GajeelRedfox99
Pokémon Fantasy Developer
- 24
- Posts
- 9
- Years
- Everywhere
- Seen Feb 1, 2023
I've been trying to create a new ability that throws stealth rocks onto the field when the pokémon with the ability enters the battlefield. I added it just underneath the BREAK abilities I asked about a couple of weeks ago. No error message pops up, the ability just doesn't trigger. This is what I'm trying to work with:
Thanks ~ Gajeel
Can you help me out please? And instead of just posting the proper code, can you guide me through what you've done, whether in the reply or in comments in the code itself. There are spaces inbetween the : and the S of stealth rock, as it puts an emoji there otherwise...#Break Ground
if self.hasWorkingAbility(:BREAKGROUND) && onactive
PBDebug.log("#[pbthis]: can BREAK the ground with it's immence strength!]")
for i in 0...4
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if attacker.pbOpposingSide.effects[PBEffects:: StealthRock]
@battle.pbDisplay(_INTL("But it failed!"))
return -1
end
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
attacker.pbOpposingSide.effects[PBEffects:: StealthRock]=true
if [email protected]?(attacker.index)
@battle.pbDisplay(_INTL("Pointed stones float in the air around the opposing team!"))
else
@battle.pbDisplay(_INTL("Pointed stones float in the air around your team!"))
end
return 0
end
end
end
Thanks ~ Gajeel
Last edited by a moderator: