diff --git a/code/__DEFINES/mobs.dm b/code/__DEFINES/mobs.dm index 59093a4eb95..0db55b8d376 100644 --- a/code/__DEFINES/mobs.dm +++ b/code/__DEFINES/mobs.dm @@ -880,3 +880,8 @@ GLOBAL_LIST_INIT(layers_to_offset, list( #define HEALING_TOUCH_ANYONE "healing_touch_anyone" #define HEALING_TOUCH_NOT_SELF "healing_touch_not_self" #define HEALING_TOUCH_SELF_ONLY "healing_touch_self_only" + +/// Default minimum body temperature mobs can exist in before taking damage +#define NPC_DEFAULT_MIN_TEMP 250 +/// Default maximum body temperature mobs can exist in before taking damage +#define NPC_DEFAULT_MAX_TEMP 350 diff --git a/code/controllers/subsystem/minor_mapping.dm b/code/controllers/subsystem/minor_mapping.dm index 662bdd57528..5b2c17cf802 100644 --- a/code/controllers/subsystem/minor_mapping.dm +++ b/code/controllers/subsystem/minor_mapping.dm @@ -15,27 +15,25 @@ SUBSYSTEM_DEF(minor_mapping) /datum/controller/subsystem/minor_mapping/proc/trigger_migration(num_mice=10) var/list/exposed_wires = find_exposed_wires() - - var/mob/living/basic/mouse/mouse var/turf/open/proposed_turf - - while((num_mice > 0) && exposed_wires.len) proposed_turf = pick_n_take(exposed_wires) - - if(!istype(proposed_turf)) + if (!valid_mouse_turf(proposed_turf)) continue - if(prob(PROB_MOUSE_SPAWN)) - if(!mouse) - mouse = new(proposed_turf) - else - mouse.forceMove(proposed_turf) + num_mice-- + if (prob(PROB_MOUSE_SPAWN)) + new /mob/living/basic/mouse(proposed_turf) else - mouse = new /mob/living/simple_animal/hostile/regalrat/controlled(proposed_turf) - if(proposed_turf.air.has_gas(/datum/gas/oxygen, 5)) - num_mice -= 1 - mouse = null + new /mob/living/simple_animal/hostile/regalrat/controlled(proposed_turf) + +/// Returns true if a mouse won't die if spawned on this turf +/datum/controller/subsystem/minor_mapping/proc/valid_mouse_turf(turf/open/proposed_turf) + if(!istype(proposed_turf)) + return FALSE + var/datum/gas_mixture/turf/turf_gasmix = proposed_turf.air + var/turf_temperature = proposed_turf.temperature + return turf_gasmix.has_gas(/datum/gas/oxygen, 5) && turf_temperature < NPC_DEFAULT_MAX_TEMP && turf_temperature > NPC_DEFAULT_MIN_TEMP /datum/controller/subsystem/minor_mapping/proc/place_satchels(amount=10) var/list/turfs = find_satchel_suitable_turfs() diff --git a/code/modules/mob/living/basic/basic.dm b/code/modules/mob/living/basic/basic.dm index f7a386e9ba9..0473c09973c 100644 --- a/code/modules/mob/living/basic/basic.dm +++ b/code/modules/mob/living/basic/basic.dm @@ -89,9 +89,9 @@ var/unsuitable_atmos_damage = 1 ///Minimal body temperature without receiving damage - var/minimum_survivable_temperature = 250 + var/minimum_survivable_temperature = NPC_DEFAULT_MIN_TEMP ///Maximal body temperature without receiving damage - var/maximum_survivable_temperature = 350 + var/maximum_survivable_temperature = NPC_DEFAULT_MAX_TEMP ///This damage is taken when the body temp is too cold. Set both this and unsuitable_heat_damage to 0 to avoid adding the basic_body_temp_sensitive element. var/unsuitable_cold_damage = 1 ///This damage is taken when the body temp is too hot. Set both this and unsuitable_cold_damage to 0 to avoid adding the basic_body_temp_sensitive element. diff --git a/code/modules/mob/living/basic/vermin/cockroach.dm b/code/modules/mob/living/basic/vermin/cockroach.dm index 2abca82218c..c4ce8833743 100644 --- a/code/modules/mob/living/basic/vermin/cockroach.dm +++ b/code/modules/mob/living/basic/vermin/cockroach.dm @@ -38,7 +38,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, squash_damage = 1) ADD_TRAIT(src, TRAIT_VENTCRAWLER_ALWAYS, INNATE_TRAIT) diff --git a/code/modules/mob/living/simple_animal/hostile/regalrat.dm b/code/modules/mob/living/simple_animal/hostile/regalrat.dm index 7f4f4637813..bd94d7508ba 100644 --- a/code/modules/mob/living/simple_animal/hostile/regalrat.dm +++ b/code/modules/mob/living/simple_animal/hostile/regalrat.dm @@ -1,4 +1,3 @@ - /mob/living/simple_animal/hostile/regalrat name = "feral regal rat" desc = "An evolved rat, created through some strange science. They lead nearby rats with deadly efficiency to protect their kingdom. Not technically a king." diff --git a/code/modules/mob/living/simple_animal/simple_animal.dm b/code/modules/mob/living/simple_animal/simple_animal.dm index 5eed9bbbce7..54688eba617 100644 --- a/code/modules/mob/living/simple_animal/simple_animal.dm +++ b/code/modules/mob/living/simple_animal/simple_animal.dm @@ -59,9 +59,9 @@ var/stamina_recovery = 5 ///Minimal body temperature without receiving damage - var/minbodytemp = 250 + var/minbodytemp = NPC_DEFAULT_MIN_TEMP ///Maximal body temperature without receiving damage - var/maxbodytemp = 350 + var/maxbodytemp = NPC_DEFAULT_MAX_TEMP ///This damage is taken when the body temp is too cold. var/unsuitable_cold_damage ///This damage is taken when the body temp is too hot.