mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-15 20:22:07 +00:00
Small adjustment to the new stamcrit unit test Co-authored-by: Bloop <13398309+vinylspiders@users.noreply.github.com> Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
26 lines
1.3 KiB
Plaintext
26 lines
1.3 KiB
Plaintext
/// Tests 100 stamina damage = stamcrit
|
|
/datum/unit_test/stamcrit
|
|
priority = TEST_LONGER
|
|
|
|
/datum/unit_test/stamcrit/Run()
|
|
var/mob/living/carbon/human/consistent/tider = allocate(__IMPLIED_TYPE__)
|
|
tider.stamina_regen_time = 0.2 SECONDS
|
|
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 [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")
|
|
|
|
/// Tests stamina regen after the set time
|
|
/datum/unit_test/stam_regen
|
|
priority = TEST_LONGER
|
|
|
|
/datum/unit_test/stam_regen/Run()
|
|
var/mob/living/carbon/human/consistent/tider = allocate(__IMPLIED_TYPE__)
|
|
tider.stamina_regen_time = 0.2 SECONDS
|
|
tider.adjustStaminaLoss(50)
|
|
sleep(tider.stamina_regen_time * 2)
|
|
TEST_ASSERT_EQUAL(tider.getStaminaLoss(), 0, "Stamina should be fully regenerated after regen time")
|