diff --git a/Moves.json b/Moves.json index 31f037a..9fabba9 100644 --- a/Moves.json +++ b/Moves.json @@ -6877,17 +6877,6 @@ "category": "status", "flags": ["protect", "reflectable", "mirror"] }, - { - "name": "struggle", - "type": "normal", - "power": 50, - "pp": 255, - "accuracy": 0, - "priority": 0, - "target": "RandomOpponent", - "category": "physical", - "flags": ["contact", "protect"] - }, { "name": "struggle_bug", "type": "bug", diff --git a/Scripts/Moves/Struggle.as b/Scripts/Moves/Struggle.as index 1edf7e5..30c37d8 100644 --- a/Scripts/Moves/Struggle.as +++ b/Scripts/Moves/Struggle.as @@ -1,8 +1,24 @@ namespace Gen7 { [Move effect=Struggle] - shared class Struggle : PkmnScript { - void OnSecondaryEffect(ExecutingMove@ attack, Pokemon@ target, uint8 hit) override{ - attack.User.Damage(uint(attack.User.MaxHealth / 4), DamageSource::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); + } + }; } \ No newline at end of file