From 6f9b310a23457813d65f12d007d97949ee669aaf Mon Sep 17 00:00:00 2001 From: Evan Date: Thu, 11 Feb 2021 16:00:49 -0700 Subject: [PATCH 01/14] fix mega trigger sprite data corruption --- src/battle_interface.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/battle_interface.c b/src/battle_interface.c index 73b66a7ff..65c98a187 100644 --- a/src/battle_interface.c +++ b/src/battle_interface.c @@ -1516,8 +1516,11 @@ bool32 IsMegaTriggerSpriteActive(void) void HideMegaTriggerSprite(void) { - ChangeMegaTriggerSprite(gBattleStruct->mega.triggerSpriteId, 0); - gSprites[gBattleStruct->mega.triggerSpriteId].tHide = TRUE; + if (gBattleStruct->mega.triggerSpriteId != 0xFF) + { + ChangeMegaTriggerSprite(gBattleStruct->mega.triggerSpriteId, 0); + gSprites[gBattleStruct->mega.triggerSpriteId].tHide = TRUE; + } } void DestroyMegaTriggerSprite(void) From 510686711696b9eb09ffbf24305aeb563c373cb5 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Fri, 2 Apr 2021 04:10:20 +0000 Subject: [PATCH 02/14] Update battle_util.c --- 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 f1f5ffd10..c02448465 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -7559,7 +7559,7 @@ static u32 CalcDefenseStat(u16 move, u8 battlerAtk, u8 battlerDef, u8 moveType, break; case ABILITY_PUNK_ROCK: if (gBattleMoves[move].flags & FLAG_SOUND) - MulModifier(&modifier, UQ_4_12(1.3)); + MulModifier(&modifier, UQ_4_12(2.0)); break; } From d310edda4bc70be90cfa96dbaf853630fee80542 Mon Sep 17 00:00:00 2001 From: AmbientDinosaur <66961099+AmbientDinosaur@users.noreply.github.com> Date: Fri, 2 Apr 2021 19:25:07 +0200 Subject: [PATCH 03/14] Keen Eye evasion ignoring effect from Gen 6 --- 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 0c5250050..3b8bd8563 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1510,7 +1510,7 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move) accStage = gBattleMons[battlerAtk].statStages[STAT_ACC]; evasionStage = gBattleMons[battlerDef].statStages[STAT_EVASION]; - if (atkAbility == ABILITY_UNAWARE) + if (atkAbility == ABILITY_UNAWARE || atkAbility == ABILITY_KEEN_EYE) evasionStage = 6; if (gBattleMoves[move].flags & FLAG_STAT_STAGES_IGNORED) evasionStage = 6; From 9f83c9b5740ce3b198e20d3e0c8871915ae49647 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 3 Apr 2021 21:55:49 -0300 Subject: [PATCH 04/14] Implemented Stench's battle effect And updated its description. --- src/battle_util.c | 52 +++++++++++++++++++++++++++++++++++++++ src/data/text/abilities.h | 2 +- 2 files changed, 53 insertions(+), 1 deletion(-) diff --git a/src/battle_util.c b/src/battle_util.c index f1f5ffd10..9d910692e 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -706,6 +706,43 @@ void HandleAction_ActionFinished(void) // rom const data +static const u8 sMovesNotAffectedByStench[] = +{ + [MOVE_AIR_SLASH] = 1, + [MOVE_ASTONISH] = 1, + [MOVE_BITE] = 1, + [MOVE_BONE_CLUB] = 1, + [MOVE_DARK_PULSE] = 1, + [MOVE_DOUBLE_IRON_BASH] = 1, + [MOVE_DRAGON_RUSH] = 1, + [MOVE_EXTRASENSORY] = 1, + [MOVE_FAKE_OUT] = 1, + [MOVE_FIERY_WRATH] = 1, + [MOVE_FIRE_FANG] = 1, + [MOVE_FLING] = 1, + [MOVE_FLOATY_FALL] = 1, + [MOVE_HEADBUTT] = 1, + [MOVE_HEART_STAMP] = 1, + [MOVE_HYPER_FANG] = 1, + [MOVE_ICE_FANG] = 1, + [MOVE_ICICLE_CRASH] = 1, + [MOVE_IRON_HEAD] = 1, + [MOVE_NEEDLE_ARM] = 1, + [MOVE_NONE] = 1, + [MOVE_ROCK_SLIDE] = 1, + [MOVE_ROLLING_KICK] = 1, + [MOVE_SECRET_POWER] = 1, + [MOVE_SKY_ATTACK] = 1, + [MOVE_SNORE] = 1, + [MOVE_STEAMROLLER] = 1, + [MOVE_STOMP] = 1, + [MOVE_THUNDER_FANG] = 1, + [MOVE_TWISTER] = 1, + [MOVE_WATERFALL] = 1, + [MOVE_ZEN_HEADBUTT] = 1, + [MOVE_ZING_ZAP] = 1, +}; + static const u8 sAbilitiesAffectedByMoldBreaker[] = { [ABILITY_BATTLE_ARMOR] = 1, @@ -4807,6 +4844,21 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u16 ability, u8 special, u16 move effect++; } break; + case ABILITY_STENCH: + if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT) + && gBattleMons[gBattlerTarget].hp != 0 + && !gProtectStructs[gBattlerAttacker].confusionSelfDmg + && (Random() % 10) == 0 + && !IS_MOVE_STATUS(move) + && !sMovesNotAffectedByStench[gCurrentMove]) + { + gBattleScripting.moveEffect = MOVE_EFFECT_FLINCH; + BattleScriptPushCursor(); + SetMoveEffect(FALSE, 0); + BattleScriptPop(); + effect++; + } + break; } break; case ABILITYEFFECT_MOVE_END_OTHER: // Abilities that activate on *another* battler's moveend: Dancer, Soul-Heart, Receiver, Symbiosis diff --git a/src/data/text/abilities.h b/src/data/text/abilities.h index fdecea8a8..a9f8ba7ab 100644 --- a/src/data/text/abilities.h +++ b/src/data/text/abilities.h @@ -1,5 +1,5 @@ static const u8 sNoneDescription[] = _("No special ability."); -static const u8 sStenchDescription[] = _("Helps repel wild POKéMON."); +static const u8 sStenchDescription[] = _("May cause a foe to flinch."); static const u8 sDrizzleDescription[] = _("Summons rain in battle."); static const u8 sSpeedBoostDescription[] = _("Gradually boosts Speed."); static const u8 sBattleArmorDescription[] = _("Blocks critical hits."); From 63edb34fe274ca0db3c83ce36e559dae90e30d3d Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sun, 4 Apr 2021 08:44:32 -0300 Subject: [PATCH 05/14] Minor syntax tweaks to HandleAction_UseMove --- src/battle_util.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index f1f5ffd10..89fa89ef2 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -99,7 +99,7 @@ void HandleAction_UseMove(void) } // encore forces you to use the same move else if (gDisableStructs[gBattlerAttacker].encoredMove != MOVE_NONE - && gDisableStructs[gBattlerAttacker].encoredMove == gBattleMons[gBattlerAttacker].moves[gDisableStructs[gBattlerAttacker].encoredMovePos]) + && gDisableStructs[gBattlerAttacker].encoredMove == gBattleMons[gBattlerAttacker].moves[gDisableStructs[gBattlerAttacker].encoredMovePos]) { gCurrentMove = gChosenMove = gDisableStructs[gBattlerAttacker].encoredMove; gCurrMovePos = gChosenMovePos = gDisableStructs[gBattlerAttacker].encoredMovePos; @@ -107,7 +107,7 @@ void HandleAction_UseMove(void) } // check if the encored move wasn't overwritten else if (gDisableStructs[gBattlerAttacker].encoredMove != MOVE_NONE - && gDisableStructs[gBattlerAttacker].encoredMove != gBattleMons[gBattlerAttacker].moves[gDisableStructs[gBattlerAttacker].encoredMovePos]) + && gDisableStructs[gBattlerAttacker].encoredMove != gBattleMons[gBattlerAttacker].moves[gDisableStructs[gBattlerAttacker].encoredMovePos]) { gCurrMovePos = gChosenMovePos = gDisableStructs[gBattlerAttacker].encoredMovePos; gCurrentMove = gChosenMove = gBattleMons[gBattlerAttacker].moves[gCurrMovePos]; @@ -145,17 +145,15 @@ void HandleAction_UseMove(void) && GetBattlerSide(gBattlerAttacker) != GetBattlerSide(gSideTimers[side].followmeTarget) && gBattleMons[gSideTimers[side].followmeTarget].hp != 0 && (GetBattlerAbility(gBattlerAttacker) != ABILITY_PROPELLER_TAIL - || GetBattlerAbility(gBattlerAttacker) != ABILITY_STALWART)) + || GetBattlerAbility(gBattlerAttacker) != ABILITY_STALWART)) { gBattlerTarget = gSideTimers[side].followmeTarget; } else if ((gBattleTypeFlags & BATTLE_TYPE_DOUBLE) - && gSideTimers[side].followmeTimer == 0 - && (gBattleMoves[gCurrentMove].power != 0 || gBattleMoves[gCurrentMove].target != MOVE_TARGET_USER) - && ((gBattleMons[*(gBattleStruct->moveTarget + gBattlerAttacker)].ability != ABILITY_LIGHTNING_ROD && moveType == TYPE_ELECTRIC) - || (gBattleMons[*(gBattleStruct->moveTarget + gBattlerAttacker)].ability != ABILITY_STORM_DRAIN && moveType == TYPE_WATER) - ) - ) + && gSideTimers[side].followmeTimer == 0 + && (gBattleMoves[gCurrentMove].power != 0 || gBattleMoves[gCurrentMove].target != MOVE_TARGET_USER) + && ((gBattleMons[*(gBattleStruct->moveTarget + gBattlerAttacker)].ability != ABILITY_LIGHTNING_ROD && moveType == TYPE_ELECTRIC) + || (gBattleMons[*(gBattleStruct->moveTarget + gBattlerAttacker)].ability != ABILITY_STORM_DRAIN && moveType == TYPE_WATER))) { side = GetBattlerSide(gBattlerAttacker); for (gActiveBattler = 0; gActiveBattler < gBattlersCount; gActiveBattler++) @@ -163,10 +161,10 @@ void HandleAction_UseMove(void) if (side != GetBattlerSide(gActiveBattler) && *(gBattleStruct->moveTarget + gBattlerAttacker) != gActiveBattler && ((GetBattlerAbility(gActiveBattler) == ABILITY_LIGHTNING_ROD && moveType == TYPE_ELECTRIC) - || (GetBattlerAbility(gActiveBattler) == ABILITY_STORM_DRAIN && moveType == TYPE_WATER)) + || (GetBattlerAbility(gActiveBattler) == ABILITY_STORM_DRAIN && moveType == TYPE_WATER)) && GetBattlerTurnOrderNum(gActiveBattler) < var && (GetBattlerAbility(gBattlerAttacker) != ABILITY_PROPELLER_TAIL - || GetBattlerAbility(gBattlerAttacker) != ABILITY_STALWART)) + || GetBattlerAbility(gBattlerAttacker) != ABILITY_STALWART)) { var = GetBattlerTurnOrderNum(gActiveBattler); } @@ -231,7 +229,7 @@ void HandleAction_UseMove(void) } } else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE - && gBattleMoves[gChosenMove].target & MOVE_TARGET_RANDOM) + && gBattleMoves[gChosenMove].target & MOVE_TARGET_RANDOM) { if (GetBattlerSide(gBattlerAttacker) == B_SIDE_PLAYER) { @@ -262,7 +260,7 @@ void HandleAction_UseMove(void) gBattlerTarget = gBattlerAttacker; } else if (gBattleTypeFlags & BATTLE_TYPE_DOUBLE - && gBattleMoves[gChosenMove].target == MOVE_TARGET_FOES_AND_ALLY) + && gBattleMoves[gChosenMove].target == MOVE_TARGET_FOES_AND_ALLY) { for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++) { @@ -292,7 +290,7 @@ void HandleAction_UseMove(void) // Choose battlescript. if (gBattleTypeFlags & BATTLE_TYPE_PALACE - && gProtectStructs[gBattlerAttacker].palaceUnableToUseMove) + && gProtectStructs[gBattlerAttacker].palaceUnableToUseMove) { if (gBattleMons[gBattlerAttacker].hp == 0) { From ad19b262eb531a158237ab7524f5a94133cd2406 Mon Sep 17 00:00:00 2001 From: AmbientDinosaur <66961099+AmbientDinosaur@users.noreply.github.com> Date: Thu, 8 Apr 2021 03:21:51 +0200 Subject: [PATCH 06/14] Corrected the move data for Gen 4 Overheat The contact flag was removed in Gen 4, and the base power was lowered in Gen 6. Currently, the changes are flipped around. --- src/data/battle_moves.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 661af2eab..c8203aa0e 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -4939,8 +4939,8 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = .power = 130, .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, #elif B_UPDATED_MOVE_DATA >= GEN_4 - .power = 130, - .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, + .power = 140, + .flags = FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, #else .power = 140, .flags = FLAG_MAKES_CONTACT | FLAG_PROTECT_AFFECTED | FLAG_MIRROR_MOVE_AFFECTED | FLAG_KINGS_ROCK_AFFECTED, From 232acab1a24cd421cc6c34d83d2007c3378cb43b Mon Sep 17 00:00:00 2001 From: AmbientDinosaur <66961099+AmbientDinosaur@users.noreply.github.com> Date: Sat, 10 Apr 2021 22:55:07 +0200 Subject: [PATCH 07/14] Remove superfluous define of LEVEL_UP_END LEVEL_UP_END is already defined in constants/pokemon.h --- src/data/pokemon/level_up_learnsets.h | 1 - 1 file changed, 1 deletion(-) diff --git a/src/data/pokemon/level_up_learnsets.h b/src/data/pokemon/level_up_learnsets.h index a5091c5e1..77382a151 100644 --- a/src/data/pokemon/level_up_learnsets.h +++ b/src/data/pokemon/level_up_learnsets.h @@ -1,5 +1,4 @@ #define LEVEL_UP_MOVE(lvl, moveLearned) {.move = moveLearned, .level = lvl} -#define LEVEL_UP_END (0xffff) static const struct LevelUpMove sBulbasaurLevelUpLearnset[] = { LEVEL_UP_MOVE( 1, MOVE_TACKLE), From 49bb3453387b43cc6ce62f82c4f26f4582a030a7 Mon Sep 17 00:00:00 2001 From: ExpoSeed <> Date: Fri, 16 Apr 2021 20:36:45 -0500 Subject: [PATCH 08/14] Introduce NUM_ABILITY_SLOTS --- include/constants/pokemon.h | 2 ++ include/pokemon.h | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/include/constants/pokemon.h b/include/constants/pokemon.h index 51ef0c015..1f66b83aa 100644 --- a/include/constants/pokemon.h +++ b/include/constants/pokemon.h @@ -348,4 +348,6 @@ #define MON_PIC_SIZE (64 * 64 / 2) +#define NUM_ABILITY_SLOTS 2 + #endif // GUARD_CONSTANTS_POKEMON_H diff --git a/include/pokemon.h b/include/pokemon.h index 82cdefeac..6e1d83576 100644 --- a/include/pokemon.h +++ b/include/pokemon.h @@ -200,7 +200,7 @@ struct BaseStats /* 0x13 */ u8 growthRate; /* 0x14 */ u8 eggGroup1; /* 0x15 */ u8 eggGroup2; - /* 0x16 */ u8 abilities[2]; + /* 0x16 */ u8 abilities[NUM_ABILITY_SLOTS]; /* 0x18 */ u8 safariZoneFleeRate; /* 0x19 */ u8 bodyColor : 7; u8 noFlip : 1; From 3dbb096393c840a030706570e83af1cc561f4cf9 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Wed, 28 Apr 2021 21:50:23 -0300 Subject: [PATCH 09/14] Added Gravity's missing acc boost --- src/battle_script_commands.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index df3e8da3d..13ee08b3d 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -1573,6 +1573,9 @@ u32 GetTotalAccuracy(u32 battlerAtk, u32 battlerDef, u32 move) calc = (calc * 120) / 100; // 20% acc boost } + if (gFieldStatuses & STATUS_FIELD_GRAVITY) + calc = (calc * 5) / 3; // 1.66 Gravity acc boost + return calc; } From 5489ab97e4d287ec37aa4e755ab7d2a1f621b542 Mon Sep 17 00:00:00 2001 From: LOuroboros Date: Sat, 1 May 2021 07:37:23 -0300 Subject: [PATCH 10/14] MAGIC_GAURD_CHECK -> MAGIC_GUARD_CHECK --- src/battle_util.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index b5e52e4a7..e32792052 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -2138,7 +2138,7 @@ s32 GetDrainedBigRootHp(u32 battler, s32 hp) return hp * -1; } -#define MAGIC_GAURD_CHECK \ +#define MAGIC_GUARD_CHECK \ if (ability == ABILITY_MAGIC_GUARD) \ {\ RecordAbilityBattle(gActiveBattler, ability);\ @@ -2213,7 +2213,7 @@ u8 DoBattlerEndTurnEffects(void) && gBattleMons[gStatuses3[gActiveBattler] & STATUS3_LEECHSEED_BATTLER].hp != 0 && gBattleMons[gActiveBattler].hp != 0) { - MAGIC_GAURD_CHECK; + MAGIC_GUARD_CHECK; gBattlerTarget = gStatuses3[gActiveBattler] & STATUS3_LEECHSEED_BATTLER; // Notice gBattlerTarget is actually the HP receiver. gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 8; @@ -2230,7 +2230,7 @@ u8 DoBattlerEndTurnEffects(void) if ((gBattleMons[gActiveBattler].status1 & STATUS1_POISON) && gBattleMons[gActiveBattler].hp != 0) { - MAGIC_GAURD_CHECK; + MAGIC_GUARD_CHECK; if (ability == ABILITY_POISON_HEAL) { @@ -2259,7 +2259,7 @@ u8 DoBattlerEndTurnEffects(void) if ((gBattleMons[gActiveBattler].status1 & STATUS1_TOXIC_POISON) && gBattleMons[gActiveBattler].hp != 0) { - MAGIC_GAURD_CHECK; + MAGIC_GUARD_CHECK; if (ability == ABILITY_POISON_HEAL) { @@ -2291,7 +2291,7 @@ u8 DoBattlerEndTurnEffects(void) if ((gBattleMons[gActiveBattler].status1 & STATUS1_BURN) && gBattleMons[gActiveBattler].hp != 0) { - MAGIC_GAURD_CHECK; + MAGIC_GUARD_CHECK; gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / (B_BURN_DAMAGE >= GEN_7 ? 16 : 8); if (ability == ABILITY_HEATPROOF) @@ -2311,7 +2311,7 @@ u8 DoBattlerEndTurnEffects(void) if ((gBattleMons[gActiveBattler].status2 & STATUS2_NIGHTMARE) && gBattleMons[gActiveBattler].hp != 0) { - MAGIC_GAURD_CHECK; + MAGIC_GUARD_CHECK; // R/S does not perform this sleep check, which causes the nightmare effect to // persist even after the affected Pokemon has been awakened by Shed Skin. if (gBattleMons[gActiveBattler].status1 & STATUS1_SLEEP) @@ -2333,7 +2333,7 @@ u8 DoBattlerEndTurnEffects(void) if ((gBattleMons[gActiveBattler].status2 & STATUS2_CURSED) && gBattleMons[gActiveBattler].hp != 0) { - MAGIC_GAURD_CHECK; + MAGIC_GUARD_CHECK; gBattleMoveDamage = gBattleMons[gActiveBattler].maxHP / 4; if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; @@ -2347,7 +2347,7 @@ u8 DoBattlerEndTurnEffects(void) { if (--gDisableStructs[gActiveBattler].wrapTurns != 0) // damaged by wrap { - MAGIC_GAURD_CHECK; + MAGIC_GUARD_CHECK; gBattleScripting.animArg1 = gBattleStruct->wrappedMove[gActiveBattler]; gBattleScripting.animArg2 = gBattleStruct->wrappedMove[gActiveBattler] >> 8; From e8598076a8b6b6f7212ca633fdcabfebacb2e776 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Tue, 4 May 2021 22:55:19 +1200 Subject: [PATCH 11/14] Fix Toxic and Flame Orb Shouldn't inflict status conditions on a fainted mon. --- src/battle_util.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/battle_util.c b/src/battle_util.c index f1f5ffd10..b25c5a538 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -6271,7 +6271,8 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) case HOLD_EFFECT_TOXIC_ORB: if (!gBattleMons[battlerId].status1 && CanPoisonType(battlerId, battlerId) - && GetBattlerAbility(battlerId) != ABILITY_IMMUNITY) + && GetBattlerAbility(battlerId) != ABILITY_IMMUNITY + && IsBattlerAlive) { effect = ITEM_STATUS_CHANGE; gBattleMons[battlerId].status1 = STATUS1_TOXIC_POISON; @@ -6282,7 +6283,8 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) case HOLD_EFFECT_FLAME_ORB: if (!gBattleMons[battlerId].status1 && !IS_BATTLER_OF_TYPE(battlerId, TYPE_FIRE) - && GetBattlerAbility(battlerId) != ABILITY_WATER_VEIL) + && GetBattlerAbility(battlerId) != ABILITY_WATER_VEIL + && IsBattlerAlive) { effect = ITEM_STATUS_CHANGE; gBattleMons[battlerId].status1 = STATUS1_BURN; From 542201dd4f91bb0285b2e1f8f20e3b12db2f7d27 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Tue, 4 May 2021 23:08:48 +1200 Subject: [PATCH 12/14] Add missing ability checks to orbs Flame Orb shouldn't burn mons with Water Bubble and neither orb should affect mons with Comatose. --- src/battle_util.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/battle_util.c b/src/battle_util.c index b25c5a538..eab309467 100644 --- a/src/battle_util.c +++ b/src/battle_util.c @@ -6272,6 +6272,7 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) if (!gBattleMons[battlerId].status1 && CanPoisonType(battlerId, battlerId) && GetBattlerAbility(battlerId) != ABILITY_IMMUNITY + && GetBattlerAbility(battlerId) != ABILITY_COMATOSE && IsBattlerAlive) { effect = ITEM_STATUS_CHANGE; @@ -6284,6 +6285,8 @@ u8 ItemBattleEffects(u8 caseID, u8 battlerId, bool8 moveTurn) if (!gBattleMons[battlerId].status1 && !IS_BATTLER_OF_TYPE(battlerId, TYPE_FIRE) && GetBattlerAbility(battlerId) != ABILITY_WATER_VEIL + && GetBattlerAbility(battlerId) != ABILITY_WATER_BUBBLE + && GetBattlerAbility(battlerId) != ABILITY_COMATOSE && IsBattlerAlive) { effect = ITEM_STATUS_CHANGE; From 5d177f0a152f60ce00db62e3cae3105ff5d1b2e4 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Tue, 4 May 2021 23:20:22 +1200 Subject: [PATCH 13/14] Make Big Root affect absorb moves Big Root should increase the HP recovered by Absorb, Giga Drain etc. --- data/battle_scripts_1.s | 2 ++ src/battle_script_commands.c | 7 ++++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 16bb6e92c..f10880c6c 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -2234,6 +2234,7 @@ BattleScript_EffectAbsorb:: resultmessage waitmessage 0x40 setdrainedhp + manipulatedamage DMG_BIG_ROOT orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE jumpifability BS_TARGET, ABILITY_LIQUID_OOZE, BattleScript_AbsorbLiquidOoze setbyte cMULTISTRING_CHOOSER, 0x0 @@ -2361,6 +2362,7 @@ BattleScript_DreamEaterWorked: resultmessage waitmessage 0x40 setdrainedhp + manipulatedamage DMG_BIG_ROOT orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 0c5250050..443fc4475 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8877,15 +8877,16 @@ static void Cmd_stockpiletohpheal(void) } } +// Sign change for drained HP handled in GetDrainedBigRootHp static void Cmd_setdrainedhp(void) { if (gBattleMoves[gCurrentMove].argument != 0) - gBattleMoveDamage = -(gHpDealt * gBattleMoves[gCurrentMove].argument / 100); + gBattleMoveDamage = (gHpDealt * gBattleMoves[gCurrentMove].argument / 100); else - gBattleMoveDamage = -(gHpDealt / 2); + gBattleMoveDamage = (gHpDealt / 2); if (gBattleMoveDamage == 0) - gBattleMoveDamage = -1; + gBattleMoveDamage = 1; gBattlescriptCurrInstr++; } From ec4012e95d8ef9e147ae575b2447e7e74a270498 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Tue, 4 May 2021 23:57:43 +1200 Subject: [PATCH 14/14] Fix "Room" move battle messages Move new line so these messages fit in the text box. --- src/battle_message.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/battle_message.c b/src/battle_message.c index 05874c595..8100f3cca 100644 --- a/src/battle_message.c +++ b/src/battle_message.c @@ -545,7 +545,7 @@ static const u8 sText_VanishedInstantly[] =_("{B_ATK_NAME_WITH_PREFIX} vanished\ static const u8 sText_ProtectedTeam[] =_("{B_CURRENT_MOVE} protected\n{B_ATK_TEAM2} team!"); static const u8 sText_SharedItsGuard[] =_("{B_ATK_NAME_WITH_PREFIX} shared its\nguard with the target!"); static const u8 sText_SharedItsPower[] =_("{B_ATK_NAME_WITH_PREFIX} shared its\npower with the target!"); -static const u8 sText_SwapsDefAndSpDefOfAllPkmn[] =_("It created a bizarre area in which\nthe Defense and Sp.Def stats are swapped!"); +static const u8 sText_SwapsDefAndSpDefOfAllPkmn[] =_("It created a bizarre area in which the\nDefense and Sp.Def stats are swapped!"); static const u8 sText_BecameNimble[] =_("{B_ATK_NAME_WITH_PREFIX} became nimble!"); static const u8 sText_HurledIntoTheAir[] =_("{B_DEF_NAME_WITH_PREFIX} was hurled\ninto the air!"); static const u8 sText_HeldItemsLoseEffects[] =_("It created a bizarre area in which\nPokémon's held items lose their effects!"); @@ -569,8 +569,8 @@ static const u8 sText_TelekinesisEnds[] = _("{B_ATK_NAME_WITH_PREFIX} was freed\ static const u8 sText_TailwindEnds[] = _("{B_ATK_TEAM1} team's tailwind\n petered out!"); static const u8 sText_LuckyChantEnds[] = _("{B_ATK_TEAM1} team's Lucky Chant\n wore off!"); static const u8 sText_TrickRoomEnds[] = _("The twisted dimensions returned to\nnormal!"); -static const u8 sText_WonderRoomEnds[] = _("Wonder Room wore off, and\nDefense and Sp. Def stats returned to normal!"); -static const u8 sText_MagicRoomEnds[] = _("Magic Room wore off, and\nheld items' effects returned to normal!"); +static const u8 sText_WonderRoomEnds[] = _("Wonder Room wore off, and Defense\nand Sp. Def stats returned to normal!"); +static const u8 sText_MagicRoomEnds[] = _("Magic Room wore off, and held items'\neffects returned to normal!"); static const u8 sText_MudSportEnds[] = _("The effects of Mud Sport have faded."); static const u8 sText_WaterSportEnds[] = _("The effects of Water Sport have faded."); static const u8 sText_GravityEnds[] = _("Gravity returned to normal!");