Skip to content

Commit

Permalink
Battle: Fix interaction with Shed Tail
Browse files Browse the repository at this point in the history
  • Loading branch information
AgustinSRG committed Aug 26, 2023
1 parent 6e8552c commit a4f1030
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/bot-modules/battle/battle-ai/battle-data.js
Original file line number Diff line number Diff line change
Expand Up @@ -360,6 +360,7 @@ exports.setup = function (App) {
this.boosts = Object.create(null);

this.passing = false;
this.passingSubstitute = false;
this.prepared = null;

this.helpers = Object.create(null);
Expand Down
8 changes: 8 additions & 0 deletions src/bot-modules/battle/battle-ai/battle-majors.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,11 @@ exports.setup = function (App, BattleData) {
for (let vol in active.volatiles) poke.addVolatile(vol);
for (let b in active.boosts) poke.boosts[b] = active.boosts[b];
active.passing = false;
active.passingSubstitute = false;
} else if (active.passingSubstitute && active.passingSubstitute === this.turn) {
poke.addVolatile('substitute');
active.passing = false;
active.passingSubstitute = false;
}
active.removeAllVolatiles();
active.removeAllBoosts();
Expand All @@ -281,6 +286,7 @@ exports.setup = function (App, BattleData) {
poke.fainted = true;
poke.active = false;
poke.passing = false;
poke.passingSubstitute = false;
poke.hp = 0;
poke.tera = '';
if (!isIntro) this.message("faint", det.side, poke.name);
Expand Down Expand Up @@ -340,6 +346,8 @@ exports.setup = function (App, BattleData) {
}
if (move.id === 'batonpass') {
poke.passing = this.turn;
} else if (move.id === 'shedtail') {
poke.passingSubstitute = this.turn;
}
if (!noDeductPP && kwargs.from !== 'lockedmove') {
if (args[1] !== args[3] && poke2 && poke2.ability && poke2.ability.id === "pressure") {
Expand Down

0 comments on commit a4f1030

Please sign in to comment.