Skip to content

Commit

Permalink
Add new modifier for flee
Browse files Browse the repository at this point in the history
  • Loading branch information
Xaver-DaRed committed Sep 3, 2024
1 parent ca22204 commit b254442
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 18 deletions.
3 changes: 1 addition & 2 deletions scripts/effects/flee.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
18 changes: 11 additions & 7 deletions scripts/enum/mod.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
19 changes: 10 additions & 9 deletions src/map/modifier.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit b254442

Please sign in to comment.