/mob/living/proc/Life(delta_time) (#55534)

- Makes `/mob/living/proc/Life` and most related procs use `delta_time`
- Procs that had snowflaked timing systems, such as breathing, addiction, and advanced diseases were left unchanged.
This commit is contained in:
TemporalOroboros
2021-02-19 10:24:20 -05:00
committed by GitHub
parent 690d26004d
commit e2e7ccdbdc
198 changed files with 2965 additions and 2837 deletions
+4 -4
View File
@@ -9,7 +9,7 @@
/datum/unit_test/metabolization/proc/test_reagent(mob/living/carbon/C, reagent_type)
C.reagents.add_reagent(reagent_type, 10)
C.reagents.metabolize(C, can_overdose = TRUE)
C.reagents.metabolize(C, SSMOBS_DT, 0, can_overdose = TRUE)
C.reagents.clear_reagents()
/datum/unit_test/metabolization/Destroy()
@@ -24,15 +24,15 @@
var/datum/reagent/drug/methamphetamine/meth = /datum/reagent/drug/methamphetamine
// Give them enough meth to be consumed in 2 metabolizations
pill.reagents.add_reagent(meth, initial(meth.metabolization_rate) * 1.9)
pill.reagents.add_reagent(meth, 1.9 * initial(meth.metabolization_rate) * SSMOBS_DT)
pill.attack(user, user)
user.Life()
user.Life(SSMOBS_DT)
TEST_ASSERT(user.reagents.has_reagent(meth), "User does not have meth in their system after consuming it")
TEST_ASSERT(user.has_movespeed_modifier(/datum/movespeed_modifier/reagent/methamphetamine), "User consumed meth, but did not gain movespeed modifier")
user.Life()
user.Life(SSMOBS_DT)
TEST_ASSERT(!user.reagents.has_reagent(meth), "User still has meth in their system when it should've finished metabolizing")
TEST_ASSERT(!user.has_movespeed_modifier(/datum/movespeed_modifier/reagent/methamphetamine), "User still has movespeed modifier despite not containing any more meth")
+1 -1
View File
@@ -5,6 +5,6 @@
TEST_ASSERT_EQUAL(human.has_reagent(/datum/reagent/iron), FALSE, "Human somehow has iron before taking pill")
pill.attack(human, human)
human.Life()
human.Life(SSMOBS_DT)
TEST_ASSERT(human.has_reagent(/datum/reagent/iron), "Human doesn't have iron after taking pill")
@@ -25,7 +25,7 @@
drink.reagents.add_reagent(/datum/reagent/phlogiston, 10)
drink.attack(human, human)
TEST_ASSERT_EQUAL(human.fire_stacks, 1, "Human does not have fire stacks after taking phlogiston")
human.Life()
human.Life(SSMOBS_DT)
TEST_ASSERT(human.fire_stacks > 1, "Human fire stacks did not increase after life tick")
// TOUCH
+2 -2
View File
@@ -17,9 +17,9 @@
TEST_ASSERT_EQUAL(human.reagents.has_reagent(/datum/reagent/consumable/ketchup), FALSE, "Human body has ketchup after eating it should only be in the stomach")
//Give them meth and let it kick in
pill.reagents.add_reagent(meth, initial(meth.metabolization_rate) * 1.9)
pill.reagents.add_reagent(meth, 1.9 * initial(meth.metabolization_rate) * SSMOBS_DT)
pill.attack(human, human)
human.Life()
human.Life(SSMOBS_DT)
TEST_ASSERT(human.reagents.has_reagent(meth), "Human body does not have meth after life tick")
TEST_ASSERT(human.has_movespeed_modifier(/datum/movespeed_modifier/reagent/methamphetamine), "Human consumed meth, but did not gain movespeed modifier")