[MIRROR] Makes Lesser Form into one ability & unit tests it [MDB IGNORE] (#19521)

* Makes Lesser Form into one ability & unit tests it

* Update headcrab.dm

---------

Co-authored-by: Jacquerel <hnevard@gmail.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
This commit is contained in:
SkyratBot
2023-03-10 07:08:19 +01:00
committed by GitHub
parent cba75a0e0b
commit 37953d4bcf
19 changed files with 178 additions and 98 deletions
+1
View File
@@ -137,6 +137,7 @@
#include "json_savefile_importing.dm"
#include "keybinding_init.dm"
#include "knockoff_component.dm"
#include "lesserform.dm"
#include "limbsanity.dm"
#include "load_map_security.dm"
#include "machine_disassembly.dm"
+23
View File
@@ -0,0 +1,23 @@
/// Unit test to ensure that changelings can consistently turn from monkeys to humans and back
/datum/unit_test/lesserform
/datum/unit_test/lesserform/Run()
var/mob/living/carbon/human/changeling = allocate(/mob/living/carbon/human/consistent)
changeling.mind_initialize()
var/datum/mind/mind = changeling.mind
var/datum/antagonist/changeling/changeling_datum = mind.add_antag_datum(/datum/antagonist/changeling)
changeling_datum.adjust_chemicals(INFINITY) // We don't care about how many chemicals they have
var/datum/action/changeling/lesserform/transform_ability = new(changeling)
transform_ability.transform_instantly = TRUE
transform_ability.Grant(changeling)
transform_ability.Trigger()
TEST_ASSERT(ismonkey(changeling), "Changeling failed to turn into a monkey after voluntarily transforming using lesser form.")
changeling.humanize(instant = TRUE)
transform_ability.Trigger()
TEST_ASSERT(ismonkey(changeling), "Changeling failed to turn into a monkey after involuntarily being made into a human.")
transform_ability.Trigger()
TEST_ASSERT(!ismonkey(changeling), "Changeling failed to stop being a monkey after voluntarily transforming using lesser form.")
changeling.monkeyize(instant = TRUE)
transform_ability.Trigger()
TEST_ASSERT(!ismonkey(changeling), "Changeling failed to stop being a monkey after being involuntarily turned into one.")