mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-03-13 09:12:24 +01:00
Contact moves for Aftermath and Bestow for Unburden
This commit is contained in:
parent
eb029d557b
commit
77842b0376
@ -2686,12 +2686,10 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
||||
else
|
||||
{
|
||||
gLastUsedItem = gBattleStruct->changedItems[gBattlerAttacker] = gBattleMons[gBattlerTarget].item;
|
||||
gBattleMons[gBattlerTarget].item = 0;
|
||||
gBattleMons[gBattlerTarget].item = 0;
|
||||
|
||||
CheckSetUnburden(gBattlerTarget);
|
||||
|
||||
if (GetBattlerAbility(gBattlerAttacker) == ABILITY_UNBURDEN && gBattleResources->flags->flags[gBattlerAttacker] & RESOURCE_FLAG_UNBURDEN)
|
||||
gBattleResources->flags->flags[gBattlerAttacker] &= ~(RESOURCE_FLAG_UNBURDEN);
|
||||
gBattleResources->flags->flags[gBattlerAttacker] &= ~(RESOURCE_FLAG_UNBURDEN);
|
||||
|
||||
gActiveBattler = gBattlerAttacker;
|
||||
BtlController_EmitSetMonData(0, REQUEST_HELDITEM_BATTLE, 0, 2, &gLastUsedItem);
|
||||
@ -2944,7 +2942,6 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
||||
{
|
||||
gLastUsedItem = gBattleMons[gEffectBattler].item;
|
||||
gBattleMons[gEffectBattler].item = 0;
|
||||
|
||||
CheckSetUnburden(gEffectBattler);
|
||||
|
||||
gActiveBattler = gEffectBattler;
|
||||
@ -2960,7 +2957,6 @@ void SetMoveEffect(bool32 primary, u32 certain)
|
||||
{
|
||||
gLastUsedItem = gBattleMons[gEffectBattler].item;
|
||||
gBattleMons[gEffectBattler].item = 0;
|
||||
|
||||
CheckSetUnburden(gEffectBattler);
|
||||
|
||||
gActiveBattler = gEffectBattler;
|
||||
@ -6140,7 +6136,6 @@ static void Cmd_removeitem(void)
|
||||
gBattleStruct->usedHeldItems[gActiveBattler] = gBattleMons[gActiveBattler].item;
|
||||
|
||||
gBattleMons[gActiveBattler].item = 0;
|
||||
|
||||
CheckSetUnburden(gActiveBattler);
|
||||
|
||||
BtlController_EmitSetMonData(0, REQUEST_HELDITEM_BATTLE, 0, 2, &gBattleMons[gActiveBattler].item);
|
||||
@ -7608,11 +7603,13 @@ static void Cmd_various(void)
|
||||
gBattleMons[gActiveBattler].item = ITEM_NONE;
|
||||
BtlController_EmitSetMonData(0, REQUEST_HELDITEM_BATTLE, 0, 2, &gBattleMons[gActiveBattler].item);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
CheckSetUnburden(gBattlerAttacker);
|
||||
|
||||
gActiveBattler = gBattlerTarget;
|
||||
gBattleMons[gActiveBattler].item = gLastUsedItem;
|
||||
BtlController_EmitSetMonData(0, REQUEST_HELDITEM_BATTLE, 0, 2, &gBattleMons[gActiveBattler].item);
|
||||
MarkBattlerForControllerExec(gActiveBattler);
|
||||
gBattleResources->flags->flags[gBattlerTarget] &= ~(RESOURCE_FLAG_UNBURDEN);
|
||||
|
||||
gBattlescriptCurrInstr += 7;
|
||||
}
|
||||
@ -10518,7 +10515,6 @@ static void Cmd_tryswapitems(void) // trick
|
||||
else
|
||||
{
|
||||
CheckSetUnburden(gBattlerAttacker);
|
||||
|
||||
gBattleCommunication[MULTISTRING_CHOOSER] = 1; // attacker's item -> <- nothing
|
||||
}
|
||||
}
|
||||
|
@ -3323,7 +3323,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
&& gBattleMons[gBattlerAttacker].statStages[STAT_SPEED] != 0
|
||||
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg
|
||||
&& TARGET_TURN_DAMAGED
|
||||
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT))
|
||||
&& IsMoveMakingContact(move, gBattlerAttacker))
|
||||
{
|
||||
gBattleScripting.moveEffect = MOVE_EFFECT_AFFECTS_USER | MOVE_EFFECT_SPD_MINUS_1;
|
||||
PREPARE_ABILITY_BUFFER(gBattleTextBuff1, gLastUsedAbility);
|
||||
@ -3339,7 +3339,7 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
&& gBattleMons[gBattlerAttacker].hp != 0
|
||||
&& !gProtectStructs[gBattlerAttacker].confusionSelfDmg
|
||||
&& TARGET_TURN_DAMAGED
|
||||
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT))
|
||||
&& IsMoveMakingContact(move, gBattlerAttacker))
|
||||
{
|
||||
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 8;
|
||||
if (gBattleMoveDamage == 0)
|
||||
@ -3351,11 +3351,10 @@ u8 AbilityBattleEffects(u8 caseID, u8 battler, u8 ability, u8 special, u16 moveA
|
||||
}
|
||||
break;
|
||||
case ABILITY_AFTERMATH:
|
||||
if (IsAbilityOnField(ABILITY_DAMP))
|
||||
break;
|
||||
else if (!(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
||||
if (!IsAbilityOnField(ABILITY_DAMP)
|
||||
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT)
|
||||
&& gBattleMons[gBattlerTarget].hp == 0
|
||||
&& (gBattleMoves[move].flags & FLAG_MAKES_CONTACT))
|
||||
&& IsMoveMakingContact(move, gBattlerAttacker))
|
||||
{
|
||||
gBattleMoveDamage = gBattleMons[gBattlerAttacker].maxHP / 4;
|
||||
if (gBattleMoveDamage == 0)
|
||||
|
Loading…
x
Reference in New Issue
Block a user