mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-08 13:44:59 +00:00
Added Gen 9 forms code, evolution code, some item effects
This commit is contained in:
@@ -252,8 +252,10 @@ class Pokemon
|
||||
# @param value [Integer] new HP value
|
||||
def hp=(value)
|
||||
@hp = value.clamp(0, @totalhp)
|
||||
heal_status if @hp == 0
|
||||
@ready_to_evolve = false if @hp == 0
|
||||
return if @hp > 0
|
||||
heal_status
|
||||
@ready_to_evolve = false
|
||||
@evolution_counter = 0 if isSpecies?(:BASCULIN) || isSpecies?(:YAMASK)
|
||||
end
|
||||
|
||||
# Sets this Pokémon's status. See {GameData::Status} for all possible status effects.
|
||||
@@ -988,6 +990,16 @@ class Pokemon
|
||||
end
|
||||
end
|
||||
|
||||
# Checks whether this Pokemon can evolve because of levelling up in battle.
|
||||
# This also checks call_level_up as above.
|
||||
# @return [Symbol, nil] the ID of the species to evolve into
|
||||
def check_evolution_on_battle_level_up
|
||||
return check_evolution_internal do |pkmn, new_species, method, parameter|
|
||||
success = GameData::Evolution.get(method).call_battle_level_up(pkmn, parameter)
|
||||
next (success) ? new_species : nil
|
||||
end
|
||||
end
|
||||
|
||||
# Checks whether this Pokemon can evolve because of using an item on it.
|
||||
# @param item_used [Symbol, GameData::Item, nil] the item being used
|
||||
# @return [Symbol, nil] the ID of the species to evolve into
|
||||
|
||||
Reference in New Issue
Block a user