diff options
author | Deokishisu <6993375+Deokishisu@users.noreply.github.com> | 2021-02-15 14:54:35 -0500 |
---|---|---|
committer | Deokishisu <6993375+Deokishisu@users.noreply.github.com> | 2021-02-15 14:54:35 -0500 |
commit | 7b2bf8c7e2249f66a04eabdbaeb2a8018855955f (patch) | |
tree | fd9c56262c4ef44569f313e5e067523a6a3546bf /src | |
parent | b89c3e901e1de2f3513d74fa548373d82d3f26d0 (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/battle_util.c | 6 | ||||
-rw-r--r-- | src/egg_hatch.c | 6 | ||||
-rwxr-xr-x | src/party_menu.c | 8 | ||||
-rw-r--r-- | src/pokemon.c | 18 | ||||
-rw-r--r-- | src/scrcmd.c | 12 | ||||
-rw-r--r-- | src/trade.c | 16 | ||||
-rw-r--r-- | src/tv.c | 12 |
7 files changed, 39 insertions, 39 deletions
diff --git a/src/battle_util.c b/src/battle_util.c index 7914356dc..2bf06f331 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3949,14 +3949,14 @@ u8 GetMoveTarget(u16 move, u8 setTarget) return targetBattler; } -static bool32 IsNotEventMewOrDeoxys(u8 battlerId) +static bool32 IsNotEventLegalMewOrDeoxys(u8 battlerId) { if (GetBattlerSide(battlerId) == B_SIDE_OPPONENT) return TRUE; if (GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES, NULL) != SPECIES_DEOXYS && GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_SPECIES, NULL) != SPECIES_MEW) return TRUE; - return GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_FATEFUL_ENCOUNTER, NULL); + return GetMonData(&gPlayerParty[gBattlerPartyIndexes[battlerId]], MON_DATA_EVENT_LEGAL, NULL); } u8 IsMonDisobedient(void) @@ -3970,7 +3970,7 @@ u8 IsMonDisobedient(void) if (GetBattlerSide(gBattlerAttacker) == B_SIDE_OPPONENT) return 0; - if (IsNotEventMewOrDeoxys(gBattlerAttacker)) // only if species is Mew or Deoxys + if (IsNotEventLegalMewOrDeoxys(gBattlerAttacker)) // only if species is Mew or Deoxys { if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER && GetBattlerPosition(gBattlerAttacker) == 2) return 0; diff --git a/src/egg_hatch.c b/src/egg_hatch.c index a84810f3d..5b80bfb6c 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -297,7 +297,7 @@ static void CreateHatchedMon(struct Pokemon *egg, struct Pokemon *temp) { u16 species; u32 personality, pokerus; - u8 i, friendship, language, gameMet, markings, isFatefulEncounter; + u8 i, friendship, language, gameMet, markings, isEventLegal; u16 moves[MAX_MON_MOVES]; u32 ivs[NUM_STATS]; @@ -320,7 +320,7 @@ static void CreateHatchedMon(struct Pokemon *egg, struct Pokemon *temp) gameMet = GetMonData(egg, MON_DATA_MET_GAME); markings = GetMonData(egg, MON_DATA_MARKINGS); pokerus = GetMonData(egg, MON_DATA_POKERUS); - isFatefulEncounter = GetMonData(egg, MON_DATA_FATEFUL_ENCOUNTER); + isEventLegal = GetMonData(egg, MON_DATA_EVENT_LEGAL); CreateMon(temp, species, EGG_HATCH_LEVEL, USE_RANDOM_IVS, TRUE, personality, OT_ID_PLAYER_ID, 0); @@ -342,7 +342,7 @@ static void CreateHatchedMon(struct Pokemon *egg, struct Pokemon *temp) friendship = 120; SetMonData(temp, MON_DATA_FRIENDSHIP, &friendship); SetMonData(temp, MON_DATA_POKERUS, &pokerus); - SetMonData(temp, MON_DATA_FATEFUL_ENCOUNTER, &isFatefulEncounter); + SetMonData(temp, MON_DATA_EVENT_LEGAL, &isEventLegal); *egg = *temp; } diff --git a/src/party_menu.c b/src/party_menu.c index 2af421da0..b2fd358ca 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -3520,9 +3520,9 @@ static void CursorCb_Register(u8 taskId) { u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES2); u16 species = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES); - u8 isFatefulEncounter = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_FATEFUL_ENCOUNTER); + u8 isEventLegal = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_EVENT_LEGAL); - switch (CanRegisterMonForTradingBoard(*(struct GFtgtGnameSub *)GetHostRFUtgtGname(), species2, species, isFatefulEncounter)) + switch (CanRegisterMonForTradingBoard(*(struct GFtgtGnameSub *)GetHostRFUtgtGname(), species2, species, isEventLegal)) { case CANT_REGISTER_MON: StringExpandPlaceholders(gStringVar4, gText_PkmnCantBeTradedNow); @@ -3547,8 +3547,8 @@ static void CursorCb_Trade1(u8 taskId) { u16 species2 = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES2); u16 species = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_SPECIES); - u8 isFatefulEncounter = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_FATEFUL_ENCOUNTER); - u32 stringId = GetUnionRoomTradeMessageId(*(struct GFtgtGnameSub *)GetHostRFUtgtGname(), gPartnerTgtGnameSub, species2, gUnionRoomOfferedSpecies, gUnionRoomRequestedMonType, species, isFatefulEncounter); + u8 isEventLegal = GetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_EVENT_LEGAL); + u32 stringId = GetUnionRoomTradeMessageId(*(struct GFtgtGnameSub *)GetHostRFUtgtGname(), gPartnerTgtGnameSub, species2, gUnionRoomOfferedSpecies, gUnionRoomRequestedMonType, species, isEventLegal); if (stringId != UR_TRADE_MSG_NONE) { diff --git a/src/pokemon.c b/src/pokemon.c index ea0ab624c..5812e987a 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -2615,12 +2615,12 @@ void ConvertPokemonToBattleTowerPokemon(struct Pokemon *mon, struct BattleTowerP GetMonData(mon, MON_DATA_NICKNAME, dest->nickname); } -void CreateFatefulEncounterMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId) +void CreateEventLegalMon(struct Pokemon *mon, u16 species, u8 level, u8 fixedIV, u8 hasFixedPersonality, u32 fixedPersonality, u8 otIdType, u32 fixedOtId) { - bool32 isFatefulEncounter = TRUE; + bool32 isEventLegal = TRUE; CreateMon(mon, species, level, fixedIV, hasFixedPersonality, fixedPersonality, otIdType, fixedOtId); - SetMonData(mon, MON_DATA_FATEFUL_ENCOUNTER, &isFatefulEncounter); + SetMonData(mon, MON_DATA_EVENT_LEGAL, &isEventLegal); } // If FALSE, should load this game's Deoxys form. If TRUE, should load normal Deoxys form @@ -2755,14 +2755,14 @@ u16 GetUnionRoomTrainerClass(void) return gFacilityClassToTrainerClass[gLinkPlayerFacilityClasses[arrId]]; } -void CreateFatefulEncounterEnemyMon(void) +void CreateEventLegalEnemyMon(void) { s32 species = gSpecialVar_0x8004; s32 level = gSpecialVar_0x8005; s32 itemId = gSpecialVar_0x8006; ZeroEnemyPartyMons(); - CreateFatefulEncounterMon(&gEnemyParty[0], species, level, USE_RANDOM_IVS, 0, 0, 0, 0); + CreateEventLegalMon(&gEnemyParty[0], species, level, USE_RANDOM_IVS, 0, 0, 0, 0); if (itemId) { u8 heldItem[2]; @@ -3931,8 +3931,8 @@ u32 GetBoxMonData(struct BoxPokemon *boxMon, s32 field, u8 *data) case MON_DATA_FILLER: retVal = substruct3->filler; break; - case MON_DATA_FATEFUL_ENCOUNTER: - retVal = substruct3->fatefulEncounter; + case MON_DATA_EVENT_LEGAL: + retVal = substruct3->eventLegal; break; case MON_DATA_SPECIES2: retVal = substruct0->species; @@ -4310,8 +4310,8 @@ void SetBoxMonData(struct BoxPokemon *boxMon, s32 field, const void *dataArg) case MON_DATA_FILLER: SET8(substruct3->filler); break; - case MON_DATA_FATEFUL_ENCOUNTER: - SET8(substruct3->fatefulEncounter); + case MON_DATA_EVENT_LEGAL: + SET8(substruct3->eventLegal); break; case MON_DATA_IVS: { 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; } diff --git a/src/trade.c b/src/trade.c index 0ffeeac2c..cc9a4d91e 100644 --- a/src/trade.c +++ b/src/trade.c @@ -1489,7 +1489,7 @@ static u8 CheckValidityOfTradeMons(u8 *aliveMons, u8 playerPartyCount, u8 player // Partner cant trade illegitimate Deoxys or Mew if (partnerSpecies == SPECIES_DEOXYS || partnerSpecies == SPECIES_MEW) { - if (!GetMonData(&gEnemyParty[partnerMonIdx], MON_DATA_FATEFUL_ENCOUNTER)) + if (!GetMonData(&gEnemyParty[partnerMonIdx], MON_DATA_EVENT_LEGAL)) return PARTNER_MON_INVALID; } @@ -2329,7 +2329,7 @@ static u32 CanTradeSelectedMon(struct Pokemon *playerParty, int partyCount, int if (species[monIdx] == SPECIES_DEOXYS || species[monIdx] == SPECIES_MEW) { - if (!GetMonData(&playerParty[monIdx], MON_DATA_FATEFUL_ENCOUNTER)) + if (!GetMonData(&playerParty[monIdx], MON_DATA_EVENT_LEGAL)) return CANT_TRADE_INVALID_MON; } @@ -2394,17 +2394,17 @@ s32 GetGameProgressForLinkTrade(void) return TRADE_BOTH_PLAYERS_READY; } -static bool32 IsDeoxysOrMewUntradable(u16 species, bool8 isFatefulEncounter) +static bool32 IsDeoxysOrMewUntradable(u16 species, bool8 isEventLegal) { if (species == SPECIES_DEOXYS || species == SPECIES_MEW) { - if (!isFatefulEncounter) + if (!isEventLegal) return TRUE; } return FALSE; } -int GetUnionRoomTradeMessageId(struct GFtgtGnameSub rfuPlayer, struct GFtgtGnameSub rfuPartner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, u8 isFatefulEncounter) +int GetUnionRoomTradeMessageId(struct GFtgtGnameSub rfuPlayer, struct GFtgtGnameSub rfuPartner, u16 playerSpecies2, u16 partnerSpecies, u8 requestedType, u16 playerSpecies, u8 isEventLegal) { bool8 playerHasNationalDex = rfuPlayer.hasNationalDex; bool8 playerIsChampion = rfuPlayer.isChampion; @@ -2424,7 +2424,7 @@ int GetUnionRoomTradeMessageId(struct GFtgtGnameSub rfuPlayer, struct GFtgtGname } } - if (IsDeoxysOrMewUntradable(playerSpecies, isFatefulEncounter)) + if (IsDeoxysOrMewUntradable(playerSpecies, isEventLegal)) { return UR_TRADE_MSG_MON_CANT_BE_TRADED_2; } @@ -2475,11 +2475,11 @@ int GetUnionRoomTradeMessageId(struct GFtgtGnameSub rfuPlayer, struct GFtgtGname return UR_TRADE_MSG_NONE; } -int CanRegisterMonForTradingBoard(struct GFtgtGnameSub rfuPlayer, u16 species2, u16 species, u8 isFatefulEncounter) +int CanRegisterMonForTradingBoard(struct GFtgtGnameSub rfuPlayer, u16 species2, u16 species, u8 isEventLegal) { bool8 hasNationalDex = rfuPlayer.hasNationalDex; - if (IsDeoxysOrMewUntradable(species, isFatefulEncounter)) + if (IsDeoxysOrMewUntradable(species, isEventLegal)) return CANT_REGISTER_MON; if (hasNationalDex) @@ -2421,12 +2421,12 @@ u8 TV_MonDataIdxToRibbon(u8 monDataIdx) if (monDataIdx == MON_DATA_ARTIST_RIBBON) return 23; if (monDataIdx == MON_DATA_EFFORT_RIBBON) return 24; if (monDataIdx == MON_DATA_MARINE_RIBBON) return 25; - if (monDataIdx == MON_DATA_LAND_RIBBON) return 26; - if (monDataIdx == MON_DATA_SKY_RIBBON) return 27; - if (monDataIdx == MON_DATA_COUNTRY_RIBBON) return 28; - if (monDataIdx == MON_DATA_NATIONAL_RIBBON) return 29; - if (monDataIdx == MON_DATA_EARTH_RIBBON) return 30; - if (monDataIdx == MON_DATA_WORLD_RIBBON) return 31; + if (monDataIdx == MON_DATA_LAND_RIBBON) return 26; + if (monDataIdx == MON_DATA_SKY_RIBBON) return 27; + if (monDataIdx == MON_DATA_COUNTRY_RIBBON) return 28; + if (monDataIdx == MON_DATA_NATIONAL_RIBBON) return 29; + if (monDataIdx == MON_DATA_EARTH_RIBBON) return 30; + if (monDataIdx == MON_DATA_WORLD_RIBBON) return 31; return 0; } |