- 19
- Posts
- 6
- Years
- Seen Oct 12, 2018
So I'm trying to add an ability that recovers health at the end of the turn. I've tried using Ingrain's information but changing it to if i.hasWorkingAbility(:TIMEMACHINE) instead like below, but that caused a syntax error when I put it below ingrain and the same thing when I tried putting it under intimidate. Then I tried to modify Ice Body's information by getting rid of the "if hail' part basically, and that's what I have below. But no matter what I do, I can't seem to get this dang ability to work. Can anyone help out? Or if you have a similar ability, could you explain how you did it? Thanks in advanced.
# Intimidate
if self.hasWorkingAbility(:INTIMIDATE) && onactive
PBDebug.log("[Ability triggered] #{pbThis}'s Intimidate")
for i in 0...4
if pbIsOpposing?(i) && [email protected].fainted?
@battle.battlers.pbReduceAttackStatIntimidate(self)
end
end
end
# Time Machine
if i.hasWorkingAbility(:TIMEMACHINE)
i.effects[PBEffects::HealBlock]==0
PBDebug.log("[Ability triggered] #{i.pbThis}'s Time Machine")
hpgain=i.pbRecoverHP((i.totalhp/8).floor,true)
pbDisplay(_INTL("{1}'s {2} reversed time and restored a little HP!",i.pbThis,PBAbilities.getName(i.ability))) if hpgain>0
if i.fainted?
return if !i.pbFaint
end
end
# Download
Last edited: