Merge branch 'RHH/master' into RHH/upcoming

This commit is contained in:
Eduardo Quezada 2023-12-17 17:31:10 -03:00
commit d92c046a80
5 changed files with 34 additions and 1 deletions

View file

@ -207,6 +207,7 @@ struct SpecialStatus
// End of byte
u8 emergencyExited:1;
u8 afterYou:1;
u8 magicianStolen:1; // So that Life Orb doesn't activate after Magician steals it.
};
struct SideTimer

View file

@ -5712,6 +5712,7 @@ static void Cmd_moveend(void)
gEffectBattler = gBattlerTarget;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_MagicianActivates;
gSpecialStatuses[gBattlerAttacker].magicianStolen = TRUE;
effect = TRUE;
}
gBattleScripting.moveendState++;
@ -6069,6 +6070,7 @@ static void Cmd_moveend(void)
gStatuses3[gBattlerAttacker] &= ~STATUS3_ME_FIRST;
gSpecialStatuses[gBattlerAttacker].gemBoost = FALSE;
gSpecialStatuses[gBattlerAttacker].damagedMons = 0;
gSpecialStatuses[gBattlerAttacker].magicianStolen = 0;
gSpecialStatuses[gBattlerTarget].berryReduced = FALSE;
gBattleScripting.moveEffect = 0;
// clear attacker z move data

View file

@ -7777,6 +7777,7 @@ u8 ItemBattleEffects(u8 caseID, u32 battler, bool32 moveTurn)
if (IsBattlerAlive(gBattlerAttacker)
&& !(TestSheerForceFlag(gBattlerAttacker, gCurrentMove))
&& GetBattlerAbility(gBattlerAttacker) != ABILITY_MAGIC_GUARD
&& !gSpecialStatuses[gBattlerAttacker].magicianStolen
&& gSpecialStatuses[gBattlerAttacker].damagedMons)
{
gBattleMoveDamage = GetNonDynamaxMaxHP(gBattlerAttacker) / 10;

View file

@ -13218,7 +13218,7 @@ const struct BattleMove gBattleMoves[MOVES_COUNT_DYNAMAX] =
.type = TYPE_FIRE,
.accuracy = 100,
.pp = 10,
.secondaryEffectChance = 0,
.secondaryEffectChance = 100,
.target = MOVE_TARGET_RANDOM,
.priority = 0,
.split = SPLIT_PHYSICAL,

View file

@ -0,0 +1,29 @@
#include "global.h"
#include "test/battle.h"
SINGLE_BATTLE_TEST("Magician does not get self-damage recoil after stealing Life Orb")
{
GIVEN {
ASSUME(gItems[ITEM_LIFE_ORB].holdEffect == HOLD_EFFECT_LIFE_ORB);
ASSUME(gBattleMoves[MOVE_TACKLE].power != 0);
PLAYER(SPECIES_DELPHOX) { Ability(ABILITY_MAGICIAN); Item(ITEM_NONE); }
OPPONENT(SPECIES_WOBBUFFET) { Item(ITEM_LIFE_ORB); }
} WHEN {
TURN { MOVE(player, MOVE_TACKLE); }
TURN { MOVE(player, MOVE_TACKLE); }
} SCENE {
// 1st turn
MESSAGE("Delphox used Tackle!");
ABILITY_POPUP(player, ABILITY_MAGICIAN);
MESSAGE("Delphox stole Foe Wobbuffet's Life Orb!");
NONE_OF {
HP_BAR(player);
MESSAGE("Delphox was hurt by its Life Orb!");
}
// 2nd turn - Life Orb recoil happens now
MESSAGE("Delphox used Tackle!");
HP_BAR(player);
MESSAGE("Delphox was hurt by its Life Orb!");
}
}