Skip to content

Commit

Permalink
[MIRROR] Adds Oxyloss KO unit test [MDB IGNORE] (#24480)
Browse files Browse the repository at this point in the history
* Adds Oxyloss KO unit test (#79112)

## About The Pull Request

Adds a unit test ensuring mobs over 50 oxyloss pass out correctly (and
likewise, mobs below 50 wake up).

See #79034

* Adds Oxyloss KO unit test

---------

Co-authored-by: MrMelbert <[email protected]>
  • Loading branch information
2 people authored and FFMirrorBot committed Oct 21, 2023
1 parent a9d96ac commit 9ab1561
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
1 change: 1 addition & 0 deletions code/modules/unit_tests/_unit_tests.dm
Original file line number Diff line number Diff line change
Expand Up @@ -196,6 +196,7 @@
#include "organ_set_bonus.dm"
#include "organs.dm"
#include "outfit_sanity.dm"
#include "oxyloss_suffocation.dm"
#include "paintings.dm"
#include "pills.dm"
#include "plane_double_transform.dm"
Expand Down
10 changes: 10 additions & 0 deletions code/modules/unit_tests/oxyloss_suffocation.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/// Test getting over a certain threshold of oxy damage results in KO
/datum/unit_test/oxyloss_suffocation

/datum/unit_test/oxyloss_suffocation/Run()
var/mob/living/carbon/human/dummy = allocate(/mob/living/carbon/human/consistent)

dummy.setOxyLoss(75)
TEST_ASSERT(HAS_TRAIT_FROM(dummy, TRAIT_KNOCKEDOUT, OXYLOSS_TRAIT), "Dummy should have been knocked out from taking oxy damage.")
dummy.setOxyLoss(0)
TEST_ASSERT(!HAS_TRAIT_FROM(dummy, TRAIT_KNOCKEDOUT, OXYLOSS_TRAIT), "Dummy should have woken up from KO when healing to 0 oxy damage.")

0 comments on commit 9ab1561

Please sign in to comment.