Merge pull request #38366 from AutomaticFrenzy/patch/fire-overlay

Replace area-wide fire overlay with reddening the lights
This commit is contained in:
oranges
2018-06-12 11:48:47 +12:00
committed by yogstation13-bot
parent 7df662106e
commit 401b710583
4 changed files with 50 additions and 96 deletions

View File

@@ -18,13 +18,10 @@
var/clockwork_warp_allowed = TRUE // Can servants warp into this area from Reebe? var/clockwork_warp_allowed = TRUE // Can servants warp into this area from Reebe?
var/clockwork_warp_fail = "The structure there is too dense for warping to pierce. (This is normal in high-security areas.)" var/clockwork_warp_fail = "The structure there is too dense for warping to pierce. (This is normal in high-security areas.)"
var/eject = null
var/fire = null var/fire = null
var/atmos = TRUE var/atmos = TRUE
var/atmosalm = FALSE var/atmosalm = FALSE
var/poweralm = TRUE var/poweralm = TRUE
var/party = null
var/lightswitch = TRUE var/lightswitch = TRUE
var/requires_power = TRUE var/requires_power = TRUE
@@ -256,9 +253,7 @@ GLOBAL_LIST_EMPTY(teleportlocs)
/area/proc/firereset(obj/source) /area/proc/firereset(obj/source)
if (fire) if (fire)
fire = 0 unset_fire_alarm_effects()
mouse_opacity = MOUSE_OPACITY_TRANSPARENT
updateicon()
ModifyFiredoors(TRUE) ModifyFiredoors(TRUE)
for(var/item in firealarms) for(var/item in firealarms)
var/obj/machinery/firealarm/F = item var/obj/machinery/firealarm/F = item
@@ -290,7 +285,7 @@ GLOBAL_LIST_EMPTY(teleportlocs)
DOOR.lock() DOOR.lock()
/area/proc/burglaralert(obj/trigger) /area/proc/burglaralert(obj/trigger)
if(always_unpowered == 1) //no burglar alarms in space/asteroid if(always_unpowered) //no burglar alarms in space/asteroid
return return
//Trigger alarm effect //Trigger alarm effect
@@ -306,61 +301,32 @@ GLOBAL_LIST_EMPTY(teleportlocs)
addtimer(CALLBACK(SILICON, /mob/living/silicon.proc/cancelAlarm,"Burglar",src,trigger), 600) addtimer(CALLBACK(SILICON, /mob/living/silicon.proc/cancelAlarm,"Burglar",src,trigger), 600)
/area/proc/set_fire_alarm_effect() /area/proc/set_fire_alarm_effect()
fire = 1 fire = TRUE
updateicon()
mouse_opacity = MOUSE_OPACITY_TRANSPARENT mouse_opacity = MOUSE_OPACITY_TRANSPARENT
for(var/alarm in firealarms)
var/obj/machinery/firealarm/F = alarm
F.update_fire_light(fire)
for(var/obj/machinery/light/L in src)
L.update()
/area/proc/readyalert() /area/proc/unset_fire_alarm_effects()
if(name == "Space") fire = FALSE
return mouse_opacity = MOUSE_OPACITY_TRANSPARENT
if(!eject) for(var/alarm in firealarms)
eject = 1 var/obj/machinery/firealarm/F = alarm
updateicon() F.update_fire_light(fire)
for(var/obj/machinery/light/L in src)
/area/proc/readyreset() L.update()
if(eject)
eject = 0
updateicon()
/area/proc/partyalert()
if(src.name == "Space") //no parties in space!!!
return
if (!( src.party ))
src.party = 1
src.updateicon()
src.mouse_opacity = MOUSE_OPACITY_TRANSPARENT
/area/proc/partyreset()
if (src.party)
src.party = 0
src.mouse_opacity = MOUSE_OPACITY_TRANSPARENT
src.updateicon()
for(var/obj/machinery/door/firedoor/D in src)
if(!D.welded)
if(D.operating)
D.nextstate = OPEN
else if(D.density)
INVOKE_ASYNC(D, /obj/machinery/door/firedoor.proc/open)
/area/proc/updateicon() /area/proc/updateicon()
if ((fire || eject || party) && (!requires_power||power_environ))//If it doesn't require power, can still activate this proc. var/weather_icon
if(fire && !eject && !party) for(var/V in SSweather.processing)
icon_state = "blue" var/datum/weather/W = V
else if(!fire && eject && !party) if(W.stage != END_STAGE && (src in W.impacted_areas))
icon_state = "red" W.update_areas()
else if(party && !fire && !eject) weather_icon = TRUE
icon_state = "party" if(!weather_icon)
else icon_state = null
icon_state = "blue-red"
else
var/weather_icon
for(var/V in SSweather.processing)
var/datum/weather/W = V
if(W.stage != END_STAGE && (src in W.impacted_areas))
W.update_areas()
weather_icon = TRUE
if(!weather_icon)
icon_state = null
/area/space/updateicon() /area/space/updateicon()
icon_state = null icon_state = null

View File

@@ -15,7 +15,6 @@
resistance_flags = FIRE_PROOF resistance_flags = FIRE_PROOF
heat_proof = TRUE heat_proof = TRUE
glass = TRUE glass = TRUE
var/nextstate = null
sub_door = TRUE sub_door = TRUE
explosion_block = 1 explosion_block = 1
safe = FALSE safe = FALSE
@@ -24,6 +23,7 @@
assemblytype = /obj/structure/firelock_frame assemblytype = /obj/structure/firelock_frame
armor = list("melee" = 30, "bullet" = 30, "laser" = 20, "energy" = 20, "bomb" = 10, "bio" = 100, "rad" = 100, "fire" = 95, "acid" = 70) armor = list("melee" = 30, "bullet" = 30, "laser" = 20, "energy" = 20, "bomb" = 10, "bio" = 100, "rad" = 100, "fire" = 95, "acid" = 70)
interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON | INTERACT_MACHINE_REQUIRES_SILICON | INTERACT_MACHINE_OPEN interaction_flags_machine = INTERACT_MACHINE_WIRES_IF_OPEN | INTERACT_MACHINE_ALLOW_SILICON | INTERACT_MACHINE_OPEN_SILICON | INTERACT_MACHINE_REQUIRES_SILICON | INTERACT_MACHINE_OPEN
var/nextstate = null
var/boltslocked = TRUE var/boltslocked = TRUE
var/list/affecting_areas var/list/affecting_areas

View File

@@ -23,9 +23,14 @@
idle_power_usage = 2 idle_power_usage = 2
active_power_usage = 6 active_power_usage = 6
power_channel = ENVIRON power_channel = ENVIRON
resistance_flags = FIRE_PROOF
light_power = 0
light_range = 7
light_color = "#ff3232"
var/detecting = 1 var/detecting = 1
var/buildstage = 2 // 2 = complete, 1 = no wires, 0 = circuit gone var/buildstage = 2 // 2 = complete, 1 = no wires, 0 = circuit gone
resistance_flags = FIRE_PROOF
var/last_alarm = 0 var/last_alarm = 0
var/area/myarea = null var/area/myarea = null
@@ -273,35 +278,10 @@
new /obj/item/stack/cable_coil(loc, 3) new /obj/item/stack/cable_coil(loc, 3)
qdel(src) qdel(src)
/obj/machinery/firealarm/proc/update_fire_light(fire)
/* if(fire == !!light_power)
* Party button return // do nothing if we're already active
*/ if(fire)
set_light(l_power = 0.8)
/obj/machinery/firealarm/partyalarm else
name = "\improper PARTY BUTTON" set_light(l_power = 0)
desc = "Cuban Pete is in the house!"
/obj/machinery/firealarm/partyalarm/reset()
if (stat & (NOPOWER|BROKEN))
return
var/area/A = src.loc
A = A.loc
if (!( istype(A, /area) ))
return
A.partyreset()
/obj/machinery/firealarm/partyalarm/alarm()
if (stat & (NOPOWER|BROKEN))
return
var/area/A = src.loc
A = A.loc
if (!( istype(A, /area) ))
return
A.partyalert()
/obj/machinery/firealarm/partyalarm/ui_data(mob/user)
. = ..()
var/area/A = get_area(src)
.["alarm"] = A.party

View File

@@ -296,7 +296,8 @@
cut_overlays() cut_overlays()
switch(status) // set icon_states switch(status) // set icon_states
if(LIGHT_OK) if(LIGHT_OK)
if(emergency_mode) var/area/A = get_area(src)
if(emergency_mode || (A && A.fire))
icon_state = "[base_state]_emergency" icon_state = "[base_state]_emergency"
else else
icon_state = "[base_state]" icon_state = "[base_state]"
@@ -319,9 +320,16 @@
on = FALSE on = FALSE
emergency_mode = FALSE emergency_mode = FALSE
if(on) if(on)
var/BR = nightshift_enabled? nightshift_brightness : brightness var/BR = brightness
var/PO = nightshift_enabled? nightshift_light_power : bulb_power var/PO = bulb_power
var/CO = nightshift_enabled? nightshift_light_color : bulb_colour var/CO = bulb_colour
var/area/A = get_area(src)
if (A && A.fire)
CO = bulb_emergency_colour
else if (nightshift_enabled)
BR = nightshift_brightness
PO = nightshift_light_power
CO = nightshift_light_color
var/matching = light && BR == light.light_range && PO == light.light_power && CO == light.light_color var/matching = light && BR == light.light_range && PO == light.light_power && CO == light.light_color
if(!matching) if(!matching)
switchcount++ switchcount++