diff --git a/calc/src/desc.ts b/calc/src/desc.ts index bd8be6859..a6ac5b109 100644 --- a/calc/src/desc.ts +++ b/calc/src/desc.ts @@ -574,13 +574,23 @@ function getEndOfTurn( } const loseItem = move.named('Knock Off') && !defender.hasAbility('Sticky Hold'); - if (defender.hasItem('Leftovers') && !loseItem) { + // psychic noise should suppress all recovery effects + const healBlock = move.named('Psychic Noise') && + !( + // suppression conditions + attacker.hasAbility('Sheer Force') || + defender.hasItem('Covert Cloak') || + defender.hasAbility('Shield Dust', 'Aroma Veil') + ); + if (defender.hasItem('Leftovers') && !loseItem && !healBlock) { damage += Math.floor(defender.maxHP() / 16); texts.push('Leftovers recovery'); } else if (defender.hasItem('Black Sludge') && !loseItem) { if (defender.hasType('Poison')) { - damage += Math.floor(defender.maxHP() / 16); - texts.push('Black Sludge recovery'); + if (!healBlock) { + damage += Math.floor(defender.maxHP() / 16); + texts.push('Black Sludge recovery'); + } } else if (!defender.hasAbility('Magic Guard', 'Klutz')) { damage -= Math.floor(defender.maxHP() / 8); texts.push('Black Sludge damage'); @@ -604,14 +614,14 @@ function getEndOfTurn( if (attacker.hasAbility('Liquid Ooze')) { damage -= recovery; texts.push('Liquid Ooze damage'); - } else { + } else if (!healBlock) { damage += recovery; texts.push('Leech Seed recovery'); } } if (field.hasTerrain('Grassy')) { - if (isGrounded(defender, field)) { + if (isGrounded(defender, field) && !healBlock) { damage += Math.floor(defender.maxHP() / 16); texts.push('Grassy Terrain recovery'); } @@ -619,16 +629,20 @@ function getEndOfTurn( if (defender.hasStatus('psn')) { if (defender.hasAbility('Poison Heal')) { - damage += Math.floor(defender.maxHP() / 8); - texts.push('Poison Heal'); + if (!healBlock) { + damage += Math.floor(defender.maxHP() / 8); + texts.push('Poison Heal'); + } } else if (!defender.hasAbility('Magic Guard')) { damage -= Math.floor(defender.maxHP() / (gen.num === 1 ? 16 : 8)); texts.push('poison damage'); } } else if (defender.hasStatus('tox')) { if (defender.hasAbility('Poison Heal')) { - damage += Math.floor(defender.maxHP() / 8); - texts.push('Poison Heal'); + if (!healBlock) { + damage += Math.floor(defender.maxHP() / 8); + texts.push('Poison Heal'); + } } else if (!defender.hasAbility('Magic Guard')) { texts.push('toxic damage'); } diff --git a/calc/src/test/calc.test.ts b/calc/src/test/calc.test.ts index 16efa7235..85ad79972 100644 --- a/calc/src/test/calc.test.ts +++ b/calc/src/test/calc.test.ts @@ -1434,6 +1434,12 @@ describe('calc', () => { result = calculate(attacker, defender, Move('Revelation Dance')); expect(result.move.type).toBe('Water'); }); + test('Psychic Noise should disable healing effects', () => { + const attacker = Pokemon('Mewtwo'); + const defender = Pokemon('Regigigas', {ability: 'Poison Heal', item: 'Leftovers', status: 'tox'}); + const result = calculate(attacker, defender, Move('Psychic Noise'), Field({terrain: 'Grassy', attackerSide: {isSeeded: true}})); + expect(result.desc()).toBe('0 SpA Mewtwo Psychic Noise vs. 0 HP / 0 SpD Regigigas: 109-129 (30.1 - 35.7%) -- 31.2% chance to 3HKO'); + }); test('Flower Gift, Power Spot, Battery, and switching boosts shouldn\'t have double spaces', () => { const attacker = Pokemon('Weavile');