Adds callnative for soundproofcheck to addtionally check the flag (#5301)
* Adds callnative for soundproofcheck to addtionally check the flag * rename callnative, include parish song and missing ability recording
This commit is contained in:
parent
d62b7270c8
commit
5089b1d0b4
3 changed files with 25 additions and 2 deletions
|
@ -1679,6 +1679,12 @@
|
||||||
.4byte \failInstr
|
.4byte \failInstr
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
|
.macro jumpifblockedbysoundproof battler:req, failInstr:req
|
||||||
|
callnative BS_JumpIfBlockedBySoundproof
|
||||||
|
.byte \battler
|
||||||
|
.4byte \failInstr
|
||||||
|
.endm
|
||||||
|
|
||||||
@ various command changed to more readable macros
|
@ various command changed to more readable macros
|
||||||
.macro cancelmultiturnmoves battler:req
|
.macro cancelmultiturnmoves battler:req
|
||||||
various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES
|
various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES
|
||||||
|
|
|
@ -508,7 +508,7 @@ BattleScript_EffectAttackUpUserAlly_TryAlly:
|
||||||
BattleScript_EffectAttackUpUserAlly_End:
|
BattleScript_EffectAttackUpUserAlly_End:
|
||||||
goto BattleScript_MoveEnd
|
goto BattleScript_MoveEnd
|
||||||
BattleScript_EffectAttackUpUserAlly_TryAlly_:
|
BattleScript_EffectAttackUpUserAlly_TryAlly_:
|
||||||
jumpifability BS_ATTACKER_PARTNER, ABILITY_SOUNDPROOF, BattleScript_EffectAttackUpUserAlly_TryAllyBlocked
|
jumpifblockedbysoundproof BS_ATTACKER_PARTNER, BattleScript_EffectAttackUpUserAlly_TryAllyBlocked
|
||||||
setstatchanger STAT_ATK, 1, FALSE
|
setstatchanger STAT_ATK, 1, FALSE
|
||||||
statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_EffectAttackUpUserAlly_End
|
statbuffchange STAT_CHANGE_ALLOW_PTR, BattleScript_EffectAttackUpUserAlly_End
|
||||||
jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_EffectAttackUpUserAlly_AllyAnim
|
jumpifbyte CMP_NOT_EQUAL, cMULTISTRING_CHOOSER, B_MSG_STAT_WONT_INCREASE, BattleScript_EffectAttackUpUserAlly_AllyAnim
|
||||||
|
@ -4281,7 +4281,7 @@ BattleScript_EffectPerishSong::
|
||||||
waitmessage B_WAIT_TIME_LONG
|
waitmessage B_WAIT_TIME_LONG
|
||||||
setbyte gBattlerTarget, 0
|
setbyte gBattlerTarget, 0
|
||||||
BattleScript_PerishSongLoop::
|
BattleScript_PerishSongLoop::
|
||||||
jumpifability BS_TARGET, ABILITY_SOUNDPROOF, BattleScript_PerishSongBlocked
|
jumpifblockedbysoundproof BS_TARGET, BattleScript_PerishSongBlocked
|
||||||
jumpifpranksterblocked BS_TARGET, BattleScript_PerishSongNotAffected
|
jumpifpranksterblocked BS_TARGET, BattleScript_PerishSongNotAffected
|
||||||
BattleScript_PerishSongLoopIncrement::
|
BattleScript_PerishSongLoopIncrement::
|
||||||
addbyte gBattlerTarget, 1
|
addbyte gBattlerTarget, 1
|
||||||
|
|
|
@ -17218,3 +17218,20 @@ void BS_TryTarShot(void)
|
||||||
gBattlescriptCurrInstr = cmd->nextInstr;
|
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void BS_JumpIfBlockedBySoundproof(void)
|
||||||
|
{
|
||||||
|
NATIVE_ARGS(u8 battler, const u8 *jumpInstr);
|
||||||
|
u32 battler = GetBattlerForBattleScript(cmd->battler);
|
||||||
|
if (gMovesInfo[gCurrentMove].soundMove && GetBattlerAbility(battler) == ABILITY_SOUNDPROOF)
|
||||||
|
{
|
||||||
|
gLastUsedAbility = ABILITY_SOUNDPROOF;
|
||||||
|
gBattlescriptCurrInstr = cmd->jumpInstr;
|
||||||
|
RecordAbilityBattle(battler, gLastUsedAbility);
|
||||||
|
gBattlerAbility = battler;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
gBattlescriptCurrInstr = cmd->nextInstr;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
Loading…
Reference in a new issue