mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-03-06 15:38:11 +01:00
OW Poison configs
This commit is contained in:
parent
5fe79d83c1
commit
dfee8a4759
@ -4,6 +4,9 @@
|
||||
// Movement config
|
||||
#define OW_RUNNING_INDOORS GEN_LATEST // In Gen4+, players are allowed to run indoors.
|
||||
|
||||
// Other settings
|
||||
#define OW_POISON_DAMAGE GEN_LATEST // In Gen4, Pokémon no longer faint from Poison in the overworld. In Gen5+, they no longer take damage at all.
|
||||
|
||||
// Overworld flags
|
||||
// To use the following features in scripting, replace the 0s with the flag ID you're assigning it to.
|
||||
// Eg: Replace with FLAG_UNUSED_0x264 so you can use that flag to toggle the feature.
|
||||
|
@ -180,6 +180,7 @@ extern const u8 gText_Confirm3[];
|
||||
extern const u8 gText_Cancel4[];
|
||||
extern const u8 gText_IsThisTheCorrectTime[];
|
||||
extern const u8 gText_PkmnFainted_FldPsn[];
|
||||
extern const u8 gText_PkmnSurvived_FldPsn[];
|
||||
extern const u8 gText_Coins[];
|
||||
extern const u8 gText_Silver[];
|
||||
extern const u8 gText_Gold[];
|
||||
|
@ -565,11 +565,13 @@ static bool8 TryStartStepCountScript(u16 metatileBehavior)
|
||||
|
||||
if (!(gPlayerAvatar.flags & PLAYER_AVATAR_FLAG_FORCED_MOVE) && !MetatileBehavior_IsForcedMovementTile(metatileBehavior))
|
||||
{
|
||||
#if OW_POISON_DAMAGE < GEN_5
|
||||
if (UpdatePoisonStepCounter() == TRUE)
|
||||
{
|
||||
ScriptContext_SetupScript(EventScript_FieldPoison);
|
||||
return TRUE;
|
||||
}
|
||||
#endif
|
||||
if (ShouldEggHatch())
|
||||
{
|
||||
IncrementGameStat(GAME_STAT_HATCHED_EGGS);
|
||||
|
@ -44,7 +44,9 @@ static void FaintFromFieldPoison(u8 partyIdx)
|
||||
struct Pokemon *pokemon = &gPlayerParty[partyIdx];
|
||||
u32 status = STATUS1_NONE;
|
||||
|
||||
#if OW_POISON_DAMAGE < GEN_4
|
||||
AdjustFriendship(pokemon, FRIENDSHIP_EVENT_FAINT_FIELD_PSN);
|
||||
#endif
|
||||
SetMonData(pokemon, MON_DATA_STATUS, &status);
|
||||
GetMonData(pokemon, MON_DATA_NICKNAME, gStringVar1);
|
||||
StringGet_Nickname(gStringVar1);
|
||||
@ -53,7 +55,11 @@ static void FaintFromFieldPoison(u8 partyIdx)
|
||||
static bool32 MonFaintedFromPoison(u8 partyIdx)
|
||||
{
|
||||
struct Pokemon *pokemon = &gPlayerParty[partyIdx];
|
||||
#if OW_POISON_DAMAGE < GEN_4
|
||||
if (IsMonValidSpecies(pokemon) && GetMonData(pokemon, MON_DATA_HP) == 0 && GetAilmentFromStatus(GetMonData(pokemon, MON_DATA_STATUS)) == AILMENT_PSN)
|
||||
#else
|
||||
if (IsMonValidSpecies(pokemon) && GetMonData(pokemon, MON_DATA_HP) == 1 && GetAilmentFromStatus(GetMonData(pokemon, MON_DATA_STATUS)) == AILMENT_PSN)
|
||||
#endif
|
||||
return TRUE;
|
||||
|
||||
return FALSE;
|
||||
@ -73,7 +79,11 @@ static void Task_TryFieldPoisonWhiteOut(u8 taskId)
|
||||
if (MonFaintedFromPoison(tPartyIdx))
|
||||
{
|
||||
FaintFromFieldPoison(tPartyIdx);
|
||||
#if OW_POISON_DAMAGE < GEN_4
|
||||
ShowFieldMessage(gText_PkmnFainted_FldPsn);
|
||||
#else
|
||||
ShowFieldMessage(gText_PkmnSurvived_FldPsn);
|
||||
#endif
|
||||
tState++;
|
||||
return;
|
||||
}
|
||||
@ -127,7 +137,11 @@ s32 DoPoisonFieldEffect(void)
|
||||
{
|
||||
// Apply poison damage
|
||||
hp = GetMonData(pokemon, MON_DATA_HP);
|
||||
#if OW_POISON_DAMAGE < GEN_4
|
||||
if (hp == 0 || --hp == 0)
|
||||
#else
|
||||
if (hp == 1 || --hp == 1)
|
||||
#endif
|
||||
numFainted++;
|
||||
|
||||
SetMonData(pokemon, MON_DATA_HP, &hp);
|
||||
|
@ -1192,6 +1192,7 @@ const u8 gText_IcePunch48BP[] = _("ICE PUNCH{CLEAR_TO 0x4E}48BP");
|
||||
const u8 gText_ThunderPunch48BP[] = _("THUNDERPUNCH{CLEAR_TO 0x4E}48BP");
|
||||
const u8 gText_FirePunch48BP[] = _("FIRE PUNCH{CLEAR_TO 0x4E}48BP");
|
||||
const u8 gText_PkmnFainted_FldPsn[] = _("{STR_VAR_1} fainted…\p\n");
|
||||
const u8 gText_PkmnSurvived_FldPsn[] = _("{STR_VAR_1} survived the poisoning.\nThe poison faded away!\p");
|
||||
const u8 gText_Marco[] = _("MARCO");
|
||||
const u8 gText_TrainerCardName[] = _("NAME: ");
|
||||
const u8 gText_TrainerCardIDNo[] = _("IDNo.");
|
||||
|
Loading…
x
Reference in New Issue
Block a user