mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-08-26 22:57:39 +01:00
Fire Rework (#9669)
This commit is contained in:
@@ -0,0 +1,51 @@
|
||||
/datum/event/electrical_fire/start()
|
||||
if(!machines.len)
|
||||
return
|
||||
|
||||
var/list/possible_machines = list()
|
||||
for(var/obj/machinery/M in machines)
|
||||
var/area/A = get_area(M)
|
||||
if(!A)
|
||||
continue
|
||||
if(A.flag_check(AREA_FORBID_EVENTS))
|
||||
continue
|
||||
if(istype( A, /area/maintenance ))
|
||||
continue
|
||||
if(istype( A, /area/shuttle ))
|
||||
continue
|
||||
var/turf/T = get_turf(M)
|
||||
if(!T)
|
||||
continue
|
||||
if(T.is_outdoors())
|
||||
continue
|
||||
if(!(T.z in using_map.station_levels))
|
||||
continue
|
||||
// All of these make fires, a good spread in populated areas
|
||||
if(istype(M,/obj/machinery/light_switch))
|
||||
var/obj/machinery/light_switch/L = M
|
||||
if(L.on)
|
||||
possible_machines.Add(M) // prefer rooms that are in use
|
||||
if(istype(M,/obj/machinery/washing_machine) \
|
||||
|| istype(M,/obj/machinery/microwave) \
|
||||
|| istype(M,/obj/machinery/recharge_station) \
|
||||
|| istype(M,/obj/machinery/power/thermoregulator/cryogaia))
|
||||
if(!(M.stat & NOPOWER)) // Has to be powered
|
||||
possible_machines.Add(M)
|
||||
|
||||
if(!possible_machines.len)
|
||||
return
|
||||
|
||||
// set alight!
|
||||
var/obj/machinery/M = pick(possible_machines)
|
||||
if(M)
|
||||
M.visible_message(span_warning("\The [M] sparks violently and catches fire!"))
|
||||
var/datum/effect/effect/system/spark_spread/sparks = new /datum/effect/effect/system/spark_spread()
|
||||
sparks.set_up(4, 1, get_turf(M))
|
||||
sparks.start()
|
||||
|
||||
var/turf/T = get_turf(M)
|
||||
T.lingering_fire(0.6)
|
||||
|
||||
var/area/A = get_area(T)
|
||||
log_admin("Electrical event: [M] in [A] caught fire.")
|
||||
message_admins("Electrical event: [M] in [A] caught fire.")
|
||||
@@ -125,6 +125,7 @@
|
||||
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Blob", /datum/event/blob, -100, list(ASSIGNMENT_SECURITY = 40, ASSIGNMENT_HOS = 10, ASSIGNMENT_WARDEN = 10, ASSIGNMENT_ENGINEER = 5), 1, min_jobs = list(ASSIGNMENT_SECURITY = 1)),
|
||||
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Carp Migration", /datum/event/carp_migration, -110, list(ASSIGNMENT_SECURITY = 50, ASSIGNMENT_HOS = 10, ASSIGNMENT_WARDEN = 10), 1, min_jobs = list(ASSIGNMENT_SECURITY = 3)),
|
||||
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Disease Outbreak", /datum/event/disease_outbreak, -30, list(ASSIGNMENT_MEDICAL = 30, ASSIGNMENT_ANY = 1), 1, min_jobs = list(ASSIGNMENT_MEDICAL = 2)),
|
||||
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Electrical Fire", /datum/event/electrical_fire, 5, list(ASSIGNMENT_ENGINEER = 5, ASSIGNMENT_CYBORG = 5), 0),
|
||||
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Exotic Horde Infestation", /datum/event/highdangerinfestation, -50, list(ASSIGNMENT_ENGINEER = 20, ASSIGNMENT_SCIENCE = 5, ASSIGNMENT_ANY = 2), 1),
|
||||
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Horde Infestation", /datum/event/horde_infestation, -60, list(ASSIGNMENT_SECURITY = 20, ASSIGNMENT_HOS = 10, ASSIGNMENT_WARDEN = 10, ASSIGNMENT_ANY = 3), 0),
|
||||
new /datum/event_meta(EVENT_LEVEL_MAJOR, "Infected Room", /datum/event/disease_outbreak/floor, -50, list(ASSIGNMENT_MEDICAL = 25, ASSIGNMENT_JANITOR = 10, ASSIGNMENT_ANY = 1), 1, min_jobs = list(ASSIGNMENT_MEDICAL = 2)),
|
||||
|
||||
Reference in New Issue
Block a user