From 9ee5db6a967f44c16b186242c36e29f08a542611 Mon Sep 17 00:00:00 2001 From: ultima-soul Date: Mon, 18 May 2020 14:54:12 -0700 Subject: [PATCH 1/6] Expand ability ids to u16. Thanks to ghoulslash for some assistance! --- asm/macros/battle_script.inc | 4 +- include/battle.h | 12 ++--- include/battle_ai_script_commands.h | 2 +- include/battle_controllers.h | 2 +- include/battle_message.h | 7 +-- include/battle_util.h | 4 +- include/constants/abilities.h | 31 ++++++++++- include/pokemon.h | 46 ++++++++--------- src/battle_ai_script_commands.c | 2 +- src/battle_ai_switch_items.c | 6 +-- src/battle_controller_player.c | 2 +- src/battle_controllers.c | 5 +- src/battle_debug.c | 4 +- src/battle_main.c | 4 +- src/battle_message.c | 4 +- src/battle_pike.c | 4 +- src/battle_script_commands.c | 18 +++---- src/battle_util.c | 4 +- src/data/text/abilities.h | 79 ++++++++++++++++++++++++++++- src/egg_hatch.c | 2 +- src/field_player_avatar.c | 2 +- src/fldeff_cut.c | 2 +- src/pokemon.c | 4 +- src/pokemon_summary_screen.c | 4 +- src/wild_encounter.c | 8 +-- 25 files changed, 184 insertions(+), 78 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 20071fc36..8c2f95a17 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -143,7 +143,7 @@ .macro jumpifability param0:req, ability:req, ptr:req .byte 0x1e .byte \param0 - .byte \ability + .2byte \ability .4byte \ptr .endm @@ -371,7 +371,7 @@ .macro jumpifabilitypresent ability:req, ptr:req .byte 0x43 - .byte \ability + .2byte \ability .4byte \ptr .endm diff --git a/include/battle.h b/include/battle.h index 6a9ecd89c..8c4b4ac9a 100644 --- a/include/battle.h +++ b/include/battle.h @@ -237,7 +237,7 @@ struct WishFutureKnock struct AI_SavedBattleMon { - u8 ability; + u16 ability; u16 moves[4]; u16 heldItem; u16 species; @@ -267,7 +267,7 @@ struct UsedMoves struct BattleHistory { struct UsedMoves usedMoves[MAX_BATTLERS_COUNT]; - u8 abilities[MAX_BATTLERS_COUNT]; + u16 abilities[MAX_BATTLERS_COUNT]; u8 itemEffects[MAX_BATTLERS_COUNT]; u16 trainerItems[MAX_BATTLERS_COUNT]; u8 itemsNo; @@ -486,7 +486,7 @@ struct BattleStruct u16 lastTakenMove[MAX_BATTLERS_COUNT]; // Last move that a battler was hit with. u16 hpOnSwitchout[2]; u32 savedBattleTypeFlags; - u8 abilityPreventingSwitchout; + u16 abilityPreventingSwitchout; u8 hpScale; u16 synchronizeMoveEffect; bool8 anyMonHasTransformed; @@ -539,7 +539,7 @@ struct BattleStruct u8 lastMoveFailed; // as bits for each battler, for the sake of Stomping Tantrum u8 lastMoveTarget[MAX_BATTLERS_COUNT]; // The last target on which each mon used a move, for the sake of Instruct u8 debugHoldEffects[MAX_BATTLERS_COUNT]; // These override actual items' hold effects. - u8 tracedAbility[MAX_BATTLERS_COUNT]; + u16 tracedAbility[MAX_BATTLERS_COUNT]; u16 hpBefore[MAX_BATTLERS_COUNT]; // Hp of battlers before using a move. For Berserk bool8 spriteIgnore0Hp; struct Illusion illusion[MAX_BATTLERS_COUNT]; @@ -754,7 +754,7 @@ extern s32 gBattleMoveDamage; extern s32 gHpDealt; extern s32 gTakenDmg[MAX_BATTLERS_COUNT]; extern u16 gLastUsedItem; -extern u8 gLastUsedAbility; +extern u16 gLastUsedAbility; extern u8 gBattlerAttacker; extern u8 gBattlerTarget; extern u8 gBattlerFainted; @@ -818,7 +818,7 @@ extern u16 gMoveToLearn; extern u8 gBattleMonForms[MAX_BATTLERS_COUNT]; extern u32 gFieldStatuses; extern struct FieldTimer gFieldTimers; -extern u8 gBattlerAbility; +extern u16 gBattlerAbility; extern u16 gPartnerSpriteId; extern void (*gPreBattleCallback1)(void); diff --git a/include/battle_ai_script_commands.h b/include/battle_ai_script_commands.h index 04d580a84..6bca16639 100644 --- a/include/battle_ai_script_commands.h +++ b/include/battle_ai_script_commands.h @@ -18,7 +18,7 @@ bool32 IsTruantMonVulnerable(u32 battlerAI, u32 opposingBattler); bool32 IsBattlerAIControlled(u32 battlerId); void ClearBattlerMoveHistory(u8 battlerId); void RecordMoveBattle(u8 battlerId, u32 move); -void RecordAbilityBattle(u8 battlerId, u8 abilityId); +void RecordAbilityBattle(u8 battlerId, u16 abilityId); void ClearBattlerAbilityHistory(u8 battlerId); void RecordItemEffectBattle(u8 battlerId, u8 itemEffect); void ClearBattlerItemEffectHistory(u8 battlerId); diff --git a/include/battle_controllers.h b/include/battle_controllers.h index bbaa40ca8..0cf7f6b5a 100644 --- a/include/battle_controllers.h +++ b/include/battle_controllers.h @@ -211,7 +211,7 @@ void BtlController_EmitChooseAction(u8 bufferId, u8 arg1, u16 arg2); void BtlController_EmitUnknownYesNoBox(u8 bufferId); void BtlController_EmitChooseMove(u8 bufferId, bool8 isDoubleBattle, bool8 NoPpNumber, struct ChooseMoveStruct *movePpData); void BtlController_EmitChooseItem(u8 bufferId, u8* arg1); -void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 arg2, u8 abilityId, u8* arg4); +void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 arg2, u16 abilityId, u8* arg4); void BtlController_EmitCmd23(u8 bufferId); // unused void BtlController_EmitHealthBarUpdate(u8 bufferId, u16 hpValue); void BtlController_EmitExpUpdate(u8 bufferId, u8 partyId, u16 expPoints); diff --git a/include/battle_message.h b/include/battle_message.h index 0236cc793..df9265288 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -103,7 +103,8 @@ textVar[0] = B_BUFF_PLACEHOLDER_BEGIN; \ textVar[1] = B_BUFF_ABILITY; \ textVar[2] = abilityId; \ - textVar[3] = B_BUFF_EOS; \ + textVar[3] = (abilityId & 0xFF00) >> 8; \ + textVar[4] = B_BUFF_EOS; \ } #define PREPARE_TYPE_BUFFER(textVar, typeId) \ @@ -207,13 +208,13 @@ struct BattleMsgData u16 currentMove; u16 originallyUsedMove; u16 lastItem; - u8 lastAbility; + u16 lastAbility; u8 scrActive; u8 unk1605E; u8 hpScale; u8 itemEffectBattler; u8 moveType; - u8 abilities[MAX_BATTLERS_COUNT]; + u16 abilities[MAX_BATTLERS_COUNT]; u8 textBuffs[3][TEXT_BUFF_ARRAY_COUNT]; }; diff --git a/include/battle_util.h b/include/battle_util.h index 71a485d35..54f86b3af 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -77,7 +77,7 @@ u8 AtkCanceller_UnableToUseMove2(void); bool8 HasNoMonsToSwitch(u8 battlerId, u8 r1, u8 r2); u8 TryWeatherFormChange(u8 battlerId); bool32 TryChangeBattleWeather(u8 battler, u32 weatherEnumId, bool32 viaAbility); -u8 AbilityBattleEffects(u8 caseID, u8 battlerId, u8 ability, u8 special, u16 moveArg); +u8 AbilityBattleEffects(u8 caseID, u8 battlerId, u16 ability, u8 special, u16 moveArg); u32 GetBattlerAbility(u8 battlerId); u32 IsAbilityOnSide(u32 battlerId, u32 ability); u32 IsAbilityOnOpposingSide(u32 battlerId, u32 ability); @@ -102,7 +102,7 @@ u8 GetBattleMonMoveSlot(struct BattlePokemon *battleMon, u16 move); u32 GetBattlerWeight(u8 battlerId); s32 CalculateMoveDamage(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, s32 fixedBasePower, bool32 isCrit, bool32 randomFactor, bool32 updateFlags); u16 CalcTypeEffectivenessMultiplier(u16 move, u8 moveType, u8 battlerAtk, u8 battlerDef, bool32 recordAbilities); -u16 CalcPartyMonTypeEffectivenessMultiplier(u16 move, u16 speciesDef, u8 abilityDef); +u16 CalcPartyMonTypeEffectivenessMultiplier(u16 move, u16 speciesDef, u16 abilityDef); u16 GetTypeModifier(u8 atkType, u8 defType); s32 GetStealthHazardDamage(u8 hazardType, u8 battlerId); u16 GetMegaEvolutionSpecies(u16 preEvoSpecies, u16 heldItemId); diff --git a/include/constants/abilities.h b/include/constants/abilities.h index fdb5233f0..321446153 100644 --- a/include/constants/abilities.h +++ b/include/constants/abilities.h @@ -255,6 +255,35 @@ #define ABILITIES_COUNT_GEN7 235 -#define ABILITIES_COUNT ABILITIES_COUNT_GEN7 +// Gen 8 +#define ABILITY_INTREPID_SWORD 235 +#define ABILITY_DAUNTLESS_SHIELD 236 +#define ABILITY_LIBERO 237 +#define ABILITY_BALL_FETCH 238 +#define ABILITY_COTTON_DOWN 239 +#define ABILITY_PROPELLER_TAIL 240 +#define ABILITY_MIRROR_ARMOR 241 +#define ABILITY_GULP_MISSILE 242 +#define ABILITY_STALWART 243 +#define ABILITY_STEAM_ENGINE 244 +#define ABILITY_PUNK_ROCK 245 +#define ABILITY_SAND_SPIT 246 +#define ABILITY_ICE_SCALES 247 +#define ABILITY_RIPEN 248 +#define ABILITY_ICE_FACE 249 +#define ABILITY_POWER_SPOT 250 +#define ABILITY_MIMICRY 251 +#define ABILITY_SCREEN_CLEANER 252 +#define ABILITY_STEELY_SPIRIT 253 +#define ABILITY_PERISH_BODY 254 +#define ABILITY_WANDERING_SPIRIT 255 +#define ABILITY_GORILLA_TACTICS 256 +#define ABILITY_NEUTRALIZING_GAS 257 +#define ABILITY_PASTEL_VEIL 258 +#define ABILITY_HUNGER_SWITCH 259 + +#define ABILITIES_COUNT_GEN8 260 + +#define ABILITIES_COUNT ABILITIES_COUNT_GEN8 #endif // GUARD_CONSTANTS_ABILITIES_H diff --git a/include/pokemon.h b/include/pokemon.h index 61647eff8..46ccf50d6 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -152,24 +152,24 @@ struct BattlePokemon /*0x17*/ u32 spDefenseIV:5; /*0x17*/ u32 abilityNum:2; /*0x18*/ s8 statStages[NUM_BATTLE_STATS]; - /*0x20*/ u8 ability; - /*0x21*/ u8 type1; - /*0x22*/ u8 type2; - /*0x23*/ u8 type3; - /*0x24*/ u8 pp[MAX_MON_MOVES]; - /*0x28*/ u16 hp; - /*0x2A*/ u8 level; - /*0x2B*/ u8 friendship; - /*0x2C*/ u16 maxHP; - /*0x2E*/ u16 item; - /*0x30*/ u8 nickname[POKEMON_NAME_LENGTH + 1]; - /*0x3B*/ u8 ppBonuses; - /*0x3C*/ u8 otName[PLAYER_NAME_LENGTH + 1]; - /*0x44*/ u32 experience; - /*0x48*/ u32 personality; - /*0x4C*/ u32 status1; - /*0x50*/ u32 status2; - /*0x54*/ u32 otId; + /*0x20*/ u16 ability; + /*0x22*/ u8 type1; + /*0x23*/ u8 type2; + /*0x24*/ u8 type3; + /*0x25*/ u8 pp[MAX_MON_MOVES]; + /*0x29*/ u16 hp; + /*0x2B*/ u8 level; + /*0x2C*/ u8 friendship; + /*0x2D*/ u16 maxHP; + /*0x2F*/ u16 item; + /*0x31*/ u8 nickname[POKEMON_NAME_LENGTH + 1]; + /*0x3C*/ u8 ppBonuses; + /*0x3D*/ u8 otName[PLAYER_NAME_LENGTH + 1]; + /*0x45*/ u32 experience; + /*0x49*/ u32 personality; + /*0x4D*/ u32 status1; + /*0x51*/ u32 status2; + /*0x55*/ u32 otId; }; struct BaseStats @@ -198,9 +198,9 @@ struct BaseStats /* 0x13 */ u8 growthRate; /* 0x14 */ u8 eggGroup1; /* 0x15 */ u8 eggGroup2; - /* 0x16 */ u8 abilities[2]; - /* 0x18 */ u8 safariZoneFleeRate; - /* 0x19 */ u8 bodyColor : 7; + /* 0x16 */ u16 abilities[2]; + /* 0x1A */ u8 safariZoneFleeRate; + /* 0x1B */ u8 bodyColor : 7; u8 noFlip : 1; }; @@ -326,8 +326,8 @@ u8 CalculatePlayerPartyCount(void); u8 CalculateEnemyPartyCount(void); u8 GetMonsStateToDoubles(void); u8 GetMonsStateToDoubles_2(void); -u8 GetAbilityBySpecies(u16 species, u8 abilityNum); -u8 GetMonAbility(struct Pokemon *mon); +u16 GetAbilityBySpecies(u16 species, u8 abilityNum); +u16 GetMonAbility(struct Pokemon *mon); void CreateSecretBaseEnemyParty(struct SecretBase *secretBaseRecord); u8 GetSecretBaseTrainerPicIndex(void); u8 GetSecretBaseTrainerClass(void); diff --git a/src/battle_ai_script_commands.c b/src/battle_ai_script_commands.c index 6247df4bc..30740c47e 100644 --- a/src/battle_ai_script_commands.c +++ b/src/battle_ai_script_commands.c @@ -774,7 +774,7 @@ void RecordMoveBattle(u8 battlerId, u32 move) } } -void RecordAbilityBattle(u8 battlerId, u8 abilityId) +void RecordAbilityBattle(u8 battlerId, u16 abilityId) { BATTLE_HISTORY->abilities[battlerId] = abilityId; } diff --git a/src/battle_ai_switch_items.c b/src/battle_ai_switch_items.c index 2eaf0e2e3..1ed5d03c7 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -138,7 +138,7 @@ static bool8 ShouldSwitchIfWonderGuard(void) static bool8 FindMonThatAbsorbsOpponentsMove(void) { u8 battlerIn1, battlerIn2; - u8 absorbingTypeAbility; + u16 absorbingTypeAbility; s32 firstId; s32 lastId; // + 1 struct Pokemon *party; @@ -189,7 +189,7 @@ static bool8 FindMonThatAbsorbsOpponentsMove(void) for (i = firstId; i < lastId; i++) { u16 species; - u8 monAbility; + u16 monAbility; if (GetMonData(&party[i], MON_DATA_HP) == 0) continue; @@ -370,7 +370,7 @@ static bool8 FindMonWithFlagsAndSuperEffective(u16 flags, u8 moduloPercent) for (i = firstId; i < lastId; i++) { u16 species; - u8 monAbility; + u16 monAbility; if (GetMonData(&party[i], MON_DATA_HP) == 0) continue; diff --git a/src/battle_controller_player.c b/src/battle_controller_player.c index 3bf255776..0d93a574a 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -2703,7 +2703,7 @@ static void PlayerHandleChoosePokemon(void) gTasks[gUnknown_03005D7C[gActiveBattler]].data[0] = gBattleResources->bufferA[gActiveBattler][1] & 0xF; *(&gBattleStruct->battlerPreventingSwitchout) = gBattleResources->bufferA[gActiveBattler][1] >> 4; *(&gBattleStruct->field_8B) = gBattleResources->bufferA[gActiveBattler][2]; - *(&gBattleStruct->abilityPreventingSwitchout) = gBattleResources->bufferA[gActiveBattler][3]; + *(&gBattleStruct->abilityPreventingSwitchout) = (gBattleResources->bufferA[gActiveBattler][3] & 0xFF) | (gBattleResources->bufferA[gActiveBattler][7] << 8); BeginNormalPaletteFade(0xFFFFFFFF, 0, 0, 0x10, RGB_BLACK); gBattlerControllerFuncs[gActiveBattler] = OpenPartyMenuToChooseMon; gBattlerInMenuId = gActiveBattler; diff --git a/src/battle_controllers.c b/src/battle_controllers.c index fdcd98aed..4c3b55e4c 100644 --- a/src/battle_controllers.c +++ b/src/battle_controllers.c @@ -1186,14 +1186,15 @@ void BtlController_EmitChooseItem(u8 bufferId, u8 *arg1) PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 4); } -void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 slotId, u8 abilityId, u8 *arg4) +void BtlController_EmitChoosePokemon(u8 bufferId, u8 caseId, u8 slotId, u16 abilityId, u8 *arg4) { s32 i; sBattleBuffersTransferData[0] = CONTROLLER_CHOOSEPOKEMON; sBattleBuffersTransferData[1] = caseId; sBattleBuffersTransferData[2] = slotId; - sBattleBuffersTransferData[3] = abilityId; + sBattleBuffersTransferData[3] = abilityId & 0xFF; + sBattleBuffersTransferData[7] = (abilityId >> 8) & 0xFF; for (i = 0; i < 3; i++) sBattleBuffersTransferData[4 + i] = arg4[i]; PrepareBufferDataTransfer(bufferId, sBattleBuffersTransferData, 8); // Only 7 bytes were written. diff --git a/src/battle_debug.c b/src/battle_debug.c index 4b86b9963..1568c333c 100644 --- a/src/battle_debug.c +++ b/src/battle_debug.c @@ -1436,10 +1436,10 @@ static void SetUpModifyArrows(struct BattleDebugMenu *data) { case LIST_ITEM_ABILITY: data->modifyArrows.minValue = 0; - data->modifyArrows.maxValue = ABILITIES_COUNT_GEN7 - 1; + data->modifyArrows.maxValue = ABILITIES_COUNT_GEN8 - 1; data->modifyArrows.maxDigits = 3; data->modifyArrows.modifiedValPtr = &gBattleMons[data->battlerId].ability; - data->modifyArrows.typeOfVal = VAL_U8; + data->modifyArrows.typeOfVal = VAL_U16; data->modifyArrows.currValue = gBattleMons[data->battlerId].ability; break; case LIST_ITEM_MOVES: diff --git a/src/battle_main.c b/src/battle_main.c index 29194b889..645e6cd56 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -181,7 +181,7 @@ EWRAM_DATA s32 gBattleMoveDamage = 0; EWRAM_DATA s32 gHpDealt = 0; EWRAM_DATA s32 gTakenDmg[MAX_BATTLERS_COUNT] = {0}; EWRAM_DATA u16 gLastUsedItem = 0; -EWRAM_DATA u8 gLastUsedAbility = 0; +EWRAM_DATA u16 gLastUsedAbility = 0; EWRAM_DATA u8 gBattlerAttacker = 0; EWRAM_DATA u8 gBattlerTarget = 0; EWRAM_DATA u8 gBattlerFainted = 0; @@ -245,7 +245,7 @@ EWRAM_DATA u16 gMoveToLearn = 0; EWRAM_DATA u8 gBattleMonForms[MAX_BATTLERS_COUNT] = {0}; EWRAM_DATA u32 gFieldStatuses = 0; EWRAM_DATA struct FieldTimer gFieldTimers = {0}; -EWRAM_DATA u8 gBattlerAbility = 0; +EWRAM_DATA u16 gBattlerAbility = 0; EWRAM_DATA u16 gPartnerSpriteId = 0; // IWRAM common vars diff --git a/src/battle_message.c b/src/battle_message.c index 29eaf12ec..dd99c2c5c 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -49,7 +49,7 @@ static void ChooseTypeOfMoveUsedString(u8 *dst); static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst); // EWRAM vars -static EWRAM_DATA u8 sBattlerAbilities[MAX_BATTLERS_COUNT] = {0}; +static EWRAM_DATA u16 sBattlerAbilities[MAX_BATTLERS_COUNT] = {0}; EWRAM_DATA struct BattleMsgData *gBattleMsgDataPtr = NULL; // const rom data @@ -3320,7 +3320,7 @@ static void ExpandBattleTextBuffPlaceholders(const u8 *src, u8 *dst) break; case B_BUFF_ABILITY: // ability names StringAppend(dst, gAbilityNames[src[srcID + 1]]); - srcID += 2; + srcID += 3; break; case B_BUFF_ITEM: // item name hword = T1_READ_16(&src[srcID + 1]); diff --git a/src/battle_pike.c b/src/battle_pike.c index 6b31419a5..edcbc4e40 100644 --- a/src/battle_pike.c +++ b/src/battle_pike.c @@ -811,7 +811,7 @@ static void HealMon(struct Pokemon *mon) static bool8 DoesAbilityPreventStatus(struct Pokemon *mon, u32 status) { - u8 ability = GetMonAbility(mon); + u16 ability = GetMonAbility(mon); bool8 ret = FALSE; switch (status) @@ -1626,7 +1626,7 @@ static bool8 CanEncounterWildMon(u8 enemyMonLevel) { if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)) { - u8 monAbility = GetMonAbility(&gPlayerParty[0]); + u16 monAbility = GetMonAbility(&gPlayerParty[0]); if (monAbility == ABILITY_KEEN_EYE || monAbility == ABILITY_INTIMIDATE) { u8 playerMonLevel = GetMonData(&gPlayerParty[0], MON_DATA_LEVEL); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 5faadb24e..a8464532a 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3248,7 +3248,7 @@ static void Cmd_jumpifability(void) { u32 battlerId; bool32 hasAbility = FALSE; - u32 ability = gBattlescriptCurrInstr[2]; + u32 ability = T2_READ_16(gBattlescriptCurrInstr + 2); switch (gBattlescriptCurrInstr[1]) { @@ -3278,13 +3278,13 @@ static void Cmd_jumpifability(void) if (hasAbility) { gLastUsedAbility = ability; - gBattlescriptCurrInstr = T2_READ_PTR(gBattlescriptCurrInstr + 3); + gBattlescriptCurrInstr = T2_READ_PTR(gBattlescriptCurrInstr + 4); RecordAbilityBattle(battlerId, gLastUsedAbility); gBattlerAbility = battlerId; } else { - gBattlescriptCurrInstr += 7; + gBattlescriptCurrInstr += 8; } } @@ -4187,10 +4187,10 @@ static void Cmd_setroost(void) static void Cmd_jumpifabilitypresent(void) { - if (IsAbilityOnField(gBattlescriptCurrInstr[1])) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 2); + if (IsAbilityOnField(T1_READ_16(gBattlescriptCurrInstr + 1))) + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); else - gBattlescriptCurrInstr += 6; + gBattlescriptCurrInstr += 7; } static void Cmd_endselectionscript(void) @@ -9939,7 +9939,7 @@ static void Cmd_healpartystatus(void) if (species != SPECIES_NONE && species != SPECIES_EGG) { - u8 ability; + u16 ability; if (gBattlerPartyIndexes[gBattlerAttacker] == i) ability = gBattleMons[gBattlerAttacker].ability; @@ -10942,7 +10942,7 @@ static void Cmd_tryswapabilities(void) // skill swap } else { - u8 abilityAtk = gBattleMons[gBattlerAttacker].ability; + u16 abilityAtk = gBattleMons[gBattlerAttacker].ability; gBattleMons[gBattlerAttacker].ability = gBattleMons[gBattlerTarget].ability; gBattleMons[gBattlerTarget].ability = abilityAtk; @@ -11197,7 +11197,7 @@ static void Cmd_pickup(void) { s32 i; u16 species, heldItem; - u8 ability; + u16 ability; u8 lvlDivBy10; if (InBattlePike()) diff --git a/src/battle_util.c b/src/battle_util.c index 86de71de3..34e4d9bbd 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -2845,7 +2845,7 @@ static u8 ForewarnChooseMove(u32 battler) free(data); } -u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveArg) +u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 moveArg) { u8 effect = 0; u32 speciesAtk, speciesDef; @@ -6510,7 +6510,7 @@ u16 CalcTypeEffectivenessMultiplier(u16 move, u8 moveType, u8 battlerAtk, u8 bat return modifier; } -u16 CalcPartyMonTypeEffectivenessMultiplier(u16 move, u16 speciesDef, u8 abilityDef) +u16 CalcPartyMonTypeEffectivenessMultiplier(u16 move, u16 speciesDef, u16 abilityDef) { u16 modifier = UQ_4_12(1.0); u8 moveType = gBattleMoves[move].type; diff --git a/src/data/text/abilities.h b/src/data/text/abilities.h index 11b6ffaf7..182a33536 100644 --- a/src/data/text/abilities.h +++ b/src/data/text/abilities.h @@ -221,8 +221,33 @@ static const u8 sMistySurgeDescription[] = _("Field becomes misty."); static const u8 sGrassySurgeDescription[] = _("Field becomes grassy."); static const u8 sFullMetalBodyDescription[] = _("Prevents stat reduction."); static const u8 sNeuroforceDescription[] = _("Ups “super effective.“."); +static const u8 sIntrepidSwordDescription[] = _("Ups Attack on entry."); +static const u8 sDauntlessShieldDescription[] = _("Ups Defense on entry."); +static const u8 sLiberoDescription[] = _("Changes type to match move."); +static const u8 sBallFetchDescription[] = _("Fetches first failed Poké Ball."); +static const u8 sCottonDownDescription[] = _("Lowers everyone's Speed when hit."); +static const u8 sPropellerTailDescription[] = _("Moves ignore redirection."); +static const u8 sMirrorArmorDescription[] = _("Bounces back stat decreases."); +static const u8 sGulpMissileDescription[] = _("Spits prey if damaged after a swim."); +static const u8 sStalwartDescription[] = _("Moves ignore redirection."); +static const u8 sSteamEngineDescription[] = _("Fire and Water hits boost Speed."); +static const u8 sPunkRockDescription[] = _("Ups and resists sound moves."); +static const u8 sSandSpitDescription[] = _("Creates a sandstorm when hit."); +static const u8 sIceScalesDescription[] = _("Halves special damage."); +static const u8 sRipenDescription[] = _("Doubles Berry effects."); +static const u8 sIceFaceDescription[] = _("Takes one free physical hit."); +static const u8 sPowerSpotDescription[] = _("Powers up ally moves."); +static const u8 sMimicryDescription[] = _("Changes type with terrain."); +static const u8 sScreenCleanerDescription[] = _("Screens are removed on entry."); +static const u8 sSteelySpiritDescription[] = _("Boosts ally Steel moves."); +static const u8 sPerishBodyDescription[] = _("Gives a perish count on contact."); +static const u8 sWanderingSpiritDescription[] = _("Trades Abilities on contact."); +static const u8 sGorillaTacticsDescription[] = _("Ups Attack, but allows one move."); +static const u8 sNeutralizingGasDescription[] = _("All Abilities are nullified."); +static const u8 sPastelVeilDescription[] = _("Protects team from poison."); +static const u8 sHungerSwitchDescription[] = _("Changes form each turn."); -const u8 gAbilityNames[ABILITIES_COUNT_GEN7][ABILITY_NAME_LENGTH + 1] = +const u8 gAbilityNames[ABILITIES_COUNT_GEN8][ABILITY_NAME_LENGTH + 1] = { [ABILITY_NONE] = _("-------"), [ABILITY_STENCH] = _("Stench"), @@ -459,9 +484,34 @@ const u8 gAbilityNames[ABILITIES_COUNT_GEN7][ABILITY_NAME_LENGTH + 1] = [ABILITY_SHADOW_SHIELD] = _("ShadowShield"), [ABILITY_PRISM_ARMOR] = _("Prism Armor"), [ABILITY_NEUROFORCE] = _("Neuroforce"), + [ABILITY_INTREPID_SWORD] = _("IntrepidSwor"), + [ABILITY_DAUNTLESS_SHIELD] = _("DauntlessShi"), + [ABILITY_LIBERO] = _("Libero"), + [ABILITY_BALL_FETCH] = _("Ball Fetch"), + [ABILITY_COTTON_DOWN] = _("Cotton Down"), + [ABILITY_PROPELLER_TAIL] = _("PropellerTai"), + [ABILITY_MIRROR_ARMOR] = _("Mirror Armor"), + [ABILITY_GULP_MISSILE] = _("Gulp Missile"), + [ABILITY_STALWART] = _("Stalwart"), + [ABILITY_STEAM_ENGINE] = _("Steam Engine"), + [ABILITY_PUNK_ROCK] = _("Punk Rock"), + [ABILITY_SAND_SPIT] = _("Sand Spit"), + [ABILITY_ICE_SCALES] = _("Ice Scales"), + [ABILITY_RIPEN] = _("Ripen"), + [ABILITY_ICE_FACE] = _("Ice Face"), + [ABILITY_POWER_SPOT] = _("Power Spot"), + [ABILITY_MIMICRY] = _("Mimicry"), + [ABILITY_SCREEN_CLEANER] = _("ScreenCleane"), + [ABILITY_STEELY_SPIRIT] = _("SteelySpirit"), + [ABILITY_PERISH_BODY] = _("Perish Body"), + [ABILITY_WANDERING_SPIRIT] = _("WanderingSpi"), + [ABILITY_GORILLA_TACTICS] = _("GorillaTacti"), + [ABILITY_NEUTRALIZING_GAS] = _("Neutralizing"), + [ABILITY_PASTEL_VEIL] = _("Pastel Veil"), + [ABILITY_HUNGER_SWITCH] = _("HungerSwitch"), }; -const u8 *const gAbilityDescriptionPointers[ABILITIES_COUNT_GEN7] = +const u8 *const gAbilityDescriptionPointers[ABILITIES_COUNT_GEN8] = { [ABILITY_NONE] = sNoneDescription, [ABILITY_STENCH] = sStenchDescription, @@ -698,4 +748,29 @@ const u8 *const gAbilityDescriptionPointers[ABILITIES_COUNT_GEN7] = [ABILITY_SHADOW_SHIELD] = sMultiscaleDescription, [ABILITY_PRISM_ARMOR] = sFilterDescription, [ABILITY_NEUROFORCE] = sNeuroforceDescription, + [ABILITY_INTREPID_SWORD] = sIntrepidSwordDescription, + [ABILITY_DAUNTLESS_SHIELD] = sDauntlessShieldDescription, + [ABILITY_LIBERO] = sLiberoDescription, + [ABILITY_BALL_FETCH] = sBallFetchDescription, + [ABILITY_COTTON_DOWN] = sCottonDownDescription, + [ABILITY_PROPELLER_TAIL] = sPropellerTailDescription, + [ABILITY_MIRROR_ARMOR] = sMirrorArmorDescription, + [ABILITY_GULP_MISSILE] = sGulpMissileDescription, + [ABILITY_STALWART] = sStalwartDescription, + [ABILITY_STEAM_ENGINE] = sSteamEngineDescription, + [ABILITY_PUNK_ROCK] = sPunkRockDescription, + [ABILITY_SAND_SPIT] = sSandSpitDescription, + [ABILITY_ICE_SCALES] = sIceScalesDescription, + [ABILITY_RIPEN] = sRipenDescription, + [ABILITY_ICE_FACE] = sIceFaceDescription, + [ABILITY_POWER_SPOT] = sPowerSpotDescription, + [ABILITY_MIMICRY] = sMimicryDescription, + [ABILITY_SCREEN_CLEANER] = sScreenCleanerDescription, + [ABILITY_STEELY_SPIRIT] = sSteelySpiritDescription, + [ABILITY_PERISH_BODY] = sPerishBodyDescription, + [ABILITY_WANDERING_SPIRIT] = sWanderingSpiritDescription, + [ABILITY_GORILLA_TACTICS] = sGorillaTacticsDescription, + [ABILITY_NEUTRALIZING_GAS] = sNeutralizingGasDescription, + [ABILITY_PASTEL_VEIL] = sPastelVeilDescription, + [ABILITY_HUNGER_SWITCH] = sHungerSwitchDescription, }; diff --git a/src/egg_hatch.c b/src/egg_hatch.c index 032ae6733..a7da3234a 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -872,7 +872,7 @@ u8 GetEggStepsToSubtract(void) { if (!GetMonData(&gPlayerParty[i], MON_DATA_SANITY_IS_EGG)) { - u8 ability = GetMonAbility(&gPlayerParty[i]); + u16 ability = GetMonAbility(&gPlayerParty[i]); if (ability == ABILITY_MAGMA_ARMOR || ability == ABILITY_FLAME_BODY) return 2; } diff --git a/src/field_player_avatar.c b/src/field_player_avatar.c index b0918a78d..9928d6a4f 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -1827,7 +1827,7 @@ static bool8 Fishing6(struct Task *task) { if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)) { - u8 ability = GetMonAbility(&gPlayerParty[0]); + u16 ability = GetMonAbility(&gPlayerParty[0]); if (ability == ABILITY_SUCTION_CUPS || ability == ABILITY_STICKY_HOLD) { if (Random() % 100 > 14) diff --git a/src/fldeff_cut.c b/src/fldeff_cut.c index 88927959e..8e216da4c 100644 --- a/src/fldeff_cut.c +++ b/src/fldeff_cut.c @@ -141,7 +141,7 @@ bool8 SetUpFieldMove_Cut(void) s16 x, y; u8 i, j; u8 tileBehavior; - u8 userAbility; + u16 userAbility; bool8 cutTiles[CUT_NORMAL_AREA]; bool8 ret; diff --git a/src/pokemon.c b/src/pokemon.c index a417fffec..62fe01704 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -4170,7 +4170,7 @@ u8 GetMonsStateToDoubles_2(void) return (aliveCount > 1) ? PLAYER_HAS_TWO_USABLE_MONS : PLAYER_HAS_ONE_USABLE_MON; } -u8 GetAbilityBySpecies(u16 species, u8 abilityNum) +u16 GetAbilityBySpecies(u16 species, u8 abilityNum) { if (abilityNum) gLastUsedAbility = gBaseStats[species].abilities[1]; @@ -4180,7 +4180,7 @@ u8 GetAbilityBySpecies(u16 species, u8 abilityNum) return gLastUsedAbility; } -u8 GetMonAbility(struct Pokemon *mon) +u16 GetMonAbility(struct Pokemon *mon) { u16 species = GetMonData(mon, MON_DATA_SPECIES, NULL); u8 abilityNum = GetMonData(mon, MON_DATA_ABILITY_NUM, NULL); diff --git a/src/pokemon_summary_screen.c b/src/pokemon_summary_screen.c index db6da1495..4751e052a 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -3173,13 +3173,13 @@ static void PrintMonOTID(void) static void PrintMonAbilityName(void) { - u8 ability = GetAbilityBySpecies(sMonSummaryScreen->summary.species, sMonSummaryScreen->summary.abilityNum); + u16 ability = GetAbilityBySpecies(sMonSummaryScreen->summary.species, sMonSummaryScreen->summary.abilityNum); SummaryScreen_PrintTextOnWindow(AddWindowFromTemplateList(sPageInfoTemplate, PSS_DATA_WINDOW_INFO_ABILITY), gAbilityNames[ability], 0, 1, 0, 1); } static void PrintMonAbilityDescription(void) { - u8 ability = GetAbilityBySpecies(sMonSummaryScreen->summary.species, sMonSummaryScreen->summary.abilityNum); + u16 ability = GetAbilityBySpecies(sMonSummaryScreen->summary.species, sMonSummaryScreen->summary.abilityNum); SummaryScreen_PrintTextOnWindow(AddWindowFromTemplateList(sPageInfoTemplate, PSS_DATA_WINDOW_INFO_ABILITY), gAbilityDescriptionPointers[ability], 0, 17, 0, 0); } diff --git a/src/wild_encounter.c b/src/wild_encounter.c index 9f2197cee..f218d0f2d 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -36,7 +36,7 @@ static void FeebasSeedRng(u16 seed); static bool8 IsWildLevelAllowedByRepel(u8 level); static void ApplyFluteEncounterRateMod(u32 *encRate); static void ApplyCleanseTagEncounterRateMod(u32 *encRate); -static bool8 TryGetAbilityInfluencedWildMonIndex(const struct WildPokemon *wildMon, u8 type, u8 ability, u8 *monIndex); +static bool8 TryGetAbilityInfluencedWildMonIndex(const struct WildPokemon *wildMon, u8 type, u16 ability, u8 *monIndex); static bool8 IsAbilityAllowingEncounter(u8 level); // EWRAM vars @@ -256,7 +256,7 @@ static u8 ChooseWildMonLevel(const struct WildPokemon *wildPokemon) // check ability for max level mon if (!GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)) { - u8 ability = GetMonAbility(&gPlayerParty[0]); + u16 ability = GetMonAbility(&gPlayerParty[0]); if (ability == ABILITY_HUSTLE || ability == ABILITY_VITAL_SPIRIT || ability == ABILITY_PRESSURE) { if (Random() % 2 == 0) @@ -905,7 +905,7 @@ static bool8 IsWildLevelAllowedByRepel(u8 wildLevel) static bool8 IsAbilityAllowingEncounter(u8 level) { - u8 ability; + u16 ability; if (GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)) return TRUE; @@ -942,7 +942,7 @@ static bool8 TryGetRandomWildMonIndexByType(const struct WildPokemon *wildMon, u return TRUE; } -static bool8 TryGetAbilityInfluencedWildMonIndex(const struct WildPokemon *wildMon, u8 type, u8 ability, u8 *monIndex) +static bool8 TryGetAbilityInfluencedWildMonIndex(const struct WildPokemon *wildMon, u8 type, u16 ability, u8 *monIndex) { if (GetMonData(&gPlayerParty[0], MON_DATA_SANITY_IS_EGG)) return FALSE; From 63bd0ec8364a9c126983254aa6945bc17ef3b074 Mon Sep 17 00:00:00 2001 From: ultima-soul Date: Mon, 16 Nov 2020 15:42:09 -0800 Subject: [PATCH 2/6] Remove Cacophony and fix some Gen 8 ability descriptions to fit. --- include/constants/abilities.h | 397 +++++++++++++++++----------------- src/data/text/abilities.h | 7 +- 2 files changed, 200 insertions(+), 204 deletions(-) diff --git a/include/constants/abilities.h b/include/constants/abilities.h index 420b2ec11..23b9fe2b7 100644 --- a/include/constants/abilities.h +++ b/include/constants/abilities.h @@ -77,221 +77,220 @@ #define ABILITY_WHITE_SMOKE 73 #define ABILITY_PURE_POWER 74 #define ABILITY_SHELL_ARMOR 75 -#define ABILITY_CACOPHONY 76 -#define ABILITY_AIR_LOCK 77 +#define ABILITY_AIR_LOCK 76 -#define ABILITIES_COUNT_GEN3 78 +#define ABILITIES_COUNT_GEN3 77 // Gen 4 -#define ABILITY_TANGLED_FEET 78 -#define ABILITY_MOTOR_DRIVE 79 -#define ABILITY_RIVALRY 80 -#define ABILITY_STEADFAST 81 -#define ABILITY_SNOW_CLOAK 82 -#define ABILITY_GLUTTONY 83 -#define ABILITY_ANGER_POINT 84 -#define ABILITY_UNBURDEN 85 -#define ABILITY_HEATPROOF 86 -#define ABILITY_SIMPLE 87 -#define ABILITY_DRY_SKIN 88 -#define ABILITY_DOWNLOAD 89 -#define ABILITY_IRON_FIST 90 -#define ABILITY_POISON_HEAL 91 -#define ABILITY_ADAPTABILITY 92 -#define ABILITY_SKILL_LINK 93 -#define ABILITY_HYDRATION 94 -#define ABILITY_SOLAR_POWER 95 -#define ABILITY_QUICK_FEET 96 -#define ABILITY_NORMALIZE 97 -#define ABILITY_SNIPER 98 -#define ABILITY_MAGIC_GUARD 99 -#define ABILITY_NO_GUARD 100 -#define ABILITY_STALL 101 -#define ABILITY_TECHNICIAN 102 -#define ABILITY_LEAF_GUARD 103 -#define ABILITY_KLUTZ 104 -#define ABILITY_MOLD_BREAKER 105 -#define ABILITY_SUPER_LUCK 106 -#define ABILITY_AFTERMATH 107 -#define ABILITY_ANTICIPATION 108 -#define ABILITY_FOREWARN 109 -#define ABILITY_UNAWARE 110 -#define ABILITY_TINTED_LENS 111 -#define ABILITY_FILTER 112 -#define ABILITY_SLOW_START 113 -#define ABILITY_SCRAPPY 114 -#define ABILITY_STORM_DRAIN 115 -#define ABILITY_ICE_BODY 116 -#define ABILITY_SOLID_ROCK 117 -#define ABILITY_SNOW_WARNING 118 -#define ABILITY_HONEY_GATHER 119 -#define ABILITY_FRISK 120 -#define ABILITY_RECKLESS 121 -#define ABILITY_MULTITYPE 122 -#define ABILITY_FLOWER_GIFT 123 -#define ABILITY_BAD_DREAMS 124 +#define ABILITY_TANGLED_FEET 77 +#define ABILITY_MOTOR_DRIVE 78 +#define ABILITY_RIVALRY 79 +#define ABILITY_STEADFAST 80 +#define ABILITY_SNOW_CLOAK 81 +#define ABILITY_GLUTTONY 82 +#define ABILITY_ANGER_POINT 83 +#define ABILITY_UNBURDEN 84 +#define ABILITY_HEATPROOF 85 +#define ABILITY_SIMPLE 86 +#define ABILITY_DRY_SKIN 87 +#define ABILITY_DOWNLOAD 88 +#define ABILITY_IRON_FIST 89 +#define ABILITY_POISON_HEAL 90 +#define ABILITY_ADAPTABILITY 91 +#define ABILITY_SKILL_LINK 92 +#define ABILITY_HYDRATION 93 +#define ABILITY_SOLAR_POWER 94 +#define ABILITY_QUICK_FEET 95 +#define ABILITY_NORMALIZE 96 +#define ABILITY_SNIPER 97 +#define ABILITY_MAGIC_GUARD 98 +#define ABILITY_NO_GUARD 99 +#define ABILITY_STALL 100 +#define ABILITY_TECHNICIAN 101 +#define ABILITY_LEAF_GUARD 102 +#define ABILITY_KLUTZ 103 +#define ABILITY_MOLD_BREAKER 104 +#define ABILITY_SUPER_LUCK 105 +#define ABILITY_AFTERMATH 106 +#define ABILITY_ANTICIPATION 107 +#define ABILITY_FOREWARN 108 +#define ABILITY_UNAWARE 109 +#define ABILITY_TINTED_LENS 110 +#define ABILITY_FILTER 111 +#define ABILITY_SLOW_START 112 +#define ABILITY_SCRAPPY 113 +#define ABILITY_STORM_DRAIN 114 +#define ABILITY_ICE_BODY 115 +#define ABILITY_SOLID_ROCK 116 +#define ABILITY_SNOW_WARNING 117 +#define ABILITY_HONEY_GATHER 118 +#define ABILITY_FRISK 119 +#define ABILITY_RECKLESS 120 +#define ABILITY_MULTITYPE 121 +#define ABILITY_FLOWER_GIFT 122 +#define ABILITY_BAD_DREAMS 123 -#define ABILITIES_COUNT_GEN4 125 +#define ABILITIES_COUNT_GEN4 124 // Gen 5 -#define ABILITY_PICKPOCKET 125 -#define ABILITY_SHEER_FORCE 126 -#define ABILITY_CONTRARY 127 -#define ABILITY_UNNERVE 128 -#define ABILITY_DEFIANT 129 -#define ABILITY_DEFEATIST 130 -#define ABILITY_CURSED_BODY 131 -#define ABILITY_HEALER 132 -#define ABILITY_FRIEND_GUARD 133 -#define ABILITY_WEAK_ARMOR 134 -#define ABILITY_HEAVY_METAL 135 -#define ABILITY_LIGHT_METAL 136 -#define ABILITY_MULTISCALE 137 -#define ABILITY_TOXIC_BOOST 138 -#define ABILITY_FLARE_BOOST 139 -#define ABILITY_HARVEST 140 -#define ABILITY_TELEPATHY 141 -#define ABILITY_MOODY 142 -#define ABILITY_OVERCOAT 143 -#define ABILITY_POISON_TOUCH 144 -#define ABILITY_REGENERATOR 145 -#define ABILITY_BIG_PECKS 146 -#define ABILITY_SAND_RUSH 147 -#define ABILITY_WONDER_SKIN 148 -#define ABILITY_ANALYTIC 149 -#define ABILITY_ILLUSION 150 -#define ABILITY_IMPOSTER 151 -#define ABILITY_INFILTRATOR 152 -#define ABILITY_MUMMY 153 -#define ABILITY_MOXIE 154 -#define ABILITY_JUSTIFIED 155 -#define ABILITY_RATTLED 156 -#define ABILITY_MAGIC_BOUNCE 157 -#define ABILITY_SAP_SIPPER 158 -#define ABILITY_PRANKSTER 159 -#define ABILITY_SAND_FORCE 160 -#define ABILITY_IRON_BARBS 161 -#define ABILITY_ZEN_MODE 162 -#define ABILITY_VICTORY_STAR 163 -#define ABILITY_TURBOBLAZE 164 -#define ABILITY_TERAVOLT 165 +#define ABILITY_PICKPOCKET 124 +#define ABILITY_SHEER_FORCE 125 +#define ABILITY_CONTRARY 126 +#define ABILITY_UNNERVE 127 +#define ABILITY_DEFIANT 128 +#define ABILITY_DEFEATIST 129 +#define ABILITY_CURSED_BODY 130 +#define ABILITY_HEALER 131 +#define ABILITY_FRIEND_GUARD 132 +#define ABILITY_WEAK_ARMOR 133 +#define ABILITY_HEAVY_METAL 134 +#define ABILITY_LIGHT_METAL 135 +#define ABILITY_MULTISCALE 136 +#define ABILITY_TOXIC_BOOST 137 +#define ABILITY_FLARE_BOOST 138 +#define ABILITY_HARVEST 139 +#define ABILITY_TELEPATHY 140 +#define ABILITY_MOODY 141 +#define ABILITY_OVERCOAT 142 +#define ABILITY_POISON_TOUCH 143 +#define ABILITY_REGENERATOR 144 +#define ABILITY_BIG_PECKS 145 +#define ABILITY_SAND_RUSH 146 +#define ABILITY_WONDER_SKIN 147 +#define ABILITY_ANALYTIC 148 +#define ABILITY_ILLUSION 149 +#define ABILITY_IMPOSTER 150 +#define ABILITY_INFILTRATOR 151 +#define ABILITY_MUMMY 152 +#define ABILITY_MOXIE 153 +#define ABILITY_JUSTIFIED 154 +#define ABILITY_RATTLED 155 +#define ABILITY_MAGIC_BOUNCE 156 +#define ABILITY_SAP_SIPPER 157 +#define ABILITY_PRANKSTER 158 +#define ABILITY_SAND_FORCE 159 +#define ABILITY_IRON_BARBS 160 +#define ABILITY_ZEN_MODE 161 +#define ABILITY_VICTORY_STAR 162 +#define ABILITY_TURBOBLAZE 163 +#define ABILITY_TERAVOLT 164 -#define ABILITIES_COUNT_GEN5 166 +#define ABILITIES_COUNT_GEN5 165 // Gen 6 -#define ABILITY_AROMA_VEIL 166 -#define ABILITY_FLOWER_VEIL 167 -#define ABILITY_CHEEK_POUCH 168 -#define ABILITY_PROTEAN 169 -#define ABILITY_FUR_COAT 170 -#define ABILITY_MAGICIAN 171 -#define ABILITY_BULLETPROOF 172 -#define ABILITY_COMPETITIVE 173 -#define ABILITY_STRONG_JAW 174 -#define ABILITY_REFRIGERATE 175 -#define ABILITY_SWEET_VEIL 176 -#define ABILITY_STANCE_CHANGE 177 -#define ABILITY_GALE_WINGS 178 -#define ABILITY_MEGA_LAUNCHER 179 -#define ABILITY_GRASS_PELT 180 -#define ABILITY_SYMBIOSIS 181 -#define ABILITY_TOUGH_CLAWS 182 -#define ABILITY_PIXILATE 183 -#define ABILITY_GOOEY 184 -#define ABILITY_AERILATE 185 -#define ABILITY_PARENTAL_BOND 186 -#define ABILITY_DARK_AURA 187 -#define ABILITY_FAIRY_AURA 188 -#define ABILITY_AURA_BREAK 189 -#define ABILITY_PRIMORDIAL_SEA 190 -#define ABILITY_DESOLATE_LAND 191 -#define ABILITY_DELTA_STREAM 192 +#define ABILITY_AROMA_VEIL 165 +#define ABILITY_FLOWER_VEIL 166 +#define ABILITY_CHEEK_POUCH 167 +#define ABILITY_PROTEAN 168 +#define ABILITY_FUR_COAT 169 +#define ABILITY_MAGICIAN 170 +#define ABILITY_BULLETPROOF 171 +#define ABILITY_COMPETITIVE 172 +#define ABILITY_STRONG_JAW 173 +#define ABILITY_REFRIGERATE 174 +#define ABILITY_SWEET_VEIL 175 +#define ABILITY_STANCE_CHANGE 176 +#define ABILITY_GALE_WINGS 177 +#define ABILITY_MEGA_LAUNCHER 178 +#define ABILITY_GRASS_PELT 179 +#define ABILITY_SYMBIOSIS 180 +#define ABILITY_TOUGH_CLAWS 181 +#define ABILITY_PIXILATE 182 +#define ABILITY_GOOEY 183 +#define ABILITY_AERILATE 184 +#define ABILITY_PARENTAL_BOND 185 +#define ABILITY_DARK_AURA 186 +#define ABILITY_FAIRY_AURA 187 +#define ABILITY_AURA_BREAK 188 +#define ABILITY_PRIMORDIAL_SEA 189 +#define ABILITY_DESOLATE_LAND 190 +#define ABILITY_DELTA_STREAM 191 -#define ABILITIES_COUNT_GEN6 193 +#define ABILITIES_COUNT_GEN6 192 // Gen 7 -#define ABILITY_STAMINA 193 -#define ABILITY_WIMP_OUT 194 -#define ABILITY_EMERGENCY_EXIT 195 -#define ABILITY_WATER_COMPACTION 196 -#define ABILITY_MERCILESS 197 -#define ABILITY_SHIELDS_DOWN 198 -#define ABILITY_STAKEOUT 199 -#define ABILITY_WATER_BUBBLE 200 -#define ABILITY_STEELWORKER 201 -#define ABILITY_BERSERK 202 -#define ABILITY_SLUSH_RUSH 203 -#define ABILITY_LONG_REACH 204 -#define ABILITY_LIQUID_VOICE 205 -#define ABILITY_TRIAGE 206 -#define ABILITY_GALVANIZE 207 -#define ABILITY_SURGE_SURFER 208 -#define ABILITY_SCHOOLING 209 -#define ABILITY_DISGUISE 210 -#define ABILITY_BATTLE_BOND 211 -#define ABILITY_POWER_CONSTRUCT 212 -#define ABILITY_CORROSION 213 -#define ABILITY_COMATOSE 214 -#define ABILITY_QUEENLY_MAJESTY 215 -#define ABILITY_INNARDS_OUT 216 -#define ABILITY_DANCER 217 -#define ABILITY_BATTERY 218 -#define ABILITY_FLUFFY 219 -#define ABILITY_DAZZLING 220 -#define ABILITY_SOUL_HEART 221 -#define ABILITY_TANGLING_HAIR 222 -#define ABILITY_RECEIVER 223 -#define ABILITY_POWER_OF_ALCHEMY 224 -#define ABILITY_BEAST_BOOST 225 -#define ABILITY_RKS_SYSTEM 226 -#define ABILITY_ELECTRIC_SURGE 227 -#define ABILITY_PSYCHIC_SURGE 228 -#define ABILITY_MISTY_SURGE 229 -#define ABILITY_GRASSY_SURGE 230 -#define ABILITY_FULL_METAL_BODY 231 -#define ABILITY_SHADOW_SHIELD 232 -#define ABILITY_PRISM_ARMOR 233 -#define ABILITY_NEUROFORCE 234 +#define ABILITY_STAMINA 192 +#define ABILITY_WIMP_OUT 193 +#define ABILITY_EMERGENCY_EXIT 194 +#define ABILITY_WATER_COMPACTION 195 +#define ABILITY_MERCILESS 196 +#define ABILITY_SHIELDS_DOWN 197 +#define ABILITY_STAKEOUT 198 +#define ABILITY_WATER_BUBBLE 199 +#define ABILITY_STEELWORKER 200 +#define ABILITY_BERSERK 201 +#define ABILITY_SLUSH_RUSH 202 +#define ABILITY_LONG_REACH 203 +#define ABILITY_LIQUID_VOICE 204 +#define ABILITY_TRIAGE 205 +#define ABILITY_GALVANIZE 206 +#define ABILITY_SURGE_SURFER 207 +#define ABILITY_SCHOOLING 208 +#define ABILITY_DISGUISE 209 +#define ABILITY_BATTLE_BOND 210 +#define ABILITY_POWER_CONSTRUCT 211 +#define ABILITY_CORROSION 212 +#define ABILITY_COMATOSE 213 +#define ABILITY_QUEENLY_MAJESTY 214 +#define ABILITY_INNARDS_OUT 215 +#define ABILITY_DANCER 216 +#define ABILITY_BATTERY 217 +#define ABILITY_FLUFFY 218 +#define ABILITY_DAZZLING 219 +#define ABILITY_SOUL_HEART 220 +#define ABILITY_TANGLING_HAIR 221 +#define ABILITY_RECEIVER 222 +#define ABILITY_POWER_OF_ALCHEMY 223 +#define ABILITY_BEAST_BOOST 224 +#define ABILITY_RKS_SYSTEM 225 +#define ABILITY_ELECTRIC_SURGE 226 +#define ABILITY_PSYCHIC_SURGE 227 +#define ABILITY_MISTY_SURGE 228 +#define ABILITY_GRASSY_SURGE 229 +#define ABILITY_FULL_METAL_BODY 230 +#define ABILITY_SHADOW_SHIELD 231 +#define ABILITY_PRISM_ARMOR 232 +#define ABILITY_NEUROFORCE 233 -#define ABILITIES_COUNT_GEN7 235 +#define ABILITIES_COUNT_GEN7 234 // Gen 8 -#define ABILITY_INTREPID_SWORD 235 -#define ABILITY_DAUNTLESS_SHIELD 236 -#define ABILITY_LIBERO 237 -#define ABILITY_BALL_FETCH 238 -#define ABILITY_COTTON_DOWN 239 -#define ABILITY_PROPELLER_TAIL 240 -#define ABILITY_MIRROR_ARMOR 241 -#define ABILITY_GULP_MISSILE 242 -#define ABILITY_STALWART 243 -#define ABILITY_STEAM_ENGINE 244 -#define ABILITY_PUNK_ROCK 245 -#define ABILITY_SAND_SPIT 246 -#define ABILITY_ICE_SCALES 247 -#define ABILITY_RIPEN 248 -#define ABILITY_ICE_FACE 249 -#define ABILITY_POWER_SPOT 250 -#define ABILITY_MIMICRY 251 -#define ABILITY_SCREEN_CLEANER 252 -#define ABILITY_STEELY_SPIRIT 253 -#define ABILITY_PERISH_BODY 254 -#define ABILITY_WANDERING_SPIRIT 255 -#define ABILITY_GORILLA_TACTICS 256 -#define ABILITY_NEUTRALIZING_GAS 257 -#define ABILITY_PASTEL_VEIL 258 -#define ABILITY_HUNGER_SWITCH 259 -#define ABILITY_QUICK_DRAW 260 -#define ABILITY_UNSEEN_FIST 261 -#define ABILITY_CURIOUS_MEDICINE 262 -#define ABILITY_TRANSISTOR 263 -#define ABILITY_DRAGONS_MAW 264 -#define ABILITY_CHILLING_NEIGH 265 -#define ABILITY_GRIM_NEIGH 266 -#define ABILITY_AS_ONE_ICE_RIDER 267 -#define ABILITY_AS_ONE_SHADOW_RIDER 268 +#define ABILITY_INTREPID_SWORD 234 +#define ABILITY_DAUNTLESS_SHIELD 235 +#define ABILITY_LIBERO 236 +#define ABILITY_BALL_FETCH 237 +#define ABILITY_COTTON_DOWN 238 +#define ABILITY_PROPELLER_TAIL 239 +#define ABILITY_MIRROR_ARMOR 240 +#define ABILITY_GULP_MISSILE 241 +#define ABILITY_STALWART 242 +#define ABILITY_STEAM_ENGINE 243 +#define ABILITY_PUNK_ROCK 244 +#define ABILITY_SAND_SPIT 245 +#define ABILITY_ICE_SCALES 246 +#define ABILITY_RIPEN 247 +#define ABILITY_ICE_FACE 248 +#define ABILITY_POWER_SPOT 249 +#define ABILITY_MIMICRY 250 +#define ABILITY_SCREEN_CLEANER 251 +#define ABILITY_STEELY_SPIRIT 252 +#define ABILITY_PERISH_BODY 253 +#define ABILITY_WANDERING_SPIRIT 254 +#define ABILITY_GORILLA_TACTICS 255 +#define ABILITY_NEUTRALIZING_GAS 256 +#define ABILITY_PASTEL_VEIL 257 +#define ABILITY_HUNGER_SWITCH 258 +#define ABILITY_QUICK_DRAW 259 +#define ABILITY_UNSEEN_FIST 260 +#define ABILITY_CURIOUS_MEDICINE 261 +#define ABILITY_TRANSISTOR 262 +#define ABILITY_DRAGONS_MAW 263 +#define ABILITY_CHILLING_NEIGH 264 +#define ABILITY_GRIM_NEIGH 265 +#define ABILITY_AS_ONE_ICE_RIDER 266 +#define ABILITY_AS_ONE_SHADOW_RIDER 267 -#define ABILITIES_COUNT_GEN8 269 +#define ABILITIES_COUNT_GEN8 268 #define ABILITIES_COUNT ABILITIES_COUNT_GEN8 diff --git a/src/data/text/abilities.h b/src/data/text/abilities.h index 882c3d30c..37fb15f25 100644 --- a/src/data/text/abilities.h +++ b/src/data/text/abilities.h @@ -74,7 +74,6 @@ static const u8 sVitalSpiritDescription[] = _("Prevents sleep."); static const u8 sWhiteSmokeDescription[] = _("Prevents ability reduction."); static const u8 sPurePowerDescription[] = _("Raises Attack."); static const u8 sShellArmorDescription[] = _("Blocks critical hits."); -static const u8 sCacophonyDescription[] = _("Avoids sound-based moves."); static const u8 sAirLockDescription[] = _("Negates weather effects."); static const u8 sTangledFeetDescription[] = _("Ups evasion if confused."); static const u8 sMotorDriveDescription[] = _("Electricity raises Speed."); @@ -223,7 +222,7 @@ static const u8 sFullMetalBodyDescription[] = _("Prevents stat reduction."); static const u8 sNeuroforceDescription[] = _("Ups “supereffective”."); static const u8 sIntrepidSwordDescription[] = _("Ups Attack on entry."); static const u8 sDauntlessShieldDescription[] = _("Ups Defense on entry."); -static const u8 sLiberoDescription[] = _("Changes type to match move."); +static const u8 sLiberoDescription[] = _("Changes type to move's."); static const u8 sBallFetchDescription[] = _("Fetches failed Poké Ball."); static const u8 sCottonDownDescription[] = _("Lower Speed of all when hit."); static const u8 sPropellerTailDescription[] = _("Ignores foe's redirection."); @@ -247,7 +246,7 @@ static const u8 sNeutralizingGasDescription[] = _("All Abilities are nullified." static const u8 sPastelVeilDescription[] = _("Protects team from poison."); static const u8 sHungerSwitchDescription[] = _("Changes form each turn.");; static const u8 sQuickDrawDescription[] = _("Moves first occasionally."); -static const u8 sUnseenFistDescription[] = _("Contact ignores protection."); +static const u8 sUnseenFistDescription[] = _("Contact evades protection."); static const u8 sCuriousMedicineDescription[] = _("Remove ally's stat changes."); static const u8 sTransistorDescription[] = _("Ups Electric-type moves."); static const u8 sDragonsMawDescription[] = _("Ups Dragon-type moves."); @@ -334,7 +333,6 @@ const u8 gAbilityNames[ABILITIES_COUNT_GEN8][ABILITY_NAME_LENGTH + 1] = [ABILITY_WHITE_SMOKE] = _("White Smoke"), [ABILITY_PURE_POWER] = _("Pure Power"), [ABILITY_SHELL_ARMOR] = _("Shell Armor"), - [ABILITY_CACOPHONY] = _("Cacophony"), [ABILITY_AIR_LOCK] = _("Air Lock"), [ABILITY_TANGLED_FEET] = _("Tangled Feet"), [ABILITY_MOTOR_DRIVE] = _("Motor Drive"), @@ -607,7 +605,6 @@ const u8 *const gAbilityDescriptionPointers[ABILITIES_COUNT_GEN8] = [ABILITY_WHITE_SMOKE] = sWhiteSmokeDescription, [ABILITY_PURE_POWER] = sPurePowerDescription, [ABILITY_SHELL_ARMOR] = sShellArmorDescription, - [ABILITY_CACOPHONY] = sCacophonyDescription, [ABILITY_AIR_LOCK] = sAirLockDescription, [ABILITY_TANGLED_FEET] = sTangledFeetDescription, [ABILITY_MOTOR_DRIVE] = sMotorDriveDescription, From e15a86caae6272dbc35561fda2d08be518111e75 Mon Sep 17 00:00:00 2001 From: ultima-soul Date: Tue, 17 Nov 2020 10:32:24 -0800 Subject: [PATCH 3/6] =?UTF-8?q?Add=20ifdef=20for=20Hidden=20Abilities=20fr?= =?UTF-8?q?om=20Pok=C3=A9mon=20Expansion=20and=20change=20gBattlerAbility?= =?UTF-8?q?=20back=20to=20a=20u8.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- include/battle.h | 2 +- include/pokemon.h | 7 +++++-- src/battle_main.c | 2 +- 3 files changed, 7 insertions(+), 4 deletions(-) diff --git a/include/battle.h b/include/battle.h index 5846321a6..a6e201a23 100644 --- a/include/battle.h +++ b/include/battle.h @@ -815,7 +815,7 @@ extern u16 gMoveToLearn; extern u8 gBattleMonForms[MAX_BATTLERS_COUNT]; extern u32 gFieldStatuses; extern struct FieldTimer gFieldTimers; -extern u16 gBattlerAbility; +extern u8 gBattlerAbility; extern u16 gPartnerSpriteId; extern void (*gPreBattleCallback1)(void); diff --git a/include/pokemon.h b/include/pokemon.h index 8a8beb106..0c64d2137 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -199,8 +199,11 @@ struct BaseStats /* 0x14 */ u8 eggGroup1; /* 0x15 */ u8 eggGroup2; /* 0x16 */ u16 abilities[2]; - /* 0x1A */ u8 safariZoneFleeRate; - /* 0x1B */ u8 bodyColor : 7; +#ifdef POKEMON_EXPANSION + u16 abilityHidden; +#endif + u8 safariZoneFleeRate; + u8 bodyColor : 7; u8 noFlip : 1; }; diff --git a/src/battle_main.c b/src/battle_main.c index f0c658773..48129c523 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -226,7 +226,7 @@ EWRAM_DATA u16 gMoveToLearn = 0; EWRAM_DATA u8 gBattleMonForms[MAX_BATTLERS_COUNT] = {0}; EWRAM_DATA u32 gFieldStatuses = 0; EWRAM_DATA struct FieldTimer gFieldTimers = {0}; -EWRAM_DATA u16 gBattlerAbility = 0; +EWRAM_DATA u8 gBattlerAbility = 0; EWRAM_DATA u16 gPartnerSpriteId = 0; // IWRAM common vars From 07a4400d50e94bddf80329df312502b1c1c7be35 Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 19 Nov 2020 11:42:00 -0700 Subject: [PATCH 4/6] finish switch in ability messages --- data/battle_scripts_1.s | 7 +++ include/battle_scripts.h | 1 + include/constants/battle_string_ids.h | 25 ++++++++- src/battle_message.c | 30 +++++++++- src/battle_util.c | 81 +++++++++++++++++++++------ 5 files changed, 124 insertions(+), 20 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 504896d63..603a393b5 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -7688,3 +7688,10 @@ BattleScript_PrintPlayerForfeitedLinkBattle:: atk57 waitmessage 0x40 end2 + +BattleScript_AnnounceAirLockCloudNine:: + call BattleScript_AbilityPopUp + printstring STRINGID_AIRLOCKACTIVATES + waitmessage 0x40 + call BattleScript_WeatherFormChanges + end3 diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 84a7ba2ef..3566a1c4d 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -349,5 +349,6 @@ extern const u8 BattleScript_EmergencyExitNoPopUp[]; extern const u8 BattleScript_EmergencyExitWild[]; extern const u8 BattleScript_EmergencyExitWildNoPopUp[]; extern const u8 BattleScript_CheekPouchActivates[]; +extern const u8 BattleScript_AnnounceAirLockCloudNine[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 3c6d74b48..9348d67d5 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -551,7 +551,30 @@ #define STRINGID_CLOAKEDINAFREEZINGLIGHT 547 #define STRINGID_STATWASNOTLOWERED 548 #define STRINGID_FERVENTWISHREACHED 549 +#define STRINGID_AIRLOCKACTIVATES 550 +#define STRINGID_PRESSUREENTERS 551 +#define STRINGID_DARKAURAENTERS 552 +#define STRINGID_FAIRYAURAENTERS 553 +#define STRINGID_AURABREAKENTERS 554 +#define STRINGID_COMATOSEENTERS 555 +#define STRINGID_SCREENCLEANERENTERS 556 -#define BATTLESTRINGS_COUNT 550 +#define BATTLESTRINGS_COUNT 557 + +//// multichoice message IDs +// switch in ability message +#define MULTI_SWITCHIN_MOLDBREAKER 0 +#define MULTI_SWITCHIN_TERAVOLT 1 +#define MULTI_SWITCHIN_TURBOBLAZE 2 +#define MULTI_SWITCHIN_SLOWSTART 3 +#define MULTI_SWITCHIN_UNNERVE 4 +#define MULTI_SWITCHIN_ANTICIPATION 5 +#define MULTI_SWITCHIN_FOREWARN 6 +#define MULTI_SWITCHIN_PRESSURE 7 +#define MULTI_SWITCHIN_DARKAURA 8 +#define MULTI_SWITCHIN_FAIRYAURA 9 +#define MULTI_SWITCHIN_AURABREAK 10 +#define MULTI_SWITCHIN_COMATOSE 11 +#define MULTI_SWITCHIN_SCREENCLEANER 12 #endif // GUARD_CONSTANTS_BATTLE_STRING_IDS_H diff --git a/src/battle_message.c b/src/battle_message.c index 9e86d2774..2e1cf9c06 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -678,6 +678,13 @@ static const u8 sText_NoOneWillBeAbleToRun[] = _("No one will be able to run awa static const u8 sText_DestinyKnotActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} fell in love\nfrom the {B_LAST_ITEM}!"); static const u8 sText_CloakedInAFreezingLight[] = _("{B_ATK_NAME_WITH_PREFIX} became cloaked\nin a freezing light!"); static const u8 sText_StatWasNotLowered[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_BUFF1}\nwas not lowered!"); +static const u8 sText_AirLockActivates[] = _("The effects of weather\ndisappeared."); +static const u8 sText_PressureActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is extering its\npressure!"); +static const u8 sText_DarkAuraActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is radiating\na dark aura!"); +static const u8 sText_FairyAuraActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is radiating\na fairy aura!"); +static const u8 sText_AuraBreakActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} reversed all\nother POKéMON's auras!"); +static const u8 sText_ComatoseActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is drowsing!"); +static const u8 sText_ScreenCleanerActivates[] = _("All screens on the field were\ncleansed!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { @@ -1219,6 +1226,13 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_GRASSYTERRAINHEALS - 12] = sText_GrassyTerrainHeals, [STRINGID_ELECTRICTERRAINPREVENTS - 12] = sText_ElectricTerrainPreventsSleep, [STRINGID_PSYCHICTERRAINPREVENTS - 12] = sText_PsychicTerrainPreventsPriority, + [STRINGID_AIRLOCKACTIVATES - 12] = sText_AirLockActivates, + [STRINGID_PRESSUREENTERS - 12] = sText_PressureActivates, + [STRINGID_DARKAURAENTERS - 12] = sText_DarkAuraActivates, + [STRINGID_FAIRYAURAENTERS - 12] = sText_FairyAuraActivates, + [STRINGID_AURABREAKENTERS - 12] = sText_AuraBreakActivates, + [STRINGID_COMATOSEENTERS - 12] = sText_ComatoseActivates, + [STRINGID_SCREENCLEANERENTERS - 12] = sText_ScreenCleanerActivates, }; const u16 gTerrainStringIds[] = @@ -1248,9 +1262,19 @@ const u16 gDmgHazardsStringIds[] = const u16 gSwitchInAbilityStringIds[] = { - STRINGID_MOLDBREAKERENTERS, STRINGID_TERAVOLTENTERS, STRINGID_TURBOBLAZEENTERS, - STRINGID_SLOWSTARTENTERS, STRINGID_UNNERVEENTERS, STRINGID_ANTICIPATIONACTIVATES, - STRINGID_FOREWARNACTIVATES + [MULTI_SWITCHIN_MOLDBREAKER] = STRINGID_MOLDBREAKERENTERS, + [MULTI_SWITCHIN_TERAVOLT] = STRINGID_TERAVOLTENTERS, + [MULTI_SWITCHIN_TURBOBLAZE] = STRINGID_TURBOBLAZEENTERS, + [MULTI_SWITCHIN_SLOWSTART] = STRINGID_SLOWSTARTENTERS, + [MULTI_SWITCHIN_UNNERVE] = STRINGID_UNNERVEENTERS, + [MULTI_SWITCHIN_ANTICIPATION] = STRINGID_ANTICIPATIONACTIVATES, + [MULTI_SWITCHIN_FOREWARN] = STRINGID_FOREWARNACTIVATES, + [MULTI_SWITCHIN_PRESSURE] = STRINGID_PRESSUREENTERS, + [MULTI_SWITCHIN_DARKAURA] = STRINGID_DARKAURAENTERS, + [MULTI_SWITCHIN_FAIRYAURA] = STRINGID_FAIRYAURAENTERS, + [MULTI_SWITCHIN_AURABREAK] = STRINGID_AURABREAKENTERS, + [MULTI_SWITCHIN_COMATOSE] = STRINGID_COMATOSEENTERS, + [MULTI_SWITCHIN_SCREENCLEANER] = STRINGID_SCREENCLEANERENTERS, }; const u16 gMissStringIds[] = diff --git a/src/battle_util.c b/src/battle_util.c index 697c7799d..9337591bb 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3656,7 +3656,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA case ABILITY_MOLD_BREAKER: if (!gSpecialStatuses[battler].switchInAbilityDone) { - gBattleCommunication[MULTISTRING_CHOOSER] = 0; + gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_SWITCHIN_MOLDBREAKER; gSpecialStatuses[battler].switchInAbilityDone = 1; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; @@ -3665,7 +3665,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA case ABILITY_TERAVOLT: if (!gSpecialStatuses[battler].switchInAbilityDone) { - gBattleCommunication[MULTISTRING_CHOOSER] = 1; + gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_SWITCHIN_TERAVOLT; gSpecialStatuses[battler].switchInAbilityDone = 1; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; @@ -3674,7 +3674,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA case ABILITY_TURBOBLAZE: if (!gSpecialStatuses[battler].switchInAbilityDone) { - gBattleCommunication[MULTISTRING_CHOOSER] = 2; + gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_SWITCHIN_TURBOBLAZE; gSpecialStatuses[battler].switchInAbilityDone = 1; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; @@ -3684,7 +3684,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA if (!gSpecialStatuses[battler].switchInAbilityDone) { gDisableStructs[battler].slowStartTimer = 5; - gBattleCommunication[MULTISTRING_CHOOSER] = 3; + gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_SWITCHIN_SLOWSTART; gSpecialStatuses[battler].switchInAbilityDone = 1; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; @@ -3693,7 +3693,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA case ABILITY_UNNERVE: if (!gSpecialStatuses[battler].switchInAbilityDone) { - gBattleCommunication[MULTISTRING_CHOOSER] = 4; + gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_SWITCHIN_UNNERVE; gSpecialStatuses[battler].switchInAbilityDone = 1; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; @@ -3723,7 +3723,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA if (effect) { - gBattleCommunication[MULTISTRING_CHOOSER] = 5; + gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_SWITCHIN_ANTICIPATION; gSpecialStatuses[battler].switchInAbilityDone = 1; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); } @@ -3741,7 +3741,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA if (!gSpecialStatuses[battler].switchInAbilityDone) { ForewarnChooseMove(battler); - gBattleCommunication[MULTISTRING_CHOOSER] = 6; + gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_SWITCHIN_FOREWARN; gSpecialStatuses[battler].switchInAbilityDone = 1; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; @@ -3784,6 +3784,60 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA } } break; + case ABILITY_PRESSURE: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_SWITCHIN_PRESSURE; + gSpecialStatuses[battler].switchInAbilityDone = 1; + BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); + effect++; + } + break; + case ABILITY_DARK_AURA: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_SWITCHIN_DARKAURA; + gSpecialStatuses[battler].switchInAbilityDone = 1; + BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); + effect++; + } + break; + case ABILITY_FAIRY_AURA: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_SWITCHIN_FAIRYAURA; + gSpecialStatuses[battler].switchInAbilityDone = 1; + BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); + effect++; + } + break; + case ABILITY_AURA_BREAK: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_SWITCHIN_AURABREAK; + gSpecialStatuses[battler].switchInAbilityDone = 1; + BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); + effect++; + } + break; + case ABILITY_COMATOSE: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_SWITCHIN_COMATOSE; + gSpecialStatuses[battler].switchInAbilityDone = 1; + BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); + effect++; + } + break; + case ABILITY_SCREEN_CLEANER: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + gBattleCommunication[MULTISTRING_CHOOSER] = MULTI_SWITCHIN_SCREENCLEANER; + gSpecialStatuses[battler].switchInAbilityDone = 1; + BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); + effect++; + } + break; case ABILITY_DRIZZLE: if (TryChangeBattleWeather(battler, ENUM_WEATHER_RAIN, TRUE)) { @@ -3865,16 +3919,11 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA break; case ABILITY_CLOUD_NINE: case ABILITY_AIR_LOCK: - for (i = 0; i < gBattlersCount; i++) + if (!gSpecialStatuses[battler].switchInAbilityDone) { - effect = TryWeatherFormChange(i); - if (effect != 0) - { - BattleScriptPushCursorAndCallback(BattleScript_CastformChange); - gBattleScripting.battler = i; - gBattleStruct->formToChangeInto = effect - 1; - break; - } + gSpecialStatuses[battler].switchInAbilityDone = 1; + BattleScriptPushCursorAndCallback(BattleScript_AnnounceAirLockCloudNine); + effect++; } break; case ABILITY_SCHOOLING: From 56c0a392063237a3693a6100a2e35fd623bc036b Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 19 Nov 2020 11:53:47 -0700 Subject: [PATCH 5/6] fix pressure typo --- src/battle_message.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_message.c b/src/battle_message.c index 2e1cf9c06..21c52eac5 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -679,7 +679,7 @@ static const u8 sText_DestinyKnotActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX static const u8 sText_CloakedInAFreezingLight[] = _("{B_ATK_NAME_WITH_PREFIX} became cloaked\nin a freezing light!"); static const u8 sText_StatWasNotLowered[] = _("{B_DEF_NAME_WITH_PREFIX}'s {B_BUFF1}\nwas not lowered!"); static const u8 sText_AirLockActivates[] = _("The effects of weather\ndisappeared."); -static const u8 sText_PressureActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is extering its\npressure!"); +static const u8 sText_PressureActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is exerting its\npressure!"); static const u8 sText_DarkAuraActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is radiating\na dark aura!"); static const u8 sText_FairyAuraActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} is radiating\na fairy aura!"); static const u8 sText_AuraBreakActivates[] = _("{B_SCR_ACTIVE_NAME_WITH_PREFIX} reversed all\nother POKéMON's auras!"); From 914c8306165d1d70d4cacd3b54bf52a3ae8210ae Mon Sep 17 00:00:00 2001 From: ExpoSeed <43502820+ExpoSeed@users.noreply.github.com> Date: Thu, 19 Nov 2020 21:14:12 -0600 Subject: [PATCH 6/6] Remove Techno Blast and Judgment from battle scripts --- data/battle_scripts_1.s | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 504896d63..f99f0089b 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -316,8 +316,7 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectClearSmog .4byte BattleScript_EffectHitSwitchTarget .4byte BattleScript_EffectFinalGambit - .4byte BattleScript_EffectTechnoBlast - .4byte BattleScript_EffectJudgment + .4byte BattleScript_EffectChangeTypeOnItem .4byte BattleScript_EffectAutotomize .4byte BattleScript_EffectCopycat .4byte BattleScript_EffectDefog @@ -2046,8 +2045,7 @@ BattleScript_EffectPsyshock: BattleScript_EffectWeatherBall: BattleScript_EffectHiddenPower: BattleScript_EffectTwoTypedMove: -BattleScript_EffectTechnoBlast: -BattleScript_EffectJudgment: +BattleScript_EffectChangeTypeOnItem: BattleScript_EffectFusionCombo: BattleScript_EffectRevelationDance: BattleScript_EffectBelch: