Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port pokefirered's Vs. Seeker to pokeemerald #3256

Merged
merged 46 commits into from
Nov 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
0042857
First version of Vs. Seeker
pkmnsnfrn Aug 27, 2023
b6eb9e7
Update movement.inc
pkmnsnfrn Aug 27, 2023
2ae5e9f
Update field_effect_scripts.s
pkmnsnfrn Aug 27, 2023
945ce76
Update field_effect_scripts.s
pkmnsnfrn Aug 27, 2023
93c2970
Update item_use.h
pkmnsnfrn Aug 27, 2023
fa4ccb4
Update movement_action_func_tables.h
pkmnsnfrn Aug 28, 2023
a0876d5
Update event_object_movement.c
pkmnsnfrn Aug 28, 2023
542de59
Update overworld.c
pkmnsnfrn Aug 28, 2023
f81df90
Update vs_seeker.h
pkmnsnfrn Aug 28, 2023
766e046
Update vs_seeker.c
pkmnsnfrn Aug 28, 2023
121085b
Update UpdateRandomTrainerRematches
pkmnsnfrn Aug 30, 2023
bd37bb8
Updated UseVsSeekerEffect_2
pkmnsnfrn Aug 30, 2023
6f2bc1e
Updated UseVsSeekerEffect_3
pkmnsnfrn Aug 30, 2023
fe85a1d
Updated UseVsSeekerEffect_4
pkmnsnfrn Aug 30, 2023
6c1b2f2
Fixed bug that allowed Vs Seeker to be used indoors in correct places
pkmnsnfrn Aug 30, 2023
1c33bfc
Refactored FieldUseFunc_VsSeeker
pkmnsnfrn Aug 30, 2023
8d678d7
Added curly braces to else case in FieldUseFunc_VsSeeker
pkmnsnfrn Aug 30, 2023
559dc8d
renamed data[x] in Task_ResetObjectsRematchWantedState
pkmnsnfrn Aug 30, 2023
2f6c34f
Refactored Task_ResetObjectsRematchWantedState
pkmnsnfrn Aug 30, 2023
6bab4f6
Refactored VsSeekerResetObjectMovementAfterChargeComplete
pkmnsnfrn Aug 30, 2023
6a1df45
Refactored ResetMovementOfRematchableTrainers
pkmnsnfrn Aug 30, 2023
101a265
Refactored GatherNearbyTrainerInfo
pkmnsnfrn Aug 30, 2023
863231a
Refactored Task_VsSeeker_3
pkmnsnfrn Aug 30, 2023
aeafd2b
CanUseVsSeeker
pkmnsnfrn Aug 30, 2023
47fd390
Refactored GetVsSeekerResponseInArea
pkmnsnfrn Aug 30, 2023
e71a95e
GetCurVsSeekerResponse refactored
pkmnsnfrn Aug 30, 2023
727e2e0
Cleaned up GetTrainerFlagFromScript
pkmnsnfrn Aug 31, 2023
73de5dc
Gave sensible names to Task_VsSeeker
pkmnsnfrn Aug 31, 2023
c35c968
Fixed two bugs where player would not have the right gfx state after …
pkmnsnfrn Aug 31, 2023
d24eaab
Renamed UseVsSeeker Functions
pkmnsnfrn Aug 31, 2023
4453a78
Added I_VS_SEEKER_CHARGING to make Vs. Seeker broken until flag is as…
pkmnsnfrn Aug 31, 2023
6246640
Addressed PR feedback
pkmnsnfrn Aug 30, 2023
6f727e6
Fixed issue with building non-modern
pkmnsnfrn Aug 31, 2023
7b15ad4
Refactored GetRunningBehaviorFromGraphicsId and renamed to GetRespons…
pkmnsnfrn Aug 31, 2023
c9077db
Merge branch 'upcoming' into vs_seeker
pkmnsnfrn Sep 1, 2023
35f4a92
Addresses Lunos's PR feedback: https://github.com/rh-hideout/pokeemer…
pkmnsnfrn Sep 13, 2023
433770c
Merge branch 'upcoming' of https://github.com/rh-hideout/pokeemerald-…
pkmnsnfrn Sep 27, 2023
753a0c3
Merge branch 'upcoming' into vs_seeker
pkmnsnfrn Nov 10, 2023
e4fe0e1
Added changes in response to Jasper's feedback
pkmnsnfrn Nov 10, 2023
26ac0e7
Merge branch 'upcoming' into vs_seeker
pkmnsnfrn Nov 13, 2023
cdb9b9e
Updated with Edu's discord feedback https://discord.com/channels/4192…
pkmnsnfrn Nov 22, 2023
b5dc744
Merge branch 'upcoming' of https://github.com/rh-hideout/pokeemerald-…
pkmnsnfrn Nov 22, 2023
bce579b
Removed ifdef tags around the repo unless needed
pkmnsnfrn Nov 24, 2023
63dda47
Merge branch 'upcoming' into vs_seeker
pkmnsnfrn Nov 24, 2023
34f1e9c
Merge branch 'upcoming' into vs_seeker
pkmnsnfrn Nov 26, 2023
ffe9236
Merge branch 'upcoming' into vs_seeker
pkmnsnfrn Nov 26, 2023
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
2 changes: 2 additions & 0 deletions asm/macros/movement.inc
Original file line number Diff line number Diff line change
Expand Up @@ -162,5 +162,7 @@
create_movement_action figure_8, MOVEMENT_ACTION_FIGURE_8
create_movement_action fly_up, MOVEMENT_ACTION_FLY_UP
create_movement_action fly_down, MOVEMENT_ACTION_FLY_DOWN
create_movement_action emote_double_exclamation_mark, MOVEMENT_ACTION_EMOTE_DOUBLE_EXCL_MARK
create_movement_action emote_x, MOVEMENT_ACTION_EMOTE_X

create_movement_action step_end, MOVEMENT_ACTION_STEP_END
7 changes: 7 additions & 0 deletions data/event_scripts.s
Original file line number Diff line number Diff line change
Expand Up @@ -1005,6 +1005,13 @@ Common_EventScript_LegendaryFlewAway::
release
end

EventScript_VsSeekerChargingDone::
special VsSeekerFreezeObjectsAfterChargeComplete
waitstate
special VsSeekerResetObjectMovementAfterChargeComplete
releaseall
end

.include "data/scripts/pc_transfer.inc"
.include "data/scripts/questionnaire.inc"
.include "data/scripts/abnormal_weather.inc"
Expand Down
16 changes: 16 additions & 0 deletions data/field_effect_scripts.s
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#include "config/item.h"
.include "asm/macros.inc"
.include "constants/constants.inc"

Expand Down Expand Up @@ -72,6 +73,9 @@ gFieldEffectScriptPointers::
.4byte gFieldEffectScript_RayquazaSpotlight @ FLDEFF_RAYQUAZA_SPOTLIGHT
.4byte gFieldEffectScript_DestroyDeoxysRock @ FLDEFF_DESTROY_DEOXYS_ROCK
.4byte gFieldEffectScript_MoveDeoxysRock @ FLDEFF_MOVE_DEOXYS_ROCK
.4byte gFldEffScript_UseVsSeeker @ FLDEFF_USE_VS_SEEKER
.4byte gFldEffScript_XIcon @ FLDEFF_X_ICON
.4byte gFldEffScript_DoubleExclMarkIcon @ FLDEFF_DOUBLE_EXCL_MARK_ICON

gFieldEffectScript_ExclamationMarkIcon1::
field_eff_callnative FldEff_ExclamationMarkIcon
Expand Down Expand Up @@ -343,3 +347,15 @@ gFieldEffectScript_DestroyDeoxysRock::
gFieldEffectScript_MoveDeoxysRock::
field_eff_callnative FldEff_MoveDeoxysRock
field_eff_end

gFldEffScript_UseVsSeeker::
field_eff_callnative FldEff_UseVsSeeker
field_eff_end

gFldEffScript_XIcon::
field_eff_callnative FldEff_XIcon
field_eff_end

gFldEffScript_DoubleExclMarkIcon::
field_eff_callnative FldEff_DoubleExclMarkIcon
field_eff_end
2 changes: 2 additions & 0 deletions data/specials.inc
Original file line number Diff line number Diff line change
Expand Up @@ -540,3 +540,5 @@ gSpecials::
def_special GetSprayId
def_special GetLastUsedSprayType
def_special TrySkyBattle
def_special VsSeekerResetObjectMovementAfterChargeComplete
def_special VsSeekerFreezeObjectsAfterChargeComplete
15 changes: 15 additions & 0 deletions data/text/trainers.inc
Original file line number Diff line number Diff line change
Expand Up @@ -4779,3 +4779,18 @@ Route134_Text_HudsonPostBattle:
.string "Our boat drifted out to sea.\p"
.string "My buddy's a timid fellow, so I'm\n"
.string "worried about him.$"

VSSeeker_Text_BatteryNotChargedNeedXSteps::
.string "The battery isn't charged enough.\p"
.string "No. of steps required to fully\n"
.string "charge the battery: {STR_VAR_1}{PAUSE_UNTIL_PRESS}$"

VSSeeker_Text_NoTrainersWithinRange::
.string "There are no Trainers within range\n"
.string "who can battle…\p"
.string "The VS Seeker was turned off.{PAUSE_UNTIL_PRESS}$"

VSSeeker_Text_TrainersNotReady::
.string "The other Trainers don't appear\n"
.string "to be ready for battle.\p"
.string "Let's wait till later.{PAUSE_UNTIL_PRESS}$"
Binary file added graphics/field_effects/pics/emote_x.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions include/battle_setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,8 @@ u16 CountBattledRematchTeams(u16 trainerId);

void DoStandardWildBattle_Debug(void);
void BattleSetup_StartTrainerBattle_Debug(void);
s32 TrainerIdToRematchTableId(const struct RematchTrainer *table, u16 trainerId);
s32 FirstBattleTrainerIdToRematchTableId(const struct RematchTrainer *table, u16 trainerId);
u16 GetRematchTrainerIdFromTable(const struct RematchTrainer *table, u16 firstBattleTrainerId);

#endif // GUARD_BATTLE_SETUP_H
3 changes: 3 additions & 0 deletions include/config/item.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,7 @@
#define VAR_LAST_REPEL_LURE_USED 0 // If this var has been assigned, last Repel/Lure used will be saved and the player will get prompted with the vanilla repel YES/NO option, unless I_REPEL_LURE_MENU is set to TRUE.
#define I_REPEL_LURE_MENU TRUE // If TRUE, the player is able to choose which Repel/Lure to use once the previous one runs out. Cursor position is saved by VAR_LAST_REPEL_LURE_USED if not 0.

// Vs. Seeker
#define I_VS_SEEKER_CHARGING 0 // If this flag is assigned, the Vs Seeker will functionlity will be enabled. When the player has the Vs. Seeker, Match Call rematch functions will stop working.
pkmnsnfrn marked this conversation as resolved.
Show resolved Hide resolved

#endif // GUARD_CONFIG_ITEM_H
3 changes: 3 additions & 0 deletions include/constants/event_object_movement.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,6 +242,8 @@
#define MOVEMENT_ACTION_FIGURE_8 0x9B
#define MOVEMENT_ACTION_FLY_UP 0x9C
#define MOVEMENT_ACTION_FLY_DOWN 0x9D
#define MOVEMENT_ACTION_EMOTE_X 0x9E
#define MOVEMENT_ACTION_EMOTE_DOUBLE_EXCL_MARK 0x9F

#define MOVEMENT_ACTION_STEP_END 0xFE
#define MOVEMENT_ACTION_NONE 0xFF
Expand Down Expand Up @@ -300,6 +302,7 @@
#define ANIM_GET_ON_OFF_POKEMON_EAST (ANIM_STD_COUNT + 3)

#define ANIM_NURSE_BOW (ANIM_STD_COUNT + 0)
#define ANIM_RAISE_HAND (ANIM_STD_COUNT + 0)

#define ANIM_FIELD_MOVE 0

Expand Down
3 changes: 3 additions & 0 deletions include/constants/field_effects.h
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,9 @@
#define FLDEFF_RAYQUAZA_SPOTLIGHT 64
#define FLDEFF_DESTROY_DEOXYS_ROCK 65
#define FLDEFF_MOVE_DEOXYS_ROCK 66
#define FLDEFF_USE_VS_SEEKER 67
#define FLDEFF_X_ICON 68
#define FLDEFF_DOUBLE_EXCL_MARK_ICON 69

#define FLDEFFOBJ_SHADOW_S 0
#define FLDEFFOBJ_SHADOW_M 1
Expand Down
3 changes: 3 additions & 0 deletions include/event_object_movement.h
Original file line number Diff line number Diff line change
Expand Up @@ -440,4 +440,7 @@ bool32 IsVirtualObjectInvisible(u8 virtualObjId);
void SetVirtualObjectSpriteAnim(u8 virtualObjId, u8 animNum);
bool32 IsVirtualObjectAnimating(u8 virtualObjId);

bool8 MovementAction_EmoteX_Step0(struct ObjectEvent *, struct Sprite *);
bool8 MovementAction_EmoteDoubleExclamationMark_Step0(struct ObjectEvent *, struct Sprite *);

#endif //GUARD_EVENT_OBJECT_MOVEMENT_H
5 changes: 5 additions & 0 deletions include/event_scripts.h
Original file line number Diff line number Diff line change
Expand Up @@ -612,4 +612,9 @@ extern const u8 EventScript_TradeCenter_Chair0[];
extern const u8 EventScript_ConfirmLeaveCableClubRoom[];
extern const u8 EventScript_TerminateLink[];

extern const u8 VSSeeker_Text_BatteryNotChargedNeedXSteps[];
extern const u8 VSSeeker_Text_NoTrainersWithinRange[];
extern const u8 VSSeeker_Text_TrainersNotReady[];
extern const u8 EventScript_VsSeekerChargingDone[];

#endif // GUARD_EVENT_SCRIPTS_H
1 change: 1 addition & 0 deletions include/global.fieldmap.h
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,7 @@ enum {
PLAYER_AVATAR_STATE_FIELD_MOVE,
PLAYER_AVATAR_STATE_FISHING,
PLAYER_AVATAR_STATE_WATERING,
PLAYER_AVATAR_STATE_VSSEEKER,
};

#define PLAYER_AVATAR_FLAG_ON_FOOT (1 << 0)
Expand Down
2 changes: 2 additions & 0 deletions include/item_use.h
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,8 @@ void ItemUseInBattle_PartyMenuChooseMove(u8 taskId);
void Task_UseDigEscapeRopeOnField(u8 taskId);
u8 CanUseDigOrEscapeRopeOnCurMap(void);
u8 CheckIfItemIsTMHMOrEvolutionStone(u16 itemId);
void FieldUseFunc_VsSeeker(u8 taskId);
void Task_ItemUse_CloseMessageBoxAndReturnToField_VsSeeker(u8 taskId);
pkmnsnfrn marked this conversation as resolved.
Show resolved Hide resolved

enum {
BALL_THROW_UNABLE_TWO_MONS,
Expand Down
2 changes: 2 additions & 0 deletions include/trainer_see.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,7 @@ u8 FldEff_HeartIcon(void);
u8 GetCurrentApproachingTrainerObjectEventId(void);
u8 GetChosenApproachingTrainerObjectEventId(u8 arrayId);
void PlayerFaceTrainerAfterBattle(void);
u8 FldEff_DoubleExclMarkIcon(void);
u8 FldEff_XIcon(void);

#endif // GUARD_TRAINER_SEE_H
14 changes: 14 additions & 0 deletions include/vs_seeker.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#ifndef GUARD_VS_SEEKER_H
#define GUARD_VS_SEEKER_H

#include "global.h"

void Task_InitVsSeekerAndCheckForTrainersOnScreen(u8 taskId);
bool8 UpdateVsSeekerStepCounter(void);
void MapResetTrainerRematches(u16 mapGroup, u16 mapNum);
void ClearRematchMovementByTrainerId(void);
u16 GetRematchTrainerIdVSSeeker(u16 trainerId);

#define VSSEEKER_RECHARGE_STEPS 100

#endif //GUARD_VS_SEEKER_H
60 changes: 41 additions & 19 deletions src/battle_setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@
#include "mirage_tower.h"
#include "field_screen_effect.h"
#include "data.h"
#include "vs_seeker.h"
#include "item.h"
#include "constants/battle_frontier.h"
#include "constants/battle_setup.h"
#include "constants/game_stat.h"
Expand Down Expand Up @@ -1627,7 +1629,7 @@ static const u8 *GetTrainerCantBattleSpeech(void)
return ReturnEmptyStringIfNull(sTrainerCannotBattleSpeech);
}

static s32 FirstBattleTrainerIdToRematchTableId(const struct RematchTrainer *table, u16 trainerId)
s32 FirstBattleTrainerIdToRematchTableId(const struct RematchTrainer *table, u16 trainerId)
{
s32 i;

Expand All @@ -1640,7 +1642,7 @@ static s32 FirstBattleTrainerIdToRematchTableId(const struct RematchTrainer *tab
return -1;
}

static s32 TrainerIdToRematchTableId(const struct RematchTrainer *table, u16 trainerId)
s32 TrainerIdToRematchTableId(const struct RematchTrainer *table, u16 trainerId)
{
s32 i, j;

Expand Down Expand Up @@ -1686,30 +1688,42 @@ static void SetRematchIdForTrainer(const struct RematchTrainer *table, u32 table
gSaveBlock1Ptr->trainerRematches[tableId] = i;
}

static bool32 DoesCurrentMapMatchRematchTrainerMap(s32 i, const struct RematchTrainer *table, u16 mapGroup, u16 mapNum)
{
return table[i].mapGroup == mapGroup && table[i].mapNum == mapNum;
}

bool32 TrainerIsMatchCallRegistered(s32 i)
{
return FlagGet(FLAG_MATCH_CALL_REGISTERED + i);
}

static bool32 UpdateRandomTrainerRematches(const struct RematchTrainer *table, u16 mapGroup, u16 mapNum)
{
s32 i;
bool32 ret = FALSE;

if (CheckBagHasItem(ITEM_VS_SEEKER, 1) && I_VS_SEEKER_CHARGING != 0)
return FALSE;

for (i = 0; i <= REMATCH_SPECIAL_TRAINER_START; i++)
{
if (table[i].mapGroup == mapGroup && table[i].mapNum == mapNum && !IsRematchForbidden(i))
if (DoesCurrentMapMatchRematchTrainerMap(i,table,mapGroup,mapNum) && !IsRematchForbidden(i))
continue;

if (gSaveBlock1Ptr->trainerRematches[i] != 0)
{
// Trainer already wants a rematch. Don't bother updating it.
return TRUE;
}
pkmnsnfrn marked this conversation as resolved.
Show resolved Hide resolved
else if (TrainerIsMatchCallRegistered(i) && ((Random() % 100) <= 30))
// 31% chance of getting a rematch.
{
if (gSaveBlock1Ptr->trainerRematches[i] != 0)
{
// Trainer already wants a rematch. Don't bother updating it.
ret = TRUE;
}
else if (FlagGet(FLAG_MATCH_CALL_REGISTERED + i)
&& (Random() % 100) <= 30) // 31% chance of getting a rematch.
{
SetRematchIdForTrainer(table, i);
ret = TRUE;
}
SetRematchIdForTrainer(table, i);
return TRUE;
}
}

return ret;
return FALSE;
}

void UpdateRematchIfDefeated(s32 rematchTableId)
Expand Down Expand Up @@ -1772,7 +1786,7 @@ static bool8 IsTrainerReadyForRematch_(const struct RematchTrainer *table, u16 t
return TRUE;
}

static u16 GetRematchTrainerIdFromTable(const struct RematchTrainer *table, u16 firstBattleTrainerId)
u16 GetRematchTrainerIdFromTable(const struct RematchTrainer *table, u16 firstBattleTrainerId)
{
const struct RematchTrainer *trainerEntry;
s32 i;
Expand Down Expand Up @@ -1877,7 +1891,9 @@ static bool32 HasAtLeastFiveBadges(void)

void IncrementRematchStepCounter(void)
{
if (HasAtLeastFiveBadges())
if (HasAtLeastFiveBadges()
&& (I_VS_SEEKER_CHARGING != 0)
&& (!CheckBagHasItem(ITEM_VS_SEEKER, 1)))
{
if (gSaveBlock1Ptr->trainerRematchStepCounter >= STEP_COUNTER_MAX)
gSaveBlock1Ptr->trainerRematchStepCounter = STEP_COUNTER_MAX;
Expand Down Expand Up @@ -1912,7 +1928,10 @@ bool32 IsRematchTrainerIn(u16 mapGroup, u16 mapNum)

static u16 GetRematchTrainerId(u16 trainerId)
{
return GetRematchTrainerIdFromTable(gRematchTable, trainerId);
if (FlagGet(I_VS_SEEKER_CHARGING) && (I_VS_SEEKER_CHARGING != 0))
return GetRematchTrainerIdVSSeeker(trainerId);
else
return GetRematchTrainerIdFromTable(gRematchTable, trainerId);
}

u16 GetLastBeatenRematchTrainerId(u16 trainerId)
Expand All @@ -1935,6 +1954,9 @@ bool8 IsTrainerReadyForRematch(void)

static void HandleRematchVarsOnBattleEnd(void)
{
if ((gBattleTypeFlags & BATTLE_TYPE_TRAINER) && (I_VS_SEEKER_CHARGING != 0))
ClearRematchMovementByTrainerId();

ClearTrainerWantRematchState(gRematchTable, gTrainerBattleOpponent_A);
SetBattledTrainersFlags();
}
Expand Down
4 changes: 4 additions & 0 deletions src/data/items.h
Original file line number Diff line number Diff line change
Expand Up @@ -8723,7 +8723,11 @@ const struct Item gItems[] =
.importance = 1,
.pocket = POCKET_KEY_ITEMS,
.type = ITEM_USE_FIELD,
#if I_VS_SEEKER_CHARGING != 0
.fieldUseFunc = FieldUseFunc_VsSeeker,
#else
.fieldUseFunc = ItemUseOutOfBattle_CannotUse,
#endif
},

[ITEM_TM_CASE] =
Expand Down
14 changes: 14 additions & 0 deletions src/data/object_events/movement_action_func_tables.h
Original file line number Diff line number Diff line change
Expand Up @@ -420,6 +420,8 @@ u8 (*const gMovementActionFuncs_StopLevitateAtTop[])(struct ObjectEvent *, struc
u8 (*const gMovementActionFuncs_Figure8[])(struct ObjectEvent *, struct Sprite *);
u8 (*const gMovementActionFuncs_FlyUp[])(struct ObjectEvent *, struct Sprite *);
u8 (*const gMovementActionFuncs_FlyDown[])(struct ObjectEvent *, struct Sprite *);
u8 (*const gMovementActionFuncs_EmoteX[])(struct ObjectEvent *, struct Sprite *);
u8 (*const gMovementActionFuncs_EmoteDoubleExclMark[])(struct ObjectEvent *, struct Sprite *);

u8 (*const *const gMovementActionFuncs[])(struct ObjectEvent *, struct Sprite *) = {
[MOVEMENT_ACTION_FACE_DOWN] = gMovementActionFuncs_FaceDown,
Expand Down Expand Up @@ -580,6 +582,8 @@ u8 (*const *const gMovementActionFuncs[])(struct ObjectEvent *, struct Sprite *)
[MOVEMENT_ACTION_FIGURE_8] = gMovementActionFuncs_Figure8,
[MOVEMENT_ACTION_FLY_UP] = gMovementActionFuncs_FlyUp,
[MOVEMENT_ACTION_FLY_DOWN] = gMovementActionFuncs_FlyDown,
[MOVEMENT_ACTION_EMOTE_X] = gMovementActionFuncs_EmoteX,
[MOVEMENT_ACTION_EMOTE_DOUBLE_EXCL_MARK] = gMovementActionFuncs_EmoteDoubleExclMark,
};

u8 (*const gMovementActionFuncs_FaceDown[])(struct ObjectEvent *, struct Sprite *) = {
Expand Down Expand Up @@ -1519,3 +1523,13 @@ u8 (*const gMovementActionFuncs_StopLevitateAtTop[])(struct ObjectEvent *, struc
MovementAction_StopLevitateAtTop_Step0,
MovementAction_Finish,
};

u8 (*const gMovementActionFuncs_EmoteX[])(struct ObjectEvent *, struct Sprite *) = {
MovementAction_EmoteX_Step0,
MovementAction_Finish,
};

u8 (*const gMovementActionFuncs_EmoteDoubleExclMark[])(struct ObjectEvent *, struct Sprite *) = {
MovementAction_EmoteDoubleExclamationMark_Step0,
MovementAction_Finish,
};
16 changes: 16 additions & 0 deletions src/event_object_movement.c
Original file line number Diff line number Diff line change
Expand Up @@ -8965,3 +8965,19 @@ u8 MovementAction_Fly_Finish(struct ObjectEvent *objectEvent, struct Sprite *spr
{
return TRUE;
}

bool8 MovementAction_EmoteX_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{
ObjectEventGetLocalIdAndMap(objectEvent, &gFieldEffectArguments[0], &gFieldEffectArguments[1], &gFieldEffectArguments[2]);
FieldEffectStart(FLDEFF_X_ICON);
sprite->sActionFuncId = 1;
return TRUE;
}

bool8 MovementAction_EmoteDoubleExclamationMark_Step0(struct ObjectEvent *objectEvent, struct Sprite *sprite)
{
ObjectEventGetLocalIdAndMap(objectEvent, &gFieldEffectArguments[0], &gFieldEffectArguments[1], &gFieldEffectArguments[2]);
FieldEffectStart(FLDEFF_DOUBLE_EXCL_MARK_ICON);
sprite->sActionFuncId = 1;
return TRUE;
}
6 changes: 6 additions & 0 deletions src/field_control_avatar.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
#include "start_menu.h"
#include "trainer_see.h"
#include "trainer_hill.h"
#include "vs_seeker.h"
#include "wild_encounter.h"
#include "constants/event_bg.h"
#include "constants/event_objects.h"
Expand Down Expand Up @@ -615,6 +616,11 @@ static bool8 TryStartStepCountScript(u16 metatileBehavior)
ScriptContext_SetupScript(MossdeepCity_SpaceCenter_2F_EventScript_RivalRayquazaCall);
return TRUE;
}
if (UpdateVsSeekerStepCounter())
{
ScriptContext_SetupScript(EventScript_VsSeekerChargingDone);
return TRUE;
}
}

if (SafariZoneTakeStep() == TRUE)
Expand Down
Loading
Loading