Gen7Data/Scripts/Moves/Struggle.as

24 lines
743 B
ActionScript
Raw Normal View History

2021-03-28 18:22:46 +00:00
namespace Gen7 {
[Move effect=Struggle]
2021-04-16 12:53:35 +00:00
class Struggle : PkmnScript {
void ChangeEffectiveness(ExecutingMove@, Pokemon@, uint8, float &inout eff) override {
eff = 1;
2021-03-28 18:22:46 +00:00
}
2021-04-16 12:53:35 +00:00
void IsInvulnerable(ExecutingMove@, Pokemon@, bool &inout invul) override {
invul = false;
}
void ModifyNumberOfHits(MoveTurnChoice@, uint8 &inout hitcount) override {
hitcount = 1;
}
void OnSecondaryEffect(ExecutingMove@ attack, Pokemon@, uint8) override {
auto damage = uint(attack.User.MaxHealth / 4);
if (damage == 0){
damage = 1;
}
attack.User.Damage(damage, DamageSource::Struggle);
}
};
2021-03-28 18:22:46 +00:00
}