mirror of
https://github.com/rh-hideout/pokeemerald-expansion.git
synced 2026-03-21 18:04:50 -05:00
Add original frlg safari zone menu and fix initial step counter (#9340)
This commit is contained in:
parent
91a1278934
commit
dc3dd0273c
|
|
@ -2,6 +2,7 @@
|
||||||
#define GUARD_SAFARI_ZONE_H
|
#define GUARD_SAFARI_ZONE_H
|
||||||
|
|
||||||
extern u8 gNumSafariBalls;
|
extern u8 gNumSafariBalls;
|
||||||
|
extern u16 gSafariZoneStepCounter;
|
||||||
|
|
||||||
bool32 GetSafariZoneFlag(void);
|
bool32 GetSafariZoneFlag(void);
|
||||||
void SetSafariZoneFlag(void);
|
void SetSafariZoneFlag(void);
|
||||||
|
|
|
||||||
|
|
@ -186,6 +186,7 @@ extern const u8 gText_Floor6[];
|
||||||
extern const u8 gText_Floor7[];
|
extern const u8 gText_Floor7[];
|
||||||
extern const u8 gText_Peak[];
|
extern const u8 gText_Peak[];
|
||||||
extern const u8 gText_SafariBallStock[];
|
extern const u8 gText_SafariBallStock[];
|
||||||
|
extern const u8 gText_MenuSafariStats[];
|
||||||
extern const u8 gText_BattlePyramidFloor[];
|
extern const u8 gText_BattlePyramidFloor[];
|
||||||
|
|
||||||
extern const u8 gText_MenuOptionPokedex[];
|
extern const u8 gText_MenuOptionPokedex[];
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ extern const u8 SafariZone_EventScript_OutOfBallsMidBattle[];
|
||||||
extern const u8 SafariZone_EventScript_OutOfBalls[];
|
extern const u8 SafariZone_EventScript_OutOfBalls[];
|
||||||
|
|
||||||
EWRAM_DATA u8 gNumSafariBalls = 0;
|
EWRAM_DATA u8 gNumSafariBalls = 0;
|
||||||
EWRAM_DATA static u16 sSafariZoneStepCounter = 0;
|
EWRAM_DATA u16 gSafariZoneStepCounter = 0;
|
||||||
EWRAM_DATA static u8 sSafariZoneCaughtMons = 0;
|
EWRAM_DATA static u8 sSafariZoneCaughtMons = 0;
|
||||||
EWRAM_DATA static u8 sSafariZonePkblkUses = 0;
|
EWRAM_DATA static u8 sSafariZonePkblkUses = 0;
|
||||||
EWRAM_DATA static struct PokeblockFeeder sPokeblockFeeders[NUM_POKEBLOCK_FEEDERS] = {0};
|
EWRAM_DATA static struct PokeblockFeeder sPokeblockFeeders[NUM_POKEBLOCK_FEEDERS] = {0};
|
||||||
|
|
@ -58,7 +58,10 @@ void EnterSafariMode(void)
|
||||||
SetSafariZoneFlag();
|
SetSafariZoneFlag();
|
||||||
ClearAllPokeblockFeeders();
|
ClearAllPokeblockFeeders();
|
||||||
gNumSafariBalls = 30;
|
gNumSafariBalls = 30;
|
||||||
sSafariZoneStepCounter = 500;
|
if (IS_FRLG)
|
||||||
|
gSafariZoneStepCounter = 600;
|
||||||
|
else
|
||||||
|
gSafariZoneStepCounter = 500;
|
||||||
sSafariZoneCaughtMons = 0;
|
sSafariZoneCaughtMons = 0;
|
||||||
sSafariZonePkblkUses = 0;
|
sSafariZonePkblkUses = 0;
|
||||||
}
|
}
|
||||||
|
|
@ -69,7 +72,7 @@ void ExitSafariMode(void)
|
||||||
ResetSafariZoneFlag();
|
ResetSafariZoneFlag();
|
||||||
ClearAllPokeblockFeeders();
|
ClearAllPokeblockFeeders();
|
||||||
gNumSafariBalls = 0;
|
gNumSafariBalls = 0;
|
||||||
sSafariZoneStepCounter = 0;
|
gSafariZoneStepCounter = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool8 SafariZoneTakeStep(void)
|
bool8 SafariZoneTakeStep(void)
|
||||||
|
|
@ -80,8 +83,8 @@ bool8 SafariZoneTakeStep(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
DecrementFeederStepCounters();
|
DecrementFeederStepCounters();
|
||||||
sSafariZoneStepCounter--;
|
gSafariZoneStepCounter--;
|
||||||
if (sSafariZoneStepCounter == 0)
|
if (gSafariZoneStepCounter == 0)
|
||||||
{
|
{
|
||||||
ScriptContext_SetupScript(SafariZone_EventScript_TimesUp);
|
ScriptContext_SetupScript(SafariZone_EventScript_TimesUp);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
|
|
|
||||||
|
|
@ -440,9 +440,20 @@ static void ShowSafariBallsWindow(void)
|
||||||
sSafariBallsWindowId = AddWindow(&sWindowTemplate_SafariBalls);
|
sSafariBallsWindowId = AddWindow(&sWindowTemplate_SafariBalls);
|
||||||
PutWindowTilemap(sSafariBallsWindowId);
|
PutWindowTilemap(sSafariBallsWindowId);
|
||||||
DrawStdWindowFrame(sSafariBallsWindowId, FALSE);
|
DrawStdWindowFrame(sSafariBallsWindowId, FALSE);
|
||||||
ConvertIntToDecimalStringN(gStringVar1, gNumSafariBalls, STR_CONV_MODE_RIGHT_ALIGN, 2);
|
if (IS_FRLG)
|
||||||
StringExpandPlaceholders(gStringVar4, gText_SafariBallStock);
|
{
|
||||||
AddTextPrinterParameterized(sSafariBallsWindowId, FONT_NORMAL, gStringVar4, 0, 1, TEXT_SKIP_DRAW, NULL);
|
ConvertIntToDecimalStringN(gStringVar1, gSafariZoneStepCounter, STR_CONV_MODE_RIGHT_ALIGN, 3);
|
||||||
|
ConvertIntToDecimalStringN(gStringVar2, 600, STR_CONV_MODE_RIGHT_ALIGN, 3);
|
||||||
|
ConvertIntToDecimalStringN(gStringVar3, gNumSafariBalls, STR_CONV_MODE_RIGHT_ALIGN, 2);
|
||||||
|
StringExpandPlaceholders(gStringVar4, gText_MenuSafariStats);
|
||||||
|
AddTextPrinterParameterized(sSafariBallsWindowId, FONT_NORMAL, gStringVar4, 4, 3, 0xFF, NULL);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
ConvertIntToDecimalStringN(gStringVar1, gNumSafariBalls, STR_CONV_MODE_RIGHT_ALIGN, 2);
|
||||||
|
StringExpandPlaceholders(gStringVar4, gText_SafariBallStock);
|
||||||
|
AddTextPrinterParameterized(sSafariBallsWindowId, FONT_NORMAL, gStringVar4, 0, 1, TEXT_SKIP_DRAW, NULL);
|
||||||
|
}
|
||||||
CopyWindowToVram(sSafariBallsWindowId, COPYWIN_GFX);
|
CopyWindowToVram(sSafariBallsWindowId, COPYWIN_GFX);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -984,6 +984,7 @@ const u8 gText_MenuRetire[] = _("RETIRE");
|
||||||
const u8 gText_MenuRest[] = _("REST");
|
const u8 gText_MenuRest[] = _("REST");
|
||||||
const u8 gText_MenuDexNav[] = _("DEXNAV");
|
const u8 gText_MenuDexNav[] = _("DEXNAV");
|
||||||
const u8 gText_SafariBallStock[] = _("SAFARI BALLS\nStock: {STR_VAR_1}");
|
const u8 gText_SafariBallStock[] = _("SAFARI BALLS\nStock: {STR_VAR_1}");
|
||||||
|
const u8 gText_MenuSafariStats[] = _("{STR_VAR_1}/{STR_VAR_2}\nBALLS {STR_VAR_3}");
|
||||||
const u8 gText_BattlePyramidFloor[] = _("Battle Pyramid\n{STR_VAR_1}");
|
const u8 gText_BattlePyramidFloor[] = _("Battle Pyramid\n{STR_VAR_1}");
|
||||||
const u8 gText_Floor1[] = _("Floor 1");
|
const u8 gText_Floor1[] = _("Floor 1");
|
||||||
const u8 gText_Floor2[] = _("Floor 2");
|
const u8 gText_Floor2[] = _("Floor 2");
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user