################################################################################
# Deals damage. If target has already moved, its ability will be supressed.
# (Core Enforcer)
################################################################################
class PokeBattle_Move_CF21 < PokeBattle_Move
def pbEffectAfterHit(attacker,opponent,turneffects)
if opponent.hasMovedThisRound?
if opponent.effects[PBEffects::Substitute]>0 && !ignoresSubstitute?(attacker)
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
if isConst?(opponent.ability,PBAbilities,:MULTITYPE) ||
isConst?(opponent.ability,PBAbilities,:STANCECHANGE) ||
isConst?(opponent.ability,PBAbilities,:SCHOOLING) ||
isConst?(opponent.ability,PBAbilities,:COMATOSE) ||
isConst?(opponent.ability,PBAbilities,:SHIELDSDOWN) ||
isConst?(opponent.ability,PBAbilities,:DISGUISE) ||
isConst?(opponent.ability,PBAbilities,:RKSSYSTEM) ||
isConst?(opponent.ability,PBAbilities,:BATTLEBOND) ||
isConst?(opponent.ability,PBAbilities,:POWERCONSTRUCT)
return -1
end
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
oldabil=opponent.ability
opponent.effects[PBEffects::GastroAcid]=true
opponent.effects[PBEffects::Truant]=false
@battle.pbDisplay(_INTL("{1}'s Ability was suppressed!",opponent.pbThis))
if opponent.effects[PBEffects::Illusion] && isConst?(oldabil,PBAbilities,:ILLUSION)
PBDebug.log("[Ability triggered] #{opponent.pbThis}'s Illusion ended")
opponent.effects[PBEffects::Illusion]=nil
@battle.scene.pbChangePokemon(opponent,opponent.pokemon)
@battle.pbDisplay(_INTL("{1}'s {2} wore off!",opponent.pbThis,PBAbilities.getName(oldabil)))
end
return 0
end
end
end