mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-12-26 19:54:21 +01:00
Merge pull request #1701 from GriffinRichards/faint-cmd-name
Rename faintifabilitynotdamp and jumpifattackandspecialattackcannotfall
This commit is contained in:
commit
165f51a295
@ -668,7 +668,7 @@
|
||||
.byte 0x77
|
||||
.endm
|
||||
|
||||
.macro faintifabilitynotdamp
|
||||
.macro tryexplosion
|
||||
.byte 0x78
|
||||
.endm
|
||||
|
||||
@ -1031,7 +1031,7 @@
|
||||
.byte 0xc8
|
||||
.endm
|
||||
|
||||
.macro jumpifattackandspecialattackcannotfall ptr:req
|
||||
.macro trymemento ptr:req
|
||||
.byte 0xc9
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
@ -374,7 +374,8 @@ BattleScript_EffectExplosion::
|
||||
attackcanceler
|
||||
attackstring
|
||||
ppreduce
|
||||
faintifabilitynotdamp
|
||||
@ Below jumps to BattleScript_DampStopsExplosion if it fails (only way it can)
|
||||
tryexplosion
|
||||
setatkhptozero
|
||||
waitstate
|
||||
jumpifbyte CMP_NO_COMMON_BITS, gMoveResultFlags, MOVE_RESULT_MISSED, BattleScript_ExplosionDoAnimStartLoop
|
||||
@ -2201,10 +2202,10 @@ BattleScript_AlreadyBurned::
|
||||
|
||||
BattleScript_EffectMemento::
|
||||
attackcanceler
|
||||
jumpifbyte CMP_EQUAL, cMISS_TYPE, B_MSG_PROTECTED, BattleScript_MementoFailProtect
|
||||
jumpifbyte CMP_EQUAL, cMISS_TYPE, B_MSG_PROTECTED, BattleScript_MementoTargetProtect
|
||||
attackstring
|
||||
ppreduce
|
||||
jumpifattackandspecialattackcannotfall BattleScript_ButItFailed
|
||||
trymemento BattleScript_ButItFailed
|
||||
setatkhptozero
|
||||
attackanimation
|
||||
waitanimation
|
||||
@ -2214,7 +2215,7 @@ BattleScript_EffectMemento::
|
||||
playstatchangeanimation BS_TARGET, BIT_ATK, STAT_CHANGE_NEGATIVE | STAT_CHANGE_BY_TWO
|
||||
setstatchanger STAT_ATK, 2, TRUE
|
||||
statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_EffectMementoTrySpAtk
|
||||
@ Greater than STAT_FELL is checking if the stat cannot decrease
|
||||
@ Greater than B_MSG_DEFENDER_STAT_FELL is checking if the stat cannot decrease
|
||||
jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, B_MSG_DEFENDER_STAT_FELL, BattleScript_EffectMementoTrySpAtk
|
||||
printfromtable gStatDownStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
@ -2222,7 +2223,7 @@ BattleScript_EffectMementoTrySpAtk:
|
||||
playstatchangeanimation BS_TARGET, BIT_SPATK, STAT_CHANGE_NEGATIVE | STAT_CHANGE_BY_TWO
|
||||
setstatchanger STAT_SPATK, 2, TRUE
|
||||
statbuffchange STAT_BUFF_ALLOW_PTR, BattleScript_EffectMementoTryFaint
|
||||
@ Greater than STAT_FELL is checking if the stat cannot decrease
|
||||
@ Greater than B_MSG_DEFENDER_STAT_FELL is checking if the stat cannot decrease
|
||||
jumpifbyte CMP_GREATER_THAN, cMULTISTRING_CHOOSER, B_MSG_DEFENDER_STAT_FELL, BattleScript_EffectMementoTryFaint
|
||||
printfromtable gStatDownStringIds
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
@ -2233,11 +2234,12 @@ BattleScript_EffectMementoPrintNoEffect:
|
||||
printstring STRINGID_BUTNOEFFECT
|
||||
waitmessage B_WAIT_TIME_LONG
|
||||
goto BattleScript_EffectMementoTryFaint
|
||||
BattleScript_MementoFailProtect:
|
||||
@ If the target is protected there's no need to check the target's stats or animate, the user will just faint
|
||||
BattleScript_MementoTargetProtect:
|
||||
attackstring
|
||||
ppreduce
|
||||
jumpifattackandspecialattackcannotfall BattleScript_MementoFailEnd
|
||||
BattleScript_MementoFailEnd:
|
||||
trymemento BattleScript_MementoTargetProtectEnd
|
||||
BattleScript_MementoTargetProtectEnd:
|
||||
setatkhptozero
|
||||
pause B_WAIT_TIME_LONG
|
||||
effectivenesssound
|
||||
|
@ -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
|
||||
@ -6497,11 +6497,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)
|
||||
@ -6510,12 +6511,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++;
|
||||
|
||||
// Find first target
|
||||
for (gBattlerTarget = 0; gBattlerTarget < gBattlersCount; gBattlerTarget++)
|
||||
{
|
||||
if (gBattlerTarget == gBattlerAttacker)
|
||||
@ -6526,6 +6529,7 @@ static void Cmd_faintifabilitynotdamp(void)
|
||||
}
|
||||
else
|
||||
{
|
||||
// Failed, a battler has Damp
|
||||
gLastUsedAbility = ABILITY_DAMP;
|
||||
RecordAbilityBattle(gBattlerTarget, gBattleMons[gBattlerTarget].ability);
|
||||
gBattlescriptCurrInstr = BattleScript_DampStopsExplosion;
|
||||
@ -8961,16 +8965,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);
|
||||
|
Loading…
Reference in New Issue
Block a user