fix stuff cheeks w new consumeberry impl

This commit is contained in:
ghoulslash 2022-05-13 16:28:23 -04:00
parent f6f4227f49
commit cdd37ad1bb
3 changed files with 15 additions and 6 deletions

View File

@ -1785,8 +1785,9 @@
various \battler, VARIOUS_TRY_ACTIVATE_GRIM_NEIGH
.endm
.macro consumeberry battler:req
.macro consumeberry battler:req, frombattler:req
various \battler, VARIOUS_CONSUME_BERRY
.byte \frombattler
.endm
.macro activateitemeffects battler:req

View File

@ -661,7 +661,7 @@ BattleScript_EffectFlingConsumeBerry:
battleritemtolastuseditem BS_TARGET
setbyte sBERRY_OVERRIDE, 1 @ override the requirements for eating berries
orword gHitMarker, HITMARKER_NO_ANIMATIONS
consumeberry BS_TARGET
consumeberry BS_TARGET, TRUE
bicword gHitMarker, HITMARKER_NO_ANIMATIONS
setbyte sBERRY_OVERRIDE, 0
restorebattleritem BS_TARGET
@ -1058,9 +1058,10 @@ BattleScript_EffectStuffCheeks::
BattleScript_StuffCheeksEatBerry:
setbyte sBERRY_OVERRIDE, TRUE
orword gHitMarker, HITMARKER_NO_ANIMATIONS
consumeberry BS_ATTACKER
consumeberry BS_ATTACKER, TRUE
bicword gHitMarker, HITMARKER_NO_ANIMATIONS
setbyte sBERRY_OVERRIDE, FALSE
removeitem BS_ATTACKER
setstatchanger STAT_DEF, 2, FALSE
statbuffchange MOVE_EFFECT_AFFECTS_USER | STAT_BUFF_ALLOW_PTR, BattleScript_StuffCheeksEnd
setgraphicalstatchangevalues
@ -1350,7 +1351,7 @@ BattleScript_MoveEffectBugBite::
waitmessage B_WAIT_TIME_LONG
orword gHitMarker, HITMARKER_NO_ANIMATIONS
setbyte sBERRY_OVERRIDE, TRUE @ override the requirements for eating berries
consumeberry BS_ATTACKER
consumeberry BS_ATTACKER, FALSE
bicword gHitMarker, HITMARKER_NO_ANIMATIONS
setbyte sBERRY_OVERRIDE, FALSE
return

View File

@ -9276,12 +9276,19 @@ static void Cmd_various(void)
break;
case VARIOUS_CONSUME_BERRY:
if (gBattleScripting.overrideBerryRequirements == 2)
break;
{
gBattlescriptCurrInstr += 4;
return;
}
if (gBattlescriptCurrInstr[3])
gLastUsedItem = gBattleMons[gActiveBattler].item;
gBattleScripting.battler = gEffectBattler = gBattlerTarget = gActiveBattler; // Cover all berry effect battlerId cases. e.g. ChangeStatBuffs uses target ID
if (ItemBattleEffects(ITEMEFFECT_USE_LAST_ITEM, gActiveBattler, FALSE))
return;
break;
gBattlescriptCurrInstr += 4;
return;
case VARIOUS_JUMP_IF_CANT_REVERT_TO_PRIMAL:
{
bool8 canDoPrimalReversion = FALSE;