diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index 2259d399c9..6a74e9fbd5 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -1,5 +1,9 @@ + + + + ## Description diff --git a/docs/SUMMARY.md b/docs/SUMMARY.md index cb02bb306e..597534e318 100644 --- a/docs/SUMMARY.md +++ b/docs/SUMMARY.md @@ -19,7 +19,7 @@ - [How to use the Testing System](tutorials/how_to_testing_system.md) - [Changelog](./CHANGELOG.md) - [1.10.x]() - - [Version 1.10.0](changelogs/1.9.x/1.9.4.md) + - [Version 1.10.0](changelogs/1.10.x/1.10.0.md) - [1.9.x]() - [Version 1.9.4](changelogs/1.9.x/1.9.4.md) - [Version 1.9.3](changelogs/1.9.x/1.9.3.md) @@ -67,3 +67,4 @@ - [Version 0.9.0](changelogs/0.9.x/0.9.0.md) - [Team Procedures]() - [How to make an Expansion version](team_procedures/expansion_versions.md) + - [Scope Guidelines](scope.md) diff --git a/docs/changelogs/1.10.0/1.10.0.md b/docs/changelogs/1.10.x/1.10.0.md similarity index 100% rename from docs/changelogs/1.10.0/1.10.0.md rename to docs/changelogs/1.10.x/1.10.0.md diff --git a/docs/scope.md b/docs/scope.md new file mode 100644 index 0000000000..1bec4f2db7 --- /dev/null +++ b/docs/scope.md @@ -0,0 +1,54 @@ +# Document Purpose + +This document is a guide for contributors and Senate to decide if a feature is within "scope" for pokeemerald-expansion. If a feature is not in scope, then it should not be merged. Even if an opened PR is within scope, this does not mean it will be merged, as acceptance criteria will often come down to the details of the implementation. + +# Definitions + +* **Showdown Supported (SS)**: A core series game who's metagame can be played on Showdown. + * Notably, this is every [core series game](https://bulbapedia.bulbagarden.net/wiki/Core_series#List_of_core_series_games) except Pokémon Legends: Arceus. +* **Base Expansion Version**: "A .gba file built from an unmodified `master` or `upcoming` branch of `pokeemerald-expansion`. +* **Vanilla Emerald Version**: A .gba file built from an unmodified `master` branch of pret's `pokeemerald`. + +# Guidelines + +A pull request meets the scope criteria if: +* The feature does not belong to a category considered “not in scope” AND +* The feature belongs to a category considered “in scope” + +## In Scope Categories + +1. **SS Species:** Adds Species that have appeared in a Showdown-supported title +2. **SS Moves:** Adds Moves and Move Animations that have appeared in a Showdown-supported title +3. **SS Abilities:** Adds Abilities that have appeared in a Showdown-supported title +4. **SS Items:** Adds Items that have appeared in a Showdown-supported title +5. **SS Gimmicks:** Adds Gimmicks that have appeared in a Showdown-supported title +6. **SS Battle Types:** Adds Special Battle Types that have appeared in a Showdown-supported title +7. **SS Battle Mechanics:** Adds mechanical battle changes that have appeared in a Showdown-supported title +8. **Improve Battle AI:** Improve the Battle AI in a way that allows it to approach the skill and capability of a human competitive player +9. **Base Link Compatibility:** Link compatibility with base +10. **SS Overworld / Menu Updates:** Replicate overworld or menu changes from Showdown-supported Pokémon titles +11. **Speed Up:** Speed up the player experience of features found in base +12. **Compression:** Automatically compress assets +13. **Novel Experience:** Adds a novel experience included in another Showdown Supported title +15. **Helper Features:** Eases the addition or inclusion of any of the aforementioned + +## Not In Scope Categories + +1. **Non-SS Species**: Adds Species that have NOT appeared in a Showdown-supported title +2. **Non-SS Moves**: Adds Moves and Move Animations that have NOT appeared in a Showdown-supported title +3. **Non-SS Abilities**: Adds Abilities that have NOT appeared in a Showdown-supported title +4. **Non-SS Items**: Adds Items that have NOT appeared in a Showdown-supported title +5. **Non-SS Gimmicks**: Adds Gimmicks that have NOT appeared in a Showdown-supported title +6. **Non-SS Battle Types**: Adds Special Battle Types that have NOT appeared in a Showdown-supported title +7. **Duplicate Feature UI**: Adds functionality that duplicates the core functionality of an existing vanilla feature +8. **Vanilla Link Compatibility**: Link compatibility with vanilla + +## Discussion Required Categories + +Pull Requests that fall into this category should be brought up to maintainers, who will discuss and vote as to whether or not the feature is considered in scope. Considerations for acceptance may include invasiveness of implementation, popularity, ease of maintenance, etc. + +1. **Developer Ease of Use:** Lowers barrier of entry for developers to use existing behavior +2. **Fangame Features:** Adds a popular feature from other fangames +3. **Popular Non-SS Features:** Exceptions can be made for uniquely popular or requested features (Drowsy, PLA Legend Plate, etc.) +4. **External Program**: External programs like poryscript, porymoves, etc. + diff --git a/docs/tutorials/ai_flags.md b/docs/tutorials/ai_flags.md index 7b77305c13..fcad6ed34f 100644 --- a/docs/tutorials/ai_flags.md +++ b/docs/tutorials/ai_flags.md @@ -165,3 +165,6 @@ AI always assumes it will roll the lowest possible result when comparing damage ## `AI_FLAG_SEQUENCE_SWITCHING` AI will always switch out after a KO in exactly party order as defined in the trainer data (ie. slot 1, then 2, then 3, etc.). The AI will never switch out mid-battle unless forced to (Roar etc.). If the AI uses a move that requires a switch where it makes a decision about what to send in (U-Turn etc.), it will always switch out into the lowest available party index. + +## `AI_FLAG_WEIGH_ABILITY_PREDICTION` +AI will predict the player's ability based to its aiRating. Without this flag the AI randomly assumes an ability with an even distribution between all possible abilities until one is confirmed. With this flag, it instead guesses proportionally to each ability's aiRating, making it far more likely to guess an ability like Water Absorb than Damp if both are options. diff --git a/include/battle.h b/include/battle.h index bb65a4b181..fc2d73e62d 100644 --- a/include/battle.h +++ b/include/battle.h @@ -870,9 +870,29 @@ STATIC_ASSERT(sizeof(((struct BattleStruct *)0)->palaceFlags) * 8 >= MAX_BATTLER #define TARGET_TURN_DAMAGED ((gSpecialStatuses[gBattlerTarget].physicalDmg != 0 || gSpecialStatuses[gBattlerTarget].specialDmg != 0) || (gBattleStruct->enduredDamage & (1u << gBattlerTarget))) #define BATTLER_TURN_DAMAGED(battlerId) ((gSpecialStatuses[battlerId].physicalDmg != 0 || gSpecialStatuses[battlerId].specialDmg != 0) || (gBattleStruct->enduredDamage & (1u << battler))) -#define IS_BATTLER_OF_TYPE(battlerId, type)((GetBattlerType(battlerId, 0, FALSE) == type || GetBattlerType(battlerId, 1, FALSE) == type || (GetBattlerType(battlerId, 2, FALSE) != TYPE_MYSTERY && GetBattlerType(battlerId, 2, FALSE) == type))) -#define IS_BATTLER_OF_BASE_TYPE(battlerId, type)((GetBattlerType(battlerId, 0, TRUE) == type || GetBattlerType(battlerId, 1, TRUE) == type || (GetBattlerType(battlerId, 2, TRUE) != TYPE_MYSTERY && GetBattlerType(battlerId, 2, TRUE) == type))) -#define IS_BATTLER_TYPELESS(battlerId)(GetBattlerType(battlerId, 0, FALSE) == TYPE_MYSTERY && GetBattlerType(battlerId, 1, FALSE) == TYPE_MYSTERY && GetBattlerType(battlerId, 2, FALSE) == TYPE_MYSTERY) +/* Checks if 'battlerId' is any of the types. + * Passing multiple types is more efficient than calling this multiple + * times with one type because it shares the 'GetBattlerTypes' result. */ +#define _IS_BATTLER_ANY_TYPE(battlerId, ignoreTera, ...) \ + ({ \ + u32 types[3]; \ + GetBattlerTypes(battlerId, ignoreTera, types); \ + RECURSIVELY(R_FOR_EACH(_IS_BATTLER_ANY_TYPE_HELPER, __VA_ARGS__)) FALSE; \ + }) + +#define _IS_BATTLER_ANY_TYPE_HELPER(type) (types[0] == type) || (types[1] == type) || (types[2] == type) || + +#define IS_BATTLER_ANY_TYPE(battlerId, ...) _IS_BATTLER_ANY_TYPE(battlerId, FALSE, __VA_ARGS__) +#define IS_BATTLER_OF_TYPE IS_BATTLER_ANY_TYPE +#define IS_BATTLER_ANY_BASE_TYPE(battlerId, ...) _IS_BATTLER_ANY_TYPE(battlerId, TRUE, __VA_ARGS__) +#define IS_BATTLER_OF_BASE_TYPE IS_BATTLER_ANY_BASE_TYPE + +#define IS_BATTLER_TYPELESS(battlerId) \ + ({ \ + u32 types[3]; \ + GetBattlerTypes(battlerId, FALSE, types); \ + types[0] == TYPE_MYSTERY && types[1] == TYPE_MYSTERY && types[2] == TYPE_MYSTERY; \ + }) #define SET_BATTLER_TYPE(battlerId, type) \ { \ diff --git a/include/battle_util.h b/include/battle_util.h index 03b7c2029f..14edad6460 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -310,7 +310,8 @@ bool32 AreBattlersOfOppositeGender(u32 battler1, u32 battler2); bool32 AreBattlersOfSameGender(u32 battler1, u32 battler2); u32 CalcSecondaryEffectChance(u32 battler, u32 battlerAbility, const struct AdditionalEffect *additionalEffect); bool32 MoveEffectIsGuaranteed(u32 battler, u32 battlerAbility, const struct AdditionalEffect *additionalEffect); -u8 GetBattlerType(u32 battler, u8 typeIndex, bool32 ignoreTera); +void GetBattlerTypes(u32 battler, bool32 ignoreTera, u32 types[static 3]); +u32 GetBattlerType(u32 battler, u32 typeIndex, bool32 ignoreTera); bool8 CanMonParticipateInSkyBattle(struct Pokemon *mon); bool8 IsMonBannedFromSkyBattles(u16 species); void RemoveBattlerType(u32 battler, u8 type); @@ -318,6 +319,7 @@ u32 GetMoveType(u32 move); void TryActivateSleepClause(u32 battler, u32 indexInParty); void TryDeactivateSleepClause(u32 battlerSide, u32 indexInParty); bool32 IsSleepClauseActiveForSide(u32 battlerSide); +bool32 IsSleepClauseEnabled(); void ClearDamageCalcResults(void); #endif // GUARD_BATTLE_UTIL_H diff --git a/include/config/battle.h b/include/config/battle.h index 43da403010..861e3e3fad 100644 --- a/include/config/battle.h +++ b/include/config/battle.h @@ -256,6 +256,7 @@ #define B_OVERWORLD_FOG GEN_LATEST // In Gen8+, overworld Fog summons Misty Terrain in battle. In Gen4 only, overworld Fog summons the unique fog weather condition in battle. #define B_TOXIC_REVERSAL GEN_LATEST // In Gen5+, bad poison will change to regular poison at the end of battles. #define B_TRY_CATCH_TRAINER_BALL GEN_LATEST // In Gen4+, trying to catch a Trainer's Pokémon does not consume the Poké Ball. +#define B_SLEEP_CLAUSE FALSE // Enables Sleep Clause all the time in every case, overriding B_FLAG_SLEEP_CLAUSE. Use that for modularity. // Animation Settings #define B_NEW_SWORD_PARTICLE FALSE // If set to TRUE, it updates Swords Dance's particle. diff --git a/include/constants/battle_ai.h b/include/constants/battle_ai.h index df6069ead9..ecde1e8668 100644 --- a/include/constants/battle_ai.h +++ b/include/constants/battle_ai.h @@ -26,35 +26,36 @@ // AI Flags. Most run specific functions to update score, new flags are used for internal logic in other scripts // See docs/ai_flags.md for more details. -#define AI_FLAG_CHECK_BAD_MOVE (1 << 0) // AI will avoid using moves that are likely to fail or be ineffective in the current situation. -#define AI_FLAG_TRY_TO_FAINT (1 << 1) // AI will prioritize KOing the player's mon if able. -#define AI_FLAG_CHECK_VIABILITY (1 << 2) // AI damaging moves and move effects to determine the best available move in the current situation. +#define AI_FLAG_CHECK_BAD_MOVE (1 << 0) // AI will avoid using moves that are likely to fail or be ineffective in the current situation. +#define AI_FLAG_TRY_TO_FAINT (1 << 1) // AI will prioritize KOing the player's mon if able. +#define AI_FLAG_CHECK_VIABILITY (1 << 2) // AI damaging moves and move effects to determine the best available move in the current situation. #define AI_FLAG_FORCE_SETUP_FIRST_TURN (1 << 3) // AI will prioritize using setup moves on the first turn at the expensve of all else. AI_FLAG_CHECK_VIABILITY will instead do this when the AI determines it makes sense. -#define AI_FLAG_RISKY (1 << 4) // AI will generally behave more recklessly, prioritizing damage over accuracy, explosions, etc. -#define AI_FLAG_PREFER_STRONGEST_MOVE (1 << 5) // AI adds score bonus to any move the AI has that either OHKOs or 2HKOs the player. -#define AI_FLAG_PREFER_BATON_PASS (1 << 6) // AI prefers raising its own stats and setting for / using Baton Pass. -#define AI_FLAG_DOUBLE_BATTLE (1 << 7) // Automatically set for double battles, handles AI behaviour with partner. -#define AI_FLAG_HP_AWARE (1 << 8) // AI will favour certain move effects based on how much remaining HP it and the player's mon have. -#define AI_FLAG_POWERFUL_STATUS (1 << 9) // AI prefers moves that set up field effects or side statuses, even if the user can faint the target. +#define AI_FLAG_RISKY (1 << 4) // AI will generally behave more recklessly, prioritizing damage over accuracy, explosions, etc. +#define AI_FLAG_PREFER_STRONGEST_MOVE (1 << 5) // AI adds score bonus to any move the AI has that either OHKOs or 2HKOs the player. +#define AI_FLAG_PREFER_BATON_PASS (1 << 6) // AI prefers raising its own stats and setting for / using Baton Pass. +#define AI_FLAG_DOUBLE_BATTLE (1 << 7) // Automatically set for double battles, handles AI behaviour with partner. +#define AI_FLAG_HP_AWARE (1 << 8) // AI will favour certain move effects based on how much remaining HP it and the player's mon have. +#define AI_FLAG_POWERFUL_STATUS (1 << 9) // AI prefers moves that set up field effects or side statuses, even if the user can faint the target. // New, Trainer Handicap Flags -#define AI_FLAG_NEGATE_UNAWARE (1 << 10) // AI is NOT aware of negating effects like wonder room, mold breaker, etc. -#define AI_FLAG_WILL_SUICIDE (1 << 11) // AI will use explosion / self destruct / final gambit / etc. +#define AI_FLAG_NEGATE_UNAWARE (1 << 10) // AI is NOT aware of negating effects like wonder room, mold breaker, etc. +#define AI_FLAG_WILL_SUICIDE (1 << 11) // AI will use explosion / self destruct / final gambit / etc. // New, Trainer Strategy Flags -#define AI_FLAG_PREFER_STATUS_MOVES (1 << 12) // AI gets a score bonus for status moves. Should be combined with AI_FLAG_CHECK_BAD_MOVE to prevent using only status moves. -#define AI_FLAG_STALL (1 << 13) // AI stalls battle and prefers secondary damage/trapping/etc. TODO not finished. -#define AI_FLAG_SMART_SWITCHING (1 << 14) // AI includes a lot more switching checks. Automatically includes AI_FLAG_SMART_MON_CHOICES. -#define AI_FLAG_ACE_POKEMON (1 << 15) // AI has an Ace Pokemon. The last Pokemon in the party will not be used until it's the last one remaining. -#define AI_FLAG_OMNISCIENT (1 << 16) // AI has full knowledge of player moves, abilities, hold items. -#define AI_FLAG_SMART_MON_CHOICES (1 << 17) // AI will make smarter decisions when choosing which mon to send out mid-battle and after a KO, which are separate decisions. Automatically included by AI_FLAG_SMART_SWITCHING. -#define AI_FLAG_CONSERVATIVE (1 << 18) // AI assumes all moves will low roll damage. -#define AI_FLAG_SEQUENCE_SWITCHING (1 << 19) // AI switches in mons in exactly party order, and never switches mid-battle. -#define AI_FLAG_DOUBLE_ACE_POKEMON (1 << 20) // AI has *two* Ace Pokémon. The last two Pokémons in the party won't be used unless they're the last ones remaining. Goes well in battles where the trainer ID equals to twins, couples, etc. +#define AI_FLAG_PREFER_STATUS_MOVES (1 << 12) // AI gets a score bonus for status moves. Should be combined with AI_FLAG_CHECK_BAD_MOVE to prevent using only status moves. +#define AI_FLAG_STALL (1 << 13) // AI stalls battle and prefers secondary damage/trapping/etc. TODO not finished. +#define AI_FLAG_SMART_SWITCHING (1 << 14) // AI includes a lot more switching checks. Automatically includes AI_FLAG_SMART_MON_CHOICES. +#define AI_FLAG_ACE_POKEMON (1 << 15) // AI has an Ace Pokemon. The last Pokemon in the party will not be used until it's the last one remaining. +#define AI_FLAG_OMNISCIENT (1 << 16) // AI has full knowledge of player moves, abilities, hold items. +#define AI_FLAG_SMART_MON_CHOICES (1 << 17) // AI will make smarter decisions when choosing which mon to send out mid-battle and after a KO, which are separate decisions. Automatically included by AI_FLAG_SMART_SWITCHING. +#define AI_FLAG_CONSERVATIVE (1 << 18) // AI assumes all moves will low roll damage. +#define AI_FLAG_SEQUENCE_SWITCHING (1 << 19) // AI switches in mons in exactly party order, and never switches mid-battle. +#define AI_FLAG_DOUBLE_ACE_POKEMON (1 << 20) // AI has *two* Ace Pokémon. The last two Pokémons in the party won't be used unless they're the last ones remaining. Goes well in battles where the trainer ID equals to twins, couples, etc. +#define AI_FLAG_WEIGH_ABILITY_PREDICTION (1 << 21) // AI will predict player's ability based on aiRating -#define AI_FLAG_COUNT 21 +#define AI_FLAG_COUNT 22 // The following options are enough to have a basic/smart trainer. Any other addtion could make the trainer worse/better depending on the flag #define AI_FLAG_BASIC_TRAINER (AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_TRY_TO_FAINT | AI_FLAG_CHECK_VIABILITY) -#define AI_FLAG_SMART_TRAINER (AI_FLAG_BASIC_TRAINER | AI_FLAG_OMNISCIENT | AI_FLAG_SMART_SWITCHING | AI_FLAG_SMART_MON_CHOICES) +#define AI_FLAG_SMART_TRAINER (AI_FLAG_BASIC_TRAINER | AI_FLAG_OMNISCIENT | AI_FLAG_SMART_SWITCHING | AI_FLAG_SMART_MON_CHOICES | AI_FLAG_WEIGH_ABILITY_PREDICTION) // 'other' ai logic flags #define AI_FLAG_DYNAMIC_FUNC (1 << 28) // Create custom AI functions for specific battles via "setdynamicaifunc" cmd diff --git a/include/constants/expansion.h b/include/constants/expansion.h index 6b3a5ace78..1f2af1a226 100644 --- a/include/constants/expansion.h +++ b/include/constants/expansion.h @@ -1,7 +1,7 @@ #ifndef GUARD_CONSTANTS_EXPANSION_H #define GUARD_CONSTANTS_EXPANSION_H -// Last version: 1.10.1 +// Last version: 1.10.0 #define EXPANSION_VERSION_MAJOR 1 #define EXPANSION_VERSION_MINOR 11 #define EXPANSION_VERSION_PATCH 0 diff --git a/include/constants/form_change_types.h b/include/constants/form_change_types.h index 79a8a4cee7..8af9740cad 100644 --- a/include/constants/form_change_types.h +++ b/include/constants/form_change_types.h @@ -134,8 +134,14 @@ // param1: amount of days #define FORM_CHANGE_DAYS_PASSED 23 -// Form change for Aegislash -#define FORM_CHANGE_BATTLE_ATTACK 24 -#define FORM_CHANGE_BATTLE_KINGS_SHIELD 25 +// Form change that activates before using a move. +// param1: move to check +// param2: ability to check, optional +#define FORM_CHANGE_BATTLE_BEFORE_MOVE 24 + +// Form change that activates before using a specific move category. +// param1: move category to check +// param2: ability to check, optional +#define FORM_CHANGE_BATTLE_BEFORE_MOVE_CATEGORY 25 #endif // GUARD_CONSTANTS_FORM_CHANGE_TYPES_H diff --git a/include/random.h b/include/random.h index 2409a1a883..000bc1302c 100644 --- a/include/random.h +++ b/include/random.h @@ -174,6 +174,7 @@ enum RandomTag RNG_AI_SWITCH_SE_DEFENSIVE, RNG_SHELL_SIDE_ARM, RNG_RANDOM_TARGET, + RNG_AI_PREDICT_ABILITY, RNG_HEALER, }; diff --git a/include/strings.h b/include/strings.h index 45bbeb9707..8e1f797079 100644 --- a/include/strings.h +++ b/include/strings.h @@ -177,12 +177,7 @@ extern const u8 gMenuText_Toss[]; extern const u8 gMenuText_Give[]; extern const u8 gMenuText_Give2[]; extern const u8 gMenuText_Register[]; -extern const u8 gMenuText_Check[]; -extern const u8 gMenuText_Walk[]; -extern const u8 gMenuText_Deselect[]; -extern const u8 gMenuText_CheckTag[]; extern const u8 gMenuText_Confirm[]; -extern const u8 gMenuText_Show[]; extern const u8 gMenuText_Give2[]; extern const u8 gText_EggNickname[]; @@ -318,15 +313,10 @@ extern const u8 gText_ThrewAwayVar2Var1s[]; extern const u8 gText_CantWriteMail[]; extern const u8 gText_NoPokemon[]; extern const u8 gText_Var1CantBeHeld[]; -extern const u8 gText_Var1CantBeHeldHere[]; extern const u8 gText_CantBuyKeyItem[]; extern const u8 gText_HowManyToSell[]; extern const u8 gText_ICanPayVar1[]; extern const u8 gText_TurnedOverVar1ForVar2[]; -extern const u8 gText_DepositHowManyVar1[]; -extern const u8 gText_CantStoreImportantItems[]; -extern const u8 gText_DepositedVar2Var1s[]; -extern const u8 gText_NoRoomForItems[]; extern const u8 gText_ThreeDashes[]; extern const u8 *const gPocketNamesStringsTable[]; @@ -450,28 +440,12 @@ extern const u8 gBirchDexRatingText_LessThan190[]; extern const u8 gBirchDexRatingText_LessThan200[]; extern const u8 gBirchDexRatingText_DexCompleted[]; -// player pc text +// player PC text extern const u8 gText_WhatWouldYouLike[]; extern const u8 gText_NoMailHere[]; - -extern const u8 gText_TakeOutItemsFromPC[]; -extern const u8 gText_StoreItemsInPC[]; -extern const u8 gText_ThrowAwayItemsInPC[]; extern const u8 gText_GoBackPrevMenu[]; - -extern const u8 gText_ItemStorage[]; -extern const u8 gText_Mailbox[]; -extern const u8 gText_Decoration[]; -extern const u8 gText_TurnOff[]; - -extern const u8 gText_WithdrawItem[]; -extern const u8 gText_DepositItem[]; -extern const u8 gText_TossItem[]; extern const u8 gText_Cancel[]; -extern const u8 gText_Read[]; -extern const u8 gText_MoveToBag[]; -extern const u8 gText_Give2[]; extern const u8 gText_Cancel2[]; extern const u8 gText_NoItems[]; @@ -481,12 +455,8 @@ extern const u8 gText_BagIsFull[]; extern const u8 gText_MailToBagMessageErased[]; extern const u8 gText_GoBackPrevMenu[]; -extern const u8 gText_WithdrawHowManyItems[]; -extern const u8 gText_WithdrawXItems[]; extern const u8 gText_TossHowManyVar1s[]; extern const u8 gText_ThrewAwayVar2Var1s[]; -extern const u8 gText_NoRoomInBag[]; -extern const u8 gText_TooImportantToToss[]; extern const u8 gText_ConfirmTossItems[]; extern const u8 gText_MoveVar1Where[]; @@ -509,16 +479,6 @@ extern const u8 gText_HealthboxGender_None[]; extern const u8 gText_HealthboxGender_Male[]; extern const u8 gText_HealthboxGender_Female[]; -extern const u8 gText_99TimesPlus[]; -extern const u8 gText_1MinutePlus[]; -extern const u8 gText_SpaceSeconds[]; -extern const u8 gText_SpaceTimes[]; - -extern const u8 gText_BigGuy[]; -extern const u8 gText_BigGirl[]; -extern const u8 gText_Son[]; -extern const u8 gText_Daughter[]; - // Multichoice strings extern const u8 gText_Exit[]; extern const u8 gText_1F[]; @@ -539,73 +499,6 @@ extern const u8 gText_B4F[]; extern const u8 gText_Rooftop[]; extern const u8 gText_ElevatorNowOn[]; -extern const u8 gText_BlueFlute[]; -extern const u8 gText_YellowFlute[]; -extern const u8 gText_RedFlute[]; -extern const u8 gText_WhiteFlute[]; -extern const u8 gText_BlackFlute[]; -extern const u8 gText_PrettyChair[]; -extern const u8 gText_PrettyDesk[]; - -extern const u8 gText_0Pts[]; -extern const u8 gText_10Pts[]; -extern const u8 gText_20Pts[]; -extern const u8 gText_30Pts[]; -extern const u8 gText_40Pts[]; -extern const u8 gText_50Pts[]; -extern const u8 gText_60Pts[]; -extern const u8 gText_70Pts[]; -extern const u8 gText_80Pts[]; -extern const u8 gText_90Pts[]; -extern const u8 gText_100Pts[]; -extern const u8 gText_QuestionMark[]; - -extern const u8 gText_KissPoster16BP[]; -extern const u8 gText_KissCushion32BP[]; -extern const u8 gText_SmoochumDoll32BP[]; -extern const u8 gText_TogepiDoll48BP[]; -extern const u8 gText_MeowthDoll48BP[]; -extern const u8 gText_ClefairyDoll48BP[]; -extern const u8 gText_DittoDoll48BP[]; -extern const u8 gText_CyndaquilDoll80BP[]; -extern const u8 gText_ChikoritaDoll80BP[]; -extern const u8 gText_TotodileDoll80BP[]; - -extern const u8 gText_LaprasDoll128BP[]; -extern const u8 gText_SnorlaxDoll128BP[]; -extern const u8 gText_VenusaurDoll256BP[]; -extern const u8 gText_CharizardDoll256BP[]; -extern const u8 gText_BlastoiseDoll256BP[]; - -extern const u8 gText_Protein1BP[]; -extern const u8 gText_Calcium1BP[]; -extern const u8 gText_Iron1BP[]; -extern const u8 gText_Zinc1BP[]; -extern const u8 gText_Carbos1BP[]; -extern const u8 gText_HpUp1BP[]; - -extern const u8 gText_Leftovers48BP[]; -extern const u8 gText_WhiteHerb48BP[]; -extern const u8 gText_QuickClaw48BP[]; -extern const u8 gText_MentalHerb48BP[]; -extern const u8 gText_BrightPowder64BP[]; -extern const u8 gText_ChoiceBand64BP[]; -extern const u8 gText_KingsRock64BP[]; -extern const u8 gText_FocusBand64BP[]; -extern const u8 gText_ScopeLens64BP[]; - -extern const u8 gText_EnergyPowder50[]; -extern const u8 gText_EnergyRoot80[]; -extern const u8 gText_HealPowder50[]; -extern const u8 gText_RevivalHerb300[]; -extern const u8 gText_Protein1000[]; -extern const u8 gText_Iron1000[]; -extern const u8 gText_Carbos1000[]; -extern const u8 gText_Calcium1000[]; -extern const u8 gText_Zinc1000[]; -extern const u8 gText_HPUp1000[]; -extern const u8 gText_PPUp3000[]; - extern const u8 gText_BattleTower2[]; extern const u8 gText_BattleDome[]; extern const u8 gText_BattlePalace[]; @@ -616,28 +509,6 @@ extern const u8 gText_BattlePyramid[]; extern const u8 gText_RankingHall[]; extern const u8 gText_ExchangeService[]; -// Battle Frontier Move Tutors -extern const u8 gText_Softboiled16BP[]; -extern const u8 gText_SeismicToss24BP[]; -extern const u8 gText_DreamEater24BP[]; -extern const u8 gText_MegaPunch24BP[]; -extern const u8 gText_MegaKick48BP[]; -extern const u8 gText_BodySlam48BP[]; -extern const u8 gText_RockSlide48BP[]; -extern const u8 gText_Counter48BP[]; -extern const u8 gText_ThunderWave48BP[]; -extern const u8 gText_SwordsDance48BP[]; -extern const u8 gText_DefenseCurl16BP[]; -extern const u8 gText_Snore24BP[]; -extern const u8 gText_MudSlap24BP[]; -extern const u8 gText_Swift24BP[]; -extern const u8 gText_IcyWind24BP[]; -extern const u8 gText_Endure48BP[]; -extern const u8 gText_PsychUp48BP[]; -extern const u8 gText_IcePunch48BP[]; -extern const u8 gText_ThunderPunch48BP[]; -extern const u8 gText_FirePunch48BP[]; - extern const u8 gText_SlateportCity[]; extern const u8 gText_BattleFrontier[]; extern const u8 gText_SouthernIsland[]; @@ -816,26 +687,12 @@ extern const u8 gText_Gabby[]; extern const u8 gText_Anna[]; extern const u8 gText_DadsAdvice[]; -extern const u8 gText_CantDismountBike[]; -extern const u8 gText_ItemFinderNothing[]; -extern const u8 gText_ItemFinderNearby[]; -extern const u8 gText_ItemFinderOnTop[]; -extern const u8 gText_CoinCase[]; -extern const u8 gText_PowderQty[]; -extern const u8 gText_BootedUpHM[]; -extern const u8 gText_BootedUpTM[]; -extern const u8 gText_TMHMContainedVar1[]; extern const u8 gText_PlayerUsedVar2[]; extern const u8 gText_RepelEffectsLingered[]; extern const u8 gText_LureEffectsLingered[]; -extern const u8 gText_UsedVar2WildLured[]; -extern const u8 gText_UsedVar2WildRepelled[]; extern const u8 gText_BoxFull[]; extern const u8 gText_WontHaveEffect[]; extern const u8 gText_NextFusionMon[]; -extern const u8 gText_PlayedPokeFluteCatchy[]; -extern const u8 gText_PlayedPokeFlute[]; -extern const u8 gText_PokeFluteAwakenedMon[]; extern const u8 gText_LevelSymbol[]; extern const u8 gText_PkmnInfo[]; @@ -934,31 +791,13 @@ extern const u8 gText_SomeonesPC[]; extern const u8 gText_PlayersPC[]; extern const u8 gText_WhichPCShouldBeAccessed[]; -extern const u8 gText_Petalburg[]; -extern const u8 gText_Slateport[]; -extern const u8 gText_Enter2[]; extern const u8 gText_Info2[]; -extern const u8 gText_WhatsAContest[]; -extern const u8 gText_TypesOfContests[]; -extern const u8 gText_Ranks[]; extern const u8 gText_Decoration2[]; extern const u8 gText_PackUp[]; extern const u8 gText_Registry[]; extern const u8 gText_Information[]; -extern const u8 gText_Mach[]; -extern const u8 gText_Acro[]; -extern const u8 gText_Psn[]; -extern const u8 gText_Par[]; -extern const u8 gText_Slp[]; -extern const u8 gText_Brn[]; -extern const u8 gText_Frz[]; -extern const u8 gText_Dewford[]; -extern const u8 gText_SawIt[]; -extern const u8 gText_NotYet[]; extern const u8 gText_Yes[]; extern const u8 gText_No[]; -extern const u8 gText_Challenge[]; -extern const u8 gText_Info3[]; // Pokédex strings extern const u8 gText_SearchForPkmnBasedOnParameters[]; @@ -1009,41 +848,7 @@ extern const u8 gText_DexEmptyString[]; extern const u8 gText_DexSearchDontSpecify[]; extern const u8 gText_DexSearchTypeNone[]; -extern const u8 gText_FreshWaterAndPrice[]; -extern const u8 gText_SodaPopAndPrice[]; -extern const u8 gText_LemonadeAndPrice[]; -extern const u8 gText_HowToRide[]; -extern const u8 gText_HowToTurn[]; -extern const u8 gText_SandySlopes[]; -extern const u8 gText_Wheelies[]; -extern const u8 gText_BunnyHops[]; -extern const u8 gText_Jump[]; -extern const u8 gText_Satisfied[]; -extern const u8 gText_Dissatisfied[]; -extern const u8 gText_DeepSeaTooth[]; -extern const u8 gText_DeepSeaScale[]; -extern const u8 gText_BlueFlute2[]; -extern const u8 gText_YellowFlute2[]; -extern const u8 gText_RedFlute2[]; -extern const u8 gText_WhiteFlute2[]; -extern const u8 gText_BlackFlute2[]; -extern const u8 gText_GlassChair[]; -extern const u8 gText_GlassDesk[]; -extern const u8 gText_TreeckoDollAndPrice[]; -extern const u8 gText_TorchicDollAndPrice[]; -extern const u8 gText_MudkipDollAndPrice[]; -extern const u8 gText_TM32AndPrice[]; -extern const u8 gText_TM29AndPrice[]; -extern const u8 gText_TM35AndPrice[]; -extern const u8 gText_TM24AndPrice[]; -extern const u8 gText_TM13AndPrice[]; -extern const u8 gText_50CoinsAndPrice[]; -extern const u8 gText_500CoinsAndPrice[]; -extern const u8 gText_Excellent2[]; -extern const u8 gText_NotSoGood[]; extern const u8 gText_LilycoveCity[]; -extern const u8 gText_Right[]; -extern const u8 gText_Left[]; extern const u8 gText_RedShard[]; extern const u8 gText_YellowShard[]; extern const u8 gText_BlueShard[]; @@ -1054,79 +859,20 @@ extern const u8 gText_ReadyToStart[]; extern const u8 gText_Record2[]; extern const u8 gText_Rest[]; extern const u8 gText_Retire[]; -extern const u8 gText_RedTent[]; -extern const u8 gText_BlueTent[]; extern const u8 gText_TradeCenter[]; extern const u8 gText_Colosseum[]; extern const u8 gText_RecordCorner[]; -extern const u8 gText_SingleBattle[]; -extern const u8 gText_DoubleBattle[]; -extern const u8 gText_MultiBattle[]; extern const u8 gText_BerryCrush3[]; -extern const u8 gText_PokemonJump[]; -extern const u8 gText_DodrioBerryPicking[]; -extern const u8 gText_JoinGroup[]; -extern const u8 gText_BecomeLeader[]; -extern const u8 gText_NormalRank[]; -extern const u8 gText_SuperRank[]; -extern const u8 gText_HyperRank[]; -extern const u8 gText_MasterRank[]; -extern const u8 gText_BattleBag[]; -extern const u8 gText_HeldItem[]; -extern const u8 gText_LinkContest[]; -extern const u8 gText_AboutE_Mode[]; -extern const u8 gText_AboutG_Mode[]; -extern const u8 gText_E_Mode[]; -extern const u8 gText_G_Mode[]; extern const u8 gText_Blank[]; -extern const u8 gText_5BP[]; -extern const u8 gText_10BP[]; -extern const u8 gText_15BP[]; -extern const u8 gText_ClawFossil[]; -extern const u8 gText_RootFossil[]; -extern const u8 gText_No4[]; -extern const u8 gText_TwoStyles[]; -extern const u8 gText_Lv50_3[]; -extern const u8 gText_OpenLevel2[]; -extern const u8 gText_MonTypeAndNo[]; -extern const u8 gText_HoldItems[]; -extern const u8 gText_Symbols2[]; -extern const u8 gText_Record3[]; -extern const u8 gText_BattlePts[]; extern const u8 gText_BattleRules[]; extern const u8 gText_JudgeMind[]; extern const u8 gText_JudgeSkill[]; extern const u8 gText_JudgeBody[]; -extern const u8 gText_TowerInfo[]; -extern const u8 gText_BattleMon[]; -extern const u8 gText_BattleSalon[]; -extern const u8 gText_MultiLink2[]; -extern const u8 gText_Matchup[]; -extern const u8 gText_TourneyTree[]; -extern const u8 gText_DoubleKO[]; extern const u8 gText_BasicRules[]; extern const u8 gText_SwapPartners[]; extern const u8 gText_SwapNumber[]; extern const u8 gText_SwapNotes[]; -extern const u8 gText_OpenLevel3[]; -extern const u8 gText_PyramidPokemon[]; -extern const u8 gText_PyramidTrainers[]; -extern const u8 gText_PyramidMaze[]; -extern const u8 gText_BattleBag2[]; -extern const u8 gText_PokenavAndBag[]; -extern const u8 gText_HeldItems[]; -extern const u8 gText_PokemonOrder[]; extern const u8 gText_GoOn[]; -extern const u8 gText_Red[]; -extern const u8 gText_Blue[]; -extern const u8 gText_IllBattleNow[]; -extern const u8 gText_IWon[]; -extern const u8 gText_ILost[]; -extern const u8 gText_IWontTell[]; -extern const u8 gText_CaveOfOrigin[]; -extern const u8 gText_MtPyre[]; -extern const u8 gText_SkyPillar[]; -extern const u8 gText_DontRemember[]; extern const u8 gText_BattlePokemon[]; extern const u8 gText_NormalTagMatch[]; extern const u8 gText_VarietyTagMatch[]; @@ -1150,19 +896,6 @@ extern const u8 CableClub_Text_YouMayBattleHere[]; extern const u8 CableClub_Text_CanMixRecords[]; extern const u8 CableClub_Text_CanMakeBerryPowder[]; -// Rotom Catalog text -extern const u8 gText_LightBulb[]; -extern const u8 gText_MicrowaveOven[]; -extern const u8 gText_WashingMachine[]; -extern const u8 gText_Refrigerator[]; -extern const u8 gText_ElectricFan[]; -extern const u8 gText_LawnMower[]; -extern const u8 gText_Exit[]; - -// Zygarde Cube text -extern const u8 gText_ChangeForm[]; -extern const u8 gText_ChangeAbility[]; - // Frontier records. extern const u8 gText_WinStreak[]; extern const u8 gText_Record[]; @@ -1887,21 +1620,8 @@ extern const u8 gText_NotAble2[]; extern const u8 gText_Learned[]; extern const u8 gText_Have[]; extern const u8 gText_DontHave[]; -extern const u8 gText_Take[]; -extern const u8 gText_Mail[]; -extern const u8 gText_Take2[]; -extern const u8 gText_Read2[]; extern const u8 gText_Cancel2[]; -extern const u8 gText_Shift[]; -extern const u8 gText_SendOut[]; -extern const u8 gText_Enter[]; -extern const u8 gText_NoEntry[]; -extern const u8 gText_Store[]; extern const u8 gText_Register[]; -extern const u8 gText_Trade4[]; -extern const u8 gText_Summary5[]; -extern const u8 gText_Switch2[]; -extern const u8 gText_Item[]; extern const u8 gText_NotPkmnOtherTrainerWants[]; extern const u8 gText_ThatIsntAnEgg[]; extern const u8 gText_OtherTrainersPkmnCantBeTraded[]; @@ -2697,9 +2417,6 @@ extern const u8 gText_ExpShareOff[]; extern const u8 gText_BasePointsResetToZero[]; -extern const u8 gText_Fertilize[]; -extern const u8 gText_PlantBerry[]; - // Map name pop-up extern const u8 gText_AM[]; extern const u8 gText_PM[]; diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 28ac8f48d1..cb85ba8c78 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -2354,12 +2354,15 @@ static s32 AI_CheckBadMove(u32 battlerAtk, u32 battlerDef, u32 move, s32 score) ADJUST_SCORE(-10); break; case EFFECT_SOAK: + { + u32 types[3]; + GetBattlerTypes(battlerDef, FALSE, types); + // TODO: Use the type of the move like 'VARIOUS_TRY_SOAK'? if (PartnerMoveIsSameAsAttacker(BATTLE_PARTNER(battlerAtk), battlerDef, move, aiData->partnerMove) - || (GetBattlerType(battlerDef, 0, FALSE) == TYPE_WATER - && GetBattlerType(battlerDef, 1, FALSE) == TYPE_WATER - && GetBattlerType(battlerDef, 2, FALSE) == TYPE_MYSTERY)) + || (types[0] == TYPE_WATER && types[1] == TYPE_WATER && types[2] == TYPE_MYSTERY)) ADJUST_SCORE(-10); // target is already water-only break; + } case EFFECT_THIRD_TYPE: switch (move) { @@ -4433,7 +4436,7 @@ static u32 AI_CalcMoveEffectScore(u32 battlerAtk, u32 battlerDef, u32 move) ADJUST_SCORE(GOOD_EFFECT); break; case EFFECT_SALT_CURE: - if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_WATER) || IS_BATTLER_OF_TYPE(battlerDef, TYPE_STEEL)) + if (IS_BATTLER_ANY_TYPE(battlerDef, TYPE_WATER, TYPE_STEEL)) ADJUST_SCORE(DECENT_EFFECT); break; } // move effect checks diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 18ceb7fab2..d0ec630fad 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -102,6 +102,15 @@ bool32 IsAiBattlerAware(u32 battlerId) return BattlerHasAi(battlerId); } +bool32 IsAiBattlerPredictingAbility(u32 battlerId) +{ + if (AI_THINKING_STRUCT->aiFlags[B_POSITION_OPPONENT_LEFT] & AI_FLAG_WEIGH_ABILITY_PREDICTION + || AI_THINKING_STRUCT->aiFlags[B_POSITION_OPPONENT_RIGHT] & AI_FLAG_WEIGH_ABILITY_PREDICTION) + return TRUE; + + return BattlerHasAi(battlerId); +} + void ClearBattlerMoveHistory(u32 battlerId) { memset(BATTLE_HISTORY->usedMoves[battlerId], 0, sizeof(BATTLE_HISTORY->usedMoves[battlerId])); @@ -1332,6 +1341,8 @@ s32 AI_DecideKnownAbilityForTurn(u32 battlerId) u32 validAbilities[NUM_ABILITY_SLOTS]; u8 i, numValidAbilities = 0; u32 knownAbility = AI_GetBattlerAbility(battlerId); + u32 indexAbility; + u32 abilityAiRatings[NUM_ABILITY_SLOTS] = {0}; // We've had ability overwritten by e.g. Worry Seed. It is not part of AI_PARTY in case of switching if (gBattleStruct->overwrittenAbilities[battlerId]) @@ -1354,10 +1365,17 @@ s32 AI_DecideKnownAbilityForTurn(u32 battlerId) for (i = 0; i < NUM_ABILITY_SLOTS; i++) { - if (gSpeciesInfo[gBattleMons[battlerId].species].abilities[i] != ABILITY_NONE) - validAbilities[numValidAbilities++] = gSpeciesInfo[gBattleMons[battlerId].species].abilities[i]; + indexAbility = gSpeciesInfo[gBattleMons[battlerId].species].abilities[i]; + if (indexAbility != ABILITY_NONE) + { + abilityAiRatings[numValidAbilities] = gAbilitiesInfo[indexAbility].aiRating; + validAbilities[numValidAbilities++] = indexAbility; + } } + if (numValidAbilities > 0 && IsAiBattlerPredictingAbility(battlerId)) + return validAbilities[RandomWeighted(RNG_AI_PREDICT_ABILITY, abilityAiRatings[0], abilityAiRatings[1], abilityAiRatings[2])]; + if (numValidAbilities > 0) return validAbilities[RandomUniform(RNG_AI_ABILITY, 0, numValidAbilities - 1)]; @@ -1582,9 +1600,7 @@ bool32 ShouldSetSandstorm(u32 battler, u32 ability, u32 holdEffect) || ability == ABILITY_OVERCOAT || ability == ABILITY_MAGIC_GUARD || holdEffect == HOLD_EFFECT_SAFETY_GOGGLES - || IS_BATTLER_OF_TYPE(battler, TYPE_ROCK) - || IS_BATTLER_OF_TYPE(battler, TYPE_STEEL) - || IS_BATTLER_OF_TYPE(battler, TYPE_GROUND) + || IS_BATTLER_ANY_TYPE(battler, TYPE_ROCK, TYPE_GROUND, TYPE_STEEL) || HasMoveEffect(battler, EFFECT_SHORE_UP) || HasMoveEffect(battler, EFFECT_WEATHER_BALL)) { @@ -2370,6 +2386,32 @@ bool32 IsSwitchOutEffect(u32 effect) } } +static inline bool32 IsMoveSleepClauseTrigger(u32 move) +{ + u32 i, effect = gMovesInfo[move].effect; + + // Sleeping effects like Sleep Powder, Yawn, Dark Void, etc. + switch (effect) + { + case EFFECT_SLEEP: + case EFFECT_YAWN: + case EFFECT_DARK_VOID: + return TRUE; + } + + // Sleeping effects like G-Max Befuddle, G-Max Snooze, etc. + for (i = 0; i < gMovesInfo[move].numAdditionalEffects; i++) + { + switch (gMovesInfo[move].additionalEffects[i].moveEffect) + { + case MAX_EFFECT_EFFECT_SPORE_FOES: + case MAX_EFFECT_YAWN_FOE: + return TRUE; + } + } + return FALSE; +} + bool32 HasDamagingMove(u32 battlerId) { u32 i; @@ -2523,9 +2565,7 @@ static u32 GetPoisonDamage(u32 battlerId) static bool32 BattlerAffectedBySandstorm(u32 battlerId, u32 ability) { - if (!IS_BATTLER_OF_TYPE(battlerId, TYPE_ROCK) - && !IS_BATTLER_OF_TYPE(battlerId, TYPE_GROUND) - && !IS_BATTLER_OF_TYPE(battlerId, TYPE_STEEL) + if (!IS_BATTLER_ANY_TYPE(battlerId, TYPE_ROCK, TYPE_GROUND, TYPE_STEEL) && ability != ABILITY_SAND_VEIL && ability != ABILITY_SAND_FORCE && ability != ABILITY_SAND_RUSH @@ -2930,7 +2970,7 @@ bool32 AI_CanPoison(u32 battlerAtk, u32 battlerDef, u32 defAbility, u32 move, u3 || DoesSubstituteBlockMove(battlerAtk, battlerDef, move) || PartnerMoveEffectIsStatusSameTarget(BATTLE_PARTNER(battlerAtk), battlerDef, partnerMove)) return FALSE; - else if (defAbility != ABILITY_CORROSION && (IS_BATTLER_OF_TYPE(battlerDef, TYPE_POISON) || IS_BATTLER_OF_TYPE(battlerDef, TYPE_STEEL))) + else if (defAbility != ABILITY_CORROSION && IS_BATTLER_ANY_TYPE(battlerDef, TYPE_POISON, TYPE_STEEL)) return FALSE; else if (IsValidDoubleBattle(battlerAtk) && AI_DATA->abilities[BATTLE_PARTNER(battlerDef)] == ABILITY_PASTEL_VEIL) return FALSE; @@ -3393,13 +3433,9 @@ bool32 PartnerMoveIsSameNoTarget(u32 battlerAtkPartner, u32 move, u32 partnerMov bool32 PartnerMoveActivatesSleepClause(u32 partnerMove) { - u32 effect = gMovesInfo[partnerMove].effect; - if (!IsDoubleBattle() || !FlagGet(B_FLAG_SLEEP_CLAUSE)) + if (!IsDoubleBattle() || !IsSleepClauseEnabled()) return FALSE; - if (effect == EFFECT_SLEEP - || effect == EFFECT_YAWN) - return TRUE; - return FALSE; + return IsMoveSleepClauseTrigger(partnerMove); } bool32 ShouldUseWishAromatherapy(u32 battlerAtk, u32 battlerDef, u32 move) diff --git a/src/battle_main.c b/src/battle_main.c index 0799313544..6cce72d909 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3118,7 +3118,7 @@ static void BattleStartClearSetData(void) gSelectedMonPartyId = PARTY_SIZE; // Revival Blessing gCategoryIconSpriteId = 0xFF; - if(FlagGet(B_FLAG_SLEEP_CLAUSE)) + if(IsSleepClauseEnabled()) { // If monCausingSleepClause[side] equals PARTY_SIZE, Sleep Clause is not active for the given side. gBattleStruct->monCausingSleepClause[B_SIDE_PLAYER] = PARTY_SIZE; diff --git a/src/battle_message.c b/src/battle_message.c index db68c9968e..88b33a2c03 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -163,11 +163,6 @@ const u8 gText_drastically[] = _("drastically "); const u8 gText_severely[] = _("severely "); static const u8 sText_TerrainReturnedToNormal[] = _("The terrain returned to normal!"); // Unused -// Remove these when done testing -static const u8 sTest_TempTestText1[] = _("This is a text for testing stuff."); -static const u8 sTest_TempTestText2[] = _("This is a text for testing stuff that should be two lines."); -static const u8 sTest_TempTestText3[] = _("This is a text for testing stuff that should be three lines so it has to have some extra text."); - const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { [STRINGID_TRAINER1LOSETEXT] = COMPOUND_STRING("{B_TRAINER1_LOSE_TEXT}"), diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index e4c8b238d3..c817a14df1 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1125,29 +1125,14 @@ static bool32 NoTargetPresent(u8 battler, u32 move) return FALSE; } -static bool32 TryAegiFormChange(void) +static bool32 TryFormChangeBeforeMove(void) { - // Only Aegislash with Stance Change can transform, transformed mons cannot. - if (GetBattlerAbility(gBattlerAttacker) != ABILITY_STANCE_CHANGE - || gBattleMons[gBattlerAttacker].status2 & STATUS2_TRANSFORMED) + bool32 result = TryBattleFormChange(gBattlerAttacker, FORM_CHANGE_BATTLE_BEFORE_MOVE); + if (!result) + result = TryBattleFormChange(gBattlerAttacker, FORM_CHANGE_BATTLE_BEFORE_MOVE_CATEGORY); + if (!result) return FALSE; - switch (gBattleMons[gBattlerAttacker].species) - { - default: - return FALSE; - case SPECIES_AEGISLASH_SHIELD: // Shield -> Blade - if (IS_MOVE_STATUS(gCurrentMove)) - return FALSE; - TryBattleFormChange(gBattlerAttacker, FORM_CHANGE_BATTLE_ATTACK); - break; - case SPECIES_AEGISLASH_BLADE: // Blade -> Shield - if (gCurrentMove != MOVE_KINGS_SHIELD) - return FALSE; - TryBattleFormChange(gBattlerAttacker, FORM_CHANGE_BATTLE_KINGS_SHIELD); - break; - } - BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_AttackerFormChange; return TRUE; @@ -1221,7 +1206,7 @@ static void Cmd_attackcanceler(void) gBattlescriptCurrInstr = BattleScript_MoveEnd; return; } - if (B_STANCE_CHANGE_FAIL < GEN_7 && TryAegiFormChange()) + if (B_STANCE_CHANGE_FAIL < GEN_7 && TryFormChangeBeforeMove()) return; if (AtkCanceller_UnableToUseMove(moveType)) return; @@ -1282,7 +1267,7 @@ static void Cmd_attackcanceler(void) gBattleStruct->moveResultFlags[gBattlerTarget] |= MOVE_RESULT_MISSED; return; } - if (B_STANCE_CHANGE_FAIL >= GEN_7 && TryAegiFormChange()) + if (B_STANCE_CHANGE_FAIL >= GEN_7 && TryFormChangeBeforeMove()) return; gHitMarker &= ~HITMARKER_ALLOW_NO_PP; @@ -2373,13 +2358,13 @@ static u32 UpdateEffectivenessResultFlagsForDoubleSpreadMoves(u32 resultFlags) return resultFlags; } -static inline bool32 TryStrongWindsWeakenAttack(u32 battlerDef) +static inline bool32 TryStrongWindsWeakenAttack(u32 battlerDef, u32 moveType) { if (gBattleWeather & B_WEATHER_STRONG_WINDS && WEATHER_HAS_EFFECT) { if (gMovesInfo[gCurrentMove].category != DAMAGE_CATEGORY_STATUS && IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING) - && gTypeEffectivenessTable[GetMoveType(gCurrentMove)][TYPE_FLYING] >= UQ_4_12(2.0) + && gTypeEffectivenessTable[moveType][TYPE_FLYING] >= UQ_4_12(2.0) && !gBattleStruct->printedStrongWindsWeakenedAttack) { gBattleStruct->printedStrongWindsWeakenedAttack = TRUE; @@ -2425,6 +2410,7 @@ static inline bool32 TryActivateWeakenessBerry(u32 battlerDef) static bool32 ProcessPreAttackAnimationFuncs(void) { + u32 moveType = GetMoveType(gCurrentMove); if (IsDoubleSpreadMove()) { u32 moveTarget = GetBattlerMoveTargetType(gBattlerAttacker, gCurrentMove); @@ -2437,7 +2423,7 @@ static bool32 ProcessPreAttackAnimationFuncs(void) || (gBattleStruct->noResultString[battlerDef] && gBattleStruct->noResultString[battlerDef] != DO_ACCURACY_CHECK)) continue; - if (TryStrongWindsWeakenAttack(battlerDef)) + if (TryStrongWindsWeakenAttack(battlerDef, moveType)) return TRUE; } } @@ -2457,7 +2443,7 @@ static bool32 ProcessPreAttackAnimationFuncs(void) } else { - if (TryStrongWindsWeakenAttack(gBattlerTarget)) + if (TryStrongWindsWeakenAttack(gBattlerTarget, moveType)) return TRUE; if (TryTeraShellDistortTypeMatchups(gBattlerTarget)) return TRUE; @@ -9013,7 +8999,7 @@ static bool32 HasAttackerFaintedTarget(void) bool32 CanPoisonType(u8 battlerAttacker, u8 battlerTarget) { return GetBattlerAbility(battlerAttacker) == ABILITY_CORROSION - || (!IS_BATTLER_OF_TYPE(battlerTarget, TYPE_STEEL) && !IS_BATTLER_OF_TYPE(battlerTarget, TYPE_POISON)); + || !IS_BATTLER_ANY_TYPE(battlerTarget, TYPE_POISON, TYPE_STEEL); } bool32 CanParalyzeType(u8 battlerAttacker, u8 battlerTarget) @@ -10328,9 +10314,10 @@ static void Cmd_various(void) case VARIOUS_TRY_SOAK: { VARIOUS_ARGS(const u8 *failInstr); - if ((GetBattlerType(gBattlerTarget, 0, FALSE) == gMovesInfo[gCurrentMove].type - && GetBattlerType(gBattlerTarget, 1, FALSE) == gMovesInfo[gCurrentMove].type) - || GetActiveGimmick(gBattlerTarget) == GIMMICK_TERA) + u32 types[3]; + GetBattlerTypes(gBattlerTarget, FALSE, types); + if ((types[0] == gMovesInfo[gCurrentMove].type && types[1] == gMovesInfo[gCurrentMove].type) + || GetActiveGimmick(gBattlerTarget) == GIMMICK_TERA) { gBattlescriptCurrInstr = cmd->failInstr; } @@ -15505,7 +15492,7 @@ static void Cmd_handleballthrow(void) ballMultiplier = 150; break; case BALL_NET: - if (IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_WATER) || IS_BATTLER_OF_TYPE(gBattlerTarget, TYPE_BUG)) + if (IS_BATTLER_ANY_TYPE(gBattlerTarget, TYPE_WATER, TYPE_BUG)) ballMultiplier = B_NET_BALL_MODIFIER >= GEN_7 ? 350 : 300; break; case BALL_DIVE: @@ -16952,9 +16939,8 @@ void BS_TryReflectType(void) { NATIVE_ARGS(const u8 *failInstr); u16 targetBaseSpecies = GET_BASE_SPECIES_ID(gBattleMons[gBattlerTarget].species); - u8 targetType1 = GetBattlerType(gBattlerTarget, 0, FALSE); - u8 targetType2 = GetBattlerType(gBattlerTarget, 1, FALSE); - u8 targetType3 = GetBattlerType(gBattlerTarget, 2, FALSE); + u32 targetTypes[3]; + GetBattlerTypes(gBattlerTarget, FALSE, targetTypes); if (targetBaseSpecies == SPECIES_ARCEUS || targetBaseSpecies == SPECIES_SILVALLY) { @@ -16968,32 +16954,32 @@ void BS_TryReflectType(void) { gBattlescriptCurrInstr = cmd->failInstr; } - else if (targetType1 == TYPE_MYSTERY && targetType2 == TYPE_MYSTERY && targetType3 != TYPE_MYSTERY) + else if (targetTypes[0] == TYPE_MYSTERY && targetTypes[1] == TYPE_MYSTERY && targetTypes[2] != TYPE_MYSTERY) { gBattleMons[gBattlerAttacker].types[0] = TYPE_NORMAL; gBattleMons[gBattlerAttacker].types[1] = TYPE_NORMAL; - gBattleMons[gBattlerAttacker].types[2] = targetType3; + gBattleMons[gBattlerAttacker].types[2] = targetTypes[2]; gBattlescriptCurrInstr = cmd->nextInstr; } - else if (targetType1 == TYPE_MYSTERY && targetType2 != TYPE_MYSTERY) + else if (targetTypes[0] == TYPE_MYSTERY && targetTypes[1] != TYPE_MYSTERY) { - gBattleMons[gBattlerAttacker].types[0] = targetType2; - gBattleMons[gBattlerAttacker].types[1] = targetType2; - gBattleMons[gBattlerAttacker].types[2] = targetType3; + gBattleMons[gBattlerAttacker].types[0] = targetTypes[1]; + gBattleMons[gBattlerAttacker].types[1] = targetTypes[1]; + gBattleMons[gBattlerAttacker].types[2] = targetTypes[2]; gBattlescriptCurrInstr = cmd->nextInstr; } - else if (targetType1 != TYPE_MYSTERY && targetType2 == TYPE_MYSTERY) + else if (targetTypes[0] != TYPE_MYSTERY && targetTypes[1] == TYPE_MYSTERY) { - gBattleMons[gBattlerAttacker].types[0] = targetType1; - gBattleMons[gBattlerAttacker].types[1] = targetType1; - gBattleMons[gBattlerAttacker].types[2] = targetType3; + gBattleMons[gBattlerAttacker].types[0] = targetTypes[0]; + gBattleMons[gBattlerAttacker].types[1] = targetTypes[0]; + gBattleMons[gBattlerAttacker].types[2] = targetTypes[2]; gBattlescriptCurrInstr = cmd->nextInstr; } else { - gBattleMons[gBattlerAttacker].types[0] = targetType1; - gBattleMons[gBattlerAttacker].types[1] = targetType2; - gBattleMons[gBattlerAttacker].types[2] = targetType3; + gBattleMons[gBattlerAttacker].types[0] = targetTypes[0]; + gBattleMons[gBattlerAttacker].types[1] = targetTypes[1]; + gBattleMons[gBattlerAttacker].types[2] = targetTypes[2]; gBattlescriptCurrInstr = cmd->nextInstr; } } @@ -17585,7 +17571,7 @@ void BS_JumpIfSleepClause(void) NATIVE_ARGS(const u8 *jumpInstr); // Can freely sleep own partner - if (IsDoubleBattle() && B_FLAG_SLEEP_CLAUSE && GetBattlerSide(gBattlerAttacker) == GetBattlerSide(gBattlerTarget)) + if (IsDoubleBattle() && IsSleepClauseEnabled() && GetBattlerSide(gBattlerAttacker) == GetBattlerSide(gBattlerTarget)) { gBattleStruct->sleepClauseEffectExempt |= (1u << gBattlerTarget); gBattlescriptCurrInstr = cmd->nextInstr; diff --git a/src/battle_util.c b/src/battle_util.c index d7e883f14d..36fd867b38 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -2330,9 +2330,7 @@ u8 DoBattlerEndTurnEffects(void) && ability != ABILITY_SAND_FORCE && ability != ABILITY_SAND_RUSH && ability != ABILITY_OVERCOAT - && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_ROCK) - && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_GROUND) - && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_STEEL) + && !IS_BATTLER_ANY_TYPE(gBattlerAttacker, TYPE_ROCK, TYPE_GROUND, TYPE_STEEL) && !(gStatuses3[gBattlerAttacker] & (STATUS3_UNDERGROUND | STATUS3_UNDERWATER)) && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_SAFETY_GOGGLES) { @@ -2905,7 +2903,7 @@ u8 DoBattlerEndTurnEffects(void) && !IsBattlerProtectedByMagicGuard(battler, ability)) { gBattlerTarget = battler; - if (IS_BATTLER_OF_TYPE(battler, TYPE_STEEL) || IS_BATTLER_OF_TYPE(battler, TYPE_WATER)) + if (IS_BATTLER_ANY_TYPE(battler, TYPE_STEEL, TYPE_WATER)) gBattleStruct->moveDamage[battler] = gBattleMons[battler].maxHP / 4; else gBattleStruct->moveDamage[battler] = gBattleMons[battler].maxHP / 8; @@ -3333,7 +3331,7 @@ u8 AtkCanceller_UnableToUseMove(u32 moveType) gHitMarker |= HITMARKER_OBEYS; break; case DISOBEYS_FALL_ASLEEP: - if (FlagGet(B_FLAG_SLEEP_CLAUSE)) + if (IsSleepClauseEnabled()) gBattleStruct->sleepClauseEffectExempt |= (1u << gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_IgnoresAndFallsAsleep; gBattleStruct->moveResultFlags[gBattlerTarget] |= MOVE_RESULT_MISSED; @@ -5877,7 +5875,7 @@ u32 AbilityBattleEffects(u32 caseID, u32 battler, u32 ability, u32 special, u32 && GetBattlerHoldEffect(gBattlerAttacker, TRUE) != HOLD_EFFECT_PROTECTIVE_PADS && IsMoveMakingContact(move, gBattlerAttacker)) { - if (FlagGet(B_FLAG_SLEEP_CLAUSE)) + if (IsSleepClauseEnabled()) gBattleStruct->sleepClauseEffectExempt |= (1u << gBattlerAttacker); gBattleScripting.moveEffect = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_SLEEP; PREPARE_ABILITY_BUFFER(gBattleTextBuff1, gLastUsedAbility); @@ -10602,13 +10600,14 @@ static void UpdateMoveResultFlags(uq4_12_t modifier, u32 battler) static inline uq4_12_t CalcTypeEffectivenessMultiplierInternal(u32 move, u32 moveType, u32 battlerAtk, u32 battlerDef, bool32 recordAbilities, uq4_12_t modifier, u32 defAbility) { u32 illusionSpecies; + u32 types[3]; + GetBattlerTypes(battlerDef, FALSE, types); - MulByTypeEffectiveness(&modifier, move, moveType, battlerDef, GetBattlerType(battlerDef, 0, FALSE), battlerAtk, recordAbilities); - if (GetBattlerType(battlerDef, 1, FALSE) != GetBattlerType(battlerDef, 0, FALSE)) - MulByTypeEffectiveness(&modifier, move, moveType, battlerDef, GetBattlerType(battlerDef, 1, FALSE), battlerAtk, recordAbilities); - if (GetBattlerType(battlerDef, 2, FALSE) != TYPE_MYSTERY && GetBattlerType(battlerDef, 2, FALSE) != GetBattlerType(battlerDef, 1, FALSE) - && GetBattlerType(battlerDef, 2, FALSE) != GetBattlerType(battlerDef, 0, FALSE)) - MulByTypeEffectiveness(&modifier, move, moveType, battlerDef, GetBattlerType(battlerDef, 2, FALSE), battlerAtk, recordAbilities); + MulByTypeEffectiveness(&modifier, move, moveType, battlerDef, types[0], battlerAtk, recordAbilities); + if (types[1] != types[0]) + MulByTypeEffectiveness(&modifier, move, moveType, battlerDef, types[1], battlerAtk, recordAbilities); + if (types[2] != TYPE_MYSTERY && types[2] != types[1] && types[2] != types[0]) + MulByTypeEffectiveness(&modifier, move, moveType, battlerDef, types[2], battlerAtk, recordAbilities); if (moveType == TYPE_FIRE && gDisableStructs[battlerDef].tarShot) modifier = uq4_12_multiply(modifier, UQ_4_12(2.0)); @@ -10639,8 +10638,9 @@ static inline uq4_12_t CalcTypeEffectivenessMultiplierInternal(u32 move, u32 mov } // Thousand Arrows ignores type modifiers for flying mons - if (!IsBattlerGrounded(battlerDef) && (gMovesInfo[move].ignoreTypeIfFlyingAndUngrounded) - && (GetBattlerType(battlerDef, 0, FALSE) == TYPE_FLYING || GetBattlerType(battlerDef, 1, FALSE) == TYPE_FLYING || GetBattlerType(battlerDef, 2, FALSE) == TYPE_FLYING)) + if (!IsBattlerGrounded(battlerDef) + && (gMovesInfo[move].ignoreTypeIfFlyingAndUngrounded) + && IS_BATTLER_OF_TYPE(battlerDef, TYPE_FLYING)) { modifier = UQ_4_12(1.0); } @@ -11059,9 +11059,15 @@ u16 GetBattleFormChangeTargetSpecies(u32 battler, u16 method) if (GetBattlerTeraType(battler) == formChanges[i].param1) targetSpecies = formChanges[i].targetSpecies; break; - case FORM_CHANGE_BATTLE_ATTACK: - case FORM_CHANGE_BATTLE_KINGS_SHIELD: - targetSpecies = formChanges[i].targetSpecies; + case FORM_CHANGE_BATTLE_BEFORE_MOVE: + if (formChanges[i].param1 == gCurrentMove + && (formChanges[i].param2 == ABILITY_NONE || formChanges[i].param2 == GetBattlerAbility(battler))) + targetSpecies = formChanges[i].targetSpecies; + break; + case FORM_CHANGE_BATTLE_BEFORE_MOVE_CATEGORY: + if (formChanges[i].param1 == GetBattleMoveCategory(gCurrentMove) + && (formChanges[i].param2 == ABILITY_NONE || formChanges[i].param2 == GetBattlerAbility(battler))) + targetSpecies = formChanges[i].targetSpecies; break; } } @@ -11149,8 +11155,9 @@ bool32 TryBattleFormChange(u32 battler, u32 method) bool32 DoBattlersShareType(u32 battler1, u32 battler2) { s32 i; - u8 types1[3] = {GetBattlerType(battler1, 0, FALSE), GetBattlerType(battler1, 1, FALSE), GetBattlerType(battler1, 2, FALSE)}; - u8 types2[3] = {GetBattlerType(battler2, 0, FALSE), GetBattlerType(battler2, 1, FALSE), GetBattlerType(battler2, 2, FALSE)}; + u32 types1[3], types2[3]; + GetBattlerTypes(battler1, FALSE, types1); + GetBattlerTypes(battler2, FALSE, types2); if (types1[2] == TYPE_MYSTERY) types1[2] = types1[0]; @@ -11921,31 +11928,40 @@ bool8 IsMonBannedFromSkyBattles(u16 species) } } -u8 GetBattlerType(u32 battler, u8 typeIndex, bool32 ignoreTera) +void GetBattlerTypes(u32 battler, bool32 ignoreTera, u32 types[static 3]) { - u32 teraType = GetBattlerTeraType(battler); - u16 types[3] = {0}; + // Terastallization. + bool32 isTera = GetActiveGimmick(battler) == GIMMICK_TERA; + if (!ignoreTera && isTera) + { + u32 teraType = GetBattlerTeraType(battler); + if (teraType != TYPE_STELLAR) + { + types[0] = types[1] = types[2] = teraType; + return; + } + } + types[0] = gBattleMons[battler].types[0]; types[1] = gBattleMons[battler].types[1]; types[2] = gBattleMons[battler].types[2]; - // Handle Terastallization - if (GetActiveGimmick(battler) == GIMMICK_TERA && teraType != TYPE_STELLAR && !ignoreTera) - return GetBattlerTeraType(battler); - - // Handle Roost's Flying-type suppression - if (typeIndex == 0 || typeIndex == 1) + // Roost. + if (!isTera && (gBattleResources->flags->flags[battler] & RESOURCE_FLAG_ROOST)) { - if (gBattleResources->flags->flags[battler] & RESOURCE_FLAG_ROOST - && GetActiveGimmick(battler) != GIMMICK_TERA) - { - if (types[0] == TYPE_FLYING && types[1] == TYPE_FLYING) - return B_ROOST_PURE_FLYING >= GEN_5 ? TYPE_NORMAL : TYPE_MYSTERY; - else - return types[typeIndex] == TYPE_FLYING ? TYPE_MYSTERY : types[typeIndex]; - } + if (types[0] == TYPE_FLYING && types[1] == TYPE_FLYING) + types[0] = types[1] = B_ROOST_PURE_FLYING >= GEN_5 ? TYPE_NORMAL : TYPE_MYSTERY; + else if (types[0] == TYPE_FLYING) + types[0] = TYPE_MYSTERY; + else if (types[1] == TYPE_FLYING) + types[1] = TYPE_MYSTERY; } +} +u32 GetBattlerType(u32 battler, u32 typeIndex, bool32 ignoreTera) +{ + u32 types[3]; + GetBattlerTypes(battler, ignoreTera, types); return types[typeIndex]; } @@ -12052,7 +12068,7 @@ void TryActivateSleepClause(u32 battler, u32 indexInParty) return; } - if (FlagGet(B_FLAG_SLEEP_CLAUSE)) + if (IsSleepClauseEnabled()) gBattleStruct->monCausingSleepClause[GetBattlerSide(battler)] = indexInParty; } @@ -12060,7 +12076,7 @@ void TryDeactivateSleepClause(u32 battlerSide, u32 indexInParty) { // If the pokemon on the given side at the given index in the party is the one causing Sleep Clause to be active, // set monCausingSleepClause[battlerSide] = PARTY_SIZE, which means Sleep Clause is not active for the given side - if (FlagGet(B_FLAG_SLEEP_CLAUSE) && gBattleStruct->monCausingSleepClause[battlerSide] == indexInParty) + if (IsSleepClauseEnabled() && gBattleStruct->monCausingSleepClause[battlerSide] == indexInParty) gBattleStruct->monCausingSleepClause[battlerSide] = PARTY_SIZE; } @@ -12069,7 +12085,16 @@ bool32 IsSleepClauseActiveForSide(u32 battlerSide) // If monCausingSleepClause[battlerSide] == PARTY_SIZE, Sleep Clause is not active for the given side. // If monCausingSleepClause[battlerSide] < PARTY_SIZE, it means it is storing the index of the mon that is causing Sleep Clause to be active, // from which it follows that Sleep Clause is active. - return (FlagGet(B_FLAG_SLEEP_CLAUSE) && (gBattleStruct->monCausingSleepClause[battlerSide] < PARTY_SIZE)); + return (IsSleepClauseEnabled() && (gBattleStruct->monCausingSleepClause[battlerSide] < PARTY_SIZE)); +} + +bool32 IsSleepClauseEnabled() +{ + if (B_SLEEP_CLAUSE) + return TRUE; + if (FlagGet(B_FLAG_SLEEP_CLAUSE)) + return TRUE; + return FALSE; } void ClearDamageCalcResults(void) diff --git a/src/data/party_menu.h b/src/data/party_menu.h index 841cedca88..3bc86593fa 100644 --- a/src/data/party_menu.h +++ b/src/data/party_menu.h @@ -686,39 +686,41 @@ static const u16 sUnusedData[] = 0x0121, 0x013b, 0x000f, 0x0013, 0x0039, 0x0046, 0x0094, 0x00f9, 0x007f, 0x0123, }; +static const u8 sText_Trade4[] = _("TRADE"); + struct { const u8 *text; TaskFunc func; } static const sCursorOptions[MENU_FIELD_MOVES] = { - [MENU_SUMMARY] = {gText_Summary5, CursorCb_Summary}, - [MENU_SWITCH] = {gText_Switch2, CursorCb_Switch}, + [MENU_SUMMARY] = {COMPOUND_STRING("SUMMARY"), CursorCb_Summary}, + [MENU_SWITCH] = {COMPOUND_STRING("SWITCH"), CursorCb_Switch}, [MENU_CANCEL1] = {gText_Cancel2, CursorCb_Cancel1}, - [MENU_ITEM] = {gText_Item, CursorCb_Item}, + [MENU_ITEM] = {COMPOUND_STRING("ITEM"), CursorCb_Item}, [MENU_GIVE] = {gMenuText_Give, CursorCb_Give}, - [MENU_TAKE_ITEM] = {gText_Take, CursorCb_TakeItem}, - [MENU_MAIL] = {gText_Mail, CursorCb_Mail}, - [MENU_TAKE_MAIL] = {gText_Take2, CursorCb_TakeMail}, - [MENU_READ] = {gText_Read2, CursorCb_Read}, + [MENU_TAKE_ITEM] = {COMPOUND_STRING("TAKE"), CursorCb_TakeItem}, + [MENU_MAIL] = {COMPOUND_STRING("MAIL"), CursorCb_Mail}, + [MENU_TAKE_MAIL] = {COMPOUND_STRING("TAKE"), CursorCb_TakeMail}, + [MENU_READ] = {COMPOUND_STRING("READ"), CursorCb_Read}, [MENU_CANCEL2] = {gText_Cancel2, CursorCb_Cancel2}, - [MENU_SHIFT] = {gText_Shift, CursorCb_SendMon}, - [MENU_SEND_OUT] = {gText_SendOut, CursorCb_SendMon}, - [MENU_ENTER] = {gText_Enter, CursorCb_Enter}, - [MENU_NO_ENTRY] = {gText_NoEntry, CursorCb_NoEntry}, - [MENU_STORE] = {gText_Store, CursorCb_Store}, + [MENU_SHIFT] = {COMPOUND_STRING("SHIFT"), CursorCb_SendMon}, + [MENU_SEND_OUT] = {COMPOUND_STRING("SEND OUT"), CursorCb_SendMon}, + [MENU_ENTER] = {COMPOUND_STRING("ENTER"), CursorCb_Enter}, + [MENU_NO_ENTRY] = {COMPOUND_STRING("NO ENTRY"), CursorCb_NoEntry}, + [MENU_STORE] = {COMPOUND_STRING("STORE"), CursorCb_Store}, [MENU_REGISTER] = {gText_Register, CursorCb_Register}, - [MENU_TRADE1] = {gText_Trade4, CursorCb_Trade1}, - [MENU_TRADE2] = {gText_Trade4, CursorCb_Trade2}, + [MENU_TRADE1] = {sText_Trade4, CursorCb_Trade1}, + [MENU_TRADE2] = {sText_Trade4, CursorCb_Trade2}, [MENU_TOSS] = {gMenuText_Toss, CursorCb_Toss}, - [MENU_CATALOG_BULB] = {gText_LightBulb, CursorCb_CatalogBulb}, - [MENU_CATALOG_OVEN] = {gText_MicrowaveOven, CursorCb_CatalogOven}, - [MENU_CATALOG_WASHING] = {gText_WashingMachine, CursorCb_CatalogWashing}, - [MENU_CATALOG_FRIDGE] = {gText_Refrigerator, CursorCb_CatalogFridge}, - [MENU_CATALOG_FAN] = {gText_ElectricFan, CursorCb_CatalogFan}, - [MENU_CATALOG_MOWER] = {gText_LawnMower, CursorCb_CatalogMower}, - [MENU_CHANGE_FORM] = {gText_ChangeForm, CursorCb_ChangeForm}, - [MENU_CHANGE_ABILITY] = {gText_ChangeAbility, CursorCb_ChangeAbility}, + [MENU_CATALOG_BULB] = {COMPOUND_STRING("Light bulb"), CursorCb_CatalogBulb}, + [MENU_CATALOG_OVEN] = {COMPOUND_STRING("Microwave oven"), CursorCb_CatalogOven}, + [MENU_CATALOG_WASHING] = {COMPOUND_STRING("Washing machine"), CursorCb_CatalogWashing}, + [MENU_CATALOG_FRIDGE] = {COMPOUND_STRING("Refrigerator"), CursorCb_CatalogFridge}, + [MENU_CATALOG_FAN] = {COMPOUND_STRING("Electric fan"), CursorCb_CatalogFan}, + [MENU_CATALOG_MOWER] = {COMPOUND_STRING("Lawn mower"), CursorCb_CatalogMower}, + [MENU_CHANGE_FORM] = {COMPOUND_STRING("Change form"), CursorCb_ChangeForm}, + [MENU_CHANGE_ABILITY] = {COMPOUND_STRING("Change Ability"), CursorCb_ChangeAbility}, }; static const u8 sPartyMenuAction_SummarySwitchCancel[] = {MENU_SUMMARY, MENU_SWITCH, MENU_CANCEL1}; diff --git a/src/data/pokemon/form_change_tables.h b/src/data/pokemon/form_change_tables.h index 4af68ce318..340bdb1fa6 100644 --- a/src/data/pokemon/form_change_tables.h +++ b/src/data/pokemon/form_change_tables.h @@ -789,11 +789,12 @@ static const struct FormChange sFurfrouFormChangeTable[] = { #if P_FAMILY_HONEDGE static const struct FormChange sAegislashFormChangeTable[] = { - {FORM_CHANGE_BATTLE_ATTACK, SPECIES_AEGISLASH_BLADE}, - {FORM_CHANGE_BATTLE_KINGS_SHIELD, SPECIES_AEGISLASH_SHIELD}, - {FORM_CHANGE_BATTLE_SWITCH, SPECIES_AEGISLASH_SHIELD}, - {FORM_CHANGE_FAINT, SPECIES_AEGISLASH_SHIELD}, - {FORM_CHANGE_END_BATTLE, SPECIES_AEGISLASH_SHIELD}, + {FORM_CHANGE_BATTLE_BEFORE_MOVE_CATEGORY, SPECIES_AEGISLASH_BLADE, DAMAGE_CATEGORY_PHYSICAL, ABILITY_STANCE_CHANGE}, + {FORM_CHANGE_BATTLE_BEFORE_MOVE_CATEGORY, SPECIES_AEGISLASH_BLADE, DAMAGE_CATEGORY_SPECIAL, ABILITY_STANCE_CHANGE}, + {FORM_CHANGE_BATTLE_BEFORE_MOVE, SPECIES_AEGISLASH_SHIELD, MOVE_KINGS_SHIELD, ABILITY_STANCE_CHANGE}, + {FORM_CHANGE_BATTLE_SWITCH, SPECIES_AEGISLASH_SHIELD}, + {FORM_CHANGE_FAINT, SPECIES_AEGISLASH_SHIELD}, + {FORM_CHANGE_END_BATTLE, SPECIES_AEGISLASH_SHIELD}, {FORM_CHANGE_TERMINATOR}, }; #endif //P_FAMILY_HONEDGE diff --git a/src/data/script_menu.h b/src/data/script_menu.h index 3b29171327..fc0b574a2f 100644 --- a/src/data/script_menu.h +++ b/src/data/script_menu.h @@ -1,23 +1,23 @@ // multichoice lists static const struct MenuAction MultichoiceList_BrineyOnDewford[] = { - {gText_Petalburg}, - {gText_Slateport}, + {COMPOUND_STRING("PETALBURG")}, + {COMPOUND_STRING("SLATEPORT")}, {gText_Exit}, }; static const struct MenuAction MultichoiceList_EnterInfo[] = { - {gText_Enter2}, + {COMPOUND_STRING("ENTER")}, {gText_Info2}, {gText_Exit}, }; static const struct MenuAction MultichoiceList_ContestInfo[] = { - {gText_WhatsAContest}, - {gText_TypesOfContests}, - {gText_Ranks}, + {COMPOUND_STRING("What's a CONTEST?")}, + {COMPOUND_STRING("Types of CONTESTS")}, + {COMPOUND_STRING("Ranks")}, {gText_Cancel2}, }; @@ -56,30 +56,30 @@ static const struct MenuAction MultichoiceList_RegisterMenu[] = static const struct MenuAction MultichoiceList_Bike[] = { - {gText_Mach}, - {gText_Acro}, + {COMPOUND_STRING("MACH")}, + {COMPOUND_STRING("ACRO")}, }; static const struct MenuAction MultichoiceList_StatusInfo[] = { - {gText_Psn}, - {gText_Par}, - {gText_Slp}, - {gText_Brn}, - {gText_Frz}, + {COMPOUND_STRING("PSN")}, + {COMPOUND_STRING("PAR")}, + {COMPOUND_STRING("SLP")}, + {COMPOUND_STRING("BRN")}, + {COMPOUND_STRING("FRZ")}, {gText_Exit}, }; static const struct MenuAction MultichoiceList_BrineyOffDewford[] = { - {gText_Dewford}, + {COMPOUND_STRING("DEWFORD")}, {gText_Exit}, }; static const struct MenuAction MultichoiceList_ViewedPaintings[] = { - {gText_SawIt}, - {gText_NotYet}, + {COMPOUND_STRING("Saw it")}, + {COMPOUND_STRING("Not yet")}, }; static const struct MenuAction MultichoiceList_YesNoInfo2[] = @@ -91,8 +91,8 @@ static const struct MenuAction MultichoiceList_YesNoInfo2[] = static const struct MenuAction MultichoiceList_ChallengeInfo[] = { - {gText_Challenge}, - {gText_Info3}, + {COMPOUND_STRING("CHALLENGE")}, + {COMPOUND_STRING("INFO")}, {gText_Exit}, }; @@ -210,82 +210,82 @@ static const struct MenuAction MultichoiceList_Mechadoll5_Q3[] = static const struct MenuAction MultichoiceList_VendingMachine[] = { - {gText_FreshWaterAndPrice}, - {gText_SodaPopAndPrice}, - {gText_LemonadeAndPrice}, + {COMPOUND_STRING("FRESH WATER{CLEAR_TO 0x48}¥200")}, + {COMPOUND_STRING("SODA POP{CLEAR_TO 0x48}¥300")}, + {COMPOUND_STRING("LEMONADE{CLEAR_TO 0x48}¥350")}, {gText_Exit}, }; static const struct MenuAction MultichoiceList_MachBikeInfo[] = { - {gText_HowToRide}, - {gText_HowToTurn}, - {gText_SandySlopes}, + {COMPOUND_STRING("HOW TO RIDE")}, + {COMPOUND_STRING("HOW TO TURN")}, + {COMPOUND_STRING("SANDY SLOPES")}, {gText_Exit}, }; static const struct MenuAction MultichoiceList_AcroBikeInfo[] = { - {gText_Wheelies}, - {gText_BunnyHops}, - {gText_Jump}, + {COMPOUND_STRING("WHEELIES")}, + {COMPOUND_STRING("BUNNY-HOPS")}, + {COMPOUND_STRING("JUMP")}, {gText_Exit}, }; static const struct MenuAction MultichoiceList_Satisfaction[] = { - {gText_Satisfied}, - {gText_Dissatisfied}, + {COMPOUND_STRING("Satisfied")}, + {COMPOUND_STRING("Dissatisfied")}, }; static const struct MenuAction MultichoiceList_SternDeepSea[] = { - {gText_DeepSeaTooth}, - {gText_DeepSeaScale}, + {COMPOUND_STRING("DEEPSEATOOTH")}, + {COMPOUND_STRING("DEEPSEASCALE")}, {gText_Exit}, }; static const struct MenuAction MultichoiceList_UnusedAshVendor[] = { - {gText_BlueFlute2}, - {gText_YellowFlute2}, - {gText_RedFlute2}, - {gText_WhiteFlute2}, - {gText_BlackFlute2}, - {gText_GlassChair}, - {gText_GlassDesk}, + {COMPOUND_STRING("BLUE FLUTE")}, + {COMPOUND_STRING("YELLOW FLUTE")}, + {COMPOUND_STRING("RED FLUTE")}, + {COMPOUND_STRING("WHITE FLUTE")}, + {COMPOUND_STRING("BLACK FLUTE")}, + {COMPOUND_STRING("GLASS CHAIR")}, + {COMPOUND_STRING("GLASS DESK")}, {gText_Cancel2}, }; static const struct MenuAction MultichoiceList_GameCornerDolls[] = { - {gText_TreeckoDollAndPrice}, - {gText_TorchicDollAndPrice}, - {gText_MudkipDollAndPrice}, + {COMPOUND_STRING("TREECKO DOLL 1,000 COINS")}, + {COMPOUND_STRING("TORCHIC DOLL 1,000 COINS")}, + {COMPOUND_STRING("MUDKIP DOLL 1,000 COINS")}, {gText_Exit}, }; static const struct MenuAction MultichoiceList_GameCornerTMs[] = { - {gText_TM32AndPrice}, - {gText_TM29AndPrice}, - {gText_TM35AndPrice}, - {gText_TM24AndPrice}, - {gText_TM13AndPrice}, + {COMPOUND_STRING("TM32{CLEAR_TO 0x48}1,500 COINS")}, + {COMPOUND_STRING("TM29{CLEAR_TO 0x48}3,500 COINS")}, + {COMPOUND_STRING("TM35{CLEAR_TO 0x48}4,000 COINS")}, + {COMPOUND_STRING("TM24{CLEAR_TO 0x48}4,000 COINS")}, + {COMPOUND_STRING("TM13{CLEAR_TO 0x48}4,000 COINS")}, {gText_Exit}, }; static const struct MenuAction MultichoiceList_GameCornerCoins[] = { - {gText_50CoinsAndPrice}, - {gText_500CoinsAndPrice}, + {COMPOUND_STRING(" 50 COINS ¥1,000")}, + {COMPOUND_STRING("500 COINS ¥10,000")}, {gText_Exit}, }; static const struct MenuAction MultichoiceList_HowsFishing[] = { - {gText_Excellent2}, - {gText_NotSoGood}, + {COMPOUND_STRING("Excellent")}, + {COMPOUND_STRING("Not so good")}, }; static const struct MenuAction MultichoiceList_SSTidalSlateportWithBF[] = @@ -304,8 +304,8 @@ static const struct MenuAction MultichoiceList_SSTidalBattleFrontier[] = static const struct MenuAction MultichoiceList_RightLeft[] = { - {gText_Right}, - {gText_Left}, + {COMPOUND_STRING("Right")}, + {COMPOUND_STRING("Left")}, }; static const struct MenuAction MultichoiceList_SSTidalSlateportNoBF[] = @@ -452,8 +452,8 @@ static const struct MenuAction MultichoiceList_TourneyNoRecord[] = static const struct MenuAction MultichoiceList_Tent[] = { - {gText_RedTent}, - {gText_BlueTent}, + {COMPOUND_STRING("RED TENT")}, + {COMPOUND_STRING("BLUE TENT")}, }; static const struct MenuAction MultichoiceList_LinkServicesNoBerry[] = @@ -473,9 +473,9 @@ static const struct MenuAction MultichoiceList_YesNoInfo[] = static const struct MenuAction MultichoiceList_BattleMode[] = { - {gText_SingleBattle}, - {gText_DoubleBattle}, - {gText_MultiBattle}, + {COMPOUND_STRING("SINGLE BATTLE")}, + {COMPOUND_STRING("DOUBLE BATTLE")}, + {COMPOUND_STRING("MULTI BATTLE")}, {gText_Info2}, {gText_Exit}, }; @@ -506,46 +506,46 @@ static const struct MenuAction MultichoiceList_LinkServicesNoRecordBerry[] = static const struct MenuAction MultichoiceList_WirelessMinigame[] = { - {gText_PokemonJump}, - {gText_DodrioBerryPicking}, + {COMPOUND_STRING("POKéMON JUMP")}, + {COMPOUND_STRING("DODRIO BERRY-PICKING")}, {gText_Exit}, }; static const struct MenuAction MultichoiceList_LinkLeader[] = { - {gText_JoinGroup}, - {gText_BecomeLeader}, + {COMPOUND_STRING("JOIN GROUP")}, + {COMPOUND_STRING("BECOME LEADER")}, {gText_Exit}, }; static const struct MenuAction MultichoiceList_ContestRank[] = { - {gText_NormalRank}, - {gText_SuperRank}, - {gText_HyperRank}, - {gText_MasterRank}, + {COMPOUND_STRING("NORMAL RANK")}, + {COMPOUND_STRING("SUPER RANK")}, + {COMPOUND_STRING("HYPER RANK")}, + {COMPOUND_STRING("MASTER RANK")}, {gText_Exit}, }; static const struct MenuAction MultichoiceList_FrontierItemChoose[] = { - {gText_BattleBag}, - {gText_HeldItem}, + {COMPOUND_STRING("BATTLE BAG")}, + {COMPOUND_STRING("HELD ITEM")}, {gText_Exit}, }; static const struct MenuAction MultichoiceList_LinkContestInfo[] = { - {gText_LinkContest}, - {gText_AboutE_Mode}, - {gText_AboutG_Mode}, + {COMPOUND_STRING("LINK CONTEST")}, + {COMPOUND_STRING("ABOUT E-MODE")}, + {COMPOUND_STRING("ABOUT G-MODE")}, {gText_Cancel2}, }; static const struct MenuAction MultichoiceList_LinkContestMode[] = { - {gText_E_Mode}, - {gText_G_Mode}, + {COMPOUND_STRING("E-MODE")}, + {COMPOUND_STRING("G-MODE")}, {gText_Exit}, }; @@ -563,9 +563,9 @@ static const struct MenuAction MultichoiceList_ForcedStartMenu[] = static const struct MenuAction MultichoiceList_FrontierGamblerBet[] = { - {gText_5BP}, - {gText_10BP}, - {gText_15BP}, + {COMPOUND_STRING(" 5BP")}, + {COMPOUND_STRING("10BP")}, + {COMPOUND_STRING("15BP")}, {gText_Exit}, }; @@ -600,32 +600,32 @@ static const struct MenuAction MultichoiceList_UnusedSSTidal4[] = static const struct MenuAction MultichoiceList_Fossil[] = { - {gText_ClawFossil}, - {gText_RootFossil}, + {COMPOUND_STRING("CLAW FOSSIL")}, + {COMPOUND_STRING("ROOT FOSSIL")}, {gText_Exit}, }; static const struct MenuAction MultichoiceList_YesNo[] = { {gText_Yes}, - {gText_No4}, + {COMPOUND_STRING("NO")}, }; static const struct MenuAction MultichoiceList_FrontierRules[] = { - {gText_TwoStyles}, - {gText_Lv50_3}, - {gText_OpenLevel2}, - {gText_MonTypeAndNo}, - {gText_HoldItems}, + {COMPOUND_STRING("TWO STYLES")}, + {COMPOUND_STRING("LV. 50")}, + {COMPOUND_STRING("OPEN LEVEL")}, + {COMPOUND_STRING("{PKMN} TYPE & NO.")}, + {COMPOUND_STRING("HOLD ITEMS")}, {gText_Exit}, }; static const struct MenuAction MultichoiceList_FrontierPassInfo[] = { - {gText_Symbols2}, - {gText_Record3}, - {gText_BattlePts}, + {COMPOUND_STRING("SYMBOLS")}, + {COMPOUND_STRING("RECORD")}, + {COMPOUND_STRING("BATTLE PTS")}, {gText_Exit}, }; @@ -640,18 +640,18 @@ static const struct MenuAction MultichoiceList_BattleArenaRules[] = static const struct MenuAction MultichoiceList_BattleTowerRules[] = { - {gText_TowerInfo}, - {gText_BattleMon}, - {gText_BattleSalon}, - {gText_MultiLink2}, + {COMPOUND_STRING("TOWER INFO")}, + {COMPOUND_STRING("BATTLE {PKMN}")}, + {COMPOUND_STRING("BATTLE SALON")}, + {COMPOUND_STRING("MULTI-LINK")}, {gText_Exit}, }; static const struct MenuAction MultichoiceList_BattleDomeRules[] = { - {gText_Matchup}, - {gText_TourneyTree}, - {gText_DoubleKO}, + {COMPOUND_STRING("MATCHUP")}, + {COMPOUND_STRING("TOURNEY TREE")}, + {COMPOUND_STRING("DOUBLE KO")}, {gText_Exit}, }; @@ -661,7 +661,7 @@ static const struct MenuAction MultichoiceList_BattleFactoryRules[] = {gText_SwapPartners}, {gText_SwapNumber}, {gText_SwapNotes}, - {gText_OpenLevel3}, + {COMPOUND_STRING("OPEN LEVEL")}, {gText_Exit}, }; @@ -677,18 +677,18 @@ static const struct MenuAction MultichoiceList_BattlePalaceRules[] = static const struct MenuAction MultichoiceList_BattlePyramidRules[] = { - {gText_PyramidPokemon}, - {gText_PyramidTrainers}, - {gText_PyramidMaze}, - {gText_BattleBag2}, + {COMPOUND_STRING("PYRAMID: POKéMON")}, + {COMPOUND_STRING("PYRAMID: TRAINERS")}, + {COMPOUND_STRING("PYRAMID: MAZE")}, + {COMPOUND_STRING("BATTLE BAG")}, {gText_Exit}, }; static const struct MenuAction MultichoiceList_BattlePikeRules[] = { - {gText_PokenavAndBag}, - {gText_HeldItems}, - {gText_PokemonOrder}, + {COMPOUND_STRING("POKéNAV AND BAG")}, + {COMPOUND_STRING("HELD ITEMS")}, + {COMPOUND_STRING("POKéMON ORDER")}, {gText_Exit}, }; @@ -722,24 +722,24 @@ static const struct MenuAction MultichoiceList_GoOnRetire[] = static const struct MenuAction MultichoiceList_TVLati[] = { - {gText_Red}, - {gText_Blue}, + {COMPOUND_STRING("RED")}, + {COMPOUND_STRING("BLUE")}, }; static const struct MenuAction MultichoiceList_BattleTowerFeelings[] = { - {gText_IllBattleNow}, - {gText_IWon}, - {gText_ILost}, - {gText_IWontTell}, + {COMPOUND_STRING("I'll battle now!")}, + {COMPOUND_STRING("I won!")}, + {COMPOUND_STRING("I lost!")}, + {COMPOUND_STRING("I won't tell.")}, }; static const struct MenuAction MultichoiceList_WheresRayquaza[] = { - {gText_CaveOfOrigin}, - {gText_MtPyre}, - {gText_SkyPillar}, - {gText_DontRemember}, + {COMPOUND_STRING("CAVE OF ORIGIN")}, + {COMPOUND_STRING("MT. PYRE")}, + {COMPOUND_STRING("SKY PILLAR")}, + {COMPOUND_STRING("Don't remember")}, }; static const struct MenuAction MultichoiceList_SlateportTentRules[] = @@ -773,8 +773,8 @@ static const struct MenuAction MultichoiceList_TagMatchType[] = static const struct MenuAction MultichoiceList_BerryPlot[] = { - {gText_Fertilize}, - {gText_PlantBerry}, + {COMPOUND_STRING("FERTILIZE")}, + {COMPOUND_STRING("PLANT BERRY")}, {gText_Exit}, }; diff --git a/src/field_specials.c b/src/field_specials.c index f5154f8424..680b527dc7 100644 --- a/src/field_specials.c +++ b/src/field_specials.c @@ -148,6 +148,15 @@ static void BufferFanClubTrainerName_(struct LinkBattleRecords *, u8, u8); static void BufferFanClubTrainerName_(u8 whichLinkTrainer, u8 whichNPCTrainer); #endif //FREE_LINK_BATTLE_RECORDS +static const u8 sText_BigGuy[] = _("Big guy"); +static const u8 sText_BigGirl[] = _("Big girl"); +static const u8 sText_Son[] = _("son"); +static const u8 sText_Daughter[] = _("daughter"); +static const u8 sText_99TimesPlus[] = _("99 times +"); +static const u8 sText_1MinutePlus[] = _("1 minute +"); +static const u8 sText_SpaceSeconds[] = _(" seconds"); +static const u8 sText_SpaceTimes[] = _(" time(s)"); + void Special_ShowDiploma(void) { SetMainCallback2(CB2_ShowDiploma); @@ -191,11 +200,11 @@ static void DetermineCyclingRoadResults(u32 numFrames, u8 numBikeCollisions) if (numBikeCollisions < 100) { ConvertIntToDecimalStringN(gStringVar1, numBikeCollisions, STR_CONV_MODE_LEFT_ALIGN, 2); - StringAppend(gStringVar1, gText_SpaceTimes); + StringAppend(gStringVar1, sText_SpaceTimes); } else { - StringCopy(gStringVar1, gText_99TimesPlus); + StringCopy(gStringVar1, sText_99TimesPlus); } if (numFrames < 3600) @@ -203,11 +212,11 @@ static void DetermineCyclingRoadResults(u32 numFrames, u8 numBikeCollisions) ConvertIntToDecimalStringN(gStringVar2, numFrames / 60, STR_CONV_MODE_RIGHT_ALIGN, 2); gStringVar2[2] = CHAR_DEC_SEPARATOR; ConvertIntToDecimalStringN(&gStringVar2[3], ((numFrames % 60) * 100) / 60, STR_CONV_MODE_LEADING_ZEROS, 2); - StringAppend(gStringVar2, gText_SpaceSeconds); + StringAppend(gStringVar2, sText_SpaceSeconds); } else { - StringCopy(gStringVar2, gText_1MinutePlus); + StringCopy(gStringVar2, sText_1MinutePlus); } result = 0; @@ -916,17 +925,17 @@ u8 GetPlayerTrainerIdOnesDigit(void) void GetPlayerBigGuyGirlString(void) { if (gSaveBlock2Ptr->playerGender == MALE) - StringCopy(gStringVar1, gText_BigGuy); + StringCopy(gStringVar1, sText_BigGuy); else - StringCopy(gStringVar1, gText_BigGirl); + StringCopy(gStringVar1, sText_BigGirl); } void GetRivalSonDaughterString(void) { if (gSaveBlock2Ptr->playerGender == MALE) - StringCopy(gStringVar1, gText_Daughter); + StringCopy(gStringVar1, sText_Daughter); else - StringCopy(gStringVar1, gText_Son); + StringCopy(gStringVar1, sText_Son); } u8 GetBattleOutcome(void) @@ -2421,89 +2430,89 @@ static const u8 *const sScrollableMultichoiceOptions[][MAX_SCROLL_MULTI_LENGTH] }, [SCROLL_MULTI_GLASS_WORKSHOP_VENDOR] = { - gText_BlueFlute, - gText_YellowFlute, - gText_RedFlute, - gText_WhiteFlute, - gText_BlackFlute, - gText_PrettyChair, - gText_PrettyDesk, + COMPOUND_STRING("BLUE FLUTE"), + COMPOUND_STRING("YELLOW FLUTE"), + COMPOUND_STRING("RED FLUTE"), + COMPOUND_STRING("WHITE FLUTE"), + COMPOUND_STRING("BLACK FLUTE"), + COMPOUND_STRING("PRETTY CHAIR"), + COMPOUND_STRING("PRETTY DESK"), gText_Exit }, [SCROLL_MULTI_POKEMON_FAN_CLUB_RATER] = { - gText_0Pts, - gText_10Pts, - gText_20Pts, - gText_30Pts, - gText_40Pts, - gText_50Pts, - gText_60Pts, - gText_70Pts, - gText_80Pts, - gText_90Pts, - gText_100Pts, - gText_QuestionMark + COMPOUND_STRING("0 pts"), + COMPOUND_STRING("10 pts"), + COMPOUND_STRING("20 pts"), + COMPOUND_STRING("30 pts"), + COMPOUND_STRING("40 pts"), + COMPOUND_STRING("50 pts"), + COMPOUND_STRING("60 pts"), + COMPOUND_STRING("70 pts"), + COMPOUND_STRING("80 pts"), + COMPOUND_STRING("90 pts"), + COMPOUND_STRING("100 pts"), + COMPOUND_STRING("?") }, [SCROLL_MULTI_BF_EXCHANGE_CORNER_DECOR_VENDOR_1] = { - gText_KissPoster16BP, - gText_KissCushion32BP, - gText_SmoochumDoll32BP, - gText_TogepiDoll48BP, - gText_MeowthDoll48BP, - gText_ClefairyDoll48BP, - gText_DittoDoll48BP, - gText_CyndaquilDoll80BP, - gText_ChikoritaDoll80BP, - gText_TotodileDoll80BP, + COMPOUND_STRING("KISS POSTER{CLEAR_TO 0x5E}16BP"), + COMPOUND_STRING("KISS CUSHION{CLEAR_TO 0x5E}32BP"), + COMPOUND_STRING("SMOOCHUM DOLL{CLEAR_TO 0x5E}32BP"), + COMPOUND_STRING("TOGEPI DOLL{CLEAR_TO 0x5E}48BP"), + COMPOUND_STRING("MEOWTH DOLL{CLEAR_TO 0x5E}48BP"), + COMPOUND_STRING("CLEFAIRY DOLL{CLEAR_TO 0x5E}48BP"), + COMPOUND_STRING("DITTO DOLL{CLEAR_TO 0x5E}48BP"), + COMPOUND_STRING("CYNDAQUIL DOLL{CLEAR_TO 0x5E}80BP"), + COMPOUND_STRING("CHIKORITA DOLL{CLEAR_TO 0x5E}80BP"), + COMPOUND_STRING("TOTODILE DOLL{CLEAR_TO 0x5E}80BP"), gText_Exit }, [SCROLL_MULTI_BF_EXCHANGE_CORNER_DECOR_VENDOR_2] = { - gText_LaprasDoll128BP, - gText_SnorlaxDoll128BP, - gText_VenusaurDoll256BP, - gText_CharizardDoll256BP, - gText_BlastoiseDoll256BP, + COMPOUND_STRING("LAPRAS DOLL{CLEAR_TO 0x58}128BP"), + COMPOUND_STRING("SNORLAX DOLL{CLEAR_TO 0x58}128BP"), + COMPOUND_STRING("VENUSAUR DOLL{CLEAR_TO 0x58}256BP"), + COMPOUND_STRING("CHARIZARD DOLL{CLEAR_TO 0x58}256BP"), + COMPOUND_STRING("BLASTOISE DOLL{CLEAR_TO 0x58}256BP"), gText_Exit }, [SCROLL_MULTI_BF_EXCHANGE_CORNER_VITAMIN_VENDOR] = { - gText_Protein1BP, - gText_Calcium1BP, - gText_Iron1BP, - gText_Zinc1BP, - gText_Carbos1BP, - gText_HpUp1BP, + COMPOUND_STRING("PROTEIN{CLEAR_TO 0x64}1BP"), + COMPOUND_STRING("CALCIUM{CLEAR_TO 0x64}1BP"), + COMPOUND_STRING("IRON{CLEAR_TO 0x64}1BP"), + COMPOUND_STRING("ZINC{CLEAR_TO 0x64}1BP"), + COMPOUND_STRING("CARBOS{CLEAR_TO 0x64}1BP"), + COMPOUND_STRING("HP UP{CLEAR_TO 0x64}1BP"), gText_Exit }, [SCROLL_MULTI_BF_EXCHANGE_CORNER_HOLD_ITEM_VENDOR] = { - gText_Leftovers48BP, - gText_WhiteHerb48BP, - gText_QuickClaw48BP, - gText_MentalHerb48BP, - gText_BrightPowder64BP, - gText_ChoiceBand64BP, - gText_KingsRock64BP, - gText_FocusBand64BP, - gText_ScopeLens64BP, + COMPOUND_STRING("LEFTOVERS{CLEAR_TO 0x5E}48BP"), + COMPOUND_STRING("WHITE HERB{CLEAR_TO 0x5E}48BP"), + COMPOUND_STRING("QUICK CLAW{CLEAR_TO 0x5E}48BP"), + COMPOUND_STRING("MENTAL HERB{CLEAR_TO 0x5E}48BP"), + COMPOUND_STRING("BRIGHTPOWDER{CLEAR_TO 0x5E}64BP"), + COMPOUND_STRING("CHOICE BAND{CLEAR_TO 0x5E}64BP"), + COMPOUND_STRING("KING'S ROCK{CLEAR_TO 0x5E}64BP"), + COMPOUND_STRING("FOCUS BAND{CLEAR_TO 0x5E}64BP"), + COMPOUND_STRING("SCOPE LENS{CLEAR_TO 0x5E}64BP"), gText_Exit }, [SCROLL_MULTI_BERRY_POWDER_VENDOR] = { - gText_EnergyPowder50, - gText_EnergyRoot80, - gText_HealPowder50, - gText_RevivalHerb300, - gText_Protein1000, - gText_Iron1000, - gText_Carbos1000, - gText_Calcium1000, - gText_Zinc1000, - gText_HPUp1000, - gText_PPUp3000, + COMPOUND_STRING("ENERGYPOWDER{CLEAR_TO 114}{FONT_SMALL}50"), + COMPOUND_STRING("ENERGY ROOT{CLEAR_TO 114}{FONT_SMALL}80"), + COMPOUND_STRING("HEAL POWDER{CLEAR_TO 114}{FONT_SMALL}50"), + COMPOUND_STRING("REVIVAL HERB{CLEAR_TO 108}{FONT_SMALL}300"), + COMPOUND_STRING("PROTEIN{CLEAR_TO 99}{FONT_SMALL}1,000"), + COMPOUND_STRING("IRON{CLEAR_TO 99}{FONT_SMALL}1,000"), + COMPOUND_STRING("CARBOS{CLEAR_TO 99}{FONT_SMALL}1,000"), + COMPOUND_STRING("CALCIUM{CLEAR_TO 99}{FONT_SMALL}1,000"), + COMPOUND_STRING("ZINC{CLEAR_TO 99}{FONT_SMALL}1,000"), + COMPOUND_STRING("HP UP{CLEAR_TO 99}{FONT_SMALL}1,000"), + COMPOUND_STRING("PP UP{CLEAR_TO 99}{FONT_SMALL}3,000"), gText_Exit }, [SCROLL_MULTI_BF_RECEPTIONIST] = @@ -2521,30 +2530,30 @@ static const u8 *const sScrollableMultichoiceOptions[][MAX_SCROLL_MULTI_LENGTH] }, [SCROLL_MULTI_BF_MOVE_TUTOR_1] = { - gText_Softboiled16BP, - gText_SeismicToss24BP, - gText_DreamEater24BP, - gText_MegaPunch24BP, - gText_MegaKick48BP, - gText_BodySlam48BP, - gText_RockSlide48BP, - gText_Counter48BP, - gText_ThunderWave48BP, - gText_SwordsDance48BP, + COMPOUND_STRING("SOFTBOILED{CLEAR_TO 0x4E}16BP"), + COMPOUND_STRING("SEISMIC TOSS{CLEAR_TO 0x4E}24BP"), + COMPOUND_STRING("DREAM EATER{CLEAR_TO 0x4E}24BP"), + COMPOUND_STRING("MEGA PUNCH{CLEAR_TO 0x4E}24BP"), + COMPOUND_STRING("MEGA KICK{CLEAR_TO 0x4E}48BP"), + COMPOUND_STRING("BODY SLAM{CLEAR_TO 0x4E}48BP"), + COMPOUND_STRING("ROCK SLIDE{CLEAR_TO 0x4E}48BP"), + COMPOUND_STRING("COUNTER{CLEAR_TO 0x4E}48BP"), + COMPOUND_STRING("THUNDER WAVE{CLEAR_TO 0x4E}48BP"), + COMPOUND_STRING("SWORDS DANCE{CLEAR_TO 0x4E}48BP"), gText_Exit }, [SCROLL_MULTI_BF_MOVE_TUTOR_2] = { - gText_DefenseCurl16BP, - gText_Snore24BP, - gText_MudSlap24BP, - gText_Swift24BP, - gText_IcyWind24BP, - gText_Endure48BP, - gText_PsychUp48BP, - gText_IcePunch48BP, - gText_ThunderPunch48BP, - gText_FirePunch48BP, + COMPOUND_STRING("DEFENSE CURL{CLEAR_TO 0x4E}16BP"), + COMPOUND_STRING("SNORE{CLEAR_TO 0x4E}24BP"), + COMPOUND_STRING("MUD-SLAP{CLEAR_TO 0x4E}24BP"), + COMPOUND_STRING("SWIFT{CLEAR_TO 0x4E}24BP"), + COMPOUND_STRING("ICY WIND{CLEAR_TO 0x4E}24BP"), + COMPOUND_STRING("ENDURE{CLEAR_TO 0x4E}48BP"), + COMPOUND_STRING("PSYCH UP{CLEAR_TO 0x4E}48BP"), + COMPOUND_STRING("ICE PUNCH{CLEAR_TO 0x4E}48BP"), + COMPOUND_STRING("THUNDERPUNCH{CLEAR_TO 0x4E}48BP"), + COMPOUND_STRING("FIRE PUNCH{CLEAR_TO 0x4E}48BP"), gText_Exit }, [SCROLL_MULTI_SS_TIDAL_DESTINATION] = diff --git a/src/item_menu.c b/src/item_menu.c index d885f0a8ec..709dded46b 100755 --- a/src/item_menu.c +++ b/src/item_menu.c @@ -212,6 +212,12 @@ static void ConfirmSell(u8); static void CancelSell(u8); static void Task_FadeAndCloseBagMenuIfMulch(u8 taskId); +static const u8 sText_Var1CantBeHeldHere[] = _("The {STR_VAR_1} can't be held\nhere."); +static const u8 sText_DepositHowManyVar1[] = _("Deposit how many\n{STR_VAR_1}?"); +static const u8 sText_DepositedVar2Var1s[] = _("Deposited {STR_VAR_2}\n{STR_VAR_1}."); +static const u8 sText_NoRoomForItems[] = _("There's no room to\nstore items."); +static const u8 sText_CantStoreImportantItems[] = _("Important items\ncan't be stored in\nthe PC!"); + static const struct BgTemplate sBgTemplates_ItemMenu[] = { { @@ -266,20 +272,20 @@ static const struct ListMenuTemplate sItemListMenu = }; static const struct MenuAction sItemMenuActions[] = { - [ACTION_USE] = {gMenuText_Use, {ItemMenu_UseOutOfBattle}}, - [ACTION_TOSS] = {gMenuText_Toss, {ItemMenu_Toss}}, - [ACTION_REGISTER] = {gMenuText_Register, {ItemMenu_Register}}, - [ACTION_GIVE] = {gMenuText_Give, {ItemMenu_Give}}, - [ACTION_CANCEL] = {gText_Cancel2, {ItemMenu_Cancel}}, - [ACTION_BATTLE_USE] = {gMenuText_Use, {ItemMenu_UseInBattle}}, - [ACTION_CHECK] = {gMenuText_Check, {ItemMenu_UseOutOfBattle}}, - [ACTION_WALK] = {gMenuText_Walk, {ItemMenu_UseOutOfBattle}}, - [ACTION_DESELECT] = {gMenuText_Deselect, {ItemMenu_Register}}, - [ACTION_CHECK_TAG] = {gMenuText_CheckTag, {ItemMenu_CheckTag}}, - [ACTION_CONFIRM] = {gMenuText_Confirm, {Task_FadeAndCloseBagMenu}}, - [ACTION_SHOW] = {gMenuText_Show, {ItemMenu_Show}}, - [ACTION_GIVE_FAVOR_LADY] = {gMenuText_Give2, {ItemMenu_GiveFavorLady}}, - [ACTION_CONFIRM_QUIZ_LADY] = {gMenuText_Confirm, {ItemMenu_ConfirmQuizLady}}, + [ACTION_USE] = {gMenuText_Use, {ItemMenu_UseOutOfBattle}}, + [ACTION_TOSS] = {gMenuText_Toss, {ItemMenu_Toss}}, + [ACTION_REGISTER] = {gMenuText_Register, {ItemMenu_Register}}, + [ACTION_GIVE] = {gMenuText_Give, {ItemMenu_Give}}, + [ACTION_CANCEL] = {gText_Cancel2, {ItemMenu_Cancel}}, + [ACTION_BATTLE_USE] = {gMenuText_Use, {ItemMenu_UseInBattle}}, + [ACTION_CHECK] = {COMPOUND_STRING("CHECK"), {ItemMenu_UseOutOfBattle}}, + [ACTION_WALK] = {COMPOUND_STRING("WALK"), {ItemMenu_UseOutOfBattle}}, + [ACTION_DESELECT] = {COMPOUND_STRING("CHECK TAG"), {ItemMenu_Register}}, + [ACTION_CHECK_TAG] = {COMPOUND_STRING("DESELECT"), {ItemMenu_CheckTag}}, + [ACTION_CONFIRM] = {gMenuText_Confirm, {Task_FadeAndCloseBagMenu}}, + [ACTION_SHOW] = {COMPOUND_STRING("SHOW"), {ItemMenu_Show}}, + [ACTION_GIVE_FAVOR_LADY] = {gMenuText_Give2, {ItemMenu_GiveFavorLady}}, + [ACTION_CONFIRM_QUIZ_LADY] = {gMenuText_Confirm, {ItemMenu_ConfirmQuizLady}}, [ACTION_DUMMY] = {gText_EmptyString2, {NULL}} }; @@ -2038,7 +2044,7 @@ static void Task_ItemContext_GiveToParty(u8 taskId) else if (!IsHoldingItemAllowed(gSpecialVar_ItemId)) { CopyItemName(gSpecialVar_ItemId, gStringVar1); - StringExpandPlaceholders(gStringVar4, gText_Var1CantBeHeldHere); + StringExpandPlaceholders(gStringVar4, sText_Var1CantBeHeldHere); DisplayItemMessage(taskId, FONT_NORMAL, gStringVar4, HandleErrorMessage); } else if (gBagPosition.pocket != KEYITEMS_POCKET && !ItemId_GetImportance(gSpecialVar_ItemId)) @@ -2236,7 +2242,7 @@ static void Task_ItemContext_Deposit(u8 taskId) { u8 *end = CopyItemNameHandlePlural(gSpecialVar_ItemId, gStringVar1, 2); WrapFontIdToFit(gStringVar1, end, FONT_NORMAL, WindowWidthPx(WIN_DESCRIPTION) - 10 - 6); - StringExpandPlaceholders(gStringVar4, gText_DepositHowManyVar1); + StringExpandPlaceholders(gStringVar4, sText_DepositHowManyVar1); FillWindowPixelBuffer(WIN_DESCRIPTION, PIXEL_FILL(0)); BagMenu_Print(WIN_DESCRIPTION, FONT_NORMAL, gStringVar4, 3, 1, 0, 0, 0, COLORID_NORMAL); AddItemQuantityWindow(ITEMWIN_QUANTITY); @@ -2276,7 +2282,7 @@ static void TryDepositItem(u8 taskId) if (ItemId_GetImportance(gSpecialVar_ItemId)) { // Can't deposit important items - BagMenu_Print(WIN_DESCRIPTION, FONT_NORMAL, gText_CantStoreImportantItems, 3, 1, 0, 0, 0, COLORID_NORMAL); + BagMenu_Print(WIN_DESCRIPTION, FONT_NORMAL, sText_CantStoreImportantItems, 3, 1, 0, 0, 0, COLORID_NORMAL); gTasks[taskId].func = WaitDepositErrorMessage; } else if (AddPCItem(gSpecialVar_ItemId, tItemCount) == TRUE) @@ -2285,14 +2291,14 @@ static void TryDepositItem(u8 taskId) u8 *end = CopyItemNameHandlePlural(gSpecialVar_ItemId, gStringVar1, tItemCount); WrapFontIdToFit(gStringVar1, end, FONT_NORMAL, WindowWidthPx(WIN_DESCRIPTION) - 10 - 6); ConvertIntToDecimalStringN(gStringVar2, tItemCount, STR_CONV_MODE_LEFT_ALIGN, MAX_ITEM_DIGITS); - StringExpandPlaceholders(gStringVar4, gText_DepositedVar2Var1s); + StringExpandPlaceholders(gStringVar4, sText_DepositedVar2Var1s); BagMenu_Print(WIN_DESCRIPTION, FONT_NORMAL, gStringVar4, 3, 1, 0, 0, 0, COLORID_NORMAL); gTasks[taskId].func = Task_RemoveItemFromBag; } else { // No room to deposit - BagMenu_Print(WIN_DESCRIPTION, FONT_NORMAL, gText_NoRoomForItems, 3, 1, 0, 0, 0, COLORID_NORMAL); + BagMenu_Print(WIN_DESCRIPTION, FONT_NORMAL, sText_NoRoomForItems, 3, 1, 0, 0, 0, COLORID_NORMAL); gTasks[taskId].func = WaitDepositErrorMessage; } } diff --git a/src/item_use.c b/src/item_use.c index c04d9b9911..2dc33b164c 100644 --- a/src/item_use.c +++ b/src/item_use.c @@ -80,6 +80,21 @@ static void CB2_OpenPokeblockFromBag(void); static void ItemUseOnFieldCB_Honey(u8 taskId); static bool32 IsValidLocationForVsSeeker(void); +static const u8 sText_CantDismountBike[] = _("You can't dismount your BIKE here.{PAUSE_UNTIL_PRESS}"); +static const u8 sText_ItemFinderNearby[] = _("Huh?\nThe ITEMFINDER's responding!\pThere's an item buried around here!{PAUSE_UNTIL_PRESS}"); +static const u8 sText_ItemFinderOnTop[] = _("Oh!\nThe ITEMFINDER's shaking wildly!{PAUSE_UNTIL_PRESS}"); +static const u8 sText_ItemFinderNothing[] = _("… … … …Nope!\nThere's no response.{PAUSE_UNTIL_PRESS}"); +static const u8 sText_CoinCase[] = _("Your COINS:\n{STR_VAR_1}{PAUSE_UNTIL_PRESS}"); +static const u8 sText_PowderQty[] = _("POWDER QTY: {STR_VAR_1}{PAUSE_UNTIL_PRESS}"); +static const u8 sText_BootedUpTM[] = _("Booted up a TM."); +static const u8 sText_BootedUpHM[] = _("Booted up an HM."); +static const u8 sText_TMHMContainedVar1[] = _("It contained\n{STR_VAR_1}.\pTeach {STR_VAR_1}\nto a POKéMON?"); +static const u8 sText_UsedVar2WildLured[] = _("{PLAYER} used the\n{STR_VAR_2}.\pWild POKéMON will be lured.{PAUSE_UNTIL_PRESS}"); +static const u8 sText_UsedVar2WildRepelled[] = _("{PLAYER} used the\n{STR_VAR_2}.\pWild POKéMON will be repelled.{PAUSE_UNTIL_PRESS}"); +static const u8 sText_PlayedPokeFluteCatchy[] = _("Played the POKé FLUTE.\pNow, that's a catchy tune!{PAUSE_UNTIL_PRESS}"); +static const u8 sText_PlayedPokeFlute[] = _("Played the POKé FLUTE."); +static const u8 sText_PokeFluteAwakenedMon[] = _("The POKé FLUTE awakened sleeping\nPOKéMON.{PAUSE_UNTIL_PRESS}"); + // EWRAM variables EWRAM_DATA static void(*sItemUseOnFieldCB)(u8 taskId) = NULL; @@ -168,7 +183,7 @@ void DisplayDadsAdviceCannotUseItemMessage(u8 taskId, bool8 isUsingRegisteredKey static void DisplayCannotDismountBikeMessage(u8 taskId, bool8 isUsingRegisteredKeyItemOnField) { - DisplayCannotUseItemMessage(taskId, isUsingRegisteredKeyItemOnField, gText_CantDismountBike); + DisplayCannotUseItemMessage(taskId, isUsingRegisteredKeyItemOnField, sText_CantDismountBike); } static void Task_CloseCantUseKeyItemMessage(u8 taskId) @@ -322,7 +337,7 @@ static void ItemUseOnFieldCB_Itemfinder(u8 taskId) if (ItemfinderCheckForHiddenItems(gMapHeader.events, taskId) == TRUE) gTasks[taskId].func = Task_UseItemfinder; else - DisplayItemMessageOnField(taskId, gText_ItemFinderNothing, Task_CloseItemfinderMessage); + DisplayItemMessageOnField(taskId, sText_ItemFinderNothing, Task_CloseItemfinderMessage); } // Define itemfinder task data @@ -615,7 +630,7 @@ static void PlayerFaceHiddenItem(u8 direction) static void Task_HiddenItemNearby(u8 taskId) { if (ObjectEventCheckHeldMovementStatus(&gObjectEvents[GetObjectEventIdByLocalIdAndMap(OBJ_EVENT_ID_PLAYER, 0, 0)]) == TRUE) - DisplayItemMessageOnField(taskId, gText_ItemFinderNearby, Task_CloseItemfinderMessage); + DisplayItemMessageOnField(taskId, sText_ItemFinderNearby, Task_CloseItemfinderMessage); } static void Task_StandingOnHiddenItem(u8 taskId) @@ -632,7 +647,7 @@ static void Task_StandingOnHiddenItem(u8 taskId) tCounter++; if (tCounter == 4) - DisplayItemMessageOnField(taskId, gText_ItemFinderOnTop, Task_CloseItemfinderMessage); + DisplayItemMessageOnField(taskId, sText_ItemFinderOnTop, Task_CloseItemfinderMessage); } } @@ -693,7 +708,7 @@ static void Task_AccessPokemonBoxLink(u8 taskId) void ItemUseOutOfBattle_CoinCase(u8 taskId) { ConvertIntToDecimalStringN(gStringVar1, GetCoins(), STR_CONV_MODE_LEFT_ALIGN, 4); - StringExpandPlaceholders(gStringVar4, gText_CoinCase); + StringExpandPlaceholders(gStringVar4, sText_CoinCase); if (!gTasks[taskId].tUsingRegisteredKeyItem) { @@ -708,7 +723,7 @@ void ItemUseOutOfBattle_CoinCase(u8 taskId) void ItemUseOutOfBattle_PowderJar(u8 taskId) { ConvertIntToDecimalStringN(gStringVar1, GetBerryPowder(), STR_CONV_MODE_LEFT_ALIGN, 5); - StringExpandPlaceholders(gStringVar4, gText_PowderQty); + StringExpandPlaceholders(gStringVar4, sText_PowderQty); if (!gTasks[taskId].tUsingRegisteredKeyItem) { @@ -858,9 +873,9 @@ void ItemUseOutOfBattle_DynamaxCandy(u8 taskId) void ItemUseOutOfBattle_TMHM(u8 taskId) { if (gSpecialVar_ItemId >= ITEM_HM01) - DisplayItemMessage(taskId, FONT_NORMAL, gText_BootedUpHM, BootUpSoundTMHM); // HM + DisplayItemMessage(taskId, FONT_NORMAL, sText_BootedUpHM, BootUpSoundTMHM); // HM else - DisplayItemMessage(taskId, FONT_NORMAL, gText_BootedUpTM, BootUpSoundTMHM); // TM + DisplayItemMessage(taskId, FONT_NORMAL, sText_BootedUpTM, BootUpSoundTMHM); // TM } static void BootUpSoundTMHM(u8 taskId) @@ -874,7 +889,7 @@ static void Task_ShowTMHMContainedMessage(u8 taskId) if (JOY_NEW(A_BUTTON | B_BUTTON)) { StringCopy(gStringVar1, GetMoveName(ItemIdToBattleMoveId(gSpecialVar_ItemId))); - StringExpandPlaceholders(gStringVar4, gText_TMHMContainedVar1); + StringExpandPlaceholders(gStringVar4, sText_TMHMContainedVar1); DisplayItemMessage(taskId, FONT_NORMAL, gStringVar4, UseTMHMYesNo); } } @@ -1015,13 +1030,13 @@ void ItemUseOutOfBattle_BlackWhiteFlute(u8 taskId) { FlagSet(FLAG_SYS_ENC_UP_ITEM); FlagClear(FLAG_SYS_ENC_DOWN_ITEM); - StringExpandPlaceholders(gStringVar4, gText_UsedVar2WildLured); + StringExpandPlaceholders(gStringVar4, sText_UsedVar2WildLured); } else { FlagSet(FLAG_SYS_ENC_DOWN_ITEM); FlagClear(FLAG_SYS_ENC_UP_ITEM); - StringExpandPlaceholders(gStringVar4, gText_UsedVar2WildRepelled); + StringExpandPlaceholders(gStringVar4, sText_UsedVar2WildRepelled); } gTasks[taskId].data[8] = 0; gTasks[taskId].func = Task_UsedBlackWhiteFlute; @@ -1504,9 +1519,9 @@ static void Task_DisplayPokeFluteMessage(u8 taskId) if (WaitFanfare(FALSE)) { if (gTasks[taskId].data[3] == 0) - DisplayItemMessage(taskId, FONT_NORMAL, gText_PokeFluteAwakenedMon, CloseItemMessage); + DisplayItemMessage(taskId, FONT_NORMAL, sText_PokeFluteAwakenedMon, CloseItemMessage); else - DisplayItemMessageOnField(taskId, gText_PokeFluteAwakenedMon, Task_CloseCantUseKeyItemMessage); + DisplayItemMessageOnField(taskId, sText_PokeFluteAwakenedMon, Task_CloseCantUseKeyItemMessage); } } @@ -1530,16 +1545,16 @@ void ItemUseOutOfBattle_PokeFlute(u8 taskId) if (wokeSomeoneUp) { if (gTasks[taskId].data[3] == 0) - DisplayItemMessage(taskId, FONT_NORMAL, gText_PlayedPokeFlute, Task_PlayPokeFlute); + DisplayItemMessage(taskId, FONT_NORMAL, sText_PlayedPokeFlute, Task_PlayPokeFlute); else - DisplayItemMessageOnField(taskId, gText_PlayedPokeFlute, Task_PlayPokeFlute); + DisplayItemMessageOnField(taskId, sText_PlayedPokeFlute, Task_PlayPokeFlute); } else { if (gTasks[taskId].data[3] == 0) - DisplayItemMessage(taskId, FONT_NORMAL, gText_PlayedPokeFluteCatchy, CloseItemMessage); + DisplayItemMessage(taskId, FONT_NORMAL, sText_PlayedPokeFluteCatchy, CloseItemMessage); else - DisplayItemMessageOnField(taskId, gText_PlayedPokeFluteCatchy, Task_CloseCantUseKeyItemMessage); + DisplayItemMessageOnField(taskId, sText_PlayedPokeFluteCatchy, Task_CloseCantUseKeyItemMessage); } } diff --git a/src/player_pc.c b/src/player_pc.c index 3dd5fcc36f..b44799223c 100644 --- a/src/player_pc.c +++ b/src/player_pc.c @@ -181,20 +181,30 @@ static EWRAM_DATA u8 sTopMenuNumOptions = 0; EWRAM_DATA struct PlayerPCItemPageStruct gPlayerPCItemPageInfo = {}; static EWRAM_DATA struct ItemStorageMenu *sItemStorageMenu = NULL; +static const u8 sText_WithdrawItem[] = _("WITHDRAW ITEM"); +static const u8 sText_DepositItem[] = _("DEPOSIT ITEM"); +static const u8 sText_TossItem[] = _("TOSS ITEM"); +static const u8 sText_Mailbox[] = _("MAILBOX"); + +static const u8 sText_WithdrawHowManyItems[] = _("Withdraw how many\n{STR_VAR_1}?"); +static const u8 sText_WithdrawXItems[] = _("Withdrew {STR_VAR_2}\n{STR_VAR_1}."); +static const u8 sText_NoRoomInBag[] = _("There is no more\nroom in the BAG."); +static const u8 sText_TooImportantToToss[] = _("That's much too\nimportant to toss\nout!"); + static const u8 *const sItemStorage_OptionDescriptions[] = { - [MENU_WITHDRAW] = gText_TakeOutItemsFromPC, - [MENU_DEPOSIT] = gText_StoreItemsInPC, - [MENU_TOSS] = gText_ThrowAwayItemsInPC, + [MENU_WITHDRAW] = COMPOUND_STRING("Take out items from the PC."), + [MENU_DEPOSIT] = COMPOUND_STRING("Store items in the PC."), + [MENU_TOSS] = COMPOUND_STRING("Throw away items stored in the PC."), [MENU_EXIT] = gText_GoBackPrevMenu, }; static const struct MenuAction sPlayerPCMenuActions[] = { - [MENU_ITEMSTORAGE] = { gText_ItemStorage, {PlayerPC_ItemStorage} }, - [MENU_MAILBOX] = { gText_Mailbox, {PlayerPC_Mailbox} }, - [MENU_DECORATION] = { gText_Decoration, {PlayerPC_Decoration} }, - [MENU_TURNOFF] = { gText_TurnOff, {PlayerPC_TurnOff} } + [MENU_ITEMSTORAGE] = { COMPOUND_STRING("ITEM STORAGE"), {PlayerPC_ItemStorage} }, + [MENU_MAILBOX] = { sText_Mailbox, {PlayerPC_Mailbox} }, + [MENU_DECORATION] = { COMPOUND_STRING("DECORATION"), {PlayerPC_Decoration} }, + [MENU_TURNOFF] = { COMPOUND_STRING("TURN OFF"), {PlayerPC_TurnOff} } }; static const u8 sBedroomPC_OptionOrder[] = @@ -216,9 +226,9 @@ static const u8 sPlayerPC_OptionOrder[] = static const struct MenuAction sItemStorage_MenuActions[] = { - [MENU_WITHDRAW] = { gText_WithdrawItem, {ItemStorage_Withdraw} }, - [MENU_DEPOSIT] = { gText_DepositItem, {ItemStorage_Deposit} }, - [MENU_TOSS] = { gText_TossItem, {ItemStorage_Toss} }, + [MENU_WITHDRAW] = { sText_WithdrawItem, {ItemStorage_Withdraw} }, + [MENU_DEPOSIT] = { sText_DepositItem, {ItemStorage_Deposit} }, + [MENU_TOSS] = { sText_TossItem, {ItemStorage_Toss} }, [MENU_EXIT] = { gText_Cancel, {ItemStorage_Exit} } }; @@ -230,10 +240,10 @@ static const u16 sNewGamePCItems[][2] = const struct MenuAction gMailboxMailOptions[] = { - { gText_Read, {Mailbox_DoMailRead} }, - { gText_MoveToBag, {Mailbox_MoveToBag} }, - { gText_Give2, {Mailbox_Give} }, - { gText_Cancel2, {Mailbox_Cancel} } + { COMPOUND_STRING("READ"), {Mailbox_DoMailRead} }, + { COMPOUND_STRING("MOVE TO BAG"), {Mailbox_MoveToBag} }, + { COMPOUND_STRING("GIVE"), {Mailbox_Give} }, + { gText_Cancel2, {Mailbox_Cancel} } }; static const struct WindowTemplate sWindowTemplates_MainMenus[] = @@ -697,7 +707,7 @@ static void Mailbox_DrawMailboxMenu(u8 taskId) { u8 windowId = MailboxMenu_AddWindow(MAILBOXWIN_TITLE); MailboxMenu_AddWindow(MAILBOXWIN_LIST); - AddTextPrinterParameterized(windowId, FONT_NORMAL, gText_Mailbox, GetStringCenterAlignXOffset(FONT_NORMAL, gText_Mailbox, 0x40), 1, 0, NULL); + AddTextPrinterParameterized(windowId, FONT_NORMAL, sText_Mailbox, GetStringCenterAlignXOffset(FONT_NORMAL, sText_Mailbox, 0x40), 1, 0, NULL); ScheduleBgCopyTilemapToVram(0); gTasks[taskId].tListTaskId = MailboxMenu_CreateList(&gPlayerPCItemPageInfo); MailboxMenu_AddScrollArrows(&gPlayerPCItemPageInfo); @@ -1145,9 +1155,9 @@ static void ItemStorage_CreateListMenu(u8 taskId) for (i = 0; i <= ITEMPC_WIN_LIST_END; i++) ItemStorage_AddWindow(i); toss = tInTossMenu; - text = gText_TossItem; + text = sText_TossItem; if (!toss) - text = gText_WithdrawItem; + text = sText_WithdrawItem; x = GetStringCenterAlignXOffset(FONT_NORMAL, text, 104); AddTextPrinterParameterized(sItemStorageMenu->windowIds[ITEMPC_WIN_TITLE], FONT_NORMAL, text, x, 1, 0, NULL); CopyWindowToVram(sItemStorageMenu->windowIds[ITEMPC_WIN_ICON], COPYWIN_GFX); @@ -1170,10 +1180,10 @@ static const u8 *ItemStorage_GetMessage(u16 itemId) string = gText_GoBackPrevMenu; break; case MSG_HOW_MANY_TO_WITHDRAW: - string = gText_WithdrawHowManyItems; + string = sText_WithdrawHowManyItems; break; case MSG_WITHDREW_ITEM: - string = gText_WithdrawXItems; + string = sText_WithdrawXItems; break; case MSG_HOW_MANY_TO_TOSS: string = gText_TossHowManyVar1s; @@ -1182,10 +1192,10 @@ static const u8 *ItemStorage_GetMessage(u16 itemId) string = gText_ThrewAwayVar2Var1s; break; case MSG_NO_MORE_ROOM: - string = gText_NoRoomInBag; + string = sText_NoRoomInBag; break; case MSG_TOO_IMPORTANT: - string = gText_TooImportantToToss; + string = sText_TooImportantToToss; break; case MSG_OKAY_TO_THROW_AWAY: string = gText_ConfirmTossItems; diff --git a/src/strings.c b/src/strings.c index b886ac639f..fb3c96eb9d 100644 --- a/src/strings.c +++ b/src/strings.c @@ -126,21 +126,11 @@ const u8 gMenuText_Use[] = _("USE"); const u8 gMenuText_Toss[] = _("TOSS"); const u8 gMenuText_Register[] = _("REGISTER"); const u8 gMenuText_Give[] = _("GIVE"); -const u8 gMenuText_CheckTag[] = _("CHECK TAG"); const u8 gMenuText_Confirm[] = _("CONFIRM"); -const u8 gMenuText_Walk[] = _("WALK"); const u8 gText_Cancel[] = _("CANCEL"); const u8 gText_Cancel2[] = _("CANCEL"); -const u8 gMenuText_Show[] = _("SHOW"); const u8 gText_EmptyString2[] = _(""); -const u8 gText_Cancel7[] = _("CANCEL"); // Unused -const u8 gText_Item[] = _("ITEM"); -const u8 gText_Mail[] = _("MAIL"); -const u8 gText_Take[] = _("TAKE"); -const u8 gText_Store[] = _("STORE"); -const u8 gMenuText_Check[] = _("CHECK"); const u8 gText_None[] = _("NONE"); -const u8 gMenuText_Deselect[] = _("DESELECT"); const u8 gText_FiveMarks[] = _("?????"); const u8 gText_Slash[] = _("/"); const u8 gText_OneDash[] = _("-"); @@ -166,39 +156,19 @@ const u8 gText_CantWriteMail[] = _("You can't write\nMAIL here."); const u8 gText_NoPokemon[] = _("There is no\nPOKéMON."); const u8 gText_MoveVar1Where[] = _("Move the\n{STR_VAR_1}\nwhere?"); const u8 gText_Var1CantBeHeld[] = _("The {STR_VAR_1} can't be held."); -const u8 gText_Var1CantBeHeldHere[] = _("The {STR_VAR_1} can't be held\nhere."); -const u8 gText_DepositHowManyVar1[] = _("Deposit how many\n{STR_VAR_1}?"); -const u8 gText_DepositedVar2Var1s[] = _("Deposited {STR_VAR_2}\n{STR_VAR_1}."); -const u8 gText_NoRoomForItems[] = _("There's no room to\nstore items."); -const u8 gText_CantStoreImportantItems[] = _("Important items\ncan't be stored in\nthe PC!"); -const u8 gText_TooImportantToToss[] = _("That's much too\nimportant to toss\nout!"); const u8 gText_TossHowManyVar1s[] = _("Toss out how many\n{STR_VAR_1}?"); const u8 gText_ThrewAwayVar2Var1s[] = _("Threw away {STR_VAR_2}\n{STR_VAR_1}."); const u8 gText_ConfirmTossItems[] = _("Is it okay to\nthrow away {STR_VAR_2}\n{STR_VAR_1}?"); const u8 gText_DadsAdvice[] = _("DAD's advice…\n{PLAYER}, there's a time and place for\leverything!{PAUSE_UNTIL_PRESS}"); -const u8 gText_CantDismountBike[] = _("You can't dismount your BIKE here.{PAUSE_UNTIL_PRESS}"); -const u8 gText_ItemFinderNearby[] = _("Huh?\nThe ITEMFINDER's responding!\pThere's an item buried around here!{PAUSE_UNTIL_PRESS}"); -const u8 gText_ItemFinderOnTop[] = _("Oh!\nThe ITEMFINDER's shaking wildly!{PAUSE_UNTIL_PRESS}"); -const u8 gText_ItemFinderNothing[] = _("… … … …Nope!\nThere's no response.{PAUSE_UNTIL_PRESS}"); -const u8 gText_CoinCase[] = _("Your COINS:\n{STR_VAR_1}{PAUSE_UNTIL_PRESS}"); -const u8 gText_BootedUpTM[] = _("Booted up a TM."); -const u8 gText_BootedUpHM[] = _("Booted up an HM."); -const u8 gText_TMHMContainedVar1[] = _("It contained\n{STR_VAR_1}.\pTeach {STR_VAR_1}\nto a POKéMON?"); const u8 gText_PlayerUsedVar2[] = _("{PLAYER} used the\n{STR_VAR_2}.{PAUSE_UNTIL_PRESS}"); const u8 gText_RepelEffectsLingered[] = _("But the effects of a REPEL\nlingered from earlier.{PAUSE_UNTIL_PRESS}"); const u8 gText_LureEffectsLingered[] = _("But the effects of a Lure\nlingered from earlier.{PAUSE_UNTIL_PRESS}"); -const u8 gText_UsedVar2WildLured[] = _("{PLAYER} used the\n{STR_VAR_2}.\pWild POKéMON will be lured.{PAUSE_UNTIL_PRESS}"); -const u8 gText_UsedVar2WildRepelled[] = _("{PLAYER} used the\n{STR_VAR_2}.\pWild POKéMON will be repelled.{PAUSE_UNTIL_PRESS}"); const u8 gText_BoxFull[] = _("The BOX is full.{PAUSE_UNTIL_PRESS}"); -const u8 gText_PowderQty[] = _("POWDER QTY: {STR_VAR_1}{PAUSE_UNTIL_PRESS}"); const u8 gText_TheField[] = _("the field"); const u8 gText_TheBattle[] = _("the battle"); const u8 gText_ThePokemonList[] = _("the POKéMON LIST"); const u8 gText_TheShop[] = _("the shop"); const u8 gText_ThePC[] = _("the PC"); -const u8 gText_PlayedPokeFluteCatchy[] = _("Played the POKé FLUTE.\pNow, that's a catchy tune!{PAUSE_UNTIL_PRESS}"); -const u8 gText_PlayedPokeFlute[] = _("Played the POKé FLUTE."); -const u8 gText_PokeFluteAwakenedMon[] = _("The POKé FLUTE awakened sleeping\nPOKéMON.{PAUSE_UNTIL_PRESS}"); const u8 *const gBagMenu_ReturnToStrings[] = { @@ -266,16 +236,6 @@ const u8 gText_HowManyToSell[] = _("{STR_VAR_2}?\nHow many would you like to sel const u8 gText_ICanPayVar1[] = _("I can pay ¥{STR_VAR_1}.\nWould that be okay?"); const u8 gText_TurnedOverVar1ForVar2[] = _("Turned over the {STR_VAR_2}\nand received ¥{STR_VAR_1}."); const u8 gText_PokedollarVar1[] = _("¥{STR_VAR_1}"); -const u8 gText_Shift[] = _("SHIFT"); -const u8 gText_SendOut[] = _("SEND OUT"); -const u8 gText_Switch2[] = _("SWITCH"); -const u8 gText_Summary5[] = _("SUMMARY"); -const u8 gText_Moves[] = _("MOVES"); // Unused -const u8 gText_Enter[] = _("ENTER"); -const u8 gText_NoEntry[] = _("NO ENTRY"); -const u8 gText_Take2[] = _("TAKE"); -const u8 gText_Read2[] = _("READ"); -const u8 gText_Trade4[] = _("TRADE"); const u8 gText_HP3[] = _("HP"); const u8 gText_SpAtk3[] = _("SP. ATK"); const u8 gText_SpDef3[] = _("SP. DEF"); @@ -483,23 +443,7 @@ const u8 gText_Tristan[] = _("TRISTAN"); const u8 gText_Philip[] = _("PHILIP"); const u8 gText_Dennis[] = _("DENNIS"); const u8 gText_Roberto[] = _("ROBERTO"); -const u8 gText_TurnOff[] = _("TURN OFF"); -const u8 gText_Decoration[] = _("DECORATION"); -const u8 gText_ItemStorage[] = _("ITEM STORAGE"); -const u8 gText_Mailbox[] = _("MAILBOX"); -const u8 gText_DepositItem[] = _("DEPOSIT ITEM"); -const u8 gText_WithdrawItem[] = _("WITHDRAW ITEM"); -const u8 gText_TossItem[] = _("TOSS ITEM"); -const u8 gText_StoreItemsInPC[] = _("Store items in the PC."); -const u8 gText_TakeOutItemsFromPC[] = _("Take out items from the PC."); -const u8 gText_ThrowAwayItemsInPC[] = _("Throw away items stored in the PC."); const u8 gText_NoItems[] = _("There are no items.{PAUSE_UNTIL_PRESS}"); -const u8 gText_NoRoomInBag[] = _("There is no more\nroom in the BAG."); -const u8 gText_WithdrawHowManyItems[] = _("Withdraw how many\n{STR_VAR_1}?"); -const u8 gText_WithdrawXItems[] = _("Withdrew {STR_VAR_2}\n{STR_VAR_1}."); -const u8 gText_Read[] = _("READ"); -const u8 gText_MoveToBag[] = _("MOVE TO BAG"); -const u8 gText_Give2[] = _("GIVE"); const u8 gText_NoMailHere[] = _("There's no MAIL here.{PAUSE_UNTIL_PRESS}"); const u8 gText_WhatToDoWithVar1sMail[] = _("What would you like to do with\n{STR_VAR_1}'s MAIL?"); const u8 gText_MessageWillBeLost[] = _("The message will be lost.\nIs that okay?"); @@ -513,17 +457,7 @@ const u8 gText_Brawly[] = _("BRAWLY"); const u8 gText_Winona[] = _("WINONA"); const u8 gText_Phoebe[] = _("PHOEBE"); const u8 gText_Glacia[] = _("GLACIA"); -const u8 gText_Petalburg[] = _("PETALBURG"); -const u8 gText_Slateport[] = _("SLATEPORT"); -const u8 gText_Littleroot[] = _("LITTLEROOT"); // Unused. Given the context, Briney may at one point have been able to sail the player here -const u8 gText_Lilycove[] = _("LILYCOVE"); // Unused. Given the context, Briney may at one point have been able to sail the player here -const u8 gText_Dewford[] = _("DEWFORD"); -const u8 gText_Enter2[] = _("ENTER"); const u8 gText_Info2[] = _("INFO"); -const u8 gText_WhatsAContest[] = _("What's a CONTEST?"); -const u8 gText_TypesOfContests[] = _("Types of CONTESTS"); -const u8 gText_Ranks[] = _("Ranks"); -const u8 gText_Judging[] = _("Judging"); //unused const u8 gText_CoolnessContest[] = _("COOLNESS CONTEST"); const u8 gText_BeautyContest[] = _("BEAUTY CONTEST"); const u8 gText_CutenessContest[] = _("CUTENESS CONTEST"); @@ -531,71 +465,17 @@ const u8 gText_SmartnessContest[] = _("SMARTNESS CONTEST"); const u8 gText_ToughnessContest[] = _("TOUGHNESS CONTEST"); const u8 gText_Decoration2[] = _("DECORATION"); const u8 gText_PackUp[] = _("PACK UP"); -const u8 gText_Count[] = _("COUNT"); //unused const u8 gText_Registry[] = _("REGISTRY"); const u8 gText_Information[] = _("INFORMATION"); -const u8 gText_Mach[] = _("MACH"); -const u8 gText_Acro[] = _("ACRO"); -const u8 gText_Psn[] = _("PSN"); -const u8 gText_Par[] = _("PAR"); -const u8 gText_Slp[] = _("SLP"); -const u8 gText_Brn[] = _("BRN"); -const u8 gText_Frz[] = _("FRZ"); -const u8 gText_Toxic[] = _("TOXIC"); // Unused -const u8 gText_Ok3[] = _("OK"); // Unused -const u8 gText_Quit[] = _("QUIT"); // Unused -const u8 gText_SawIt[] = _("Saw it"); -const u8 gText_NotYet[] = _("Not yet"); const u8 gText_Yes[] = _("YES"); const u8 gText_No[] = _("NO"); -const u8 gText_Info4[] = _("INFO"); // Unused -const u8 gText_SingleBattle[] = _("SINGLE BATTLE"); -const u8 gText_DoubleBattle[] = _("DOUBLE BATTLE"); -const u8 gText_MultiBattle[] = _("MULTI BATTLE"); -const u8 gText_MrBriney[] = _("MR. BRINEY"); // Unused -const u8 gText_Challenge[] = _("CHALLENGE"); -const u8 gText_Info3[] = _("INFO"); const u8 gText_Lv50[] = _("LV. 50"); const u8 gText_OpenLevel[] = _("OPEN LEVEL"); -const u8 gText_FreshWaterAndPrice[] = _("FRESH WATER{CLEAR_TO 0x48}¥200"); -const u8 gText_SodaPopAndPrice[] = _("SODA POP{CLEAR_TO 0x48}¥300"); -const u8 gText_LemonadeAndPrice[] = _("LEMONADE{CLEAR_TO 0x48}¥350"); -const u8 gText_HowToRide[] = _("HOW TO RIDE"); -const u8 gText_HowToTurn[] = _("HOW TO TURN"); -const u8 gText_SandySlopes[] = _("SANDY SLOPES"); -const u8 gText_Wheelies[] = _("WHEELIES"); -const u8 gText_BunnyHops[] = _("BUNNY-HOPS"); -const u8 gText_Jump[] = _("JUMP"); -const u8 gText_Satisfied[] = _("Satisfied"); -const u8 gText_Dissatisfied[] = _("Dissatisfied"); -const u8 gText_DeepSeaTooth[] = _("DEEPSEATOOTH"); -const u8 gText_DeepSeaScale[] = _("DEEPSEASCALE"); -const u8 gText_BlueFlute2[] = _("BLUE FLUTE"); -const u8 gText_YellowFlute2[] = _("YELLOW FLUTE"); -const u8 gText_RedFlute2[] = _("RED FLUTE"); -const u8 gText_WhiteFlute2[] = _("WHITE FLUTE"); -const u8 gText_BlackFlute2[] = _("BLACK FLUTE"); -const u8 gText_GlassChair[] = _("GLASS CHAIR"); -const u8 gText_GlassDesk[] = _("GLASS DESK"); -const u8 gText_TreeckoDollAndPrice[] = _("TREECKO DOLL 1,000 COINS"); -const u8 gText_TorchicDollAndPrice[] = _("TORCHIC DOLL 1,000 COINS"); -const u8 gText_MudkipDollAndPrice[] = _("MUDKIP DOLL 1,000 COINS"); -const u8 gText_50CoinsAndPrice[] = _(" 50 COINS ¥1,000"); -const u8 gText_500CoinsAndPrice[] = _("500 COINS ¥10,000"); -const u8 gText_Excellent2[] = _("Excellent"); -const u8 gText_NotSoGood[] = _("Not so good"); const u8 gText_RedShard[] = _("RED SHARD"); const u8 gText_YellowShard[] = _("YELLOW SHARD"); const u8 gText_BlueShard[] = _("BLUE SHARD"); const u8 gText_GreenShard[] = _("GREEN SHARD"); const u8 gText_BattleFrontier[] = _("BATTLE FRONTIER"); -const u8 gText_Right[] = _("Right"); -const u8 gText_Left[] = _("Left"); -const u8 gText_TM32AndPrice[] = _("TM32{CLEAR_TO 0x48}1,500 COINS"); -const u8 gText_TM29AndPrice[] = _("TM29{CLEAR_TO 0x48}3,500 COINS"); -const u8 gText_TM35AndPrice[] = _("TM35{CLEAR_TO 0x48}4,000 COINS"); -const u8 gText_TM24AndPrice[] = _("TM24{CLEAR_TO 0x48}4,000 COINS"); -const u8 gText_TM13AndPrice[] = _("TM13{CLEAR_TO 0x48}4,000 COINS"); const u8 gText_Cool[] = _("COOL"); const u8 gText_Beauty[] = _("BEAUTY"); const u8 gText_Cute[] = _("CUTE"); @@ -623,21 +503,10 @@ const u8 gText_LogOff[] = _("LOG OFF"); const u8 gText_Opponent[] = _("OPPONENT"); const u8 gText_Tourney_Tree[] = _("TOURNEY TREE"); const u8 gText_ReadyToStart[] = _("READY TO START"); -const u8 gText_NormalRank[] = _("NORMAL RANK"); -const u8 gText_SuperRank[] = _("SUPER RANK"); -const u8 gText_HyperRank[] = _("HYPER RANK"); -const u8 gText_MasterRank[] = _("MASTER RANK"); const u8 gText_Single2[] = _("SINGLE"); const u8 gText_Double2[] = _("DOUBLE"); const u8 gText_Multi[] = _("MULTI"); const u8 gText_MultiLink[] = _("MULTI-LINK"); -const u8 gText_BattleBag[] = _("BATTLE BAG"); -const u8 gText_HeldItem[] = _("HELD ITEM"); -const u8 gText_LinkContest[] = _("LINK CONTEST"); -const u8 gText_AboutE_Mode[] = _("ABOUT E-MODE"); -const u8 gText_AboutG_Mode[] = _("ABOUT G-MODE"); -const u8 gText_E_Mode[] = _("E-MODE"); -const u8 gText_G_Mode[] = _("G-MODE"); const u8 gText_MenuOptionPokedex[] = _("POKéDEX"); const u8 gText_MenuOptionPokemon[] = _("POKéMON"); const u8 gText_MenuOptionBag[] = _("BAG"); @@ -646,22 +515,10 @@ const u8 gText_Blank[] = _(""); const u8 gText_MenuOptionSave[] = _("SAVE"); const u8 gText_MenuOptionOption[] = _("OPTION"); const u8 gText_MenuOptionExit[] = _("EXIT"); -const u8 gText_5BP[] = _(" 5BP"); -const u8 gText_10BP[] = _("10BP"); -const u8 gText_15BP[] = _("15BP"); -const u8 gText_RedTent[] = _("RED TENT"); -const u8 gText_BlueTent[] = _("BLUE TENT"); const u8 gText_SouthernIsland[] = _("SOUTHERN ISLAND"); const u8 gText_BirthIsland[] = _("BIRTH ISLAND"); const u8 gText_FarawayIsland[] = _("FARAWAY ISLAND"); const u8 gText_NavelRock[] = _("NAVEL ROCK"); -const u8 gText_ClawFossil[] = _("CLAW FOSSIL"); -const u8 gText_RootFossil[] = _("ROOT FOSSIL"); -const u8 gText_No4[] = _("NO"); -const u8 gText_IllBattleNow[] = _("I'll battle now!"); -const u8 gText_IWon[] = _("I won!"); -const u8 gText_ILost[] = _("I lost!"); -const u8 gText_IWontTell[] = _("I won't tell."); const u8 gText_NormalTagMatch[] = _("NORMAL TAG MATCH"); const u8 gText_VarietyTagMatch[] = _("VARIETY TAG MATCH"); const u8 gText_UniqueTagMatch[] = _("UNIQUE TAG MATCH"); @@ -670,69 +527,25 @@ const u8 gText_TradeCenter[] = _("TRADE CENTER"); const u8 gText_Colosseum[] = _("COLOSSEUM"); const u8 gText_RecordCorner[] = _("RECORD CORNER"); const u8 gText_BerryCrush3[] = _("BERRY CRUSH"); -const u8 gText_EmptyLinkService[] = _(""); // Maybe Spin Trade? -const u8 gText_PokemonJump[] = _("POKéMON JUMP"); -const u8 gText_DodrioBerryPicking[] = _("DODRIO BERRY-PICKING"); -const u8 gText_BecomeLeader[] = _("BECOME LEADER"); -const u8 gText_JoinGroup[] = _("JOIN GROUP"); -const u8 gText_TwoStyles[] = _("TWO STYLES"); -const u8 gText_Lv50_3[] = _("LV. 50"); -const u8 gText_OpenLevel2[] = _("OPEN LEVEL"); -const u8 gText_MonTypeAndNo[] = _("{PKMN} TYPE & NO."); -const u8 gText_HoldItems[] = _("HOLD ITEMS"); -const u8 gText_Symbols2[] = _("SYMBOLS"); -const u8 gText_Record3[] = _("RECORD"); -const u8 gText_BattlePts[] = _("BATTLE PTS"); -const u8 gText_TowerInfo[] = _("TOWER INFO"); -const u8 gText_BattleMon[] = _("BATTLE {PKMN}"); -const u8 gText_BattleSalon[] = _("BATTLE SALON"); -const u8 gText_MultiLink2[] = _("MULTI-LINK"); const u8 gText_BattleRules[] = _("BATTLE RULES"); const u8 gText_JudgeMind[] = _("JUDGE: MIND"); const u8 gText_JudgeSkill[] = _("JUDGE: SKILL"); const u8 gText_JudgeBody[] = _("JUDGE: BODY"); -const u8 gText_Matchup[] = _("MATCHUP"); -const u8 gText_TourneyTree[] = _("TOURNEY TREE"); -const u8 gText_DoubleKO[] = _("DOUBLE KO"); const u8 gText_BasicRules[] = _("BASIC RULES"); const u8 gText_SwapPartners[] = _("SWAP: PARTNER"); const u8 gText_SwapNumber[] = _("SWAP: NUMBER"); const u8 gText_SwapNotes[] = _("SWAP: NOTES"); -const u8 gText_OpenLevel3[] = _("OPEN LEVEL"); const u8 gText_BattleBasics[] = _("BATTLE BASICS"); const u8 gText_PokemonNature[] = _("POKéMON NATURE"); const u8 gText_PokemonMoves[] = _("POKéMON MOVES"); const u8 gText_Underpowered[] = _("UNDERPOWERED"); const u8 gText_WhenInDanger[] = _("WHEN IN DANGER"); -const u8 gText_PyramidPokemon[] = _("PYRAMID: POKéMON"); -const u8 gText_PyramidTrainers[] = _("PYRAMID: TRAINERS"); -const u8 gText_PyramidMaze[] = _("PYRAMID: MAZE"); -const u8 gText_BattleBag2[] = _("BATTLE BAG"); -const u8 gText_PokenavAndBag[] = _("POKéNAV AND BAG"); -const u8 gText_HeldItems[] = _("HELD ITEMS"); -const u8 gText_PokemonOrder[] = _("POKéMON ORDER"); const u8 gText_BattlePokemon[] = _("BATTLE POKéMON"); const u8 gText_BattleTrainers[] = _("BATTLE TRAINERS"); const u8 gText_GoOn[] = _("GO ON"); const u8 gText_Record2[] = _("RECORD"); const u8 gText_Rest[] = _("REST"); const u8 gText_Retire[] = _("RETIRE"); -const u8 gText_99TimesPlus[] = _("99 times +"); -const u8 gText_1MinutePlus[] = _("1 minute +"); -const u8 gText_SpaceSeconds[] = _(" seconds"); -const u8 gText_SpaceTimes[] = _(" time(s)"); -const u8 gText_Dot[] = _("."); // Unused -const u8 gText_BigGuy[] = _("Big guy"); -const u8 gText_BigGirl[] = _("Big girl"); -const u8 gText_Son[] = _("son"); -const u8 gText_Daughter[] = _("daughter"); -const u8 gText_BlueFlute[] = _("BLUE FLUTE"); -const u8 gText_YellowFlute[] = _("YELLOW FLUTE"); -const u8 gText_RedFlute[] = _("RED FLUTE"); -const u8 gText_WhiteFlute[] = _("WHITE FLUTE"); -const u8 gText_BlackFlute[] = _("BLACK FLUTE"); -const u8 gText_PrettyChair[] = _("PRETTY CHAIR"); -const u8 gText_PrettyDesk[] = _("PRETTY DESK"); const u8 gText_1F[] = _("1F"); const u8 gText_2F[] = _("2F"); const u8 gText_3F[] = _("3F"); @@ -751,25 +564,10 @@ const u8 gText_B4F[] = _("B4F"); const u8 gText_Rooftop[] = _("ROOFTOP"); const u8 gText_ElevatorNowOn[] = _("Now on:"); const u8 gText_BP[] = _("BP"); -const u8 gText_EnergyPowder50[] = _("ENERGYPOWDER{CLEAR_TO 114}{FONT_SMALL}50"); -const u8 gText_EnergyRoot80[] = _("ENERGY ROOT{CLEAR_TO 114}{FONT_SMALL}80"); -const u8 gText_HealPowder50[] = _("HEAL POWDER{CLEAR_TO 114}{FONT_SMALL}50"); -const u8 gText_RevivalHerb300[] = _("REVIVAL HERB{CLEAR_TO 108}{FONT_SMALL}300"); -const u8 gText_Protein1000[] = _("PROTEIN{CLEAR_TO 99}{FONT_SMALL}1,000"); -const u8 gText_Iron1000[] = _("IRON{CLEAR_TO 99}{FONT_SMALL}1,000"); -const u8 gText_Carbos1000[] = _("CARBOS{CLEAR_TO 99}{FONT_SMALL}1,000"); -const u8 gText_Calcium1000[] = _("CALCIUM{CLEAR_TO 99}{FONT_SMALL}1,000"); -const u8 gText_Zinc1000[] = _("ZINC{CLEAR_TO 99}{FONT_SMALL}1,000"); -const u8 gText_HPUp1000[] = _("HP UP{CLEAR_TO 99}{FONT_SMALL}1,000"); -const u8 gText_PPUp3000[] = _("PP UP{CLEAR_TO 99}{FONT_SMALL}3,000"); const u8 gText_RankingHall[] = _("RANKING HALL"); const u8 gText_ExchangeService[] = _("EXCHANGE SERVICE"); const u8 gText_LilycoveCity[] = _("LILYCOVE CITY"); const u8 gText_SlateportCity[] = _("SLATEPORT CITY"); -const u8 gText_CaveOfOrigin[] = _("CAVE OF ORIGIN"); -const u8 gText_MtPyre[] = _("MT. PYRE"); -const u8 gText_SkyPillar[] = _("SKY PILLAR"); -const u8 gText_DontRemember[] = _("Don't remember"); const u8 gText_Exit[] = _("EXIT"); const u8 gText_YourPartysFull[] = _("Your party's full!{PAUSE_UNTIL_PRESS}"); const u8 gText_NatureSlash[] = _("NATURE/"); @@ -909,68 +707,6 @@ const u8 gText_Jackpot[] = _("jackpot"); const u8 gText_First[] = _("first"); const u8 gText_Second[] = _("second"); const u8 gText_Third[] = _("third"); -const u8 gText_0Pts[] = _("0 pts"); -const u8 gText_10Pts[] = _("10 pts"); -const u8 gText_20Pts[] = _("20 pts"); -const u8 gText_30Pts[] = _("30 pts"); -const u8 gText_40Pts[] = _("40 pts"); -const u8 gText_50Pts[] = _("50 pts"); -const u8 gText_60Pts[] = _("60 pts"); -const u8 gText_70Pts[] = _("70 pts"); -const u8 gText_80Pts[] = _("80 pts"); -const u8 gText_90Pts[] = _("90 pts"); -const u8 gText_100Pts[] = _("100 pts"); -const u8 gText_QuestionMark[] = _("?"); -const u8 gText_KissPoster16BP[] = _("KISS POSTER{CLEAR_TO 0x5E}16BP"); -const u8 gText_KissCushion32BP[] = _("KISS CUSHION{CLEAR_TO 0x5E}32BP"); -const u8 gText_SmoochumDoll32BP[] = _("SMOOCHUM DOLL{CLEAR_TO 0x5E}32BP"); -const u8 gText_TogepiDoll48BP[] = _("TOGEPI DOLL{CLEAR_TO 0x5E}48BP"); -const u8 gText_MeowthDoll48BP[] = _("MEOWTH DOLL{CLEAR_TO 0x5E}48BP"); -const u8 gText_ClefairyDoll48BP[] = _("CLEFAIRY DOLL{CLEAR_TO 0x5E}48BP"); -const u8 gText_DittoDoll48BP[] = _("DITTO DOLL{CLEAR_TO 0x5E}48BP"); -const u8 gText_CyndaquilDoll80BP[] = _("CYNDAQUIL DOLL{CLEAR_TO 0x5E}80BP"); -const u8 gText_ChikoritaDoll80BP[] = _("CHIKORITA DOLL{CLEAR_TO 0x5E}80BP"); -const u8 gText_TotodileDoll80BP[] = _("TOTODILE DOLL{CLEAR_TO 0x5E}80BP"); -const u8 gText_LaprasDoll128BP[] = _("LAPRAS DOLL{CLEAR_TO 0x58}128BP"); -const u8 gText_SnorlaxDoll128BP[] = _("SNORLAX DOLL{CLEAR_TO 0x58}128BP"); -const u8 gText_VenusaurDoll256BP[] = _("VENUSAUR DOLL{CLEAR_TO 0x58}256BP"); -const u8 gText_CharizardDoll256BP[] = _("CHARIZARD DOLL{CLEAR_TO 0x58}256BP"); -const u8 gText_BlastoiseDoll256BP[] = _("BLASTOISE DOLL{CLEAR_TO 0x58}256BP"); -const u8 gText_Protein1BP[] = _("PROTEIN{CLEAR_TO 0x64}1BP"); -const u8 gText_Calcium1BP[] = _("CALCIUM{CLEAR_TO 0x64}1BP"); -const u8 gText_Iron1BP[] = _("IRON{CLEAR_TO 0x64}1BP"); -const u8 gText_Zinc1BP[] = _("ZINC{CLEAR_TO 0x64}1BP"); -const u8 gText_Carbos1BP[] = _("CARBOS{CLEAR_TO 0x64}1BP"); -const u8 gText_HpUp1BP[] = _("HP UP{CLEAR_TO 0x64}1BP"); -const u8 gText_Leftovers48BP[] = _("LEFTOVERS{CLEAR_TO 0x5E}48BP"); -const u8 gText_WhiteHerb48BP[] = _("WHITE HERB{CLEAR_TO 0x5E}48BP"); -const u8 gText_QuickClaw48BP[] = _("QUICK CLAW{CLEAR_TO 0x5E}48BP"); -const u8 gText_MentalHerb48BP[] = _("MENTAL HERB{CLEAR_TO 0x5E}48BP"); -const u8 gText_BrightPowder64BP[] = _("BRIGHTPOWDER{CLEAR_TO 0x5E}64BP"); -const u8 gText_ChoiceBand64BP[] = _("CHOICE BAND{CLEAR_TO 0x5E}64BP"); -const u8 gText_KingsRock64BP[] = _("KING'S ROCK{CLEAR_TO 0x5E}64BP"); -const u8 gText_FocusBand64BP[] = _("FOCUS BAND{CLEAR_TO 0x5E}64BP"); -const u8 gText_ScopeLens64BP[] = _("SCOPE LENS{CLEAR_TO 0x5E}64BP"); -const u8 gText_Softboiled16BP[] = _("SOFTBOILED{CLEAR_TO 0x4E}16BP"); -const u8 gText_SeismicToss24BP[] = _("SEISMIC TOSS{CLEAR_TO 0x4E}24BP"); -const u8 gText_DreamEater24BP[] = _("DREAM EATER{CLEAR_TO 0x4E}24BP"); -const u8 gText_MegaPunch24BP[] = _("MEGA PUNCH{CLEAR_TO 0x4E}24BP"); -const u8 gText_MegaKick48BP[] = _("MEGA KICK{CLEAR_TO 0x4E}48BP"); -const u8 gText_BodySlam48BP[] = _("BODY SLAM{CLEAR_TO 0x4E}48BP"); -const u8 gText_RockSlide48BP[] = _("ROCK SLIDE{CLEAR_TO 0x4E}48BP"); -const u8 gText_Counter48BP[] = _("COUNTER{CLEAR_TO 0x4E}48BP"); -const u8 gText_ThunderWave48BP[] = _("THUNDER WAVE{CLEAR_TO 0x4E}48BP"); -const u8 gText_SwordsDance48BP[] = _("SWORDS DANCE{CLEAR_TO 0x4E}48BP"); -const u8 gText_DefenseCurl16BP[] = _("DEFENSE CURL{CLEAR_TO 0x4E}16BP"); -const u8 gText_Snore24BP[] = _("SNORE{CLEAR_TO 0x4E}24BP"); -const u8 gText_MudSlap24BP[] = _("MUD-SLAP{CLEAR_TO 0x4E}24BP"); -const u8 gText_Swift24BP[] = _("SWIFT{CLEAR_TO 0x4E}24BP"); -const u8 gText_IcyWind24BP[] = _("ICY WIND{CLEAR_TO 0x4E}24BP"); -const u8 gText_Endure48BP[] = _("ENDURE{CLEAR_TO 0x4E}48BP"); -const u8 gText_PsychUp48BP[] = _("PSYCH UP{CLEAR_TO 0x4E}48BP"); -const u8 gText_IcePunch48BP[] = _("ICE PUNCH{CLEAR_TO 0x4E}48BP"); -const u8 gText_ThunderPunch48BP[] = _("THUNDERPUNCH{CLEAR_TO 0x4E}48BP"); -const u8 gText_FirePunch48BP[] = _("FIRE PUNCH{CLEAR_TO 0x4E}48BP"); #if OW_POISON_DAMAGE < GEN_4 const u8 gText_PkmnFainted_FldPsn[] = _("{STR_VAR_1} fainted…\p\n"); #else @@ -1193,9 +929,6 @@ const u8 gJPText_ConnectionComplete[] = _("つうしん しゅうりょう!" const u8 gJPText_NewTrainerHasComeToHoenn[] = _("あらたな トレーナーが\nホウエンに やってきた!"); const u8 gJPText_PleaseWaitAMoment[] = _("しばらく おまちください"); const u8 gJPText_WriteErrorUnableToSaveData[] = _("かきこみ エラー です\nデータが ほぞん できませんでした"); -const u8 gText_Red[] = _("RED"); -const u8 gText_Blue[] = _("BLUE"); -const u8 gText_3Dashes[] = _("---"); // Unused const u8 gText_SingleBattleRoomResults[] = _("{PLAYER}'s Single Battle Room Results"); const u8 gText_DoubleBattleRoomResults[] = _("{PLAYER}'s Double Battle Room Results"); const u8 gText_MultiBattleRoomResults[] = _("{PLAYER}'s Multi Battle Room Results"); @@ -1497,14 +1230,6 @@ const u8 gText_TrainerHill1F[] = _("1F"); const u8 gText_TrainerHill2F[] = _("2F"); const u8 gText_TrainerHill3F[] = _("3F"); const u8 gText_TrainerHill4F[] = _("4F"); -const u8 gText_LightBulb[] = _("Light bulb"); -const u8 gText_MicrowaveOven[] = _("Microwave oven"); -const u8 gText_WashingMachine[] = _("Washing machine"); -const u8 gText_Refrigerator[] = _("Refrigerator"); -const u8 gText_ElectricFan[] = _("Electric fan"); -const u8 gText_LawnMower[] = _("Lawn mower"); -const u8 gText_ChangeForm[] = _("Change form"); -const u8 gText_ChangeAbility[] = _("Change Ability"); const u8 gText_TeachWhichMoveToPkmn[] = _("Teach which move to\n{STR_VAR_1}?"); const u8 gText_MoveRelearnerTeachMoveConfirm[] = _("Teach {STR_VAR_2}?"); const u8 gText_MoveRelearnerPkmnLearnedMove[] = _("{STR_VAR_1} learned\n{STR_VAR_2}!"); @@ -1563,8 +1288,6 @@ const u8 gText_Berries[] = _("BERRIES"); const u8 gText_ExpShareOn[] = _("The Exp. Share has been turned on.{PAUSE_UNTIL_PRESS}"); const u8 gText_ExpShareOff[] = _("The Exp. Share has been turned off.{PAUSE_UNTIL_PRESS}"); const u8 gText_BasePointsResetToZero[] = _("{STR_VAR_1}'s base points\nwere all reset to zero!{PAUSE_UNTIL_PRESS}"); -const u8 gText_Fertilize[] = _("FERTILIZE"); -const u8 gText_PlantBerry[] = _("PLANT BERRY"); const u8 gText_AM[] = _("AM"); const u8 gText_PM[] = _("PM"); const u8 gText_Relearn[] = _("{START_BUTTON} RELEARN"); // future note: don't decap this, because it mimics the summary screen BG graphics which will not get decapped diff --git a/test/battle/ability/stance_change.c b/test/battle/ability/stance_change.c new file mode 100644 index 0000000000..8221e16385 --- /dev/null +++ b/test/battle/ability/stance_change.c @@ -0,0 +1,84 @@ +#include "global.h" +#include "test/battle.h" + + +SINGLE_BATTLE_TEST("Stance Change changes Aegislash from Shield to Blade when using a damaging move") +{ + u16 move; + PARAMETRIZE { move = MOVE_TACKLE; } + PARAMETRIZE { move = MOVE_SWIFT; } + PARAMETRIZE { move = MOVE_GROWL; } + GIVEN { + PLAYER(SPECIES_AEGISLASH_SHIELD); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, move); } + } SCENE { + if (move != MOVE_GROWL) { + ABILITY_POPUP(player, ABILITY_STANCE_CHANGE); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); + } else { + NONE_OF { + ABILITY_POPUP(player, ABILITY_STANCE_CHANGE); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); + } + } + ANIMATION(ANIM_TYPE_MOVE, move, player); + } THEN { + if (move != MOVE_GROWL) + EXPECT_EQ(player->species, SPECIES_AEGISLASH_BLADE); + else + EXPECT_EQ(player->species, SPECIES_AEGISLASH_SHIELD); + } +} + +SINGLE_BATTLE_TEST("Stance Change changes Aegislash from Blade to Shield when using King's Shield") +{ + u16 move; + PARAMETRIZE { move = MOVE_PROTECT; } + PARAMETRIZE { move = MOVE_KINGS_SHIELD; } + GIVEN { + PLAYER(SPECIES_AEGISLASH_BLADE); + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, move); } + } SCENE { + if (move == MOVE_KINGS_SHIELD) { + ABILITY_POPUP(player, ABILITY_STANCE_CHANGE); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); + } else { + NONE_OF { + ABILITY_POPUP(player, ABILITY_STANCE_CHANGE); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); + } + } + ANIMATION(ANIM_TYPE_MOVE, move, player); + } THEN { + if (move == MOVE_KINGS_SHIELD) + EXPECT_EQ(player->species, SPECIES_AEGISLASH_SHIELD); + else + EXPECT_EQ(player->species, SPECIES_AEGISLASH_BLADE); + } +} + +SINGLE_BATTLE_TEST("Stance Change doesn't change Aegislash to Shield if King's Shield is called by a different move - Sleep Talk") +{ + KNOWN_FAILING; // Currently does change form + GIVEN { + ASSUME(gMovesInfo[MOVE_SLEEP_TALK].effect == EFFECT_SLEEP_TALK); + PLAYER(SPECIES_AEGISLASH_BLADE) { Moves(MOVE_KINGS_SHIELD, MOVE_SLEEP_TALK); Status1(STATUS1_SLEEP_TURN(3)); } + OPPONENT(SPECIES_WOBBUFFET); + } WHEN { + TURN { MOVE(player, MOVE_SLEEP_TALK); } + } SCENE { + NONE_OF { + ABILITY_POPUP(player, ABILITY_STANCE_CHANGE); + ANIMATION(ANIM_TYPE_GENERAL, B_ANIM_FORM_CHANGE, player); + } + ANIMATION(ANIM_TYPE_MOVE, MOVE_KINGS_SHIELD, player); + } THEN { + EXPECT_EQ(player->species, SPECIES_AEGISLASH_BLADE); + } +} + +TO_DO_BATTLE_TEST("Stance Change doesn't change Aegislash to Shield if King's Shield is called by a different move - Me First"); diff --git a/test/battle/ai/ai_flag_predict_ability.c b/test/battle/ai/ai_flag_predict_ability.c new file mode 100644 index 0000000000..ab934698b8 --- /dev/null +++ b/test/battle/ai/ai_flag_predict_ability.c @@ -0,0 +1,16 @@ +#include "global.h" +#include "test/battle.h" +#include "battle_ai_util.h" + +AI_SINGLE_BATTLE_TEST("AI_FLAG_WEIGH_ABILITY_PREDICTION: AI will predict opposing ability based on its aiRating") +{ + PASSES_RANDOMLY(7, 14, RNG_AI_PREDICT_ABILITY); + GIVEN { + ASSUME(gMovesInfo[MOVE_THUNDERBOLT].type == TYPE_ELECTRIC); + AI_FLAGS(AI_FLAG_CHECK_BAD_MOVE | AI_FLAG_CHECK_VIABILITY | AI_FLAG_TRY_TO_FAINT | AI_FLAG_WEIGH_ABILITY_PREDICTION); + PLAYER(SPECIES_LANTURN) { Ability(ABILITY_VOLT_ABSORB); }; + OPPONENT(SPECIES_LANTURN) { Moves(MOVE_THUNDERBOLT, MOVE_ICE_BEAM, MOVE_SURF); } + } WHEN { + TURN { EXPECT_MOVE(opponent, MOVE_THUNDERBOLT); } + } +}