Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions data/scripts/follower.inc
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,12 @@ gText_FollowerDefault::
gText_WantsToFly::
.string "{STR_VAR_1} looks up at the\nsky restlessly.\pWould you like to use FLY?$"

.macro playfirstmoncry
callfunc ScrFunc_playfirstmoncry
.macro playfirstfollowmoncry
callfunc ScrFunc_playfirstfollowmoncry
.endm

.macro bufferlivemonnickname out:req
callfunc ScrFunc_bufferlivemonnickname
.macro bufferlivefollowmonnickname out:req
callfunc ScrFunc_bufferlivefollowmonnickname
.byte \out
.endm

Expand All @@ -27,8 +27,8 @@ callfunc ScrFunc_emote

EventScript_Follower::
lock
bufferlivemonnickname 0
playfirstmoncry
bufferlivefollowmonnickname 0
playfirstfollowmoncry
callfunc ScrFunc_getfolloweraction
EventScript_FollowerEnd::
waitfieldeffect FLDEFF_EMOTE
Expand Down
4 changes: 2 additions & 2 deletions include/constants/event_objects.h
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@
// These accept vars, too: VAR_TEMP_1, etc
#define OW_MON_ALLOWED_SPECIES (0)
#define OW_MON_ALLOWED_MET_LVL (0)
#define OW_MON_ALLOWED_MET_LOC (0)
#define OW_MON_ALLOWED_MET_LOC (MAPSEC_COUNT)
// Examples:
// Yellow Pikachu:
// #define OW_MON_ALLOWED_SPECIES (SPECIES_PIKACHU)
Expand All @@ -339,7 +339,7 @@
// Species set in VAR_XXXX:
// #define OW_MON_ALLOWED_SPECIES (VAR_XXXX)
// #define OW_MON_ALLOWED_MET_LVL (0)
// #define OW_MON_ALLOWED_MET_LOC (0)
// #define OW_MON_ALLOWED_MET_LOC (MAPSEC_COUNT)

#define SHADOW_SIZE_S 0
#define SHADOW_SIZE_M 1
Expand Down
2 changes: 1 addition & 1 deletion include/event_object_movement.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ void SetSpritePosToOffsetMapCoords(s16 *x, s16 *y, s16 dx, s16 dy);
void ClearObjectEventMovement(struct ObjectEvent *objectEvent, struct Sprite *sprite);
void ObjectEventClearHeldMovement(struct ObjectEvent *objectEvent);
void ObjectEventClearHeldMovementIfActive(struct ObjectEvent *objectEvent);
struct Pokemon * GetFirstLiveMon(void);
struct Pokemon * GetFirstLiveFollowMon(void);
void UpdateFollowingPokemon(void);
void RemoveFollowingPokemon(void);
struct ObjectEvent * GetFollowerObject(void);
Expand Down
2 changes: 1 addition & 1 deletion src/battle_controller_player.c
Original file line number Diff line number Diff line change
Expand Up @@ -2213,7 +2213,7 @@ static bool8 ShouldDoSlideInAnim(void) {
)
return FALSE;

if (GetFirstLiveMon() != &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]])
if (GetFirstLiveFollowMon() != &gPlayerParty[gBattlerPartyIndexes[gActiveBattler]])
return FALSE;

return TRUE;
Expand Down
12 changes: 6 additions & 6 deletions src/event_object_movement.c
Original file line number Diff line number Diff line change
Expand Up @@ -1940,13 +1940,13 @@ u8 CreateVirtualObject(u16 graphicsId, u8 virtualObjId, s16 x, s16 y, u8 elevati
return spriteId;
}

struct Pokemon *GetFirstLiveMon(void) { // Return address of first conscious party mon or NULL
struct Pokemon *GetFirstLiveFollowMon(void) { // Return address of first conscious party follow mon or NULL
u32 i;
for (i = 0; i < PARTY_SIZE; i++) {
struct Pokemon *mon = &gPlayerParty[i];
if ((OW_MON_ALLOWED_SPECIES && GetMonData(mon, MON_DATA_SPECIES_OR_EGG) != VarGet(OW_MON_ALLOWED_SPECIES))
|| (OW_MON_ALLOWED_MET_LVL && GetMonData(mon, MON_DATA_MET_LEVEL) != VarGet(OW_MON_ALLOWED_MET_LVL))
|| (OW_MON_ALLOWED_MET_LOC && GetMonData(mon, MON_DATA_MET_LOCATION) != VarGet(OW_MON_ALLOWED_MET_LOC))
|| (OW_MON_ALLOWED_MET_LOC != MAPSEC_COUNT && GetMonData(mon, MON_DATA_MET_LOCATION) != VarGet(OW_MON_ALLOWED_MET_LOC))
) {
continue;
}
Expand Down Expand Up @@ -2124,7 +2124,7 @@ static bool8 GetMonInfo(struct Pokemon * mon, u16 *species, u8 *form, u8 *shiny)

// Retrieve graphic information about the following pokemon, if any
static bool8 GetFollowerInfo(u16 *species, u8 *form, u8 *shiny) {
return GetMonInfo(GetFirstLiveMon(), species, form, shiny);
return GetMonInfo(GetFirstLiveFollowMon(), species, form, shiny);
}

void UpdateFollowingPokemon(void) { // Update following pokemon if any
Expand Down Expand Up @@ -2327,7 +2327,7 @@ bool8 ScrFunc_getfolloweraction(struct ScriptContext *ctx) // Essentially a big
u32 condCount = 0;
u32 emotion;
struct ObjectEvent *objEvent = GetFollowerObject();
struct Pokemon *mon = GetFirstLiveMon();
struct Pokemon *mon = GetFirstLiveFollowMon();
u8 emotion_weight[FOLLOWER_EMOTION_LENGTH] = {
[FOLLOWER_EMOTION_HAPPY] = 10,
[FOLLOWER_EMOTION_NEUTRAL] = 15,
Expand Down Expand Up @@ -5874,7 +5874,7 @@ bool8 ScrFunc_GetDirectionToFace(struct ScriptContext *ctx) {
bool8 ScrFunc_IsFollowerFieldMoveUser(struct ScriptContext *ctx) {
u16 *var = GetVarPointer(ScriptReadHalfword(ctx));
u16 userIndex = gFieldEffectArguments[0]; // field move user index
struct Pokemon *follower = GetFirstLiveMon();
struct Pokemon *follower = GetFirstLiveFollowMon();
struct ObjectEvent *obj = GetFollowerObject();
if (var == NULL)
return FALSE;
Expand Down Expand Up @@ -7053,7 +7053,7 @@ static void ObjectEventSetPokeballGfx(struct ObjectEvent *objEvent) {
#if OW_MON_POKEBALLS
u32 ball = BALL_POKE;
if (objEvent->localId == OBJ_EVENT_ID_FOLLOWER) {
struct Pokemon *mon = GetFirstLiveMon();
struct Pokemon *mon = GetFirstLiveFollowMon();
if (mon)
ball = ItemIdToBallId(GetMonData(mon, MON_DATA_POKEBALL));
}
Expand Down
8 changes: 4 additions & 4 deletions src/scrcmd.c
Original file line number Diff line number Diff line change
Expand Up @@ -1625,11 +1625,11 @@ bool8 ScrCmd_bufferleadmonspeciesname(struct ScriptContext *ctx)
return FALSE;
}

bool8 ScrFunc_bufferlivemonnickname(struct ScriptContext *ctx)
bool8 ScrFunc_bufferlivefollowmonnickname(struct ScriptContext *ctx)
{
u8 stringVarIndex = ScriptReadByte(ctx);

GetMonData(GetFirstLiveMon(), MON_DATA_NICKNAME, sScriptStringVars[stringVarIndex]);
GetMonData(GetFirstLiveFollowMon(), MON_DATA_NICKNAME, sScriptStringVars[stringVarIndex]);
StringGet_Nickname(sScriptStringVars[stringVarIndex]);
return FALSE;
}
Expand Down Expand Up @@ -2093,9 +2093,9 @@ bool8 ScrCmd_playmoncry(struct ScriptContext *ctx)
return FALSE;
}

bool8 ScrFunc_playfirstmoncry(struct ScriptContext *ctx)
bool8 ScrFunc_playfirstfollowmoncry(struct ScriptContext *ctx)
{
u16 species = GetMonData(GetFirstLiveMon(), MON_DATA_SPECIES);
u16 species = GetMonData(GetFirstLiveFollowMon(), MON_DATA_SPECIES);
PlayCry_Script(species, 0);
return FALSE;
}
Expand Down