mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-04-25 15:38:27 -05:00
Fix Psychic Noise's interaction with Life Dew (#10892)
* Fix Psychic Noise's interaction with Life Dew * Add FIXME comment * Remove unreachable code * Update to ESLint 9
This commit is contained in:
parent
4346e3d34c
commit
f2736e1a3f
|
|
@ -8623,7 +8623,13 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = {
|
|||
this.add('-end', pokemon, 'move: Heal Block');
|
||||
},
|
||||
onTryHeal(damage, target, source, effect) {
|
||||
if ((effect?.id === 'zpower') || this.effectState.isZ) return damage;
|
||||
if (effect && (effect.id === 'zpower' || (effect as Move).isZ)) return damage;
|
||||
if (target !== source && target.hp !== target.maxhp) {
|
||||
this.attrLastMove('[still]');
|
||||
// FIXME: Wrong error message, correct one not supported yet
|
||||
this.add('cant', source, 'move: Heal Block', effect);
|
||||
return null;
|
||||
}
|
||||
return false;
|
||||
},
|
||||
onRestart(target, source, effect) {
|
||||
|
|
@ -14071,13 +14077,6 @@ export const Moves: import('../sim/dex-moves').MoveDataTable = {
|
|||
onHit(target, source, move) {
|
||||
if (source.isAlly(target)) {
|
||||
if (!this.heal(Math.floor(target.baseMaxhp * 0.5))) {
|
||||
if (target.volatiles['healblock'] && target.hp !== target.maxhp) {
|
||||
this.attrLastMove('[still]');
|
||||
// Wrong error message, correct one not supported yet
|
||||
this.add('cant', source, 'move: Heal Block', move);
|
||||
} else {
|
||||
this.add('-immune', target);
|
||||
}
|
||||
return this.NOT_FAIL;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1221,16 +1221,17 @@ export class BattleActions {
|
|||
continue;
|
||||
}
|
||||
const amount = target.baseMaxhp * moveData.heal[0] / moveData.heal[1];
|
||||
const d = target.heal((this.battle.gen < 5 ? Math.floor : Math.round)(amount));
|
||||
const d = this.battle.heal((this.battle.gen < 5 ? Math.floor : Math.round)(amount), target, source, move);
|
||||
if (!d && d !== 0) {
|
||||
this.battle.add('-fail', source);
|
||||
this.battle.attrLastMove('[still]');
|
||||
if (d !== null) {
|
||||
this.battle.add('-fail', source);
|
||||
this.battle.attrLastMove('[still]');
|
||||
}
|
||||
this.battle.debug('heal interrupted');
|
||||
damage[i] = this.combineResults(damage[i], false);
|
||||
didAnything = this.combineResults(didAnything, null);
|
||||
continue;
|
||||
}
|
||||
this.battle.add('-heal', target, target.getHealth);
|
||||
didSomething = true;
|
||||
}
|
||||
if (moveData.status) {
|
||||
|
|
|
|||
|
|
@ -106,7 +106,7 @@ export interface EventMethods {
|
|||
) => boolean | null | void;
|
||||
onTryEatItem?: boolean | ((this: Battle, item: Item, pokemon: Pokemon) => boolean | void);
|
||||
onTryHeal?: (
|
||||
((this: Battle, relayVar: number, target: Pokemon, source: Pokemon, effect: Effect) => number | boolean | void)
|
||||
((this: Battle, relayVar: number, target: Pokemon, source: Pokemon, effect: Effect) => number | boolean | null | void)
|
||||
);
|
||||
onTryHit?: MoveEventMethods['onTryHit'];
|
||||
onTryHitField?: MoveEventMethods['onTryHitField'];
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ describe('Psychic Noise', () => {
|
|||
assert.cantMove(() => battle.choose('p1', 'move softboiled'));
|
||||
});
|
||||
|
||||
it.skip(`should prevent the target's ally from healing it with Life Dew`, () => {
|
||||
it(`should prevent the target's ally from healing it with Life Dew`, () => {
|
||||
battle = common.createBattle({ gameType: 'doubles' }, [[
|
||||
{ species: 'Wynaut', ability: 'battlearmor', moves: ['sleeptalk'] },
|
||||
{ species: 'Blissey', ability: 'battlearmor', moves: ['lifedew'] },
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user