Document field_poison
This commit is contained in:
@@ -22,20 +22,7 @@
|
||||
#include "constants/trainers.h"
|
||||
#include "constants/species.h"
|
||||
#include "constants/moves.h"
|
||||
|
||||
#define PIKE_ROOM_SINGLE_BATTLE 0
|
||||
#define PIKE_ROOM_HEAL_FULL 1
|
||||
#define PIKE_ROOM_NPC 2
|
||||
#define PIKE_ROOM_STATUS 3
|
||||
#define PIKE_ROOM_HEAL_PART 4
|
||||
#define PIKE_ROOM_WILD_MONS 5
|
||||
#define PIKE_ROOM_HARD_BATTLE 6
|
||||
#define PIKE_ROOM_DOUBLE_BATTLE 7
|
||||
#define PIKE_ROOM_BRAIN 8
|
||||
|
||||
// For the room with a status effect.
|
||||
#define PIKE_STATUS_KIRLIA 0
|
||||
#define PIKE_STATUS_DUSCLOPS 1
|
||||
#include "constants/battle_pike.h"
|
||||
|
||||
struct PikeRoomNPC
|
||||
{
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
#include "overworld.h"
|
||||
#include "event_scripts.h"
|
||||
#include "constants/battle_frontier.h"
|
||||
#include "constants/battle_pyramid.h"
|
||||
#include "constants/event_objects.h"
|
||||
#include "constants/event_object_movement_constants.h"
|
||||
#include "constants/items.h"
|
||||
@@ -39,38 +40,7 @@
|
||||
extern const struct MapLayout *const gMapLayouts[];
|
||||
extern const u16 gUnknown_08D856C8[][16];
|
||||
|
||||
#define TOTAL_ROUNDS 20
|
||||
#define PICKUP_ITEMS_PER_ROUND 10
|
||||
#define FLOOR_WALKABLE_METATILE 0x28D
|
||||
#define FLOOR_EXIT_METATILE 0x28E
|
||||
|
||||
enum
|
||||
{
|
||||
HINT_EXIT_DIRECTION,
|
||||
HINT_REMAINING_ITEMS,
|
||||
HINT_REMAINING_TRAINERS,
|
||||
HINT_EXIT_SHORT_REMAINING_TRAINERS,
|
||||
HINT_EXIT_SHORT_REMAINING_ITEMS,
|
||||
HINT_EXIT_MEDIUM_REMAINING_TRAINERS,
|
||||
HINT_EXIT_MEDIUM_REMAINING_ITEMS,
|
||||
HINT_EXIT_FAR_REMAINING_TRAINERS,
|
||||
HINT_EXIT_FAR_REMAINING_ITEMS,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
OBJ_TRAINERS,
|
||||
OBJ_ITEMS,
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
OBJ_POSITIONS_UNIFORM,
|
||||
OBJ_POSITIONS_IN_AND_NEAR_ENTRANCE,
|
||||
OBJ_POSITIONS_IN_AND_NEAR_EXIT,
|
||||
OBJ_POSITIONS_NEAR_ENTRANCE,
|
||||
OBJ_POSITIONS_NEAR_EXIT,
|
||||
};
|
||||
|
||||
struct PyramidWildMon
|
||||
{
|
||||
|
||||
@@ -1273,7 +1273,7 @@ void BattleSetup_StartTrainerBattle(void)
|
||||
|
||||
MarkApproachingPyramidTrainersAsBattled();
|
||||
}
|
||||
else if (sub_81D5C18())
|
||||
else if (InTrainerHillChallenge())
|
||||
{
|
||||
gBattleTypeFlags |= BATTLE_TYPE_TRAINER_HILL;
|
||||
|
||||
@@ -1291,7 +1291,7 @@ void BattleSetup_StartTrainerBattle(void)
|
||||
gUnknown_03006080 = 0;
|
||||
gMain.savedCallback = CB2_EndTrainerBattle;
|
||||
|
||||
if (InBattlePyramid() || sub_81D5C18())
|
||||
if (InBattlePyramid() || InTrainerHillChallenge())
|
||||
sub_80B0828();
|
||||
else
|
||||
DoTrainerBattle();
|
||||
@@ -1307,7 +1307,7 @@ static void CB2_EndTrainerBattle(void)
|
||||
}
|
||||
else if (IsPlayerDefeated(gBattleOutcome) == TRUE)
|
||||
{
|
||||
if (InBattlePyramid() || sub_81D5C18())
|
||||
if (InBattlePyramid() || InTrainerHillChallenge())
|
||||
SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic);
|
||||
else
|
||||
SetMainCallback2(CB2_WhiteOut);
|
||||
@@ -1315,7 +1315,7 @@ static void CB2_EndTrainerBattle(void)
|
||||
else
|
||||
{
|
||||
SetMainCallback2(CB2_ReturnToFieldContinueScriptPlayMapMusic);
|
||||
if (!InBattlePyramid() && !sub_81D5C18())
|
||||
if (!InBattlePyramid() && !InTrainerHillChallenge())
|
||||
{
|
||||
RegisterTrainerInMatchCall();
|
||||
SetBattledTrainersFlags();
|
||||
@@ -1361,7 +1361,7 @@ void ShowTrainerIntroSpeech(void)
|
||||
|
||||
sub_80982B8();
|
||||
}
|
||||
else if (sub_81D5C18())
|
||||
else if (InTrainerHillChallenge())
|
||||
{
|
||||
if (gNoOfApproachingTrainers == 0 || gNoOfApproachingTrainers == 1)
|
||||
CopyTrainerHillTrainerText(2, LocalIdToHillTrainerId(gSpecialVar_LastTalked));
|
||||
|
||||
@@ -547,7 +547,7 @@ static bool8 TryStartStepCountScript(u16 metatileBehavior)
|
||||
{
|
||||
if (UpdatePoisonStepCounter() == TRUE)
|
||||
{
|
||||
ScriptContext1_SetupScript(EventScript_Poison);
|
||||
ScriptContext1_SetupScript(EventScript_FieldPoison);
|
||||
return TRUE;
|
||||
}
|
||||
if (ShouldEggHatch())
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "strings.h"
|
||||
#include "task.h"
|
||||
#include "trainer_hill.h"
|
||||
#include "constants/field_poison.h"
|
||||
#include "constants/species.h"
|
||||
|
||||
static bool32 IsMonValidSpecies(struct Pokemon *pokemon)
|
||||
@@ -62,7 +63,7 @@ static bool32 MonFaintedFromPoison(u8 partyIdx)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void Task_WhiteOut(u8 taskId)
|
||||
static void Task_TryFieldPoisonWhiteOut(u8 taskId)
|
||||
{
|
||||
s16 *data = gTasks[taskId].data;
|
||||
switch (data[0])
|
||||
@@ -89,18 +90,18 @@ static void Task_WhiteOut(u8 taskId)
|
||||
case 2:
|
||||
if (AllMonsFainted())
|
||||
{
|
||||
if (InBattlePyramid() | InBattlePike() || sub_81D5C18())
|
||||
if (InBattlePyramid() | InBattlePike() || InTrainerHillChallenge())
|
||||
{
|
||||
gSpecialVar_Result = 2;
|
||||
gSpecialVar_Result = FLDPSN_FRONTIER_WHITEOUT;
|
||||
}
|
||||
else
|
||||
{
|
||||
gSpecialVar_Result = 1;
|
||||
gSpecialVar_Result = FLDPSN_WHITEOUT;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gSpecialVar_Result = 0;
|
||||
gSpecialVar_Result = FLDPSN_NO_WHITEOUT;
|
||||
}
|
||||
EnableBothScriptContexts();
|
||||
DestroyTask(taskId);
|
||||
@@ -108,9 +109,9 @@ static void Task_WhiteOut(u8 taskId)
|
||||
}
|
||||
}
|
||||
|
||||
void ExecuteWhiteOut(void)
|
||||
void TryFieldPoisonWhiteOut(void)
|
||||
{
|
||||
CreateTask(Task_WhiteOut, 80);
|
||||
CreateTask(Task_TryFieldPoisonWhiteOut, 80);
|
||||
ScriptContext1_Stop();
|
||||
}
|
||||
|
||||
|
||||
@@ -48,7 +48,7 @@ static bool32 WaitForWeatherFadeIn(void);
|
||||
static void task0A_mpl_807E31C(u8 taskId);
|
||||
static void sub_80AFA0C(u8 taskId);
|
||||
static void sub_80AFA88(u8 taskId);
|
||||
static void task50_0807F0C8(u8);
|
||||
static void Task_EnableScriptAfterMusicFade(u8 taskId);
|
||||
|
||||
// const
|
||||
const u16 sFlashLevelPixelRadii[] = { 200, 72, 64, 56, 48, 40, 32, 24, 0 };
|
||||
@@ -1231,13 +1231,13 @@ void sub_80B058C(void)
|
||||
gTasks[taskId].data[0] = 6;
|
||||
}
|
||||
|
||||
void sub_80B05B4(void)
|
||||
void Script_FadeOutMapMusic(void)
|
||||
{
|
||||
Overworld_FadeOutMapMusic();
|
||||
CreateTask(task50_0807F0C8, 80);
|
||||
CreateTask(Task_EnableScriptAfterMusicFade, 80);
|
||||
}
|
||||
|
||||
static void task50_0807F0C8(u8 taskId)
|
||||
static void Task_EnableScriptAfterMusicFade(u8 taskId)
|
||||
{
|
||||
if (BGMusicStopped() == TRUE)
|
||||
{
|
||||
|
||||
@@ -5704,7 +5704,7 @@ u8 GetTrainerEncounterMusicId(u16 trainerOpponentId)
|
||||
{
|
||||
if (InBattlePyramid())
|
||||
return GetBattlePyramindTrainerEncounterMusicId(trainerOpponentId);
|
||||
else if (sub_81D5C18())
|
||||
else if (InTrainerHillChallenge())
|
||||
return GetTrainerEncounterMusicIdInTrainerHill(trainerOpponentId);
|
||||
else
|
||||
return TRAINER_ENCOUNTER_MUSIC(trainerOpponentId);
|
||||
|
||||
@@ -86,7 +86,7 @@ int GameClear(void)
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool8 sp0C8_whiteout_maybe(void)
|
||||
bool8 SetCB2WhiteOut(void)
|
||||
{
|
||||
SetMainCallback2(CB2_WhiteOut);
|
||||
return FALSE;
|
||||
|
||||
@@ -63,7 +63,7 @@ static void TrainerHillGetChallengeStatus(void);
|
||||
static void sub_81D5B2C(void);
|
||||
static void sub_81D5BBC(void);
|
||||
static void sub_81D5C00(void);
|
||||
static void sub_81D5C5C(void);
|
||||
static void GetInTrainerHill(void);
|
||||
static void sub_81D62B4(void);
|
||||
static void sub_81D64AC(void);
|
||||
static void sub_81D64DC(void);
|
||||
@@ -231,7 +231,7 @@ static void (* const sHillFunctions[])(void) =
|
||||
sub_81D5B2C,
|
||||
sub_81D5BBC,
|
||||
sub_81D5C00,
|
||||
sub_81D5C5C,
|
||||
GetInTrainerHill,
|
||||
sub_81D62B4,
|
||||
sub_81D64AC,
|
||||
sub_81D64DC,
|
||||
@@ -534,7 +534,7 @@ static void sub_81D5C00(void)
|
||||
FreeDataStruct();
|
||||
}
|
||||
|
||||
bool8 sub_81D5C18(void)
|
||||
bool8 InTrainerHillChallenge(void)
|
||||
{
|
||||
if (VarGet(VAR_TRAINER_HILL_IS_ACTIVE) == 0)
|
||||
return FALSE;
|
||||
@@ -546,9 +546,9 @@ bool8 sub_81D5C18(void)
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
static void sub_81D5C5C(void)
|
||||
static void GetInTrainerHill(void)
|
||||
{
|
||||
if (!sub_81D5C18())
|
||||
if (!InTrainerHillChallenge())
|
||||
gSpecialVar_Result = 0;
|
||||
else
|
||||
gSpecialVar_Result = 1;
|
||||
@@ -997,7 +997,7 @@ static void sub_81D6518(void)
|
||||
|
||||
bool32 sub_81D6534(void)
|
||||
{
|
||||
if (!sub_81D5C18() || GetCurrentTrainerHillMapId() == 6)
|
||||
if (!InTrainerHillChallenge() || GetCurrentTrainerHillMapId() == 6)
|
||||
return FALSE;
|
||||
|
||||
sub_81D5C00();
|
||||
|
||||
Reference in New Issue
Block a user