From b254442633c7e86d1b13c35bee4b1dfb0c913786 Mon Sep 17 00:00:00 2001 From: Xaver-DaRed Date: Tue, 3 Sep 2024 12:48:02 +0200 Subject: [PATCH 1/6] Add new modifier for flee --- scripts/effects/flee.lua | 3 +-- scripts/enum/mod.lua | 18 +++++++++++------- src/map/modifier.h | 19 ++++++++++--------- 3 files changed, 22 insertions(+), 18 deletions(-) diff --git a/scripts/effects/flee.lua b/scripts/effects/flee.lua index a07ff102cef..49b61ddf28c 100644 --- a/scripts/effects/flee.lua +++ b/scripts/effects/flee.lua @@ -5,14 +5,13 @@ local effectObject = {} effectObject.onEffectGain = function(target, effect) - target:addMod(xi.mod.MOVE_SPEED_STACKABLE, effect:getPower()) + effect:addMod(xi.mod.MOVE_SPEED_FLEE, effect:getPower()) end effectObject.onEffectTick = function(target, effect) end effectObject.onEffectLose = function(target, effect) - target:delMod(xi.mod.MOVE_SPEED_STACKABLE, effect:getPower()) end return effectObject diff --git a/scripts/enum/mod.lua b/scripts/enum/mod.lua index e3d26947dc3..126b1af2634 100644 --- a/scripts/enum/mod.lua +++ b/scripts/enum/mod.lua @@ -233,13 +233,17 @@ xi.mod = MAGIC_CRIT_DMG_INCREASE = 563, HASTE_MAGIC = 167, SPELLINTERRUPT = 168, - MOVE_SPEED_OVERIDE = 169, -- Modifier used to overide regular speed caps. (GM speed and Feast of Swords) - MOVE_SPEED_STACKABLE = 75, -- Gear movement speed penalties, flee bonus, etc. - MOVE_SPEED_GEAR_BONUS = 76, -- Gear movement speed bonuses. DOES NOT STACK with each other, only highest applies. - MOVE_SPEED_WEIGHT_PENALTY = 77, -- For Gravity and curse. - MOVE_SPEED_QUICKENING = 78, -- Jig, spreinter shoes, etc. Only highest of Mazurka OR quickening will take effect. - MOVE_SPEED_MAZURKA = 79, -- Song movement speed. Only highest of Mazurka OR quickening will take effect. - MOUNT_MOVE = 972, -- % Mount Movement Speed + + -- Movement speed modifiers + MOVE_SPEED_OVERIDE = 169, -- Modifier used to overide regular speed caps. (GM speed and Feast of Swords) + MOVE_SPEED_STACKABLE = 75, -- Gear movement speed penalties, etc. + MOVE_SPEED_GEAR_BONUS = 76, -- Gear movement speed bonuses. DOES NOT STACK with each other, only highest applies. + MOVE_SPEED_WEIGHT_PENALTY = 77, -- For Gravity and curse. + MOVE_SPEED_QUICKENING = 78, -- Jig, spreinter shoes, etc. Only highest of Mazurka OR quickening will take effect. + MOVE_SPEED_MAZURKA = 79, -- Song movement speed. Only highest of Mazurka OR quickening will take effect. + MOVE_SPEED_FLEE = 1085, -- Flee applies a separate multiplier to speed. + MOUNT_MOVE = 972, -- % Mount Movement Speed + FASTCAST = 170, UFASTCAST = 407, CURE_CAST_TIME = 519, diff --git a/src/map/modifier.h b/src/map/modifier.h index ec06b040d74..44ce3ab4d1a 100644 --- a/src/map/modifier.h +++ b/src/map/modifier.h @@ -273,14 +273,15 @@ enum class Mod SPELLINTERRUPT = 168, // % Spell Interruption Rate // New movement speed modifiers. - MOVE_SPEED_OVERIDE = 169, // Modifier used to overide regular speed caps. (GM speed and Feast of Swords) - MOVE_SPEED_STACKABLE = 75, // Gear movement speed penalties, flee bonus, etc. - MOVE_SPEED_GEAR_BONUS = 76, // Gear movement speed bonuses. DOES NOT STACK with each other, only highest applies. - MOVE_SPEED_WEIGHT_PENALTY = 77, // For Gravity and curse. - MOVE_SPEED_QUICKENING = 78, // Jig, spreinter shoes, etc. Only highest of Mazurka OR quickening will take effect. - MOVE_SPEED_MAZURKA = 79, // Song movement speed. Only highest of Mazurka OR quickening will take effect. - - MOUNT_MOVE = 972, // % Mount Movement Speed + MOVE_SPEED_OVERIDE = 169, // Modifier used to overide regular speed caps. (GM speed and Feast of Swords) + MOVE_SPEED_STACKABLE = 75, // Gear movement speed penalties, flee bonus, etc. + MOVE_SPEED_GEAR_BONUS = 76, // Gear movement speed bonuses. DOES NOT STACK with each other, only highest applies. + MOVE_SPEED_WEIGHT_PENALTY = 77, // For Gravity and curse. + MOVE_SPEED_QUICKENING = 78, // Jig, spreinter shoes, etc. Only highest of Mazurka OR quickening will take effect. + MOVE_SPEED_MAZURKA = 79, // Song movement speed. Only highest of Mazurka OR quickening will take effect. + MOVE_SPEED_FLEE = 1085, // Flee applies a separate multiplier to speed. + MOUNT_MOVE = 972, // % Mount Movement Speed + FASTCAST = 170, // Increases Spell Cast Time (TRAIT) UFASTCAST = 407, // uncapped fast cast CURE_CAST_TIME = 519, // cure cast time reduction @@ -1023,7 +1024,7 @@ enum class Mod // The spares take care of finding the next ID to use so long as we don't forget to list IDs that have been freed up by refactoring. // 570 through 825 used by WS DMG mods these are not spares. // - // SPARE IDs: 1085 and onward + // SPARE IDs: 1086 and onward }; // temporary workaround for using enum class as unordered_map key until compilers support it From 58b08c4fc9ddc43e5ff1ad21b4b628cbfe71ab09 Mon Sep 17 00:00:00 2001 From: Xaver-DaRed Date: Tue, 3 Sep 2024 13:34:05 +0200 Subject: [PATCH 2/6] Adjust additive speed modifiers from a % to a flat number to add/remove --- scripts/actions/abilities/chocobo_jig.lua | 2 +- scripts/actions/abilities/chocobo_jig_ii.lua | 2 +- scripts/effects/bolters_roll.lua | 3 +- scripts/effects/gestation.lua | 3 +- scripts/effects/mazurka.lua | 6 +- scripts/globals/spells/enhancing_song.lua | 4 +- scripts/items/choco-katana.lua | 6 +- scripts/items/choco-ligar.lua | 6 +- scripts/items/choco-scroll.lua | 6 +- scripts/items/chocolate_rarab_tail.lua | 6 +- scripts/items/fudgy-wudge.lua | 6 +- scripts/items/sprinters_shoes.lua | 3 +- scripts/items/talaria.lua | 5 +- scripts/items/temple_truffle.lua | 6 +- sql/item_latents.sql | 2 +- sql/item_mods.sql | 106 +++++++++---------- 16 files changed, 85 insertions(+), 87 deletions(-) diff --git a/scripts/actions/abilities/chocobo_jig.lua b/scripts/actions/abilities/chocobo_jig.lua index 0b4b6ff92fd..449d958b3e8 100644 --- a/scripts/actions/abilities/chocobo_jig.lua +++ b/scripts/actions/abilities/chocobo_jig.lua @@ -23,7 +23,7 @@ abilityObject.onUseAbility = function(player, target, ability) player:delStatusEffect(xi.effect.WEIGHT) end - player:addStatusEffect(xi.effect.QUICKENING, 20, 0, finalDuration) + player:addStatusEffect(xi.effect.QUICKENING, 10, 0, finalDuration) end return abilityObject diff --git a/scripts/actions/abilities/chocobo_jig_ii.lua b/scripts/actions/abilities/chocobo_jig_ii.lua index 7110a762f1b..15018d3c0c6 100644 --- a/scripts/actions/abilities/chocobo_jig_ii.lua +++ b/scripts/actions/abilities/chocobo_jig_ii.lua @@ -23,7 +23,7 @@ abilityObject.onUseAbility = function(player, target, ability) target:delStatusEffect(xi.effect.WEIGHT) end - target:addStatusEffect(xi.effect.QUICKENING, 20, 0, finalDuration) + target:addStatusEffect(xi.effect.QUICKENING, 10, 0, finalDuration) end return abilityObject diff --git a/scripts/effects/bolters_roll.lua b/scripts/effects/bolters_roll.lua index 61f72d54b41..be85d233504 100644 --- a/scripts/effects/bolters_roll.lua +++ b/scripts/effects/bolters_roll.lua @@ -5,14 +5,13 @@ local effectObject = {} effectObject.onEffectGain = function(target, effect) - target:addMod(xi.mod.MOVE_SPEED_STACKABLE, effect:getPower()) + effect:addMod(xi.mod.MOVE_SPEED_STACKABLE, effect:getPower()) end effectObject.onEffectTick = function(target, effect) end effectObject.onEffectLose = function(target, effect) - target:delMod(xi.mod.MOVE_SPEED_STACKABLE, effect:getPower()) end return effectObject diff --git a/scripts/effects/gestation.lua b/scripts/effects/gestation.lua index f24154d74db..3e55df10039 100644 --- a/scripts/effects/gestation.lua +++ b/scripts/effects/gestation.lua @@ -22,14 +22,13 @@ local effectObject = {} local boostAmount = 50 -- +50% movement speed effectObject.onEffectGain = function(target, effect) - target:addMod(xi.mod.MOVE_SPEED_STACKABLE, boostAmount) + effect:addMod(xi.mod.MOVE_SPEED_STACKABLE, boostAmount) end effectObject.onEffectTick = function(target, effect) end effectObject.onEffectLose = function(target, effect) - target:delMod(xi.mod.MOVE_SPEED_STACKABLE, boostAmount) end return effectObject diff --git a/scripts/effects/mazurka.lua b/scripts/effects/mazurka.lua index 0d10e95dcac..afcb66296c2 100644 --- a/scripts/effects/mazurka.lua +++ b/scripts/effects/mazurka.lua @@ -5,16 +5,14 @@ local effectObject = {} effectObject.onEffectGain = function(target, effect) - target:addMod(xi.mod.MOVE_SPEED_MAZURKA, effect:getPower()) - target:addMod(xi.mod.AGI, effect:getSubPower()) -- Apply Stat Buff from AUGMENT_SONG_STAT + effect:addMod(xi.mod.MOVE_SPEED_MAZURKA, effect:getPower()) + effect:addMod(xi.mod.AGI, effect:getSubPower()) -- Apply Stat Buff from AUGMENT_SONG_STAT end effectObject.onEffectTick = function(target, effect) end effectObject.onEffectLose = function(target, effect) - target:delMod(xi.mod.MOVE_SPEED_MAZURKA, effect:getPower()) - target:delMod(xi.mod.AGI, effect:getSubPower()) -- Remove Stat Buff from AUGMENT_SONG_STAT end return effectObject diff --git a/scripts/globals/spells/enhancing_song.lua b/scripts/globals/spells/enhancing_song.lua index 7122b5f6507..74f7729e1be 100644 --- a/scripts/globals/spells/enhancing_song.lua +++ b/scripts/globals/spells/enhancing_song.lua @@ -96,8 +96,8 @@ local pTable = -- Misc. [xi.magic.spell.GODDESSS_HYMNUS ] = { 1, xi.effect.HYMNUS, xi.mod.AUGMENT_SONG_STAT, 0, 0, 0, 1, 0, 1, 0, 0, false }, [xi.magic.spell.SENTINELS_SCHERZO ] = { 1, xi.effect.SCHERZO, xi.mod.AUGMENT_SONG_STAT, 0, 0, 0, 1, 350, 45, 1, 10, false }, - [xi.magic.spell.RAPTOR_MAZURKA ] = { 1, xi.effect.MAZURKA, xi.mod.AUGMENT_SONG_STAT, 0, 0, 0, 12, 0, 12, 0, 0, false }, - [xi.magic.spell.CHOCOBO_MAZURKA ] = { 1, xi.effect.MAZURKA, xi.mod.AUGMENT_SONG_STAT, 0, 0, 0, 24, 0, 24, 0, 0, false }, + [xi.magic.spell.RAPTOR_MAZURKA ] = { 1, xi.effect.MAZURKA, xi.mod.AUGMENT_SONG_STAT, 0, 0, 0, 5, 0, 12, 0, 0, false }, + [xi.magic.spell.CHOCOBO_MAZURKA ] = { 1, xi.effect.MAZURKA, xi.mod.AUGMENT_SONG_STAT, 0, 0, 0, 10, 0, 24, 0, 0, false }, -- Emnity Songs [xi.magic.spell.FOE_SIRVENTE ] = { 1, xi.effect.SIRVENTE, xi.mod.AUGMENT_SONG_STAT, 0, 0, 0, 35, 0, 35, 1, 0, true }, diff --git a/scripts/items/choco-katana.lua b/scripts/items/choco-katana.lua index ab6e6909ecb..49b37591b10 100644 --- a/scripts/items/choco-katana.lua +++ b/scripts/items/choco-katana.lua @@ -4,7 +4,7 @@ -- Food Effect: 3 Min, All Races ----------------------------------- -- Agility 1 --- Speed 12.5% +-- Base speed 10% or +5 ----------------------------------- ---@type TItemFood local itemObject = {} @@ -19,12 +19,12 @@ end itemObject.onEffectGain = function(target, effect) target:addMod(xi.mod.AGI, 1) - target:addMod(xi.mod.MOVE_SPEED_QUICKENING, 12) + target:addMod(xi.mod.MOVE_SPEED_QUICKENING, 5) end itemObject.onEffectLose = function(target, effect) target:delMod(xi.mod.AGI, 1) - target:delMod(xi.mod.MOVE_SPEED_QUICKENING, 12) + target:delMod(xi.mod.MOVE_SPEED_QUICKENING, 5) end return itemObject diff --git a/scripts/items/choco-ligar.lua b/scripts/items/choco-ligar.lua index d99b716be5e..4f2118b02a0 100644 --- a/scripts/items/choco-ligar.lua +++ b/scripts/items/choco-ligar.lua @@ -4,7 +4,7 @@ -- Food Effect: 3 Min, All Races ----------------------------------- -- Vitality 1 --- Speed 12.5% +-- Base speed 10% or +5 ----------------------------------- ---@type TItemFood local itemObject = {} @@ -19,12 +19,12 @@ end itemObject.onEffectGain = function(target, effect) target:addMod(xi.mod.VIT, 1) - target:addMod(xi.mod.MOVE_SPEED_QUICKENING, 12) + target:addMod(xi.mod.MOVE_SPEED_QUICKENING, 5) end itemObject.onEffectLose = function(target, effect) target:delMod(xi.mod.VIT, 1) - target:delMod(xi.mod.MOVE_SPEED_QUICKENING, 12) + target:delMod(xi.mod.MOVE_SPEED_QUICKENING, 5) end return itemObject diff --git a/scripts/items/choco-scroll.lua b/scripts/items/choco-scroll.lua index 547b3269146..2e97b37abf3 100644 --- a/scripts/items/choco-scroll.lua +++ b/scripts/items/choco-scroll.lua @@ -4,7 +4,7 @@ -- Food Effect: 3 Min, All Races ----------------------------------- -- Mind 1 --- Speed 12.5% +-- Base speed 10% or +5 ----------------------------------- ---@type TItemFood local itemObject = {} @@ -19,12 +19,12 @@ end itemObject.onEffectGain = function(target, effect) target:addMod(xi.mod.MND, 1) - target:addMod(xi.mod.MOVE_SPEED_QUICKENING, 12) + target:addMod(xi.mod.MOVE_SPEED_QUICKENING, 5) end itemObject.onEffectLose = function(target, effect) target:delMod(xi.mod.MND, 1) - target:delMod(xi.mod.MOVE_SPEED_QUICKENING, 12) + target:delMod(xi.mod.MOVE_SPEED_QUICKENING, 5) end return itemObject diff --git a/scripts/items/chocolate_rarab_tail.lua b/scripts/items/chocolate_rarab_tail.lua index 933dcaae914..f86b109178d 100644 --- a/scripts/items/chocolate_rarab_tail.lua +++ b/scripts/items/chocolate_rarab_tail.lua @@ -4,7 +4,7 @@ -- Food Effect: 3 Min, All Races ----------------------------------- -- Dexterity 1 --- Speed 12.5% +-- Base speed 10% or +5 ----------------------------------- ---@type TItemFood local itemObject = {} @@ -19,12 +19,12 @@ end itemObject.onEffectGain = function(target, effect) target:addMod(xi.mod.DEX, 1) - target:addMod(xi.mod.MOVE_SPEED_QUICKENING, 12) + target:addMod(xi.mod.MOVE_SPEED_QUICKENING, 5) end itemObject.onEffectLose = function(target, effect) target:delMod(xi.mod.DEX, 1) - target:delMod(xi.mod.MOVE_SPEED_QUICKENING, 12) + target:delMod(xi.mod.MOVE_SPEED_QUICKENING, 5) end return itemObject diff --git a/scripts/items/fudgy-wudge.lua b/scripts/items/fudgy-wudge.lua index 766a041436b..59c39bf9530 100644 --- a/scripts/items/fudgy-wudge.lua +++ b/scripts/items/fudgy-wudge.lua @@ -4,7 +4,7 @@ -- Food Effect: 3 Min, All Races ----------------------------------- -- Intelligence 1 --- Speed 12.5% +-- Base speed 10% or +5 ----------------------------------- ---@type TItemFood local itemObject = {} @@ -19,12 +19,12 @@ end itemObject.onEffectGain = function(target, effect) target:addMod(xi.mod.INT, 1) - target:addMod(xi.mod.MOVE_SPEED_QUICKENING, 12) + target:addMod(xi.mod.MOVE_SPEED_QUICKENING, 5) end itemObject.onEffectLose = function(target, effect) target:delMod(xi.mod.INT, 1) - target:delMod(xi.mod.MOVE_SPEED_QUICKENING, 12) + target:delMod(xi.mod.MOVE_SPEED_QUICKENING, 5) end return itemObject diff --git a/scripts/items/sprinters_shoes.lua b/scripts/items/sprinters_shoes.lua index f6d2d8c2852..e73a844c23d 100644 --- a/scripts/items/sprinters_shoes.lua +++ b/scripts/items/sprinters_shoes.lua @@ -2,6 +2,7 @@ -- ID: 15754 -- Item: Sprinter's Shoes -- Item Effect: Quickening for 60 minutes +-- Base speed 10% or +5 ----------------------------------- ---@type TItem local itemObject = {} @@ -11,7 +12,7 @@ itemObject.onItemCheck = function(target, item, param, caster) end itemObject.onItemUse = function(target) - target:addStatusEffect(xi.effect.QUICKENING, 10, 0, 3600) + target:addStatusEffect(xi.effect.QUICKENING, 5, 0, 3600) target:messageBasic(xi.msg.basic.GAINS_EFFECT_OF_STATUS, xi.effect.QUICKENING) end diff --git a/scripts/items/talaria.lua b/scripts/items/talaria.lua index 10746952d73..befac00d406 100644 --- a/scripts/items/talaria.lua +++ b/scripts/items/talaria.lua @@ -3,6 +3,7 @@ -- Item: Talaria -- Enchantment: Increases movement speed. -- Durration: 60 Mins +-- Base speed 10% or +5 ----------------------------------- ---@type TItem local itemObject = {} @@ -18,11 +19,11 @@ itemObject.onItemUse = function(target) end itemObject.onEffectGain = function(target, effect) - target:addMod(xi.mod.MOVE_SPEED_QUICKENING, 12) + target:addMod(xi.mod.MOVE_SPEED_QUICKENING, 5) end itemObject.onEffectLose = function(target, effect) - target:delMod(xi.mod.MOVE_SPEED_QUICKENING, 12) + target:delMod(xi.mod.MOVE_SPEED_QUICKENING, 5) end return itemObject diff --git a/scripts/items/temple_truffle.lua b/scripts/items/temple_truffle.lua index 5736a3db0dd..549232d8abe 100644 --- a/scripts/items/temple_truffle.lua +++ b/scripts/items/temple_truffle.lua @@ -4,7 +4,7 @@ -- Food Effect: 3 Min, All Races ----------------------------------- -- Strength 1 --- Speed 12.5% +-- Base speed 10% or +5 ----------------------------------- ---@type TItemFood local itemObject = {} @@ -19,12 +19,12 @@ end itemObject.onEffectGain = function(target, effect) target:addMod(xi.mod.STR, 1) - target:addMod(xi.mod.MOVE_SPEED_QUICKENING, 12) + target:addMod(xi.mod.MOVE_SPEED_QUICKENING, 5) end itemObject.onEffectLose = function(target, effect) target:delMod(xi.mod.STR, 1) - target:delMod(xi.mod.MOVE_SPEED_QUICKENING, 12) + target:delMod(xi.mod.MOVE_SPEED_QUICKENING, 5) end return itemObject diff --git a/sql/item_latents.sql b/sql/item_latents.sql index 08eed36ff07..3d795678fdf 100644 --- a/sql/item_latents.sql +++ b/sql/item_latents.sql @@ -58,7 +58,7 @@ INSERT INTO `item_latents` VALUES (10961,22,-40,13,14); -- CHARMED:DARKRES -- LAVALIER +1 INSERT INTO `item_latents` VALUES (10962,21,-50,13,14); -- CHARMED:LIGHTRES INSERT INTO `item_latents` VALUES (10962,22,-50,13,14); -- CHARMED:DARKRES -INSERT INTO `item_latents` VALUES (10962,75,-12,13,14); -- CHARMED:MOVE_SPEED_STACKABLE +INSERT INTO `item_latents` VALUES (10962,75,-5,13,14); -- CHARMED:MOVE_SPEED_STACKABLE -- Archon Cape +1 INSERT INTO `item_latents` VALUES (10975,23,13,52,8); -- DARK WEATHER:ATT diff --git a/sql/item_mods.sql b/sql/item_mods.sql index caca4d9bb5b..acd0266a57b 100644 --- a/sql/item_mods.sql +++ b/sql/item_mods.sql @@ -691,7 +691,7 @@ INSERT INTO `item_mods` VALUES (10371,384,200); -- HASTE_GEAR: 200 -- Plumb Boots INSERT INTO `item_mods` VALUES (10372,1,49); -- DEF: 49 -INSERT INTO `item_mods` VALUES (10372,75,-12); -- MOVE_SPEED_STACKABLE: -12 +INSERT INTO `item_mods` VALUES (10372,75,-20); -- MOVE_SPEED_STACKABLE: -20 INSERT INTO `item_mods` VALUES (10372,161,-500); -- DMGPHYS: -500 -- Ocular Boots @@ -4196,9 +4196,9 @@ INSERT INTO `item_mods` VALUES (10969,8,5); -- STR: 5 INSERT INTO `item_mods` VALUES (10969,9,5); -- DEX: 5 -- Scuta Cape -INSERT INTO `item_mods` VALUES (10970,1,20); -- DEF: 20 -INSERT INTO `item_mods` VALUES (10970,75,-12); -- MOVE_SPEED_STACKABLE: -12 -INSERT INTO `item_mods` VALUES (10970,370,2); -- REGEN: 2 +INSERT INTO `item_mods` VALUES (10970,1,20); -- DEF: 20 +INSERT INTO `item_mods` VALUES (10970,75,-5); -- MOVE_SPEED_STACKABLE: -5 +INSERT INTO `item_mods` VALUES (10970,370,2); -- REGEN: 2 -- Strendu Mantle INSERT INTO `item_mods` VALUES (10971,1,12); -- DEF: 12 @@ -4246,7 +4246,7 @@ INSERT INTO `item_mods` VALUES (10979,121,6); -- WIND: 6 -- Mollusca Mantle INSERT INTO `item_mods` VALUES (10980,1,19); -- DEF: 19 INSERT INTO `item_mods` VALUES (10980,160,-500); -- DMG: -500 -INSERT INTO `item_mods` VALUES (10980,75,-12); -- MOVE_SPEED_STACKABLE: -12 +INSERT INTO `item_mods` VALUES (10980,75,-5); -- MOVE_SPEED_STACKABLE: -5 -- Chela Cape INSERT INTO `item_mods` VALUES (10981,1,10); -- DEF: 10 @@ -8935,7 +8935,7 @@ INSERT INTO `item_mods` VALUES (11817,1,30); -- DEF: 30 INSERT INTO `item_mods` VALUES (11817,10,9); -- VIT: 9 INSERT INTO `item_mods` VALUES (11817,68,-14); -- EVA: -14 INSERT INTO `item_mods` VALUES (11817,161,-500); -- DMGPHYS: -500 -INSERT INTO `item_mods` VALUES (11817,75,-12); -- MOVE_SPEED_STACKABLE: -12 +INSERT INTO `item_mods` VALUES (11817,75,-5); -- MOVE_SPEED_STACKABLE: -5 -- Oneiros Headgear INSERT INTO `item_mods` VALUES (11818,1,25); -- DEF: 25 @@ -12447,12 +12447,12 @@ INSERT INTO `item_mods` VALUES (12444,15,2); -- FIRE_RES: 2 INSERT INTO `item_mods` VALUES (12444,20,-1); -- WATER_RES: -1 -- Dusk Mask -INSERT INTO `item_mods` VALUES (12445,1,31); -- DEF: 31 -INSERT INTO `item_mods` VALUES (12445,2,30); -- HP: 30 -INSERT INTO `item_mods` VALUES (12445,10,5); -- VIT: 5 -INSERT INTO `item_mods` VALUES (12445,25,5); -- ACC: 5 -INSERT INTO `item_mods` VALUES (12445,68,5); -- EVA: 5 -INSERT INTO `item_mods` VALUES (12445,75,-12); -- MOVE_SPEED_STACKABLE: -12 +INSERT INTO `item_mods` VALUES (12445,1,31); -- DEF: 31 +INSERT INTO `item_mods` VALUES (12445,2,30); -- HP: 30 +INSERT INTO `item_mods` VALUES (12445,10,5); -- VIT: 5 +INSERT INTO `item_mods` VALUES (12445,25,5); -- ACC: 5 +INSERT INTO `item_mods` VALUES (12445,68,5); -- EVA: 5 +INSERT INTO `item_mods` VALUES (12445,75,-5); -- MOVE_SPEED_STACKABLE: -5 -- Tiger Helm INSERT INTO `item_mods` VALUES (12446,1,21); -- DEF: 21 @@ -13037,11 +13037,11 @@ INSERT INTO `item_mods` VALUES (12572,15,3); -- FIRE_RES: 3 INSERT INTO `item_mods` VALUES (12572,20,-1); -- WATER_RES: -1 -- Dusk Jerkin -INSERT INTO `item_mods` VALUES (12573,1,50); -- DEF: 50 -INSERT INTO `item_mods` VALUES (12573,2,40); -- HP: 40 -INSERT INTO `item_mods` VALUES (12573,25,2); -- ACC: 2 -INSERT INTO `item_mods` VALUES (12573,75,-12); -- MOVE_SPEED_STACKABLE: -12 -INSERT INTO `item_mods` VALUES (12573,370,1); -- REGEN: 1 +INSERT INTO `item_mods` VALUES (12573,1,50); -- DEF: 50 +INSERT INTO `item_mods` VALUES (12573,2,40); -- HP: 40 +INSERT INTO `item_mods` VALUES (12573,25,2); -- ACC: 2 +INSERT INTO `item_mods` VALUES (12573,75,-5); -- MOVE_SPEED_STACKABLE: -5 +INSERT INTO `item_mods` VALUES (12573,370,1); -- REGEN: 1 -- Tiger Jerkin INSERT INTO `item_mods` VALUES (12574,1,41); -- DEF: 41 @@ -13643,7 +13643,7 @@ INSERT INTO `item_mods` VALUES (12700,20,-1); -- WATER_RES: -1 INSERT INTO `item_mods` VALUES (12701,1,24); -- DEF: 24 INSERT INTO `item_mods` VALUES (12701,2,20); -- HP: 20 INSERT INTO `item_mods` VALUES (12701,23,5); -- ATT: 5 -INSERT INTO `item_mods` VALUES (12701,75,-12); -- MOVE_SPEED_STACKABLE: -12 +INSERT INTO `item_mods` VALUES (12701,75,-5); -- MOVE_SPEED_STACKABLE: -5 INSERT INTO `item_mods` VALUES (12701,384,300); -- HASTE_GEAR: 300 -- Tiger Gloves @@ -14416,11 +14416,11 @@ INSERT INTO `item_mods` VALUES (12878,14,1); -- CHR: 1 INSERT INTO `item_mods` VALUES (12878,163,-200); -- DMGMAGIC: -200 -- Dusk Trousers -INSERT INTO `item_mods` VALUES (12879,1,47); -- DEF: 47 -INSERT INTO `item_mods` VALUES (12879,2,35); -- HP: 35 -INSERT INTO `item_mods` VALUES (12879,23,14); -- ATT: 14 -INSERT INTO `item_mods` VALUES (12879,26,10); -- RACC: 10 -INSERT INTO `item_mods` VALUES (12879,75,-12); -- MOVE_SPEED_STACKABLE: -12 +INSERT INTO `item_mods` VALUES (12879,1,47); -- DEF: 47 +INSERT INTO `item_mods` VALUES (12879,2,35); -- HP: 35 +INSERT INTO `item_mods` VALUES (12879,23,14); -- ATT: 14 +INSERT INTO `item_mods` VALUES (12879,26,10); -- RACC: 10 +INSERT INTO `item_mods` VALUES (12879,75,-5); -- MOVE_SPEED_STACKABLE: -5 -- Ogre Trousers INSERT INTO `item_mods` VALUES (12880,1,31); -- DEF: 31 @@ -14746,7 +14746,7 @@ INSERT INTO `item_mods` VALUES (12956,20,-1); -- WATER_RES: -1 INSERT INTO `item_mods` VALUES (12957,1,23); -- DEF: 23 INSERT INTO `item_mods` VALUES (12957,2,25); -- HP: 25 INSERT INTO `item_mods` VALUES (12957,23,4); -- ATT: 4 -INSERT INTO `item_mods` VALUES (12957,75,-12); -- MOVE_SPEED_STACKABLE: -12 +INSERT INTO `item_mods` VALUES (12957,75,-5); -- MOVE_SPEED_STACKABLE: -5 INSERT INTO `item_mods` VALUES (12957,384,200); -- HASTE_GEAR: 200 -- Tiger Ledelsens @@ -19231,12 +19231,12 @@ INSERT INTO `item_mods` VALUES (13937,162,-600); -- DMGBREATH: -600 INSERT INTO `item_mods` VALUES (13937,289,4); -- SUBTLE_BLOW: 4 -- Dusk Mask +1 -INSERT INTO `item_mods` VALUES (13938,1,32); -- DEF: 32 -INSERT INTO `item_mods` VALUES (13938,2,32); -- HP: 32 -INSERT INTO `item_mods` VALUES (13938,10,6); -- VIT: 6 -INSERT INTO `item_mods` VALUES (13938,25,6); -- ACC: 6 -INSERT INTO `item_mods` VALUES (13938,68,6); -- EVA: 6 -INSERT INTO `item_mods` VALUES (13938,75,-12); -- MOVE_SPEED_STACKABLE: -12 +INSERT INTO `item_mods` VALUES (13938,1,32); -- DEF: 32 +INSERT INTO `item_mods` VALUES (13938,2,32); -- HP: 32 +INSERT INTO `item_mods` VALUES (13938,10,6); -- VIT: 6 +INSERT INTO `item_mods` VALUES (13938,25,6); -- ACC: 6 +INSERT INTO `item_mods` VALUES (13938,68,6); -- EVA: 6 +INSERT INTO `item_mods` VALUES (13938,75,-5); -- MOVE_SPEED_STACKABLE: -5 -- Austere Hat INSERT INTO `item_mods` VALUES (13939,1,13); -- DEF: 13 @@ -20573,7 +20573,7 @@ INSERT INTO `item_mods` VALUES (14187,27,2); -- ENMITY: 2 INSERT INTO `item_mods` VALUES (14188,1,24); -- DEF: 24 INSERT INTO `item_mods` VALUES (14188,2,27); -- HP: 27 INSERT INTO `item_mods` VALUES (14188,23,5); -- ATT: 5 -INSERT INTO `item_mods` VALUES (14188,75,-12); -- MOVE_SPEED_STACKABLE: -12 +INSERT INTO `item_mods` VALUES (14188,75,-5); -- MOVE_SPEED_STACKABLE: -5 INSERT INTO `item_mods` VALUES (14188,384,300); -- HASTE_GEAR: 300 -- Austere Sabots @@ -21293,11 +21293,11 @@ INSERT INTO `item_mods` VALUES (14306,162,-400); -- DMGBREATH: -400 INSERT INTO `item_mods` VALUES (14306,289,6); -- SUBTLE_BLOW: 6 -- Dusk Trousers +1 -INSERT INTO `item_mods` VALUES (14307,1,48); -- DEF: 48 -INSERT INTO `item_mods` VALUES (14307,2,37); -- HP: 37 -INSERT INTO `item_mods` VALUES (14307,23,15); -- ATT: 15 -INSERT INTO `item_mods` VALUES (14307,26,11); -- RACC: 11 -INSERT INTO `item_mods` VALUES (14307,75,-12); -- MOVE_SPEED_STACKABLE: -12 +INSERT INTO `item_mods` VALUES (14307,1,48); -- DEF: 48 +INSERT INTO `item_mods` VALUES (14307,2,37); -- HP: 37 +INSERT INTO `item_mods` VALUES (14307,23,15); -- ATT: 15 +INSERT INTO `item_mods` VALUES (14307,26,11); -- RACC: 11 +INSERT INTO `item_mods` VALUES (14307,75,-5); -- MOVE_SPEED_STACKABLE: -5 -- Hecatomb Subligar INSERT INTO `item_mods` VALUES (14308,1,42); -- DEF: 42 @@ -21805,11 +21805,11 @@ INSERT INTO `item_mods` VALUES (14390,162,-1200); -- DMGBREATH: -1200 INSERT INTO `item_mods` VALUES (14390,289,12); -- SUBTLE_BLOW: 12 -- Dusk Jerkin +1 -INSERT INTO `item_mods` VALUES (14391,1,51); -- DEF: 51 -INSERT INTO `item_mods` VALUES (14391,2,42); -- HP: 42 -INSERT INTO `item_mods` VALUES (14391,25,3); -- ACC: 3 -INSERT INTO `item_mods` VALUES (14391,75,-12); -- MOVE_SPEED_STACKABLE: -12 -INSERT INTO `item_mods` VALUES (14391,370,1); -- REGEN: 1 +INSERT INTO `item_mods` VALUES (14391,1,51); -- DEF: 51 +INSERT INTO `item_mods` VALUES (14391,2,42); -- HP: 42 +INSERT INTO `item_mods` VALUES (14391,25,3); -- ACC: 3 +INSERT INTO `item_mods` VALUES (14391,75,-5); -- MOVE_SPEED_STACKABLE: -5 +INSERT INTO `item_mods` VALUES (14391,370,1); -- REGEN: 1 -- Carpenters Apron INSERT INTO `item_mods` VALUES (14392,1,3); -- DEF: 3 @@ -23891,7 +23891,7 @@ INSERT INTO `item_mods` VALUES (14824,289,3); -- SUBTLE_BLOW: 3 INSERT INTO `item_mods` VALUES (14825,1,25); -- DEF: 25 INSERT INTO `item_mods` VALUES (14825,2,22); -- HP: 22 INSERT INTO `item_mods` VALUES (14825,23,6); -- ATT: 6 -INSERT INTO `item_mods` VALUES (14825,75,-12); -- MOVE_SPEED_STACKABLE: -12 +INSERT INTO `item_mods` VALUES (14825,75,-5); -- MOVE_SPEED_STACKABLE: -5 INSERT INTO `item_mods` VALUES (14825,384,400); -- HASTE_GEAR: 400 -- Austere Cuffs @@ -29101,7 +29101,7 @@ INSERT INTO `item_mods` VALUES (15758,296,3); -- CONSERVE_MP: 3 INSERT INTO `item_mods` VALUES (15759,1,9); -- DEF: 9 INSERT INTO `item_mods` VALUES (15759,28,2); -- MATT: 2 INSERT INTO `item_mods` VALUES (15759,29,2); -- MDEF: 2 -INSERT INTO `item_mods` VALUES (15759,75,-12); -- MOVE_SPEED_STACKABLE: -12 +INSERT INTO `item_mods` VALUES (15759,75,-5); -- MOVE_SPEED_STACKABLE: -5 INSERT INTO `item_mods` VALUES (15759,384,-500); -- HASTE_GEAR: -500 -- Marabout Sandals @@ -31443,12 +31443,12 @@ INSERT INTO `item_mods` VALUES (16343,73,5); -- STORETP: 5 INSERT INTO `item_mods` VALUES (16343,289,5); -- SUBTLE_BLOW: 5 -- Oily Trousers -INSERT INTO `item_mods` VALUES (16344,1,35); -- DEF: 35 -INSERT INTO `item_mods` VALUES (16344,9,5); -- DEX: 5 -INSERT INTO `item_mods` VALUES (16344,11,5); -- AGI: 5 -INSERT INTO `item_mods` VALUES (16344,25,5); -- ACC: 5 -INSERT INTO `item_mods` VALUES (16344,26,5); -- RACC: 5 -INSERT INTO `item_mods` VALUES (16344,75,-12); -- MOVE_SPEED_STACKABLE: -12 +INSERT INTO `item_mods` VALUES (16344,1,35); -- DEF: 35 +INSERT INTO `item_mods` VALUES (16344,9,5); -- DEX: 5 +INSERT INTO `item_mods` VALUES (16344,11,5); -- AGI: 5 +INSERT INTO `item_mods` VALUES (16344,25,5); -- ACC: 5 +INSERT INTO `item_mods` VALUES (16344,26,5); -- RACC: 5 +INSERT INTO `item_mods` VALUES (16344,75,-5); -- MOVE_SPEED_STACKABLE: -5 -- Magus Shalwar +1 INSERT INTO `item_mods` VALUES (16345,1,34); -- DEF: 34 @@ -35666,8 +35666,8 @@ INSERT INTO `item_mods` VALUES (17812,8,1); -- STR: 1 INSERT INTO `item_mods` VALUES (17812,11,1); -- AGI: 1 -- Raikiri -INSERT INTO `item_mods` VALUES (17814,25,3); -- ACC: 3 -INSERT INTO `item_mods` VALUES (17814,75,-12); -- MOVE_SPEED_STACKABLE: -12 +INSERT INTO `item_mods` VALUES (17814,25,3); -- ACC: 3 +INSERT INTO `item_mods` VALUES (17814,75,-5); -- MOVE_SPEED_STACKABLE: -5 -- Tachi Of Trials INSERT INTO `item_mods` VALUES (17815,2,20); -- HP: 20 @@ -37616,8 +37616,8 @@ INSERT INTO `item_mods` VALUES (18518,10,5); -- VIT: 5 INSERT INTO `item_mods` VALUES (18518,25,5); -- ACC: 5 -- Oneiros Axe -INSERT INTO `item_mods` VALUES (18519,73,-15); -- STORETP: -15 -INSERT INTO `item_mods` VALUES (18519,75,-12); -- MOVE_SPEED_STACKABLE: -12 +INSERT INTO `item_mods` VALUES (18519,73,-15); -- STORETP: -15 +INSERT INTO `item_mods` VALUES (18519,75,-5); -- MOVE_SPEED_STACKABLE: -5 -- Laceratrice INSERT INTO `item_mods` VALUES (18520,165,4); -- CRITHITRATE: 4 From eaf7833d5a1a621e6d4ba1439c101bc29798f769 Mon Sep 17 00:00:00 2001 From: Xaver-DaRed Date: Tue, 3 Sep 2024 13:34:28 +0200 Subject: [PATCH 3/6] Re-adjust speed calculations to account for new info Co-authored-by: cocosolos --- src/map/entities/battleentity.cpp | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/src/map/entities/battleentity.cpp b/src/map/entities/battleentity.cpp index acd6d9e1242..f98e6f5e8a2 100644 --- a/src/map/entities/battleentity.cpp +++ b/src/map/entities/battleentity.cpp @@ -255,27 +255,31 @@ uint8 CBattleEntity::GetSpeed() return std::clamp(outputSpeed, std::numeric_limits::min(), std::numeric_limits::max()); } - // Flee, KIs, Gear penalties, Bolters Roll. - float additiveMods = static_cast(getMod(Mod::MOVE_SPEED_STACKABLE)) / 100.0f; + // KIs, Gear penalties, Bolters Roll. + float additiveMods = static_cast(getMod(Mod::MOVE_SPEED_STACKABLE)); - // Quickening and Mazurka. Only highest applies. + // Quickening and Mazurka. Only highest applies. Additive. Mod modToUse = getMod(Mod::MOVE_SPEED_QUICKENING) > getMod(Mod::MOVE_SPEED_MAZURKA) ? Mod::MOVE_SPEED_QUICKENING : Mod::MOVE_SPEED_MAZURKA; - float effectBonus = static_cast(getMod(modToUse)) / 100.0f; + float effectAdditiveBonus = static_cast(getMod(modToUse)); - // Positive movement speed from gear. Only highest applies. - float gearBonus = 0.0f; + // Flee. + float fleeFactor = std::clamp(1.0f + static_cast(getMod(Mod::MOVE_SPEED_FLEE)) / 100.0f, 1.0f, 2.0f); + + // Positive movement speed from gear. Only highest applies. Multiplicative to base speed. + float gearBonus = 1.0f; if (objtype == TYPE_PC) { - gearBonus = static_cast(getMaxGearMod(Mod::MOVE_SPEED_GEAR_BONUS)) / 100.0f; + gearBonus = std::clamp(1.0f + static_cast(getMaxGearMod(Mod::MOVE_SPEED_GEAR_BONUS)) / 100.0f, 1.0f, 1.25f); } // Gravity and Curse. They seem additive to each other and the sum seems to be multiplicative. - float weightPenalties = static_cast(getMod(Mod::MOVE_SPEED_WEIGHT_PENALTY)) / 100.0f; + float weightPenalties = std::clamp(1.0f - static_cast(getMod(Mod::MOVE_SPEED_WEIGHT_PENALTY)) / 100.0f, 0.1f, 1.0f); // We have all the modifiers needed. Calculate final speed. - float modifiedSpeed = static_cast(baseSpeed) * std::clamp(1.0f + additiveMods + effectBonus, 0.1f, 1.6f) * (1.0f + gearBonus) * std::clamp(1.0f - weightPenalties, 0.1f, 1.0f); + // Final speed = (base speed + addtive bonuses/penalties) * flee * positive bonus from gear * weight penalties + float modifiedSpeed = static_cast(baseSpeed + additiveMods + effectAdditiveBonus) * fleeFactor * gearBonus * weightPenalties; outputSpeed = static_cast(modifiedSpeed); From c8246d42c6f95b0a9dbf70fb55450a08e6f20729 Mon Sep 17 00:00:00 2001 From: Xaver-DaRed Date: Tue, 3 Sep 2024 19:33:10 +0200 Subject: [PATCH 4/6] Implement common cap for Quickening and Mazurka Co-authored-by: cocosolos --- src/map/entities/battleentity.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/map/entities/battleentity.cpp b/src/map/entities/battleentity.cpp index f98e6f5e8a2..53e4e91df7b 100644 --- a/src/map/entities/battleentity.cpp +++ b/src/map/entities/battleentity.cpp @@ -258,10 +258,8 @@ uint8 CBattleEntity::GetSpeed() // KIs, Gear penalties, Bolters Roll. float additiveMods = static_cast(getMod(Mod::MOVE_SPEED_STACKABLE)); - // Quickening and Mazurka. Only highest applies. Additive. - Mod modToUse = getMod(Mod::MOVE_SPEED_QUICKENING) > getMod(Mod::MOVE_SPEED_MAZURKA) ? Mod::MOVE_SPEED_QUICKENING : Mod::MOVE_SPEED_MAZURKA; - - float effectAdditiveBonus = static_cast(getMod(modToUse)); + // Quickening and Mazurka. They share a cap. Additive. + float effectAdditiveBonus = std::clamp(static_cast(getMod(Mod::MOVE_SPEED_QUICKENING)) + static_cast(getMod(Mod::MOVE_SPEED_MAZURKA)), 0.0f, 10.0f); // Flee. float fleeFactor = std::clamp(1.0f + static_cast(getMod(Mod::MOVE_SPEED_FLEE)) / 100.0f, 1.0f, 2.0f); From b3fd755e35c14937bc444cf89269b6845fbbd0a1 Mon Sep 17 00:00:00 2001 From: Xaver-DaRed Date: Tue, 3 Sep 2024 20:35:48 +0200 Subject: [PATCH 5/6] Add notes for for Atma movement speed bonus and correct "typo" --- scripts/commands/speed.lua | 2 +- scripts/enum/mod.lua | 2 +- scripts/globals/abyssea/atma.lua | 4 ++-- src/map/entities/battleentity.cpp | 10 +++++----- src/map/modifier.h | 2 +- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/scripts/commands/speed.lua b/scripts/commands/speed.lua index 2717f6dcb90..2b6eb291940 100644 --- a/scripts/commands/speed.lua +++ b/scripts/commands/speed.lua @@ -47,7 +47,7 @@ commandObj.onTrigger = function(player, speed) player:printToPlayer(string.format('New speed: %u', speed)) end - player:setMod(xi.mod.MOVE_SPEED_OVERIDE, speed) + player:setMod(xi.mod.MOVE_SPEED_OVERRIDE, speed) player:setSpeed(baseSpeed) end diff --git a/scripts/enum/mod.lua b/scripts/enum/mod.lua index 126b1af2634..5343bc7afe6 100644 --- a/scripts/enum/mod.lua +++ b/scripts/enum/mod.lua @@ -235,7 +235,7 @@ xi.mod = SPELLINTERRUPT = 168, -- Movement speed modifiers - MOVE_SPEED_OVERIDE = 169, -- Modifier used to overide regular speed caps. (GM speed and Feast of Swords) + MOVE_SPEED_OVERRIDE = 169, -- Modifier used to overide regular speed caps. (GM speed and Feast of Swords) MOVE_SPEED_STACKABLE = 75, -- Gear movement speed penalties, etc. MOVE_SPEED_GEAR_BONUS = 76, -- Gear movement speed bonuses. DOES NOT STACK with each other, only highest applies. MOVE_SPEED_WEIGHT_PENALTY = 77, -- For Gravity and curse. diff --git a/scripts/globals/abyssea/atma.lua b/scripts/globals/abyssea/atma.lua index e749c5f5385..c9b610b86ae 100644 --- a/scripts/globals/abyssea/atma.lua +++ b/scripts/globals/abyssea/atma.lua @@ -124,7 +124,7 @@ xi.atma.atmaMods = [xi.ki.ATMA_OF_THE_AZURE_SKY] = { }, [xi.ki.ATMA_OF_ECHOES] = { }, [xi.ki.ATMA_OF_DREAD] = { }, - [xi.ki.ATMA_OF_AMBITION] = { }, + [xi.ki.ATMA_OF_AMBITION] = { }, -- Note: Speed modifier is the same as positive gear. Meaning, it doesnt stack. [xi.ki.ATMA_OF_THE_BEAST_KING] = { }, [xi.ki.ATMA_OF_THE_KIRIN] = { }, [xi.ki.ATMA_OF_HELLS_GUARDIAN] = { }, @@ -143,7 +143,7 @@ xi.atma.atmaMods = [xi.ki.ATMA_OF_THE_ILLUMINATOR] = { }, [xi.ki.ATMA_OF_THE_BUSHIN] = { }, [xi.ki.ATMA_OF_THE_ACE_ANGLER] = { }, - [xi.ki.ATMA_OF_THE_MASTER_CRAFTER] = { }, + [xi.ki.ATMA_OF_THE_MASTER_CRAFTER] = { }, -- Note: Speed modifier is the same as positive gear. Meaning, it doesnt stack [xi.ki.ATMA_OF_INGENUITY] = { }, [xi.ki.ATMA_OF_THE_GRIFFONS_CLAW] = { }, [xi.ki.ATMA_OF_THE_FETCHING_FOOTPAD] = { }, diff --git a/src/map/entities/battleentity.cpp b/src/map/entities/battleentity.cpp index 53e4e91df7b..e48e73196a9 100644 --- a/src/map/entities/battleentity.cpp +++ b/src/map/entities/battleentity.cpp @@ -255,16 +255,16 @@ uint8 CBattleEntity::GetSpeed() return std::clamp(outputSpeed, std::numeric_limits::min(), std::numeric_limits::max()); } - // KIs, Gear penalties, Bolters Roll. + // Gear penalties, Bolters Roll. float additiveMods = static_cast(getMod(Mod::MOVE_SPEED_STACKABLE)); // Quickening and Mazurka. They share a cap. Additive. - float effectAdditiveBonus = std::clamp(static_cast(getMod(Mod::MOVE_SPEED_QUICKENING)) + static_cast(getMod(Mod::MOVE_SPEED_MAZURKA)), 0.0f, 10.0f); + float effectAdditiveBonus = std::clamp(getMod(Mod::MOVE_SPEED_QUICKENING) + getMod(Mod::MOVE_SPEED_MAZURKA), 0.0f, 10.0f); // Flee. float fleeFactor = std::clamp(1.0f + static_cast(getMod(Mod::MOVE_SPEED_FLEE)) / 100.0f, 1.0f, 2.0f); - // Positive movement speed from gear. Only highest applies. Multiplicative to base speed. + // Positive movement speed from gear and from Atmas. Only highest applies. Multiplicative to base speed. float gearBonus = 1.0f; if (objtype == TYPE_PC) @@ -288,9 +288,9 @@ uint8 CBattleEntity::GetSpeed() // TODO: Find exceptions. Add them here. // GM speed bypass. - if (getMod(Mod::MOVE_SPEED_OVERIDE) > 0) + if (getMod(Mod::MOVE_SPEED_OVERRIDE) > 0) { - outputSpeed = getMod(Mod::MOVE_SPEED_OVERIDE); + outputSpeed = getMod(Mod::MOVE_SPEED_OVERRIDE); } return std::clamp(outputSpeed, std::numeric_limits::min(), std::numeric_limits::max()); diff --git a/src/map/modifier.h b/src/map/modifier.h index 44ce3ab4d1a..5b750cf8339 100644 --- a/src/map/modifier.h +++ b/src/map/modifier.h @@ -273,7 +273,7 @@ enum class Mod SPELLINTERRUPT = 168, // % Spell Interruption Rate // New movement speed modifiers. - MOVE_SPEED_OVERIDE = 169, // Modifier used to overide regular speed caps. (GM speed and Feast of Swords) + MOVE_SPEED_OVERRIDE = 169, // Modifier used to overide regular speed caps. (GM speed and Feast of Swords) MOVE_SPEED_STACKABLE = 75, // Gear movement speed penalties, flee bonus, etc. MOVE_SPEED_GEAR_BONUS = 76, // Gear movement speed bonuses. DOES NOT STACK with each other, only highest applies. MOVE_SPEED_WEIGHT_PENALTY = 77, // For Gravity and curse. From 328cb9bcbf32647e35f065c88b2b998e1e22fe71 Mon Sep 17 00:00:00 2001 From: Xaver-DaRed Date: Wed, 4 Sep 2024 16:58:45 +0200 Subject: [PATCH 6/6] Add flooring and proper order to each speed factor Co-authored-by: cocosolos --- scripts/effects/bolters_roll.lua | 2 +- scripts/enum/mod.lua | 18 ++++---- scripts/globals/job_utils/corsair.lua | 62 +++++++++++++-------------- src/map/entities/battleentity.cpp | 36 ++++++++++------ src/map/modifier.h | 20 +++++---- 5 files changed, 76 insertions(+), 62 deletions(-) diff --git a/scripts/effects/bolters_roll.lua b/scripts/effects/bolters_roll.lua index be85d233504..511147f4f9a 100644 --- a/scripts/effects/bolters_roll.lua +++ b/scripts/effects/bolters_roll.lua @@ -5,7 +5,7 @@ local effectObject = {} effectObject.onEffectGain = function(target, effect) - effect:addMod(xi.mod.MOVE_SPEED_STACKABLE, effect:getPower()) + effect:addMod(xi.mod.MOVE_SPEED_BOLTERS_ROLL, effect:getPower()) end effectObject.onEffectTick = function(target, effect) diff --git a/scripts/enum/mod.lua b/scripts/enum/mod.lua index 5343bc7afe6..2fffc7545a8 100644 --- a/scripts/enum/mod.lua +++ b/scripts/enum/mod.lua @@ -234,15 +234,17 @@ xi.mod = HASTE_MAGIC = 167, SPELLINTERRUPT = 168, - -- Movement speed modifiers - MOVE_SPEED_OVERRIDE = 169, -- Modifier used to overide regular speed caps. (GM speed and Feast of Swords) - MOVE_SPEED_STACKABLE = 75, -- Gear movement speed penalties, etc. - MOVE_SPEED_GEAR_BONUS = 76, -- Gear movement speed bonuses. DOES NOT STACK with each other, only highest applies. - MOVE_SPEED_WEIGHT_PENALTY = 77, -- For Gravity and curse. - MOVE_SPEED_QUICKENING = 78, -- Jig, spreinter shoes, etc. Only highest of Mazurka OR quickening will take effect. - MOVE_SPEED_MAZURKA = 79, -- Song movement speed. Only highest of Mazurka OR quickening will take effect. - MOVE_SPEED_FLEE = 1085, -- Flee applies a separate multiplier to speed. + -- Movement speed modifiers in use order. MOUNT_MOVE = 972, -- % Mount Movement Speed + MOVE_SPEED_STACKABLE = 75, -- Additive modifier. Applied before multipliers. Gear movement speed penalties. + MOVE_SPEED_WEIGHT_PENALTY = 77, -- Multiplicative modifier. For Gravity and curse. + MOVE_SPEED_FLEE = 1085, -- Multiplicative modifier. + MOVE_SPEED_CHEER = 1087, -- Multiplicative modifier from "cheer" type KI's. + MOVE_SPEED_GEAR_BONUS = 76, -- Multiplicative modifier. Gear movement speed bonuses. DOES NOT STACK with each other, only highest applies. + MOVE_SPEED_QUICKENING = 78, -- Additive modifier. Applied after multipliers. Jig, spreinter shoes, etc. Shares cap with Mazurka. + MOVE_SPEED_MAZURKA = 79, -- Additive modifier. Applied after multipliers. Song movement speed. Shares cap with Quickening, + MOVE_SPEED_BOLTERS_ROLL = 1086, -- Additive modifier. Applied after multipliers. + MOVE_SPEED_OVERRIDE = 169, -- Modifier used to overide regular speed caps. (GM speed and Feast of Swords) FASTCAST = 170, UFASTCAST = 407, diff --git a/scripts/globals/job_utils/corsair.lua b/scripts/globals/job_utils/corsair.lua index 485f7d39292..5bbbbfdecf6 100644 --- a/scripts/globals/job_utils/corsair.lua +++ b/scripts/globals/job_utils/corsair.lua @@ -17,37 +17,37 @@ xi.job_utils.corsair = xi.job_utils.corsair or {} -- TODO: verify Corsair's Roll for subjob: see http://wiki.ffo.jp/html/6052.html local corsairRollMods = { - [xi.jobAbility.CORSAIRS_ROLL ] = { { 10, 11, 11, 12, 20, 13, 15, 16, 8, 17, 24, 6 }, 2, 0, xi.effect.CORSAIRS_ROLL, xi.mod.EXP_BONUS, xi.job.COR }, - [xi.jobAbility.NINJA_ROLL ] = { { 4, 5, 5, 14, 6, 7, 9, 2, 10, 11, 18, 6 }, 2, 6, xi.effect.NINJA_ROLL, xi.mod.EVA, xi.job.NIN }, - [xi.jobAbility.HUNTERS_ROLL ] = { { 10, 13, 15, 40, 18, 20, 25, 5, 27, 30, 50, 5 }, 5, 15, xi.effect.HUNTERS_ROLL, xi.mod.ACC, xi.job.RNG }, - [xi.jobAbility.CHAOS_ROLL ] = { { 6, 8, 9, 25, 11, 13, 16, 3, 17, 19, 31, 10 }, 3, 10, xi.effect.CHAOS_ROLL, xi.mod.ATTP, xi.job.DRK }, - [xi.jobAbility.MAGUSS_ROLL ] = { { 5, 20, 6, 8, 9, 3, 10, 13, 14, 15, 25, 5 }, 2, 8, xi.effect.MAGUSS_ROLL, xi.mod.MDEF, xi.job.BLU }, - [xi.jobAbility.HEALERS_ROLL ] = { { 3, 4, 12, 5, 6, 7, 1, 8, 9, 10, 16, 4 }, 3, 4, xi.effect.HEALERS_ROLL, xi.mod.CURE_POTENCY_RCVD, xi.job.WHM }, - [xi.jobAbility.DRACHEN_ROLL ] = { { 10, 13, 15, 40, 18, 20, 25, 5, 28, 30, 50, 15 }, 5, 15, xi.effect.DRACHEN_ROLL, nil, xi.job.DRG }, - [xi.jobAbility.CHORAL_ROLL ] = { { 13, 55, 17, 20, 25, 8, 30, 35, 40, 45, 65, 25 }, 4, 25, xi.effect.CHORAL_ROLL, xi.mod.SPELLINTERRUPT, xi.job.BRD }, - [xi.jobAbility.MONKS_ROLL ] = { { 8, 10, 32, 12, 14, 16, 4, 20, 22, 24, 40, 11 }, 4, 10, xi.effect.MONKS_ROLL, xi.mod.SUBTLE_BLOW, xi.job.MNK }, - [xi.jobAbility.BEAST_ROLL ] = { { 4, 5, 7, 19, 8, 9, 11, 2, 13, 14, 23, 7 }, 3, 10, xi.effect.BEAST_ROLL, nil, xi.job.BST }, - [xi.jobAbility.SAMURAI_ROLL ] = { { 8, 32, 10, 12, 14, 4, 16, 20, 22, 24, 40, 5 }, 4, 10, xi.effect.SAMURAI_ROLL, xi.mod.STORETP, xi.job.SAM }, - [xi.jobAbility.EVOKERS_ROLL ] = { { 1, 1, 1, 1, 3, 2, 2, 2, 1, 3, 4, 1 }, 1, 1, xi.effect.EVOKERS_ROLL, xi.mod.REFRESH, xi.job.SMN }, - [xi.jobAbility.ROGUES_ROLL ] = { { 2, 2, 3, 4, 12, 5, 6, 6, 1, 8, 19, 6 }, 1, 6, xi.effect.ROGUES_ROLL, xi.mod.CRITHITRATE, xi.job.THF }, - [xi.jobAbility.WARLOCKS_ROLL ] = { { 2, 3, 4, 12, 5, 6, 7, 1, 8, 9, 15, 5 }, 1, 5, xi.effect.WARLOCKS_ROLL, xi.mod.MACC, xi.job.RDM }, - [xi.jobAbility.FIGHTERS_ROLL ] = { { 2, 2, 3, 4, 12, 5, 6, 7, 1, 9, 18, 6 }, 1, 6, xi.effect.FIGHTERS_ROLL, xi.mod.DOUBLE_ATTACK, xi.job.WAR }, - [xi.jobAbility.PUPPET_ROLL ] = { { 4, 5, 18, 7, 9, 10, 2, 11, 13, 15, 22, 8 }, 3, 8, xi.effect.PUPPET_ROLL, nil, xi.job.PUP }, - [xi.jobAbility.GALLANTS_ROLL ] = { { 600, 800, 2400, 900, 1100, 1200, 300, 1500, 1700, 1800, 3000, 500 }, 234, 500, xi.effect.GALLANTS_ROLL, xi.mod.DMG, xi.job.PLD }, - [xi.jobAbility.WIZARDS_ROLL ] = { { 4, 6, 8, 10, 25, 12, 14, 17, 2, 20, 30, 10 }, 2, 10, xi.effect.WIZARDS_ROLL, xi.mod.MATT, xi.job.BLM }, - [xi.jobAbility.DANCERS_ROLL ] = { { 3, 4, 12, 5, 6, 7, 1, 8, 9, 10, 16, 4 }, 2, 4, xi.effect.DANCERS_ROLL, xi.mod.REGEN, xi.job.DNC }, - [xi.jobAbility.SCHOLARS_ROLL ] = { { 2, 9, 3, 4, 5, 2, 6, 6, 7, 9, 14, 4 }, 1, 4, xi.effect.SCHOLARS_ROLL, xi.mod.CONSERVE_MP, xi.job.SCH }, - [xi.jobAbility.NATURALISTS_ROLL] = { { 6, 7, 15, 8, 9, 10, 5, 11, 12, 13, 20, -5 }, 1, 5, xi.effect.NATURALISTS_ROLL, xi.mod.ENH_MAGIC_DURATION, xi.job.GEO }, - [xi.jobAbility.RUNEISTS_ROLL ] = { { 4, 6, 8, 25, 10, 12, 14, 2, 17, 20, 30, -10 }, 2, 7, xi.effect.RUNEISTS_ROLL, xi.mod.MEVA, xi.job.RUN }, - [xi.jobAbility.BOLTERS_ROLL ] = { { 6, 6, 16, 8, 8, 10, 10, 12, 4, 14, 20, 0 }, 4, 0, xi.effect.BOLTERS_ROLL, xi.mod.MOVE_SPEED_STACKABLE, xi.job.NONE }, - [xi.jobAbility.CASTERS_ROLL ] = { { 6, 15, 7, 8, 9, 10, 5, 11, 12, 13, 20, -10 }, 3, 10, xi.effect.CASTERS_ROLL, xi.mod.FASTCAST, xi.job.NONE }, - [xi.jobAbility.COURSERS_ROLL ] = { { 2, 3, 11, 4, 5, 6, 7, 8, 1, 10, 12, -5 }, 1, 3, xi.effect.COURSERS_ROLL, nil, xi.job.NONE }, - [xi.jobAbility.BLITZERS_ROLL ] = { { -2, -3, -4, -11, -5, -6, -7, -8, -1, -10, -12, 3 }, -1, -3, xi.effect.BLITZERS_ROLL, xi.mod.DELAYP, xi.job.NONE }, - [xi.jobAbility.TACTICIANS_ROLL ] = { { 10, 10, 10, 10, 30, 10, 10, 0, 20, 20, 40, -10 }, 2, 10, xi.effect.TACTICIANS_ROLL, xi.mod.REGAIN, xi.job.NONE }, - [xi.jobAbility.ALLIES_ROLL ] = { { 2, 3, 20, 5, 7, 9, 11, 13, 15, 1, 25, -5 }, 1, 5, xi.effect.ALLIES_ROLL, xi.mod.SKILLCHAINBONUS, xi.job.NONE }, - [xi.jobAbility.MISERS_ROLL ] = { { 30, 50, 70, 90, 200, 110, 20, 130, 150, 170, 250, 0 }, 15, 0, xi.effect.MISERS_ROLL, xi.mod.SAVETP, xi.job.NONE }, - [xi.jobAbility.COMPANIONS_ROLL ] = { { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0 }, 10, 0, xi.effect.COMPANIONS_ROLL, nil, xi.job.NONE }, - [xi.jobAbility.AVENGERS_ROLL ] = { { 2, 2, 3, 12, 4, 5, 6, 1, 7, 9, 18, 6 }, 1, 0, xi.effect.AVENGERS_ROLL, xi.mod.COUNTER, xi.job.NONE }, + [xi.jobAbility.CORSAIRS_ROLL ] = { { 10, 11, 11, 12, 20, 13, 15, 16, 8, 17, 24, 6 }, 2, 0, xi.effect.CORSAIRS_ROLL, xi.mod.EXP_BONUS, xi.job.COR }, + [xi.jobAbility.NINJA_ROLL ] = { { 4, 5, 5, 14, 6, 7, 9, 2, 10, 11, 18, 6 }, 2, 6, xi.effect.NINJA_ROLL, xi.mod.EVA, xi.job.NIN }, + [xi.jobAbility.HUNTERS_ROLL ] = { { 10, 13, 15, 40, 18, 20, 25, 5, 27, 30, 50, 5 }, 5, 15, xi.effect.HUNTERS_ROLL, xi.mod.ACC, xi.job.RNG }, + [xi.jobAbility.CHAOS_ROLL ] = { { 6, 8, 9, 25, 11, 13, 16, 3, 17, 19, 31, 10 }, 3, 10, xi.effect.CHAOS_ROLL, xi.mod.ATTP, xi.job.DRK }, + [xi.jobAbility.MAGUSS_ROLL ] = { { 5, 20, 6, 8, 9, 3, 10, 13, 14, 15, 25, 5 }, 2, 8, xi.effect.MAGUSS_ROLL, xi.mod.MDEF, xi.job.BLU }, + [xi.jobAbility.HEALERS_ROLL ] = { { 3, 4, 12, 5, 6, 7, 1, 8, 9, 10, 16, 4 }, 3, 4, xi.effect.HEALERS_ROLL, xi.mod.CURE_POTENCY_RCVD, xi.job.WHM }, + [xi.jobAbility.DRACHEN_ROLL ] = { { 10, 13, 15, 40, 18, 20, 25, 5, 28, 30, 50, 15 }, 5, 15, xi.effect.DRACHEN_ROLL, nil, xi.job.DRG }, + [xi.jobAbility.CHORAL_ROLL ] = { { 13, 55, 17, 20, 25, 8, 30, 35, 40, 45, 65, 25 }, 4, 25, xi.effect.CHORAL_ROLL, xi.mod.SPELLINTERRUPT, xi.job.BRD }, + [xi.jobAbility.MONKS_ROLL ] = { { 8, 10, 32, 12, 14, 16, 4, 20, 22, 24, 40, 11 }, 4, 10, xi.effect.MONKS_ROLL, xi.mod.SUBTLE_BLOW, xi.job.MNK }, + [xi.jobAbility.BEAST_ROLL ] = { { 4, 5, 7, 19, 8, 9, 11, 2, 13, 14, 23, 7 }, 3, 10, xi.effect.BEAST_ROLL, nil, xi.job.BST }, + [xi.jobAbility.SAMURAI_ROLL ] = { { 8, 32, 10, 12, 14, 4, 16, 20, 22, 24, 40, 5 }, 4, 10, xi.effect.SAMURAI_ROLL, xi.mod.STORETP, xi.job.SAM }, + [xi.jobAbility.EVOKERS_ROLL ] = { { 1, 1, 1, 1, 3, 2, 2, 2, 1, 3, 4, 1 }, 1, 1, xi.effect.EVOKERS_ROLL, xi.mod.REFRESH, xi.job.SMN }, + [xi.jobAbility.ROGUES_ROLL ] = { { 2, 2, 3, 4, 12, 5, 6, 6, 1, 8, 19, 6 }, 1, 6, xi.effect.ROGUES_ROLL, xi.mod.CRITHITRATE, xi.job.THF }, + [xi.jobAbility.WARLOCKS_ROLL ] = { { 2, 3, 4, 12, 5, 6, 7, 1, 8, 9, 15, 5 }, 1, 5, xi.effect.WARLOCKS_ROLL, xi.mod.MACC, xi.job.RDM }, + [xi.jobAbility.FIGHTERS_ROLL ] = { { 2, 2, 3, 4, 12, 5, 6, 7, 1, 9, 18, 6 }, 1, 6, xi.effect.FIGHTERS_ROLL, xi.mod.DOUBLE_ATTACK, xi.job.WAR }, + [xi.jobAbility.PUPPET_ROLL ] = { { 4, 5, 18, 7, 9, 10, 2, 11, 13, 15, 22, 8 }, 3, 8, xi.effect.PUPPET_ROLL, nil, xi.job.PUP }, + [xi.jobAbility.GALLANTS_ROLL ] = { { 600, 800, 2400, 900, 1100, 1200, 300, 1500, 1700, 1800, 3000, 500 }, 234, 500, xi.effect.GALLANTS_ROLL, xi.mod.DMG, xi.job.PLD }, + [xi.jobAbility.WIZARDS_ROLL ] = { { 4, 6, 8, 10, 25, 12, 14, 17, 2, 20, 30, 10 }, 2, 10, xi.effect.WIZARDS_ROLL, xi.mod.MATT, xi.job.BLM }, + [xi.jobAbility.DANCERS_ROLL ] = { { 3, 4, 12, 5, 6, 7, 1, 8, 9, 10, 16, 4 }, 2, 4, xi.effect.DANCERS_ROLL, xi.mod.REGEN, xi.job.DNC }, + [xi.jobAbility.SCHOLARS_ROLL ] = { { 2, 9, 3, 4, 5, 2, 6, 6, 7, 9, 14, 4 }, 1, 4, xi.effect.SCHOLARS_ROLL, xi.mod.CONSERVE_MP, xi.job.SCH }, + [xi.jobAbility.NATURALISTS_ROLL] = { { 6, 7, 15, 8, 9, 10, 5, 11, 12, 13, 20, -5 }, 1, 5, xi.effect.NATURALISTS_ROLL, xi.mod.ENH_MAGIC_DURATION, xi.job.GEO }, + [xi.jobAbility.RUNEISTS_ROLL ] = { { 4, 6, 8, 25, 10, 12, 14, 2, 17, 20, 30, -10 }, 2, 7, xi.effect.RUNEISTS_ROLL, xi.mod.MEVA, xi.job.RUN }, + [xi.jobAbility.BOLTERS_ROLL ] = { { 6, 6, 16, 8, 8, 10, 10, 12, 4, 14, 20, 0 }, 4, 0, xi.effect.BOLTERS_ROLL, xi.mod.MOVE_SPEED_BOLTERS_ROLL, xi.job.NONE }, + [xi.jobAbility.CASTERS_ROLL ] = { { 6, 15, 7, 8, 9, 10, 5, 11, 12, 13, 20, -10 }, 3, 10, xi.effect.CASTERS_ROLL, xi.mod.FASTCAST, xi.job.NONE }, + [xi.jobAbility.COURSERS_ROLL ] = { { 2, 3, 11, 4, 5, 6, 7, 8, 1, 10, 12, -5 }, 1, 3, xi.effect.COURSERS_ROLL, nil, xi.job.NONE }, + [xi.jobAbility.BLITZERS_ROLL ] = { { -2, -3, -4, -11, -5, -6, -7, -8, -1, -10, -12, 3 }, -1, -3, xi.effect.BLITZERS_ROLL, xi.mod.DELAYP, xi.job.NONE }, + [xi.jobAbility.TACTICIANS_ROLL ] = { { 10, 10, 10, 10, 30, 10, 10, 0, 20, 20, 40, -10 }, 2, 10, xi.effect.TACTICIANS_ROLL, xi.mod.REGAIN, xi.job.NONE }, + [xi.jobAbility.ALLIES_ROLL ] = { { 2, 3, 20, 5, 7, 9, 11, 13, 15, 1, 25, -5 }, 1, 5, xi.effect.ALLIES_ROLL, xi.mod.SKILLCHAINBONUS, xi.job.NONE }, + [xi.jobAbility.MISERS_ROLL ] = { { 30, 50, 70, 90, 200, 110, 20, 130, 150, 170, 250, 0 }, 15, 0, xi.effect.MISERS_ROLL, xi.mod.SAVETP, xi.job.NONE }, + [xi.jobAbility.COMPANIONS_ROLL ] = { { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 0 }, 10, 0, xi.effect.COMPANIONS_ROLL, nil, xi.job.NONE }, + [xi.jobAbility.AVENGERS_ROLL ] = { { 2, 2, 3, 12, 4, 5, 6, 1, 7, 9, 18, 6 }, 1, 0, xi.effect.AVENGERS_ROLL, xi.mod.COUNTER, xi.job.NONE }, } -- Check for xi.mod.PHANTOM_ROLL Value and apply non-stack logic. diff --git a/src/map/entities/battleentity.cpp b/src/map/entities/battleentity.cpp index e48e73196a9..fdcb47c1535 100644 --- a/src/map/entities/battleentity.cpp +++ b/src/map/entities/battleentity.cpp @@ -256,32 +256,42 @@ uint8 CBattleEntity::GetSpeed() } // Gear penalties, Bolters Roll. - float additiveMods = static_cast(getMod(Mod::MOVE_SPEED_STACKABLE)); + uint8 additiveMods = static_cast(getMod(Mod::MOVE_SPEED_STACKABLE)); - // Quickening and Mazurka. They share a cap. Additive. - float effectAdditiveBonus = std::clamp(getMod(Mod::MOVE_SPEED_QUICKENING) + getMod(Mod::MOVE_SPEED_MAZURKA), 0.0f, 10.0f); + // Gravity and Curse. They seem additive to each other and the sum seems to be multiplicative. + float weightFactor = std::clamp(1.0f - static_cast(getMod(Mod::MOVE_SPEED_WEIGHT_PENALTY)) / 100.0f, 0.1f, 1.0f); // Flee. float fleeFactor = std::clamp(1.0f + static_cast(getMod(Mod::MOVE_SPEED_FLEE)) / 100.0f, 1.0f, 2.0f); + // Cheer KI's + float cheerFactor = (99.0f + static_cast(getMod(Mod::MOVE_SPEED_CHEER))) / 99.0f; + + // Bolter's Roll. Additive + uint8 boltersRollEffect = static_cast(getMod(Mod::MOVE_SPEED_BOLTERS_ROLL)); + // Positive movement speed from gear and from Atmas. Only highest applies. Multiplicative to base speed. - float gearBonus = 1.0f; + float gearFactor = 1.0f; if (objtype == TYPE_PC) { - gearBonus = std::clamp(1.0f + static_cast(getMaxGearMod(Mod::MOVE_SPEED_GEAR_BONUS)) / 100.0f, 1.0f, 1.25f); + gearFactor = std::clamp(1.0f + static_cast(getMaxGearMod(Mod::MOVE_SPEED_GEAR_BONUS)) / 100.0f, 1.0f, 1.25f); } - // Gravity and Curse. They seem additive to each other and the sum seems to be multiplicative. - float weightPenalties = std::clamp(1.0f - static_cast(getMod(Mod::MOVE_SPEED_WEIGHT_PENALTY)) / 100.0f, 0.1f, 1.0f); + // Quickening and Mazurka. They share a cap. Additive. + uint8 mazurkaQuickeningEffect = std::clamp(getMod(Mod::MOVE_SPEED_QUICKENING) + getMod(Mod::MOVE_SPEED_MAZURKA), 0, 10); // We have all the modifiers needed. Calculate final speed. - // Final speed = (base speed + addtive bonuses/penalties) * flee * positive bonus from gear * weight penalties - float modifiedSpeed = static_cast(baseSpeed + additiveMods + effectAdditiveBonus) * fleeFactor * gearBonus * weightPenalties; - - outputSpeed = static_cast(modifiedSpeed); - - // Set cap. + // This MUST BE DONE IN THIS ORDER. Using uint8 data type, we use that to floor. + outputSpeed = baseSpeed + additiveMods; + outputSpeed = outputSpeed * weightFactor; + outputSpeed = outputSpeed * fleeFactor; + outputSpeed = outputSpeed * cheerFactor; + outputSpeed = outputSpeed + boltersRollEffect; + outputSpeed = outputSpeed * gearFactor; + outputSpeed = outputSpeed + mazurkaQuickeningEffect; + + // Set cap (Default 80). outputSpeed = std::clamp(outputSpeed, 0, 80 + settings::get("map.SPEED_MOD")); // Speed cap can be bypassed. Ex. Feast of swords. GM speed. diff --git a/src/map/modifier.h b/src/map/modifier.h index 5b750cf8339..eef25ba4eb7 100644 --- a/src/map/modifier.h +++ b/src/map/modifier.h @@ -272,15 +272,17 @@ enum class Mod TWOHAND_HASTE_ABILITY = 217, // Haste (and Slow) from abilities - 10000 base, 375 = 3.75% - Only applies to auto attacks when using two handed weapons, additive to HASTE_ABILITY SPELLINTERRUPT = 168, // % Spell Interruption Rate - // New movement speed modifiers. - MOVE_SPEED_OVERRIDE = 169, // Modifier used to overide regular speed caps. (GM speed and Feast of Swords) - MOVE_SPEED_STACKABLE = 75, // Gear movement speed penalties, flee bonus, etc. - MOVE_SPEED_GEAR_BONUS = 76, // Gear movement speed bonuses. DOES NOT STACK with each other, only highest applies. - MOVE_SPEED_WEIGHT_PENALTY = 77, // For Gravity and curse. - MOVE_SPEED_QUICKENING = 78, // Jig, spreinter shoes, etc. Only highest of Mazurka OR quickening will take effect. - MOVE_SPEED_MAZURKA = 79, // Song movement speed. Only highest of Mazurka OR quickening will take effect. - MOVE_SPEED_FLEE = 1085, // Flee applies a separate multiplier to speed. + // Movement speed modifiers in use order. MOUNT_MOVE = 972, // % Mount Movement Speed + MOVE_SPEED_STACKABLE = 75, // Additive modifier. Applied before multipliers. Gear movement speed penalties. + MOVE_SPEED_WEIGHT_PENALTY = 77, // Multiplicative modifier. For Gravity and curse. + MOVE_SPEED_FLEE = 1085, // Multiplicative modifier. + MOVE_SPEED_CHEER = 1087, // Multiplicative modifier from "cheer" type KI's. + MOVE_SPEED_GEAR_BONUS = 76, // Multiplicative modifier. Gear movement speed bonuses. DOES NOT STACK with each other, only highest applies. + MOVE_SPEED_QUICKENING = 78, // Additive modifier. Applied after multipliers. Jig, spreinter shoes, etc. Shares cap with Mazurka. + MOVE_SPEED_MAZURKA = 79, // Additive modifier. Applied after multipliers. Song movement speed. Shares cap with Quickening, + MOVE_SPEED_BOLTERS_ROLL = 1086, // Additive modifier. Applied after multipliers. + MOVE_SPEED_OVERRIDE = 169, // Modifier used to overide regular speed caps. (GM speed and Feast of Swords) FASTCAST = 170, // Increases Spell Cast Time (TRAIT) UFASTCAST = 407, // uncapped fast cast @@ -1024,7 +1026,7 @@ enum class Mod // The spares take care of finding the next ID to use so long as we don't forget to list IDs that have been freed up by refactoring. // 570 through 825 used by WS DMG mods these are not spares. // - // SPARE IDs: 1086 and onward + // SPARE IDs: 1088 and onward }; // temporary workaround for using enum class as unordered_map key until compilers support it