- 1
- Posts
- 6
- Years
- Seen Mar 13, 2019
Hello i need help with a script for an Ice Type Move.
The move should Freeze the foe and Boost the users DEF and SDEF.
I would be realy pleased to recive any help or thoughts.
this is the code i combined off the function codes 00C and 02A
i dont know what is wrong.
only thing that works is the Stat boost.
The move should Freeze the foe and Boost the users DEF and SDEF.
I would be realy pleased to recive any help or thoughts.
this is the code i combined off the function codes 00C and 02A
################################################################################
# Freezes Target and Bossts 1Def and 1SpezDef
################################################################################
class PokeBattle_Move_159 < PokeBattle_Move
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
return super(attacker,opponent,hitnum,alltargets,showanimation) if pbIsDamaging?
return -1 if !opponent.pbCanFreeze?(attacker,true,self)
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
opponent.pbFreeze
return 0
end
def pbAdditionalEffect(attacker,opponent)
if opponent.pbCanFreeze?(attacker,false,self)
opponent.pbFreeze
return true
end
return false
end
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
if !attacker.pbCanIncreaseStatStage?(PBStats::DEFENSE,attacker,false,self) &&
!attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,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::DEFENSE,attacker,false,self)
attacker.pbIncreaseStat(PBStats::DEFENSE,1,attacker,false,self,showanim)
showanim=false
end
if attacker.pbCanIncreaseStatStage?(PBStats::SPDEF,attacker,false,self)
attacker.pbIncreaseStat(PBStats::SPDEF,1,attacker,false,self,showanim)
showanim=false
end
return 0
end
end
i dont know what is wrong.
only thing that works is the Stat boost.
Last edited: