elementize pet collars (#29209)

This commit is contained in:
warriorstar-orion
2025-05-07 22:31:17 +00:00
committed by GitHub
parent c74541cf8d
commit 58967ee12e
32 changed files with 255 additions and 167 deletions
+1
View File
@@ -47,6 +47,7 @@
#include "test_subsystem_init.dm"
#include "test_subsystem_metric_sanity.dm"
#include "test_timer_sanity.dm"
#include "test_wears_collar.dm"
#endif
#ifdef MAP_TESTS
+24
View File
@@ -0,0 +1,24 @@
/datum/game_test/wears_collar/Run()
var/datum/test_puppeteer/player = new(src)
var/obj/chair = player.spawn_obj_nearby(/obj/structure/chair)
var/mob/corgi = player.spawn_mob_nearby(/mob/living/simple_animal/pet/dog/corgi)
chair.buckle_mob(corgi) // So it doesn't wander off
var/obj/item/petcollar/collar = player.spawn_obj_in_hand(/obj/item/petcollar)
player.click_on(corgi)
TEST_ASSERT(collar in corgi, "Collar not placed on corgi")
TEST_ASSERT_EQUAL(corgi.name, "corgi", "animal name not preserved")
qdel(collar)
qdel(corgi)
corgi = player.spawn_mob_nearby(/mob/living/simple_animal/pet/dog/corgi)
chair.buckle_mob(corgi) // So it doesn't wander off
collar = player.spawn_obj_in_hand(/obj/item/petcollar)
collar.tagname = "Bucephalus"
player.click_on(corgi)
TEST_ASSERT(collar in corgi, "Collar not placed on corgi")
TEST_ASSERT_EQUAL(corgi.name, "Bucephalus", "animal name not changed")