- 6
- Posts
- 8
- Years
- Seen Dec 1, 2016
I'm not sure how to code "when hp drops from above 50% to below 50%". It activates whenever they take damage below 50% which isn't how it works,
I currently have:
I currently have:
Code:
if target.hasWorkingAbility(:EMERGENCYEXIT) && target.hp<=(target.totalhp/2).floor && !target.damagestate.substitute
if !target.isFainted? && @battle.pbCanChooseNonActive?(target.index) &&
[email protected]?(@battle.pbParty(target.index))
@battle.pbDisplay(_INTL("Golisopod's Emergency Exit activates!"))
@battle.pbDisplay(_INTL("Golisopod went back to {2}!",target.pbThis,@battle.pbGetOwner(target.index).name))
@battle.pbClearChoices(target.index)
newpoke=0
[email protected](target.index,true,false)
@battle.pbMessagesOnReplace(target.index,newpoke)
@battle.pbRecallAndReplace(target.index,newpoke,true)
target.pbResetForm
@battle.pbOnActiveOne(target)
target.pbAbilitiesOnSwitchIn(true)
end
end
Last edited by a moderator: