Zarel/Pokemon-Showdown — pull request #906 by Pikachuun (2014-05-06 13:23:52+00:00)
Title: Making Gen 3 Wish work properly

Wish will now heal the next Pokemon sent in if the initial target has fainted, after spikes damage as it should in gen 3.

As you can probably tell, the implementation is slightly unorthodox [I had to define a new move, wish2, for its side condition, as you cannot define 2 side conditions in moves, if I recall correctly], however this has been tested to work in the initially bugged scenario. If you were to attempt to access wish2 in a gen 3 custom game, it will show up as undefined [like any other move that isn't in the code], effectively making the move invisible except from the code itself. The global variable defined in wish's effect, source2, is immediately deleted after it is finished being used, clearing any unnecessary issues caused by said variable.