fixes
This commit is contained in:
@@ -280,6 +280,12 @@
|
|||||||
/datum/config_entry/number/movedelay/sprint_speed_increase
|
/datum/config_entry/number/movedelay/sprint_speed_increase
|
||||||
config_entry_value = 1
|
config_entry_value = 1
|
||||||
|
|
||||||
|
/datum/config_entry/number/movedelay/sprint_max_tiles_increase
|
||||||
|
config_entry_value = 5
|
||||||
|
|
||||||
|
/datum/config_entry/number/movedelay/sprint_absolute_max_tiles
|
||||||
|
config_entry_value = 13
|
||||||
|
|
||||||
/datum/config_entry/number/movedelay/sprint_buffer_max
|
/datum/config_entry/number/movedelay/sprint_buffer_max
|
||||||
config_entry_value = 24
|
config_entry_value = 24
|
||||||
|
|
||||||
|
|||||||
@@ -11,11 +11,6 @@
|
|||||||
|
|
||||||
/mob/living/carbon/human/movement_delay()
|
/mob/living/carbon/human/movement_delay()
|
||||||
. = ..()
|
. = ..()
|
||||||
if(CHECK_MOBILITY(src, MOBILITY_STAND) && m_intent == MOVE_INTENT_RUN && (combat_flags & COMBAT_FLAG_SPRINT_ACTIVE))
|
|
||||||
var/static/datum/config_entry/number/movedelay/sprint_speed_increase/SSI
|
|
||||||
if(!SSI)
|
|
||||||
SSI = CONFIG_GET_ENTRY(number/movedelay/sprint_speed_increase)
|
|
||||||
. -= SSI.config_entry_value
|
|
||||||
if (m_intent == MOVE_INTENT_WALK && HAS_TRAIT(src, TRAIT_SPEEDY_STEP))
|
if (m_intent == MOVE_INTENT_WALK && HAS_TRAIT(src, TRAIT_SPEEDY_STEP))
|
||||||
. -= 1.5
|
. -= 1.5
|
||||||
|
|
||||||
|
|||||||
@@ -173,4 +173,6 @@
|
|||||||
else
|
else
|
||||||
remove_movespeed_modifier(/datum/movespeed_modifier/limbless)
|
remove_movespeed_modifier(/datum/movespeed_modifier/limbless)
|
||||||
|
|
||||||
|
update_movespeed()
|
||||||
|
|
||||||
return mobility_flags
|
return mobility_flags
|
||||||
|
|||||||
@@ -29,6 +29,7 @@
|
|||||||
if(combat_flags & COMBAT_FLAG_SPRINT_ACTIVE)
|
if(combat_flags & COMBAT_FLAG_SPRINT_ACTIVE)
|
||||||
return
|
return
|
||||||
ENABLE_BITFIELD(combat_flags, COMBAT_FLAG_SPRINT_ACTIVE)
|
ENABLE_BITFIELD(combat_flags, COMBAT_FLAG_SPRINT_ACTIVE)
|
||||||
|
add_movespeed_modifier(/datum/movespeed_modifier/sprinting)
|
||||||
if(update_icon)
|
if(update_icon)
|
||||||
update_sprint_icon()
|
update_sprint_icon()
|
||||||
|
|
||||||
@@ -36,6 +37,7 @@
|
|||||||
if(!(combat_flags & COMBAT_FLAG_SPRINT_ACTIVE) || (combat_flags & COMBAT_FLAG_SPRINT_FORCED))
|
if(!(combat_flags & COMBAT_FLAG_SPRINT_ACTIVE) || (combat_flags & COMBAT_FLAG_SPRINT_FORCED))
|
||||||
return
|
return
|
||||||
DISABLE_BITFIELD(combat_flags, COMBAT_FLAG_SPRINT_ACTIVE)
|
DISABLE_BITFIELD(combat_flags, COMBAT_FLAG_SPRINT_ACTIVE)
|
||||||
|
remove_movespeed_modifier(/datum/movespeed_modifier/sprinting)
|
||||||
if(update_icon)
|
if(update_icon)
|
||||||
update_sprint_icon()
|
update_sprint_icon()
|
||||||
|
|
||||||
|
|||||||
@@ -38,6 +38,12 @@ Key procs
|
|||||||
|
|
||||||
/// Multiplicative slowdown
|
/// Multiplicative slowdown
|
||||||
var/multiplicative_slowdown = 0
|
var/multiplicative_slowdown = 0
|
||||||
|
/// Next two variables depend on this: Should we do advanced calculations?
|
||||||
|
var/complex_calculation = FALSE
|
||||||
|
/// Absolute max tiles we can boost to
|
||||||
|
var/absolute_max_tiles_per_second
|
||||||
|
/// Max tiles per second we can boost
|
||||||
|
var/max_tiles_per_second_boost
|
||||||
|
|
||||||
/// Movetypes this applies to
|
/// Movetypes this applies to
|
||||||
var/movetypes = ALL
|
var/movetypes = ALL
|
||||||
@@ -53,6 +59,16 @@ Key procs
|
|||||||
if(!id)
|
if(!id)
|
||||||
id = "[type]" //We turn the path into a string.
|
id = "[type]" //We turn the path into a string.
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Returns new multiplicative movespeed after modification.
|
||||||
|
*/
|
||||||
|
/datum/movespeed_modifier/proc/apply_multiplicative(existing, mob/target)
|
||||||
|
if(!complex_calculation || (multiplicative_slowdown > 0)) // we aren't limiting how much things can slowdown.. yet.
|
||||||
|
return existing + multiplicative_slowdown
|
||||||
|
var/current_tiles = 10 / existing
|
||||||
|
var/minimum_speed = 10 / min(current_tiles + max_tiles_per_second_boost, max(current_tiles, absolute_max_tiles_per_second))
|
||||||
|
return max(minimum_speed, existing + multiplicative_slowdown)
|
||||||
|
|
||||||
GLOBAL_LIST_EMPTY(movespeed_modification_cache)
|
GLOBAL_LIST_EMPTY(movespeed_modification_cache)
|
||||||
|
|
||||||
/// Grabs a STATIC MODIFIER datum from cache. YOU MUST NEVER EDIT THESE DATUMS, OR IT WILL AFFECT ANYTHING ELSE USING IT TOO!
|
/// Grabs a STATIC MODIFIER datum from cache. YOU MUST NEVER EDIT THESE DATUMS, OR IT WILL AFFECT ANYTHING ELSE USING IT TOO!
|
||||||
@@ -198,7 +214,7 @@ GLOBAL_LIST_EMPTY(movespeed_modification_cache)
|
|||||||
conflict_tracker[conflict] = amt
|
conflict_tracker[conflict] = amt
|
||||||
else
|
else
|
||||||
continue
|
continue
|
||||||
. += amt
|
. = M.apply_multiplicative(., src)
|
||||||
var/old = cached_multiplicative_slowdown // CITAEDL EDIT - To make things a bit less jarring, when in situations where
|
var/old = cached_multiplicative_slowdown // CITAEDL EDIT - To make things a bit less jarring, when in situations where
|
||||||
// your delay decreases, "give" the delay back to the client
|
// your delay decreases, "give" the delay back to the client
|
||||||
cached_multiplicative_slowdown = .
|
cached_multiplicative_slowdown = .
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
/datum/movespeed_modifier/jetpack
|
/datum/movespeed_modifier/jetpack
|
||||||
conflicts_with = MOVE_CONFLICT_JETPACK
|
conflicts_with = MOVE_CONFLICT_JETPACK
|
||||||
movetypes = FLOATING
|
movetypes = FLOATING
|
||||||
|
multiplicative_slowdown = -1
|
||||||
|
|
||||||
/datum/movespeed_modifier/jetpack/cybernetic
|
/datum/movespeed_modifier/jetpack/cybernetic
|
||||||
multiplicative_slowdown = -0.5
|
multiplicative_slowdown = -1.25
|
||||||
|
|
||||||
/datum/movespeed_modifier/jetpack/fullspeed
|
/datum/movespeed_modifier/jetpack/fullspeed
|
||||||
multiplicative_slowdown = -2
|
multiplicative_slowdown = -1.5
|
||||||
|
|
||||||
/datum/movespeed_modifier/die_of_fate
|
/datum/movespeed_modifier/die_of_fate
|
||||||
multiplicative_slowdown = 1
|
multiplicative_slowdown = 1
|
||||||
|
|||||||
@@ -120,3 +120,32 @@
|
|||||||
/datum/movespeed_modifier/active_block
|
/datum/movespeed_modifier/active_block
|
||||||
variable = TRUE
|
variable = TRUE
|
||||||
flags = IGNORE_NOSLOW
|
flags = IGNORE_NOSLOW
|
||||||
|
|
||||||
|
/datum/movespeed_modifier/sprinting
|
||||||
|
flags = IGNORE_NOSLOW
|
||||||
|
blacklisted_movetypes = FLOATING
|
||||||
|
required_mobility_flags = MOBILITY_STAND
|
||||||
|
priority = -100
|
||||||
|
|
||||||
|
/// for speed reasons this is sorta copypasty.
|
||||||
|
/datum/movespeed_modifier/sprinting/apply_multiplicative(existing, mob/target)
|
||||||
|
. = existing
|
||||||
|
if(target.m_intent != MOVE_INTENT_RUN)
|
||||||
|
return
|
||||||
|
if(isliving(target))
|
||||||
|
var/mob/living/L = target
|
||||||
|
if(!(L.mobility_flags & MOBILITY_STAND))
|
||||||
|
return
|
||||||
|
var/static/datum/config_entry/number/movedelay/sprint_max_tiles_increase/SSMTI
|
||||||
|
if(!SSMTI)
|
||||||
|
SSMTI = CONFIG_GET_ENTRY(number/movedelay/sprint_max_tiles_increase)
|
||||||
|
var/static/datum/config_entry/number/movedelay/sprint_speed_increase/SSI
|
||||||
|
if(!SSI)
|
||||||
|
SSI = CONFIG_GET_ENTRY(number/movedelay/sprint_speed_increase)
|
||||||
|
var/static/datum/config_entry/number/movedelay/sprint_absolute_max_tiles/SAMT
|
||||||
|
if(!SAMT)
|
||||||
|
SAMT = CONFIG_GET_ENTRY(number/movedelay/sprint_absolute_max_tiles)
|
||||||
|
var/current_tiles = 10 / existing
|
||||||
|
var/minimum_speed = 10 / min(SAMT.config_entry_value, ((current_tiles) + SSMTI.config_entry_value))
|
||||||
|
. = max(minimum_speed, (existing - SSI.config_entry_value))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user