From b89c3e901e1de2f3513d74fa548373d82d3f26d0 Mon Sep 17 00:00:00 2001 From: Deokishisu <6993375+Deokishisu@users.noreply.github.com> Date: Mon, 15 Feb 2021 11:40:16 -0500 Subject: Fix giftRibbons Field in SaveBlock1 & Relabel Gift Ribbons in pokemon.h MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The giftRibbons field has been split out into proper subfields. The new ExternalEvent structs deal with interconnectivity between external games/peripherals and Emerald, such as PokéCoupon storage and the flag for receiving Wishmaker Jirachi. The giftRibbon fields in `PokemonSubstruct3` have also been renamed to their appropriate ribbons, and commented with distribution info if applicable. The previous `fatefulEncounter` field was actually filler, and relabeled as such, while the obedient bit was renamed `fatefulEncounter`. All relevant constants and functions dealing with the Pokémon data structure were renamed with these changes in mind. --- src/scrcmd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/scrcmd.c') diff --git a/src/scrcmd.c b/src/scrcmd.c index f599a0004..0b9e3d445 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -2207,21 +2207,21 @@ bool8 ScrCmd_lockfortrainer(struct ScriptContext *ctx) } } -// This command will force the Pokémon to be obedient, you don't get to make it disobedient. -bool8 ScrCmd_setmonobedient(struct ScriptContext *ctx) +// This command will set a Pokémon's Fateful Encounter bit; there is no similar command to clear it. +bool8 ScrCmd_setmonfatefulencounter(struct ScriptContext *ctx) { - bool8 obedient = TRUE; + bool8 isFatefulEncounter = TRUE; u16 partyIndex = VarGet(ScriptReadHalfword(ctx)); - SetMonData(&gPlayerParty[partyIndex], MON_DATA_OBEDIENCE, &obedient); + SetMonData(&gPlayerParty[partyIndex], MON_DATA_FATEFUL_ENCOUNTER, &isFatefulEncounter); return FALSE; } -bool8 ScrCmd_checkmonobedience(struct ScriptContext *ctx) +bool8 ScrCmd_checkmonfatefulencounter(struct ScriptContext *ctx) { u16 partyIndex = VarGet(ScriptReadHalfword(ctx)); - gSpecialVar_Result = GetMonData(&gPlayerParty[partyIndex], MON_DATA_OBEDIENCE, NULL); + gSpecialVar_Result = GetMonData(&gPlayerParty[partyIndex], MON_DATA_FATEFUL_ENCOUNTER, NULL); return FALSE; } -- cgit v1.2.3 From 7b2bf8c7e2249f66a04eabdbaeb2a8018855955f Mon Sep 17 00:00:00 2001 From: Deokishisu <6993375+Deokishisu@users.noreply.github.com> Date: Mon, 15 Feb 2021 14:54:35 -0500 Subject: Rename obedient/fatefulEncounter to eventLegal Per discussion on pret, `obedient`/`fatefulEncounter` has been renamed to `eventLegal`, and all related functions and constants have been modified with this in mind. Additionally, fixed some whitespace alignment issues in `script_cmd_table.h`, `pokemon.h`, and `tv.c` from the last commit. --- src/scrcmd.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'src/scrcmd.c') diff --git a/src/scrcmd.c b/src/scrcmd.c index 0b9e3d445..7caaa194b 100644 --- a/src/scrcmd.c +++ b/src/scrcmd.c @@ -2207,21 +2207,21 @@ bool8 ScrCmd_lockfortrainer(struct ScriptContext *ctx) } } -// This command will set a Pokémon's Fateful Encounter bit; there is no similar command to clear it. -bool8 ScrCmd_setmonfatefulencounter(struct ScriptContext *ctx) +// This command will set a Pokémon's eventLegal bit; there is no similar command to clear it. +bool8 ScrCmd_setmoneventlegal(struct ScriptContext *ctx) { - bool8 isFatefulEncounter = TRUE; + bool8 isEventLegal = TRUE; u16 partyIndex = VarGet(ScriptReadHalfword(ctx)); - SetMonData(&gPlayerParty[partyIndex], MON_DATA_FATEFUL_ENCOUNTER, &isFatefulEncounter); + SetMonData(&gPlayerParty[partyIndex], MON_DATA_EVENT_LEGAL, &isEventLegal); return FALSE; } -bool8 ScrCmd_checkmonfatefulencounter(struct ScriptContext *ctx) +bool8 ScrCmd_checkmoneventlegal(struct ScriptContext *ctx) { u16 partyIndex = VarGet(ScriptReadHalfword(ctx)); - gSpecialVar_Result = GetMonData(&gPlayerParty[partyIndex], MON_DATA_FATEFUL_ENCOUNTER, NULL); + gSpecialVar_Result = GetMonData(&gPlayerParty[partyIndex], MON_DATA_EVENT_LEGAL, NULL); return FALSE; } -- cgit v1.2.3