Fixes Mind Blown / Magic Guard interaction and renames Steel Beam effect (#4043)

* Fixes Mind Blown / Magic Guard interaction and renames Steel Beam effect

* review fixes

---------

Co-authored-by: Bassoonian <iasperbassoonian@gmail.com>
This commit is contained in:
Alex 2024-01-21 23:42:01 +01:00 committed by GitHub
parent a01d442f36
commit 0ec777dd24
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 60 additions and 7 deletions

View file

@ -406,7 +406,7 @@ 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
.4byte BattleScript_EffectMaxHp50Recoil @ EFFECT_MAX_HP_50_RECOIL
.4byte BattleScript_EffectExtremeEvoboost @ EFFECT_EXTREME_EVOBOOST
.4byte BattleScript_EffectHitSetRemoveTerrain @ EFFECT_HIT_SET_REMOVE_TERRAIN
.4byte BattleScript_EffectDarkVoid @ EFFECT_DARK_VOID
@ -927,7 +927,7 @@ BattleScript_EffectShellTrap::
waitmessage B_WAIT_TIME_LONG
goto BattleScript_MoveEnd
BattleScript_EffectSteelBeam::
BattleScript_EffectMaxHp50Recoil::
attackcanceler
attackstring
ppreduce
@ -3592,6 +3592,7 @@ BattleScript_MindBlownDamp:
goto BattleScript_DampStopsExplosion
BattleScript_EffectMindBlown_HpDown:
setbyte sMULTIHIT_EFFECT, 1 @ Note to not faint the attacker
jumpifability BS_ATTACKER, ABILITY_MAGIC_GUARD, BattleScript_EffectMindBlown_AnimDmgNoFaint
dmg_1_2_attackerhp
healthbarupdate BS_ATTACKER
datahpupdate BS_ATTACKER

View file

@ -383,7 +383,7 @@
#define EFFECT_RISING_VOLTAGE 377
#define EFFECT_BEAK_BLAST 378
#define EFFECT_COURT_CHANGE 379
#define EFFECT_STEEL_BEAM 380
#define EFFECT_MAX_HP_50_RECOIL 380
#define EFFECT_EXTREME_EVOBOOST 381
#define EFFECT_HIT_SET_REMOVE_TERRAIN 382 // genesis supernova
#define EFFECT_DARK_VOID 383

View file

@ -972,7 +972,7 @@ static bool32 AI_IsMoveEffectInMinus(u32 battlerAtk, u32 battlerDef, u32 move, s
case EFFECT_OVERHEAT:
case EFFECT_MAKE_IT_RAIN:
case EFFECT_MIND_BLOWN:
case EFFECT_STEEL_BEAM:
case EFFECT_MAX_HP_50_RECOIL:
return TRUE;
case EFFECT_RECOIL_25:
case EFFECT_RECOIL_IF_MISS:

View file

@ -467,7 +467,7 @@ static const u16 sPoints_MoveEffect[NUM_BATTLE_MOVE_EFFECTS] =
[EFFECT_RISING_VOLTAGE] = 0, // TODO: Assign points
[EFFECT_BEAK_BLAST] = 0, // TODO: Assign points
[EFFECT_COURT_CHANGE] = 0, // TODO: Assign points
[EFFECT_STEEL_BEAM] = 0, // TODO: Assign points
[EFFECT_MAX_HP_50_RECOIL] = 0, // TODO: Assign points
[EFFECT_EXTREME_EVOBOOST] = 0, // TODO: Assign points
[EFFECT_HIT_SET_REMOVE_TERRAIN] = 0, // TODO: Assign points
[EFFECT_DARK_VOID] = 0, // TODO: Assign points

View file

@ -12606,7 +12606,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] =
[MOVE_STEEL_BEAM] =
{
.effect = EFFECT_STEEL_BEAM,
.effect = EFFECT_MAX_HP_50_RECOIL,
.power = 140,
.type = TYPE_STEEL,
.accuracy = 95,
@ -13259,7 +13259,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] =
#else
.power = 120,
#endif
.effect = EFFECT_STEEL_BEAM,
.effect = EFFECT_MAX_HP_50_RECOIL,
.type = TYPE_GRASS,
.accuracy = 95,
.pp = 5,

View file

@ -0,0 +1,39 @@
#include "global.h"
#include "test/battle.h"
ASSUMPTIONS
{
ASSUME(gBattleMoves[MOVE_STEEL_BEAM].effect == EFFECT_MAX_HP_50_RECOIL);
}
SINGLE_BATTLE_TEST("Steel Beam causes the user to take damage equal to half of its maximum HP")
{
s16 recoilDamage;
GIVEN {
PLAYER(SPECIES_WOBBUFFET);
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_STEEL_BEAM); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_STEEL_BEAM, player);
HP_BAR(opponent);
HP_BAR(player, captureDamage: &recoilDamage);
} THEN {
EXPECT_EQ(player->maxHP / 2, recoilDamage);
}
}
SINGLE_BATTLE_TEST("Steel Beam hp loss is prevented by Magic Guard")
{
GIVEN {
PLAYER(SPECIES_CLEFAIRY) { Ability(ABILITY_MAGIC_GUARD); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_STEEL_BEAM); }
} SCENE {
ANIMATION(ANIM_TYPE_MOVE, MOVE_STEEL_BEAM, player);
HP_BAR(opponent);
NOT HP_BAR(player);
}
}

View file

@ -105,3 +105,16 @@ DOUBLE_BATTLE_TEST("Mind Blown causes everyone to faint in a double battle")
MESSAGE("Wobbuffet fainted!");
}
}
SINGLE_BATTLE_TEST("Mind Blown hp loss is prevented by Magic Guard")
{
GIVEN {
PLAYER(SPECIES_CLEFAIRY) { Ability(ABILITY_MAGIC_GUARD); }
OPPONENT(SPECIES_WOBBUFFET);
} WHEN {
TURN { MOVE(player, MOVE_MIND_BLOWN); }
} SCENE {
NOT HP_BAR(player);
ANIMATION(ANIM_TYPE_MOVE, MOVE_MIND_BLOWN, player);
}
}