mirror of
https://github.com/Ninjdai1/pokeemerald.git
synced 2025-01-30 07:24:16 +01:00
Prepare damage calc huge changes
This commit is contained in:
parent
939127bfff
commit
baf172d605
@ -860,7 +860,7 @@
|
|||||||
.byte 0xab
|
.byte 0xab
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro remaininghptopower
|
.macro nop_AC
|
||||||
.byte 0xac
|
.byte 0xac
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
@ -1085,7 +1085,7 @@
|
|||||||
.4byte \param0
|
.4byte \param0
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
.macro weightdamagecalculation
|
.macro nop_DD
|
||||||
.byte 0xdd
|
.byte 0xdd
|
||||||
.endm
|
.endm
|
||||||
|
|
||||||
|
@ -254,6 +254,9 @@ BattleScript_EffectUnusedA3::
|
|||||||
BattleScript_EffectPlaceholder200::
|
BattleScript_EffectPlaceholder200::
|
||||||
BattleScript_EffectPlaceholder209:
|
BattleScript_EffectPlaceholder209:
|
||||||
BattleScript_EffectHit::
|
BattleScript_EffectHit::
|
||||||
|
BattleScript_EffectLowKick:
|
||||||
|
BattleScript_EffectFlail:
|
||||||
|
BattleScript_EffectFacade:
|
||||||
jumpifnotmove MOVE_SURF, BattleScript_HitFromAtkCanceler
|
jumpifnotmove MOVE_SURF, BattleScript_HitFromAtkCanceler
|
||||||
jumpifnostatus3 BS_TARGET, STATUS3_UNDERWATER, BattleScript_HitFromAtkCanceler
|
jumpifnostatus3 BS_TARGET, STATUS3_UNDERWATER, BattleScript_HitFromAtkCanceler
|
||||||
orword gHitMarker, HITMARKER_IGNORE_UNDERWATER
|
orword gHitMarker, HITMARKER_IGNORE_UNDERWATER
|
||||||
@ -1368,10 +1371,6 @@ BattleScript_EffectDestinyBond::
|
|||||||
waitmessage 0x40
|
waitmessage 0x40
|
||||||
goto BattleScript_MoveEnd
|
goto BattleScript_MoveEnd
|
||||||
|
|
||||||
BattleScript_EffectFlail::
|
|
||||||
remaininghptopower
|
|
||||||
goto BattleScript_EffectHit
|
|
||||||
|
|
||||||
BattleScript_EffectSpite::
|
BattleScript_EffectSpite::
|
||||||
attackcanceler
|
attackcanceler
|
||||||
attackstring
|
attackstring
|
||||||
@ -2277,14 +2276,6 @@ BattleScript_82DA15A::
|
|||||||
tryfaintmon BS_ATTACKER, FALSE, NULL
|
tryfaintmon BS_ATTACKER, FALSE, NULL
|
||||||
goto BattleScript_MoveEnd
|
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::
|
BattleScript_EffectFocusPunch::
|
||||||
attackcanceler
|
attackcanceler
|
||||||
jumpifnodamage BattleScript_HitFromAccCheck
|
jumpifnodamage BattleScript_HitFromAccCheck
|
||||||
@ -2581,14 +2572,6 @@ BattleScript_EffectSnatch::
|
|||||||
waitmessage 0x40
|
waitmessage 0x40
|
||||||
goto BattleScript_MoveEnd
|
goto BattleScript_MoveEnd
|
||||||
|
|
||||||
BattleScript_EffectLowKick::
|
|
||||||
attackcanceler
|
|
||||||
attackstring
|
|
||||||
ppreduce
|
|
||||||
weightdamagecalculation
|
|
||||||
accuracycheck BattleScript_MoveMissedPause, ACC_CURR_MOVE
|
|
||||||
goto BattleScript_HitFromCritCalc
|
|
||||||
|
|
||||||
BattleScript_EffectSecretPower::
|
BattleScript_EffectSecretPower::
|
||||||
getsecretpowereffect
|
getsecretpowereffect
|
||||||
goto BattleScript_EffectHit
|
goto BattleScript_EffectHit
|
||||||
|
@ -262,7 +262,7 @@ static void atkA8_copymovepermanently(void);
|
|||||||
static void atkA9_trychoosesleeptalkmove(void);
|
static void atkA9_trychoosesleeptalkmove(void);
|
||||||
static void atkAA_setdestinybond(void);
|
static void atkAA_setdestinybond(void);
|
||||||
static void atkAB_trysetdestinybondtohappen(void);
|
static void atkAB_trysetdestinybondtohappen(void);
|
||||||
static void atkAC_remaininghptopower(void);
|
static void atkAC_nop(void);
|
||||||
static void atkAD_tryspiteppreduce(void);
|
static void atkAD_tryspiteppreduce(void);
|
||||||
static void atkAE_healpartystatus(void);
|
static void atkAE_healpartystatus(void);
|
||||||
static void atkAF_cursetarget(void);
|
static void atkAF_cursetarget(void);
|
||||||
@ -311,7 +311,7 @@ static void atkD9_scaledamagebyhealthratio(void);
|
|||||||
static void atkDA_tryswapabilities(void);
|
static void atkDA_tryswapabilities(void);
|
||||||
static void atkDB_tryimprision(void);
|
static void atkDB_tryimprision(void);
|
||||||
static void atkDC_trysetgrudge(void);
|
static void atkDC_trysetgrudge(void);
|
||||||
static void atkDD_weightdamagecalculation(void);
|
static void atkDD_nop(void);
|
||||||
static void atkDE_asistattackselect(void);
|
static void atkDE_asistattackselect(void);
|
||||||
static void atkDF_trysetmagiccoat(void);
|
static void atkDF_trysetmagiccoat(void);
|
||||||
static void atkE0_trysetsnatch(void);
|
static void atkE0_trysetsnatch(void);
|
||||||
@ -514,7 +514,7 @@ void (* const gBattleScriptingCommandsTable[])(void) =
|
|||||||
atkA9_trychoosesleeptalkmove,
|
atkA9_trychoosesleeptalkmove,
|
||||||
atkAA_setdestinybond,
|
atkAA_setdestinybond,
|
||||||
atkAB_trysetdestinybondtohappen,
|
atkAB_trysetdestinybondtohappen,
|
||||||
atkAC_remaininghptopower,
|
atkAC_nop,
|
||||||
atkAD_tryspiteppreduce,
|
atkAD_tryspiteppreduce,
|
||||||
atkAE_healpartystatus,
|
atkAE_healpartystatus,
|
||||||
atkAF_cursetarget,
|
atkAF_cursetarget,
|
||||||
@ -563,7 +563,7 @@ void (* const gBattleScriptingCommandsTable[])(void) =
|
|||||||
atkDA_tryswapabilities,
|
atkDA_tryswapabilities,
|
||||||
atkDB_tryimprision,
|
atkDB_tryimprision,
|
||||||
atkDC_trysetgrudge,
|
atkDC_trysetgrudge,
|
||||||
atkDD_weightdamagecalculation,
|
atkDD_nop,
|
||||||
atkDE_asistattackselect,
|
atkDE_asistattackselect,
|
||||||
atkDF_trysetmagiccoat,
|
atkDF_trysetmagiccoat,
|
||||||
atkE0_trysetsnatch,
|
atkE0_trysetsnatch,
|
||||||
@ -798,16 +798,6 @@ static const u16 sMovesForbiddenToCopy[] =
|
|||||||
METRONOME_FORBIDDEN_END
|
METRONOME_FORBIDDEN_END
|
||||||
};
|
};
|
||||||
|
|
||||||
static const u8 sFlailHpScaleToPowerTable[] =
|
|
||||||
{
|
|
||||||
1, 200,
|
|
||||||
4, 150,
|
|
||||||
9, 100,
|
|
||||||
16, 80,
|
|
||||||
32, 40,
|
|
||||||
48, 20
|
|
||||||
};
|
|
||||||
|
|
||||||
static const u16 sNaturePowerMoves[] =
|
static const u16 sNaturePowerMoves[] =
|
||||||
{
|
{
|
||||||
MOVE_STUN_SPORE,
|
MOVE_STUN_SPORE,
|
||||||
@ -822,17 +812,6 @@ static const u16 sNaturePowerMoves[] =
|
|||||||
MOVE_SWIFT
|
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[] =
|
static const u16 sPickupItems[] =
|
||||||
{
|
{
|
||||||
ITEM_POTION,
|
ITEM_POTION,
|
||||||
@ -8514,18 +8493,8 @@ static void atkAB_trysetdestinybondtohappen(void)
|
|||||||
gBattlescriptCurrInstr++;
|
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++;
|
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++;
|
gBattlescriptCurrInstr++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user