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:
Bloop
2024-06-14 01:47:51 -04:00
committed by GitHub
parent 6fea9d999d
commit 6f6ec555fb
+4 -3
View File
@@ -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")