[MIRROR] Adds an action speed modifier system (#522)

* Adds an action speed modifier system (#53023)

* Adds an action speed modifier system

Co-authored-by: Qustinnus <Floydje123@hotmail.com>
This commit is contained in:
SkyratBot
2020-08-26 01:40:42 +02:00
committed by GitHub
co-authored by Qustinnus
parent 5726fa5a21
commit dc3663a8d1
16 changed files with 232 additions and 40 deletions
-14
View File
@@ -984,20 +984,6 @@
set_usable_hands(usable_hands - 1)
/mob/living/carbon/do_after_coefficent()
. = ..()
var/datum/component/mood/mood = src.GetComponent(/datum/component/mood) //Currently, only carbons or higher use mood, move this once that changes.
if(mood)
switch(mood.sanity) //Alters do_after delay based on how sane you are
if(-INFINITY to SANITY_DISTURBED)
. *= 1.25
if(SANITY_NEUTRAL to INFINITY)
. *= 0.90
for(var/i in status_effects)
var/datum/status_effect/S = i
. *= S.interact_speed_modifier()
/mob/living/carbon/proc/create_internal_organs()
for(var/X in internal_organs)
var/obj/item/organ/I = X
@@ -1158,10 +1158,6 @@
riding_datum.handle_vehicle_layer()
. = ..(target, force, check_loc)
/mob/living/carbon/human/do_after_coefficent()
. = ..()
. *= physiology.do_after_speed
/mob/living/carbon/human/updatehealth()
. = ..()
dna?.species.spec_updatehealth(src)
@@ -23,7 +23,5 @@
var/hunger_mod = 1 //% of hunger rate taken per tick.
var/do_after_speed = 1 //Speed mod for do_after. Lower is better. If temporarily adjusting, please only modify using *= and /=, so you don't interrupt other calculations.
/datum/physiology/New()
armor = new
+1
View File
@@ -77,6 +77,7 @@
set_nutrition(rand(NUTRITION_LEVEL_START_MIN, NUTRITION_LEVEL_START_MAX))
. = ..()
update_config_movespeed()
initialize_actionspeed()
update_movespeed(TRUE)
/**
+6
View File
@@ -28,6 +28,12 @@
var/list/movespeed_mod_immunities //Lazy list, see mob_movespeed.dm
/// The calculated mob speed slowdown based on the modifiers list
var/cached_multiplicative_slowdown
/// List of action speed modifiers applying to this mob
var/list/actionspeed_modification //Lazy list, see mob_movespeed.dm
/// List of action speed modifiers ignored by this mob. List -> List (id) -> List (sources)
var/list/actionspeed_mod_immunities //Lazy list, see mob_movespeed.dm
/// The calculated mob action speed slowdown based on the modifiers list
var/cached_multiplicative_actions_slowdown
/// List of action hud items the user has
var/list/datum/action/actions
/// A special action? No idea why this lives here