pokemon-showdown/data/mods/gen1jpn/conditions.ts
livid washed a1cb1f23fc
Gen 1: Implement Dig/Fly invulnerability glitch, partially fix charging moves and Mirror Move (#9243)
* Protect/Detect/Endure don't exist in gen 1

* Add twoturnmove condition to gen 1

* Gens 1-2: Mirror Move fails immediately after a switch

* Fix first Mirror Move test: Fearow was getting OHKO'd by Hyper Beam

* pokemon.lastMove (for Mirror Move) isn't updated with the charging turn

* Remove unnecessary code

* Add onTryMove for each two-turn move with removeVolatile('twoturnmove')

* Sleep, Freeze, partial trapping, flinch don't stop two turn moves

* Para/confusion stops thrashing moves + copy over lockedmove condition details instead of inheriting

* Remove some unnecessary code

* Add Dig/Fly invulnerability glitch

* Add hint for Dig/Fly invulnerability glitch

* Gen 1 Japanese and Stadium

* put Dig before Fly

* Self-targeted moves (e.g. Recover) will work while semi-invulnerable

* Revert changes to lockedmove, do them in a future patch

* move ends if it fails due to disable

* Two-turn moves use PP in their second turn

* restore mocharc

* Remove unnecessary code

* Fix PP usage for Metronome/Mirror Move calling two-turn moves
2022-12-29 18:35:59 -08:00

13 lines
430 B
TypeScript

export const Conditions: {[k: string]: ModdedConditionData} = {
invulnerability: {
// Dig/Fly
name: 'invulnerability',
onInvulnerability(target, source, move) {
if (target === source) return true;
if ((move.id === 'swift' && target.volatiles['substitute']) || move.id === 'transform') return true;
this.add('-message', 'The foe ' + target.name + ' can\'t be hit while invulnerable!');
return false;
},
},
};