Skip to content

Commit d0e3531

Browse files
committed
Fix burned Explosion damage
1 parent 7279f81 commit d0e3531

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

sim/battle-actions.ts

+1
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ export class BattleActions {
124124
oldActive.statsRaisedThisTurn = false;
125125
oldActive.statsLoweredThisTurn = false;
126126
oldActive.position = pokemon.position;
127+
if (oldActive.fainted) oldActive.status = '';
127128
pokemon.position = pos;
128129
side.pokemon[pokemon.position] = pokemon;
129130
side.pokemon[oldActive.position] = oldActive;

sim/pokemon.ts

-1
Original file line numberDiff line numberDiff line change
@@ -1526,7 +1526,6 @@ export class Pokemon {
15261526
if (this.fainted || this.faintQueued) return 0;
15271527
const d = this.hp;
15281528
this.hp = 0;
1529-
this.status = '';
15301529
this.switchFlag = false;
15311530
this.faintQueued = true;
15321531
this.battle.faintQueue.push({

test/sim/misc/statuses.js

+11
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ describe('Burn', () => {
3131
assert.bounded(damage, [37, 44]);
3232
});
3333

34+
it(`should halve damage after fainting`, () => {
35+
battle = common.gen(4).createBattle([[
36+
{ species: 'Electrode', ability: 'noguard', moves: ['explosion'] },
37+
], [
38+
{ species: 'Wailord', ability: 'prankster', moves: ['willowisp'] },
39+
]]);
40+
battle.makeChoices();
41+
const wailord = battle.p2.active[0];
42+
assert.bounded(wailord.hp, [200, 300]);
43+
});
44+
3445
it('should reduce atk to 50% of its original value in Stadium', () => {
3546
// I know WoW doesn't exist in Stadium, but the engine supports future gen moves
3647
// and this is easier than digging for a seed that makes Flamethrower burn

0 commit comments

Comments
 (0)