diff --git a/data/battle_scripts_1.s b/data/battle_scripts_1.s index 0dc88eb43..47cbf3091 100644 --- a/data/battle_scripts_1.s +++ b/data/battle_scripts_1.s @@ -410,6 +410,51 @@ gBattleScriptsForMoveEffects:: .4byte BattleScript_EffectHit @ EFFECT_RISING_VOLTAGE .4byte BattleScript_EffectHit @ EFFECT_BEAK_BLAST .4byte BattleScript_EffectCourtChange @ EFFECT_COURT_CHANGE + .4byte BattleScript_EffectSteelBeam @ EFFECT_STEEL_BEAM + +BattleScript_EffectSteelBeam:: + attackcanceler + attackstring + ppreduce + accuracycheck BattleScript_SteelBeamMiss, ACC_CURR_MOVE + 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 + jumpifability BS_ATTACKER, ABILITY_MAGIC_GUARD, BattleScript_SteelBeamAfterSelfDamage + call BattleScript_SteelBeamSelfDamage +BattleScript_SteelBeamAfterSelfDamage:: + waitstate + tryfaintmon BS_ATTACKER + tryfaintmon BS_TARGET + goto BattleScript_MoveEnd +BattleScript_SteelBeamMiss:: + pause B_WAIT_TIME_SHORT + effectivenesssound + resultmessage + waitmessage B_WAIT_TIME_LONG + jumpifability BS_ATTACKER, ABILITY_MAGIC_GUARD, BattleScript_MoveEnd + bichalfword gMoveResultFlags, MOVE_RESULT_MISSED + call BattleScript_SteelBeamSelfDamage + orhalfword gMoveResultFlags, MOVE_RESULT_MISSED + goto BattleScript_SteelBeamAfterSelfDamage + +BattleScript_SteelBeamSelfDamage:: + dmg_1_2_attackerhp + healthbarupdate BS_ATTACKER + datahpupdate BS_ATTACKER + return BattleScript_EffectCourtChange:: attackcanceler diff --git a/include/constants/battle_move_effects.h b/include/constants/battle_move_effects.h index 3cc3d72b3..c3460bcfe 100644 --- a/include/constants/battle_move_effects.h +++ b/include/constants/battle_move_effects.h @@ -393,7 +393,8 @@ #define EFFECT_RISING_VOLTAGE 387 #define EFFECT_BEAK_BLAST 388 #define EFFECT_COURT_CHANGE 389 +#define EFFECT_STEEL_BEAM 390 -#define NUM_BATTLE_MOVE_EFFECTS 390 +#define NUM_BATTLE_MOVE_EFFECTS 391 #endif // GUARD_CONSTANTS_BATTLE_MOVE_EFFECTS_H diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 227d2f573..cb60447ed 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -9882,7 +9882,7 @@ static void Cmd_manipulatedamage(void) gBattleMoveDamage = GetDrainedBigRootHp(gBattlerAttacker, gBattleMoveDamage); break; case DMG_1_2_ATTACKER_HP: - gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 2; + gBattleMoveDamage = (gBattleMons[gBattlerAttacker].maxHP + 1) / 2; // Half of Max HP Rounded UP break; case DMG_RECOIL_FROM_IMMUNE: gBattleMoveDamage = gBattleMons[gBattlerTarget].maxHP / 2; diff --git a/src/data/battle_moves.h b/src/data/battle_moves.h index 1f90abf03..2035acff7 100644 --- a/src/data/battle_moves.h +++ b/src/data/battle_moves.h @@ -11221,7 +11221,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT] = [MOVE_STEEL_BEAM] = { - .effect = EFFECT_RECOIL_50, + .effect = EFFECT_STEEL_BEAM, .power = 140, .type = TYPE_STEEL, .accuracy = 95,