From 5840b1f0ede5d9c82cf545b5ff2c175d6b826dd3 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Mon, 24 May 2021 09:52:45 -0600 Subject: [PATCH 01/72] utility umbrella effect --- asm/macros/battle_script.inc | 6 +++ data/battle_scripts_1.s | 8 ++- include/battle_util.h | 1 + include/constants/battle_script_commands.h | 1 + src/battle_main.c | 13 ++--- src/battle_script_commands.c | 34 ++++++++----- src/battle_util.c | 57 ++++++++++++++-------- 7 files changed, 76 insertions(+), 44 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 9fa3fe0c3..649afc834 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1768,6 +1768,12 @@ .macro tryactivategrimneigh, battler:req various \battler, VARIOUS_TRY_ACTIVATE_GRIM_NEIGH .endm + + .macro jumpifweatheraffected battler:req, weather:req, ptr:req + various \battler, VARIOUS_JUMP_IF_WEATHER_AFFECTED + .4byte \weather + .4byte \ptr + .endm @ helpful macros .macro setstatchanger stat:req, stages:req, down:req diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 77eddc8ab..f73c59590 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -1288,7 +1288,7 @@ BattleScript_GrowthDoMoveAnim:: waitanimation setbyte sSTAT_ANIM_PLAYED, FALSE playstatchangeanimation BS_ATTACKER, BIT_ATK | BIT_SPATK, 0 - jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_ANY, BattleScript_GrowthAtk2 + jumpifweatheraffected BS_ATTACKER, WEATHER_SUN_ANY, BattleScript_GrowthAtk2 setstatchanger STAT_ATK, 1, FALSE goto BattleScript_GrowthAtk BattleScript_GrowthAtk2: @@ -1299,7 +1299,7 @@ BattleScript_GrowthAtk: printfromtable gStatUpStringIds waitmessage B_WAIT_TIME_LONG BattleScript_GrowthTrySpAtk:: - jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_ANY, BattleScript_GrowthSpAtk2 + jumpifweatheraffected BS_ATTACKER, WEATHER_SUN_ANY, BattleScript_GrowthSpAtk2 setstatchanger STAT_SPATK, 1, FALSE goto BattleScript_GrowthSpAtk BattleScript_GrowthSpAtk2: @@ -4015,9 +4015,7 @@ BattleScript_EffectGust:: goto BattleScript_EffectHit BattleScript_EffectSolarbeam:: - jumpifabilitypresent ABILITY_CLOUD_NINE, BattleScript_SolarbeamDecideTurn - jumpifabilitypresent ABILITY_AIR_LOCK, BattleScript_SolarbeamDecideTurn - jumpifhalfword CMP_COMMON_BITS, gBattleWeather, WEATHER_SUN_TEMPORARY | WEATHER_SUN_PERMANENT, BattleScript_SolarbeamOnFirstTurn + jumpifweatheraffected BS_ATTACKER, WEATHER_SUN_ANY, BattleScript_SolarbeamOnFirstTurn BattleScript_SolarbeamDecideTurn:: jumpifstatus2 BS_ATTACKER, STATUS2_MULTIPLETURNS, BattleScript_TwoTurnMovesSecondTurn jumpifword CMP_COMMON_BITS, gHitMarker, HITMARKER_NO_ATTACKSTRING, BattleScript_TwoTurnMovesSecondTurn diff --git a/include/battle_util.h b/include/battle_util.h index f06a58938..98439e4e1 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -138,6 +138,7 @@ bool32 IsTelekinesisBannedSpecies(u16 species); bool32 IsHealBlockPreventingMove(u32 battler, u32 move); bool32 IsThawingMove(u8 battlerId, u16 move); bool32 HasEnoughHpToEatBerry(u32 battlerId, u32 hpFraction, u32 itemId); +bool32 IsBattlerWeatherAffected(u8 battlerId, u32 weatherFlags); // ability checks bool32 IsRolePlayBannedAbilityAtk(u16 ability); diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index faaf8f17e..a738fd9e0 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -173,6 +173,7 @@ #define VARIOUS_DESTROY_ABILITY_POPUP 102 #define VARIOUS_TOTEM_BOOST 103 #define VARIOUS_TRY_ACTIVATE_GRIM_NEIGH 104 +#define VARIOUS_JUMP_IF_WEATHER_AFFECTED 105 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/src/battle_main.c b/src/battle_main.c index 814bcb66c..9825f1680 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4229,9 +4229,9 @@ u32 GetBattlerTotalSpeedStat(u8 battlerId) // weather abilities if (WEATHER_HAS_EFFECT) { - if (ability == ABILITY_SWIFT_SWIM && gBattleWeather & WEATHER_RAIN_ANY) + if (ability == ABILITY_SWIFT_SWIM && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA && gBattleWeather & WEATHER_RAIN_ANY) speed *= 2; - else if (ability == ABILITY_CHLOROPHYLL && gBattleWeather & WEATHER_SUN_ANY) + else if (ability == ABILITY_CHLOROPHYLL && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA && gBattleWeather & WEATHER_SUN_ANY) speed *= 2; else if (ability == ABILITY_SAND_RUSH && gBattleWeather & WEATHER_SANDSTORM_ANY) speed *= 2; @@ -5002,6 +5002,7 @@ void RunBattleScriptCommands(void) void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk) { u32 moveType, ateType, attackerAbility; + u16 holdEffect = GetBattlerHoldEffect(battlerAtk, TRUE); if (move == MOVE_STRUGGLE) return; @@ -5014,11 +5015,11 @@ void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk) { if (WEATHER_HAS_EFFECT) { - if (gBattleWeather & WEATHER_RAIN_ANY) + if (gBattleWeather & WEATHER_RAIN_ANY && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA) gBattleStruct->dynamicMoveType = TYPE_WATER | 0x80; else if (gBattleWeather & WEATHER_SANDSTORM_ANY) gBattleStruct->dynamicMoveType = TYPE_ROCK | 0x80; - else if (gBattleWeather & WEATHER_SUN_ANY) + else if (gBattleWeather & WEATHER_SUN_ANY && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA) gBattleStruct->dynamicMoveType = TYPE_FIRE | 0x80; else if (gBattleWeather & WEATHER_HAIL_ANY) gBattleStruct->dynamicMoveType = TYPE_ICE | 0x80; @@ -5042,7 +5043,7 @@ void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk) } else if (gBattleMoves[move].effect == EFFECT_CHANGE_TYPE_ON_ITEM) { - if (GetBattlerHoldEffect(battlerAtk, TRUE) == gBattleMoves[move].argument) + if (holdEffect == gBattleMoves[move].argument) gBattleStruct->dynamicMoveType = ItemId_GetSecondaryId(gBattleMons[battlerAtk].item) | 0x80; } else if (gBattleMoves[move].effect == EFFECT_REVELATION_DANCE) @@ -5098,7 +5099,7 @@ void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk) // Check if a gem should activate. GET_MOVE_TYPE(move, moveType); - if (GetBattlerHoldEffect(battlerAtk, TRUE) == HOLD_EFFECT_GEMS + if (holdEffect == HOLD_EFFECT_GEMS && moveType == ItemId_GetSecondaryId(gBattleMons[battlerAtk].item)) { gSpecialStatuses[battlerAtk].gemParam = GetBattlerHoldEffectParam(battlerAtk); diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 2c6bc25bf..ae8f22075 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1474,13 +1474,13 @@ static bool32 AccuracyCalcHelper(u16 move) return TRUE; } - if ((WEATHER_HAS_EFFECT && - (((gBattleWeather & WEATHER_RAIN_ANY) && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE)) - || (((gBattleWeather & WEATHER_HAIL_ANY) && move == MOVE_BLIZZARD)))) - || (gBattleMoves[move].effect == EFFECT_VITAL_THROW) - || (gBattleMoves[move].accuracy == 0) - || ((B_MINIMIZE_DMG_ACC >= GEN_6) && (gStatuses3[gBattlerTarget] & STATUS3_MINIMIZED) && (gBattleMoves[move].flags & FLAG_DMG_MINIMIZE))) + if (gBattleMoves[move].effect == EFFECT_VITAL_THROW + || gBattleMoves[move].accuracy == 0 + || ((B_MINIMIZE_DMG_ACC >= GEN_6) && (gStatuses3[gBattlerTarget] & STATUS3_MINIMIZED) && (gBattleMoves[move].flags & FLAG_DMG_MINIMIZE)) + || (IsBattlerWeatherAffected(gBattlerTarget, WEATHER_RAIN_ANY) && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE)) + || (gBattleWeather & WEATHER_HAIL_ANY && move == MOVE_BLIZZARD)) { + // thunder/hurricane ignore acc checks in rain unless target is holding utility umbrella JumpIfMoveFailed(7, move); return TRUE; } @@ -1523,8 +1523,8 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move) moveAcc = gBattleMoves[move].accuracy; // Check Thunder and Hurricane on sunny weather. - if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY - && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE)) + if (IsBattlerWeatherAffected(battlerDef, WEATHER_SUN_ANY) + && (gBattleMoves[move].effect == EFFECT_THUNDER || gBattleMoves[move].effect == EFFECT_HURRICANE)) moveAcc = 50; // Check Wonder Skin. if (defAbility == ABILITY_WONDER_SKIN && gBattleMoves[move].power == 0) @@ -2552,7 +2552,7 @@ void SetMoveEffect(bool32 primary, u32 certain) statusChanged = TRUE; break; case STATUS1_FREEZE: - if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY) + if (IsBattlerWeatherAffected(gEffectBattler, WEATHER_SUN_ANY)) noSunCanFreeze = FALSE; if (IS_BATTLER_OF_TYPE(gEffectBattler, TYPE_ICE)) break; @@ -7056,7 +7056,7 @@ u32 IsFlowerVeilProtected(u32 battler) u32 IsLeafGuardProtected(u32 battler) { - if (WEATHER_HAS_EFFECT && (gBattleWeather & WEATHER_SUN_ANY)) + if (IsBattlerWeatherAffected(battler, WEATHER_SUN_ANY)) return GetBattlerAbility(battler) == ABILITY_LEAF_GUARD; else return 0; @@ -8349,6 +8349,15 @@ static void Cmd_various(void) gBattlescriptCurrInstr += 7; // exit if loop failed (failsafe) } return; + case VARIOUS_JUMP_IF_WEATHER_AFFECTED: + { + u32 weatherFlags = T1_READ_32(gBattlescriptCurrInstr + 3); + if (IsBattlerWeatherAffected(gActiveBattler, weatherFlags)) + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 7); + else + gBattlescriptCurrInstr += 11; + } + return; } gBattlescriptCurrInstr += 3; @@ -10154,11 +10163,12 @@ static bool8 IsTwoTurnsMove(u16 move) return FALSE; } +// unused static u8 AttacksThisTurn(u8 battlerId, u16 move) // Note: returns 1 if it's a charging turn, otherwise 2 { // first argument is unused if (gBattleMoves[move].effect == EFFECT_SOLARBEAM - && (gBattleWeather & WEATHER_SUN_ANY)) + && IsBattlerWeatherAffected(battlerId, WEATHER_SUN_ANY)) return 2; if (gBattleMoves[move].effect == EFFECT_SKULL_BASH @@ -10816,7 +10826,7 @@ static void Cmd_recoverbasedonsunlight(void) { if (!(gBattleWeather & WEATHER_ANY) || !WEATHER_HAS_EFFECT) gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2; - else if (gBattleWeather & WEATHER_SUN_ANY) + else if (IsBattlerWeatherAffected(gBattlerAttacker, WEATHER_SUN_ANY)) gBattleMoveDamage = 20 * gBattleMons[gBattlerAttacker].maxHP / 30; else // not sunny weather gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; diff --git a/src/battle_util.c b/src/battle_util.c index 4c3f795de..b8c6a4168 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -3608,7 +3608,8 @@ u8 TryWeatherFormChange(u8 battler) { u8 ret = 0; bool32 weatherEffect = WEATHER_HAS_EFFECT; - + u16 holdEffect = GetBattlerHoldEffect(battler, TRUE); + if (gBattleMons[battler].species == SPECIES_CASTFORM) { if (gBattleMons[battler].ability != ABILITY_FORECAST || gBattleMons[battler].hp == 0) @@ -3624,17 +3625,17 @@ u8 TryWeatherFormChange(u8 battler) { ret = 0; } - else if (!(gBattleWeather & (WEATHER_RAIN_ANY | WEATHER_SUN_ANY | WEATHER_HAIL_ANY)) && !IS_BATTLER_OF_TYPE(battler, TYPE_NORMAL)) + else if (holdEffect == HOLD_EFFECT_UTILITY_UMBRELLA || (!(gBattleWeather & (WEATHER_RAIN_ANY | WEATHER_SUN_ANY | WEATHER_HAIL_ANY)) && !IS_BATTLER_OF_TYPE(battler, TYPE_NORMAL))) { SET_BATTLER_TYPE(battler, TYPE_NORMAL); ret = 1; } - else if (gBattleWeather & WEATHER_SUN_ANY && !IS_BATTLER_OF_TYPE(battler, TYPE_FIRE)) + else if (gBattleWeather & WEATHER_SUN_ANY && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA && !IS_BATTLER_OF_TYPE(battler, TYPE_FIRE)) { SET_BATTLER_TYPE(battler, TYPE_FIRE); ret = 2; } - else if (gBattleWeather & WEATHER_RAIN_ANY && !IS_BATTLER_OF_TYPE(battler, TYPE_WATER)) + else if (gBattleWeather & WEATHER_RAIN_ANY && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA && !IS_BATTLER_OF_TYPE(battler, TYPE_WATER)) { SET_BATTLER_TYPE(battler, TYPE_WATER); ret = 3; @@ -3649,9 +3650,9 @@ u8 TryWeatherFormChange(u8 battler) { if (gBattleMons[battler].ability != ABILITY_FLOWER_GIFT || gBattleMons[battler].hp == 0) ret = 0; - else if (gBattleMonForms[battler] == 0 && weatherEffect && gBattleWeather & WEATHER_SUN_ANY) + else if (gBattleMonForms[battler] == 0 && weatherEffect && holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA && gBattleWeather & WEATHER_SUN_ANY) ret = 2; - else if (gBattleMonForms[battler] != 0 && (!weatherEffect || !(gBattleWeather & WEATHER_SUN_ANY))) + else if (gBattleMonForms[battler] != 0 && (!weatherEffect || holdEffect != HOLD_EFFECT_UTILITY_UMBRELLA || !(gBattleWeather & WEATHER_SUN_ANY))) ret = 1; } @@ -4258,7 +4259,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move switch (gLastUsedAbility) { case ABILITY_HARVEST: - if (((WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY) || Random() % 2 == 0) + if ((IsBattlerWeatherAffected(battler, WEATHER_SUN_ANY) || Random() % 2 == 0) && gBattleMons[battler].item == ITEM_NONE && gBattleStruct->changedItems[battler] == ITEM_NONE && ItemId_GetPocket(gBattleStruct->usedHeldItems[battler]) == POCKET_BERRIES) @@ -4270,12 +4271,11 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move } break; case ABILITY_DRY_SKIN: - if (gBattleWeather & WEATHER_SUN_ANY) + if (IsBattlerWeatherAffected(battler, WEATHER_SUN_ANY)) goto SOLAR_POWER_HP_DROP; // Dry Skin works similarly to Rain Dish in Rain case ABILITY_RAIN_DISH: - if (WEATHER_HAS_EFFECT - && (gBattleWeather & WEATHER_RAIN_ANY) + if (IsBattlerWeatherAffected(battler, WEATHER_RAIN_ANY) && !BATTLER_MAX_HP(battler) && !(gStatuses3[battler] & STATUS3_HEAL_BLOCK)) { @@ -4288,8 +4288,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move } break; case ABILITY_HYDRATION: - if (WEATHER_HAS_EFFECT - && (gBattleWeather & WEATHER_RAIN_ANY) + if (IsBattlerWeatherAffected(battler, WEATHER_RAIN_ANY) && gBattleMons[battler].status1 & STATUS1_ANY) { goto ABILITY_HEAL_MON_STATUS; @@ -4384,7 +4383,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move break; SOLAR_POWER_HP_DROP: case ABILITY_SOLAR_POWER: - if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY) + if (IsBattlerWeatherAffected(battler, WEATHER_SUN_ANY)) { BattleScriptPushCursorAndCallback(BattleScript_SolarPowerActivates); gBattleMoveDamage = gBattleMons[battler].maxHP / 8; @@ -7467,7 +7466,7 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe // todo break; case EFFECT_SOLARBEAM: - if (WEATHER_HAS_EFFECT && gBattleWeather & (WEATHER_HAIL_ANY | WEATHER_SANDSTORM_ANY | WEATHER_RAIN_ANY)) + if (IsBattlerWeatherAffected(battlerAtk, (WEATHER_HAIL_ANY | WEATHER_SANDSTORM_ANY | WEATHER_RAIN_ANY))) MulModifier(&modifier, UQ_4_12(0.5)); break; case EFFECT_STOMPING_TANTRUM: @@ -7564,7 +7563,7 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b MulModifier(&modifier, UQ_4_12(0.5)); break; case ABILITY_SOLAR_POWER: - if (IS_MOVE_SPECIAL(move) && WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY) + if (IS_MOVE_SPECIAL(move) && IsBattlerWeatherAffected(battlerAtk, WEATHER_SUN_ANY)) MulModifier(&modifier, UQ_4_12(1.5)); break; case ABILITY_DEFEATIST: @@ -7601,7 +7600,7 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b } break; case ABILITY_FLOWER_GIFT: - if (gBattleMons[battlerAtk].species == SPECIES_CHERRIM && WEATHER_HAS_EFFECT && (gBattleWeather & WEATHER_SUN_ANY) && IS_MOVE_PHYSICAL(move)) + if (gBattleMons[battlerAtk].species == SPECIES_CHERRIM && IsBattlerWeatherAffected(battlerAtk, WEATHER_SUN_ANY) && IS_MOVE_PHYSICAL(move)) MulModifier(&modifier, UQ_4_12(1.5)); break; case ABILITY_HUSTLE: @@ -7641,7 +7640,7 @@ static u32 CalcAttackStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, b switch (GetBattlerAbility(BATTLE_PARTNER(battlerAtk))) { case ABILITY_FLOWER_GIFT: - if (gBattleMons[BATTLE_PARTNER(battlerAtk)].species == SPECIES_CHERRIM && IS_MOVE_PHYSICAL(move)) + if (gBattleMons[BATTLE_PARTNER(battlerAtk)].species == SPECIES_CHERRIM && IsBattlerWeatherAffected(BATTLE_PARTNER(battlerAtk), WEATHER_SUN_ANY) && IS_MOVE_PHYSICAL(move)) MulModifier(&modifier, UQ_4_12(1.5)); break; } @@ -7771,7 +7770,7 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, } break; case ABILITY_FLOWER_GIFT: - if (gBattleMons[battlerDef].species == SPECIES_CHERRIM && WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY && !usesDefStat) + if (gBattleMons[battlerDef].species == SPECIES_CHERRIM && IsBattlerWeatherAffected(battlerDef, WEATHER_SUN_ANY) && !usesDefStat) MulModifier(&modifier, UQ_4_12(1.5)); break; case ABILITY_PUNK_ROCK: @@ -7786,7 +7785,7 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, switch (GetBattlerAbility(BATTLE_PARTNER(battlerDef))) { case ABILITY_FLOWER_GIFT: - if (gBattleMons[BATTLE_PARTNER(battlerDef)].species == SPECIES_CHERRIM && !usesDefStat) + if (gBattleMons[BATTLE_PARTNER(battlerDef)].species == SPECIES_CHERRIM && IsBattlerWeatherAffected(BATTLE_PARTNER(battlerDef), WEATHER_SUN_ANY) && !usesDefStat) MulModifier(&modifier, UQ_4_12(1.5)); break; } @@ -7852,14 +7851,14 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move dmg = ApplyModifier(UQ_4_12(0.5), dmg); // check sunny/rain weather - if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_RAIN_ANY) + if (IsBattlerWeatherAffected(battlerAtk, WEATHER_RAIN_ANY)) { if (moveType == TYPE_FIRE) dmg = ApplyModifier(UQ_4_12(0.5), dmg); else if (moveType == TYPE_WATER) dmg = ApplyModifier(UQ_4_12(1.5), dmg); } - else if (WEATHER_HAS_EFFECT && gBattleWeather & WEATHER_SUN_ANY) + else if (IsBattlerWeatherAffected(battlerAtk, WEATHER_SUN_ANY)) { if (moveType == TYPE_FIRE) dmg = ApplyModifier(UQ_4_12(1.5), dmg); @@ -8657,3 +8656,19 @@ bool32 IsEntrainmentTargetOrSimpleBeamBannedAbility(u16 ability) return FALSE; } +bool32 IsBattlerWeatherAffected(u8 battlerId, u32 weatherFlags) +{ + if (!WEATHER_HAS_EFFECT) + return FALSE; + + if (gBattleWeather & weatherFlags) + { + // given weather is active -> check if its sun, rain against utility umbrella ( since only 1 weather can be active at once) + if (gBattleWeather & (WEATHER_SUN_ANY | WEATHER_RAIN_ANY) && GetBattlerHoldEffect(battlerId, TRUE) == HOLD_EFFECT_UTILITY_UMBRELLA) + return FALSE; // utility umbrella blocks sun, rain effects + + return TRUE; + } + return FALSE; +} + From f30a9542eebb2db4fb7245b324fea649787b8352 Mon Sep 17 00:00:00 2001 From: MissingNoL Date: Thu, 27 May 2021 22:21:55 -0700 Subject: [PATCH 02/72] Problem: Photon Geyser is calculating as Shell Side Arm?? Needs: Poison effect, contact move for Shell Side Arm --- asm/macros/battle_script.inc | 8 ++++ data/battle_scripts_1.s | 8 ++++ include/battle.h | 2 + include/constants/battle_move_effects.h | 4 +- include/constants/battle_script_commands.h | 2 + src/battle_main.c | 3 ++ src/battle_script_commands.c | 49 ++++++++++++++++++++++ src/battle_util.c | 7 +++- src/data/battle_moves.h | 10 ++--- 9 files changed, 85 insertions(+), 8 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 9fa3fe0c3..b5d21abc4 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1726,6 +1726,14 @@ .4byte \ptr .endm + .macro photongeysercheck + various BS_ATTACKER, VARIOUS_PHOTON_GEYSER_CHECK + .endm + + .macro shellsidearmcheck + various BS_ATTACKER, VARIOUS_SHELL_SIDE_ARM_CHECK + .endm + .macro trysetfairylock ptr:req various BS_ATTACKER, VARIOUS_TRY_FAIRY_LOCK .4byte \ptr diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 77eddc8ab..544583961 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -367,6 +367,14 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 .4byte BattleScript_EffectFairyLock .4byte BattleScript_EffectAllySwitch .4byte BattleScript_EffectSleepHit + .4byte BattleScript_EffectPhotonGeyser + .4byte BattleScript_EffectShellSideArm + +BattleScript_EffectShellSideArm: + shellsidearmcheck + +BattleScript_EffectPhotonGeyser: + photongeysercheck BattleScript_EffectSleepHit: setmoveeffect MOVE_EFFECT_SLEEP diff --git a/include/battle.h b/include/battle.h index 82a917538..2195e0a21 100644 --- a/include/battle.h +++ b/include/battle.h @@ -858,4 +858,6 @@ extern u8 gBattleControllerData[MAX_BATTLERS_COUNT]; extern bool8 gHasFetchedBall; extern u8 gLastUsedBall; +extern bool8 gSwapDamageCategory; // Photon Geyser, Shell Side Arm, Light That Burns the Sky + #endif // GUARD_BATTLE_H diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 74418d2c7..b9cf92854 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -351,7 +351,9 @@ #define EFFECT_FAIRY_LOCK 345 #define EFFECT_ALLY_SWITCH 346 #define EFFECT_SLEEP_HIT 347 // Relic Song +#define EFFECT_PHOTON_GEYSER 348 +#define EFFECT_SHELL_SIDE_ARM 349 -#define NUM_BATTLE_MOVE_EFFECTS 348 +#define NUM_BATTLE_MOVE_EFFECTS 350 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index faaf8f17e..28ba1a5d4 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -173,6 +173,8 @@ #define VARIOUS_DESTROY_ABILITY_POPUP 102 #define VARIOUS_TOTEM_BOOST 103 #define VARIOUS_TRY_ACTIVATE_GRIM_NEIGH 104 +#define VARIOUS_PHOTON_GEYSER_CHECK 105 +#define VARIOUS_SHELL_SIDE_ARM_CHECK 106 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/src/battle_main.c b/src/battle_main.c index 77470246f..739d33a3e 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -229,6 +229,7 @@ EWRAM_DATA u16 gPartnerSpriteId = 0; EWRAM_DATA struct TotemBoost gTotemBoosts[MAX_BATTLERS_COUNT] = {0}; EWRAM_DATA bool8 gHasFetchedBall = FALSE; EWRAM_DATA u8 gLastUsedBall = 0; +EWRAM_DATA bool8 gSwapDamageCategory = FALSE; // Photon Geyser, Shell Side Arm, Light That Burns the Sky // IWRAM common vars void (*gPreBattleCallback1)(void); @@ -2928,6 +2929,8 @@ static void BattleStartClearSetData(void) gBattleStruct->arenaLostOpponentMons = 0; gBattleStruct->mega.triggerSpriteId = 0xFF; + + gSwapDamageCategory = FALSE; // Photon Geyser, Shell Side Arm, Light That Burns the Sky } void SwitchInClearSetData(void) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index fc0eedcbc..2a761e5c6 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -7126,6 +7126,55 @@ static void Cmd_various(void) switch (gBattlescriptCurrInstr[2]) { + case VARIOUS_PHOTON_GEYSER_CHECK: + { + u32 attStat = gBattleMons[gActiveBattler].attack; + u8 atkStage = gBattleMons[gActiveBattler].statStages[STAT_ATK]; + u32 spaStat = gBattleMons[gActiveBattler].spAttack; + + attStat *= gStatStageRatios[atkStage][0]; + attStat /= gStatStageRatios[atkStage][1]; + + atkStage = gBattleMons[gActiveBattler].statStages[STAT_SPATK]; + spaStat *= gStatStageRatios[atkStage][0]; + spaStat /= gStatStageRatios[atkStage][1]; + + if (attStat > spaStat) + gSwapDamageCategory = TRUE; + } + case VARIOUS_SHELL_SIDE_ARM_CHECK: // according to DaWoblefet, 0% chance GameFreak actually checks this way, but this is the only functional explanation at the moment + { + u32 attStat = gBattleMons[gBattlerAttacker].attack; + u8 atkStage = gBattleMons[gBattlerAttacker].statStages[STAT_ATK]; + u32 attStatDef = gBattleMons[gBattlerTarget].attack; + u32 physical; + + u32 spaStat = gBattleMons[gBattlerAttacker].spAttack; + u32 spaStatDef = gBattleMons[gBattlerTarget].spAttack; + u32 special; + + attStat *= gStatStageRatios[atkStage][0]; + attStat /= gStatStageRatios[atkStage][1]; + + atkStage = gBattleMons[gBattlerTarget].statStages[STAT_ATK]; + attStatDef *= gStatStageRatios[atkStage][0]; + attStatDef /= gStatStageRatios[atkStage][1]; + + physical = ((((2 * gBattleMons[gBattlerAttacker].level / 5 + 2) * 90 * attStat) / attStatDef) / 50); + + atkStage = gBattleMons[gBattlerAttacker].statStages[STAT_SPATK]; + spaStat *= gStatStageRatios[atkStage][0]; + spaStat /= gStatStageRatios[atkStage][1]; + + atkStage = gBattleMons[gBattlerTarget].statStages[STAT_SPATK]; + spaStatDef *= gStatStageRatios[atkStage][0]; + spaStatDef /= gStatStageRatios[atkStage][1]; + + special = ((((2 * gBattleMons[gBattlerAttacker].level / 5 + 2) * 90 * spaStat) / spaStatDef) / 50); + + if (((physical > special) || (physical == special && (Random() % 2) == 0))) + gSwapDamageCategory = TRUE; + } // Roar will fail in a double wild battle when used by the player against one of the two alive wild mons. // Also when an opposing wild mon uses it againt its partner. case VARIOUS_JUMP_IF_ROAR_FAILS: diff --git a/src/battle_util.c b/src/battle_util.c index 07c150066..e657a4e96 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8367,8 +8367,11 @@ bool8 ShouldGetStatBadgeBoost(u16 badgeFlag, u8 battlerId) u8 GetBattleMoveSplit(u32 moveId) { if (IS_MOVE_STATUS(moveId) || B_PHYSICAL_SPECIAL_SPLIT >= GEN_4) - return gBattleMoves[moveId].split; - else if (gBattleMoves[moveId].type < TYPE_MYSTERY) + if (gSwapDamageCategory == TRUE) // Photon Geyser, Shell Side Arm, Light That Burns the Sky + return SPLIT_PHYSICAL; + else + return gBattleMoves[moveId].split; + else if (gBattleMoves[moveId].type < TYPE_MYSTERY || gSwapDamageCategory == TRUE) // Photon Geyser, Shell Side Arm, Light That Burns the Sky return SPLIT_PHYSICAL; else return SPLIT_SPECIAL; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 61050e44f..0e27bb588 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -10343,15 +10343,15 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_PHOTON_GEYSER] = { - .effect = EFFECT_PLACEHOLDER, // Needs a custom move effect + .effect = EFFECT_PHOTON_GEYSER, .power = 100, .type = TYPE_PSYCHIC, .accuracy = 100, .pp = 5, - .secondaryEffectChance = 0, + .secondaryEffectChance = 100, .target = MOVE_TARGET_FOES_AND_ALLY, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TARGET_ABILITY_IGNORED, .split = SPLIT_SPECIAL, }, @@ -11178,12 +11178,12 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_SHELL_SIDE_ARM] = { - .effect = EFFECT_PLACEHOLDER, //TODO + .effect = EFFECT_SHELL_SIDE_ARM, .power = 90, .type = TYPE_POISON, .accuracy = 100, .pp = 10, - .secondaryEffectChance = 0, + .secondaryEffectChance = 100, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, From 0f09055cfea6a1faf43c7775f7ed7e19aada1536 Mon Sep 17 00:00:00 2001 From: MissingNoL Date: Fri, 28 May 2021 11:11:03 -0700 Subject: [PATCH 03/72] Fixes and added Poison chance to Shell Side Arm (needs contact on physical) --- data/battle_scripts_1.s | 3 ++ src/battle_script_commands.c | 100 ++++++++++++++++++----------------- src/battle_util.c | 9 ++-- src/data/battle_moves.h | 4 +- 4 files changed, 60 insertions(+), 56 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 544583961..795518380 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -372,9 +372,12 @@ gBattleScriptsForMoveEffects:: @ 82D86A8 BattleScript_EffectShellSideArm: shellsidearmcheck + setmoveeffect MOVE_EFFECT_POISON + goto BattleScript_EffectHit BattleScript_EffectPhotonGeyser: photongeysercheck + goto BattleScript_EffectHit BattleScript_EffectSleepHit: setmoveeffect MOVE_EFFECT_SLEEP diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 2a761e5c6..e387423bc 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -7126,55 +7126,6 @@ static void Cmd_various(void) switch (gBattlescriptCurrInstr[2]) { - case VARIOUS_PHOTON_GEYSER_CHECK: - { - u32 attStat = gBattleMons[gActiveBattler].attack; - u8 atkStage = gBattleMons[gActiveBattler].statStages[STAT_ATK]; - u32 spaStat = gBattleMons[gActiveBattler].spAttack; - - attStat *= gStatStageRatios[atkStage][0]; - attStat /= gStatStageRatios[atkStage][1]; - - atkStage = gBattleMons[gActiveBattler].statStages[STAT_SPATK]; - spaStat *= gStatStageRatios[atkStage][0]; - spaStat /= gStatStageRatios[atkStage][1]; - - if (attStat > spaStat) - gSwapDamageCategory = TRUE; - } - case VARIOUS_SHELL_SIDE_ARM_CHECK: // according to DaWoblefet, 0% chance GameFreak actually checks this way, but this is the only functional explanation at the moment - { - u32 attStat = gBattleMons[gBattlerAttacker].attack; - u8 atkStage = gBattleMons[gBattlerAttacker].statStages[STAT_ATK]; - u32 attStatDef = gBattleMons[gBattlerTarget].attack; - u32 physical; - - u32 spaStat = gBattleMons[gBattlerAttacker].spAttack; - u32 spaStatDef = gBattleMons[gBattlerTarget].spAttack; - u32 special; - - attStat *= gStatStageRatios[atkStage][0]; - attStat /= gStatStageRatios[atkStage][1]; - - atkStage = gBattleMons[gBattlerTarget].statStages[STAT_ATK]; - attStatDef *= gStatStageRatios[atkStage][0]; - attStatDef /= gStatStageRatios[atkStage][1]; - - physical = ((((2 * gBattleMons[gBattlerAttacker].level / 5 + 2) * 90 * attStat) / attStatDef) / 50); - - atkStage = gBattleMons[gBattlerAttacker].statStages[STAT_SPATK]; - spaStat *= gStatStageRatios[atkStage][0]; - spaStat /= gStatStageRatios[atkStage][1]; - - atkStage = gBattleMons[gBattlerTarget].statStages[STAT_SPATK]; - spaStatDef *= gStatStageRatios[atkStage][0]; - spaStatDef /= gStatStageRatios[atkStage][1]; - - special = ((((2 * gBattleMons[gBattlerAttacker].level / 5 + 2) * 90 * spaStat) / spaStatDef) / 50); - - if (((physical > special) || (physical == special && (Random() % 2) == 0))) - gSwapDamageCategory = TRUE; - } // Roar will fail in a double wild battle when used by the player against one of the two alive wild mons. // Also when an opposing wild mon uses it againt its partner. case VARIOUS_JUMP_IF_ROAR_FAILS: @@ -8429,6 +8380,57 @@ static void Cmd_various(void) gBattlescriptCurrInstr += 7; // exit if loop failed (failsafe) } return; + case VARIOUS_PHOTON_GEYSER_CHECK: + { + u32 attStat = gBattleMons[gActiveBattler].attack; + u8 atkStage = gBattleMons[gActiveBattler].statStages[STAT_ATK]; + u32 spaStat = gBattleMons[gActiveBattler].spAttack; + + attStat *= gStatStageRatios[atkStage][0]; + attStat /= gStatStageRatios[atkStage][1]; + + atkStage = gBattleMons[gActiveBattler].statStages[STAT_SPATK]; + spaStat *= gStatStageRatios[atkStage][0]; + spaStat /= gStatStageRatios[atkStage][1]; + + if (attStat > spaStat) + gSwapDamageCategory = TRUE; + break; + } + case VARIOUS_SHELL_SIDE_ARM_CHECK: // 0% chance GameFreak actually checks this way according to DaWobblefet, but this is the only functional explanation at the moment + { + u32 attStat = gBattleMons[gBattlerAttacker].attack; + u8 atkStage = gBattleMons[gBattlerAttacker].statStages[STAT_ATK]; + u32 attStatDef = gBattleMons[gBattlerTarget].attack; + u32 physical; + + u32 spaStat = gBattleMons[gBattlerAttacker].spAttack; + u32 spaStatDef = gBattleMons[gBattlerTarget].spAttack; + u32 special; + + attStat *= gStatStageRatios[atkStage][0]; + attStat /= gStatStageRatios[atkStage][1]; + + atkStage = gBattleMons[gBattlerTarget].statStages[STAT_ATK]; + attStatDef *= gStatStageRatios[atkStage][0]; + attStatDef /= gStatStageRatios[atkStage][1]; + + physical = ((((2 * gBattleMons[gBattlerAttacker].level / 5 + 2) * 90 * attStat) / attStatDef) / 50); + + atkStage = gBattleMons[gBattlerAttacker].statStages[STAT_SPATK]; + spaStat *= gStatStageRatios[atkStage][0]; + spaStat /= gStatStageRatios[atkStage][1]; + + atkStage = gBattleMons[gBattlerTarget].statStages[STAT_SPATK]; + spaStatDef *= gStatStageRatios[atkStage][0]; + spaStatDef /= gStatStageRatios[atkStage][1]; + + special = ((((2 * gBattleMons[gBattlerAttacker].level / 5 + 2) * 90 * spaStat) / spaStatDef) / 50); + + if (((physical > special) || (physical == special && (Random() % 2) == 0))) + gSwapDamageCategory = TRUE; + break; + } } gBattlescriptCurrInstr += 3; diff --git a/src/battle_util.c b/src/battle_util.c index e657a4e96..570377002 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8366,12 +8366,11 @@ bool8 ShouldGetStatBadgeBoost(u16 badgeFlag, u8 battlerId) u8 GetBattleMoveSplit(u32 moveId) { + if (gSwapDamageCategory == TRUE) // Photon Geyser, Shell Side Arm, Light That Burns the Sky + return SPLIT_PHYSICAL; if (IS_MOVE_STATUS(moveId) || B_PHYSICAL_SPECIAL_SPLIT >= GEN_4) - if (gSwapDamageCategory == TRUE) // Photon Geyser, Shell Side Arm, Light That Burns the Sky - return SPLIT_PHYSICAL; - else - return gBattleMoves[moveId].split; - else if (gBattleMoves[moveId].type < TYPE_MYSTERY || gSwapDamageCategory == TRUE) // Photon Geyser, Shell Side Arm, Light That Burns the Sky + return gBattleMoves[moveId].split; + else if (gBattleMoves[moveId].type < TYPE_MYSTERY) return SPLIT_PHYSICAL; else return SPLIT_SPECIAL; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 0e27bb588..89b2e29aa 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -10348,7 +10348,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .type = TYPE_PSYCHIC, .accuracy = 100, .pp = 5, - .secondaryEffectChance = 100, + .secondaryEffectChance = 0, .target = MOVE_TARGET_FOES_AND_ALLY, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TARGET_ABILITY_IGNORED, @@ -11183,7 +11183,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .type = TYPE_POISON, .accuracy = 100, .pp = 10, - .secondaryEffectChance = 100, + .secondaryEffectChance = 20, .target = MOVE_TARGET_SELECTED, .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, From c4b700a8e7e9298610bf439380dc86383f0b0f22 Mon Sep 17 00:00:00 2001 From: MissingNoL Date: Sat, 5 Jun 2021 13:47:05 -0700 Subject: [PATCH 04/72] Only thing left is making IsMoveMakingContact work when hitting King's Shield, etc. --- src/battle_script_commands.c | 2 +- src/battle_util.c | 15 +++++++++------ 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index e387423bc..422738795 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -4708,7 +4708,7 @@ static void Cmd_moveend(void) switch (gBattleScripting.moveendState) { case MOVEEND_PROTECT_LIKE_EFFECT: - if (gBattleMoves[gCurrentMove].flags & FLAG_MAKES_CONTACT) + if (gBattleMoves[gCurrentMove].flags & FLAG_MAKES_CONTACT) // needs to be IsMoveMakingContact, but this file does not reference include/battle_util.h or src/battle_util.c { if (gProtectStructs[gBattlerTarget].spikyShielded && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) { diff --git a/src/battle_util.c b/src/battle_util.c index 570377002..fb4110591 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -4556,7 +4556,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && IsBattlerAlive(gBattlerAttacker) && TARGET_TURN_DAMAGED - && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT)) + && (IsMoveMakingContact(move, gBattlerAttacker))) { switch (gBattleMons[gBattlerAttacker].ability) { @@ -4745,7 +4745,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && gBattleMons[gBattlerAttacker].hp != 0 && !gProtectStructs[gBattlerAttacker].confusionSelfDmg - && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT) + && (IsMoveMakingContact(move, gBattlerAttacker)) && TARGET_TURN_DAMAGED && !IS_BATTLER_OF_TYPE(gBattlerAttacker, TYPE_FIRE) && GetBattlerAbility(gBattlerAttacker) != ABILITY_WATER_VEIL @@ -4764,7 +4764,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && gBattleMons[gBattlerAttacker].hp != 0 && !gProtectStructs[gBattlerAttacker].confusionSelfDmg - && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT) + && (IsMoveMakingContact(move, gBattlerAttacker)) && TARGET_TURN_DAMAGED && gBattleMons[gBattlerTarget].hp != 0 && (Random() % 3) == 0 @@ -4832,7 +4832,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move && !gProtectStructs[gBattlerAttacker].confusionSelfDmg && TARGET_TURN_DAMAGED && IsBattlerAlive(battler) - && (gBattleMoves[move].flags & FLAG_MAKES_CONTACT) + && (IsMoveMakingContact(move, gBattlerAttacker)) && !(gStatuses3[gBattlerAttacker] & STATUS3_PERISH_SONG)) { if (!(gStatuses3[battler] & STATUS3_PERISH_SONG)) @@ -6665,7 +6665,10 @@ u32 GetBattlerHoldEffectParam(u8 battlerId) bool32 IsMoveMakingContact(u16 move, u8 battlerAtk) { if (!(gBattleMoves[move].flags & FLAG_MAKES_CONTACT)) - return FALSE; + if (gBattleMoves[move].effect == EFFECT_SHELL_SIDE_ARM && gSwapDamageCategory == TRUE) + return TRUE; + else + return FALSE; else if (GetBattlerAbility(battlerAtk) == ABILITY_LONG_REACH) return FALSE; else if (GetBattlerHoldEffect(battlerAtk, TRUE) == HOLD_EFFECT_PROTECTIVE_PADS) @@ -7135,7 +7138,7 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe MulModifier(&modifier, UQ_4_12(1.3)); break; case ABILITY_TOUGH_CLAWS: - if (gBattleMoves[move].flags & FLAG_MAKES_CONTACT) + if (IsMoveMakingContact(move, battlerAtk)) MulModifier(&modifier, UQ_4_12(1.3)); break; case ABILITY_STRONG_JAW: From 517763bc9f31721813eb283b6fadce88e23bc825 Mon Sep 17 00:00:00 2001 From: MissingNoL <84547991+MissingNoL@users.noreply.github.com> Date: Sat, 5 Jun 2021 16:38:37 -0700 Subject: [PATCH 05/72] Update src/battle_util.c Changed an `if` to `else if` Co-authored-by: LOuroboros --- src/battle_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_util.c b/src/battle_util.c index fb4110591..0d4a7f18a 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8371,7 +8371,7 @@ u8 GetBattleMoveSplit(u32 moveId) { if (gSwapDamageCategory == TRUE) // Photon Geyser, Shell Side Arm, Light That Burns the Sky return SPLIT_PHYSICAL; - if (IS_MOVE_STATUS(moveId) || B_PHYSICAL_SPECIAL_SPLIT >= GEN_4) + else if (IS_MOVE_STATUS(moveId) || B_PHYSICAL_SPECIAL_SPLIT >= GEN_4) return gBattleMoves[moveId].split; else if (gBattleMoves[moveId].type < TYPE_MYSTERY) return SPLIT_PHYSICAL; From 921b80de7c138a0c0320187ae2a383d22a390f13 Mon Sep 17 00:00:00 2001 From: MissingNoL <84547991+MissingNoL@users.noreply.github.com> Date: Sat, 5 Jun 2021 16:40:03 -0700 Subject: [PATCH 06/72] Update battle_script_commands.h Properly aligned the list of number IDs --- include/constants/battle_script_commands.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 28ba1a5d4..3976d4375 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -173,8 +173,8 @@ #define VARIOUS_DESTROY_ABILITY_POPUP 102 #define VARIOUS_TOTEM_BOOST 103 #define VARIOUS_TRY_ACTIVATE_GRIM_NEIGH 104 -#define VARIOUS_PHOTON_GEYSER_CHECK 105 -#define VARIOUS_SHELL_SIDE_ARM_CHECK 106 +#define VARIOUS_PHOTON_GEYSER_CHECK 105 +#define VARIOUS_SHELL_SIDE_ARM_CHECK 106 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 From d69cfcff7043a1a97d0835747dd727f1a3709d34 Mon Sep 17 00:00:00 2001 From: MissingNoL <84547991+MissingNoL@users.noreply.github.com> Date: Sat, 5 Jun 2021 16:43:19 -0700 Subject: [PATCH 07/72] Update battle_script_commands.c Included src/battle_util.c to call IsMoveMakingContact --- src/battle_script_commands.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 422738795..bb81b2cbc 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -53,6 +53,7 @@ #include "constants/rgb.h" #include "data.h" #include "constants/party_menu.h" +#include "src/battle_util.c" extern struct MusicPlayerInfo gMPlayInfo_BGM; @@ -4708,7 +4709,7 @@ static void Cmd_moveend(void) switch (gBattleScripting.moveendState) { case MOVEEND_PROTECT_LIKE_EFFECT: - if (gBattleMoves[gCurrentMove].flags & FLAG_MAKES_CONTACT) // needs to be IsMoveMakingContact, but this file does not reference include/battle_util.h or src/battle_util.c + if (IsMoveMakingContact(move, gBattlerAttacker)) { if (gProtectStructs[gBattlerTarget].spikyShielded && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) { From caf2548830d67dd9e6de97c8b29cc1ddbe777c2a Mon Sep 17 00:00:00 2001 From: MissingNoL Date: Sun, 6 Jun 2021 21:40:38 -0700 Subject: [PATCH 08/72] Included `battle_util.h`, fixed parameter `IsMoveMakingContact` --- src/battle_script_commands.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 1dadeadb1..bc1b48cfc 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -54,7 +54,7 @@ #include "constants/rgb.h" #include "data.h" #include "constants/party_menu.h" -#include "src/battle_util.c" +#include "battle_util.h" extern struct MusicPlayerInfo gMPlayInfo_BGM; @@ -4781,7 +4781,7 @@ static void Cmd_moveend(void) switch (gBattleScripting.moveendState) { case MOVEEND_PROTECT_LIKE_EFFECT: - if (IsMoveMakingContact(move, gBattlerAttacker)) + if (IsMoveMakingContact(gCurrentMove, gBattlerAttacker)) { if (gProtectStructs[gBattlerTarget].spikyShielded && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) { From 380e1e470c2c25683b22e567cc65489faaf3c2ae Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Wed, 22 Sep 2021 23:29:00 -0300 Subject: [PATCH 09/72] Applied use of TRUE and FALSE for flags. --- src/battle_main.c | 60 +++++++++---------- src/battle_script_commands.c | 112 +++++++++++++++++------------------ src/battle_util.c | 112 +++++++++++++++++------------------ 3 files changed, 142 insertions(+), 142 deletions(-) diff --git a/src/battle_main.c b/src/battle_main.c index 72d05a0fd..1b4ad5f74 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -3067,31 +3067,31 @@ void FaintClearSetData(void) memset(&gDisableStructs[gActiveBattler], 0, sizeof(struct DisableStruct)); - gProtectStructs[gActiveBattler].protected = 0; - gProtectStructs[gActiveBattler].spikyShielded = 0; - gProtectStructs[gActiveBattler].kingsShielded = 0; - gProtectStructs[gActiveBattler].banefulBunkered = 0; - gProtectStructs[gActiveBattler].endured = 0; - gProtectStructs[gActiveBattler].noValidMoves = 0; - gProtectStructs[gActiveBattler].helpingHand = 0; - gProtectStructs[gActiveBattler].bounceMove = 0; - gProtectStructs[gActiveBattler].stealMove = 0; - gProtectStructs[gActiveBattler].prlzImmobility = 0; - gProtectStructs[gActiveBattler].confusionSelfDmg = 0; - gProtectStructs[gActiveBattler].targetAffected = 0; - gProtectStructs[gActiveBattler].chargingTurn = 0; + gProtectStructs[gActiveBattler].protected = FALSE; + gProtectStructs[gActiveBattler].spikyShielded = FALSE; + gProtectStructs[gActiveBattler].kingsShielded = FALSE; + gProtectStructs[gActiveBattler].banefulBunkered = FALSE; + gProtectStructs[gActiveBattler].endured = FALSE; + gProtectStructs[gActiveBattler].noValidMoves = FALSE; + gProtectStructs[gActiveBattler].helpingHand = FALSE; + gProtectStructs[gActiveBattler].bounceMove = FALSE; + gProtectStructs[gActiveBattler].stealMove = FALSE; + gProtectStructs[gActiveBattler].prlzImmobility = FALSE; + gProtectStructs[gActiveBattler].confusionSelfDmg = FALSE; + gProtectStructs[gActiveBattler].targetAffected = FALSE; + gProtectStructs[gActiveBattler].chargingTurn = FALSE; gProtectStructs[gActiveBattler].fleeFlag = 0; - gProtectStructs[gActiveBattler].usedImprisonedMove = 0; - gProtectStructs[gActiveBattler].loveImmobility = 0; - gProtectStructs[gActiveBattler].usedDisabledMove = 0; - gProtectStructs[gActiveBattler].usedTauntedMove = 0; - gProtectStructs[gActiveBattler].flag2Unknown = 0; - gProtectStructs[gActiveBattler].flinchImmobility = 0; - gProtectStructs[gActiveBattler].notFirstStrike = 0; - gProtectStructs[gActiveBattler].usedHealBlockedMove = 0; - gProtectStructs[gActiveBattler].usesBouncedMove = 0; - gProtectStructs[gActiveBattler].usedGravityPreventedMove = 0; - gProtectStructs[gActiveBattler].usedThroatChopPreventedMove = 0; + gProtectStructs[gActiveBattler].usedImprisonedMove = FALSE; + gProtectStructs[gActiveBattler].loveImmobility = FALSE; + gProtectStructs[gActiveBattler].usedDisabledMove = FALSE; + gProtectStructs[gActiveBattler].usedTauntedMove = FALSE; + gProtectStructs[gActiveBattler].flag2Unknown = FALSE; + gProtectStructs[gActiveBattler].flinchImmobility = FALSE; + gProtectStructs[gActiveBattler].notFirstStrike = FALSE; + gProtectStructs[gActiveBattler].usedHealBlockedMove = FALSE; + gProtectStructs[gActiveBattler].usesBouncedMove = FALSE; + gProtectStructs[gActiveBattler].usedGravityPreventedMove = FALSE; + gProtectStructs[gActiveBattler].usedThroatChopPreventedMove = FALSE; gDisableStructs[gActiveBattler].isFirstTurn = 2; @@ -4541,10 +4541,10 @@ static void TurnValuesCleanUp(bool8 var0) { if (var0) { - gProtectStructs[gActiveBattler].protected = 0; - gProtectStructs[gActiveBattler].spikyShielded = 0; - gProtectStructs[gActiveBattler].kingsShielded = 0; - gProtectStructs[gActiveBattler].banefulBunkered = 0; + gProtectStructs[gActiveBattler].protected = FALSE; + gProtectStructs[gActiveBattler].spikyShielded = FALSE; + gProtectStructs[gActiveBattler].kingsShielded = FALSE; + gProtectStructs[gActiveBattler].banefulBunkered = FALSE; } else { @@ -5032,7 +5032,7 @@ void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk) gBattleStruct->dynamicMoveType = 0; gBattleStruct->ateBoost[battlerAtk] = 0; - gSpecialStatuses[battlerAtk].gemBoost = 0; + gSpecialStatuses[battlerAtk].gemBoost = FALSE; if (gBattleMoves[move].effect == EFFECT_WEATHER_BALL) { @@ -5126,7 +5126,7 @@ void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk) && moveType == ItemId_GetSecondaryId(gBattleMons[battlerAtk].item)) { gSpecialStatuses[battlerAtk].gemParam = GetBattlerHoldEffectParam(battlerAtk); - gSpecialStatuses[battlerAtk].gemBoost = 1; + gSpecialStatuses[battlerAtk].gemBoost = TRUE; } } diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 5840e8805..9a107fac0 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1402,8 +1402,8 @@ static void Cmd_attackcanceler(void) && !gProtectStructs[gBattlerAttacker].usesBouncedMove) { PressurePPLose(gBattlerAttacker, gBattlerTarget, MOVE_MAGIC_COAT); - gProtectStructs[gBattlerTarget].bounceMove = 0; - gProtectStructs[gBattlerTarget].usesBouncedMove = 1; + gProtectStructs[gBattlerTarget].bounceMove = FALSE; + gProtectStructs[gBattlerTarget].usesBouncedMove = TRUE; gBattleCommunication[MULTISTRING_CHOOSER] = 0; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_MagicCoatBounce; @@ -1414,7 +1414,7 @@ static void Cmd_attackcanceler(void) && !gProtectStructs[gBattlerAttacker].usesBouncedMove) { RecordAbilityBattle(gBattlerTarget, ABILITY_MAGIC_BOUNCE); - gProtectStructs[gBattlerTarget].usesBouncedMove = 1; + gProtectStructs[gBattlerTarget].usesBouncedMove = TRUE; gBattleCommunication[MULTISTRING_CHOOSER] = 1; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_MagicCoatBounce; @@ -1426,7 +1426,7 @@ static void Cmd_attackcanceler(void) if ((gProtectStructs[gBattlerByTurnOrder[i]].stealMove) && gBattleMoves[gCurrentMove].flags & FLAG_SNATCH_AFFECTED) { PressurePPLose(gBattlerAttacker, gBattlerByTurnOrder[i], MOVE_SNATCH); - gProtectStructs[gBattlerByTurnOrder[i]].stealMove = 0; + gProtectStructs[gBattlerByTurnOrder[i]].stealMove = FALSE; gBattleScripting.battler = gBattlerByTurnOrder[i]; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_SnatchedMove; @@ -1436,7 +1436,7 @@ static void Cmd_attackcanceler(void) if (gSpecialStatuses[gBattlerTarget].lightningRodRedirected) { - gSpecialStatuses[gBattlerTarget].lightningRodRedirected = 0; + gSpecialStatuses[gBattlerTarget].lightningRodRedirected = FALSE; gLastUsedAbility = ABILITY_LIGHTNING_ROD; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_TookAttack; @@ -1444,7 +1444,7 @@ static void Cmd_attackcanceler(void) } else if (gSpecialStatuses[gBattlerTarget].stormDrainRedirected) { - gSpecialStatuses[gBattlerTarget].stormDrainRedirected = 0; + gSpecialStatuses[gBattlerTarget].stormDrainRedirected = FALSE; gLastUsedAbility = ABILITY_STORM_DRAIN; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_TookAttack; @@ -1456,7 +1456,7 @@ static void Cmd_attackcanceler(void) && gBattleMoves[gCurrentMove].effect != EFFECT_SUCKER_PUNCH) { if (gBattleMoves[gCurrentMove].flags & FLAG_MAKES_CONTACT) - gProtectStructs[gBattlerAttacker].touchedProtectLike = 1; + gProtectStructs[gBattlerAttacker].touchedProtectLike = TRUE; CancelMultiTurnMoves(gBattlerAttacker); gMoveResultFlags |= MOVE_RESULT_MISSED; gLastLandedMoves[gBattlerTarget] = 0; @@ -1745,7 +1745,7 @@ static void Cmd_ppreduce(void) if (!(gHitMarker & (HITMARKER_NO_PPDEDUCT | HITMARKER_NO_ATTACKSTRING)) && gBattleMons[gBattlerAttacker].pp[gCurrMovePos]) { - gProtectStructs[gBattlerAttacker].notFirstStrike = 1; + gProtectStructs[gBattlerAttacker].notFirstStrike = TRUE; // For item Metronome, echoed voice if (gCurrentMove == gLastResultingMoves[gBattlerAttacker] && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) @@ -1888,17 +1888,17 @@ static void Cmd_adjustdamage(void) if (holdEffect == HOLD_EFFECT_FOCUS_BAND && (Random() % 100) < param) { RecordItemEffectBattle(gBattlerTarget, holdEffect); - gSpecialStatuses[gBattlerTarget].focusBanded = 1; + gSpecialStatuses[gBattlerTarget].focusBanded = TRUE; } else if (holdEffect == HOLD_EFFECT_FOCUS_SASH && BATTLER_MAX_HP(gBattlerTarget)) { RecordItemEffectBattle(gBattlerTarget, holdEffect); - gSpecialStatuses[gBattlerTarget].focusSashed = 1; + gSpecialStatuses[gBattlerTarget].focusSashed = TRUE; } else if (GetBattlerAbility(gBattlerTarget) == ABILITY_STURDY && BATTLER_MAX_HP(gBattlerTarget)) { RecordAbilityBattle(gBattlerTarget, ABILITY_STURDY); - gSpecialStatuses[gBattlerTarget].sturdied = 1; + gSpecialStatuses[gBattlerTarget].sturdied = TRUE; } if (gBattleMoves[gCurrentMove].effect != EFFECT_FALSE_SWIPE @@ -1961,7 +1961,7 @@ static void Cmd_multihitresultmessage(void) if (gMoveResultFlags & MOVE_RESULT_STURDIED) { gMoveResultFlags &= ~(MOVE_RESULT_STURDIED | MOVE_RESULT_FOE_HUNG_ON); - gSpecialStatuses[gBattlerTarget].sturdied = 0; // Delete this line to make Sturdy last for the duration of the whole move turn. + gSpecialStatuses[gBattlerTarget].sturdied = FALSE; // Delete this line to make Sturdy last for the duration of the whole move turn. BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_SturdiedMsg; return; @@ -1971,8 +1971,8 @@ static void Cmd_multihitresultmessage(void) gLastUsedItem = gBattleMons[gBattlerTarget].item; gPotentialItemEffectBattler = gBattlerTarget; gMoveResultFlags &= ~(MOVE_RESULT_STURDIED | MOVE_RESULT_FOE_HUNG_ON); - gSpecialStatuses[gBattlerTarget].focusBanded = 0; // Delete this line to make Focus Band last for the duration of the whole move turn. - gSpecialStatuses[gBattlerTarget].focusSashed = 0; // Delete this line to make Focus Sash last for the duration of the whole move turn. + gSpecialStatuses[gBattlerTarget].focusBanded = FALSE; // Delete this line to make Focus Band last for the duration of the whole move turn. + gSpecialStatuses[gBattlerTarget].focusSashed = FALSE; // Delete this line to make Focus Sash last for the duration of the whole move turn. BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_HangedOnMsg; return; @@ -1984,7 +1984,7 @@ static void Cmd_multihitresultmessage(void) if (gSpecialStatuses[gBattlerTarget].berryReduced && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) { - gSpecialStatuses[gBattlerTarget].berryReduced = 0; + gSpecialStatuses[gBattlerTarget].berryReduced = FALSE; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_PrintBerryReduceString; } @@ -2336,7 +2336,7 @@ static void Cmd_resultmessage(void) else if (gMoveResultFlags & MOVE_RESULT_STURDIED) { gMoveResultFlags &= ~(MOVE_RESULT_STURDIED | MOVE_RESULT_FOE_ENDURED | MOVE_RESULT_FOE_HUNG_ON); - gSpecialStatuses[gBattlerTarget].sturdied = 0; + gSpecialStatuses[gBattlerTarget].sturdied = FALSE; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_SturdiedMsg; return; @@ -2378,7 +2378,7 @@ static void Cmd_resultmessage(void) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) { gLastUsedItem = gBattleMons[gBattlerTarget].item; - gSpecialStatuses[gBattlerTarget].berryReduced = 0; + gSpecialStatuses[gBattlerTarget].berryReduced = FALSE; BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_PrintBerryReduceString; } @@ -2888,7 +2888,7 @@ void SetMoveEffect(bool32 primary, u32 certain) case MOVE_EFFECT_CHARGING: gBattleMons[gEffectBattler].status2 |= STATUS2_MULTIPLETURNS; gLockedMoves[gEffectBattler] = gCurrentMove; - gProtectStructs[gEffectBattler].chargingTurn = 1; + gProtectStructs[gEffectBattler].chargingTurn = TRUE; gBattlescriptCurrInstr++; break; case MOVE_EFFECT_WRAP: @@ -3212,14 +3212,14 @@ void SetMoveEffect(bool32 primary, u32 certain) || gProtectStructs[gBattlerTarget].kingsShielded || gProtectStructs[gBattlerTarget].banefulBunkered) { - gProtectStructs[gBattlerTarget].protected = 0; + gProtectStructs[gBattlerTarget].protected = FALSE; gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_WIDE_GUARD); gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_QUICK_GUARD); gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_CRAFTY_SHIELD); gSideStatuses[GetBattlerSide(gBattlerTarget)] &= ~(SIDE_STATUS_MAT_BLOCK); - gProtectStructs[gBattlerTarget].spikyShielded = 0; - gProtectStructs[gBattlerTarget].kingsShielded = 0; - gProtectStructs[gBattlerTarget].banefulBunkered = 0; + gProtectStructs[gBattlerTarget].spikyShielded = FALSE; + gProtectStructs[gBattlerTarget].kingsShielded = FALSE; + gProtectStructs[gBattlerTarget].banefulBunkered = FALSE; if (gCurrentMove == MOVE_FEINT) { BattleScriptPush(gBattlescriptCurrInstr + 1); @@ -4753,7 +4753,7 @@ static void Cmd_moveend(void) { if (gProtectStructs[gBattlerTarget].spikyShielded && GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD) { - gProtectStructs[gBattlerAttacker].touchedProtectLike = 0; + gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 8; if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; @@ -4764,7 +4764,7 @@ static void Cmd_moveend(void) } else if (gProtectStructs[gBattlerTarget].kingsShielded) { - gProtectStructs[gBattlerAttacker].touchedProtectLike = 0; + gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; i = gBattlerAttacker; gBattlerAttacker = gBattlerTarget; gBattlerTarget = i; // gBattlerTarget and gBattlerAttacker are swapped in order to activate Defiant, if applicable @@ -4775,7 +4775,7 @@ static void Cmd_moveend(void) } else if (gProtectStructs[gBattlerTarget].banefulBunkered) { - gProtectStructs[gBattlerAttacker].touchedProtectLike = 0; + gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE; gBattleScripting.moveEffect = MOVE_EFFECT_POISON | MOVE_EFFECT_AFFECTS_USER; PREPARE_MOVE_BUFFER(gBattleTextBuff1, MOVE_BANEFUL_BUNKER); BattleScriptPushCursor(); @@ -4924,7 +4924,7 @@ static void Cmd_moveend(void) BtlController_EmitSpriteInvisibility(0, FALSE); MarkBattlerForControllerExec(gActiveBattler); gStatuses3[gBattlerAttacker] &= ~(STATUS3_SEMI_INVULNERABLE); - gSpecialStatuses[gBattlerAttacker].restoredBattlerSprite = 1; + gSpecialStatuses[gBattlerAttacker].restoredBattlerSprite = TRUE; gBattleScripting.moveendState++; return; } @@ -5030,7 +5030,7 @@ static void Cmd_moveend(void) // Set a flag if move hits either target (for throat spray that can't check damage) if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)) - gProtectStructs[gBattlerAttacker].targetAffected = 1; + gProtectStructs[gBattlerAttacker].targetAffected = TRUE; if (!(gHitMarker & HITMARKER_UNABLE_TO_USE_MOVE) && gBattleTypeFlags & BATTLE_TYPE_DOUBLE @@ -5227,7 +5227,7 @@ static void Cmd_moveend(void) { gBattleScripting.savedBattler = gBattlerTarget | 0x4; gBattleScripting.savedBattler |= (gBattlerAttacker << 4); - gSpecialStatuses[gBattlerAttacker].dancerUsedMove = 1; + gSpecialStatuses[gBattlerAttacker].dancerUsedMove = TRUE; } for (battler = 0; battler < MAX_BATTLERS_COUNT; battler++) { @@ -5275,13 +5275,13 @@ static void Cmd_moveend(void) *(gBattleStruct->moveTarget + gBattlerAttacker) = gSpecialStatuses[gBattlerAttacker].instructedChosenTarget & 0x3; if (gSpecialStatuses[gBattlerAttacker].dancerOriginalTarget) *(gBattleStruct->moveTarget + gBattlerAttacker) = gSpecialStatuses[gBattlerAttacker].dancerOriginalTarget & 0x3; - gProtectStructs[gBattlerAttacker].usesBouncedMove = 0; - gProtectStructs[gBattlerAttacker].targetAffected = 0; + gProtectStructs[gBattlerAttacker].usesBouncedMove = FALSE; + gProtectStructs[gBattlerAttacker].targetAffected = FALSE; gBattleStruct->ateBoost[gBattlerAttacker] = 0; gStatuses3[gBattlerAttacker] &= ~(STATUS3_ME_FIRST); - gSpecialStatuses[gBattlerAttacker].gemBoost = 0; + gSpecialStatuses[gBattlerAttacker].gemBoost = FALSE; gSpecialStatuses[gBattlerAttacker].damagedMons = 0; - gSpecialStatuses[gBattlerTarget].berryReduced = 0; + gSpecialStatuses[gBattlerTarget].berryReduced = FALSE; gBattleScripting.moveEffect = 0; gBattleScripting.moveendState++; break; @@ -7538,9 +7538,9 @@ static void Cmd_various(void) gBattleCommunication[0] = FALSE; break; case VARIOUS_RESET_INTIMIDATE_TRACE_BITS: - gSpecialStatuses[gActiveBattler].intimidatedMon = 0; - gSpecialStatuses[gActiveBattler].traced = 0; - gSpecialStatuses[gActiveBattler].switchInAbilityDone = 0; + gSpecialStatuses[gActiveBattler].intimidatedMon = FALSE; + gSpecialStatuses[gActiveBattler].traced = FALSE; + gSpecialStatuses[gActiveBattler].switchInAbilityDone = FALSE; break; case VARIOUS_UPDATE_CHOICE_MOVE_ON_LVL_UP: if (gBattlerPartyIndexes[0] == gBattleStruct->expGetterMonId || gBattlerPartyIndexes[2] == gBattleStruct->expGetterMonId) @@ -8615,27 +8615,27 @@ static void Cmd_setprotectlike(void) { if (gBattleMoves[gCurrentMove].effect == EFFECT_ENDURE) { - gProtectStructs[gBattlerAttacker].endured = 1; + gProtectStructs[gBattlerAttacker].endured = TRUE; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_BRACED_ITSELF; } else if (gCurrentMove == MOVE_DETECT || gCurrentMove == MOVE_PROTECT) { - gProtectStructs[gBattlerAttacker].protected = 1; + gProtectStructs[gBattlerAttacker].protected = TRUE; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF; } else if (gCurrentMove == MOVE_SPIKY_SHIELD) { - gProtectStructs[gBattlerAttacker].spikyShielded = 1; + gProtectStructs[gBattlerAttacker].spikyShielded = TRUE; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF; } else if (gCurrentMove == MOVE_KINGS_SHIELD) { - gProtectStructs[gBattlerAttacker].kingsShielded = 1; + gProtectStructs[gBattlerAttacker].kingsShielded = TRUE; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF; } else if (gCurrentMove == MOVE_BANEFUL_BUNKER) { - gProtectStructs[gBattlerAttacker].banefulBunkered = 1; + gProtectStructs[gBattlerAttacker].banefulBunkered = TRUE; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_PROTECTED_ITSELF; } @@ -8800,7 +8800,7 @@ static void Cmd_trymirrormove(void) } else { - gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; + gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; gBattlescriptCurrInstr++; } } @@ -9168,7 +9168,7 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr BattleScriptPush(BS_ptr); gBattleScripting.battler = gActiveBattler; gBattlescriptCurrInstr = BattleScript_MistProtected; - gSpecialStatuses[gActiveBattler].statLowered = 1; + gSpecialStatuses[gActiveBattler].statLowered = TRUE; } } return STAT_CHANGE_DIDNT_WORK; @@ -9198,7 +9198,7 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr gBattlescriptCurrInstr = BattleScript_AbilityNoStatLoss; gLastUsedAbility = GetBattlerAbility(gActiveBattler); RecordAbilityBattle(gActiveBattler, gLastUsedAbility); - gSpecialStatuses[gActiveBattler].statLowered = 1; + gSpecialStatuses[gActiveBattler].statLowered = TRUE; } } return STAT_CHANGE_DIDNT_WORK; @@ -9218,7 +9218,7 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr gBattlerAbility = index - 1; gBattlescriptCurrInstr = BattleScript_FlowerVeilProtectsRet; gLastUsedAbility = ABILITY_FLOWER_VEIL; - gSpecialStatuses[gActiveBattler].statLowered = 1; + gSpecialStatuses[gActiveBattler].statLowered = TRUE; } } return STAT_CHANGE_DIDNT_WORK; @@ -9293,7 +9293,7 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr else { // Check eject pack. disableEjectPack set for edge cases (e.g. attacking weak armor'd eject pack holder with u-turn) - if (gProtectStructs[gActiveBattler].disableEjectPack == 0) + if (!gProtectStructs[gActiveBattler].disableEjectPack) gSpecialStatuses[gActiveBattler].statFell = TRUE; gBattleCommunication[MULTISTRING_CHOOSER] = (gBattlerTarget == gActiveBattler); // B_MSG_ATTACKER_STAT_FELL or B_MSG_DEFENDER_STAT_FELL } @@ -9787,12 +9787,12 @@ static void Cmd_tryKO(void) if (holdEffect == HOLD_EFFECT_FOCUS_BAND && (Random() % 100) < GetBattlerHoldEffectParam(gBattlerTarget)) { - gSpecialStatuses[gBattlerTarget].focusBanded = 1; + gSpecialStatuses[gBattlerTarget].focusBanded = TRUE; RecordItemEffectBattle(gBattlerTarget, holdEffect); } else if (holdEffect == HOLD_EFFECT_FOCUS_SASH && BATTLER_MAX_HP(gBattlerTarget)) { - gSpecialStatuses[gBattlerTarget].focusSashed = 1; + gSpecialStatuses[gBattlerTarget].focusSashed = TRUE; RecordItemEffectBattle(gBattlerTarget, holdEffect); } @@ -10206,7 +10206,7 @@ static void Cmd_counterdamagecalculator(void) } else { - gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; + gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } } @@ -10231,7 +10231,7 @@ static void Cmd_mirrorcoatdamagecalculator(void) // a copy of atkA1 with the phy } else { - gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; + gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } } @@ -10720,7 +10720,7 @@ static void Cmd_trysetspikes(void) if (gSideTimers[targetSide].spikesAmount == 3) { - gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; + gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } else @@ -11407,7 +11407,7 @@ static void Cmd_trysethelpinghand(void) && !gProtectStructs[gBattlerAttacker].helpingHand && !gProtectStructs[gBattlerTarget].helpingHand) { - gProtectStructs[gBattlerTarget].helpingHand = 1; + gProtectStructs[gBattlerTarget].helpingHand = TRUE; gBattlescriptCurrInstr += 5; } else @@ -11827,28 +11827,28 @@ static void Cmd_assistattackselect(void) static void Cmd_trysetmagiccoat(void) { gBattlerTarget = gBattlerAttacker; - gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; + gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; if (gCurrentTurnActionNumber == gBattlersCount - 1) // moves last turn { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } else { - gProtectStructs[gBattlerAttacker].bounceMove = 1; + gProtectStructs[gBattlerAttacker].bounceMove = TRUE; gBattlescriptCurrInstr += 5; } } static void Cmd_trysetsnatch(void) // snatch { - gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; + gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; if (gCurrentTurnActionNumber == gBattlersCount - 1) // moves last turn { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } else { - gProtectStructs[gBattlerAttacker].stealMove = 1; + gProtectStructs[gBattlerAttacker].stealMove = TRUE; gBattlescriptCurrInstr += 5; } } @@ -12835,7 +12835,7 @@ static void Cmd_metalburstdamagecalculator(void) } else { - gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = 1; + gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE; gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1); } } diff --git a/src/battle_util.c b/src/battle_util.c index f0adfebb9..b012f7d49 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -255,7 +255,7 @@ void HandleAction_UseMove(void) // choose move if (gProtectStructs[gBattlerAttacker].noValidMoves) { - gProtectStructs[gBattlerAttacker].noValidMoves = 0; + gProtectStructs[gBattlerAttacker].noValidMoves = FALSE; gCurrentMove = gChosenMove = MOVE_STRUGGLE; gHitMarker |= HITMARKER_NO_PPDEDUCT; *(gBattleStruct->moveTarget + gBattlerAttacker) = GetMoveTarget(MOVE_STRUGGLE, 0); @@ -386,9 +386,9 @@ void HandleAction_UseMove(void) gActiveBattler = gBattlerByTurnOrder[var]; RecordAbilityBattle(gActiveBattler, gBattleMons[gActiveBattler].ability); if (gBattleMons[gActiveBattler].ability == ABILITY_LIGHTNING_ROD) - gSpecialStatuses[gActiveBattler].lightningRodRedirected = 1; + gSpecialStatuses[gActiveBattler].lightningRodRedirected = TRUE; else if (gBattleMons[gActiveBattler].ability == ABILITY_STORM_DRAIN) - gSpecialStatuses[gActiveBattler].stormDrainRedirected = 1; + gSpecialStatuses[gActiveBattler].stormDrainRedirected = TRUE; gBattlerTarget = gActiveBattler; } } @@ -1594,7 +1594,7 @@ u8 TrySetCantSelectMoveBattleScript(void) if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingDisabledMoveInPalace; - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; } else { @@ -1609,7 +1609,7 @@ u8 TrySetCantSelectMoveBattleScript(void) if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingTormentedMoveInPalace; - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; } else { @@ -1624,7 +1624,7 @@ u8 TrySetCantSelectMoveBattleScript(void) if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveTauntInPalace; - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; } else { @@ -1639,7 +1639,7 @@ u8 TrySetCantSelectMoveBattleScript(void) if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveThroatChopInPalace; - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; } else { @@ -1654,7 +1654,7 @@ u8 TrySetCantSelectMoveBattleScript(void) if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingImprisonedMoveInPalace; - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; } else { @@ -1669,7 +1669,7 @@ u8 TrySetCantSelectMoveBattleScript(void) if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveGravityInPalace; - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; } else { @@ -1684,7 +1684,7 @@ u8 TrySetCantSelectMoveBattleScript(void) if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedMoveHealBlockInPalace; - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; } else { @@ -1699,7 +1699,7 @@ u8 TrySetCantSelectMoveBattleScript(void) if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { gPalaceSelectionBattleScripts[gActiveBattler] = BattleScript_SelectingNotAllowedBelchInPalace; - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; } else { @@ -1715,7 +1715,7 @@ u8 TrySetCantSelectMoveBattleScript(void) gLastUsedItem = gBattleMons[gActiveBattler].item; if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; } else { @@ -1729,7 +1729,7 @@ u8 TrySetCantSelectMoveBattleScript(void) gLastUsedItem = gBattleMons[gActiveBattler].item; if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; } else { @@ -1742,7 +1742,7 @@ u8 TrySetCantSelectMoveBattleScript(void) { if (gBattleTypeFlags & BATTLE_TYPE_PALACE) { - gProtectStructs[gActiveBattler].palaceUnableToUseMove = 1; + gProtectStructs[gActiveBattler].palaceUnableToUseMove = TRUE; } else { @@ -1801,12 +1801,12 @@ bool8 AreAllMovesUnusable(void) if (unusable == 0xF) // All moves are unusable. { - gProtectStructs[gActiveBattler].noValidMoves = 1; + gProtectStructs[gActiveBattler].noValidMoves = TRUE; gSelectionBattleScripts[gActiveBattler] = BattleScript_NoMovesLeft; } else { - gProtectStructs[gActiveBattler].noValidMoves = 0; + gProtectStructs[gActiveBattler].noValidMoves = FALSE; } return (unusable == 0xF); @@ -3194,7 +3194,7 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_FLINCH: // flinch if (gBattleMons[gBattlerAttacker].status2 & STATUS2_FLINCHED) { - gProtectStructs[gBattlerAttacker].flinchImmobility = 1; + gProtectStructs[gBattlerAttacker].flinchImmobility = TRUE; CancelMultiTurnMoves(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_MoveUsedFlinched; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; @@ -3205,7 +3205,7 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_DISABLED: // disabled move if (gDisableStructs[gBattlerAttacker].disabledMove == gCurrentMove && gDisableStructs[gBattlerAttacker].disabledMove != 0) { - gProtectStructs[gBattlerAttacker].usedDisabledMove = 1; + gProtectStructs[gBattlerAttacker].usedDisabledMove = TRUE; gBattleScripting.battler = gBattlerAttacker; CancelMultiTurnMoves(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_MoveUsedIsDisabled; @@ -3217,7 +3217,7 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_HEAL_BLOCKED: if (gStatuses3[gBattlerAttacker] & STATUS3_HEAL_BLOCK && IsHealBlockPreventingMove(gBattlerAttacker, gCurrentMove)) { - gProtectStructs[gBattlerAttacker].usedHealBlockedMove = 1; + gProtectStructs[gBattlerAttacker].usedHealBlockedMove = TRUE; gBattleScripting.battler = gBattlerAttacker; CancelMultiTurnMoves(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_MoveUsedHealBlockPrevents; @@ -3229,7 +3229,7 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_GRAVITY: if (gFieldStatuses & STATUS_FIELD_GRAVITY && IsGravityPreventingMove(gCurrentMove)) { - gProtectStructs[gBattlerAttacker].usedGravityPreventedMove = 1; + gProtectStructs[gBattlerAttacker].usedGravityPreventedMove = TRUE; gBattleScripting.battler = gBattlerAttacker; CancelMultiTurnMoves(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_MoveUsedGravityPrevents; @@ -3241,7 +3241,7 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_TAUNTED: // taunt if (gDisableStructs[gBattlerAttacker].tauntTimer && gBattleMoves[gCurrentMove].power == 0) { - gProtectStructs[gBattlerAttacker].usedTauntedMove = 1; + gProtectStructs[gBattlerAttacker].usedTauntedMove = TRUE; CancelMultiTurnMoves(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_MoveUsedIsTaunted; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; @@ -3252,7 +3252,7 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_IMPRISONED: // imprisoned if (GetImprisonedMovesCount(gBattlerAttacker, gCurrentMove)) { - gProtectStructs[gBattlerAttacker].usedImprisonedMove = 1; + gProtectStructs[gBattlerAttacker].usedImprisonedMove = TRUE; CancelMultiTurnMoves(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_MoveUsedIsImprisoned; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; @@ -3271,7 +3271,7 @@ u8 AtkCanceller_UnableToUseMove(void) gBattleCommunication[MULTISTRING_CHOOSER] = TRUE; gBattlerTarget = gBattlerAttacker; gBattleMoveDamage = CalculateMoveDamage(MOVE_NONE, gBattlerAttacker, gBattlerAttacker, TYPE_MYSTERY, 40, FALSE, FALSE, TRUE); - gProtectStructs[gBattlerAttacker].confusionSelfDmg = 1; + gProtectStructs[gBattlerAttacker].confusionSelfDmg = TRUE; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; } else @@ -3293,7 +3293,7 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_PARALYSED: // paralysis if ((gBattleMons[gBattlerAttacker].status1 & STATUS1_PARALYSIS) && (Random() % 4) == 0) { - gProtectStructs[gBattlerAttacker].prlzImmobility = 1; + gProtectStructs[gBattlerAttacker].prlzImmobility = TRUE; // This is removed in Emerald for some reason //CancelMultiTurnMoves(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_MoveUsedIsParalyzed; @@ -3314,7 +3314,7 @@ u8 AtkCanceller_UnableToUseMove(void) { BattleScriptPush(BattleScript_MoveUsedIsInLoveCantAttack); gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; - gProtectStructs[gBattlerAttacker].loveImmobility = 1; + gProtectStructs[gBattlerAttacker].loveImmobility = TRUE; CancelMultiTurnMoves(gBattlerAttacker); } gBattlescriptCurrInstr = BattleScript_MoveUsedIsInLove; @@ -3393,7 +3393,7 @@ u8 AtkCanceller_UnableToUseMove(void) GET_MOVE_TYPE(gCurrentMove, moveType); if (moveType == TYPE_FIRE) { - gProtectStructs[gBattlerAttacker].powderSelfDmg = 1; + gProtectStructs[gBattlerAttacker].powderSelfDmg = TRUE; gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; gBattlescriptCurrInstr = BattleScript_MoveUsedPowder; effect = 1; @@ -3404,7 +3404,7 @@ u8 AtkCanceller_UnableToUseMove(void) case CANCELLER_THROAT_CHOP: if (gDisableStructs[gBattlerAttacker].throatChopTimer && gBattleMoves[gCurrentMove].flags & FLAG_SOUND) { - gProtectStructs[gBattlerAttacker].usedThroatChopPreventedMove = 1; + gProtectStructs[gBattlerAttacker].usedThroatChopPreventedMove = TRUE; CancelMultiTurnMoves(gBattlerAttacker); gBattlescriptCurrInstr = BattleScript_MoveUsedIsThroatChopPrevented; gHitMarker |= HITMARKER_UNABLE_TO_USE_MOVE; @@ -3926,7 +3926,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!gSpecialStatuses[battler].switchInAbilityDone) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_MOLDBREAKER; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -3935,7 +3935,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!gSpecialStatuses[battler].switchInAbilityDone) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_TERAVOLT; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -3944,7 +3944,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!gSpecialStatuses[battler].switchInAbilityDone) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_TURBOBLAZE; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -3954,7 +3954,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move { gDisableStructs[battler].slowStartTimer = 5; gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_SLOWSTART; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -3963,7 +3963,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!gSpecialStatuses[battler].switchInAbilityDone) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_UNNERVE; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -3973,7 +3973,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!gSpecialStatuses[battler].switchInAbilityDone) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_ASONE; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_ActivateAsOne); effect++; } @@ -3985,7 +3985,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move u32 i; gEffectBattler = BATTLE_PARTNER(battler); gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_CURIOUS_MEDICINE; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -4015,7 +4015,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (effect) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_ANTICIPATION; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); } } @@ -4023,7 +4023,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move case ABILITY_FRISK: if (!gSpecialStatuses[battler].switchInAbilityDone) { - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_FriskActivates); // Try activate effect++; } @@ -4033,7 +4033,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move { ForewarnChooseMove(battler); gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_FOREWARN; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -4063,7 +4063,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move else statId = STAT_SPATK; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; if (CompareStat(battler, statId, MAX_STAT_STAGE, CMP_LESS_THAN)) { @@ -4080,7 +4080,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!gSpecialStatuses[battler].switchInAbilityDone) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_PRESSURE; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -4089,7 +4089,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!gSpecialStatuses[battler].switchInAbilityDone) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_DARKAURA; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -4098,7 +4098,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!gSpecialStatuses[battler].switchInAbilityDone) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_FAIRYAURA; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -4107,7 +4107,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!gSpecialStatuses[battler].switchInAbilityDone) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_AURABREAK; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -4116,7 +4116,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!gSpecialStatuses[battler].switchInAbilityDone) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_COMATOSE; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -4125,7 +4125,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!gSpecialStatuses[battler].switchInAbilityDone && TryRemoveScreens(battler)) { gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_SCREENCLEANER; - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_SwitchInAbilityMsg); effect++; } @@ -4190,7 +4190,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!(gSpecialStatuses[battler].intimidatedMon)) { gBattleResources->flags->flags[battler] |= RESOURCE_FLAG_INTIMIDATED; - gSpecialStatuses[battler].intimidatedMon = 1; + gSpecialStatuses[battler].intimidatedMon = TRUE; } break; case ABILITY_FORECAST: @@ -4206,14 +4206,14 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!(gSpecialStatuses[battler].traced)) { gBattleResources->flags->flags[battler] |= RESOURCE_FLAG_TRACED; - gSpecialStatuses[battler].traced = 1; + gSpecialStatuses[battler].traced = TRUE; } break; case ABILITY_CLOUD_NINE: case ABILITY_AIR_LOCK: if (!gSpecialStatuses[battler].switchInAbilityDone) { - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; BattleScriptPushCursorAndCallback(BattleScript_AnnounceAirLockCloudNine); effect++; } @@ -4231,7 +4231,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move case ABILITY_INTREPID_SWORD: if (!gSpecialStatuses[battler].switchInAbilityDone) { - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; SET_STATCHANGER(STAT_ATK, 1, FALSE); BattleScriptPushCursorAndCallback(BattleScript_BattlerAbilityStatRaiseOnSwitchIn); effect++; @@ -4240,7 +4240,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move case ABILITY_DAUNTLESS_SHIELD: if (!gSpecialStatuses[battler].switchInAbilityDone) { - gSpecialStatuses[battler].switchInAbilityDone = 1; + gSpecialStatuses[battler].switchInAbilityDone = TRUE; SET_STATCHANGER(STAT_DEF, 1, FALSE); BattleScriptPushCursorAndCallback(BattleScript_BattlerAbilityStatRaiseOnSwitchIn); effect++; @@ -4659,7 +4659,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move || CompareStat(battler, STAT_DEF, MIN_STAT_STAGE, CMP_GREATER_THAN))) // Don't activate if defense cannot be lowered { if (gBattleMoves[gCurrentMove].effect == EFFECT_HIT_ESCAPE && CanBattlerSwitch(gBattlerAttacker)) - gProtectStructs[battler].disableEjectPack = 1; // Set flag for target + gProtectStructs[battler].disableEjectPack = TRUE; // Set flag for target BattleScriptPushCursor(); gBattlescriptCurrInstr = BattleScript_WeakArmorActivates; @@ -5015,7 +5015,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move && gBattlerAttacker != battler) { // Set bit and save Dancer mon's original target - gSpecialStatuses[battler].dancerUsedMove = 1; + gSpecialStatuses[battler].dancerUsedMove = TRUE; gSpecialStatuses[battler].dancerOriginalTarget = *(gBattleStruct->moveTarget + battler) | 0x4; gBattleStruct->atkCancellerTracker = 0; gBattlerAttacker = gBattlerAbility = battler; @@ -6016,7 +6016,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) if (effect) { - gSpecialStatuses[battlerId].switchInItemDone = 1; + gSpecialStatuses[battlerId].switchInItemDone = TRUE; gActiveBattler = gBattlerAttacker = gPotentialItemEffectBattler = gBattleScripting.battler = battlerId; switch (effect) { @@ -6852,7 +6852,7 @@ u8 GetMoveTarget(u16 move, u8 setTarget) { targetBattler ^= BIT_FLANK; RecordAbilityBattle(targetBattler, gBattleMons[targetBattler].ability); - gSpecialStatuses[targetBattler].lightningRodRedirected = 1; + gSpecialStatuses[targetBattler].lightningRodRedirected = TRUE; } else if (gBattleMoves[move].type == TYPE_WATER && IsAbilityOnOpposingSide(gBattlerAttacker, ABILITY_STORM_DRAIN) @@ -6860,7 +6860,7 @@ u8 GetMoveTarget(u16 move, u8 setTarget) { targetBattler ^= BIT_FLANK; RecordAbilityBattle(targetBattler, gBattleMons[targetBattler].ability); - gSpecialStatuses[targetBattler].stormDrainRedirected = 1; + gSpecialStatuses[targetBattler].stormDrainRedirected = TRUE; } } break; @@ -7387,7 +7387,7 @@ static u16 CalcMoveBasePower(u16 move, u8 battlerAtk, u8 battlerDef) basePower *= 2; break; case EFFECT_ASSURANCE: - if (gProtectStructs[battlerDef].physicalDmg != 0 || gProtectStructs[battlerDef].specialDmg != 0 || gProtectStructs[battlerDef].confusionSelfDmg != 0) + if (gProtectStructs[battlerDef].physicalDmg != 0 || gProtectStructs[battlerDef].specialDmg != 0 || gProtectStructs[battlerDef].confusionSelfDmg) basePower *= 2; break; case EFFECT_TRUMP_CARD: @@ -8236,7 +8236,7 @@ static u32 CalcFinalDmg(u32 dmg, u16 move, u8 battlerAtk, u8 battlerDef, u8 move else MulModifier(&finalModifier, UQ_4_12(0.5)); if (updateFlags) - gSpecialStatuses[battlerDef].berryReduced = 1; + gSpecialStatuses[battlerDef].berryReduced = TRUE; } break; } From 075c0299a13fa1b012614eadefebd9f991f83e74 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Wed, 22 Sep 2021 23:29:26 -0300 Subject: [PATCH 10/72] Better names for Micle and Custap flags --- include/battle.h | 4 ++-- src/battle_main.c | 12 ++++++------ src/battle_script_commands.c | 4 ++-- src/battle_util.c | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/include/battle.h b/include/battle.h index 36646c9fe..200b1112d 100644 --- a/include/battle.h +++ b/include/battle.h @@ -142,8 +142,8 @@ struct ProtectStruct u32 usedGravityPreventedMove:1; u32 powderSelfDmg:1; u32 usedThroatChopPreventedMove:1; - u32 micle:1; - u32 custap:1; // also quick claw + u32 usedMicleBerry:1; + u32 usedCustapBerry:1; // also quick claw u32 touchedProtectLike:1; u32 disableEjectPack:1; u32 physicalDmg; diff --git a/src/battle_main.c b/src/battle_main.c index 1b4ad5f74..cc9fff1d3 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -4360,7 +4360,7 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves) || (!IsAbilityOnOpposingSide(battler1, ABILITY_UNNERVE) && holdEffectBattler1 == HOLD_EFFECT_CUSTAP_BERRY && HasEnoughHpToEatBerry(battler1, 4, gBattleMons[battler1].item))) - gProtectStructs[battler1].custap = TRUE; + gProtectStructs[battler1].usedCustapBerry = TRUE; speedBattler2 = GetBattlerTotalSpeedStat(battler2); holdEffectBattler2 = GetBattlerHoldEffect(battler2, TRUE); @@ -4368,7 +4368,7 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves) || (!IsAbilityOnOpposingSide(battler2, ABILITY_UNNERVE) && holdEffectBattler2 == HOLD_EFFECT_CUSTAP_BERRY && HasEnoughHpToEatBerry(battler2, 4, gBattleMons[battler2].item))) - gProtectStructs[battler2].custap = TRUE; + gProtectStructs[battler2].usedCustapBerry = TRUE; if (!ignoreChosenMoves) { @@ -4384,9 +4384,9 @@ u8 GetWhoStrikesFirst(u8 battler1, u8 battler2, bool8 ignoreChosenMoves) // LAGGING TAIL - always last // STALL - always last - if (gProtectStructs[battler1].custap && !gProtectStructs[battler2].custap) + if (gProtectStructs[battler1].usedCustapBerry && !gProtectStructs[battler2].usedCustapBerry) strikesFirst = 0; - else if (gProtectStructs[battler2].custap && !gProtectStructs[battler1].custap) + else if (gProtectStructs[battler2].usedCustapBerry && !gProtectStructs[battler1].usedCustapBerry) strikesFirst = 1; else if (holdEffectBattler1 == HOLD_EFFECT_LAGGING_TAIL && holdEffectBattler2 != HOLD_EFFECT_LAGGING_TAIL) strikesFirst = 1; @@ -4639,12 +4639,12 @@ static void CheckQuickClaw_CustapBerryActivation(void) gBattleStruct->quickClawBattlerId++; if (gChosenActionByBattler[gActiveBattler] == B_ACTION_USE_MOVE && gChosenMoveByBattler[gActiveBattler] != MOVE_FOCUS_PUNCH // quick claw message doesn't need to activate here - && gProtectStructs[gActiveBattler].custap + && gProtectStructs[gActiveBattler].usedCustapBerry && !(gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP) && !(gDisableStructs[gBattlerAttacker].truantCounter) && !(gProtectStructs[gActiveBattler].noValidMoves)) { - gProtectStructs[gActiveBattler].custap = FALSE; + gProtectStructs[gActiveBattler].usedCustapBerry = FALSE; gLastUsedItem = gBattleMons[gActiveBattler].item; if (GetBattlerHoldEffect(gActiveBattler, FALSE) == HOLD_EFFECT_CUSTAP_BERRY) { diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 9a107fac0..b03da17c3 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1638,9 +1638,9 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move) else if (atkHoldEffect == HOLD_EFFECT_ZOOM_LENS && GetBattlerTurnOrderNum(battlerAtk) > GetBattlerTurnOrderNum(battlerDef)); calc = (calc * (100 + atkParam)) / 100; - if (gProtectStructs[battlerAtk].micle) + if (gProtectStructs[battlerAtk].usedMicleBerry) { - gProtectStructs[battlerAtk].micle = FALSE; + gProtectStructs[battlerAtk].usedMicleBerry = FALSE; if (atkAbility == ABILITY_RIPEN) calc = (calc * 140) / 100; // ripen gives 40% acc boost else diff --git a/src/battle_util.c b/src/battle_util.c index b012f7d49..c9ecfd3d8 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5616,7 +5616,7 @@ static u8 TrySetMicleBerry(u32 battlerId, u32 itemId, bool32 end2) { if (HasEnoughHpToEatBerry(battlerId, 4, itemId)) { - gProtectStructs[battlerId].micle = TRUE; // battler's next attack has increased accuracy + gProtectStructs[battlerId].usedMicleBerry = TRUE; // battler's next attack has increased accuracy if (end2) { From 996301d5d33072407fe9143811d27eb31e07e201 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Tue, 12 Oct 2021 18:04:34 -0400 Subject: [PATCH 11/72] add mirror armor --- asm/macros/battle_script.inc | 4 ++ data/battle_scripts_1.s | 36 +++++++++++++++ include/battle_scripts.h | 2 + include/constants/battle_script_commands.h | 1 + src/battle_script_commands.c | 51 +++++++++++++++++----- src/battle_util.c | 7 +-- 6 files changed, 86 insertions(+), 15 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 4d8fe0365..f00e580f0 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1824,6 +1824,10 @@ .macro trytoclearprimalweather various BS_ATTACKER, VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER .endm + + .macro getrandommirrorarmortarget + various BS_TARGET, VARIOUS_GET_RANDOM_MIRROR_ARMOR_TARGET + .endm @ helpful macros .macro setstatchanger stat:req, stages:req, down:req diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index e1fb47930..5979f4c67 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -2645,6 +2645,33 @@ BattleScript_StatDownPrintString:: BattleScript_StatDownEnd:: goto BattleScript_MoveEnd +BattleScript_MirrorArmorReflect:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + jumpifsubstituteblocks BattleScript_AbilityNoSpecificStatLoss +BattleScript_MirrorArmorReflectStatLoss: + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_MirrorArmorReflectWontFall + jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_MirrorArmorReflectAnim + goto BattleScript_MirrorArmorReflectWontFall +BattleScript_MirrorArmorReflectAnim: + setgraphicalstatchangevalues + playanimation BS_ATTACKER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 +BattleScript_MirrorArmorReflectPrintString: + printfromtable gStatDownStringIds + waitmessage B_WAIT_TIME_LONG +BattleScript_MirrorArmorReflectEnd: + return + +BattleScript_MirrorArmorReflectWontFall: + copybyte gBattlerTarget, gBattlerAttacker @ STRINGID_STATSWONTDECREASE uses target + goto BattleScript_MirrorArmorReflectPrintString + +BattleScript_MirrorArmorReflectStickyWeb: + call BattleScript_AbilityPopUp + getrandommirrorarmortarget + jumpifbyteequal gBattlerTarget, gBattlerAttacker, BattleScript_AbilityNoSpecificStatLossPrint + goto BattleScript_MirrorArmorReflectStatLoss + BattleScript_StatDown:: playanimation BS_EFFECT_BATTLER, B_ANIM_STATS_CHANGE, sB_ANIM_ARG1 printfromtable gStatDownStringIds @@ -6099,6 +6126,7 @@ BattleScript_StickyWebOnSwitchIn:: copybyte gBattlerTarget, sBATTLER printstring STRINGID_STICKYWEBSWITCHIN waitmessage B_WAIT_TIME_LONG + jumpifability BS_TARGET, ABILITY_MIRROR_ARMOR, BattleScript_MirrorArmorReflectStickyWeb statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_StickyWebOnSwitchInEnd jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_StickyWebOnSwitchInStatAnim jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_FELL_EMPTY, BattleScript_StickyWebOnSwitchInEnd @@ -7639,6 +7667,7 @@ BattleScript_GrassyTerrainHealEnd: BattleScript_AbilityNoSpecificStatLoss:: pause B_WAIT_TIME_SHORT call BattleScript_AbilityPopUp +BattleScript_AbilityNoSpecificStatLossPrint: printstring STRINGID_PKMNSXPREVENTSYLOSS waitmessage B_WAIT_TIME_LONG setbyte cMULTISTRING_CHOOSER, B_MSG_STAT_FELL_EMPTY @@ -7885,6 +7914,13 @@ BattleScript_CuteCharmActivates:: call BattleScript_TryDestinyKnotTarget return +BattleScript_GooeyActivates:: + waitstate + call BattleScript_AbilityPopUp + swapattackerwithtarget @ for defiant, mirror armor + seteffectsecondary + return + BattleScript_AbilityStatusEffect:: waitstate call BattleScript_AbilityPopUp diff --git a/include/battle_scripts.h b/include/battle_scripts.h index cd4600543..4e5568c75 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -398,5 +398,7 @@ extern const u8 BattleScript_MysteriousAirCurrentBlowsOn[]; extern const u8 BattleScript_AttackWeakenedByStrongWinds[]; extern const u8 BattleScript_BlockedByPrimalWeatherEnd3[]; extern const u8 BattleScript_BlockedByPrimalWeatherRet[]; +extern const u8 BattleScript_MirrorArmorReflect[]; +extern const u8 BattleScript_GooeyActivates[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index d61eabbf8..bbf5714e9 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -185,6 +185,7 @@ #define VARIOUS_REMOVE_TERRAIN 113 #define VARIOUS_JUMP_IF_PRANKSTER_BLOCKED 114 #define VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER 115 +#define VARIOUS_GET_RANDOM_MIRROR_ARMOR_TARGET 116 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 2c017b2df..9c0b4ec37 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2582,6 +2582,8 @@ void SetMoveEffect(bool32 primary, u32 certain) { s32 i, byTwo, affectsUser = 0; bool32 statusChanged = FALSE; + bool32 mirrorArmorReflected = (GetBattlerAbility(gBattlerTarget) == ABILITY_MIRROR_ARMOR); + u32 flags; switch (gBattleScripting.moveEffect) // Set move effects which happen later on { @@ -3012,11 +3014,18 @@ void SetMoveEffect(bool32 primary, u32 certain) case MOVE_EFFECT_SP_DEF_MINUS_1: case MOVE_EFFECT_ACC_MINUS_1: case MOVE_EFFECT_EVS_MINUS_1: - if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(1) | STAT_BUFF_NEGATIVE, - gBattleScripting.moveEffect - MOVE_EFFECT_ATK_MINUS_1 + 1, - affectsUser, 0)) + flags = affectsUser | certain; + if (mirrorArmorReflected && !affectsUser) { - gBattlescriptCurrInstr++; + flags |= STAT_BUFF_ALLOW_PTR; + } + + if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(1) | STAT_BUFF_NEGATIVE, + gBattleScripting.moveEffect - MOVE_EFFECT_ATK_MINUS_1 + 1, + flags, gBattlescriptCurrInstr + 1)) + { + if (!mirrorArmorReflected) + gBattlescriptCurrInstr++; } else { @@ -8822,6 +8831,25 @@ static void Cmd_various(void) } break; } + case VARIOUS_GET_RANDOM_MIRROR_ARMOR_TARGET: + i = BATTLE_OPPOSITE(gActiveBattler); + gBattlerAttacker = gBattlerTarget; + if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) + { + if (IsBattlerAlive(i) + && !(gBattleMons[i].status2 & STATUS2_SUBSTITUTE)) + gBattlerAttacker = i; + else if (IsBattlerAlive(BATTLE_PARTNER(i)) + && !(gBattleMons[BATTLE_PARTNER(i)].status2 & STATUS2_SUBSTITUTE)) + gBattlerAttacker = BATTLE_PARTNER(i); + } + else + { + if (IsBattlerAlive(i) && !(gBattleMons[i].status2 & STATUS2_SUBSTITUTE)) + gBattlerAttacker = i; + } + SET_STATCHANGER(STAT_SPEED, 1, TRUE); + break; } gBattlescriptCurrInstr += 3; @@ -9355,8 +9383,9 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr bool32 certain = FALSE; bool32 notProtectAffected = FALSE; u32 index; + bool32 affectsUser = flags & MOVE_EFFECT_AFFECTS_USER; - if (flags & MOVE_EFFECT_AFFECTS_USER) + if (affectsUser) gActiveBattler = gBattlerAttacker; else gActiveBattler = gBattlerTarget; @@ -9457,8 +9486,9 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr } return STAT_CHANGE_DIDNT_WORK; } - else if (GetBattlerAbility(gActiveBattler) == ABILITY_KEEN_EYE - && !certain && statId == STAT_ACC) + else if (!certain + && ((GetBattlerAbility(gActiveBattler) == ABILITY_KEEN_EYE && statId == STAT_ACC) + || (GetBattlerAbility(gActiveBattler) == ABILITY_HYPER_CUTTER && statId == STAT_ATK))) { if (flags == STAT_BUFF_ALLOW_PTR) { @@ -9471,17 +9501,14 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr } return STAT_CHANGE_DIDNT_WORK; } - else if (GetBattlerAbility(gActiveBattler) == ABILITY_HYPER_CUTTER - && !certain && statId == STAT_ATK) + else if (GetBattlerAbility(gActiveBattler) == ABILITY_MIRROR_ARMOR && !affectsUser && gBattlerAttacker != gBattlerTarget && gActiveBattler == gBattlerTarget) { if (flags == STAT_BUFF_ALLOW_PTR) { BattleScriptPush(BS_ptr); gBattleScripting.battler = gActiveBattler; gBattlerAbility = gActiveBattler; - gBattlescriptCurrInstr = BattleScript_AbilityNoSpecificStatLoss; - gLastUsedAbility = GetBattlerAbility(gActiveBattler); - RecordAbilityBattle(gActiveBattler, gLastUsedAbility); + gBattlescriptCurrInstr = BattleScript_MirrorArmorReflect; } return STAT_CHANGE_DIDNT_WORK; } diff --git a/src/battle_util.c b/src/battle_util.c index 68e787698..37cc17644 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -4835,15 +4835,16 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move case ABILITY_TANGLING_HAIR: if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && gBattleMons[gBattlerAttacker].hp != 0 - && CompareStat(gBattlerAttacker, STAT_SPEED, MIN_STAT_STAGE, CMP_GREATER_THAN) + && (CompareStat(gBattlerAttacker, STAT_SPEED, MIN_STAT_STAGE, CMP_GREATER_THAN) || GetBattlerAbility(gBattlerAttacker) == ABILITY_MIRROR_ARMOR) && !gProtectStructs[gBattlerAttacker].confusionSelfDmg && TARGET_TURN_DAMAGED && IsMoveMakingContact(move, gBattlerAttacker)) { - gBattleScripting.moveEffect = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_SPD_MINUS_1; + SET_STATCHANGER(STAT_SPEED, 1, TRUE); + gBattleScripting.moveEffect = MOVE_EFFECT_SPD_MINUS_1; PREPARE_ABILITY_BUFFER(gBattleTextBuff1, gLastUsedAbility); BattleScriptPushCursor(); - gBattlescriptCurrInstr = BattleScript_AbilityStatusEffect; + gBattlescriptCurrInstr = BattleScript_GooeyActivates; gHitMarker |= HITMARKER_IGNORE_SAFEGUARD; effect++; } From f9272a89fa3fade69f26a37462cc2fe93e9abc15 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Tue, 12 Oct 2021 21:09:27 -0400 Subject: [PATCH 12/72] add mirror armor check to two-stage stat decrease effects --- src/battle_script_commands.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 9c0b4ec37..253f87c1c 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3016,9 +3016,7 @@ void SetMoveEffect(bool32 primary, u32 certain) case MOVE_EFFECT_EVS_MINUS_1: flags = affectsUser | certain; if (mirrorArmorReflected && !affectsUser) - { flags |= STAT_BUFF_ALLOW_PTR; - } if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(1) | STAT_BUFF_NEGATIVE, gBattleScripting.moveEffect - MOVE_EFFECT_ATK_MINUS_1 + 1, @@ -3063,11 +3061,15 @@ void SetMoveEffect(bool32 primary, u32 certain) case MOVE_EFFECT_SP_DEF_MINUS_2: case MOVE_EFFECT_ACC_MINUS_2: case MOVE_EFFECT_EVS_MINUS_2: + flags = affectsUser | certain; + if (mirrorArmorReflected && !affectsUser) + flags |= STAT_BUFF_ALLOW_PTR; if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(2) | STAT_BUFF_NEGATIVE, gBattleScripting.moveEffect - MOVE_EFFECT_ATK_MINUS_2 + 1, - affectsUser, 0)) + flags, gBattlescriptCurrInstr + 1)) { - gBattlescriptCurrInstr++; + if (!mirrorArmorReflected) + gBattlescriptCurrInstr++; } else { From d64dc2bbe890f210d653fede84151bd37ca1bc98 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sun, 24 Oct 2021 17:55:37 +1300 Subject: [PATCH 13/72] Sleep moves don't check target's type Dark types aren't immune to Hypnosis, Ghost types aren't immune to Yawn or Lovely Kiss, so this check isn't needed. --- src/battle_ai_util.c | 1 - 1 file changed, 1 deletion(-) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index fef6e6c6f..0c3bf717a 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -2606,7 +2606,6 @@ bool32 AI_CanSleep(u8 battler, u16 ability) bool32 AI_CanPutToSleep(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 partnerMove) { if (!AI_CanSleep(battlerDef, defAbility) - || AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0 || DoesSubstituteBlockMove(battlerAtk, battlerDef, move) || PartnerMoveEffectIsStatusSameTarget(BATTLE_PARTNER(battlerAtk), battlerDef, partnerMove)) // shouldn't try to sleep mon that partner is trying to make sleep return FALSE; From bbe2eccf62c210926739a324d4d001dd1e7bbcda Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sun, 24 Oct 2021 17:57:06 +1300 Subject: [PATCH 14/72] Fix typo CanBeParayzed to CanBeParalyzed --- src/battle_ai_util.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 0c3bf717a..dc2be7fd5 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -2653,7 +2653,7 @@ bool32 AI_CanPoison(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 return TRUE; } -static bool32 CanBeParayzed(u8 battler, u16 ability) +static bool32 CanBeParalyzed(u8 battler, u16 ability) { if (ability == ABILITY_LIMBER || IS_BATTLER_OF_TYPE(battler, TYPE_ELECTRIC) @@ -2665,7 +2665,7 @@ static bool32 CanBeParayzed(u8 battler, u16 ability) bool32 AI_CanParalyze(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 partnerMove) { - if (!CanBeParayzed(battlerDef, defAbility) + if (!CanBeParalyzed(battlerDef, defAbility) || AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0 || gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_SAFEGUARD || DoesSubstituteBlockMove(battlerAtk, battlerDef, move) From 4310868bee6d4ddb0f8a238ef1d003896a79b7d7 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sun, 24 Oct 2021 18:49:17 +1300 Subject: [PATCH 15/72] AI handles multi-strike and fixed dmg moves Does not account for Parental Bond or Beat Up yet as those require some functions from #1676. --- include/battle_util.h | 5 ++- src/battle_ai_util.c | 90 +++++++++++++++++++++++++++++++++++++++---- src/battle_util.c | 26 +++++++++++++ 3 files changed, 113 insertions(+), 8 deletions(-) diff --git a/include/battle_util.h b/include/battle_util.h index ee7337ef2..5ffc901c3 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -156,7 +156,7 @@ void BufferStatChange(u8 battlerId, u8 statId, u8 stringId); void DoBurmyFormChange(u32 monId); bool32 BlocksPrankster(u16 move, u8 battlerPrankster, u8 battlerDef, bool32 checkTarget); -// ability checks +// Ability checks bool32 IsRolePlayBannedAbilityAtk(u16 ability); bool32 IsRolePlayBannedAbility(u16 ability); bool32 IsSkillSwapBannedAbility(u16 ability); @@ -173,4 +173,7 @@ bool32 CanBeFrozen(u8 battlerId); bool32 CanBeConfused(u8 battlerId); bool32 IsBattlerTerrainAffected(u8 battlerId, u32 terrainFlag); +// Move checks +bool8 IsTwoStrikesMove(u16 move); + #endif // GUARD_BATTLE_UTIL_H diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index dc2be7fd5..cf9980ee4 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -733,20 +733,85 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef) else dmg = (critDmg + normalDmg * (critChance - 1)) / critChance; - // handle dynamic move damage + // Handle dynamic move damage switch (gBattleMoves[move].effect) { case EFFECT_LEVEL_DAMAGE: case EFFECT_PSYWAVE: - //psywave's expected damage is equal to the user's level - dmg = gBattleMons[battlerAtk].level; + { + // Psywave's expected damage is equal to the user's level + if (AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0) + dmg = 0; + else if (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND) + dmg = 2 * gBattleMons[battlerAtk].level; + else + dmg = gBattleMons[battlerAtk].level; break; + } case EFFECT_DRAGON_RAGE: - dmg = 40; + { + if (AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0) + dmg = 0; + else if (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND) + dmg = 80; + else + dmg = 40; break; + } case EFFECT_SONICBOOM: - dmg = 20; + { + if (AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0) + dmg = 0; + else if (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND) + dmg = 40; + else + dmg = 20; break; + } + case EFFECT_MULTI_HIT: + { + if (AI_DATA->atkAbility == ABILITY_SKILL_LINK) + dmg *= 5; + else + dmg *= 3; // Average number of hits is three + break; + } + case EFFECT_TRIPLE_KICK: + { + if (AI_DATA->atkAbility == ABILITY_SKILL_LINK) + dmg *= 6; // Skill Link ensures the 2nd and 3rd hits will connect if the first does + else + dmg *= 5; // Triple Kick/Triple Axel's average power is almost 5x its base power + break; + } + case EFFECT_ENDEAVOR: + { + if (AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0) + dmg = 0; + else + // If target has less HP than user, Endeavor does no damage + dmg = max(0, gBattleMons[battlerDef].hp - gBattleMons[battlerAtk].hp); + break; + } + case EFFECT_SUPER_FANG: + { + if (AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0) + dmg = 0; + // Two hits of Super Fang halves HP twice, leaving target with 25% HP + else if (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND) + dmg = gBattleMons[battlerDef].hp * 3 / 4; + else + dmg = gBattleMons[battlerDef].hp / 2; + break; + } + case EFFECT_FINAL_GAMBIT: + { + if (AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0) + dmg = 0; + else + dmg = gBattleMons[battlerAtk].hp; + break; + } //case EFFECT_METAL_BURST: //case EFFECT_COUNTER: default: @@ -755,6 +820,17 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef) break; } + // Handle other multi-strike moves + if (IsTwoStrikesMove(move)) + { + dmg *= 2; + } + else if (move == MOVE_SURGING_STRIKES + || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH)) + { + dmg *= 3; + } + RestoreBattlerData(battlerAtk); RestoreBattlerData(battlerDef); @@ -2653,7 +2729,7 @@ bool32 AI_CanPoison(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 return TRUE; } -static bool32 CanBeParalyzed(u8 battler, u16 ability) +static bool32 AI_CanBeParalyzed(u8 battler, u16 ability) { if (ability == ABILITY_LIMBER || IS_BATTLER_OF_TYPE(battler, TYPE_ELECTRIC) @@ -2665,7 +2741,7 @@ static bool32 CanBeParalyzed(u8 battler, u16 ability) bool32 AI_CanParalyze(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 partnerMove) { - if (!CanBeParalyzed(battlerDef, defAbility) + if (!AI_CanBeParalyzed(battlerDef, defAbility) || AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0 || gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_SAFEGUARD || DoesSubstituteBlockMove(battlerAtk, battlerDef, move) diff --git a/src/battle_util.c b/src/battle_util.c index 33dd0f5de..cc9e2fc16 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -217,6 +217,20 @@ static const u16 sEntrainmentTargetSimpleBeamBannedAbilities[] = ABILITY_GULP_MISSILE, }; +static const u16 sTwoStrikeMoves[] = +{ + MOVE_BONEMERANG, + MOVE_DOUBLE_HIT, + MOVE_DOUBLE_IRON_BASH, + MOVE_DOUBLE_KICK, + MOVE_DRAGON_DARTS, + MOVE_DUAL_CHOP, + MOVE_DUAL_WINGBEAT, + MOVE_GEAR_GRIND, + MOVE_TWINEEDLE, + 0xFFFF +}; + bool32 IsAffectedByFollowMe(u32 battlerAtk, u32 defSide, u32 move) { u32 ability = GetBattlerAbility(battlerAtk); @@ -9509,3 +9523,15 @@ bool32 BlocksPrankster(u16 move, u8 battlerPrankster, u8 battlerDef, bool32 chec #endif return FALSE; } + +bool8 IsTwoStrikesMove(u16 move) +{ + u32 i; + + for (i = 0; i < ARRAY_COUNT(sTwoStrikeMoves); i++) + { + if (move == sTwoStrikeMoves[i]) + return TRUE; + } + return FALSE; +} From 4faa0776415f31b371bc44311799d1b758a8585c Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Tue, 26 Oct 2021 13:41:08 +1300 Subject: [PATCH 16/72] Triple Kick, Super Fang tweaks Ignore accuracy for Triple Kick and assume all hits will connect. Super Fang always does at least 1 damage, so this should be accounted for. --- src/battle_ai_util.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index cf9980ee4..3535e800c 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -778,10 +778,7 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef) } case EFFECT_TRIPLE_KICK: { - if (AI_DATA->atkAbility == ABILITY_SKILL_LINK) - dmg *= 6; // Skill Link ensures the 2nd and 3rd hits will connect if the first does - else - dmg *= 5; // Triple Kick/Triple Axel's average power is almost 5x its base power + dmg *= 6; break; } case EFFECT_ENDEAVOR: @@ -799,9 +796,9 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef) dmg = 0; // Two hits of Super Fang halves HP twice, leaving target with 25% HP else if (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND) - dmg = gBattleMons[battlerDef].hp * 3 / 4; + dmg = max(1, gBattleMons[battlerDef].hp * 3 / 4); else - dmg = gBattleMons[battlerDef].hp / 2; + dmg = max(1, gBattleMons[battlerDef].hp / 2); break; } case EFFECT_FINAL_GAMBIT: From d5b5090d521522abe6d7d377b1475ebdee68dcc3 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Wed, 27 Oct 2021 09:36:00 -0300 Subject: [PATCH 17/72] Fixed BattleScript_EffectPhotonGeyser --- data/battle_scripts_1.s | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 447c329e0..c6ae2e848 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -399,7 +399,28 @@ BattleScript_EffectShellSideArm: goto BattleScript_EffectHit BattleScript_EffectPhotonGeyser: + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + ppreduce + critcalc + damagecalc + adjustdamage photongeysercheck + attackanimation + waitanimation + effectivenesssound + hitanimation BS_TARGET + waitstate + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + critmessage + waitmessage B_WAIT_TIME_LONG + resultmessage + waitmessage B_WAIT_TIME_LONG + seteffectwithchance + tryfaintmon BS_TARGET, FALSE, NULL + goto BattleScript_MoveEnd BattleScript_EffectPlasmaFists: attackcanceler From ad95fa3d15abfe3080e00beab69225c2bc288bf7 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Wed, 27 Oct 2021 10:03:27 -0300 Subject: [PATCH 18/72] Updated Shell Side Arm's description --- src/data/text/move_descriptions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/text/move_descriptions.h b/src/data/text/move_descriptions.h index e204fb196..037261e32 100644 --- a/src/data/text/move_descriptions.h +++ b/src/data/text/move_descriptions.h @@ -2839,7 +2839,7 @@ static const u8 sMETEOR_BEAMDescription[] = _( "Sp. Attack before attacking."); static const u8 sSHELL_SIDE_ARMDescription[] = _( - "Uses higher of physical and\n" + "Deals better of physical and\n" "special damage. May poison."); static const u8 sMISTY_EXPLOSIONDescription[] = _( From de157919b060e70cb430050b176ef487c28b0753 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Wed, 27 Oct 2021 11:05:01 -0300 Subject: [PATCH 19/72] Added animations for Shell Side Arm --- data/battle_anim_scripts.s | 45 +++++++++++++++++++++++++++++++++++++- src/battle_anim_new.c | 9 ++++++++ 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 994bc5cc1..30a4ccc61 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -13995,7 +13995,50 @@ Move_METEOR_BEAM:: end @to do: Move_SHELL_SIDE_ARM:: - end @to do: + launchtask AnimTask_ShellSideArm 0x5 0x0 + jumpargeq 0x0, TRUE, Move_SHELL_SIDE_ARM_PHYSICAL + jumpargeq 0x0, FALSE, Move_SHELL_SIDE_ARM_SPECIAL +Move_SHELL_SIDE_ARM_PHYSICAL: @ Modified Body Slam, placeholder + loadspritegfx ANIM_TAG_IMPACT + createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_IMPACT, 0, 6, 6, RGB_MAGENTA + monbg ANIM_DEF_PARTNER + setalpha 12, 8 + playsewithpan SE_M_TAKE_DOWN, SOUND_PAN_ATTACKER + createsprite gVerticalDipSpriteTemplate, ANIM_ATTACKER, 2, 6, 1, ANIM_ATTACKER + waitforvisualfinish + delay 11 + createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 0, 26, 0, 0, 5 + delay 6 + createsprite gBasicHitSplatSpriteTemplate, ANIM_ATTACKER, 4, -10, 0, ANIM_TARGET, 0 + loopsewithpan SE_M_MEGA_KICK2, SOUND_PAN_TARGET, 10, 2 + delay 1 + createsprite gSlideMonToOffsetSpriteTemplate, ANIM_ATTACKER, 2, 1, -28, 0, 0, 3 + waitforvisualfinish + createvisualtask AnimTask_ShakeMonInPlace, 2, ANIM_TARGET, 4, 0, 12, 1 + waitforvisualfinish + delay 10 + createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, 0, 0, 6 + delay 5 + createsprite gSlideMonToOriginalPosSpriteTemplate, ANIM_ATTACKER, 2, 1, 0, 6 + waitforvisualfinish + clearmonbg ANIM_DEF_PARTNER + blendoff + end +Move_SHELL_SIDE_ARM_SPECIAL: @ Modified Snipe Shot, placeholder + loadspritegfx ANIM_TAG_IMPACT_2 + loadspritegfx ANIM_TAG_LEER + createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_IMPACT_2, 0, 6, 6, RGB_MAGENTA + createvisualtask AnimTask_BlendParticle, 5, ANIM_TAG_LEER, 0, 6, 6, RGB_MAGENTA + launchtemplate gLeerSpriteTemplate 0x82, 2 0x18 -12 + playsewithpan SE_M_DETECT, SOUND_PAN_ATTACKER + waitforvisualfinish + delay 0x20 + playsewithpan SE_M_GIGA_DRAIN, SOUND_PAN_TARGET + launchtemplate gSnipeShotBallTemplate 0x82, 3, 0 0 24, + waitforvisualfinish + launchtask AnimTask_ShakeMon2 2 5 1 4 0 8, 1 + waitforvisualfinish + end Move_MISTY_EXPLOSION:: end @to do: diff --git a/src/battle_anim_new.c b/src/battle_anim_new.c index d04483e6b..3bc45939f 100644 --- a/src/battle_anim_new.c +++ b/src/battle_anim_new.c @@ -5064,3 +5064,12 @@ void AnimTask_PrimalReversion(u8 taskId) gBattleAnimArgs[0] = 0; DestroyAnimVisualTask(taskId); } + +void AnimTask_ShellSideArm(u8 taskId) +{ + if (gSwapDamageCategory) + gBattleAnimArgs[0] = TRUE; + else + gBattleAnimArgs[0] = FALSE; + DestroyAnimVisualTask(taskId); +} From 8c35a6806014cede7354f0e6c47eb075223ce507 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Wed, 27 Oct 2021 11:19:39 -0300 Subject: [PATCH 20/72] Quick syntax tweaks --- asm/macros/battle_script.inc | 16 ++++++++-------- include/battle.h | 1 - src/battle_util.c | 4 ++-- 3 files changed, 10 insertions(+), 11 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index b838cb6d2..4a8570a1a 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1731,14 +1731,6 @@ .4byte \ptr .endm - .macro photongeysercheck - various BS_ATTACKER, VARIOUS_PHOTON_GEYSER_CHECK - .endm - - .macro shellsidearmcheck - various BS_ATTACKER, VARIOUS_SHELL_SIDE_ARM_CHECK - .endm - .macro trysetfairylock ptr:req various BS_ATTACKER, VARIOUS_TRY_FAIRY_LOCK .4byte \ptr @@ -1866,6 +1858,14 @@ various BS_ATTACKER, VARIOUS_APPLY_PLASMA_FISTS .endm + .macro photongeysercheck + various BS_ATTACKER, VARIOUS_PHOTON_GEYSER_CHECK + .endm + + .macro shellsidearmcheck + various BS_ATTACKER, VARIOUS_SHELL_SIDE_ARM_CHECK + .endm + @ helpful macros .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7 diff --git a/include/battle.h b/include/battle.h index 00b2c2f25..b5dabaded 100644 --- a/include/battle.h +++ b/include/battle.h @@ -918,7 +918,6 @@ extern u8 gBattleControllerData[MAX_BATTLERS_COUNT]; extern bool8 gHasFetchedBall; extern u8 gLastUsedBall; extern u16 gLastThrownBall; - extern bool8 gSwapDamageCategory; // Photon Geyser, Shell Side Arm, Light That Burns the Sky #endif // GUARD_BATTLE_H diff --git a/src/battle_util.c b/src/battle_util.c index f79ce62b2..7797b4751 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -7271,7 +7271,7 @@ bool32 IsMoveMakingContact(u16 move, u8 battlerAtk) { if (!(gBattleMoves[move].flags & FLAG_MAKES_CONTACT)) { - if (gBattleMoves[move].effect == EFFECT_SHELL_SIDE_ARM && gSwapDamageCategory == TRUE) + if (gBattleMoves[move].effect == EFFECT_SHELL_SIDE_ARM && gSwapDamageCategory) return TRUE; else return FALSE; @@ -9077,7 +9077,7 @@ bool8 ShouldGetStatBadgeBoost(u16 badgeFlag, u8 battlerId) u8 GetBattleMoveSplit(u32 moveId) { - if (gSwapDamageCategory == TRUE) // Photon Geyser, Shell Side Arm, Light That Burns the Sky + if (gSwapDamageCategory) // Photon Geyser, Shell Side Arm, Light That Burns the Sky return SPLIT_PHYSICAL; else if (IS_MOVE_STATUS(moveId) || B_PHYSICAL_SPECIAL_SPLIT >= GEN_4) return gBattleMoves[moveId].split; From 52054e4bfefde6572fa19a74240a9187d4147b64 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 30 Oct 2021 21:12:18 +1300 Subject: [PATCH 21/72] Fix Corrosion, Poison Touch - CanBePoisoned now calls CanPoisonType instead of overriding it. Poison Touch now activates only if the attacker actually damaged the target. Partially implemented Pastel Veil. --- include/battle_util.h | 2 +- src/battle_ai_util.c | 2 +- src/battle_script_commands.c | 14 ++++---------- src/battle_util.c | 24 +++++++++++++----------- 4 files changed, 19 insertions(+), 23 deletions(-) diff --git a/include/battle_util.h b/include/battle_util.h index d98c511e2..6caa939b9 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -167,7 +167,7 @@ bool32 IsEntrainmentBannedAbilityAttacker(u16 ability); bool32 IsEntrainmentTargetOrSimpleBeamBannedAbility(u16 ability); bool32 CanSleep(u8 battlerId); -bool32 CanBePoisoned(u8 battlerId); +bool32 CanBePoisoned(u8 gBattlerAttacker, u8 battlerTarget); bool32 CanBeBurned(u8 battlerId); bool32 CanBeParalyzed(u8 battlerId); bool32 CanBeFrozen(u8 battlerId); diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index fef6e6c6f..9640df2b4 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -2616,7 +2616,7 @@ bool32 AI_CanPutToSleep(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, bool32 AI_CanBePoisoned(u8 battler, u16 ability) { if (ability == ABILITY_IMMUNITY - || ability == ABILITY_PASTEL_VEIL + || IsAbilityOnSide(battler, ABILITY_PASTEL_VEIL) || gBattleMons[battler].status1 & STATUS1_ANY || IsAbilityStatusProtected(battler) || gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_SAFEGUARD) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index c5c922d8e..49cc8540e 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2682,9 +2682,7 @@ void SetMoveEffect(bool32 primary, u32 certain) gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_STATUS_HAD_NO_EFFECT; RESET_RETURN } - if (!CanPoisonType(gBattleScripting.battler, gEffectBattler)) - break; - if (!CanBePoisoned(gEffectBattler)) + if (!CanBePoisoned(gBattleScripting.battler, gEffectBattler)) break; statusChanged = TRUE; @@ -2809,11 +2807,8 @@ void SetMoveEffect(bool32 primary, u32 certain) } if (gBattleMons[gEffectBattler].status1) break; - if (CanPoisonType(gBattleScripting.battler, gEffectBattler)) + if (CanBePoisoned(gBattleScripting.battler, gEffectBattler)) { - if (!CanBePoisoned(gEffectBattler)) - break; - // It's redundant, because at this point we know the status1 value is 0. gBattleMons[gEffectBattler].status1 &= ~(STATUS1_TOXIC_POISON); gBattleMons[gEffectBattler].status1 &= ~(STATUS1_POISON); @@ -7257,9 +7252,8 @@ static void HandleTerrainMove(u32 moveEffect) bool32 CanPoisonType(u8 battlerAttacker, u8 battlerTarget) { - return (GetBattlerAbility(battlerAttacker) == ABILITY_CORROSION - || !(IS_BATTLER_OF_TYPE(battlerTarget, TYPE_POISON) - || IS_BATTLER_OF_TYPE(battlerTarget, TYPE_STEEL))); + return ((GetBattlerAbility(battlerAttacker) == ABILITY_CORROSION && gBattleMoves[gCurrentMove].split == SPLIT_STATUS) + || !(IS_BATTLER_OF_TYPE(battlerTarget, TYPE_POISON) || IS_BATTLER_OF_TYPE(battlerTarget, TYPE_STEEL))); } bool32 CanParalyzeType(u8 battlerAttacker, u8 battlerTarget) diff --git a/src/battle_util.c b/src/battle_util.c index fe957e464..5dbe42227 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -4961,7 +4961,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move && gBattleMons[gBattlerAttacker].hp != 0 && !gProtectStructs[gBattlerAttacker].confusionSelfDmg && TARGET_TURN_DAMAGED - && CanBePoisoned(gBattlerAttacker) + && CanBePoisoned(gBattlerAttacker, gBattlerTarget) && IsMoveMakingContact(move, gBattlerAttacker) && (Random() % 3) == 0) { @@ -5148,8 +5148,9 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && gBattleMons[gBattlerTarget].hp != 0 && !gProtectStructs[gBattlerTarget].confusionSelfDmg - && CanBePoisoned(gBattlerTarget) + && CanBePoisoned(gBattlerAttacker, gBattlerTarget) && IsMoveMakingContact(move, gBattlerAttacker) + && TARGET_TURN_DAMAGED // Need to actually hit the target && (Random() % 3) == 0) { gBattleScripting.moveEffect = MOVE_EFFECT_POISON; @@ -5589,18 +5590,19 @@ bool32 CanSleep(u8 battlerId) return TRUE; } -bool32 CanBePoisoned(u8 battlerId) +bool32 CanBePoisoned(u8 battlerAttacker, u8 battlerTarget) { - u16 ability = GetBattlerAbility(battlerId); - if (IS_BATTLER_OF_TYPE(battlerId, TYPE_POISON) - || IS_BATTLER_OF_TYPE(battlerId, TYPE_STEEL) - || gSideStatuses[GetBattlerSide(battlerId)] & SIDE_STATUS_SAFEGUARD - || gBattleMons[battlerId].status1 & STATUS1_ANY + u16 ability = GetBattlerAbility(battlerTarget); + + if (!(CanPoisonType(battlerAttacker, battlerTarget)) + || gSideStatuses[GetBattlerSide(battlerTarget)] & SIDE_STATUS_SAFEGUARD + || gBattleMons[battlerTarget].status1 & STATUS1_ANY || ability == ABILITY_IMMUNITY || ability == ABILITY_COMATOSE - || gBattleMons[battlerId].status1 & STATUS1_ANY - || IsAbilityStatusProtected(battlerId) - || IsBattlerTerrainAffected(battlerId, STATUS_FIELD_MISTY_TERRAIN)) + || IsAbilityOnSide(battlerTarget, ABILITY_PASTEL_VEIL) + || gBattleMons[battlerTarget].status1 & STATUS1_ANY + || IsAbilityStatusProtected(battlerTarget) + || IsBattlerTerrainAffected(battlerTarget, STATUS_FIELD_MISTY_TERRAIN)) return FALSE; return TRUE; } From a461823cbf557706e5a8767e2b4f3279532e7300 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sat, 30 Oct 2021 09:48:23 -0400 Subject: [PATCH 22/72] weather ball anim checks utility umbrella --- src/battle_anim_effects_3.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/battle_anim_effects_3.c b/src/battle_anim_effects_3.c index 11e350535..6ec577388 100755 --- a/src/battle_anim_effects_3.c +++ b/src/battle_anim_effects_3.c @@ -22,6 +22,7 @@ #include "constants/rgb.h" #include "constants/songs.h" #include "constants/weather.h" +#include "constants/hold_effects.h" extern const struct SpriteTemplate gThoughtBubbleSpriteTemplate; @@ -5526,10 +5527,12 @@ static void AnimRecycle_Step(struct Sprite *sprite) void AnimTask_GetWeather(u8 taskId) { + bool32 utilityUmbrellaAffected = GetBattlerHoldEffect(gBattleAnimAttacker, TRUE) == HOLD_EFFECT_UTILITY_UMBRELLA; + gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_NONE; - if (gWeatherMoveAnim & WEATHER_SUN_ANY) + if (gWeatherMoveAnim & WEATHER_SUN_ANY && !utilityUmbrellaAffected) gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_SUN; - else if (gWeatherMoveAnim & WEATHER_RAIN_ANY) + else if (gWeatherMoveAnim & WEATHER_RAIN_ANY && !utilityUmbrellaAffected) gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_RAIN; else if (gWeatherMoveAnim & WEATHER_SANDSTORM_ANY) gBattleAnimArgs[ARG_RET_ID] = ANIM_WEATHER_SANDSTORM; From 468ee66cd877b175244eb204a1b5cd24cd379d78 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sat, 30 Oct 2021 11:04:50 -0400 Subject: [PATCH 23/72] fix synthesis and leaf guard w utility umbrella --- asm/macros/battle_script.inc | 7 +++---- data/battle_scripts_1.s | 12 ++++++------ include/constants/battle_script_commands.h | 1 + src/battle_script_commands.c | 10 ++++++++-- 4 files changed, 18 insertions(+), 12 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 3de14f586..7e35f6ab2 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1989,10 +1989,9 @@ goto \jumpptr .endm - .macro jumpifleafguard jumpptr:req - jumpifhalfword CMP_NO_COMMON_BITS, gBattleWeather, WEATHER_SUN_ANY, 1f - jumpifability BS_TARGET, ABILITY_LEAF_GUARD, \jumpptr - 1: + .macro jumpifleafguardprotected battler:req, jumpptr:req + various \battler, VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED + .4byte \jumpptr .endm .macro jumpifsafeguard jumpptr:req diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 180c74eed..c050fb4be 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -2512,7 +2512,7 @@ BattleScript_EffectSleep:: jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects jumpifflowerveil BattleScript_FlowerVeilProtects jumpifability BS_TARGET_SIDE, ABILITY_SWEET_VEIL, BattleScript_SweetVeilProtects - jumpifleafguard BattleScript_LeafGuardProtects + jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed jumpifterrainaffected BS_TARGET, STATUS_FIELD_ELECTRIC_TERRAIN, BattleScript_ElectricTerrainPrevents @@ -3054,7 +3054,7 @@ BattleScript_EffectToxic:: jumpifability BS_TARGET, ABILITY_IMMUNITY, BattleScript_ImmunityProtected jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects jumpifflowerveil BattleScript_FlowerVeilProtects - jumpifleafguard BattleScript_LeafGuardProtects + jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifsubstituteblocks BattleScript_ButItFailed jumpifstatus BS_TARGET, STATUS1_POISON | STATUS1_TOXIC_POISON, BattleScript_AlreadyPoisoned @@ -3409,7 +3409,7 @@ BattleScript_EffectPoison:: jumpifability BS_TARGET, ABILITY_IMMUNITY, BattleScript_ImmunityProtected jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects jumpifflowerveil BattleScript_FlowerVeilProtects - jumpifleafguard BattleScript_LeafGuardProtects + jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifsubstituteblocks BattleScript_ButItFailed jumpifstatus BS_TARGET, STATUS1_POISON, BattleScript_AlreadyPoisoned @@ -3434,7 +3434,7 @@ BattleScript_EffectParalyze: jumpifability BS_TARGET, ABILITY_LIMBER, BattleScript_LimberProtected jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects jumpifflowerveil BattleScript_FlowerVeilProtects - jumpifleafguard BattleScript_LeafGuardProtects + jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifsubstituteblocks BattleScript_ButItFailed .if B_GLARE_GHOST >= GEN_4 @@ -4874,7 +4874,7 @@ BattleScript_EffectWillOWisp:: jumpifability BS_TARGET, ABILITY_WATER_BUBBLE, BattleScript_WaterVeilPrevents jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects jumpifflowerveil BattleScript_FlowerVeilProtects - jumpifleafguard BattleScript_LeafGuardProtects + jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_ButItFailed jumpifterrainaffected BS_TARGET, STATUS_FIELD_MISTY_TERRAIN, BattleScript_MistyTerrainPrevents @@ -5152,7 +5152,7 @@ BattleScript_EffectYawn:: jumpifability BS_TARGET, ABILITY_INSOMNIA, BattleScript_PrintBankAbilityMadeIneffective jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_PrintBankAbilityMadeIneffective jumpifflowerveil BattleScript_FlowerVeilProtects - jumpifleafguard BattleScript_LeafGuardProtects + jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects jumpifsubstituteblocks BattleScript_ButItFailed jumpifsafeguard BattleScript_SafeguardProtected diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 74c2a3f59..18ae63179 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -195,6 +195,7 @@ #define VARIOUS_APPLY_PLASMA_FISTS 122 #define VARIOUS_JUMP_IF_SPECIES 123 #define VARIOUS_JUMP_IF_WEATHER_AFFECTED 124 +#define VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED 125 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index dbcd3ad95..44ae0e33e 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8990,6 +8990,12 @@ static void Cmd_various(void) else gBattlescriptCurrInstr += 9; return; + case VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED: + if (IsLeafGuardProtected(gActiveBattler)) + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 5); + else + gBattlescriptCurrInstr += 7; + return; } gBattlescriptCurrInstr += 3; @@ -11514,9 +11520,9 @@ static void Cmd_recoverbasedonsunlight(void) } else { - if (!(gBattleWeather & WEATHER_ANY) || !WEATHER_HAS_EFFECT) + if (!(gBattleWeather & WEATHER_ANY) || !WEATHER_HAS_EFFECT || GetBattlerHoldEffect(gBattlerAttacker, TRUE) == HOLD_EFFECT_UTILITY_UMBRELLA) gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2; - else if (IsBattlerWeatherAffected(gBattlerAttacker, WEATHER_SUN_ANY)) + else if (gBattleWeather & WEATHER_SUN_ANY) gBattleMoveDamage = 20 * gBattleMons[gBattlerAttacker].maxHP / 30; else // not sunny weather gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4; From dfb92fa74e4c13021f0764fa3b09d0ff3ca06a7d Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Sun, 31 Oct 2021 11:12:17 -0400 Subject: [PATCH 24/72] fix VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED --- src/battle_script_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 44ae0e33e..ee46c4c35 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8992,7 +8992,7 @@ static void Cmd_various(void) return; case VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED: if (IsLeafGuardProtected(gActiveBattler)) - gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 5); + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); else gBattlescriptCurrInstr += 7; return; From e59d0dd5cfdb63457d4f89bbc385a1785c911115 Mon Sep 17 00:00:00 2001 From: Blackforest92 Date: Sun, 31 Oct 2021 22:58:43 +0700 Subject: [PATCH 25/72] clean Spacial Rend background --- .../backgrounds/new/spacial_rend.pal | 19 ++++++++++++++++++ .../backgrounds/new/spacial_rend.png | Bin 0 -> 6531 bytes .../backgrounds/new/spacial_rend_opponent.bin | Bin 896 -> 896 bytes .../backgrounds/new/spacial_rend_opponent.pal | 19 ------------------ .../backgrounds/new/spacial_rend_opponent.png | Bin 5861 -> 0 bytes .../backgrounds/new/spacial_rend_player.bin | Bin 896 -> 896 bytes .../backgrounds/new/spacial_rend_player.pal | 19 ------------------ .../backgrounds/new/spacial_rend_player.png | Bin 6948 -> 0 bytes .../backgrounds/spacial_rend_opponent.bin | Bin 896 -> 0 bytes .../backgrounds/spacial_rend_opponent.pal | 19 ------------------ .../backgrounds/spacial_rend_opponent.png | Bin 5861 -> 0 bytes .../backgrounds/spacial_rend_player.bin | Bin 896 -> 0 bytes .../backgrounds/spacial_rend_player.pal | 19 ------------------ .../backgrounds/spacial_rend_player.png | Bin 6948 -> 0 bytes include/graphics.h | 6 ++---- src/battle_anim.c | 4 ++-- src/graphics.c | 11 ++++------ 17 files changed, 27 insertions(+), 89 deletions(-) create mode 100644 graphics/battle_anims/backgrounds/new/spacial_rend.pal create mode 100644 graphics/battle_anims/backgrounds/new/spacial_rend.png delete mode 100644 graphics/battle_anims/backgrounds/new/spacial_rend_opponent.pal delete mode 100644 graphics/battle_anims/backgrounds/new/spacial_rend_opponent.png delete mode 100644 graphics/battle_anims/backgrounds/new/spacial_rend_player.pal delete mode 100644 graphics/battle_anims/backgrounds/new/spacial_rend_player.png delete mode 100644 graphics/battle_anims/backgrounds/spacial_rend_opponent.bin delete mode 100644 graphics/battle_anims/backgrounds/spacial_rend_opponent.pal delete mode 100644 graphics/battle_anims/backgrounds/spacial_rend_opponent.png delete mode 100644 graphics/battle_anims/backgrounds/spacial_rend_player.bin delete mode 100644 graphics/battle_anims/backgrounds/spacial_rend_player.pal delete mode 100644 graphics/battle_anims/backgrounds/spacial_rend_player.png diff --git a/graphics/battle_anims/backgrounds/new/spacial_rend.pal b/graphics/battle_anims/backgrounds/new/spacial_rend.pal new file mode 100644 index 000000000..afc2b31fc --- /dev/null +++ b/graphics/battle_anims/backgrounds/new/spacial_rend.pal @@ -0,0 +1,19 @@ +JASC-PAL +0100 +16 +0 0 0 +208 112 200 +216 184 249 +216 160 232 +211 107 195 +208 104 192 +217 129 209 +216 135 215 +209 120 208 +218 153 226 +216 168 232 +217 176 241 +220 188 252 +203 115 203 +223 182 246 +216 192 248 diff --git a/graphics/battle_anims/backgrounds/new/spacial_rend.png b/graphics/battle_anims/backgrounds/new/spacial_rend.png new file mode 100644 index 0000000000000000000000000000000000000000..ea98198c4c0ad4c8f5aa27d39fc9937aeeeacad1 GIT binary patch literal 6531 zcmV-}8GPo6P)nc~=}=-IIG+`RnDbIaeh_SnGq7nS)700009 za7bBm000ie000ie0hKEb8vp>56*T{ci#_BF3pTh#EXcx9vfa7O;hY4Ro|+yYGcwSD%L_URZ&6PY;d(m z%MYt1h{)QAbXVdRBJIAi710iQX@jlacg`JuCCNw_Jih1L^W}5S`P?xa2NyLjgS|{$ z=V|LYuu5q;`htgsJ>!gDy45X<&Ak&ZOXSR za2N4)A{Lk*Z+_e@NrZ%Oc|)g%y8VS2`V0kzdjWr)jTfS;&CO0oa9wP3X>QS2DYnTs z6u7QY!*o5PMq1W7&w>04ZOgkSJ$!kIKBb^1)ATy6ceTPbYn7z4t+(_*8#nm&7}pi_ z*snKNX`#X9hpvcK3SDb0Hb%QVr%`JPHf(`#b1YpmiSH$J>2RH zed3{uv>s=}!z71H2g0zuVI@R*AKo4x=XulpYL1Y}x*m?dMjx*lmub~QTiKtxj;}d_ zp?NG3s{|Vu(SF`_lYQ z`qi}WH(-YI0{vl?x={gxlvAC?zb7Oqv`XoIIOdO-cDwwA)w=wX5O?PYeKkIHfxdiw z?gBlwYM}RS7OQ23*nO)BrLV$j;;3ogiqL?fagK0vN9bs3^aA~Sy6-0SEjiz&#-f|0 zVmW}nj**aU5Dl@(+GV`$HC7fH!TP;KINyKLh;r^SO{PW{sWLNrnLhC{tQkeNZkE_F zl#fGtG>q@Ny?nWWMR1RBQ)j4_o*1OMdd_2Xm8Nb&IC&Sd6df_9^b9)u2~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iwqGvC3B33R}$@UgRZ~+gjGKo(*hd6Pww>%e=y?yvFOi!JE9r+q}cOyvO@& zWgFYsZrg0DeZUTO@*yAH=YPy6>|!^c@)>*B%jbN-KKAn^UvYqge9bo;;xI=zT9zYr z*p6|WZ~2bz`GFIh`D zzlryF@een+$t`Ykhr9gCe>|Xa@{+g8tAZ-ZN4}~gKlv*_0nXp~xyq`ds;Z{y3RDdR zsiuMzqEOXRZPig-)l+>n5R$^wP$s8F3Ri?873m^exNEE?@+eAS?%w}R6|H89QLN(B zTrCu@mTINeYNG@ts;%0oy^_>H$x2a*OLiUANu8CdE=qJ=)lJ=%rgZgCPxVr7^-*8- zQ-2N6Kn>Dh4be~y({PPYhBB4uGTcawQkJqcS~<$qJ%c>uYmCNfoW^T{CTfxFwuX}0F5*cG`#SE2$}s{a90+wKkk diff --git a/graphics/battle_anims/backgrounds/new/spacial_rend_opponent.pal b/graphics/battle_anims/backgrounds/new/spacial_rend_opponent.pal deleted file mode 100644 index 7f1f61789..000000000 --- a/graphics/battle_anims/backgrounds/new/spacial_rend_opponent.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -255 0 0 -222 156 230 -222 180 246 -213 123 205 -213 189 246 -205 115 205 -213 164 230 -213 131 213 -222 197 255 -222 189 255 -213 139 222 -213 172 238 -213 106 197 -222 131 213 -213 115 205 -205 106 197 diff --git a/graphics/battle_anims/backgrounds/new/spacial_rend_opponent.png b/graphics/battle_anims/backgrounds/new/spacial_rend_opponent.png deleted file mode 100644 index 637b9cf5a93f05f59639b81ff9a52ca6009dc9a0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5861 zcmVb^P)005u_0{{R3dEt5<0000mP)t-s{{R5q zoaWxN_SJjM)xGx3bIsMH=GBAM-o^jkz5msV-qoz`)oR7wgVoh@&CP1X^35>w000(n zNkl4<5C>HrC7bfAnmW<@>cokpv z(B;Ln|2#9^>H8FS`y`1=`OC?a zRq^Er@!wYTa_t}Sz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mjfv_DB9 diff --git a/graphics/battle_anims/backgrounds/new/spacial_rend_player.bin b/graphics/battle_anims/backgrounds/new/spacial_rend_player.bin index 7b479c88d672f56c52b5a2633d6b41aec8cdedca..3b89218e0e6cbba254e78a9f11abe717002cba8a 100644 GIT binary patch literal 896 zcmWN@WnfSR0EJP(KuNpfyW8FN9z0+@n)P5wV@qR8V@qRzG}zME(%912(%7y?V|Sik zC&BTKvmNUg%NRrqvHvHIcoGN*X-*3wTGEQvG^7!YX+l$)QIGm$INfPZb&8Xnp7n7S)S>c%wjfkn9Drovw+8VoF{mar+AuYc$Po-lfU?zfB2Ul_>mP}?qy!; zC0^`BUg(7^Vlhit$}*O-g6DXi7kH7Ec$rstm4<4h#%iLbYNq-+SsT3G>%7)$yxOb0 z(kofTYSyrpb*yItukku>@Fs8ZHt+B*7wZyTs>^h_uF%;!M?1XT+q~6VyxE()(Hq&s zX11`EZER-;@9{n#@F5@ZF`w`$&DBDYTB?;=D@L(8;Qij`z24*9-sPR%$u4%YhrR4$ zKL_}X&-sEc`HHXkhHq)7_UfRH>ZHy}R*LFe>l#GY5pe3znO&i+Mj`nn*Bb|sNo&*v}BAFCY zNh6(*obEKII>pIOa-v0Nx?lpj(v9x)peMaTY;XF|mwsfBNfz1UkV_u<>mwC)*0Sj5gA}{m;&-Xmf^&HRk`CPzaF61IE<`ORDGA`!|u4D;I zLk*U(oE5BO6{}gpTGp}7YrV$nS>+9^@N#ct6Pww>R<7b|uHjm)<9cr3MsDI}ZsAt8 zaT~XD2Y0fa9qjOS-^JbB!@X?tecaCjJjg>l%p*L?V?53iJjqi$%`?Y0c$S^);yHG+ zhrR4$pZ9u?cl&vEd8c3CMPA}%_H%$&c$L?9oi})sw?gdOyu-V^$NPN1hkV4x9OMv( ze9)ipDWCBZ)$)t{&>CUh1tr>Z^XrP^Pk!tsLblFXY@HC&*WS4bVUh(qIkIPz}>? zjnGJq(rAs*SQV&HMJiSmB`Q^!$~8_EsyxnD1{J}0P0&P5(qvU>il%CsrfY_(Rij$f Osa_3gRFh_Emi_~I!0bK% diff --git a/graphics/battle_anims/backgrounds/new/spacial_rend_player.pal b/graphics/battle_anims/backgrounds/new/spacial_rend_player.pal deleted file mode 100644 index 846d3e703..000000000 --- a/graphics/battle_anims/backgrounds/new/spacial_rend_player.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -255 0 0 -213 156 230 -222 180 246 -213 123 205 -213 189 246 -213 131 213 -205 115 205 -213 164 230 -222 197 255 -213 139 222 -222 189 255 -213 172 238 -213 106 197 -213 115 205 -222 156 230 -205 106 197 diff --git a/graphics/battle_anims/backgrounds/new/spacial_rend_player.png b/graphics/battle_anims/backgrounds/new/spacial_rend_player.png deleted file mode 100644 index 993b3d8a69827d2c1e87eb1a0cfc33cfa3c96cb9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6948 zcmV+<8{6cGP)0058#0{{R3eVcu=0000mP)t-s{{R5h zoaWxN_SJjM)xGxBgVoJ*&DEsl-o^jbi{9S7|JAJS)oR7nbIsnI=FMuw#EaV9000`V zNklp4ba0m_Z2Bhjwibd>{eomRrTt;`|dsW-1|zBBpi&fOl26KEaAb&vGn*E_VMjw ze`OzckABNOU%zH^{w;32lZ(e5(=cYV>&whNjDE+ftfuQ{OsWGKOT%={@Jy!Jok(Ju z-RNEUj(xnkwaPxfeaEqiS8%hdsQG?JqasH8LIdF~?)a=L>{US4J|-qHQ%~9TvzZv1 zT;1wq*B{1;?4PC=ox)Ar``A(fIT|zA4n@AmKv0Z34Z1^QezQ>WRD?(9t3 zcoM|9#%;^tw6;4PO+0oLfM=Qpt_Z-0SZsO{W0y01j487-zhgeHoi;2V zXLncQ)Aupp26y<^^iW{kG!u1%$pOy4ZWx$miKqY+0XEF}EA0Bs%s`rb);I94tiNEl zF<_+c7F`Cs1zUba1{R0S)|+*VMVnhs>)#*TH`W}h+h?w@e<=q3$bN9_ zr;OXY?QU*U+<(Tog)ig2?&0?GeHUYV%8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O@*yAH=YPy6>|!^c@)>*B%jbN-KKAn^UvYqge9bo;;xI=zT9zYr z*p6|WZ~2bz`GFIh`D zzlryF@een+$t`Ykhr9gCe>|Xa@{+g8tAZ-ZN4}~gKlv*_0nXp~xyq`ds;Z{y3RDdR zsiuMzqEOXRZPig-)l+>n5R$^wP$s8F3Ri?873m^exNEE?@+eAS?%w}R6|H89QLN(B zTrCu@mTINeYNG@ts;%0oy^_>H$x2a*OLiUANu8CdE=qJ=)lJ=%rgZgCPxVr7^-*8- zQ-2N6Kn>Dh4be~y({PPYhBB4uGTcawQkJqcS~<$qJ%c>uYmCNfoW^T{CTfxFwuX}0F5*cG`#SE2$}s{a90+wKkk diff --git a/graphics/battle_anims/backgrounds/spacial_rend_opponent.pal b/graphics/battle_anims/backgrounds/spacial_rend_opponent.pal deleted file mode 100644 index 7f1f61789..000000000 --- a/graphics/battle_anims/backgrounds/spacial_rend_opponent.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -255 0 0 -222 156 230 -222 180 246 -213 123 205 -213 189 246 -205 115 205 -213 164 230 -213 131 213 -222 197 255 -222 189 255 -213 139 222 -213 172 238 -213 106 197 -222 131 213 -213 115 205 -205 106 197 diff --git a/graphics/battle_anims/backgrounds/spacial_rend_opponent.png b/graphics/battle_anims/backgrounds/spacial_rend_opponent.png deleted file mode 100644 index 637b9cf5a93f05f59639b81ff9a52ca6009dc9a0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5861 zcmVb^P)005u_0{{R3dEt5<0000mP)t-s{{R5q zoaWxN_SJjM)xGx3bIsMH=GBAM-o^jkz5msV-qoz`)oR7wgVoh@&CP1X^35>w000(n zNkl4<5C>HrC7bfAnmW<@>cokpv z(B;Ln|2#9^>H8FS`y`1=`OC?a zRq^Er@!wYTa_t}Szin6BGwHmRP?S)%6)>%Y4MQr(rLS*p-Tbvri}|0iulbvNOvhLZ z4Dn;RJY?pS@Y{Cv>r6VV#g$wv-U^uE!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ki8dMB;P_G7)r! z^p4m0f+MN&5Jg8m_XCa_l~vLciDyNqb$MnKs}&)AH|bTEf0S zjZ5L`xNflf8^2&jJa^{7(Ag}y{R^t}q;4pQGOIKO1d z%D%EAvkQH^WK;GPMwv`A!BMZ9M%V~RyM?3uWnKTSvQB6O&D{d#{=ze}tMC*K816S( z!~I_JS=d2H;=u^Xte*Dvx<%j%-UxkAWcx{$y^`y7 zFS$NQk|ea?HK+g8*7W}%XlSEuT$t1#2n~b zOm(k(uLNtC-{j`>9e_nwYB+% z)cKM&lF(Y1CE-oQ+2$f!Q=>}?ij79sE*HKow3d!31EcbBa~ZI?6*ud(;&xy)T5&>a zaU1^5GxcqS%2#L>3a#b$8t|wD-&{)N!Em#kxwA#u+|CqQ8w5mm#KFzQ-h(z=$zX*& z+Z&;+_6FOdO-xs7t61>w(SSMB+<@7&kxkdmX0|}>N8UzK_Gu%DO>Lyw-fbjm$qUpV z<&7@r-EEC71oz0;QHn}hJf=e%@7L&Zc%zFPOQ066*NVHdqZJqNT5*Y2X~hZDWZrBR zhPF2g&)1uUQp^|I(JYLKyEY32+M4gJotg297&pGJhHD*g?;{4Atzu()t5}0*f`I2A z1yhyL`;O^0TF1hEhak3^*~YeJHo-|mQ^8TCF97X()?9Bix3?$Y5Cu~+(+57rv0FR7 z1@P4lnlv96F!+H1*|%NJz2Z@r-HtSD0e*+WI=daZr~~eGoJiXDIMHs$LcB7|D;{`~ z>Ia^7JGde=AN4!%k*#<4KC&fj9!6Zb-gIL4C5Otay$_WMbd1Bl#Jc>^Z%35}@&+B} z5MJk^gC?^#GyGwbbA#Env5IDEFOtD6iK8q{BM?=qYI=+FnUa zICN;|^#HpOI%3viDLDO8t1|aHI#%>rfOOyqL^Wn)+umHVFaDSgKD`zoKk6r4p+kQF vbRUphQp*g@dHO5200000NkvXXu0mjfv_DB9 diff --git a/graphics/battle_anims/backgrounds/spacial_rend_player.bin b/graphics/battle_anims/backgrounds/spacial_rend_player.bin deleted file mode 100644 index 7b479c88d672f56c52b5a2633d6b41aec8cdedca..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 896 zcmW-eb$FKr0EAtS?sdEe_tCK)-LM`THEKPuTN=eyy3GY5pe3znO&i+Mj`nn*Bb|sNo&*v}BAFCY zNh6(*obEKII>pIOa-v0Nx?lpj(v9x)peMaTY;XF|mwsfBNfz1UkV_u<>mwC)*0Sj5gA}{m;&-Xmf^&HRk`CPzaF61IE<`ORDGA`!|u4D;I zLk*U(oE5BO6{}gpTGp}7YrV$nS>+9^@N#ct6Pww>R<7b|uHjm)<9cr3MsDI}ZsAt8 zaT~XD2Y0fa9qjOS-^JbB!@X?tecaCjJjg>l%p*L?V?53iJjqi$%`?Y0c$S^);yHG+ zhrR4$pZ9u?cl&vEd8c3CMPA}%_H%$&c$L?9oi})sw?gdOyu-V^$NPN1hkV4x9OMv( ze9)ipDWCBZ)$)t{&>CUh1tr>Z^XrP^Pk!tsLblFXY@HC&*WS4bVUh(qIkIPz}>? zjnGJq(rAs*SQV&HMJiSmB`Q^!$~8_EsyxnD1{J}0P0&P5(qvU>il%CsrfY_(Rij$f Osa_3gRFh_Emi_~I!0bK% diff --git a/graphics/battle_anims/backgrounds/spacial_rend_player.pal b/graphics/battle_anims/backgrounds/spacial_rend_player.pal deleted file mode 100644 index 846d3e703..000000000 --- a/graphics/battle_anims/backgrounds/spacial_rend_player.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -255 0 0 -213 156 230 -222 180 246 -213 123 205 -213 189 246 -213 131 213 -205 115 205 -213 164 230 -222 197 255 -213 139 222 -222 189 255 -213 172 238 -213 106 197 -213 115 205 -222 156 230 -205 106 197 diff --git a/graphics/battle_anims/backgrounds/spacial_rend_player.png b/graphics/battle_anims/backgrounds/spacial_rend_player.png deleted file mode 100644 index 993b3d8a69827d2c1e87eb1a0cfc33cfa3c96cb9..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 6948 zcmV+<8{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?YZvB1oo+PLqlGt&&9PLxEu;fyzB4Z7oYnc%6V!eK<_Zpn+kLDIu|& z0bqzuUsBbh#$u2HGa>e&ruYrikBid(1t1YAyXVP?|5)As&z3CHTS4cWR&@r)rv8dfwzqNa*L=L)PjrilwMct^W9?mj^}ay z{|E5@`I29o= Date: Mon, 1 Nov 2021 01:06:39 +0700 Subject: [PATCH 26/72] Optimized Rock Wrecker and Hurricane --- data/battle_anim_scripts.s | 2 +- .../backgrounds/new/high_speed.bin | 2 -- .../backgrounds/new/high_speed.png | Bin 855 -> 0 bytes .../hurricane.bin} | Bin .../new/{high_speed.pal => hurricane.pal} | 0 .../backgrounds/new/hurricane.png | Bin 0 -> 519 bytes .../backgrounds/new/rock_wrecker.bin | 2 -- .../backgrounds/new/rock_wrecker.pal | 32 +++++++++--------- .../backgrounds/new/rock_wrecker.png | Bin 1511 -> 0 bytes .../battle_anims/backgrounds/rock_wrecker.png | Bin 1249 -> 0 bytes include/constants/battle_anim.h | 2 +- include/graphics.h | 10 +++--- src/battle_anim.c | 4 +-- src/graphics.c | 23 +++---------- 14 files changed, 29 insertions(+), 48 deletions(-) delete mode 100644 graphics/battle_anims/backgrounds/new/high_speed.bin delete mode 100644 graphics/battle_anims/backgrounds/new/high_speed.png rename graphics/battle_anims/backgrounds/{rock_wrecker_map.bin => new/hurricane.bin} (100%) rename graphics/battle_anims/backgrounds/new/{high_speed.pal => hurricane.pal} (100%) create mode 100644 graphics/battle_anims/backgrounds/new/hurricane.png delete mode 100644 graphics/battle_anims/backgrounds/new/rock_wrecker.bin delete mode 100644 graphics/battle_anims/backgrounds/new/rock_wrecker.png delete mode 100644 graphics/battle_anims/backgrounds/rock_wrecker.png diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 73aeb9259..03d72f3ea 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -6636,7 +6636,7 @@ Move_HURRICANE: monbg ANIM_DEF_PARTNER monbgprio_28 ANIM_TARGET setalpha 12, 8 - fadetobg BG_HIGH_SPEED + fadetobg BG_HURRICANE waitbgfadeout launchtask AnimTask_StartSlidingBg 0x5 0x4 0x1000 0x0 0x1 0xffff waitbgfadein diff --git a/graphics/battle_anims/backgrounds/new/high_speed.bin b/graphics/battle_anims/backgrounds/new/high_speed.bin deleted file mode 100644 index ca049478c..000000000 --- a/graphics/battle_anims/backgrounds/new/high_speed.bin +++ /dev/null @@ -1,2 +0,0 @@ -                                                                                             -                                                                ! " # $ % & ' ( ) * + , - . / 0 1 2 3 3 3 3 3 3 4 5 6 7 7 8 9 : ; < = > ? @ A A A A B C D E F G D H A A A A A A I J K A A L M N O M M P M M Q Q R S T U V W S S S S S S S S S S S S S X Y Z [ [ [ [ [ [ [ [ \ \ \ \ ] ^ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ \ _ _ _ _ ` a b c _ d d d d e f e d d g h i j k l m n o p q r s t j$u v w x y z w${ | | | | | | } ~  $ } $ (((((( $ $ $ \ No newline at end of file diff --git a/graphics/battle_anims/backgrounds/new/high_speed.png b/graphics/battle_anims/backgrounds/new/high_speed.png deleted file mode 100644 index 08bb2b0de3dd768a622a8a586061d9afb9b879a8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 855 zcmV-d1E~CoP)002k?0{{R3gZAU`0000mP)t-s0002R z|No2L_H)($YR&&*#s6Bg_DZDgL7eU}l;$am<|%X4AcNi@V$C30#VJa(skcN40008w zNklMN6{;~q+ zO!^7CC*?*xU@=3)u({PJ@b?Uz1Ij(Mz_IUVs71gxPZ;}#3B3>PETC$XBH+6x3wa$v zX8~(y?k#`Mr^SAB8=r^>|jLH5O{h1(C|p3;Gjip2CuOe?n|yIzr^Z(0eb!KPa=n`dzLSmVGm-SsCVpVcSL&xq$f)Nn7^zAKI*VkJ>W?T zg|aA5#fc35N0951t}R`A+p(~{Vc5B}2W8aiGWwrP#i?y6+-bVBb!FijuXn*hhwvEn zze60jzr}1dwA*Yx!_9$n{@*RpT^w!!EL|K?6h;GkF^4#e1`fZ}Xy7o87LJz>XDB0e z2h=Yx=oJVhX_D0MF)F%9^D5&aslqg0t81mpx^NeV<`oO|1XU;5fvWC86_vaa+3|EC z7}yu9roO5Ac57TxwM{7N7B~$qwYn*1CV}YQsK%<+i3)&_RkjwTT3bc#^bA)h2y{!m z8Suku6)+S_Q9!rmX4&B(4x@l3Dz9CHLQz2F$B`dUCcu#Enk^B9k1|nY1525JYHO5Q h2%K>npTPec_y?2488ib@x4=6h=47d=eI-vi3x1d{4^D8Z>-y7!6C9a$4=urmhemKX9yXbw z*jct&<^Co0Z7`DgexSDyST%I=dcJsN-24t zQc**A4c$xaax@J<^V#shg6VANq^^0fhM)@-fXp~XdRl7qXF`z~AdN#U;Pti#Gf6hn z=RiL!cx~>vQCDISdJe-am_C7i<=_ ? @ A B C D E F F G H I I J K L M N N N O P P P P P Q R S S S S S T Q U V S W X X Y Z [ \ ] ] ] ] ] ^ _ ` a a b c d e f g g g g g h i i i i j k k l m n o p p p p p q m m m m r s t u v w x y z { { | } ~ ~  ~ ~ ,,,, s,t( m, d,d,d,d,d, d, P,P,P, $ P, 4,4,4,4,4,4, \ No newline at end of file diff --git a/graphics/battle_anims/backgrounds/new/rock_wrecker.pal b/graphics/battle_anims/backgrounds/new/rock_wrecker.pal index f17343c31..198e7f034 100644 --- a/graphics/battle_anims/backgrounds/new/rock_wrecker.pal +++ b/graphics/battle_anims/backgrounds/new/rock_wrecker.pal @@ -1,19 +1,19 @@ JASC-PAL 0100 16 -0 0 0 -255 246 0 -255 238 0 -255 222 0 -255 205 0 -255 189 0 -255 172 0 -255 156 8 -255 139 8 -255 123 8 -255 106 8 -255 90 8 -255 74 8 -255 49 8 -255 41 8 -246 24 0 +96 192 24 +248 248 216 +248 248 176 +248 240 144 +248 232 120 +248 232 112 +248 216 96 +240 200 88 +232 192 72 +232 184 64 +232 176 56 +224 160 32 +216 152 32 +208 136 40 +192 120 40 +176 88 40 diff --git a/graphics/battle_anims/backgrounds/new/rock_wrecker.png b/graphics/battle_anims/backgrounds/new/rock_wrecker.png deleted file mode 100644 index 97cf4b73af4c1d66ced0caa1cf28a539f506a897..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1511 zcmV003wN0{{R3gj(ju0000mP)t-s00030 z_5lCx0RP?q|IGmZy#W8L0RNl_|BDF!dkFt(2>)6L|4In|F$n)D2=*8NZ#0u{000GY zNklvbAO6vw9poC<_ofmykL07?M@lmdXo-yJ{=@NxmbCg0713a}TYfe57m z2~}XB26C*-d*;q#cUk$I z>EGB?sE5_S2C~{r(`#P%u;Y59j|cKK>AnHni)uRXeld`m{+Z!?6DU-8gk9EA3yT7E zNTOUd`4Pa|c*z~VTrLqY`O&U_;JtZ#&SBwJ6QTofF!l7;k}0~wPcG=KAnc$BaCT<_ z@8>M~x>xo)rmaT^L+|Xte-H-jjB&i%X8|?HcC&S`$r~}R2E&=Ck!B&5FHDKPwrjl` zP;wv33AGUoBz(#vS|06EwCdD9K;VOVDZ3SUOvA|U7fWdE6gDo3*HIit%Q$jZp@t-D*aI&xx8_aeUFxgW6%LzM z0<~ob&-6&l6s96T*yA+>zCy~+NFUCA*zMy4uGd^lpr$^g5Nevb)W2Eq;B1LD!z>~V zY|^wyp#y2g1o+zxvdx#kVgj?XIV3>h$ilpFLkFG@anUP*1K^g401kW_9^XbfFo(=G zX<#1%ka;L{zdsh(Z&a9qRtm7|lx0G<*{s!RoOj_1md(Q~V3w5CY`M9nYYScIivg7w zkmYp;kWbffejs%!%dt%g1j(WGiEb}$KX+tFE+Cf!cm?uI9swZns_~w-+HroG6WCDe zOd*w}PS22vSbO84HPXmxj{|>|o2Ab#U^7f@P8T;Z5L=OCDNp-P%$^{QT2hu&)(0dy+p(Uo`^v%lqtw)P6(*$^yzi*^M79eJ{Ukxn$c zSAjr%<8x8Y(y6x<3Di7XeV4|9-&<8F?M=CYeBY}es#4SHAis2~?haf|P)V2e>Vt4Z z{2O_G|2x?8Cm)@_x2*vLD!uK=#r)y~_vQTzYztSU5ckk_u@9)#J)yQ6E<7mgzylAQz@F!#TRdWL0`~nX#$;XpY#VZyQeCn0mz%#fQb>5Xqfg@e$Vh8YXyX-_d zqBkpzu_d7Ij#C{ZjLrn|F6UMz&>f!r@-D^ioYtZblHq9tyjJ1UL=3Rws6A`og} zLvC@a^V!u+kBo}dOy+yFHZ4klp4aDX4hlFqN%ztb94;?v;3W0i;FK^oYw~Df71taKrgSfM$h6(8(2Y5mAcz$>4S__A2;jTL?&v z(SagM%x-ptfHYjM^~u9^vnvK97W#hECL%7XzmKUiQBL{tF^ewGqXX^Gg5# N002ovPDHLkV1iC@&gTFC diff --git a/graphics/battle_anims/backgrounds/rock_wrecker.png b/graphics/battle_anims/backgrounds/rock_wrecker.png deleted file mode 100644 index ca50da7b76be898616327410ffb07c75e5fbd5d6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1249 zcmeAS@N?(olHy`uVBq!ia0vp^4nSA|DI)Syc>J@v}D!U2f;;5(uYEnls5>bt>tc- z_apt{(;3T)1-`f>W;#h}F*^DS=rAo~VX^%prR3`|v0uUH$iH7FW_tVjK36#LW@Fag zGfzE!X*bPVxB0NngVI9=0$;9pyM5SqV9wb_mDwUwjJ7qY+*J9}uW=J$fGx$b>8~F_Q|7-yzszdsevT`AKvLUisrHiuh8&({pNF8P~ds*JMR{r*ZE-eLi6C_sSW)mFFH>?QEK%)!qWa| z->PeZHsx!|g-hgDEx#K0_1yC9#ow2&)mmMm^mL#1-}BF9*;w-W&YB6SWHZlZcjodw z^V-2EoIyv>$8tUM_euW0 Date: Mon, 1 Nov 2021 11:32:13 -0400 Subject: [PATCH 27/72] fix leaf guard ability pop up --- src/battle_script_commands.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index f2311f198..e51b426a0 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8992,9 +8992,14 @@ static void Cmd_various(void) return; case VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED: if (IsLeafGuardProtected(gActiveBattler)) + { + gBattlerAbility = gActiveBattler; gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + } else + { gBattlescriptCurrInstr += 7; + } return; } From c4aa2a1e924c0f1b7a517ac5a13dcfd1e01efd31 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Mon, 1 Nov 2021 21:36:08 -0300 Subject: [PATCH 28/72] Added Gen 8 contest data (minus combos), also fixed Bubble's category --- src/data/contest_moves.h | 522 ++++++++++++++++++++++++++++++++++++++- 1 file changed, 521 insertions(+), 1 deletion(-) diff --git a/src/data/contest_moves.h b/src/data/contest_moves.h index 2e8fd8089..160a05407 100644 --- a/src/data/contest_moves.h +++ b/src/data/contest_moves.h @@ -1158,7 +1158,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] = [MOVE_BUBBLE] = { .effect = CONTEST_EFFECT_STARTLE_PREV_MONS, - .contestCategory = CONTEST_CATEGORY_COOL, + .contestCategory = CONTEST_CATEGORY_CUTE, .comboStarterId = 0, .comboMoves = {COMBO_STARTER_RAIN_DANCE}, }, @@ -5398,6 +5398,526 @@ const struct ContestMove gContestMoves[MOVES_COUNT] = .comboStarterId = 0, .comboMoves = {0} }, + + [MOVE_DYNAMAX_CANNON] = + { + .effect = CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, + .contestCategory = CONTEST_CATEGORY_SMART, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_SNIPE_SHOT] = + { + .effect = CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_JAW_LOCK] = + { + .effect = CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_STUFF_CHEEKS] = + { + .effect = CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, + .contestCategory = CONTEST_CATEGORY_CUTE, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_NO_RETREAT] = + { + .effect = CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_TAR_SHOT] = + { + .effect = CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_MAGIC_POWDER] = + { + .effect = CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_CUTE, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_DRAGON_DARTS] = + { + .effect = CONTEST_EFFECT_REPETITION_NOT_BORING, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_TEATIME] = + { + .effect = CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_OCTOLOCK] = + { + .effect = CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_BOLT_BEAK] = + { + .effect = CONTEST_EFFECT_BETTER_IF_FIRST, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_FISHIOUS_REND] = + { + .effect = CONTEST_EFFECT_BETTER_IF_FIRST, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_COURT_CHANGE] = + { + .effect = CONTEST_EFFECT_MAKE_FOLLOWING_MONS_NERVOUS, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_CLANGOROUS_SOUL] = + { + .effect = CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_BODY_PRESS] = + { + .effect = CONTEST_EFFECT_BETTER_IF_SAME_TYPE, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_DECORATE] = + { + .effect = CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, + .contestCategory = CONTEST_CATEGORY_CUTE, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_DRUM_BEATING] = + { + .effect = CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_SMART, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_SNAP_TRAP] = + { + .effect = CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_PYRO_BALL] = + { + .effect = CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_BEHEMOTH_BLADE] = + { + .effect = CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_BEHEMOTH_BASH] = + { + .effect = CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_AURA_WHEEL] = + { + .effect = CONTEST_EFFECT_BETTER_IF_FIRST, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_BREAKING_SWIPE] = + { + .effect = CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_BRANCH_POKE] = + { + .effect = CONTEST_EFFECT_HIGHLY_APPEALING, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_OVERDRIVE] = + { + .effect = CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_APPLE_ACID] = + { + .effect = CONTEST_EFFECT_STARTLE_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_GRAV_APPLE] = + { + .effect = CONTEST_EFFECT_STARTLE_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_CUTE, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_SPIRIT_BREAK] = + { + .effect = CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_CUTE, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_STRANGE_STEAM] = + { + .effect = CONTEST_EFFECT_BADLY_STARTLE_FRONT_MON, + .contestCategory = CONTEST_CATEGORY_SMART, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_LIFE_DEW] = + { + .effect = CONTEST_EFFECT_QUALITY_DEPENDS_ON_TIMING, + .contestCategory = CONTEST_CATEGORY_CUTE, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_OBSTRUCT] = + { + .effect = CONTEST_EFFECT_AVOID_STARTLE, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_FALSE_SURRENDER] = + { + .effect = CONTEST_EFFECT_BETTER_IF_FIRST, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_METEOR_ASSAULT] = + { + .effect = CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_ETERNABEAM] = + { + .effect = CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN, + .contestCategory = CONTEST_CATEGORY_SMART, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_STEEL_BEAM] = + { + .effect = CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_EXPANDING_FORCE] = + { + .effect = CONTEST_EFFECT_STARTLE_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_SMART, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_VENOM_DRENCH] = + { + .effect = CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_SCALE_SHOT] = + { + .effect = CONTEST_EFFECT_NEXT_APPEAL_EARLIER, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_METEOR_BEAM] = + { + .effect = CONTEST_EFFECT_USER_MORE_EASILY_STARTLED, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_SHELL_SIDE_ARM] = + { + .effect = CONTEST_EFFECT_BETTER_IF_SAME_TYPE, + .contestCategory = CONTEST_CATEGORY_SMART, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_MISTY_EXPLOSION] = + { + .effect = CONTEST_EFFECT_GREAT_APPEAL_BUT_NO_MORE_MOVES, + .contestCategory = CONTEST_CATEGORY_CUTE, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_GRASSY_GLIDE] = + { + .effect = CONTEST_EFFECT_NEXT_APPEAL_EARLIER, + .contestCategory = CONTEST_CATEGORY_SMART, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_RISING_VOLTAGE] = + { + .effect = CONTEST_EFFECT_HIGHLY_APPEALING, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_TERRAIN_PULSE] = + { + .effect = CONTEST_EFFECT_HIGHLY_APPEALING, + .contestCategory = CONTEST_CATEGORY_CUTE, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_SKITTER_SMACK] = + { + .effect = CONTEST_EFFECT_BADLY_STARTLE_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_CUTE, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_BURNING_JEALOUSY] = + { + .effect = CONTEST_EFFECT_STARTLE_MON_WITH_JUDGES_ATTENTION, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_LASH_OUT] = + { + .effect = CONTEST_EFFECT_STARTLE_PREV_MON, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_POLTERGEIST] = + { + .effect = CONTEST_EFFECT_BETTER_IF_FIRST, + .contestCategory = CONTEST_CATEGORY_SMART, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_CORROSIVE_GAS] = + { + .effect = CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_COACHING] = + { + .effect = CONTEST_EFFECT_IMPROVE_CONDITION_PREVENT_NERVOUSNESS, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_FLIP_TURN] = + { + .effect = CONTEST_EFFECT_AVOID_STARTLE, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_TRIPLE_AXEL] = + { + .effect = CONTEST_EFFECT_BETTER_IF_SAME_TYPE, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_DUAL_WINGBEAT] = + { + .effect = CONTEST_EFFECT_REPETITION_NOT_BORING, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_SCORCHING_SANDS] = + { + .effect = CONTEST_EFFECT_HIGHLY_APPEALING, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_JUNGLE_HEALING] = + { + .effect = CONTEST_EFFECT_QUALITY_DEPENDS_ON_TIMING, + .contestCategory = CONTEST_CATEGORY_SMART, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_WICKED_BLOW] = + { + .effect = CONTEST_EFFECT_JAMS_OTHERS_BUT_MISS_ONE_TURN, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_SURGING_STRIKES] = + { + .effect = CONTEST_EFFECT_STARTLE_MONS_SAME_TYPE_APPEAL, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_THUNDER_CAGE] = + { + .effect = CONTEST_EFFECT_DONT_EXCITE_AUDIENCE, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_DRAGON_ENERGY] = + { + .effect = CONTEST_EFFECT_BETTER_WHEN_LATER, + .contestCategory = CONTEST_CATEGORY_COOL, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_FREEZING_GLARE] = + { + .effect = CONTEST_EFFECT_HIGHLY_APPEALING, + .contestCategory = CONTEST_CATEGORY_CUTE, + .comboStarterId = 0, + .comboMoves = {0} + }, + + [MOVE_FIERY_WRATH] = + { + .effect = CONTEST_EFFECT_HIGHLY_APPEALING, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_THUNDEROUS_KICK] = + { + .effect = CONTEST_EFFECT_HIGHLY_APPEALING, + .contestCategory = CONTEST_CATEGORY_TOUGH, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_GLACIAL_LANCE] = + { + .effect = CONTEST_EFFECT_BETTER_IF_LAST, + .contestCategory = CONTEST_CATEGORY_BEAUTY, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_ASTRAL_BARRAGE] = + { + .effect = CONTEST_EFFECT_BETTER_IF_FIRST, + .contestCategory = CONTEST_CATEGORY_SMART, + .comboStarterId = 0, + .comboMoves = {0}, + }, + + [MOVE_EERIE_SPELL] = + { + .effect = CONTEST_EFFECT_BETTER_WHEN_LATER, + .contestCategory = CONTEST_CATEGORY_SMART, + .comboStarterId = 0, + .comboMoves = {0} + }, }; const struct ContestEffect gContestEffects[] = From 8332bfae4682c9b4a778386c944d01253a1a81cd Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Mon, 1 Nov 2021 21:59:34 -0300 Subject: [PATCH 29/72] Gen 8 combo moves --- include/constants/contest.h | 4 ++++ src/data/contest_moves.h | 18 +++++++++--------- 2 files changed, 13 insertions(+), 9 deletions(-) diff --git a/include/constants/contest.h b/include/constants/contest.h index cefcbeebd..f7b858c4a 100644 --- a/include/constants/contest.h +++ b/include/constants/contest.h @@ -238,5 +238,9 @@ #define COMBO_STARTER_THOUSAND_WAVES 82 #define COMBO_STARTER_HYPERSPACE_FURY 83 #define COMBO_STARTER_SHADOW_BONE 84 +#define COMBO_STARTER_ELECTRIC_TERRAIN 85 +#define COMBO_STARTER_MISTY_TERRAIN 86 +#define COMBO_STARTER_GRASSY_TERRAIN 87 +#define COMBO_STARTER_PSYCHIC_TERRAIN 88 #endif // GUARD_CONSTANTS_CONTEST_H diff --git a/src/data/contest_moves.h b/src/data/contest_moves.h index 160a05407..8600dcbc6 100644 --- a/src/data/contest_moves.h +++ b/src/data/contest_moves.h @@ -4633,7 +4633,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] = { .effect = CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED, .contestCategory = CONTEST_CATEGORY_SMART, - .comboStarterId = 0, + .comboStarterId = COMBO_STARTER_GRASSY_TERRAIN, .comboMoves = {0} }, @@ -4641,7 +4641,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] = { .effect = CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED, .contestCategory = CONTEST_CATEGORY_CUTE, - .comboStarterId = 0, + .comboStarterId = COMBO_STARTER_MISTY_TERRAIN, .comboMoves = {0} }, @@ -4825,7 +4825,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] = { .effect = CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED, .contestCategory = CONTEST_CATEGORY_BEAUTY, - .comboStarterId = 0, + .comboStarterId = COMBO_STARTER_ELECTRIC_TERRAIN, .comboMoves = {0} }, @@ -5115,7 +5115,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] = { .effect = CONTEST_EFFECT_BETTER_WHEN_AUDIENCE_EXCITED, .contestCategory = CONTEST_CATEGORY_SMART, - .comboStarterId = 0, + .comboStarterId = COMBO_STARTER_PSYCHIC_TERRAIN, .comboMoves = {0} }, @@ -5684,7 +5684,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] = .effect = CONTEST_EFFECT_STARTLE_PREV_MONS, .contestCategory = CONTEST_CATEGORY_SMART, .comboStarterId = 0, - .comboMoves = {0} + .comboMoves = {COMBO_STARTER_PSYCHIC_TERRAIN} }, [MOVE_VENOM_DRENCH] = @@ -5724,7 +5724,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] = .effect = CONTEST_EFFECT_GREAT_APPEAL_BUT_NO_MORE_MOVES, .contestCategory = CONTEST_CATEGORY_CUTE, .comboStarterId = 0, - .comboMoves = {0} + .comboMoves = {COMBO_STARTER_MISTY_TERRAIN} }, [MOVE_GRASSY_GLIDE] = @@ -5732,7 +5732,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] = .effect = CONTEST_EFFECT_NEXT_APPEAL_EARLIER, .contestCategory = CONTEST_CATEGORY_SMART, .comboStarterId = 0, - .comboMoves = {0} + .comboMoves = {COMBO_STARTER_GRASSY_TERRAIN} }, [MOVE_RISING_VOLTAGE] = @@ -5740,7 +5740,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] = .effect = CONTEST_EFFECT_HIGHLY_APPEALING, .contestCategory = CONTEST_CATEGORY_BEAUTY, .comboStarterId = 0, - .comboMoves = {0} + .comboMoves = {COMBO_STARTER_ELECTRIC_TERRAIN} }, [MOVE_TERRAIN_PULSE] = @@ -5748,7 +5748,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] = .effect = CONTEST_EFFECT_HIGHLY_APPEALING, .contestCategory = CONTEST_CATEGORY_CUTE, .comboStarterId = 0, - .comboMoves = {0}, + .comboMoves = {COMBO_STARTER_ELECTRIC_TERRAIN, COMBO_STARTER_MISTY_TERRAIN, COMBO_STARTER_GRASSY_TERRAIN, COMBO_STARTER_PSYCHIC_TERRAIN}, }, [MOVE_SKITTER_SMACK] = From 10306d046cd4262741ca47415cc261ac3e3c7319 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Mon, 1 Nov 2021 22:07:54 -0300 Subject: [PATCH 30/72] Fixed Steam Roller's define --- src/data/contest_moves.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/data/contest_moves.h b/src/data/contest_moves.h index 8600dcbc6..169e55991 100644 --- a/src/data/contest_moves.h +++ b/src/data/contest_moves.h @@ -5687,7 +5687,7 @@ const struct ContestMove gContestMoves[MOVES_COUNT] = .comboMoves = {COMBO_STARTER_PSYCHIC_TERRAIN} }, - [MOVE_VENOM_DRENCH] = + [MOVE_STEEL_ROLLER] = { .effect = CONTEST_EFFECT_WORSEN_CONDITION_OF_PREV_MONS, .contestCategory = CONTEST_CATEGORY_TOUGH, From 8af882348a504d953997baa2faf5a50c12e59009 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Tue, 2 Nov 2021 16:56:12 +1300 Subject: [PATCH 31/72] Fix Parental Bond Super Fang Min damage should be 2 --- src/battle_ai_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 3535e800c..9478d7343 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -796,7 +796,7 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef) dmg = 0; // Two hits of Super Fang halves HP twice, leaving target with 25% HP else if (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND) - dmg = max(1, gBattleMons[battlerDef].hp * 3 / 4); + dmg = max(2, gBattleMons[battlerDef].hp * 3 / 4); else dmg = max(1, gBattleMons[battlerDef].hp / 2); break; From 40bced517a9a66292cea932da1360bc3e02a1161 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Tue, 2 Nov 2021 20:00:57 +1300 Subject: [PATCH 32/72] Pastel Veil blocks poison for whole side Tested vs Toxic, Toxic Thread and Sludge with 100% effect chance. --- data/battle_scripts_1.s | 15 +++++++++++++++ include/constants/battle_string_ids.h | 3 ++- src/battle_message.c | 2 ++ 3 files changed, 19 insertions(+), 1 deletion(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index dd6af61e5..dc0a1900e 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -2581,6 +2581,18 @@ BattleScript_AromaVeilProtects: orhalfword gMoveResultFlags, MOVE_RESULT_FAILED goto BattleScript_MoveEnd +BattleScript_PastelVeilProtectsRet:: + pause B_WAIT_TIME_SHORT + call BattleScript_AbilityPopUp + printstring STRINGID_PASTELVEILPROTECTED + waitmessage B_WAIT_TIME_LONG + return + +BattleScript_PastelVeilProtects: + call BattleScript_PastelVeilProtectsRet + orhalfword gMoveResultFlags, MOVE_RESULT_FAILED + goto BattleScript_MoveEnd + BattleScript_LeafGuardProtectsRet:: pause B_WAIT_TIME_SHORT call BattleScript_AbilityPopUp @@ -3053,6 +3065,7 @@ BattleScript_EffectToxic:: ppreduce jumpifability BS_TARGET, ABILITY_IMMUNITY, BattleScript_ImmunityProtected jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects + jumpifability BS_TARGET_SIDE, ABILITY_PASTEL_VEIL, BattleScript_PastelVeilProtects jumpifflowerveil BattleScript_FlowerVeilProtects jumpifleafguard BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects @@ -3080,6 +3093,7 @@ BattleScript_AlreadyPoisoned:: BattleScript_ImmunityProtected:: copybyte gEffectBattler, gBattlerTarget + call BattleScript_AbilityPopUp setbyte cMULTISTRING_CHOOSER, B_MSG_ABILITY_PREVENTS_MOVE_STATUS call BattleScript_PSNPrevention goto BattleScript_MoveEnd @@ -3408,6 +3422,7 @@ BattleScript_EffectPoison:: ppreduce jumpifability BS_TARGET, ABILITY_IMMUNITY, BattleScript_ImmunityProtected jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects + jumpifability BS_TARGET_SIDE, ABILITY_PASTEL_VEIL, BattleScript_PastelVeilProtects jumpifflowerveil BattleScript_FlowerVeilProtects jumpifleafguard BattleScript_LeafGuardProtects jumpifshieldsdown BS_TARGET, BattleScript_LeafGuardProtects diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 1d461e2a0..a84f0ff34 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -597,8 +597,9 @@ #define STRINGID_BUTPOKEMONCANTUSETHEMOVE 594 #define STRINGID_BUTHOOPACANTUSEIT 595 #define STRINGID_BROKETHROUGHPROTECTION 596 +#define STRINGID_PASTELVEILPROTECTED 597 -#define BATTLESTRINGS_COUNT 597 +#define BATTLESTRINGS_COUNT 598 // The below IDs are all indexes into battle message tables, // used to determine which of a set of messages to print. diff --git a/src/battle_message.c b/src/battle_message.c index f26726a69..f6569f039 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -723,9 +723,11 @@ static const u8 sText_PkmnRevertedToPrimal[] = _("{B_ATK_NAME_WITH_PREFIX}'s Pri static const u8 sText_ButPokemonCantUseTheMove[] = _("But {B_ATK_NAME_WITH_PREFIX} can't\nuse the move!"); static const u8 sText_ButHoopaCantUseIt[] = _("But Hoopa can't use it\nthe way it is now!"); static const u8 sText_BrokeThroughProtection[] = _("It broke through the\n{B_DEF_NAME_WITH_PREFIX}'s protection!"); +static const u8 sText_PastelVeilProtected[] = _("{B_DEF_NAME_WITH_PREFIX} is protected\nby a pastel veil!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_PASTELVEILPROTECTED -12] = sText_PastelVeilProtected, [STRINGID_BROKETHROUGHPROTECTION - 12] = sText_BrokeThroughProtection, [STRINGID_BUTPOKEMONCANTUSETHEMOVE - 12] = sText_ButPokemonCantUseTheMove, [STRINGID_BUTHOOPACANTUSEIT - 12] = sText_ButHoopaCantUseIt, From 95435b5f7f132da3d0d36464e8726ad132fd7008 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Tue, 2 Nov 2021 23:06:10 +1300 Subject: [PATCH 33/72] Pastel Veil switchin effect attempt Battle script isn't working for partner for some reason. --- data/battle_scripts_1.s | 8 ++++++++ include/battle_scripts.h | 1 + include/constants/battle_string_ids.h | 4 +++- src/battle_message.c | 3 +++ src/battle_util.c | 19 +++++++++++++++++++ 5 files changed, 34 insertions(+), 1 deletion(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index dc0a1900e..d627008da 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -8926,3 +8926,11 @@ BattleScript_DarkTypePreventsPrankster:: waitmessage B_WAIT_TIME_LONG orhalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT goto BattleScript_MoveEnd + +BattleScript_PastelVeilActivates:: + call BattleScript_AbilityPopUp + printfromtable gSwitchInAbilityStringIds + curestatus BS_SCRIPTING + updatestatusicon BS_SCRIPTING + waitmessage B_WAIT_TIME_LONG + end3 diff --git a/include/battle_scripts.h b/include/battle_scripts.h index ec95a4549..5875eaa68 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -402,5 +402,6 @@ extern const u8 BattleScript_BlockedByPrimalWeatherEnd3[]; extern const u8 BattleScript_BlockedByPrimalWeatherRet[]; extern const u8 BattleScript_PrimalReversion[]; extern const u8 BattleScript_HyperspaceFuryRemoveProtect[]; +extern const u8 BattleScript_PastelVeilActivates[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index a84f0ff34..95a37223d 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -598,8 +598,9 @@ #define STRINGID_BUTHOOPACANTUSEIT 595 #define STRINGID_BROKETHROUGHPROTECTION 596 #define STRINGID_PASTELVEILPROTECTED 597 +#define STRINGID_PASTELVEILENTERS 598 -#define BATTLESTRINGS_COUNT 598 +#define BATTLESTRINGS_COUNT 599 // The below IDs are all indexes into battle message tables, // used to determine which of a set of messages to print. @@ -834,6 +835,7 @@ #define B_MSG_SWITCHIN_SCREENCLEANER 12 #define B_MSG_SWITCHIN_ASONE 13 #define B_MSG_SWITCHIN_CURIOUS_MEDICINE 14 +#define B_MSG_SWITCHIN_PASTEL_VEIL 15 // gMentalHerbCureStringIds #define B_MSG_MENTALHERBCURE_INFATUATION 0 diff --git a/src/battle_message.c b/src/battle_message.c index f6569f039..3a17a7240 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -724,9 +724,11 @@ static const u8 sText_ButPokemonCantUseTheMove[] = _("But {B_ATK_NAME_WITH_PREFI static const u8 sText_ButHoopaCantUseIt[] = _("But Hoopa can't use it\nthe way it is now!"); static const u8 sText_BrokeThroughProtection[] = _("It broke through the\n{B_DEF_NAME_WITH_PREFIX}'s protection!"); static const u8 sText_PastelVeilProtected[] = _("{B_DEF_NAME_WITH_PREFIX} is protected\nby a pastel veil!"); +static const u8 sText_PastelVeilEnters[] = _("{B_EFF_NAME_WITH_PREFIX}'s poisoning\nwas cured!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_PASTELVEILENTERS - 12] = sText_PastelVeilEnters, [STRINGID_PASTELVEILPROTECTED -12] = sText_PastelVeilProtected, [STRINGID_BROKETHROUGHPROTECTION - 12] = sText_BrokeThroughProtection, [STRINGID_BUTPOKEMONCANTUSETHEMOVE - 12] = sText_ButPokemonCantUseTheMove, @@ -1373,6 +1375,7 @@ const u16 gSwitchInAbilityStringIds[] = [B_MSG_SWITCHIN_SCREENCLEANER] = STRINGID_SCREENCLEANERENTERS, [B_MSG_SWITCHIN_ASONE] = STRINGID_ASONEENTERS, [B_MSG_SWITCHIN_CURIOUS_MEDICINE] = STRINGID_CURIOUSMEDICINEENTERS, + [B_MSG_SWITCHIN_PASTEL_VEIL] = STRINGID_PASTELVEILENTERS, }; const u16 gMissStringIds[] = diff --git a/src/battle_util.c b/src/battle_util.c index 5dbe42227..0600d37e8 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -4061,6 +4061,25 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move effect++; } break; + case ABILITY_PASTEL_VEIL: + if (!gSpecialStatuses[battler].switchInAbilityDone) + { + u32 side = GetBattlerSide(battler); + + for (i = 0; i < MAX_BATTLERS_COUNT; i++) + { + if (IsBattlerAlive(i) && GetBattlerSide(i) == side + && (gBattleMons[i].status1 & STATUS1_POISON || gBattleMons[i].status1 & STATUS1_TOXIC_POISON)) + { + gActiveBattler = gBattleScripting.battler = gEffectBattler = i; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_PASTEL_VEIL; + BattleScriptPushCursorAndCallback(BattleScript_PastelVeilActivates); + effect++; + } + } + gSpecialStatuses[battler].switchInAbilityDone = 1; + } + break; case ABILITY_ANTICIPATION: if (!gSpecialStatuses[battler].switchInAbilityDone) { From 4668e11765c644e1e621275fae215c36a9fa2484 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Wed, 3 Nov 2021 00:45:24 +1300 Subject: [PATCH 34/72] Looping battlescript version 1 Would be better if it simply updated the target, cured the status and returned I think, needs testing. --- data/battle_scripts_1.s | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index d627008da..37b592365 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -8927,10 +8927,30 @@ BattleScript_DarkTypePreventsPrankster:: orhalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT goto BattleScript_MoveEnd -BattleScript_PastelVeilActivates:: +BattleScript_PastelVeilActivatesOld:: call BattleScript_AbilityPopUp printfromtable gSwitchInAbilityStringIds curestatus BS_SCRIPTING updatestatusicon BS_SCRIPTING waitmessage B_WAIT_TIME_LONG end3 + +BattleScript_PastelVeilActivates:: + call BattleScript_AbilityPopUp + printfromtable gSwitchInAbilityStringIds + waitmessage B_WAIT_TIME_LONG + copybyte gBattlerTarget, gBattlerAttacker + setbyte gBattleCommunication, 0 +BattleScript_PastelVeil_TryCurePoison: + jumpifstatus BS_TARGET, STATUS1_POISON | STATUS1_TOXIC_POISON, BattleScript_PastelVeilCurePoison + goto BattleScript_PastelVeilEnd +BattleScript_PastelVeilCurePoison: + curestatus BS_TARGET + updatestatusicon BS_TARGET + jumpifbyte CMP_NOT_EQUAL, gBattleCommunication, 0x0, BattleScript_PastelVeilEnd + addbyte gBattleCommunication, 1 + jumpifnoally BS_TARGET, BattleScript_PastelVeilEnd + setallytonexttarget BattleScript_PastelVeil_TryCurePoison + goto BattleScript_MoveEnd +BattleScript_PastelVeilEnd: + end3 From 592a1dab63d3b8eb97679cbdc9161ade8f762d90 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Tue, 2 Nov 2021 12:02:58 -0400 Subject: [PATCH 35/72] fix mirror armor setstatchanger, handle reflected stat blockage --- data/battle_scripts_1.s | 2 +- src/battle_script_commands.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index b72140a11..eb80a41d5 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -2894,7 +2894,7 @@ BattleScript_MirrorArmorReflect:: call BattleScript_AbilityPopUp jumpifsubstituteblocks BattleScript_AbilityNoSpecificStatLoss BattleScript_MirrorArmorReflectStatLoss: - statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_NOT_PROTECT_AFFECTED, BattleScript_MirrorArmorReflectWontFall + statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_NOT_PROTECT_AFFECTED | STAT_BUFF_ALLOW_PTR, BattleScript_MirrorArmorReflectEnd jumpifbyte CMP_LESS_THAN, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_DECREASE, BattleScript_MirrorArmorReflectAnim goto BattleScript_MirrorArmorReflectWontFall BattleScript_MirrorArmorReflectAnim: diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 28cab4af3..2ee80557f 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9689,10 +9689,12 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr { if (flags == STAT_BUFF_ALLOW_PTR) { + SET_STATCHANGER(statId, GET_STAT_BUFF_VALUE(statValue) | STAT_BUFF_NEGATIVE, TRUE); BattleScriptPush(BS_ptr); gBattleScripting.battler = gActiveBattler; gBattlerAbility = gActiveBattler; gBattlescriptCurrInstr = BattleScript_MirrorArmorReflect; + RecordAbilityBattle(gActiveBattler, gBattleMons[gActiveBattler].ability); } return STAT_CHANGE_DIDNT_WORK; } From 69b42de0d9b054617a946cfa37064749b43c5013 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 30 Oct 2021 20:40:05 -0300 Subject: [PATCH 36/72] Implemented Mimicry Thanks to AsparagusEduardo for helping me optimize RestoreBattlerOriginalTypes. --- asm/macros/battle_script.inc | 5 ++ data/battle_scripts_1.s | 23 ++++++++ include/battle_scripts.h | 2 + include/battle_util.h | 2 + include/constants/battle_script_commands.h | 1 + include/constants/battle_string_ids.h | 3 +- src/battle_message.c | 2 + src/battle_script_commands.c | 16 ++++++ src/battle_util.c | 62 +++++++++++++++++++++- 9 files changed, 114 insertions(+), 2 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 8fd760634..f288cfeaf 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1874,6 +1874,11 @@ .4byte \ptr .endm + .macro trytoapplymimicry battler:req, ptr:req + various \battler, VARIOUS_TRY_TO_APPLY_MIMICRY + .4byte \ptr + .endm + @ helpful macros .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7 diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index df0048ad9..8c3e744c1 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -1908,8 +1908,25 @@ BattleScript_EffectPsychicTerrain: waitmessage B_WAIT_TIME_LONG playanimation BS_SCRIPTING, B_ANIM_RESTORE_BG, NULL call BattleScript_TerrainSeedLoop + jumpifabilitypresent ABILITY_MIMICRY, BattleScript_ApplyMimicry goto BattleScript_MoveEnd +BattleScript_ApplyMimicry:: + savetarget + setbyte gBattlerTarget, 0 +BattleScript_MimicryLoopIter: + copybyte sBATTLER, gBattlerTarget + trytoapplymimicry BS_TARGET, BattleScript_MimicryLoop_NextBattler + copybyte gBattlerAbility, sBATTLER + call BattleScript_AbilityPopUp + printstring STRINGID_BATTLERTYPECHANGEDTO + waitmessage B_WAIT_TIME_LONG +BattleScript_MimicryLoop_NextBattler: + addbyte gBattlerTarget, 0x1 + jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_MimicryLoopIter + restoretarget + end + BattleScript_EffectTopsyTurvy: attackcanceler attackstring @@ -7957,6 +7974,12 @@ BattleScript_ColorChangeActivates:: waitmessage B_WAIT_TIME_LONG return +BattleScript_MimicryActivatesEnd3:: + call BattleScript_AbilityPopUp + printstring STRINGID_BATTLERTYPECHANGEDTO + waitmessage B_WAIT_TIME_LONG + end3 + BattleScript_ProteanActivates:: call BattleScript_AbilityPopUp printstring STRINGID_PKMNCHANGEDTYPE diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 403af9515..537d9cb81 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -404,5 +404,7 @@ extern const u8 BattleScript_PrimalReversion[]; extern const u8 BattleScript_HyperspaceFuryRemoveProtect[]; extern const u8 BattleScript_SelectingNotAllowedMoveGorillaTactics[]; extern const u8 BattleScript_WanderingSpiritActivates[]; +extern const u8 BattleScript_MimicryActivatesEnd3[]; +extern const u8 BattleScript_ApplyMimicry[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/battle_util.h b/include/battle_util.h index 7f267308d..62a7e1db6 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -157,6 +157,8 @@ void DoBurmyFormChange(u32 monId); bool32 BlocksPrankster(u16 move, u8 battlerPrankster, u8 battlerDef, bool32 checkTarget); u16 GetUsedHeldItem(u8 battler); bool32 IsBattlerWeatherAffected(u8 battlerId, u32 weatherFlags); +void TryToApplyMimicry(u8 battlerId, bool8 various); +void RestoreBattlerOriginalTypes(u8 battlerId); // ability checks bool32 IsRolePlayBannedAbilityAtk(u16 ability); diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index fb1142f48..ee6cd4c7f 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -197,6 +197,7 @@ #define VARIOUS_UPDATE_ABILITY_POPUP 124 #define VARIOUS_JUMP_IF_WEATHER_AFFECTED 125 #define VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED 126 +#define VARIOUS_TRY_TO_APPLY_MIMICRY 127 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 27b39475a..c4161c68f 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -599,8 +599,9 @@ #define STRINGID_BROKETHROUGHPROTECTION 596 #define STRINGID_ABILITYALLOWSONLYMOVE 597 #define STRINGID_SWAPPEDABILITIES 598 +#define STRINGID_BATTLERTYPECHANGEDTO 599 -#define BATTLESTRINGS_COUNT 599 +#define BATTLESTRINGS_COUNT 600 // The below IDs are all indexes into battle message tables, // used to determine which of a set of messages to print. diff --git a/src/battle_message.c b/src/battle_message.c index 37919ddca..30a8670ac 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -725,9 +725,11 @@ static const u8 sText_ButHoopaCantUseIt[] = _("But Hoopa can't use it\nthe way i static const u8 sText_BrokeThroughProtection[] = _("It broke through the\n{B_DEF_NAME_WITH_PREFIX}'s protection!"); static const u8 sText_AbilityAllowsOnlyMove[] = _("{B_ATK_ABILITY} allows the\nuse of only {B_CURRENT_MOVE}!\p"); static const u8 sText_SwappedAbilities[] = _("{B_DEF_NAME_WITH_PREFIX} swapped Abilities\nwith its target!"); +static const u8 sText_BattlerTypeChangedTo[] = _("{B_BUFF1}'s type\nchanged to {B_BUFF2}!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { + [STRINGID_BATTLERTYPECHANGEDTO - 12] = sText_BattlerTypeChangedTo, [STRINGID_SWAPPEDABILITIES - 12] = sText_SwappedAbilities, [STRINGID_ABILITYALLOWSONLYMOVE - 12] = sText_AbilityAllowsOnlyMove, [STRINGID_BROKETHROUGHPROTECTION - 12] = sText_BrokeThroughProtection, diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 9e779da1b..2f4e8c46b 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -54,6 +54,7 @@ #include "constants/rgb.h" #include "data.h" #include "constants/party_menu.h" +#include "battle_util.h" extern struct MusicPlayerInfo gMPlayInfo_BGM; extern struct Evolution gEvolutionTable[][EVOS_PER_MON]; @@ -9004,6 +9005,21 @@ static void Cmd_various(void) gBattlescriptCurrInstr += 7; } return; + case VARIOUS_TRY_TO_APPLY_MIMICRY: + { + bool8 isMimicryDone = FALSE; + + if (GetBattlerAbility(gActiveBattler) == ABILITY_MIMICRY) + { + TryToApplyMimicry(gActiveBattler, TRUE); + isMimicryDone = TRUE; + } + if (!isMimicryDone) + gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3); + else + gBattlescriptCurrInstr += 7; + return; + } } gBattlescriptCurrInstr += 3; diff --git a/src/battle_util.c b/src/battle_util.c index 224cb1af1..00e323d20 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1894,6 +1894,46 @@ u8 GetImprisonedMovesCount(u8 battlerId, u16 move) return imprisonedMoves; } +void RestoreBattlerOriginalTypes(u8 battlerId) +{ + gBattleMons[battlerId].type1 = gBaseStats[gBattleMons[battlerId].species].type1; + gBattleMons[battlerId].type2 = gBaseStats[gBattleMons[battlerId].species].type2; +} + +void TryToApplyMimicry(u8 battlerId, bool8 various) +{ + u32 moveType, move; + + GET_MOVE_TYPE(move, moveType); + switch (gFieldStatuses) + { + case STATUS_FIELD_ELECTRIC_TERRAIN: + moveType = TYPE_ELECTRIC; + break; + case STATUS_FIELD_MISTY_TERRAIN: + moveType = TYPE_FAIRY; + break; + case STATUS_FIELD_GRASSY_TERRAIN: + moveType = TYPE_GRASS; + break; + case STATUS_FIELD_PSYCHIC_TERRAIN: + moveType = TYPE_PSYCHIC; + break; + default: + moveType = 0; + break; + } + + if (moveType != 0 && !IS_BATTLER_OF_TYPE(battlerId, moveType)) + { + SET_BATTLER_TYPE(battlerId, moveType); + PREPARE_MON_NICK_WITH_PREFIX_BUFFER(gBattleTextBuff1, battlerId, gBattlerPartyIndexes[battlerId]) + PREPARE_TYPE_BUFFER(gBattleTextBuff2, moveType); + if (!various) + BattleScriptPushCursorAndCallback(BattleScript_MimicryActivatesEnd3); + } +} + enum { ENDTURN_ORDER, @@ -2278,6 +2318,9 @@ u8 DoFieldEndTurnEffects(void) && (!(gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT) && --gFieldTimers.electricTerrainTimer == 0)) { gFieldStatuses &= ~(STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_TERRAIN_PERMANENT); + for (i = 0; i < MAX_BATTLERS_COUNT; i++) + if (GetBattlerAbility(i) == ABILITY_MIMICRY) + RestoreBattlerOriginalTypes(i); BattleScriptExecute(BattleScript_ElectricTerrainEnds); effect++; } @@ -2288,6 +2331,9 @@ u8 DoFieldEndTurnEffects(void) && (!(gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT) && --gFieldTimers.mistyTerrainTimer == 0)) { gFieldStatuses &= ~(STATUS_FIELD_MISTY_TERRAIN); + for (i = 0; i < MAX_BATTLERS_COUNT; i++) + if (GetBattlerAbility(i) == ABILITY_MIMICRY) + RestoreBattlerOriginalTypes(i); BattleScriptExecute(BattleScript_MistyTerrainEnds); effect++; } @@ -2298,8 +2344,12 @@ u8 DoFieldEndTurnEffects(void) { if (!(gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT) && (gFieldTimers.grassyTerrainTimer == 0 || --gFieldTimers.grassyTerrainTimer == 0)) + { gFieldStatuses &= ~(STATUS_FIELD_GRASSY_TERRAIN); - + for (i = 0; i < MAX_BATTLERS_COUNT; i++) + if (GetBattlerAbility(i) == ABILITY_MIMICRY) + RestoreBattlerOriginalTypes(i); + } BattleScriptExecute(BattleScript_GrassyTerrainHeals); effect++; } @@ -2310,6 +2360,9 @@ u8 DoFieldEndTurnEffects(void) && (!(gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT) && --gFieldTimers.psychicTerrainTimer == 0)) { gFieldStatuses &= ~(STATUS_FIELD_PSYCHIC_TERRAIN); + for (i = 0; i < MAX_BATTLERS_COUNT; i++) + if (GetBattlerAbility(i) == ABILITY_MIMICRY) + RestoreBattlerOriginalTypes(i); BattleScriptExecute(BattleScript_PsychicTerrainEnds); effect++; } @@ -4380,6 +4433,13 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move effect++; } break; + case ABILITY_MIMICRY: + if (gBattleMons[battler].hp != 0 && gFieldStatuses & STATUS_FIELD_TERRAIN_ANY) + { + TryToApplyMimicry(battler, FALSE); + effect++; + } + break; } break; case ABILITYEFFECT_ENDTURN: // 1 From d99fd30e4d60533e46d59e872cac542786a8d929 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Wed, 3 Nov 2021 11:51:20 +1300 Subject: [PATCH 37/72] Looping battle script, correct message Testing in Sword showed that the pop up should happen once if two mons are cured, and that the correct message is "X was cured of its poisoning!" --- data/battle_scripts_1.s | 24 ++++++++++-------------- src/battle_message.c | 2 +- src/battle_util.c | 17 ++++------------- 3 files changed, 15 insertions(+), 28 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 37b592365..5bd37cf04 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -8927,30 +8927,26 @@ BattleScript_DarkTypePreventsPrankster:: orhalfword gMoveResultFlags, MOVE_RESULT_NO_EFFECT goto BattleScript_MoveEnd -BattleScript_PastelVeilActivatesOld:: - call BattleScript_AbilityPopUp - printfromtable gSwitchInAbilityStringIds - curestatus BS_SCRIPTING - updatestatusicon BS_SCRIPTING - waitmessage B_WAIT_TIME_LONG - end3 - BattleScript_PastelVeilActivates:: - call BattleScript_AbilityPopUp - printfromtable gSwitchInAbilityStringIds - waitmessage B_WAIT_TIME_LONG - copybyte gBattlerTarget, gBattlerAttacker setbyte gBattleCommunication, 0 + setbyte gBattleCommunication + 1, 0 BattleScript_PastelVeil_TryCurePoison: jumpifstatus BS_TARGET, STATUS1_POISON | STATUS1_TOXIC_POISON, BattleScript_PastelVeilCurePoison - goto BattleScript_PastelVeilEnd + goto BattleScript_PastelVeilLoopIncrement BattleScript_PastelVeilCurePoison: + jumpifbyte CMP_NOT_EQUAL, gBattleCommunication + 1, 0x0, BattleScript_PastelVeilCurePoisonNoPopUp + call BattleScript_AbilityPopUp + setbyte gBattleCommunication + 1, 1 +BattleScript_PastelVeilCurePoisonNoPopUp: @ Only show Pastel Veil pop up once if it cures two mons + printfromtable gSwitchInAbilityStringIds + waitmessage B_WAIT_TIME_LONG curestatus BS_TARGET updatestatusicon BS_TARGET +BattleScript_PastelVeilLoopIncrement: jumpifbyte CMP_NOT_EQUAL, gBattleCommunication, 0x0, BattleScript_PastelVeilEnd addbyte gBattleCommunication, 1 jumpifnoally BS_TARGET, BattleScript_PastelVeilEnd setallytonexttarget BattleScript_PastelVeil_TryCurePoison - goto BattleScript_MoveEnd + goto BattleScript_PastelVeilEnd BattleScript_PastelVeilEnd: end3 diff --git a/src/battle_message.c b/src/battle_message.c index 3a17a7240..61889a2b7 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -724,7 +724,7 @@ static const u8 sText_ButPokemonCantUseTheMove[] = _("But {B_ATK_NAME_WITH_PREFI static const u8 sText_ButHoopaCantUseIt[] = _("But Hoopa can't use it\nthe way it is now!"); static const u8 sText_BrokeThroughProtection[] = _("It broke through the\n{B_DEF_NAME_WITH_PREFIX}'s protection!"); static const u8 sText_PastelVeilProtected[] = _("{B_DEF_NAME_WITH_PREFIX} is protected\nby a pastel veil!"); -static const u8 sText_PastelVeilEnters[] = _("{B_EFF_NAME_WITH_PREFIX}'s poisoning\nwas cured!"); +static const u8 sText_PastelVeilEnters[] = _("{B_DEF_NAME_WITH_PREFIX} was cured\nof its poisoning!"); const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = { diff --git a/src/battle_util.c b/src/battle_util.c index 0600d37e8..25bfde382 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -4064,19 +4064,10 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move case ABILITY_PASTEL_VEIL: if (!gSpecialStatuses[battler].switchInAbilityDone) { - u32 side = GetBattlerSide(battler); - - for (i = 0; i < MAX_BATTLERS_COUNT; i++) - { - if (IsBattlerAlive(i) && GetBattlerSide(i) == side - && (gBattleMons[i].status1 & STATUS1_POISON || gBattleMons[i].status1 & STATUS1_TOXIC_POISON)) - { - gActiveBattler = gBattleScripting.battler = gEffectBattler = i; - gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_PASTEL_VEIL; - BattleScriptPushCursorAndCallback(BattleScript_PastelVeilActivates); - effect++; - } - } + gBattlerTarget = battler; + gBattleCommunication[MULTISTRING_CHOOSER] = B_MSG_SWITCHIN_PASTEL_VEIL; + BattleScriptPushCursorAndCallback(BattleScript_PastelVeilActivates); + effect++; gSpecialStatuses[battler].switchInAbilityDone = 1; } break; From 5bfb3096adba05e14938b3c1416aa0d9ad38d4ac Mon Sep 17 00:00:00 2001 From: sbird Date: Tue, 2 Nov 2021 23:53:03 +0000 Subject: [PATCH 38/72] [battle_debug] fix charbase overflow --- src/battle_debug.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_debug.c b/src/battle_debug.c index b34afe484..c967cfe00 100644 --- a/src/battle_debug.c +++ b/src/battle_debug.c @@ -559,7 +559,7 @@ static const struct BgTemplate sBgTemplates[] = }, { .bg = 1, - .charBaseIndex = 10, + .charBaseIndex = 2, .mapBaseIndex = 20, .screenSize = 0, .paletteMode = 0, From d33bcc335bd6e9beca0a94346098be89b6bffff6 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Wed, 3 Nov 2021 14:49:14 +1300 Subject: [PATCH 39/72] Revert Poison Touch target check This would prevent Poison Touch activating if the target hurt itself. --- src/battle_util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_util.c b/src/battle_util.c index 843ed16a7..7d955ee84 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5208,7 +5208,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move case ABILITY_POISON_TOUCH: if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) && gBattleMons[gBattlerTarget].hp != 0 - && !gProtectStructs[gBattlerTarget].confusionSelfDmg + && !gProtectStructs[gBattlerAttacker].confusionSelfDmg && CanBePoisoned(gBattlerAttacker, gBattlerTarget) && IsMoveMakingContact(move, gBattlerAttacker) && TARGET_TURN_DAMAGED // Need to actually hit the target From 74c85b581890f014a6031f233494fa37e96a4b3b Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Wed, 3 Nov 2021 17:23:33 +1300 Subject: [PATCH 40/72] Implement Relic Song's form change Meloetta transforms into its pirouette form after using Relic Song, unless it has Sheer Force or the move has no effect. It also has a chance to put both targets to sleep. --- data/battle_scripts_1.s | 40 ++++++++++++++++++++++--- include/battle_scripts.h | 1 + include/constants/battle.h | 3 +- include/constants/battle_config.h | 2 ++ include/constants/battle_move_effects.h | 2 +- src/battle_ai_main.c | 2 +- src/battle_script_commands.c | 10 +++++++ src/battle_util.c | 5 ++-- src/data/battle_moves.h | 3 +- 9 files changed, 58 insertions(+), 10 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index df0048ad9..5bdada7b8 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -367,7 +367,7 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectGeomancy @ EFFECT_GEOMANCY .4byte BattleScript_EffectFairyLock @ EFFECT_FAIRY_LOCK .4byte BattleScript_EffectAllySwitch @ EFFECT_ALLY_SWITCH - .4byte BattleScript_EffectSleepHit @ EFFECT_SLEEP_HIT + .4byte BattleScript_EffectRelicSong @ EFFECT_RELIC_SONG .4byte BattleScript_EffectAttackerDefenseDownHit @ EFFECT_ATTACKER_DEFENSE_DOWN_HIT .4byte BattleScript_EffectHit @ EFFECT_BODY_PRESS .4byte BattleScript_EffectEerieSpell @ EFFECT_EERIE_SPELL @@ -734,9 +734,30 @@ BattleScript_EffectAttackerDefenseDownHit: setmoveeffect MOVE_EFFECT_DEF_MINUS_1 | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN goto BattleScript_EffectHit -BattleScript_EffectSleepHit: - setmoveeffect MOVE_EFFECT_SLEEP - goto BattleScript_EffectHit +BattleScript_EffectRelicSong: + setmoveeffect MOVE_EFFECT_RELIC_SONG | MOVE_EFFECT_CERTAIN + attackcanceler + accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE + attackstring + ppreduce + critcalc + damagecalc + adjustdamage + attackanimation + waitanimation + effectivenesssound + hitanimation BS_TARGET + waitstate + healthbarupdate BS_TARGET + datahpupdate BS_TARGET + critmessage + waitmessage B_WAIT_TIME_LONG + resultmessage + waitmessage B_WAIT_TIME_LONG + seteffectwithchance + argumentstatuseffect + tryfaintmon BS_TARGET, FALSE, NULL + goto BattleScript_MoveEnd BattleScript_EffectAllySwitch: attackcanceler @@ -6939,6 +6960,17 @@ BattleScript_AttackerFormChangeEnd3:: call BattleScript_AttackerFormChange end3 +BattleScript_AttackerFormChangeMoveEffect:: + waitmessage 1 + handleformchange BS_ATTACKER, 0 + handleformchange BS_ATTACKER, 1 + playanimation BS_ATTACKER, B_ANIM_FORM_CHANGE, NULL + waitanimation + printstring STRINGID_PKMNTRANSFORMED + waitmessage B_WAIT_TIME_LONG + handleformchange BS_ATTACKER, 2 + end3 + BattleScript_BallFetch:: call BattleScript_AbilityPopUp printstring STRINGID_FETCHEDPOKEBALL diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 403af9515..753dc5127 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -404,5 +404,6 @@ extern const u8 BattleScript_PrimalReversion[]; extern const u8 BattleScript_HyperspaceFuryRemoveProtect[]; extern const u8 BattleScript_SelectingNotAllowedMoveGorillaTactics[]; extern const u8 BattleScript_WanderingSpiritActivates[]; +extern const u8 BattleScript_AttackerFormChangeMoveEffect[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/include/constants/battle.h b/include/constants/battle.h index 918c3e7f0..438b5660c 100644 --- a/include/constants/battle.h +++ b/include/constants/battle.h @@ -357,7 +357,8 @@ #define MOVE_EFFECT_INCINERATE 0x44 #define MOVE_EFFECT_BUG_BITE 0x45 #define MOVE_EFFECT_RECOIL_HP_25 0x46 -#define NUM_MOVE_EFFECTS 0x47 +#define MOVE_EFFECT_RELIC_SONG 0x47 +#define NUM_MOVE_EFFECTS 0x48 #define MOVE_EFFECT_AFFECTS_USER 0x4000 #define MOVE_EFFECT_CERTAIN 0x8000 diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 41fee089d..0e7b75d6d 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -47,6 +47,8 @@ #define SPECIES_GRENINJA_ASH 10017 #define SPECIES_HOOPA 0 #define SPECIES_HOOPA_UNBOUND 10018 + #define SPECIES_MELOETTA 0 + #define SPECIES_MELOETTA_PIROUETTE 10019 #endif // Items with peculiar battle effects. diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 62b49a191..8d3df5ec0 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -350,7 +350,7 @@ #define EFFECT_GEOMANCY 344 #define EFFECT_FAIRY_LOCK 345 #define EFFECT_ALLY_SWITCH 346 -#define EFFECT_SLEEP_HIT 347 +#define EFFECT_RELIC_SONG 347 #define EFFECT_ATTACKER_DEFENSE_DOWN_HIT 348 #define EFFECT_BODY_PRESS 349 #define EFFECT_EERIE_SPELL 350 diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 84fa7b634..c06bb7394 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -4305,7 +4305,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) if (!IsBattlerGrounded(battlerDef)) score += 3; break; - case EFFECT_SLEEP_HIT: // Relic Song + case EFFECT_RELIC_SONG: #if (defined SPECIES_MELOETTA && defined SPECIES_MELOETTA_PIROUETTE) if (AI_DATA->atkSpecies == SPECIES_MELOETTA && gBattleMons[battlerDef].defense < gBattleMons[battlerDef].spDefense) score += 3; // Change to pirouette if can do more damage diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 9e779da1b..d88bf9944 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3393,6 +3393,13 @@ void SetMoveEffect(bool32 primary, u32 certain) gBattlescriptCurrInstr = BattleScript_MoveEffectBugBite; } break; + case MOVE_EFFECT_RELIC_SONG: + if (gBattleMons[gBattlerAttacker].species == SPECIES_MELOETTA) + { + gBattleMons[gBattlerAttacker].species = SPECIES_MELOETTA_PIROUETTE; + BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeMoveEffect); + } + break; } } } @@ -8282,6 +8289,9 @@ static void Cmd_various(void) case VARIOUS_ARGUMENT_STATUS_EFFECT: switch (gBattleMoves[gCurrentMove].argument) { + case STATUS1_SLEEP: + gBattleScripting.moveEffect = MOVE_EFFECT_SLEEP; + break; case STATUS1_BURN: gBattleScripting.moveEffect = MOVE_EFFECT_BURN; break; diff --git a/src/battle_util.c b/src/battle_util.c index 224cb1af1..ca1021dfa 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8957,6 +8957,7 @@ void UndoFormChange(u32 monId, u32 side, bool32 isSwitchingOut) { {SPECIES_MIMIKYU_BUSTED, SPECIES_MIMIKYU}, {SPECIES_GRENINJA_ASH, SPECIES_GRENINJA_BATTLE_BOND}, + {SPECIES_MELOETTA_PIROUETTE, SPECIES_MELOETTA}, {SPECIES_AEGISLASH_BLADE, SPECIES_AEGISLASH}, {SPECIES_DARMANITAN_ZEN_MODE, SPECIES_DARMANITAN}, {SPECIES_MINIOR, SPECIES_MINIOR_CORE_RED}, @@ -8971,8 +8972,8 @@ void UndoFormChange(u32 monId, u32 side, bool32 isSwitchingOut) {SPECIES_CRAMORANT_GULPING, SPECIES_CRAMORANT}, }; - if (isSwitchingOut) // Don't revert Mimikyu Busted or Ash-Greninja when switching out - i = 2; + if (isSwitchingOut) // Don't revert Mimikyu, Greninja, Meloetta when switching out + i = 3; else i = 0; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 97d61202a..0d3f23168 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -8614,7 +8614,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_RELIC_SONG] = { - .effect = EFFECT_SLEEP_HIT, + .effect = EFFECT_RELIC_SONG, .power = 75, .type = TYPE_NORMAL, .accuracy = 100, @@ -8624,6 +8624,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .priority = 0, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SOUND | FLAG_SHEER_FORCE_BOOST, .split = SPLIT_SPECIAL, + .argument = STATUS1_SLEEP, }, [MOVE_SECRET_SWORD] = From 18b87416d5f2a9b912a9ade9b932e9a25893ce68 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Wed, 3 Nov 2021 17:56:16 +1300 Subject: [PATCH 41/72] Fixes - Fix Sheer Force interaction (needed after adding | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN) - Fix "X Transformed!" target - Allow switching between both forms - Allow form change if target is KO'ed --- data/battle_scripts_1.s | 3 ++- src/battle_script_commands.c | 14 +++++++++++--- 2 files changed, 13 insertions(+), 4 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 5bdada7b8..7e52d7d06 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -735,7 +735,7 @@ BattleScript_EffectAttackerDefenseDownHit: goto BattleScript_EffectHit BattleScript_EffectRelicSong: - setmoveeffect MOVE_EFFECT_RELIC_SONG | MOVE_EFFECT_CERTAIN + setmoveeffect MOVE_EFFECT_RELIC_SONG | MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN attackcanceler accuracycheck BattleScript_PrintMoveMissed, ACC_CURR_MOVE attackstring @@ -6966,6 +6966,7 @@ BattleScript_AttackerFormChangeMoveEffect:: handleformchange BS_ATTACKER, 1 playanimation BS_ATTACKER, B_ANIM_FORM_CHANGE, NULL waitanimation + copybyte sBATTLER, gBattlerAttacker printstring STRINGID_PKMNTRANSFORMED waitmessage B_WAIT_TIME_LONG handleformchange BS_ATTACKER, 2 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d88bf9944..d510a2746 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3394,10 +3394,18 @@ void SetMoveEffect(bool32 primary, u32 certain) } break; case MOVE_EFFECT_RELIC_SONG: - if (gBattleMons[gBattlerAttacker].species == SPECIES_MELOETTA) + if (GetBattlerAbility(gBattlerAttacker) != ABILITY_SHEER_FORCE) { - gBattleMons[gBattlerAttacker].species = SPECIES_MELOETTA_PIROUETTE; - BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeMoveEffect); + if (gBattleMons[gBattlerAttacker].species == SPECIES_MELOETTA) + { + gBattleMons[gBattlerAttacker].species = SPECIES_MELOETTA_PIROUETTE; + BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeMoveEffect); + } + else if (gBattleMons[gBattlerAttacker].species == SPECIES_MELOETTA_PIROUETTE) + { + gBattleMons[gBattlerAttacker].species = SPECIES_MELOETTA; + BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeMoveEffect); + } } break; } From 6ce1f01b8c92539659687658d1d6041841147382 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Wed, 3 Nov 2021 19:45:03 +1300 Subject: [PATCH 42/72] Hunger Switch and Aura Wheel Implement the ability Hunger Switch and the move Aura Wheel. --- data/battle_scripts_1.s | 12 ++++++++++-- include/constants/battle_config.h | 4 ++++ include/constants/battle_move_effects.h | 3 ++- src/battle_main.c | 4 ++++ src/battle_util.c | 17 +++++++++++++++++ src/data/battle_moves.h | 2 +- src/data/pokemon/base_stats.h | 4 ++-- 7 files changed, 40 insertions(+), 6 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index df0048ad9..8b2d14dc8 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -392,10 +392,18 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectSparklySwirl @ EFFECT_SPARKLY_SWIRL .4byte BattleScript_EffectPlasmaFists @ EFFECT_PLASMA_FISTS .4byte BattleScript_EffectHyperspaceFury @ EFFECT_HYPERSPACE_FURY + .4byte BattleScript_EffectAuraWheel @ EFFECT_AURA_WHEEL + +BattleScript_EffectAuraWheel: @ Aura Wheel can only be used by Morpeko + jumpifspecies BS_ATTACKER, SPECIES_MORPEKO, BattleScript_EffectSpeedUpHit + jumpifspecies BS_ATTACKER, SPECIES_MORPEKO_HANGRY, BattleScript_EffectSpeedUpHit + printstring STRINGID_BUTPOKEMONCANTUSETHEMOVE + waitmessage B_WAIT_TIME_LONG + goto BattleScript_MoveEnd BattleScript_EffectHyperspaceFury: - jumpifspecies BS_ATTACKER, SPECIES_TREECKO, BattleScript_EffectHyperspaceFuryUnbound - jumpifspecies BS_ATTACKER, SPECIES_MUDKIP, BattleScript_ButHoopaCantUseIt + jumpifspecies BS_ATTACKER, SPECIES_HOOPA_UNBOUND, BattleScript_EffectHyperspaceFuryUnbound + jumpifspecies BS_ATTACKER, SPECIES_HOOPA, BattleScript_ButHoopaCantUseIt printstring STRINGID_BUTPOKEMONCANTUSETHEMOVE waitmessage B_WAIT_TIME_LONG goto BattleScript_MoveEnd diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 41fee089d..defc44226 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -47,6 +47,10 @@ #define SPECIES_GRENINJA_ASH 10017 #define SPECIES_HOOPA 0 #define SPECIES_HOOPA_UNBOUND 10018 + #define SPECIES_MELOETTA 0 + #define SPECIES_MELOETTA_PIROUETTE 10019 + #define SPECIES_MORPEKO 0 + #define SPECIES_MORPEKO_HANGRY 10020 #endif // Items with peculiar battle effects. diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 62b49a191..7acb56c93 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -375,7 +375,8 @@ #define EFFECT_SPARKLY_SWIRL 369 #define EFFECT_PLASMA_FISTS 370 #define EFFECT_HYPERSPACE_FURY 371 +#define EFFECT_AURA_WHEEL 372 -#define NUM_BATTLE_MOVE_EFFECTS 372 +#define NUM_BATTLE_MOVE_EFFECTS 373 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/src/battle_main.c b/src/battle_main.c index ad02854bd..12324ef96 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -5221,6 +5221,10 @@ void SetTypeBeforeUsingMove(u16 move, u8 battlerAtk) { gBattleStruct->dynamicMoveType = 0x80 | TYPE_ELECTRIC; } + else if (move == MOVE_AURA_WHEEL && gBattleMons[battlerAtk].species == SPECIES_MORPEKO_HANGRY) + { + gBattleStruct->dynamicMoveType = 0x80 | TYPE_DARK; + } // Check if a gem should activate. GET_MOVE_TYPE(move, moveType); diff --git a/src/battle_util.c b/src/battle_util.c index 224cb1af1..54a755f0e 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -4562,6 +4562,22 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move effect++; } break; + case ABILITY_HUNGER_SWITCH: + if (!(gBattleMons[battler].status2 & STATUS2_TRANSFORMED)) + { + if (gBattleMons[battler].species == SPECIES_MORPEKO) + { + gBattleMons[battler].species = SPECIES_MORPEKO_HANGRY; + BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeEnd3); + } + else if (gBattleMons[battler].species == SPECIES_MORPEKO_HANGRY) + { + gBattleMons[battler].species = SPECIES_MORPEKO; + BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeEnd3); + } + effect++; + } + break; } } break; @@ -8969,6 +8985,7 @@ void UndoFormChange(u32 monId, u32 side, bool32 isSwitchingOut) {SPECIES_WISHIWASHI_SCHOOL, SPECIES_WISHIWASHI}, {SPECIES_CRAMORANT_GORGING, SPECIES_CRAMORANT}, {SPECIES_CRAMORANT_GULPING, SPECIES_CRAMORANT}, + {SPECIES_MORPEKO_HANGRY, SPECIES_MORPEKO} }; if (isSwitchingOut) // Don't revert Mimikyu Busted or Ash-Greninja when switching out diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 97d61202a..51c760166 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -11038,7 +11038,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_AURA_WHEEL] = { - .effect = EFFECT_SPEED_UP_HIT, + .effect = EFFECT_AURA_WHEEL, .power = 110, .type = TYPE_ELECTRIC, .accuracy = 100, diff --git a/src/data/pokemon/base_stats.h b/src/data/pokemon/base_stats.h index 141631643..0014b4437 100644 --- a/src/data/pokemon/base_stats.h +++ b/src/data/pokemon/base_stats.h @@ -6848,7 +6848,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - .abilities = {ABILITY_STURDY, ABILITY_NONE}, + .abilities = {ABILITY_HUNGER_SWITCH, ABILITY_NONE}, .safariZoneFleeRate = 0, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, @@ -7552,7 +7552,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - .abilities = {ABILITY_OWN_TEMPO, ABILITY_NONE}, + .abilities = {ABILITY_HUNGER_SWITCH, ABILITY_NONE}, .safariZoneFleeRate = 0, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, From 5141e84296caff64a298cb46d1cb7f06cd6f35b3 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Wed, 3 Nov 2021 20:01:09 +1300 Subject: [PATCH 43/72] Fix base stats Clean up mess from testing. --- src/data/pokemon/base_stats.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/pokemon/base_stats.h b/src/data/pokemon/base_stats.h index 0014b4437..141631643 100644 --- a/src/data/pokemon/base_stats.h +++ b/src/data/pokemon/base_stats.h @@ -6848,7 +6848,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_MEDIUM_SLOW, .eggGroup1 = EGG_GROUP_BUG, .eggGroup2 = EGG_GROUP_BUG, - .abilities = {ABILITY_HUNGER_SWITCH, ABILITY_NONE}, + .abilities = {ABILITY_STURDY, ABILITY_NONE}, .safariZoneFleeRate = 0, .bodyColor = BODY_COLOR_YELLOW, .noFlip = FALSE, @@ -7552,7 +7552,7 @@ const struct BaseStats gBaseStats[] = .growthRate = GROWTH_FAST, .eggGroup1 = EGG_GROUP_FIELD, .eggGroup2 = EGG_GROUP_FIELD, - .abilities = {ABILITY_HUNGER_SWITCH, ABILITY_NONE}, + .abilities = {ABILITY_OWN_TEMPO, ABILITY_NONE}, .safariZoneFleeRate = 0, .bodyColor = BODY_COLOR_WHITE, .noFlip = FALSE, From b9c23f7c62d74570bf62987c9fc58091b27f21e7 Mon Sep 17 00:00:00 2001 From: Blackforest92 Date: Wed, 3 Nov 2021 16:29:09 +0700 Subject: [PATCH 44/72] Update waterfall, trick room, & focus blast BG --- data/battle_anim_scripts.s | 18 ++++++++++++-- .../battle_anims/backgrounds/dark_void.bin | Bin 2048 -> 0 bytes .../battle_anims/backgrounds/dark_void.pal | 19 --------------- .../battle_anims/backgrounds/dark_void.png | Bin 7041 -> 0 bytes .../backgrounds/new/dark_void.bin | Bin 2048 -> 2048 bytes .../backgrounds/new/dark_void.pal | 16 ++++++------- .../backgrounds/new/dark_void.png | Bin 7041 -> 0 bytes .../backgrounds/new/focus_blast.bin | Bin 896 -> 896 bytes .../backgrounds/new/focus_blast.png | Bin 3537 -> 984 bytes .../backgrounds/new/magic_room.pal | 12 +++++----- .../backgrounds/new/trick_room.bin | Bin 896 -> 896 bytes .../backgrounds/new/trick_room.pal | 12 +++++----- .../backgrounds/new/trick_room.png | Bin 2137 -> 1718 bytes .../backgrounds/new/waterfall.bin | Bin 2048 -> 2048 bytes .../backgrounds/new/waterfall.pal | 8 +++---- .../backgrounds/new/waterfall.png | Bin 5092 -> 814 bytes .../backgrounds/new/wonder_room.pal | 12 +++++----- .../battle_anims/backgrounds/trick_room.png | Bin 2043 -> 0 bytes .../backgrounds/trick_room_map.bin | Bin 1280 -> 0 bytes include/graphics.h | 1 - src/battle_anim.c | 2 +- src/graphics.c | 22 +++++------------- 22 files changed, 53 insertions(+), 69 deletions(-) delete mode 100644 graphics/battle_anims/backgrounds/dark_void.bin delete mode 100644 graphics/battle_anims/backgrounds/dark_void.pal delete mode 100644 graphics/battle_anims/backgrounds/dark_void.png delete mode 100644 graphics/battle_anims/backgrounds/new/dark_void.png delete mode 100644 graphics/battle_anims/backgrounds/trick_room.png delete mode 100644 graphics/battle_anims/backgrounds/trick_room_map.bin diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index 03d72f3ea..cfe95371d 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -1893,7 +1893,7 @@ Move_AURA_SPHERE: monbg ANIM_ATK_PARTNER monbgprio_28 ANIM_ATTACKER setalpha 12, 8 - call SetHighSpeedBg + call SetAuraSphereBG playsewithpan SE_M_SKY_UPPERCUT, 0 delay 60 createsprite gAuraSphereBlast, ANIM_TARGET, 3, 0 @@ -1908,6 +1908,10 @@ Move_AURA_SPHERE: delay 1 end +SetAuraSphereBG: + fadetobg BG_AURA_SPHERE + goto SetHighSpeedBgFade + Move_ROCK_POLISH: loadspritegfx ANIM_TAG_WHITE_STREAK loadspritegfx ANIM_TAG_SPARKLE_3 @@ -2378,7 +2382,7 @@ Move_FOCUS_BLAST: monbg ANIM_ATK_PARTNER monbgprio_28 ANIM_ATTACKER setalpha 12, 8 - call SetHighSpeedBg + call SetFocusBlastBG createsprite gSuperpowerOrbSpriteTemplate, ANIM_TARGET, 2, 0 playsewithpan SE_M_MEGA_KICK, SOUND_PAN_ATTACKER waitforvisualfinish @@ -2391,6 +2395,10 @@ Move_FOCUS_BLAST: delay 1 end +SetFocusBlastBG: + fadetobg BG_FOCUS_BLAST + goto SetHighSpeedBgFade + Move_ENERGY_BALL: loadspritegfx ANIM_TAG_ENERGY_BALL monbg ANIM_TARGET @@ -3437,6 +3445,7 @@ Move_GUNK_SHOT: monbg ANIM_DEF_PARTNER monbgprio_28 ANIM_TARGET setalpha 12, 8 + call SetGunkShotBG createvisualtask AnimTask_ShakeMon 5, 5, ANIM_ATTACKER, 0, 2, 40, 1 delay 6 panse_1B SE_M_HYDRO_PUMP, SOUND_PAN_ATTACKER, SOUND_PAN_TARGET, 2, 0 @@ -3464,6 +3473,7 @@ Move_GUNK_SHOT: call GunkShotImpact call PoisonBubblesEffect waitforvisualfinish + call UnsetHighSpeedBg clearmonbg ANIM_DEF_PARTNER blendoff end @@ -3479,6 +3489,10 @@ GunkShotImpact: createsprite gGunkShotImpactSpriteTemplate, 4, 4, 0, 15, 1, 1 createsprite gGunkShotImpactSpriteTemplate, 4, 4, 0, -15, 1, 1 return +SetGunkShotBG: + fadetobg BG_GUNK_SHOT + goto SetHighSpeedBgFade + Move_IRON_HEAD: loadspritegfx ANIM_TAG_GUST diff --git a/graphics/battle_anims/backgrounds/dark_void.bin b/graphics/battle_anims/backgrounds/dark_void.bin deleted file mode 100644 index 97b879f01ba8ebc08c92d30497c894a1a7b186c8..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 2048 zcmeH`W0Rg)6h-HaZF8-pgO1IPZM$RJwr!_l+qP|IY}=lBlA3=pUAJznefB-)!?{&E zL<~a2Bo?uWLtNq!p9CZ%5s3poNpO>rjO3&sC8Q3JlqG_4l&1m}sYGR}P?c&_rv^2t zMQ!R(mwMEv0S#$HW17&EW;CY-Eont-+7L-w+R>g4bfgoV=|We!(VZUjq!+#ELtpyQ zp8*VH5Q7=QP=+y_5sYLMqZz|k#xb4=Ok@(1nZi`2F`XIAWEQiT!(8Sup9L&r5sO*E zQkJot6|7_xQNhoISj`&NvMx{|*0X_)Y+^H8*c#N^*#64j!A^Fun?3AhANx7LK@M@4 zBOK)z$2q}CPH~zuoaG$nxxhs(ahWSz$y!A)*)n>*a)9`|{`Lmu&%Cp_gD&w0V? zyuq8i#oN5YyS&Hye87i%#K(NXr+miee8HD|#n*hpw|vL<{J@X=#LxV~ul&aE{K236 z#ozqHYle(rOk)|_IL0-e@l9Yt6Pef~CN-JKO<_t?nc6g_HJ$0rU`8{U*(_!iHJjND zGlx0NWp2aGV_x%_-vSo2kcBN`QHxpJ5|%VXDN9=>V2HATddZh3!g7|kLQq$^Beaj3%_?g&RZ%F&K-tm7Q-1SdMl$xd;q z)12-MXFAK-&T+2uobLh`y2!;YajDB(?h04B$|zU6#JKX6m zce}^E?sLBfJm?`0d&Hw2^SCEG=_yZp#3~?@CWcYb6c+pE<_KH`%=5=p)(_7y5 ij(5H1eINMHM?Ut6PkrWdUj%c}`H#+jbpHRZ`TrM_mOTvs diff --git a/graphics/battle_anims/backgrounds/dark_void.pal b/graphics/battle_anims/backgrounds/dark_void.pal deleted file mode 100644 index f4cf0f09d..000000000 --- a/graphics/battle_anims/backgrounds/dark_void.pal +++ /dev/null @@ -1,19 +0,0 @@ -JASC-PAL -0100 -16 -0 0 0 -131 131 131 -123 123 123 -115 115 115 -106 106 106 -98 98 98 -82 82 82 -65 65 65 -49 49 49 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 -0 0 0 diff --git a/graphics/battle_anims/backgrounds/dark_void.png b/graphics/battle_anims/backgrounds/dark_void.png deleted file mode 100644 index 2922f89d3f24a6bb835fe3b53f62bedbd96029c4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7041 zcmV-{8-C=8P)006)Q0{{R3aTRq$0000mP)t-s0001k zgM)i}dvkMhYHDg?Vq#KKQb9pMF)=X!0000000000000000000000000>A(T!000{d zNklBzMqy1kG@V5U84&UNd|U`m`u70$}21}xN$w$UEm45-Eua7F4Dl_ z%}U3h^CuAfBZwr=#hQfqeZuz=QVuE{M9hV|ED48$qAuTnVz0RKzKbmmnh5^CgH(Vq zMy9KEC1n2{sNF&A%J5VH zKv#eoAw#jg1rrb3lI#Mg`AC*U2|2g`P)TI`1Y)8w0MR3ex(4aMNE4uibRQ`)FClK#gz^0m$wk3<(nP ziGdW@D=`?fOekRzbRd*4(%j$<`W*C0pdA~*9C@3Ms&$EC6jr9(k3s76*IRQ{x?JQHr187nPAc1&iDVt%HMF6gPkO(kc=^>FL$H#UufJT6A z4yw5$dppb1G4?rVa?k`2;=Kc14sI;$>piGQ#mWe&9)*Ey=h#prG&fu$(EwZuFwSiN zHQ#|ivLuT#j~EDw0#5X ze(0K#g)FTDeaS7|C4O=8zx|psYq)8%5ht&O;8$m`zc+n`Wl5$pR(hAVte*G%d7bue@0=WopDH zCw62zUU-(|Q{Qr90F!`5jk}g#S34W6K0-ZD0n}vKR8e`DWu~*qQY9?qsY)?`v%&^& zZ@t#pEU#zDOm^ZBS}Q=l?Z$3MlN3cwR2eUuL!d<;nNy^bK4|4WXd~XAf+#W}=J-cU z(giM6c;GrL!U+^W@us*w%+}rv3ZRCyGE=Fxe&q$oC;qHR0n|6rN+K&e;+;@{7*P(g z9@JovaNJ1FkqzK02P3E;d`` z1mH{Zm(l!Q?vwRa5OR?R5Y1qq<(NlX7_}IxxrH`(ncoGmG6eFl21`6c;Xw zWYmG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{7;WEl zia&yN^1Qf}PkEj)TIj3zNATgqTdwUnMTVTJZK`{kwk`gjVE?U-N&Bx3a`OKLhvt=l fY?_!zfAanZtmW~3kuXOo00000NkvXXu0mjf6ZK=N diff --git a/graphics/battle_anims/backgrounds/new/dark_void.bin b/graphics/battle_anims/backgrounds/new/dark_void.bin index 97b879f01ba8ebc08c92d30497c894a1a7b186c8..274b971db6077f17e2f02b8620be277d724c249b 100644 GIT binary patch literal 2048 zcmajcRaOE300q$_1|}sYNQl6IV-XS(``?x9;GOxrpR;%8){TFzUAc7OuXATkogDgc zANMq@`@Y%p)vn(rZ`<<4rVXEc^3ezHy|eDEHLG?^Ubf_o*Is$)h36JM z^VAcMEqG+btW@W>O-G-&cdi#EwC98uty6HYm!$T=5Wa>X?_lqi!t{Y{?!CQpBpr@zV5-{k3U z^7J=(`kOrcO`iTHPk)oAzsb|zn>_tZp8h6Jf0L)b$2LD%H+lM- F{2%-zDKG#4 literal 2048 zcmeH`W0Rg)6h-HaZF8-pgO1IPZM$RJwr!_l+qP|IY}=lBlA3=pUAJznefB-)!?{&E zL<~a2Bo?uWLtNq!p9CZ%5s3poNpO>rjO3&sC8Q3JlqG_4l&1m}sYGR}P?c&_rv^2t zMQ!R(mwMEv0S#$HW17&EW;CY-Eont-+7L-w+R>g4bfgoV=|We!(VZUjq!+#ELtpyQ zp8*VH5Q7=QP=+y_5sYLMqZz|k#xb4=Ok@(1nZi`2F`XIAWEQiT!(8Sup9L&r5sO*E zQkJot6|7_xQNhoISj`&NvMx{|*0X_)Y+^H8*c#N^*#64j!A^Fun?3AhANx7LK@M@4 zBOK)z$2q}CPH~zuoaG$nxxhs(ahWSz$y!A)*)n>*a)9`|{`Lmu&%Cp_gD&w0V? zyuq8i#oN5YyS&Hye87i%#K(NXr+miee8HD|#n*hpw|vL<{J@X=#LxV~ul&aE{K236 z#ozqHYle(rOk)|_IL0-e@l9Yt6Pef~CN-JKO<_t?nc6g_HJ$0rU`8{U*(_!iHJjND zGlx0NWp2aGV_x%_-vSo2kcBN`QHxpJ5|%VXDN9=>V2HATddZh3!g7|kLQq$^Beaj3%_?g&RZ%F&K-tm7Q-1SdMl$xd;q z)12-MXFAK-&T+2uobLh`y2!;YajDB(?h04B$|zU6#JKX6m zce}^E?sLBfJm?`0d&Hw2^SCEG=_yZp#3~?@CWcYb6c+pE<_KH`%=5=p)(_7y5 ij(5H1eINMHM?Ut6PkrWdUj%c}`H#+jbpHRZ`TrM_mOTvs diff --git a/graphics/battle_anims/backgrounds/new/dark_void.pal b/graphics/battle_anims/backgrounds/new/dark_void.pal index f4cf0f09d..6aa0b26a6 100644 --- a/graphics/battle_anims/backgrounds/new/dark_void.pal +++ b/graphics/battle_anims/backgrounds/new/dark_void.pal @@ -2,14 +2,14 @@ JASC-PAL 0100 16 0 0 0 -131 131 131 -123 123 123 -115 115 115 -106 106 106 -98 98 98 -82 82 82 -65 65 65 -49 49 49 +48 48 48 +72 72 72 +88 88 88 +120 120 120 +0 0 0 +0 0 0 +0 0 0 +0 0 0 0 0 0 0 0 0 0 0 0 diff --git a/graphics/battle_anims/backgrounds/new/dark_void.png b/graphics/battle_anims/backgrounds/new/dark_void.png deleted file mode 100644 index 2922f89d3f24a6bb835fe3b53f62bedbd96029c4..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 7041 zcmV-{8-C=8P)006)Q0{{R3aTRq$0000mP)t-s0001k zgM)i}dvkMhYHDg?Vq#KKQb9pMF)=X!0000000000000000000000000>A(T!000{d zNklBzMqy1kG@V5U84&UNd|U`m`u70$}21}xN$w$UEm45-Eua7F4Dl_ z%}U3h^CuAfBZwr=#hQfqeZuz=QVuE{M9hV|ED48$qAuTnVz0RKzKbmmnh5^CgH(Vq zMy9KEC1n2{sNF&A%J5VH zKv#eoAw#jg1rrb3lI#Mg`AC*U2|2g`P)TI`1Y)8w0MR3ex(4aMNE4uibRQ`)FClK#gz^0m$wk3<(nP ziGdW@D=`?fOekRzbRd*4(%j$<`W*C0pdA~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4sYeG&k!}I^(iTm_4%cpj8m;m^LLsi$Nap$Pydef@)Y76r_-0DVRiCSE18k~SbzNW z`F6W(TklV4nO5hY?Zfo8ZGWd(ax6znR@zgu{_MfLaqINuqGnF^v-JW}+6)aJQ8~e4*&5gei08>zCy;%T@}2N=__hPklXf ziu4A;q~YGkW%mdtJtQmcV8+sA_3}2))*X1H7IR(#BMrx(L}*w4Ht~l3hQG}yPOf$N zR{gbKuB)vAk3%rL_@?uc7-?E&;vuqI+5v+#&%T^Y%I-b*JCS$2GmrRozg1mDQaKpD zrcRO7%d)A&_uvTiU_YF?cTmz6L)5|ml|r}m z=_pn8>vg4?>cvmJ^tGJTRnvS2qA>_$n3Z)|1Z-&U5!kMGs{e8ciXi(dTksxp1E2r7 z=Xe`U8~X9E+X}B+*)xRK_2QxKcQHh@$JgDmE$g)UQ7w7)eDbHQD_rTLAw>Gj6<-u4 z!O-3$l)l|6(YEIwjaZiVPhgu2|8`KQBE5XMg&RD<8;|{51mr(}^*xu`&v?4{7;WEl zia&yN^1Qf}PkEj)TIj3zNATgqTdwUnMTVTJZK`{kwk`gjVE?U-N&Bx3a`OKLhvt=l fY?_!zfAanZtmW~3kuXOo00000NkvXXu0mjf6ZK=N diff --git a/graphics/battle_anims/backgrounds/new/focus_blast.bin b/graphics/battle_anims/backgrounds/new/focus_blast.bin index 98e3e8e16b63fe73c0fb8cc7adc2cc1630bd3359..25c569a1465844e30b2dbf039894446f4cc7e984 100644 GIT binary patch literal 896 zcmWN|S35EQ00rPDlqf2DJ8^L2*dbeHWbe%EUH|{?``-IEfB-5`i7EsULN&suK`kPP zq7LaA z#ZGpxoo#Go3!B-*Mm8|PIDsVk&<|n&gBXG^j1)#-jA9Jq80Q#AX^t?(VTwZ>PSaE^nv%C_nvp1^NzQ@mB`s@3t6KGnm%ZdgFL>S=&w17}PJ7x@p7eyFr25n^YCwY;k~FN8 zMr4g@Oye5&m`81oIOSo>Lmu>i>3;V)X*jNg8q}yJHLFFfYE!#9)Tu6Yt4F=+b&tE< zBomp*LRPX7L3VPGlU(E`Pf#Rz$w&Th7oZ@8C`=KGQjFr1 z0Hh?PLPk-V=)h7YP+7`Ro(fc?5|yb!RjN^)8q}l~wZov8qknNG^PnnX-0Ee z5JN02X+>+=5Jy|u(Vh-;q!XQqrwd)_Mt6G9lV0?u4}IxJe+Dp+K@4UHLm9?!Mlh05 zjAjgDNnjk~nZQIQF_|e$Wg63&!AugF#cbvmXSEO(fD_KP{ zt69TZ*0G)qY-AIg*}_(~@i33@D37t79qeQmkMjgi@)S?=47=IGvpmQ1yue=e@ggs= zp937^5HIrzucqj=)P6ms-$=dQ4E+{|Il@tn1%8`%LLN`a6M;^0iqo9oUEbq;KHx0p z_>hnIm{0hW&p6KoJ`ehWi(KMMzT#`X;d00;T;&?qxxu%5$M^h@+CTCWH@U^n{KBvN z7IZt%9e(Ez{^T$I<{$2IkAL}(|GCdYrZKJQOm7A=n#s&&F{{~(FuOU-X)be{$4K*< z&-@m!poJ`K5sO;P;+7D#q@|3qw9$d0En`{BS>6g(w33yrVpXeI-5S=kmbI;8UF%uj z1~#;jjcsC6o7vnJ#u#f$TiMz+#@W_(wzorYM>~b=Y`k6UYB#&v!=CoCw|(quKl=v_ zaG--6>=1`K%;Ao3q@x_|7{{96ILAA|iB58|Q=IBFr#r)$COXU6&T+2uobLh`y2!;Y fajDB(?h2D!=_-@MYIRs82CZ?e>s;@K@VC(i6Oa3q diff --git a/graphics/battle_anims/backgrounds/new/focus_blast.png b/graphics/battle_anims/backgrounds/new/focus_blast.png index 8720658a784516bc636fe2156fc769109f312fda..7c8755f59a7d5666663c87dab82325fa8146d99b 100644 GIT binary patch delta 937 zcmV;a16KUe8`uXSiBL{Q4GJ0x0000DNk~Le0001h0000u1Oos70LO{#;E^Fde*g(^ zNLh0L01m_e01m_fl`9S#0009{Nkl8+!moz^9mCiv!i*wgtX?JMlzs8zU^*L!rwKCHTCV2=@AVV(Ql)G3rS7}s-Tb^fub zR)j)P6!=`%+FD!t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D;U0lHaC?6rCN+|8kmbu8Q}(ENC1~ed1)i|uYiC#2*oAM*h^9_Py@wcsGz?l zal6--4Lu|W*0Bsve*0q_Ap_m(zvPE~&&XFh27kUwbBEdxaz(o$y0EN?6|GQGxHnG*l_Xo*`BBX}%pg1JfOaWq*Kor@dgC=8VTXTE zNmOtbnl*d!?1S8Sq$yHAbUfs5M#l>s<(iL)qS~hi045P<1P`HBb7@f}t1v`a@0egQ z+J75MzhV%isv}GE^Uq*J2Du{mhDR9EzmRAfK2Q(~Q%C1IbRl9&b~C(cfGIX3Qnj=T zpWvRlVg5~#l0pr=T=ATm91P-F!l2~yZYRh^1=&MG3!SL1^pz}^T1zDEe=cC8JjYYV zi$Y`eKg`HI&;R>$su>UxomRm}fRI5cH-FzjlqZ0YbSz3f6q{*&O>>6gfKj=lO0M}j z^#}~|-)ISoB{aYx$|UIO9f00OYHlMqrZ+6XTvXbDW5x#wTu<@9ebl`W5{0> zUMw;5$B!?S(m@68SaXrG;#m~(r zfKjykRp>dMAAEAq*K|txKvIH@B!4ql45YFmT`ZLC+d1y5xG_>g!bw{~T}_iE&G-=_ z+1NdnZQDNo_dMu;L3bMSP=59S#!W=re@NVg(jQ*|3^C)@NveY|-T4cEq0zXNnV`h* zUgLikU{nUqkb1q3<&&aYaF@s#C0GMzkl)AG06$z0um$R?htg4T}%J~ N002ovPDHLkV1m*T11kUk diff --git a/graphics/battle_anims/backgrounds/new/waterfall.bin b/graphics/battle_anims/backgrounds/new/waterfall.bin index 076beeff2fe1ba44277bad014102fbcc7c3180bc..eb2085cb29530c90e242b6f08d485c95a2d228ba 100644 GIT binary patch literal 2048 zcmajc*;WAn00!YhB(gVK z<%9PwT{w5{Y{?!CQpBpr@zV5-{k3U z^7J=(`kOrcO`iTHPk)oAzsb|zn>_tZp8h6Jf0L)b$2LD%H+lM- F{2!U)2`~Tv literal 2048 zcmXw21(a1s6yxK%xG#`Ef-dgv?(XjH?(E|3&f@NFEmWZH?nUbEUOIf}nUmZkcix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/waterfall.pal b/graphics/battle_anims/backgrounds/new/waterfall.pal index 1ae2f0ef9..69a25c589 100644 --- a/graphics/battle_anims/backgrounds/new/waterfall.pal +++ b/graphics/battle_anims/backgrounds/new/waterfall.pal @@ -2,10 +2,10 @@ JASC-PAL 0100 16 0 0 0 -131 205 230 -123 180 213 -115 156 205 -115 139 164 +128 200 232 +120 176 216 +112 152 200 +112 136 160 0 0 0 0 0 0 0 0 0 diff --git a/graphics/battle_anims/backgrounds/new/waterfall.png b/graphics/battle_anims/backgrounds/new/waterfall.png index 2fa27759f34a96ef3f362b934933b038629c3501..3ddb1a0a2662eacdca77c95a78e0e55b8c203be0 100644 GIT binary patch delta 798 zcmV+(1L6GSC$0uKiBL{Q4GJ0x0000DNk~Le0001h0000W1Oos704NM?761SMFi=cX zMF0Q*fXL{0u-I^z$Z&|DkwF-dPzir|U}`!5000SaNLh0L01m_e01m_fl`9S#0007{ zNkl0ZA^^ErB1^Q}sp`(!6_8QE z>`bjv>n(qp@@*_b7U!VSIpwCA0eDnS8Mfqlol|`R(3Vi>s$5AMzOT-A2^p$3xlU`_ zZlkmeUO~U&O6;9fd*^Z#DLH??#IrU#MU_Im;qsoHtIjnL8YW?-xHIxQbI!t+lN5T1 zRdv~L`$ze*vNo<8OfS4q^$Bpp+7fFVuI62hc@+uH%G4#u6l-bJqsA+{uIaT&UAdir zF!!)fJP)SsZc2@D9A9F zyRPE40)VDGxCH=tUu0(8b_F;D3nx3k@E}Y8D|Hh9guL69dbH*XZc@Dzj5H`f)3yU_ zDgc*KW8)rB5V8RP`Joz%Hl+iAxiJp|w_tB!9RPS69SYR72Nbw9e_enr_Pqp|c0BA* zegMQ`0H6T31lN23&`^JL>j2<ZmpW?;Y*|IJdqDK)tc6 zjq2m4P!Ri^0q7rqFuMVUiLQE$fPv2mhzsy8YaUMk#Oi1&rh;0Lep3)nz!xnsn;i=5 z@*tiHJU(7NcI#%pIi~gn{RaH_<~kIN`4?b%aKzsMXT5XQ^@{m7Kzy`t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eH?f3a)Ai zhumn=G$0}>8<_+gR}rZ-EM26Z1}Gp2Ni}q2gdY|L8O+_Retak`J;*${qG8cBDyN&t zk^K>P1}k0+T(6gcCL&V#ySt-2O#ge|f-szUmy4h~T2Tqa$K0r-{F3zy47&u!QC|WJ zjc3D3&l+$v8{T-NN9$GjHRQ&XO|wFaQcEYTk?pspP#!I`?0B^vF9rW%AJ1*NvdGaT zK3(Gqc|YSTTteqOH?_yLLw+pA?I2rhGtG1JG-v)*16^C<3C*v#u+!2Bdl&CseAS)9 z6voxvk2MFW(A+WA9;7N1`FbEPCsCMwsI7-Ictq?m%nRXbDmgk}eZ?pxKT zLG$tIG+HKl)AjWCaNWCF$ZYup`91G*;gkY{aCvenWnIN!>^63KP{7OHORdkU1rLhN z{e49tzGx!b)$-2MC9f4N&wClF)Z@zko-F!kn8>vkV=gjRhNaCBRu3#MwQAxrg?HHY zTjhMQM?@GK{f-1KQx9L#Ul!jylt2->wZQRhcP2WShU|omg#$$6KMCgnWk!UT6S1IaD@&dxDlMyON|85fHe3i04To!5(R z<+#SQhF)(A)42-(^o;k=925$YNldTnrqu+q2U&+kqz)%ocFbv)#0teNTh44OS3G#a>i(Fk+TLn*4w+x S`O;MX>!Y!D&bBNJ5c3m?gK+-< diff --git a/graphics/battle_anims/backgrounds/trick_room_map.bin b/graphics/battle_anims/backgrounds/trick_room_map.bin deleted file mode 100644 index 3d0041baaa897abd0ec1395b944b28a804c89c2f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1280 zcmeIuMVA#<6hPs|-Q7Q&;1b;3-GW1Kcc+11!QF#HBf+I{|7DzaCop30CQP`s_CDuU ztv#uN3MiN*IdKXp>^nt%*fZ~ce$Vtp6_YKQzPJ*yCDWHwO15PB(#pt|OkY+x6`gOb1k&gN^5Pj)lPdI{Hdc(I_sjV zZo2ECr(SyNqi@{$1^rV$z(9ixHpEcF3^&3^ql`AjSmTU0!9JPXB~= z*&W^!-*W8@a_vk0H+g^Zfz%&#$YDnu4Igvd2`8P3{j@XAI_G@y1s7xg&!zBXSHf3a zOZ{~>+;mHx+wO$#x)=W6eGg(j^eFt;lW?A=$Z`18v@_QfB V{Fwa7=QO`0e+}pSKEM1Ad;`R~qc8vf diff --git a/include/graphics.h b/include/graphics.h index 78d9f2c42..34eef131e 100644 --- a/include/graphics.h +++ b/include/graphics.h @@ -4941,7 +4941,6 @@ extern const u32 gBattleAnimBgImage_SpacialRend[]; extern const u32 gBattleAnimBgPalette_SpacialRend[]; extern const u32 gBattleAnimBgTilemap_SpacialRendOpponent[]; extern const u32 gBattleAnimBgTilemap_SpacialRendPlayer[]; -extern const u32 gBattleAnimBgImage_DarkVoid[]; extern const u32 gBattleAnimBgPalette_DarkVoid[]; extern const u32 gBattleAnimBgTilemap_DarkVoid[]; extern const u32 gBattleAnimBgPalette_Dark[]; diff --git a/src/battle_anim.c b/src/battle_anim.c index 44a382296..b52ef0592 100644 --- a/src/battle_anim.c +++ b/src/battle_anim.c @@ -2059,7 +2059,7 @@ const struct BattleAnimBackground gBattleAnimBackgroundTable[] = [BG_ROCK_WRECKER] = {gBattleAnimBgImage_Hurricane, gBattleAnimBgPalette_RockWrecker, gBattleAnimBgTilemap_Hurricane}, [BG_SPACIAL_REND_ON_OPPONENT] = {gBattleAnimBgImage_SpacialRend, gBattleAnimBgPalette_SpacialRend, gBattleAnimBgTilemap_SpacialRendOpponent}, [BG_SPACIAL_REND_ON_PLAYER] = {gBattleAnimBgImage_SpacialRend, gBattleAnimBgPalette_SpacialRend, gBattleAnimBgTilemap_SpacialRendPlayer}, - [BG_DARK_VOID] = {gBattleAnimBgImage_DarkVoid, gBattleAnimBgPalette_DarkVoid, gBattleAnimBgTilemap_DarkVoid}, + [BG_DARK_VOID] = {gBattleAnimBgImage_Waterfall, gBattleAnimBgPalette_DarkVoid, gBattleAnimBgTilemap_DarkVoid}, [BG_WATER] = {gBattleAnimBgImage_HydroPump, gBattleAnimBgPalette_HydroPump, gBattleAnimBgTilemap_HydroPump}, [BG_NIGHTMARE] = {gBattleAnimBgImage_Nightmare, gBattleAnimBgPalette_Nightmare, gBattleAnimBgTilemap_Nightmare}, [BG_LEAF_STORM] = {gBattleAnimBgImage_LeafStorm, gBattleAnimBgPalette_LeafStorm, gBattleAnimBgTilemap_LeafStorm}, diff --git a/src/graphics.c b/src/graphics.c index 5ba3af42b..153d75c71 100644 --- a/src/graphics.c +++ b/src/graphics.c @@ -1397,10 +1397,6 @@ const u32 gBattleAnimBgPalette_MagmaStorm[] = INCBIN_U32("graphics/battle_anims/ //new battle bgs const u32 gBattleAnimBgPalette_GigaImpact[] = INCBIN_U32("graphics/battle_anims/backgrounds/giga_impact.gbapal.lz"); -//const u32 gBattleAnimBgImage_TrickRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/trick_room.4bpp.lz"); -//const u32 gBattleAnimBgPalette_TrickRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/trick_room.gbapal.lz"); -//const u32 gBattleAnimBgTilemap_TrickRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/trick_room_map.bin.lz"); - const u32 gBattleAnimBgImage_Hurricane[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hurricane.4bpp.lz"); const u32 gBattleAnimBgPalette_Hurricane[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hurricane.gbapal.lz"); const u32 gBattleAnimBgTilemap_Hurricane[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/hurricane.bin.lz"); @@ -1412,11 +1408,6 @@ const u32 gBattleAnimBgPalette_SpacialRend[] = INCBIN_U32("graphics/battle_anims const u32 gBattleAnimBgTilemap_SpacialRendOpponent[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend_opponent.bin.lz"); const u32 gBattleAnimBgTilemap_SpacialRendPlayer[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/spacial_rend_player.bin.lz"); -const u32 gBattleAnimBgImage_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/dark_void.4bpp.lz"); -const u32 gBattleAnimBgPalette_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/dark_void.gbapal.lz"); -const u32 gBattleAnimBgTilemap_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/dark_void.bin.lz"); - - const u32 gBattleAnimBgPalette_SludgeWave[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/sludge_wave.gbapal.lz"); const u32 gBattleAnimBgImage_Aeroblast[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/aeroblast_tiles.4bpp.lz"); @@ -1441,10 +1432,6 @@ const u32 gBattleAnimBgImage_ClangorousSoulblaze[] = INCBIN_U32("graphics/battle const u32 gBattleAnimBgPalette_ClangorousSoulblaze[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/clangorous_soulblaze.gbapal.lz"); const u32 gBattleAnimBgTilemap_ClangorousSoulblaze[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/clangorous_soulblaze.bin.lz"); -//const u32 gBattleAnimBgImage_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/dark_void.4bpp.lz"); -//const u32 gBattleAnimBgPalette_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/dark_void.gbapal.lz"); -//const u32 gBattleAnimBgTilemap_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/dark_void.bin.lz"); - const u32 gBattleAnimBgPalette_DynamaxCannon[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/dynamax_cannon.gbapal.lz"); const u32 gBattleAnimBgImage_ElectricTerrain[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/electric_terrain.4bpp.lz"); @@ -1497,8 +1484,6 @@ const u32 gBattleAnimBgImage_LeafStorm[] = INCBIN_U32("graphics/battle_anims/bac const u32 gBattleAnimBgPalette_LeafStorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/leaf_storm.gbapal.lz"); const u32 gBattleAnimBgTilemap_LeafStorm[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/leaf_storm.bin.lz"); -const u32 gBattleAnimBgPalette_MagicRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/magic_room.gbapal.lz"); - const u32 gBattleAnimBgImage_MaliciousMoonsault[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/malicious_moonsault.4bpp.lz"); const u32 gBattleAnimBgPalette_MaliciousMoonsault[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/malicious_moonsault.gbapal.lz"); const u32 gBattleAnimBgTilemap_MaliciousMoonsault[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/malicious_moonsault.bin.lz"); @@ -1553,6 +1538,10 @@ const u32 gBattleAnimBgImage_TrickRoom[] = INCBIN_U32("graphics/battle_anims/bac const u32 gBattleAnimBgPalette_TrickRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/trick_room.gbapal.lz"); const u32 gBattleAnimBgTilemap_TrickRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/trick_room.bin.lz"); +const u32 gBattleAnimBgPalette_MagicRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/magic_room.gbapal.lz"); + +const u32 gBattleAnimBgPalette_WonderRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/wonder_room.gbapal.lz"); + const u32 gBattleAnimBgImage_TwinkleTackle[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/twinkle_tackle.4bpp.lz"); const u32 gBattleAnimBgPalette_TwinkleTackle[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/twinkle_tackle.gbapal.lz"); const u32 gBattleAnimBgTilemap_TwinkleTackle[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/twinkle_tackle.bin.lz"); @@ -1565,7 +1554,8 @@ const u32 gBattleAnimBgImage_Waterfall[] = INCBIN_U32("graphics/battle_anims/bac const u32 gBattleAnimBgPalette_Waterfall[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/waterfall.gbapal.lz"); const u32 gBattleAnimBgTilemap_Waterfall[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/waterfall.bin.lz"); -const u32 gBattleAnimBgPalette_WonderRoom[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/wonder_room.gbapal.lz"); +const u32 gBattleAnimBgPalette_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/dark_void.gbapal.lz"); +const u32 gBattleAnimBgTilemap_DarkVoid[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/dark_void.bin.lz"); const u32 gBattleAnimBgImage_ZMoveActivate[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/zmove_activate.4bpp.lz"); const u32 gBattleAnimBgPalette_ZMoveActivate[] = INCBIN_U32("graphics/battle_anims/backgrounds/new/zmove_activate.gbapal.lz"); From 7e6e23005be4bbfbffda03be99c5db0c64ae892d Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Wed, 3 Nov 2021 13:59:26 -0400 Subject: [PATCH 45/72] fix clear body --- src/battle_script_commands.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 2ee80557f..500b7cab0 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2586,7 +2586,7 @@ void SetMoveEffect(bool32 primary, u32 certain) s32 i, byTwo, affectsUser = 0; bool32 statusChanged = FALSE; bool32 mirrorArmorReflected = (GetBattlerAbility(gBattlerTarget) == ABILITY_MIRROR_ARMOR); - u32 flags; + u32 flags = 0; switch (gBattleScripting.moveEffect) // Set move effects which happen later on { @@ -3017,7 +3017,7 @@ void SetMoveEffect(bool32 primary, u32 certain) case MOVE_EFFECT_SP_DEF_MINUS_1: case MOVE_EFFECT_ACC_MINUS_1: case MOVE_EFFECT_EVS_MINUS_1: - flags = affectsUser | certain; + flags = affectsUser; if (mirrorArmorReflected && !affectsUser) flags |= STAT_BUFF_ALLOW_PTR; @@ -3064,7 +3064,7 @@ void SetMoveEffect(bool32 primary, u32 certain) case MOVE_EFFECT_SP_DEF_MINUS_2: case MOVE_EFFECT_ACC_MINUS_2: case MOVE_EFFECT_EVS_MINUS_2: - flags = affectsUser | certain; + flags = affectsUser; if (mirrorArmorReflected && !affectsUser) flags |= STAT_BUFF_ALLOW_PTR; if (ChangeStatBuffs(SET_STAT_BUFF_VALUE(2) | STAT_BUFF_NEGATIVE, @@ -9567,7 +9567,7 @@ static u32 ChangeStatBuffs(s8 statValue, u32 statId, u32 flags, const u8 *BS_ptr bool32 certain = FALSE; bool32 notProtectAffected = FALSE; u32 index; - bool32 affectsUser = flags & MOVE_EFFECT_AFFECTS_USER; + bool32 affectsUser = (flags & MOVE_EFFECT_AFFECTS_USER); if (affectsUser) gActiveBattler = gBattlerAttacker; From 48c29a9cd823ea7d9b000c493ef52e925c467aba Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Wed, 3 Nov 2021 15:05:52 -0400 Subject: [PATCH 46/72] proper mirror armor sticky web targeting --- asm/macros/battle_script.inc | 4 ++-- data/battle_scripts_1.s | 5 +++-- include/battle.h | 1 + include/constants/battle_script_commands.h | 2 +- src/battle_main.c | 8 ++++++++ src/battle_script_commands.c | 24 +++++++--------------- 6 files changed, 22 insertions(+), 22 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 6b2c248db..328780f53 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1839,8 +1839,8 @@ various BS_ATTACKER, VARIOUS_TRY_TO_CLEAR_PRIMAL_WEATHER .endm - .macro getrandommirrorarmortarget - various BS_TARGET, VARIOUS_GET_RANDOM_MIRROR_ARMOR_TARGET + .macro setattackertostickywebuser + various BS_TARGET, VARIOUS_SET_ATTACKER_STICKY_WEB_USER .endm .macro getrototillertargets ptr:req diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index eb80a41d5..36ae4d967 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -2910,10 +2910,11 @@ BattleScript_MirrorArmorReflectWontFall: copybyte gBattlerTarget, gBattlerAttacker @ STRINGID_STATSWONTDECREASE uses target goto BattleScript_MirrorArmorReflectPrintString +@ gBattlerTarget is battler with Mirror Armor BattleScript_MirrorArmorReflectStickyWeb: call BattleScript_AbilityPopUp - getrandommirrorarmortarget - jumpifbyteequal gBattlerTarget, gBattlerAttacker, BattleScript_AbilityNoSpecificStatLossPrint + setattackertostickywebuser + jumpifbyteequal gBattlerAttacker, gBattlerTarget, BattleScript_StickyWebOnSwitchInEnd @ Sticky web user not on field -> no stat loss goto BattleScript_MirrorArmorReflectStatLoss BattleScript_StatDown:: diff --git a/include/battle.h b/include/battle.h index 5e5aa2479..770d826a5 100644 --- a/include/battle.h +++ b/include/battle.h @@ -612,6 +612,7 @@ struct BattleStruct struct StolenItem itemStolen[PARTY_SIZE]; // Player's team that had items stolen (two bytes per party member) u8 blunderPolicy:1; // should blunder policy activate u8 ballSpriteIds[2]; // item gfx, window gfx + u8 stickyWebUser; }; #define GET_MOVE_TYPE(move, typeArg) \ diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 5034c4f56..3b4495208 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -197,7 +197,7 @@ #define VARIOUS_UPDATE_ABILITY_POPUP 124 #define VARIOUS_JUMP_IF_WEATHER_AFFECTED 125 #define VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED 126 -#define VARIOUS_GET_RANDOM_MIRROR_ARMOR_TARGET 127 +#define VARIOUS_SET_ATTACKER_STICKY_WEB_USER 127 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/src/battle_main.c b/src/battle_main.c index ad02854bd..f1adb1bfb 100644 --- a/src/battle_main.c +++ b/src/battle_main.c @@ -2933,6 +2933,8 @@ static void BattleStartClearSetData(void) gBattleStruct->mega.triggerSpriteId = 0xFF; + gBattleStruct->stickyWebUser = 0xFF; + for (i = 0; i < PARTY_SIZE; i++) { gBattleStruct->usedHeldItems[i][0] = 0; @@ -3030,6 +3032,9 @@ void SwitchInClearSetData(void) gBattleStruct->lastTakenMoveFrom[gActiveBattler][3] = 0; gBattleStruct->lastMoveFailed &= ~(gBitTable[gActiveBattler]); gBattleStruct->palaceFlags &= ~(gBitTable[gActiveBattler]); + + if (gActiveBattler == gBattleStruct->stickyWebUser) + gBattleStruct->stickyWebUser = 0xFF; // Switched into sticky web user slot so reset it for (i = 0; i < gBattlersCount; i++) { @@ -3127,6 +3132,9 @@ void FaintClearSetData(void) gBattleStruct->lastTakenMoveFrom[gActiveBattler][3] = 0; gBattleStruct->palaceFlags &= ~(gBitTable[gActiveBattler]); + + if (gActiveBattler == gBattleStruct->stickyWebUser) + gBattleStruct->stickyWebUser = 0xFF; // User of sticky web fainted, so reset the stored battler ID for (i = 0; i < gBattlersCount; i++) { diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 500b7cab0..3d5786b35 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9015,24 +9015,13 @@ static void Cmd_various(void) gBattlescriptCurrInstr += 7; } return; - case VARIOUS_GET_RANDOM_MIRROR_ARMOR_TARGET: - i = BATTLE_OPPOSITE(gActiveBattler); - gBattlerAttacker = gBattlerTarget; - if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE) - { - if (IsBattlerAlive(i) - && !(gBattleMons[i].status2 & STATUS2_SUBSTITUTE)) - gBattlerAttacker = i; - else if (IsBattlerAlive(BATTLE_PARTNER(i)) - && !(gBattleMons[BATTLE_PARTNER(i)].status2 & STATUS2_SUBSTITUTE)) - gBattlerAttacker = BATTLE_PARTNER(i); - } - else - { - if (IsBattlerAlive(i) && !(gBattleMons[i].status2 & STATUS2_SUBSTITUTE)) - gBattlerAttacker = i; - } + case VARIOUS_SET_ATTACKER_STICKY_WEB_USER: + // For Mirror Armor: "If the Pokémon with this Ability is affected by Sticky Web, the effect is reflected back to the Pokémon which set it up. + // If Pokémon which set up Sticky Web is not on the field, no Pokémon have their Speed lowered." + gBattlerAttacker = gBattlerTarget; // Initialize 'fail' condition SET_STATCHANGER(STAT_SPEED, 1, TRUE); + if (gBattleStruct->stickyWebUser != 0xFF) + gBattlerAttacker = gBattleStruct->stickyWebUser; break; } @@ -11590,6 +11579,7 @@ static void Cmd_setstickyweb(void) { gSideStatuses[targetSide] |= SIDE_STATUS_STICKY_WEB; gSideTimers[targetSide].stickyWebAmount = 1; + gBattleStruct->stickyWebUser = gBattlerAttacker; // For Mirror Armor gBattlescriptCurrInstr += 5; } } From f0d7c75ec899bf3962794eb19f2be9b1f8099222 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Wed, 3 Nov 2021 17:48:04 -0300 Subject: [PATCH 47/72] Syntax corrections --- data/battle_scripts_1.s | 2 +- src/battle_util.c | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 8c3e744c1..aa6c10bcb 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -1925,7 +1925,7 @@ BattleScript_MimicryLoop_NextBattler: addbyte gBattlerTarget, 0x1 jumpifbytenotequal gBattlerTarget, gBattlersCount, BattleScript_MimicryLoopIter restoretarget - end + goto BattleScript_MoveEnd BattleScript_EffectTopsyTurvy: attackcanceler diff --git a/src/battle_util.c b/src/battle_util.c index 00e323d20..45cba507b 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -2319,8 +2319,10 @@ u8 DoFieldEndTurnEffects(void) { gFieldStatuses &= ~(STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_TERRAIN_PERMANENT); for (i = 0; i < MAX_BATTLERS_COUNT; i++) + { if (GetBattlerAbility(i) == ABILITY_MIMICRY) RestoreBattlerOriginalTypes(i); + } BattleScriptExecute(BattleScript_ElectricTerrainEnds); effect++; } @@ -2332,8 +2334,10 @@ u8 DoFieldEndTurnEffects(void) { gFieldStatuses &= ~(STATUS_FIELD_MISTY_TERRAIN); for (i = 0; i < MAX_BATTLERS_COUNT; i++) + { if (GetBattlerAbility(i) == ABILITY_MIMICRY) RestoreBattlerOriginalTypes(i); + } BattleScriptExecute(BattleScript_MistyTerrainEnds); effect++; } @@ -2347,8 +2351,10 @@ u8 DoFieldEndTurnEffects(void) { gFieldStatuses &= ~(STATUS_FIELD_GRASSY_TERRAIN); for (i = 0; i < MAX_BATTLERS_COUNT; i++) + { if (GetBattlerAbility(i) == ABILITY_MIMICRY) RestoreBattlerOriginalTypes(i); + } } BattleScriptExecute(BattleScript_GrassyTerrainHeals); effect++; @@ -2361,8 +2367,10 @@ u8 DoFieldEndTurnEffects(void) { gFieldStatuses &= ~(STATUS_FIELD_PSYCHIC_TERRAIN); for (i = 0; i < MAX_BATTLERS_COUNT; i++) + { if (GetBattlerAbility(i) == ABILITY_MIMICRY) RestoreBattlerOriginalTypes(i); + } BattleScriptExecute(BattleScript_PsychicTerrainEnds); effect++; } From 5a855db4ad97a8bebfd3c1eb7135162c2c1c3997 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Thu, 4 Nov 2021 11:08:37 +1300 Subject: [PATCH 48/72] Fix prototype of CanBePoisoned --- include/battle_util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/battle_util.h b/include/battle_util.h index 86fe789f0..d0a9d8f87 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -168,7 +168,7 @@ bool32 IsEntrainmentBannedAbilityAttacker(u16 ability); bool32 IsEntrainmentTargetOrSimpleBeamBannedAbility(u16 ability); bool32 CanSleep(u8 battlerId); -bool32 CanBePoisoned(u8 gBattlerAttacker, u8 battlerTarget); +bool32 CanBePoisoned(u8 battlerAttacker, u8 battlerTarget); bool32 CanBeBurned(u8 battlerId); bool32 CanBeParalyzed(u8 battlerId); bool32 CanBeFrozen(u8 battlerId); From 05850f0f65cbdbbbd0ee466aeceff512bc25cae2 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Wed, 3 Nov 2021 22:05:02 -0300 Subject: [PATCH 49/72] Refactored UndoFormChange to make it more user friendly --- src/battle_util.c | 40 ++++++++++++++++++---------------------- 1 file changed, 18 insertions(+), 22 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index 196ce0268..f32c9875b 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8954,33 +8954,29 @@ void UndoFormChange(u32 monId, u32 side, bool32 isSwitchingOut) { u32 i, currSpecies; struct Pokemon *party = (side == B_SIDE_PLAYER) ? gPlayerParty : gEnemyParty; - static const u16 species[][2] = // changed form id, default form id + static const u16 species[][3] = { - {SPECIES_MIMIKYU_BUSTED, SPECIES_MIMIKYU}, - {SPECIES_GRENINJA_ASH, SPECIES_GRENINJA_BATTLE_BOND}, - {SPECIES_AEGISLASH_BLADE, SPECIES_AEGISLASH}, - {SPECIES_DARMANITAN_ZEN_MODE, SPECIES_DARMANITAN}, - {SPECIES_MINIOR, SPECIES_MINIOR_CORE_RED}, - {SPECIES_MINIOR_METEOR_BLUE, SPECIES_MINIOR_CORE_BLUE}, - {SPECIES_MINIOR_METEOR_GREEN, SPECIES_MINIOR_CORE_GREEN}, - {SPECIES_MINIOR_METEOR_INDIGO, SPECIES_MINIOR_CORE_INDIGO}, - {SPECIES_MINIOR_METEOR_ORANGE, SPECIES_MINIOR_CORE_ORANGE}, - {SPECIES_MINIOR_METEOR_VIOLET, SPECIES_MINIOR_CORE_VIOLET}, - {SPECIES_MINIOR_METEOR_YELLOW, SPECIES_MINIOR_CORE_YELLOW}, - {SPECIES_WISHIWASHI_SCHOOL, SPECIES_WISHIWASHI}, - {SPECIES_CRAMORANT_GORGING, SPECIES_CRAMORANT}, - {SPECIES_CRAMORANT_GULPING, SPECIES_CRAMORANT}, + // Changed Form ID Default Form ID Should change on switch + {SPECIES_MIMIKYU_BUSTED, SPECIES_MIMIKYU, FALSE}, + {SPECIES_GRENINJA_ASH, SPECIES_GRENINJA_BATTLE_BOND, FALSE}, + {SPECIES_AEGISLASH_BLADE, SPECIES_AEGISLASH, TRUE}, + {SPECIES_DARMANITAN_ZEN_MODE, SPECIES_DARMANITAN, TRUE}, + {SPECIES_MINIOR, SPECIES_MINIOR_CORE_RED, TRUE}, + {SPECIES_MINIOR_METEOR_BLUE, SPECIES_MINIOR_CORE_BLUE, TRUE}, + {SPECIES_MINIOR_METEOR_GREEN, SPECIES_MINIOR_CORE_GREEN, TRUE}, + {SPECIES_MINIOR_METEOR_INDIGO, SPECIES_MINIOR_CORE_INDIGO, TRUE}, + {SPECIES_MINIOR_METEOR_ORANGE, SPECIES_MINIOR_CORE_ORANGE, TRUE}, + {SPECIES_MINIOR_METEOR_VIOLET, SPECIES_MINIOR_CORE_VIOLET, TRUE}, + {SPECIES_MINIOR_METEOR_YELLOW, SPECIES_MINIOR_CORE_YELLOW, TRUE}, + {SPECIES_WISHIWASHI_SCHOOL, SPECIES_WISHIWASHI, TRUE}, + {SPECIES_CRAMORANT_GORGING, SPECIES_CRAMORANT, TRUE}, + {SPECIES_CRAMORANT_GULPING, SPECIES_CRAMORANT, TRUE}, }; - if (isSwitchingOut) // Don't revert Mimikyu Busted or Ash-Greninja when switching out - i = 2; - else - i = 0; - currSpecies = GetMonData(&party[monId], MON_DATA_SPECIES, NULL); - for (; i < ARRAY_COUNT(species); i++) + for (i = 0; i < ARRAY_COUNT(species); i++) { - if (currSpecies == species[i][0]) + if (currSpecies == species[i][0] && (!isSwitchingOut || species[i][2] == TRUE)) { SetMonData(&party[monId], MON_DATA_SPECIES, &species[i][1]); CalculateMonStats(&party[monId]); From 4466fbd930af4a7b32521936ca40220aaeb1dccc Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Wed, 3 Nov 2021 21:36:33 -0400 Subject: [PATCH 50/72] ai version of CanPoisonType, CanBePoisoned and IsAbilityOnSide --- include/battle_ai_util.h | 2 +- src/battle_ai_main.c | 2 +- src/battle_ai_util.c | 40 +++++++++++++++++++++++++++++++--------- 3 files changed, 33 insertions(+), 11 deletions(-) diff --git a/include/battle_ai_util.h b/include/battle_ai_util.h index b8cd53c07..304a8149d 100644 --- a/include/battle_ai_util.h +++ b/include/battle_ai_util.h @@ -54,6 +54,7 @@ bool32 IsRecycleEncouragedItem(u16 item); bool32 CanKnockOffItem(u8 battler, u16 item); bool32 IsAbilityOfRating(u16 ability, s8 rating); s8 GetAbilityRating(u16 ability); +u32 AI_IsAbilityOnSide(u32 battlerId, u32 ability); // stat stage checks bool32 AnyStatIsRaised(u8 battlerId); @@ -120,7 +121,6 @@ bool32 IsSemiInvulnerable(u8 battlerDef, u16 move); // status checks bool32 AI_CanBeBurned(u8 battler, u16 ability); -bool32 AI_CanBePoisoned(u8 battler, u16 ability); bool32 AI_CanBeConfused(u8 battler, u16 ability); bool32 AI_CanSleep(u8 battler, u16 ability); bool32 IsBattlerIncapacitated(u8 battler, u16 ability); diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 84fa7b634..526336947 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -3999,7 +3999,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 2; break; case HOLD_EFFECT_TOXIC_ORB: - if (!ShouldPoisonSelf(battlerAtk, AI_DATA->atkAbility) && AI_CanBePoisoned(battlerDef, AI_DATA->defAbility)) + if (!ShouldPoisonSelf(battlerAtk, AI_DATA->atkAbility)) score += 2; break; case HOLD_EFFECT_FLAME_ORB: diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 9640df2b4..bf10666f6 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -1065,6 +1065,16 @@ bool32 CanTargetFaintAiWithMod(u8 battlerDef, u8 battlerAtk, s32 hpMod, s32 dmgM return FALSE; } +u32 AI_IsAbilityOnSide(u32 battlerId, u32 ability) +{ + if (IsBattlerAlive(battlerId) && AI_GetAbility(battlerId) == ability) + return battlerId + 1; + else if (IsBattlerAlive(BATTLE_PARTNER(battlerId)) && AI_GetAbility(BATTLE_PARTNER(battlerId)) == ability) + return BATTLE_PARTNER(battlerId) + 1; + else + return 0; +} + // does NOT include ability suppression checks s32 AI_GetAbility(u32 battlerId) { @@ -2613,20 +2623,32 @@ bool32 AI_CanPutToSleep(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, return TRUE; } -bool32 AI_CanBePoisoned(u8 battler, u16 ability) +static bool32 AI_CanPoisonType(u8 battlerAttacker, u8 battlerTarget) { - if (ability == ABILITY_IMMUNITY - || IsAbilityOnSide(battler, ABILITY_PASTEL_VEIL) - || gBattleMons[battler].status1 & STATUS1_ANY - || IsAbilityStatusProtected(battler) - || gSideStatuses[GetBattlerSide(battler)] & SIDE_STATUS_SAFEGUARD) + return ((AI_GetAbility(battlerAttacker) == ABILITY_CORROSION && gBattleMoves[gCurrentMove].split == SPLIT_STATUS) + || !(IS_BATTLER_OF_TYPE(battlerTarget, TYPE_POISON) || IS_BATTLER_OF_TYPE(battlerTarget, TYPE_STEEL))); +} + +static bool32 AI_CanBePoisoned(u8 battlerAtk, u8 battlerDef) +{ + u16 ability = AI_GetAbility(battlerDef); + + if (!(AI_CanPoisonType(battlerAtk, battlerDef)) + || gSideStatuses[GetBattlerSide(battlerDef)] & SIDE_STATUS_SAFEGUARD + || gBattleMons[battlerDef].status1 & STATUS1_ANY + || ability == ABILITY_IMMUNITY + || ability == ABILITY_COMATOSE + || AI_IsAbilityOnSide(battlerDef, ABILITY_PASTEL_VEIL) + || gBattleMons[battlerDef].status1 & STATUS1_ANY + || IsAbilityStatusProtected(battlerDef) + || AI_IsTerrainAffected(battlerDef, STATUS_FIELD_MISTY_TERRAIN)) return FALSE; return TRUE; } bool32 ShouldPoisonSelf(u8 battler, u16 ability) { - if (AI_CanBePoisoned(battler, ability) && ( + if (AI_CanBePoisoned(battler, battler) && ( ability == ABILITY_MARVEL_SCALE || ability == ABILITY_POISON_HEAL || ability == ABILITY_QUICK_FEET @@ -2641,7 +2663,7 @@ bool32 ShouldPoisonSelf(u8 battler, u16 ability) bool32 AI_CanPoison(u8 battlerAtk, u8 battlerDef, u16 defAbility, u16 move, u16 partnerMove) { - if (!AI_CanBePoisoned(battlerDef, defAbility) + if (!AI_CanBePoisoned(battlerAtk, battlerDef) || AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0 || DoesSubstituteBlockMove(battlerAtk, battlerDef, move) || PartnerMoveEffectIsStatusSameTarget(BATTLE_PARTNER(battlerAtk), battlerDef, partnerMove)) @@ -2744,7 +2766,7 @@ bool32 AI_CanBeInfatuated(u8 battlerAtk, u8 battlerDef, u16 defAbility, u8 atkGe || atkGender == defGender || atkGender == MON_GENDERLESS || defGender == MON_GENDERLESS - || IsAbilityOnSide(battlerDef, ABILITY_AROMA_VEIL)) + || AI_IsAbilityOnSide(battlerDef, ABILITY_AROMA_VEIL)) return FALSE; return TRUE; } From 012877bdc157d2ad04afcb9b47e03ae7eafd9434 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Wed, 3 Nov 2021 21:49:46 -0400 Subject: [PATCH 51/72] fix ai's def magic guard check --- src/battle_ai_main.c | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 84fa7b634..767ef4e35 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -578,6 +578,21 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) { switch (AI_DATA->defAbility) { + case ABILITY_MAGIC_GUARD: + switch (moveEffect) + { + case EFFECT_POISON: + case EFFECT_WILL_O_WISP: + case EFFECT_TOXIC: + case EFFECT_LEECH_SEED: + score -= 5; + break; + case EFFECT_CURSE: + if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST)) + score -= 5; + break; + } + break; case ABILITY_VOLT_ABSORB: case ABILITY_MOTOR_DRIVE: case ABILITY_LIGHTNING_ROD: @@ -2949,7 +2964,7 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) } } - // ability checks + // attacker ability checks switch (AI_DATA->atkAbility) { case ABILITY_MOXIE: @@ -2960,21 +2975,6 @@ static s16 AI_CheckViability(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score += 8; // prioritize killing target for stat boost } break; - case ABILITY_MAGIC_GUARD: - switch (moveEffect) - { - case EFFECT_POISON: - case EFFECT_WILL_O_WISP: - case EFFECT_TOXIC: - case EFFECT_LEECH_SEED: - score -= 5; - break; - case EFFECT_CURSE: - if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST)) - score -= 5; - break; - } - break; } // ability checks // move effect checks From 060ae35c7cc1c638e09b2a3ae4391fd309264080 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Wed, 3 Nov 2021 21:53:28 -0400 Subject: [PATCH 52/72] fix curse magic guard check --- src/battle_ai_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_ai_main.c b/src/battle_ai_main.c index 767ef4e35..857908ef7 100644 --- a/src/battle_ai_main.c +++ b/src/battle_ai_main.c @@ -588,7 +588,7 @@ static s16 AI_CheckBadMove(u8 battlerAtk, u8 battlerDef, u16 move, s16 score) score -= 5; break; case EFFECT_CURSE: - if (IS_BATTLER_OF_TYPE(battlerDef, TYPE_GHOST)) + if (IS_BATTLER_OF_TYPE(battlerAtk, TYPE_GHOST)) // Don't use Curse if you're a ghost type vs a Magic Guard user, they'll take no damage. score -= 5; break; } From b931e341728e4b4e70c24f4a33d9d1ab4b7c07f8 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Wed, 3 Nov 2021 21:04:34 -0300 Subject: [PATCH 53/72] Handled Mimicry's interaction with Steel Roller's effect --- asm/macros/battle_script.inc | 4 ++++ data/battle_scripts_1.s | 1 + include/constants/battle_script_commands.h | 1 + src/battle_script_commands.c | 7 +++++++ 4 files changed, 13 insertions(+) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index b7a60dbbb..1625fe41c 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1883,6 +1883,10 @@ .4byte \ptr .endm + .macro trytorevertmimicry + various BS_ATTACKER, VARIOUS_TRY_TO_REVERT_MIMICRY + .endm + @ helpful macros .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7 diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index ac2d9a1a6..88d89ec3f 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -660,6 +660,7 @@ BattleScript_EffectRemoveTerrain: resultmessage waitmessage B_WAIT_TIME_LONG removeterrain + trytorevertmimicry jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 4, BattleScript_MoveEnd printfromtable gTerrainEndingStringIds waitmessage B_WAIT_TIME_LONG diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 50db28028..3d7dfbc2b 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -199,6 +199,7 @@ #define VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED 126 #define VARIOUS_SET_ATTACKER_STICKY_WEB_USER 127 #define VARIOUS_TRY_TO_APPLY_MIMICRY 128 +#define VARIOUS_TRY_TO_REVERT_MIMICRY 129 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 3bfa227bc..74d52dbb6 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9039,6 +9039,13 @@ static void Cmd_various(void) gBattlescriptCurrInstr += 7; return; } + case VARIOUS_TRY_TO_REVERT_MIMICRY: + for (i = 0; i < gBattlersCount; i++) + { + if (GetBattlerAbility(i) == ABILITY_MIMICRY) + RestoreBattlerOriginalTypes(i); + } + break; } gBattlescriptCurrInstr += 3; From e930dae278e8b3d2385956f353ca9b93d40bc4bb Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Thu, 4 Nov 2021 15:40:26 +1300 Subject: [PATCH 54/72] Remove ability pop up for Hunger Switch Morpeko should change form each turn without showing its ability. --- data/battle_scripts_1.s | 5 +++++ include/battle_scripts.h | 1 + src/battle_util.c | 4 ++-- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index a81d17f84..af4e96992 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -6980,6 +6980,7 @@ BattleScript_AttackerFormChange:: call BattleScript_AbilityPopUp printstring STRINGID_EMPTYSTRING3 waitmessage 1 +BattleScript_AttackerFormChangeNoPopup:: handleformchange BS_ATTACKER, 0 handleformchange BS_ATTACKER, 1 playanimation BS_ATTACKER, B_ANIM_FORM_CHANGE, NULL @@ -6991,6 +6992,10 @@ BattleScript_AttackerFormChangeEnd3:: call BattleScript_AttackerFormChange end3 +BattleScript_AttackerFormChangeEnd3NoPopup:: + call BattleScript_AttackerFormChangeNoPopup + end3 + BattleScript_BallFetch:: call BattleScript_AbilityPopUp printstring STRINGID_FETCHEDPOKEBALL diff --git a/include/battle_scripts.h b/include/battle_scripts.h index 12212ff94..035087fad 100644 --- a/include/battle_scripts.h +++ b/include/battle_scripts.h @@ -407,5 +407,6 @@ extern const u8 BattleScript_WanderingSpiritActivates[]; extern const u8 BattleScript_MirrorArmorReflect[]; extern const u8 BattleScript_GooeyActivates[]; extern const u8 BattleScript_PastelVeilActivates[]; +extern const u8 BattleScript_AttackerFormChangeEnd3NoPopup[]; #endif // GUARD_BATTLE_SCRIPTS_H diff --git a/src/battle_util.c b/src/battle_util.c index b17c82755..a1e39f329 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -4578,12 +4578,12 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (gBattleMons[battler].species == SPECIES_MORPEKO) { gBattleMons[battler].species = SPECIES_MORPEKO_HANGRY; - BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeEnd3); + BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeEnd3NoPopup); } else if (gBattleMons[battler].species == SPECIES_MORPEKO_HANGRY) { gBattleMons[battler].species = SPECIES_MORPEKO; - BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeEnd3); + BattleScriptPushCursorAndCallback(BattleScript_AttackerFormChangeEnd3NoPopup); } effect++; } From a2574b55cc231b4fa6b44878f0d699e17fecd5c3 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Thu, 4 Nov 2021 16:09:28 +1300 Subject: [PATCH 55/72] Fix dynamic move damage calculation Can't check effectiveness here without breaking the AI. After testing, it also appears that it doesn't need to be checked here after all. --- src/battle_ai_util.c | 80 +++++++------------------------------------- 1 file changed, 12 insertions(+), 68 deletions(-) diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index ab7cc6b53..884e0fa37 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -738,95 +738,39 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef) { case EFFECT_LEVEL_DAMAGE: case EFFECT_PSYWAVE: - { - // Psywave's expected damage is equal to the user's level - if (AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0) - dmg = 0; - else if (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND) - dmg = 2 * gBattleMons[battlerAtk].level; - else - dmg = gBattleMons[battlerAtk].level; + dmg = gBattleMons[battlerAtk].level * (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND ? 2 : 1); break; - } case EFFECT_DRAGON_RAGE: - { - if (AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0) - dmg = 0; - else if (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND) - dmg = 80; - else - dmg = 40; + dmg = 40 * (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND ? 2 : 1); break; - } case EFFECT_SONICBOOM: - { - if (AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0) - dmg = 0; - else if (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND) - dmg = 40; - else - dmg = 20; + dmg = 20 * (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND ? 2 : 1); break; - } case EFFECT_MULTI_HIT: - { - if (AI_DATA->atkAbility == ABILITY_SKILL_LINK) - dmg *= 5; - else - dmg *= 3; // Average number of hits is three + dmg *= (AI_DATA->atkAbility == ABILITY_SKILL_LINK ? 5 : 3); break; - } case EFFECT_TRIPLE_KICK: - { - dmg *= 6; + dmg *= (AI_DATA->atkAbility == ABILITY_SKILL_LINK ? 6 : 5); break; - } case EFFECT_ENDEAVOR: - { - if (AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0) - dmg = 0; - else - // If target has less HP than user, Endeavor does no damage - dmg = max(0, gBattleMons[battlerDef].hp - gBattleMons[battlerAtk].hp); + // If target has less HP than user, Endeavor does no damage + dmg = max(0, gBattleMons[battlerDef].hp - gBattleMons[battlerAtk].hp); break; - } case EFFECT_SUPER_FANG: - { - if (AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0) - dmg = 0; - // Two hits of Super Fang halves HP twice, leaving target with 25% HP - else if (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND) - dmg = max(2, gBattleMons[battlerDef].hp * 3 / 4); - else - dmg = max(1, gBattleMons[battlerDef].hp / 2); + dmg = (AI_DATA->atkAbility == ABILITY_PARENTAL_BOND + ? max(2, gBattleMons[battlerDef].hp * 3 / 4) + : max(1, gBattleMons[battlerDef].hp / 2)); break; - } case EFFECT_FINAL_GAMBIT: - { - if (AI_GetMoveEffectiveness(move, battlerAtk, battlerDef) == AI_EFFECTIVENESS_x0) - dmg = 0; - else - dmg = gBattleMons[battlerAtk].hp; - break; - } - //case EFFECT_METAL_BURST: - //case EFFECT_COUNTER: - default: - //do not add the random factor, it's an average case analysis - //dmg *= (100 - (Random() % 10)) / 100; // add random factor + dmg = gBattleMons[battlerAtk].hp; break; } // Handle other multi-strike moves if (IsTwoStrikesMove(move)) - { dmg *= 2; - } - else if (move == MOVE_SURGING_STRIKES - || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH)) - { + else if (move == MOVE_SURGING_STRIKES || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH)) dmg *= 3; - } RestoreBattlerData(battlerAtk); RestoreBattlerData(battlerDef); From 7d1009768440b5c28a641f1700a45837af3d871c Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Thu, 4 Nov 2021 17:11:56 +1300 Subject: [PATCH 56/72] Replace IsTwoStrikesMove with FLAG_TWO_STRIKES Note that this flag does nothing until the Parental Bond PR is merged - it's just for the AI until then. --- include/battle_util.h | 3 --- include/constants/pokemon.h | 1 + src/battle_ai_util.c | 2 +- src/battle_util.c | 26 -------------------------- src/data/battle_moves.h | 20 ++++++++++---------- 5 files changed, 12 insertions(+), 40 deletions(-) diff --git a/include/battle_util.h b/include/battle_util.h index ac27461bd..aa2a3d838 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -175,7 +175,4 @@ bool32 CanBeFrozen(u8 battlerId); bool32 CanBeConfused(u8 battlerId); bool32 IsBattlerTerrainAffected(u8 battlerId, u32 terrainFlag); -// Move checks -bool8 IsTwoStrikesMove(u16 move); - #endif // GUARD_BATTLE_UTIL_H diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 4e776e592..959148e6c 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -308,6 +308,7 @@ #define FLAG_DMG_UNGROUNDED_IGNORE_TYPE_IF_FLYING (1 << 24) // Makes a Ground type move do 1x damage to flying and levitating targets #define FLAG_THAW_USER (1 << 25) #define FLAG_HIT_IN_SUBSTITUTE (1 << 26) // Hyperspace Fury +#define FLAG_TWO_STRIKES (1 << 27) // A move with this flag will strike twice, and may apply its effect on each hit // Split defines. #define SPLIT_PHYSICAL 0x0 diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index 884e0fa37..4fd01418c 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -767,7 +767,7 @@ s32 AI_CalcDamage(u16 move, u8 battlerAtk, u8 battlerDef) } // Handle other multi-strike moves - if (IsTwoStrikesMove(move)) + if (gBattleMoves[move].flags & FLAG_TWO_STRIKES) dmg *= 2; else if (move == MOVE_SURGING_STRIKES || (move == MOVE_WATER_SHURIKEN && gBattleMons[battlerAtk].species == SPECIES_GRENINJA_ASH)) dmg *= 3; diff --git a/src/battle_util.c b/src/battle_util.c index 82d6ddcbd..05c7af122 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -217,20 +217,6 @@ static const u16 sEntrainmentTargetSimpleBeamBannedAbilities[] = ABILITY_GULP_MISSILE, }; -static const u16 sTwoStrikeMoves[] = -{ - MOVE_BONEMERANG, - MOVE_DOUBLE_HIT, - MOVE_DOUBLE_IRON_BASH, - MOVE_DOUBLE_KICK, - MOVE_DRAGON_DARTS, - MOVE_DUAL_CHOP, - MOVE_DUAL_WINGBEAT, - MOVE_GEAR_GRIND, - MOVE_TWINEEDLE, - 0xFFFF -}; - bool32 IsAffectedByFollowMe(u32 battlerAtk, u32 defSide, u32 move) { u32 ability = GetBattlerAbility(battlerAtk); @@ -9620,15 +9606,3 @@ bool32 IsBattlerWeatherAffected(u8 battlerId, u32 weatherFlags) } return FALSE; } - -bool8 IsTwoStrikesMove(u16 move) -{ - u32 i; - - for (i = 0; i < ARRAY_COUNT(sTwoStrikeMoves); i++) - { - if (move == sTwoStrikeMoves[i]) - return TRUE; - } - return FALSE; -} diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 97d61202a..f4ace3915 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -378,7 +378,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, @@ -649,7 +649,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 20, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_SHEER_FORCE_BOOST | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, @@ -2460,7 +2460,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, @@ -7267,7 +7267,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, @@ -8367,7 +8367,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, @@ -8575,7 +8575,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, @@ -10726,9 +10726,9 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_DOUBLE_IRON_BASH] = { #if B_UPDATED_MOVE_DATA >= GEN_8 - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST | FLAG_TWO_STRIKES, #else - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_DMG_MINIMIZE | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_DMG_MINIMIZE | FLAG_IRON_FIST_BOOST | FLAG_SHEER_FORCE_BOOST | FLAG_TWO_STRIKES, #endif .effect = EFFECT_DOUBLE_IRON_BASH, .power = 60, @@ -10850,7 +10850,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, @@ -11480,7 +11480,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .secondaryEffectChance = 0, .target = MOVE_TARGET_SELECTED, .priority = 0, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED | FLAG_TWO_STRIKES, .split = SPLIT_PHYSICAL, }, From 2728f13eedce96ae3bd3c9cc18e2e14055749565 Mon Sep 17 00:00:00 2001 From: Jaizu Date: Thu, 4 Nov 2021 09:58:55 +0100 Subject: [PATCH 57/72] Fix comment typo --- src/battle_script_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index ee9379d8d..d76dd8283 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -12817,7 +12817,7 @@ static void Cmd_handleballthrow(void) gBattleSpritesDataPtr->animationData->criticalCaptureSuccess = 0; if (CriticalCapture(odds)) { - maxShakes = 1; //critical capture doesn't gauarantee capture + maxShakes = 1; //critical capture doesn't guarantee capture gBattleSpritesDataPtr->animationData->isCriticalCapture = 1; } else From 6b10801ee8f511d5cd3ed413c8016274798c94c9 Mon Sep 17 00:00:00 2001 From: ghoulslash Date: Thu, 4 Nov 2021 10:43:33 -0400 Subject: [PATCH 58/72] convert AI_IsabilityOnSide to bool --- include/battle_ai_util.h | 2 +- src/battle_ai_util.c | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/include/battle_ai_util.h b/include/battle_ai_util.h index 304a8149d..b6df2168e 100644 --- a/include/battle_ai_util.h +++ b/include/battle_ai_util.h @@ -54,7 +54,7 @@ bool32 IsRecycleEncouragedItem(u16 item); bool32 CanKnockOffItem(u8 battler, u16 item); bool32 IsAbilityOfRating(u16 ability, s8 rating); s8 GetAbilityRating(u16 ability); -u32 AI_IsAbilityOnSide(u32 battlerId, u32 ability); +bool32 AI_IsAbilityOnSide(u32 battlerId, u32 ability); // stat stage checks bool32 AnyStatIsRaised(u8 battlerId); diff --git a/src/battle_ai_util.c b/src/battle_ai_util.c index bf10666f6..a08034979 100644 --- a/src/battle_ai_util.c +++ b/src/battle_ai_util.c @@ -1065,14 +1065,14 @@ bool32 CanTargetFaintAiWithMod(u8 battlerDef, u8 battlerAtk, s32 hpMod, s32 dmgM return FALSE; } -u32 AI_IsAbilityOnSide(u32 battlerId, u32 ability) +bool32 AI_IsAbilityOnSide(u32 battlerId, u32 ability) { if (IsBattlerAlive(battlerId) && AI_GetAbility(battlerId) == ability) - return battlerId + 1; + return TRUE; else if (IsBattlerAlive(BATTLE_PARTNER(battlerId)) && AI_GetAbility(BATTLE_PARTNER(battlerId)) == ability) - return BATTLE_PARTNER(battlerId) + 1; + return TRUE; else - return 0; + return FALSE; } // does NOT include ability suppression checks From 4f251e6ec2b8cd4cb9339dec7a825e7c5d5f9100 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Thu, 4 Nov 2021 12:13:55 -0300 Subject: [PATCH 59/72] Moved VARIOUS_TRY_TO_REVERT_MIMICRY to VARIOUS_REMOVE_TERRAIN --- asm/macros/battle_script.inc | 4 ---- data/battle_scripts_1.s | 1 - include/constants/battle_script_commands.h | 1 - src/battle_script_commands.c | 12 +++++------- 4 files changed, 5 insertions(+), 13 deletions(-) diff --git a/asm/macros/battle_script.inc b/asm/macros/battle_script.inc index 1625fe41c..b7a60dbbb 100644 --- a/asm/macros/battle_script.inc +++ b/asm/macros/battle_script.inc @@ -1883,10 +1883,6 @@ .4byte \ptr .endm - .macro trytorevertmimicry - various BS_ATTACKER, VARIOUS_TRY_TO_REVERT_MIMICRY - .endm - @ helpful macros .macro setstatchanger stat:req, stages:req, down:req setbyte sSTATCHANGER \stat | \stages << 3 | \down << 7 diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 88d89ec3f..ac2d9a1a6 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -660,7 +660,6 @@ BattleScript_EffectRemoveTerrain: resultmessage waitmessage B_WAIT_TIME_LONG removeterrain - trytorevertmimicry jumpifbyte CMP_EQUAL, cMULTISTRING_CHOOSER, 4, BattleScript_MoveEnd printfromtable gTerrainEndingStringIds waitmessage B_WAIT_TIME_LONG diff --git a/include/constants/battle_script_commands.h b/include/constants/battle_script_commands.h index 3d7dfbc2b..50db28028 100644 --- a/include/constants/battle_script_commands.h +++ b/include/constants/battle_script_commands.h @@ -199,7 +199,6 @@ #define VARIOUS_JUMP_IF_LEAF_GUARD_PROTECTED 126 #define VARIOUS_SET_ATTACKER_STICKY_WEB_USER 127 #define VARIOUS_TRY_TO_APPLY_MIMICRY 128 -#define VARIOUS_TRY_TO_REVERT_MIMICRY 129 // Cmd_manipulatedamage #define DMG_CHANGE_SIGN 0 diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 74d52dbb6..d615e0b35 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8865,6 +8865,11 @@ static void Cmd_various(void) break; } gFieldStatuses &= ~STATUS_FIELD_TERRAIN_ANY; // remove the terrain + for (i = 0; i < gBattlersCount; i++) // restore the types of Pokémon with Mimicry + { + if (GetBattlerAbility(i) == ABILITY_MIMICRY) + RestoreBattlerOriginalTypes(i); + } break; case VARIOUS_JUMP_IF_PRANKSTER_BLOCKED: if (BlocksPrankster(gCurrentMove, gBattlerAttacker, gActiveBattler, TRUE)) @@ -9039,13 +9044,6 @@ static void Cmd_various(void) gBattlescriptCurrInstr += 7; return; } - case VARIOUS_TRY_TO_REVERT_MIMICRY: - for (i = 0; i < gBattlersCount; i++) - { - if (GetBattlerAbility(i) == ABILITY_MIMICRY) - RestoreBattlerOriginalTypes(i); - } - break; } gBattlescriptCurrInstr += 3; From b64d506809c2b84e9a6ae1e91b9d081b5b37b71e Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Thu, 4 Nov 2021 12:20:31 -0300 Subject: [PATCH 60/72] Made a function to lift Mimicry's effect --- include/battle_util.h | 1 + src/battle_script_commands.c | 6 +----- src/battle_util.c | 35 +++++++++++++++-------------------- 3 files changed, 17 insertions(+), 25 deletions(-) diff --git a/include/battle_util.h b/include/battle_util.h index 62a7e1db6..cb196519e 100644 --- a/include/battle_util.h +++ b/include/battle_util.h @@ -158,6 +158,7 @@ bool32 BlocksPrankster(u16 move, u8 battlerPrankster, u8 battlerDef, bool32 chec u16 GetUsedHeldItem(u8 battler); bool32 IsBattlerWeatherAffected(u8 battlerId, u32 weatherFlags); void TryToApplyMimicry(u8 battlerId, bool8 various); +void TryToRevertMimicry(void); void RestoreBattlerOriginalTypes(u8 battlerId); // ability checks diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index d615e0b35..d056bfa5a 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8865,11 +8865,7 @@ static void Cmd_various(void) break; } gFieldStatuses &= ~STATUS_FIELD_TERRAIN_ANY; // remove the terrain - for (i = 0; i < gBattlersCount; i++) // restore the types of Pokémon with Mimicry - { - if (GetBattlerAbility(i) == ABILITY_MIMICRY) - RestoreBattlerOriginalTypes(i); - } + TryToRevertMimicry(); // restore the types of Pokémon with Mimicry break; case VARIOUS_JUMP_IF_PRANKSTER_BLOCKED: if (BlocksPrankster(gCurrentMove, gBattlerAttacker, gActiveBattler, TRUE)) diff --git a/src/battle_util.c b/src/battle_util.c index a924722eb..b3cf60819 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -1934,6 +1934,17 @@ void TryToApplyMimicry(u8 battlerId, bool8 various) } } +void TryToRevertMimicry(void) +{ + s32 i; + + for (i = 0; i < MAX_BATTLERS_COUNT; i++) + { + if (GetBattlerAbility(i) == ABILITY_MIMICRY) + RestoreBattlerOriginalTypes(i); + } +} + enum { ENDTURN_ORDER, @@ -2318,11 +2329,7 @@ u8 DoFieldEndTurnEffects(void) && (!(gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT) && --gFieldTimers.electricTerrainTimer == 0)) { gFieldStatuses &= ~(STATUS_FIELD_ELECTRIC_TERRAIN | STATUS_FIELD_TERRAIN_PERMANENT); - for (i = 0; i < MAX_BATTLERS_COUNT; i++) - { - if (GetBattlerAbility(i) == ABILITY_MIMICRY) - RestoreBattlerOriginalTypes(i); - } + TryToRevertMimicry(); BattleScriptExecute(BattleScript_ElectricTerrainEnds); effect++; } @@ -2333,11 +2340,7 @@ u8 DoFieldEndTurnEffects(void) && (!(gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT) && --gFieldTimers.mistyTerrainTimer == 0)) { gFieldStatuses &= ~(STATUS_FIELD_MISTY_TERRAIN); - for (i = 0; i < MAX_BATTLERS_COUNT; i++) - { - if (GetBattlerAbility(i) == ABILITY_MIMICRY) - RestoreBattlerOriginalTypes(i); - } + TryToRevertMimicry(); BattleScriptExecute(BattleScript_MistyTerrainEnds); effect++; } @@ -2350,11 +2353,7 @@ u8 DoFieldEndTurnEffects(void) && (gFieldTimers.grassyTerrainTimer == 0 || --gFieldTimers.grassyTerrainTimer == 0)) { gFieldStatuses &= ~(STATUS_FIELD_GRASSY_TERRAIN); - for (i = 0; i < MAX_BATTLERS_COUNT; i++) - { - if (GetBattlerAbility(i) == ABILITY_MIMICRY) - RestoreBattlerOriginalTypes(i); - } + TryToRevertMimicry(); } BattleScriptExecute(BattleScript_GrassyTerrainHeals); effect++; @@ -2366,11 +2365,7 @@ u8 DoFieldEndTurnEffects(void) && (!(gFieldStatuses & STATUS_FIELD_TERRAIN_PERMANENT) && --gFieldTimers.psychicTerrainTimer == 0)) { gFieldStatuses &= ~(STATUS_FIELD_PSYCHIC_TERRAIN); - for (i = 0; i < MAX_BATTLERS_COUNT; i++) - { - if (GetBattlerAbility(i) == ABILITY_MIMICRY) - RestoreBattlerOriginalTypes(i); - } + TryToRevertMimicry(); BattleScriptExecute(BattleScript_PsychicTerrainEnds); effect++; } From 671cbabc3daa2fe217e26fa1598778f2c418ab7f Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Thu, 4 Nov 2021 17:18:26 -0300 Subject: [PATCH 61/72] Added a battle config for the Soul Dew --- include/constants/battle_config.h | 1 + src/battle_util.c | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 41fee089d..792d12a9b 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -166,6 +166,7 @@ #define B_X_ITEMS_BUFF GEN_7 // In Gen7+, the X Items raise a stat by 2 stages instead of 1. #define B_MENTAL_HERB GEN_5 // In Gen5+, the Mental Herb cures Infatuation, Taunt, Encore, Torment, Heal Block, and Disable #define B_TRAINERS_KNOCK_OFF_ITEMS TRUE // If TRUE, trainers can steal/swap your items (non-berries are restored after battle). In vanilla games trainers cannot steal items. +#define B_SOUL_DEW_BOOST GEN_7 // In Gens3-6, Soul Dew boosts the power of Lati@s' stats. In Gen7+ it boosts the power of their Psychic and Dragon type moves instead. // Flag settings // To use the following features in scripting, replace the 0s with the flag ID you're assigning it to. diff --git a/src/battle_util.c b/src/battle_util.c index 5a9d47df9..f2b186002 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8059,7 +8059,10 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe MulModifier(&modifier, holdEffectModifier); break; case HOLD_EFFECT_SOUL_DEW: - if ((gBattleMons[battlerAtk].species == SPECIES_LATIAS || gBattleMons[battlerAtk].species == SPECIES_LATIOS) && !(gBattleTypeFlags & BATTLE_TYPE_FRONTIER)) + if (((gBattleMons[battlerAtk].species == SPECIES_LATIAS || gBattleMons[battlerAtk].species == SPECIES_LATIOS) + && !(gBattleTypeFlags & BATTLE_TYPE_FRONTIER) && B_SOUL_DEW_BOOST <= GEN_6) + || ((gBattleMons[battlerAtk].species == SPECIES_LATIAS || gBattleMons[battlerAtk].species == SPECIES_LATIOS) + && (moveType == TYPE_PSYCHIC || moveType == TYPE_DRAGON) && B_SOUL_DEW_BOOST >= GEN_7)) MulModifier(&modifier, holdEffectModifier); break; case HOLD_EFFECT_GEMS: From 9a3739d2bdc439c9189ad8d62b6ee480be09347c Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Thu, 4 Nov 2021 21:00:39 -0300 Subject: [PATCH 62/72] Review changes --- src/battle_util.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index f2b186002..c9fefe61b 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -8059,10 +8059,11 @@ static u32 CalcMoveBasePowerAfterModifiers(u16 move, u8 battlerAtk, u8 battlerDe MulModifier(&modifier, holdEffectModifier); break; case HOLD_EFFECT_SOUL_DEW: - if (((gBattleMons[battlerAtk].species == SPECIES_LATIAS || gBattleMons[battlerAtk].species == SPECIES_LATIOS) - && !(gBattleTypeFlags & BATTLE_TYPE_FRONTIER) && B_SOUL_DEW_BOOST <= GEN_6) - || ((gBattleMons[battlerAtk].species == SPECIES_LATIAS || gBattleMons[battlerAtk].species == SPECIES_LATIOS) - && (moveType == TYPE_PSYCHIC || moveType == TYPE_DRAGON) && B_SOUL_DEW_BOOST >= GEN_7)) + #if B_SOUL_DEW_BOOST >= GEN_7 + if ((gBattleMons[battlerAtk].species == SPECIES_LATIAS || gBattleMons[battlerAtk].species == SPECIES_LATIOS) && (moveType == TYPE_PSYCHIC || moveType == TYPE_DRAGON)) + #else + if ((gBattleMons[battlerAtk].species == SPECIES_LATIAS || gBattleMons[battlerAtk].species == SPECIES_LATIOS) && !(gBattleTypeFlags & BATTLE_TYPE_FRONTIER)) + #endif MulModifier(&modifier, holdEffectModifier); break; case HOLD_EFFECT_GEMS: @@ -8475,6 +8476,14 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, if (!usesDefStat) MulModifier(&modifier, UQ_4_12(1.5)); break; +#if B_SOUL_DEW_BOOST <= GEN_6 + case HOLD_EFFECT_SOUL_DEW: + if ((gBattleMons[battlerDef].species == SPECIES_LATIAS || gBattleMons[battlerDef].species == SPECIES_LATIOS) + && !(gBattleTypeFlags & BATTLE_TYPE_FRONTIER) + && !usesDefStat) + MulModifier(&modifier, UQ_4_12(1.5)); + break; +#endif } // sandstorm sp.def boost for rock types From bf786c6c9a8069be877aea3b5723d7a46660b7cb Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Fri, 5 Nov 2021 18:22:52 +1300 Subject: [PATCH 63/72] Fix Magma Storm Fix the strings and animation displayed when Magma Storm. Also move gTrappingMoves to battle_script_message.c as it's only sued in this file, and this allows ARRAY_COUNT(sTrappingMoves) to replace the constant in SetMoveEffect. --- data/battle_anim_scripts.s | 27 +++++++++++++++++++++++++++ include/battle_message.h | 1 - include/constants/battle_anim.h | 3 ++- include/constants/battle_string_ids.h | 2 +- src/battle_anim_throw.c | 2 ++ src/battle_message.c | 24 ++++++++++-------------- src/battle_script_commands.c | 9 +++++++-- 7 files changed, 49 insertions(+), 19 deletions(-) diff --git a/data/battle_anim_scripts.s b/data/battle_anim_scripts.s index cfe95371d..4198f6410 100644 --- a/data/battle_anim_scripts.s +++ b/data/battle_anim_scripts.s @@ -24037,6 +24037,7 @@ General_TurnTrap: jumpargeq 0, TRAP_ANIM_WHIRLPOOL, Status_Whirlpool jumpargeq 0, TRAP_ANIM_CLAMP, Status_Clamp jumpargeq 0, TRAP_ANIM_SAND_TOMB, Status_SandTomb + jumpargeq 0, TRAP_ANIM_MAGMA_STORM, Status_MagmaStorm jumpargeq 0, TRAP_ANIM_INFESTATION, Status_Infestation goto Status_BindWrap Status_BindWrap: @@ -24063,6 +24064,32 @@ Status_FireSpin: stopsound end +Status_MagmaStorm: + loadspritegfx ANIM_TAG_SMALL_EMBER + fadetobg BG_MAGMA_STORM + waitbgfadeout + createvisualtask AnimTask_MoveSeismicTossBg, 3 + playsewithpan SE_M_SACRED_FIRE2, SOUND_PAN_TARGET + loopsewithpan SE_M_SACRED_FIRE2, SOUND_PAN_TARGET, 5, 8 + createvisualtask AnimTask_SeismicTossBgAccelerateDownAtEnd, 3 + createvisualtask AnimTask_ShakeMon, 5, ANIM_TARGET, 0, 2, 47, 1 + createvisualtask AnimTask_BlendColorCycle, 2, 6, 4, 2, 2, 0, 12, RGB(22, 9, 7) + call FireSpinEffect + call FireSpinEffect + createvisualtask AnimTask_BlendColorCycle, 2, 6, 4, 2, 2, 0, 12, RGB(22, 9, 7) + call FireSpinEffect + call FireSpinEffect + createvisualtask AnimTask_BlendColorCycle, 2, 6, 4, 2, 2, 0, 12, RGB(22, 9, 7) + call FireSpinEffect + restorebg + waitbgfadeout + setarg 7, 0xFFF + waitbgfadein + stopsound + clearmonbg ANIM_DEF_PARTNER + blendoff + end + Status_Whirlpool: loadspritegfx ANIM_TAG_WATER_ORB monbg ANIM_DEF_PARTNER diff --git a/include/battle_message.h b/include/battle_message.h index e8b362c9e..5c10f9e04 100644 --- a/include/battle_message.h +++ b/include/battle_message.h @@ -310,6 +310,5 @@ extern const u8 gText_BattleTourney[]; extern const u16 gMissStringIds[]; extern const u16 gStatUpStringIds[]; -extern const u16 gTrappingMoves[]; #endif // GUARD_BATTLE_MESSAGE_H diff --git a/include/constants/battle_anim.h b/include/constants/battle_anim.h index c7871bd15..7df75794e 100644 --- a/include/constants/battle_anim.h +++ b/include/constants/battle_anim.h @@ -565,7 +565,8 @@ #define TRAP_ANIM_WHIRLPOOL 2 #define TRAP_ANIM_CLAMP 3 #define TRAP_ANIM_SAND_TOMB 4 -#define TRAP_ANIM_INFESTATION 5 +#define TRAP_ANIM_MAGMA_STORM 5 +#define TRAP_ANIM_INFESTATION 6 // Weather defines for battle animation scripts. #define ANIM_WEATHER_NONE 0 diff --git a/include/constants/battle_string_ids.h b/include/constants/battle_string_ids.h index 74105f3bf..8fba7597c 100644 --- a/include/constants/battle_string_ids.h +++ b/include/constants/battle_string_ids.h @@ -410,7 +410,7 @@ #define STRINGID_PKMNTWISTEDDIMENSIONS 406 #define STRINGID_POINTEDSTONESFLOAT 407 #define STRINGID_CLOAKEDINMYSTICALMOONLIGHT 408 -#define STRINGID_TRAPPERBYSWIRLINGMAGMA 409 +#define STRINGID_TRAPPEDBYSWIRLINGMAGMA 409 #define STRINGID_VANISHEDINSTANTLY 410 #define STRINGID_PROTECTEDTEAM 411 #define STRINGID_SHAREDITSGUARD 412 diff --git a/src/battle_anim_throw.c b/src/battle_anim_throw.c index 207d1255d..f325cba07 100755 --- a/src/battle_anim_throw.c +++ b/src/battle_anim_throw.c @@ -2496,6 +2496,8 @@ void AnimTask_GetTrappedMoveAnimId(u8 taskId) gBattleAnimArgs[0] = TRAP_ANIM_CLAMP; else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_SAND_TOMB) gBattleAnimArgs[0] = TRAP_ANIM_SAND_TOMB; + else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_MAGMA_STORM) + gBattleAnimArgs[0] = TRAP_ANIM_MAGMA_STORM; else if (gBattleSpritesDataPtr->animationData->animArg == MOVE_INFESTATION) gBattleAnimArgs[0] = TRAP_ANIM_INFESTATION; else diff --git a/src/battle_message.c b/src/battle_message.c index 60b7f5203..f52f6be7e 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -1200,7 +1200,7 @@ const u8 *const gBattleStringsTable[BATTLESTRINGS_COUNT] = [STRINGID_PKMNTWISTEDDIMENSIONS - 12] = sText_PkmnTwistedDimensions, [STRINGID_POINTEDSTONESFLOAT - 12] = sText_PointedStonesFloat, [STRINGID_CLOAKEDINMYSTICALMOONLIGHT - 12] = sText_CloakedInMysticalMoonlight, - [STRINGID_TRAPPERBYSWIRLINGMAGMA - 12] = sText_TrappedBySwirlingMagma, + [STRINGID_TRAPPEDBYSWIRLINGMAGMA - 12] = sText_TrappedBySwirlingMagma, [STRINGID_VANISHEDINSTANTLY - 12] = sText_VanishedInstantly, [STRINGID_PROTECTEDTEAM - 12] = sText_ProtectedTeam, [STRINGID_SHAREDITSGUARD - 12] = sText_SharedItsGuard, @@ -1535,16 +1535,17 @@ const u16 gFirstTurnOfTwoStringIds[] = [B_MSG_TURN1_FREEZE_SHOCK] = STRINGID_CLOAKEDINAFREEZINGLIGHT, }; -// Index copied from move's index in gTrappingMoves +// Index copied from move's index in sTrappingMoves const u16 gWrappedStringIds[] = { - STRINGID_PKMNSQUEEZEDBYBIND, // MOVE_BIND - STRINGID_PKMNWRAPPEDBY, // MOVE_WRAP - STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_FIRE_SPIN - STRINGID_PKMNCLAMPED, // MOVE_CLAMP - STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_WHIRLPOOL - STRINGID_PKMNTRAPPEDBYSANDTOMB,// MOVE_SAND_TOMB - STRINGID_INFESTATION, // MOVE_INFESTATION + STRINGID_PKMNSQUEEZEDBYBIND, // MOVE_BIND + STRINGID_PKMNWRAPPEDBY, // MOVE_WRAP + STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_FIRE_SPIN + STRINGID_PKMNCLAMPED, // MOVE_CLAMP + STRINGID_PKMNTRAPPEDINVORTEX, // MOVE_WHIRLPOOL + STRINGID_PKMNTRAPPEDBYSANDTOMB, // MOVE_SAND_TOMB + STRINGID_TRAPPEDBYSWIRLINGMAGMA, // MOVE_MAGMA_STORM + STRINGID_INFESTATION, // MOVE_INFESTATION }; const u16 gMistUsedStringIds[] = @@ -1755,11 +1756,6 @@ const u16 gCaughtMonStringIds[] = [B_MSG_LANETTES_BOX_FULL] = STRINGID_PKMNBOXLANETTESPCFULL, }; -const u16 gTrappingMoves[] = -{ - MOVE_BIND, MOVE_WRAP, MOVE_FIRE_SPIN, MOVE_CLAMP, MOVE_WHIRLPOOL, MOVE_SAND_TOMB, MOVE_INFESTATION, 0xFFFF -}; - const u16 gRoomsStringIds[] = { STRINGID_PKMNTWISTEDDIMENSIONS, STRINGID_TRICKROOMENDS, diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 6f0fec8a7..dd49d0493 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -279,6 +279,11 @@ static const s32 sExperienceScalingFactors[] = 159767, }; +static const u16 sTrappingMoves[] = +{ + MOVE_BIND, MOVE_WRAP, MOVE_FIRE_SPIN, MOVE_CLAMP, MOVE_WHIRLPOOL, MOVE_SAND_TOMB, MOVE_MAGMA_STORM, MOVE_INFESTATION, 0xFFFF +}; + #define STAT_CHANGE_WORKED 0 #define STAT_CHANGE_DIDNT_WORK 1 @@ -2978,9 +2983,9 @@ void SetMoveEffect(bool32 primary, u32 certain) for (gBattleCommunication[MULTISTRING_CHOOSER] = 0; ; gBattleCommunication[MULTISTRING_CHOOSER]++) { - if (gBattleCommunication[MULTISTRING_CHOOSER] > 5) + if (gBattleCommunication[MULTISTRING_CHOOSER] > ARRAY_COUNT(sTrappingMoves)) break; - if (gTrappingMoves[gBattleCommunication[MULTISTRING_CHOOSER]] == gCurrentMove) + if (sTrappingMoves[gBattleCommunication[MULTISTRING_CHOOSER]] == gCurrentMove) break; } } From 3f1ce399e640c4e43c889e11cded0a1b94a1c90d Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Fri, 5 Nov 2021 18:37:45 +1300 Subject: [PATCH 64/72] Account for terminator in sTrappingMoves --- src/battle_script_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index dd49d0493..b81639db0 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -2983,7 +2983,7 @@ void SetMoveEffect(bool32 primary, u32 certain) for (gBattleCommunication[MULTISTRING_CHOOSER] = 0; ; gBattleCommunication[MULTISTRING_CHOOSER]++) { - if (gBattleCommunication[MULTISTRING_CHOOSER] > ARRAY_COUNT(sTrappingMoves)) + if (gBattleCommunication[MULTISTRING_CHOOSER] > ARRAY_COUNT(sTrappingMoves) - 1) break; if (sTrappingMoves[gBattleCommunication[MULTISTRING_CHOOSER]] == gCurrentMove) break; From d15eeeb8eb7724697438e0e2269dc7d53348dbba Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 5 Nov 2021 10:37:41 -0300 Subject: [PATCH 65/72] Fixed the comment for B_SOUL_DEW_BOOST --- include/constants/battle_config.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 792d12a9b..faf57a40c 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -166,7 +166,7 @@ #define B_X_ITEMS_BUFF GEN_7 // In Gen7+, the X Items raise a stat by 2 stages instead of 1. #define B_MENTAL_HERB GEN_5 // In Gen5+, the Mental Herb cures Infatuation, Taunt, Encore, Torment, Heal Block, and Disable #define B_TRAINERS_KNOCK_OFF_ITEMS TRUE // If TRUE, trainers can steal/swap your items (non-berries are restored after battle). In vanilla games trainers cannot steal items. -#define B_SOUL_DEW_BOOST GEN_7 // In Gens3-6, Soul Dew boosts the power of Lati@s' stats. In Gen7+ it boosts the power of their Psychic and Dragon type moves instead. +#define B_SOUL_DEW_BOOST GEN_7 // In Gens3-6, Soul Dew boosts Lati@s' Sp. Atk and Sp. Def. In Gen7+ it boosts the power of their Psychic and Dragon type moves instead. // Flag settings // To use the following features in scripting, replace the 0s with the flag ID you're assigning it to. From 13029cd3b38049b880212e247234eb2ae2c2cfa5 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 5 Nov 2021 10:50:21 -0300 Subject: [PATCH 66/72] Tweaked VARIOUS_PHOTON_GEYSER_CHECK and VARIOUS_SHELL_SIDE_ARM_CHECK --- src/battle_script_commands.c | 56 ++++++++++++++++++------------------ 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 73dcca97c..a89487ce8 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8996,50 +8996,50 @@ static void Cmd_various(void) return; case VARIOUS_PHOTON_GEYSER_CHECK: { - u32 attStat = gBattleMons[gActiveBattler].attack; - u8 atkStage = gBattleMons[gActiveBattler].statStages[STAT_ATK]; - u32 spaStat = gBattleMons[gActiveBattler].spAttack; + u32 attackerAtkStat = gBattleMons[gBattlerAttacker].attack; + u8 attackerAtkStage = gBattleMons[gBattlerAttacker].statStages[STAT_ATK]; + u32 attackerSpAtkStat = gBattleMons[gBattlerAttacker].spAttack; - attStat *= gStatStageRatios[atkStage][0]; - attStat /= gStatStageRatios[atkStage][1]; + attackerAtkStat *= gStatStageRatios[attackerAtkStage][0]; + attackerAtkStat /= gStatStageRatios[attackerAtkStage][1]; - atkStage = gBattleMons[gActiveBattler].statStages[STAT_SPATK]; - spaStat *= gStatStageRatios[atkStage][0]; - spaStat /= gStatStageRatios[atkStage][1]; + attackerAtkStage = gBattleMons[gBattlerAttacker].statStages[STAT_SPATK]; + attackerSpAtkStat *= gStatStageRatios[attackerAtkStage][0]; + attackerSpAtkStat /= gStatStageRatios[attackerAtkStage][1]; - if (attStat > spaStat) + if (attackerAtkStat > attackerSpAtkStat) gSwapDamageCategory = TRUE; break; } case VARIOUS_SHELL_SIDE_ARM_CHECK: // 0% chance GameFreak actually checks this way according to DaWobblefet, but this is the only functional explanation at the moment { - u32 attStat = gBattleMons[gBattlerAttacker].attack; - u8 atkStage = gBattleMons[gBattlerAttacker].statStages[STAT_ATK]; - u32 attStatDef = gBattleMons[gBattlerTarget].attack; + u32 attackerAtkStat = gBattleMons[gBattlerAttacker].attack; + u32 targetDefStat = gBattleMons[gBattlerTarget].defense; + u32 attackerSpAtkStat = gBattleMons[gBattlerAttacker].spAttack; + u32 targetSpDefStat = gBattleMons[gBattlerTarget].spDefense; + u8 statStage; u32 physical; - - u32 spaStat = gBattleMons[gBattlerAttacker].spAttack; - u32 spaStatDef = gBattleMons[gBattlerTarget].spAttack; u32 special; - attStat *= gStatStageRatios[atkStage][0]; - attStat /= gStatStageRatios[atkStage][1]; + statStage = = gBattleMons[gBattlerAttacker].statStages[STAT_ATK]; + attackerAtkStat *= gStatStageRatios[statStage][0]; + attackerAtkStat /= gStatStageRatios[statStage][1]; - atkStage = gBattleMons[gBattlerTarget].statStages[STAT_ATK]; - attStatDef *= gStatStageRatios[atkStage][0]; - attStatDef /= gStatStageRatios[atkStage][1]; + statStage = gBattleMons[gBattlerTarget].statStages[STAT_ATK]; + targetDefStat *= gStatStageRatios[statStage][0]; + targetDefStat /= gStatStageRatios[statStage][1]; - physical = ((((2 * gBattleMons[gBattlerAttacker].level / 5 + 2) * gBattleMoves[gCurrentMove].power * attStat) / attStatDef) / 50); + physical = ((((2 * gBattleMons[gBattlerAttacker].level / 5 + 2) * gBattleMoves[gCurrentMove].power * attackerAtkStat) / targetDefStat) / 50); - atkStage = gBattleMons[gBattlerAttacker].statStages[STAT_SPATK]; - spaStat *= gStatStageRatios[atkStage][0]; - spaStat /= gStatStageRatios[atkStage][1]; + statStage = gBattleMons[gBattlerAttacker].statStages[STAT_SPATK]; + attackerSpAtkStat *= gStatStageRatios[statStage][0]; + attackerSpAtkStat /= gStatStageRatios[statStage][1]; - atkStage = gBattleMons[gBattlerTarget].statStages[STAT_SPATK]; - spaStatDef *= gStatStageRatios[atkStage][0]; - spaStatDef /= gStatStageRatios[atkStage][1]; + statStage = gBattleMons[gBattlerTarget].statStages[STAT_SPATK]; + targetSpDefStat *= gStatStageRatios[statStage][0]; + targetSpDefStat /= gStatStageRatios[statStage][1]; - special = ((((2 * gBattleMons[gBattlerAttacker].level / 5 + 2) * gBattleMoves[gCurrentMove].power * spaStat) / spaStatDef) / 50); + special = ((((2 * gBattleMons[gBattlerAttacker].level / 5 + 2) * gBattleMoves[gCurrentMove].power * attackerSpAtkStat) / targetSpDefStat) / 50); if (((physical > special) || (physical == special && (Random() % 2) == 0))) gSwapDamageCategory = TRUE; From b23d5db5981b100f5d241a3cba3c0fee68b47a1d Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 5 Nov 2021 13:02:16 -0300 Subject: [PATCH 67/72] Oops --- src/battle_script_commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 97a7b034f..ec7c6effa 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9032,7 +9032,7 @@ static void Cmd_various(void) u32 physical; u32 special; - statStage = = gBattleMons[gBattlerAttacker].statStages[STAT_ATK]; + statStage = gBattleMons[gBattlerAttacker].statStages[STAT_ATK]; attackerAtkStat *= gStatStageRatios[statStage][0]; attackerAtkStat /= gStatStageRatios[statStage][1]; From 14ebba04afd2972b2f79ca89159ff643a7f698d9 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sat, 6 Nov 2021 12:43:57 +1300 Subject: [PATCH 68/72] Align comment with others Co-authored-by: Eduardo Quezada D'Ottone --- data/battle_scripts_1.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 30facd40d..a85b2e2a7 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -367,7 +367,7 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectGeomancy @ EFFECT_GEOMANCY .4byte BattleScript_EffectFairyLock @ EFFECT_FAIRY_LOCK .4byte BattleScript_EffectAllySwitch @ EFFECT_ALLY_SWITCH - .4byte BattleScript_EffectRelicSong @ EFFECT_RELIC_SONG + .4byte BattleScript_EffectRelicSong @ EFFECT_RELIC_SONG .4byte BattleScript_EffectAttackerDefenseDownHit @ EFFECT_ATTACKER_DEFENSE_DOWN_HIT .4byte BattleScript_EffectHit @ EFFECT_BODY_PRESS .4byte BattleScript_EffectEerieSpell @ EFFECT_EERIE_SPELL From 8e49e3e6530d6d738cf0167c51705833f7ef66d3 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Fri, 5 Nov 2021 21:16:13 -0300 Subject: [PATCH 69/72] Config for Synchronize's interaction with toxic poisoning --- include/constants/battle_config.h | 1 + src/battle_util.c | 6 ++++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 95ff4f4a0..1c7781980 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -162,6 +162,7 @@ #define B_MOODY_ACC_EVASION GEN_8 // In Gen8, Moody CANNOT raise Accuracy and Evasion anymore. #define B_FLASH_FIRE_FROZEN GEN_7 // In Gen5+, Flash Fire can trigger even when frozen, when it couldn't before. #define B_SYNCHRONIZE_NATURE GEN_8 // In Gen8, if the Pokémon with Synchronize is leading the party, it's 100% guaranteed that wild Pokémon will have the same ability, as opposed to 50% previously. +#define B_SYNCHRONIZE_TOXIC GEN_8 // In Gen5+, if the Pokémon with Synchronize is badly poisoned, the opponent will also become badly poisoned. Previously, the opponent would become regular poisoned. #define B_UPDATED_INTIMIDATE GEN_8 // In Gen8, Intimidate doesn't work on opponents with the Inner Focus, Scrappy, Own Tempo or Oblivious abilities. // Item settings diff --git a/src/battle_util.c b/src/battle_util.c index 0585bb4b6..3ddc2e9bb 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -5471,8 +5471,10 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move if (!(gBattleMons[gBattlerAttacker].status1 & STATUS1_ANY)) { gBattleStruct->synchronizeMoveEffect &= ~(MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_CERTAIN); - if (gBattleStruct->synchronizeMoveEffect == MOVE_EFFECT_TOXIC) - gBattleStruct->synchronizeMoveEffect = MOVE_EFFECT_POISON; + #if B_SYNCHRONIZE_TOXIC < GEN_5 + if (gBattleStruct->synchronizeMoveEffect == MOVE_EFFECT_TOXIC) + gBattleStruct->synchronizeMoveEffect = MOVE_EFFECT_POISON; + #endif gBattleScripting.moveEffect = gBattleStruct->synchronizeMoveEffect + MOVE_EFFECT_AFFECTS_USER; gBattleScripting.battler = gBattlerAbility = gBattlerTarget; From 202827068c52df2ef10a6657ad902b9842c75cc1 Mon Sep 17 00:00:00 2001 From: Eduardo Quezada D'Ottone Date: Fri, 5 Nov 2021 21:25:42 -0300 Subject: [PATCH 70/72] a Co-authored-by: LOuroboros --- include/constants/battle_config.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/constants/battle_config.h b/include/constants/battle_config.h index 1c7781980..df8015518 100644 --- a/include/constants/battle_config.h +++ b/include/constants/battle_config.h @@ -161,8 +161,8 @@ #define B_SHADOW_TAG_ESCAPE GEN_7 // In Gen4+, if both sides have a Pokémon with Shadow Tag, all battlers can escape. Before, neither side could escape this situation. #define B_MOODY_ACC_EVASION GEN_8 // In Gen8, Moody CANNOT raise Accuracy and Evasion anymore. #define B_FLASH_FIRE_FROZEN GEN_7 // In Gen5+, Flash Fire can trigger even when frozen, when it couldn't before. -#define B_SYNCHRONIZE_NATURE GEN_8 // In Gen8, if the Pokémon with Synchronize is leading the party, it's 100% guaranteed that wild Pokémon will have the same ability, as opposed to 50% previously. -#define B_SYNCHRONIZE_TOXIC GEN_8 // In Gen5+, if the Pokémon with Synchronize is badly poisoned, the opponent will also become badly poisoned. Previously, the opponent would become regular poisoned. +#define B_SYNCHRONIZE_NATURE GEN_8 // In Gen8, if a Pokémon with Synchronize is leading the party, it's 100% guaranteed that wild Pokémon will have the same ability, as opposed to 50% previously. +#define B_SYNCHRONIZE_TOXIC GEN_8 // In Gen5+, if a Pokémon with Synchronize is badly poisoned, the opponent will also become badly poisoned. Previously, the opponent would become regular poisoned. #define B_UPDATED_INTIMIDATE GEN_8 // In Gen8, Intimidate doesn't work on opponents with the Inner Focus, Scrappy, Own Tempo or Oblivious abilities. // Item settings From 4bdbef9a9d25d8e547c2bd97e962df3b43d95e05 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 5 Nov 2021 22:21:50 -0300 Subject: [PATCH 71/72] Use the right defensive target stats during Shell Side Arm calculation --- src/battle_script_commands.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index ec7c6effa..938c4bf54 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9036,7 +9036,7 @@ static void Cmd_various(void) attackerAtkStat *= gStatStageRatios[statStage][0]; attackerAtkStat /= gStatStageRatios[statStage][1]; - statStage = gBattleMons[gBattlerTarget].statStages[STAT_ATK]; + statStage = gBattleMons[gBattlerTarget].statStages[STAT_DEF]; targetDefStat *= gStatStageRatios[statStage][0]; targetDefStat /= gStatStageRatios[statStage][1]; @@ -9046,7 +9046,7 @@ static void Cmd_various(void) attackerSpAtkStat *= gStatStageRatios[statStage][0]; attackerSpAtkStat /= gStatStageRatios[statStage][1]; - statStage = gBattleMons[gBattlerTarget].statStages[STAT_SPATK]; + statStage = gBattleMons[gBattlerTarget].statStages[STAT_SPDEF]; targetSpDefStat *= gStatStageRatios[statStage][0]; targetSpDefStat /= gStatStageRatios[statStage][1]; From c2e8c1058fdd73c97a9b3e112bf03962e05d5aea Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 5 Nov 2021 23:07:26 -0300 Subject: [PATCH 72/72] Force set gSwapDamageCategory's initial value in Photon Geyser's and Shell Side Arm's calculations --- src/battle_script_commands.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 938c4bf54..78872b638 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9011,6 +9011,8 @@ static void Cmd_various(void) u8 attackerAtkStage = gBattleMons[gBattlerAttacker].statStages[STAT_ATK]; u32 attackerSpAtkStat = gBattleMons[gBattlerAttacker].spAttack; + gSwapDamageCategory = FALSE; + attackerAtkStat *= gStatStageRatios[attackerAtkStage][0]; attackerAtkStat /= gStatStageRatios[attackerAtkStage][1]; @@ -9032,6 +9034,8 @@ static void Cmd_various(void) u32 physical; u32 special; + gSwapDamageCategory = FALSE; + statStage = gBattleMons[gBattlerAttacker].statStages[STAT_ATK]; attackerAtkStat *= gStatStageRatios[statStage][0]; attackerAtkStat /= gStatStageRatios[statStage][1];