Skip to content

Commit

Permalink
OW_FOLLOWERS_COPY_WILD_PKMN now depends on follower's ability and moves
Browse files Browse the repository at this point in the history
  • Loading branch information
AsparagusEduardo committed Jul 28, 2024
1 parent 93e4a1f commit 92b02ea
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/event_object_movement.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include "metatile_behavior.h"
#include "overworld.h"
#include "palette.h"
#include "party_menu.h"
#include "pokemon.h"
#include "pokeball.h"
#include "random.h"
Expand Down Expand Up @@ -5210,7 +5211,8 @@ static bool32 EndFollowerTransformEffect(struct ObjectEvent *objectEvent, struct
static bool32 TryStartFollowerTransformEffect(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{
u32 multi;
u32 baseSpecies = GET_BASE_SPECIES_ID(OW_SPECIES(objectEvent));
struct Pokemon *mon;
u32 ability;
if (OW_FOLLOWERS_WEATHER_FORMS
&& DoesSpeciesHaveFormChangeMethod(OW_SPECIES(objectEvent), FORM_CHANGE_BATTLE_WEATHER)
&& OW_SPECIES(objectEvent) != (multi = GetOverworldWeatherSpecies(OW_SPECIES(objectEvent))))
Expand All @@ -5221,8 +5223,8 @@ static bool32 TryStartFollowerTransformEffect(struct ObjectEvent *objectEvent, s
}

if (OW_FOLLOWERS_COPY_WILD_PKMN
&& (baseSpecies == SPECIES_MEW || baseSpecies == SPECIES_DITTO
|| baseSpecies == SPECIES_ZORUA || baseSpecies == SPECIES_ZOROARK)
&& (MonKnowsMove(mon = GetFirstLiveMon(), MOVE_TRANSFORM)
|| (ability = GetMonAbility(mon)) == ABILITY_IMPOSTER || ability == ABILITY_ILLUSION)
&& (Random() & 0xFFFF) < 18 && GetLocalWildMon(FALSE))
{
sprite->data[7] = TRANSFORM_TYPE_RANDOM_WILD << 8;
Expand Down

0 comments on commit 92b02ea

Please sign in to comment.