mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-18 11:36:24 +01:00
Small adjustment to the new stamcrit unit test (#83931)
## About The Pull Request Not all downstreams have 100 hp as `maxHealth`, so this makes the test work in those cases by no longer having it be hardcoded. ## Why It's Good For The Game More universal unit tests. ## Changelog Nothing player facing.
This commit is contained in:
@@ -5,10 +5,11 @@
|
||||
/datum/unit_test/stamcrit/Run()
|
||||
var/mob/living/carbon/human/consistent/tider = allocate(__IMPLIED_TYPE__)
|
||||
tider.stamina_regen_time = 0.2 SECONDS
|
||||
tider.adjustStaminaLoss(99)
|
||||
TEST_ASSERT(!tider.has_status_effect(/datum/status_effect/incapacitating/stamcrit), "Stamcrit should not be applied at 99 stamina damage")
|
||||
var/stamloss_to_reach_crit_threshold = tider.maxHealth
|
||||
tider.adjustStaminaLoss(stamloss_to_reach_crit_threshold - 1)
|
||||
TEST_ASSERT(!tider.has_status_effect(/datum/status_effect/incapacitating/stamcrit), "Stamcrit should not be applied at [stamloss_to_reach_crit_threshold - 1] stamina damage")
|
||||
tider.adjustStaminaLoss(1)
|
||||
TEST_ASSERT(tider.has_status_effect(/datum/status_effect/incapacitating/stamcrit), "Stamcrit should be applied at 100 stamina damage")
|
||||
TEST_ASSERT(tider.has_status_effect(/datum/status_effect/incapacitating/stamcrit), "Stamcrit should be applied at [stamloss_to_reach_crit_threshold] stamina damage")
|
||||
sleep(tider.stamina_regen_time * 2)
|
||||
TEST_ASSERT(!tider.has_status_effect(/datum/status_effect/incapacitating/stamcrit), "Stamcrit should be removed after regen time")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user