light eater no longer eats plasmamen helmets

This commit is contained in:
DragonTrance
2021-02-24 18:35:32 -07:00
parent 7bb205f940
commit bbb8c81d81
3 changed files with 20 additions and 10 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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, "<span class='notice'>Your [src] consumes the lights in [AM].</span>")
T.set_light(0,0)
else if(isopenturf(AM))
return
@@ -198,13 +199,13 @@
to_chat(borg, "<span class='danger'>Your headlamp is fried! You'll need a human to help replace it.</span>")
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, "<span class='warning'>Your [H]'s torch extinguishes!</span>")
return TRUE
#undef HEART_SPECIAL_SHADOWIFY
#undef HEART_RESPAWN_THRESHHOLD