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:
singiamtel
2024-01-03 06:49:13 +01:00
committed by GitHub
parent 049e648fed
commit acd02f8efd
2 changed files with 12 additions and 1 deletions

View File

@@ -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 {

View File

@@ -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 () {