From 4f57e96f31bd733ae3d2fea6a6040cbc6d8e7692 Mon Sep 17 00:00:00 2001 From: Rangi42 Date: Wed, 12 Jun 2024 13:11:33 -0400 Subject: [PATCH] Consolidate the duplicate stat level data files --- data/battle/stat_multipliers.asm | 6 +++--- data/battle/stat_multipliers_2.asm | 20 -------------------- engine/battle/core.asm | 3 ++- engine/battle/effect_commands.asm | 1 + 4 files changed, 6 insertions(+), 24 deletions(-) delete mode 100644 data/battle/stat_multipliers_2.asm diff --git a/data/battle/stat_multipliers.asm b/data/battle/stat_multipliers.asm index bbb1cadd6..add8732d1 100644 --- a/data/battle/stat_multipliers.asm +++ b/data/battle/stat_multipliers.asm @@ -1,10 +1,10 @@ ; Multiplier ratios for all stats from modifier -6 to +6 ; (except accuracy, see data/battle/accuracy_multipliers.asm). -; This table is identical to data/battle/stat_multipliers_2.asm. -; This one is used by CalcBattleStats. +; This table is INCLUDEd twice in different ROM banks: +; once for CalcBattleStats (see engine/battle/effect_commands.asm), +; and once for ApplyStatLevelMultiplier (see engine/battle/core.asm). -StatLevelMultipliers: db 25, 100 ; -6 = 25% db 28, 100 ; -5 = 28% db 33, 100 ; -4 = 33% diff --git a/data/battle/stat_multipliers_2.asm b/data/battle/stat_multipliers_2.asm deleted file mode 100644 index 3f3dc2348..000000000 --- a/data/battle/stat_multipliers_2.asm +++ /dev/null @@ -1,20 +0,0 @@ -; Multiplier ratios for all stats from modifier -6 to +6 -; (except accuracy, see data/battle/accuracy_multipliers.asm). - -; This table is identical to data/battle/stat_multipliers.asm. -; This one is used by ApplyStatLevelMultiplier. - -StatLevelMultipliers_Applied: - db 25, 100 ; -6 = 25% - db 28, 100 ; -5 = 28% - db 33, 100 ; -4 = 33% - db 40, 100 ; -3 = 40% - db 50, 100 ; -2 = 50% - db 66, 100 ; -1 = 66% - db 1, 1 ; 0 = 100% - db 15, 10 ; +1 = 150% - db 2, 1 ; +2 = 200% - db 25, 10 ; +3 = 250% - db 3, 1 ; +4 = 300% - db 35, 10 ; +5 = 350% - db 4, 1 ; +6 = 400% diff --git a/engine/battle/core.asm b/engine/battle/core.asm index 55fde7d3a..d4d87c17a 100644 --- a/engine/battle/core.asm +++ b/engine/battle/core.asm @@ -6756,7 +6756,8 @@ ApplyStatLevelMultiplier: pop bc ret -INCLUDE "data/battle/stat_multipliers_2.asm" +StatLevelMultipliers_Applied: +INCLUDE "data/battle/stat_multipliers.asm" BadgeStatBoosts: ; Raise the stats of the battle mon in wBattleMon diff --git a/engine/battle/effect_commands.asm b/engine/battle/effect_commands.asm index 82398f7c0..65eec4fb8 100644 --- a/engine/battle/effect_commands.asm +++ b/engine/battle/effect_commands.asm @@ -4622,6 +4622,7 @@ GetStatName: INCLUDE "data/battle/stat_names.asm" +StatLevelMultipliers: INCLUDE "data/battle/stat_multipliers.asm" BattleCommand_AllStatsUp: