summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/constants/event_bg.h2
-rw-r--r--include/constants/flags.h2
-rw-r--r--include/constants/quest_log.h12
-rw-r--r--include/constants/vars.h15
-rw-r--r--include/coord_event_weather.h6
-rw-r--r--include/daycare.h1
-rw-r--r--include/event_object_movement.h3
-rw-r--r--include/event_scripts.h49
-rw-r--r--include/field_control_avatar.h31
-rw-r--r--include/field_fadetransition.h8
-rw-r--r--include/field_specials.h3
-rw-r--r--include/global.fieldmap.h22
-rw-r--r--include/item_menu.h1
-rw-r--r--include/metatile_behavior.h10
-rw-r--r--include/overworld.h10
-rw-r--r--include/script.h25
-rw-r--r--include/script_menu.h2
-rw-r--r--include/vs_seeker.h1
-rw-r--r--include/wild_encounter.h1
19 files changed, 166 insertions, 38 deletions
diff --git a/include/constants/event_bg.h b/include/constants/event_bg.h
index b106a74ef..37fedf25b 100644
--- a/include/constants/event_bg.h
+++ b/include/constants/event_bg.h
@@ -7,4 +7,6 @@
#define BG_EVENT_PLAYER_FACING_EAST 3
#define BG_EVENT_PLAYER_FACING_WEST 4
+#define BG_EVENT_HIDDEN_ITEM 7
+
#endif // GUARD_CONSTANTS_EVENT_BG_H
diff --git a/include/constants/flags.h b/include/constants/flags.h
index 0bc96eb35..ccac1da3b 100644
--- a/include/constants/flags.h
+++ b/include/constants/flags.h
@@ -1360,7 +1360,7 @@
#define FLAG_SYS_RIBBON_GET (SYS_FLAGS + 0x3B)
#define FLAG_SYS_SAW_HELP_SYSTEM_INTRO (SYS_FLAGS + 0x3C)
#define FLAG_0x83D (SYS_FLAGS + 0x3D)
-#define FLAG_PALLET_TOWN_LADY_MOVED_FROM_SIGN (SYS_FLAGS + 0x3E)
+#define FLAG_OPENED_START_MENU (SYS_FLAGS + 0x3E)
#define FLAG_0x83F (SYS_FLAGS + 0x3F)
#define FLAG_SYS_NATIONAL_DEX (SYS_FLAGS + 0x40)
#define FLAG_SYS_PC_STORAGE_DISABLED (SYS_FLAGS + 0x41)
diff --git a/include/constants/quest_log.h b/include/constants/quest_log.h
index c1eaf3f07..b5494e7b9 100644
--- a/include/constants/quest_log.h
+++ b/include/constants/quest_log.h
@@ -118,6 +118,18 @@
#define QL_DEPARTED_MISC_BUILDING_1 8
#define QL_DEPARTED_MISC_BUILDING_2 9
+#define QL_INPUT_OFF 0
+#define QL_INPUT_UP 1
+#define QL_INPUT_DOWN 2
+#define QL_INPUT_LEFT 3
+#define QL_INPUT_RIGHT 4
+#define QL_INPUT_L 5
+#define QL_INPUT_R 6
+#define QL_INPUT_START 7
+#define QL_INPUT_SELECT 8
+#define QL_INPUT_A 9
+#define QL_INPUT_B 10
+
#define FANCLUB_MEMBER1 0
#define FANCLUB_MEMBER2 1
diff --git a/include/constants/vars.h b/include/constants/vars.h
index 640bf41fd..4a64eb095 100644
--- a/include/constants/vars.h
+++ b/include/constants/vars.h
@@ -49,10 +49,15 @@
// Counts up every step. Wraps around at 128.
// When wraparound occurs, the friendship of
// every party poke gets a slight boost.
-#define VAR_FRIENDSHIP_STEP_COUNT 0x4021
+#define VAR_HAPPINESS_STEP_COUNTER 0x4021
-// Maybe unused?
-#define VAR_0x4022 0x4022
+// Counts up every step while a party Pokemon is
+// poisoned. Wraps around at 5. When wraparound
+// occurs, every party Pokemon with the PSN status
+// takes 1 point of damage.
+// This is a deviation from the typical rate in
+// the series, which is 1 damage every 4 steps.
+#define VAR_POISON_STEP_COUNTER 0x4022
// Step counter. Caps at 1500. If you enter a map with
// renewable hidden items and this counter is capped,
@@ -81,8 +86,8 @@
#define VAR_QUEST_LOG_MON_COUNTS 0x4027
#define VAR_MENEWS_JISAN_STEP_COUNTER 0x4028
#define VAR_0x4029 0x4029
-#define VAR_HAPPINESS_STEP_COUNTER 0x402A
-#define VAR_POISON_STEP_COUNTER 0x402B
+#define VAR_0x402A 0x402A
+#define VAR_0x402B 0x402B
#define VAR_RESET_RTC_ENABLE 0x402C
#define VAR_0x402D 0x402D
#define VAR_0x402E 0x402E
diff --git a/include/coord_event_weather.h b/include/coord_event_weather.h
new file mode 100644
index 000000000..4996b52a6
--- /dev/null
+++ b/include/coord_event_weather.h
@@ -0,0 +1,6 @@
+#ifndef GUARD_COORD_EVENT_WEATHER_H
+#define GUARD_COORD_EVENT_WEATHER_H
+
+void DoCoordEventWeather(u8 weatherId);
+
+#endif //GUARD_COORD_EVENT_WEATHER_H
diff --git a/include/daycare.h b/include/daycare.h
index 71eada93e..01751641e 100644
--- a/include/daycare.h
+++ b/include/daycare.h
@@ -29,5 +29,6 @@ bool8 sub_8071614(void);
void EggHatch(void);
u8 GetEggStepsToSubtract(void);
u16 sub_80722E0(void);
+bool8 ShouldEggHatch(void);
#endif // GUARD_DAYCARE_H
diff --git a/include/event_object_movement.h b/include/event_object_movement.h
index ac102d9a9..e01364e55 100644
--- a/include/event_object_movement.h
+++ b/include/event_object_movement.h
@@ -63,7 +63,8 @@ bool8 TryGetObjectEventIdByLocalIdAndMap(u8, u8, u8, u8 *);
u8 GetObjectEventIdByXY(s16, s16);
void SetObjectEventDirection(struct ObjectEvent *, u8);
u8 sub_808D4F4(void);
-void RemoveObjectEventByLocalIdAndMap(u8, u8, u8);
+void RemoveObjectEventByLocalIdAndMap(u8 localId, u8 mapNum, u8 mapGroup);
+u16 sub_805FCD8(u8 localId, u8 mapNum, u8 mapGroup);
void LoadPlayerObjectReflectionPalette(u16, u8);
void LoadSpecialObjectReflectionPalette(u16, u8);
void TryMoveObjectEventToMapCoords(u8, u8, u8, s16, s16);
diff --git a/include/event_scripts.h b/include/event_scripts.h
index c211e3a34..9b78854fa 100644
--- a/include/event_scripts.h
+++ b/include/event_scripts.h
@@ -1161,7 +1161,7 @@ extern const u8 EventScript_TryDoNormalTrainerBattle[];
extern const u8 EventScript_TryDoDoubleRematchBattle[];
extern const u8 EventScript_TryDoRematchBattle[];
extern const u8 EventScript_DoTrainerBattleFromApproach[];
-extern const u8 Test_EventScript_Sign[];
+extern const u8 EventScript_TestSignpostMsg[];
// new_game
extern const u8 EventScript_ResetAllMapFlags[];
@@ -1212,4 +1212,51 @@ extern const u8 CableClub_Text_PleaseWaitBCancel[];
// fldeff_flash
extern const u8 EventScript_FldEffFlash[];
+// field_control_avatar
+extern const u8 EventScript_CancelMessageBox[];
+extern const u8 PalletTown_PlayersHouse_2F_EventScript_PC[];
+extern const u8 EventScript_HiddenItemScript[];
+extern const u8 EventScript_PC[];
+extern const u8 EventScript_WallTownMap[];
+extern const u8 gUnknown_81A7606[];
+extern const u8 gUnknown_81A760F[];
+extern const u8 gUnknown_81A7618[];
+extern const u8 gUnknown_81A7633[];
+extern const u8 gUnknown_81A763C[];
+extern const u8 gUnknown_81A7621[];
+extern const u8 gUnknown_81A7645[];
+extern const u8 gUnknown_81A762A[];
+extern const u8 TrainerTower_EventScript_ShowTime[];
+extern const u8 gUnknown_81A764E[];
+extern const u8 gUnknown_81A7657[];
+extern const u8 gUnknown_81A7660[];
+extern const u8 gUnknown_81A7669[];
+extern const u8 gUnknown_81A7672[];
+extern const u8 gUnknown_81A767B[];
+extern const u8 gUnknown_81A7684[];
+extern const u8 gUnknown_81A768D[];
+extern const u8 gUnknown_81A7696[];
+extern const u8 gUnknown_81A769F[];
+extern const u8 gUnknown_81A76A8[];
+extern const u8 gUnknown_81A76B1[];
+extern const u8 gUnknown_81A76BA[];
+extern const u8 gUnknown_81A76C3[];
+extern const u8 gUnknown_81A76CC[];
+extern const u8 gUnknown_81A76D5[];
+extern const u8 CableClub_EventScript_81BBFD8[];
+extern const u8 EventScript_Questionnaire[];
+extern const u8 CableClub_EventScript_ShowBattleRecords[];
+extern const u8 EventScript_Indigo_UltimateGoal[];
+extern const u8 EventScript_Indigo_HighestAuthority[];
+extern const u8 EventScript_PokemartSign[];
+extern const u8 EventScript_PokecenterSign[];
+extern const u8 EventScript_CurrentTooFast[];
+extern const u8 EventScript_UseSurf[];
+extern const u8 EventScript_Waterfall[];
+extern const u8 EventScript_CantUseWaterfall[];
+extern const u8 gUnknown_81A8CED[];
+extern const u8 EventScript_FieldPoison[];
+extern const u8 EventScript_EggHatch[];
+extern const u8 EventScript_1C1361[];
+
#endif //GUARD_EVENT_SCRIPTS_H
diff --git a/include/field_control_avatar.h b/include/field_control_avatar.h
index 4311a2b29..335076a9d 100644
--- a/include/field_control_avatar.h
+++ b/include/field_control_avatar.h
@@ -3,12 +3,37 @@
#include "global.h"
-extern u32 gUnknown_3005078;
+struct FieldInput
+{
+ bool8 pressedAButton:1;
+ bool8 checkStandardWildEncounter:1;
+ bool8 pressedStartButton:1;
+ bool8 pressedSelectButton:1;
+ bool8 heldDirection:1;
+ bool8 heldDirection2:1;
+ bool8 tookStep:1;
+ bool8 pressedBButton:1;
+ bool8 pressedRButton:1;
+ bool8 input_field_1_0:1;
+ bool8 input_field_1_1:1;
+ bool8 input_field_1_2:1;
+ bool8 input_field_1_3:1;
+ u8 dpadDirection;
+};
+
+extern struct FieldInput gInputToStoreInQuestLogMaybe;
void RestartWildEncounterImmunitySteps(void);
void ClearPoisonStepCounter(void);
-void SetCableClubWarp(void);
+int SetCableClubWarp(void);
void sub_806DE28(struct ObjectEvent *);
-void dive_warp(struct MapPosition * pos, u16 behavior);
+bool8 dive_warp(struct MapPosition * pos, u16 behavior);
+bool8 sub_806DB84(u16 metatileBehavior, u8 playerDirection);
+const u8 *GetInteractedLinkPlayerScript(struct MapPosition *position, u8 metatileBehavior, u8 direction);
+const u8 *GetCoordEventScriptAtMapPosition(struct MapPosition *position);
+void FieldClearPlayerInput(struct FieldInput *input);
+int ProcessPlayerFieldInput(struct FieldInput *input);
+void FieldInput_HandleCancelSignpost(struct FieldInput * input);
+void FieldGetPlayerInput(struct FieldInput *input, u16 newKeys, u16 heldKeys);
#endif //GUARD_FIELD_CONTROL_AVATAR_H
diff --git a/include/field_fadetransition.h b/include/field_fadetransition.h
index a1fe590fa..d649fc02f 100644
--- a/include/field_fadetransition.h
+++ b/include/field_fadetransition.h
@@ -9,7 +9,7 @@ void DoDiveWarp(void);
void DoDoorWarp(void);
void DoFallWarp(void);
-void sub_807E59C(void);
+void DoTeleportWarp(void);
void sub_807E500(void);
void sub_807DF64(void);
void WarpFadeOutScreen(void);
@@ -22,5 +22,11 @@ void sub_807DCE4(void);
bool32 sub_807E418(void);
void palette_bg_faded_fill_black(void);
+void sub_807E4A0(u16 metatileBehavior, u16 delay);
+void DoEscalatorWarp(u8 a0);
+void DoLavaridgeGymB1FWarp(void);
+void DoLavaridgeGym1FWarp(void);
+void DoTeleportWarp(void);
+void DoUnionRoomWarp(void);
#endif // GUARD_FIELD_FADETRANSITION_H
diff --git a/include/field_specials.h b/include/field_specials.h
index b3291bf54..9c44c35bc 100644
--- a/include/field_specials.h
+++ b/include/field_specials.h
@@ -28,5 +28,8 @@ u8 GetUnlockedSeviiAreas(void);
u32 GetPlayerTrainerId(void);
bool8 CutMoveRuinValleyCheck(void);
void CutMoveOpenDottedHoleDoor(void);
+void RunMassageCooldownStepCounter(void);
+void IncrementResortGorgeousStepCounter(void);
+void IncrementBirthIslandRockStepCount(void);
#endif // GUARD_FIELD_SPECIALS_H
diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h
index e1998afdf..3c4b5f382 100644
--- a/include/global.fieldmap.h
+++ b/include/global.fieldmap.h
@@ -110,20 +110,18 @@ struct ObjectEventTemplate
struct WarpEvent
{
s16 x, y;
- s8 warpId;
- u8 mapGroup;
+ u8 elevation;
+ u8 warpId;
u8 mapNum;
- u8 unk7;
+ u8 mapGroup;
};
struct CoordEvent
{
- s16 x, y;
- u8 unk4;
- u8 filler_5;
+ u16 x, y;
+ u8 elevation;
u16 trigger;
u16 index;
- u8 filler_A[0x2];
u8 *script;
};
@@ -152,7 +150,7 @@ union BgUnion
struct BgEvent
{
u16 x, y;
- u8 unk4;
+ u8 elevation;
u8 kind;
// 0x2 padding for the union beginning.
union BgUnion bgUnion;
@@ -318,6 +316,14 @@ enum
COLLISION_HORIZONTAL_RAIL,
};
+// player running states
+enum
+{
+ NOT_MOVING,
+ TURN_DIRECTION, // not the same as turning! turns your avatar without moving. also known as a turn frame in some circles
+ MOVING,
+};
+
// player tile transition states
enum
{
diff --git a/include/item_menu.h b/include/item_menu.h
index 27bd73e72..fe593ff02 100644
--- a/include/item_menu.h
+++ b/include/item_menu.h
@@ -41,5 +41,6 @@ void InitOldManBag(void);
void Pocket_CalculateNItemsAndMaxShowed(u8 pocketId);
void PocketCalculateInitialCursorPosAndItemsAbove(u8 pocketId);
void GoToBagMenu(u8 menuType, u8 pocket, MainCallback callback);
+bool8 UseRegisteredKeyItemOnField(void);
#endif //GUARD_ITEM_MENU_H
diff --git a/include/metatile_behavior.h b/include/metatile_behavior.h
index 91a1824e5..ae3e6a01d 100644
--- a/include/metatile_behavior.h
+++ b/include/metatile_behavior.h
@@ -62,8 +62,8 @@ bool8 MetatileBehavior_UnusedIsMB_01(u8 metatileBehavior);
bool8 MetatileBehavior_UnusedIsTallGrass(u8 metatileBehavior);
bool8 MetatileBehavior_IsIndoorEncounter(u8 metatileBehavior);
bool8 MetatileBehavior_IsMountain(u8 metatileBehavior);
-bool8 MetatileBehavior_IsDeepOrSemiDeepWater(u8 metatileBehavior);
-bool8 MetatileBehavior_IsMB19(u8 metatileBehavior);
+bool8 MetatileBehavior_IsDiveable(u8 metatileBehavior);
+bool8 MetatileBehavior_IsUnableToEmerge(u8 metatileBehavior);
bool8 MetatileBehavior_IsShallowFlowingWater(u8 metatileBehavior);
bool8 MetatileBehavior_IsThinIce(u8 metatileBehavior);
bool8 MetatileBehavior_IsCrackedIce(u8 metatileBehavior);
@@ -89,9 +89,9 @@ bool8 MetatileBehavior_UnusedReturnFalse_5(u8 metatileBehavior);
bool8 MetatileBehavior_UnusedReturnFalse_6(u8 metatileBehavior);
bool8 MetatileBehavior_UnusedReturnFalse_7(u8 metatileBehavior);
bool8 MetatileBehavior_UnusedReturnFalse_8(u8 metatileBehavior);
-bool8 MetatileBehavior_ReturnFalse_12(u8 metatileBehavior);
-bool8 MetatileBheavior_IsMB_68(u8 metatileBehavior);
-bool8 MetatileBehavior_IsRegularWarp(u8 metatileBehavior);
+bool8 MetatileBehavior_IsLavaridgeB1FWarp(u8 metatileBehavior);
+bool8 MetatileBehavior_IsLavaridge1FWarp(u8 metatileBehavior);
+bool8 MetatileBehavior_IsWarpPad(u8 metatileBehavior);
bool8 MetatileBehavior_IsUnionRoomWarp(u8 metatileBehavior);
bool8 MetatileBehavior_IsWater(u8 metatileBehavior);
bool8 MetatileBehavior_IsFallWarp(u8 metatileBehavior);
diff --git a/include/overworld.h b/include/overworld.h
index 37274dfb4..bd4dda9b6 100644
--- a/include/overworld.h
+++ b/include/overworld.h
@@ -72,7 +72,7 @@ void Overworld_SetMapObjTemplateMovementType(u8, u8);
void SetWarpDestination(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
-void saved_warp2_set(int unused, s8 mapGroup, s8 mapNum, s8 warpId);
+void SetDynamicWarp(int unused, s8 mapGroup, s8 mapNum, s8 warpId);
void SetDynamicWarpWithCoords(int unused, s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
void SetFixedDiveWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
void SetFixedHoleWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
@@ -110,9 +110,9 @@ void WarpIntoMap(void);
u8 get_map_light_level_by_bank_and_number(s8 mapGroup, s8 mapNum);
void sub_8086194(void);
void sub_8084CCC(u8 spawn);
-void warp1_set_2(s8 mapGroup, s8 mapNum, s8 warpNum);
+void SetWarpDestinationToMapWarp(s8 mapGroup, s8 mapNum, s8 warpNum);
void c2_load_new_map(void);
-void copy_saved_warp2_bank_and_enter_x_to_warp1(u8 unused);
+void SetWarpDestinationToDynamicWarp(u8 unused);
void mapldr_default(void);
u32 GetGameStat(u8 statId);
@@ -194,6 +194,10 @@ void SetMainCallback1(MainCallback cb);
void CB1_Overworld(void);
void sub_80568C4(void);
u8 GetLastUsedWarpMapSectionId(void);
+void StoreInitialPlayerAvatarState(void);
+void UpdateEscapeWarp(s16 x, s16 y);
+bool8 SetDiveWarpEmerge(u16 x, u16 y);
+bool8 SetDiveWarpDive(u16 x, u16 y);
extern u16 *gBGTilemapBuffers1;
extern u16 *gBGTilemapBuffers2;
diff --git a/include/script.h b/include/script.h
index 2fb732396..3dd91ca59 100644
--- a/include/script.h
+++ b/include/script.h
@@ -53,27 +53,34 @@ void mapheader_run_script_with_tag_x3(void);
void mapheader_run_script_with_tag_x5(void);
void mapheader_run_script_with_tag_x7(void);
void mapheader_run_script_with_tag_x6(void);
-bool8 mapheader_run_first_tag2_script_list_match(void);
+bool8 TryRunOnFrameMapScript(void);
void mapheader_run_first_tag4_script_list_match(void);
u32 CalculateRamScriptChecksum(void);
void ClearRamScript(void);
bool8 InitRamScript(u8 *script, u16 scriptSize, u8 mapGroup, u8 mapNum, u8 objectId);
-u8 *GetRamScript(u8 objectId, u8 *script);
+const u8 *GetRamScript(u8 objectId, const u8 *script);
bool32 sub_80991F8(void);
u8 *sub_8099244(void);
void sub_80992A0(u8 *script, u16 scriptSize);
bool32 ValidateRamScript(void);
void MEventSetRamScript(u8 * script, u16 scriptSize);
u8 * sub_8069E48(void);
-void sub_8069998(u8 var);
-void sub_80699F8(void);
-void sub_8069964(void);
-void sub_80699A4(void);
-void sub_8069970(void);
-void sub_8069A20(void);
-void sub_8069A2C(void);
+void RegisterQuestLogInput(u8 var);
+void ClearMsgBoxCancelableState(void);
+void SetQuestLogInputIsDpadFlag(void);
+void ClearQuestLogInput(void);
+void ClearQuestLogInputIsDpadFlag(void);
+void MsgSetSignPost(void);
+void MsgSetNotSignPost(void);
bool8 IsMsgSignPost(void);
+bool8 IsQuestLogInputDpad(void);
+u8 GetRegisteredQuestLogInput(void);
+void ResetFacingNpcOrSignPostVars(void);
+bool8 CanWalkAwayToCancelMsgBox(void);
+void SetWalkingIntoSignVars(void);
+bool8 sub_80699D4(void);
extern const u8 *gRAMScriptPtr;
+extern u8 gWalkAwayFromSignInhibitTimer;
#endif // GUARD_SCRIPT_H
diff --git a/include/script_menu.h b/include/script_menu.h
index 0e166e7c7..006ce5578 100644
--- a/include/script_menu.h
+++ b/include/script_menu.h
@@ -15,6 +15,6 @@ void ScriptMenu_DisplayPCStartupPrompt(void);
bool8 (*ScriptMenu_GetPicboxWaitFunc(void))(void);
void QLPlaybackCB_DestroyScriptMenuMonPicSprites(void);
-void sub_809D424(void);
+void PicboxCancel(void);
#endif //GUARD_SCRIPT_MENU_H
diff --git a/include/vs_seeker.h b/include/vs_seeker.h
index 2d88417fa..d80e558ea 100644
--- a/include/vs_seeker.h
+++ b/include/vs_seeker.h
@@ -14,5 +14,6 @@ bool8 sub_810CF04(u8 a0);
u8 sub_810CF54();
void sub_810D0D0(void);
void sub_810CB90(void);
+bool8 sub_810C4EC(void);
#endif //GUARD_VS_SEEKER_H
diff --git a/include/wild_encounter.h b/include/wild_encounter.h
index 5d57ddd12..fd44b7d4a 100644
--- a/include/wild_encounter.h
+++ b/include/wild_encounter.h
@@ -46,5 +46,6 @@ u8 GetUnownLetterByPersonalityLoByte(u32 personality);
bool8 SweetScentWildEncounter(void);
void SeedWildEncounterRng(u16 randVal);
void ResetEncounterRateModifiers(void);
+bool8 TryStandardWildEncounter(u32 currMetatileBehavior);
#endif // GUARD_WILD_ENCOUNTER_H