Fixed Explosion & Intimidate's 'interaction'

This commit is contained in:
LOuroboros 2023-01-17 22:16:42 -03:00
parent c72274ee98
commit 773e7f0de2
4 changed files with 22 additions and 0 deletions

View File

@ -2037,6 +2037,11 @@
various \battler, VARIOUS_ACTIVATE_TERRAIN_CHANGE_ABILITIES
.endm
.macro jumpifnovalidtargets ptr:req
various BS_ATTACKER, VARIOUS_JUMP_IF_NO_VALID_TARGETS
.4byte \ptr
.endm
@ helpful macros
.macro setstatchanger stat:req, stages:req, down:req
setbyte sSTATCHANGER, \stat | \stages << 3 | \down << 7

View File

@ -8479,6 +8479,7 @@ BattleScript_TryAdrenalineOrbRet:
return
BattleScript_IntimidateActivates::
jumpifnovalidtargets BattleScript_IntimidateEnd
showabilitypopup BS_ATTACKER
pause B_WAIT_TIME_LONG
destroyabilitypopup

View File

@ -254,6 +254,7 @@
#define VARIOUS_TRY_WIND_RIDER_POWER 163
#define VARIOUS_ACTIVATE_WEATHER_CHANGE_ABILITIES 164
#define VARIOUS_ACTIVATE_TERRAIN_CHANGE_ABILITIES 165
#define VARIOUS_JUMP_IF_NO_VALID_TARGETS 166
// Cmd_manipulatedamage
#define DMG_CHANGE_SIGN 0

View File

@ -10214,6 +10214,21 @@ static void Cmd_various(void)
gBattlescriptCurrInstr += 3;
AbilityBattleEffects(ABILITYEFFECT_ON_TERRAIN, gActiveBattler, 0, 0, 0);
return;
case VARIOUS_JUMP_IF_NO_VALID_TARGETS:
{
u32 count = 0;
for (i = 0; i < gBattlersCount; i++)
{
if (GetBattlerSide(i) != GetBattlerSide(gBattlerAttacker) && IsBattlerAlive(i))
count++;
}
if (count == 0)
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 3);
else
gBattlescriptCurrInstr += 7;
}
return;
} // End of switch (gBattlescriptCurrInstr[2])
gBattlescriptCurrInstr += 3;