Done Tera Shell in Inverse Battles

What type of bug are you reporting? OM

What is the bug?
Terapagos's ability in the Inverse OM fails to resist moves at full HP. However, Terapagos will resist Ghost-type moves.

Are you able to replicate it? If so, how?
Play a game in Inverse and make sure the Terapagos is at full HP when it takes a hit. The hit will be non-resisted.

Shown in turn 4, where Torkoal uses Eruption and Terapagos's ability fails. https://replay.pokemonshowdown.com/gen9inverse-2213981767

Shown in turn 3, where Alomomola uses Scald and Terapagos's ability fails.
https://replay.pokemonshowdown.com/gen9inverse-2213985660

Shown in turn 4, where Alomomola uses Shadow Ball and it is resisted by Tera Shell.
https://replay.pokemonshowdown.com/gen9inverse-2213987142
 
This happens because of an interaction between Inverse Mod and event processing.

On most events, you want returning a falsy value to cancel event processing, as falsy values are used as a failure flag.

Unfortunately, this means that when Inverse Mod finds a normal effective hit, it cancels the event, because zero is falsy.

A solution seems to be to modify the Inverse Mod code to end with if (typeMod) return -typeMod;.

(Note that not returning an explicit value i.e. returning undefined is a special case and indicates that the handler was not interested in the event.)

DaWoblefet edit: fixed by urkerab in https://github.com/smogon/pokemon-showdown/pull/10599
 
Last edited by a moderator:
Back
Top