- 8
- Posts
- 9
- Years
- Seen Oct 9, 2019
I've been updating my game with a lot of the Gen 7 moves and abilities. I did find one for Shell Trap, but would like to tweak it slightly. Currently the one that I found by BlackOutG5 does fixed damage. How would I go about changing this to do the standard damage calculation after confirming the counter works?
Spoiler:
################################################################################
# Counters a physical move used against the user this round, with an explosion.
# (Shell Trap)
################################################################################
class PokeBattle_Move_214 < PokeBattle_Move
def pbAddTarget(targets,attacker)
if attacker.effects[PBEffects::ShellTrap]>=0 &&
attacker.pbIsOpposing?(attacker.effects[PBEffects::ShellTrap])
if !attacker.pbAddTarget(targets,@battle.battlers[attacker.effects[PBEffects::ShellTrap]])
attacker.pbRandomTarget(targets)
end
end
end
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if attacker.effects[PBEffects::Counter]<=0 || !opponent
@battle.pbDisplay(_INTL("Shell Trap failed!"))
return -1
end
ret=pbEffectFixedDamage(150,attacker,opponent,hitnum,alltargets,showanimation)
return ret
end
end
# Counters a physical move used against the user this round, with an explosion.
# (Shell Trap)
################################################################################
class PokeBattle_Move_214 < PokeBattle_Move
def pbAddTarget(targets,attacker)
if attacker.effects[PBEffects::ShellTrap]>=0 &&
attacker.pbIsOpposing?(attacker.effects[PBEffects::ShellTrap])
if !attacker.pbAddTarget(targets,@battle.battlers[attacker.effects[PBEffects::ShellTrap]])
attacker.pbRandomTarget(targets)
end
end
end
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if attacker.effects[PBEffects::Counter]<=0 || !opponent
@battle.pbDisplay(_INTL("Shell Trap failed!"))
return -1
end
ret=pbEffectFixedDamage(150,attacker,opponent,hitnum,alltargets,showanimation)
return ret
end
end