From ef41a4c14d8008b41dd468f9f1a124f1b5a8c017 Mon Sep 17 00:00:00 2001 From: BuffelSaft Date: Sun, 6 Dec 2020 16:14:02 +1300 Subject: [PATCH] Fix Jump Kick * Now inflicts recoil damage on the user if the target was immune to the attack * Gen V+ recoil damage is now half of the user's HP instead of half of the target's HP. --- data/battle_scripts_1.s | 7 ++++--- src/battle_script_commands.c | 2 +- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 0ccaa7ef64..63ae752ec1 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -2806,6 +2806,8 @@ BattleScript_EffectDoubleHit:: BattleScript_EffectRecoilIfMiss:: attackcanceler accuracycheck BattleScript_MoveMissedDoDamage, ACC_CURR_MOVE + typecalc + jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_MoveMissedDoDamage goto BattleScript_HitFromAtkString BattleScript_MoveMissedDoDamage:: jumpifability BS_ATTACKER, ABILITY_MAGIC_GUARD, BattleScript_PrintMoveMissed @@ -2814,19 +2816,18 @@ BattleScript_MoveMissedDoDamage:: pause 0x40 resultmessage waitmessage 0x40 - jumpifbyte CMP_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_DOESNT_AFFECT_FOE, BattleScript_MoveEnd printstring STRINGID_PKMNCRASHED waitmessage 0x40 damagecalc typecalc adjustdamage manipulatedamage DMG_RECOIL_FROM_MISS - bichalfword gMoveResultFlags, MOVE_RESULT_MISSED + bichalfword gMoveResultFlags, MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE orword gHitMarker, HITMARKER_IGNORE_SUBSTITUTE healthbarupdate BS_ATTACKER datahpupdate BS_ATTACKER tryfaintmon BS_ATTACKER, FALSE, NULL - orhalfword gMoveResultFlags, MOVE_RESULT_MISSED + orhalfword gMoveResultFlags, MOVE_RESULT_MISSED | MOVE_RESULT_DOESNT_AFFECT_FOE goto BattleScript_MoveEnd BattleScript_EffectMist:: diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 16e2989f8e..ab3b70e69b 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -8584,7 +8584,7 @@ static void Cmd_manipulatedamage(void) if (gBattleMoveDamage == 0) gBattleMoveDamage = 1; if (B_RECOIL_IF_MISS_DMG >= GEN_5 || ((gBattleMons[gBattlerTarget].maxHP / 2) < gBattleMoveDamage)) - gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 2; + gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2; break; case DMG_DOUBLED: gBattleMoveDamage *= 2;