pokerogue
pokerogue copied to clipboard
Rockruff dusk form not evolving
This PR addresses an issue raised where rockruff with own tempo is unable to evolve into dusk form. During dusk it does not evolve, during day or night it evolves instead into the midday/midnight forms.
Replaced inappropriate 'getSpeciesFormIndex' (which is not able to check rockruff's species since it doesn't have access to the pokemon's information, only scene info. It defaults to zero so rockruffs form index will always be zero) with 'hasAbility' for own tempo. In order to prevent an own tempo rockruff from evolving otherwise I've added a check for own tempo. Plus relevant import from enum abilities.
Screenshots of bug (#681)
note that getSpeciesFormIndex might be worth updating in future for more complex forms however this approach seems to be suitable and avoids messing with getSpeciesFormIndex unnecessarily
Since the getSpeciesFormIndex doesn't work for rockruff, formIndex will accurately track whether it was originally an owntempo rockruff or not (otherwise we would be creating additional functions or modifying getFormIndex which was intended for wild pokemon gen). If it fuses to any other pokemon it still keeps its formIndex the same since it takes the first pokemon's form. So far rockruff still evolves correctly, an OT rockruff fused w any pokemon still evolves into dusk form, a regular rockruff fused with an OT rockruff (or any other pokemon that overwrites the ability as own tempo) will turn into day/night forms still.
Regular rockruff fused with own tempo rockruff evolves into day form correctly:
OT rockruff fused with another pokemon (replacing OT) still evolves into dusk form:
@Xavion3. should be fine with fusions