No, he wants to make an ability that always leaves the user with at least 1 HP, regardless of how much damage the move should have done. No restriction that the Pokemon needed to be at full health to trigger it, which means it triggers forever and the Pokemon cannot be killed. Think of it less like Sturdy and more like an infinite Endure.
Endure is found on line 1168 of the script section PokeBattle_Move. By adding in the red lines, you have your ability as described:
Code:
if @function==0xE9 # False Swipe
damage=damage-1
[COLOR="Red"]elsif opponent.hasWorkingAbility(:GODSENDURANCE)
damage=damage-1[/COLOR]
elsif opponent.effects[PBEffects::Endure]
damage=damage-1
opponent.damagestate.endured=true
PBDebug.log("[Lingering effect triggered] #{opponent.pbThis}'s Endure")
elsif damage==opponent.totalhp
if opponent.hasWorkingAbility(:STURDY) && !attacker.hasMoldBreaker
opponent.damagestate.sturdy=true
damage=damage-1
PBDebug.log("[Ability triggered] #{opponent.pbThis}'s Sturdy")
elsif opponent.hasWorkingItem(:FOCUSSASH) && opponent.hp==opponent.totalhp
opponent.damagestate.focussash=true
damage=damage-1
PBDebug.log("[Item triggered] #{opponent.pbThis}'s Focus Sash")
elsif opponent.hasWorkingItem(:FOCUSBAND) && @battle.pbRandom(10)==0
opponent.damagestate.focusband=true
damage=damage-1
PBDebug.log("[Item triggered] #{opponent.pbThis}'s Focus Band")
end
end
Note, however, that abilities like this still leave the Pokemon vulnerable to certain things that can kill them:
- Poison damage, unless the Pokemon is Poison type and was not poisoned by a Pokemon with the ability Corrosion
- Burn damage, unless the Pokemon is Fire type
- Nightmare damage
- hail damage, unless the Pokemon is Ice or Steel type
- sandstorm damage, unless the Pokemon is Rock, Ground, or Steel type
- Shadow Sky damage, unless the Pokemon is a Shadow Pokemon.