- 5
- Posts
- 4
- Years
- Seen Mar 13, 2021
I'm trying to create a new signature move for a Pokemon I'll be creating for a custom game of mine. However, the attempts at the script have, so far, given me nothing but syntax errors.
I will admit that Ruby is sort of like gibberish to me right now, but I understand how 'end' works, and it seems I have enough to fully close the script.
I assume that this isn't a very efficient way of coding this move in (heals both active 'mons on the user's side by 1/3rd if applicable), since I have two pbDisplay calls one after another and a seemingly imbalanced amount of 'return' codes.
I will admit that Ruby is sort of like gibberish to me right now, but I understand how 'end' works, and it seems I have enough to fully close the script.
Code:
################################################################################
# Heals the user and their ally by 1/3 of their respective max HP. (Divine Order)
################################################################################
class PokeBattle_Move_17B < PokeBattle_Move
def isHealingMove?
return true
end
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if attacker.hp==attacker.totalhp && if attacker.pbPartner.hp==attacker.pbPartner.totalhp
@battle.pbDisplay(_INTL("{1}'s HP is full!",attacker.pbThis))
@battle.pbDisplay(_INTL("{2}'s HP is full!",attacker.pbPartner.pbThis(true)))
return -1
end
pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
attacker.pbRecoverHP(((attacker.totalhp+1)/3).floor,true)
@battle.pbDisplay(_INTL("{1}'s HP was restored.",attacker.pbThis))
if attacker.pbPartner && !attacker.pbPartner.fainted?
attacker.pbPartner.pbRecoverHP((attacker.pbPartner.totalhp/3).floor,true)
@battle.pbDisplay(_INTL("{2}'s HP was restored.",attacker.pbPartner.pbThis(true)))
return 0
end
end
end
I assume that this isn't a very efficient way of coding this move in (heals both active 'mons on the user's side by 1/3rd if applicable), since I have two pbDisplay calls one after another and a seemingly imbalanced amount of 'return' codes.