Add a unit test to check that maploaded simple/basic mobs are in an environment they can survive in. (#82180)

## About The Pull Request
I've recently noticed that the maploaded penguins from the snowdin away
mission were dying from unsafe atmos/temperature. This sparked the idea
of making a (focus only) unit test that would prevent this sort of
issues from happening.

This PR also implements the usage of the `atmos_requirements` and
`body_temp_sensitive` elements for simple animals too, cutting down the
copypaste.

## Why It's Good For The Game
More unit tests to make sure things are done correctly.

## Changelog

🆑
fix: Made sure that mapped critters (i.e. penguins on the snow cabin
away mission) can survive in the environment they're spawned in.
/🆑
This commit is contained in:
Ghom
2024-03-27 23:01:56 +01:00
committed by GitHub
parent 772d508e29
commit 95b7fa1fb7
56 changed files with 310 additions and 273 deletions
@@ -40,7 +40,6 @@
var/static/list/roach_drops = list(/obj/effect/decal/cleanable/insectguts)
AddElement(/datum/element/death_drops, roach_drops)
AddElement(/datum/element/swabable, cockroach_cell_line, CELL_VIRUS_TABLE_GENERIC_MOB, 1, 7)
AddElement(/datum/element/basic_body_temp_sensitive, 270, INFINITY)
AddComponent( \
/datum/component/squashable, \
squash_chance = 50, \
+21 -7
View File
@@ -52,13 +52,7 @@
ADD_TRAIT(src, TRAIT_VENTCRAWLER_ALWAYS, INNATE_TRAIT)
if(prob(1))
name = "rare frog"
desc = "They seem a little smug."
icon_state = "rare_frog"
icon_living = "rare_frog"
icon_dead = "rare_frog_dead"
butcher_results = list(/obj/item/food/nugget = 5)
poison_type = /datum/reagent/drug/mushroomhallucinogen
make_rare()
var/static/list/loc_connections = list(
COMSIG_ATOM_ENTERED = PROC_REF(on_entered),
@@ -68,6 +62,15 @@
AddElement(/datum/element/ai_retaliate)
AddElement(/datum/element/swabable, CELL_LINE_TABLE_FROG, CELL_VIRUS_TABLE_GENERIC_MOB, 1, 5)
/mob/living/basic/frog/proc/make_rare()
name = "rare frog"
desc = "They seem a little smug."
icon_state = "rare_[icon_state]"
icon_living = "rare_[icon_living]"
icon_dead = "rare_[icon_dead]"
butcher_results = list(/obj/item/food/nugget = 5)
poison_type = /datum/reagent/drug/mushroomhallucinogen
/mob/living/basic/frog/proc/on_entered(datum/source, AM as mob|obj)
SIGNAL_HANDLER
if(!stat && isliving(AM))
@@ -75,6 +78,17 @@
if(L.mob_size > MOB_SIZE_TINY)
playsound(src, stepped_sound, 50, TRUE)
/mob/living/basic/frog/icemoon_facility
name = "Peter Jr."
desc = "They seem a little cold."
minimum_survivable_temperature = ICEBOX_MIN_TEMPERATURE
habitable_atmos = null
gold_core_spawnable = NO_SPAWN
/mob/living/basic/frog/icemoon_facility/make_rare()
. = ..()
name = "Peter Sr." //make him senior.
/mob/living/basic/frog/frog_suicide
name = "suicide frog"
desc = "Driven by sheer will."
@@ -53,3 +53,10 @@
/datum/ai_planning_subtree/target_retaliate,
/datum/ai_planning_subtree/basic_melee_attack_subtree,
)
///Subtype used in the caves away mission
/mob/living/basic/bat/away_caves
name = "cave bat"
desc = "A rare breed of bat which roosts deep in caves."
minimum_survivable_temperature = 0
gold_core_spawnable = NO_SPAWN