mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-03-21 17:25:10 -05:00
Correct Weakness Policy mechanics
And added relevant Burning Jealousy tests.
This commit is contained in:
parent
b9df40c5af
commit
2b0c77939f
|
|
@ -6658,12 +6658,8 @@ export const Items: {[itemid: string]: ItemData} = {
|
|||
fling: {
|
||||
basePower: 80,
|
||||
},
|
||||
onHitPriority: 1,
|
||||
onHit(target, source, move) {
|
||||
if (
|
||||
target.hp && move.category !== 'Status' && !move.damage &&
|
||||
!move.damageCallback && target.getMoveHitData(move).typeMod > 0
|
||||
) {
|
||||
onDamagingHit(damage, target, source, move) {
|
||||
if (!move.damage && !move.damageCallback && target.getMoveHitData(move).typeMod > 0) {
|
||||
target.useItem();
|
||||
}
|
||||
},
|
||||
|
|
|
|||
42
test/sim/moves/burningjealousy.js
Normal file
42
test/sim/moves/burningjealousy.js
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
'use strict';
|
||||
|
||||
const assert = require('./../../assert');
|
||||
const common = require('./../../common');
|
||||
|
||||
let battle;
|
||||
|
||||
describe('Burning Jealousy', function () {
|
||||
afterEach(function () {
|
||||
battle.destroy();
|
||||
});
|
||||
|
||||
it(`should burn a target whose stats were raised this turn`, function () {
|
||||
battle = common.createBattle([[
|
||||
{species: "Mew", moves: ['dragondance']},
|
||||
], [
|
||||
{species: "Torkoal", moves: ['burningjealousy']},
|
||||
]]);
|
||||
battle.makeChoices('move dragondance', 'move burningjealousy');
|
||||
assert.equal(battle.p1.active[0].status, 'brn');
|
||||
});
|
||||
|
||||
it(`should not burn a target whose stats were raised after the attack`, function () {
|
||||
battle = common.createBattle([[
|
||||
{species: "Ninetales", moves: ['burningjealousy']},
|
||||
], [
|
||||
{species: "Magearna", item: 'weaknesspolicy', moves: ['imprison']},
|
||||
]]);
|
||||
battle.makeChoices('move burningjealousy', 'move imprison');
|
||||
assert.equal(battle.p2.active[0].status, '');
|
||||
});
|
||||
|
||||
it(`should be affected by Sheer Force`, function () {
|
||||
battle = common.createBattle([[
|
||||
{species: "Cobalion", moves: ['swordsdance']},
|
||||
], [
|
||||
{species: "Darmanitan", ability: 'sheerforce', item: 'kingsrock', moves: ['burningjealousy']},
|
||||
]]);
|
||||
battle.makeChoices('move swordsdance', 'move burningjealousy');
|
||||
assert.equal(battle.p1.active[0].status, '');
|
||||
});
|
||||
});
|
||||
Loading…
Reference in New Issue
Block a user