Fixes for struggle
This commit is contained in:
parent
82ac1061fa
commit
76f62d6c2d
11
Moves.json
11
Moves.json
|
@ -6877,17 +6877,6 @@
|
||||||
"category": "status",
|
"category": "status",
|
||||||
"flags": ["protect", "reflectable", "mirror"]
|
"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",
|
"name": "struggle_bug",
|
||||||
"type": "bug",
|
"type": "bug",
|
||||||
|
|
|
@ -1,8 +1,24 @@
|
||||||
namespace Gen7 {
|
namespace Gen7 {
|
||||||
[Move effect=Struggle]
|
[Move effect=Struggle]
|
||||||
shared class Struggle : PkmnScript {
|
class Struggle : PkmnScript {
|
||||||
void OnSecondaryEffect(ExecutingMove@ attack, Pokemon@ target, uint8 hit) override{
|
void ChangeEffectiveness(ExecutingMove@, Pokemon@, uint8, float &inout eff) override {
|
||||||
attack.User.Damage(uint(attack.User.MaxHealth / 4), DamageSource::Struggle);
|
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);
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
Loading…
Reference in New Issue