mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-27 13:53:52 +01:00
Prepare damage calc huge changes
This commit is contained in:
parent
939127bfff
commit
baf172d605
@ -860,7 +860,7 @@
|
||||
.byte 0xab
|
||||
.endm
|
||||
|
||||
.macro remaininghptopower
|
||||
.macro nop_AC
|
||||
.byte 0xac
|
||||
.endm
|
||||
|
||||
@ -1085,7 +1085,7 @@
|
||||
.4byte \param0
|
||||
.endm
|
||||
|
||||
.macro weightdamagecalculation
|
||||
.macro nop_DD
|
||||
.byte 0xdd
|
||||
.endm
|
||||
|
||||
|
@ -254,6 +254,9 @@ BattleScript_EffectUnusedA3::
|
||||
BattleScript_EffectPlaceholder200::
|
||||
BattleScript_EffectPlaceholder209:
|
||||
BattleScript_EffectHit::
|
||||
BattleScript_EffectLowKick:
|
||||
BattleScript_EffectFlail:
|
||||
BattleScript_EffectFacade:
|
||||
jumpifnotmove MOVE_SURF, BattleScript_HitFromAtkCanceler
|
||||
jumpifnostatus3 BS_TARGET, STATUS3_UNDERWATER, BattleScript_HitFromAtkCanceler
|
||||
orword gHitMarker, HITMARKER_IGNORE_UNDERWATER
|
||||
@ -1368,10 +1371,6 @@ BattleScript_EffectDestinyBond::
|
||||
waitmessage 0x40
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_EffectFlail::
|
||||
remaininghptopower
|
||||
goto BattleScript_EffectHit
|
||||
|
||||
BattleScript_EffectSpite::
|
||||
attackcanceler
|
||||
attackstring
|
||||
@ -2277,14 +2276,6 @@ BattleScript_82DA15A::
|
||||
tryfaintmon BS_ATTACKER, FALSE, NULL
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_EffectFacade::
|
||||
jumpifstatus BS_ATTACKER, STATUS1_POISON | STATUS1_BURN | STATUS1_PARALYSIS | STATUS1_TOXIC_POISON, BattleScript_FacadeDoubleDmg
|
||||
goto BattleScript_EffectHit
|
||||
|
||||
BattleScript_FacadeDoubleDmg::
|
||||
setbyte sDMG_MULTIPLIER, 0x2
|
||||
goto BattleScript_EffectHit
|
||||
|
||||
BattleScript_EffectFocusPunch::
|
||||
attackcanceler
|
||||
jumpifnodamage BattleScript_HitFromAccCheck
|
||||
@ -2581,14 +2572,6 @@ BattleScript_EffectSnatch::
|
||||
waitmessage 0x40
|
||||
goto BattleScript_MoveEnd
|
||||
|
||||
BattleScript_EffectLowKick::
|
||||
attackcanceler
|
||||
attackstring
|
||||
ppreduce
|
||||
weightdamagecalculation
|
||||
accuracycheck BattleScript_MoveMissedPause, ACC_CURR_MOVE
|
||||
goto BattleScript_HitFromCritCalc
|
||||
|
||||
BattleScript_EffectSecretPower::
|
||||
getsecretpowereffect
|
||||
goto BattleScript_EffectHit
|
||||
|
@ -262,7 +262,7 @@ static void atkA8_copymovepermanently(void);
|
||||
static void atkA9_trychoosesleeptalkmove(void);
|
||||
static void atkAA_setdestinybond(void);
|
||||
static void atkAB_trysetdestinybondtohappen(void);
|
||||
static void atkAC_remaininghptopower(void);
|
||||
static void atkAC_nop(void);
|
||||
static void atkAD_tryspiteppreduce(void);
|
||||
static void atkAE_healpartystatus(void);
|
||||
static void atkAF_cursetarget(void);
|
||||
@ -311,7 +311,7 @@ static void atkD9_scaledamagebyhealthratio(void);
|
||||
static void atkDA_tryswapabilities(void);
|
||||
static void atkDB_tryimprision(void);
|
||||
static void atkDC_trysetgrudge(void);
|
||||
static void atkDD_weightdamagecalculation(void);
|
||||
static void atkDD_nop(void);
|
||||
static void atkDE_asistattackselect(void);
|
||||
static void atkDF_trysetmagiccoat(void);
|
||||
static void atkE0_trysetsnatch(void);
|
||||
@ -514,7 +514,7 @@ void (* const gBattleScriptingCommandsTable[])(void) =
|
||||
atkA9_trychoosesleeptalkmove,
|
||||
atkAA_setdestinybond,
|
||||
atkAB_trysetdestinybondtohappen,
|
||||
atkAC_remaininghptopower,
|
||||
atkAC_nop,
|
||||
atkAD_tryspiteppreduce,
|
||||
atkAE_healpartystatus,
|
||||
atkAF_cursetarget,
|
||||
@ -563,7 +563,7 @@ void (* const gBattleScriptingCommandsTable[])(void) =
|
||||
atkDA_tryswapabilities,
|
||||
atkDB_tryimprision,
|
||||
atkDC_trysetgrudge,
|
||||
atkDD_weightdamagecalculation,
|
||||
atkDD_nop,
|
||||
atkDE_asistattackselect,
|
||||
atkDF_trysetmagiccoat,
|
||||
atkE0_trysetsnatch,
|
||||
@ -798,16 +798,6 @@ static const u16 sMovesForbiddenToCopy[] =
|
||||
METRONOME_FORBIDDEN_END
|
||||
};
|
||||
|
||||
static const u8 sFlailHpScaleToPowerTable[] =
|
||||
{
|
||||
1, 200,
|
||||
4, 150,
|
||||
9, 100,
|
||||
16, 80,
|
||||
32, 40,
|
||||
48, 20
|
||||
};
|
||||
|
||||
static const u16 sNaturePowerMoves[] =
|
||||
{
|
||||
MOVE_STUN_SPORE,
|
||||
@ -822,17 +812,6 @@ static const u16 sNaturePowerMoves[] =
|
||||
MOVE_SWIFT
|
||||
};
|
||||
|
||||
// format: min. weight (hectograms), base power
|
||||
static const u16 sWeightToDamageTable[] =
|
||||
{
|
||||
100, 20,
|
||||
250, 40,
|
||||
500, 60,
|
||||
1000, 80,
|
||||
2000, 100,
|
||||
0xFFFF, 0xFFFF
|
||||
};
|
||||
|
||||
static const u16 sPickupItems[] =
|
||||
{
|
||||
ITEM_POTION,
|
||||
@ -8514,18 +8493,8 @@ static void atkAB_trysetdestinybondtohappen(void)
|
||||
gBattlescriptCurrInstr++;
|
||||
}
|
||||
|
||||
static void atkAC_remaininghptopower(void)
|
||||
static void atkAC_nop(void)
|
||||
{
|
||||
s32 i;
|
||||
s32 hpFraction = GetScaledHPFraction(gBattleMons[gBattlerAttacker].hp, gBattleMons[gBattlerAttacker].maxHP, 48);
|
||||
|
||||
for (i = 0; i < (s32) sizeof(sFlailHpScaleToPowerTable); i += 2)
|
||||
{
|
||||
if (hpFraction <= sFlailHpScaleToPowerTable[i])
|
||||
break;
|
||||
}
|
||||
|
||||
gDynamicBasePower = sFlailHpScaleToPowerTable[i + 1];
|
||||
gBattlescriptCurrInstr++;
|
||||
}
|
||||
|
||||
@ -9650,20 +9619,8 @@ static void atkDC_trysetgrudge(void)
|
||||
}
|
||||
}
|
||||
|
||||
static void atkDD_weightdamagecalculation(void)
|
||||
static void atkDD_nop(void)
|
||||
{
|
||||
s32 i;
|
||||
for (i = 0; sWeightToDamageTable[i] != 0xFFFF; i += 2)
|
||||
{
|
||||
if (sWeightToDamageTable[i] > GetPokedexHeightWeight(SpeciesToNationalPokedexNum(gBattleMons[gBattlerTarget].species), 1))
|
||||
break;
|
||||
}
|
||||
|
||||
if (sWeightToDamageTable[i] != 0xFFFF)
|
||||
gDynamicBasePower = sWeightToDamageTable[i + 1];
|
||||
else
|
||||
gDynamicBasePower = 120;
|
||||
|
||||
gBattlescriptCurrInstr++;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user