mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-04-26 02:39:38 -05:00
Fix timing of freeze thaws (#8453)
This commit is contained in:
parent
f2c9483496
commit
25910ed66d
|
|
@ -101,8 +101,13 @@ export const Conditions: {[k: string]: ConditionData} = {
|
|||
pokemon.setStatus('');
|
||||
}
|
||||
},
|
||||
onHit(target, source, move) {
|
||||
if (move.thawsTarget || move.type === 'Fire' && move.category !== 'Status') {
|
||||
onAfterMoveSecondary(target, source, move) {
|
||||
if (move.thawsTarget) {
|
||||
target.cureStatus();
|
||||
}
|
||||
},
|
||||
onDamagingHit(damage, target, source, move) {
|
||||
if (move.type === 'Fire' && move.category !== 'Status') {
|
||||
target.cureStatus();
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ export const Conditions: {[k: string]: ModdedConditionData} = {
|
|||
return false;
|
||||
},
|
||||
onModifyMove() {},
|
||||
onHit() {},
|
||||
onDamagingHit() {},
|
||||
onAfterMoveSecondary(target, source, move) {
|
||||
if ((move.secondary && move.secondary.status === 'brn') || move.statusRoll === 'brn') {
|
||||
target.cureStatus();
|
||||
|
|
|
|||
|
|
@ -38,9 +38,9 @@ export const Conditions: {[k: string]: ModdedConditionData} = {
|
|||
},
|
||||
frz: {
|
||||
inherit: true,
|
||||
onHit(target, source, move) {
|
||||
onDamagingHit(damage, target, source, move) {
|
||||
// don't count Hidden Power or Weather Ball as Fire-type
|
||||
if (move.thawsTarget || this.dex.moves.get(move.id).type === 'Fire' && move.category !== 'Status') {
|
||||
if (this.dex.moves.get(move.id).type === 'Fire' && move.category !== 'Status') {
|
||||
target.cureStatus();
|
||||
}
|
||||
},
|
||||
|
|
|
|||
|
|
@ -43,4 +43,30 @@ describe('Sheer Force', function () {
|
|||
battle.makeChoices('move bodyslam', 'move rest');
|
||||
assert.equal(battle.p1.active[0].hp, battle.p1.active[0].maxhp);
|
||||
});
|
||||
|
||||
it(`should not be possible to thaw a frozen target with a Sheer Force-boosted thawsTarget move`, function () {
|
||||
battle = common.createBattle([[
|
||||
{species: 'wynaut', ability: 'sheerforce', moves: ['sleeptalk', 'scald']},
|
||||
], [
|
||||
{species: 'shuckle', moves: ['meteorassault']},
|
||||
]]);
|
||||
battle.makeChoices(); // Use Meteor Assault to force recharge next turn and skip potential thaw
|
||||
const frozenMon = battle.p2.active[0];
|
||||
frozenMon.setStatus('frz');
|
||||
battle.makeChoices('move scald', 'auto');
|
||||
assert.equal(frozenMon.status, 'frz');
|
||||
});
|
||||
|
||||
it(`should be possible to thaw a frozen target with a Sheer Force-boosted Fire-type move`, function () {
|
||||
battle = common.createBattle([[
|
||||
{species: 'wynaut', ability: 'sheerforce', moves: ['sleeptalk', 'flamethrower']},
|
||||
], [
|
||||
{species: 'shuckle', moves: ['meteorassault']},
|
||||
]]);
|
||||
battle.makeChoices(); // Use Meteor Assault to force recharge next turn and skip potential thaw
|
||||
const frozenMon = battle.p2.active[0];
|
||||
frozenMon.setStatus('frz');
|
||||
battle.makeChoices('move flamethrower', 'auto');
|
||||
assert.equal(frozenMon.status, '');
|
||||
});
|
||||
});
|
||||
|
|
|
|||
|
|
@ -192,6 +192,19 @@ describe('Freeze', function () {
|
|||
assert.equal(battle.p1.active[0].status, 'frz');
|
||||
assert.equal(battle.p1.active[0].species.name, 'Shaymin-Sky');
|
||||
});
|
||||
|
||||
it(`should not be possible to burn a frozen target when using a move that thaws that target`, function () {
|
||||
battle = common.createBattle([[
|
||||
{species: 'wynaut', ability: 'serenegrace', item: 'widelens', moves: ['sleeptalk', 'sacredfire']},
|
||||
], [
|
||||
{species: 'shuckle', moves: ['meteorassault']},
|
||||
]]);
|
||||
battle.makeChoices(); // Use Meteor Assault to force recharge next turn and skip potential thaw
|
||||
const frozenMon = battle.p2.active[0];
|
||||
frozenMon.setStatus('frz');
|
||||
battle.makeChoices('move sacredfire', 'auto');
|
||||
assert.equal(frozenMon.status, '');
|
||||
});
|
||||
});
|
||||
|
||||
describe('Burn [Gen 6]', function () {
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user