When a Pokémon with Moxie directly causes another Pokémon (including allies) to faint by using a damaging move, its Attack is increased by one stage. If its Attack is already at +6 stages, Moxie will not activate.
Moxie activates after the Pokémon gains Attack from Fell Stinger. If a Pokémon with Moxie defeats a Pokémon with Mummy using a contact move, the Pokémon's Ability will become Mummy before Moxie has the opportunity to activate.
Relevant Code Points
subscr_006.s handles the fainting sequence; we need to figure out how to incorporate Moxie as a check into this sequence, which might require some refactoring (as it is also used for fainting due to hazards).
Documentation
https://bulbapedia.bulbagarden.net/wiki/Moxie_(Ability)
Relevant Code Points
subscr_006.s
handles the fainting sequence; we need to figure out how to incorporate Moxie as a check into this sequence, which might require some refactoring (as it is also used for fainting due to hazards).