Fixed bug with Neutralizing Gas, fixed typo

This commit is contained in:
Maruno17
2021-10-19 17:39:27 +01:00
parent aee0595d3f
commit 837208792a
2 changed files with 5 additions and 4 deletions

View File

@@ -338,15 +338,16 @@ class PokeBattle_Battler
# active, and the code for the two combined would cause an infinite loop # active, and the code for the two combined would cause an infinite loop
# (regardless of whether any Pokémon actually has either the ability or # (regardless of whether any Pokémon actually has either the ability or
# the item - the code existing is enough to cause the loop). # the item - the code existing is enough to cause the loop).
def abilityActive?(ignore_fainted = false) def abilityActive?(ignore_fainted = false, check_ability = nil)
return false if fainted? && !ignore_fainted return false if fainted? && !ignore_fainted
return false if @effects[PBEffects::GastroAcid] return false if @effects[PBEffects::GastroAcid]
return false if self.ability != :NEUTRALIZINGGAS && @battle.pbCheckGlobalAbility(:NEUTRALIZINGGAS) return false if check_ability != :NEUTRALIZINGGAS && self.ability != :NEUTRALIZINGGAS &&
@battle.pbCheckGlobalAbility(:NEUTRALIZINGGAS)
return true return true
end end
def hasActiveAbility?(check_ability, ignore_fainted = false) def hasActiveAbility?(check_ability, ignore_fainted = false)
return false if !abilityActive?(ignore_fainted) return false if !abilityActive?(ignore_fainted, check_ability)
return check_ability.include?(@ability_id) if check_ability.is_a?(Array) return check_ability.include?(@ability_id) if check_ability.is_a?(Array)
return self.ability == check_ability return self.ability == check_ability
end end

View File

@@ -1865,7 +1865,7 @@ BattleHandlers::UserAbilityEndOfMove.add(:MAGICIAN,
end end
user.item = b.item user.item = b.item
b.item = nil b.item = nil
b.effects[PBEffects::Unburden] = true if n.hasActiveAbility?(:UNBURDEN) b.effects[PBEffects::Unburden] = true if b.hasActiveAbility?(:UNBURDEN)
if battle.wildBattle? && !user.initialItem && user.item == b.initialItem if battle.wildBattle? && !user.initialItem && user.item == b.initialItem
user.setInitialItem(user.item) user.setInitialItem(user.item)
b.setInitialItem(nil) b.setInitialItem(nil)