mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
Fixes abilities activating twice
This commit is contained in:
@@ -730,6 +730,7 @@ class PokemonFusionScene
|
|||||||
@pokemon1.steps_to_hatch = @pokemon1.species_data.hatch_steps
|
@pokemon1.steps_to_hatch = @pokemon1.species_data.hatch_steps
|
||||||
end
|
end
|
||||||
#@pokemon1.ability = pbChooseAbility(@pokemon1, hiddenAbility1, hiddenAbility2)
|
#@pokemon1.ability = pbChooseAbility(@pokemon1, hiddenAbility1, hiddenAbility2)
|
||||||
|
#
|
||||||
pbChooseAbility(@pokemon1, hiddenAbility1, hiddenAbility2)
|
pbChooseAbility(@pokemon1, hiddenAbility1, hiddenAbility2)
|
||||||
|
|
||||||
setFusionMoves(@pokemon1, @pokemon2, firstOptionSelected) if !noMoves
|
setFusionMoves(@pokemon1, @pokemon2, firstOptionSelected) if !noMoves
|
||||||
|
|||||||
@@ -19,10 +19,12 @@ class PokeBattle_Battler
|
|||||||
|
|
||||||
#Secondary ability utility methods for battlers class
|
#Secondary ability utility methods for battlers class
|
||||||
def ability2
|
def ability2
|
||||||
|
return nil if !$game_switches[SWITCH_DOUBLE_ABILITIES]
|
||||||
return GameData::Ability.try_get(@ability2_id)
|
return GameData::Ability.try_get(@ability2_id)
|
||||||
end
|
end
|
||||||
|
|
||||||
def ability2=(value)
|
def ability2=(value)
|
||||||
|
return if !$game_switches[SWITCH_DOUBLE_ABILITIES]
|
||||||
new_ability = GameData::Ability.try_get(value)
|
new_ability = GameData::Ability.try_get(value)
|
||||||
@ability2_id = (new_ability) ? new_ability.id : nil
|
@ability2_id = (new_ability) ? new_ability.id : nil
|
||||||
end
|
end
|
||||||
@@ -42,6 +44,7 @@ class PokeBattle_Battler
|
|||||||
end
|
end
|
||||||
|
|
||||||
def hasActiveAbilityDouble?(check_ability, ignore_fainted = false)
|
def hasActiveAbilityDouble?(check_ability, ignore_fainted = false)
|
||||||
|
return false if !$game_switches[SWITCH_DOUBLE_ABILITIES]
|
||||||
return false if !abilityActive?(ignore_fainted)
|
return false if !abilityActive?(ignore_fainted)
|
||||||
if check_ability.is_a?(Array)
|
if check_ability.is_a?(Array)
|
||||||
return check_ability.include?(@ability_id) || check_ability.include?(@ability2_id)
|
return check_ability.include?(@ability_id) || check_ability.include?(@ability2_id)
|
||||||
@@ -148,15 +151,18 @@ class Pokemon
|
|||||||
|
|
||||||
#Secondary ability utility methods for pokemon class
|
#Secondary ability utility methods for pokemon class
|
||||||
def ability2_index
|
def ability2_index
|
||||||
|
return nil if !$game_switches[SWITCH_DOUBLE_ABILITIES]
|
||||||
@ability2_index = (@personalID & 1) if !@ability2_index
|
@ability2_index = (@personalID & 1) if !@ability2_index
|
||||||
return @ability2_index
|
return @ability2_index
|
||||||
end
|
end
|
||||||
|
|
||||||
def ability2
|
def ability2
|
||||||
|
return nil if !$game_switches[SWITCH_DOUBLE_ABILITIES]
|
||||||
return GameData::Ability.try_get(ability2_id())
|
return GameData::Ability.try_get(ability2_id())
|
||||||
end
|
end
|
||||||
|
|
||||||
def ability2=(value)
|
def ability2=(value)
|
||||||
|
return if !$game_switches[SWITCH_DOUBLE_ABILITIES]
|
||||||
return if value && !GameData::Ability.exists?(value)
|
return if value && !GameData::Ability.exists?(value)
|
||||||
@ability2 = (value) ? GameData::Ability.get(value).id : value
|
@ability2 = (value) ? GameData::Ability.get(value).id : value
|
||||||
end
|
end
|
||||||
@@ -183,6 +189,7 @@ class Pokemon
|
|||||||
end
|
end
|
||||||
|
|
||||||
def ability2_id
|
def ability2_id
|
||||||
|
return nil if !$game_switches[SWITCH_DOUBLE_ABILITIES]
|
||||||
if !@ability2
|
if !@ability2
|
||||||
sp_data = species_data
|
sp_data = species_data
|
||||||
abil_index = ability_index
|
abil_index = ability_index
|
||||||
@@ -244,10 +251,6 @@ class PokemonFusionScene
|
|||||||
if scene.hasNickname
|
if scene.hasNickname
|
||||||
@pokemon1.name = scene.nickname
|
@pokemon1.name = scene.nickname
|
||||||
end
|
end
|
||||||
|
|
||||||
p @pokemon1.ability.real_name
|
|
||||||
p @pokemon1.ability2.real_name
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
Reference in New Issue
Block a user