Rename faintifabilitynotdamp and jumpifattackandspecialattackcannotfall

This commit is contained in:
GriffinR
2022-07-06 14:38:27 -04:00
parent 06c9e0eb99
commit e6a374f2b6
3 changed files with 24 additions and 16 deletions

View File

@@ -196,7 +196,7 @@ static void Cmd_hpthresholds2(void);
static void Cmd_useitemonopponent(void);
static void Cmd_various(void);
static void Cmd_setprotectlike(void);
static void Cmd_faintifabilitynotdamp(void);
static void Cmd_tryexplosion(void);
static void Cmd_setatkhptozero(void);
static void Cmd_jumpifnexttargetvalid(void);
static void Cmd_tryhealhalfhealth(void);
@@ -277,7 +277,7 @@ static void Cmd_setsemiinvulnerablebit(void);
static void Cmd_clearsemiinvulnerablebit(void);
static void Cmd_setminimize(void);
static void Cmd_sethail(void);
static void Cmd_jumpifattackandspecialattackcannotfall(void);
static void Cmd_trymemento(void);
static void Cmd_setforcedtarget(void);
static void Cmd_setcharge(void);
static void Cmd_callterrainattack(void);
@@ -448,7 +448,7 @@ void (* const gBattleScriptingCommandsTable[])(void) =
Cmd_useitemonopponent, //0x75
Cmd_various, //0x76
Cmd_setprotectlike, //0x77
Cmd_faintifabilitynotdamp, //0x78
Cmd_tryexplosion, //0x78
Cmd_setatkhptozero, //0x79
Cmd_jumpifnexttargetvalid, //0x7A
Cmd_tryhealhalfhealth, //0x7B
@@ -529,7 +529,7 @@ void (* const gBattleScriptingCommandsTable[])(void) =
Cmd_clearsemiinvulnerablebit, //0xC6
Cmd_setminimize, //0xC7
Cmd_sethail, //0xC8
Cmd_jumpifattackandspecialattackcannotfall, //0xC9
Cmd_trymemento, //0xC9
Cmd_setforcedtarget, //0xCA
Cmd_setcharge, //0xCB
Cmd_callterrainattack, //0xCC
@@ -6489,11 +6489,12 @@ static void Cmd_setprotectlike(void) // protect and endure
gBattlescriptCurrInstr++;
}
static void Cmd_faintifabilitynotdamp(void)
static void Cmd_tryexplosion(void)
{
if (gBattleControllerExecFlags)
return;
// Explosion can only fail if any battler has Damp
for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++)
{
if (gBattleMons[gBattlerTarget].ability == ABILITY_DAMP)
@@ -6502,12 +6503,14 @@ static void Cmd_faintifabilitynotdamp(void)
if (gBattlerTarget == gBattlersCount)
{
// Success, no battlers with Damp. Drop user's HP bar to 0
gActiveBattler = gBattlerAttacker;
gBattleMoveDamage = gBattleMons[gActiveBattler].hp;
BtlController_EmitHealthBarUpdate(BUFFER_A, INSTANT_HP_BAR_DROP);
MarkBattlerForControllerExec(gActiveBattler);
gBattlescriptCurrInstr++;
// Mark Explosion user as absent
for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++)
{
if (gBattlerTarget == gBattlerAttacker)
@@ -6518,6 +6521,7 @@ static void Cmd_faintifabilitynotdamp(void)
}
else
{
// Failed, a battler has Damp
gLastUsedAbility = ABILITY_DAMP;
RecordAbilityBattle(gBattlerTarget, gBattleMons[gBattlerTarget].ability);
gBattlescriptCurrInstr = BattleScript_DampStopsExplosion;
@@ -8950,16 +8954,18 @@ static void Cmd_sethail(void)
gBattlescriptCurrInstr++;
}
static void Cmd_jumpifattackandspecialattackcannotfall(void) // memento
static void Cmd_trymemento(void)
{
if (gBattleMons[gBattlerTarget].statStages[STAT_ATK] == MIN_STAT_STAGE
&& gBattleMons[gBattlerTarget].statStages[STAT_SPATK] == MIN_STAT_STAGE
&& gBattleCommunication[MISS_TYPE] != B_MSG_PROTECTED)
{
// Failed, unprotected target already has minimum Attack and Special Attack.
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
}
else
{
// Success, drop user's HP bar to 0
gActiveBattler = gBattlerAttacker;
gBattleMoveDamage = gBattleMons[gActiveBattler].hp;
BtlController_EmitHealthBarUpdate(BUFFER_A, INSTANT_HP_BAR_DROP);