fix bug bite not activating if faints target. also save original move target through the effect

This commit is contained in:
ghoulslash 2022-05-13 18:24:52 -04:00
parent b09dad68d5
commit ebb711b6e5
2 changed files with 4 additions and 1 deletions

View File

@ -1351,9 +1351,11 @@ BattleScript_MoveEffectBugBite::
waitmessage B_WAIT_TIME_LONG waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_NO_ANIMATIONS orword gHitMarker, HITMARKER_NO_ANIMATIONS
setbyte sBERRY_OVERRIDE, 1 @ override the requirements for eating berries setbyte sBERRY_OVERRIDE, 1 @ override the requirements for eating berries
savetarget
consumeberry BS_ATTACKER, FALSE consumeberry BS_ATTACKER, FALSE
bicword gHitMarker, HITMARKER_NO_ANIMATIONS bicword gHitMarker, HITMARKER_NO_ANIMATIONS
setbyte sBERRY_OVERRIDE, 0 setbyte sBERRY_OVERRIDE, 0
restoretarget
return return
BattleScript_EffectCoreEnforcer: BattleScript_EffectCoreEnforcer:

View File

@ -2665,7 +2665,8 @@ void SetMoveEffect(bool32 primary, u32 certain)
if (gBattleMons[gEffectBattler].hp == 0 if (gBattleMons[gEffectBattler].hp == 0
&& gBattleScripting.moveEffect != MOVE_EFFECT_PAYDAY && gBattleScripting.moveEffect != MOVE_EFFECT_PAYDAY
&& gBattleScripting.moveEffect != MOVE_EFFECT_STEAL_ITEM) && gBattleScripting.moveEffect != MOVE_EFFECT_STEAL_ITEM
&& gBattleScripting.moveEffect != MOVE_EFFECT_BUG_BITE)
INCREMENT_RESET_RETURN INCREMENT_RESET_RETURN
if (DoesSubstituteBlockMove(gBattlerAttacker, gEffectBattler, gCurrentMove) && affectsUser != MOVE_EFFECT_AFFECTS_USER) if (DoesSubstituteBlockMove(gBattlerAttacker, gEffectBattler, gCurrentMove) && affectsUser != MOVE_EFFECT_AFFECTS_USER)