/*
* 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