summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/battle.h10
-rw-r--r--include/battle_arena.h14
-rw-r--r--include/battle_controllers.h2
-rw-r--r--include/battle_factory.h9
-rw-r--r--include/battle_factory_screen.h7
-rw-r--r--include/battle_interface.h2
-rw-r--r--include/battle_pike.h9
-rw-r--r--include/battle_scripts.h2
-rw-r--r--include/battle_tower.h4
-rw-r--r--include/berry.h24
-rw-r--r--include/constants/battle_script_commands.h7
-rw-r--r--include/constants/field_effects.h72
-rw-r--r--include/event_object_movement.h6
-rw-r--r--include/event_scripts.h50
-rw-r--r--include/field_camera.h10
-rw-r--r--include/field_control_avatar.h2
-rw-r--r--include/field_effect.h193
-rw-r--r--include/field_effect_helpers.h2
-rw-r--r--include/field_poison.h4
-rw-r--r--include/field_region_map.h6
-rw-r--r--include/fieldmap.h1
-rw-r--r--include/fldeff_80F9BCC.h2
-rw-r--r--include/fldeff_teleport.h7
-rw-r--r--include/frontier_util.h1
-rw-r--r--include/global.fieldmap.h18
-rw-r--r--include/global.h34
-rw-r--r--include/main.h2
-rw-r--r--include/metatile_behavior.h2
-rw-r--r--include/overworld.h16
-rw-r--r--include/pokemon.h2
30 files changed, 240 insertions, 280 deletions
diff --git a/include/battle.h b/include/battle.h
index f34364ea6..90bef24ac 100644
--- a/include/battle.h
+++ b/include/battle.h
@@ -498,10 +498,12 @@ struct BattleStruct
struct BattleTv tv;
u8 notSureWhatFieldLol[0x28];
u8 AI_monToSwitchIntoId[MAX_BATTLERS_COUNT];
- u8 field_298[8];
- u8 field_2A0;
- u8 field_2A1;
- u8 field_2A2;
+ s8 arenaMindPoints[2];
+ s8 arenaSkillPoints[2];
+ u16 arenaStartHp[2];
+ u8 arenaLostPlayerMons; // Bits for party member, lost as in referee's decision, not by fainting.
+ u8 arenaLostOpponentMons;
+ u8 alreadyStatusedMoveAttempt; // As bits for battlers; For example when using Thunder Wave on an already paralyzed pokemon.
};
#define GET_MOVE_TYPE(move, typeArg) \
diff --git a/include/battle_arena.h b/include/battle_arena.h
new file mode 100644
index 000000000..bf305ea4e
--- /dev/null
+++ b/include/battle_arena.h
@@ -0,0 +1,14 @@
+#ifndef GUARD_BATTLE_ARENA_H
+#define GUARD_BATTLE_ARENA_H
+
+void CallBattleArenaFunction(void);
+u8 BattleArena_ShowJudgmentWindow(u8 *state);
+void BattleArena_InitPoints(void);
+void BattleArena_AddMindPoints(u8 battler);
+void BattleArena_AddSkillPoints(u8 battler);
+void BattleArena_DeductMindPoints(u8 battler, u16 stringId);
+void sub_81A586C(u8 battler);
+void sub_81A5BF8(void);
+void sub_81A5D44(void);
+
+#endif //GUARD_BATTLE_ARENA_H
diff --git a/include/battle_controllers.h b/include/battle_controllers.h
index b449bb501..ff5a629af 100644
--- a/include/battle_controllers.h
+++ b/include/battle_controllers.h
@@ -1,8 +1,6 @@
#ifndef GUARD_BATTLE_CONTROLLERS_H
#define GUARD_BATTLE_CONTROLLERS_H
-#include "battle.h"
-
enum
{
REQUEST_ALL_BATTLE,
diff --git a/include/battle_factory.h b/include/battle_factory.h
index 1b0e44943..2db041b06 100644
--- a/include/battle_factory.h
+++ b/include/battle_factory.h
@@ -1,7 +1,12 @@
#ifndef GUARD_BATTLE_FACTORY_H
#define GUARD_BATTLE_FACTORY_H
-void DoBattleFactorySelectScreen(void);
-void DoBattleFactorySwapScreen(void);
+void CallBattleFactoryFunction(void);
+bool8 sub_81A6BF4(void);
+u8 GetFactoryMonFixedIV(u8 arg0, u8 arg1);
+void FillFactoryBrainParty(void);
+u8 sub_81A6F70(u8 battleMode, u8 lvlMode);
+u32 GetAiScriptsInBattleFactory(void);
+void SetMonMoveAvoidReturn(struct Pokemon *mon, u16 moveArg, u8 moveSlot);
#endif // GUARD_BATTLE_FACTORY_H
diff --git a/include/battle_factory_screen.h b/include/battle_factory_screen.h
new file mode 100644
index 000000000..86d6177f6
--- /dev/null
+++ b/include/battle_factory_screen.h
@@ -0,0 +1,7 @@
+#ifndef GUARD_BATTLE_FACTORY_SCREEN_H
+#define GUARD_BATTLE_FACTORY_SCREEN_H
+
+void DoBattleFactorySelectScreen(void);
+void DoBattleFactorySwapScreen(void);
+
+#endif // GUARD_BATTLE_FACTORY_SCREEN_H
diff --git a/include/battle_interface.h b/include/battle_interface.h
index 3145939d0..66a7f9828 100644
--- a/include/battle_interface.h
+++ b/include/battle_interface.h
@@ -1,8 +1,6 @@
#ifndef GUARD_BATTLE_INTERFACE_H
#define GUARD_BATTLE_INTERFACE_H
-#include "battle_controllers.h"
-
enum
{
HP_CURRENT,
diff --git a/include/battle_pike.h b/include/battle_pike.h
new file mode 100644
index 000000000..ada5b2441
--- /dev/null
+++ b/include/battle_pike.h
@@ -0,0 +1,9 @@
+#ifndef GUARD_BATTLE_PIKE_H
+#define GUARD_BATTLE_PIKE_H
+
+void CallBattlePikeFunction(void);
+u8 GetBattlePikeWildMonHeaderId(void);
+bool32 TryGenerateBattlePikeWildMon(bool8 checkKeenEyeIntimidate);
+bool8 InBattlePike(void);
+
+#endif // GUARD_BATTLE_PIKE_H
diff --git a/include/battle_scripts.h b/include/battle_scripts.h
index 9c4537363..a23fa6948 100644
--- a/include/battle_scripts.h
+++ b/include/battle_scripts.h
@@ -206,7 +206,7 @@ extern const u8 BattleScript_BerryFocusEnergyEnd2[];
extern const u8 BattleScript_ActionSelectionItemsCantBeUsed[];
extern const u8 BattleScript_ArenaTurnBeginning[];
extern const u8 BattleScript_82DB881[];
-extern const u8 BattleScript_82DB8F3[];
+extern const u8 BattleScript_ArenaDoJudgment[];
extern const u8 BattleScript_82DAA0B[];
extern const u8 BattleScript_AskIfWantsToForfeitMatch[];
extern const u8 BattleScript_PrintPlayerForfeited[];
diff --git a/include/battle_tower.h b/include/battle_tower.h
index 5fe8d1190..90c22c982 100644
--- a/include/battle_tower.h
+++ b/include/battle_tower.h
@@ -21,7 +21,7 @@ struct BattleFrontierTrainer
u16 speechBefore[6];
u16 speechWin[6];
u16 speechLose[6];
- const u16 *bfMonPool;
+ const u16 *monSets;
};
struct FacilityMon
@@ -52,7 +52,7 @@ u8 GetFrontierOpponentClass(u16 trainerId);
void GetFrontierTrainerName(u8 *dst, u16 trainerId);
void FillFrontierTrainerParty(u8 monsCount);
void FillFrontierTrainersParties(u8 monsCount);
-u16 RandomizeFacilityTrainerMonId(u16 trainerId);
+u16 RandomizeFacilityTrainerMonSet(u16 trainerId);
void FrontierSpeechToString(const u16 *words);
void DoSpecialTrainerBattle(void);
void CalcEmeraldBattleTowerChecksum(struct EmeraldBattleTowerRecord *record);
diff --git a/include/berry.h b/include/berry.h
index 1a8b7fa25..bef56ae41 100644
--- a/include/berry.h
+++ b/include/berry.h
@@ -1,6 +1,8 @@
#ifndef GUARD_BERRY_H
#define GUARD_BERRY_H
+#define BERRY_NONE 0
+
enum
{
BERRY_FIRMNESS_UNKNOWN,
@@ -21,6 +23,17 @@ enum
FLAVOR_COUNT
};
+enum
+{
+ BERRY_STAGE_NO_BERRY, // there is no tree planted and the soil is completely flat.
+ BERRY_STAGE_PLANTED,
+ BERRY_STAGE_SPROUTED,
+ BERRY_STAGE_TALLER,
+ BERRY_STAGE_FLOWERING,
+ BERRY_STAGE_BERRIES,
+ BERRY_STAGE_SPARKLING = 0xFF,
+};
+
#define NUM_BERRIES 44
extern const u8 *const gBerryTreeEventObjectGraphicsIdTablePointers[];
@@ -29,7 +42,6 @@ extern const u8 *const gBerryTreePaletteSlotTablePointers[];
void ClearEnigmaBerries(void);
void SetEnigmaBerry(u8 *src);
-u32 GetEnigmaBerryChecksum(struct EnigmaBerry *enigmaBerry);
bool32 IsEnigmaBerryValid(void);
const struct Berry *GetBerryInfo(u8 berry);
struct BerryTree *GetBerryTreeInfo(u8 id);
@@ -37,28 +49,20 @@ bool32 EventObjectInteractionWaterBerryTree(void);
bool8 IsPlayerFacingPlantedBerryTree(void);
bool8 TryToWaterBerryTree(void);
void ClearBerryTrees(void);
-bool32 BerryTreeGrow(struct BerryTree *tree);
void BerryTreeTimeUpdate(s32 minutes);
void PlantBerryTree(u8 id, u8 berry, u8 stage, bool8 sparkle);
void RemoveBerryTree(u8 id);
u8 GetBerryTypeByBerryTreeId(u8 id);
u8 GetStageByBerryTreeId(u8);
u8 ItemIdToBerryType(u16 item);
-u16 BerryTypeToItemId(u16 berry);
void GetBerryNameByBerryType(u8 berry, u8 *string);
void ResetBerryTreeSparkleFlag(u8 id);
-u8 BerryTreeGetNumStagesWatered(struct BerryTree *tree);
-u8 GetNumStagesWateredByBerryTreeId(u8 id);
-u8 CalcBerryYieldInternal(u16 max, u16 min, u8 water);
-u8 CalcBerryYield(struct BerryTree *tree);
-u8 GetBerryCountByBerryTreeId(u8 id);
-u16 GetStageDurationByBerryType(u8);
void Bag_ChooseBerry(void);
void EventObjectInteractionGetBerryTreeData(void);
void EventObjectInteractionPlantBerryTree(void);
void EventObjectInteractionPickBerryTree(void);
void EventObjectInteractionRemoveBerryTree(void);
-u8 PlayerHasBerries(void);
+bool8 PlayerHasBerries(void);
void ResetBerryTreeSparkleFlags(void);
extern const struct Berry gBerries[];
diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h
index dc07fda6e..e8a2980a5 100644
--- a/include/constants/battle_script_commands.h
+++ b/include/constants/battle_script_commands.h
@@ -68,12 +68,19 @@
#define VARIOUS_GET_MOVE_TARGET 3
#define VARIOUS_RESET_INTIMIDATE_TRACE_BITS 5
#define VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP 6
+#define VARIOUS_ARENA_JUDGMENT_WINDOW 9
+#define VARIOUS_ARENA_OPPONENT_MON_LOST 10
+#define VARIOUS_ARENA_PLAYER_MON_LOST 11
+#define VARIOUS_ARENA_BOTH_MONS_LOST 12
#define VARIOUS_EMIT_YESNOBOX 13
+#define VARIOUS_ARENA_JUDGMENT_STRING 16
+#define VARIOUS_ARENA_WAIT_STRING 17
#define VARIOUS_WAIT_CRY 18
#define VARIOUS_RETURN_OPPONENT_MON1 19
#define VARIOUS_RETURN_OPPONENT_MON2 20
#define VARIOUS_VOLUME_DOWN 21
#define VARIOUS_VOLUME_UP 22
+#define VARIOUS_SET_ALREADY_STATUS_MOVE_ATTEMPT 23
#define VARIOUS_SET_TELEPORT_OUTCOME 25
#define VARIOUS_PLAY_TRAINER_DEFEATED_MUSIC 26
diff --git a/include/constants/field_effects.h b/include/constants/field_effects.h
new file mode 100644
index 000000000..b93b98201
--- /dev/null
+++ b/include/constants/field_effects.h
@@ -0,0 +1,72 @@
+#ifndef GUARD_FIELD_EFFECT_CONSTANTS_H
+#define GUARD_FIELD_EFFECT_CONSTANTS_H
+
+#define FLDEFF_EXCLAMATION_MARK_ICON 0
+#define FLDEFF_USE_CUT_ON_GRASS 1
+#define FLDEFF_USE_CUT_ON_TREE 2
+#define FLDEFF_SHADOW 3
+#define FLDEFF_TALL_GRASS 4
+#define FLDEFF_RIPPLE 5
+#define FLDEFF_FIELD_MOVE_SHOW_MON 6
+#define FLDEFF_ASH 7
+#define FLDEFF_SURF_BLOB 8
+#define FLDEFF_USE_SURF 9
+#define FLDEFF_DUST 10
+#define FLDEFF_USE_SECRET_POWER_CAVE 11
+#define FLDEFF_JUMP_TALL_GRASS 12
+#define FLDEFF_SAND_FOOTPRINTS 13
+#define FLDEFF_JUMP_BIG_SPLASH 14
+#define FLDEFF_SPLASH 15
+#define FLDEFF_JUMP_SMALL_SPLASH 16
+#define FLDEFF_LONG_GRASS 17
+#define FLDEFF_JUMP_LONG_GRASS 18
+#define FLDEFF_UNKNOWN_19 19
+#define FLDEFF_UNKNOWN_20 20
+#define FLDEFF_UNKNOWN_21 21
+#define FLDEFF_UNKNOWN_22 22
+#define FLDEFF_BERRY_TREE_GROWTH_SPARKLE 23
+#define FLDEFF_DEEP_SAND_FOOTPRINTS 24
+#define FLDEFF_POKECENTER_HEAL 25
+#define FLDEFF_USE_SECRET_POWER_TREE 26
+#define FLDEFF_USE_SECRET_POWER_SHRUB 27
+#define FLDEFF_TREE_DISGUISE 28
+#define FLDEFF_MOUNTAIN_DISGUISE 29
+#define FLDEFF_NPCFLY_OUT 30
+#define FLDEFF_USE_FLY 31
+#define FLDEFF_FLY_IN 32
+#define FLDEFF_QUESTION_MARK_ICON 33
+#define FLDEFF_FEET_IN_FLOWING_WATER 34
+#define FLDEFF_BIKE_TIRE_TRACKS 35
+#define FLDEFF_SAND_DISGUISE 36
+#define FLDEFF_USE_ROCK_SMASH 37
+#define FLDEFF_USE_DIG 38
+#define FLDEFF_SAND_PILE 39
+#define FLDEFF_USE_STRENGTH 40
+#define FLDEFF_SHORT_GRASS 41
+#define FLDEFF_HOT_SPRINGS_WATER 42
+#define FLDEFF_USE_WATERFALL 43
+#define FLDEFF_USE_DIVE 44
+#define FLDEFF_POKEBALL 45
+#define FLDEFF_HEART_ICON 46
+#define FLDEFF_NOP_47 47
+#define FLDEFF_NOP_48 48
+#define FLDEFF_POP_OUT_OF_ASH 49
+#define FLDEFF_LAVARIDGE_GYM_WARP 50
+#define FLDEFF_SWEET_SCENT 51
+#define FLDEFF_SAND_PILLAR 52
+#define FLDEFF_BUBBLES 53
+#define FLDEFF_SPARKLE 54
+#define FLDEFF_SECRET_POWER_CAVE 55
+#define FLDEFF_SECRET_POWER_TREE 56
+#define FLDEFF_SECRET_POWER_SHRUB 57
+#define FLDEFF_CUT_GRASS 58
+#define FLDEFF_FIELD_MOVE_SHOW_MON_INIT 59
+#define FLDEFF_USE_FLY_ANCIENT_TOMB 60
+#define FLDEFF_PCTURN_ON 61
+#define FLDEFF_HALL_OF_FAME_RECORD 62
+#define FLDEFF_USE_TELEPORT 63
+#define FLDEFF_64 64
+#define FLDEFF_65 65
+#define FLDEFF_66 66
+
+#endif
diff --git a/include/event_object_movement.h b/include/event_object_movement.h
index 6d38d072d..6515791c3 100644
--- a/include/event_object_movement.h
+++ b/include/event_object_movement.h
@@ -75,14 +75,14 @@ struct PairedPalettes
struct LockedAnimEventObjects
{
- u8 eventObjectIds[NUM_EVENT_OBJECTS];
+ u8 eventObjectIds[EVENT_OBJECTS_COUNT];
u8 count;
};
extern const struct SpriteFrameImage gEventObjectPicTable_PechaBerryTree[];
extern const u8 gReflectionEffectPaletteMap[];
-void sub_808D438(void);
+void ResetEventObjects(void);
u8 GetMoveDirectionAnimNum(u8);
u8 GetEventObjectIdByLocalIdAndMap(u8, u8, u8);
bool8 TryGetEventObjectIdByLocalIdAndMap(u8, u8, u8, u8 *);
@@ -180,9 +180,7 @@ u8 ZCoordToPriority(u8);
void EventObjectUpdateZCoord(struct EventObject *pObject);
void SetObjectSubpriorityByZCoord(u8, struct Sprite *, u8);
bool8 IsZCoordMismatchAt(u8, s16, s16);
-void UpdateEventObjectSpriteSubpriorityAndVisibility(struct Sprite *);
void UnfreezeEventObject(struct EventObject *);
-void oamt_npc_ministep_reset(struct Sprite *, u8, u8);
u8 FindLockedEventObjectIndex(struct EventObject *);
bool8 obj_npc_ministep(struct Sprite *sprite);
bool8 sub_80976EC(struct Sprite *sprite);
diff --git a/include/event_scripts.h b/include/event_scripts.h
index 5b8b74d8b..dd0eca12f 100644
--- a/include/event_scripts.h
+++ b/include/event_scripts.h
@@ -528,4 +528,54 @@ extern const u8 MauvilleCity_PokemonCenter_1F_Text_290097[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_2900B5[];
extern const u8 MauvilleCity_PokemonCenter_1F_Text_2900CB[];
+extern const u8 EventScript_PlayerPCMale[];
+extern const u8 EventScript_PlayerPCFemale[];
+extern const u8 EventScript_SecretBasePC[];
+extern const u8 EventScript_RecordMixingSecretBasePC[];
+extern const u8 EventScript_SecretPower1[];
+extern const u8 EventScript_SecretPower2[];
+extern const u8 EventScript_PC[];
+extern const u8 EventScript_TestSignpostMsg[];
+extern const u8 EventScript_HiddenItemScript[];
+extern const u8 EventScript_2759F1[];
+extern const u8 EventScript_TV[];
+extern const u8 EventScript_ClosedSootopolisDoor[];
+extern const u8 SkyPillar_Outside_EventScript_2393F9[];
+extern const u8 EventScript_CableBoxResults[];
+extern const u8 EventScript_2A4BAC[];
+extern const u8 Route110_TrickHouseEntrance_EventScript_26A22A[];
+extern const u8 EventScript_RegionMap[];
+extern const u8 EventScript_RunningShoesManual[];
+extern const u8 EventScript_PictureBookShelf[];
+extern const u8 EventScript_BookShelf[];
+extern const u8 EventScript_PokemonCenterBookshelf[];
+extern const u8 EventScript_Vase[];
+extern const u8 EventScript_TrashCan[];
+extern const u8 EventScript_ShopShelf[];
+extern const u8 EventScript_Blueprint[];
+extern const u8 EventScript_WirelessBoxResults[];
+extern const u8 EventScript_CableBoxResults[];
+extern const u8 EventScript_Questionnaire[];
+extern const u8 EventScript_TrainerHillTimer[];
+extern const u8 EventScript_SecretBaseSandOrnament[];
+extern const u8 EventScript_SecretBaseShieldOrToyTV[];
+extern const u8 EventScript_UseSurf[];
+extern const u8 EventScript_UseWaterfall[];
+extern const u8 EventScript_CannotUseWaterfall[];
+extern const u8 EventScript_UseDive[];
+extern const u8 EventScript_UseDiveUnderwater[];
+extern const u8 EventScript_FallDownHole[];
+extern const u8 BattleFrontier_BattlePyramidEmptySquare_EventScript_252BE8[];
+extern const u8 EventScript_Poison[];
+extern const u8 EventScript_EggHatch[];
+extern const u8 gUnknown_08273D1F[];
+extern const u8 IslandCave_EventScript_238EAF[];
+extern const u8 MauvilleCity_EventScript_1DF7BA[];
+extern const u8 Route119_EventScript_1F49EC[];
+extern const u8 LittlerootTown_ProfessorBirchsLab_EventScript_1FA4D6[];
+extern const u8 RustboroCity_Gym_EventScript_21307B[];
+extern const u8 MossdeepCity_SpaceCenter_2F_EventScript_224175[];
+extern const u8 SSTidalCorridor_EventScript_23C050[];
+extern const u8 gUnknown_082A8350[];
+
#endif //GUARD_EVENT_SCRIPTS_H
diff --git a/include/field_camera.h b/include/field_camera.h
index fcc19ce9a..fdc4c5450 100644
--- a/include/field_camera.h
+++ b/include/field_camera.h
@@ -7,16 +7,16 @@ struct CameraObject
{
void (*callback)(struct CameraObject *);
u32 spriteId;
- s32 unk8;
- s32 unkC;
+ s32 movementSpeedX;
+ s32 movementSpeedY;
s32 x;
s32 y;
};
// Exported RAM declarations
-extern struct CameraObject gUnknown_03005DD0;
-extern u16 gUnknown_03005DEC;
-extern u16 gUnknown_03005DE8;
+extern struct CameraObject gFieldCamera;
+extern u16 gTotalCameraPixelOffsetX;
+extern u16 gTotalCameraPixelOffsetY;
// Exported ROM declarations
void DrawWholeMapView(void);
diff --git a/include/field_control_avatar.h b/include/field_control_avatar.h
index 536f218a3..24adbe4b3 100644
--- a/include/field_control_avatar.h
+++ b/include/field_control_avatar.h
@@ -25,7 +25,7 @@ struct FieldInput
void FieldClearPlayerInput(struct FieldInput *pStruct);
void FieldGetPlayerInput(struct FieldInput *pStruct, u16 keys, u16 heldKeys);
-int sub_809C014(struct FieldInput *pStruct);
+int ProcessPlayerFieldInput(struct FieldInput *pStruct);
u8 *sub_80682A8(struct MapPosition *, u8, u8);
void overworld_poison_timer_set(void);
void RestartWildEncounterImmunitySteps(void);
diff --git a/include/field_effect.h b/include/field_effect.h
index 3fa39aae0..7620cedcd 100644
--- a/include/field_effect.h
+++ b/include/field_effect.h
@@ -1,85 +1,12 @@
#ifndef GUARD_FIELD_EFFECTS_H
#define GUARD_FIELD_EFFECTS_H
-#include "task.h"
-
extern const struct CompressedSpritePalette gTrainerFrontPicPaletteTable[2];
extern const struct SpritePalette gNewGameBirchObjectPaletteInfo;
extern const struct CompressedSpriteSheet gTrainerFrontPicTable[2];
extern const struct SpriteTemplate gNewGameBirchObjectTemplate;
extern const struct OamData gNewGameBirchOamAttributes;
-enum FieldEffectScriptIdx
-{
- FLDEFF_EXCLAMATION_MARK_ICON,
- FLDEFF_USE_CUT_ON_GRASS,
- FLDEFF_USE_CUT_ON_TREE,
- FLDEFF_SHADOW,
- FLDEFF_TALL_GRASS,
- FLDEFF_RIPPLE,
- FLDEFF_FIELD_MOVE_SHOW_MON,
- FLDEFF_ASH,
- FLDEFF_SURF_BLOB,
- FLDEFF_USE_SURF,
- FLDEFF_DUST,
- FLDEFF_USE_SECRET_POWER_CAVE,
- FLDEFF_JUMP_TALL_GRASS,
- FLDEFF_SAND_FOOTPRINTS,
- FLDEFF_JUMP_BIG_SPLASH,
- FLDEFF_SPLASH,
- FLDEFF_JUMP_SMALL_SPLASH,
- FLDEFF_LONG_GRASS,
- FLDEFF_JUMP_LONG_GRASS,
- FLDEFF_UNKNOWN_19,
- FLDEFF_UNKNOWN_20,
- FLDEFF_UNKNOWN_21,
- FLDEFF_UNKNOWN_22,
- FLDEFF_BERRY_TREE_GROWTH_SPARKLE,
- FLDEFF_DEEP_SAND_FOOTPRINTS,
- FLDEFF_POKECENTER_HEAL,
- FLDEFF_USE_SECRET_POWER_TREE,
- FLDEFF_USE_SECRET_POWER_SHRUB,
- FLDEFF_TREE_DISGUISE,
- FLDEFF_MOUNTAIN_DISGUISE,
- FLDEFF_NPCFLY_OUT,
- FLDEFF_USE_FLY,
- FLDEFF_FLY_IN,
- FLDEFF_QUESTION_MARK_ICON,
- FLDEFF_FEET_IN_FLOWING_WATER,
- FLDEFF_BIKE_TIRE_TRACKS,
- FLDEFF_SAND_DISGUISE,
- FLDEFF_USE_ROCK_SMASH,
- FLDEFF_USE_DIG,
- FLDEFF_SAND_PILE,
- FLDEFF_USE_STRENGTH,
- FLDEFF_SHORT_GRASS,
- FLDEFF_HOT_SPRINGS_WATER,
- FLDEFF_USE_WATERFALL,
- FLDEFF_USE_DIVE,
- FLDEFF_POKEBALL,
- FLDEFF_HEART_ICON,
- FLDEFF_NOP_47,
- FLDEFF_NOP_48,
- FLDEFF_POP_OUT_OF_ASH,
- FLDEFF_LAVARIDGE_GYM_WARP,
- FLDEFF_SWEET_SCENT,
- FLDEFF_SAND_PILLAR,
- FLDEFF_BUBBLES,
- FLDEFF_SPARKLE,
- FLDEFF_SECRET_POWER_CAVE,
- FLDEFF_SECRET_POWER_TREE,
- FLDEFF_SECRET_POWER_SHRUB,
- FLDEFF_CUT_GRASS,
- FLDEFF_FIELD_MOVE_SHOW_MON_INIT,
- FLDEFF_USE_FLY_ANCIENT_TOMB,
- FLDEFF_PCTURN_ON,
- FLDEFF_HALL_OF_FAME_RECORD,
- FLDEFF_USE_TELEPORT,
- FLDEFF_64,
- FLDEFF_65,
- FLDEFF_66,
-};
-
extern s32 gFieldEffectArguments[8];
extern void (*gPostMenuFieldCallback)(void);
extern bool8 (*gFieldCallback2)(void);
@@ -109,126 +36,6 @@ bool8 FieldEffectCmd_loadgfx_callnative(u8 **script, u32 *val);
bool8 FieldEffectCmd_loadtiles_callnative(u8 **script, u32 *val);
bool8 FieldEffectCmd_loadfadedpal_callnative(u8 **script, u32 *val);
-void PokecenterHealEffect_0(struct Task *);
-void PokecenterHealEffect_1(struct Task *);
-void PokecenterHealEffect_2(struct Task *);
-void PokecenterHealEffect_3(struct Task *);
-
-void HallOfFameRecordEffect_0(struct Task *);
-void HallOfFameRecordEffect_1(struct Task *);
-void HallOfFameRecordEffect_2(struct Task *);
-void HallOfFameRecordEffect_3(struct Task *);
-
-void PokeballGlowEffect_0(struct Sprite *);
-void PokeballGlowEffect_1(struct Sprite *);
-void PokeballGlowEffect_2(struct Sprite *);
-void PokeballGlowEffect_3(struct Sprite *);
-void PokeballGlowEffect_4(struct Sprite *);
-void PokeballGlowEffect_5(struct Sprite *);
-void PokeballGlowEffect_6(struct Sprite *);
-void PokeballGlowEffect_7(struct Sprite *);
-
-bool8 sub_80B6BCC(struct Task *);
-bool8 sub_80B6C74(struct Task *);
-bool8 sub_80B6C90(struct Task *);
-bool8 sub_80B6D04(struct Task *);
-bool8 sub_80B6DBC(struct Task *);
-bool8 sub_80B6DD8(struct Task *);
-bool8 sub_80B6E18(struct Task *);
-
-bool8 sub_80B6EC0(struct Task *);
-bool8 sub_80B6EE0(struct Task *);
-bool8 sub_80B6F50(struct Task *);
-bool8 sub_80B6F74(struct Task *);
-bool8 sub_80B6F84(struct Task *);
-bool8 sub_80B6FA8(struct Task *);
-
-bool8 sub_80B7114(struct Task *);
-bool8 sub_80B7190(struct Task *);
-bool8 sub_80B71D0(struct Task *);
-bool8 sub_80B7230(struct Task *);
-bool8 sub_80B7270(struct Task *);
-bool8 sub_80B72D0(struct Task *);
-bool8 sub_80B72F4(struct Task *);
-
-bool8 sub_80B73D0(struct Task *, struct EventObject *);
-bool8 waterfall_1_do_anim_probably(struct Task *, struct EventObject *);
-bool8 waterfall_2_wait_anim_finish_probably(struct Task *, struct EventObject *);
-bool8 sub_80B7450(struct Task *, struct EventObject *);
-bool8 sub_80B7478(struct Task *, struct EventObject *);
-
-bool8 dive_1_lock(struct Task *);
-bool8 dive_2_unknown(struct Task *);
-bool8 dive_3_unknown(struct Task *);
-
-bool8 sub_80B764C(struct Task *, struct EventObject *, struct Sprite *);
-bool8 sub_80B7684(struct Task *, struct EventObject *, struct Sprite *);
-bool8 sub_80B76B8(struct Task *, struct EventObject *, struct Sprite *);
-bool8 sub_80B7704(struct Task *, struct EventObject *, struct Sprite *);
-bool8 sub_80B77F8(struct Task *, struct EventObject *, struct Sprite *);
-bool8 sub_80B7814(struct Task *, struct EventObject *, struct Sprite *);
-
-bool8 sub_80B78EC(struct Task *, struct EventObject *, struct Sprite *);
-bool8 sub_80B791C(struct Task *, struct EventObject *, struct Sprite *);
-bool8 sub_80B7968(struct Task *, struct EventObject *, struct Sprite *);
-bool8 sub_80B79BC(struct Task *, struct EventObject *, struct Sprite *);
-
-bool8 sub_80B7AE8(struct Task *, struct EventObject *, struct Sprite *);
-bool8 sub_80B7B18(struct Task *, struct EventObject *, struct Sprite *);
-bool8 sub_80B7B94(struct Task *, struct EventObject *, struct Sprite *);
-bool8 sub_80B7BCC(struct Task *, struct EventObject *, struct Sprite *);
-bool8 sub_80B7BF4(struct Task *, struct EventObject *, struct Sprite *);
-
-void sub_80B7D14(struct Task *);
-void sub_80B7D34(struct Task *);
-
-void sub_80B7EC4(struct Task *);
-void sub_80B7EE8(struct Task *);
-
-void sub_80B8280(struct Task *);
-void sub_80B830C(struct Task *);
-void sub_80B8410(struct Task *);
-
-void sub_80B8584(struct Task *);
-void sub_80B85F8(struct Task *);
-void sub_80B8660(struct Task *);
-void sub_80B86EC(struct Task *);
-void sub_80B871C(struct Task *);
-void sub_80B8770(struct Task *);
-void overworld_bg_setup_2(struct Task *);
-
-void sub_80B88E4(struct Task *);
-void sub_80B8920(struct Task *);
-void sub_80B898C(struct Task *);
-void sub_80B89DC(struct Task *);
-void sub_80B8A0C(struct Task *);
-void sub_80B8A44(struct Task *);
-void sub_80B8A64(struct Task *);
-
-void sub_80B8DB4(struct Task *);
-void sub_80B8E14(struct Task *);
-void sub_80B8E60(struct Task *);
-void sub_80B8EA8(struct Task *);
-void sub_80B8F24(struct Task *);
-
-void sub_80B9204(struct Task *);
-void sub_80B925C(struct Task *);
-void sub_80B92A0(struct Task *);
-void sub_80B92F8(struct Task *);
-void sub_80B933C(struct Task *);
-void sub_80B9390(struct Task *);
-void sub_80B9418(struct Task *);
-void sub_80B9474(struct Task *);
-void sub_80B9494(struct Task *);
-
-void sub_80B9804(struct Task *);
-void sub_80B98B8(struct Task *);
-void sub_80B9924(struct Task *);
-void sub_80B9978(struct Task *);
-void sub_80B99F0(struct Task *);
-void sub_80B9A28(struct Task *);
-void sub_80B9A60(struct Task *);
-
void sub_80B9C28(s16*, u8);
void sub_80B9C54(s16*, u8);
void sub_80B9CDC(s16*, u8);
diff --git a/include/field_effect_helpers.h b/include/field_effect_helpers.h
index 223350042..6022467e4 100644
--- a/include/field_effect_helpers.h
+++ b/include/field_effect_helpers.h
@@ -18,7 +18,7 @@ u8 FindTallGrassFieldEffectSpriteId(u8 localId, u8 mapNum, u8 mapGroup, s16 x, s
void sub_8155F80(struct Sprite*);
void UpdateShadowFieldEffect(struct Sprite*);
void UpdateTallGrassFieldEffect(struct Sprite*);
-void sub_81561D0(struct Sprite*);
+void WaitFieldEffectSpriteAnim(struct Sprite*);
void UpdateAshFieldEffect(struct Sprite*);
void UpdateSurfBlobFieldEffect(struct Sprite*);
void sub_8156194(struct Sprite*);
diff --git a/include/field_poison.h b/include/field_poison.h
index 6a1ba17f2..a23a93ca5 100644
--- a/include/field_poison.h
+++ b/include/field_poison.h
@@ -13,7 +13,7 @@ enum {
FLDPSN_FNT
};
-void sub_80F972C(void);
-int DoPoisonFieldEffect(void);
+void ExecuteWhiteOut(void);
+s32 DoPoisonFieldEffect(void);
#endif //GUARD_FIELD_POISON_H
diff --git a/include/field_region_map.h b/include/field_region_map.h
deleted file mode 100644
index d50f1265c..000000000
--- a/include/field_region_map.h
+++ /dev/null
@@ -1,6 +0,0 @@
-#ifndef GUARD_FIELD_REGION_MAP_H
-#define GUARD_FIELD_REGION_MAP_H
-
-void FieldInitRegionMap(MainCallback callback);
-
-#endif // GUARD_FIELD_REGION_MAP_H
diff --git a/include/fieldmap.h b/include/fieldmap.h
index 8287229ed..a50c79b43 100644
--- a/include/fieldmap.h
+++ b/include/fieldmap.h
@@ -35,6 +35,7 @@ bool8 sub_8088BF0(u16*, u16, u8);
struct MapConnection *sub_8088950(u8 direction, int x, int y);
bool8 sub_80889A8(u8 direction, int x, int y, struct MapConnection *connection);
bool8 sub_8088A0C(int x, int src_width, int dest_width, int offset);
+void save_serialize_map(void);
void SpriteCB_PokeballGlow(struct Sprite *);
void SpriteCB_PokecenterMonitor(struct Sprite *);
diff --git a/include/fldeff_80F9BCC.h b/include/fldeff_80F9BCC.h
index 87a20d290..027bb4273 100644
--- a/include/fldeff_80F9BCC.h
+++ b/include/fldeff_80F9BCC.h
@@ -11,7 +11,7 @@ void sub_80FA5E4(s16 id, s16 x, s16 y);
void sub_80FA794(s16 x, s16 y);
void CreateRecordMixingSprite(void);
void DestroyRecordMixingSprite(void);
-void overworld_poison_effect(void);
+void FldeffPoison_Start(void);
void sub_80FA970(s16);
void sub_80FA9D0(void);
bool8 sub_80FADE4(u16, u8);
diff --git a/include/fldeff_teleport.h b/include/fldeff_teleport.h
deleted file mode 100644
index 71fb64ad2..000000000
--- a/include/fldeff_teleport.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef GUARD_FLDEFF_TELEPORT_H
-#define GUARD_FLDEFF_TELEPORT_H
-
-void hm_teleport_run_dp02scr(void);
-void sub_817C94C(void);
-
-#endif // GUARD_FLDEFF_TELEPORT_H
diff --git a/include/frontier_util.h b/include/frontier_util.h
index cfc3a8af4..6b6a2ea39 100644
--- a/include/frontier_util.h
+++ b/include/frontier_util.h
@@ -15,6 +15,7 @@ u8 GetPlayerSymbolCountForFacility(u8 facility);
void ShowRankingHallRecordsWindow(void);
void ScrollRankingHallRecordsWindow(void);
void ClearRankingHallRecords(void);
+void sub_81A4C30(void);
u8 GetFrontierBrainTrainerPicIndex(void);
u8 GetFrontierBrainTrainerClass(void);
void CopyFrontierBrainTrainerName(u8 *dst);
diff --git a/include/global.fieldmap.h b/include/global.fieldmap.h
index bb120c62c..f6273e80d 100644
--- a/include/global.fieldmap.h
+++ b/include/global.fieldmap.h
@@ -1,8 +1,6 @@
#ifndef GUARD_GLOBAL_FIELDMAP_H
#define GUARD_GLOBAL_FIELDMAP_H
-#define NUM_EVENT_OBJECTS 16
-
enum
{
CONNECTION_SOUTH = 1,
@@ -228,14 +226,14 @@ struct EventObjectGraphicsInfo
/*0x20*/ const union AffineAnimCmd *const *affineAnims;
};
-#define PLAYER_AVATAR_FLAG_ON_FOOT (1 << 0)
-#define PLAYER_AVATAR_FLAG_MACH_BIKE (1 << 1)
-#define PLAYER_AVATAR_FLAG_ACRO_BIKE (1 << 2)
-#define PLAYER_AVATAR_FLAG_SURFING (1 << 3)
+#define PLAYER_AVATAR_FLAG_ON_FOOT (1 << 0)
+#define PLAYER_AVATAR_FLAG_MACH_BIKE (1 << 1)
+#define PLAYER_AVATAR_FLAG_ACRO_BIKE (1 << 2)
+#define PLAYER_AVATAR_FLAG_SURFING (1 << 3)
#define PLAYER_AVATAR_FLAG_UNDERWATER (1 << 4)
-#define PLAYER_AVATAR_FLAG_5 (1 << 5)
-#define PLAYER_AVATAR_FLAG_6 (1 << 6)
-#define PLAYER_AVATAR_FLAG_DASH (1 << 7)
+#define PLAYER_AVATAR_FLAG_5 (1 << 5)
+#define PLAYER_AVATAR_FLAG_6 (1 << 6)
+#define PLAYER_AVATAR_FLAG_DASH (1 << 7)
enum
{
@@ -311,7 +309,7 @@ struct Camera
s32 y;
};
-extern struct EventObject gEventObjects[NUM_EVENT_OBJECTS];
+extern struct EventObject gEventObjects[EVENT_OBJECTS_COUNT];
extern u8 gSelectedEventObject;
extern struct MapHeader gMapHeader;
extern struct PlayerAvatar gPlayerAvatar;
diff --git a/include/global.h b/include/global.h
index c2b139e7a..5a86d5daa 100644
--- a/include/global.h
+++ b/include/global.h
@@ -119,22 +119,22 @@ enum LanguageId
#define GAME_LANGUAGE (LANGUAGE_ENGLISH)
// capacities of various saveblock objects
-#define DAYCARE_MON_COUNT 2
-#define POKEBLOCKS_COUNT 40
-#define EVENT_OBJECTS_COUNT 16
+#define DAYCARE_MON_COUNT 2
+#define POKEBLOCKS_COUNT 40
+#define EVENT_OBJECTS_COUNT 16
#define BERRY_TREES_COUNT 128
#define FLAGS_COUNT 300
#define VARS_COUNT 256
-#define MAIL_COUNT 16
-#define SECRET_BASES_COUNT 20
-#define TV_SHOWS_COUNT 25
-#define POKE_NEWS_COUNT 16
-#define PC_ITEMS_COUNT 50
-#define BAG_ITEMS_COUNT 30
-#define BAG_KEYITEMS_COUNT 30
-#define BAG_POKEBALLS_COUNT 16
-#define BAG_TMHM_COUNT 64
-#define BAG_BERRIES_COUNT 46
+#define MAIL_COUNT 16
+#define SECRET_BASES_COUNT 20
+#define TV_SHOWS_COUNT 25
+#define POKE_NEWS_COUNT 16
+#define PC_ITEMS_COUNT 50
+#define BAG_ITEMS_COUNT 30
+#define BAG_KEYITEMS_COUNT 30
+#define BAG_POKEBALLS_COUNT 16
+#define BAG_TMHM_COUNT 64
+#define BAG_BERRIES_COUNT 46
#define PYRAMID_BAG_ITEMS_COUNT 10
#define HALL_FACILITIES_COUNT 9 // 7 facilities for single mode + tower double mode + tower multi mode.
@@ -424,7 +424,8 @@ struct BattleFrontier
/*0xD1C*/ u16 domeTotalChampionships[2][2];
/*0xD24*/ struct BattleDomeTrainer domeTrainers[DOME_TOURNAMENT_TRAINERS_COUNT];
/*0xD64*/ u16 domeMonIds[DOME_TOURNAMENT_TRAINERS_COUNT][3];
- /*0xD64*/ u16 field_DC4[2];
+ /*0xDC4*/ u16 field_DC4;
+ /*0xDC6*/ u16 field_DC6;
/*0xDC8*/ u16 palaceWinStreaks[2][2];
/*0xDD0*/ u16 palaceRecordWinStreaks[2][2];
/*0xDD8*/ u16 field_DD8;
@@ -438,7 +439,10 @@ struct BattleFrontier
/*0xE04*/ u16 pikeWinStreaks[2];
/*0xE08*/ u16 pikeRecordStreaks[2];
/*0xE0C*/ u16 pikeTotalStreaks[2];
- /*0xE10*/ u16 field_E10[5];
+ /*0xE10*/ u8 field_E10_1:3;
+ /*0xE10*/ u8 field_E10_2:4;
+ /*0xE10*/ u8 field_E10_3:1;
+ /*0xE12*/ u16 field_E12[4];
/*0xE1A*/ u16 pyramidWinStreaks[2];
/*0xE1E*/ u16 pyramidRecordStreaks[2];
/*0xE1E*/ u16 field_E1F[5];
diff --git a/include/main.h b/include/main.h
index 3de34de13..47b26b1c7 100644
--- a/include/main.h
+++ b/include/main.h
@@ -1,8 +1,6 @@
#ifndef GUARD_MAIN_H
#define GUARD_MAIN_H
-#include "global.h"
-
typedef void (*MainCallback)(void);
typedef void (*IntrCallback)(void);
typedef void (*IntrFunc)(void);
diff --git a/include/metatile_behavior.h b/include/metatile_behavior.h
index 8301a22f2..e18639faf 100644
--- a/include/metatile_behavior.h
+++ b/include/metatile_behavior.h
@@ -77,7 +77,7 @@ bool8 MetatileBehavior_IsBerryTreeSoil(u8);
bool8 MetatileBehavior_IsAshGrass(u8);
bool8 MetatileBehavior_IsFootprints(u8);
bool8 MetatileBehavior_IsBridge(u8);
-u8 MetatileBehavior_GetBridgeSth(u8);
+u8 MetatileBehavior_GetBridgeType(u8);
u8 MetatileBehavior_8089510(u8);
bool8 MetatileBehavior_IsLandWildEncounter(u8);
bool8 MetatileBehavior_IsWaterWildEncounter(u8);
diff --git a/include/overworld.h b/include/overworld.h
index 3dce20ab2..6b38a8782 100644
--- a/include/overworld.h
+++ b/include/overworld.h
@@ -47,13 +47,13 @@ void Overworld_SetEventObjTemplateMovementType(u8 localId, u8 movementType);
const struct MapLayout *GetMapLayout(void);
void ApplyCurrentWarp(void);
void set_warp2_warp3_to_neg_1(void);
-void SetWarpData(struct WarpData *warp, s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
-bool32 IsDummyWarp(struct WarpData *warp);
+static void SetWarpData(struct WarpData *warp, s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
+static bool32 IsDummyWarp(struct WarpData *warp);
struct MapHeader const *const Overworld_GetMapHeaderByGroupAndId(u16 mapGroup, u16 mapNum);
struct MapHeader const *const GetDestinationWarpMapHeader(void);
-void LoadCurrentMapData(void);
-void LoadSaveblockMapHeader(void);
-void SetPlayerCoordsFromWarp(void);
+static void LoadCurrentMapData(void);
+static void LoadSaveblockMapHeader(void);
+static void SetPlayerCoordsFromWarp(void);
void WarpIntoMap(void);
void Overworld_SetWarpDestination(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
void warp1_set_2(s8 mapGroup, s8 mapNum, s8 warpId);
@@ -67,7 +67,7 @@ void sub_8084D5C(s16 a1, s16 a2);
void sub_8084DD4(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
void sub_8084E14(void);
void SetFixedDiveWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
-void SetFixedDiveWarpAsDestination(void);
+static void SetFixedDiveWarpAsDestination(void);
void SetFixedHoleWarp(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
void SetFixedHoleWarpAsDestination(s16 x, s16 y);
void warp1_set_to_sav1w(void);
@@ -75,7 +75,7 @@ void sub_8084F2C(s8 mapGroup, s8 mapNum, s8 warpId, s8 x, s8 y);
void sub_8084F6C(u8 a1);
void sub_8084FAC(void);
const struct MapConnection *GetMapConnection(u8 dir);
-bool8 SetDiveWarp(u8 dir, u16 x, u16 y);
+static bool8 SetDiveWarp(u8 dir, u16 x, u16 y);
bool8 SetDiveWarpEmerge(u16 x, u16 y);
bool8 SetDiveWarpDive(u16 x, u16 y);
void mliX_load_map(u8 mapGroup, u8 mapNum);
@@ -105,7 +105,7 @@ void UpdateAmbientCry(s16 *state, u16 *delayCounter);
u8 GetMapTypeByGroupAndId(s8 mapGroup, s8 mapNum);
u8 GetMapTypeByWarpData(struct WarpData *warp);
u8 Overworld_GetMapTypeOfSaveblockLocation(void);
-u8 get_map_light_from_warp0(void);
+u8 GetLastUsedWarpMapType(void);
bool8 is_map_type_1_2_3_5_or_6(u8 mapType);
bool8 Overworld_MapTypeAllowsTeleportAndFly(u8 mapType);
bool8 Overworld_MapTypeIsIndoors(u8 mapType);
diff --git a/include/pokemon.h b/include/pokemon.h
index 0155f7430..7cf043ba3 100644
--- a/include/pokemon.h
+++ b/include/pokemon.h
@@ -486,7 +486,7 @@ void CreateMonWithEVSpread(struct Pokemon *mon, u16 species, u8 level, u8 fixedI
void sub_806819C(struct Pokemon *mon, struct UnknownPokemonStruct *src);
void sub_8068338(struct Pokemon *mon, struct UnknownPokemonStruct *src, bool8 lvl50);
void CreateApprenticeMon(struct Pokemon *mon, const struct Apprentice *src, u8 monId);
-void CreateMonWithEVSpreadPersonalityOTID(struct Pokemon *mon, u16 species, u8 level, u8 nature, u8 fixedIV, u8 evSpread, u32 otId);
+void CreateMonWithEVSpreadNatureOTID(struct Pokemon *mon, u16 species, u8 level, u8 nature, u8 fixedIV, u8 evSpread, u32 otId);
void sub_80686FC(struct Pokemon *mon, struct UnknownPokemonStruct *dest);
void CreateObedientMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId);
bool8 sub_80688F8(u8 caseId, u8 battlerId);