From bbb8c81d8129c28fd997796209dfab2c6cf00548 Mon Sep 17 00:00:00 2001 From: DragonTrance Date: Wed, 24 Feb 2021 18:35:32 -0700 Subject: [PATCH] light eater no longer eats plasmamen helmets --- .../antagonists/nightmare/nightmare.dm | 1 + .../nightmare/nightmare_objectives.dm | 9 ++------- .../human/species_types/shadowpeople.dm | 20 ++++++++++++++++--- 3 files changed, 20 insertions(+), 10 deletions(-) diff --git a/code/modules/antagonists/nightmare/nightmare.dm b/code/modules/antagonists/nightmare/nightmare.dm index a8832c5a..847ceeb6 100644 --- a/code/modules/antagonists/nightmare/nightmare.dm +++ b/code/modules/antagonists/nightmare/nightmare.dm @@ -1,6 +1,7 @@ #define LIGHTSTOBREAK_MINIMUM 25 #define LIGHTSTOBREAK_MAXIMUM 75 #define LIGHTSTOBREAK_THRESHOLD 50 +#define LIGHTSTOBREAK_MAX_CHANCE 50 #define LIGHTSTOBREAK_AREA_MIN 1 #define LIGHTSTOBREAK_AREA_MAX 2 diff --git a/code/modules/antagonists/nightmare/nightmare_objectives.dm b/code/modules/antagonists/nightmare/nightmare_objectives.dm index 1fc25248..dbcadc5e 100644 --- a/code/modules/antagonists/nightmare/nightmare_objectives.dm +++ b/code/modules/antagonists/nightmare/nightmare_objectives.dm @@ -33,7 +33,7 @@ area_targets += area2add else target_amount = rand(LIGHTSTOBREAK_MINIMUM, LIGHTSTOBREAK_MAXIMUM) - if(prob(50)) + if(prob(LIGHTSTOBREAK_MAX_CHANCE)) if(target_amount > LIGHTSTOBREAK_THRESHOLD) target_amount = LIGHTSTOBREAK_MAXIMUM else if(target_amount > LIGHTSTOBREAK_THRESHOLD) @@ -73,19 +73,13 @@ else var/list/valid_turfs = list() for(var/area/target in area_targets) - var/I = 0 var/list/cached_area = get_area_turfs(target.type) for(var/turf/A in cached_area) if(!is_station_level(A.z)) continue valid_turfs += A - I++ - var/E = 0 - var/D = 0 for(var/turf/T in valid_turfs) - D++ for(var/atom/C in T.contents) - E++ /*if(!C?.visibility) //Doesn't compile, add this another time continue*/ if(C.light_range > 0) @@ -106,5 +100,6 @@ #undef LIGHTSTOBREAK_MINIMUM #undef LIGHTSTOBREAK_MAXIMUM #undef LIGHTSTOBREAK_THRESHOLD +#undef LIGHTSTOBREAK_MAX_CHANCE #undef LIGHTSTOBREAK_AREA_MIN #undef LIGHTSTOBREAK_AREA_MAX diff --git a/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm b/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm index 1d50d2c4..4a7de3d2 100644 --- a/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm +++ b/code/modules/mob/living/carbon/human/species_types/shadowpeople.dm @@ -186,6 +186,7 @@ if(isopenturf(AM) && !istype(AM, /turf/open/space) && !istype(AM, /turf/open/lava)) var/turf/T = AM if(T.light_power || T.light_range) + to_chat(user, "Your [src] consumes the lights in [AM].") T.set_light(0,0) else if(isopenturf(AM)) return @@ -198,13 +199,13 @@ to_chat(borg, "Your headlamp is fried! You'll need a human to help replace it.") else for(var/obj/item/O in AM) - if(O.light_range && O.light_power) + if(O.light_range && O.light_power && !check_plasmaman(O, AM)) disintegrate(O, user) - if(L.pulling && L.pulling.light_range && isitem(L.pulling)) + if(L.pulling && L.pulling.light_range && isitem(L.pulling) && !check_plasmaman(L.pulling, L)) disintegrate(L.pulling, user) else if(isitem(AM)) var/obj/item/I = AM - if(I.light_range && I.light_power) + if(I.light_range && I.light_power && !check_plasmaman(AM)) disintegrate(I, user) else if(istype(AM, /obj/structure/marker_beacon)) var/obj/structure/marker_beacon/I = AM @@ -247,5 +248,18 @@ if(is_species(user, /datum/species/shadow/nightmare)) handle_objectives(user) +/obj/item/light_eater/proc/check_plasmaman(obj/item/O, mob/living/carbon/human/user) + if(!istype(O, /obj/item/clothing/head/helmet/space/plasmaman)) + return FALSE + var/obj/item/clothing/head/helmet/space/plasmaman/H = O + if(H.on) + H.on = FALSE + H.icon_state = "[initial(H.icon_state)][H.on ? "-light":""]" + H.item_state = H.icon_state + if(user) + user.update_inv_head() + to_chat(user, "Your [H]'s torch extinguishes!") + return TRUE + #undef HEART_SPECIAL_SHADOWIFY #undef HEART_RESPAWN_THRESHHOLD