mirror of
https://github.com/cybergirlvannie/OpenSS13.git
synced 2026-07-11 15:52:49 +01:00
Continued reformatting, machines and computers
This commit is contained in:
+4
-243
@@ -2212,51 +2212,7 @@ Total SMES charging rate should not exceed total power generation rate, or an ov
|
||||
|
||||
|
||||
|
||||
/obj/machinery/computer
|
||||
name = "computer"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
|
||||
/obj/machinery/computer/airtunnel
|
||||
name = "Air Tunnel Control"
|
||||
icon = 'airtunnelcomputer.dmi'
|
||||
icon_state = "console00"
|
||||
/obj/machinery/computer/atmosphere
|
||||
name = "atmosphere"
|
||||
icon = 'turfs.dmi'
|
||||
/obj/machinery/computer/atmosphere/siphonswitch
|
||||
name = "Area Air Control"
|
||||
icon_state = "switch"
|
||||
var/otherarea
|
||||
var/area/area
|
||||
/obj/machinery/computer/atmosphere/siphonswitch/mastersiphonswitch
|
||||
name = "Master Air Control"
|
||||
/obj/machinery/computer/card
|
||||
name = "Identification Computer"
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "id_computer"
|
||||
var/obj/item/weapon/card/id/scan = null
|
||||
var/obj/item/weapon/card/id/modify = null
|
||||
var/authenticated = 0.0
|
||||
var/mode = 0.0
|
||||
var/printing = null
|
||||
/obj/machinery/computer/communications
|
||||
name = "communications"
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "comm_computer"
|
||||
/obj/machinery/computer/data
|
||||
name = "data"
|
||||
icon = 'weap_sat.dmi'
|
||||
icon_state = "computer"
|
||||
|
||||
var/list/topics = list( )
|
||||
|
||||
/obj/machinery/computer/data/weapon
|
||||
name = "weapon"
|
||||
/obj/machinery/computer/data/weapon/info
|
||||
name = "Research Computer"
|
||||
/obj/machinery/computer/data/weapon/log
|
||||
name = "Log Computer"
|
||||
/obj/machinery/computer/dna
|
||||
name = "DNA operations computer"
|
||||
icon = 'Cryogenic2.dmi'
|
||||
@@ -2266,68 +2222,10 @@ Total SMES charging rate should not exceed total power generation rate, or an ov
|
||||
var/obj/item/weapon/card/data/modify2 = null
|
||||
var/mode = null
|
||||
var/temp = null
|
||||
/obj/machinery/computer/engine
|
||||
name = "engine"
|
||||
icon = 'enginecomputer.dmi'
|
||||
var/temp = null
|
||||
var/id = 1
|
||||
var/obj/machinery/gas_sensor/gs
|
||||
var/access = "4000/0030"
|
||||
var/allowed
|
||||
|
||||
/obj/machinery/computer/hologram_comp
|
||||
name = "Hologram Computer"
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "holo_console0"
|
||||
var/obj/machinery/hologram_proj/projector = null
|
||||
var/temp = null
|
||||
var/lumens = 0.0
|
||||
var/h_r = 245.0
|
||||
var/h_g = 245.0
|
||||
var/h_b = 245.0
|
||||
/obj/machinery/computer/med_data
|
||||
name = "Medical Records"
|
||||
icon = 'weap_sat.dmi'
|
||||
icon_state = "computer"
|
||||
var/obj/item/weapon/card/id/scan = null
|
||||
var/authenticated = null
|
||||
var/rank = null
|
||||
var/screen = null
|
||||
var/datum/data/record/active1 = null
|
||||
var/datum/data/record/active2 = null
|
||||
var/a_id = null
|
||||
var/temp = null
|
||||
var/printing = null
|
||||
var/allowed = "Medical Researcher/Medical Doctor/Head of Personnel/Captain"
|
||||
var/access
|
||||
|
||||
/obj/machinery/computer/pod
|
||||
name = "Pod Launch Control"
|
||||
icon = 'escapepod.dmi'
|
||||
icon_state = "computer"
|
||||
var/id = 1.0
|
||||
var/obj/machinery/mass_driver/connected = null
|
||||
var/timing = 0.0
|
||||
var/time = 30.0
|
||||
|
||||
|
||||
/obj/machinery/computer/prison_shuttle
|
||||
name = "prison shuttle"
|
||||
icon = 'shuttle.dmi'
|
||||
icon_state = "shuttlecom"
|
||||
/obj/machinery/computer/secure_data
|
||||
name = "Security Records"
|
||||
icon = 'weap_sat.dmi'
|
||||
icon_state = "computer"
|
||||
var/obj/item/weapon/card/id/scan = null
|
||||
var/authenticated = null
|
||||
var/rank = null
|
||||
var/screen = null
|
||||
var/datum/data/record/active1 = null
|
||||
var/datum/data/record/active2 = null
|
||||
var/a_id = null
|
||||
var/temp = null
|
||||
var/printing = null
|
||||
|
||||
|
||||
/obj/machinery/computer/security
|
||||
name = "security"
|
||||
icon = 'stationobjs.dmi'
|
||||
@@ -2336,21 +2234,8 @@ Total SMES charging rate should not exceed total power generation rate, or an ov
|
||||
var/last_pic = 1.0
|
||||
var/network = "SS13"
|
||||
var/maplevel = 1
|
||||
/obj/machinery/computer/shuttle
|
||||
name = "shuttle"
|
||||
icon = 'shuttle.dmi'
|
||||
icon_state = "shuttlecom"
|
||||
var/auth_need = 3.0
|
||||
|
||||
var/list/authorized = list( )
|
||||
var/allowed
|
||||
var/access = "2000"
|
||||
|
||||
/obj/machinery/computer/sleep_console
|
||||
name = "sleep console"
|
||||
icon = 'Cryogenic2.dmi'
|
||||
icon_state = "sleeperconsole"
|
||||
var/obj/machinery/sleeper/connected = null
|
||||
/obj/machinery/computer/teleporter
|
||||
name = "teleporter"
|
||||
icon = 'stationobjs.dmi'
|
||||
@@ -2361,24 +2246,6 @@ Total SMES charging rate should not exceed total power generation rate, or an ov
|
||||
|
||||
|
||||
|
||||
/obj/machinery/cryo_cell
|
||||
name = "cryo cell"
|
||||
icon = 'Cryogenic2.dmi'
|
||||
icon_state = "celltop"
|
||||
density = 1
|
||||
var/obj/machinery/line_in = null
|
||||
var/mob/occupant = null
|
||||
var/obj/substance/gas/gas = null
|
||||
var/obj/substance/gas/ngas = null
|
||||
anchored = 1.0
|
||||
p_dir = 8.0
|
||||
capmult = 1
|
||||
|
||||
var/obj/overlay/O1 = null
|
||||
var/obj/overlay/O2 = null
|
||||
|
||||
var/obj/machinery/vnode = null
|
||||
|
||||
/obj/machinery/dna_scanner
|
||||
name = "DNA Scanner/Implanter"
|
||||
icon = 'Cryogenic2.dmi'
|
||||
@@ -2390,58 +2257,6 @@ Total SMES charging rate should not exceed total power generation rate, or an ov
|
||||
|
||||
|
||||
|
||||
/obj/machinery/freezer
|
||||
name = "freezer"
|
||||
icon = 'Cryogenic2.dmi'
|
||||
icon_state = "freezer_0"
|
||||
density = 1
|
||||
var/connector = null
|
||||
var/obj/machinery/line_out = null
|
||||
var/obj/machinery/vnode = null
|
||||
var/c_used = 1.0
|
||||
var/status = 0.0
|
||||
var/t_flags = 3.0
|
||||
var/transfer = 0.0
|
||||
var/temperature = 60.0+T0C
|
||||
|
||||
var/obj/substance/gas/gas
|
||||
var/obj/substance/gas/ngas
|
||||
p_dir = 4.0
|
||||
anchored = 1.0
|
||||
capmult = 1
|
||||
|
||||
|
||||
/obj/machinery/hologram_proj
|
||||
name = "Hologram Projector"
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "hologram0"
|
||||
var/atom/projection = null
|
||||
anchored = 1.0
|
||||
|
||||
/obj/machinery/mass_driver
|
||||
name = "mass driver"
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "mass_driver"
|
||||
var/power = 1.0
|
||||
var/code = 1.0
|
||||
var/id = 1.0
|
||||
anchored = 1.0
|
||||
|
||||
/obj/machinery/nuclearbomb
|
||||
desc = "Uh oh."
|
||||
name = "Nuclear Fission Explosive"
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "nuclearbomb0"
|
||||
density = 1
|
||||
var/extended = 0.0
|
||||
var/timeleft = 60.0
|
||||
var/timing = 0.0
|
||||
var/r_code = "ADMIN"
|
||||
var/code = ""
|
||||
var/yes_code = 0.0
|
||||
var/safety = 1.0
|
||||
var/obj/item/weapon/disk/nuclear/auth = null
|
||||
flags = 320.0
|
||||
|
||||
|
||||
|
||||
@@ -2449,24 +2264,6 @@ Total SMES charging rate should not exceed total power generation rate, or an ov
|
||||
|
||||
|
||||
|
||||
/obj/machinery/pod
|
||||
name = "Escape Pod"
|
||||
icon = 'escapepod.dmi'
|
||||
icon_state = "pod"
|
||||
density = 1
|
||||
var/id = 1.0
|
||||
var/speed = 10.0
|
||||
var/capacity = null
|
||||
flags = 320.0
|
||||
anchored = 1.0
|
||||
/obj/machinery/recon
|
||||
name = "1-Person Reconaissance Pod"
|
||||
icon = 'escapepod.dmi'
|
||||
icon_state = "recon"
|
||||
density = 1
|
||||
var/speed = 1.0
|
||||
flags = 320.0
|
||||
anchored = 1.0
|
||||
/obj/machinery/restruct
|
||||
name = "DNA Physical Restructurization Accelerator"
|
||||
icon = 'Cryogenic2.dmi'
|
||||
@@ -2497,41 +2294,7 @@ Total SMES charging rate should not exceed total power generation rate, or an ov
|
||||
|
||||
//*****
|
||||
|
||||
/obj/machinery/shuttle
|
||||
name = "shuttle"
|
||||
icon = 'shuttle.dmi'
|
||||
/obj/machinery/shuttle/engine
|
||||
name = "engine"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
/obj/machinery/shuttle/engine/heater
|
||||
name = "heater"
|
||||
icon_state = "heater"
|
||||
/obj/machinery/shuttle/engine/platform
|
||||
name = "platform"
|
||||
icon_state = "platform"
|
||||
/obj/machinery/shuttle/engine/propulsion
|
||||
name = "propulsion"
|
||||
icon_state = "propulsion"
|
||||
opacity = 1
|
||||
/obj/machinery/shuttle/engine/propulsion/burst
|
||||
name = "burst"
|
||||
/obj/machinery/shuttle/engine/propulsion/burst/left
|
||||
name = "left"
|
||||
icon_state = "burst_l"
|
||||
/obj/machinery/shuttle/engine/propulsion/burst/right
|
||||
name = "right"
|
||||
icon_state = "burst_r"
|
||||
/obj/machinery/shuttle/engine/router
|
||||
name = "router"
|
||||
icon_state = "router"
|
||||
/obj/machinery/sleeper
|
||||
name = "sleeper"
|
||||
icon = 'Cryogenic2.dmi'
|
||||
icon_state = "sleeper_0"
|
||||
density = 1
|
||||
var/mob/occupant = null
|
||||
anchored = 1.0
|
||||
|
||||
/obj/machinery/teleport
|
||||
name = "teleport"
|
||||
icon = 'stationobjs.dmi'
|
||||
@@ -2680,9 +2443,7 @@ Total SMES charging rate should not exceed total power generation rate, or an ov
|
||||
density = 1
|
||||
var/obj/target = null
|
||||
anchored = 1.0
|
||||
/obj/projection
|
||||
name = "Projection"
|
||||
anchored = 1.0
|
||||
|
||||
/obj/rack
|
||||
name = "rack"
|
||||
icon = 'Icons.dmi'
|
||||
|
||||
@@ -60,6 +60,8 @@ obj/machinery/atmoalter/siphs
|
||||
// Reset the siphon state. If "valve" is negative, main valve is set to release at that rate
|
||||
// If "valve" is positive, main valve set to siphon at that rate
|
||||
// If "auto" true, main valve set to automatic status
|
||||
// This routine is called by the siphonswitch computers to control the siphs
|
||||
|
||||
|
||||
proc/reset(valve, auto)
|
||||
if(c_status!=0)
|
||||
|
||||
@@ -0,0 +1,82 @@
|
||||
/*
|
||||
* Computer -- the base computer machine
|
||||
*
|
||||
*
|
||||
* TODO: Eventual rewrite of computer system from scratch?
|
||||
*/
|
||||
|
||||
|
||||
obj/machinery/computer
|
||||
name = "computer"
|
||||
density = 1
|
||||
anchored = 1
|
||||
|
||||
// Note the icon files for computer objects should have a "broken" and "c_unpowered" state, unless the following procs are overridden.
|
||||
|
||||
|
||||
|
||||
// Called when area power state changes
|
||||
// Display the correct icon depending on the state of the machine
|
||||
|
||||
power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broken"
|
||||
else
|
||||
if( powered() ) // Defaults to equipment channel
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "c_unpowered"
|
||||
stat |= NOPOWER
|
||||
|
||||
|
||||
// Default timed process. Use power (as long as computer is operating)
|
||||
|
||||
process()
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(250)
|
||||
|
||||
|
||||
// Default when hit by a meteor. Break the computer, and remove any verbs.
|
||||
|
||||
meteorhit(var/obj/O)
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
src.icon_state = "broken"
|
||||
stat |= BROKEN
|
||||
|
||||
|
||||
// Default when attacked by blob. 50% change to break computer.
|
||||
|
||||
blob_act()
|
||||
if (prob(50))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
src.icon_state = "broken"
|
||||
src.stat |= BROKEN
|
||||
src.density = 0
|
||||
|
||||
|
||||
// Default when exploded. Delete or chance to break the computer
|
||||
|
||||
ex_act(severity)
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
|
||||
src.icon_state = "broken"
|
||||
stat |= BROKEN
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
src.icon_state = "broken"
|
||||
stat |= BROKEN
|
||||
@@ -0,0 +1,156 @@
|
||||
/*
|
||||
* Airtunnel -- the airtunnel computer
|
||||
* Controls extention and retraction of the tunnel, and regulation of the atmosphere in it.
|
||||
*
|
||||
* Note: Currently, only 1 airtunnel per map can be operated; there is no link to the global airtunnel datum
|
||||
*/
|
||||
|
||||
|
||||
obj/machinery/computer/airtunnel
|
||||
name = "Air Tunnel Control"
|
||||
icon = 'airtunnelcomputer.dmi'
|
||||
icon_state = "console00"
|
||||
|
||||
|
||||
// Update icon_state depending on computer and airtunnel status
|
||||
|
||||
proc/update_icon()
|
||||
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broken"
|
||||
return
|
||||
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "c_unpowered"
|
||||
return
|
||||
|
||||
var/status = 0
|
||||
if (SS13_airtunnel.operating == 1)
|
||||
status = "r"
|
||||
else if (SS13_airtunnel.operating == 2)
|
||||
status = "e"
|
||||
else
|
||||
var/obj/move/airtunnel/connector/C = pick(SS13_airtunnel.connectors)
|
||||
|
||||
if (C.current == C)
|
||||
status = 0
|
||||
else if (!( C.current.next ))
|
||||
status = 2
|
||||
else
|
||||
status = 1
|
||||
|
||||
src.icon_state = "console[SS13_airtunnel.siphon_status >= 2 ? "1" : "0"][status]"
|
||||
|
||||
|
||||
// Timed process
|
||||
// Update the icon, use power, and update interaction window for viewers
|
||||
|
||||
process()
|
||||
|
||||
src.update_icon()
|
||||
if(stat & (NOPOWER|BROKEN) )
|
||||
return
|
||||
use_power(250)
|
||||
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
|
||||
|
||||
|
||||
// Monkey interct same as human
|
||||
|
||||
attack_paw(mob/user)
|
||||
return src.attack_hand(user)
|
||||
|
||||
|
||||
// Human interact
|
||||
// Show airtunnel status and interaction window
|
||||
|
||||
attack_hand(mob/user)
|
||||
|
||||
if(stat & (NOPOWER|BROKEN) )
|
||||
return
|
||||
|
||||
var/dat = "<HTML><BODY><TT><B>Air Tunnel Controls</B><BR>"
|
||||
user.machine = src
|
||||
|
||||
if (SS13_airtunnel.operating == 1)
|
||||
dat += "<B>Status:</B> RETRACTING<BR>"
|
||||
|
||||
else if (SS13_airtunnel.operating == 2)
|
||||
dat += "<B>Status:</B> EXPANDING<BR>"
|
||||
|
||||
else
|
||||
var/obj/move/airtunnel/connector/C = pick(SS13_airtunnel.connectors)
|
||||
|
||||
if (C.current == C)
|
||||
dat += "<B>Status:</B> Fully Retracted<BR>"
|
||||
else if (!( C.current.next ))
|
||||
dat += "<B>Status:</B> Fully Extended<BR>"
|
||||
else
|
||||
dat += "<B>Status:</B> Stopped Midway<BR>"
|
||||
|
||||
dat += "<A href='?src=\ref[src];retract=1'>Retract</A> <A href='?src=\ref[src];stop=1'>Stop</A> <A href='?src=\ref[src];extend=1'>Extend</A><BR>"
|
||||
dat += "<BR><B>Air Level:</B> [(SS13_airtunnel.air_stat ? "Acceptable" : "DANGEROUS")]<BR>"
|
||||
dat += "<B>Air System Status:</B> "
|
||||
|
||||
switch(SS13_airtunnel.siphon_status)
|
||||
if(0.0)
|
||||
dat += "Stopped "
|
||||
if(1.0)
|
||||
dat += "Siphoning (Siphons only) "
|
||||
if(2.0)
|
||||
dat += "Regulating (BOTH) "
|
||||
if(3.0)
|
||||
dat += "RELEASING MAX (Siphons only) "
|
||||
|
||||
dat += "<A href='?src=\ref[src];refresh=1'>(Refresh)</A><BR>"
|
||||
dat += "<A href='?src=\ref[src];release=1'>RELEASE (Siphons only)</A> <A href='?src=\ref[src];siphon=1'>Siphon (Siphons only)</A> <A href='?src=\ref[src];stop_siph=1'>Stop</A> <A href='?src=\ref[src];auto=1'>Regulate</A><BR>"
|
||||
dat += "<BR><BR><A href='?src=\ref[user];mach_close=computer'>Close</A></TT></BODY></HTML>"
|
||||
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
|
||||
|
||||
// Handle topic links from interaction window
|
||||
// Control the airtunnel through the global datum
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey"))))
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
if ((usr.stat || usr.restrained()))
|
||||
return
|
||||
if ((usr.contents.Find(src) || (get_dist(src, usr) <= 1 && istype(src.loc, /turf))))
|
||||
usr.machine = src
|
||||
|
||||
if (href_list["retract"])
|
||||
SS13_airtunnel.retract()
|
||||
else if (href_list["stop"])
|
||||
SS13_airtunnel.operating = 0
|
||||
else if (href_list["extend"])
|
||||
SS13_airtunnel.extend()
|
||||
else if (href_list["release"])
|
||||
SS13_airtunnel.siphon_status = 3
|
||||
SS13_airtunnel.siphons()
|
||||
else if (href_list["siphon"])
|
||||
SS13_airtunnel.siphon_status = 1
|
||||
SS13_airtunnel.siphons()
|
||||
else if (href_list["stop_siph"])
|
||||
SS13_airtunnel.siphon_status = 0
|
||||
SS13_airtunnel.siphons()
|
||||
else if (href_list["auto"])
|
||||
SS13_airtunnel.siphon_status = 2
|
||||
SS13_airtunnel.siphons()
|
||||
else if (href_list["refresh"])
|
||||
SS13_airtunnel.siphons()
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* Atmosphere -- the base type for atmosphere computers
|
||||
*
|
||||
* Two derived types:
|
||||
* Siphonsiwtch control the siphons and air filters/regulator in an area
|
||||
* Mastersiphonswitch controls all areas in the world, but isn't used in current maps as it's too powerful
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
obj/machinery/computer/atmosphere
|
||||
name = "atmosphere"
|
||||
icon = 'turfs.dmi'
|
||||
|
||||
|
||||
// Prototype: returns the contents of the area that the computer controls
|
||||
// Used to find all the siphon objects in the controlled region
|
||||
|
||||
proc/returnarea()
|
||||
return
|
||||
|
||||
|
||||
// The siphon switch derived type
|
||||
|
||||
siphonswitch
|
||||
name = "Area Air Control"
|
||||
icon_state = "switch"
|
||||
var
|
||||
otherarea // set this for the computer to control an area other than the one its in
|
||||
// e.g. set this to "testlab1" to control /area/testlab1
|
||||
area/area // the area to control. Defaults to the area containing the computer, unless otherarea is set.
|
||||
|
||||
|
||||
// Create a siphonswitch computer
|
||||
// Set the controlled area to the containing area, or to that in the "otherarea" var if set
|
||||
|
||||
New()
|
||||
..()
|
||||
|
||||
spawn(5) // wait for map to finish loading
|
||||
src.area = src.loc.loc
|
||||
if(otherarea)
|
||||
src.area = locate(text2path("/area/[otherarea]"))
|
||||
|
||||
|
||||
// Return the contents of the controlled area
|
||||
|
||||
returnarea()
|
||||
return area.contents
|
||||
|
||||
|
||||
// The verbs for siphonswitch and mastersiphonswitch
|
||||
// Siphons are controlled through the reset() proc for each
|
||||
|
||||
// Switch all siphons on
|
||||
|
||||
verb/siphon_all()
|
||||
set src in oview(1)
|
||||
if(stat & NOPOWER) return
|
||||
if (usr.stat)
|
||||
return
|
||||
usr << "Starting all siphon systems."
|
||||
for(var/obj/machinery/atmoalter/siphs/S in src.returnarea())
|
||||
S.reset(1, 0)
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
|
||||
// Turn off all siphons
|
||||
|
||||
verb/stop_all()
|
||||
set src in oview(1)
|
||||
if(stat & NOPOWER) return
|
||||
if (usr.stat)
|
||||
return
|
||||
usr << "Stopping all siphon systems."
|
||||
for(var/obj/machinery/atmoalter/siphs/S in src.returnarea())
|
||||
S.reset(0, 0)
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
|
||||
// Set all siphons to automatic mode
|
||||
|
||||
verb/auto_on()
|
||||
set src in oview(1)
|
||||
if(stat & NOPOWER) return
|
||||
if (usr.stat)
|
||||
return
|
||||
usr << "Starting automatic air control systems."
|
||||
for(var/obj/machinery/atmoalter/siphs/S in src.returnarea())
|
||||
S.reset(0, 1)
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
|
||||
// Set all scrubber type siphons to release
|
||||
|
||||
verb/release_scrubbers()
|
||||
set src in oview(1)
|
||||
|
||||
if(stat & NOPOWER) return
|
||||
if (usr.stat)
|
||||
return
|
||||
usr << "Releasing all scrubber toxins."
|
||||
for(var/obj/machinery/atmoalter/siphs/scrubbers/S in src.returnarea())
|
||||
S.reset(-1.0, 0)
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
|
||||
// Set all siphons to release
|
||||
|
||||
verb/release_all()
|
||||
set src in oview(1)
|
||||
if(stat & NOPOWER) return
|
||||
if (usr.stat)
|
||||
return
|
||||
usr << "Releasing all stored air."
|
||||
for(var/obj/machinery/atmoalter/siphs/S in src.returnarea())
|
||||
S.reset(-1.0, 0)
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
|
||||
|
||||
// The master siphon switch - controls all siphons in the world
|
||||
// Not used in current maps since it's rather too powerful
|
||||
|
||||
mastersiphonswitch
|
||||
name = "Master Air Control"
|
||||
|
||||
|
||||
// Return the world as the contolled area
|
||||
|
||||
returnarea()
|
||||
return world
|
||||
|
||||
@@ -0,0 +1,287 @@
|
||||
/*
|
||||
* Card -- the identification computer
|
||||
*
|
||||
* Used to alter the settings of an ID card
|
||||
* Also provides a crew manifest
|
||||
*
|
||||
*/
|
||||
|
||||
obj/machinery/computer/card
|
||||
name = "Identification Computer"
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "id_computer"
|
||||
|
||||
var
|
||||
obj/item/weapon/card/id/scan = null // The ID card used to authenticate
|
||||
// Must be assigned to Captain or Head of Personnel
|
||||
obj/item/weapon/card/id/modify = null // The ID card to modify
|
||||
authenticated = 0 // true if Capt/HoP card is authenticated
|
||||
mode = 0 // 0 = show card edit, 1 = show crew manifest
|
||||
printing = null // true if printing the crew manifest
|
||||
|
||||
|
||||
|
||||
// Attack with object same as interact
|
||||
|
||||
attackby(obj/I, mob/user)
|
||||
src.attack_hand(user)
|
||||
|
||||
|
||||
// Monkey interact same as human
|
||||
|
||||
attack_paw(mob/user)
|
||||
return src.attack_hand(user)
|
||||
|
||||
|
||||
// Human interact.
|
||||
// Show interaction window
|
||||
|
||||
attack_hand(mob/user)
|
||||
|
||||
if(stat & (NOPOWER|BROKEN) ) return
|
||||
|
||||
user.machine = src
|
||||
var/dat
|
||||
if (!( ticker ))
|
||||
return
|
||||
|
||||
if (src.mode)
|
||||
|
||||
var/d2 = "Confirm Identity: <A href='?src=\ref[src];scan=1'>[(src.scan ? text("[]", src.scan.name) : "----------")]</A>\n[(src.authenticated ? "You are logged in!" :"<A href='?src=\ref[src];auth=1'>{Log in}</A>")]"
|
||||
|
||||
var/d1 = "Please use security Records to modify entries.<BR>"
|
||||
for(var/datum/data/record/t in data_core.general)
|
||||
d1 += "[t.fields["name"]] - [t.fields["rank"]]<BR>"
|
||||
|
||||
dat = "<HTML><HEAD></HEAD><BODY><TT>[d2]<BR>\n<BR>\n<B>Crew Manifest:</B><BR>\n[d1]\n<BR>\n<A href='?src=\ref[src];print=1'>Print</A><BR>\n<BR>\n<A href='?src=\ref[src];mode=0'>Access ID modification console.</A><BR>\n</TT></BODY></HTML>"
|
||||
else
|
||||
var/d1 = "<A href='?src=\ref[src];auth=1'>{Log in}</A>"
|
||||
if ((src.authenticated && src.modify))
|
||||
var/vo = null
|
||||
var/va = null
|
||||
var/vl = null
|
||||
var/ve = null
|
||||
switch(src.modify.access_level)
|
||||
if(1.0)
|
||||
vo = "<A href='?src=\ref[src];vo=-1'>0</A> 1 <A href='?src=\ref[src];vo=2'>2</A> <A href='?src=\ref[src];vo=3'>3</A> <A href='?src=\ref[src];vo=4'>4</A> <A href='?src=\ref[src];vo=5'>5</A>"
|
||||
if(2.0)
|
||||
vo = "<A href='?src=\ref[src];vo=-1'>0</A> <A href='?src=\ref[src];vo=1'>1</A> 2 <A href='?src=\ref[src];vo=3'>3</A> <A href='?src=\ref[src];vo=4'>4</A> <A href='?src=\ref[src];vo=5'>5</A>"
|
||||
if(3.0)
|
||||
vo = "<A href='?src=\ref[src];vo=-1'>0</A> <A href='?src=\ref[src];vo=1'>1</A> <A href='?src=\ref[src];vo=2'>2</A> 3 <A href='?src=\ref[src];vo=4'>4</A> <A href='?src=\ref[src];vo=5'>5</A>"
|
||||
if(4.0)
|
||||
vo = "<A href='?src=\ref[src];vo=-1'>0</A> <A href='?src=\ref[src];vo=1'>1</A> <A href='?src=\ref[src];vo=2'>2</A> <A href='?src=\ref[src];vo=3'>3</A> 4 <A href='?src=\ref[src];vo=5'>5</A>"
|
||||
if(5.0)
|
||||
vo = "<A href='?src=\ref[src];vo=-1'>0</A> <A href='?src=\ref[src];vo=1'>1</A> <A href='?src=\ref[src];vo=2'>2</A> <A href='?src=\ref[src];vo=3'>3</A> <A href='?src=\ref[src];vo=4'>4</A> 5"
|
||||
else
|
||||
vo = "0 <A href='?src=\ref[src];vo=1'>1</A> <A href='?src=\ref[src];vo=2'>2</A> <A href='?src=\ref[src];vo=3'>3</A> <A href='?src=\ref[src];vo=4'>4</A> <A href='?src=\ref[src];vo=5'>5</A>"
|
||||
switch(src.modify.lab_access)
|
||||
if(1.0)
|
||||
vl = "<A href='?src=\ref[src];vl=-1'>0</A> 1 <A href='?src=\ref[src];vl=2'>2</A> <A href='?src=\ref[src];vl=3'>3</A> <A href='?src=\ref[src];vl=4'>4</A> <A href='?src=\ref[src];vl=5'>5</A>"
|
||||
if(2.0)
|
||||
vl = "<A href='?src=\ref[src];vl=-1'>0</A> <A href='?src=\ref[src];vl=1'>1</A> 2 <A href='?src=\ref[src];vl=3'>3</A> <A href='?src=\ref[src];vl=4'>4</A> <A href='?src=\ref[src];vl=5'>5</A>"
|
||||
if(3.0)
|
||||
vl = "<A href='?src=\ref[src];vl=-1'>0</A> <A href='?src=\ref[src];vl=1'>1</A> <A href='?src=\ref[src];vl=2'>2</A> 3 <A href='?src=\ref[src];vl=4'>4</A> <A href='?src=\ref[src];vl=5'>5</A>"
|
||||
if(4.0)
|
||||
vl = "<A href='?src=\ref[src];vl=-1'>0</A> <A href='?src=\ref[src];vl=1'>1</A> <A href='?src=\ref[src];vl=2'>2</A> <A href='?src=\ref[src];vl=3'>3</A> 4 <A href='?src=\ref[src];vl=5'>5</A>"
|
||||
if(5.0)
|
||||
vl = "<A href='?src=\ref[src];vl=-1'>0</A> <A href='?src=\ref[src];vl=1'>1</A> <A href='?src=\ref[src];vl=2'>2</A> <A href='?src=\ref[src];vl=3'>3</A> <A href='?src=\ref[src];vl=4'>4</A> 5"
|
||||
else
|
||||
vl = "0 <A href='?src=\ref[src];vl=1'>1</A> <A href='?src=\ref[src];vl=2'>2</A> <A href='?src=\ref[src];vl=3'>3</A> <A href='?src=\ref[src];vl=4'>4</A> <A href='?src=\ref[src];vl=5'>5</A>"
|
||||
switch(src.modify.engine_access)
|
||||
if(1.0)
|
||||
ve = "<A href='?src=\ref[src];ve=-1'>0</A> 1 <A href='?src=\ref[src];ve=2'>2</A> <A href='?src=\ref[src];ve=3'>3</A> <A href='?src=\ref[src];ve=4'>4</A> <A href='?src=\ref[src];ve=5'>5</A>"
|
||||
if(2.0)
|
||||
ve = "<A href='?src=\ref[src];ve=-1'>0</A> <A href='?src=\ref[src];ve=1'>1</A> 2 <A href='?src=\ref[src];ve=3'>3</A> <A href='?src=\ref[src];ve=4'>4</A> <A href='?src=\ref[src];ve=5'>5</A>"
|
||||
if(3.0)
|
||||
ve = "<A href='?src=\ref[src];ve=-1'>0</A> <A href='?src=\ref[src];ve=1'>1</A> <A href='?src=\ref[src];ve=2'>2</A> 3 <A href='?src=\ref[src];ve=4'>4</A> <A href='?src=\ref[src];ve=5'>5</A>"
|
||||
if(4.0)
|
||||
ve = "<A href='?src=\ref[src];ve=-1'>0</A> <A href='?src=\ref[src];ve=1'>1</A> <A href='?src=\ref[src];ve=2'>2</A> <A href='?src=\ref[src];ve=3'>3</A> 4 <A href='?src=\ref[src];ve=5'>5</A>"
|
||||
if(5.0)
|
||||
ve = "<A href='?src=\ref[src];ve=-1'>0</A> <A href='?src=\ref[src];ve=1'>1</A> <A href='?src=\ref[src];ve=2'>2</A> <A href='?src=\ref[src];ve=3'>3</A> <A href='?src=\ref[src];ve=4'>4</A> 5"
|
||||
else
|
||||
ve = "0 <A href='?src=\ref[src];ve=1'>1</A> <A href='?src=\ref[src];ve=2'>2</A> <A href='?src=\ref[src];ve=3'>3</A> <A href='?src=\ref[src];ve=4'>4</A> <A href='?src=\ref[src];ve=5'>5</A>"
|
||||
switch(src.modify.air_access)
|
||||
if(1.0)
|
||||
va = "<A href='?src=\ref[src];va=-1'>0</A> 1 <A href='?src=\ref[src];va=2'>2</A> <A href='?src=\ref[src];va=3'>3</A> <A href='?src=\ref[src];va=4'>4</A> <A href='?src=\ref[src];va=5'>5</A>"
|
||||
if(2.0)
|
||||
va = "<A href='?src=\ref[src];va=-1'>0</A> <A href='?src=\ref[src];va=1'>1</A> 2 <A href='?src=\ref[src];va=3'>3</A> <A href='?src=\ref[src];va=4'>4</A> <A href='?src=\ref[src];va=5'>5</A>"
|
||||
if(3.0)
|
||||
va = "<A href='?src=\ref[src];va=-1'>0</A> <A href='?src=\ref[src];va=1'>1</A> <A href='?src=\ref[src];va=2'>2</A> 3 <A href='?src=\ref[src];va=4'>4</A> <A href='?src=\ref[src];va=5'>5</A>"
|
||||
if(4.0)
|
||||
va = "<A href='?src=\ref[src];va=-1'>0</A> <A href='?src=\ref[src];va=1'>1</A> <A href='?src=\ref[src];va=2'>2</A> <A href='?src=\ref[src];va=3'>3</A> 4 <A href='?src=\ref[src];va=5'>5</A>"
|
||||
if(5.0)
|
||||
va = "<A href='?src=\ref[src];va=-1'>0</A> <A href='?src=\ref[src];va=1'>1</A> <A href='?src=\ref[src];va=2'>2</A> <A href='?src=\ref[src];va=3'>3</A> <A href='?src=\ref[src];va=4'>4</A> 5"
|
||||
else
|
||||
va = "0 <A href='?src=\ref[src];va=1'>1</A> <A href='?src=\ref[src];va=2'>2</A> <A href='?src=\ref[src];va=3'>3</A> <A href='?src=\ref[src];va=4'>4</A> <A href='?src=\ref[src];va=5'>5</A>"
|
||||
|
||||
var/list/L = list( "Research Assistant", "Staff Assistant", "Medical Assistant", "Technical Assistant", "Engineer", "Forensic Technician", "Research Technician", "Medical Doctor", "Captain", "Security Officer", "Medical Researcher", "Toxin Researcher", "Head of Research", "Head of Personnel", "Station Technician", "Atmospheric Technician", "Unassigned", "Systems", "Custom" )
|
||||
var/assign = ""
|
||||
if (istype(user, /mob/human))
|
||||
var/counter = 1
|
||||
for(var/t in L)
|
||||
assign += "<A href='?src=\ref[src];assign=[t]'>[t]</A> "
|
||||
counter++
|
||||
if (counter >= 3)
|
||||
assign += "<BR>"
|
||||
counter = 1
|
||||
|
||||
d1 = "[src.modify.name] :<BR>\nGeneral Access Level: [vo]<BR>\nLaboratory Access: [vl]<BR>\nReactor/Engine Access: [ve]<BR>\nMain Systems Access: [va]<BR>\nRegistered: <A href='?src=\ref[src];reg=1'>[src.modify.registered ? "[src.modify.registered]" : "{None: Click to modify}"]</A><BR>\nAssignment: [src.modify.assignment ? "[src.modify.assignment]" : "None"]<BR>\n[assign]<BR>"
|
||||
else
|
||||
var/counter = 1
|
||||
for(var/t in L)
|
||||
assign += "<A href='?src=\ref[src];assign=[t]'>[stars(t)]</A> "
|
||||
counter++
|
||||
if (counter >= 4)
|
||||
assign += "<BR>"
|
||||
counter = 1
|
||||
|
||||
d1 = "[stars(modify.name)] :<BR>\n[stars("General Access Level:")] [vo]<BR>\n[stars("Laboratory Access:")] [vl]<BR>\n[stars("Reactor/Engine Access:")] [ve]<BR>\n[stars("Main Systems Access:")] [va]<BR>\n[stars("Registered:")] <A href='?src=\ref[src];reg=1'>[src.modify.registered ? stars(src.modify.registered) : stars("{None: Click to modify}")]</A><BR>\n[stars("Assignment:")] [src.modify.assignment ? "[stars(src.modify.assignment)]" : "None"]<BR>\n[assign]<BR>"
|
||||
|
||||
|
||||
if (istype(user, /mob/human))
|
||||
dat = text("<TT><B>Identification Card Modifier</B><BR>\n<I>Please Insert the cards into the slots</I><BR>\nTarget: <A href='?src=\ref[];modify=1'>[]</A><BR>\nConfirm Identity: <A href='?src=\ref[];scan=1'>[]</A><BR>\n-----------------<BR>\n[]<BR>\n<BR>\n<BR>\n<A href='?src=\ref[];mode=1'>Access Crew Manifest</A><BR>\n</TT>", src, (src.modify ? text("[]", src.modify.name) : "----------"), src, (src.scan ? text("[]", src.scan.name) : "----------"), d1, src)
|
||||
else
|
||||
dat = text("<TT><B>[]</B><BR>\n<I>[]</I><BR>\n[] <A href='?src=\ref[];modify=1'>[]</A><BR>\n[] <A href='?src=\ref[];scan=1'>[]</A><BR>\n-----------------<BR>\n[]<BR>\n<BR>\n<BR>\n<A href='?src=\ref[];mode=1'>[]</A><BR>\n</TT>", stars("Identification Card Modifier"), stars("Please Insert the cards into the slots"), stars("Target:"), src, (src.modify ? text("[]", stars(src.modify.name)) : "----------"), stars("Confirm Identity:"), src, (src.scan ? text("[]", stars(src.scan.name)) : "----------"), d1, src, stars("Access Crew Manifest"))
|
||||
user << browse(dat, "window=id_com;size=400x500")
|
||||
|
||||
|
||||
// Handle topic links from interaction window
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
usr << browse(null, "window=id_com")
|
||||
return
|
||||
|
||||
if(usr.restrained() || usr.lying) return
|
||||
|
||||
if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey"))))
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
if ((usr.stat || usr.restrained()))
|
||||
return
|
||||
|
||||
if ((get_dist(src, usr) <= 1 && istype(src.loc, /turf)))
|
||||
usr.machine = src
|
||||
if (href_list["modify"])
|
||||
if (src.modify)
|
||||
src.modify.name = "[src.modify.registered]'s ID Card ([src.modify.access_level]>[src.modify.lab_access]-[src.modify.engine_access]-[src.modify.air_access])"
|
||||
src.modify.loc = src.loc
|
||||
src.modify = null
|
||||
else
|
||||
var/obj/item/I = usr.equipped()
|
||||
if (istype(I, /obj/item/weapon/card/id))
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
src.modify = I
|
||||
src.authenticated = 0
|
||||
|
||||
if (href_list["scan"])
|
||||
if (src.scan)
|
||||
src.scan.loc = src.loc
|
||||
src.scan = null
|
||||
else
|
||||
var/obj/item/I = usr.equipped()
|
||||
if (istype(I, /obj/item/weapon/card/id))
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
src.scan = I
|
||||
src.authenticated = 0
|
||||
|
||||
if (href_list["auth"])
|
||||
if ((!( src.authenticated ) && src.scan && (src.modify || src.mode)))
|
||||
if ((src.scan.assignment == "Captain" || src.scan.assignment == "Head of Personnel"))
|
||||
src.authenticated = 1
|
||||
|
||||
if (href_list["vo"])
|
||||
if (src.authenticated)
|
||||
var/t1 = text2num(href_list["vo"])
|
||||
if (t1 == -1.0)
|
||||
t1 = 0
|
||||
src.modify.access_level = t1
|
||||
|
||||
if (href_list["vl"])
|
||||
if (src.authenticated)
|
||||
var/t1 = text2num(href_list["vl"])
|
||||
if (t1 == -1.0)
|
||||
t1 = 0
|
||||
src.modify.lab_access = t1
|
||||
|
||||
if (href_list["ve"])
|
||||
if (src.authenticated)
|
||||
var/t1 = text2num(href_list["ve"])
|
||||
if (t1 == -1.0)
|
||||
t1 = 0
|
||||
src.modify.engine_access = t1
|
||||
|
||||
if (href_list["va"])
|
||||
if (src.authenticated)
|
||||
var/t1 = text2num(href_list["va"])
|
||||
if (t1 == -1.0)
|
||||
t1 = 0
|
||||
src.modify.air_access = t1
|
||||
|
||||
if (href_list["assign"])
|
||||
if (src.authenticated)
|
||||
var/t1 = href_list["assign"]
|
||||
|
||||
if(t1 == "Custom")
|
||||
t1 = input("Enter a custom job assignment.","Assignment")
|
||||
|
||||
src.modify.assignment = t1
|
||||
|
||||
if (href_list["reg"])
|
||||
if (src.authenticated)
|
||||
var/t2 = src.modify
|
||||
var/t1 = input(usr, "What name?", "ID computer", null) as text
|
||||
if ((src.authenticated && src.modify == t2 && get_dist(src, usr) <= 1 && istype(src.loc, /turf)))
|
||||
src.modify.registered = t1
|
||||
|
||||
if (href_list["mode"])
|
||||
src.mode = text2num(href_list["mode"])
|
||||
|
||||
if (href_list["print"])
|
||||
if (!( src.printing ))
|
||||
src.printing = 1
|
||||
sleep(50)
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( src.loc )
|
||||
var/t1 = "<B>Crew Manifest:</B><BR>"
|
||||
for(var/datum/data/record/t in data_core.general)
|
||||
t1 += "<B>[t.fields["name"]]</B> - [t.fields["rank"]]<BR>"
|
||||
|
||||
P.info = "[t1]"
|
||||
P.name = "paper- 'Crew Manifest'"
|
||||
src.printing = null
|
||||
|
||||
if (href_list["mode"])
|
||||
src.authenticated = 0
|
||||
src.mode = text2num(href_list["mode"])
|
||||
if (src.modify)
|
||||
src.modify.name = "[src.modify.registered]'s ID Card ([src.modify.access_level]>[src.modify.lab_access]-[src.modify.engine_access]-[src.modify.air_access])"
|
||||
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
else
|
||||
usr << browse(null, "window=id_com")
|
||||
|
||||
|
||||
// Called when area power state changes
|
||||
// Update machione stat and icon_state
|
||||
|
||||
power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broken"
|
||||
else
|
||||
if( powered() )
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "id_unpowered"
|
||||
stat |= NOPOWER
|
||||
|
||||
|
||||
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
* Communications -- the communications computer
|
||||
*
|
||||
* Used to call the emergency shuttle.
|
||||
*/
|
||||
|
||||
obj/machinery/computer/communications
|
||||
name = "communications"
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "comm_computer"
|
||||
|
||||
|
||||
// Call the shuttle
|
||||
|
||||
verb/call_shuttle()
|
||||
set src in oview(1)
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
if(stat & NOPOWER) return
|
||||
|
||||
if ((!( ticker ) || ticker.shuttle_location == 1))
|
||||
return
|
||||
|
||||
if( ticker.mode == "blob" ) // Shuttle cannot be called in blob mode
|
||||
usr << "Under directive 7-10, SS13 is quarantined until further notice."
|
||||
return
|
||||
|
||||
world << "\blue <B>Alert: The emergency shuttle has been called. It will arrive in T-10:00 minutes.</B>"
|
||||
if (!( ticker.timeleft ))
|
||||
ticker.timeleft = 6000
|
||||
ticker.timing = 1
|
||||
|
||||
|
||||
// Cancel the shuttle call
|
||||
|
||||
verb/cancel_call()
|
||||
set src in oview(1)
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
if(stat & NOPOWER) return
|
||||
if ((!( ticker ) || ticker.shuttle_location == 1 || ticker.timing == 0 || ticker.timeleft < 300))
|
||||
return
|
||||
if( ticker.mode == "blob" )
|
||||
return
|
||||
|
||||
world << "\blue <B>Alert: The shuttle is going back!</B>"
|
||||
ticker.timing = -1.0
|
||||
@@ -0,0 +1,114 @@
|
||||
/*
|
||||
* Data -- A computer that displays data
|
||||
*
|
||||
* All these do is display a list of entries, Each entry can be read to display information about it.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
obj/machinery/computer/data
|
||||
name = "data"
|
||||
icon = 'weap_sat.dmi'
|
||||
icon_state = "computer"
|
||||
|
||||
var
|
||||
list/topics = list( ) // An associative list of entries and content
|
||||
|
||||
|
||||
// Display the list of entries
|
||||
|
||||
verb/display()
|
||||
set src in oview(1)
|
||||
|
||||
for(var/x in src.topics)
|
||||
usr << "[x], \..."
|
||||
|
||||
usr << ""
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
|
||||
// Display the content of an entry, given the entry name as an argument
|
||||
|
||||
verb/read(topic as text)
|
||||
set src in oview(1)
|
||||
|
||||
if (src.topics[text("[]", topic)])
|
||||
usr << "<B>[topic]</B>\n\t [src.topics["[topic]"]]"
|
||||
else
|
||||
usr << "Unable to find- [topic]"
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
|
||||
|
||||
weapon
|
||||
name = "weapon"
|
||||
|
||||
info
|
||||
name = "Research Computer"
|
||||
|
||||
// Create the entries and content for this computer
|
||||
|
||||
New()
|
||||
..()
|
||||
src.topics["LOG(001)"] = "System: Deployment successful"
|
||||
src.topics["LOG(002)"] = "System: Safe orbit at inclination .003 established"
|
||||
src.topics["LOG(003)"] = "CenCom: Attempting test fire...ALERT(001)"
|
||||
src.topics["ALERT(001)"] = "System: Cannot attempt test fire"
|
||||
src.topics["LOG(004)"] = "System: Airlock accessed..."
|
||||
src.topics["LOG(005)"] = "System: System successfully reset...Generator engaged"
|
||||
src.topics["LOG(006)"] = "Physical: Super-heater (W005) added to power grid"
|
||||
src.topics["LOG(007)"] = "Physical: Amplifier (W007) added to power grid"
|
||||
src.topics["LOG(008)"] = "Physical: Plasma Energizer (W006) added to power grid"
|
||||
src.topics["LOG(009)"] = "Physical: Laser (W004) added to power grid"
|
||||
src.topics["LOG(010)"] = "Physical: Laser test firing"
|
||||
src.topics["LOG(011)"] = "Physical: Plasma added to Super-heater"
|
||||
src.topics["LOG(012)"] = "Physical: Orient N12.525,E22.124"
|
||||
src.topics["LOG(013)"] = "System: Location N12.525,E22.124"
|
||||
src.topics["LOG(014)"] = "Physical: Test fire...successful"
|
||||
src.topics["LOG(015)"] = "Physical: Airlock accessed..."
|
||||
src.topics["LOG(016)"] = "******: Disable locater systems"
|
||||
src.topics["LOG(017)"] = "System: Locater Beacon-Disengaged,CenCom link-Cut...ALERT(002)"
|
||||
src.topics["ALERT(002)"] = "System: Cannot seem to establish contact with Central Command"
|
||||
src.topics["LOG(018)"] = "******: Shutting down all systems...ALERT(003)"
|
||||
src.topics["ALERT(003)"] = "System: Power grid failure-Activating back-up power...ALERT(004)"
|
||||
src.topics["ALERT(004)"] = "System: Engine failure...All systems deactivated."
|
||||
|
||||
|
||||
// Overrides display verb to show a title
|
||||
|
||||
display()
|
||||
set src in oview(1)
|
||||
|
||||
usr << "<B>Research Information:</B>"
|
||||
..()
|
||||
return
|
||||
|
||||
|
||||
log
|
||||
name = "Log Computer"
|
||||
|
||||
|
||||
// Create the list for this computer
|
||||
|
||||
New()
|
||||
..()
|
||||
src.topics["Super-heater"] = "This turns a can of semi-liquid plasma into a super-heated ball of plasma."
|
||||
src.topics["Amplifier"] = "This increases the intensity of a laser."
|
||||
src.topics["Class 11 Laser"] = "This creates a very slow laser that is capable of penetrating most objects."
|
||||
src.topics["Plasma Energizer"] = "This combines super-heated plasma with a laser beam."
|
||||
src.topics["Generator"] = "This controls the entire power grid."
|
||||
src.topics["Mirror"] = "this can reflect LOW power lasers. HIGH power goes through it!"
|
||||
src.topics["Targetting Prism"] = "This focuses a laser coming from any direction forward."
|
||||
|
||||
|
||||
// Override display verb to show a title
|
||||
|
||||
display()
|
||||
set src in oview(1)
|
||||
|
||||
usr << "<B>Research Log:</B>"
|
||||
..()
|
||||
return
|
||||
|
||||
@@ -0,0 +1,133 @@
|
||||
/*
|
||||
* 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)
|
||||
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
|
||||
|
||||
// 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)
|
||||
|
||||
|
||||
// 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 = "<TT>[src.temp]</TT><BR><BR><A href='?src=\ref[src];temp=1'>Clear Screen</A>"
|
||||
else if (engine_eject_control.status == 0)
|
||||
dat = "<B>Engine Gas Monitor</B><HR>"
|
||||
if(gs)
|
||||
dat += "[gs.sense_string()]"
|
||||
|
||||
else
|
||||
dat += "No sensor found."
|
||||
|
||||
dat += "<BR><B>Engine Ejection Module</B><HR>\nStatus: Docked<BR>\n<BR>\nCountdown: [engine_eject_control.timeleft]/60 <A href='?src=\ref[src];reset=1'>\[Reset\]</A><BR>\n<BR>\n<A href='?src=\ref[src];eject=1'>Eject Engine</A><BR>\n<BR>\n<A href='?src=\ref[user];mach_close=computer'>Close</A>"
|
||||
else
|
||||
if (engine_eject_control.status == 1)
|
||||
dat = "<B>Engine Ejection Module</B><HR>\nStatus: Ejecting<BR>\n<BR>\nCountdown: [engine_eject_control.timeleft]/60 \[Reset\]<BR>\n<BR>\n<A href='?src=\ref[src];stop=1'>Stop Ejection</A><BR>\n<BR>\n<A href='?src=\ref[user];mach_close=computer'>Close</A>"
|
||||
else
|
||||
dat = "<B>Engine Ejection Module</B><HR>\nStatus: Ejected<BR>\n<BR>\nCountdown: N/60 \[Reset\]<BR>\n<BR>\nEngine Ejected!<BR>\n<BR>\n<A href='?src=\ref[user];mach_close=computer'>Close</A>"
|
||||
user << 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"))))
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
if ((usr.stat || usr.restrained()))
|
||||
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?<BR><BR><B><A href='?src=\ref[src];eject2=1'>\[Swipe ID to initiate eject sequence\]</A></B><BR><A href='?src=\ref[src];temp=1'>Cancel</A>"
|
||||
|
||||
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 << "\red Access Denied."
|
||||
else if (href_list["stop"])
|
||||
if (engine_eject_control.status > 0)
|
||||
src.temp = text("Stop Ejection?<BR><BR><A href='?src=\ref[];stop2=1'>Yes</A><BR><A href='?src=\ref[];temp=1'>No</A>", 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)
|
||||
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
@@ -0,0 +1,159 @@
|
||||
/*
|
||||
* /obj/machinery/computer/hologram_comp - Hologram computer
|
||||
*
|
||||
* /obj/machinery/holograp_proj - Hologram projector
|
||||
*
|
||||
* /obj/projection - Hologram projection
|
||||
*
|
||||
* Used to display a mob with variable skin colour, hair, etc.
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* The hologram computer
|
||||
*/
|
||||
|
||||
|
||||
obj/machinery/computer/hologram_comp
|
||||
name = "Hologram Computer"
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "holo_console0"
|
||||
|
||||
var
|
||||
obj/machinery/hologram_proj/projector = null // the projector object associated with this computer
|
||||
temp = null // temporary text for interaction window (not used)
|
||||
lumens = 0.0 // brightness of the hologram skin image
|
||||
h_r = 245.0 //
|
||||
h_g = 245.0 // RGB settings for the hologram hair
|
||||
h_b = 245.0 //
|
||||
|
||||
|
||||
// Create a new computer
|
||||
// After world has finished loading, located the hologram projector to the north
|
||||
|
||||
New()
|
||||
..()
|
||||
spawn( 10 )
|
||||
src.projector = locate(/obj/machinery/hologram_proj, get_step(src.loc, NORTH))
|
||||
|
||||
|
||||
// Interact when double clicked
|
||||
// Possibly using this instead of usual attack_hand() because its designed to be used before game starts
|
||||
// However this doesn't seem to be necessary in the current code
|
||||
|
||||
DblClick()
|
||||
if (get_dist(src, usr) > 1)
|
||||
return 0
|
||||
src.show_console(usr)
|
||||
|
||||
|
||||
// Render a human male with the current settings
|
||||
// Set the projector to use the resulting icon
|
||||
|
||||
proc/render()
|
||||
var/icon/I = new /icon( 'human.dmi', "male" )
|
||||
if (src.lumens >= 0)
|
||||
I.Blend(rgb(src.lumens, src.lumens, src.lumens), 0)
|
||||
else
|
||||
I.Blend(rgb(- src.lumens, -src.lumens, -src.lumens), 1)
|
||||
I.Blend(new /icon( 'human.dmi', "mouth" ), 3)
|
||||
var/icon/U = new /icon( 'human.dmi', "diaper" )
|
||||
U.Blend(U, 3)
|
||||
U = new /icon( 'mob.dmi', "hair_a" )
|
||||
U.Blend(rgb(src.h_r, src.h_g, src.h_b), 0)
|
||||
I.Blend(U, 3)
|
||||
src.projector.projection.icon = I
|
||||
|
||||
|
||||
// Show interaction window
|
||||
|
||||
proc/show_console(var/mob/user)
|
||||
|
||||
var/dat
|
||||
user.machine = src
|
||||
if (src.temp)
|
||||
dat = "[temp]<BR><BR><A href='?src=\ref[src];temp=1'>Clear</A>"
|
||||
else
|
||||
dat = {"<B>Hologram Status:</B><HR>
|
||||
Power: <A href='?src=\ref[src];power=1'>[(src.projector.projection ? "On" : "Off")]</A><HR>
|
||||
<B>Hologram Control:</B><BR>
|
||||
Color Luminosity: [-src.lumens + 35]/220 <A href='?src=\ref[src];reset=1'>\[Reset\]</A><BR>
|
||||
Lighten: <A href='?src=\ref[src];light=1'>1</A> <A href='?src=\ref[src];light=10'>10</A><BR>
|
||||
Darken: <A href='?src=\ref[src];light=-1'>1</A> <A href='?src=\ref[src];light=-10'>10</A><BR>
|
||||
<BR>
|
||||
Hair Color: ([h_r],[h_g],[h_b]) <A href='?src=\ref[src];h_reset=1'>\[Reset\]</A><BR>
|
||||
Red (0-255): <A href='?src=\ref[src];h_r=-300'>\[0\]</A> <A href='?src=\ref[src];h_r=-10'>-10</A> <A href='?src=\ref[src];h_r=-1'>-1</A> [h_r] <A href='?src=\ref[src];h_r=1'>1</A> <A href='?src=\ref[src];h_r=10'>10</A> <A href='?src=\ref[src];h_r=300'>\[255\]</A><BR>
|
||||
Green (0-255): <A href='?src=\ref[src];h_g=-300'>\[0\]</A> <A href='?src=\ref[src];h_g=-10'>-10</A> <A href='?src=\ref[src];h_g=-1'>-1</A> [h_g] <A href='?src=\ref[src];h_g=1'>1</A> <A href='?src=\ref[src];h_g=10'>10</A> <A href='?src=\ref[src];h_g=300'>\[255\]</A><BR>
|
||||
Blue (0-255): <A href='?src=\ref[src];h_b=-300'>\[0\]</A> <A href='?src=\ref[src];h_b=-10'>-10</A> <A href='?src=\ref[src];h_b=-1'>-1</A> [h_b] <A href='?src=\ref[src];h_b=1'>1</A> <A href='?src=\ref[src];h_b=10'>10</A> <A href='?src=\ref[src];h_b=300'>\[255\]</A><BR>"}
|
||||
user << browse(dat, "window=hologram_console")
|
||||
|
||||
|
||||
// Handle topic links from window
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
if (get_dist(src, usr) <= 1)
|
||||
flick("holo_console1", src)
|
||||
if (href_list["power"])
|
||||
if (src.projector.projection) // remove the current projection
|
||||
src.projector.icon_state = "hologram0"
|
||||
del(src.projector.projection)
|
||||
else // create a new projection
|
||||
src.projector.projection = new /obj/projection( src.projector.loc )
|
||||
src.projector.projection.icon = 'human.dmi'
|
||||
src.projector.projection.icon_state = "male"
|
||||
src.projector.icon_state = "hologram1"
|
||||
src.render()
|
||||
else if (href_list["h_r"])
|
||||
if (src.projector.projection)
|
||||
src.h_r += text2num(href_list["h_r"])
|
||||
src.h_r = min(max(src.h_r, 0), 255)
|
||||
render()
|
||||
else if (href_list["h_g"])
|
||||
if (src.projector.projection)
|
||||
src.h_g += text2num(href_list["h_g"])
|
||||
src.h_g = min(max(src.h_g, 0), 255)
|
||||
render()
|
||||
else if (href_list["h_b"])
|
||||
if (src.projector.projection)
|
||||
src.h_b += text2num(href_list["h_b"])
|
||||
src.h_b = min(max(src.h_b, 0), 255)
|
||||
render()
|
||||
else if (href_list["light"])
|
||||
if (src.projector.projection)
|
||||
src.lumens += text2num(href_list["light"])
|
||||
src.lumens = min(max(src.lumens, -185.0), 35)
|
||||
render()
|
||||
else if (href_list["reset"])
|
||||
if (src.projector.projection)
|
||||
src.lumens = 0
|
||||
render()
|
||||
else if (href_list["temp"])
|
||||
src.temp = null
|
||||
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.show_console(M)
|
||||
|
||||
|
||||
/*
|
||||
* The hologram projector
|
||||
*/
|
||||
|
||||
|
||||
obj/machinery/hologram_proj
|
||||
name = "Hologram Projector"
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "hologram0"
|
||||
anchored = 1
|
||||
var
|
||||
obj/projection/projection = null // the projection object
|
||||
|
||||
|
||||
/*
|
||||
* The projected hologram
|
||||
*/
|
||||
|
||||
/obj/projection
|
||||
name = "Projection"
|
||||
anchored = 1.0
|
||||
@@ -0,0 +1,399 @@
|
||||
/*
|
||||
* Med_data -- a computer that shows player medical data.
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
|
||||
obj/machinery/computer/med_data
|
||||
name = "Medical Records"
|
||||
icon = 'weap_sat.dmi'
|
||||
icon_state = "computer"
|
||||
var
|
||||
obj/item/weapon/card/id/scan = null // ID card inserted in the computer
|
||||
authenticated = null // name on ID card (if has access)
|
||||
rank = null // job assignment of ID card
|
||||
screen = null // active screen displayed
|
||||
// 1=menu, 2=list of records, 3=maint. menu ,4=record edit
|
||||
datum/data/record/active1 = null // selected general record (from data_core.general)
|
||||
datum/data/record/active2 = null // selected medical record (from data_code.medical)
|
||||
a_id = null // not used
|
||||
temp = null // temporary text to show in window
|
||||
printing = null // true if printing a record
|
||||
allowed = "Medical Researcher/Medical Doctor/Head of Personnel/Captain" // the job assignments which have access
|
||||
access // the access levels which have access (none)
|
||||
|
||||
|
||||
// Monkey interact same as human
|
||||
|
||||
attack_paw(mob/user)
|
||||
return src.attack_hand(user)
|
||||
|
||||
|
||||
// Human interact
|
||||
// Show interaction window
|
||||
|
||||
attack_hand(mob/user)
|
||||
|
||||
var/dat
|
||||
if (src.temp) // show temporary text
|
||||
dat = "<TT>[temp]</TT><BR><BR><A href='?src=\ref[src];temp=1'>Clear Screen</A>"
|
||||
else // show ID card inserted
|
||||
dat = "Confirm Identity: <A href='?src=\ref[src];scan=1'>[src.scan ? "[src.scan.name]" : "----------"]</A><HR>"
|
||||
if (src.authenticated)
|
||||
switch(src.screen)
|
||||
if(1.0)
|
||||
dat += {"<A href='?src=\ref[src];search=1'>Search Records</A><BR>
|
||||
<A href='?src=\ref[src];list=1'>List Records</A><BR>
|
||||
<BR>
|
||||
<A href='?src=\ref[src];rec_m=1'>Record Maintenance</A><BR>
|
||||
<A href='?src=\ref[src];logout=1'>{Log Out}</A><BR>
|
||||
"}
|
||||
if(2.0)
|
||||
dat += "<B>Record List</B>:<HR>"
|
||||
for(var/datum/data/record/R in data_core.general)
|
||||
dat += "<A href='?src=\ref[src];d_rec=\ref[R]'>[R.fields["id"]]: [R.fields["name"]]<BR>"
|
||||
|
||||
dat += "<HR><A href='?src=\ref[src];main=1'>Back</A>"
|
||||
if(3.0)
|
||||
dat += {"<B>Records Maintenance</B><HR>
|
||||
<A href='?src=\ref[src];back=1'>Backup To Disk</A><BR>
|
||||
<A href='?src=\ref[src];u_load=1'>Upload From disk</A><BR>
|
||||
<A href='?src=\ref[src];del_all=1'>Delete All Records</A><BR>
|
||||
<BR>
|
||||
<A href='?src=\ref[src];main=1'>Back</A>"}
|
||||
|
||||
if(4.0)
|
||||
dat += "<CENTER><B>Medical Record</B></CENTER><BR>"
|
||||
if ((istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1)))
|
||||
dat += {"Name: [src.active1.fields["name"]] ID: [src.active1.fields["id"]]<BR>
|
||||
Sex: <A href='?src=\ref[src];field=sex'>[src.active1.fields["sex"]]</A><BR>
|
||||
Age: <A href='?src=\ref[src];field=age'>[src.active1.fields["age"]]</A><BR>
|
||||
Fingerprint: <A href='?src=\ref[src];field=fingerprint'>[src.active1.fields["fingerprint"]]</A><BR>
|
||||
Physical Status: <A href='?src=\ref[src];field=p_stat'>[src.active1.fields["p_stat"]]</A><BR>
|
||||
Mental Status: <A href='?src=\ref[src];field=m_stat'>[src.active1.fields["m_stat"]]</A><BR>"}
|
||||
|
||||
else
|
||||
dat += "<B>General Record Lost!</B><BR>"
|
||||
if ((istype(src.active2, /datum/data/record) && data_core.medical.Find(src.active2)))
|
||||
dat += {"<BR>
|
||||
<CENTER><B>Medical Data</B></CENTER><BR>
|
||||
Blood Type: <A href='?src=\ref[src];field=b_type'>[src.active2.fields["b_type"]]</A><BR>
|
||||
<BR>
|
||||
Minor Disabilities: <A href='?src=\ref[src];field=mi_dis'>[src.active2.fields["mi_dis"]]</A><BR>
|
||||
Details: <A href='?src=\ref[src];field=mi_dis_d'>[src.active2.fields["mi_dis_d"]]</A><BR>
|
||||
<BR>
|
||||
Major Disabilities: <A href='?src=\ref[src];field=ma_dis'>[src.active2.fields["ma_dis"]]</A><BR>
|
||||
Details: <A href='?src=\ref[src];field=ma_dis_d'>[src.active2.fields["ma_dis_d"]]</A><BR>
|
||||
<BR>
|
||||
Allergies: <A href='?src=\ref[src];field=alg'>[src.active2.fields["alg"]]</A><BR>
|
||||
Details: <A href='?src=\ref[src];field=alg_d'>[src.active2.fields["alg_d"]]</A><BR>
|
||||
<BR>
|
||||
Current Diseases: <A href='?src=\ref[src];field=cdi'>[src.active2.fields["cdi"]]</A> (per disease info placed in log/comment section)<BR>
|
||||
Details: <A href='?src=\ref[src];field=cdi_d'>[src.active2.fields["cdi_d"]]</A><BR>
|
||||
<BR>
|
||||
Important Notes:<BR>
|
||||
<A href='?src=\ref[src];field=notes'>[src.active2.fields["notes"]]</A><BR>
|
||||
<BR>
|
||||
<CENTER><B>Comments/Log</B></CENTER><BR>"}
|
||||
|
||||
var/counter = 1
|
||||
while(src.active2.fields["com_[counter]"])
|
||||
dat += "[src.active2.fields["com_[counter]"]]<BR><A href='?src=\ref[src];del_c=[counter]'>Delete Entry</A><BR><BR>"
|
||||
counter++
|
||||
dat += "<A href='?src=\ref[src];add_c=1'>Add Entry</A><BR><BR>"
|
||||
dat += "<A href='?src=\ref[src];del_r=1'>Delete Record (Medical Only)</A><BR><BR>"
|
||||
else
|
||||
dat += "<B>Medical Record Lost!</B><BR>"
|
||||
dat += "<A href='?src=\ref[src];new=1'>New Record</A><BR><BR>"
|
||||
dat += "\n<A href='?src=\ref[src];print_p=1'>Print Record</A><BR>\n<A href='?src=\ref[src];list=1'>Back</A><BR>"
|
||||
|
||||
else
|
||||
dat += "<A href='?src=\ref[src];login=1'>{Log In}</A>"
|
||||
user << browse("<HEAD><TITLE>Medical Records</TITLE></HEAD><TT>[dat]</TT>", "window=med_rec")
|
||||
|
||||
|
||||
|
||||
// Handle topic links from interaction window
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
if (!( data_core.general.Find(src.active1) ))
|
||||
src.active1 = null
|
||||
if (!( data_core.medical.Find(src.active2) ))
|
||||
src.active2 = null
|
||||
if ((usr.stat || usr.restrained()))
|
||||
return
|
||||
if ((usr.contents.Find(src) || (get_dist(src, usr) <= 1 && istype(src.loc, /turf))))
|
||||
|
||||
usr.machine = src
|
||||
if (href_list["temp"])
|
||||
src.temp = null // close the temporary display
|
||||
if (href_list["scan"])
|
||||
if (src.scan)
|
||||
src.scan.loc = src.loc // remove ID card from computer
|
||||
src.scan = null
|
||||
else
|
||||
var/obj/item/I = usr.equipped()
|
||||
if (istype(I, /obj/item/weapon/card/id))
|
||||
usr.drop_item()
|
||||
I.loc = src // insert ID card into computer
|
||||
src.scan = I
|
||||
else if (href_list["logout"])
|
||||
src.authenticated = null
|
||||
src.screen = null
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
else if (href_list["login"]) // check inserted ID card against access requirements
|
||||
if (istype(src.scan, /obj/item/weapon/card/id))
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
if(scan.check_access(access, allowed))
|
||||
src.authenticated = src.scan.registered
|
||||
src.rank = src.scan.assignment
|
||||
src.screen = 1
|
||||
if (src.authenticated)
|
||||
if (href_list["list"])
|
||||
src.screen = 2
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
else if (href_list["rec_m"])
|
||||
src.screen = 3
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
else if (href_list["del_all"])
|
||||
src.temp = "Are you sure you wish to delete all records?<br>\n\t<A href='?src=\ref[src];temp=1;del_all2=1'>Yes</A><br>\n\t<A href='?src=\ref[src];temp=1'>No</A><br>"
|
||||
else if (href_list["del_all2"])
|
||||
for(var/datum/data/record/R in data_core.medical)
|
||||
del(R)
|
||||
src.temp = "All records deleted."
|
||||
else if (href_list["main"])
|
||||
src.screen = 1
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
|
||||
else if (href_list["field"]) // edit fields
|
||||
var/a1 = src.active1
|
||||
var/a2 = src.active2
|
||||
switch(href_list["field"])
|
||||
if("fingerprint")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
var/t1 = input("Please input fingerprint hash:", "Med. records", src.active1.fields["id"], null) as text
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || get_dist(src, usr) > 1 || src.active1 != a1))
|
||||
return
|
||||
src.active1.fields["fingerprint"] = t1
|
||||
if("sex")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
if (src.active1.fields["sex"] == "Male")
|
||||
src.active1.fields["sex"] = "Female"
|
||||
else
|
||||
src.active1.fields["sex"] = "Male"
|
||||
if("age")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
var/t1 = input("Please input age:", "Med. records", src.active1.fields["age"], null) as text
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || get_dist(src, usr) > 1 || src.active1 != a1))
|
||||
return
|
||||
src.active1.fields["age"] = t1
|
||||
if("mi_dis")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please input minor disabilities list:", "Med. records", src.active2.fields["mi_dis"], null) as text
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || get_dist(src, usr) > 1 || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["mi_dis"] = t1
|
||||
if("mi_dis_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please summarize minor dis.:", "Med. records", src.active2.fields["mi_dis_d"], null) as message
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || get_dist(src, usr) > 1 || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["mi_dis_d"] = t1
|
||||
if("ma_dis")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please input major diabilities list:", "Med. records", src.active2.fields["ma_dis"], null) as text
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || get_dist(src, usr) > 1 || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["ma_dis"] = t1
|
||||
if("ma_dis_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please summarize major dis.:", "Med. records", src.active2.fields["ma_dis_d"], null) as message
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || get_dist(src, usr) > 1 || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["ma_dis_d"] = t1
|
||||
if("alg")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please state allergies:", "Med. records", src.active2.fields["alg"], null) as text
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || get_dist(src, usr) > 1 || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["alg"] = t1
|
||||
if("alg_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please summarize allergies:", "Med. records", src.active2.fields["alg_d"], null) as message
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || get_dist(src, usr) > 1 || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["alg_d"] = t1
|
||||
if("cdi")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please state diseases:", "Med. records", src.active2.fields["cdi"], null) as text
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || get_dist(src, usr) > 1 || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["cdi"] = t1
|
||||
if("cdi_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please summarize diseases:", "Med. records", src.active2.fields["cdi_d"], null) as message
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || get_dist(src, usr) > 1 || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["cdi_d"] = t1
|
||||
if("notes")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please summarize notes:", "Med. records", src.active2.fields["notes"], null) as message
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || get_dist(src, usr) > 1 || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["notes"] = t1
|
||||
if("p_stat")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
src.temp = text("<B>Physical Condition:</B><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=deceased'>*Deceased*</A><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=unconscious'>*Unconscious*</A><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=active'>Active</A><BR>\n\t<A href='?src=\ref[];temp=1;p_stat=unfit'>Physically Unfit</A><BR>", src, src, src, src)
|
||||
if("m_stat")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
src.temp = text("<B>Mental Condition:</B><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=insane'>*Insane*</A><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=unstable'>*Unstable*</A><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=watch'>*Watch*</A><BR>\n\t<A href='?src=\ref[];temp=1;m_stat=stable'>Stable</A><BR>", src, src, src, src)
|
||||
if("b_type")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
src.temp = text("<B>Blood Type:</B><BR>\n\t<A href='?src=\ref[];temp=1;b_type=an'>A-</A> <A href='?src=\ref[];temp=1;b_type=ap'>A+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=bn'>B-</A> <A href='?src=\ref[];temp=1;b_type=bp'>B+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=abn'>AB-</A> <A href='?src=\ref[];temp=1;b_type=abp'>AB+</A><BR>\n\t<A href='?src=\ref[];temp=1;b_type=on'>O-</A> <A href='?src=\ref[];temp=1;b_type=op'>O+</A><BR>", src, src, src, src, src, src, src, src)
|
||||
|
||||
else if (href_list["p_stat"])
|
||||
if (src.active1)
|
||||
switch(href_list["p_stat"])
|
||||
if("deceased")
|
||||
src.active1.fields["p_stat"] = "*Deceased*"
|
||||
if("unconscious")
|
||||
src.active1.fields["p_stat"] = "*Unconscious*"
|
||||
if("active")
|
||||
src.active1.fields["p_stat"] = "Active"
|
||||
if("unfit")
|
||||
src.active1.fields["p_stat"] = "Physically Unfit"
|
||||
else if (href_list["m_stat"])
|
||||
if (src.active1)
|
||||
switch(href_list["m_stat"])
|
||||
if("insane")
|
||||
src.active1.fields["m_stat"] = "*Insane*"
|
||||
if("unstable")
|
||||
src.active1.fields["m_stat"] = "*Unstable*"
|
||||
if("watch")
|
||||
src.active1.fields["m_stat"] = "*Watch*"
|
||||
if("stable")
|
||||
src.active2.fields["m_stat"] = "Stable"
|
||||
|
||||
else if (href_list["b_type"])
|
||||
if (src.active2)
|
||||
switch(href_list["b_type"])
|
||||
if("an")
|
||||
src.active2.fields["b_type"] = "A-"
|
||||
if("bn")
|
||||
src.active2.fields["b_type"] = "B-"
|
||||
if("abn")
|
||||
src.active2.fields["b_type"] = "AB-"
|
||||
if("on")
|
||||
src.active2.fields["b_type"] = "O-"
|
||||
if("ap")
|
||||
src.active2.fields["b_type"] = "A+"
|
||||
if("bp")
|
||||
src.active2.fields["b_type"] = "B+"
|
||||
if("abp")
|
||||
src.active2.fields["b_type"] = "AB+"
|
||||
if("op")
|
||||
src.active2.fields["b_type"] = "O+"
|
||||
|
||||
else if (href_list["del_r"])
|
||||
if (src.active2)
|
||||
src.temp = text("Are you sure you wish to delete the record (Medical Portion Only)?<br>\n\t<A href='?src=\ref[];temp=1;del_r2=1'>Yes</A><br>\n\t<A href='?src=\ref[];temp=1'>No</A><br>", src, src)
|
||||
else if (href_list["del_r2"])
|
||||
if (src.active2)
|
||||
del(src.active2)
|
||||
else if (href_list["d_rec"])
|
||||
var/datum/data/record/R = locate(href_list["d_rec"])
|
||||
var/datum/data/record/M = locate(href_list["d_rec"])
|
||||
if (!( data_core.general.Find(R) ))
|
||||
src.temp = "Record Not Found!"
|
||||
return
|
||||
for(var/datum/data/record/E in data_core.medical)
|
||||
if ((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"]))
|
||||
M = E
|
||||
src.active1 = R
|
||||
src.active2 = M
|
||||
src.screen = 4
|
||||
else if (href_list["new"])
|
||||
if ((istype(src.active1, /datum/data/record) && !( istype(src.active2, /datum/data/record) )))
|
||||
var/datum/data/record/R = new /datum/data/record( )
|
||||
R.fields["name"] = src.active1.fields["name"]
|
||||
R.fields["id"] = src.active1.fields["id"]
|
||||
R.name = text("Medical Record #[]", R.fields["id"])
|
||||
R.fields["b_type"] = "Unknown"
|
||||
R.fields["mi_dis"] = "None"
|
||||
R.fields["mi_dis_d"] = "No minor disabilities have been declared."
|
||||
R.fields["ma_dis"] = "None"
|
||||
R.fields["ma_dis_d"] = "No major disabilities have been diagnosed."
|
||||
R.fields["alg"] = "None"
|
||||
R.fields["alg_d"] = "No allergies have been detected in this patient."
|
||||
R.fields["cdi"] = "None"
|
||||
R.fields["cdi_d"] = "No diseases have been diagnosed at the moment."
|
||||
R.fields["notes"] = "No notes."
|
||||
data_core.medical += R
|
||||
src.active2 = R
|
||||
src.screen = 4
|
||||
else if (href_list["add_c"])
|
||||
if (!( istype(src.active2, /datum/data/record) ))
|
||||
return
|
||||
var/a2 = src.active2
|
||||
var/t1 = input("Add Comment:", "Med. records", null, null) as message
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || get_dist(src, usr) > 1 || src.active2 != a2))
|
||||
return
|
||||
var/counter = 1
|
||||
while(src.active2.fields[text("com_[]", counter)])
|
||||
counter++
|
||||
src.active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [], 2053<BR>[]", src.authenticated, src.rank, time2text(world.realtime, "DDD MMM DD hh:mm:ss"), t1)
|
||||
else if (href_list["del_c"])
|
||||
if ((istype(src.active2, /datum/data/record) && src.active2.fields[text("com_[]", href_list["del_c"])]))
|
||||
src.active2.fields[text("com_[]", href_list["del_c"])] = "<B>Deleted</B>"
|
||||
else if (href_list["search"])
|
||||
var/t1 = input("Search String: (Name or ID)", "Med. records", null, null) as text
|
||||
if ((!( t1 ) || usr.stat || !( src.authenticated ) || usr.restrained() || get_dist(src, usr) > 1))
|
||||
return
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
t1 = lowertext(t1)
|
||||
for(var/datum/data/record/R in data_core.general)
|
||||
if ((lowertext(R.fields["name"]) == t1 || t1 == lowertext(R.fields["id"])))
|
||||
src.active1 = R
|
||||
if (!( src.active1 ))
|
||||
src.temp = text("Could not locate record [].", t1)
|
||||
else
|
||||
for(var/datum/data/record/E in data_core.medical)
|
||||
if ((E.fields["name"] == src.active1.fields["name"] || E.fields["id"] == src.active1.fields["id"]))
|
||||
src.active2 = E
|
||||
src.screen = 4
|
||||
else if (href_list["print_p"])
|
||||
if (!( src.printing ))
|
||||
src.printing = 1
|
||||
sleep(50)
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( src.loc )
|
||||
P.info = "<CENTER><B>Medical Record</B></CENTER><BR>"
|
||||
if ((istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1)))
|
||||
P.info += text("Name: [] ID: []<BR>\nSex: []<BR>\nAge: []<BR>\nFingerprint: []<BR>\nPhysical Status: []<BR>\nMental Status: []<BR>", src.active1.fields["name"], src.active1.fields["id"], src.active1.fields["sex"], src.active1.fields["age"], src.active1.fields["fingerprint"], src.active1.fields["p_stat"], src.active1.fields["m_stat"])
|
||||
else
|
||||
P.info += "<B>General Record Lost!</B><BR>"
|
||||
if ((istype(src.active2, /datum/data/record) && data_core.medical.Find(src.active2)))
|
||||
P.info += text("<BR>\n<CENTER><B>Medical Data</B></CENTER><BR>\nBlood Type: []<BR>\n<BR>\nMinor Disabilities: []<BR>\nDetails: []<BR>\n<BR>\nMajor Disabilities: []<BR>\nDetails: []<BR>\n<BR>\nAllergies: []<BR>\nDetails: []<BR>\n<BR>\nCurrent Diseases: [] (per disease info placed in log/comment section)<BR>\nDetails: []<BR>\n<BR>\nImportant Notes:<BR>\n\t[]<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", src.active2.fields["b_type"], src.active2.fields["mi_dis"], src.active2.fields["mi_dis_d"], src.active2.fields["ma_dis"], src.active2.fields["ma_dis_d"], src.active2.fields["alg"], src.active2.fields["alg_d"], src.active2.fields["cdi"], src.active2.fields["cdi_d"], src.active2.fields["notes"])
|
||||
var/counter = 1
|
||||
while(src.active2.fields[text("com_[]", counter)])
|
||||
P.info += text("[]<BR>", src.active2.fields[text("com_[]", counter)])
|
||||
counter++
|
||||
else
|
||||
P.info += "<B>Medical Record Lost!</B><BR>"
|
||||
P.info += "</TT>"
|
||||
P.name = "paper- 'Medical Record'"
|
||||
src.printing = null
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
@@ -0,0 +1,226 @@
|
||||
/*
|
||||
* Pod computer -- controls launch of escape pods
|
||||
*
|
||||
* Mass driver - launches the pods
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* The pod computer
|
||||
*/
|
||||
|
||||
obj/machinery/computer/pod
|
||||
name = "Pod Launch Control"
|
||||
icon = 'escapepod.dmi'
|
||||
icon_state = "computer"
|
||||
|
||||
var
|
||||
id = 1.0 // ID of mass driver(s) and poddoors to control
|
||||
obj/machinery/mass_driver/connected = null // the controlled mass driver
|
||||
timing = 0.0 // true if counting down before launch
|
||||
time = 30.0 // time (seconds) to count down
|
||||
|
||||
// Note: Only one massdriver is located via connected, but all drivers with matching ID are fired together
|
||||
|
||||
|
||||
// Create a new pod computer
|
||||
// Locate and set a massdriver with the same ID
|
||||
|
||||
New()
|
||||
..()
|
||||
spawn( 5 )
|
||||
for(var/obj/machinery/mass_driver/M in machines)
|
||||
if (M.id == src.id)
|
||||
src.connected = M
|
||||
|
||||
|
||||
// Called to fire the driver
|
||||
// Open the poddoors with same ID, fire the matching mass drivers, then close the doors
|
||||
|
||||
proc/alarm()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN)) return
|
||||
|
||||
if (!( src.connected ))
|
||||
viewers(null, null) << "Cannot locate mass driver connector. Cancelling firing sequence!"
|
||||
return
|
||||
|
||||
for(var/obj/machinery/door/poddoor/M in machines)
|
||||
if (M.id == src.id)
|
||||
spawn( 0 )
|
||||
M.openpod()
|
||||
return
|
||||
|
||||
sleep(20)
|
||||
|
||||
// Note updated from 40.93.3S source - all massdrivers with same ID are fired
|
||||
// (Previously, only the connected driver was fired)
|
||||
for(var/obj/machinery/mass_driver/M in machines)
|
||||
if(M.id == src.id)
|
||||
M.power = src.connected.power
|
||||
M.drive()
|
||||
//
|
||||
|
||||
sleep(50)
|
||||
for(var/obj/machinery/door/poddoor/M in machines)
|
||||
if (M.id == src.id)
|
||||
spawn( 0 )
|
||||
M.closepod()
|
||||
return
|
||||
|
||||
|
||||
// Monkey interact same as human
|
||||
|
||||
attack_paw(mob/user)
|
||||
return src.attack_hand(user)
|
||||
|
||||
|
||||
// Human interact, show window
|
||||
|
||||
attack_hand(mob/user)
|
||||
|
||||
if(stat & (NOPOWER|BROKEN)) return
|
||||
|
||||
var/dat = "<HTML><BODY><TT><B>Mass Driver Controls</B>"
|
||||
user.machine = src
|
||||
var/d2
|
||||
if (src.timing)
|
||||
d2 = "<A href='?src=\ref[src];time=0'>Stop Time Launch</A>"
|
||||
else
|
||||
d2 = "<A href='?src=\ref[src];time=1'>Initiate Time Launch</A>"
|
||||
var/second = src.time % 60
|
||||
var/minute = (src.time - second) / 60
|
||||
dat += {"<HR>
|
||||
Timer System: [d2]
|
||||
Time Left: [(minute ? "[minute]:" : null)][second] <A href='?src=\ref[src];tp=-30'>-</A> <A href='?src=\ref[src];tp=-1'>-</A> <A href='?src=\ref[src];tp=1'>+</A> <A href='?src=\ref[src];tp=30'>+</A>"}
|
||||
|
||||
if (src.connected)
|
||||
var/temp = ""
|
||||
var/list/L = list( 0.25, 0.5, 1, 2, 4, 8, 16 )
|
||||
for(var/t in L)
|
||||
if (t == src.connected.power)
|
||||
temp += "[t] "
|
||||
else
|
||||
temp += "<A href = '?src=\ref[src];power=[t]'>[t]</A> "
|
||||
|
||||
dat += "<HR>\nPower Level: [temp]<BR>\n<A href = '?src=\ref[src];alarm=1'>Firing Sequence</A><BR>\n<A href = '?src=\ref[src];drive=1'>Test Fire Driver</A><BR>\n<A href = '?src=\ref[src];door=1'>Toggle Outer Door</A><BR>"
|
||||
|
||||
else
|
||||
dat += "<BR>\n<A href = '?src=\ref[src];door=1'>Toggle Outer Door</A><BR>"
|
||||
|
||||
dat += "<BR><BR><A href='?src=\ref[user];mach_close=computer'>Close</A></TT></BODY></HTML>"
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
|
||||
|
||||
// Handle topic links from interaction window
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
usr << browse(null, "window=computer")
|
||||
return
|
||||
|
||||
if(usr.restrained() || usr.lying) return
|
||||
|
||||
if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey"))))
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
if ((usr.stat || usr.restrained()))
|
||||
return
|
||||
if ((usr.contents.Find(src) || (get_dist(src, usr) <= 1 && istype(src.loc, /turf))))
|
||||
usr.machine = src
|
||||
if (href_list["power"])
|
||||
var/t = text2num(href_list["power"])
|
||||
t = min(max(0.25, t), 16)
|
||||
if (src.connected)
|
||||
src.connected.power = t
|
||||
else if (href_list["alarm"])
|
||||
src.alarm()
|
||||
else if (href_list["time"])
|
||||
src.timing = text2num(href_list["time"])
|
||||
else if (href_list["tp"])
|
||||
var/tp = text2num(href_list["tp"])
|
||||
src.time += tp
|
||||
src.time = min(max(round(src.time), 0), 120)
|
||||
else if (href_list["door"])
|
||||
for(var/obj/machinery/door/poddoor/M in machines)
|
||||
if (M.id == src.id)
|
||||
if (M.density)
|
||||
spawn( 0 )
|
||||
M.openpod()
|
||||
return
|
||||
else
|
||||
spawn( 0 )
|
||||
M.closepod()
|
||||
return
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
//Foreach goto(394)
|
||||
return
|
||||
|
||||
|
||||
// Timed process
|
||||
// Countdown timer and fire when zero reached
|
||||
|
||||
process()
|
||||
if(stat & (NOPOWER|BROKEN) )
|
||||
return
|
||||
use_power(250)
|
||||
|
||||
if (src.timing)
|
||||
if (src.time > 0)
|
||||
src.time = round(src.time) - 1
|
||||
else
|
||||
alarm()
|
||||
src.time = 0
|
||||
src.timing = 0
|
||||
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* The mass driver
|
||||
*/
|
||||
|
||||
obj/machinery/mass_driver
|
||||
name = "mass driver"
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "mass_driver"
|
||||
anchored = 1
|
||||
var
|
||||
power = 1.0 // The power level to launch the pod
|
||||
id = 1.0 // ID of the mass driver. Pod computer must have matching ID.
|
||||
|
||||
|
||||
|
||||
// Fire the driver
|
||||
// All objects at the location (that have the DRIVABLE flag) are launched in the direction of the driver
|
||||
// Show the firing animation
|
||||
|
||||
proc/drive(amount)
|
||||
|
||||
if(stat & NOPOWER)
|
||||
return
|
||||
|
||||
use_power(500)
|
||||
for(var/obj/O in src.loc)
|
||||
if (O.flags & DRIVABLE)
|
||||
O.throwing = 1
|
||||
O.throwspeed = 100
|
||||
spawn( 0 )
|
||||
O.throwing(src.dir, src.power)
|
||||
return
|
||||
|
||||
flick("mass_driver1", src)
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,97 @@
|
||||
/*
|
||||
* Prison shuttle -- prision shuttle control computer
|
||||
*
|
||||
* TODO: Allow prision shuttle Z level to be adjusted more easily (marker on map)
|
||||
*/
|
||||
|
||||
#define PRISON_SHUTTLE_Z 8 // Z level of the prison station
|
||||
|
||||
|
||||
obj/machinery/computer/prison_shuttle
|
||||
name = "prison shuttle"
|
||||
icon = 'shuttle.dmi'
|
||||
icon_state = "shuttlecom"
|
||||
|
||||
|
||||
// Take off verb
|
||||
// Move the shuttle (and all objects in it) between station and prison Z level
|
||||
|
||||
verb/take_off()
|
||||
set src in oview(1)
|
||||
|
||||
if ((usr.stat || usr.restrained()))
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
if (prison_entered) // shuttle is at station
|
||||
var/A = locate(/area/shuttle)
|
||||
for(var/turf/T in A)
|
||||
if (T.z == 1)
|
||||
for(var/atom/movable/AM in T)
|
||||
AM.z = PRISON_SHUTTLE_Z
|
||||
var/turf/U = locate(T.x, T.y, PRISON_SHUTTLE_Z) // move to prison level
|
||||
U.oxygen = T.oxygen
|
||||
U.oldoxy = T.oldoxy
|
||||
U.tmpoxy = T.tmpoxy
|
||||
U.poison = T.poison
|
||||
U.oldpoison = T.oldpoison
|
||||
U.tmppoison = T.tmppoison
|
||||
U.co2 = T.co2
|
||||
U.oldco2 = T.oldco2
|
||||
U.tmpco2 = T.tmpco2
|
||||
del(T)
|
||||
prison_entered = null
|
||||
else if (!( prison_entered )) // shuttle is at prision
|
||||
if (ticker.shuttle_location != 1) // make sure emergency shuttle isn't at station
|
||||
var/A = locate(/area/shuttle_prison)
|
||||
for(var/turf/T in A)
|
||||
if (T.z == PRISON_SHUTTLE_Z)
|
||||
for(var/atom/movable/AM in T)
|
||||
AM.z = 1
|
||||
var/turf/U = locate(T.x, T.y, 1) // move to station level
|
||||
U.oxygen = T.oxygen
|
||||
U.oldoxy = T.oldoxy
|
||||
U.tmpoxy = T.tmpoxy
|
||||
U.poison = T.poison
|
||||
U.oldpoison = T.oldpoison
|
||||
U.tmppoison = T.tmppoison
|
||||
U.co2 = T.co2
|
||||
U.oldco2 = T.oldco2
|
||||
U.tmpco2 = T.tmpco2
|
||||
del(T)
|
||||
prison_entered = 1
|
||||
else
|
||||
usr << "\blue There is an obstructing shuttle!"
|
||||
|
||||
|
||||
// Restabalize verb
|
||||
// Set all shuttle locations to standard atmosphere settings
|
||||
|
||||
verb/restabalize()
|
||||
set src in oview(1)
|
||||
|
||||
viewers(null, null) << "\red <B>Restabalizing prison shuttle atmosphere!</B>"
|
||||
var/A = locate(/area/shuttle_prison)
|
||||
for(var/obj/move/T in A)
|
||||
T.firelevel = 0
|
||||
T.oxygen = O2STANDARD
|
||||
T.oldoxy = O2STANDARD
|
||||
T.tmpoxy = O2STANDARD
|
||||
T.poison = 0
|
||||
T.oldpoison = 0
|
||||
T.tmppoison = 0
|
||||
T.co2 = 0
|
||||
T.oldco2 = 0
|
||||
T.tmpco2 = 0
|
||||
T.sl_gas = 0
|
||||
T.osl_gas = 0
|
||||
T.tsl_gas = 0
|
||||
T.n2 = N2STANDARD
|
||||
T.on2 = N2STANDARD
|
||||
T.tn2 = N2STANDARD
|
||||
T.temp = T20C
|
||||
T.otemp = T20C
|
||||
T.ttemp = T20C
|
||||
|
||||
viewers(null, null) << "\red <B>Prison shuttle Restabalized!</B>"
|
||||
src.add_fingerprint(usr)
|
||||
@@ -0,0 +1,425 @@
|
||||
/*
|
||||
* Secure_data -- computer that displays security data about a player
|
||||
*
|
||||
*
|
||||
* Very similar to the med_data computer
|
||||
*/
|
||||
|
||||
|
||||
obj/machinery/computer/secure_data
|
||||
name = "Security Records"
|
||||
icon = 'weap_sat.dmi'
|
||||
icon_state = "computer"
|
||||
var
|
||||
obj/item/weapon/card/id/scan = null // the inserted ID card
|
||||
authenticated = null // the name on the ID card
|
||||
rank = null // the job assignment on the ID card
|
||||
screen = null // the screen to show in the window
|
||||
// 1=Search, 2=List, 3=Maint, 4=Edit record
|
||||
datum/data/record/active1 = null // record from data_core.general
|
||||
datum/data/record/active2 = null // record from data_core.security
|
||||
temp = null // temporary text display for window
|
||||
printing = null // true while printing a record
|
||||
|
||||
access = null // required access levels (none)
|
||||
allowed = "Security Officer/Forensic Technician/Prison Warden/Head of Personnel/Captain"
|
||||
// required job assignments to access records
|
||||
|
||||
// Monkey interact same as human
|
||||
|
||||
attack_paw(mob/user)
|
||||
return src.attack_hand(user)
|
||||
|
||||
|
||||
// Human interact, display window
|
||||
|
||||
attack_hand(mob/user)
|
||||
|
||||
if(stat & (NOPOWER|BROKEN) )
|
||||
return
|
||||
|
||||
var/dat
|
||||
if (src.temp)
|
||||
dat = text("<TT>[]</TT><BR><BR><A href='?src=\ref[];temp=1'>Clear Screen</A>", src.temp, src)
|
||||
else
|
||||
dat = text("Confirm Identity: <A href='?src=\ref[];scan=1'>[]</A><HR>", src, (src.scan ? text("[]", src.scan.name) : "----------"))
|
||||
if (src.authenticated)
|
||||
switch(src.screen)
|
||||
if(1.0)
|
||||
dat += text("<A href='?src=\ref[];search=1'>Search Records</A><BR>\n<A href='?src=\ref[];list=1'>List Records</A><BR>\n<A href='?src=\ref[];search_f=1'>Search Fingerprints</A><BR>\n<A href='?src=\ref[];new_r=1'>New Record</A><BR>\n<BR>\n<A href='?src=\ref[];rec_m=1'>Record Maintenance</A><BR>\n<A href='?src=\ref[];logout=1'>{Log Out}</A><BR>\n", src, src, src, src, src, src)
|
||||
if(2.0)
|
||||
dat += "<B>Record List</B>:<HR>"
|
||||
for(var/datum/data/record/R in data_core.general)
|
||||
dat += text("<A href='?src=\ref[];d_rec=\ref[]'>[]: []<BR>", src, R, R.fields["id"], R.fields["name"])
|
||||
|
||||
dat += text("<HR><A href='?src=\ref[];main=1'>Back</A>", src)
|
||||
if(3.0)
|
||||
dat += text("<B>Records Maintenance</B><HR>\n<A href='?src=\ref[];back=1'>Backup To Disk</A><BR>\n<A href='?src=\ref[];u_load=1'>Upload From disk</A><BR>\n<A href='?src=\ref[];del_all=1'>Delete All Records</A><BR>\n<BR>\n<A href='?src=\ref[];main=1'>Back</A>", src, src, src, src)
|
||||
if(4.0)
|
||||
dat += "<CENTER><B>Security Record</B></CENTER><BR>"
|
||||
if ((istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1)))
|
||||
dat += text("Name: <A href='?src=\ref[];field=name'>[]</A> ID: <A href='?src=\ref[];field=id'>[]</A><BR>\nSex: <A href='?src=\ref[];field=sex'>[]</A><BR>\nAge: <A href='?src=\ref[];field=age'>[]</A><BR>\nRank: <A href='?src=\ref[];field=rank'>[]</A><BR>\nFingerprint: <A href='?src=\ref[];field=fingerprint'>[]</A><BR>\nPhysical Status: []<BR>\nMental Status: []<BR>", src, src.active1.fields["name"], src, src.active1.fields["id"], src, src.active1.fields["sex"], src, src.active1.fields["age"], src, src.active1.fields["rank"], src, src.active1.fields["fingerprint"], src.active1.fields["p_stat"], src.active1.fields["m_stat"])
|
||||
else
|
||||
dat += "<B>General Record Lost!</B><BR>"
|
||||
if ((istype(src.active2, /datum/data/record) && data_core.security.Find(src.active2)))
|
||||
dat += text("<BR>\n<CENTER><B>Security Data</B></CENTER><BR>\nCriminal Status: <A href='?src=\ref[];field=criminal'>[]</A><BR>\n<BR>\nMinor Crimes: <A href='?src=\ref[];field=mi_crim'>[]</A><BR>\nDetails: <A href='?src=\ref[];field=mi_crim_d'>[]</A><BR>\n<BR>\nMajor Crimes: <A href='?src=\ref[];field=ma_crim'>[]</A><BR>\nDetails: <A href='?src=\ref[];field=ma_crim_d'>[]</A><BR>\n<BR>\nImportant Notes:<BR>\n\t<A href='?src=\ref[];field=notes'>[]</A><BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", src, src.active2.fields["criminal"], src, src.active2.fields["mi_crim"], src, src.active2.fields["mi_crim_d"], src, src.active2.fields["ma_crim"], src, src.active2.fields["ma_crim_d"], src, src.active2.fields["notes"])
|
||||
var/counter = 1
|
||||
while(src.active2.fields[text("com_[]", counter)])
|
||||
dat += text("[]<BR><A href='?src=\ref[];del_c=[]'>Delete Entry</A><BR><BR>", src.active2.fields[text("com_[]", counter)], src, counter)
|
||||
counter++
|
||||
dat += text("<A href='?src=\ref[];add_c=1'>Add Entry</A><BR><BR>", src)
|
||||
dat += text("<A href='?src=\ref[];del_r=1'>Delete Record (Security Only)</A><BR><BR>", src)
|
||||
else
|
||||
dat += "<B>Security Record Lost!</B><BR>"
|
||||
dat += text("<A href='?src=\ref[];new=1'>New Record</A><BR><BR>", src)
|
||||
dat += text("\n<A href='?src=\ref[];dela_r=1'>Delete Record (ALL)</A><BR><BR>\n<A href='?src=\ref[];print_p=1'>Print Record</A><BR>\n<A href='?src=\ref[];list=1'>Back</A><BR>", src, src, src)
|
||||
else
|
||||
else
|
||||
dat += text("<A href='?src=\ref[];login=1'>{Log In}</A>", src)
|
||||
user << browse(text("<HEAD><TITLE>Security Records</TITLE></HEAD><TT>[]</TT>", dat), "window=secure_rec")
|
||||
|
||||
|
||||
// Handle topic links
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
if(stat & (NOPOWER|BROKEN) )
|
||||
return
|
||||
if (!( data_core.general.Find(src.active1) ))
|
||||
src.active1 = null
|
||||
if (!( data_core.security.Find(src.active2) ))
|
||||
src.active2 = null
|
||||
if ((usr.stat || usr.restrained()))
|
||||
return
|
||||
if ((usr.contents.Find(src) || (get_dist(src, usr) <= 1 && istype(src.loc, /turf))))
|
||||
usr.machine = src
|
||||
if (href_list["temp"])
|
||||
src.temp = null
|
||||
if (href_list["scan"])
|
||||
if (src.scan)
|
||||
src.scan.loc = src.loc
|
||||
src.scan = null
|
||||
else
|
||||
var/obj/item/I = usr.equipped()
|
||||
if (istype(I, /obj/item/weapon/card/id))
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
src.scan = I
|
||||
else
|
||||
if (href_list["logout"])
|
||||
src.authenticated = null
|
||||
src.screen = null
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
else
|
||||
if (href_list["login"])
|
||||
if (istype(src.scan, /obj/item/weapon/card/id))
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
if (scan.check_access(access, allowed))
|
||||
src.authenticated = src.scan.registered
|
||||
src.rank = src.scan.assignment
|
||||
src.screen = 1
|
||||
if (src.authenticated)
|
||||
if (href_list["list"])
|
||||
src.screen = 2
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
else
|
||||
if (href_list["rec_m"])
|
||||
src.screen = 3
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
else
|
||||
if (href_list["del_all"])
|
||||
src.temp = text("Are you sure you wish to delete all records?<br>\n\t<A href='?src=\ref[];temp=1;del_all2=1'>Yes</A><br>\n\t<A href='?src=\ref[];temp=1'>No</A><br>", src, src)
|
||||
else
|
||||
if (href_list["del_all2"])
|
||||
for(var/datum/data/record/R in data_core.security)
|
||||
del(R)
|
||||
|
||||
src.temp = "All records deleted."
|
||||
else
|
||||
if (href_list["main"])
|
||||
src.screen = 1
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
else
|
||||
if (href_list["field"])
|
||||
var/a1 = src.active1
|
||||
var/a2 = src.active2
|
||||
switch(href_list["field"])
|
||||
if("name")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
var/t1 = input("Please input name:", "Secure. records", src.active1.fields["name"], null) as text
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || get_dist(src, usr) > 1 || src.active1 != a1))
|
||||
return
|
||||
src.active1.fields["name"] = t1
|
||||
if("id")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please input id:", "Secure. records", src.active1.fields["id"], null) as text
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || get_dist(src, usr) > 1 || src.active1 != a1))
|
||||
return
|
||||
src.active1.fields["id"] = t1
|
||||
if("fingerprint")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
var/t1 = input("Please input fingerprint hash:", "Secure. records", src.active1.fields["fingerprint"], null) as text
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || get_dist(src, usr) > 1 || src.active1 != a1))
|
||||
return
|
||||
src.active1.fields["fingerprint"] = t1
|
||||
if("sex")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
if (src.active1.fields["sex"] == "Male")
|
||||
src.active1.fields["sex"] = "Female"
|
||||
else
|
||||
src.active1.fields["sex"] = "Male"
|
||||
if("age")
|
||||
if (istype(src.active1, /datum/data/record))
|
||||
var/t1 = input("Please input age:", "Secure. records", src.active1.fields["age"], null) as text
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || get_dist(src, usr) > 1 || src.active1 != a1))
|
||||
return
|
||||
src.active1.fields["age"] = t1
|
||||
if("mi_crim")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please input minor disabilities list:", "Secure. records", src.active2.fields["mi_crim"], null) as text
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || get_dist(src, usr) > 1 || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["mi_crim"] = t1
|
||||
if("mi_crim_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please summarize minor dis.:", "Secure. records", src.active2.fields["mi_crim_d"], null) as message
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || get_dist(src, usr) > 1 || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["mi_crim_d"] = t1
|
||||
if("ma_crim")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please input major diabilities list:", "Secure. records", src.active2.fields["ma_crim"], null) as text
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || get_dist(src, usr) > 1 || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["ma_crim"] = t1
|
||||
if("ma_crim_d")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please summarize major dis.:", "Secure. records", src.active2.fields["ma_crim_d"], null) as message
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || get_dist(src, usr) > 1 || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["ma_crim_d"] = t1
|
||||
if("notes")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
var/t1 = input("Please summarize notes:", "Secure. records", src.active2.fields["notes"], null) as message
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || get_dist(src, usr) > 1 || src.active2 != a2))
|
||||
return
|
||||
src.active2.fields["notes"] = t1
|
||||
if("criminal")
|
||||
if (istype(src.active2, /datum/data/record))
|
||||
src.temp = text("<B>Criminal Status:</B><BR>\n\t<A href='?src=\ref[];temp=1;criminal2=none'>None</A><BR>\n\t<A href='?src=\ref[];temp=1;criminal2=arrest'>*Arrest*</A><BR>\n\t<A href='?src=\ref[];temp=1;criminal2=incarcerated'>Incarcerated</A><BR>\n\t<A href='?src=\ref[];temp=1;criminal2=parolled'>Parolled</A><BR>\n\t<A href='?src=\ref[];temp=1;criminal2=released'>Released</A><BR>", src, src, src, src, src)
|
||||
if("rank")
|
||||
var/list/L = list( "Head of Personnel", "Captain" )
|
||||
if ((istype(src.active1, /datum/data/record) && L.Find(src.rank)))
|
||||
src.temp = text("<B>Rank:</B><BR>\n<B>Assistants:</B><BR>\n<A href='?src=\ref[];temp=1;rank=res_assist'>Research Assistant</A><BR>\n<A href='?src=\ref[];temp=1;rank=staff_assist'>Staff Assistant</A><BR>\n<A href='?src=\ref[];temp=1;rank=med_assist'>Medical Assistant</A><BR>\n<A href='?src=\ref[];temp=1;rank=tech_assist'>Technical Assistant</A><BR>\n<B>Technicians:</B><BR>\n<A href='?src=\ref[];temp=1;rank=foren_tech'>Forensic Technician</A><BR>\n<A href='?src=\ref[];temp=1;rank=res_tech'>Research Technician</A><BR>\n<A href='?src=\ref[];temp=1;rank=stat_tech'>Station Technician</A><BR>\n<A href='?src=\ref[];temp=1;rank=atmo_tech'>Atmospheric Technician</A><BR>\n<A href='?src=\ref[];temp=1;rank=engineer'>Engineer (Engine Technician)\n<B>Researchers:</B><BR>\n<A href='?src=\ref[];temp=1;rank=med_res'>Medical Researcher</A><BR>\n<A href='?src=\ref[];temp=1;rank=tox_res'>Toxin Researcher</A><BR>\n<B>Officers:</B><BR>\n<A href='?src=\ref[];temp=1;rank=med_doc'>Medical Doctor</A><BR>\n<A href='?src=\ref[];temp=1;rank=secure_off'>Security Officer</A><BR>\n<B>Higher Officers:</B><BR>\n<A href='?src=\ref[];temp=1;rank=hoperson'>Head of Research</A><BR>\n<A href='?src=\ref[];temp=1;rank=horesearch'>Head of Personnel</A><BR>\n<A href='?src=\ref[];temp=1;rank=captain'>Captain</A><BR>", src, src, src, src, src, src, src, src, src, src, src, src, src, src, src, src)
|
||||
else
|
||||
else
|
||||
if (href_list["rank"])
|
||||
var/list/L = list( "Head of Personnel", "Captain" )
|
||||
if ((src.active1 && L.Find(src.rank)))
|
||||
switch(href_list["rank"])
|
||||
if("res_assist")
|
||||
src.active1.fields["rank"] = "Research Assistant"
|
||||
if("staff_assist")
|
||||
src.active1.fields["rank"] = "Staff Assistant"
|
||||
if("med_assist")
|
||||
src.active1.fields["rank"] = "Medical Assistant"
|
||||
if("tech_assist")
|
||||
src.active1.fields["rank"] = "Technical Assistant"
|
||||
if("foren_tech")
|
||||
src.active1.fields["rank"] = "Forensic Technician"
|
||||
if("res_tech")
|
||||
src.active1.fields["rank"] = "Research Technician"
|
||||
if("stat_tech")
|
||||
src.active1.fields["rank"] = "Station Technician"
|
||||
if("atmo_tech")
|
||||
src.active1.fields["rank"] = "Atmospheric Technician"
|
||||
if("engineer")
|
||||
src.active1.fields["rank"] = "Engineer"
|
||||
if("med_res")
|
||||
src.active1.fields["rank"] = "Medical Researcher"
|
||||
if("tox_res")
|
||||
src.active1.fields["rank"] = "Toxin Researcher"
|
||||
if("med_doc")
|
||||
src.active1.fields["rank"] = "Medical Doctor"
|
||||
if("secure_off")
|
||||
src.active1.fields["rank"] = "Security Officer"
|
||||
if("hoperson")
|
||||
src.active1.fields["rank"] = "Head of Research"
|
||||
if("horesearch")
|
||||
src.active1.fields["rank"] = "Head of Personnel"
|
||||
if("captain")
|
||||
src.active1.fields["rank"] = "Captain"
|
||||
|
||||
else
|
||||
if (href_list["criminal2"])
|
||||
if (src.active2)
|
||||
switch(href_list["criminal2"])
|
||||
if("none")
|
||||
src.active2.fields["criminal"] = "None"
|
||||
if("arrest")
|
||||
src.active2.fields["criminal"] = "*Arrest*"
|
||||
if("incarcerated")
|
||||
src.active2.fields["criminal"] = "Incarcerated"
|
||||
if("parolled")
|
||||
src.active2.fields["criminal"] = "Parolled"
|
||||
if("released")
|
||||
src.active2.fields["criminal"] = "Released"
|
||||
|
||||
else
|
||||
if (href_list["del_r"])
|
||||
if (src.active2)
|
||||
src.temp = text("Are you sure you wish to delete the record (Security Portion Only)?<br>\n\t<A href='?src=\ref[];temp=1;del_r2=1'>Yes</A><br>\n\t<A href='?src=\ref[];temp=1'>No</A><br>", src, src)
|
||||
else
|
||||
if (href_list["del_r2"])
|
||||
if (src.active2)
|
||||
|
||||
del(src.active2)
|
||||
else
|
||||
if (href_list["dela_r"])
|
||||
if (src.active1)
|
||||
src.temp = text("Are you sure you wish to delete the record (ALL)?<br>\n\t<A href='?src=\ref[];temp=1;dela_r2=1'>Yes</A><br>\n\t<A href='?src=\ref[];temp=1'>No</A><br>", src, src)
|
||||
else
|
||||
if (href_list["dela_r2"])
|
||||
for(var/datum/data/record/R in data_core.medical)
|
||||
if ((R.fields["name"] == src.active1.fields["name"] || R.fields["id"] == src.active1.fields["id"]))
|
||||
|
||||
del(R)
|
||||
|
||||
if (src.active2)
|
||||
|
||||
del(src.active2)
|
||||
if (src.active1)
|
||||
|
||||
del(src.active1)
|
||||
else
|
||||
if (href_list["d_rec"])
|
||||
var/datum/data/record/R = locate(href_list["d_rec"])
|
||||
var/S = locate(href_list["d_rec"])
|
||||
if (!( data_core.general.Find(R) ))
|
||||
src.temp = "Record Not Found!"
|
||||
return
|
||||
for(var/datum/data/record/E in data_core.security)
|
||||
if ((E.fields["name"] == R.fields["name"] || E.fields["id"] == R.fields["id"]))
|
||||
S = E
|
||||
|
||||
src.active1 = R
|
||||
src.active2 = S
|
||||
src.screen = 4
|
||||
else
|
||||
if (href_list["new_r"])
|
||||
var/datum/data/record/G = new /datum/data/record( )
|
||||
G.fields["name"] = "New Record"
|
||||
G.fields["id"] = text("[]", add_zero(num2hex(rand(1, 1.6777215E7)), 6))
|
||||
G.fields["rank"] = "Unassigned"
|
||||
G.fields["sex"] = "Male"
|
||||
G.fields["age"] = "Unknown"
|
||||
G.fields["fingerprint"] = "Unknown"
|
||||
G.fields["p_stat"] = "Active"
|
||||
G.fields["m_stat"] = "Stable"
|
||||
data_core.general += G
|
||||
src.active1 = G
|
||||
src.active2 = null
|
||||
else
|
||||
if (href_list["new"])
|
||||
if ((istype(src.active1, /datum/data/record) && !( istype(src.active2, /datum/data/record) )))
|
||||
var/datum/data/record/R = new /datum/data/record( )
|
||||
R.fields["name"] = src.active1.fields["name"]
|
||||
R.fields["id"] = src.active1.fields["id"]
|
||||
R.name = text("Security Record #[]", R.fields["id"])
|
||||
R.fields["criminal"] = "None"
|
||||
R.fields["mi_crim"] = "None"
|
||||
R.fields["mi_crim_d"] = "No minor crime convictions."
|
||||
R.fields["ma_crim"] = "None"
|
||||
R.fields["ma_crim_d"] = "No minor crime convictions."
|
||||
R.fields["notes"] = "No notes."
|
||||
data_core.security += R
|
||||
src.active2 = R
|
||||
src.screen = 4
|
||||
else
|
||||
if (href_list["add_c"])
|
||||
if (!( istype(src.active2, /datum/data/record) ))
|
||||
return
|
||||
var/a2 = src.active2
|
||||
var/t1 = input("Add Comment:", "Secure. records", null, null) as message
|
||||
if ((!( t1 ) || !( src.authenticated ) || usr.stat || usr.restrained() || get_dist(src, usr) > 1 || src.active2 != a2))
|
||||
return
|
||||
var/counter = 1
|
||||
while(src.active2.fields[text("com_[]", counter)])
|
||||
counter++
|
||||
src.active2.fields[text("com_[]", counter)] = text("Made by [] ([]) on [], 2053<BR>[]", src.authenticated, src.rank, time2text(world.realtime, "DDD MMM DD hh:mm:ss"), t1)
|
||||
else
|
||||
if (href_list["del_c"])
|
||||
if ((istype(src.active2, /datum/data/record) && src.active2.fields[text("com_[]", href_list["del_c"])]))
|
||||
src.active2.fields[text("com_[]", href_list["del_c"])] = "<B>Deleted</B>"
|
||||
else
|
||||
if (href_list["search_f"])
|
||||
var/t1 = input("Search String: (Fingerprint)", "Secure. records", null, null) as text
|
||||
if ((!( t1 ) || usr.stat || !( src.authenticated ) || usr.restrained() || get_dist(src, usr) > 1))
|
||||
return
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
t1 = lowertext(t1)
|
||||
for(var/datum/data/record/R in data_core.general)
|
||||
if (lowertext(R.fields["fingerprint"]) == t1)
|
||||
src.active1 = R
|
||||
|
||||
if (!( src.active1 ))
|
||||
src.temp = text("Could not locate record [].", t1)
|
||||
else
|
||||
for(var/datum/data/record/E in data_core.security)
|
||||
if ((E.fields["name"] == src.active1.fields["name"] || E.fields["id"] == src.active1.fields["id"]))
|
||||
src.active2 = E
|
||||
|
||||
src.screen = 4
|
||||
else
|
||||
if (href_list["search"])
|
||||
var/t1 = input("Search String: (Name or ID)", "Secure. records", null, null) as text
|
||||
if ((!( t1 ) || usr.stat || !( src.authenticated ) || usr.restrained() || get_dist(src, usr) > 1))
|
||||
return
|
||||
src.active1 = null
|
||||
src.active2 = null
|
||||
t1 = lowertext(t1)
|
||||
for(var/datum/data/record/R in data_core.general)
|
||||
if ((lowertext(R.fields["name"]) == t1 || t1 == lowertext(R.fields["id"])))
|
||||
src.active1 = R
|
||||
|
||||
if (!( src.active1 ))
|
||||
src.temp = text("Could not locate record [].", t1)
|
||||
else
|
||||
for(var/datum/data/record/E in data_core.security)
|
||||
if ((E.fields["name"] == src.active1.fields["name"] || E.fields["id"] == src.active1.fields["id"]))
|
||||
src.active2 = E
|
||||
|
||||
src.screen = 4
|
||||
else
|
||||
if (href_list["print_p"])
|
||||
if (!( src.printing ))
|
||||
src.printing = 1
|
||||
sleep(50)
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( src.loc )
|
||||
P.info = "<CENTER><B>Security Record</B></CENTER><BR>"
|
||||
if ((istype(src.active1, /datum/data/record) && data_core.general.Find(src.active1)))
|
||||
P.info += text("Name: [] ID: []<BR>\nSex: []<BR>\nAge: []<BR>\nFingerprint: []<BR>\nPhysical Status: []<BR>\nMental Status: []<BR>", src.active1.fields["name"], src.active1.fields["id"], src.active1.fields["sex"], src.active1.fields["age"], src.active1.fields["fingerprint"], src.active1.fields["p_stat"], src.active1.fields["m_stat"])
|
||||
else
|
||||
P.info += "<B>General Record Lost!</B><BR>"
|
||||
if ((istype(src.active2, /datum/data/record) && data_core.security.Find(src.active2)))
|
||||
P.info += text("<BR>\n<CENTER><B>Security Data</B></CENTER><BR>\nCriminal Status: []<BR>\n<BR>\nMinor Crimes: []<BR>\nDetails: []<BR>\n<BR>\nMajor Crimes: []<BR>\nDetails: []<BR>\n<BR>\nImportant Notes:<BR>\n\t[]<BR>\n<BR>\n<CENTER><B>Comments/Log</B></CENTER><BR>", src.active2.fields["criminal"], src.active2.fields["mi_crim"], src.active2.fields["mi_crim_d"], src.active2.fields["ma_crim"], src.active2.fields["ma_crim_d"], src.active2.fields["notes"])
|
||||
var/counter = 1
|
||||
while(src.active2.fields[text("com_[]", counter)])
|
||||
P.info += text("[]<BR>", src.active2.fields[text("com_[]", counter)])
|
||||
counter++
|
||||
else
|
||||
P.info += "<B>Security Record Lost!</B><BR>"
|
||||
P.info += "</TT>"
|
||||
P.name = "paper- 'Security Record'"
|
||||
src.printing = null
|
||||
src.add_fingerprint(usr)
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
/*
|
||||
* Shuttle -- emergency shuttle control computer
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
obj/machinery/computer/shuttle
|
||||
name = "shuttle"
|
||||
icon = 'shuttle.dmi'
|
||||
icon_state = "shuttlecom"
|
||||
|
||||
var
|
||||
auth_need = 3 // number of authorizations needed to launch shuttle early
|
||||
list/authorized = list( ) // list of names of those authorizing the early launch
|
||||
allowed // ID card job assignmented needed to authorize (none)
|
||||
access = "2000" // ID card access level needed to authorize
|
||||
|
||||
|
||||
// Restabalize verb
|
||||
// Set all shuttle locations to standard atmosphere
|
||||
|
||||
verb/restabalize()
|
||||
set src in oview(1)
|
||||
|
||||
world << "\red <B>Restabalizing shuttle atmosphere!</B>"
|
||||
var/A = locate(/area/shuttle)
|
||||
for(var/obj/move/T in A)
|
||||
T.firelevel = 0
|
||||
T.oxygen = O2STANDARD
|
||||
T.oldoxy = O2STANDARD
|
||||
T.tmpoxy = O2STANDARD
|
||||
T.poison = 0
|
||||
T.oldpoison = 0
|
||||
T.tmppoison = 0
|
||||
T.co2 = 0
|
||||
T.oldco2 = 0
|
||||
T.tmpco2 = 0
|
||||
T.sl_gas = 0
|
||||
T.osl_gas = 0
|
||||
T.tsl_gas = 0
|
||||
T.n2 = N2STANDARD
|
||||
T.on2 = N2STANDARD
|
||||
T.tn2 = N2STANDARD
|
||||
T.temp = T20C
|
||||
T.otemp = T20C
|
||||
T.ttemp = T20C
|
||||
|
||||
world << "\red <B>Shuttle Restabalized!</B>"
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
|
||||
// Hijack verb
|
||||
// Can be used only by the traitor to end a round
|
||||
// Note can only occur when shuttle is at CC, not at the station level
|
||||
|
||||
verb/hijack()
|
||||
set src in oview(1)
|
||||
|
||||
if ((!( ticker ) || ticker.shuttle_location != shuttle_z))
|
||||
return
|
||||
if (usr != ticker.killer)
|
||||
return
|
||||
world << "\blue <B>Alert: The shuttle is has been hijacked prematurely by the traitor!</B>"
|
||||
ticker.timing = 0
|
||||
ticker.check_win()
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
|
||||
// Attack with object
|
||||
// Allows shuttle to be launched early if 3 ID card of sufficient level (from different holders) are used
|
||||
|
||||
attackby(obj/item/weapon/card/id/W, mob/user)
|
||||
|
||||
|
||||
if ((!( istype(W, /obj/item/weapon/card/id) ) || !( ticker ) || ticker.shuttle_location == shuttle_z || !( user )))
|
||||
return
|
||||
if (!W.check_access(access, allowed))
|
||||
user << text("The access level ([]) of [] card is not high enough. ", W.access_level, W.registered)
|
||||
return
|
||||
var/choice = alert(user, text("Would you like to (un)authorize a shortened launch time? [] authorization\s are still needed. Use abort to cancel all authorizations.", src.auth_need - src.authorized.len), "Shuttle Launch", "Authorize", "Repeal", "Abort")
|
||||
switch(choice)
|
||||
if("Authorize")
|
||||
src.authorized -= W.registered
|
||||
src.authorized += W.registered
|
||||
if (src.auth_need - src.authorized.len > 0)
|
||||
world << text("\blue <B>Alert: [] authorizations needed until shuttle is launched early</B>", src.auth_need - src.authorized.len)
|
||||
else
|
||||
world << "\blue <B>Alert: Shuttle launch time shortened to 10 seconds!</B>"
|
||||
ticker.timeleft = 100
|
||||
//src.authorized = null
|
||||
del(src.authorized)
|
||||
src.authorized = list( )
|
||||
if("Repeal")
|
||||
src.authorized -= W.registered
|
||||
world << text("\blue <B>Alert: [] authorizations needed until shuttle is launched early</B>", src.auth_need - src.authorized.len)
|
||||
if("Abort")
|
||||
world << "\blue <B>All authorizations to shorting time for shuttle launch have been revoked!</B>"
|
||||
src.authorized.len = 0
|
||||
src.authorized = list( )
|
||||
@@ -0,0 +1,421 @@
|
||||
/*
|
||||
* Cryo_cell -- used to heal mobs of major damage
|
||||
*
|
||||
* Needs a freezer unit attached by a (flex)pipe to operate.
|
||||
*
|
||||
* TODO: Cell does not seem to have a broken icon state, nor does breaking the cell affect overlays. Needs further work.
|
||||
*/
|
||||
|
||||
obj/machinery/cryo_cell
|
||||
name = "cryo cell"
|
||||
icon = 'Cryogenic2.dmi'
|
||||
icon_state = "celltop"
|
||||
density = 1
|
||||
anchored = 1
|
||||
p_dir = 8 // pipe direction is west
|
||||
capmult = 1 // capacity multiplier
|
||||
|
||||
var
|
||||
mob/occupant = null // the mob inside, or null if none
|
||||
|
||||
obj/substance/gas/gas = null // the gas reservoir
|
||||
obj/substance/gas/ngas = null // the new calculated gas
|
||||
|
||||
obj/overlay/O1 = null // the console overlay object
|
||||
obj/overlay/O2 = null // the base of cell overlay object
|
||||
|
||||
obj/machinery/line_in = null // the connected pipe
|
||||
obj/machinery/vnode = null // the connected pipeline of line_in
|
||||
|
||||
|
||||
// Create a cryo_cell
|
||||
// Pixel-displaced overlays are used to show the console and base of the cell, with the main icon being the cell top
|
||||
|
||||
New()
|
||||
..()
|
||||
src.layer = 5
|
||||
O1 = new /obj/overlay( )
|
||||
O1.icon = 'Cryogenic2.dmi'
|
||||
O1.icon_state = "cellconsole"
|
||||
O1.pixel_y = -32.0
|
||||
O1.layer = 4
|
||||
|
||||
O2 = new /obj/overlay( )
|
||||
O2.icon = 'Cryogenic2.dmi'
|
||||
O2.icon_state = "cellbottom"
|
||||
O2.pixel_y = -32.0
|
||||
|
||||
src.pixel_y = 32
|
||||
|
||||
add_overlays()
|
||||
|
||||
src.gas = new /obj/substance/gas( null )
|
||||
gas.temperature = T20C
|
||||
src.ngas = new /obj/substance/gas (null)
|
||||
ngas.temperature = T20C
|
||||
|
||||
gasflowlist += src
|
||||
|
||||
|
||||
// Find the connected (flex)pipe and its pipeline object
|
||||
|
||||
buildnodes()
|
||||
|
||||
var/turf/T = src.loc
|
||||
|
||||
line_in = get_machine(level, T, p_dir )
|
||||
|
||||
if(line_in) vnode = line_in.getline()
|
||||
|
||||
|
||||
|
||||
// Called to set the object overlays to the stored values
|
||||
|
||||
proc/add_overlays()
|
||||
src.overlays = list(O1, O2)
|
||||
|
||||
|
||||
// Gas procs
|
||||
|
||||
|
||||
// Return gas fullness value
|
||||
|
||||
get_gas_val(from)
|
||||
return gas.tot_gas()
|
||||
|
||||
|
||||
// Return the gas reservoir
|
||||
|
||||
get_gas(from)
|
||||
return gas
|
||||
|
||||
|
||||
// Update gas levels with new levels calculated in process()
|
||||
|
||||
gas_flow()
|
||||
gas.replace_by(ngas)
|
||||
|
||||
|
||||
|
||||
// Called when area power state changes
|
||||
// If no power, update icon states to show unpowered versions
|
||||
|
||||
power_change()
|
||||
..()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "celltop-p"
|
||||
O1.icon_state="cellconsole-p"
|
||||
O2.icon_state="cellbottom-p"
|
||||
else
|
||||
icon_state = "celltop[ occupant ? "_1" : ""]"
|
||||
O1.icon_state ="cellconsole"
|
||||
O2.icon_state ="cellbottom"
|
||||
|
||||
add_overlays()
|
||||
|
||||
|
||||
// Timed process
|
||||
// Perform gas flow, use area power
|
||||
|
||||
process()
|
||||
|
||||
if(vnode)
|
||||
var/delta_gt = FLOWFRAC * ( vnode.get_gas_val(src) - gas.tot_gas() / capmult)
|
||||
calc_delta( src, gas, ngas, vnode, delta_gt)
|
||||
else
|
||||
leak_to_turf()
|
||||
|
||||
|
||||
if(stat & NOPOWER)
|
||||
return
|
||||
use_power(500)
|
||||
|
||||
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
|
||||
|
||||
// Called if no pipe is present
|
||||
// Leak gas contents to turf to west
|
||||
|
||||
proc/leak_to_turf()
|
||||
var/turf/T = get_step(src, WEST)
|
||||
|
||||
if(T.density)
|
||||
T = src.loc
|
||||
if(T.density)
|
||||
return
|
||||
|
||||
flow_to_turf(gas, ngas, T)
|
||||
|
||||
|
||||
// Cryocell verbs
|
||||
|
||||
|
||||
// Eject the occupant
|
||||
|
||||
verb/move_eject()
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat != 0)
|
||||
return
|
||||
src.go_out()
|
||||
add_fingerprint(usr)
|
||||
|
||||
|
||||
// Move the player into the cell
|
||||
// Cell must be powered, can't already have an occupant, and player can't be wearing anything.
|
||||
// If all true, move the player inside and update the view
|
||||
|
||||
verb/move_inside()
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat != 0 || stat & NOPOWER)
|
||||
return
|
||||
if (src.occupant)
|
||||
usr << "\blue <B>The cell is already occupied!</B>"
|
||||
return
|
||||
if (usr.abiotic())
|
||||
usr << "Subject may not have abiotic items on."
|
||||
return
|
||||
usr.pulling = null
|
||||
usr.client.perspective = EYE_PERSPECTIVE
|
||||
usr.client.eye = src
|
||||
usr.loc = src
|
||||
src.occupant = usr
|
||||
src.icon_state = "celltop_1"
|
||||
for(var/obj/O in src)
|
||||
O.loc = src.loc
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
|
||||
// Attack by item
|
||||
// A special case - only works with the pseudo-item representing grabbing another player
|
||||
// Make standard checks, then move grabbed player into the cell, and update their view.
|
||||
|
||||
attackby(obj/item/weapon/grab/G, mob/user)
|
||||
|
||||
if (stat & NOPOWER) return
|
||||
|
||||
if ((!( istype(G, /obj/item/weapon/grab) ) || !( ismob(G.affecting) )))
|
||||
return
|
||||
if (src.occupant)
|
||||
user << "\blue <B>The cell is already occupied!</B>"
|
||||
return
|
||||
if (G.affecting.abiotic())
|
||||
user << "Subject may not have abiotic items on."
|
||||
return
|
||||
var/mob/M = G.affecting
|
||||
if (M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
M.loc = src
|
||||
src.occupant = M
|
||||
src.icon_state = "celltop_1"
|
||||
for(var/obj/O in src)
|
||||
del(O)
|
||||
src.add_fingerprint(user)
|
||||
del(G)
|
||||
|
||||
|
||||
// Monkey interact same as human
|
||||
|
||||
attack_paw(mob/user)
|
||||
return src.attack_hand(user)
|
||||
|
||||
|
||||
// Human interact, show status window of machine and occupant
|
||||
// No topic links, since all control is handled through the freezer unit
|
||||
|
||||
attack_hand(mob/user)
|
||||
|
||||
if(stat & NOPOWER)
|
||||
return
|
||||
|
||||
user.machine = src
|
||||
if (istype(user, /mob/human))
|
||||
var/dat = "<font color='blue'> <B>System Statistics:</B></FONT><BR>"
|
||||
if (src.gas.temperature > T0C)
|
||||
dat += text("<font color='red'>\tTemperature (°C): [] (MUST be below 0, add coolant to mixture)</FONT><BR>", round(src.gas.temperature-T0C, 0.1))
|
||||
else
|
||||
dat += text("<font color='blue'>\tTemperature (°C): [] </FONT><BR>", round(src.gas.temperature-T0C, 0.1))
|
||||
if (src.gas.plasma < 1)
|
||||
dat += text("<font color='red'>\tPlasma Units: [] (Add plasma to mixture!)</FONT><BR>", round(src.gas.plasma, 0.1))
|
||||
else
|
||||
dat += text("<font color='blue'>\tPlasma Units: []</FONT><BR>", round(src.gas.plasma, 0.1))
|
||||
if (src.gas.oxygen < 1)
|
||||
dat += text("<font color='red'>\tOxygen Units: [] (Add oxygen to mixture!)</FONT><BR>", round(src.gas.oxygen, 0.1))
|
||||
else
|
||||
dat += text("<font color='blue'>\tOxygen Units: []</FONT><BR>", round(src.gas.oxygen, 0.1))
|
||||
if (src.occupant)
|
||||
dat += "<font color='blue'><B>Occupant Statistics:</B></FONT><BR>"
|
||||
var/t1
|
||||
switch(src.occupant.stat)
|
||||
if(0.0)
|
||||
t1 = "Conscious"
|
||||
if(1.0)
|
||||
t1 = "Unconscious"
|
||||
if(2.0)
|
||||
t1 = "*dead*"
|
||||
else
|
||||
dat += text("[]\tHealth %: [] ([])</FONT><BR>", (src.occupant.health > 50 ? "<font color='blue'>" : "<font color='red'>"), src.occupant.health, t1)
|
||||
dat += text("[]\t-Respiratory Damage %: []</FONT><BR>", (src.occupant.oxyloss < 60 ? "<font color='blue'>" : "<font color='red'>"), src.occupant.oxyloss)
|
||||
dat += text("[]\t-Toxin Content %: []</FONT><BR>", (src.occupant.toxloss < 60 ? "<font color='blue'>" : "<font color='red'>"), src.occupant.toxloss)
|
||||
dat += text("[]\t-Burn Severity %: []</FONT>", (src.occupant.fireloss < 60 ? "<font color='blue'>" : "<font color='red'>"), src.occupant.fireloss)
|
||||
dat += text("<BR><BR><A href='?src=\ref[];mach_close=cryo'>Close</A>", user)
|
||||
user << browse(dat, "window=cryo;size=400x500")
|
||||
else
|
||||
var/dat = text("<font color='blue'> <B>[]</B></FONT><BR>", stars("System Statistics:"))
|
||||
if (src.gas.temperature > T0C)
|
||||
dat += text("<font color='red'>\t[]</FONT><BR>", stars(text("Temperature (C): [] (MUST be below 0, add coolant to mixture)", round(src.gas.temperature-T0C, 0.1))))
|
||||
else
|
||||
dat += text("<font color='blue'>\t[] </FONT><BR>", stars(text("Temperature(C): []", round(src.gas.temperature-T0C, 0.1))))
|
||||
if (src.gas.plasma < 1)
|
||||
dat += text("<font color='red'>\t[]</FONT><BR>", stars(text("Plasma Units: [] (Add plasma to mixture!)", round(src.gas.plasma, 0.1))))
|
||||
else
|
||||
dat += text("<font color='blue'>\t[]</FONT><BR>", stars(text("Plasma Units: []", round(src.gas.plasma, 0.1))))
|
||||
if (src.gas.oxygen < 1)
|
||||
dat += text("<font color='red'>\t[]</FONT><BR>", stars(text("Oxygen Units: [] (Add oxygen to mixture!)", round(src.gas.oxygen, 0.1))))
|
||||
else
|
||||
dat += text("<font color='blue'>\t[]</FONT><BR>", stars(text("Oxygen Units: []", round(src.gas.oxygen, 0.1))))
|
||||
if (src.occupant)
|
||||
dat += "<font color='blue'><B>Occupant Statistics:</B></FONT><BR>"
|
||||
var/t1 = null
|
||||
switch(src.occupant.stat)
|
||||
if(0.0)
|
||||
t1 = "Conscious"
|
||||
if(1.0)
|
||||
t1 = "Unconscious"
|
||||
if(2.0)
|
||||
t1 = "*dead*"
|
||||
else
|
||||
dat += text("[]\t[]</FONT><BR>", (src.occupant.health > 50 ? "<font color='blue'>" : "<font color='red'>"), stars(text("Health %: [] ([])", src.occupant.health, t1)))
|
||||
dat += text("[]\t[]</FONT><BR>", (src.occupant.oxyloss < 60 ? "<font color='blue'>" : "<font color='red'>"), stars(text("-Respiratory Damage %: []", src.occupant.oxyloss)))
|
||||
dat += text("[]\t[]</FONT><BR>", (src.occupant.toxloss < 60 ? "<font color='blue'>" : "<font color='red'>"), stars(text("-Toxin Content %: []", src.occupant.toxloss)))
|
||||
dat += text("[]\t[]</FONT>", (src.occupant.fireloss < 60 ? "<font color='blue'>" : "<font color='red'>"), stars(text("-Burn Severity %: []", src.occupant.fireloss)))
|
||||
dat += text("<BR><BR><A href='?src=\ref[];mach_close=cryo'>Close</A>", user)
|
||||
user << browse(dat, "window=cryo;size=400x500")
|
||||
|
||||
|
||||
// Called to remove the occupant of a cell
|
||||
// Reset the view back to normal
|
||||
|
||||
proc/go_out()
|
||||
|
||||
if (!( src.occupant ))
|
||||
return
|
||||
for(var/obj/O in src)
|
||||
O.loc = src.loc
|
||||
|
||||
if (src.occupant.client)
|
||||
src.occupant.client.eye = src.occupant.client.mob
|
||||
src.occupant.client.perspective = MOB_PERSPECTIVE
|
||||
src.occupant.loc = src.loc
|
||||
src.occupant = null
|
||||
src.icon_state = "celltop"
|
||||
|
||||
|
||||
// Called when client tries to move while inside the cell
|
||||
// If the user is able to move, leave the cell
|
||||
|
||||
relaymove(mob/user)
|
||||
|
||||
if (user.stat)
|
||||
return
|
||||
src.go_out()
|
||||
|
||||
|
||||
// Called in mob/Life() proc while mob is inside the cell
|
||||
// Actually heal the occupant, while using up plasma and oxygen from the cell
|
||||
|
||||
alter_health(mob/M)
|
||||
|
||||
if(stat & NOPOWER)
|
||||
return
|
||||
|
||||
if (M.health < 0)
|
||||
if ((src.gas.temperature > T0C || src.gas.plasma < 1))
|
||||
return
|
||||
if (M.stat == 2)
|
||||
return
|
||||
if (src.gas.oxygen >= 1)
|
||||
src.ngas.oxygen--
|
||||
if (M.oxyloss >= 10)
|
||||
var/amount = max(0.15, 2)
|
||||
M.oxyloss -= amount
|
||||
else
|
||||
M.oxyloss = 0
|
||||
M.health = 100 - M.oxyloss - M.toxloss - M.fireloss - M.bruteloss
|
||||
if ((src.gas.temperature < T0C && src.gas.plasma >= 1))
|
||||
src.ngas.plasma--
|
||||
if (M.toxloss > 5)
|
||||
var/amount = max(0.1, 2)
|
||||
M.toxloss -= amount
|
||||
else
|
||||
M.toxloss = 0
|
||||
M.health = 100 - M.oxyloss - M.toxloss - M.fireloss - M.bruteloss
|
||||
if (istype(M, /mob/human))
|
||||
var/mob/human/H = M
|
||||
var/ok = 0
|
||||
for(var/organ in H.organs)
|
||||
var/obj/item/weapon/organ/external/affecting = H.organs[text("[]", organ)]
|
||||
ok += affecting.heal_damage(5, 5)
|
||||
|
||||
if (ok)
|
||||
H.UpdateDamageIcon()
|
||||
else
|
||||
H.UpdateDamage()
|
||||
else
|
||||
if (M.fireloss > 15)
|
||||
var/amount = max(0.3, 2)
|
||||
M.fireloss -= amount
|
||||
else
|
||||
M.fireloss = 0
|
||||
if (M.bruteloss > 10)
|
||||
var/amount = max(0.3, 2)
|
||||
M.bruteloss -= amount
|
||||
else
|
||||
M.bruteloss = 0
|
||||
M.health = 100 - M.oxyloss - M.toxloss - M.fireloss - M.bruteloss
|
||||
M.paralysis += 5
|
||||
if (src.gas.temperature < (60+T0C))
|
||||
src.gas.temperature = min(src.gas.temperature + 1, 60+T0C)
|
||||
|
||||
for(var/mob/E in viewers(1, src))
|
||||
if ((E.client && E.machine == src))
|
||||
src.attack_hand(E)
|
||||
|
||||
|
||||
|
||||
// Explosion - delete the cell or break it
|
||||
|
||||
ex_act(severity)
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
src.icon_state = "broken"
|
||||
|
||||
|
||||
// Blob attack - break the cell
|
||||
|
||||
blob_act()
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
src.icon_state = "broken"
|
||||
src.density = 0
|
||||
|
||||
|
||||
|
||||
/* Unused
|
||||
|
||||
allow_drop()
|
||||
return 0
|
||||
|
||||
*/
|
||||
@@ -0,0 +1,390 @@
|
||||
/*
|
||||
* Freezer -- freezer part of cryocell system.
|
||||
* attaches to the cryocell via a (flex)pipe
|
||||
*
|
||||
* TODO: Better handling of gas flow when freezer is turned off
|
||||
* TODO: Improve flask finding in process()
|
||||
* TODO: Logically, the freezer should warm the environment somewhat just like a real freezer
|
||||
*/
|
||||
|
||||
obj/machinery/freezer
|
||||
name = "freezer"
|
||||
icon = 'Cryogenic2.dmi'
|
||||
icon_state = "freezer_0"
|
||||
density = 1
|
||||
p_dir = 4 // the pipe connection direction (west)
|
||||
anchored = 1
|
||||
capmult = 1 // capacity multiplier
|
||||
|
||||
var
|
||||
connector = null // the flask connecter overlay object
|
||||
obj/machinery/line_out = null // the pipe object connected
|
||||
obj/machinery/vnode = null // the pipeline object associated with line_out
|
||||
c_used = 1.0 // coolant amount used
|
||||
status = 0.0 // true if cooling
|
||||
t_flags = 3.0 // bitflags for oxygen (bit-0) and plasma (bit-1) delivery
|
||||
transfer = 0.0 // true if transfering to cryocell
|
||||
temperature = 60.0+T0C // the temperature setpoint (kelvin)
|
||||
|
||||
obj/substance/gas/gas // the gas reservoir
|
||||
obj/substance/gas/ngas // the new value of the gas reservoir
|
||||
|
||||
|
||||
// Create a new freezer
|
||||
// Create the overlay object for the flask connectors
|
||||
// Create the 3 flasks (as contents of the freezer)
|
||||
// Allocate the gas reservoir and register with the gasflowlist
|
||||
|
||||
New()
|
||||
..()
|
||||
var/obj/overlay/O1 = new /obj/overlay( )
|
||||
O1.icon = 'Cryogenic2.dmi'
|
||||
O1.icon_state = "canister connector_0"
|
||||
O1.pixel_y = -16.0
|
||||
src.overlays += O1
|
||||
src.connector = O1
|
||||
new /obj/item/weapon/flasks/oxygen( src )
|
||||
new /obj/item/weapon/flasks/coolant( src )
|
||||
new /obj/item/weapon/flasks/plasma( src )
|
||||
rebuild_overlay()
|
||||
|
||||
gas = new/obj/substance/gas()
|
||||
ngas = new/obj/substance/gas()
|
||||
|
||||
gasflowlist += src
|
||||
|
||||
|
||||
// Find the (flex)pipe connected to the freezer
|
||||
|
||||
buildnodes()
|
||||
var/turf/T = src.loc
|
||||
|
||||
line_out = get_machine(level, T, p_dir )
|
||||
|
||||
if(line_out) vnode = line_out.getline() // the pipeline associated with the pipe
|
||||
|
||||
|
||||
// Update gas levels with the new levels calculated in process()
|
||||
|
||||
gas_flow()
|
||||
gas.replace_by(ngas)
|
||||
|
||||
|
||||
// Called to leak gas to the turf one step east, if the pipe is not present
|
||||
|
||||
proc/leak_to_turf()
|
||||
var/turf/T = get_step(src, EAST)
|
||||
|
||||
if(T.density)
|
||||
T = src.loc
|
||||
if(T.density)
|
||||
return
|
||||
|
||||
flow_to_turf(gas, ngas, T)
|
||||
|
||||
|
||||
// Returns the gas fullness value
|
||||
|
||||
get_gas_val(from)
|
||||
return gas.tot_gas()
|
||||
|
||||
|
||||
// Returns the gas reservoir
|
||||
|
||||
get_gas(from)
|
||||
return gas
|
||||
|
||||
|
||||
// Interact by monkey same as human
|
||||
|
||||
attack_paw(mob/user)
|
||||
return src.attack_hand(user)
|
||||
|
||||
|
||||
// Interact by human
|
||||
// Show the interaction window
|
||||
|
||||
attack_hand(mob/user)
|
||||
|
||||
user.machine = src
|
||||
|
||||
if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey"))))
|
||||
var/d1
|
||||
if (locate(/obj/item/weapon/flasks, src))
|
||||
var/counter = 1
|
||||
|
||||
for(var/obj/item/weapon/flasks/F in src)
|
||||
d1 += text("<A href = '?src=\ref[];flask=[]'><B>Flask []</B></A>: [] / [] / []<BR>", src, counter, counter, F.oxygen, F.plasma, F.coolant)
|
||||
counter++
|
||||
//Foreach goto(78)
|
||||
d1 += "Key: Oxygen / Plasma / Coolant<BR>"
|
||||
else
|
||||
d1 = "<B>No flasks!</B>"
|
||||
var/t1 = null
|
||||
switch(src.t_flags)
|
||||
if(0.0)
|
||||
t1 = text("<A href = '?src=\ref[];oxygen=1'>Oxygen-No</A> <A href = '?src=\ref[];plasma=1'>Plasma-No</A>", src, src)
|
||||
if(1.0)
|
||||
t1 = text("<A href = '?src=\ref[];oxygen=0'>Oxygen-Yes</A> <A href = '?src=\ref[];plasma=1'>Plasma-No</A>", src, src)
|
||||
if(2.0)
|
||||
t1 = text("<A href = '?src=\ref[];oxygen=1'>Oxygen-No</A> <A href = '?src=\ref[];plasma=0'>Plasma-Yes</A>", src, src)
|
||||
if(3.0)
|
||||
t1 = text("<A href = '?src=\ref[];oxygen=0'>Oxygen-Yes</A> <A href = '?src=\ref[];plasma=0'>Plasma-Yes</A>", src, src)
|
||||
else
|
||||
var/t2 = null
|
||||
if (src.status)
|
||||
t2 = text("Cooling-[] <A href = '?src=\ref[];cool=0'>Stop</A>", src.c_used, src)
|
||||
else
|
||||
t2 = text("<A href = '?src=\ref[];cool=1'>Cool</A> Stopped", src)
|
||||
var/dat = text("<HTML><HEAD></HEAD><BODY><TT><BR>\n\t\t<B>Temperature</B>: []<BR>\n\t\t<B>Transfer Status</B>: []<BR>\n\t\t <B>Chemicals Used</B>: []<BR>\n\t\t<B>Freezer status</B>: []<BR>\n\t\t <A href='?src=\ref[];cp=-5'>-</A> <A href='?src=\ref[];cp=-1'>-</A> [] <A href='?src=\ref[];cp=1'>+</A> <A href='?src=\ref[];cp=5'>+</A><BR>\n<BR>\n\t[]<BR>\n<BR>\n<BR>\n\t<A href='?src=\ref[];mach_close=freezer'>Close</A><BR>\n\t</TT></BODY></HTML>", src.temperature-T0C, (src.transfer ? text("Transfering <A href='?src=\ref[];transfer=0'>Stop</A>", src) : text("<A href='?src=\ref[];transfer=1'>Transfer</A> Stopped", src)), t1, t2, src, src, src.c_used, src, src, d1, user)
|
||||
user << browse(dat, "window=freezer;size=400x500")
|
||||
else
|
||||
var/d1 = null
|
||||
if (locate(/obj/item/weapon/flasks, src))
|
||||
var/counter = 1
|
||||
for(var/obj/item/weapon/flasks/F in src)
|
||||
d1 += text("<A href = '?src=\ref[];flask=[]'><B>[] []</B></A>: []<BR>", src, counter, stars("Flask"), counter, stars(text("[] / [] / []", F.oxygen, F.plasma, F.coolant)))
|
||||
counter++
|
||||
//Foreach goto(380)
|
||||
d1 += "Key: Oxygen / Plasma / Coolant<BR>"
|
||||
else
|
||||
d1 = "<B>No flasks!</B>"
|
||||
var/t1 = null
|
||||
switch(src.t_flags)
|
||||
if(0.0)
|
||||
t1 = text("<A href = '?src=\ref[];oxygen=1'>[]</A> <A href = '?src=\ref[];plasma=1'>[]</A>", src, stars("Oxygen-No"), src, stars("Plasma-No"))
|
||||
if(1.0)
|
||||
t1 = text("<A href = '?src=\ref[];oxygen=0'>[]</A> <A href = '?src=\ref[];plasma=1'>[]</A>", src, stars("Oxygen-Yes"), src, stars("Plasma-No"))
|
||||
if(2.0)
|
||||
t1 = text("<A href = '?src=\ref[];oxygen=1'>[]</A> <A href = '?src=\ref[];plasma=0'>[]</A>", src, stars("Oxygen-No"), src, stars("Plasma-Yes"))
|
||||
if(3.0)
|
||||
t1 = text("<A href = '?src=\ref[];oxygen=0'>[]</A> <A href = '?src=\ref[];plasma=0'>[]</A>", src, stars("Oxygen-Yes"), src, stars("Plasma-Yes"))
|
||||
else
|
||||
var/t2 = null
|
||||
if (src.status)
|
||||
t2 = text("Cooling-[] <A href = '?src=\ref[];cool=0'>[]</A>", src.c_used, src, stars("Stop"))
|
||||
else
|
||||
t2 = text("<A href = '?src=\ref[];cool=1'>Cool</A> []", src, stars("Stopped"))
|
||||
var/dat = text("<HTML><HEAD></HEAD><BODY><TT><BR>\n\t\t<B>[]</B>: []<BR>\n\t\t<B>[]</B>: []<BR>\n\t\t <B>[]</B>: []<BR>\n\t\t<B>[]</B>: []<BR>\n\t\t <A href='?src=\ref[];cp=-5'>-</A> <A href='?src=\ref[];cp=-1'>-</A> [] <A href='?src=\ref[];cp=1'>+</A> <A href='?src=\ref[];cp=5'>+</A><BR>\n<BR>\n\t[]<BR>\n<BR>\n<BR>\n\t<A href='?src=\ref[];mach_close=freezer'>Close</A>\n\t</TT></BODY></HTML>", stars("Temperature"), src.temperature-T0C, stars("Transfer Status"), (src.transfer ? text("Transfering <A href='?src=\ref[];transfer=0'>Stop</A>", src) : text("<A href='?src=\ref[];transfer=1'>Transfer</A> Stopped", src)), stars("Chemicals Used"), t1, stars("Freezer status"), t2, src, src, src.c_used, src, src, d1, user)
|
||||
user << browse(dat, "window=freezer;size=400x500")
|
||||
|
||||
|
||||
// Handle topic links from interaction window
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey"))))
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
if ((usr.stat || usr.restrained()))
|
||||
return
|
||||
if ((usr.contents.Find(src) || (get_dist(src, usr) <= 1 && istype(src.loc, /turf))))
|
||||
usr.machine = src
|
||||
if (href_list["cp"])
|
||||
var/cp = text2num(href_list["cp"])
|
||||
src.c_used += cp
|
||||
src.c_used = min(max(round(src.c_used), 0), 10)
|
||||
if (href_list["oxygen"])
|
||||
var/t1 = text2num(href_list["oxygen"])
|
||||
if (t1)
|
||||
src.t_flags |= 1
|
||||
else
|
||||
src.t_flags &= 65534
|
||||
if (href_list["plasma"])
|
||||
var/t1 = text2num(href_list["plasma"])
|
||||
if (t1)
|
||||
src.t_flags |= 2
|
||||
else
|
||||
src.t_flags &= 65533
|
||||
if (href_list["cool"])
|
||||
src.status = text2num(href_list["cool"])
|
||||
src.icon_state = text("freezer_[]", src.status)
|
||||
if (href_list["transfer"])
|
||||
src.transfer = text2num(href_list["transfer"])
|
||||
if (href_list["flask"])
|
||||
var/t1 = text2num(href_list["flask"])
|
||||
if (t1 <= src.contents.len)
|
||||
var/obj/F = src.contents[t1]
|
||||
F.loc = src.loc
|
||||
src.rebuild_overlay()
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
|
||||
// Attack with item
|
||||
// If a flask, add to contents and rebuild overlays
|
||||
|
||||
attackby(obj/item/weapon/flasks/F, mob/user)
|
||||
|
||||
if (!( istype(F, /obj/item/weapon/flasks) ))
|
||||
return
|
||||
if (src.contents.len >= 3)
|
||||
user << "\blue All slots are full!"
|
||||
return
|
||||
else
|
||||
user.drop_item()
|
||||
F.loc = src
|
||||
src.rebuild_overlay()
|
||||
|
||||
|
||||
// Called when area power state changes
|
||||
// Set icon state depending on power status
|
||||
|
||||
power_change()
|
||||
..()
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "freezer_0"
|
||||
else
|
||||
src.icon_state = "freezer_[status]"
|
||||
|
||||
|
||||
// Called to update the overlays of the connector and flasks
|
||||
|
||||
proc/rebuild_overlay()
|
||||
for(var/x in src.overlays)
|
||||
src.overlays -= x
|
||||
|
||||
src.overlays += src.connector
|
||||
var/counter = 0
|
||||
|
||||
for(var/obj/item/weapon/flasks/F in src.contents)
|
||||
var/obj/overlay/O = new /obj/overlay( )
|
||||
O.icon = F.icon
|
||||
O.icon_state = F.icon_state
|
||||
O.pixel_y = -17.0
|
||||
O.pixel_x = counter * 12
|
||||
src.overlays += O
|
||||
counter++
|
||||
if (counter >= 3)
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
// Timed process
|
||||
// Deplete flasks and cool/add to gas reservoir as appropriate
|
||||
// Perform flow into pipe
|
||||
// Note: Flask finding/depletion process is rather inefficient - rewrite?
|
||||
// TODO: Make gas flow when not transfering from flasks
|
||||
|
||||
process()
|
||||
|
||||
if(stat & NOPOWER)
|
||||
return
|
||||
|
||||
use_power(50)
|
||||
|
||||
var/obj/item/weapon/flasks/F1
|
||||
var/obj/item/weapon/flasks/F2
|
||||
var/obj/item/weapon/flasks/F3
|
||||
if (src.contents.len >= 3)
|
||||
F3 = src.contents[3]
|
||||
if (src.contents.len >= 2)
|
||||
F2 = src.contents[2]
|
||||
if (src.contents.len >= 1)
|
||||
F1 = src.contents[1]
|
||||
var/u_cool = 0
|
||||
if (src.status)
|
||||
u_cool = src.c_used
|
||||
|
||||
if ((F2 && F2.coolant))
|
||||
if (F2.coolant >= u_cool)
|
||||
F2.coolant -= u_cool
|
||||
else
|
||||
u_cool = F2.coolant
|
||||
F2.coolant = 0
|
||||
|
||||
else if ((F1 && F1.coolant))
|
||||
if (F1.coolant >= u_cool)
|
||||
F1.coolant -= u_cool
|
||||
else
|
||||
u_cool = F1.coolant
|
||||
F1.coolant = 0
|
||||
|
||||
else if ((F3 && F3.coolant))
|
||||
if (F3.coolant >= u_cool)
|
||||
F3.coolant -= u_cool
|
||||
else
|
||||
u_cool = F3.coolant
|
||||
F3.coolant = 0
|
||||
else
|
||||
u_cool = 0
|
||||
|
||||
if (u_cool)
|
||||
src.temperature = max((-100.0+T0C), src.temperature - (u_cool * 5) )
|
||||
use_power(200)
|
||||
|
||||
src.temperature = min(src.temperature + 5, 20+T0C)
|
||||
if (src.transfer)
|
||||
var/u_oxy = 0
|
||||
var/u_pla = 0
|
||||
|
||||
if (src.t_flags & 1)
|
||||
u_oxy = 1
|
||||
if ((F1 && F1.oxygen))
|
||||
if (F1.oxygen >= u_oxy)
|
||||
F1.oxygen -= u_oxy
|
||||
else
|
||||
u_oxy = F1.oxygen
|
||||
F1.oxygen = 0
|
||||
else
|
||||
if ((F2 && F2.oxygen))
|
||||
if (F2.oxygen >= u_oxy)
|
||||
F2.oxygen -= u_oxy
|
||||
else
|
||||
u_oxy = F2.oxygen
|
||||
F2.oxygen = 0
|
||||
else
|
||||
if ((F3 && F3.oxygen))
|
||||
if (F3.oxygen >= u_oxy)
|
||||
F3.oxygen -= u_oxy
|
||||
else
|
||||
u_oxy = F3.oxygen
|
||||
F3.oxygen = 0
|
||||
else
|
||||
u_oxy = 0
|
||||
|
||||
if (src.t_flags & 2)
|
||||
u_pla = 1
|
||||
if ((F3 && F3.plasma))
|
||||
if (F3.plasma >= u_pla)
|
||||
F3.plasma -= u_pla
|
||||
else
|
||||
u_pla = F3.plasma
|
||||
F3.plasma = 0
|
||||
else
|
||||
if ((F2 && F2.plasma))
|
||||
if (F2.plasma >= u_pla)
|
||||
F2.plasma -= u_pla
|
||||
else
|
||||
u_pla = F2.plasma
|
||||
F2.plasma = 0
|
||||
else
|
||||
if ((F1 && F1.plasma))
|
||||
if (F1.plasma >= u_pla)
|
||||
F1.plasma -= u_pla
|
||||
else
|
||||
u_pla = F1.plasma
|
||||
F1.plasma = 0
|
||||
else
|
||||
u_pla = 0
|
||||
if ( (u_oxy + u_pla) > 0)
|
||||
ngas.oxygen += u_oxy
|
||||
ngas.plasma += u_pla
|
||||
ngas.temperature = src.temperature
|
||||
spawn( 1 )
|
||||
if (src.line_out)
|
||||
|
||||
if(vnode)
|
||||
var/delta_gt = FLOWFRAC * ( vnode.get_gas_val(src) - gas.tot_gas() / capmult)
|
||||
calc_delta( src, gas, ngas, vnode, delta_gt)
|
||||
else
|
||||
leak_to_turf()
|
||||
|
||||
return
|
||||
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,280 @@
|
||||
/*
|
||||
* Nuclearbomb -- A nuclear explosive
|
||||
*
|
||||
* Requires authentication disk and code to activate
|
||||
*
|
||||
* As used in "Nuclear" mode.
|
||||
*
|
||||
* TODO: Unify explosion proc with other explosions (plamsabombs, etc.)
|
||||
*
|
||||
*/
|
||||
|
||||
obj/machinery/nuclearbomb
|
||||
desc = "Uh oh."
|
||||
name = "Nuclear Fission Explosive"
|
||||
icon = 'stationobjs.dmi'
|
||||
icon_state = "nuclearbomb0"
|
||||
density = 1
|
||||
flags = FPRINT|DRIVABLE
|
||||
|
||||
var
|
||||
extended = 0 // True if bomb is deployed
|
||||
timeleft = 60.0 // Time (seconds) until explosion
|
||||
timing = 0 // True if counting down the timer
|
||||
r_code = "ADMIN" // The activation code of the nuke
|
||||
code = "" // The code typed in
|
||||
yes_code = 0 // True if typed code matches
|
||||
safety = 1 // False to enable bomb to explode
|
||||
obj/item/weapon/disk/nuclear/auth = null // The authenication disk of the nuke, or null if none inserted
|
||||
|
||||
|
||||
// Create a nuclear bomb.
|
||||
// nuke_code is a global integer randomly set between 10000 and 99999
|
||||
|
||||
New()
|
||||
|
||||
if (nuke_code)
|
||||
src.r_code = "[nuke_code]"
|
||||
..()
|
||||
|
||||
|
||||
// Timed process
|
||||
// If timing, count down the timer and explode when expires
|
||||
// Update interaction window of viewing clients
|
||||
|
||||
process()
|
||||
|
||||
if (src.timing)
|
||||
src.timeleft--
|
||||
if (src.timeleft <= 0)
|
||||
explode()
|
||||
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
|
||||
|
||||
// Monkey interact same as human
|
||||
|
||||
attack_paw(mob/user)
|
||||
return src.attack_hand(user)
|
||||
|
||||
|
||||
// Human interact
|
||||
// If already deployed, show the interaction window
|
||||
// Otherwise, deploy and anchor the bomb
|
||||
|
||||
attack_hand(mob/user)
|
||||
if (src.extended) // Bomb deployed?
|
||||
user.machine = src
|
||||
|
||||
// insert auth disk here
|
||||
var/dat = {"<TT><B>Nuclear Fission Explosive</B><BR>
|
||||
Auth. Disk: <A href='?src=\ref[src];auth=1'>[(src.auth ? "++++++++++" : "----------")]</A><HR>"}
|
||||
|
||||
if (src.auth) // auth disk inserted
|
||||
if (src.yes_code) // and code is correct
|
||||
// show full control panel
|
||||
dat += {"
|
||||
<B>Status</B>: [(src.timing ? "Func/Set" : "Functional")]-[(src.safety ? "Safe" : "Engaged")]<BR>
|
||||
<B>Timer</B>: [src.timeleft]<BR>
|
||||
<BR>
|
||||
Timer: [(src.timing ? "On" : "Off")] <A href='?src=\ref[src];timer=1'>Toggle</A><BR>
|
||||
Time: <A href='?src=\ref[src];time=-10'>-</A> <A href='?src=\ref[src];time=-1'>-</A> [src.timeleft] <A href='?src=\ref[src];time=1'>+</A> <A href='?src=\ref[src];time=10'>+</A><BR>
|
||||
<BR>
|
||||
Safety: [(src.safety ? "On" : "Off")] <A href='?src=\ref[src];safety=1'>Toggle</A><BR>
|
||||
Anchor: [(src.anchored ? "Engaged" : "Off")] <A href='?src=\ref[src];anchor=1'>Toggle</A><BR>
|
||||
"}
|
||||
|
||||
else // otherwise, lock controls until code entered
|
||||
|
||||
dat += {"
|
||||
<B>Status</B>: Auth. S2-[(src.safety ? "Safe" : "Engaged")]<BR>
|
||||
<B>Timer</B>: [src.timeleft]<BR>
|
||||
<BR>\nTimer: [(src.timing ? "On" : "Off")] Toggle<BR>
|
||||
Time: - - [src.timeleft] + +<BR>
|
||||
<BR>
|
||||
Safety: [(src.safety ? "On" : "Off")] Toggle<BR>
|
||||
Anchor: [(src.anchored ? "Engaged" : "Off")] Toggle<BR>
|
||||
"}
|
||||
|
||||
else
|
||||
if (src.timing) // auth disk removed, but counting down, lock controls
|
||||
|
||||
dat += {"
|
||||
<B>Status</B>: Set-[(src.safety ? "Safe" : "Engaged")]<BR>
|
||||
<B>Timer</B>: [src.timeleft]<BR>
|
||||
<BR>
|
||||
Timer: [(src.timing ? "On" : "Off")] Toggle<BR>
|
||||
Time: - - [src.timeleft] + +<BR>
|
||||
<BR>
|
||||
Safety: [(src.safety ? "On" : "Off")] Toggle<BR>
|
||||
Anchor: [(src.anchored ? "Engaged" : "Off")] Toggle<BR>
|
||||
"}
|
||||
|
||||
else // also lock controls if not counting, no auth disk
|
||||
|
||||
dat += {"
|
||||
<B>Status</B>: Auth. S1-[(src.safety ? "Safe" : "Engaged")]<BR>
|
||||
<B>Timer</B>: [src.timeleft]<BR>
|
||||
<BR>
|
||||
Timer: [(src.timing ? "On" : "Off")] Toggle<BR>
|
||||
Time: - - [src.timeleft] + +<BR>
|
||||
<BR>
|
||||
Safety: [(src.safety ? "On" : "Off")] Toggle<BR>
|
||||
Anchor: [(src.anchored ? "Engaged" : "Off")] Toggle<BR>
|
||||
"}
|
||||
|
||||
var/message = "AUTH"
|
||||
|
||||
if (src.auth)
|
||||
message = "[src.code]"
|
||||
if (src.yes_code)
|
||||
message = "*****"
|
||||
// The keypad - enter code here
|
||||
dat += {"<HR>
|
||||
[message]<BR>
|
||||
<A href='?src=\ref[src];type=1'>1</A>-<A href='?src=\ref[src];type=2'>2</A>-<A href='?src=\ref[src];type=3'>3</A><BR>
|
||||
<A href='?src=\ref[src];type=4'>4</A>-<A href='?src=\ref[src];type=5'>5</A>-<A href='?src=\ref[src];type=6'>6</A><BR>
|
||||
<A href='?src=\ref[src];type=7'>7</A>-<A href='?src=\ref[src];type=8'>8</A>-<A href='?src=\ref[src];type=9'>9</A><BR>
|
||||
<A href='?src=\ref[src];type=R'>R</A>-<A href='?src=\ref[src];type=0'>0</A>-<A href='?src=\ref[src];type=E'>E</A><BR>
|
||||
</TT>"}
|
||||
user << browse(dat, "window=nuclearbomb;size=300x400")
|
||||
|
||||
else // Deploy and anchor the bomb.
|
||||
|
||||
src.anchored = 1
|
||||
flick("nuclearbombc", src)
|
||||
src.icon_state = "nuclearbomb1"
|
||||
src.extended = 1
|
||||
return
|
||||
|
||||
|
||||
// Handle topic links from interaction window
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
if (usr.stat || usr.restrained())
|
||||
return
|
||||
if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey"))))
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
if ((usr.contents.Find(src) || (get_dist(src, usr) <= 1 && istype(src.loc, /turf))))
|
||||
usr.machine = src
|
||||
|
||||
if (href_list["auth"]) // auth link - if disk already inserted, remove it
|
||||
if (src.auth)
|
||||
src.auth.loc = src.loc
|
||||
src.yes_code = 0
|
||||
src.auth = null
|
||||
else // if not inserted, check that it's in the player's hand
|
||||
var/obj/item/I = usr.equipped()
|
||||
if (istype(I, /obj/item/weapon/disk/nuclear))
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
src.auth = I
|
||||
if (src.auth)
|
||||
if (href_list["type"]) // keypad typing
|
||||
if (href_list["type"] == "E") // enter the current code, check against nuke code
|
||||
if (src.code == src.r_code)
|
||||
src.yes_code = 1
|
||||
src.code = null
|
||||
else
|
||||
src.code = "ERROR"
|
||||
else
|
||||
if (href_list["type"] == "R") // reset code
|
||||
src.yes_code = 0
|
||||
src.code = null
|
||||
else
|
||||
src.code += "[href_list["type"]]" // otherwise, add a digit
|
||||
if (length(src.code) > 5)
|
||||
src.code = "ERROR"
|
||||
if (src.yes_code)
|
||||
if (href_list["time"])
|
||||
var/time = text2num(href_list["time"])
|
||||
src.timeleft += time
|
||||
src.timeleft = min(max(round(src.timeleft), 5), 600)
|
||||
if (href_list["timer"])
|
||||
if (src.timing == -1.0)
|
||||
return
|
||||
src.timing = !( src.timing )
|
||||
if (src.timing)
|
||||
src.icon_state = "nuclearbomb2"
|
||||
else
|
||||
src.icon_state = "nuclearbomb1"
|
||||
if (href_list["safety"])
|
||||
src.safety = !( src.safety )
|
||||
if (href_list["anchor"])
|
||||
src.anchored = !( src.anchored )
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
else
|
||||
usr << browse(null, "window=nuclearbomb")
|
||||
return
|
||||
|
||||
|
||||
// On explosion, only (potentially) delete nuke if not about to explode
|
||||
|
||||
ex_act()
|
||||
if (src.timing == -1.0)
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
// Blob attack same as explosion
|
||||
|
||||
blob_act()
|
||||
|
||||
if (src.timing == -1.0)
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
|
||||
|
||||
// Explode the nuke, destroying almost everything around
|
||||
// TODO: Unify this explosion proc with others
|
||||
|
||||
proc/explode()
|
||||
|
||||
if (src.safety)
|
||||
src.timing = 0
|
||||
return
|
||||
src.timing = -1.0
|
||||
src.yes_code = 0
|
||||
src.icon_state = "nuclearbomb3"
|
||||
sleep(20) // 2 second delay
|
||||
var/turf/T = src.loc
|
||||
while(!( istype(T, /turf) ))
|
||||
T = T.loc
|
||||
var/min = 50
|
||||
var/med = 250
|
||||
var/max = 500
|
||||
var/sw = locate(1, 1, T.z) // explosion encompasses whole of z-level
|
||||
var/ne = locate(world.maxx, world.maxy, T.z)
|
||||
|
||||
defer_powernet_rebuild = 1 // Prevent powenet being rebuilt when cable objects deleted
|
||||
|
||||
for(var/turf/U in block(sw, ne))
|
||||
var/zone = 4
|
||||
if ((U.y <= T.y + max && U.y >= T.y - max && U.x <= T.x + max && U.x >= T.x - max))
|
||||
zone = 3
|
||||
if ((U.y <= T.y + med && U.y >= T.y - med && U.x <= T.x + med && U.x >= T.x - med))
|
||||
zone = 2
|
||||
if ((U.y <= T.y + min && U.y >= T.y - min && U.x <= T.x + min && U.x >= T.x - min))
|
||||
zone = 1
|
||||
for(var/atom/A in U)
|
||||
A.ex_act(zone)
|
||||
|
||||
U.ex_act(zone)
|
||||
U.buildlinks()
|
||||
|
||||
|
||||
defer_powernet_rebuild = 0 // Renable powernet rebuilt
|
||||
makepowernets() // And do so
|
||||
ticker.nuclear(src.z) // inform gameticker that nuke exploded
|
||||
del(src)
|
||||
@@ -0,0 +1,201 @@
|
||||
/*
|
||||
* Pod -- escape pod.
|
||||
*
|
||||
* Pilotable object that can carry people and other objects
|
||||
*
|
||||
* TODO: Work out whats going on at low speeds <=10 in process()
|
||||
* TODO: Limit the capcity of the pod in some way - current carrying capacity is infinite
|
||||
* Could use a simple count or based on item weight, w_class, etc.
|
||||
*/
|
||||
|
||||
obj/machinery/pod
|
||||
name = "Escape Pod"
|
||||
icon = 'escapepod.dmi'
|
||||
icon_state = "pod"
|
||||
density = 1
|
||||
flags = FPRINT|DRIVABLE
|
||||
anchored = 1
|
||||
|
||||
var
|
||||
id = 1.0 // Not used
|
||||
speed = 10.0 // The current speed, in tiles per second, roughly
|
||||
capacity = null // Not used
|
||||
|
||||
|
||||
// Timed process
|
||||
// Move the pod depending on its speed and direction
|
||||
|
||||
process()
|
||||
if (src.speed)
|
||||
if (src.speed <= 10) // at low speed
|
||||
var/t1 = 10 - src.speed // very odd - step (with delay) an inverse number of times?
|
||||
//var t1 = speed // consider replacing with this - much more controllable! - Hobnob
|
||||
while(t1 > 0)
|
||||
step(src, src.dir)
|
||||
sleep(1)
|
||||
t1--
|
||||
else // at high speed
|
||||
var/t1 = round(src.speed / 5) // step speed/5 times per process
|
||||
while(t1 > 0)
|
||||
step(src, src.dir)
|
||||
t1--
|
||||
|
||||
|
||||
// Called when pod bumps into something
|
||||
// Set the speed to zero
|
||||
|
||||
Bump(var/atom/A)
|
||||
spawn( 0 )
|
||||
..()
|
||||
src.speed = 0
|
||||
|
||||
|
||||
// Called when client attempts to move, and is inside a pod
|
||||
// direction is the direction key the client used
|
||||
|
||||
relaymove(mob/user, direction)
|
||||
|
||||
if (user.stat)
|
||||
return
|
||||
if ((user in src)) // make sure player is inside this pod
|
||||
|
||||
if (direction & 1) // North pressed
|
||||
src.speed = max(src.speed - 1, 1) // slow down to minimum speed (1)
|
||||
|
||||
else if (direction & 2) // South pressed
|
||||
src.speed++ // Increase speed up to maximum (10)
|
||||
if (src.speed > 10)
|
||||
src.speed = 10
|
||||
if (direction & 4) // East pressed
|
||||
src.dir = turn(src.dir, -90.0) // Turn clockwise
|
||||
|
||||
else if (direction & 8) // West pressed
|
||||
src.dir = turn(src.dir, 90) // Turn anticlockwise
|
||||
|
||||
|
||||
|
||||
// Pod Verbs
|
||||
|
||||
|
||||
// Eject from pod - place player behind pod and restore view
|
||||
|
||||
verb/eject()
|
||||
set src = usr.loc
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
var/mob/M = usr
|
||||
M.loc = src.loc
|
||||
if (M.client)
|
||||
M.client.eye = M.client.mob
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
step(M, turn(src.dir, 180))
|
||||
|
||||
|
||||
// Board the pod - place player inside the pod and set the view to follow the pod
|
||||
|
||||
verb/board()
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
var/mob/M = usr
|
||||
if (M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
M.loc = src
|
||||
return
|
||||
|
||||
|
||||
// Load pod - whatever the player is pulling gets loaded into the pod (including other players)
|
||||
|
||||
verb/load()
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
if (( ( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey"))))
|
||||
var/mob/human/H = usr
|
||||
|
||||
if ((H.pulling && !( H.pulling.anchored )))
|
||||
|
||||
H.pulling.loc = src
|
||||
|
||||
if (ismob(H.pulling))
|
||||
var/mob/M = H.pulling
|
||||
if (M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << text("\blue <B> [] loads [] into []!</B>", H, H.pulling, src)
|
||||
H.pulling = null
|
||||
return
|
||||
|
||||
|
||||
// Unload a pod - remove an item or mob from the pod
|
||||
// If a client mob, restore their view settings
|
||||
|
||||
verb/unload(var/atom/movable/A in src.contents)
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
if (istype(A, /atom/movable))
|
||||
A.loc = src.loc
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << text("\blue <B> [] unloads [] from []!</B>", usr, A, src)
|
||||
//Foreach goto(54)
|
||||
if (ismob(A))
|
||||
var/mob/M = A
|
||||
if (M.client)
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
M.client.eye = M
|
||||
step(A, turn(src.dir, 180))
|
||||
return
|
||||
|
||||
|
||||
// Damage procs
|
||||
|
||||
// Hit by meteor - eject/unload everything from the pod
|
||||
|
||||
meteorhit(var/obj/O)
|
||||
|
||||
if (O.icon_state == "flaming")
|
||||
for(var/obj/item/I in src)
|
||||
I.loc = src.loc
|
||||
|
||||
for(var/mob/M in src)
|
||||
M.loc = src.loc
|
||||
if (M.client)
|
||||
M.client.eye = M.client.mob
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
|
||||
del(src)
|
||||
|
||||
|
||||
// In explosion - eject everything and destroy pod
|
||||
|
||||
ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
for(var/atom/movable/A in src)
|
||||
A.loc = src.loc
|
||||
A.ex_act(severity)
|
||||
del(src)
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/atom/movable/A in src)
|
||||
A.loc = src.loc
|
||||
A.ex_act(severity)
|
||||
del(src)
|
||||
|
||||
|
||||
// Blob attack - eject everything and destroy pod
|
||||
|
||||
blob_act()
|
||||
|
||||
for(var/atom/movable/A in src)
|
||||
A.loc = src.loc
|
||||
del(src)
|
||||
@@ -0,0 +1,198 @@
|
||||
/*
|
||||
* Recon -- reconaissance pod
|
||||
*
|
||||
* Very similar to escape pods, except can carry only 1 person
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
obj/machinery/recon
|
||||
name = "1-Person Reconaissance Pod"
|
||||
icon = 'escapepod.dmi'
|
||||
icon_state = "recon"
|
||||
density = 1
|
||||
flags = FPRINT|DRIVABLE
|
||||
anchored = 1
|
||||
var
|
||||
speed = 1 // the current speed, turfs/second
|
||||
|
||||
|
||||
// Timed process
|
||||
// Move according to current speed and direction
|
||||
|
||||
process()
|
||||
if (src.speed)
|
||||
if (src.speed <= 10)
|
||||
var/t1 = 10 - src.speed // See note for pod/process()
|
||||
// var/t1 = src.speed
|
||||
while(t1 > 0)
|
||||
step(src, src.dir)
|
||||
sleep(1)
|
||||
t1--
|
||||
else
|
||||
var/t1 = round(src.speed / 5)
|
||||
while(t1 > 0)
|
||||
step(src, src.dir)
|
||||
t1--
|
||||
|
||||
|
||||
// Called when we bump into a dense object
|
||||
// Set speed to zero
|
||||
|
||||
Bump()
|
||||
spawn( 0 )
|
||||
..()
|
||||
src.speed = 0
|
||||
|
||||
|
||||
// Called by client/Move() when player tries to move while inside a recon
|
||||
// direction is the key pressed
|
||||
|
||||
relaymove(mob/user, direction)
|
||||
if (user.stat)
|
||||
return
|
||||
|
||||
if ((user in src))
|
||||
if (direction & 1) // North
|
||||
src.speed = max(src.speed - 1, 1) // Slow down
|
||||
|
||||
else if (direction & 2) // South
|
||||
src.speed++ // Speed up
|
||||
|
||||
if (direction & 4) // East
|
||||
src.dir = turn(src.dir, -90.0) // Turn clockwise
|
||||
|
||||
else if (direction & 8) // West
|
||||
src.dir = turn(src.dir, 90) // Turn anticlockwise
|
||||
|
||||
if (direction & 16) // Centre
|
||||
src.speed = 30 // Speed boost
|
||||
else
|
||||
src.speed = min(src.speed, 10) // otherwise max speed is 10 turfs/second
|
||||
|
||||
|
||||
// Recon verbs
|
||||
|
||||
|
||||
// Eject from the recon, reset view to player
|
||||
|
||||
verb/eject()
|
||||
set src = usr.loc
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
var/mob/M = usr
|
||||
M.loc = src.loc
|
||||
if (M.client)
|
||||
M.client.eye = M.client.mob
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
|
||||
|
||||
// Board the recon, set view to follow the object
|
||||
|
||||
verb/board()
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
if (locate(/mob, src))
|
||||
usr << "There is no room! You can only fit one person."
|
||||
return
|
||||
var/mob/M = usr
|
||||
if (M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
M.loc = src
|
||||
|
||||
|
||||
// Load the recon with the pulled object
|
||||
// Note recons can carry only items, unlike escape pobs which can carry any movable object
|
||||
|
||||
verb/load()
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
if ((( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey"))))
|
||||
var/mob/human/H = usr
|
||||
if ((H.pulling && !( H.pulling.anchored )))
|
||||
if (!( istype(H.pulling, /obj/item/weapon) ))
|
||||
usr << "You may only place items in."
|
||||
else
|
||||
if ((locate(/mob, src) && ismob(H.pulling)))
|
||||
usr << "There is no room! You can only fit one person."
|
||||
else
|
||||
H.pulling.loc = src
|
||||
if (ismob(H.pulling))
|
||||
var/mob/M = H.pulling
|
||||
if (M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << text("\blue <B> [] loads [] into []!</B>", H, H.pulling, src)
|
||||
//Foreach goto(204)
|
||||
H.pulling = null
|
||||
|
||||
|
||||
// Unload an object from the recon
|
||||
// If a player, reset the player's view to normal
|
||||
|
||||
verb/unload(atom/movable/A in src)
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
if (istype(A, /atom/movable))
|
||||
A.loc = src.loc
|
||||
for(var/mob/O in view(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << text("\blue <B> [] unloads [] from []!</B>", usr, A, src)
|
||||
//Foreach goto(53)
|
||||
if (ismob(A))
|
||||
var/mob/M = A
|
||||
if (M.client)
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
M.client.eye = M
|
||||
|
||||
|
||||
// Damage procs
|
||||
|
||||
// Meteor hit, dump all contents and delete recon
|
||||
|
||||
meteorhit(var/obj/O)
|
||||
if (O.icon_state == "flaming")
|
||||
for(var/obj/item/I in src)
|
||||
I.loc = src.loc
|
||||
|
||||
for(var/mob/M in src)
|
||||
M.loc = src.loc
|
||||
if (M.client)
|
||||
M.client.eye = M.client.mob
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
del(src)
|
||||
|
||||
|
||||
// Explosion, dump all contents and explode them, then delete recon
|
||||
|
||||
ex_act(severity)
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
for(var/atom/movable/A in src)
|
||||
A.loc = src.loc
|
||||
A.ex_act(severity)
|
||||
del(src)
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/atom/movable/A in src)
|
||||
A.loc = src.loc
|
||||
A.ex_act(severity)
|
||||
del(src)
|
||||
|
||||
|
||||
// Blob attack, dump contents and delete recon
|
||||
|
||||
blob_act()
|
||||
for(var/atom/movable/A in src)
|
||||
A.loc = src.loc
|
||||
del(src)
|
||||
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
* Shuttle - machines for shuttle propulsion
|
||||
*
|
||||
* These do nothing, but are used in certain places as graphical elements
|
||||
*
|
||||
* TODO: Make them actually do something? This would require significant coding for moving objects.
|
||||
*/
|
||||
|
||||
obj/machinery/shuttle
|
||||
name = "shuttle"
|
||||
icon = 'shuttle.dmi'
|
||||
|
||||
engine
|
||||
name = "engine"
|
||||
density = 1
|
||||
anchored = 1.0
|
||||
|
||||
heater
|
||||
name = "heater"
|
||||
icon_state = "heater"
|
||||
|
||||
platform
|
||||
name = "platform"
|
||||
icon_state = "platform"
|
||||
|
||||
propulsion
|
||||
name = "propulsion"
|
||||
icon_state = "propulsion"
|
||||
opacity = 1
|
||||
|
||||
burst
|
||||
left
|
||||
name = "left"
|
||||
icon_state = "burst_l"
|
||||
right
|
||||
name = "right"
|
||||
icon_state = "burst_r"
|
||||
|
||||
router
|
||||
name = "router"
|
||||
icon_state = "router"
|
||||
@@ -0,0 +1,320 @@
|
||||
/*
|
||||
* Sleeper -- allows a mob to be preserved without further damage
|
||||
*
|
||||
* /obj/machinery/sleeper -- the sleeper itself
|
||||
*
|
||||
* /obj/machinery/computer/sleep_console -- the control console
|
||||
*
|
||||
* TODO: Sleepers currently do not use or need power. If altered, need to make the occupant suffer if the power goes out.
|
||||
*
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
* The sleeper
|
||||
*/
|
||||
|
||||
obj/machinery/sleeper
|
||||
name = "sleeper"
|
||||
icon = 'Cryogenic2.dmi'
|
||||
icon_state = "sleeper_0"
|
||||
density = 1
|
||||
anchored = 1
|
||||
var
|
||||
mob/occupant = null // the mob in the sleeper, or null if none
|
||||
|
||||
|
||||
// Eject verb
|
||||
// Remove the occupant from the sleeper
|
||||
|
||||
verb/eject()
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat != 0)
|
||||
return
|
||||
src.go_out()
|
||||
add_fingerprint(usr)
|
||||
|
||||
|
||||
// Move inside verb
|
||||
// Insert the mob you are pulling into the sleeper
|
||||
// Sleeper must be empty, and mob cannot be wearing anything
|
||||
|
||||
verb/move_inside()
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat != 0)
|
||||
return
|
||||
if (src.occupant)
|
||||
usr << "\blue <B>The sleeper is already occupied!</B>"
|
||||
return
|
||||
if (usr.abiotic())
|
||||
usr << "Subject may not have abiotic items on."
|
||||
return
|
||||
usr.pulling = null
|
||||
usr.client.perspective = EYE_PERSPECTIVE
|
||||
usr.client.eye = src
|
||||
usr.loc = src
|
||||
src.occupant = usr
|
||||
src.icon_state = "sleeper_1"
|
||||
for(var/obj/O in src)
|
||||
del(O)
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
|
||||
// Attack by item
|
||||
// Only used for the grab pseudo-item, places the grabbed mob in the sleeper
|
||||
|
||||
attackby(obj/item/weapon/grab/G, mob/user)
|
||||
|
||||
if ((!( istype(G, /obj/item/weapon/grab) ) || !( ismob(G.affecting) )))
|
||||
return
|
||||
if (src.occupant)
|
||||
user << "\blue <B>The sleeper is already occupied!</B>"
|
||||
return
|
||||
if (G.affecting.abiotic())
|
||||
user << "Subject may not have abiotic items on."
|
||||
return
|
||||
var/mob/M = G.affecting
|
||||
if (M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
M.loc = src
|
||||
src.occupant = M
|
||||
src.icon_state = "sleeper_1"
|
||||
for(var/obj/O in src)
|
||||
O.loc = src.loc
|
||||
|
||||
src.add_fingerprint(user)
|
||||
|
||||
del(G)
|
||||
|
||||
|
||||
// Called to remove a mob from the sleeper
|
||||
// If a client, reset the view to normal
|
||||
|
||||
proc/go_out()
|
||||
if (!( src.occupant ))
|
||||
return
|
||||
for(var/obj/O in src)
|
||||
O.loc = src.loc
|
||||
|
||||
if (src.occupant.client)
|
||||
src.occupant.client.eye = src.occupant.client.mob
|
||||
src.occupant.client.perspective = MOB_PERSPECTIVE
|
||||
src.occupant.loc = src.loc
|
||||
src.occupant = null
|
||||
src.icon_state = "sleeper_0"
|
||||
|
||||
|
||||
// Called to inject rejuve chemicals into the occupant
|
||||
// Maximum is 60 units
|
||||
|
||||
proc/inject(mob/user)
|
||||
|
||||
if (src.occupant)
|
||||
if (src.occupant.rejuv < 60)
|
||||
src.occupant.rejuv = 60
|
||||
user << text("Occupant now has [] units of rejuvenation in his/her bloodstream.", src.occupant.rejuv)
|
||||
else
|
||||
user << "No occupant!"
|
||||
|
||||
|
||||
// Shows the health statistics of the occupant
|
||||
// Does not seem to be used?
|
||||
|
||||
proc/check(mob/user)
|
||||
if (src.occupant)
|
||||
user << "\blue <B>Occupant ([src.occupant]) Statistics:</B>"
|
||||
var/t1
|
||||
switch(src.occupant.stat)
|
||||
if(0.0)
|
||||
t1 = "Conscious"
|
||||
if(1.0)
|
||||
t1 = "Unconscious"
|
||||
if(2.0)
|
||||
t1 = "*dead*"
|
||||
else
|
||||
user << "[(src.occupant.health > 50 ? "\blue " : "\red ")]\t Health %: [src.occupant.health] ([t1])"
|
||||
user << "[(src.occupant.oxyloss < 60 ? "\blue " : "\red ")]\t -Respiratory Damage %: [src.occupant.oxyloss]"
|
||||
user << "[(src.occupant.toxloss < 60 ? "\blue " : "\red ")]\t -Toxin Content %: [src.occupant.toxloss]"
|
||||
user << "[(src.occupant.fireloss < 60 ? "\blue " : "\red ")]\t -Burn Severity %: [src.occupant.fireloss]"
|
||||
user << "\blue Expected time till occupant can safely awake: (note: If health is below 20% these times are inaccurate)"
|
||||
user << "\blue \t [src.occupant.paralysis / 5] second\s (if around 1 or 2 the sleeper is keeping them asleep.)"
|
||||
else
|
||||
user << "\blue There is no one inside!"
|
||||
return
|
||||
|
||||
|
||||
// Called in mob/Life() while the occupant is inside
|
||||
// Sets the health settings of the occupant
|
||||
|
||||
alter_health(mob/M)
|
||||
|
||||
if (M.health > 0)
|
||||
if (M.oxyloss >= 10)
|
||||
var/amount = max(0.15, 1)
|
||||
M.oxyloss -= amount
|
||||
else
|
||||
M.oxyloss = 0
|
||||
M.health = 100 - M.oxyloss - M.toxloss - M.fireloss - M.bruteloss
|
||||
M.paralysis -= 4
|
||||
M.weakened -= 4
|
||||
M.stunned -= 4
|
||||
if (M.paralysis <= 1)
|
||||
M.paralysis = 3
|
||||
if (M.weakened <= 1)
|
||||
M.weakened = 3
|
||||
if (M.stunned <= 1)
|
||||
M.stunned = 3
|
||||
if (M.rejuv < 3)
|
||||
M.rejuv = 4
|
||||
|
||||
|
||||
// Explosion damage
|
||||
// Chance to remove the occupant and explode them, then delete the sleeper
|
||||
|
||||
ex_act(severity)
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
for(var/atom/movable/A in src)
|
||||
A.loc = src.loc
|
||||
A.ex_act(severity)
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/atom/movable/A in src)
|
||||
A.loc = src.loc
|
||||
A.ex_act(severity)
|
||||
del(src)
|
||||
return
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/atom/movable/A in src)
|
||||
A.loc = src.loc
|
||||
A.ex_act(severity)
|
||||
del(src)
|
||||
return
|
||||
|
||||
|
||||
// Blob attack, remove the occupant and delete
|
||||
|
||||
blob_act()
|
||||
for(var/atom/movable/A in src)
|
||||
A.loc = src.loc
|
||||
del(src)
|
||||
|
||||
|
||||
/* Unused
|
||||
|
||||
allow_drop()
|
||||
return 0
|
||||
|
||||
*/
|
||||
|
||||
/*
|
||||
* The sleep console
|
||||
*/
|
||||
|
||||
|
||||
obj/machinery/computer/sleep_console
|
||||
name = "sleep console"
|
||||
icon = 'Cryogenic2.dmi'
|
||||
icon_state = "sleeperconsole"
|
||||
var
|
||||
obj/machinery/sleeper/connected = null // the associated sleeper
|
||||
|
||||
|
||||
// Create a new sleep console
|
||||
// Locate the connected sleeper 1 step west
|
||||
|
||||
New()
|
||||
..()
|
||||
spawn( 5 ) // wait for world to finish loading
|
||||
src.connected = locate(/obj/machinery/sleeper, get_step(src, WEST))
|
||||
|
||||
|
||||
// Monkey interact same as human
|
||||
|
||||
attack_paw(mob/user)
|
||||
return src.attack_hand(user)
|
||||
|
||||
// Human interact
|
||||
// Show the interaction window
|
||||
|
||||
attack_hand(mob/user)
|
||||
if (src.connected)
|
||||
var/mob/occupant = src.connected.occupant
|
||||
var/dat = "<font color='blue'><B>Occupant Statistics:</B></FONT><BR>"
|
||||
if (occupant)
|
||||
var/t1
|
||||
switch(occupant.stat)
|
||||
if(0.0)
|
||||
t1 = "Conscious"
|
||||
if(1.0)
|
||||
t1 = "Unconscious"
|
||||
if(2.0)
|
||||
t1 = "*dead*"
|
||||
else
|
||||
dat += "[occupant.health > 50 ? "<font color='blue'>" : "<font color='red'>"]\tHealth %: [occupant.health] ([t1])</FONT><BR>"
|
||||
dat += "[occupant.oxyloss < 60 ? "<font color='blue'>" : "<font color='red'>"]\t-Respiratory Damage %: [occupant.oxyloss]</FONT><BR>"
|
||||
dat += "[occupant.toxloss < 60 ? "<font color='blue'>" : "<font color='red'>"]\t-Toxin Content %: [occupant.toxloss]</FONT><BR>"
|
||||
dat += "[occupant.fireloss < 60 ? "<font color='blue'>" : "<font color='red'>"]\t-Burn Severity %: [occupant.fireloss]</FONT><BR>"
|
||||
dat += "<BR>Paralysis Summary %: [occupant.paralysis] ([round(occupant.paralysis / 4)] seconds left!)</FONT><BR>"
|
||||
dat += "<HR><A href='?src=\ref[src];refresh=1'>Refresh</A><BR><A href='?src=\ref[src];rejuv=1'>Inject Rejuvenators</A>"
|
||||
else
|
||||
dat += "The sleeper is empty."
|
||||
dat += "<BR><BR><A href='?src=\ref[user];mach_close=sleeper'>Close</A>"
|
||||
user << browse(dat, "window=sleeper;size=400x500")
|
||||
|
||||
|
||||
// Handle topic links from interaction window
|
||||
|
||||
Topic(href, href_list)
|
||||
..()
|
||||
if ((usr.stat || usr.restrained()))
|
||||
return
|
||||
if ((usr.contents.Find(src) || (get_dist(src, usr) <= 1 && istype(src.loc, /turf))))
|
||||
usr.machine = src
|
||||
if (href_list["rejuv"])
|
||||
if (src.connected)
|
||||
src.connected.inject(usr)
|
||||
if (href_list["refresh"])
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
//Foreach goto(123)
|
||||
src.add_fingerprint(usr)
|
||||
|
||||
|
||||
// Timed process - just update interaction window for those viewing
|
||||
|
||||
process()
|
||||
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
|
||||
|
||||
// Called when area power state changes
|
||||
// no change - sleeper works without power
|
||||
// Note overrides standard /obj/machinery/computer/power_change()
|
||||
|
||||
power_change()
|
||||
return
|
||||
|
||||
|
||||
// Explosion damage, chance to delete the sleeper console
|
||||
|
||||
ex_act(severity)
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
del(src)
|
||||
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
del(src)
|
||||
@@ -99,163 +99,6 @@
|
||||
|
||||
|
||||
|
||||
/obj/machinery/computer/airtunnel/ex_act(severity)
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
//Foreach goto(58)
|
||||
src.icon_state = "broken"
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
//Foreach goto(109)
|
||||
src.icon_state = "broken"
|
||||
else
|
||||
return
|
||||
|
||||
/obj/machinery/computer/airtunnel/attack_paw(user as mob)
|
||||
|
||||
return src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/airtunnel/attack_hand(var/mob/user as mob)
|
||||
|
||||
if(stat & (NOPOWER|BROKEN) )
|
||||
return
|
||||
|
||||
var/dat = "<HTML><BODY><TT><B>Air Tunnel Controls</B><BR>"
|
||||
user.machine = src
|
||||
if (SS13_airtunnel.operating == 1)
|
||||
dat += "<B>Status:</B> RETRACTING<BR>"
|
||||
else
|
||||
if (SS13_airtunnel.operating == 2)
|
||||
dat += "<B>Status:</B> EXPANDING<BR>"
|
||||
else
|
||||
var/obj/move/airtunnel/connector/C = pick(SS13_airtunnel.connectors)
|
||||
if (C.current == C)
|
||||
dat += "<B>Status:</B> Fully Retracted<BR>"
|
||||
else
|
||||
if (!( C.current.next ))
|
||||
dat += "<B>Status:</B> Fully Extended<BR>"
|
||||
else
|
||||
dat += "<B>Status:</B> Stopped Midway<BR>"
|
||||
dat += text("<A href='?src=\ref[];retract=1'>Retract</A> <A href='?src=\ref[];stop=1'>Stop</A> <A href='?src=\ref[];extend=1'>Extend</A><BR>", src, src, src)
|
||||
dat += text("<BR><B>Air Level:</B> []<BR>", (SS13_airtunnel.air_stat ? "Acceptable" : "DANGEROUS"))
|
||||
dat += "<B>Air System Status:</B> "
|
||||
switch(SS13_airtunnel.siphon_status)
|
||||
if(0.0)
|
||||
dat += "Stopped "
|
||||
if(1.0)
|
||||
dat += "Siphoning (Siphons only) "
|
||||
if(2.0)
|
||||
dat += "Regulating (BOTH) "
|
||||
if(3.0)
|
||||
dat += "RELEASING MAX (Siphons only) "
|
||||
else
|
||||
dat += text("<A href='?src=\ref[];refresh=1'>(Refresh)</A><BR>", src)
|
||||
dat += text("<A href='?src=\ref[];release=1'>RELEASE (Siphons only)</A> <A href='?src=\ref[];siphon=1'>Siphon (Siphons only)</A> <A href='?src=\ref[];stop_siph=1'>Stop</A> <A href='?src=\ref[];auto=1'>Regulate</A><BR>", src, src, src, src)
|
||||
dat += text("<BR><BR><A href='?src=\ref[];mach_close=computer'>Close</A></TT></BODY></HTML>", user)
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/airtunnel/proc/update_icon()
|
||||
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broken"
|
||||
return
|
||||
|
||||
if(stat & NOPOWER)
|
||||
icon_state = "c_unpowered"
|
||||
return
|
||||
|
||||
var/status = 0
|
||||
if (SS13_airtunnel.operating == 1)
|
||||
status = "r"
|
||||
else
|
||||
if (SS13_airtunnel.operating == 2)
|
||||
status = "e"
|
||||
else
|
||||
var/obj/move/airtunnel/connector/C = pick(SS13_airtunnel.connectors)
|
||||
if (C.current == C)
|
||||
status = 0
|
||||
else
|
||||
if (!( C.current.next ))
|
||||
status = 2
|
||||
else
|
||||
status = 1
|
||||
src.icon_state = text("console[][]", (SS13_airtunnel.siphon_status >= 2 ? "1" : "0"), status)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/airtunnel/process()
|
||||
|
||||
src.update_icon()
|
||||
if(stat & (NOPOWER|BROKEN) )
|
||||
return
|
||||
use_power(250)
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
//Foreach goto(27)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/airtunnel/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey"))))
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
if ((usr.stat || usr.restrained()))
|
||||
return
|
||||
if ((usr.contents.Find(src) || (get_dist(src, usr) <= 1 && istype(src.loc, /turf))))
|
||||
usr.machine = src
|
||||
if (href_list["retract"])
|
||||
SS13_airtunnel.retract()
|
||||
else
|
||||
if (href_list["stop"])
|
||||
SS13_airtunnel.operating = 0
|
||||
else
|
||||
if (href_list["extend"])
|
||||
SS13_airtunnel.extend()
|
||||
else
|
||||
if (href_list["release"])
|
||||
SS13_airtunnel.siphon_status = 3
|
||||
SS13_airtunnel.siphons()
|
||||
else
|
||||
if (href_list["siphon"])
|
||||
SS13_airtunnel.siphon_status = 1
|
||||
SS13_airtunnel.siphons()
|
||||
else
|
||||
if (href_list["stop_siph"])
|
||||
SS13_airtunnel.siphon_status = 0
|
||||
SS13_airtunnel.siphons()
|
||||
else
|
||||
if (href_list["auto"])
|
||||
SS13_airtunnel.siphon_status = 2
|
||||
SS13_airtunnel.siphons()
|
||||
else
|
||||
if (href_list["refresh"])
|
||||
SS13_airtunnel.siphons()
|
||||
src.add_fingerprint(usr)
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
//Foreach goto(346)
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/datum/air_tunnel/air_tunnel1/New()
|
||||
|
||||
|
||||
@@ -1,20 +0,0 @@
|
||||
|
||||
/obj/machinery/mass_driver/proc/drive(amount)
|
||||
|
||||
if(stat & NOPOWER)
|
||||
return
|
||||
|
||||
use_power(500)
|
||||
for(var/obj/O in src.loc)
|
||||
if (O.flags & 64)
|
||||
O.throwing = 1
|
||||
O.throwspeed = 100
|
||||
spawn( 0 )
|
||||
O.throwing(src.dir, src.power)
|
||||
return
|
||||
//Foreach goto(17)
|
||||
flick("mass_driver1", src)
|
||||
return
|
||||
|
||||
|
||||
|
||||
@@ -48,869 +48,6 @@
|
||||
return 1
|
||||
return
|
||||
|
||||
/obj/machinery/computer/meteorhit(var/obj/O as obj)
|
||||
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
//Foreach goto(17)
|
||||
src.icon_state = "broken"
|
||||
stat |= BROKEN
|
||||
return
|
||||
|
||||
/obj/machinery/computer/communications/ex_act(severity)
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
//Foreach goto(58)
|
||||
src.icon_state = "broken"
|
||||
stat |= BROKEN
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
//Foreach goto(109)
|
||||
src.icon_state = "broken"
|
||||
stat |= BROKEN
|
||||
else
|
||||
return
|
||||
|
||||
/obj/machinery/computer/blob_act()
|
||||
if (prob(50))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
//Foreach goto(58)
|
||||
src.icon_state = "broken"
|
||||
src.stat |= BROKEN
|
||||
src.density = 0
|
||||
|
||||
/obj/machinery/computer/power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broken"
|
||||
else
|
||||
if( powered() )
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "c_unpowered"
|
||||
stat |= NOPOWER
|
||||
|
||||
|
||||
/obj/machinery/computer/process()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
return
|
||||
use_power(250)
|
||||
|
||||
|
||||
/obj/machinery/computer/communications/verb/call_shuttle()
|
||||
set src in oview(1)
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
if(stat & NOPOWER) return
|
||||
|
||||
if ((!( ticker ) || ticker.shuttle_location == 1))
|
||||
return
|
||||
|
||||
if( ticker.mode == "blob" )
|
||||
usr << "Under directive 7-10, SS13 is quarantined until further notice."
|
||||
return
|
||||
|
||||
world << "\blue <B>Alert: The emergency shuttle has been called. It will arrive in T-10:00 minutes.</B>"
|
||||
if (!( ticker.timeleft ))
|
||||
ticker.timeleft = 6000
|
||||
ticker.timing = 1
|
||||
return
|
||||
|
||||
/obj/machinery/computer/communications/verb/cancel_call()
|
||||
set src in oview(1)
|
||||
|
||||
src.add_fingerprint(usr)
|
||||
if(stat & NOPOWER) return
|
||||
if ((!( ticker ) || ticker.shuttle_location == 1 || ticker.timing == 0 || ticker.timeleft < 300))
|
||||
return
|
||||
if( ticker.mode == "blob" )
|
||||
return
|
||||
|
||||
world << "\blue <B>Alert: The shuttle is going back!</B>"
|
||||
ticker.timing = -1.0
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/computer/card/ex_act(severity)
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
//Foreach goto(58)
|
||||
src.icon_state = "broken"
|
||||
stat |= BROKEN
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
//Foreach goto(109)
|
||||
src.icon_state = "broken"
|
||||
stat |= BROKEN
|
||||
else
|
||||
return
|
||||
|
||||
/obj/machinery/computer/card/power_change()
|
||||
if(stat & BROKEN)
|
||||
icon_state = "broken"
|
||||
else
|
||||
if( powered() )
|
||||
icon_state = initial(icon_state)
|
||||
stat &= ~NOPOWER
|
||||
else
|
||||
spawn(rand(0, 15))
|
||||
src.icon_state = "id_unpowered"
|
||||
stat |= NOPOWER
|
||||
|
||||
/obj/machinery/computer/card/attack_paw(var/mob/user as mob)
|
||||
|
||||
return src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/card/attack_hand(var/mob/user as mob)
|
||||
|
||||
if(stat & (NOPOWER|BROKEN) ) return
|
||||
|
||||
user.machine = src
|
||||
var/dat
|
||||
if (!( ticker ))
|
||||
return
|
||||
if (src.mode)
|
||||
var/d2 = text("Confirm Identity: <A href='?src=\ref[];scan=1'>[]</A>\n[]", src, (src.scan ? text("[]", src.scan.name) : "----------"), (src.authenticated ? "You are logged in!" : text("<A href='?src=\ref[];auth=1'>{Log in}</A>", src)))
|
||||
var/d1 = "Please use security Records to modify entries.<BR>"
|
||||
for(var/datum/data/record/t in data_core.general)
|
||||
d1 += text("[] - []<BR>", t.fields["name"], t.fields["rank"])
|
||||
//Foreach goto(104)
|
||||
dat = text("<HTML><HEAD></HEAD><BODY><TT>[]<BR>\n<BR>\n<B>Crew Manifest:</B><BR>\n[]\n<BR>\n<A href='?src=\ref[];print=1'>Print</A><BR>\n<BR>\n<A href='?src=\ref[];mode=0'>Access ID modification console.</A><BR>\n</TT></BODY></HTML>", d2, d1, src, src)
|
||||
else
|
||||
var/d1 = text("<A href='?src=\ref[];auth=1'>{Log in}</A>", src)
|
||||
if ((src.authenticated && src.modify))
|
||||
var/vo = null
|
||||
var/va = null
|
||||
var/vl = null
|
||||
var/ve = null
|
||||
switch(src.modify.access_level)
|
||||
if(1.0)
|
||||
vo = text("<A href='?src=\ref[];vo=-1'>0</A> 1 <A href='?src=\ref[];vo=2'>2</A> <A href='?src=\ref[];vo=3'>3</A> <A href='?src=\ref[];vo=4'>4</A> <A href='?src=\ref[];vo=5'>5</A>", src, src, src, src, src)
|
||||
if(2.0)
|
||||
vo = text("<A href='?src=\ref[];vo=-1'>0</A> <A href='?src=\ref[];vo=1'>1</A> 2 <A href='?src=\ref[];vo=3'>3</A> <A href='?src=\ref[];vo=4'>4</A> <A href='?src=\ref[];vo=5'>5</A>", src, src, src, src, src)
|
||||
if(3.0)
|
||||
vo = text("<A href='?src=\ref[];vo=-1'>0</A> <A href='?src=\ref[];vo=1'>1</A> <A href='?src=\ref[];vo=2'>2</A> 3 <A href='?src=\ref[];vo=4'>4</A> <A href='?src=\ref[];vo=5'>5</A>", src, src, src, src, src)
|
||||
if(4.0)
|
||||
vo = text("<A href='?src=\ref[];vo=-1'>0</A> <A href='?src=\ref[];vo=1'>1</A> <A href='?src=\ref[];vo=2'>2</A> <A href='?src=\ref[];vo=3'>3</A> 4 <A href='?src=\ref[];vo=5'>5</A>", src, src, src, src, src)
|
||||
if(5.0)
|
||||
vo = text("<A href='?src=\ref[];vo=-1'>0</A> <A href='?src=\ref[];vo=1'>1</A> <A href='?src=\ref[];vo=2'>2</A> <A href='?src=\ref[];vo=3'>3</A> <A href='?src=\ref[];vo=4'>4</A> 5", src, src, src, src, src)
|
||||
else
|
||||
vo = text("0 <A href='?src=\ref[];vo=1'>1</A> <A href='?src=\ref[];vo=2'>2</A> <A href='?src=\ref[];vo=3'>3</A> <A href='?src=\ref[];vo=4'>4</A> <A href='?src=\ref[];vo=5'>5</A>", src, src, src, src, src)
|
||||
switch(src.modify.lab_access)
|
||||
if(1.0)
|
||||
vl = text("<A href='?src=\ref[];vl=-1'>0</A> 1 <A href='?src=\ref[];vl=2'>2</A> <A href='?src=\ref[];vl=3'>3</A> <A href='?src=\ref[];vl=4'>4</A> <A href='?src=\ref[];vl=5'>5</A>", src, src, src, src, src)
|
||||
if(2.0)
|
||||
vl = text("<A href='?src=\ref[];vl=-1'>0</A> <A href='?src=\ref[];vl=1'>1</A> 2 <A href='?src=\ref[];vl=3'>3</A> <A href='?src=\ref[];vl=4'>4</A> <A href='?src=\ref[];vl=5'>5</A>", src, src, src, src, src)
|
||||
if(3.0)
|
||||
vl = text("<A href='?src=\ref[];vl=-1'>0</A> <A href='?src=\ref[];vl=1'>1</A> <A href='?src=\ref[];vl=2'>2</A> 3 <A href='?src=\ref[];vl=4'>4</A> <A href='?src=\ref[];vl=5'>5</A>", src, src, src, src, src)
|
||||
if(4.0)
|
||||
vl = text("<A href='?src=\ref[];vl=-1'>0</A> <A href='?src=\ref[];vl=1'>1</A> <A href='?src=\ref[];vl=2'>2</A> <A href='?src=\ref[];vl=3'>3</A> 4 <A href='?src=\ref[];vl=5'>5</A>", src, src, src, src, src)
|
||||
if(5.0)
|
||||
vl = text("<A href='?src=\ref[];vl=-1'>0</A> <A href='?src=\ref[];vl=1'>1</A> <A href='?src=\ref[];vl=2'>2</A> <A href='?src=\ref[];vl=3'>3</A> <A href='?src=\ref[];vl=4'>4</A> 5", src, src, src, src, src)
|
||||
else
|
||||
vl = text("0 <A href='?src=\ref[];vl=1'>1</A> <A href='?src=\ref[];vl=2'>2</A> <A href='?src=\ref[];vl=3'>3</A> <A href='?src=\ref[];vl=4'>4</A> <A href='?src=\ref[];vl=5'>5</A>", src, src, src, src, src)
|
||||
switch(src.modify.engine_access)
|
||||
if(1.0)
|
||||
ve = text("<A href='?src=\ref[];ve=-1'>0</A> 1 <A href='?src=\ref[];ve=2'>2</A> <A href='?src=\ref[];ve=3'>3</A> <A href='?src=\ref[];ve=4'>4</A> <A href='?src=\ref[];ve=5'>5</A>", src, src, src, src, src)
|
||||
if(2.0)
|
||||
ve = text("<A href='?src=\ref[];ve=-1'>0</A> <A href='?src=\ref[];ve=1'>1</A> 2 <A href='?src=\ref[];ve=3'>3</A> <A href='?src=\ref[];ve=4'>4</A> <A href='?src=\ref[];ve=5'>5</A>", src, src, src, src, src)
|
||||
if(3.0)
|
||||
ve = text("<A href='?src=\ref[];ve=-1'>0</A> <A href='?src=\ref[];ve=1'>1</A> <A href='?src=\ref[];ve=2'>2</A> 3 <A href='?src=\ref[];ve=4'>4</A> <A href='?src=\ref[];ve=5'>5</A>", src, src, src, src, src)
|
||||
if(4.0)
|
||||
ve = text("<A href='?src=\ref[];ve=-1'>0</A> <A href='?src=\ref[];ve=1'>1</A> <A href='?src=\ref[];ve=2'>2</A> <A href='?src=\ref[];ve=3'>3</A> 4 <A href='?src=\ref[];ve=5'>5</A>", src, src, src, src, src)
|
||||
if(5.0)
|
||||
ve = text("<A href='?src=\ref[];ve=-1'>0</A> <A href='?src=\ref[];ve=1'>1</A> <A href='?src=\ref[];ve=2'>2</A> <A href='?src=\ref[];ve=3'>3</A> <A href='?src=\ref[];ve=4'>4</A> 5", src, src, src, src, src)
|
||||
else
|
||||
ve = text("0 <A href='?src=\ref[];ve=1'>1</A> <A href='?src=\ref[];ve=2'>2</A> <A href='?src=\ref[];ve=3'>3</A> <A href='?src=\ref[];ve=4'>4</A> <A href='?src=\ref[];ve=5'>5</A>", src, src, src, src, src)
|
||||
switch(src.modify.air_access)
|
||||
if(1.0)
|
||||
va = text("<A href='?src=\ref[];va=-1'>0</A> 1 <A href='?src=\ref[];va=2'>2</A> <A href='?src=\ref[];va=3'>3</A> <A href='?src=\ref[];va=4'>4</A> <A href='?src=\ref[];va=5'>5</A>", src, src, src, src, src)
|
||||
if(2.0)
|
||||
va = text("<A href='?src=\ref[];va=-1'>0</A> <A href='?src=\ref[];va=1'>1</A> 2 <A href='?src=\ref[];va=3'>3</A> <A href='?src=\ref[];va=4'>4</A> <A href='?src=\ref[];va=5'>5</A>", src, src, src, src, src)
|
||||
if(3.0)
|
||||
va = text("<A href='?src=\ref[];va=-1'>0</A> <A href='?src=\ref[];va=1'>1</A> <A href='?src=\ref[];va=2'>2</A> 3 <A href='?src=\ref[];va=4'>4</A> <A href='?src=\ref[];va=5'>5</A>", src, src, src, src, src)
|
||||
if(4.0)
|
||||
va = text("<A href='?src=\ref[];va=-1'>0</A> <A href='?src=\ref[];va=1'>1</A> <A href='?src=\ref[];va=2'>2</A> <A href='?src=\ref[];va=3'>3</A> 4 <A href='?src=\ref[];va=5'>5</A>", src, src, src, src, src)
|
||||
if(5.0)
|
||||
va = text("<A href='?src=\ref[];va=-1'>0</A> <A href='?src=\ref[];va=1'>1</A> <A href='?src=\ref[];va=2'>2</A> <A href='?src=\ref[];va=3'>3</A> <A href='?src=\ref[];va=4'>4</A> 5", src, src, src, src, src)
|
||||
else
|
||||
va = text("0 <A href='?src=\ref[];va=1'>1</A> <A href='?src=\ref[];va=2'>2</A> <A href='?src=\ref[];va=3'>3</A> <A href='?src=\ref[];va=4'>4</A> <A href='?src=\ref[];va=5'>5</A>", src, src, src, src, src)
|
||||
var/list/L = list( "Research Assistant", "Staff Assistant", "Medical Assistant", "Technical Assistant", "Engineer", "Forensic Technician", "Research Technician", "Medical Doctor", "Captain", "Security Officer", "Medical Researcher", "Toxin Researcher", "Head of Research", "Head of Personnel", "Station Technician", "Atmospheric Technician", "Unassigned", "Systems", "Custom" )
|
||||
var/assign = ""
|
||||
if (istype(user, /mob/human))
|
||||
var/counter = 1
|
||||
for(var/t in L)
|
||||
assign += text("<A href='?src=\ref[];assign=[]'>[]</A> ", src, t, t)
|
||||
counter++
|
||||
if (counter >= 3)
|
||||
assign += "<BR>"
|
||||
counter = 1
|
||||
//Foreach goto(912)
|
||||
d1 = text("[] :<BR>\nGeneral Access Level: []<BR>\nLaboratory Access: []<BR>\nReactor/Engine Access: []<BR>\nMain Systems Access: []<BR>\nRegistered: <A href='?src=\ref[];reg=1'>[]</A><BR>\nAssignment: []<BR>\n[]<BR>", src.modify.name, vo, vl, ve, va, src, (src.modify.registered ? text("[]", src.modify.registered) : "{None: Click to modify}"), (src.modify.assignment ? text("[]", src.modify.assignment) : "None"), assign)
|
||||
else
|
||||
var/counter = 1
|
||||
for(var/t in L)
|
||||
assign += text("<A href='?src=\ref[];assign=[]'>[]</A> ", src, t, stars(t))
|
||||
counter++
|
||||
if (counter >= 4)
|
||||
assign += "<BR>"
|
||||
counter = 1
|
||||
//Foreach goto(1057)
|
||||
d1 = text("[] :<BR>\n[] []<BR>\n[] []<BR>\n[] []<BR>\n[] []<BR>\n[] <A href='?src=\ref[];reg=1'>[]</A><BR>\n[] []<BR>\n[]<BR>", stars("modify.name"), stars("General Access Level:"), vo, stars("Laboratory Access:"), vl, stars("Reactor/Engine Access:"), ve, stars("Main Systems Access:"), va, stars("Registered:"), src, (src.modify.registered ? text("[]", stars(src.modify.registered)) : text("[]", stars("{None: Click to modify}"))), stars("Assignment:"), (src.modify.assignment ? text("[]", stars(src.modify.assignment)) : "None"), assign)
|
||||
if (istype(user, /mob/human))
|
||||
dat = text("<TT><B>Identification Card Modifier</B><BR>\n<I>Please Insert the cards into the slots</I><BR>\nTarget: <A href='?src=\ref[];modify=1'>[]</A><BR>\nConfirm Identity: <A href='?src=\ref[];scan=1'>[]</A><BR>\n-----------------<BR>\n[]<BR>\n<BR>\n<BR>\n<A href='?src=\ref[];mode=1'>Access Crew Manifest</A><BR>\n</TT>", src, (src.modify ? text("[]", src.modify.name) : "----------"), src, (src.scan ? text("[]", src.scan.name) : "----------"), d1, src)
|
||||
else
|
||||
dat = text("<TT><B>[]</B><BR>\n<I>[]</I><BR>\n[] <A href='?src=\ref[];modify=1'>[]</A><BR>\n[] <A href='?src=\ref[];scan=1'>[]</A><BR>\n-----------------<BR>\n[]<BR>\n<BR>\n<BR>\n<A href='?src=\ref[];mode=1'>[]</A><BR>\n</TT>", stars("Identification Card Modifier"), stars("Please Insert the cards into the slots"), stars("Target:"), src, (src.modify ? text("[]", stars(src.modify.name)) : "----------"), stars("Confirm Identity:"), src, (src.scan ? text("[]", stars(src.scan.name)) : "----------"), d1, src, stars("Access Crew Manifest"))
|
||||
user << browse(dat, "window=id_com;size=400x500")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/card/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
usr << browse(null, "window=id_com")
|
||||
return
|
||||
|
||||
if(usr.restrained() || usr.lying) return
|
||||
|
||||
if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey"))))
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
if ((usr.stat || usr.restrained()))
|
||||
return
|
||||
if ((get_dist(src, usr) <= 1 && istype(src.loc, /turf)))
|
||||
usr.machine = src
|
||||
if (href_list["modify"])
|
||||
if (src.modify)
|
||||
src.modify.name = text("[]'s ID Card ([]>[]-[]-[])", src.modify.registered, src.modify.access_level, src.modify.lab_access, src.modify.engine_access, src.modify.air_access)
|
||||
src.modify.loc = src.loc
|
||||
src.modify = null
|
||||
else
|
||||
var/obj/item/I = usr.equipped()
|
||||
if (istype(I, /obj/item/weapon/card/id))
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
src.modify = I
|
||||
src.authenticated = 0
|
||||
if (href_list["scan"])
|
||||
if (src.scan)
|
||||
src.scan.loc = src.loc
|
||||
src.scan = null
|
||||
else
|
||||
var/obj/item/I = usr.equipped()
|
||||
if (istype(I, /obj/item/weapon/card/id))
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
src.scan = I
|
||||
src.authenticated = 0
|
||||
if (href_list["auth"])
|
||||
if ((!( src.authenticated ) && src.scan && (src.modify || src.mode)))
|
||||
if ((src.scan.assignment == "Captain" || src.scan.assignment == "Head of Personnel"))
|
||||
src.authenticated = 1
|
||||
if (href_list["vo"])
|
||||
if (src.authenticated)
|
||||
var/t1 = text2num(href_list["vo"])
|
||||
if (t1 == -1.0)
|
||||
t1 = 0
|
||||
src.modify.access_level = t1
|
||||
if (href_list["vl"])
|
||||
if (src.authenticated)
|
||||
var/t1 = text2num(href_list["vl"])
|
||||
if (t1 == -1.0)
|
||||
t1 = 0
|
||||
src.modify.lab_access = t1
|
||||
if (href_list["ve"])
|
||||
if (src.authenticated)
|
||||
var/t1 = text2num(href_list["ve"])
|
||||
if (t1 == -1.0)
|
||||
t1 = 0
|
||||
src.modify.engine_access = t1
|
||||
if (href_list["va"])
|
||||
if (src.authenticated)
|
||||
var/t1 = text2num(href_list["va"])
|
||||
if (t1 == -1.0)
|
||||
t1 = 0
|
||||
src.modify.air_access = t1
|
||||
if (href_list["assign"])
|
||||
if (src.authenticated)
|
||||
var/t1 = href_list["assign"]
|
||||
|
||||
if(t1 == "Custom")
|
||||
t1 = input("Enter a custom job assignment.","Assignment")
|
||||
|
||||
src.modify.assignment = t1
|
||||
if (href_list["reg"])
|
||||
if (src.authenticated)
|
||||
var/t2 = src.modify
|
||||
var/t1 = input(usr, "What name?", "ID computer", null) as text
|
||||
if ((src.authenticated && src.modify == t2 && get_dist(src, usr) <= 1 && istype(src.loc, /turf)))
|
||||
src.modify.registered = t1
|
||||
if (href_list["mode"])
|
||||
src.mode = text2num(href_list["mode"])
|
||||
if (href_list["print"])
|
||||
if (!( src.printing ))
|
||||
src.printing = 1
|
||||
sleep(50)
|
||||
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( src.loc )
|
||||
var/t1 = "<B>Crew Manifest:</B><BR>"
|
||||
for(var/datum/data/record/t in data_core.general)
|
||||
t1 += text("<B>[]</B> - []<BR>", t.fields["name"], t.fields["rank"])
|
||||
//Foreach goto(868)
|
||||
P.info = text("[]", t1)
|
||||
P.name = "paper- 'Crew Manifest'"
|
||||
src.printing = null
|
||||
if (href_list["mode"])
|
||||
src.authenticated = 0
|
||||
src.mode = text2num(href_list["mode"])
|
||||
if (src.modify)
|
||||
src.modify.name = text("[]'s ID Card ([]>[]-[]-[])", src.modify.registered, src.modify.access_level, src.modify.lab_access, src.modify.engine_access, src.modify.air_access)
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
//Foreach goto(1015)
|
||||
src.add_fingerprint(usr)
|
||||
else
|
||||
usr << browse(null, "window=id_com")
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/computer/card/attackby(I as obj, user as mob)
|
||||
|
||||
src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/pod/ex_act(severity)
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
//Foreach goto(58)
|
||||
src.icon_state = "broken"
|
||||
stat |= BROKEN
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
//Foreach goto(109)
|
||||
src.icon_state = "broken"
|
||||
stat |= BROKEN
|
||||
else
|
||||
return
|
||||
|
||||
/obj/machinery/computer/pod/proc/alarm()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN)) return
|
||||
|
||||
if (!( src.connected ))
|
||||
viewers(null, null) << "Cannot locate mass driver connector. Cancelling firing sequence!"
|
||||
return
|
||||
for(var/obj/machinery/door/poddoor/M in machines)
|
||||
if (M.id == src.id)
|
||||
spawn( 0 )
|
||||
M.openpod()
|
||||
return
|
||||
//Foreach goto(41)
|
||||
sleep(20)
|
||||
|
||||
//src.connected.drive() *****RM from 40.93.3S
|
||||
for(var/obj/machinery/mass_driver/M in machines)
|
||||
if(M.id == src.id)
|
||||
M.power = src.connected.power
|
||||
M.drive()
|
||||
|
||||
//*****
|
||||
sleep(50)
|
||||
for(var/obj/machinery/door/poddoor/M in machines)
|
||||
if (M.id == src.id)
|
||||
spawn( 0 )
|
||||
M.closepod()
|
||||
return
|
||||
//Foreach goto(123)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/pod/New()
|
||||
|
||||
..()
|
||||
spawn( 5 )
|
||||
for(var/obj/machinery/mass_driver/M in machines)
|
||||
if (M.id == src.id)
|
||||
src.connected = M
|
||||
else
|
||||
//Foreach continue //goto(25)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/computer/pod/attack_paw(var/mob/user as mob)
|
||||
|
||||
return src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/pod/attack_hand(var/mob/user as mob)
|
||||
|
||||
if(stat & (NOPOWER|BROKEN)) return
|
||||
|
||||
var/dat = "<HTML><BODY><TT><B>Mass Driver Controls</B>"
|
||||
user.machine = src
|
||||
var/d2
|
||||
if (src.timing)
|
||||
d2 = text("<A href='?src=\ref[];time=0'>Stop Time Launch</A>", src)
|
||||
else
|
||||
d2 = text("<A href='?src=\ref[];time=1'>Initiate Time Launch</A>", src)
|
||||
var/second = src.time % 60
|
||||
var/minute = (src.time - second) / 60
|
||||
dat += text("<HR>\nTimer System: []\nTime Left: [][] <A href='?src=\ref[];tp=-30'>-</A> <A href='?src=\ref[];tp=-1'>-</A> <A href='?src=\ref[];tp=1'>+</A> <A href='?src=\ref[];tp=30'>+</A>", d2, (minute ? text("[]:", minute) : null), second, src, src, src, src)
|
||||
if (src.connected)
|
||||
var/temp = ""
|
||||
var/list/L = list( 0.25, 0.5, 1, 2, 4, 8, 16 )
|
||||
for(var/t in L)
|
||||
if (t == src.connected.power)
|
||||
temp += text("[] ", t)
|
||||
else
|
||||
temp += text("<A href = '?src=\ref[];power=[]'>[]</A> ", src, t, t)
|
||||
//Foreach goto(172)
|
||||
dat += text("<HR>\nPower Level: []<BR>\n<A href = '?src=\ref[];alarm=1'>Firing Sequence</A><BR>\n<A href = '?src=\ref[];drive=1'>Test Fire Driver</A><BR>\n<A href = '?src=\ref[];door=1'>Toggle Outer Door</A><BR>", temp, src, src, src)
|
||||
//*****RM from 40.93.3S
|
||||
else
|
||||
dat += text("<BR>\n<A href = '?src=\ref[];door=1'>Toggle Outer Door</A><BR>", src)
|
||||
//*****
|
||||
dat += text("<BR><BR><A href='?src=\ref[];mach_close=computer'>Close</A></TT></BODY></HTML>", user)
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/pod/process()
|
||||
|
||||
|
||||
if(stat & (NOPOWER|BROKEN) )
|
||||
return
|
||||
use_power(250)
|
||||
|
||||
if (src.timing)
|
||||
if (src.time > 0)
|
||||
src.time = round(src.time) - 1
|
||||
else
|
||||
alarm()
|
||||
src.time = 0
|
||||
src.timing = 0
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
//Foreach goto(68)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/pod/Topic(href, href_list)
|
||||
..()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN))
|
||||
usr << browse(null, "window=computer")
|
||||
return
|
||||
|
||||
|
||||
if(usr.restrained() || usr.lying) return
|
||||
|
||||
if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey"))))
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
if ((usr.stat || usr.restrained()))
|
||||
return
|
||||
if ((usr.contents.Find(src) || (get_dist(src, usr) <= 1 && istype(src.loc, /turf))))
|
||||
usr.machine = src
|
||||
if (href_list["power"])
|
||||
var/t = text2num(href_list["power"])
|
||||
t = min(max(0.25, t), 16)
|
||||
if (src.connected)
|
||||
src.connected.power = t
|
||||
else
|
||||
if (href_list["alarm"])
|
||||
src.alarm()
|
||||
else
|
||||
if (href_list["time"])
|
||||
src.timing = text2num(href_list["time"])
|
||||
else
|
||||
if (href_list["tp"])
|
||||
var/tp = text2num(href_list["tp"])
|
||||
src.time += tp
|
||||
src.time = min(max(round(src.time), 0), 120)
|
||||
else
|
||||
if (href_list["door"])
|
||||
for(var/obj/machinery/door/poddoor/M in machines)
|
||||
if (M.id == src.id)
|
||||
if (M.density)
|
||||
spawn( 0 )
|
||||
M.openpod()
|
||||
return
|
||||
else
|
||||
spawn( 0 )
|
||||
M.closepod()
|
||||
return
|
||||
//Foreach goto(298)
|
||||
src.add_fingerprint(usr)
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
//Foreach goto(394)
|
||||
return
|
||||
|
||||
/obj/machinery/pod/meteorhit(var/obj/O as obj)
|
||||
|
||||
if (O.icon_state == "flaming")
|
||||
for(var/obj/item/I in src)
|
||||
I.loc = src.loc
|
||||
//Foreach goto(29)
|
||||
for(var/mob/M in src)
|
||||
M.loc = src.loc
|
||||
if (M.client)
|
||||
M.client.eye = M.client.mob
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
//Foreach goto(71)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/pod/process()
|
||||
|
||||
if (src.speed)
|
||||
if (src.speed <= 10)
|
||||
var/t1 = 10 - src.speed
|
||||
while(t1 > 0)
|
||||
step(src, src.dir)
|
||||
sleep(1)
|
||||
t1--
|
||||
else
|
||||
var/t1 = round(src.speed / 5)
|
||||
while(t1 > 0)
|
||||
step(src, src.dir)
|
||||
t1--
|
||||
return
|
||||
|
||||
/obj/machinery/pod/ex_act(severity)
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
//Foreach goto(31)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
//Foreach goto(104)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
/obj/machinery/pod/blob_act()
|
||||
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
del(src)
|
||||
|
||||
/obj/machinery/pod/Bump(var/atom/A)
|
||||
|
||||
//world << "[src] bumped into [A]"
|
||||
spawn( 0 )
|
||||
..()
|
||||
src.speed = 0
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/pod/relaymove(mob/user as mob, direction)
|
||||
|
||||
if (user.stat)
|
||||
return
|
||||
if ((user in src))
|
||||
if (direction & 1)
|
||||
src.speed = max(src.speed - 1, 1)
|
||||
else
|
||||
if (direction & 2)
|
||||
src.speed++
|
||||
if (src.speed > 10)
|
||||
src.speed = 10
|
||||
if (direction & 4)
|
||||
src.dir = turn(src.dir, -90.0)
|
||||
else
|
||||
if (direction & 8)
|
||||
src.dir = turn(src.dir, 90)
|
||||
return
|
||||
|
||||
/obj/machinery/pod/verb/eject()
|
||||
set src = usr.loc
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
var/mob/M = usr
|
||||
M.loc = src.loc
|
||||
if (M.client)
|
||||
M.client.eye = M.client.mob
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
step(M, turn(src.dir, 180))
|
||||
return
|
||||
|
||||
/obj/machinery/pod/verb/board()
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
var/mob/M = usr
|
||||
if (M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
M.loc = src
|
||||
return
|
||||
|
||||
/obj/machinery/pod/verb/load()
|
||||
set src in oview(1)
|
||||
|
||||
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
if (( ( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey"))))
|
||||
var/mob/human/H = usr
|
||||
|
||||
if ((H.pulling && !( H.pulling.anchored )))
|
||||
|
||||
H.pulling.loc = src
|
||||
|
||||
|
||||
if (ismob(H.pulling))
|
||||
var/mob/M = H.pulling
|
||||
if (M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << text("\blue <B> [] loads [] into []!</B>", H, H.pulling, src)
|
||||
//Foreach goto(152)
|
||||
H.pulling = null
|
||||
return
|
||||
|
||||
/obj/machinery/pod/verb/unload(var/atom/movable/A in src.contents)
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
if (istype(A, /atom/movable))
|
||||
A.loc = src.loc
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << text("\blue <B> [] unloads [] from []!</B>", usr, A, src)
|
||||
//Foreach goto(54)
|
||||
if (ismob(A))
|
||||
var/mob/M = A
|
||||
if (M.client)
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
M.client.eye = M
|
||||
step(A, turn(src.dir, 180))
|
||||
return
|
||||
|
||||
/obj/machinery/recon/meteorhit(var/obj/O as obj)
|
||||
|
||||
if (O.icon_state == "flaming")
|
||||
for(var/obj/item/I in src)
|
||||
I.loc = src.loc
|
||||
//Foreach goto(29)
|
||||
for(var/mob/M in src)
|
||||
M.loc = src.loc
|
||||
if (M.client)
|
||||
M.client.eye = M.client.mob
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
//Foreach goto(71)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/recon/process()
|
||||
|
||||
if (src.speed)
|
||||
if (src.speed <= 10)
|
||||
var/t1 = 10 - src.speed
|
||||
while(t1 > 0)
|
||||
step(src, src.dir)
|
||||
sleep(1)
|
||||
t1--
|
||||
else
|
||||
var/t1 = round(src.speed / 5)
|
||||
while(t1 > 0)
|
||||
step(src, src.dir)
|
||||
t1--
|
||||
return
|
||||
|
||||
/obj/machinery/recon/ex_act(severity)
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
//Foreach goto(31)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
ex_act(severity)
|
||||
//Foreach goto(104)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
else
|
||||
return
|
||||
|
||||
/obj/machinery/recon/blob_act()
|
||||
|
||||
for(var/atom/movable/A as mob|obj in src)
|
||||
A.loc = src.loc
|
||||
del(src)
|
||||
|
||||
/obj/machinery/recon/Bump()
|
||||
|
||||
spawn( 0 )
|
||||
..()
|
||||
src.speed = 0
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/recon/verb/eject()
|
||||
set src = usr.loc
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
var/mob/M = usr
|
||||
M.loc = src.loc
|
||||
if (M.client)
|
||||
M.client.eye = M.client.mob
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
return
|
||||
|
||||
/obj/machinery/recon/verb/board()
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
if (locate(/mob, src))
|
||||
usr << "There is no room! You can only fit one person."
|
||||
return
|
||||
var/mob/M = usr
|
||||
if (M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
M.loc = src
|
||||
return
|
||||
|
||||
/obj/machinery/recon/verb/load()
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
if ((( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey"))))
|
||||
var/mob/human/H = usr
|
||||
if ((H.pulling && !( H.pulling.anchored )))
|
||||
if (!( istype(H.pulling, /obj/item/weapon) ))
|
||||
usr << "You may only place items in."
|
||||
else
|
||||
if ((locate(/mob, src) && ismob(H.pulling)))
|
||||
usr << "There is no room! You can only fit one person."
|
||||
else
|
||||
H.pulling.loc = src
|
||||
if (ismob(H.pulling))
|
||||
var/mob/M = H.pulling
|
||||
if (M.client)
|
||||
M.client.perspective = EYE_PERSPECTIVE
|
||||
M.client.eye = src
|
||||
for(var/mob/O in viewers(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << text("\blue <B> [] loads [] into []!</B>", H, H.pulling, src)
|
||||
//Foreach goto(204)
|
||||
H.pulling = null
|
||||
return
|
||||
|
||||
/obj/machinery/recon/verb/unload(var/atom/movable/A in src)
|
||||
set src in oview(1)
|
||||
|
||||
if (usr.stat)
|
||||
return
|
||||
if (istype(A, /atom/movable))
|
||||
A.loc = src.loc
|
||||
for(var/mob/O in view(src, null))
|
||||
if ((O.client && !( O.blinded )))
|
||||
O << text("\blue <B> [] unloads [] from []!</B>", usr, A, src)
|
||||
//Foreach goto(53)
|
||||
if (ismob(A))
|
||||
var/mob/M = A
|
||||
if (M.client)
|
||||
M.client.perspective = MOB_PERSPECTIVE
|
||||
M.client.eye = M
|
||||
return
|
||||
|
||||
/obj/machinery/recon/Bump()
|
||||
|
||||
spawn( 0 )
|
||||
..()
|
||||
src.speed = 0
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/recon/relaymove(var/mob/user as mob, direction)
|
||||
|
||||
if (user.stat)
|
||||
return
|
||||
if ((user in src))
|
||||
if (direction & 1)
|
||||
src.speed = max(src.speed - 1, 1)
|
||||
else
|
||||
if (direction & 2)
|
||||
src.speed++
|
||||
if (direction & 4)
|
||||
src.dir = turn(src.dir, -90.0)
|
||||
else
|
||||
if (direction & 8)
|
||||
src.dir = turn(src.dir, 90)
|
||||
if (direction & 16)
|
||||
src.speed = 30
|
||||
else
|
||||
src.speed = min(src.speed, 10)
|
||||
return
|
||||
|
||||
/obj/datacore/proc/manifest()
|
||||
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -210,12 +210,14 @@
|
||||
T.oxygen += src.gas.oxygen * src.gas.temperature / 25.0
|
||||
T.n2 += src.gas.n2 * src.gas.temperature / 25.0
|
||||
T.sl_gas += src.gas.sl_gas * src.gas.temperature / 25.0
|
||||
T.co2 += src.gas.co2 * src.gas.temperature / 25.0
|
||||
T.res_vars()
|
||||
|
||||
src.gas.plasma = 0
|
||||
src.gas.oxygen = 0
|
||||
src.gas.n2 = 0
|
||||
src.gas.sl_gas = 0
|
||||
src.gas.co2 = 0
|
||||
|
||||
var/temp = src.gas.temperature
|
||||
spawn(10)
|
||||
|
||||
@@ -1,109 +0,0 @@
|
||||
|
||||
/obj/machinery/computer/atmosphere/proc/returnarea()
|
||||
|
||||
return
|
||||
|
||||
/obj/machinery/computer/atmosphere/ex_act(severity)
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
//Foreach goto(58)
|
||||
src.icon_state = "broken"
|
||||
stat |= BROKEN
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
//Foreach goto(109)
|
||||
src.icon_state = "broken"
|
||||
stat |= BROKEN
|
||||
else
|
||||
return
|
||||
|
||||
/obj/machinery/computer/atmosphere/siphonswitch/New()
|
||||
..()
|
||||
|
||||
spawn(5)
|
||||
src.area = src.loc.loc
|
||||
|
||||
if(otherarea)
|
||||
src.area = locate(text2path("/area/[otherarea]"))
|
||||
|
||||
/obj/machinery/computer/atmosphere/siphonswitch/returnarea()
|
||||
|
||||
return area.contents
|
||||
|
||||
|
||||
/obj/machinery/computer/atmosphere/siphonswitch/verb/siphon_all()
|
||||
set src in oview(1)
|
||||
if(stat & NOPOWER) return
|
||||
if (usr.stat)
|
||||
return
|
||||
usr << "Starting all siphon systems."
|
||||
for(var/obj/machinery/atmoalter/siphs/S in src.returnarea())
|
||||
S.reset(1, 0)
|
||||
//Foreach goto(39)
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/atmosphere/siphonswitch/verb/stop_all()
|
||||
set src in oview(1)
|
||||
if(stat & NOPOWER) return
|
||||
if (usr.stat)
|
||||
return
|
||||
usr << "Stopping all siphon systems."
|
||||
for(var/obj/machinery/atmoalter/siphs/S in src.returnarea())
|
||||
S.reset(0, 0)
|
||||
//Foreach goto(39)
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/atmosphere/siphonswitch/verb/auto_on()
|
||||
set src in oview(1)
|
||||
if(stat & NOPOWER) return
|
||||
if (usr.stat)
|
||||
return
|
||||
usr << "Starting automatic air control systems."
|
||||
for(var/obj/machinery/atmoalter/siphs/S in src.returnarea())
|
||||
S.reset(0, 1)
|
||||
//Foreach goto(39)
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/atmosphere/siphonswitch/verb/release_scrubbers()
|
||||
set src in oview(1)
|
||||
|
||||
if(stat & NOPOWER) return
|
||||
if (usr.stat)
|
||||
return
|
||||
usr << "Releasing all scrubber toxins."
|
||||
for(var/obj/machinery/atmoalter/siphs/scrubbers/S in src.returnarea())
|
||||
S.reset(-1.0, 0)
|
||||
//Foreach goto(39)
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/atmosphere/siphonswitch/verb/release_all()
|
||||
|
||||
if(stat & NOPOWER) return
|
||||
if (usr.stat)
|
||||
return
|
||||
usr << "Releasing all stored air."
|
||||
for(var/obj/machinery/atmoalter/siphs/S in src.returnarea())
|
||||
S.reset(-1.0, 0)
|
||||
//Foreach goto(37)
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/atmosphere/siphonswitch/mastersiphonswitch/returnarea()
|
||||
|
||||
return world
|
||||
return
|
||||
|
||||
@@ -1,133 +1,5 @@
|
||||
#define ENGINE_EJECT_Z 6
|
||||
|
||||
/obj/machinery/computer/engine/ex_act(severity)
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
//Foreach goto(58)
|
||||
src.icon_state = "broken"
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
//Foreach goto(109)
|
||||
src.icon_state = "broken"
|
||||
else
|
||||
return
|
||||
|
||||
/obj/machinery/computer/engine/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
|
||||
return
|
||||
|
||||
/obj/machinery/computer/engine/attackby(var/obj/O, mob/user)
|
||||
return src.attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/engine/attack_paw(var/mob/user as mob)
|
||||
|
||||
return src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/engine/attack_hand(var/mob/user as mob)
|
||||
|
||||
if(stat & (NOPOWER|BROKEN) )
|
||||
return
|
||||
|
||||
user.machine = src
|
||||
var/dat
|
||||
if (src.temp)
|
||||
dat = "<TT>[src.temp]</TT><BR><BR><A href='?src=\ref[src];temp=1'>Clear Screen</A>"
|
||||
else
|
||||
if (engine_eject_control.status == 0)
|
||||
|
||||
dat = "<B>Engine Gas Monitor</B><HR>"
|
||||
if(gs)
|
||||
dat += "[gs.sense_string()]"
|
||||
|
||||
else
|
||||
dat += "No sensor found."
|
||||
|
||||
|
||||
dat += "<BR><B>Engine Ejection Module</B><HR>\nStatus: Docked<BR>\n<BR>\nCountdown: [engine_eject_control.timeleft]/60 <A href='?src=\ref[src];reset=1'>\[Reset\]</A><BR>\n<BR>\n<A href='?src=\ref[src];eject=1'>Eject Engine</A><BR>\n<BR>\n<A href='?src=\ref[user];mach_close=computer'>Close</A>"
|
||||
else
|
||||
if (engine_eject_control.status == 1)
|
||||
dat = text("<B>Engine Ejection Module</B><HR>\nStatus: Ejecting<BR>\n<BR>\nCountdown: []/60 \[Reset\]<BR>\n<BR>\n<A href='?src=\ref[];stop=1'>Stop Ejection</A><BR>\n<BR>\n<A href='?src=\ref[];mach_close=computer'>Close</A>", engine_eject_control.timeleft, src, user)
|
||||
else
|
||||
dat = text("<B>Engine Ejection Module</B><HR>\nStatus: Ejected<BR>\n<BR>\nCountdown: N/60 \[Reset\]<BR>\n<BR>\nEngine Ejected!<BR>\n<BR>\n<A href='?src=\ref[];mach_close=computer'>Close</A>", user)
|
||||
user << browse(dat, "window=computer;size=400x500")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/engine/process()
|
||||
|
||||
if(stat & (NOPOWER|BROKEN) )
|
||||
return
|
||||
use_power(250)
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
//Foreach goto(18)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/engine/Topic(href, href_list)
|
||||
..()
|
||||
if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey"))))
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
if ((usr.stat || usr.restrained()))
|
||||
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?<BR><BR><B><A href='?src=\ref[src];eject2=1'>\[Swipe ID to initiate eject sequence\]</A></B><BR><A href='?src=\ref[src];temp=1'>Cancel</A>"
|
||||
|
||||
else if (href_list["eject2"])
|
||||
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 << "\red Access Denied."
|
||||
else if (href_list["stop"])
|
||||
if (engine_eject_control.status > 0)
|
||||
src.temp = text("Stop Ejection?<BR><BR><A href='?src=\ref[];stop2=1'>Yes</A><BR><A href='?src=\ref[];temp=1'>No</A>", 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)
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
//Foreach goto(351)
|
||||
return
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -6,6 +6,10 @@
|
||||
Added remote APC control the power_monitor
|
||||
Fixed a bug where APCs would continue to draw power for cell charging even when the breaker was off.
|
||||
|
||||
Added CO2 to gasbomb proc (plasmatank/proc/release())
|
||||
|
||||
Moved computer objects ex_act() to base type (since all are identical)
|
||||
|
||||
|
||||
|
||||
(Since H9.5)
|
||||
|
||||
@@ -1,99 +1,4 @@
|
||||
|
||||
/obj/machinery/computer/hologram_comp/New()
|
||||
|
||||
..()
|
||||
spawn( 10 )
|
||||
src.projector = locate(/obj/machinery/hologram_proj, get_step(src.loc, NORTH))
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/computer/hologram_comp/DblClick()
|
||||
|
||||
if (get_dist(src, usr) > 1)
|
||||
return 0
|
||||
src.show_console(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/hologram_comp/proc/render()
|
||||
|
||||
var/icon/I = new /icon( 'human.dmi', "male" )
|
||||
if (src.lumens >= 0)
|
||||
I.Blend(rgb(src.lumens, src.lumens, src.lumens), 0)
|
||||
else
|
||||
I.Blend(rgb(- src.lumens, -src.lumens, -src.lumens), 1)
|
||||
I.Blend(new /icon( 'human.dmi', "mouth" ), 3)
|
||||
var/icon/U = new /icon( 'human.dmi', "diaper" )
|
||||
U.Blend(U, 3)
|
||||
U = new /icon( 'mob.dmi', "hair_a" )
|
||||
U.Blend(rgb(src.h_r, src.h_g, src.h_b), 0)
|
||||
I.Blend(U, 3)
|
||||
src.projector.projection.icon = I
|
||||
return
|
||||
|
||||
/obj/machinery/computer/hologram_comp/proc/show_console(var/mob/user as mob)
|
||||
|
||||
var/dat
|
||||
user.machine = src
|
||||
if (src.temp)
|
||||
dat = text("[]<BR><BR><A href='?src=\ref[];temp=1'>Clear</A>", src.temp, src)
|
||||
else
|
||||
dat = text("<B>Hologram Status:</B><HR>\nPower: <A href='?src=\ref[];power=1'>[]</A><HR>\n<B>Hologram Control:</B><BR>\nColor Luminosity: []/220 <A href='?src=\ref[];reset=1'>\[Reset\]</A><BR>\nLighten: <A href='?src=\ref[];light=1'>1</A> <A href='?src=\ref[];light=10'>10</A><BR>\nDarken: <A href='?src=\ref[];light=-1'>1</A> <A href='?src=\ref[];light=-10'>10</A><BR>\n<BR>\nHair Color: ([],[],[]) <A href='?src=\ref[];h_reset=1'>\[Reset\]</A><BR>\nRed (0-255): <A href='?src=\ref[];h_r=-300'>\[0\]</A> <A href='?src=\ref[];h_r=-10'>-10</A> <A href='?src=\ref[];h_r=-1'>-1</A> [] <A href='?src=\ref[];h_r=1'>1</A> <A href='?src=\ref[];h_r=10'>10</A> <A href='?src=\ref[];h_r=300'>\[255\]</A><BR>\nGreen (0-255): <A href='?src=\ref[];h_g=-300'>\[0\]</A> <A href='?src=\ref[];h_g=-10'>-10</A> <A href='?src=\ref[];h_g=-1'>-1</A> [] <A href='?src=\ref[];h_g=1'>1</A> <A href='?src=\ref[];h_g=10'>10</A> <A href='?src=\ref[];h_g=300'>\[255\]</A><BR>\nBlue (0-255): <A href='?src=\ref[];h_b=-300'>\[0\]</A> <A href='?src=\ref[];h_b=-10'>-10</A> <A href='?src=\ref[];h_b=-1'>-1</A> [] <A href='?src=\ref[];h_b=1'>1</A> <A href='?src=\ref[];h_b=10'>10</A> <A href='?src=\ref[];h_b=300'>\[255\]</A><BR>", src, (src.projector.projection ? "On" : "Off"), -src.lumens + 35, src, src, src, src, src, src.h_r, src.h_g, src.h_b, src, src, src, src, src.h_r, src, src, src, src, src, src, src.h_g, src, src, src, src, src, src, src.h_b, src, src, src)
|
||||
user << browse(dat, "window=hologram_console")
|
||||
return
|
||||
|
||||
/obj/machinery/computer/hologram_comp/Topic(href, href_list)
|
||||
..()
|
||||
if (get_dist(src, usr) <= 1)
|
||||
flick("holo_console1", src)
|
||||
if (href_list["power"])
|
||||
if (src.projector.projection)
|
||||
src.projector.icon_state = "hologram0"
|
||||
//src.projector.projection = null
|
||||
del(src.projector.projection)
|
||||
else
|
||||
src.projector.projection = new /obj/projection( src.projector.loc )
|
||||
src.projector.projection.icon = 'human.dmi'
|
||||
src.projector.projection.icon_state = "male"
|
||||
src.projector.icon_state = "hologram1"
|
||||
src.render()
|
||||
else
|
||||
if (href_list["h_r"])
|
||||
if (src.projector.projection)
|
||||
src.h_r += text2num(href_list["h_r"])
|
||||
src.h_r = min(max(src.h_r, 0), 255)
|
||||
render()
|
||||
else
|
||||
if (href_list["h_g"])
|
||||
if (src.projector.projection)
|
||||
src.h_g += text2num(href_list["h_g"])
|
||||
src.h_g = min(max(src.h_g, 0), 255)
|
||||
render()
|
||||
else
|
||||
if (href_list["h_b"])
|
||||
if (src.projector.projection)
|
||||
src.h_b += text2num(href_list["h_b"])
|
||||
src.h_b = min(max(src.h_b, 0), 255)
|
||||
render()
|
||||
else
|
||||
if (href_list["light"])
|
||||
if (src.projector.projection)
|
||||
src.lumens += text2num(href_list["light"])
|
||||
src.lumens = min(max(src.lumens, -185.0), 35)
|
||||
render()
|
||||
else
|
||||
if (href_list["reset"])
|
||||
if (src.projector.projection)
|
||||
src.lumens = 0
|
||||
render()
|
||||
else
|
||||
if (href_list["temp"])
|
||||
src.temp = null
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.show_console(M)
|
||||
//Foreach goto(446)
|
||||
return
|
||||
|
||||
/obj/begin/verb/ready()
|
||||
set src in usr.loc
|
||||
|
||||
|
||||
@@ -1,205 +1,4 @@
|
||||
|
||||
/obj/machinery/computer/prison_shuttle/ex_act(severity)
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
//Foreach goto(58)
|
||||
src.icon_state = "broken"
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
//Foreach goto(109)
|
||||
src.icon_state = "broken"
|
||||
else
|
||||
return
|
||||
|
||||
/obj/machinery/computer/prison_shuttle/verb/take_off()
|
||||
set src in oview(1)
|
||||
|
||||
if ((usr.stat || usr.restrained()))
|
||||
return
|
||||
src.add_fingerprint(usr)
|
||||
if (prison_entered)
|
||||
var/A = locate(/area/shuttle)
|
||||
for(var/turf/T in A)
|
||||
if (T.z == 1)
|
||||
for(var/atom/movable/AM as mob|obj in T)
|
||||
AM.z = 8
|
||||
//Foreach goto(96)
|
||||
var/turf/U = locate(T.x, T.y, 8)
|
||||
U.oxygen = T.oxygen
|
||||
U.oldoxy = T.oldoxy
|
||||
U.tmpoxy = T.tmpoxy
|
||||
U.poison = T.poison
|
||||
U.oldpoison = T.oldpoison
|
||||
U.tmppoison = T.tmppoison
|
||||
U.co2 = T.co2
|
||||
U.oldco2 = T.oldco2
|
||||
U.tmpco2 = T.tmpco2
|
||||
//T = null
|
||||
del(T)
|
||||
//Foreach goto(62)
|
||||
prison_entered = null
|
||||
else
|
||||
if (!( prison_entered ))
|
||||
if (ticker.shuttle_location != 1)
|
||||
var/A = locate(/area/shuttle_prison)
|
||||
for(var/turf/T in A)
|
||||
if (T.z == 8)
|
||||
for(var/atom/movable/AM as mob|obj in T)
|
||||
AM.z = 1
|
||||
//Foreach goto(346)
|
||||
var/turf/U = locate(T.x, T.y, 1)
|
||||
U.oxygen = T.oxygen
|
||||
U.oldoxy = T.oldoxy
|
||||
U.tmpoxy = T.tmpoxy
|
||||
U.poison = T.poison
|
||||
U.oldpoison = T.oldpoison
|
||||
U.tmppoison = T.tmppoison
|
||||
U.co2 = T.co2
|
||||
U.oldco2 = T.oldco2
|
||||
U.tmpco2 = T.tmpco2
|
||||
//T = null
|
||||
del(T)
|
||||
//Foreach goto(312)
|
||||
prison_entered = 1
|
||||
else
|
||||
usr << "\blue There is an obstructing shuttle!"
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/computer/prison_shuttle/verb/restabalize()
|
||||
set src in oview(1)
|
||||
|
||||
viewers(null, null) << "\red <B>Restabalizing prison shuttle atmosphere!</B>"
|
||||
var/A = locate(/area/shuttle_prison)
|
||||
for(var/obj/move/T in A)
|
||||
T.firelevel = 0
|
||||
T.oxygen = O2STANDARD
|
||||
T.oldoxy = O2STANDARD
|
||||
T.tmpoxy = O2STANDARD
|
||||
T.poison = 0
|
||||
T.oldpoison = 0
|
||||
T.tmppoison = 0
|
||||
T.co2 = 0
|
||||
T.oldco2 = 0
|
||||
T.tmpco2 = 0
|
||||
T.sl_gas = 0
|
||||
T.osl_gas = 0
|
||||
T.tsl_gas = 0
|
||||
T.n2 = N2STANDARD
|
||||
T.on2 = N2STANDARD
|
||||
T.tn2 = N2STANDARD
|
||||
T.temp = T20C
|
||||
T.otemp = T20C
|
||||
T.ttemp = T20C
|
||||
//Foreach goto(40)
|
||||
viewers(null, null) << "\red <B>Prison shuttle Restabalized!</B>"
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/shuttle/ex_act(severity)
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
//Foreach goto(58)
|
||||
src.icon_state = "broken"
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
//Foreach goto(109)
|
||||
src.icon_state = "broken"
|
||||
else
|
||||
return
|
||||
|
||||
/obj/machinery/computer/shuttle/verb/restabalize()
|
||||
set src in oview(1)
|
||||
|
||||
world << "\red <B>Restabalizing shuttle atmosphere!</B>"
|
||||
var/A = locate(/area/shuttle)
|
||||
for(var/obj/move/T in A)
|
||||
T.firelevel = 0
|
||||
T.oxygen = O2STANDARD
|
||||
T.oldoxy = O2STANDARD
|
||||
T.tmpoxy = O2STANDARD
|
||||
T.poison = 0
|
||||
T.oldpoison = 0
|
||||
T.tmppoison = 0
|
||||
T.co2 = 0
|
||||
T.oldco2 = 0
|
||||
T.tmpco2 = 0
|
||||
T.sl_gas = 0
|
||||
T.osl_gas = 0
|
||||
T.tsl_gas = 0
|
||||
T.n2 = N2STANDARD
|
||||
T.on2 = N2STANDARD
|
||||
T.tn2 = N2STANDARD
|
||||
T.temp = T20C
|
||||
T.otemp = T20C
|
||||
T.ttemp = T20C
|
||||
//Foreach goto(35)
|
||||
world << "\red <B>Shuttle Restabalized!</B>"
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/shuttle/verb/hijack()
|
||||
set src in oview(1)
|
||||
|
||||
if ((!( ticker ) || ticker.shuttle_location != shuttle_z))
|
||||
return
|
||||
if (usr != ticker.killer)
|
||||
return
|
||||
world << "\blue <B>Alert: The shuttle is has been hijacked prematurely by the traitor!</B>"
|
||||
ticker.timing = 0
|
||||
ticker.check_win()
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/shuttle/attackby(var/obj/item/weapon/card/id/W as obj, var/mob/user as mob)
|
||||
|
||||
if ((!( istype(W, /obj/item/weapon/card/id) ) || !( ticker ) || ticker.shuttle_location == shuttle_z || !( user )))
|
||||
return
|
||||
if (!W.check_access(access, allowed))
|
||||
user << text("The access level ([]) of [] card is not high enough. ", W.access_level, W.registered)
|
||||
return
|
||||
var/choice = alert(user, text("Would you like to (un)authorize a shortened launch time? [] authorization\s are still needed. Use abort to cancel all authorizations.", src.auth_need - src.authorized.len), "Shuttle Launch", "Authorize", "Repeal", "Abort")
|
||||
switch(choice)
|
||||
if("Authorize")
|
||||
src.authorized -= W.registered
|
||||
src.authorized += W.registered
|
||||
if (src.auth_need - src.authorized.len > 0)
|
||||
world << text("\blue <B>Alert: [] authorizations needed until shuttle is launched early</B>", src.auth_need - src.authorized.len)
|
||||
else
|
||||
world << "\blue <B>Alert: Shuttle launch time shortened to 10 seconds!</B>"
|
||||
ticker.timeleft = 100
|
||||
//src.authorized = null
|
||||
del(src.authorized)
|
||||
src.authorized = list( )
|
||||
if("Repeal")
|
||||
src.authorized -= W.registered
|
||||
world << text("\blue <B>Alert: [] authorizations needed until shuttle is launched early</B>", src.auth_need - src.authorized.len)
|
||||
if("Abort")
|
||||
world << "\blue <B>All authorizations to shorting time for shuttle launch have been revoked!</B>"
|
||||
src.authorized.len = 0
|
||||
src.authorized = list( )
|
||||
else
|
||||
return
|
||||
|
||||
/obj/shut_controller/proc/rotate(direct)
|
||||
|
||||
|
||||
@@ -91,101 +91,6 @@
|
||||
return T
|
||||
return
|
||||
|
||||
/obj/machinery/computer/data/ex_act(severity)
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
if(2.0)
|
||||
if (prob(50))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
//Foreach goto(58)
|
||||
src.icon_state = "broken"
|
||||
if(3.0)
|
||||
if (prob(25))
|
||||
for(var/x in src.verbs)
|
||||
src.verbs -= x
|
||||
//Foreach goto(109)
|
||||
src.icon_state = "broken"
|
||||
else
|
||||
return
|
||||
|
||||
/obj/machinery/computer/data/weapon/log/New()
|
||||
|
||||
..()
|
||||
src.topics["Super-heater"] = "This turns a can of semi-liquid plasma into a super-heated ball of plasma."
|
||||
src.topics["Amplifier"] = "This increases the intensity of a laser."
|
||||
src.topics["Class 11 Laser"] = "This creates a very slow laser that is capable of penetrating most objects."
|
||||
src.topics["Plasma Energizer"] = "This combines super-heated plasma with a laser beam."
|
||||
src.topics["Generator"] = "This controls the entire power grid."
|
||||
src.topics["Mirror"] = "this can reflect LOW power lasers. HIGH power goes through it!"
|
||||
src.topics["Targetting Prism"] = "This focuses a laser coming from any direction forward."
|
||||
return
|
||||
|
||||
/obj/machinery/computer/data/weapon/log/display()
|
||||
set src in oview(1)
|
||||
|
||||
usr << "<B>Research Log:</B>"
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/data/weapon/info/New()
|
||||
|
||||
..()
|
||||
src.topics["LOG(001)"] = "System: Deployment successful"
|
||||
src.topics["LOG(002)"] = "System: Safe orbit at inclination .003 established"
|
||||
src.topics["LOG(003)"] = "CenCom: Attempting test fire...ALERT(001)"
|
||||
src.topics["ALERT(001)"] = "System: Cannot attempt test fire"
|
||||
src.topics["LOG(004)"] = "System: Airlock accessed..."
|
||||
src.topics["LOG(005)"] = "System: System successfully reset...Generator engaged"
|
||||
src.topics["LOG(006)"] = "Physical: Super-heater (W005) added to power grid"
|
||||
src.topics["LOG(007)"] = "Physical: Amplifier (W007) added to power grid"
|
||||
src.topics["LOG(008)"] = "Physical: Plasma Energizer (W006) added to power grid"
|
||||
src.topics["LOG(009)"] = "Physical: Laser (W004) added to power grid"
|
||||
src.topics["LOG(010)"] = "Physical: Laser test firing"
|
||||
src.topics["LOG(011)"] = "Physical: Plasma added to Super-heater"
|
||||
src.topics["LOG(012)"] = "Physical: Orient N12.525,E22.124"
|
||||
src.topics["LOG(013)"] = "System: Location N12.525,E22.124"
|
||||
src.topics["LOG(014)"] = "Physical: Test fire...successful"
|
||||
src.topics["LOG(015)"] = "Physical: Airlock accessed..."
|
||||
src.topics["LOG(016)"] = "******: Disable locater systems"
|
||||
src.topics["LOG(017)"] = "System: Locater Beacon-Disengaged,CenCom link-Cut...ALERT(002)"
|
||||
src.topics["ALERT(002)"] = "System: Cannot seem to establish contact with Central Command"
|
||||
src.topics["LOG(018)"] = "******: Shutting down all systems...ALERT(003)"
|
||||
src.topics["ALERT(003)"] = "System: Power grid failure-Activating back-up power...ALERT(004)"
|
||||
src.topics["ALERT(004)"] = "System: Engine failure...All systems deactivated."
|
||||
return
|
||||
|
||||
/obj/machinery/computer/data/weapon/info/display()
|
||||
set src in oview(1)
|
||||
|
||||
usr << "<B>Research Information:</B>"
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/computer/data/verb/display()
|
||||
set src in oview(1)
|
||||
|
||||
for(var/x in src.topics)
|
||||
usr << text("[], \...", x)
|
||||
//Foreach goto(19)
|
||||
usr << ""
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/computer/data/verb/read(topic as text)
|
||||
set src in oview(1)
|
||||
|
||||
if (src.topics[text("[]", topic)])
|
||||
usr << text("<B>[]</B>\n\t []", topic, src.topics[text("[]", topic)])
|
||||
else
|
||||
usr << text("Unable to find- []", topic)
|
||||
src.add_fingerprint(usr)
|
||||
return
|
||||
|
||||
/obj/machinery/teleport/hub/Bumped(M as mob|obj)
|
||||
|
||||
spawn( 0 )
|
||||
|
||||
@@ -1,180 +1,4 @@
|
||||
|
||||
/obj/machinery/nuclearbomb/New()
|
||||
|
||||
if (nuke_code)
|
||||
src.r_code = text("[]", nuke_code)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/machinery/nuclearbomb/process()
|
||||
|
||||
if (src.timing)
|
||||
src.timeleft--
|
||||
if (src.timeleft <= 0)
|
||||
explode()
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
//Foreach goto(46)
|
||||
return
|
||||
|
||||
/obj/machinery/nuclearbomb/attack_paw(mob/user as mob)
|
||||
|
||||
return src.attack_hand(user)
|
||||
return
|
||||
|
||||
/obj/machinery/nuclearbomb/attack_hand(mob/user as mob)
|
||||
|
||||
if (src.extended)
|
||||
user.machine = src
|
||||
var/dat = text("<TT><B>Nuclear Fission Explosive</B><BR>\nAuth. Disk: <A href='?src=\ref[];auth=1'>[]</A><HR>", src, (src.auth ? "++++++++++" : "----------"))
|
||||
if (src.auth)
|
||||
if (src.yes_code)
|
||||
dat += text("\n<B>Status</B>: []-[]<BR>\n<B>Timer</B>: []<BR>\n<BR>\nTimer: [] <A href='?src=\ref[];timer=1'>Toggle</A><BR>\nTime: <A href='?src=\ref[];time=-10'>-</A> <A href='?src=\ref[];time=-1'>-</A> [] <A href='?src=\ref[];time=1'>+</A> <A href='?src=\ref[];time=10'>+</A><BR>\n<BR>\nSafety: [] <A href='?src=\ref[];safety=1'>Toggle</A><BR>\nAnchor: [] <A href='?src=\ref[];anchor=1'>Toggle</A><BR>\n", (src.timing ? "Func/Set" : "Functional"), (src.safety ? "Safe" : "Engaged"), src.timeleft, (src.timing ? "On" : "Off"), src, src, src, src.timeleft, src, src, (src.safety ? "On" : "Off"), src, (src.anchored ? "Engaged" : "Off"), src)
|
||||
else
|
||||
dat += text("\n<B>Status</B>: Auth. S2-[]<BR>\n<B>Timer</B>: []<BR>\n<BR>\nTimer: [] Toggle<BR>\nTime: - - [] + +<BR>\n<BR>\n[] Safety: Toggle<BR>\nAnchor: [] Toggle<BR>\n", (src.safety ? "Safe" : "Engaged"), src.timeleft, (src.timing ? "On" : "Off"), src.timeleft, (src.safety ? "On" : "Off"), (src.anchored ? "Engaged" : "Off"))
|
||||
else
|
||||
if (src.timing)
|
||||
dat += text("\n<B>Status</B>: Set-[]<BR>\n<B>Timer</B>: []<BR>\n<BR>\nTimer: [] Toggle<BR>\nTime: - - [] + +<BR>\n<BR>\nSafety: [] Toggle<BR>\nAnchor: [] Toggle<BR>\n", (src.safety ? "Safe" : "Engaged"), src.timeleft, (src.timing ? "On" : "Off"), src.timeleft, (src.safety ? "On" : "Off"), (src.anchored ? "Engaged" : "Off"))
|
||||
else
|
||||
dat += text("\n<B>Status</B>: Auth. S1-[]<BR>\n<B>Timer</B>: []<BR>\n<BR>\nTimer: [] Toggle<BR>\nTime: - - [] + +<BR>\n<BR>\nSafety: [] Toggle<BR>\nAnchor: [] Toggle<BR>\n", (src.safety ? "Safe" : "Engaged"), src.timeleft, (src.timing ? "On" : "Off"), src.timeleft, (src.safety ? "On" : "Off"), (src.anchored ? "Engaged" : "Off"))
|
||||
var/message = "AUTH"
|
||||
if (src.auth)
|
||||
message = text("[]", src.code)
|
||||
if (src.yes_code)
|
||||
message = "*****"
|
||||
dat += text("<HR>\n>[]<BR>\n<A href='?src=\ref[];type=1'>1</A>-<A href='?src=\ref[];type=2'>2</A>-<A href='?src=\ref[];type=3'>3</A><BR>\n<A href='?src=\ref[];type=4'>4</A>-<A href='?src=\ref[];type=5'>5</A>-<A href='?src=\ref[];type=6'>6</A><BR>\n<A href='?src=\ref[];type=7'>7</A>-<A href='?src=\ref[];type=8'>8</A>-<A href='?src=\ref[];type=9'>9</A><BR>\n<A href='?src=\ref[];type=R'>R</A>-<A href='?src=\ref[];type=0'>0</A>-<A href='?src=\ref[];type=E'>E</A><BR>\n</TT>", message, src, src, src, src, src, src, src, src, src, src, src, src)
|
||||
user << browse(dat, "window=nuclearbomb;size=300x400")
|
||||
else
|
||||
src.anchored = 1
|
||||
flick("nuclearbombc", src)
|
||||
src.icon_state = "nuclearbomb1"
|
||||
src.extended = 1
|
||||
return
|
||||
|
||||
/obj/machinery/nuclearbomb/Topic(href, href_list)
|
||||
..()
|
||||
if (usr.stat || usr.restrained())
|
||||
return
|
||||
if ((!( istype(usr, /mob/human) ) && (!( ticker ) || (ticker && ticker.mode != "monkey"))))
|
||||
usr << "\red You don't have the dexterity to do this!"
|
||||
return
|
||||
if ((usr.contents.Find(src) || (get_dist(src, usr) <= 1 && istype(src.loc, /turf))))
|
||||
usr.machine = src
|
||||
if (href_list["auth"])
|
||||
if (src.auth)
|
||||
src.auth.loc = src.loc
|
||||
src.yes_code = 0
|
||||
src.auth = null
|
||||
else
|
||||
var/obj/item/I = usr.equipped()
|
||||
if (istype(I, /obj/item/weapon/disk/nuclear))
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
src.auth = I
|
||||
if (src.auth)
|
||||
if (href_list["type"])
|
||||
if (href_list["type"] == "E")
|
||||
if (src.code == src.r_code)
|
||||
src.yes_code = 1
|
||||
src.code = null
|
||||
else
|
||||
src.code = "ERROR"
|
||||
else
|
||||
if (href_list["type"] == "R")
|
||||
src.yes_code = 0
|
||||
src.code = null
|
||||
else
|
||||
src.code += text("[]", href_list["type"])
|
||||
if (length(src.code) > 5)
|
||||
src.code = "ERROR"
|
||||
if (src.yes_code)
|
||||
if (href_list["time"])
|
||||
var/time = text2num(href_list["time"])
|
||||
src.timeleft += time
|
||||
src.timeleft = min(max(round(src.timeleft), 5), 600)
|
||||
if (href_list["timer"])
|
||||
if (src.timing == -1.0)
|
||||
return
|
||||
src.timing = !( src.timing )
|
||||
if (src.timing)
|
||||
src.icon_state = "nuclearbomb2"
|
||||
else
|
||||
src.icon_state = "nuclearbomb1"
|
||||
if (href_list["safety"])
|
||||
src.safety = !( src.safety )
|
||||
if (href_list["anchor"])
|
||||
src.anchored = !( src.anchored )
|
||||
src.add_fingerprint(usr)
|
||||
for(var/mob/M in viewers(1, src))
|
||||
if ((M.client && M.machine == src))
|
||||
src.attack_hand(M)
|
||||
//Foreach goto(511)
|
||||
else
|
||||
usr << browse(null, "window=nuclearbomb")
|
||||
return
|
||||
return
|
||||
|
||||
/obj/machinery/nuclearbomb/ex_act()
|
||||
|
||||
if (src.timing == -1.0)
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
return
|
||||
|
||||
|
||||
/obj/machinery/nuclearbomb/blob_act()
|
||||
|
||||
if (src.timing == -1.0)
|
||||
return
|
||||
else
|
||||
return ..()
|
||||
return
|
||||
|
||||
/obj/machinery/nuclearbomb/proc/explode()
|
||||
|
||||
if (src.safety)
|
||||
src.timing = 0
|
||||
return
|
||||
src.timing = -1.0
|
||||
src.yes_code = 0
|
||||
src.icon_state = "nuclearbomb3"
|
||||
sleep(20)
|
||||
var/turf/T = src.loc
|
||||
while(!( istype(T, /turf) ))
|
||||
T = T.loc
|
||||
var/min = 50
|
||||
var/med = 250
|
||||
var/max = 500
|
||||
var/sw = locate(1, 1, T.z)
|
||||
var/ne = locate(world.maxx, world.maxy, T.z)
|
||||
|
||||
defer_powernet_rebuild = 1
|
||||
|
||||
for(var/turf/U in block(sw, ne))
|
||||
var/zone = 4
|
||||
if ((U.y <= T.y + max && U.y >= T.y - max && U.x <= T.x + max && U.x >= T.x - max))
|
||||
zone = 3
|
||||
if ((U.y <= T.y + med && U.y >= T.y - med && U.x <= T.x + med && U.x >= T.x - med))
|
||||
zone = 2
|
||||
if ((U.y <= T.y + min && U.y >= T.y - min && U.x <= T.x + min && U.x >= T.x - min))
|
||||
zone = 1
|
||||
for(var/atom/A in U)
|
||||
A.ex_act(zone)
|
||||
//Foreach goto(404)
|
||||
U.ex_act(zone)
|
||||
U.buildlinks()
|
||||
//Foreach goto(148)
|
||||
|
||||
|
||||
defer_powernet_rebuild = 0
|
||||
makepowernets()
|
||||
ticker.nuclear(src.z)
|
||||
//SN src = null
|
||||
del(src)
|
||||
return
|
||||
return
|
||||
|
||||
/obj/item/weapon/infra_sensor/New()
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
@@ -5,7 +5,7 @@
|
||||
// BEGIN_INTERNALS
|
||||
/*
|
||||
FILE: Code\!atoms.dm
|
||||
DIR: Code Code\Machinery Code\Machinery\Atmoalter Code\Machinery\Door Code\Machinery\Power
|
||||
DIR: Code Code\Machinery Code\Machinery\Atmoalter Code\Machinery\Computer Code\Machinery\Door Code\Machinery\Power
|
||||
MAP_ICON_TYPE: 0
|
||||
AUTO_FILE_DIR: ON
|
||||
*/
|
||||
@@ -15,6 +15,7 @@ AUTO_FILE_DIR: ON
|
||||
#define FILE_DIR "Code"
|
||||
#define FILE_DIR "Code/Machinery"
|
||||
#define FILE_DIR "Code/Machinery/Atmoalter"
|
||||
#define FILE_DIR "Code/Machinery/Computer"
|
||||
#define FILE_DIR "Code/Machinery/Door"
|
||||
#define FILE_DIR "Code/Machinery/Power"
|
||||
#define FILE_DIR "Icons"
|
||||
@@ -31,7 +32,6 @@ AUTO_FILE_DIR: ON
|
||||
#include "Code\aaaDefines.dm"
|
||||
#include "Code\airtunnel.dm"
|
||||
#include "Code\areas.dm"
|
||||
#include "Code\atmo_control.dm"
|
||||
#include "Code\blob.dm"
|
||||
#include "Code\cell_process.dm"
|
||||
#include "Code\cellautomata.dm"
|
||||
@@ -41,7 +41,6 @@ AUTO_FILE_DIR: ON
|
||||
#include "Code\cryo.dm"
|
||||
#include "Code\datumvars.dm"
|
||||
#include "Code\demo.dm"
|
||||
#include "Code\demo2.dm"
|
||||
#include "Code\dna.dm"
|
||||
#include "Code\engine.dm"
|
||||
#include "Code\globals.dm"
|
||||
@@ -73,9 +72,11 @@ AUTO_FILE_DIR: ON
|
||||
#include "Code\Machinery\cell_charger.dm"
|
||||
#include "Code\Machinery\circulator.dm"
|
||||
#include "Code\Machinery\connector.dm"
|
||||
#include "Code\Machinery\cryocell.dm"
|
||||
#include "Code\Machinery\dispenser.dm"
|
||||
#include "Code\Machinery\door_control.dm"
|
||||
#include "Code\Machinery\firealarm.dm"
|
||||
#include "Code\Machinery\freezer.dm"
|
||||
#include "Code\Machinery\gas_sensor.dm"
|
||||
#include "Code\Machinery\igniter.dm"
|
||||
#include "Code\Machinery\injector.dm"
|
||||
@@ -84,16 +85,35 @@ AUTO_FILE_DIR: ON
|
||||
#include "Code\Machinery\light_switch.dm"
|
||||
#include "Code\Machinery\manifold.dm"
|
||||
#include "Code\Machinery\meter.dm"
|
||||
#include "Code\Machinery\nuclearbomb.dm"
|
||||
#include "Code\Machinery\pipeline.dm"
|
||||
#include "Code\Machinery\pipes.dm"
|
||||
#include "Code\Machinery\pod.dm"
|
||||
#include "Code\Machinery\recharger.dm"
|
||||
#include "Code\Machinery\recon.dm"
|
||||
#include "Code\Machinery\sec_lock.dm"
|
||||
#include "Code\Machinery\shuttle.dm"
|
||||
#include "Code\Machinery\sleeper.dm"
|
||||
#include "Code\Machinery\valve.dm"
|
||||
#include "Code\Machinery\vent.dm"
|
||||
#include "Code\Machinery\Atmoalter\_atmoalter.dm"
|
||||
#include "Code\Machinery\Atmoalter\canister.dm"
|
||||
#include "Code\Machinery\Atmoalter\heater.dm"
|
||||
#include "Code\Machinery\Atmoalter\siphs.dm"
|
||||
#include "Code\Machinery\Computer\_computer.dm"
|
||||
#include "Code\Machinery\Computer\airtunnel.dm"
|
||||
#include "Code\Machinery\Computer\atmosphere.dm"
|
||||
#include "Code\Machinery\Computer\card.dm"
|
||||
#include "Code\Machinery\Computer\communications.dm"
|
||||
#include "Code\Machinery\Computer\data.dm"
|
||||
#include "Code\Machinery\Computer\engine.dm"
|
||||
#include "Code\Machinery\Computer\hologram.dm"
|
||||
#include "Code\Machinery\Computer\med_data.dm"
|
||||
#include "Code\Machinery\Computer\pod.dm"
|
||||
#include "Code\Machinery\Computer\prision_shuttle.dm"
|
||||
#include "Code\Machinery\Computer\secure_data.dm"
|
||||
#include "Code\Machinery\Computer\shuttle.dm"
|
||||
#include "Code\Machinery\Computer\sleeper.dm"
|
||||
#include "Code\Machinery\Door\_door.dm"
|
||||
#include "Code\Machinery\Door\airlock.dm"
|
||||
#include "Code\Machinery\Door\false_wall.dm"
|
||||
|
||||
Reference in New Issue
Block a user