- 5
- Posts
- 12
- Years
- Seen Jan 8, 2023
Hi,
I'm trying to make an ability that on switch in check the opponent's stats like Download does, but I wanted to make it so that if the user is faster than the opponent they get a stat boost. I'm struggling to figure out how to get the ability to check the Pokemon's speed stats and determine who is faster. I have the code to raise the stat (it's just Intrepid Sword at this point) but I just wanted the condition on it. Would love any help. Thanks.
BattleHandlers::AbilityOnSwitchIn.add(:JUSTIFICATION,
proc { |ability,battler,battle|
battler.pbRaiseStatStageByAbility(:ATTACK,1,battler)
}
)
I'm trying to make an ability that on switch in check the opponent's stats like Download does, but I wanted to make it so that if the user is faster than the opponent they get a stat boost. I'm struggling to figure out how to get the ability to check the Pokemon's speed stats and determine who is faster. I have the code to raise the stat (it's just Intrepid Sword at this point) but I just wanted the condition on it. Would love any help. Thanks.
BattleHandlers::AbilityOnSwitchIn.add(:JUSTIFICATION,
proc { |ability,battler,battle|
battler.pbRaiseStatStageByAbility(:ATTACK,1,battler)
}
)