Merge pull request #2579 from LOuroboros/allahu

Fixed Explosion & Intimidate's 'interaction'
This commit is contained in:
Eduardo Quezada D'Ottone 2023-01-23 11:37:06 -03:00 committed by GitHub
commit 2b22bdf1e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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

@ -10216,6 +10216,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;