/* * Engine -- engine computer * * Used to eject the engine section, and can also read the gas levels present at a gas sensor * * Most of the ejection logic is contained in the engine_eject datum */ /obj/machinery/computer/engine name = "engine" icon = 'enginecomputer.dmi' var temp = null // temporary text string used for interaction window id = 1 // id of gas sensor to display obj/machinery/gas_sensor/gs // the gas sensor object access = "4000/0030" // the access levels required to start ejection timer (Capt, Head, or Engineer) allowed // the job assignments to eject (null = none) // Create the engine computer, and the global ejector datum if not already exisiting // Also find the gas sensor object matching "id" New() if (!( engine_eject_control )) engine_eject_control = new /datum/engine_eject( ) ..() spawn(5) for(var/obj/machinery/gas_sensor/G in machines) if(G.id == src.id) gs = G break // Timed process // Use power, update interaction window for viewers process() if(stat & (NOPOWER|BROKEN) ) return use_power(250) src.updateDialog() // Attackby object - pass through to interact attackby(var/obj/O, mob/user) return src.attack_hand(user) // Monkey interact same a human attack_paw(var/mob/user as mob) return src.attack_hand(user) // AI interact attack_ai(mob/user) return src.attack_hand(user) // Human interact // Show interaction window attack_hand(var/mob/user as mob) if(stat & (NOPOWER|BROKEN) ) return user.machine = src var/dat if (src.temp) dat = "[src.temp]

Clear Screen" else if (engine_eject_control.status == 0) dat = "Engine Gas Monitor
" if(gs) dat += "[gs.sense_string()]" else dat += "No sensor found." dat += "
Engine Ejection Module
\nStatus: Docked
\n
\nCountdown: [engine_eject_control.timeleft]/60 \[Reset\]
\n
\nEject Engine
\n
\nClose" else if (engine_eject_control.status == 1) dat = "Engine Ejection Module
\nStatus: Ejecting
\n
\nCountdown: [engine_eject_control.timeleft]/60 \[Reset\]
\n
\nStop Ejection
\n
\nClose" else dat = "Engine Ejection Module
\nStatus: Ejected
\n
\nCountdown: N/60 \[Reset\]
\n
\nEngine Ejected!
\n
\nClose" user.client_mob() << browse(dat, "window=computer;size=400x500") // Handle topic links from interaction window Topic(href, href_list) ..() if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey")))) if (!istype(usr, /mob/ai)) if (!istype(usr, /mob/drone)) usr.client_mob() << "\red You don't have the dexterity to do this!" return if ((usr.stat || usr.restrained())) if (!istype(usr, /mob/ai)) return if ((usr.contents.Find(src) || (get_dist(src, usr) <= 1 && istype(src.loc, /turf)))) usr.machine = src if (href_list["eject"]) if (engine_eject_control.status == 0) src.temp = "Eject Engine?

\[Swipe ID to initiate eject sequence\]
Cancel" else if (href_list["eject2"]) // check ID card against access levels before ejecting var/obj/item/weapon/card/id/I = usr.equipped() if (istype(I)) if(I.check_access(access,allowed)) if (engine_eject_control.status == 0) engine_eject_control.ejectstart() src.temp = null else usr.client_mob() << "\red Access Denied." else if (href_list["stop"]) if (engine_eject_control.status > 0) src.temp = text("Stop Ejection?

Yes
No", src, src) else if (href_list["stop2"]) if (engine_eject_control.status > 0) engine_eject_control.stopcount() src.temp = null else if (href_list["reset"]) if (engine_eject_control.status == 0) engine_eject_control.resetcount() else if (href_list["temp"]) src.temp = null src.add_fingerprint(usr) src.updateDialog()