Finish/fix Beak Blast

This was not working at all, but the basic framework was there; some small changes tidied it up and made it work.
This commit is contained in:
BuffelSaft 2021-11-19 20:19:10 +13:00
parent 98712e576e
commit 86efd69370
2 changed files with 19 additions and 23 deletions

View File

@ -403,12 +403,12 @@ gBattleScriptsForMoveEffects::
.4byte BattleScript_EffectOctolock @ EFFECT_OCTOLOCK
.4byte BattleScript_EffectClangorousSoul @ EFFECT_CLANGOROUS_SOUL
.4byte BattleScript_EffectHit @ EFFECT_BOLT_BEAK
.4byte BattleScript_EffectHit @ EFFECT_EXPANDING_FORCE
.4byte BattleScript_EffectHit @ EFFECT_EXPANDING_FORCE
.4byte BattleScript_EffectScaleShot @ EFFECT_SCALE_SHOT
.4byte BattleScript_EffectMeteorBeam @ EFFECT_METEOR_BEAM
.4byte BattleScript_EffectHit @ EFFECT_RISING_VOLTAGE
.4byte BattleScript_EffectCorrosiveGas @ EFFECT_CORROSIVE_GAS
.4byte BattleScript_EffectBeakBlast @ EFFECT_BEAK_BLAST
.4byte BattleScript_EffectHit @ EFFECT_BEAK_BLAST
.4byte BattleScript_EffectCourtChange @ EFFECT_COURT_CHANGE
.4byte BattleScript_EffectShellTrap @ EFFECT_SHELL_TRAP
@ -464,14 +464,6 @@ BattleScript_EffectCourtChange::
waitmessage 0x40
goto BattleScript_MoveEnd
BattleScript_EffectBeakBlast::
attackcanceler
jumpifnodamage BattleScript_HitFromAccCheck
ppreduce
printstring STRINGID_PKMNLOSTFOCUS
waitmessage 0x40
goto BattleScript_MoveEnd
BattleScript_BeakBlastSetUp::
setbeakblast BS_ATTACKER
printstring STRINGID_EMPTYSTRING3
@ -482,17 +474,11 @@ BattleScript_BeakBlastSetUp::
end2
BattleScript_BeakBlastBurn::
jumpifstatus BS_TARGET, STATUS1_BURN, BattleScript_AlreadyBurned
jumpiftype BS_TARGET, TYPE_FIRE, BattleScript_NotAffected
jumpifability BS_TARGET, ABILITY_WATER_VEIL, BattleScript_WaterVeilPrevents
jumpifability BS_TARGET, ABILITY_COMATOSE, BattleScript_LeafGuardProtects
jumpifflowerveil BattleScript_FlowerVeilProtects
jumpifleafguardprotected BS_TARGET, BattleScript_LeafGuardProtects
jumpifstatus BS_TARGET, STATUS1_ANY, BattleScript_BeakBlastBurnReturn
setmoveeffect MOVE_EFFECT_BURN | MOVE_EFFECT_AFFECTS_USER
seteffectprimary
BattleScript_BeakBlastBurnReturn:
setbyte cMULTISTRING_CHOOSER, 0
copybyte gEffectBattler, gBattlerAttacker
call BattleScript_MoveEffectBurn
return
BattleScript_EffectCorrosiveGas::
attackcanceler
accuracycheck BattleScript_PrintMoveMissed, NO_ACC_CALC_CHECK_LOCK_ON

View File

@ -1543,6 +1543,11 @@ static void Cmd_attackcanceler(void)
gBattleCommunication[MISS_TYPE] = B_MSG_PROTECTED;
gBattlescriptCurrInstr++;
}
else if (gProtectStructs[gBattlerTarget].beakBlastCharge && IsMoveMakingContact(gCurrentMove, gBattlerAttacker))
{
gProtectStructs[gBattlerAttacker].touchedProtectLike = TRUE;
gBattlescriptCurrInstr++;
}
else
{
gBattlescriptCurrInstr++;
@ -4964,7 +4969,7 @@ static void Cmd_moveend(void)
}
else if (gProtectStructs[gBattlerTarget].obstructed && gCurrentMove != MOVE_SUCKER_PUNCH)
{
gProtectStructs[gBattlerAttacker].touchedProtectLike = 0;
gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE;
i = gBattlerAttacker;
gBattlerAttacker = gBattlerTarget;
gBattlerTarget = i; // gBattlerTarget and gBattlerAttacker are swapped in order to activate Defiant, if applicable
@ -4973,8 +4978,13 @@ static void Cmd_moveend(void)
gBattlescriptCurrInstr = BattleScript_KingsShieldEffect;
effect = 1;
}
else if (gProtectStructs[gBattlerTarget].beakBlastCharge)
// Not strictly a protect effect, but works the same way
else if (gProtectStructs[gBattlerTarget].beakBlastCharge
&& CanBeBurned(gBattlerAttacker)
&& !(gMoveResultFlags & MOVE_RESULT_NO_EFFECT))
{
gProtectStructs[gBattlerAttacker].touchedProtectLike = FALSE;
gBattleMons[gBattlerAttacker].status1 = STATUS1_BURN;
BattleScriptPushCursor();
gBattlescriptCurrInstr = BattleScript_BeakBlastBurn;
effect = 1;
@ -9317,7 +9327,7 @@ static void Cmd_various(void)
}
}
case VARIOUS_SET_BEAK_BLAST:
gProtectStructs[gActiveBattler].beakBlastCharge = 1;
gProtectStructs[gBattlerAttacker].beakBlastCharge = 1;
break;
case VARIOUS_SWAP_SIDE_STATUSES:
{