diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 29f901acb..9a4e926b8 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/data/battle_scripts_1.s b/data/battle_scripts_1.s index 5a52e0f64..b3b5f7029 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: @@ -7689,7 +7687,6 @@ BattleScript_PrintPlayerForfeitedLinkBattle:: waitmessage 0x40 end2 - BattleScript_TotemFlaredToLife:: playanimation BS_ATTACKER, B_ANIM_TOTEM_FLARE, NULL printstring STRINGID_AURAFLAREDTOLIFE @@ -7708,3 +7705,10 @@ BattleScript_TotemVarPrintStatMsg: printfromtable gStatUpStringIds waitmessage 0x40 goto BattleScript_TotemVar @loop until stats bitfield is empty + +BattleScript_AnnounceAirLockCloudNine:: + call BattleScript_AbilityPopUp + printstring STRINGID_AIRLOCKACTIVATES + waitmessage 0x40 + call BattleScript_WeatherFormChanges + end3 diff --git a/include/battle.h b/include/battle.h index 53324b31b..e319104f6 100644 --- a/include/battle.h +++ b/include/battle.h @@ -229,7 +229,7 @@ struct WishFutureKnock struct AI_SavedBattleMon { - u8 ability; + u16 ability; u16 moves[MAX_MON_MOVES]; u16 heldItem; u16 species; @@ -254,7 +254,7 @@ struct AI_ThinkingStruct struct BattleHistory { - u8 abilities[MAX_BATTLERS_COUNT]; + u16 abilities[MAX_BATTLERS_COUNT]; u8 itemEffects[MAX_BATTLERS_COUNT]; u16 usedMoves[MAX_BATTLERS_COUNT][MAX_MON_MOVES]; u16 moveHistory[MAX_BATTLERS_COUNT][AI_MOVE_HISTORY_COUNT]; // 3 last used moves for each battler @@ -477,7 +477,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; @@ -530,7 +530,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]; @@ -757,7 +757,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; diff --git a/include/battle_ai_script_commands.h b/include/battle_ai_script_commands.h index bd990d77a..be3787398 100644 --- a/include/battle_ai_script_commands.h +++ b/include/battle_ai_script_commands.h @@ -19,7 +19,7 @@ bool32 IsBattlerAIControlled(u32 battlerId); void ClearBattlerMoveHistory(u8 battlerId); void RecordLastUsedMoveBy(u32 battlerId, u32 move); void RecordKnownMove(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 51d06b779..06f030860 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -105,7 +105,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) \ @@ -209,13 +210,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_scripts.h b/include/battle_scripts.h index df4b6db5a..4b2e39193 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -351,5 +351,6 @@ extern const u8 BattleScript_EmergencyExitWildNoPopUp[]; extern const u8 BattleScript_CheekPouchActivates[]; extern const u8 BattleScript_TotemVar[]; extern const u8 BattleScript_TotemFlaredToLife[]; +extern const u8 BattleScript_AnnounceAirLockCloudNine[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/battle_util.h b/include/battle_util.h index 422aa7300..f7699fced 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -90,7 +90,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); @@ -115,7 +115,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..23b9fe2b7 100644 --- a/include/constants/abilities.h +++ b/include/constants/abilities.h @@ -77,184 +77,221 @@ #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 -// Gen4 abilities. -#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 +// Gen 4 +#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 -// Gen5 abilities. -#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 +// Gen 5 +#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 -// Gen6 abilities. -#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 +// Gen 6 +#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 -// Gen7 abilities. -#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 +// Gen 7 +#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 -#define ABILITIES_COUNT ABILITIES_COUNT_GEN7 +// Gen 8 +#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 268 + +#define ABILITIES_COUNT ABILITIES_COUNT_GEN8 #endif // GUARD_CONSTANTS_ABILITIES_H diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 68d8fbc30..844c9fbf5 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -552,7 +552,30 @@ #define STRINGID_STATWASNOTLOWERED 548 #define STRINGID_FERVENTWISHREACHED 549 #define STRINGID_AURAFLAREDTOLIFE 550 +#define STRINGID_AIRLOCKACTIVATES 551 +#define STRINGID_PRESSUREENTERS 552 +#define STRINGID_DARKAURAENTERS 553 +#define STRINGID_FAIRYAURAENTERS 554 +#define STRINGID_AURABREAKENTERS 555 +#define STRINGID_COMATOSEENTERS 556 +#define STRINGID_SCREENCLEANERENTERS 557 -#define BATTLESTRINGS_COUNT 551 +#define BATTLESTRINGS_COUNT 558 + +//// 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/include/pokemon.h b/include/pokemon.h index b6277b9e2..0c64d2137 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,12 @@ 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]; +#ifdef POKEMON_EXPANSION + u16 abilityHidden; +#endif + u8 safariZoneFleeRate; + u8 bodyColor : 7; u8 noFlip : 1; }; @@ -327,8 +330,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 39246c732..8a5f423a4 100644 --- a/src/battle_ai_script_commands.c +++ b/src/battle_ai_script_commands.c @@ -788,7 +788,7 @@ void RecordKnownMove(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 83c8d8627..3d3bdc4c0 100644 --- a/src/battle_ai_switch_items.c +++ b/src/battle_ai_switch_items.c @@ -137,7 +137,7 @@ static bool8 ShouldSwitchIfWonderGuard(void) static bool8 FindMonThatAbsorbsOpponentsMove(void) { u8 battlerIn1, battlerIn2; - u8 absorbingTypeAbility; + u16 absorbingTypeAbility; s32 firstId; s32 lastId; // + 1 struct Pokemon *party; @@ -188,7 +188,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; @@ -369,7 +369,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 2ad113638..dfb9cc207 100644 --- a/src/battle_controller_player.c +++ b/src/battle_controller_player.c @@ -2762,7 +2762,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 8399ce51d..eb6d73ba7 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 4ed7b1e8c..05e6c9ef2 100644 --- a/src/battle_debug.c +++ b/src/battle_debug.c @@ -1448,10 +1448,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 3e9228997..73362864e 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -162,7 +162,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; diff --git a/src/battle_message.c b/src/battle_message.c index dbbc89983..33624c1f6 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -53,7 +53,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 @@ -679,6 +679,13 @@ 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_AuraFlaredToLife[] = _("{B_DEF_NAME_WITH_PREFIX}'s aura flared to life!"); +static const u8 sText_AirLockActivates[] = _("The effects of weather\ndisappeared."); +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!"); +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] = { @@ -1221,6 +1228,13 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_ELECTRICTERRAINPREVENTS - 12] = sText_ElectricTerrainPreventsSleep, [STRINGID_PSYCHICTERRAINPREVENTS - 12] = sText_PsychicTerrainPreventsPriority, [STRINGID_AURAFLAREDTOLIFE - 12] = sText_AuraFlaredToLife, + [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[] = @@ -1250,9 +1264,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[] = @@ -3411,7 +3435,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 a053789bb..54c2361f1 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) @@ -1627,7 +1627,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 adf072636..0492e0a70 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3432,7 +3432,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]) { @@ -3462,13 +3462,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; } } @@ -4386,10 +4386,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) @@ -10316,7 +10316,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; @@ -11319,7 +11319,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; @@ -11574,7 +11574,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 697c7799d..b929b7499 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3564,7 +3564,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; @@ -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: @@ -7428,7 +7477,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 8a4d8d353..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."); @@ -221,8 +220,42 @@ 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 “supereffective”."); +static const u8 sIntrepidSwordDescription[] = _("Ups Attack on entry."); +static const u8 sDauntlessShieldDescription[] = _("Ups Defense on entry."); +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."); +static const u8 sMirrorArmorDescription[] = _("Reflect stat decreases."); +static const u8 sGulpMissileDescription[] = _("If hit, spits prey from sea."); +static const u8 sStalwartDescription[] = _("Ignores foe's redirection."); +static const u8 sSteamEngineDescription[] = _("Fire or Water hits up Speed."); +static const u8 sPunkRockDescription[] = _("Ups and resists sound."); +static const u8 sSandSpitDescription[] = _("Creates a sandstorm if hit."); +static const u8 sIceScalesDescription[] = _("Halves special damage."); +static const u8 sRipenDescription[] = _("Doubles effect of Berries."); +static const u8 sIceFaceDescription[] = _("Take a free hit. Hail renews."); +static const u8 sPowerSpotDescription[] = _("Powers up ally moves."); +static const u8 sMimicryDescription[] = _("Changes type on terrain."); +static const u8 sScreenCleanerDescription[] = _("Removes walls of light."); +static const u8 sSteelySpiritDescription[] = _("Boosts ally's Steel moves."); +static const u8 sPerishBodyDescription[] = _("Foe faints in 3 turns if hit."); +static const u8 sWanderingSpiritDescription[] = _("Trade abilities on contact."); +static const u8 sGorillaTacticsDescription[] = _("Ups Attack and locks 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.");; +static const u8 sQuickDrawDescription[] = _("Moves first occasionally."); +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."); +static const u8 sChillingNeighDescription[] = _("KOs boost Attack stat."); +static const u8 sGrimNeighDescription[] = _("KOs boost Sp. Atk stat."); +static const u8 sAsOneIceRiderDescription[] = _("Unnerve and Chilling Neigh."); +static const u8 sAsOneShadowRiderDescription[] = _("Unnerve and Grim Neigh."); -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"), @@ -300,7 +333,6 @@ const u8 gAbilityNames[ABILITIES_COUNT_GEN7][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"), @@ -459,9 +491,43 @@ 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"), + [ABILITY_QUICK_DRAW] = _("Quick Draw"), + [ABILITY_UNSEEN_FIST] = _("Unseen Fist"), + [ABILITY_CURIOUS_MEDICINE] = _("CuriousMedic"), + [ABILITY_TRANSISTOR] = _("Transistor"), + [ABILITY_DRAGONS_MAW] = _("Dragon's Maw"), + [ABILITY_CHILLING_NEIGH] = _("ChillingNeig"), + [ABILITY_GRIM_NEIGH] = _("Grim Neigh"), + [ABILITY_AS_ONE_ICE_RIDER] = _("As One"), + [ABILITY_AS_ONE_SHADOW_RIDER] = _("As One"), }; -const u8 *const gAbilityDescriptionPointers[ABILITIES_COUNT_GEN7] = +const u8 *const gAbilityDescriptionPointers[ABILITIES_COUNT_GEN8] = { [ABILITY_NONE] = sNoneDescription, [ABILITY_STENCH] = sStenchDescription, @@ -539,7 +605,6 @@ const u8 *const gAbilityDescriptionPointers[ABILITIES_COUNT_GEN7] = [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, @@ -698,4 +763,38 @@ 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, + [ABILITY_QUICK_DRAW] = sQuickDrawDescription, + [ABILITY_UNSEEN_FIST] = sUnseenFistDescription, + [ABILITY_CURIOUS_MEDICINE] = sCuriousMedicineDescription, + [ABILITY_TRANSISTOR] = sTransistorDescription, + [ABILITY_DRAGONS_MAW] = sDragonsMawDescription, + [ABILITY_CHILLING_NEIGH] = sChillingNeighDescription, + [ABILITY_GRIM_NEIGH] = sGrimNeighDescription, + [ABILITY_AS_ONE_ICE_RIDER] = sAsOneIceRiderDescription, + [ABILITY_AS_ONE_SHADOW_RIDER] = sAsOneShadowRiderDescription, }; diff --git a/src/egg_hatch.c b/src/egg_hatch.c index 87f0a13fd..521e9aaaf 100644 --- a/src/egg_hatch.c +++ b/src/egg_hatch.c @@ -872,7 +872,7 @@ u8 GetEggCyclesToSubtract(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 f8c4e79f1..3e3d3c0f6 100644 --- a/src/field_player_avatar.c +++ b/src/field_player_avatar.c @@ -1833,7 +1833,7 @@ static bool8 Fishing_CheckForBite(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 785f7b426..c5762dfaf 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 62dec3253..a7dd68bbf 100644 --- a/src/pokemon.c +++ b/src/pokemon.c @@ -4156,7 +4156,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]; @@ -4166,7 +4166,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 bfcb286ff..b571e2e85 100644 --- a/src/pokemon_summary_screen.c +++ b/src/pokemon_summary_screen.c @@ -3146,13 +3146,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); 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); 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 0f2b44e3e..e2bd8a542 100644 --- a/src/wild_encounter.c +++ b/src/wild_encounter.c @@ -35,7 +35,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 @@ -248,7 +248,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;