- 5
- Posts
- 6
- Years
- Seen Mar 25, 2020
I'm trying to make a move that heals the user and increases its accuracy and evasion. So, I'm trying to combine the functions of recover and a move I already made which increases accuracy and evasion. So the function looks like this:
I tried messing around with it but no matter what I do, the move only either heals or boosts acc/eva, not both. What am I doing wrong?
Code:
class PokeBattle_Move_161 < PokeBattle_Move
def isHealingMove?
return true
end
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if attacker.hp==attacker.totalhp
@battle.pbDisplay(_INTL("{1}'s HP is full!",attacker.pbThis))
return -1
end
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
attacker.pbRecoverHP(((attacker.totalhp+1)/2).floor,true)
@battle.pbDisplay(_INTL("{1}'s HP was restored.",attacker.pbThis))
return 0
end
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if !attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self) &&
!attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
@battle.pbDisplay(_INTL("{1}'s stats won't go any higher!",attacker.pbThis))
return -1
end
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
showanim=true
if attacker.pbCanIncreaseStatStage?(PBStats::EVASION,attacker,false,self)
attacker.pbIncreaseStat(PBStats::EVASION,1,attacker,false,self,showanim)
showanim=false
end
if attacker.pbCanIncreaseStatStage?(PBStats::ACCURACY,attacker,false,self)
attacker.pbIncreaseStat(PBStats::ACCURACY,1,attacker,false,self,showanim)
showanim=false
end
return 0
end
end
I tried messing around with it but no matter what I do, the move only either heals or boosts acc/eva, not both. What am I doing wrong?