Simple mob alerts (#48646)

Simple mob alerts
This commit is contained in:
Arkatos1
2020-01-09 14:53:57 +01:00
committed by Rob Bailey
parent f37606b796
commit fb416d9f10
6 changed files with 51 additions and 15 deletions

View File

@@ -20,7 +20,7 @@ SUBSYSTEM_DEF(minor_mapping)
M = new(proposed_turf)
else
M.forceMove(proposed_turf)
if(M.environment_is_safe())
if(M.environment_air_is_safe())
num_mice -= 1
M = null

View File

@@ -149,9 +149,12 @@
/mob/living/simple_animal/hostile/alien/handle_temperature_damage()
if(bodytemperature < minbodytemp)
adjustBruteLoss(2)
throw_alert("temp", /obj/screen/alert/cold, 1)
else if(bodytemperature > maxbodytemp)
adjustBruteLoss(20)
throw_alert("temp", /obj/screen/alert/hot, 3)
else
clear_alert("temp")
/mob/living/simple_animal/hostile/alien/maid
name = "lusty xenomorph maid"

View File

@@ -546,8 +546,12 @@
/mob/living/simple_animal/hostile/poison/giant_spider/handle_temperature_damage()
if(bodytemperature < minbodytemp)
adjustBruteLoss(20)
throw_alert("temp", /obj/screen/alert/cold, 3)
else if(bodytemperature > maxbodytemp)
adjustBruteLoss(20)
throw_alert("temp", /obj/screen/alert/hot, 3)
else
clear_alert("temp")
#undef SPIDER_IDLE
#undef SPINNING_WEB

View File

@@ -67,5 +67,9 @@
/mob/living/simple_animal/hostile/asteroid/handle_temperature_damage()
if(bodytemperature < minbodytemp)
adjustBruteLoss(2)
throw_alert("temp", /obj/screen/alert/cold, 1)
else if(bodytemperature > maxbodytemp)
adjustBruteLoss(20)
throw_alert("temp", /obj/screen/alert/hot, 3)
else
clear_alert("temp")

View File

@@ -40,8 +40,12 @@
/mob/living/simple_animal/hostile/retaliate/clown/handle_temperature_damage()
if(bodytemperature < minbodytemp)
adjustBruteLoss(10)
throw_alert("temp", /obj/screen/alert/cold, 2)
else if(bodytemperature > maxbodytemp)
adjustBruteLoss(15)
throw_alert("temp", /obj/screen/alert/hot, 3)
else
clear_alert("temp")
/mob/living/simple_animal/hostile/retaliate/clown/attack_hand(mob/living/carbon/human/M)
..()

View File

@@ -270,15 +270,14 @@
else
emote("me", 2, pick(emote_hear))
/mob/living/simple_animal/proc/environment_is_safe(datum/gas_mixture/environment, check_temp = FALSE)
/mob/living/simple_animal/proc/environment_air_is_safe()
. = TRUE
if(pulledby && pulledby.grab_state >= GRAB_KILL && atmos_requirements["min_oxy"])
. = FALSE //getting choked
if(isturf(src.loc) && isopenturf(src.loc))
var/turf/open/ST = src.loc
if(isturf(loc) && isopenturf(loc))
var/turf/open/ST = loc
if(ST.air)
var/ST_gases = ST.air.gases
ST.air.assert_gases(arglist(GLOB.hardcoded_gases))
@@ -310,29 +309,51 @@
if(atmos_requirements["min_oxy"] || atmos_requirements["min_tox"] || atmos_requirements["min_n2"] || atmos_requirements["min_co2"])
. = FALSE
if(check_temp)
var/areatemp = get_temperature(environment)
if((areatemp < minbodytemp) || (areatemp > maxbodytemp))
. = FALSE
/mob/living/simple_animal/proc/environment_temperature_is_safe(datum/gas_mixture/environment)
. = TRUE
var/areatemp = get_temperature(environment)
if((areatemp < minbodytemp) || (areatemp > maxbodytemp))
. = FALSE
/mob/living/simple_animal/handle_environment(datum/gas_mixture/environment)
var/atom/A = src.loc
var/atom/A = loc
if(isturf(A))
var/areatemp = get_temperature(environment)
if( abs(areatemp - bodytemperature) > 5)
if(abs(areatemp - bodytemperature) > 5)
var/diff = areatemp - bodytemperature
diff = diff / 5
adjust_bodytemperature(diff)
if(!environment_is_safe(environment))
if(!environment_air_is_safe())
adjustHealth(unsuitable_atmos_damage)
if(unsuitable_atmos_damage > 0)
throw_alert("not_enough_oxy", /obj/screen/alert/not_enough_oxy)
else
clear_alert("not_enough_oxy")
handle_temperature_damage()
/mob/living/simple_animal/proc/handle_temperature_damage()
if((bodytemperature < minbodytemp) || (bodytemperature > maxbodytemp))
if(bodytemperature < minbodytemp)
adjustHealth(unsuitable_atmos_damage)
switch(unsuitable_atmos_damage)
if(1 to 5)
throw_alert("temp", /obj/screen/alert/cold, 1)
if(5 to 10)
throw_alert("temp", /obj/screen/alert/cold, 2)
if(10 to INFINITY)
throw_alert("temp", /obj/screen/alert/cold, 3)
else if(bodytemperature > maxbodytemp)
adjustHealth(unsuitable_atmos_damage)
switch(unsuitable_atmos_damage)
if(1 to 5)
throw_alert("temp", /obj/screen/alert/hot, 1)
if(5 to 10)
throw_alert("temp", /obj/screen/alert/hot, 2)
if(10 to INFINITY)
throw_alert("temp", /obj/screen/alert/hot, 3)
else
clear_alert("temp")
/mob/living/simple_animal/gib()
if(butcher_results || guaranteed_butcher_results)