Telemetius
Tele*
- 256
- Posts
- 10
- Years
- Italy
- Seen Jan 9, 2022
I've encountered this problem multiple times and I feel like I'm doing something wrong.
Let's say I make a new simple move, something that behaves like hyper beam and that it's flying type.
As an additional effect this move deals double damage if the enemy is of flying type.
I want the player to know that the move is dealing an additional damage, so why if I use this code:
The message is shown and if I use this one:
Nothing appears at all? Is there something wrong with the utility pbhastype?
Let's say I make a new simple move, something that behaves like hyper beam and that it's flying type.
As an additional effect this move deals double damage if the enemy is of flying type.
I want the player to know that the move is dealing an additional damage, so why if I use this code:
Code:
class PokeBattle_Move_13A < PokeBattle_Move
def pbBaseDamage(basedmg,attacker,opponent)
[COLOR="Red"]if opponent.pbHasType?(:FLYING)
@battle.pbDisplay(_INTL("Double damage!"))[/COLOR]
return basedmg*2
end
return basedmg
end
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
ret=super(attacker,opponent,hitnum,alltargets,showanimation)
if opponent.damagestate.calcdamage>0
attacker.effects[PBEffects::HyperBeam]=2
attacker.currentMove=@id
end
return ret
end
end
The message is shown and if I use this one:
Code:
class PokeBattle_Move_13A < PokeBattle_Move
def pbBaseDamage(basedmg,attacker,opponent)
if opponent.pbHasType?(:FLYING)
return basedmg*2
end
return basedmg
end
def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
pbShowAnimation(@id,attacker,opponent,hitnum,alltargets,showanimation)
ret=super(attacker,opponent,hitnum,alltargets,showanimation)
if opponent.damagestate.calcdamage>0
attacker.effects[PBEffects::HyperBeam]=2
attacker.currentMove=@id
end
[COLOR="red"] if opponent.pbHasType?(:FLYING)
@battle.pbDisplay(_INTL("Double damage!"))
end[/COLOR]
return ret
end
end
Nothing appears at all? Is there something wrong with the utility pbhastype?