################################################################################
# Fails if the target didn't chose a damaging move to use this round, or has
# already moved. (Sucker Punch)
################################################################################
class PokeBattle_Move_116 < PokeBattle_Move
def pbMoveFailed(attacker,opponent)
return true if @battle.choices[opponent.index][0]!=1 # Didn't choose a move
[email protected][opponent.index][2]
return true if !oppmove || oppmove.id<=0 || oppmove.pbIsStatus?
return true if opponent.hasMovedThisRound? && oppmove.function!=0xB0 # Me First
return false
end
end
################################################################################
# Power increases the heavier the user is than the target. (Heat Crash, Heavy Slam)
################################################################################
class PokeBattle_Move_09B < PokeBattle_Move
def pbBaseDamage(basedmg,attacker,opponent)
n=(attacker.weight/opponent.weight(attacker)).floor
ret=40
ret=60 if n>=2
ret=80 if n>=3
ret=100 if n>=4
ret=120 if n>=5
return ret
end
end
class PokeBattle_Move_[COLOR="red"]###[/COLOR] < PokeBattle_Move
Burn your neurons and edit Sucker Punch for what you want:
Code:################################################################################ # Fails if the target didn't chose a damaging move to use this round, or has # already moved. (Sucker Punch) ################################################################################ class PokeBattle_Move_116 < PokeBattle_Move def pbMoveFailed(attacker,opponent) return true if @battle.choices[opponent.index][0]!=1 # Didn't choose a move [email protected][opponent.index][2] return true if !oppmove || oppmove.id<=0 || oppmove.pbIsStatus? return true if opponent.hasMovedThisRound? && oppmove.function!=0xB0 # Me First return false end end
Check Heavy Slam's code to recognize the weight:
Code:################################################################################ # Power increases the heavier the user is than the target. (Heat Crash, Heavy Slam) ################################################################################ class PokeBattle_Move_09B < PokeBattle_Move def pbBaseDamage(basedmg,attacker,opponent) n=(attacker.weight/opponent.weight(attacker)).floor ret=40 ret=60 if n>=2 ret=80 if n>=3 ret=100 if n>=4 ret=120 if n>=5 return ret end end
Good luck.
Also, this might go without saying, but make sure to assign a unique code to it as well. In the scripts where move functions are defined, you'll see this pattern at the start:
where ### is the actual function code - the one that you would assign to the move in the PBS. It's a three digit hexadecimal number. Base essentials goes up to 158 with function codes, so the next available would be 159, then 15A, up to 15F, then 160. But they don't have to be sequential. You could just start up at 500 and guarantee that you're not overriding another code.Code:class PokeBattle_Move_[COLOR="red"]###[/COLOR] < PokeBattle_Move
And sorry if this is all stuff you're aware of - just trying to provide a thorough answer and maybe help out someone else who comes across this post in the future.
################################################################################
# Fails if the target is heavier than the user. (Sky Lunge)
################################################################################
class PokeBattle_Move_15A < PokeBattle_Move
def pbMoveFailed(attacker,opponent)
return (attacker.weight<opponent.weight)
end
Pay attention, you need to put 'return true if' and then 'return false', like you saw in Sucker Punch. Also, you don't need '()' between code.
class PokeBattle_Move_15A < PokeBattle_Move
def pbMoveFailed(attacker,opponent)
return [COLOR="red"]((attacker.weight<opponent.weight) rescue false)[/COLOR]
end
Pay attention, you need to put 'return true if' and then 'return false', like you saw in Sucker Punch. Also, you don't need '()' between code.
Actually, I think that syntax is fine since (attacker.weight<opponent.weight) will already be a boolean value. The only change I might add is
just to catch any errors.Code:class PokeBattle_Move_15A < PokeBattle_Move def pbMoveFailed(attacker,opponent) return [COLOR="red"]((attacker.weight<opponent.weight) rescue false)[/COLOR] end