- 67
- Posts
- 4
- Years
- He/Him
- Seen Nov 16, 2023
################################################################################
# Inflicts Shock if ally or user is Electric
################################################################################
class PokeBattle_Move_231 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if pbIsDamaging?
ret=super(attacker,opponent,hitnum,alltargets,showanimation)
return ret
else
if pbTypeModifier(type,attacker,opponent)==0
@battle.pbDisplay(_INTL("It doesn't affect {1}...",opponent.pbThis(true)))
return -1
end
return -1 if pbTypeImmunityByAbility(pbType(@type,attacker,opponent),attacker,opponent)
return -1 if !opponent.pbCanShock?(attacker,true,self)
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
opponent.pbShock(attacker)
return 0
end
return -1
end
def pbAdditionalEffect(attacker,opponent)
if attacker.pbHasType?(:ELECTRIC) || attacker.pbPartner.pbHasType?(:ELECTRIC)
return if opponent.damagestate.substitute
if opponent.pbCanShock?(attacker,false,self)
opponent.pbShock(attacker)
end
end
end
end
# Inflicts Shock if ally or user is Electric
################################################################################
class PokeBattle_Move_231 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if pbIsDamaging?
ret=super(attacker,opponent,hitnum,alltargets,showanimation)
return ret
else
if pbTypeModifier(type,attacker,opponent)==0
@battle.pbDisplay(_INTL("It doesn't affect {1}...",opponent.pbThis(true)))
return -1
end
return -1 if pbTypeImmunityByAbility(pbType(@type,attacker,opponent),attacker,opponent)
return -1 if !opponent.pbCanShock?(attacker,true,self)
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
opponent.pbShock(attacker)
return 0
end
return -1
end
def pbAdditionalEffect(attacker,opponent)
if attacker.pbHasType?(:ELECTRIC) || attacker.pbPartner.pbHasType?(:ELECTRIC)
return if opponent.damagestate.substitute
if opponent.pbCanShock?(attacker,false,self)
opponent.pbShock(attacker)
end
end
end
end