From b95e450cb6208132596be8e721c4b73a751456d4 Mon Sep 17 00:00:00 2001 From: Ct11217 Date: Thu, 11 Aug 2022 22:48:36 -0600 Subject: [PATCH 01/27] Added corner case logic for AI Switching. 1. Refactor Perish Song 2. Yawn 3. Secondary Damage (Leech Seed, Cursed etc). 4. Added Preliminary logic to help AI be smarter against semi-invulnerable Added AI logic regarding abilities that benefit from switching 1. Natural Cure 2. Regenerator --- include/battle_util.h | 1 + src/battle_ai_switch_items.c | 212 +++++++++++++++++++++++++++-------- 2 files changed, 168 insertions(+), 45 deletions(-) diff --git a/include/battle_util.h b/include/battle_util.h index e45acdb89..25226c997 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -105,6 +105,7 @@ bool8 HasNoMonsToSwitch(u8 battlerId, u8 r1, u8 r2); u8 TryWeatherFormChange(u8 battlerId); bool32 TryChangeBattleWeather(u8 battler, u32 weatherEnumId, bool32 viaAbility); u8 AbilityBattleEffects(u8 caseID, u8 battlerId, u16 ability, u8 special, u16 moveArg); +bool32 IsNeutralizingGasOnField(void); u32 GetBattlerAbility(u8 battlerId); u32 IsAbilityOnSide(u32 battlerId, u32 ability); u32 IsAbilityOnOpposingSide(u32 battlerId, u32 ability); diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 034bb59e8..bc26f78cf 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -1,10 +1,13 @@ #include "global.h" #include "battle.h" +#include "constants/battle_ai.h" #include "battle_ai_main.h" #include "battle_ai_util.h" +#include "battle_util.h" #include "battle_anim.h" #include "battle_controllers.h" #include "battle_main.h" +#include "constants/hold_effects.h" #include "battle_setup.h" #include "data.h" #include "pokemon.h" @@ -19,6 +22,7 @@ static bool8 HasSuperEffectiveMoveAgainstOpponents(bool8 noRng); static bool8 FindMonWithFlagsAndSuperEffective(u16 flags, u8 moduloPercent); static bool8 ShouldUseItem(void); +static bool32 AiExpectsToFaintPlayer(void); static bool32 AI_ShouldHeal(u32 healAmount); static bool32 AI_OpponentCanFaintAiWithMod(u32 healAmount); @@ -56,21 +60,6 @@ static bool8 ShouldSwitchIfAllBadMoves(void) } } -static bool8 ShouldSwitchIfPerishSong(void) -{ - if (gStatuses3[gActiveBattler] & STATUS3_PERISH_SONG - && gDisableStructs[gActiveBattler].perishSongTimer == 0) - { - *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; - BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0); - return TRUE; - } - else - { - return FALSE; - } -} - static bool8 ShouldSwitchIfWonderGuard(void) { u8 opposingPosition; @@ -228,44 +217,177 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) return FALSE; } -static bool8 ShouldSwitchIfNaturalCure(void) +static bool8 ShouldSwitchIfGameStatePrompt(void) { - if (!(gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP)) - return FALSE; - if (AI_GetAbility(gActiveBattler) != ABILITY_NATURAL_CURE) - return FALSE; - if (gBattleMons[gActiveBattler].hp < gBattleMons[gActiveBattler].maxHP / 2) - return FALSE; + bool8 switchMon = FALSE; + u16 monAbility = AI_GetAbility(gActiveBattler); + u16 holdEffect = AI_GetHoldEffect(gActiveBattler); + u8 opposingPosition = BATTLE_OPPOSITE(GetBattlerPosition(gActiveBattler)); + u8 opposingBattler = GetBattlerAtPosition(opposingPosition); + s32 moduloChance = 4; //25% Chance Default + s32 chanceReducer = 1; //No Reduce default. Increase to reduce - if ((gLastLandedMoves[gActiveBattler] == MOVE_NONE - || gLastLandedMoves[gActiveBattler] == MOVE_UNAVAILABLE) - && Random() & 1) + + if (AnyStatIsRaised(gActiveBattler)) + chanceReducer = 5; // Reduce switchout probability by factor of 5 if setup + + //Perish Song + if (gStatuses3[gActiveBattler] & STATUS3_PERISH_SONG + && gDisableStructs[gActiveBattler].perishSongTimer == 0 + && monAbility != ABILITY_SOUNDPROOF) + switchMon = TRUE; + + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_SMART_SWITCHING) + { + //Yawn + if (gStatuses3[gActiveBattler] & STATUS3_YAWN + && AI_CanSleep(gActiveBattler, monAbility) + && gBattleMons[gActiveBattler].hp > gBattleMons[gActiveBattler].maxHP / 3) + { + switchMon = TRUE; + + //ToDo: + //Double Battles + //Add logic checking to see if effected by yawn & ally wants to switch out to a pokemon that will set Misty or Electric Terrain + + //Check if Active Pokemon can KO opponent instead of switching + //Will still fall asleep, but take out opposing Pokemon first + if (AiExpectsToFaintPlayer()) + switchMon = FALSE; + + //Checks to see if active Pokemon can do something against sleep + if (monAbility == (ABILITY_NATURAL_CURE | ABILITY_SHED_SKIN | ABILITY_EARLY_BIRD) + || holdEffect == (HOLD_EFFECT_CURE_SLP | HOLD_EFFECT_CURE_STATUS) + || HasMove(gActiveBattler, MOVE_SLEEP_TALK) + || (HasMoveEffect(gActiveBattler, MOVE_SNORE) && AI_GetTypeEffectiveness(MOVE_SNORE, gActiveBattler, opposingBattler) >= UQ_4_12(1.0)) + || (IsBattlerGrounded(gActiveBattler) + && (HasMove(gActiveBattler, MOVE_MISTY_TERRAIN) || HasMove(gActiveBattler, MOVE_ELECTRIC_TERRAIN))) + ) + switchMon = FALSE; + + //Check if Active Pokemon evasion boosted and might be able to dodge until awake + if (gBattleMons[gActiveBattler].statStages[STAT_EVASION] > (DEFAULT_STAT_STAGE + 3) + && AI_GetAbility(opposingBattler) != ABILITY_UNAWARE + && AI_GetAbility(opposingBattler) != ABILITY_KEEN_EYE + && !(gBattleMons[gActiveBattler].status2 & STATUS2_FORESIGHT) + && !(gStatuses3[gActiveBattler] & STATUS3_MIRACLE_EYED)) + switchMon = FALSE; + + } + + //Secondary Damage + if (monAbility != ABILITY_MAGIC_GUARD + && !AiExpectsToFaintPlayer()) + { + //Toxic + moduloChance = 2; //50% + if (gBattleMons[gActiveBattler].status1 & (STATUS1_TOXIC_COUNTER > 2) + && gBattleMons[gActiveBattler].hp >= (gBattleMons[gActiveBattler].maxHP / 3) + && (Random() % (moduloChance*chanceReducer)) == 0) + switchMon = TRUE; + + //Cursed + moduloChance = 2; //50% + if (gBattleMons[gActiveBattler].status2 & STATUS2_CURSED + && (Random() % (moduloChance*chanceReducer)) == 0) + switchMon = TRUE; + + //Nightmare + moduloChance = 3; //33.3% + if (gBattleMons[gActiveBattler].status1 & (STATUS1_SLEEP > 1) && gBattleMons[gActiveBattler].status2 & STATUS2_NIGHTMARE + && (Random() % (moduloChance*chanceReducer)) == 0) + switchMon = TRUE; + + //Leech Seed + moduloChance = 4; //25% + if (gStatuses3[gActiveBattler] & STATUS3_LEECHSEED + && (Random() % (moduloChance*chanceReducer)) == 0) + switchMon = TRUE; + } + + //Infatuation + if (gBattleMons[gActiveBattler].status2 & STATUS2_INFATUATION + && !AiExpectsToFaintPlayer()) + switchMon = TRUE; + + //Todo + //Pass Wish Heal + + //Semi-Invulnerable + if (gStatuses3[opposingBattler] & STATUS3_SEMI_INVULNERABLE) + if (FindMonThatAbsorbsOpponentsMove()) //If find absorber default to switch + switchMon = TRUE; + if (!AI_OpponentCanFaintAiWithMod(0) + && AnyStatIsRaised(gActiveBattler)) + switchMon = FALSE; + if (AiExpectsToFaintPlayer() + && GetAIChosenMove(gActiveBattler) == AI_IS_SLOWER + && !AI_OpponentCanFaintAiWithMod(0)) + switchMon = FALSE; + } + + + if (switchMon) { *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0); return TRUE; } - else if (gBattleMoves[gLastLandedMoves[gActiveBattler]].power == 0 - && Random() & 1) - { - *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; - BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0); - return TRUE; + else + return FALSE; +} + +static bool8 ShouldSwitchIfAbilityBenefit(void) +{ + s32 monToSwitchId; + s32 moduloChance = 4; //25% Chance Default + s32 chanceReducer = 1; //No Reduce default. Increase to reduce + u8 battlerId = GetBattlerPosition(gActiveBattler); + + if (AnyStatIsRaised(battlerId)) + chanceReducer = 5; // Reduce switchout probability by factor of 5 if setup + + //Check if ability is blocked + if (gStatuses3[gActiveBattler] & STATUS3_GASTRO_ACID + ||IsNeutralizingGasOnField()) + return FALSE; + + switch(AI_GetAbility(gActiveBattler)) { + case ABILITY_NATURAL_CURE: + moduloChance = 4; //25% + //Attempt to cure bad ailment + if (gBattleMons[gActiveBattler].status1 & (STATUS1_SLEEP | STATUS1_FREEZE | STATUS1_TOXIC_POISON) + && GetMostSuitableMonToSwitchInto() != PARTY_SIZE) + break; + //Attempt to cure lesser ailment + if ((gBattleMons[gActiveBattler].status1 & STATUS1_ANY) + && (gBattleMons[gActiveBattler].hp >= gBattleMons[gActiveBattler].maxHP / 2) + && GetMostSuitableMonToSwitchInto() != PARTY_SIZE + && Random() % (moduloChance*chanceReducer) == 0) + break; + + return FALSE; + + case ABILITY_REGENERATOR: + moduloChance = 2; //50% + //Don't switch if ailment + if (gBattleMons[gActiveBattler].status1 & STATUS1_ANY) + return FALSE; + if ((gBattleMons[gActiveBattler].hp <= ((gBattleMons[gActiveBattler].maxHP * 2) / 3)) + && GetMostSuitableMonToSwitchInto() != PARTY_SIZE + && Random() % (moduloChance*chanceReducer) == 0) + break; + + return FALSE; + + default: + return FALSE; } - if (FindMonWithFlagsAndSuperEffective(MOVE_RESULT_DOESNT_AFFECT_FOE, 1)) - return TRUE; - if (FindMonWithFlagsAndSuperEffective(MOVE_RESULT_NOT_VERY_EFFECTIVE, 1)) - return TRUE; + *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; + BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0); - if (Random() & 1) - { - *(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) = PARTY_SIZE; - BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0); - return TRUE; - } - - return FALSE; + return TRUE; } static bool8 HasSuperEffectiveMoveAgainstOpponents(bool8 noRng) @@ -489,13 +611,13 @@ bool32 ShouldSwitch(void) return FALSE; if (ShouldSwitchIfAllBadMoves()) return TRUE; - if (ShouldSwitchIfPerishSong()) + if (ShouldSwitchIfGameStatePrompt()) return TRUE; if (ShouldSwitchIfWonderGuard()) return TRUE; if (FindMonThatAbsorbsOpponentsMove()) return TRUE; - if (ShouldSwitchIfNaturalCure()) + if (ShouldSwitchIfAbilityBenefit()) return TRUE; if (HasSuperEffectiveMoveAgainstOpponents(FALSE)) return FALSE; From 7378d1099b3df6e39b25c819197f53f5c4e8fd55 Mon Sep 17 00:00:00 2001 From: Ct11217 Date: Fri, 12 Aug 2022 15:21:25 -0600 Subject: [PATCH 02/27] Removed AI_GetAbility Misc cleanup --- src/battle_ai_switch_items.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index bc26f78cf..5b4b1a30b 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -1,6 +1,5 @@ #include "global.h" #include "battle.h" -#include "constants/battle_ai.h" #include "battle_ai_main.h" #include "battle_ai_util.h" #include "battle_util.h" @@ -169,7 +168,7 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) else return FALSE; - if (AI_GetAbility(gActiveBattler) == absorbingTypeAbility) + if (AI_DATA->abilities[gActiveBattler]) == absorbingTypeAbility) return FALSE; GetAIPartyIndexes(gActiveBattler, &firstId, &lastId); @@ -220,8 +219,8 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) static bool8 ShouldSwitchIfGameStatePrompt(void) { bool8 switchMon = FALSE; - u16 monAbility = AI_GetAbility(gActiveBattler); - u16 holdEffect = AI_GetHoldEffect(gActiveBattler); + u16 monAbility = AI_DATA->abilities[gActiveBattler]; + u16 holdEffect = AI_DATA->holdEffects[gActiveBattler]; u8 opposingPosition = BATTLE_OPPOSITE(GetBattlerPosition(gActiveBattler)); u8 opposingBattler = GetBattlerAtPosition(opposingPosition); s32 moduloChance = 4; //25% Chance Default @@ -267,8 +266,8 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) //Check if Active Pokemon evasion boosted and might be able to dodge until awake if (gBattleMons[gActiveBattler].statStages[STAT_EVASION] > (DEFAULT_STAT_STAGE + 3) - && AI_GetAbility(opposingBattler) != ABILITY_UNAWARE - && AI_GetAbility(opposingBattler) != ABILITY_KEEN_EYE + && AI_DATA->abilities[opposingBattler] != ABILITY_UNAWARE + && AI_DATA->abilities[opposingBattler] != ABILITY_KEEN_EYE && !(gBattleMons[gActiveBattler].status2 & STATUS2_FORESIGHT) && !(gStatuses3[gActiveBattler] & STATUS3_MIRACLE_EYED)) switchMon = FALSE; @@ -334,7 +333,9 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) return TRUE; } else + { return FALSE; + } } static bool8 ShouldSwitchIfAbilityBenefit(void) @@ -352,7 +353,7 @@ static bool8 ShouldSwitchIfAbilityBenefit(void) ||IsNeutralizingGasOnField()) return FALSE; - switch(AI_GetAbility(gActiveBattler)) { + switch(AI_DATA->abilities[gActiveBattler]) { case ABILITY_NATURAL_CURE: moduloChance = 4; //25% //Attempt to cure bad ailment From bb978764f373bc90c7bbf3d9155393e98cfcf191 Mon Sep 17 00:00:00 2001 From: Ct11217 Date: Sat, 13 Aug 2022 00:39:44 -0600 Subject: [PATCH 03/27] Fixed recommended changes Added additional double battle logic for yawn --- src/battle_ai_switch_items.c | 54 +++++++++++++++++++++++++++++++++--- 1 file changed, 50 insertions(+), 4 deletions(-) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 5b4b1a30b..3b00340d2 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -1,5 +1,6 @@ #include "global.h" #include "battle.h" +#include "constants/battle_ai.h" #include "battle_ai_main.h" #include "battle_ai_util.h" #include "battle_util.h" @@ -14,6 +15,7 @@ #include "util.h" #include "constants/abilities.h" #include "constants/item_effects.h" +#include "constants/battle_move_effects.h" #include "constants/items.h" #include "constants/moves.h" @@ -168,7 +170,7 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) else return FALSE; - if (AI_DATA->abilities[gActiveBattler]) == absorbingTypeAbility) + if (AI_DATA->abilities[gActiveBattler] == absorbingTypeAbility) return FALSE; GetAIPartyIndexes(gActiveBattler, &firstId, &lastId); @@ -225,6 +227,10 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) u8 opposingBattler = GetBattlerAtPosition(opposingPosition); s32 moduloChance = 4; //25% Chance Default s32 chanceReducer = 1; //No Reduce default. Increase to reduce + s32 firstId; + s32 lastId; + s32 i; + struct Pokemon *party; if (AnyStatIsRaised(gActiveBattler)) @@ -245,10 +251,50 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) { switchMon = TRUE; - //ToDo: - //Double Battles - //Add logic checking to see if effected by yawn & ally wants to switch out to a pokemon that will set Misty or Electric Terrain + //Double Battles + //Check if partner can prevent sleep + if (IsDoubleBattle()) + { + if (IsBattlerAlive(BATTLE_PARTNER(gActiveBattler)) + && (GetAIChosenMove(BATTLE_PARTNER(gActiveBattler)) & MOVE_UPROAR) + ) + switchMon = FALSE; + if (IsBattlerAlive(BATTLE_PARTNER(gActiveBattler)) + && (gBattleMoves[AI_DATA->partnerMove].effect == EFFECT_MISTY_TERRAIN + || gBattleMoves[AI_DATA->partnerMove].effect == EFFECT_ELECTRIC_TERRAIN) + && IsBattlerGrounded(gActiveBattler) + ) + switchMon = FALSE; + + if (*(gBattleStruct->AI_monToSwitchIntoId + BATTLE_PARTNER(gActiveBattler)) != PARTY_SIZE) //Partner is switching + { + GetAIPartyIndexes(gActiveBattler, &firstId, &lastId); + + if (GetBattlerSide(gActiveBattler) == B_SIDE_PLAYER) + party = gPlayerParty; + + for (i = firstId; i < lastId; i++) + { + //Look for mon in party that is able to be switched into and has ability that sets terrain + if (GetMonData(&party[i], MON_DATA_HP) != 0 + && GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE + && GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_EGG + && i != gBattlerPartyIndexes[gActiveBattler] + && i != gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)] + && IsBattlerGrounded(gActiveBattler) + && (GetMonData(&party[i], MON_DATA_ABILITY_NUM) == 226 + || GetMonData(&party[i], MON_DATA_ABILITY_NUM) == 228)) //Ally has Misty or Electric Surge + { + *(gBattleStruct->AI_monToSwitchIntoId + BATTLE_PARTNER(gActiveBattler)) = i; + BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0); + switchMon = FALSE; + break; + } + } + } + } + //Check if Active Pokemon can KO opponent instead of switching //Will still fall asleep, but take out opposing Pokemon first if (AiExpectsToFaintPlayer()) From a4b53126f639439a0901d94fbdedd8c4a9dfd5cd Mon Sep 17 00:00:00 2001 From: Ct11217 Date: Wed, 17 Aug 2022 18:23:12 -0600 Subject: [PATCH 04/27] Added AI_FLAG_ACE_POKEMON When this flag is set, the trainer will have an "Ace" pokemon that will always be sent out last. If this flag is set, the last Pokemon in the party will be considered the "Ace" Pokemon. This is similar to the gym leader functionality found in Sword & Shield. --- include/constants/battle_ai.h | 1 + src/battle_ai_switch_items.c | 24 ++++++++++++++++++++++-- src/battle_controller_opponent.c | 30 ++++++++++++++++++++++++++++-- 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/include/constants/battle_ai.h b/include/constants/battle_ai.h index d48827683..a7a3e5418 100644 --- a/include/constants/battle_ai.h +++ b/include/constants/battle_ai.h @@ -56,6 +56,7 @@ #define AI_FLAG_STALL (1 << 13) // AI stalls battle and prefers secondary damage/trapping/etc. TODO not finished #define AI_FLAG_SCREENER (1 << 14) // AI prefers screening effects like reflect, mist, etc. TODO unfinished #define AI_FLAG_SMART_SWITCHING (1 << 15) // AI includes a lot more switching checks +#define AI_FLAG_ACE_POKEMON (1 << 16) // AI has Ace Pokemon -- Saves until last // 'other' ai logic flags #define AI_FLAG_ROAMING (1 << 29) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 3b00340d2..329d3ebf3 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -199,6 +199,10 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) continue; if (i == *(gBattleStruct->monToSwitchIntoId + battlerIn2)) continue; + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + && i == (CalculateEnemyPartyCount()-1)) + continue; + species = GetMonData(&party[i], MON_DATA_SPECIES); if (GetMonData(&party[i], MON_DATA_ABILITY_NUM) != 0) @@ -276,6 +280,10 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) for (i = firstId; i < lastId; i++) { + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + && i == (CalculateEnemyPartyCount()-1)) + break; + //Look for mon in party that is able to be switched into and has ability that sets terrain if (GetMonData(&party[i], MON_DATA_HP) != 0 && GetMonData(&party[i], MON_DATA_SPECIES2) != SPECIES_NONE @@ -562,6 +570,10 @@ static bool8 FindMonWithFlagsAndSuperEffective(u16 flags, u8 moduloPercent) continue; if (i == *(gBattleStruct->monToSwitchIntoId + battlerIn2)) continue; + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + && i == (CalculateEnemyPartyCount()-1)) + continue; + species = GetMonData(&party[i], MON_DATA_SPECIES); if (GetMonData(&party[i], MON_DATA_ABILITY_NUM) != 0) @@ -650,6 +662,9 @@ bool32 ShouldSwitch(void) continue; if (i == *(gBattleStruct->monToSwitchIntoId + battlerIn2)) continue; + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + && i == (CalculateEnemyPartyCount()-1)) + continue; availableToSwitch++; } @@ -712,7 +727,7 @@ void AI_TrySwitchOrUseItem(void) GetAIPartyIndexes(gActiveBattler, &firstId, &lastId); - for (monToSwitchId = firstId; monToSwitchId < lastId; monToSwitchId++) + for (monToSwitchId = (lastId-1); monToSwitchId >= firstId; monToSwitchId--) { if (GetMonData(&party[monToSwitchId], MON_DATA_HP) == 0) continue; @@ -724,6 +739,9 @@ void AI_TrySwitchOrUseItem(void) continue; if (monToSwitchId == *(gBattleStruct->monToSwitchIntoId + battlerIn2)) continue; + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + && monToSwitchId == (CalculateEnemyPartyCount()-1)) + continue; break; } @@ -921,7 +939,9 @@ u8 GetMostSuitableMonToSwitchInto(void) || gBattlerPartyIndexes[battlerIn2] == i || i == *(gBattleStruct->monToSwitchIntoId + battlerIn1) || i == *(gBattleStruct->monToSwitchIntoId + battlerIn2) - || (GetMonAbility(&party[i]) == ABILITY_TRUANT && IsTruantMonVulnerable(gActiveBattler, opposingBattler))) // While not really invalid per say, not really wise to switch into this mon. + || (GetMonAbility(&party[i]) == ABILITY_TRUANT && IsTruantMonVulnerable(gActiveBattler, opposingBattler)) // While not really invalid per say, not really wise to switch into this mon. + || (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + && i == (CalculateEnemyPartyCount()-1))) //Save Ace Pokemon for last invalidMons |= gBitTable[i]; else aliveCount++; diff --git a/src/battle_controller_opponent.c b/src/battle_controller_opponent.c index 501e31704..ddc4c4405 100644 --- a/src/battle_controller_opponent.c +++ b/src/battle_controller_opponent.c @@ -2,6 +2,7 @@ #include "battle.h" #include "battle_ai_main.h" #include "battle_ai_util.h" +#include "constants/battle_ai.h" #include "battle_anim.h" #include "battle_arena.h" #include "battle_controllers.h" @@ -94,6 +95,7 @@ static void OpponentHandleResetActionMoveSelection(void); static void OpponentHandleEndLinkBattle(void); static void OpponentHandleDebugMenu(void); static void OpponentCmdEnd(void); +static u8 CountAIAliveNonEggMonsExcept(u8 slotToIgnore); static void OpponentBufferRunCommand(void); static void OpponentBufferExecCompleted(void); @@ -1670,6 +1672,7 @@ static void OpponentHandleChooseItem(void) static void OpponentHandleChoosePokemon(void) { s32 chosenMonId; + s32 pokemonInBattle = 1; if (*(gBattleStruct->AI_monToSwitchIntoId + gActiveBattler) == PARTY_SIZE) { @@ -1687,15 +1690,20 @@ static void OpponentHandleChoosePokemon(void) { battler1 = GetBattlerAtPosition(B_POSITION_OPPONENT_LEFT); battler2 = GetBattlerAtPosition(B_POSITION_OPPONENT_RIGHT); + pokemonInBattle = 2; + } GetAIPartyIndexes(gActiveBattler, &firstId, &lastId); - for (chosenMonId = firstId; chosenMonId < lastId; chosenMonId++) + for (chosenMonId = (lastId-1); chosenMonId >= firstId; chosenMonId--) { if (GetMonData(&gEnemyParty[chosenMonId], MON_DATA_HP) != 0 && chosenMonId != gBattlerPartyIndexes[battler1] - && chosenMonId != gBattlerPartyIndexes[battler2]) + && chosenMonId != gBattlerPartyIndexes[battler2] + && (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + && (!(chosenMonId == (CalculateEnemyPartyCount()-1)) + || CountAIAliveNonEggMonsExcept(PARTY_SIZE) == pokemonInBattle))) { break; } @@ -1714,6 +1722,24 @@ static void OpponentHandleChoosePokemon(void) OpponentBufferExecCompleted(); } +static u8 CountAIAliveNonEggMonsExcept(u8 slotToIgnore) +{ + u16 i, count; + + for (i = 0, count = 0; i < PARTY_SIZE; i++) + { + if (i != slotToIgnore + && GetMonData(&gEnemyParty[i], MON_DATA_SPECIES) != SPECIES_NONE + && !GetMonData(&gEnemyParty[i], MON_DATA_IS_EGG) + && GetMonData(&gEnemyParty[i], MON_DATA_HP) != 0) + { + count++; + } + } + + return count; +} + static void OpponentHandleCmd23(void) { OpponentBufferExecCompleted(); From 67f473f38b4af0148273d601c9c6b9d16143e2a7 Mon Sep 17 00:00:00 2001 From: Ct11217 Date: Tue, 23 Aug 2022 19:49:54 -0600 Subject: [PATCH 05/27] Fixed recommended issues. Added additional comments. Reordered switching ladder in ShouldSwitch() function. Functions that can specify a specific party mon to switch into need to come first. --- include/constants/battle_ai.h | 2 +- src/battle_ai_switch_items.c | 32 ++++++++++++++++++++++++-------- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/include/constants/battle_ai.h b/include/constants/battle_ai.h index a7a3e5418..5dbbccf48 100644 --- a/include/constants/battle_ai.h +++ b/include/constants/battle_ai.h @@ -56,7 +56,7 @@ #define AI_FLAG_STALL (1 << 13) // AI stalls battle and prefers secondary damage/trapping/etc. TODO not finished #define AI_FLAG_SCREENER (1 << 14) // AI prefers screening effects like reflect, mist, etc. TODO unfinished #define AI_FLAG_SMART_SWITCHING (1 << 15) // AI includes a lot more switching checks -#define AI_FLAG_ACE_POKEMON (1 << 16) // AI has Ace Pokemon -- Saves until last +#define AI_FLAG_ACE_POKEMON (1 << 16) // AI has Ace Pokemon. The last Pokemon in the party will not used until last remaining. // 'other' ai logic flags #define AI_FLAG_ROAMING (1 << 29) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 329d3ebf3..04aa8d23b 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -109,6 +109,9 @@ static bool8 ShouldSwitchIfWonderGuard(void) continue; if (i == gBattlerPartyIndexes[gActiveBattler]) continue; + if (AI_THINKING_STRUCT->aiFlags & AI_FLAG_ACE_POKEMON + && i == (CalculateEnemyPartyCount()-1)) + continue; for (opposingBattler = GetBattlerAtPosition(opposingPosition), j = 0; j < MAX_MON_MOVES; j++) { @@ -260,7 +263,7 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) if (IsDoubleBattle()) { if (IsBattlerAlive(BATTLE_PARTNER(gActiveBattler)) - && (GetAIChosenMove(BATTLE_PARTNER(gActiveBattler)) & MOVE_UPROAR) + && (GetAIChosenMove(BATTLE_PARTNER(gActiveBattler)) == MOVE_UPROAR) ) switchMon = FALSE; @@ -291,8 +294,8 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) && i != gBattlerPartyIndexes[gActiveBattler] && i != gBattlerPartyIndexes[BATTLE_PARTNER(gActiveBattler)] && IsBattlerGrounded(gActiveBattler) - && (GetMonData(&party[i], MON_DATA_ABILITY_NUM) == 226 - || GetMonData(&party[i], MON_DATA_ABILITY_NUM) == 228)) //Ally has Misty or Electric Surge + && (GetMonAbility(&party[i]) == ABILITY_MISTY_SURGE + || GetMonAbility(&party[i]) == ABILITY_ELECTRIC_SURGE)) //Ally has Misty or Electric Surge { *(gBattleStruct->AI_monToSwitchIntoId + BATTLE_PARTNER(gActiveBattler)) = i; BtlController_EmitTwoReturnValues(BUFFER_B, B_ACTION_SWITCH, 0); @@ -347,7 +350,7 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) //Nightmare moduloChance = 3; //33.3% - if (gBattleMons[gActiveBattler].status1 & (STATUS1_SLEEP > 1) && gBattleMons[gActiveBattler].status2 & STATUS2_NIGHTMARE + if (gBattleMons[gActiveBattler].status2 & STATUS2_NIGHTMARE && (Random() % (moduloChance*chanceReducer)) == 0) switchMon = TRUE; @@ -374,7 +377,7 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) && AnyStatIsRaised(gActiveBattler)) switchMon = FALSE; if (AiExpectsToFaintPlayer() - && GetAIChosenMove(gActiveBattler) == AI_IS_SLOWER + && !WillAIStrikeFirst() && !AI_OpponentCanFaintAiWithMod(0)) switchMon = FALSE; } @@ -671,20 +674,33 @@ bool32 ShouldSwitch(void) if (availableToSwitch == 0) return FALSE; - if (ShouldSwitchIfAllBadMoves()) + + //NOTE: The sequence of the below functions matter! Do not change unless you have carefully considered the outcome. + //Since the order is sequencial, and some of these functions prompt switch to specific party members. + + //These Functions can prompt switch to specific party members + if (ShouldSwitchIfWonderGuard()) return TRUE; if (ShouldSwitchIfGameStatePrompt()) return TRUE; - if (ShouldSwitchIfWonderGuard()) - return TRUE; if (FindMonThatAbsorbsOpponentsMove()) return TRUE; + + //These Functions can prompt switch to generic pary members + if (ShouldSwitchIfAllBadMoves()) + return TRUE; if (ShouldSwitchIfAbilityBenefit()) return TRUE; + + //Removing switch capabilites under specific conditions + //These Functions prevent the "FindMonWithFlagsAndSuperEffective" from getting out of hand. if (HasSuperEffectiveMoveAgainstOpponents(FALSE)) return FALSE; if (AreStatsRaised()) return FALSE; + + //Default Function + //Can prompt switch if AI has a pokemon in party that resists current opponent & has super effective move if (FindMonWithFlagsAndSuperEffective(MOVE_RESULT_DOESNT_AFFECT_FOE, 2) || FindMonWithFlagsAndSuperEffective(MOVE_RESULT_NOT_VERY_EFFECTIVE, 3)) return TRUE; From 494e8791d742f72273f65bf7edef9b240f05d38e Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Tue, 30 Aug 2022 21:18:54 -0400 Subject: [PATCH 06/27] Fixed tutors changing levels --- src/party_menu.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/party_menu.c b/src/party_menu.c index 00224f6bd..4d7f24883 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -5040,7 +5040,8 @@ static void CB2_ShowSummaryScreenToForgetMove(void) static void CB2_ReturnToPartyMenuWhileLearningMove(void) { - SetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_LEVEL, &sFinalLevel); // to avoid displaying incorrect level + if (sFinalLevel != 0) + SetMonData(&gPlayerParty[gPartyMenu.slotId], MON_DATA_LEVEL, &sFinalLevel); // to avoid displaying incorrect level InitPartyMenu(PARTY_MENU_TYPE_FIELD, PARTY_LAYOUT_SINGLE, PARTY_ACTION_CHOOSE_MON, TRUE, PARTY_MSG_NONE, Task_ReturnToPartyMenuWhileLearningMove, gPartyMenu.exitCallback); } @@ -5313,6 +5314,10 @@ static void PartyMenuTryEvolution(u8 taskId) struct Pokemon *mon = &gPlayerParty[gPartyMenu.slotId]; u16 targetSpecies = GetEvolutionTargetSpecies(mon, EVO_MODE_NORMAL, ITEM_NONE, NULL); + // Resets values to 0 so other means of teaching moves doesn't overwrite levels + sInitialLevel = 0; + sFinalLevel = 0; + if (targetSpecies != SPECIES_NONE) { FreePartyPointers(); From 29448b6acca364feb4476e9d72270bb6bf98ffbe Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Tue, 30 Aug 2022 22:05:47 -0400 Subject: [PATCH 07/27] Fixed XL Candy going out of bounds. Also added failsafe in case an invalid param is used. --- src/pokemon.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/pokemon.c b/src/pokemon.c index 350aebf0b..8b3938aa5 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -5714,20 +5714,26 @@ bool8 PokemonUseItemEffects(struct Pokemon *mon, u16 item, u8 partyIndex, u8 mov && GetMonData(mon, MON_DATA_LEVEL, NULL) != MAX_LEVEL) { u8 param = ItemId_GetHoldEffectParam(item); + dataUnsigned = 0; + if (param == 0) // Rare Candy { dataUnsigned = gExperienceTables[gBaseStats[GetMonData(mon, MON_DATA_SPECIES, NULL)].growthRate][GetMonData(mon, MON_DATA_LEVEL, NULL) + 1]; } - else if (param < ARRAY_COUNT(sExpCandyExperienceTable)) // EXP Candies + else if (param - 1 < ARRAY_COUNT(sExpCandyExperienceTable)) // EXP Candies { u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL); dataUnsigned = sExpCandyExperienceTable[param - 1] + GetMonData(mon, MON_DATA_EXP, NULL); if (dataUnsigned > gExperienceTables[gBaseStats[species].growthRate][MAX_LEVEL]) dataUnsigned = gExperienceTables[gBaseStats[species].growthRate][MAX_LEVEL]; } - SetMonData(mon, MON_DATA_EXP, &dataUnsigned); - CalculateMonStats(mon); - retVal = FALSE; + + if (dataUnsigned != 0) // Failsafe + { + SetMonData(mon, MON_DATA_EXP, &dataUnsigned); + CalculateMonStats(mon); + retVal = FALSE; + } } // Cure status From fe5f30c2005bd668febfd1568c511eddbf0527e8 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Tue, 30 Aug 2022 22:50:20 -0400 Subject: [PATCH 08/27] Fixed moves learned at the same level being skipped while using exp candies --- src/party_menu.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/party_menu.c b/src/party_menu.c index 4d7f24883..73937b966 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -5292,11 +5292,14 @@ static void Task_TryLearningNextMove(u8 taskId) switch (result) { case 0: // No moves to learn + if (sInitialLevel >= sFinalLevel) + PartyMenuTryEvolution(taskId); break; case MON_HAS_MAX_MOVES: DisplayMonNeedsToReplaceMove(taskId); break; case MON_ALREADY_KNOWS_MOVE: + gTasks[taskId].func = Task_TryLearningNextMove; return; default: DisplayMonLearnedMove(taskId, result); @@ -5305,8 +5308,6 @@ static void Task_TryLearningNextMove(u8 taskId) if (result) break; } - if (sInitialLevel >= sFinalLevel) - PartyMenuTryEvolution(taskId); } static void PartyMenuTryEvolution(u8 taskId) From 3264c3c87a3dc68d1aac4c549ba12b729a25303e Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 31 Aug 2022 09:05:51 -0400 Subject: [PATCH 09/27] Shows amount of Exp gained. --- include/pokemon.h | 1 + src/party_menu.c | 1 + src/pokemon.c | 2 +- src/strings.c | 2 +- 4 files changed, 4 insertions(+), 2 deletions(-) diff --git a/include/pokemon.h b/include/pokemon.h index 94fdff91d..34065c6cc 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -406,6 +406,7 @@ extern const u16 gLinkPlayerFacilityClasses[]; extern const struct SpriteTemplate gBattlerSpriteTemplates[]; extern const s8 gNatureStatTable[][5]; extern const u16 *const gFormSpeciesIdTables[NUM_SPECIES]; +extern const u32 sExpCandyExperienceTable[]; void ZeroBoxMonData(struct BoxPokemon *boxMon); void ZeroMonData(struct Pokemon *mon); diff --git a/src/party_menu.c b/src/party_menu.c index 73937b966..e94bfb928 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -5187,6 +5187,7 @@ void ItemUseCB_RareCandy(u8 taskId, TaskFunc task) { PlaySE(SE_USE_ITEM); gPartyMenuUseExitCallback = FALSE; + ConvertIntToDecimalStringN(gStringVar2, sExpCandyExperienceTable[ItemId_GetHoldEffectParam(*itemPtr)], STR_CONV_MODE_LEFT_ALIGN, 3); StringExpandPlaceholders(gStringVar4, gText_PkmnGainedExp); DisplayPartyMenuMessage(gStringVar4, FALSE); ScheduleBgCopyTilemapToVram(2); diff --git a/src/pokemon.c b/src/pokemon.c index 8b3938aa5..bca560175 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -5507,7 +5507,7 @@ bool8 ExecuteTableBasedItemEffect(struct Pokemon *mon, u16 item, u8 partyIndex, } // EXP candies store an index for this table in their holdEffectParam. -static const u32 sExpCandyExperienceTable[] = { +const u32 sExpCandyExperienceTable[] = { [EXP_100 - 1] = 100, [EXP_800 - 1] = 800, [EXP_3000 - 1] = 3000, diff --git a/src/strings.c b/src/strings.c index d199b92d4..52f1b6be7 100644 --- a/src/strings.c +++ b/src/strings.c @@ -417,7 +417,7 @@ const u8 gText_PkmnRegainhedHealth[] = _("{STR_VAR_1} regained health.{PAUSE_UNT const u8 gText_PkmnBecameHealthy[] = _("{STR_VAR_1} became healthy.{PAUSE_UNTIL_PRESS}"); const u8 gText_MovesPPIncreased[] = _("{STR_VAR_1}'s PP increased.{PAUSE_UNTIL_PRESS}"); const u8 gText_PkmnElevatedToLvVar2[] = _("{STR_VAR_1} was elevated to\nLv. {STR_VAR_2}."); -const u8 gText_PkmnGainedExp[] = _("{STR_VAR_1} gained Exp. Points!{PAUSE_UNTIL_PRESS}"); +const u8 gText_PkmnGainedExp[] = _("{STR_VAR_1} gained {STR_VAR_2} Exp. Points!{PAUSE_UNTIL_PRESS}"); const u8 gText_PkmnBaseVar2StatIncreased[] = _("{STR_VAR_1}'s base {STR_VAR_2}\nstat was raised.{PAUSE_UNTIL_PRESS}"); const u8 gText_PkmnFriendlyBaseVar2Fell[] = _("{STR_VAR_1} turned friendly.\nThe base {STR_VAR_2} fell!{PAUSE_UNTIL_PRESS}"); const u8 gText_PkmnAdoresBaseVar2Fell[] = _("{STR_VAR_1} adores you!\nThe base {STR_VAR_2} fell!{PAUSE_UNTIL_PRESS}"); From 8d94c58cacd46657df3163426ec5b93d1fb72b25 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Wed, 31 Aug 2022 21:54:27 -0400 Subject: [PATCH 10/27] Shows exp when leveling up with Exp Candies --- include/strings.h | 1 + src/party_menu.c | 27 ++++++++++++++++++++++++--- src/strings.c | 1 + 3 files changed, 26 insertions(+), 3 deletions(-) diff --git a/include/strings.h b/include/strings.h index 25a96eef0..f8f5da4da 100644 --- a/include/strings.h +++ b/include/strings.h @@ -500,6 +500,7 @@ extern const u8 gText_StopLearningMove2[]; extern const u8 gText_MoveNotLearned[]; extern const u8 gText_PkmnElevatedToLvVar2[]; extern const u8 gText_PkmnGainedExp[]; +extern const u8 gText_PkmnGainedExpAndElevatedToLvVar3[]; extern const u8 gText_RemoveMailBeforeItem[]; extern const u8 gText_PkmnHoldingItemCantHoldMail[]; extern const u8 gText_MailTransferredFromMailbox[]; diff --git a/src/party_menu.c b/src/party_menu.c index e94bfb928..1d890c5f3 100755 --- a/src/party_menu.c +++ b/src/party_menu.c @@ -5140,6 +5140,16 @@ static void Task_TryLearningNextMoveAfterText(u8 taskId) Task_TryLearningNextMove(taskId); } +static void DisplayExpPoints(u8 taskId, TaskFunc task, u8 holdEffectParam) +{ + PlaySE(SE_USE_ITEM); + ConvertIntToDecimalStringN(gStringVar2, sExpCandyExperienceTable[holdEffectParam], STR_CONV_MODE_LEFT_ALIGN, 3); + StringExpandPlaceholders(gStringVar4, gText_PkmnGainedExp); + DisplayPartyMenuMessage(gStringVar4, FALSE); + ScheduleBgCopyTilemapToVram(2); + gTasks[taskId].func = task; +} + void ItemUseCB_RareCandy(u8 taskId, TaskFunc task) { struct Pokemon *mon = &gPlayerParty[gPartyMenu.slotId]; @@ -5147,6 +5157,7 @@ void ItemUseCB_RareCandy(u8 taskId, TaskFunc task) s16 *arrayPtr = ptr->data; u16 *itemPtr = &gSpecialVar_ItemId; bool8 cannotUseEffect; + u8 holdEffectParam = ItemId_GetHoldEffectParam(*itemPtr); sInitialLevel = GetMonData(mon, MON_DATA_LEVEL); if (sInitialLevel != MAX_LEVEL) @@ -5177,8 +5188,18 @@ void ItemUseCB_RareCandy(u8 taskId, TaskFunc task) if (sFinalLevel > sInitialLevel) { PlayFanfareByFanfareNum(FANFARE_LEVEL_UP); - ConvertIntToDecimalStringN(gStringVar2, sFinalLevel, STR_CONV_MODE_LEFT_ALIGN, 3); - StringExpandPlaceholders(gStringVar4, gText_PkmnElevatedToLvVar2); + if (holdEffectParam == 0) // Rare Candy + { + ConvertIntToDecimalStringN(gStringVar2, sFinalLevel, STR_CONV_MODE_LEFT_ALIGN, 3); + StringExpandPlaceholders(gStringVar4, gText_PkmnElevatedToLvVar2); + } + else // Exp Candies + { + ConvertIntToDecimalStringN(gStringVar2, sExpCandyExperienceTable[holdEffectParam - 1], STR_CONV_MODE_LEFT_ALIGN, 6); + ConvertIntToDecimalStringN(gStringVar3, sFinalLevel, STR_CONV_MODE_LEFT_ALIGN, 3); + StringExpandPlaceholders(gStringVar4, gText_PkmnGainedExpAndElevatedToLvVar3); + } + DisplayPartyMenuMessage(gStringVar4, TRUE); ScheduleBgCopyTilemapToVram(2); gTasks[taskId].func = Task_DisplayLevelUpStatsPg1; @@ -5187,7 +5208,7 @@ void ItemUseCB_RareCandy(u8 taskId, TaskFunc task) { PlaySE(SE_USE_ITEM); gPartyMenuUseExitCallback = FALSE; - ConvertIntToDecimalStringN(gStringVar2, sExpCandyExperienceTable[ItemId_GetHoldEffectParam(*itemPtr)], STR_CONV_MODE_LEFT_ALIGN, 3); + ConvertIntToDecimalStringN(gStringVar2, sExpCandyExperienceTable[holdEffectParam - 1], STR_CONV_MODE_LEFT_ALIGN, 6); StringExpandPlaceholders(gStringVar4, gText_PkmnGainedExp); DisplayPartyMenuMessage(gStringVar4, FALSE); ScheduleBgCopyTilemapToVram(2); diff --git a/src/strings.c b/src/strings.c index 52f1b6be7..fce4acdde 100644 --- a/src/strings.c +++ b/src/strings.c @@ -418,6 +418,7 @@ const u8 gText_PkmnBecameHealthy[] = _("{STR_VAR_1} became healthy.{PAUSE_UNTIL_ const u8 gText_MovesPPIncreased[] = _("{STR_VAR_1}'s PP increased.{PAUSE_UNTIL_PRESS}"); const u8 gText_PkmnElevatedToLvVar2[] = _("{STR_VAR_1} was elevated to\nLv. {STR_VAR_2}."); const u8 gText_PkmnGainedExp[] = _("{STR_VAR_1} gained {STR_VAR_2} Exp. Points!{PAUSE_UNTIL_PRESS}"); +const u8 gText_PkmnGainedExpAndElevatedToLvVar3[] = _("{STR_VAR_1} gained {STR_VAR_2} Exp. Points\nand was elevated to Lv. {STR_VAR_3}!"); const u8 gText_PkmnBaseVar2StatIncreased[] = _("{STR_VAR_1}'s base {STR_VAR_2}\nstat was raised.{PAUSE_UNTIL_PRESS}"); const u8 gText_PkmnFriendlyBaseVar2Fell[] = _("{STR_VAR_1} turned friendly.\nThe base {STR_VAR_2} fell!{PAUSE_UNTIL_PRESS}"); const u8 gText_PkmnAdoresBaseVar2Fell[] = _("{STR_VAR_1} adores you!\nThe base {STR_VAR_2} fell!{PAUSE_UNTIL_PRESS}"); From 431cb6fa7ccf7898c3dce308808e5cb26b422719 Mon Sep 17 00:00:00 2001 From: Blackforest92 Date: Fri, 9 Sep 2022 21:57:40 +0700 Subject: [PATCH 11/27] Tidying graphics - Trio Weather --- data/battle_anim_scripts.s | 32 +++++------------- .../backgrounds/windstorm_brew.pal | 19 +++++++++++ .../backgrounds/windstorm_brew.png | Bin 1067 -> 0 bytes .../battle_anims/sprites/primal_particles.png | Bin 510 -> 0 bytes include/constants/battle_anim.h | 5 ++- src/battle_anim_effects_3.c | 11 ------ src/battle_anim_flying.c | 4 +-- src/data/battle_anim.h | 2 -- src/graphics.c | 5 --- 9 files changed, 31 insertions(+), 47 deletions(-) create mode 100644 graphics/battle_anims/backgrounds/windstorm_brew.pal delete mode 100644 graphics/battle_anims/backgrounds/windstorm_brew.png delete mode 100644 graphics/battle_anims/sprites/primal_particles.png diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index f83d437a5..601db597f 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -24839,15 +24839,15 @@ General_PrimalReversion:: jumpargeq 0x1, ITEM_BLUE_ORB, General_PrimalReversion_Alpha General_PrimalReversion_Alpha: loadspritegfx ANIM_TAG_ALPHA_STONE - loadspritegfx ANIM_TAG_PRIMAL_PARTICLES + loadspritegfx ANIM_TAG_MEGA_PARTICLES loadspritegfx ANIM_TAG_ALPHA_SYMBOL monbg ANIM_ATTACKER setalpha 12, 8 loopsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER, 13, 3 createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 6, 0, 11, RGB(31, 31, 11) - call PrimalReversionParticles - call PrimalReversionParticles - call PrimalReversionParticles + call MegaEvolutionParticles + call MegaEvolutionParticles + call MegaEvolutionParticles waitforvisualfinish playsewithpan SE_M_SOLAR_BEAM, SOUND_PAN_ATTACKER createsprite gAlphaStoneSpriteTemplate, ANIM_ATTACKER, 41, 0, 0, 0, 0 @@ -24865,15 +24865,15 @@ General_PrimalReversion_Alpha: end General_PrimalReversion_Omega: loadspritegfx ANIM_TAG_OMEGA_STONE - loadspritegfx ANIM_TAG_PRIMAL_PARTICLES + loadspritegfx ANIM_TAG_MEGA_PARTICLES loadspritegfx ANIM_TAG_OMEGA_SYMBOL monbg ANIM_ATTACKER setalpha 12, 8 loopsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER, 13, 3 createvisualtask AnimTask_BlendColorCycle, 2, 2, 0, 6, 0, 11, RGB(31, 31, 11) - call PrimalReversionParticles - call PrimalReversionParticles - call PrimalReversionParticles + call MegaEvolutionParticles + call MegaEvolutionParticles + call MegaEvolutionParticles waitforvisualfinish playsewithpan SE_M_SOLAR_BEAM, SOUND_PAN_ATTACKER createsprite gOmegaStoneSpriteTemplate, ANIM_ATTACKER, 41, 0, 0, 0, 0 @@ -24889,22 +24889,6 @@ General_PrimalReversion_Omega: clearmonbg ANIM_ATK_PARTNER blendoff end -PrimalReversionParticles: - createsprite gPrimalParticlesSpriteTemplate, ANIM_ATTACKER, 2, 40, -10, 13 - delay 3 - createsprite gPrimalParticlesSpriteTemplate, ANIM_ATTACKER, 2, -35, -10, 13 - delay 3 - createsprite gPrimalParticlesSpriteTemplate, ANIM_ATTACKER, 2, 15, -40, 13 - delay 3 - createsprite gPrimalParticlesSpriteTemplate, ANIM_ATTACKER, 2, -10, -32, 13 - delay 3 - createsprite gPrimalParticlesSpriteTemplate, ANIM_ATTACKER, 2, 25, -20, 13 - delay 3 - createsprite gPrimalParticlesSpriteTemplate, ANIM_ATTACKER, 2, -40, -20, 13 - delay 3 - createsprite gPrimalParticlesSpriteTemplate, ANIM_ATTACKER, 2, 5, -40, 13 - delay 3 - return General_AffectionHangedOn:: loadspritegfx ANIM_TAG_RED_HEART diff --git a/graphics/battle_anims/backgrounds/windstorm_brew.pal b/graphics/battle_anims/backgrounds/windstorm_brew.pal new file mode 100644 index 000000000..2feb0f59e --- /dev/null +++ b/graphics/battle_anims/backgrounds/windstorm_brew.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +230 148 98 +255 255 222 +230 230 197 +213 205 172 +189 180 148 +172 156 123 +156 131 106 +0 0 0 +0 0 0 +0 0 0 +142 204 143 +123 180 122 +112 165 99 +89 130 87 +67 114 65 +55 91 56 diff --git a/graphics/battle_anims/backgrounds/windstorm_brew.png b/graphics/battle_anims/backgrounds/windstorm_brew.png deleted file mode 100644 index 2a28952662266dc252e5a0b850e41ed187241047..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1067 zcmV+`1l0S9P)%RwK{s1Cyb`=-00007bV*G`2jvO|3n4i=NfqV*000+sMObuGZ)S9NVRB^vM@&Re zPDdbiWpW@hE;Mn4q~QPn18_-1K~zY`O;wAbn=lO2{-ZRV0GkDBITKiH0B?i7-p6Tc zk_X`-`E)uRk#p9Z_?uaY6E8XsocW)~c|AAQS}Svm#PTJMx~rn&(b{PeKd!n;DRbh- zb46pAqZ`)InSeQ#6Cnc@@*?WOdM+d=!Dzgiv9Q&{b>D?gtx9~koHh)Z+1t-Kzx3?G zP-G>V0O+i`7b9@RFfITBG+YD=s0&e-b}yGORTi&-nF%)OTargNK ziYXW^Odmn}tu=+WbenTjrOY%`822G=0>`@Ls*IKdg?I_ zHWi&vqBHpX8d^+tG!nog7w>>cJjgCG4ZBfl>Y0Lo^wB^9JBP;)ap7Ky8+9`k(OAY* zMeStOZ*r?{x^i+hNXQt|p%Zdqq7ZkIQKoa@`x@qSQj-J1dZdKqeTN9eeQ6>jg%bg( z7?VPwzMVEkI+$E6DS(WSouh%gJJfb7XuiLQ99QRbQ@})s!5m$?lT6P>a#&V2baPsj z?EQ2hdf=3_dJnUZJJG&yV{ijiknlAXHS1GD`-~beh(o2Z8U=rrse#5qik$pWk`}_- z3pl7rf{2@(lgs)y6G(Cl3JS@it6Fp;JzuZai(pcc=3EH;pn&&0=YQflpr~>iMMSo4 z984uV?4~48YUIcd0pH(MMul$n(KUsv`uhIL!_mJD@e)ipqP#=iIXTze-Kdro&mv3E*Xy@V&5jnPo|Mo{zCT6WzS((@Avk zk=fg(aGdhVWn0hmU#YrVSL{;kQIfH^qkUV0bw;=USZwOmp(4~+LBedl`S2<7<+dWQ z{MO+6V*P!|QIcdtsr=3v!Z5c#h)2%Jlw)-^O{!K23arZr=$X_8&LLxKL~om%c{!mx zV?MB;%^gI2^leeb!{Hji`RaR(PJ_>FG~GPt&9s#$IWf~u^6@Mdz00_?jNa!T1l l#um@;gl~iLgz`0>e*mjVc!7vL=8gaW002ovPDHLkV1mAc^+W&w diff --git a/graphics/battle_anims/sprites/primal_particles.png b/graphics/battle_anims/sprites/primal_particles.png deleted file mode 100644 index 6fdf09d96e0d606f5253e5ed18da3c272120e6ce..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 510 zcmeAS@N?(olHy`uVBq!ia0vp^0zhoQ!VDx|6+TY^QY`6?zK#qG8~eHcB(ehe3dtTp zz6=aiY77hwEes65fIi1;V5)EKCOG0EHAg;|it=M#{_S>O>_%)r2R1cVu< zYV%101=&kHeO=k_v+;>Y%TBb>0$R^-!qdeuMB;MkSzAA6Ljjftm4S70^!7P!X%c?J zx+ueSZqwV#8y5LIH!JaLcR5@*^ZAE0>`j^9Cfg`8ALfgA)2R6Tu2V|CBd6-7XF6I< zXE=;s`@AUD;Xm-|NOoDo&iNZcoH&Dx!^FC;kotR)G0UiF^6U!J>Hw}q4M{;9{;^}p4Yc+{(W|*rs(G7+07lj71mug zd;WDF7kn9csjh*UuAxbYp@o%^xs{P6 VL_^=Zwnsn>44$rjF6*2UngE>NybAyT diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index db2efd8d0..05d9f575a 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -392,9 +392,8 @@ #define ANIM_TAG_STONE_PILLAR_MULTI (ANIM_SPRITES_START + 380) #define ANIM_TAG_ALPHA_SYMBOL (ANIM_SPRITES_START + 381) #define ANIM_TAG_OMEGA_SYMBOL (ANIM_SPRITES_START + 382) -#define ANIM_TAG_PRIMAL_PARTICLES (ANIM_SPRITES_START + 383) -#define ANIM_TAG_STEEL_BEAM (ANIM_SPRITES_START + 384) -#define ANIM_TAG_POLTERGEIST (ANIM_SPRITES_START + 385) +#define ANIM_TAG_STEEL_BEAM (ANIM_SPRITES_START + 383) +#define ANIM_TAG_POLTERGEIST (ANIM_SPRITES_START + 384) // battlers #define ANIM_ATTACKER 0 diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 3b9a9a8f8..552fcf517 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -1239,17 +1239,6 @@ const struct SpriteTemplate gOmegaStoneSpriteTemplate = .callback = AnimSpriteOnMonPos, }; -const struct SpriteTemplate gPrimalParticlesSpriteTemplate = -{ - .tileTag = ANIM_TAG_PRIMAL_PARTICLES, - .paletteTag = ANIM_TAG_PRIMAL_PARTICLES, - .oam = &gOamData_AffineNormal_ObjBlend_16x16, - .anims = gPowerAbsorptionOrbAnimTable, - .images = NULL, - .affineAnims = gPowerAbsorptionOrbAffineAnimTable, - .callback = AnimPowerAbsorptionOrb, -}; - const struct SpriteTemplate gAlphaSymbolSpriteTemplate = { .tileTag = ANIM_TAG_ALPHA_SYMBOL, diff --git a/src/battle_anim_flying.c b/src/battle_anim_flying.c index 59d012f9a..2735ea447 100644 --- a/src/battle_anim_flying.c +++ b/src/battle_anim_flying.c @@ -1252,8 +1252,8 @@ void AnimTask_LoadWindstormBackground(u8 taskId) SetGpuReg(REG_OFFSET_BG1VOFS, gBattle_BG1_Y); GetBattleAnimBg1Data(&animBg); - AnimLoadCompressedBgGfx(animBg.bgId, gBattleAnimBgImage_Windstorm, animBg.tilesOffset); - AnimLoadCompressedBgTilemapHandleContest(&animBg, gBattleAnimBgTilemap_Windstorm, 0); + AnimLoadCompressedBgGfx(animBg.bgId, gBattleAnimBgImage_Sandstorm, animBg.tilesOffset); + AnimLoadCompressedBgTilemapHandleContest(&animBg, gBattleAnimBgTilemap_Sandstorm, 0); LoadCompressedPalette(gBattleAnimSpritePal_Windstorm, animBg.paletteId * 16, 32); if (gBattleAnimArgs[0] && GetBattlerSide(gBattleAnimAttacker) != B_SIDE_PLAYER) diff --git a/src/data/battle_anim.h b/src/data/battle_anim.h index 6a67e0cd6..e6e03f06c 100644 --- a/src/data/battle_anim.h +++ b/src/data/battle_anim.h @@ -1448,7 +1448,6 @@ const struct CompressedSpriteSheet gBattleAnimPicTable[] = {gBattleAnimSpriteGfx_StonePillar, 0x1800, ANIM_TAG_STONE_PILLAR_MULTI}, {gBattleAnimSpriteGfx_AlphaSymbol, 0x0200, ANIM_TAG_ALPHA_SYMBOL}, {gBattleAnimSpriteGfx_OmegaSymbol, 0x0200, ANIM_TAG_OMEGA_SYMBOL}, - {gBattleAnimSpriteGfx_PrimalParticles, 0x0180, ANIM_TAG_PRIMAL_PARTICLES}, {gBattleAnimSpriteGfx_Orbs, 0x0180, ANIM_TAG_STEEL_BEAM}, {gBattleAnimSpriteGfx_AuraSphere, 0x200, ANIM_TAG_POLTERGEIST}, }; @@ -1899,7 +1898,6 @@ const struct CompressedSpritePalette gBattleAnimPaletteTable[] = {gBattleAnimSpritePal_StonePillar, ANIM_TAG_STONE_PILLAR_MULTI}, {gBattleAnimSpritePal_AlphaSymbol, ANIM_TAG_ALPHA_SYMBOL}, {gBattleAnimSpritePal_OmegaSymbol, ANIM_TAG_OMEGA_SYMBOL}, - {gBattleAnimSpritePal_PrimalParticles, ANIM_TAG_PRIMAL_PARTICLES}, {gBattleAnimSpritePal_SteelBeam, ANIM_TAG_STEEL_BEAM}, {gBattleAnimSpritePal_Poltergeist, ANIM_TAG_POLTERGEIST}, }; diff --git a/src/graphics.c b/src/graphics.c index 6a12dda1c..306f35928 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -42,9 +42,6 @@ const u32 gBattleAnimSpritePal_AlphaSymbol[] = INCBIN_U32("graphics/battle_anims const u32 gBattleAnimSpriteGfx_OmegaSymbol[] = INCBIN_U32("graphics/battle_anims/sprites/omega_symbol.4bpp.lz"); const u32 gBattleAnimSpritePal_OmegaSymbol[] = INCBIN_U32("graphics/battle_anims/sprites/omega_symbol.gbapal.lz"); -const u32 gBattleAnimSpriteGfx_PrimalParticles[] = INCBIN_U32("graphics/battle_anims/sprites/primal_particles.4bpp.lz"); -const u32 gBattleAnimSpritePal_PrimalParticles[] = INCBIN_U32("graphics/battle_anims/sprites/primal_particles.gbapal.lz"); - const u32 gBattleAnimSpriteGfx_FlashCannonBall[] = INCBIN_U32("graphics/battle_anims/sprites/flash_cannon_ball.4bpp.lz"); const u32 gBattleAnimSpritePal_FlashCannonBall[] = INCBIN_U32("graphics/battle_anims/sprites/flash_cannon_ball.gbapal.lz"); @@ -1309,8 +1306,6 @@ const u32 gBattleAnimSpritePal_FlyingDirt[] = INCBIN_U32("graphics/battle_anims/ const u32 gBattleAnimBgTilemap_Sandstorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/sandstorm_brew.bin.lz"); const u32 gBattleAnimBgImage_Sandstorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/sandstorm_brew.4bpp.lz"); -const u32 gBattleAnimBgTilemap_Windstorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/sandstorm_brew.bin.lz"); -const u32 gBattleAnimBgImage_Windstorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/windstorm_brew.4bpp.lz"); const u32 gBattleAnimSpritePal_Windstorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/windstorm_brew.gbapal.lz"); const u32 gBattleAnimSpriteGfx_MetalSoundWaves[] = INCBIN_U32("graphics/battle_anims/sprites/metal_sound_waves.4bpp.lz"); From d870d71dbe9437a1ec420be62b0b0aa35129a6bd Mon Sep 17 00:00:00 2001 From: Blackforest92 Date: Fri, 9 Sep 2022 22:26:29 +0700 Subject: [PATCH 12/27] Remove windstorm_brew leftovers --- include/graphics.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/include/graphics.h b/include/graphics.h index 197cb4bb4..808b320d4 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -10085,9 +10085,6 @@ extern const u16 gSlotMachineReelTimePikachu_Pal[]; extern const u32 gBattleAnimBgTilemap_Sandstorm[]; extern const u32 gBattleAnimBgImage_Sandstorm[]; -extern const u32 gBattleAnimBgTilemap_Windstorm[]; -extern const u32 gBattleAnimBgImage_Windstorm[]; - // Pokedex Area Screen extern const u32 gPokedexAreaScreenAreaUnknown_Gfx[]; extern const u16 gPokedexAreaScreenAreaUnknown_Pal[]; From 29529a0c47731a1901febe9ae7d8e6efc19fbf22 Mon Sep 17 00:00:00 2001 From: Blackforest92 Date: Fri, 9 Sep 2022 22:28:11 +0700 Subject: [PATCH 13/27] Remove primal_particle leftovers --- include/graphics.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/graphics.h b/include/graphics.h index 808b320d4..4f8534f9a 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -9631,8 +9631,6 @@ extern const u32 gBattleAnimSpriteGfx_MegaStone[]; extern const u32 gBattleAnimSpritePal_MegaStone[]; extern const u32 gBattleAnimSpriteGfx_MegaParticles[]; extern const u32 gBattleAnimSpritePal_MegaParticles[]; -extern const u32 gBattleAnimSpriteGfx_PrimalParticles[]; -extern const u32 gBattleAnimSpritePal_PrimalParticles[]; extern const u32 gBattleAnimSpriteGfx_MegaSymbol[]; extern const u32 gBattleAnimSpritePal_MegaSymbol[]; extern const u32 gBattleAnimSpriteGfx_FlashCannonBall[]; From 503b85aa2daa9484647b961af062072c44c6cb76 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 9 Sep 2022 16:44:34 -0400 Subject: [PATCH 14/27] Generating music names for the debug menu based on their labels --- charmap.txt | 1 + src/debug.c | 1068 +++++++++++++++++++++++++-------------------------- 2 files changed, 535 insertions(+), 534 deletions(-) diff --git a/charmap.txt b/charmap.txt index 980a3e5dd..2cb67a861 100644 --- a/charmap.txt +++ b/charmap.txt @@ -79,6 +79,7 @@ SUPER_RE = A0 '?' = AC '.' = AD '-' = AE +'_' = AE @ For autogenerating strings based on label names. Not using {UNDERSCORE} on purpose due to how bad it looks. '·' = AF '…' = B0 '“' = B1 diff --git a/src/debug.c b/src/debug.c index 4cc1ac616..19038723d 100644 --- a/src/debug.c +++ b/src/debug.c @@ -2839,544 +2839,544 @@ static void DebugAction_Sound_MUS_SelectId(u8 taskId) } #define SOUND_LIST_BGM \ - X(MUS_LITTLEROOT_TEST, "MUS-LITTLEROOT-TEST") \ - X(MUS_GSC_ROUTE38, "MUS-GSC-ROUTE38") \ - X(MUS_CAUGHT, "MUS-CAUGHT") \ - X(MUS_VICTORY_WILD, "MUS-VICTORY-WILD") \ - X(MUS_VICTORY_GYM_LEADER, "MUS-VICTORY-GYM-LEADER") \ - X(MUS_VICTORY_LEAGUE, "MUS-VICTORY-LEAGUE") \ - X(MUS_C_COMM_CENTER, "MUS-C-COMM-CENTER") \ - X(MUS_GSC_PEWTER, "MUS-GSC-PEWTER") \ - X(MUS_C_VS_LEGEND_BEAST, "MUS-C-VS-LEGEND-BEAST") \ - X(MUS_ROUTE101, "MUS-ROUTE101") \ - X(MUS_ROUTE110, "MUS-ROUTE110") \ - X(MUS_ROUTE120, "MUS-ROUTE120") \ - X(MUS_PETALBURG, "MUS-PETALBURG") \ - X(MUS_OLDALE, "MUS-OLDALE") \ - X(MUS_GYM, "MUS-GYM") \ - X(MUS_SURF, "MUS-SURF") \ - X(MUS_PETALBURG_WOODS, "MUS-PETALBURG-WOODS") \ - X(MUS_LEVEL_UP, "MUS-LEVEL-UP") \ - X(MUS_HEAL, "MUS-HEAL") \ - X(MUS_OBTAIN_BADGE, "MUS-OBTAIN-BADGE") \ - X(MUS_OBTAIN_ITEM, "MUS-OBTAIN-ITEM") \ - X(MUS_EVOLVED, "MUS-EVOLVED") \ - X(MUS_OBTAIN_TMHM, "MUS-OBTAIN-TMHM") \ - X(MUS_LILYCOVE_MUSEUM, "MUS-LILYCOVE-MUSEUM") \ - X(MUS_ROUTE122, "MUS-ROUTE122") \ - X(MUS_OCEANIC_MUSEUM, "MUS-OCEANIC-MUSEUM") \ - X(MUS_EVOLUTION_INTRO, "MUS-EVOLUTION-INTRO") \ - X(MUS_EVOLUTION, "MUS-EVOLUTION") \ - X(MUS_MOVE_DELETED, "MUS-MOVE-DELETED") \ - X(MUS_ENCOUNTER_GIRL, "MUS-ENCOUNTER-GIRL") \ - X(MUS_ENCOUNTER_MALE, "MUS-ENCOUNTER-MALE") \ - X(MUS_ABANDONED_SHIP, "MUS-ABANDONED-SHIP") \ - X(MUS_FORTREE, "MUS-FORTREE") \ - X(MUS_BIRCH_LAB, "MUS-BIRCH-LAB") \ - X(MUS_B_TOWER_RS, "MUS-B-TOWER-RS") \ - X(MUS_ENCOUNTER_SWIMMER, "MUS-ENCOUNTER-SWIMMER") \ - X(MUS_CAVE_OF_ORIGIN, "MUS-CAVE-OF-ORIGIN") \ - X(MUS_OBTAIN_BERRY, "MUS-OBTAIN-BERRY") \ - X(MUS_AWAKEN_LEGEND, "MUS-AWAKEN-LEGEND") \ - X(MUS_SLOTS_JACKPOT, "MUS-SLOTS-JACKPOT") \ - X(MUS_SLOTS_WIN, "MUS-SLOTS-WIN") \ - X(MUS_TOO_BAD, "MUS-TOO-BAD") \ - X(MUS_ROULETTE, "MUS-ROULETTE") \ - X(MUS_LINK_CONTEST_P1, "MUS-LINK-CONTEST-P1") \ - X(MUS_LINK_CONTEST_P2, "MUS-LINK-CONTEST-P2") \ - X(MUS_LINK_CONTEST_P3, "MUS-LINK-CONTEST-P3") \ - X(MUS_LINK_CONTEST_P4, "MUS-LINK-CONTEST-P4") \ - X(MUS_ENCOUNTER_RICH, "MUS-ENCOUNTER-RICH") \ - X(MUS_VERDANTURF, "MUS-VERDANTURF") \ - X(MUS_RUSTBORO, "MUS-RUSTBORO") \ - X(MUS_POKE_CENTER, "MUS-POKE-CENTER") \ - X(MUS_ROUTE104, "MUS-ROUTE104") \ - X(MUS_ROUTE119, "MUS-ROUTE119") \ - X(MUS_CYCLING, "MUS-CYCLING") \ - X(MUS_POKE_MART, "MUS-POKE-MART") \ - X(MUS_LITTLEROOT, "MUS-LITTLEROOT") \ - X(MUS_MT_CHIMNEY, "MUS-MT-CHIMNEY") \ - X(MUS_ENCOUNTER_FEMALE, "MUS-ENCOUNTER-FEMALE") \ - X(MUS_LILYCOVE, "MUS-LILYCOVE") \ - X(MUS_ROUTE111, "MUS-ROUTE111") \ - X(MUS_HELP, "MUS-HELP") \ - X(MUS_UNDERWATER, "MUS-UNDERWATER") \ - X(MUS_VICTORY_TRAINER, "MUS-VICTORY-TRAINER") \ - X(MUS_TITLE, "MUS-TITLE") \ - X(MUS_INTRO, "MUS-INTRO") \ - X(MUS_ENCOUNTER_MAY, "MUS-ENCOUNTER-MAY") \ - X(MUS_ENCOUNTER_INTENSE, "MUS-ENCOUNTER-INTENSE") \ - X(MUS_ENCOUNTER_COOL, "MUS-ENCOUNTER-COOL") \ - X(MUS_ROUTE113, "MUS-ROUTE113") \ - X(MUS_ENCOUNTER_AQUA, "MUS-ENCOUNTER-AQUA") \ - X(MUS_FOLLOW_ME, "MUS-FOLLOW-ME") \ - X(MUS_ENCOUNTER_BRENDAN, "MUS-ENCOUNTER-BRENDAN") \ - X(MUS_EVER_GRANDE, "MUS-EVER-GRANDE") \ - X(MUS_ENCOUNTER_SUSPICIOUS, "MUS-ENCOUNTER-SUSPICIOUS") \ - X(MUS_VICTORY_AQUA_MAGMA, "MUS-VICTORY-AQUA-MAGMA") \ - X(MUS_CABLE_CAR, "MUS-CABLE-CAR") \ - X(MUS_GAME_CORNER, "MUS-GAME-CORNER") \ - X(MUS_DEWFORD, "MUS-DEWFORD") \ - X(MUS_SAFARI_ZONE, "MUS-SAFARI-ZONE") \ - X(MUS_VICTORY_ROAD, "MUS-VICTORY-ROAD") \ - X(MUS_AQUA_MAGMA_HIDEOUT, "MUS-AQUA-MAGMA-HIDEOUT") \ - X(MUS_SAILING, "MUS-SAILING") \ - X(MUS_MT_PYRE, "MUS-MT-PYRE") \ - X(MUS_SLATEPORT, "MUS-SLATEPORT") \ - X(MUS_MT_PYRE_EXTERIOR, "MUS-MT-PYRE-EXTERIOR") \ - X(MUS_SCHOOL, "MUS-SCHOOL") \ - X(MUS_HALL_OF_FAME, "MUS-HALL-OF-FAME") \ - X(MUS_FALLARBOR, "MUS-FALLARBOR") \ - X(MUS_SEALED_CHAMBER, "MUS-SEALED-CHAMBER") \ - X(MUS_CONTEST_WINNER, "MUS-CONTEST-WINNER") \ - X(MUS_CONTEST, "MUS-CONTEST") \ - X(MUS_ENCOUNTER_MAGMA, "MUS-ENCOUNTER-MAGMA") \ - X(MUS_INTRO_BATTLE, "MUS-INTRO-BATTLE") \ - X(MUS_WEATHER_KYOGRE, "MUS-WEATHER-KYOGRE") \ - X(MUS_WEATHER_GROUDON, "MUS-WEATHER-GROUDON") \ - X(MUS_SOOTOPOLIS, "MUS-SOOTOPOLIS") \ - X(MUS_CONTEST_RESULTS, "MUS-CONTEST-RESULTS") \ - X(MUS_HALL_OF_FAME_ROOM, "MUS-HALL-OF-FAME-ROOM") \ - X(MUS_TRICK_HOUSE, "MUS-TRICK-HOUSE") \ - X(MUS_ENCOUNTER_TWINS, "MUS-ENCOUNTER-TWINS") \ - X(MUS_ENCOUNTER_ELITE_FOUR, "MUS-ENCOUNTER-ELITE-FOUR") \ - X(MUS_ENCOUNTER_HIKER, "MUS-ENCOUNTER-HIKER") \ - X(MUS_CONTEST_LOBBY, "MUS-CONTEST-LOBBY") \ - X(MUS_ENCOUNTER_INTERVIEWER, "MUS-ENCOUNTER-INTERVIEWER") \ - X(MUS_ENCOUNTER_CHAMPION, "MUS-ENCOUNTER-CHAMPION") \ - X(MUS_CREDITS, "MUS-CREDITS") \ - X(MUS_END, "MUS-END") \ - X(MUS_B_FRONTIER, "MUS-B-FRONTIER") \ - X(MUS_B_ARENA, "MUS-B-ARENA") \ - X(MUS_OBTAIN_B_POINTS, "MUS-OBTAIN-B-POINTS") \ - X(MUS_REGISTER_MATCH_CALL, "MUS-REGISTER-MATCH-CALL") \ - X(MUS_B_PYRAMID, "MUS-B-PYRAMID") \ - X(MUS_B_PYRAMID_TOP, "MUS-B-PYRAMID-TOP") \ - X(MUS_B_PALACE, "MUS-B-PALACE") \ - X(MUS_RAYQUAZA_APPEARS, "MUS-RAYQUAZA-APPEARS") \ - X(MUS_B_TOWER, "MUS-B-TOWER") \ - X(MUS_OBTAIN_SYMBOL, "MUS-OBTAIN-SYMBOL") \ - X(MUS_B_DOME, "MUS-B-DOME") \ - X(MUS_B_PIKE, "MUS-B-PIKE") \ - X(MUS_B_FACTORY, "MUS-B-FACTORY") \ - X(MUS_VS_RAYQUAZA, "MUS-VS-RAYQUAZA") \ - X(MUS_VS_FRONTIER_BRAIN, "MUS-VS-FRONTIER-BRAIN") \ - X(MUS_VS_MEW, "MUS-VS-MEW") \ - X(MUS_B_DOME_LOBBY, "MUS-B-DOME-LOBBY") \ - X(MUS_VS_WILD, "MUS-VS-WILD") \ - X(MUS_VS_AQUA_MAGMA, "MUS-VS-AQUA-MAGMA") \ - X(MUS_VS_TRAINER, "MUS-VS-TRAINER") \ - X(MUS_VS_GYM_LEADER, "MUS-VS-GYM-LEADER") \ - X(MUS_VS_CHAMPION, "MUS-VS-CHAMPION") \ - X(MUS_VS_REGI, "MUS-VS-REGI") \ - X(MUS_VS_KYOGRE_GROUDON, "MUS-VS-KYOGRE-GROUDON") \ - X(MUS_VS_RIVAL, "MUS-VS-RIVAL") \ - X(MUS_VS_ELITE_FOUR, "MUS-VS-ELITE-FOUR") \ - X(MUS_VS_AQUA_MAGMA_LEADER, "MUS-VS-AQUA-MAGMA-LEADER") \ - X(MUS_RG_FOLLOW_ME, "MUS-RG-FOLLOW-ME") \ - X(MUS_RG_GAME_CORNER, "MUS-RG-GAME-CORNER") \ - X(MUS_RG_ROCKET_HIDEOUT, "MUS-RG-ROCKET-HIDEOUT") \ - X(MUS_RG_GYM, "MUS-RG-GYM") \ - X(MUS_RG_JIGGLYPUFF, "MUS-RG-JIGGLYPUFF") \ - X(MUS_RG_INTRO_FIGHT, "MUS-RG-INTRO-FIGHT") \ - X(MUS_RG_TITLE, "MUS-RG-TITLE") \ - X(MUS_RG_CINNABAR, "MUS-RG-CINNABAR") \ - X(MUS_RG_LAVENDER, "MUS-RG-LAVENDER") \ - X(MUS_RG_HEAL, "MUS-RG-HEAL") \ - X(MUS_RG_CYCLING, "MUS-RG-CYCLING") \ - X(MUS_RG_ENCOUNTER_ROCKET, "MUS-RG-ENCOUNTER-ROCKET") \ - X(MUS_RG_ENCOUNTER_GIRL, "MUS-RG-ENCOUNTER-GIRL") \ - X(MUS_RG_ENCOUNTER_BOY, "MUS-RG-ENCOUNTER-BOY") \ - X(MUS_RG_HALL_OF_FAME, "MUS-RG-HALL-OF-FAME") \ - X(MUS_RG_VIRIDIAN_FOREST, "MUS-RG-VIRIDIAN-FOREST") \ - X(MUS_RG_MT_MOON, "MUS-RG-MT-MOON") \ - X(MUS_RG_POKE_MANSION, "MUS-RG-POKE-MANSION") \ - X(MUS_RG_CREDITS, "MUS-RG-CREDITS") \ - X(MUS_RG_ROUTE1, "MUS-RG-ROUTE1") \ - X(MUS_RG_ROUTE24, "MUS-RG-ROUTE24") \ - X(MUS_RG_ROUTE3, "MUS-RG-ROUTE3") \ - X(MUS_RG_ROUTE11, "MUS-RG-ROUTE11") \ - X(MUS_RG_VICTORY_ROAD, "MUS-RG-VICTORY-ROAD") \ - X(MUS_RG_VS_GYM_LEADER, "MUS-RG-VS-GYM-LEADER") \ - X(MUS_RG_VS_TRAINER, "MUS-RG-VS-TRAINER") \ - X(MUS_RG_VS_WILD, "MUS-RG-VS-WILD") \ - X(MUS_RG_VS_CHAMPION, "MUS-RG-VS-CHAMPION") \ - X(MUS_RG_PALLET, "MUS-RG-PALLET") \ - X(MUS_RG_OAK_LAB, "MUS-RG-OAK-LAB") \ - X(MUS_RG_OAK, "MUS-RG-OAK") \ - X(MUS_RG_POKE_CENTER, "MUS-RG-POKE-CENTER") \ - X(MUS_RG_SS_ANNE, "MUS-RG-SS-ANNE") \ - X(MUS_RG_SURF, "MUS-RG-SURF") \ - X(MUS_RG_POKE_TOWER, "MUS-RG-POKE-TOWER") \ - X(MUS_RG_SILPH, "MUS-RG-SILPH") \ - X(MUS_RG_FUCHSIA, "MUS-RG-FUCHSIA") \ - X(MUS_RG_CELADON, "MUS-RG-CELADON") \ - X(MUS_RG_VICTORY_TRAINER, "MUS-RG-VICTORY-TRAINER") \ - X(MUS_RG_VICTORY_WILD, "MUS-RG-VICTORY-WILD") \ - X(MUS_RG_VICTORY_GYM_LEADER, "MUS-RG-VICTORY-GYM-LEADER") \ - X(MUS_RG_VERMILLION, "MUS-RG-VERMILLION") \ - X(MUS_RG_PEWTER, "MUS-RG-PEWTER") \ - X(MUS_RG_ENCOUNTER_RIVAL, "MUS-RG-ENCOUNTER-RIVAL") \ - X(MUS_RG_RIVAL_EXIT, "MUS-RG-RIVAL-EXIT") \ - X(MUS_RG_DEX_RATING, "MUS-RG-DEX-RATING") \ - X(MUS_RG_OBTAIN_KEY_ITEM, "MUS-RG-OBTAIN-KEY-ITEM") \ - X(MUS_RG_CAUGHT_INTRO, "MUS-RG-CAUGHT-INTRO") \ - X(MUS_RG_PHOTO, "MUS-RG-PHOTO") \ - X(MUS_RG_GAME_FREAK, "MUS-RG-GAME-FREAK") \ - X(MUS_RG_CAUGHT, "MUS-RG-CAUGHT") \ - X(MUS_RG_NEW_GAME_INSTRUCT, "MUS-RG-NEW-GAME-INSTRUCT") \ - X(MUS_RG_NEW_GAME_INTRO, "MUS-RG-NEW-GAME-INTRO") \ - X(MUS_RG_NEW_GAME_EXIT, "MUS-RG-NEW-GAME-EXIT") \ - X(MUS_RG_POKE_JUMP, "MUS-RG-POKE-JUMP") \ - X(MUS_RG_UNION_ROOM, "MUS-RG-UNION-ROOM") \ - X(MUS_RG_NET_CENTER, "MUS-RG-NET-CENTER") \ - X(MUS_RG_MYSTERY_GIFT, "MUS-RG-MYSTERY-GIFT") \ - X(MUS_RG_BERRY_PICK, "MUS-RG-BERRY-PICK") \ - X(MUS_RG_SEVII_CAVE, "MUS-RG-SEVII-CAVE") \ - X(MUS_RG_TEACHY_TV_SHOW, "MUS-RG-TEACHY-TV-SHOW") \ - X(MUS_RG_SEVII_ROUTE, "MUS-RG-SEVII-ROUTE") \ - X(MUS_RG_SEVII_DUNGEON, "MUS-RG-SEVII-DUNGEON") \ - X(MUS_RG_SEVII_123, "MUS-RG-SEVII-123") \ - X(MUS_RG_SEVII_45, "MUS-RG-SEVII-45") \ - X(MUS_RG_SEVII_67, "MUS-RG-SEVII-67") \ - X(MUS_RG_POKE_FLUTE, "MUS-RG-POKE-FLUTE") \ - X(MUS_RG_VS_DEOXYS, "MUS-RG-VS-DEOXYS") \ - X(MUS_RG_VS_MEWTWO, "MUS-RG-VS-MEWTWO") \ - X(MUS_RG_VS_LEGEND, "MUS-RG-VS-LEGEND") \ - X(MUS_RG_ENCOUNTER_GYM_LEADER, "MUS-RG-ENCOUNTER-GYM-LEADER") \ - X(MUS_RG_ENCOUNTER_DEOXYS, "MUS-RG-ENCOUNTER-DEOXYS") \ - X(MUS_RG_TRAINER_TOWER, "MUS-RG-TRAINER-TOWER") \ - X(MUS_RG_SLOW_PALLET, "MUS-RG-SLOW-PALLET") \ - X(MUS_RG_TEACHY_TV_MENU, "MUS-RG-TEACHY-TV-MENU") \ - X(PH_TRAP_BLEND, "PH-TRAP-BLEND") \ - X(PH_TRAP_HELD, "PH-TRAP-HELD") \ - X(PH_TRAP_SOLO, "PH-TRAP-SOLO") \ - X(PH_FACE_BLEND, "PH-FACE-BLEND") \ - X(PH_FACE_HELD, "PH-FACE-HELD") \ - X(PH_FACE_SOLO, "PH-FACE-SOLO") \ - X(PH_CLOTH_BLEND, "PH-CLOTH-BLEND") \ - X(PH_CLOTH_HELD, "PH-CLOTH-HELD") \ - X(PH_CLOTH_SOLO, "PH-CLOTH-SOLO") \ - X(PH_DRESS_BLEND, "PH-DRESS-BLEND") \ - X(PH_DRESS_HELD, "PH-DRESS-HELD") \ - X(PH_DRESS_SOLO, "PH-DRESS-SOLO") \ - X(PH_FLEECE_BLEND, "PH-FLEECE-BLEND") \ - X(PH_FLEECE_HELD, "PH-FLEECE-HELD") \ - X(PH_FLEECE_SOLO, "PH-FLEECE-SOLO") \ - X(PH_KIT_BLEND, "PH-KIT-BLEND") \ - X(PH_KIT_HELD, "PH-KIT-HELD") \ - X(PH_KIT_SOLO, "PH-KIT-SOLO") \ - X(PH_PRICE_BLEND, "PH-PRICE-BLEND") \ - X(PH_PRICE_HELD, "PH-PRICE-HELD") \ - X(PH_PRICE_SOLO, "PH-PRICE-SOLO") \ - X(PH_LOT_BLEND, "PH-LOT-BLEND") \ - X(PH_LOT_HELD, "PH-LOT-HELD") \ - X(PH_LOT_SOLO, "PH-LOT-SOLO") \ - X(PH_GOAT_BLEND, "PH-GOAT-BLEND") \ - X(PH_GOAT_HELD, "PH-GOAT-HELD") \ - X(PH_GOAT_SOLO, "PH-GOAT-SOLO") \ - X(PH_THOUGHT_BLEND, "PH-THOUGHT-BLEND") \ - X(PH_THOUGHT_HELD, "PH-THOUGHT-HELD") \ - X(PH_THOUGHT_SOLO, "PH-THOUGHT-SOLO") \ - X(PH_CHOICE_BLEND, "PH-CHOICE-BLEND") \ - X(PH_CHOICE_HELD, "PH-CHOICE-HELD") \ - X(PH_CHOICE_SOLO, "PH-CHOICE-SOLO") \ - X(PH_MOUTH_BLEND, "PH-MOUTH-BLEND") \ - X(PH_MOUTH_HELD, "PH-MOUTH-HELD") \ - X(PH_MOUTH_SOLO, "PH-MOUTH-SOLO") \ - X(PH_FOOT_BLEND, "PH-FOOT-BLEND") \ - X(PH_FOOT_HELD, "PH-FOOT-HELD") \ - X(PH_FOOT_SOLO, "PH-FOOT-SOLO") \ - X(PH_GOOSE_BLEND, "PH-GOOSE-BLEND") \ - X(PH_GOOSE_HELD, "PH-GOOSE-HELD") \ - X(PH_GOOSE_SOLO, "PH-GOOSE-SOLO") \ - X(PH_STRUT_BLEND, "PH-STRUT-BLEND") \ - X(PH_STRUT_HELD, "PH-STRUT-HELD") \ - X(PH_STRUT_SOLO, "PH-STRUT-SOLO") \ - X(PH_CURE_BLEND, "PH-CURE-BLEND") \ - X(PH_CURE_HELD, "PH-CURE-HELD") \ - X(PH_CURE_SOLO, "PH-CURE-SOLO") \ - X(PH_NURSE_BLEND, "PH-NURSE-BLEND") \ - X(PH_NURSE_HELD, "PH-NURSE-HELD") \ - X(PH_NURSE_SOLO, "PH-NURSE-SOLO") \ + X(MUS_LITTLEROOT_TEST) \ + X(MUS_GSC_ROUTE38) \ + X(MUS_CAUGHT) \ + X(MUS_VICTORY_WILD) \ + X(MUS_VICTORY_GYM_LEADER) \ + X(MUS_VICTORY_LEAGUE) \ + X(MUS_C_COMM_CENTER) \ + X(MUS_GSC_PEWTER) \ + X(MUS_C_VS_LEGEND_BEAST) \ + X(MUS_ROUTE101) \ + X(MUS_ROUTE110) \ + X(MUS_ROUTE120) \ + X(MUS_PETALBURG) \ + X(MUS_OLDALE) \ + X(MUS_GYM) \ + X(MUS_SURF) \ + X(MUS_PETALBURG_WOODS) \ + X(MUS_LEVEL_UP) \ + X(MUS_HEAL) \ + X(MUS_OBTAIN_BADGE) \ + X(MUS_OBTAIN_ITEM) \ + X(MUS_EVOLVED) \ + X(MUS_OBTAIN_TMHM) \ + X(MUS_LILYCOVE_MUSEUM) \ + X(MUS_ROUTE122) \ + X(MUS_OCEANIC_MUSEUM) \ + X(MUS_EVOLUTION_INTRO) \ + X(MUS_EVOLUTION) \ + X(MUS_MOVE_DELETED) \ + X(MUS_ENCOUNTER_GIRL) \ + X(MUS_ENCOUNTER_MALE) \ + X(MUS_ABANDONED_SHIP) \ + X(MUS_FORTREE) \ + X(MUS_BIRCH_LAB) \ + X(MUS_B_TOWER_RS) \ + X(MUS_ENCOUNTER_SWIMMER) \ + X(MUS_CAVE_OF_ORIGIN) \ + X(MUS_OBTAIN_BERRY) \ + X(MUS_AWAKEN_LEGEND) \ + X(MUS_SLOTS_JACKPOT) \ + X(MUS_SLOTS_WIN) \ + X(MUS_TOO_BAD) \ + X(MUS_ROULETTE) \ + X(MUS_LINK_CONTEST_P1) \ + X(MUS_LINK_CONTEST_P2) \ + X(MUS_LINK_CONTEST_P3) \ + X(MUS_LINK_CONTEST_P4) \ + X(MUS_ENCOUNTER_RICH) \ + X(MUS_VERDANTURF) \ + X(MUS_RUSTBORO) \ + X(MUS_POKE_CENTER) \ + X(MUS_ROUTE104) \ + X(MUS_ROUTE119) \ + X(MUS_CYCLING) \ + X(MUS_POKE_MART) \ + X(MUS_LITTLEROOT) \ + X(MUS_MT_CHIMNEY) \ + X(MUS_ENCOUNTER_FEMALE) \ + X(MUS_LILYCOVE) \ + X(MUS_ROUTE111) \ + X(MUS_HELP) \ + X(MUS_UNDERWATER) \ + X(MUS_VICTORY_TRAINER) \ + X(MUS_TITLE) \ + X(MUS_INTRO) \ + X(MUS_ENCOUNTER_MAY) \ + X(MUS_ENCOUNTER_INTENSE) \ + X(MUS_ENCOUNTER_COOL) \ + X(MUS_ROUTE113) \ + X(MUS_ENCOUNTER_AQUA) \ + X(MUS_FOLLOW_ME) \ + X(MUS_ENCOUNTER_BRENDAN) \ + X(MUS_EVER_GRANDE) \ + X(MUS_ENCOUNTER_SUSPICIOUS) \ + X(MUS_VICTORY_AQUA_MAGMA) \ + X(MUS_CABLE_CAR) \ + X(MUS_GAME_CORNER) \ + X(MUS_DEWFORD) \ + X(MUS_SAFARI_ZONE) \ + X(MUS_VICTORY_ROAD) \ + X(MUS_AQUA_MAGMA_HIDEOUT) \ + X(MUS_SAILING) \ + X(MUS_MT_PYRE) \ + X(MUS_SLATEPORT) \ + X(MUS_MT_PYRE_EXTERIOR) \ + X(MUS_SCHOOL) \ + X(MUS_HALL_OF_FAME) \ + X(MUS_FALLARBOR) \ + X(MUS_SEALED_CHAMBER) \ + X(MUS_CONTEST_WINNER) \ + X(MUS_CONTEST) \ + X(MUS_ENCOUNTER_MAGMA) \ + X(MUS_INTRO_BATTLE) \ + X(MUS_WEATHER_KYOGRE) \ + X(MUS_WEATHER_GROUDON) \ + X(MUS_SOOTOPOLIS) \ + X(MUS_CONTEST_RESULTS) \ + X(MUS_HALL_OF_FAME_ROOM) \ + X(MUS_TRICK_HOUSE) \ + X(MUS_ENCOUNTER_TWINS) \ + X(MUS_ENCOUNTER_ELITE_FOUR) \ + X(MUS_ENCOUNTER_HIKER) \ + X(MUS_CONTEST_LOBBY) \ + X(MUS_ENCOUNTER_INTERVIEWER) \ + X(MUS_ENCOUNTER_CHAMPION) \ + X(MUS_CREDITS) \ + X(MUS_END) \ + X(MUS_B_FRONTIER) \ + X(MUS_B_ARENA) \ + X(MUS_OBTAIN_B_POINTS) \ + X(MUS_REGISTER_MATCH_CALL) \ + X(MUS_B_PYRAMID) \ + X(MUS_B_PYRAMID_TOP) \ + X(MUS_B_PALACE) \ + X(MUS_RAYQUAZA_APPEARS) \ + X(MUS_B_TOWER) \ + X(MUS_OBTAIN_SYMBOL) \ + X(MUS_B_DOME) \ + X(MUS_B_PIKE) \ + X(MUS_B_FACTORY) \ + X(MUS_VS_RAYQUAZA) \ + X(MUS_VS_FRONTIER_BRAIN) \ + X(MUS_VS_MEW) \ + X(MUS_B_DOME_LOBBY) \ + X(MUS_VS_WILD) \ + X(MUS_VS_AQUA_MAGMA) \ + X(MUS_VS_TRAINER) \ + X(MUS_VS_GYM_LEADER) \ + X(MUS_VS_CHAMPION) \ + X(MUS_VS_REGI) \ + X(MUS_VS_KYOGRE_GROUDON) \ + X(MUS_VS_RIVAL) \ + X(MUS_VS_ELITE_FOUR) \ + X(MUS_VS_AQUA_MAGMA_LEADER) \ + X(MUS_RG_FOLLOW_ME) \ + X(MUS_RG_GAME_CORNER) \ + X(MUS_RG_ROCKET_HIDEOUT) \ + X(MUS_RG_GYM) \ + X(MUS_RG_JIGGLYPUFF) \ + X(MUS_RG_INTRO_FIGHT) \ + X(MUS_RG_TITLE) \ + X(MUS_RG_CINNABAR) \ + X(MUS_RG_LAVENDER) \ + X(MUS_RG_HEAL) \ + X(MUS_RG_CYCLING) \ + X(MUS_RG_ENCOUNTER_ROCKET) \ + X(MUS_RG_ENCOUNTER_GIRL) \ + X(MUS_RG_ENCOUNTER_BOY) \ + X(MUS_RG_HALL_OF_FAME) \ + X(MUS_RG_VIRIDIAN_FOREST) \ + X(MUS_RG_MT_MOON) \ + X(MUS_RG_POKE_MANSION) \ + X(MUS_RG_CREDITS) \ + X(MUS_RG_ROUTE1) \ + X(MUS_RG_ROUTE24) \ + X(MUS_RG_ROUTE3) \ + X(MUS_RG_ROUTE11) \ + X(MUS_RG_VICTORY_ROAD) \ + X(MUS_RG_VS_GYM_LEADER) \ + X(MUS_RG_VS_TRAINER) \ + X(MUS_RG_VS_WILD) \ + X(MUS_RG_VS_CHAMPION) \ + X(MUS_RG_PALLET) \ + X(MUS_RG_OAK_LAB) \ + X(MUS_RG_OAK) \ + X(MUS_RG_POKE_CENTER) \ + X(MUS_RG_SS_ANNE) \ + X(MUS_RG_SURF) \ + X(MUS_RG_POKE_TOWER) \ + X(MUS_RG_SILPH) \ + X(MUS_RG_FUCHSIA) \ + X(MUS_RG_CELADON) \ + X(MUS_RG_VICTORY_TRAINER) \ + X(MUS_RG_VICTORY_WILD) \ + X(MUS_RG_VICTORY_GYM_LEADER) \ + X(MUS_RG_VERMILLION) \ + X(MUS_RG_PEWTER) \ + X(MUS_RG_ENCOUNTER_RIVAL) \ + X(MUS_RG_RIVAL_EXIT) \ + X(MUS_RG_DEX_RATING) \ + X(MUS_RG_OBTAIN_KEY_ITEM) \ + X(MUS_RG_CAUGHT_INTRO) \ + X(MUS_RG_PHOTO) \ + X(MUS_RG_GAME_FREAK) \ + X(MUS_RG_CAUGHT) \ + X(MUS_RG_NEW_GAME_INSTRUCT) \ + X(MUS_RG_NEW_GAME_INTRO) \ + X(MUS_RG_NEW_GAME_EXIT) \ + X(MUS_RG_POKE_JUMP) \ + X(MUS_RG_UNION_ROOM) \ + X(MUS_RG_NET_CENTER) \ + X(MUS_RG_MYSTERY_GIFT) \ + X(MUS_RG_BERRY_PICK) \ + X(MUS_RG_SEVII_CAVE) \ + X(MUS_RG_TEACHY_TV_SHOW) \ + X(MUS_RG_SEVII_ROUTE) \ + X(MUS_RG_SEVII_DUNGEON) \ + X(MUS_RG_SEVII_123) \ + X(MUS_RG_SEVII_45) \ + X(MUS_RG_SEVII_67) \ + X(MUS_RG_POKE_FLUTE) \ + X(MUS_RG_VS_DEOXYS) \ + X(MUS_RG_VS_MEWTWO) \ + X(MUS_RG_VS_LEGEND) \ + X(MUS_RG_ENCOUNTER_GYM_LEADER) \ + X(MUS_RG_ENCOUNTER_DEOXYS) \ + X(MUS_RG_TRAINER_TOWER) \ + X(MUS_RG_SLOW_PALLET) \ + X(MUS_RG_TEACHY_TV_MENU) \ + X(PH_TRAP_BLEND) \ + X(PH_TRAP_HELD) \ + X(PH_TRAP_SOLO) \ + X(PH_FACE_BLEND) \ + X(PH_FACE_HELD) \ + X(PH_FACE_SOLO) \ + X(PH_CLOTH_BLEND) \ + X(PH_CLOTH_HELD) \ + X(PH_CLOTH_SOLO) \ + X(PH_DRESS_BLEND) \ + X(PH_DRESS_HELD) \ + X(PH_DRESS_SOLO) \ + X(PH_FLEECE_BLEND) \ + X(PH_FLEECE_HELD) \ + X(PH_FLEECE_SOLO) \ + X(PH_KIT_BLEND) \ + X(PH_KIT_HELD) \ + X(PH_KIT_SOLO) \ + X(PH_PRICE_BLEND) \ + X(PH_PRICE_HELD) \ + X(PH_PRICE_SOLO) \ + X(PH_LOT_BLEND) \ + X(PH_LOT_HELD) \ + X(PH_LOT_SOLO) \ + X(PH_GOAT_BLEND) \ + X(PH_GOAT_HELD) \ + X(PH_GOAT_SOLO) \ + X(PH_THOUGHT_BLEND) \ + X(PH_THOUGHT_HELD) \ + X(PH_THOUGHT_SOLO) \ + X(PH_CHOICE_BLEND) \ + X(PH_CHOICE_HELD) \ + X(PH_CHOICE_SOLO) \ + X(PH_MOUTH_BLEND) \ + X(PH_MOUTH_HELD) \ + X(PH_MOUTH_SOLO) \ + X(PH_FOOT_BLEND) \ + X(PH_FOOT_HELD) \ + X(PH_FOOT_SOLO) \ + X(PH_GOOSE_BLEND) \ + X(PH_GOOSE_HELD) \ + X(PH_GOOSE_SOLO) \ + X(PH_STRUT_BLEND) \ + X(PH_STRUT_HELD) \ + X(PH_STRUT_SOLO) \ + X(PH_CURE_BLEND) \ + X(PH_CURE_HELD) \ + X(PH_CURE_SOLO) \ + X(PH_NURSE_BLEND) \ + X(PH_NURSE_HELD) \ + X(PH_NURSE_SOLO) \ #define SOUND_LIST_SE \ - X(SE_USE_ITEM, "SE-USE-ITEM") \ - X(SE_PC_LOGIN, "SE-PC-LOGIN") \ - X(SE_PC_OFF, "SE-PC-OFF") \ - X(SE_PC_ON, "SE-PC-ON") \ - X(SE_SELECT, "SE-SELECT") \ - X(SE_WIN_OPEN, "SE-WIN-OPEN") \ - X(SE_WALL_HIT, "SE-WALL-HIT") \ - X(SE_DOOR, "SE-DOOR") \ - X(SE_EXIT, "SE-EXIT") \ - X(SE_LEDGE, "SE-LEDGE") \ - X(SE_BIKE_BELL, "SE-BIKE-BELL") \ - X(SE_NOT_EFFECTIVE, "SE-NOT-EFFECTIVE") \ - X(SE_EFFECTIVE, "SE-EFFECTIVE") \ - X(SE_SUPER_EFFECTIVE, "SE-SUPER-EFFECTIVE") \ - X(SE_BALL_OPEN, "SE-BALL-OPEN") \ - X(SE_FAINT, "SE-FAINT") \ - X(SE_FLEE, "SE-FLEE") \ - X(SE_SLIDING_DOOR, "SE-SLIDING-DOOR") \ - X(SE_SHIP, "SE-SHIP") \ - X(SE_BANG, "SE-BANG") \ - X(SE_PIN, "SE-PIN") \ - X(SE_BOO, "SE-BOO") \ - X(SE_BALL, "SE-BALL") \ - X(SE_CONTEST_PLACE, "SE-CONTEST-PLACE") \ - X(SE_A, "SE-A") \ - X(SE_I, "SE-I") \ - X(SE_U, "SE-U") \ - X(SE_E, "SE-E") \ - X(SE_O, "SE-O") \ - X(SE_N, "SE-N") \ - X(SE_SUCCESS, "SE-SUCCESS") \ - X(SE_FAILURE, "SE-FAILURE") \ - X(SE_EXP, "SE-EXP") \ - X(SE_BIKE_HOP, "SE-BIKE-HOP") \ - X(SE_SWITCH, "SE-SWITCH") \ - X(SE_CLICK, "SE-CLICK") \ - X(SE_FU_ZAKU, "SE-FU-ZAKU") \ - X(SE_CONTEST_CONDITION_LOSE, "SE-CONTEST-CONDITION-LOSE") \ - X(SE_LAVARIDGE_FALL_WARP, "SE-LAVARIDGE-FALL-WARP") \ - X(SE_ICE_STAIRS, "SE-ICE-STAIRS") \ - X(SE_ICE_BREAK, "SE-ICE-BREAK") \ - X(SE_ICE_CRACK, "SE-ICE-CRACK") \ - X(SE_FALL, "SE-FALL") \ - X(SE_UNLOCK, "SE-UNLOCK") \ - X(SE_WARP_IN, "SE-WARP-IN") \ - X(SE_WARP_OUT, "SE-WARP-OUT") \ - X(SE_REPEL, "SE-REPEL") \ - X(SE_ROTATING_GATE, "SE-ROTATING-GATE") \ - X(SE_TRUCK_MOVE, "SE-TRUCK-MOVE") \ - X(SE_TRUCK_STOP, "SE-TRUCK-STOP") \ - X(SE_TRUCK_UNLOAD, "SE-TRUCK-UNLOAD") \ - X(SE_TRUCK_DOOR, "SE-TRUCK-DOOR") \ - X(SE_BERRY_BLENDER, "SE-BERRY-BLENDER") \ - X(SE_CARD, "SE-CARD") \ - X(SE_SAVE, "SE-SAVE") \ - X(SE_BALL_BOUNCE_1, "SE-BALL-BOUNCE-1") \ - X(SE_BALL_BOUNCE_2, "SE-BALL-BOUNCE-2") \ - X(SE_BALL_BOUNCE_3, "SE-BALL-BOUNCE-3") \ - X(SE_BALL_BOUNCE_4, "SE-BALL-BOUNCE-4") \ - X(SE_BALL_TRADE, "SE-BALL-TRADE") \ - X(SE_BALL_THROW, "SE-BALL-THROW") \ - X(SE_NOTE_C, "SE-NOTE-C") \ - X(SE_NOTE_D, "SE-NOTE-D") \ - X(SE_NOTE_E, "SE-NOTE-E") \ - X(SE_NOTE_F, "SE-NOTE-F") \ - X(SE_NOTE_G, "SE-NOTE-G") \ - X(SE_NOTE_A, "SE-NOTE-A") \ - X(SE_NOTE_B, "SE-NOTE-B") \ - X(SE_NOTE_C_HIGH, "SE-NOTE-C-HIGH") \ - X(SE_PUDDLE, "SE-PUDDLE") \ - X(SE_BRIDGE_WALK, "SE-BRIDGE-WALK") \ - X(SE_ITEMFINDER, "SE-ITEMFINDER") \ - X(SE_DING_DONG, "SE-DING-DONG") \ - X(SE_BALLOON_RED, "SE-BALLOON-RED") \ - X(SE_BALLOON_BLUE, "SE-BALLOON-BLUE") \ - X(SE_BALLOON_YELLOW, "SE-BALLOON-YELLOW") \ - X(SE_BREAKABLE_DOOR, "SE-BREAKABLE-DOOR") \ - X(SE_MUD_BALL, "SE-MUD-BALL") \ - X(SE_FIELD_POISON, "SE-FIELD-POISON") \ - X(SE_ESCALATOR, "SE-ESCALATOR") \ - X(SE_THUNDERSTORM, "SE-THUNDERSTORM") \ - X(SE_THUNDERSTORM_STOP, "SE-THUNDERSTORM-STOP") \ - X(SE_DOWNPOUR, "SE-DOWNPOUR") \ - X(SE_DOWNPOUR_STOP, "SE-DOWNPOUR-STOP") \ - X(SE_RAIN, "SE-RAIN") \ - X(SE_RAIN_STOP, "SE-RAIN-STOP") \ - X(SE_THUNDER, "SE-THUNDER") \ - X(SE_THUNDER2, "SE-THUNDER2") \ - X(SE_ELEVATOR, "SE-ELEVATOR") \ - X(SE_LOW_HEALTH, "SE-LOW-HEALTH") \ - X(SE_EXP_MAX, "SE-EXP-MAX") \ - X(SE_ROULETTE_BALL, "SE-ROULETTE-BALL") \ - X(SE_ROULETTE_BALL2, "SE-ROULETTE-BALL2") \ - X(SE_TAILLOW_WING_FLAP, "SE-TAILLOW-WING-FLAP") \ - X(SE_SHOP, "SE-SHOP") \ - X(SE_CONTEST_HEART, "SE-CONTEST-HEART") \ - X(SE_CONTEST_CURTAIN_RISE, "SE-CONTEST-CURTAIN-RISE") \ - X(SE_CONTEST_CURTAIN_FALL, "SE-CONTEST-CURTAIN-FALL") \ - X(SE_CONTEST_ICON_CHANGE, "SE-CONTEST-ICON-CHANGE") \ - X(SE_CONTEST_ICON_CLEAR, "SE-CONTEST-ICON-CLEAR") \ - X(SE_CONTEST_MONS_TURN, "SE-CONTEST-MONS-TURN") \ - X(SE_SHINY, "SE-SHINY") \ - X(SE_INTRO_BLAST, "SE-INTRO-BLAST") \ - X(SE_MUGSHOT, "SE-MUGSHOT") \ - X(SE_APPLAUSE, "SE-APPLAUSE") \ - X(SE_VEND, "SE-VEND") \ - X(SE_ORB, "SE-ORB") \ - X(SE_DEX_SCROLL, "SE-DEX-SCROLL") \ - X(SE_DEX_PAGE, "SE-DEX-PAGE") \ - X(SE_POKENAV_ON, "SE-POKENAV-ON") \ - X(SE_POKENAV_OFF, "SE-POKENAV-OFF") \ - X(SE_DEX_SEARCH, "SE-DEX-SEARCH") \ - X(SE_EGG_HATCH, "SE-EGG-HATCH") \ - X(SE_BALL_TRAY_ENTER, "SE-BALL-TRAY-ENTER") \ - X(SE_BALL_TRAY_BALL, "SE-BALL-TRAY-BALL") \ - X(SE_BALL_TRAY_EXIT, "SE-BALL-TRAY-EXIT") \ - X(SE_GLASS_FLUTE, "SE-GLASS-FLUTE") \ - X(SE_M_THUNDERBOLT, "SE-M-THUNDERBOLT") \ - X(SE_M_THUNDERBOLT2, "SE-M-THUNDERBOLT2") \ - X(SE_M_HARDEN, "SE-M-HARDEN") \ - X(SE_M_NIGHTMARE, "SE-M-NIGHTMARE") \ - X(SE_M_VITAL_THROW, "SE-M-VITAL-THROW") \ - X(SE_M_VITAL_THROW2, "SE-M-VITAL-THROW2") \ - X(SE_M_BUBBLE, "SE-M-BUBBLE") \ - X(SE_M_BUBBLE2, "SE-M-BUBBLE2") \ - X(SE_M_BUBBLE3, "SE-M-BUBBLE3") \ - X(SE_M_RAIN_DANCE, "SE-M-RAIN-DANCE") \ - X(SE_M_CUT, "SE-M-CUT") \ - X(SE_M_STRING_SHOT, "SE-M-STRING-SHOT") \ - X(SE_M_STRING_SHOT2, "SE-M-STRING-SHOT2") \ - X(SE_M_ROCK_THROW, "SE-M-ROCK-THROW") \ - X(SE_M_GUST, "SE-M-GUST") \ - X(SE_M_GUST2, "SE-M-GUST2") \ - X(SE_M_DOUBLE_SLAP, "SE-M-DOUBLE-SLAP") \ - X(SE_M_DOUBLE_TEAM, "SE-M-DOUBLE-TEAM") \ - X(SE_M_RAZOR_WIND, "SE-M-RAZOR-WIND") \ - X(SE_M_ICY_WIND, "SE-M-ICY-WIND") \ - X(SE_M_THUNDER_WAVE, "SE-M-THUNDER-WAVE") \ - X(SE_M_COMET_PUNCH, "SE-M-COMET-PUNCH") \ - X(SE_M_MEGA_KICK, "SE-M-MEGA-KICK") \ - X(SE_M_MEGA_KICK2, "SE-M-MEGA-KICK2") \ - X(SE_M_CRABHAMMER, "SE-M-CRABHAMMER") \ - X(SE_M_JUMP_KICK, "SE-M-JUMP-KICK") \ - X(SE_M_FLAME_WHEEL, "SE-M-FLAME-WHEEL") \ - X(SE_M_FLAME_WHEEL2, "SE-M-FLAME-WHEEL2") \ - X(SE_M_FLAMETHROWER, "SE-M-FLAMETHROWER") \ - X(SE_M_FIRE_PUNCH, "SE-M-FIRE-PUNCH") \ - X(SE_M_TOXIC, "SE-M-TOXIC") \ - X(SE_M_SACRED_FIRE, "SE-M-SACRED-FIRE") \ - X(SE_M_SACRED_FIRE2, "SE-M-SACRED-FIRE2") \ - X(SE_M_EMBER, "SE-M-EMBER") \ - X(SE_M_TAKE_DOWN, "SE-M-TAKE-DOWN") \ - X(SE_M_BLIZZARD, "SE-M-BLIZZARD") \ - X(SE_M_BLIZZARD2, "SE-M-BLIZZARD2") \ - X(SE_M_SCRATCH, "SE-M-SCRATCH") \ - X(SE_M_VICEGRIP, "SE-M-VICEGRIP") \ - X(SE_M_WING_ATTACK, "SE-M-WING-ATTACK") \ - X(SE_M_FLY, "SE-M-FLY") \ - X(SE_M_SAND_ATTACK, "SE-M-SAND-ATTACK") \ - X(SE_M_RAZOR_WIND2, "SE-M-RAZOR-WIND2") \ - X(SE_M_BITE, "SE-M-BITE") \ - X(SE_M_HEADBUTT, "SE-M-HEADBUTT") \ - X(SE_M_SURF, "SE-M-SURF") \ - X(SE_M_HYDRO_PUMP, "SE-M-HYDRO-PUMP") \ - X(SE_M_WHIRLPOOL, "SE-M-WHIRLPOOL") \ - X(SE_M_HORN_ATTACK, "SE-M-HORN-ATTACK") \ - X(SE_M_TAIL_WHIP, "SE-M-TAIL-WHIP") \ - X(SE_M_MIST, "SE-M-MIST") \ - X(SE_M_POISON_POWDER, "SE-M-POISON-POWDER") \ - X(SE_M_BIND, "SE-M-BIND") \ - X(SE_M_DRAGON_RAGE, "SE-M-DRAGON-RAGE") \ - X(SE_M_SING, "SE-M-SING") \ - X(SE_M_PERISH_SONG, "SE-M-PERISH-SONG") \ - X(SE_M_PAY_DAY, "SE-M-PAY-DAY") \ - X(SE_M_DIG, "SE-M-DIG") \ - X(SE_M_DIZZY_PUNCH, "SE-M-DIZZY-PUNCH") \ - X(SE_M_SELF_DESTRUCT, "SE-M-SELF-DESTRUCT") \ - X(SE_M_EXPLOSION, "SE-M-EXPLOSION") \ - X(SE_M_ABSORB_2, "SE-M-ABSORB-2") \ - X(SE_M_ABSORB, "SE-M-ABSORB") \ - X(SE_M_SCREECH, "SE-M-SCREECH") \ - X(SE_M_BUBBLE_BEAM, "SE-M-BUBBLE-BEAM") \ - X(SE_M_BUBBLE_BEAM2, "SE-M-BUBBLE-BEAM2") \ - X(SE_M_SUPERSONIC, "SE-M-SUPERSONIC") \ - X(SE_M_BELLY_DRUM, "SE-M-BELLY-DRUM") \ - X(SE_M_METRONOME, "SE-M-METRONOME") \ - X(SE_M_BONEMERANG, "SE-M-BONEMERANG") \ - X(SE_M_LICK, "SE-M-LICK") \ - X(SE_M_PSYBEAM, "SE-M-PSYBEAM") \ - X(SE_M_FAINT_ATTACK, "SE-M-FAINT-ATTACK") \ - X(SE_M_SWORDS_DANCE, "SE-M-SWORDS-DANCE") \ - X(SE_M_LEER, "SE-M-LEER") \ - X(SE_M_SWAGGER, "SE-M-SWAGGER") \ - X(SE_M_SWAGGER2, "SE-M-SWAGGER2") \ - X(SE_M_HEAL_BELL, "SE-M-HEAL-BELL") \ - X(SE_M_CONFUSE_RAY, "SE-M-CONFUSE-RAY") \ - X(SE_M_SNORE, "SE-M-SNORE") \ - X(SE_M_BRICK_BREAK, "SE-M-BRICK-BREAK") \ - X(SE_M_GIGA_DRAIN, "SE-M-GIGA-DRAIN") \ - X(SE_M_PSYBEAM2, "SE-M-PSYBEAM2") \ - X(SE_M_SOLAR_BEAM, "SE-M-SOLAR-BEAM") \ - X(SE_M_PETAL_DANCE, "SE-M-PETAL-DANCE") \ - X(SE_M_TELEPORT, "SE-M-TELEPORT") \ - X(SE_M_MINIMIZE, "SE-M-MINIMIZE") \ - X(SE_M_SKETCH, "SE-M-SKETCH") \ - X(SE_M_SWIFT, "SE-M-SWIFT") \ - X(SE_M_REFLECT, "SE-M-REFLECT") \ - X(SE_M_BARRIER, "SE-M-BARRIER") \ - X(SE_M_DETECT, "SE-M-DETECT") \ - X(SE_M_LOCK_ON, "SE-M-LOCK-ON") \ - X(SE_M_MOONLIGHT, "SE-M-MOONLIGHT") \ - X(SE_M_CHARM, "SE-M-CHARM") \ - X(SE_M_CHARGE, "SE-M-CHARGE") \ - X(SE_M_STRENGTH, "SE-M-STRENGTH") \ - X(SE_M_HYPER_BEAM, "SE-M-HYPER-BEAM") \ - X(SE_M_WATERFALL, "SE-M-WATERFALL") \ - X(SE_M_REVERSAL, "SE-M-REVERSAL") \ - X(SE_M_ACID_ARMOR, "SE-M-ACID-ARMOR") \ - X(SE_M_SANDSTORM, "SE-M-SANDSTORM") \ - X(SE_M_TRI_ATTACK, "SE-M-TRI-ATTACK") \ - X(SE_M_TRI_ATTACK2, "SE-M-TRI-ATTACK2") \ - X(SE_M_ENCORE, "SE-M-ENCORE") \ - X(SE_M_ENCORE2, "SE-M-ENCORE2") \ - X(SE_M_BATON_PASS, "SE-M-BATON-PASS") \ - X(SE_M_MILK_DRINK, "SE-M-MILK-DRINK") \ - X(SE_M_ATTRACT, "SE-M-ATTRACT") \ - X(SE_M_ATTRACT2, "SE-M-ATTRACT2") \ - X(SE_M_MORNING_SUN, "SE-M-MORNING-SUN") \ - X(SE_M_FLATTER, "SE-M-FLATTER") \ - X(SE_M_SAND_TOMB, "SE-M-SAND-TOMB") \ - X(SE_M_GRASSWHISTLE, "SE-M-GRASSWHISTLE") \ - X(SE_M_SPIT_UP, "SE-M-SPIT-UP") \ - X(SE_M_DIVE, "SE-M-DIVE") \ - X(SE_M_EARTHQUAKE, "SE-M-EARTHQUAKE") \ - X(SE_M_TWISTER, "SE-M-TWISTER") \ - X(SE_M_SWEET_SCENT, "SE-M-SWEET-SCENT") \ - X(SE_M_YAWN, "SE-M-YAWN") \ - X(SE_M_SKY_UPPERCUT, "SE-M-SKY-UPPERCUT") \ - X(SE_M_STAT_INCREASE, "SE-M-STAT-INCREASE") \ - X(SE_M_HEAT_WAVE, "SE-M-HEAT-WAVE") \ - X(SE_M_UPROAR, "SE-M-UPROAR") \ - X(SE_M_HAIL, "SE-M-HAIL") \ - X(SE_M_COSMIC_POWER, "SE-M-COSMIC-POWER") \ - X(SE_M_TEETER_DANCE, "SE-M-TEETER-DANCE") \ - X(SE_M_STAT_DECREASE, "SE-M-STAT-DECREASE") \ - X(SE_M_HAZE, "SE-M-HAZE") \ - X(SE_M_HYPER_BEAM2, "SE-M-HYPER-BEAM2") \ - X(SE_RG_DOOR, "SE-RG-DOOR") \ - X(SE_RG_CARD_FLIP, "SE-RG-CARD-FLIP") \ - X(SE_RG_CARD_FLIPPING, "SE-RG-CARD-FLIPPING") \ - X(SE_RG_CARD_OPEN, "SE-RG-CARD-OPEN") \ - X(SE_RG_BAG_CURSOR, "SE-RG-BAG-CURSOR") \ - X(SE_RG_BAG_POCKET, "SE-RG-BAG-POCKET") \ - X(SE_RG_BALL_CLICK, "SE-RG-BALL-CLICK") \ - X(SE_RG_SHOP, "SE-RG-SHOP") \ - X(SE_RG_SS_ANNE_HORN, "SE-RG-SS-ANNE-HORN") \ - X(SE_RG_HELP_OPEN, "SE-RG-HELP-OPEN") \ - X(SE_RG_HELP_CLOSE, "SE-RG-HELP-CLOSE") \ - X(SE_RG_HELP_ERROR, "SE-RG-HELP-ERROR") \ - X(SE_RG_DEOXYS_MOVE, "SE-RG-DEOXYS-MOVE") \ - X(SE_RG_POKE_JUMP_SUCCESS, "SE-RG-POKE-JUMP-SUCCESS") \ - X(SE_RG_POKE_JUMP_FAILURE, "SE-RG-POKE-JUMP-FAILURE") \ - X(SE_PHONE_CALL, "SE-PHONE-CALL") \ - X(SE_PHONE_CLICK, "SE-PHONE-CLICK") \ - X(SE_ARENA_TIMEUP1, "SE-ARENA-TIMEUP1") \ - X(SE_ARENA_TIMEUP2, "SE-ARENA-TIMEUP2") \ - X(SE_PIKE_CURTAIN_CLOSE, "SE-PIKE-CURTAIN-CLOSE") \ - X(SE_PIKE_CURTAIN_OPEN, "SE-PIKE-CURTAIN-OPEN") \ - X(SE_SUDOWOODO_SHAKE, "SE-SUDOWOODO-SHAKE") \ + X(SE_USE_ITEM) \ + X(SE_PC_LOGIN) \ + X(SE_PC_OFF) \ + X(SE_PC_ON) \ + X(SE_SELECT) \ + X(SE_WIN_OPEN) \ + X(SE_WALL_HIT) \ + X(SE_DOOR) \ + X(SE_EXIT) \ + X(SE_LEDGE) \ + X(SE_BIKE_BELL) \ + X(SE_NOT_EFFECTIVE) \ + X(SE_EFFECTIVE) \ + X(SE_SUPER_EFFECTIVE) \ + X(SE_BALL_OPEN) \ + X(SE_FAINT) \ + X(SE_FLEE) \ + X(SE_SLIDING_DOOR) \ + X(SE_SHIP) \ + X(SE_BANG) \ + X(SE_PIN) \ + X(SE_BOO) \ + X(SE_BALL) \ + X(SE_CONTEST_PLACE) \ + X(SE_A) \ + X(SE_I) \ + X(SE_U) \ + X(SE_E) \ + X(SE_O) \ + X(SE_N) \ + X(SE_SUCCESS) \ + X(SE_FAILURE) \ + X(SE_EXP) \ + X(SE_BIKE_HOP) \ + X(SE_SWITCH) \ + X(SE_CLICK) \ + X(SE_FU_ZAKU) \ + X(SE_CONTEST_CONDITION_LOSE) \ + X(SE_LAVARIDGE_FALL_WARP) \ + X(SE_ICE_STAIRS) \ + X(SE_ICE_BREAK) \ + X(SE_ICE_CRACK) \ + X(SE_FALL) \ + X(SE_UNLOCK) \ + X(SE_WARP_IN) \ + X(SE_WARP_OUT) \ + X(SE_REPEL) \ + X(SE_ROTATING_GATE) \ + X(SE_TRUCK_MOVE) \ + X(SE_TRUCK_STOP) \ + X(SE_TRUCK_UNLOAD) \ + X(SE_TRUCK_DOOR) \ + X(SE_BERRY_BLENDER) \ + X(SE_CARD) \ + X(SE_SAVE) \ + X(SE_BALL_BOUNCE_1) \ + X(SE_BALL_BOUNCE_2) \ + X(SE_BALL_BOUNCE_3) \ + X(SE_BALL_BOUNCE_4) \ + X(SE_BALL_TRADE) \ + X(SE_BALL_THROW) \ + X(SE_NOTE_C) \ + X(SE_NOTE_D) \ + X(SE_NOTE_E) \ + X(SE_NOTE_F) \ + X(SE_NOTE_G) \ + X(SE_NOTE_A) \ + X(SE_NOTE_B) \ + X(SE_NOTE_C_HIGH) \ + X(SE_PUDDLE) \ + X(SE_BRIDGE_WALK) \ + X(SE_ITEMFINDER) \ + X(SE_DING_DONG) \ + X(SE_BALLOON_RED) \ + X(SE_BALLOON_BLUE) \ + X(SE_BALLOON_YELLOW) \ + X(SE_BREAKABLE_DOOR) \ + X(SE_MUD_BALL) \ + X(SE_FIELD_POISON) \ + X(SE_ESCALATOR) \ + X(SE_THUNDERSTORM) \ + X(SE_THUNDERSTORM_STOP) \ + X(SE_DOWNPOUR) \ + X(SE_DOWNPOUR_STOP) \ + X(SE_RAIN) \ + X(SE_RAIN_STOP) \ + X(SE_THUNDER) \ + X(SE_THUNDER2) \ + X(SE_ELEVATOR) \ + X(SE_LOW_HEALTH) \ + X(SE_EXP_MAX) \ + X(SE_ROULETTE_BALL) \ + X(SE_ROULETTE_BALL2) \ + X(SE_TAILLOW_WING_FLAP) \ + X(SE_SHOP) \ + X(SE_CONTEST_HEART) \ + X(SE_CONTEST_CURTAIN_RISE) \ + X(SE_CONTEST_CURTAIN_FALL) \ + X(SE_CONTEST_ICON_CHANGE) \ + X(SE_CONTEST_ICON_CLEAR) \ + X(SE_CONTEST_MONS_TURN) \ + X(SE_SHINY) \ + X(SE_INTRO_BLAST) \ + X(SE_MUGSHOT) \ + X(SE_APPLAUSE) \ + X(SE_VEND) \ + X(SE_ORB) \ + X(SE_DEX_SCROLL) \ + X(SE_DEX_PAGE) \ + X(SE_POKENAV_ON) \ + X(SE_POKENAV_OFF) \ + X(SE_DEX_SEARCH) \ + X(SE_EGG_HATCH) \ + X(SE_BALL_TRAY_ENTER) \ + X(SE_BALL_TRAY_BALL) \ + X(SE_BALL_TRAY_EXIT) \ + X(SE_GLASS_FLUTE) \ + X(SE_M_THUNDERBOLT) \ + X(SE_M_THUNDERBOLT2) \ + X(SE_M_HARDEN) \ + X(SE_M_NIGHTMARE) \ + X(SE_M_VITAL_THROW) \ + X(SE_M_VITAL_THROW2) \ + X(SE_M_BUBBLE) \ + X(SE_M_BUBBLE2) \ + X(SE_M_BUBBLE3) \ + X(SE_M_RAIN_DANCE) \ + X(SE_M_CUT) \ + X(SE_M_STRING_SHOT) \ + X(SE_M_STRING_SHOT2) \ + X(SE_M_ROCK_THROW) \ + X(SE_M_GUST) \ + X(SE_M_GUST2) \ + X(SE_M_DOUBLE_SLAP) \ + X(SE_M_DOUBLE_TEAM) \ + X(SE_M_RAZOR_WIND) \ + X(SE_M_ICY_WIND) \ + X(SE_M_THUNDER_WAVE) \ + X(SE_M_COMET_PUNCH) \ + X(SE_M_MEGA_KICK) \ + X(SE_M_MEGA_KICK2) \ + X(SE_M_CRABHAMMER) \ + X(SE_M_JUMP_KICK) \ + X(SE_M_FLAME_WHEEL) \ + X(SE_M_FLAME_WHEEL2) \ + X(SE_M_FLAMETHROWER) \ + X(SE_M_FIRE_PUNCH) \ + X(SE_M_TOXIC) \ + X(SE_M_SACRED_FIRE) \ + X(SE_M_SACRED_FIRE2) \ + X(SE_M_EMBER) \ + X(SE_M_TAKE_DOWN) \ + X(SE_M_BLIZZARD) \ + X(SE_M_BLIZZARD2) \ + X(SE_M_SCRATCH) \ + X(SE_M_VICEGRIP) \ + X(SE_M_WING_ATTACK) \ + X(SE_M_FLY) \ + X(SE_M_SAND_ATTACK) \ + X(SE_M_RAZOR_WIND2) \ + X(SE_M_BITE) \ + X(SE_M_HEADBUTT) \ + X(SE_M_SURF) \ + X(SE_M_HYDRO_PUMP) \ + X(SE_M_WHIRLPOOL) \ + X(SE_M_HORN_ATTACK) \ + X(SE_M_TAIL_WHIP) \ + X(SE_M_MIST) \ + X(SE_M_POISON_POWDER) \ + X(SE_M_BIND) \ + X(SE_M_DRAGON_RAGE) \ + X(SE_M_SING) \ + X(SE_M_PERISH_SONG) \ + X(SE_M_PAY_DAY) \ + X(SE_M_DIG) \ + X(SE_M_DIZZY_PUNCH) \ + X(SE_M_SELF_DESTRUCT) \ + X(SE_M_EXPLOSION) \ + X(SE_M_ABSORB_2) \ + X(SE_M_ABSORB) \ + X(SE_M_SCREECH) \ + X(SE_M_BUBBLE_BEAM) \ + X(SE_M_BUBBLE_BEAM2) \ + X(SE_M_SUPERSONIC) \ + X(SE_M_BELLY_DRUM) \ + X(SE_M_METRONOME) \ + X(SE_M_BONEMERANG) \ + X(SE_M_LICK) \ + X(SE_M_PSYBEAM) \ + X(SE_M_FAINT_ATTACK) \ + X(SE_M_SWORDS_DANCE) \ + X(SE_M_LEER) \ + X(SE_M_SWAGGER) \ + X(SE_M_SWAGGER2) \ + X(SE_M_HEAL_BELL) \ + X(SE_M_CONFUSE_RAY) \ + X(SE_M_SNORE) \ + X(SE_M_BRICK_BREAK) \ + X(SE_M_GIGA_DRAIN) \ + X(SE_M_PSYBEAM2) \ + X(SE_M_SOLAR_BEAM) \ + X(SE_M_PETAL_DANCE) \ + X(SE_M_TELEPORT) \ + X(SE_M_MINIMIZE) \ + X(SE_M_SKETCH) \ + X(SE_M_SWIFT) \ + X(SE_M_REFLECT) \ + X(SE_M_BARRIER) \ + X(SE_M_DETECT) \ + X(SE_M_LOCK_ON) \ + X(SE_M_MOONLIGHT) \ + X(SE_M_CHARM) \ + X(SE_M_CHARGE) \ + X(SE_M_STRENGTH) \ + X(SE_M_HYPER_BEAM) \ + X(SE_M_WATERFALL) \ + X(SE_M_REVERSAL) \ + X(SE_M_ACID_ARMOR) \ + X(SE_M_SANDSTORM) \ + X(SE_M_TRI_ATTACK) \ + X(SE_M_TRI_ATTACK2) \ + X(SE_M_ENCORE) \ + X(SE_M_ENCORE2) \ + X(SE_M_BATON_PASS) \ + X(SE_M_MILK_DRINK) \ + X(SE_M_ATTRACT) \ + X(SE_M_ATTRACT2) \ + X(SE_M_MORNING_SUN) \ + X(SE_M_FLATTER) \ + X(SE_M_SAND_TOMB) \ + X(SE_M_GRASSWHISTLE) \ + X(SE_M_SPIT_UP) \ + X(SE_M_DIVE) \ + X(SE_M_EARTHQUAKE) \ + X(SE_M_TWISTER) \ + X(SE_M_SWEET_SCENT) \ + X(SE_M_YAWN) \ + X(SE_M_SKY_UPPERCUT) \ + X(SE_M_STAT_INCREASE) \ + X(SE_M_HEAT_WAVE) \ + X(SE_M_UPROAR) \ + X(SE_M_HAIL) \ + X(SE_M_COSMIC_POWER) \ + X(SE_M_TEETER_DANCE) \ + X(SE_M_STAT_DECREASE) \ + X(SE_M_HAZE) \ + X(SE_M_HYPER_BEAM2) \ + X(SE_RG_DOOR) \ + X(SE_RG_CARD_FLIP) \ + X(SE_RG_CARD_FLIPPING) \ + X(SE_RG_CARD_OPEN) \ + X(SE_RG_BAG_CURSOR) \ + X(SE_RG_BAG_POCKET) \ + X(SE_RG_BALL_CLICK) \ + X(SE_RG_SHOP) \ + X(SE_RG_SS_ANNE_HORN) \ + X(SE_RG_HELP_OPEN) \ + X(SE_RG_HELP_CLOSE) \ + X(SE_RG_HELP_ERROR) \ + X(SE_RG_DEOXYS_MOVE) \ + X(SE_RG_POKE_JUMP_SUCCESS) \ + X(SE_RG_POKE_JUMP_FAILURE) \ + X(SE_PHONE_CALL) \ + X(SE_PHONE_CLICK) \ + X(SE_ARENA_TIMEUP1) \ + X(SE_ARENA_TIMEUP2) \ + X(SE_PIKE_CURTAIN_CLOSE) \ + X(SE_PIKE_CURTAIN_OPEN) \ + X(SE_SUDOWOODO_SHAKE) \ // Create BGM list -#define X(songId, name) static const u8 sBGMName_##songId[] = _(name); +#define X(songId) static const u8 sBGMName_##songId[] = _(#songId); SOUND_LIST_BGM #undef X -#define X(songId, name) sBGMName_##songId, +#define X(songId) sBGMName_##songId, static const u8 *const gBGMNames[] = { SOUND_LIST_BGM @@ -3384,15 +3384,15 @@ SOUND_LIST_BGM #undef X // Create SE list -#define X(songId, name) static const u8 sSEName_##songId[] = _(name); +#define X(songId) static const u8 sSEName_##songId[] = _(#songId); SOUND_LIST_SE #undef X -#define X(songId, name) sSEName_##songId, +#define X(songId) sSEName_##songId, static const u8 *const gSENames[] = { SOUND_LIST_SE }; #undef X -#endif +#endif //DEBUG_SYSTEM_ENABLE == TRUE From a462db5e69a47763ac40798a04b132c28c5be89a Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Fri, 9 Sep 2022 23:34:05 -0400 Subject: [PATCH 15/27] Automated creation of MAP_GROUP_COUNT for the debug menu --- src/data/map_group_count.h | 1 + src/debug.c | 5 +---- tools/mapjson/mapjson.cpp | 16 +++++++++------- 3 files changed, 11 insertions(+), 11 deletions(-) create mode 100644 src/data/map_group_count.h diff --git a/src/data/map_group_count.h b/src/data/map_group_count.h new file mode 100644 index 000000000..4fe8a21b3 --- /dev/null +++ b/src/data/map_group_count.h @@ -0,0 +1 @@ +static const u8 MAP_GROUP_COUNT[] = {57, 5, 5, 6, 7, 8, 9, 7, 7, 14, 8, 17, 10, 23, 13, 15, 15, 2, 2, 2, 3, 1, 1, 1, 108, 61, 89, 2, 1, 13, 1, 1, 3, 1, 0}; diff --git a/src/debug.c b/src/debug.c index 4cc1ac616..e5a2d851a 100644 --- a/src/debug.c +++ b/src/debug.c @@ -282,10 +282,7 @@ extern u8 Debug_CheatStart[]; extern u8 PlayersHouse_2F_EventScript_SetWallClock[]; extern u8 PlayersHouse_2F_EventScript_CheckWallClock[]; - -// ******************************* -//Maps per map group COPY FROM /include/constants/map_groups.h -static const u8 MAP_GROUP_COUNT[] = {57, 5, 5, 6, 7, 8, 9, 7, 7, 14, 8, 17, 10, 23, 13, 15, 15, 2, 2, 2, 3, 1, 1, 1, 108, 61, 89, 2, 1, 13, 1, 1, 3, 1, 0}; +#include "data/map_group_count.h" // Text // Main Menu diff --git a/tools/mapjson/mapjson.cpp b/tools/mapjson/mapjson.cpp index 8de9ff8d0..4694bfaca 100644 --- a/tools/mapjson/mapjson.cpp +++ b/tools/mapjson/mapjson.cpp @@ -386,6 +386,7 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) { char dir_separator = file_dir.back(); ostringstream text; + ostringstream mapCountText; text << "#ifndef GUARD_CONSTANTS_MAP_GROUPS_H\n" << "#define GUARD_CONSTANTS_MAP_GROUPS_H\n\n"; @@ -424,15 +425,16 @@ string generate_map_constants_text(string groups_filepath, Json groups_data) { } text << "#define MAP_GROUPS_COUNT " << group_num << "\n\n"; - - text << "// static const u8 MAP_GROUP_COUNT[] = {"; //DEBUG - for(int i=0; i Date: Sun, 11 Sep 2022 18:06:05 +0200 Subject: [PATCH 16/27] Fix Lure prices MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This change reflects the original prices used in Pokémon let's go pikachu/eevee --- src/data/items.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/data/items.h b/src/data/items.h index 6649fb24b..b0b53c31f 100644 --- a/src/data/items.h +++ b/src/data/items.h @@ -1560,7 +1560,7 @@ const struct Item gItems[] = { .name = _("Lure"), .itemId = ITEM_LURE, - .price = 350, + .price = 400, .holdEffectParam = 100, .description = sLureDesc, .pocket = POCKET_ITEMS, @@ -1574,7 +1574,7 @@ const struct Item gItems[] = { .name = _("Super Lure"), .itemId = ITEM_SUPER_LURE, - .price = 500, + .price = 700, .holdEffectParam = 200, .description = sSuperLureDesc, .pocket = POCKET_ITEMS, @@ -1588,7 +1588,7 @@ const struct Item gItems[] = { .name = _("Max Lure"), .itemId = ITEM_MAX_LURE, - .price = 700, + .price = 900, .holdEffectParam = 250, .description = sMaxLureDesc, .pocket = POCKET_ITEMS, From 69f01d73cd7da3d99e1dd6388ba3b4487d19ca72 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada Date: Sun, 11 Sep 2022 12:41:56 -0400 Subject: [PATCH 17/27] Added missing uses of Fairy type for Union Room and Battle Factory --- .../scripts.inc | 9 +++++++++ src/data/union_room.h | 1 + 2 files changed, 10 insertions(+) diff --git a/data/maps/BattleFrontier_BattleFactoryPreBattleRoom/scripts.inc b/data/maps/BattleFrontier_BattleFactoryPreBattleRoom/scripts.inc index d54cf8357..3167b17d8 100644 --- a/data/maps/BattleFrontier_BattleFactoryPreBattleRoom/scripts.inc +++ b/data/maps/BattleFrontier_BattleFactoryPreBattleRoom/scripts.inc @@ -225,6 +225,7 @@ BattleFrontier_BattleFactoryPreBattleRoom_EventScript_CommentOnOpponentType:: call_if_eq VAR_0x8005, TYPE_ICE, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesIce call_if_eq VAR_0x8005, TYPE_DRAGON, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesDragon call_if_eq VAR_0x8005, TYPE_DARK, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesDark + call_if_eq VAR_0x8005, TYPE_FAIRY, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesFairy call_if_eq VAR_0x8005, NUMBER_OF_MON_TYPES, BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentHasNoMostCommonType return @@ -296,6 +297,10 @@ BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesDark:: msgbox BattleFrontier_BattleFactoryPreBattleRoom_Text_TrainerSkilledInDarkType, MSGBOX_DEFAULT return +BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentUsesFairy:: + msgbox BattleFrontier_BattleFactoryPreBattleRoom_Text_TrainerSkilledInFairyType, MSGBOX_DEFAULT + return + BattleFrontier_BattleFactoryPreBattleRoom_EventScript_OpponentHasNoMostCommonType:: msgbox BattleFrontier_BattleFactoryPreBattleRoom_Text_TrainerHasNoClearFavorite, MSGBOX_DEFAULT return @@ -559,6 +564,10 @@ BattleFrontier_BattleFactoryPreBattleRoom_Text_TrainerSkilledInDarkType: .string "The TRAINER is apparently skilled\n" .string "in the handling of the DARK type.$" +BattleFrontier_BattleFactoryPreBattleRoom_Text_TrainerSkilledInFairyType: + .string "The TRAINER is apparently skilled\n" + .string "in the handling of the FAIRY type.$" + BattleFrontier_BattleFactoryPreBattleRoom_Text_TrainerSkilledInSteelType: .string "The TRAINER is apparently skilled\n" .string "in the handling of the STEEL type.$" diff --git a/src/data/union_room.h b/src/data/union_room.h index cf4b12b5d..07f8e4899 100644 --- a/src/data/union_room.h +++ b/src/data/union_room.h @@ -885,6 +885,7 @@ static const struct ListMenuItem sTradingBoardTypes[NUMBER_OF_MON_TYPES] = { { gTypeNames[TYPE_DRAGON], TYPE_DRAGON }, { gTypeNames[TYPE_STEEL], TYPE_STEEL }, { gTypeNames[TYPE_DARK], TYPE_DARK }, + { gTypeNames[TYPE_FAIRY], TYPE_FAIRY }, { sText_Exit, NUMBER_OF_MON_TYPES } }; From e624f205ba26a05ba93c98df57a3a1f07fd6febe Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sun, 11 Sep 2022 21:46:40 -0300 Subject: [PATCH 18/27] Added CompareStat checks for the hero duo's abilities --- src/battle_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index 4b18fafb6..f20c4c504 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -4744,7 +4744,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move } break; case ABILITY_INTREPID_SWORD: - if (!gSpecialStatuses[battler].switchInAbilityDone) + if (!gSpecialStatuses[battler].switchInAbilityDone && CompareStat(battler, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN)) { gSpecialStatuses[battler].switchInAbilityDone = TRUE; SET_STATCHANGER(STAT_ATK, 1, FALSE); @@ -4753,7 +4753,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move } break; case ABILITY_DAUNTLESS_SHIELD: - if (!gSpecialStatuses[battler].switchInAbilityDone) + if (!gSpecialStatuses[battler].switchInAbilityDone && CompareStat(battler, STAT_DEF, MAX_STAT_STAGE, CMP_LESS_THAN)) { gSpecialStatuses[battler].switchInAbilityDone = TRUE; SET_STATCHANGER(STAT_DEF, 1, FALSE); From 717d06bd17d1f8e252273600d9a4bf853b8ddcec Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sun, 11 Sep 2022 21:57:42 -0300 Subject: [PATCH 19/27] Fixed the hero duo's abilities in doubles --- src/battle_util.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/battle_util.c b/src/battle_util.c index f20c4c504..64c2e7557 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -4746,6 +4746,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move case ABILITY_INTREPID_SWORD: if (!gSpecialStatuses[battler].switchInAbilityDone && CompareStat(battler, STAT_ATK, MAX_STAT_STAGE, CMP_LESS_THAN)) { + gBattlerAttacker = battler; gSpecialStatuses[battler].switchInAbilityDone = TRUE; SET_STATCHANGER(STAT_ATK, 1, FALSE); BattleScriptPushCursorAndCallback(BattleScript_BattlerAbilityStatRaiseOnSwitchIn); @@ -4755,6 +4756,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move case ABILITY_DAUNTLESS_SHIELD: if (!gSpecialStatuses[battler].switchInAbilityDone && CompareStat(battler, STAT_DEF, MAX_STAT_STAGE, CMP_LESS_THAN)) { + gBattlerAttacker = battler; gSpecialStatuses[battler].switchInAbilityDone = TRUE; SET_STATCHANGER(STAT_DEF, 1, FALSE); BattleScriptPushCursorAndCallback(BattleScript_BattlerAbilityStatRaiseOnSwitchIn); From fc65a483aa1f407d86dbf990bd48f9ac5a95fd19 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sun, 11 Sep 2022 22:34:24 -0300 Subject: [PATCH 20/27] Fixed ability pop ups --- src/battle_interface.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/battle_interface.c b/src/battle_interface.c index 5be969105..ebd7a3ab3 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -3123,9 +3123,6 @@ void CreateAbilityPopUp(u8 battlerId, u32 ability, bool32 isDoubleBattle) const s16 (*coords)[2]; u8 spriteId1, spriteId2, battlerPosition, taskId; - - return; - if (gBattleScripting.abilityPopupOverwrite != 0) ability = gBattleScripting.abilityPopupOverwrite; From 806106b537cc84f45c6ca97b5253cd7a8a9a77e3 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Mon, 12 Sep 2022 12:12:26 +0200 Subject: [PATCH 21/27] removed flickering in debug menu @Jaizu --- src/debug.c | 61 +++++++++++++++++++++++++++++------------------------ 1 file changed, 34 insertions(+), 27 deletions(-) diff --git a/src/debug.c b/src/debug.c index 4cc1ac616..ac5c23831 100644 --- a/src/debug.c +++ b/src/debug.c @@ -175,6 +175,7 @@ struct DebugMonData static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMtemplate); void Debug_ShowMainMenu(void); static void Debug_DestroyMenu(u8); +static void Debug_DestroyMenu_Full(u8); static void DebugAction_Cancel(u8); static void DebugAction_DestroyExtraWindow(u8 taskId); @@ -697,6 +698,12 @@ static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMte gTasks[inputTaskId].data[1] = windowId; } static void Debug_DestroyMenu(u8 taskId) +{ + DestroyListMenuTask(gTasks[taskId].data[0], NULL, NULL); + RemoveWindow(gTasks[taskId].data[1]); + DestroyTask(taskId); +} +static void Debug_DestroyMenu_Full(u8 taskId) { DestroyListMenuTask(gTasks[taskId].data[0], NULL, NULL); ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE); @@ -705,7 +712,7 @@ static void Debug_DestroyMenu(u8 taskId) } static void DebugAction_Cancel(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); ScriptContext_Enable(); } static void DebugAction_DestroyExtraWindow(u8 taskId) @@ -737,7 +744,7 @@ static void DebugTask_HandleMenuInput_Main(u8 taskId) else if (gMain.newKeys & B_BUTTON) { PlaySE(SE_SELECT); - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); ScriptContext_Enable(); } } @@ -891,7 +898,7 @@ static void DebugAction_Util_HealParty(u8 taskId) PlaySE(SE_USE_ITEM); HealPlayerParty(); ScriptContext_Enable(); - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); } static void DebugAction_Util_Fly(u8 taskId) { @@ -913,7 +920,7 @@ static void DebugAction_Util_Fly(u8 taskId) FlagSet(FLAG_VISITED_EVER_GRANDE_CITY); FlagSet(FLAG_LANDMARK_POKEMON_LEAGUE); FlagSet(FLAG_LANDMARK_BATTLE_FRONTIER); - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); SetMainCallback2(CB2_OpenFlyMap); } @@ -1141,26 +1148,26 @@ static void DebugAction_Util_CheckSaveBlock(u8 taskId) ConvertIntToDecimalStringN(gStringVar3, sizeof(struct PokemonStorage), STR_CONV_MODE_LEFT_ALIGN, 6); StringExpandPlaceholders(gStringVar4, gDebugText_SaveBlockSize); - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_ShowFieldMessageStringVar4); } static void DebugAction_Util_CheckWallClock(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(PlayersHouse_2F_EventScript_CheckWallClock); } static void DebugAction_Util_SetWallClock(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(PlayersHouse_2F_EventScript_SetWallClock); } static void DebugAction_Util_WatchCredits(u8 taskId) { struct Task* task = &gTasks[taskId]; - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); SetMainCallback2(CB2_StartCreditsSequence); } static void DebugAction_Util_Trainer_Name(u8 taskId) @@ -1174,14 +1181,14 @@ static void DebugAction_Util_Trainer_Gender(u8 taskId) gSaveBlock2Ptr->playerGender = 1; else gSaveBlock2Ptr->playerGender = 0; + Debug_DestroyMenu_Full(taskId); ScriptContext_Enable(); - Debug_DestroyMenu(taskId); } static void DebugAction_Util_Trainer_Id(u8 taskId) { u32 trainerId = ((Random() << 16) | Random()); SetTrainerId(trainerId, gSaveBlock2Ptr->playerTrainerId); - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); ScriptContext_Enable(); } @@ -1189,49 +1196,49 @@ static void DebugAction_Util_Trainer_Id(u8 taskId) // Actions Scripts static void DebugAction_Util_Script_1(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_Script_1); } static void DebugAction_Util_Script_2(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_Script_2); } static void DebugAction_Util_Script_3(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_Script_3); } static void DebugAction_Util_Script_4(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_Script_4); } static void DebugAction_Util_Script_5(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_Script_5); } static void DebugAction_Util_Script_6(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_Script_6); } static void DebugAction_Util_Script_7(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_Script_7); } static void DebugAction_Util_Script_8(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_Script_8); } @@ -1338,7 +1345,7 @@ static void DebugAction_Flags_SetPokedexFlags(u8 taskId) GetSetPokedexFlag(i + 1, FLAG_SET_CAUGHT); GetSetPokedexFlag(i + 1, FLAG_SET_SEEN); } - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); ScriptContext_Enable(); } static void DebugAction_Flags_SwitchDex(u8 taskId) @@ -1426,7 +1433,7 @@ static void DebugAction_Flags_ToggleFrontierPass(u8 taskId) static void DebugAction_Flags_CollisionOnOff(u8 taskId) { #if DEBUG_FLAG_NO_COLLISION == 0 - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_FlagsNotSetMessage); #else @@ -1440,7 +1447,7 @@ static void DebugAction_Flags_CollisionOnOff(u8 taskId) static void DebugAction_Flags_EncounterOnOff(u8 taskId) { #if OW_FLAG_NO_ENCOUNTER == 0 - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_FlagsNotSetMessage); #else @@ -1454,7 +1461,7 @@ static void DebugAction_Flags_EncounterOnOff(u8 taskId) static void DebugAction_Flags_TrainerSeeOnOff(u8 taskId) { #if OW_FLAG_NO_TRAINER_SEE == 0 - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_FlagsNotSetMessage); #else @@ -1468,7 +1475,7 @@ static void DebugAction_Flags_TrainerSeeOnOff(u8 taskId) static void DebugAction_Flags_BagUseOnOff(u8 taskId) { #if B_FLAG_NO_BAG_USE == 0 - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_FlagsNotSetMessage); #else @@ -1482,7 +1489,7 @@ static void DebugAction_Flags_BagUseOnOff(u8 taskId) static void DebugAction_Flags_CatchingOnOff(u8 taskId) { #if B_FLAG_NO_CATCHING_USE == 0 - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_FlagsNotSetMessage); #else @@ -1841,7 +1848,7 @@ static void DebugAction_Give_AllTMs(u8 taskId) if (ItemIdToBattleMoveId(i) != MOVE_NONE && !CheckBagHasItem(i, 1)) AddBagItem(i, 1); } - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); ScriptContext_Enable(); } @@ -2656,7 +2663,7 @@ static void DebugAction_Give_FillPC(u8 taskId) //Credit: Sierraffinity static void DebugAction_Give_CHEAT(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_CheatStart); } @@ -2673,7 +2680,7 @@ static void Task_WaitFadeAccessPC(u8 taskId) static void DebugAction_AccessPC(u8 taskId) { - Debug_DestroyMenu(taskId); + Debug_DestroyMenu_Full(taskId); CleanupOverworldWindowsAndTilemaps(); BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 16, RGB_BLACK); CreateTask(Task_WaitFadeAccessPC, 0); From 96d190f5ad3e36a6fdebb28a0316b40c55d22732 Mon Sep 17 00:00:00 2001 From: Ct11217 Date: Mon, 12 Sep 2022 20:39:21 -0600 Subject: [PATCH 22/27] Updated Toxic Status Counter --- src/battle_ai_switch_items.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index f72459e8d..184cea1c6 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -337,7 +337,7 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) { //Toxic moduloChance = 2; //50% - if (gBattleMons[gActiveBattler].status1 & (STATUS1_TOXIC_COUNTER > 2) + if (((gBattleMons[gActiveBattler].status1 & STATUS1_TOXIC_COUNTER) >= STATUS1_TOXIC_TURN(2)) && gBattleMons[gActiveBattler].hp >= (gBattleMons[gActiveBattler].maxHP / 3) && (Random() % (moduloChance*chanceReducer)) == 0) switchMon = TRUE; From 2c205140357062d1d1d1c0ec6bb34493cb4255e9 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Wed, 14 Sep 2022 13:39:35 +0200 Subject: [PATCH 23/27] improved debug menu function declaration consistency --- src/debug.c | 62 ++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/src/debug.c b/src/debug.c index ac5c23831..e40ed4afe 100644 --- a/src/debug.c +++ b/src/debug.c @@ -174,33 +174,33 @@ struct DebugMonData // Define functions static void Debug_ShowMenu(void (*HandleInput)(u8), struct ListMenuTemplate LMtemplate); void Debug_ShowMainMenu(void); -static void Debug_DestroyMenu(u8); -static void Debug_DestroyMenu_Full(u8); -static void DebugAction_Cancel(u8); +static void Debug_DestroyMenu(u8 taskId); +static void Debug_DestroyMenu_Full(u8 taskId); +static void DebugAction_Cancel(u8 taskId); static void DebugAction_DestroyExtraWindow(u8 taskId); -static void DebugAction_Util_Script_1(u8); -static void DebugAction_Util_Script_2(u8); -static void DebugAction_Util_Script_3(u8); -static void DebugAction_Util_Script_4(u8); -static void DebugAction_Util_Script_5(u8); -static void DebugAction_Util_Script_6(u8); -static void DebugAction_Util_Script_7(u8); -static void DebugAction_Util_Script_8(u8); +static void DebugAction_Util_Script_1(u8 taskId); +static void DebugAction_Util_Script_2(u8 taskId); +static void DebugAction_Util_Script_3(u8 taskId); +static void DebugAction_Util_Script_4(u8 taskId); +static void DebugAction_Util_Script_5(u8 taskId); +static void DebugAction_Util_Script_6(u8 taskId); +static void DebugAction_Util_Script_7(u8 taskId); +static void DebugAction_Util_Script_8(u8 taskId); -static void DebugAction_OpenUtilitiesMenu(u8); -static void DebugAction_OpenScriptsMenu(u8); -static void DebugAction_OpenFlagsMenu(u8); -static void DebugAction_OpenVariablesMenu(u8); -static void DebugAction_OpenGiveMenu(u8); -static void DebugAction_OpenSoundMenu(u8); -static void DebugTask_HandleMenuInput_Main(u8); -static void DebugTask_HandleMenuInput_Utilities(u8); -static void DebugTask_HandleMenuInput_Scripts(u8); -static void DebugTask_HandleMenuInput_Flags(u8); -static void DebugTask_HandleMenuInput_Vars(u8); -static void DebugTask_HandleMenuInput_Give(u8); -static void DebugTask_HandleMenuInput_Sound(u8); +static void DebugAction_OpenUtilitiesMenu(u8 taskId); +static void DebugAction_OpenScriptsMenu(u8 taskId); +static void DebugAction_OpenFlagsMenu(u8 taskId); +static void DebugAction_OpenVariablesMenu(u8 taskId); +static void DebugAction_OpenGiveMenu(u8 taskId); +static void DebugAction_OpenSoundMenu(u8 taskId); +static void DebugTask_HandleMenuInput_Main(u8 taskId); +static void DebugTask_HandleMenuInput_Utilities(u8 taskId); +static void DebugTask_HandleMenuInput_Scripts(u8 taskId); +static void DebugTask_HandleMenuInput_Flags(u8 taskId); +static void DebugTask_HandleMenuInput_Vars(u8 taskId); +static void DebugTask_HandleMenuInput_Give(u8 taskId); +static void DebugTask_HandleMenuInput_Sound(u8 taskId); static void DebugAction_Util_HealParty(u8 taskId); static void DebugAction_Util_Fly(u8 taskId); @@ -210,13 +210,13 @@ static void DebugAction_Util_Warp_SelectMap(u8 taskId); static void DebugAction_Util_Warp_SelectWarp(u8 taskId); static void DebugAction_Util_RunningShoes(u8 taskId); static void DebugAction_Util_PoisonMons(u8 taskId); -static void DebugAction_Util_CheckSaveBlock(u8); -static void DebugAction_Util_CheckWallClock(u8); -static void DebugAction_Util_SetWallClock(u8); -static void DebugAction_Util_WatchCredits(u8); -static void DebugAction_Util_Trainer_Name(u8); -static void DebugAction_Util_Trainer_Gender(u8); -static void DebugAction_Util_Trainer_Id(u8); +static void DebugAction_Util_CheckSaveBlock(u8 taskId); +static void DebugAction_Util_CheckWallClock(u8 taskId); +static void DebugAction_Util_SetWallClock(u8 taskId); +static void DebugAction_Util_WatchCredits(u8 taskId); +static void DebugAction_Util_Trainer_Name(u8 taskId); +static void DebugAction_Util_Trainer_Gender(u8 taskId); +static void DebugAction_Util_Trainer_Id(u8 taskId); static void DebugAction_Flags_Flags(u8 taskId); static void DebugAction_Flags_FlagsSelect(u8 taskId); From 1e03b4747fa259d735dd958f6ea3b1dd7097f822 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Wed, 14 Sep 2022 13:43:26 +0200 Subject: [PATCH 24/27] debug menu: object events now frozen while open --- src/debug.c | 2 ++ src/field_control_avatar.c | 1 + src/start_menu.c | 1 + 3 files changed, 4 insertions(+) diff --git a/src/debug.c b/src/debug.c index e40ed4afe..38da0696f 100644 --- a/src/debug.c +++ b/src/debug.c @@ -709,6 +709,7 @@ static void Debug_DestroyMenu_Full(u8 taskId) ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE); RemoveWindow(gTasks[taskId].data[1]); DestroyTask(taskId); + UnfreezeObjectEvents(); } static void DebugAction_Cancel(u8 taskId) { @@ -725,6 +726,7 @@ static void DebugAction_DestroyExtraWindow(u8 taskId) DestroyTask(taskId); ScriptContext_Enable(); + UnfreezeObjectEvents(); } diff --git a/src/field_control_avatar.c b/src/field_control_avatar.c index d407cc027..c325b63e5 100644 --- a/src/field_control_avatar.c +++ b/src/field_control_avatar.c @@ -201,6 +201,7 @@ int ProcessPlayerFieldInput(struct FieldInput *input) if (input->input_field_1_2) { PlaySE(SE_WIN_OPEN); + FreezeObjectEvents(); Debug_ShowMainMenu(); return TRUE; } diff --git a/src/start_menu.c b/src/start_menu.c index a0cff087c..388b2ce35 100644 --- a/src/start_menu.c +++ b/src/start_menu.c @@ -761,6 +761,7 @@ static bool8 StartMenuDebugCallback(void) HideStartMenuDebug(); // Hide start menu without enabling movement #if DEBUG_SYSTEM_ENABLE == TRUE + FreezeObjectEvents(); Debug_ShowMainMenu(); #endif From ef4e64c2f7d00053a16cc06672762ba8875c4aa1 Mon Sep 17 00:00:00 2001 From: TheXaman <48356183+TheXaman@users.noreply.github.com> Date: Wed, 14 Sep 2022 14:51:03 +0200 Subject: [PATCH 25/27] -added a submenu to set the weather -lowest flag is 1 --- src/debug.c | 171 +++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 148 insertions(+), 23 deletions(-) diff --git a/src/debug.c b/src/debug.c index 38da0696f..464835d3d 100644 --- a/src/debug.c +++ b/src/debug.c @@ -18,6 +18,7 @@ #include "event_scripts.h" #include "field_message_box.h" #include "field_screen_effect.h" +#include "field_weather.h" #include "international_string_util.h" #include "item.h" #include "item_icon.h" @@ -55,6 +56,7 @@ #include "constants/rgb.h" #include "constants/songs.h" #include "constants/species.h" +#include "constants/weather.h" #if DEBUG_SYSTEM_ENABLE == TRUE // ******************************* @@ -76,6 +78,7 @@ enum { // Util DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES, DEBUG_UTIL_MENU_ITEM_POISON_MONS, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK, + DEBUG_UTIL_MENU_ITEM_WEATHER, DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK, DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK, DEBUG_UTIL_MENU_ITEM_WATCHCREDITS, @@ -135,6 +138,8 @@ enum { //Sound #define DEBUG_NUMBER_DISPLAY_WIDTH 10 #define DEBUG_NUMBER_DISPLAY_HEIGHT 4 +#define DEBUG_NUMBER_DISPLAY_MEDIUM_WIDTH 15 +#define DEBUG_NUMBER_DISPLAY_MEDIUM_HEIGHT 3 #define DEBUG_NUMBER_DISPLAY_SOUND_WIDTH 20 #define DEBUG_NUMBER_DISPLAY_SOUND_HEIGHT 6 @@ -211,6 +216,8 @@ static void DebugAction_Util_Warp_SelectWarp(u8 taskId); static void DebugAction_Util_RunningShoes(u8 taskId); static void DebugAction_Util_PoisonMons(u8 taskId); static void DebugAction_Util_CheckSaveBlock(u8 taskId); +static void DebugAction_Util_Weather(u8 taskId); +static void DebugAction_Util_Weather_SelectId(u8 taskId); static void DebugAction_Util_CheckWallClock(u8 taskId); static void DebugAction_Util_SetWallClock(u8 taskId); static void DebugAction_Util_WatchCredits(u8 taskId); @@ -317,6 +324,8 @@ static const u8 gDebugText_Util_WarpToMap_SelMax[] = _("{STR_VAR_1} / {S static const u8 gDebugText_Util_RunningShoes[] = _("Toggle Running Shoes"); static const u8 gDebugText_Util_PoisonMons[] = _("Poison all mons"); static const u8 gDebugText_Util_SaveBlockSpace[] = _("SaveBlock Space"); +static const u8 gDebugText_Util_Weather[] = _("Set weather"); +static const u8 gDebugText_Util_Weather_ID[] = _("Weather Id: {STR_VAR_3}\n{STR_VAR_1}\n{STR_VAR_2}"); static const u8 gDebugText_Util_CheckWallClock[] = _("Check Wall Clock"); static const u8 gDebugText_Util_SetWallClock[] = _("Set Wall Clock"); static const u8 gDebugText_Util_WatchCredits[] = _("Watch Credits"); @@ -437,6 +446,7 @@ static const struct ListMenuItem sDebugMenu_Items_Utilities[] = [DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES] = {gDebugText_Util_RunningShoes, DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES}, [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = {gDebugText_Util_PoisonMons, DEBUG_UTIL_MENU_ITEM_POISON_MONS}, [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = {gDebugText_Util_SaveBlockSpace, DEBUG_UTIL_MENU_ITEM_SAVEBLOCK}, + [DEBUG_UTIL_MENU_ITEM_WEATHER] = {gDebugText_Util_Weather, DEBUG_UTIL_MENU_ITEM_WEATHER}, [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = {gDebugText_Util_CheckWallClock, DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK}, [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = {gDebugText_Util_SetWallClock, DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK}, [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = {gDebugText_Util_WatchCredits, DEBUG_UTIL_MENU_ITEM_WATCHCREDITS}, @@ -515,6 +525,7 @@ static void (*const sDebugMenu_Actions_Utilities[])(u8) = [DEBUG_UTIL_MENU_ITEM_RUNNING_SHOES] = DebugAction_Util_RunningShoes, [DEBUG_UTIL_MENU_ITEM_POISON_MONS] = DebugAction_Util_PoisonMons, [DEBUG_UTIL_MENU_ITEM_SAVEBLOCK] = DebugAction_Util_CheckSaveBlock, + [DEBUG_UTIL_MENU_ITEM_WEATHER] = DebugAction_Util_Weather, [DEBUG_UTIL_MENU_ITEM_CHECKWALLCLOCK] = DebugAction_Util_CheckWallClock, [DEBUG_UTIL_MENU_ITEM_SETWALLCLOCK] = DebugAction_Util_SetWallClock, [DEBUG_UTIL_MENU_ITEM_WATCHCREDITS] = DebugAction_Util_WatchCredits, @@ -595,6 +606,16 @@ static const struct WindowTemplate sDebugNumberDisplayWindowTemplate = .paletteNum = 15, .baseBlock = 1, }; +static const struct WindowTemplate sDebugNumberDisplayMediumWindowTemplate = +{ + .bg = 0, + .tilemapLeft = 30 - DEBUG_NUMBER_DISPLAY_MEDIUM_WIDTH - 1, + .tilemapTop = 1, + .width = DEBUG_NUMBER_DISPLAY_MEDIUM_WIDTH, + .height = 2 * DEBUG_NUMBER_DISPLAY_MEDIUM_HEIGHT, + .paletteNum = 15, + .baseBlock = 1, +}; static const struct WindowTemplate sDebugNumberDisplayLargeWindowTemplate = { .bg = 0, @@ -1023,23 +1044,23 @@ static void DebugAction_Util_Warp_SelectMap(u8 taskId) if (gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] > max_value - 1) + if (gTasks[taskId].data[3] > max_value - 1) gTasks[taskId].data[3] = max_value - 1; } - if(gMain.newKeys & DPAD_DOWN) + if (gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[3] < 0) gTasks[taskId].data[3] = 0; } - if(gMain.newKeys & DPAD_LEFT) + if (gMain.newKeys & DPAD_LEFT) { if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } if (gMain.newKeys & DPAD_RIGHT) { - if(gTasks[taskId].data[4] < 2) + if (gTasks[taskId].data[4] < 2) gTasks[taskId].data[4] += 1; } @@ -1075,16 +1096,16 @@ static void DebugAction_Util_Warp_SelectWarp(u8 taskId) if (gMain.newKeys & DPAD_ANY) { PlaySE(SE_SELECT); - if(gMain.newKeys & DPAD_UP) + if (gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] > 10) + if (gTasks[taskId].data[3] > 10) gTasks[taskId].data[3] = 10; } - if(gMain.newKeys & DPAD_DOWN) + if (gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] < 0) + if (gTasks[taskId].data[3] < 0) gTasks[taskId].data[3] = 0; } @@ -1154,6 +1175,110 @@ static void DebugAction_Util_CheckSaveBlock(u8 taskId) LockPlayerFieldControls(); ScriptContext_SetupScript(Debug_ShowFieldMessageStringVar4); } + +static const u8 sWeatherNames[22][24] = { + [WEATHER_NONE] = _("NONE"), + [WEATHER_SUNNY_CLOUDS] = _("SUNNY CLOUDS"), + [WEATHER_SUNNY] = _("SUNNY"), + [WEATHER_RAIN] = _("RAIN"), + [WEATHER_SNOW] = _("SNOW"), + [WEATHER_RAIN_THUNDERSTORM] = _("RAIN THUNDERSTORM"), + [WEATHER_FOG_HORIZONTAL] = _("FOG HORIZONTAL"), + [WEATHER_VOLCANIC_ASH] = _("VOLCANIC ASH"), + [WEATHER_SANDSTORM] = _("SANDSTORM"), + [WEATHER_FOG_DIAGONAL] = _("FOG DIAGONAL"), + [WEATHER_UNDERWATER] = _("UNDERWATER"), + [WEATHER_SHADE] = _("SHADE"), + [WEATHER_DROUGHT] = _("DROUGHT"), + [WEATHER_DOWNPOUR] = _("DOWNPOUR"), + [WEATHER_UNDERWATER_BUBBLES] = _("UNDERWATER BUBBLES"), + [WEATHER_ABNORMAL] = _("ABNORMAL(NOT WORKING)"), + [WEATHER_ROUTE119_CYCLE] = _("ROUTE119 CYCLE"), + [WEATHER_ROUTE123_CYCLE] = _("ROUTE123 CYCLE"), +}; +static const u8 sText_WeatherNotDefined[] = _("NOT DEFINED!!!"); +static void DebugAction_Util_Weather(u8 taskId) +{ + u8 windowId; + + ClearStdWindowAndFrame(gTasks[taskId].data[1], TRUE); + RemoveWindow(gTasks[taskId].data[1]); + + HideMapNamePopUpWindow(); + LoadMessageBoxAndBorderGfx(); + windowId = AddWindow(&sDebugNumberDisplayMediumWindowTemplate); + DrawStdWindowFrame(windowId, FALSE); + + CopyWindowToVram(windowId, 3); + + //Display initial ID + StringCopy(gStringVar2, gText_DigitIndicator[0]); + ConvertIntToDecimalStringN(gStringVar3, 1, STR_CONV_MODE_LEADING_ZEROS, 2); + StringCopyPadded(gStringVar1, sWeatherNames[0], CHAR_SPACE, 30); + StringExpandPlaceholders(gStringVar4, gDebugText_Util_Weather_ID); + AddTextPrinterParameterized(windowId, 1, gStringVar4, 1, 1, 0, NULL); + + gTasks[taskId].func = DebugAction_Util_Weather_SelectId; + gTasks[taskId].data[2] = windowId; + gTasks[taskId].data[3] = 0; //Current ID + gTasks[taskId].data[4] = 0; //Digit Selected +} +static void DebugAction_Util_Weather_SelectId(u8 taskId) +{ + if (gMain.newKeys & DPAD_ANY) + { + PlaySE(SE_SELECT); + + if (gMain.newKeys & DPAD_UP) + { + gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; + if (gTasks[taskId].data[3] > WEATHER_ROUTE123_CYCLE) + gTasks[taskId].data[3] = WEATHER_ROUTE123_CYCLE; + } + if (gMain.newKeys & DPAD_DOWN) + { + gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; + if (gTasks[taskId].data[3] < WEATHER_NONE) + gTasks[taskId].data[3] = WEATHER_NONE; + } + if (gMain.newKeys & DPAD_LEFT) + { + if (gTasks[taskId].data[4] > 0) + gTasks[taskId].data[4] -= 1; + } + if (gMain.newKeys & DPAD_RIGHT) + { + if (gTasks[taskId].data[4] < 2) + gTasks[taskId].data[4] += 1; + } + + StringCopy(gStringVar2, gText_DigitIndicator[gTasks[taskId].data[4]]); + ConvertIntToDecimalStringN(gStringVar3, gTasks[taskId].data[3], STR_CONV_MODE_LEADING_ZEROS, 2); + + if (gTasks[taskId].data[3] <= 15 || gTasks[taskId].data[3] >= 20) + StringCopyPadded(gStringVar1, sWeatherNames[gTasks[taskId].data[3]], CHAR_SPACE, 30); + else + StringCopyPadded(gStringVar1, sText_WeatherNotDefined, CHAR_SPACE, 30); + + StringExpandPlaceholders(gStringVar4, gDebugText_Util_Weather_ID); + AddTextPrinterParameterized(gTasks[taskId].data[2], 1, gStringVar4, 1, 1, 0, NULL); + } + + if (gMain.newKeys & A_BUTTON) + { + if (gTasks[taskId].data[3] <= 14 || gTasks[taskId].data[3] >= 20) + { + gTasks[taskId].data[5] = gTasks[taskId].data[3]; + SetWeather(gTasks[taskId].data[5]); + } + } + else if (gMain.newKeys & B_BUTTON) + { + PlaySE(SE_SELECT); + DebugAction_DestroyExtraWindow(taskId); + } +} + static void DebugAction_Util_CheckWallClock(u8 taskId) { Debug_DestroyMenu_Full(taskId); @@ -1179,7 +1304,7 @@ static void DebugAction_Util_Trainer_Name(u8 taskId) } static void DebugAction_Util_Trainer_Gender(u8 taskId) { - if(gSaveBlock2Ptr->playerGender == 0) // 0 Male, 1 Female + if (gSaveBlock2Ptr->playerGender == 0) // 0 Male, 1 Female gSaveBlock2Ptr->playerGender = 1; else gSaveBlock2Ptr->playerGender = 0; @@ -1262,10 +1387,10 @@ static void DebugAction_Flags_Flags(u8 taskId) CopyWindowToVram(windowId, 3); //Display initial Flag - ConvertIntToDecimalStringN(gStringVar1, 0, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS); - ConvertIntToHexStringN(gStringVar2, 0, STR_CONV_MODE_LEFT_ALIGN, 3); + ConvertIntToDecimalStringN(gStringVar1, 1, STR_CONV_MODE_LEADING_ZEROS, DEBUG_NUMBER_DIGITS_FLAGS); + ConvertIntToHexStringN(gStringVar2, 1, STR_CONV_MODE_LEFT_ALIGN, 3); StringExpandPlaceholders(gStringVar1, gDebugText_Flags_FlagHex); - if (FlagGet(0) == TRUE) + if (FlagGet(FLAG_TEMP_1) == TRUE) StringCopyPadded(gStringVar2, gDebugText_Flags_FlagSet, CHAR_SPACE, 15); else StringCopyPadded(gStringVar2, gDebugText_Flags_FlagUnset, CHAR_SPACE, 15); @@ -1275,8 +1400,8 @@ static void DebugAction_Flags_Flags(u8 taskId) gTasks[taskId].func = DebugAction_Flags_FlagsSelect; gTasks[taskId].data[2] = windowId; - gTasks[taskId].data[3] = 0; //Current Flag - gTasks[taskId].data[4] = 0; //Digit Selected + gTasks[taskId].data[3] = FLAG_TEMP_1; //Current Flag + gTasks[taskId].data[4] = 0; //Digit Selected } static void DebugAction_Flags_FlagsSelect(u8 taskId) { @@ -1301,8 +1426,8 @@ static void DebugAction_Flags_FlagsSelect(u8 taskId) { PlaySE(SE_SELECT); gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; - if (gTasks[taskId].data[3] < 0){ - gTasks[taskId].data[3] = 0; + if (gTasks[taskId].data[3] < 1){ + gTasks[taskId].data[3] = 1; } } if (gMain.newKeys & DPAD_LEFT) @@ -1541,7 +1666,7 @@ static void DebugAction_Vars_Select(u8 taskId) if (gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] > VARS_END) + if (gTasks[taskId].data[3] > VARS_END) gTasks[taskId].data[3] = VARS_END; } if (gMain.newKeys & DPAD_DOWN) @@ -1553,7 +1678,7 @@ static void DebugAction_Vars_Select(u8 taskId) if (gMain.newKeys & DPAD_LEFT) { gTasks[taskId].data[4] -= 1; - if(gTasks[taskId].data[4] < 0) + if (gTasks[taskId].data[4] < 0) gTasks[taskId].data[4] = 0; } if (gMain.newKeys & DPAD_RIGHT) @@ -1613,7 +1738,7 @@ static void DebugAction_Vars_Select(u8 taskId) } static void DebugAction_Vars_SetValue(u8 taskId) { - if(gMain.newKeys & DPAD_UP) + if (gMain.newKeys & DPAD_UP) { if (gTasks[taskId].data[6] + sPowersOfTen[gTasks[taskId].data[4]] <= 32000) gTasks[taskId].data[6] += sPowersOfTen[gTasks[taskId].data[4]]; @@ -1623,7 +1748,7 @@ static void DebugAction_Vars_SetValue(u8 taskId) if (gTasks[taskId].data[6] >= 32000) gTasks[taskId].data[6] = 32000 - 1; } - if(gMain.newKeys & DPAD_DOWN) + if (gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[6] -= sPowersOfTen[gTasks[taskId].data[4]]; if (gTasks[taskId].data[6] < 0){ @@ -1719,7 +1844,7 @@ static void DebugAction_Give_Item_SelectId(u8 taskId) if (gMain.newKeys & DPAD_UP) { gTasks[taskId].data[3] += sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] >= ITEMS_COUNT) + if (gTasks[taskId].data[3] >= ITEMS_COUNT) gTasks[taskId].data[3] = ITEMS_COUNT - 1; } if (gMain.newKeys & DPAD_DOWN) @@ -1730,7 +1855,7 @@ static void DebugAction_Give_Item_SelectId(u8 taskId) } if (gMain.newKeys & DPAD_LEFT) { - if(gTasks[taskId].data[4] > 0) + if (gTasks[taskId].data[4] > 0) gTasks[taskId].data[4] -= 1; } if (gMain.newKeys & DPAD_RIGHT) @@ -2150,7 +2275,7 @@ static void DebugAction_Give_Pokemon_SelectNature(u8 taskId) if (gMain.newKeys & DPAD_DOWN) { gTasks[taskId].data[3] -= sPowersOfTen[gTasks[taskId].data[4]]; - if(gTasks[taskId].data[3] < 0) + if (gTasks[taskId].data[3] < 0) gTasks[taskId].data[3] = 0; } From 20190ac85a7f5b744a799567033459052c151f7f Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Thu, 15 Sep 2022 18:34:15 -0400 Subject: [PATCH 26/27] fix ai switch semi invulnerable --- src/battle_ai_switch_items.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 4948113a2..f6ce4622f 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -370,7 +370,7 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) //Pass Wish Heal //Semi-Invulnerable - if (gStatuses3[opposingBattler] & STATUS3_SEMI_INVULNERABLE) + if (gStatuses3[opposingBattler] & STATUS3_SEMI_INVULNERABLE) { if (FindMonThatAbsorbsOpponentsMove()) //If find absorber default to switch switchMon = TRUE; if (!AI_OpponentCanFaintAiWithMod(0) @@ -380,6 +380,7 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) && !WillAIStrikeFirst() && !AI_OpponentCanFaintAiWithMod(0)) switchMon = FALSE; + } } if (switchMon) From 95a3ead254a27afcc1054418f056a660f95d35bf Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Thu, 15 Sep 2022 22:10:39 -0400 Subject: [PATCH 27/27] styling fix --- src/battle_ai_switch_items.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index f6ce4622f..3c3410e30 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -370,7 +370,8 @@ static bool8 ShouldSwitchIfGameStatePrompt(void) //Pass Wish Heal //Semi-Invulnerable - if (gStatuses3[opposingBattler] & STATUS3_SEMI_INVULNERABLE) { + if (gStatuses3[opposingBattler] & STATUS3_SEMI_INVULNERABLE) + { if (FindMonThatAbsorbsOpponentsMove()) //If find absorber default to switch switchMon = TRUE; if (!AI_OpponentCanFaintAiWithMod(0)