Gen7Data/Scripts/Moves/Struggle.as

24 lines
743 B
ActionScript

namespace Gen7 {
[Move effect=Struggle]
class Struggle : PkmnScript {
void ChangeEffectiveness(ExecutingMove@, Pokemon@, uint8, float &inout eff) override {
eff = 1;
}
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);
}
};
}