mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-08-20 16:14:34 -05:00
Fix Prankster info leak (#10065)
* Fix prankster hint so it doesn't leak info * Fix condition * Add unit test to verify there's no hint
This commit is contained in:
@@ -662,7 +662,9 @@ export class BattleActions {
|
||||
} else if (this.battle.gen >= 7 && move.pranksterBoosted && pokemon.hasAbility('prankster') &&
|
||||
!targets[i].isAlly(pokemon) && !this.dex.getImmunity('prankster', target)) {
|
||||
this.battle.debug('natural prankster immunity');
|
||||
if (!target.illusion) this.battle.hint("Since gen 7, Dark is immune to Prankster moves.");
|
||||
if (target.illusion || !(move.status && !this.dex.getImmunity(move.status, target))) {
|
||||
this.battle.hint("Since gen 7, Dark is immune to Prankster moves.");
|
||||
}
|
||||
this.battle.add('-immune', target);
|
||||
hitResults[i] = false;
|
||||
} else {
|
||||
|
||||
@@ -72,6 +72,15 @@ describe('Prankster', function () {
|
||||
assert(battle.p2.active[0].volatiles['encore'], `Meowstic should be encored`);
|
||||
assert.fullHP(battle.p1.active[0]);
|
||||
});
|
||||
|
||||
it('should not leak the ability via hint if the target is immune to the Status move', function () {
|
||||
battle = common.createBattle([
|
||||
[{species: "Sableye", ability: 'prankster', moves: ['willowisp']}],
|
||||
[{species: "Houndoom", ability: 'pressure', moves: ['willowisp']}],
|
||||
]);
|
||||
battle.makeChoices('move willowisp', 'move willowisp');
|
||||
assert.false(battle.log.some(line => line.includes('hint')), `Prankster should not leak the ability via hint`);
|
||||
});
|
||||
});
|
||||
|
||||
describe('Prankster [Gen 6]', function () {
|
||||
|
||||
Reference in New Issue
Block a user