mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2024-11-16 19:47:35 +01:00
add callnative bs func, convert metal burst dmg calc
This commit is contained in:
parent
1037613b0e
commit
b869b836cc
@ -1300,12 +1300,17 @@
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro metalburstdamagecalculator ptr:req
|
||||
.macro callnative func:req
|
||||
.byte 0xff
|
||||
.4byte \ptr
|
||||
.4byte \func
|
||||
.endm
|
||||
|
||||
@ various command changed to more readable macros
|
||||
.macro metalburstdamagecalculator ptr:req
|
||||
callnative BS_CalcMetalBurstDmg
|
||||
.4byte \ptr
|
||||
.endm
|
||||
|
||||
.macro cancelmultiturnmoves battler:req
|
||||
various \battler, VARIOUS_CANCEL_MULTI_TURN_MOVES
|
||||
.endm
|
||||
|
@ -574,7 +574,7 @@ static void Cmd_averagestats(void);
|
||||
static void Cmd_jumpifoppositegenders(void);
|
||||
static void Cmd_unused(void);
|
||||
static void Cmd_tryworryseed(void);
|
||||
static void Cmd_metalburstdamagecalculator(void);
|
||||
static void Cmd_callnative(void);
|
||||
|
||||
void (* const gBattleScriptingCommandsTable[])(void) =
|
||||
{
|
||||
@ -833,7 +833,7 @@ void (* const gBattleScriptingCommandsTable[])(void) =
|
||||
Cmd_jumpifoppositegenders, //0xFC
|
||||
Cmd_unused, //0xFD
|
||||
Cmd_tryworryseed, //0xFE
|
||||
Cmd_metalburstdamagecalculator, //0xFF
|
||||
Cmd_callnative, //0xFF
|
||||
};
|
||||
|
||||
const struct StatFractions gAccuracyStageRatios[] =
|
||||
@ -14743,7 +14743,14 @@ static void Cmd_tryworryseed(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void Cmd_metalburstdamagecalculator(void)
|
||||
static void Cmd_callnative(void)
|
||||
{
|
||||
void (*func)() = (void *)T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
func();
|
||||
}
|
||||
|
||||
// Callnative Funcs
|
||||
void BS_CalcMetalBurstDmg(void)
|
||||
{
|
||||
u8 sideAttacker = GetBattlerSide(gBattlerAttacker);
|
||||
u8 sideTarget = 0;
|
||||
@ -14759,7 +14766,7 @@ static void Cmd_metalburstdamagecalculator(void)
|
||||
else
|
||||
gBattlerTarget = gProtectStructs[gBattlerAttacker].physicalBattlerId;
|
||||
|
||||
gBattlescriptCurrInstr += 5;
|
||||
gBattlescriptCurrInstr += 9;
|
||||
}
|
||||
else if (gProtectStructs[gBattlerAttacker].specialDmg
|
||||
&& sideAttacker != (sideTarget = GetBattlerSide(gProtectStructs[gBattlerAttacker].specialBattlerId))
|
||||
@ -14772,12 +14779,12 @@ static void Cmd_metalburstdamagecalculator(void)
|
||||
else
|
||||
gBattlerTarget = gProtectStructs[gBattlerAttacker].specialBattlerId;
|
||||
|
||||
gBattlescriptCurrInstr += 5;
|
||||
gBattlescriptCurrInstr += 9;
|
||||
}
|
||||
else
|
||||
{
|
||||
gSpecialStatuses[gBattlerAttacker].ppNotAffectedByPressure = TRUE;
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 1);
|
||||
gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 5);
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user