Testmerge Conflict fix?
This commit is contained in:
@@ -728,6 +728,13 @@
|
||||
/atom/proc/multitool_act(mob/living/user, obj/item/I)
|
||||
return
|
||||
|
||||
/atom/proc/multitool_check_buffer(user, obj/item/I, silent = FALSE)
|
||||
if(!istype(I, /obj/item/multitool))
|
||||
if(user && !silent)
|
||||
to_chat(user, "<span class='warning'>[I] has no data buffer!</span>")
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/atom/proc/screwdriver_act(mob/living/user, obj/item/I)
|
||||
SEND_SIGNAL(src, COMSIG_ATOM_SCREWDRIVER_ACT, user, I)
|
||||
|
||||
|
||||
@@ -1,11 +1,13 @@
|
||||
/obj/machinery/computer/launchpad
|
||||
name = "\improper launchpad control console"
|
||||
name = "launchpad control console"
|
||||
desc = "Used to teleport objects to and from a launchpad."
|
||||
icon_screen = "teleport"
|
||||
icon_keyboard = "teleport_key"
|
||||
circuit = /obj/item/circuitboard/computer/launchpad_console
|
||||
var/sending = TRUE
|
||||
var/current_pad //current pad viewed on the screen
|
||||
ui_x = 475
|
||||
ui_y = 260
|
||||
|
||||
var/selected_id
|
||||
var/list/obj/machinery/launchpad/launchpads
|
||||
var/maximum_pads = 4
|
||||
|
||||
@@ -18,7 +20,9 @@
|
||||
return
|
||||
|
||||
/obj/machinery/computer/launchpad/attackby(obj/item/W, mob/user, params)
|
||||
if(istype(W, /obj/item/multitool))
|
||||
if(W.tool_behaviour == TOOL_MULTITOOL)
|
||||
if(!multitool_check_buffer(user, W))
|
||||
return
|
||||
var/obj/item/multitool/M = W
|
||||
if(M.buffer && istype(M.buffer, /obj/machinery/launchpad))
|
||||
if(LAZYLEN(launchpads) < maximum_pads)
|
||||
@@ -36,55 +40,7 @@
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/computer/launchpad/proc/get_pad(number)
|
||||
var/obj/machinery/launchpad/pad = launchpads[number]
|
||||
return pad
|
||||
|
||||
/obj/machinery/computer/launchpad/ui_interact(mob/user)
|
||||
. = ..()
|
||||
var/list/t = list()
|
||||
if(!LAZYLEN(launchpads))
|
||||
obj_flags &= ~IN_USE //Yeah so if you deconstruct teleporter while its in the process of shooting it wont disable the console
|
||||
t += "<div class='statusDisplay'>No launchpad located.</div><BR>"
|
||||
else
|
||||
for(var/i in 1 to LAZYLEN(launchpads))
|
||||
if(pad_exists(i))
|
||||
var/obj/machinery/launchpad/pad = get_pad(i)
|
||||
if(pad.stat & NOPOWER)
|
||||
t+= "<span class='linkOff'>[pad.display_name]</span>"
|
||||
else
|
||||
t+= "<A href='?src=[REF(src)];choose_pad=1;pad=[i]'>[pad.display_name]</A>"
|
||||
else
|
||||
launchpads -= get_pad(i)
|
||||
t += "<BR>"
|
||||
|
||||
if(current_pad)
|
||||
var/obj/machinery/launchpad/pad = get_pad(current_pad)
|
||||
t += "<div class='statusDisplay'><b>[pad.display_name]</b></div>"
|
||||
t += "<A href='?src=[REF(src)];change_name=1;pad=[current_pad]'>Rename</A>"
|
||||
t += "<A href='?src=[REF(src)];remove=1;pad=[current_pad]'>Remove</A><BR><BR>"
|
||||
t += "<A href='?src=[REF(src)];raisey=1;lowerx=1;pad=[current_pad]'>O</A>" //up-left
|
||||
t += "<A href='?src=[REF(src)];raisey=1;pad=[current_pad]'>^</A>" //up
|
||||
t += "<A href='?src=[REF(src)];raisey=1;raisex=1;pad=[current_pad]'>O</A><BR>" //up-right
|
||||
t += "<A href='?src=[REF(src)];lowerx=1;pad=[current_pad]'><</A>"//left
|
||||
t += "<A href='?src=[REF(src)];reset=1;pad=[current_pad]'>R</A>"//reset to 0
|
||||
t += "<A href='?src=[REF(src)];raisex=1;pad=[current_pad]'>></A><BR>"//right
|
||||
t += "<A href='?src=[REF(src)];lowery=1;lowerx=1;pad=[current_pad]'>O</A>"//down-left
|
||||
t += "<A href='?src=[REF(src)];lowery=1;pad=[current_pad]'>v</A>"//down
|
||||
t += "<A href='?src=[REF(src)];lowery=1;raisex=1;pad=[current_pad]'>O</A><BR>"//down-right
|
||||
t += "<BR>"
|
||||
t += "<div class='statusDisplay'>Current offset:</div><BR>"
|
||||
t += "<div class='statusDisplay'>[abs(pad.y_offset)] [pad.y_offset > 0 ? "N":"S"] <a href='?src=[REF(src)];sety=1;pad=[current_pad]'>\[SET\]</a></div><BR>"
|
||||
t += "<div class='statusDisplay'>[abs(pad.x_offset)] [pad.x_offset > 0 ? "E":"W"] <a href='?src=[REF(src)];setx=1;pad=[current_pad]'>\[SET\]</a></div><BR>"
|
||||
|
||||
t += "<BR><A href='?src=[REF(src)];launch=1;pad=[current_pad]'>Launch</A>"
|
||||
t += " <A href='?src=[REF(src)];pull=1;pad=[current_pad]'>Pull</A>"
|
||||
|
||||
var/datum/browser/popup = new(user, "launchpad", name, 300, 500)
|
||||
popup.set_content(t.Join())
|
||||
popup.open()
|
||||
|
||||
/obj/machinery/computer/launchpad/proc/teleport(mob/user, obj/machinery/launchpad/pad)
|
||||
/obj/machinery/computer/launchpad/proc/teleport(mob/user, obj/machinery/launchpad/pad, sending)
|
||||
if(QDELETED(pad))
|
||||
to_chat(user, "<span class='warning'>ERROR: Launchpad not responding. Check launchpad integrity.</span>")
|
||||
return
|
||||
@@ -93,66 +49,83 @@
|
||||
return
|
||||
pad.doteleport(user, sending)
|
||||
|
||||
/obj/machinery/computer/launchpad/Topic(href, href_list)
|
||||
var/obj/machinery/launchpad/pad
|
||||
if(href_list["pad"])
|
||||
pad = get_pad(text2num(href_list["pad"]))
|
||||
/obj/machinery/computer/launchpad/proc/get_pad(number)
|
||||
var/obj/machinery/launchpad/pad = launchpads[number]
|
||||
return pad
|
||||
|
||||
/obj/machinery/computer/launchpad/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "launchpad_console", name, ui_x, ui_y, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/launchpad/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
var/list/pad_list = list()
|
||||
for(var/i in 1 to LAZYLEN(launchpads))
|
||||
if(pad_exists(i))
|
||||
var/obj/machinery/launchpad/pad = get_pad(i)
|
||||
var/list/this_pad = list()
|
||||
this_pad["name"] = pad.display_name
|
||||
this_pad["id"] = i
|
||||
if(pad.stat & NOPOWER)
|
||||
this_pad["inactive"] = TRUE
|
||||
pad_list += list(this_pad)
|
||||
else
|
||||
launchpads -= get_pad(i)
|
||||
data["launchpads"] = pad_list
|
||||
data["selected_id"] = selected_id
|
||||
if(selected_id)
|
||||
var/obj/machinery/launchpad/current_pad = launchpads[selected_id]
|
||||
data["x"] = current_pad.x_offset
|
||||
data["y"] = current_pad.y_offset
|
||||
data["pad_name"] = current_pad.display_name
|
||||
data["range"] = current_pad.range
|
||||
data["selected_pad"] = current_pad
|
||||
if(QDELETED(current_pad) || (current_pad.stat & NOPOWER))
|
||||
data["pad_active"] = FALSE
|
||||
return data
|
||||
data["pad_active"] = TRUE
|
||||
|
||||
return data
|
||||
|
||||
/obj/machinery/computer/launchpad/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
if(!LAZYLEN(launchpads))
|
||||
updateDialog()
|
||||
return
|
||||
var/obj/machinery/launchpad/current_pad = launchpads[selected_id]
|
||||
switch(action)
|
||||
if("select_pad")
|
||||
selected_id = text2num(params["id"])
|
||||
. = TRUE
|
||||
if("set_pos")
|
||||
var/new_x = text2num(params["x"])
|
||||
var/new_y = text2num(params["y"])
|
||||
current_pad.set_offset(new_x, new_y)
|
||||
. = TRUE
|
||||
if("move_pos")
|
||||
var/plus_x = text2num(params["x"])
|
||||
var/plus_y = text2num(params["y"])
|
||||
current_pad.set_offset(
|
||||
x = current_pad.x_offset + plus_x,
|
||||
y = current_pad.y_offset + plus_y
|
||||
)
|
||||
. = TRUE
|
||||
if("rename")
|
||||
. = TRUE
|
||||
var/new_name = params["name"]
|
||||
if(!new_name)
|
||||
return
|
||||
current_pad.display_name = new_name
|
||||
if("remove")
|
||||
if(usr && alert(usr, "Are you sure?", "Unlink Launchpad", "I'm Sure", "Abort") != "Abort")
|
||||
launchpads -= current_pad
|
||||
selected_id = null
|
||||
. = TRUE
|
||||
if("launch")
|
||||
teleport(usr, current_pad, TRUE)
|
||||
. = TRUE
|
||||
|
||||
if(href_list["choose_pad"])
|
||||
current_pad = text2num(href_list["pad"])
|
||||
|
||||
if(href_list["raisex"])
|
||||
if(pad.x_offset < pad.range)
|
||||
pad.x_offset++
|
||||
|
||||
if(href_list["lowerx"])
|
||||
if(pad.x_offset > (pad.range * -1))
|
||||
pad.x_offset--
|
||||
|
||||
if(href_list["raisey"])
|
||||
if(pad.y_offset < pad.range)
|
||||
pad.y_offset++
|
||||
|
||||
if(href_list["lowery"])
|
||||
if(pad.y_offset > (pad.range * -1))
|
||||
pad.y_offset--
|
||||
|
||||
if(href_list["reset"])
|
||||
pad.y_offset = 0
|
||||
pad.x_offset = 0
|
||||
|
||||
if(href_list["change_name"])
|
||||
var/new_name = stripped_input(usr, "What do you wish to name the launchpad?", "Launchpad", pad.display_name, 15)
|
||||
if(!new_name)
|
||||
return
|
||||
pad.display_name = new_name
|
||||
|
||||
if(href_list["setx"])
|
||||
var/newx = input(usr, "Input new x offset", pad.display_name, pad.x_offset) as null|num
|
||||
if(!isnull(newx))
|
||||
pad.x_offset = CLAMP(newx, -pad.range, pad.range)
|
||||
|
||||
if(href_list["sety"])
|
||||
var/newy = input(usr, "Input new y offset", pad.display_name, pad.y_offset) as null|num
|
||||
if(!isnull(newy))
|
||||
pad.y_offset = CLAMP(newy, -pad.range, pad.range)
|
||||
|
||||
if(href_list["remove"])
|
||||
if(usr && alert(usr, "Are you sure?", "Remove Launchpad", "I'm Sure", "Abort") != "Abort")
|
||||
launchpads -= pad
|
||||
|
||||
if(href_list["launch"])
|
||||
sending = TRUE
|
||||
teleport(usr, pad)
|
||||
|
||||
if(href_list["pull"])
|
||||
sending = FALSE
|
||||
teleport(usr, pad)
|
||||
|
||||
updateDialog()
|
||||
if("pull")
|
||||
teleport(usr, current_pad, FALSE)
|
||||
. = TRUE
|
||||
. = TRUE
|
||||
@@ -6,6 +6,9 @@
|
||||
icon_keyboard = "security_key"
|
||||
req_access = list(ACCESS_ARMORY)
|
||||
circuit = /obj/item/circuitboard/computer/gulag_teleporter_console
|
||||
ui_x = 350
|
||||
ui_y = 295
|
||||
|
||||
var/default_goal = 200
|
||||
var/obj/machinery/gulag_teleporter/teleporter = null
|
||||
var/obj/structure/gulag_beacon/beacon = null
|
||||
@@ -22,7 +25,7 @@
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "gulag_console", name, 455, 440, master_ui, state)
|
||||
ui = new(user, src, ui_key, "gulag_console", name, ui_x, ui_y, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/prisoner/gulag_teleporter_computer/ui_data(mob/user)
|
||||
@@ -50,13 +53,19 @@
|
||||
data["teleporter_location"] = "([teleporter.x], [teleporter.y], [teleporter.z])"
|
||||
data["teleporter_lock"] = teleporter.locked
|
||||
data["teleporter_state_open"] = teleporter.state_open
|
||||
else
|
||||
data["teleporter"] = null
|
||||
if(beacon)
|
||||
data["beacon"] = beacon
|
||||
data["beacon_location"] = "([beacon.x], [beacon.y], [beacon.z])"
|
||||
else
|
||||
data["beacon"] = null
|
||||
if(contained_id)
|
||||
data["id"] = contained_id
|
||||
data["id_name"] = contained_id.registered_name
|
||||
data["goal"] = contained_id.goal
|
||||
else
|
||||
data["id"] = null
|
||||
data["can_teleport"] = can_teleport
|
||||
|
||||
return data
|
||||
@@ -72,36 +81,41 @@
|
||||
switch(action)
|
||||
if("scan_teleporter")
|
||||
teleporter = findteleporter()
|
||||
return TRUE
|
||||
if("scan_beacon")
|
||||
beacon = findbeacon()
|
||||
return TRUE
|
||||
if("handle_id")
|
||||
if(contained_id)
|
||||
id_eject(usr)
|
||||
else
|
||||
id_insert(usr)
|
||||
return TRUE
|
||||
if("set_goal")
|
||||
var/new_goal = input("Set the amount of points:", "Points", contained_id.goal) as num|null
|
||||
var/new_goal = text2num(params["value"])
|
||||
if(!isnum(new_goal))
|
||||
return
|
||||
if(!new_goal)
|
||||
new_goal = default_goal
|
||||
if (new_goal > 1000)
|
||||
to_chat(usr, "The entered amount of points is too large. Points have instead been set to the maximum allowed amount.")
|
||||
contained_id.goal = CLAMP(new_goal, 0, 1000) //maximum 1000 points
|
||||
return TRUE
|
||||
if("toggle_open")
|
||||
if(teleporter.locked)
|
||||
to_chat(usr, "The teleporter is locked")
|
||||
to_chat(usr, "<span class='alert'>The teleporter must be unlocked first.</span>")
|
||||
return
|
||||
teleporter.toggle_open()
|
||||
return TRUE
|
||||
if("teleporter_lock")
|
||||
if(teleporter.state_open)
|
||||
to_chat(usr, "Close the teleporter before locking!")
|
||||
to_chat(usr, "<span class='alert'>The teleporter must be closed first.</span>")
|
||||
return
|
||||
teleporter.locked = !teleporter.locked
|
||||
return TRUE
|
||||
if("teleport")
|
||||
if(!teleporter || !beacon)
|
||||
return
|
||||
addtimer(CALLBACK(src, .proc/teleport, usr), 5)
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/computer/prisoner/gulag_teleporter_computer/proc/scan_machinery()
|
||||
teleporter = findteleporter()
|
||||
@@ -129,12 +143,12 @@
|
||||
say("[contained_id]'s ID card goal defaulting to [contained_id.goal] points.")
|
||||
log_game("[key_name(user)] teleported [key_name(prisoner)] to the Labor Camp [COORD(beacon)] for [id_goal_not_set ? "default goal of ":""][contained_id.goal] points.")
|
||||
teleporter.handle_prisoner(contained_id, temporary_record)
|
||||
playsound(src, 'sound/weapons/emitter.ogg', 50, 1)
|
||||
playsound(src, 'sound/weapons/emitter.ogg', 50, TRUE)
|
||||
prisoner.forceMove(get_turf(beacon))
|
||||
prisoner.Stun(40) // small travel dizziness
|
||||
to_chat(prisoner, "<span class='warning'>The teleportation makes you a little dizzy.</span>")
|
||||
new /obj/effect/particle_effect/sparks(get_turf(prisoner))
|
||||
playsound(src, "sparks", 50, 1)
|
||||
playsound(src, "sparks", 50, TRUE)
|
||||
if(teleporter.locked)
|
||||
teleporter.locked = FALSE
|
||||
teleporter.toggle_open()
|
||||
|
||||
@@ -5,6 +5,8 @@
|
||||
icon_keyboard = "teleport_key"
|
||||
light_color = LIGHT_COLOR_BLUE
|
||||
circuit = /obj/item/circuitboard/computer/teleporter
|
||||
ui_x = 475
|
||||
ui_y = 130
|
||||
var/regime_set = "Teleporter"
|
||||
var/id
|
||||
var/obj/machinery/teleport/station/power_station
|
||||
@@ -32,34 +34,30 @@
|
||||
break
|
||||
return power_station
|
||||
|
||||
/obj/machinery/computer/teleporter/ui_interact(mob/user)
|
||||
. = ..()
|
||||
var/data = "<h3>Teleporter Status</h3>"
|
||||
if(!power_station)
|
||||
data += "<div class='statusDisplay'>No power station linked.</div>"
|
||||
else if(!power_station.teleporter_hub)
|
||||
data += "<div class='statusDisplay'>No hub linked.</div>"
|
||||
obj/machinery/computer/teleporter/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "teleporter", name, ui_x, ui_y, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/computer/teleporter/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["power_station"] = power_station ? TRUE : FALSE
|
||||
data["teleporter_hub"] = power_station?.teleporter_hub ? TRUE : FALSE
|
||||
data["regime_set"] = regime_set
|
||||
data["target"] = !target ? "None" : "[get_area(target)] [(regime_set != "Gate") ? "" : "Teleporter"]"
|
||||
data["calibrating"] = calibrating
|
||||
|
||||
if(power_station?.teleporter_hub?.calibrated || power_station?.teleporter_hub?.accuracy >= 3)
|
||||
data["calibrated"] = TRUE
|
||||
else
|
||||
data += "<div class='statusDisplay'>Current regime: [regime_set]<BR>"
|
||||
data += "Current target: [(!target) ? "None" : "[get_area(target)] [(regime_set != "Gate") ? "" : "Teleporter"]"]<BR>"
|
||||
if(calibrating)
|
||||
data += "Calibration: <font color='yellow'>In Progress</font>"
|
||||
else if(power_station.teleporter_hub.calibrated || power_station.efficiency >= 3)
|
||||
data += "Calibration: <font color='green'>Optimal</font>"
|
||||
else
|
||||
data += "Calibration: <font color='red'>Sub-Optimal</font>"
|
||||
data += "</div><BR>"
|
||||
data["calibrated"] = FALSE
|
||||
|
||||
data += "<A href='?src=[REF(src)];regimeset=1'>Change regime</A><BR>"
|
||||
data += "<A href='?src=[REF(src)];settarget=1'>Set target</A><BR>"
|
||||
return data
|
||||
|
||||
data += "<BR><A href='?src=[REF(src)];calibrate=1'>Calibrate Hub</A>"
|
||||
|
||||
var/datum/browser/popup = new(user, "teleporter", name, 400, 400)
|
||||
popup.set_content(data)
|
||||
popup.open()
|
||||
|
||||
/obj/machinery/computer/teleporter/Topic(href, href_list)
|
||||
/obj/machinery/computer/teleporter/ui_act(action, params)
|
||||
if(..())
|
||||
return
|
||||
|
||||
@@ -70,38 +68,39 @@
|
||||
say("Error: Calibration in progress. Stand by.")
|
||||
return
|
||||
|
||||
if(href_list["regimeset"])
|
||||
power_station.engaged = 0
|
||||
power_station.teleporter_hub.update_icon()
|
||||
power_station.teleporter_hub.calibrated = 0
|
||||
reset_regime()
|
||||
if(href_list["settarget"])
|
||||
power_station.engaged = 0
|
||||
power_station.teleporter_hub.update_icon()
|
||||
power_station.teleporter_hub.calibrated = 0
|
||||
set_target(usr)
|
||||
if(href_list["calibrate"])
|
||||
if(!target)
|
||||
say("Error: No target set to calibrate to.")
|
||||
return
|
||||
if(power_station.teleporter_hub.calibrated || power_station.efficiency >= 3)
|
||||
say("Hub is already calibrated!")
|
||||
return
|
||||
say("Processing hub calibration to target...")
|
||||
switch(action)
|
||||
if("regimeset")
|
||||
power_station.engaged = FALSE
|
||||
power_station.teleporter_hub.update_icon()
|
||||
power_station.teleporter_hub.calibrated = FALSE
|
||||
reset_regime()
|
||||
. = TRUE
|
||||
if("settarget")
|
||||
power_station.engaged = FALSE
|
||||
power_station.teleporter_hub.update_icon()
|
||||
power_station.teleporter_hub.calibrated = FALSE
|
||||
set_target(usr)
|
||||
. = TRUE
|
||||
if("calibrate")
|
||||
if(!target)
|
||||
say("Error: No target set to calibrate to.")
|
||||
return
|
||||
if(power_station.teleporter_hub.calibrated || power_station.teleporter_hub.accuracy >= 3)
|
||||
say("Hub is already calibrated!")
|
||||
return
|
||||
|
||||
calibrating = 1
|
||||
power_station.update_icon()
|
||||
spawn(50 * (3 - power_station.efficiency)) //Better parts mean faster calibration
|
||||
calibrating = 0
|
||||
if(check_hub_connection())
|
||||
power_station.teleporter_hub.calibrated = 1
|
||||
say("Calibration complete.")
|
||||
else
|
||||
say("Error: Unable to detect hub.")
|
||||
say("Processing hub calibration to target...")
|
||||
calibrating = TRUE
|
||||
power_station.update_icon()
|
||||
updateDialog()
|
||||
|
||||
updateDialog()
|
||||
spawn(50 * (3 - power_station.teleporter_hub.accuracy)) //Better parts mean faster calibration
|
||||
calibrating = FALSE
|
||||
if(check_hub_connection())
|
||||
power_station.teleporter_hub.calibrated = TRUE
|
||||
say("Calibration complete.")
|
||||
else
|
||||
say("Error: Unable to detect hub.")
|
||||
power_station.update_icon()
|
||||
. = TRUE
|
||||
|
||||
/obj/machinery/computer/teleporter/proc/check_hub_connection()
|
||||
if(!power_station)
|
||||
|
||||
@@ -16,6 +16,7 @@
|
||||
var/power_efficiency = 1
|
||||
var/x_offset = 0
|
||||
var/y_offset = 0
|
||||
var/indicator_icon = "launchpad_target"
|
||||
|
||||
/obj/machinery/launchpad/RefreshParts()
|
||||
var/E = 0
|
||||
@@ -34,17 +35,28 @@
|
||||
return
|
||||
|
||||
if(panel_open)
|
||||
if(istype(I, /obj/item/multitool))
|
||||
if(I.tool_behaviour == TOOL_MULTITOOL)
|
||||
if(!multitool_check_buffer(user, I))
|
||||
return
|
||||
var/obj/item/multitool/M = I
|
||||
M.buffer = src
|
||||
to_chat(user, "<span class='notice'>You save the data in the [I.name]'s buffer.</span>")
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
if(default_deconstruction_crowbar(I))
|
||||
return
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/launchpad/attack_ghost(mob/dead/observer/ghost)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
var/target_x = x + x_offset
|
||||
var/target_y = y + y_offset
|
||||
var/turf/target = locate(target_x, target_y, z)
|
||||
ghost.forceMove(target)
|
||||
|
||||
/obj/machinery/launchpad/proc/isAvailable()
|
||||
if(stat & NOPOWER)
|
||||
return FALSE
|
||||
@@ -52,6 +64,14 @@
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/launchpad/proc/set_offset(x, y)
|
||||
if(teleporting)
|
||||
return
|
||||
if(!isnull(x))
|
||||
x_offset = CLAMP(x, -range, range)
|
||||
if(!isnull(y))
|
||||
y_offset = CLAMP(y, -range, range)
|
||||
|
||||
/obj/machinery/launchpad/proc/doteleport(mob/user, sending)
|
||||
if(teleporting)
|
||||
to_chat(user, "<span class='warning'>ERROR: Launchpad busy.</span>")
|
||||
@@ -69,12 +89,22 @@
|
||||
var/area/A = get_area(target)
|
||||
|
||||
flick(icon_teleport, src)
|
||||
playsound(get_turf(src), 'sound/weapons/flash.ogg', 25, 1)
|
||||
|
||||
//Change the indicator's icon to show that we're teleporting
|
||||
if(sending)
|
||||
indicator_icon = "launchpad_launch"
|
||||
else
|
||||
indicator_icon = "launchpad_pull"
|
||||
|
||||
playsound(get_turf(src), 'sound/weapons/flash.ogg', 25, TRUE)
|
||||
teleporting = TRUE
|
||||
|
||||
|
||||
sleep(teleport_speed)
|
||||
|
||||
//Set the indicator icon back to normal
|
||||
indicator_icon = "launchpad_target"
|
||||
|
||||
if(QDELETED(src) || !isAvailable())
|
||||
return
|
||||
|
||||
@@ -91,25 +121,25 @@
|
||||
source = dest
|
||||
dest = target
|
||||
|
||||
playsound(get_turf(src), 'sound/weapons/emitter2.ogg', 25, 1)
|
||||
playsound(get_turf(src), 'sound/weapons/emitter2.ogg', 25, TRUE)
|
||||
var/first = TRUE
|
||||
for(var/atom/movable/ROI in source)
|
||||
if(ROI == src)
|
||||
continue
|
||||
// if it's anchored, don't teleport
|
||||
if(!istype(ROI) || isdead(ROI) || iscameramob(ROI) || istype(ROI, /obj/effect/dummy/phased_mob))
|
||||
continue//don't teleport these
|
||||
var/on_chair = ""
|
||||
if(ROI.anchored)
|
||||
if(ROI.anchored)// if it's anchored, don't teleport
|
||||
if(isliving(ROI))
|
||||
var/mob/living/L = ROI
|
||||
if(L.buckled)
|
||||
// TP people on office chairs
|
||||
if(L.buckled.anchored)
|
||||
continue
|
||||
|
||||
on_chair = " (on a chair)"
|
||||
else
|
||||
continue
|
||||
else if(!isobserver(ROI))
|
||||
else
|
||||
continue
|
||||
if(!first)
|
||||
log_msg += ", "
|
||||
@@ -158,11 +188,11 @@
|
||||
var/obj/item/storage/briefcase/launchpad/briefcase
|
||||
|
||||
/obj/machinery/launchpad/briefcase/Initialize(mapload, briefcase)
|
||||
. = ..()
|
||||
if(!briefcase)
|
||||
log_game("[src] has been spawned without a briefcase.")
|
||||
return INITIALIZE_HINT_QDEL
|
||||
src.briefcase = briefcase
|
||||
. = ..()
|
||||
if(!briefcase)
|
||||
log_game("[src] has been spawned without a briefcase.")
|
||||
return INITIALIZE_HINT_QDEL
|
||||
src.briefcase = briefcase
|
||||
|
||||
/obj/machinery/launchpad/briefcase/Destroy()
|
||||
QDEL_NULL(briefcase)
|
||||
@@ -255,7 +285,7 @@
|
||||
/obj/item/launchpad_remote/ui_interact(mob/user, ui_key = "launchpad_remote", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "launchpad_remote", "Briefcase Launchpad Remote", 550, 400, master_ui, state) //width, height
|
||||
ui = new(user, src, ui_key, "launchpad_remote", "Briefcase Launchpad Remote", 300, 240, master_ui, state) //width, height
|
||||
ui.set_style("syndicate")
|
||||
ui.open()
|
||||
|
||||
@@ -270,10 +300,9 @@
|
||||
return data
|
||||
|
||||
data["pad_name"] = pad.display_name
|
||||
data["abs_x"] = abs(pad.x_offset)
|
||||
data["abs_y"] = abs(pad.y_offset)
|
||||
data["north_south"] = pad.y_offset > 0 ? "N":"S"
|
||||
data["east_west"] = pad.x_offset > 0 ? "E":"W"
|
||||
data["range"] = pad.range
|
||||
data["x"] = pad.x_offset
|
||||
data["y"] = pad.y_offset
|
||||
return data
|
||||
|
||||
/obj/item/launchpad_remote/proc/teleport(mob/user, obj/machinery/launchpad/pad)
|
||||
@@ -289,76 +318,33 @@
|
||||
if(..())
|
||||
return
|
||||
switch(action)
|
||||
if("right")
|
||||
if(pad.x_offset < pad.range)
|
||||
pad.x_offset++
|
||||
if("set_pos")
|
||||
var/new_x = text2num(params["x"])
|
||||
var/new_y = text2num(params["y"])
|
||||
pad.set_offset(new_x, new_y)
|
||||
. = TRUE
|
||||
|
||||
if("left")
|
||||
if(pad.x_offset > (pad.range * -1))
|
||||
pad.x_offset--
|
||||
if("move_pos")
|
||||
var/plus_x = text2num(params["x"])
|
||||
var/plus_y = text2num(params["y"])
|
||||
pad.set_offset(
|
||||
x = pad.x_offset + plus_x,
|
||||
y = pad.y_offset + plus_y
|
||||
)
|
||||
. = TRUE
|
||||
|
||||
if("up")
|
||||
if(pad.y_offset < pad.range)
|
||||
pad.y_offset++
|
||||
. = TRUE
|
||||
|
||||
if("down")
|
||||
if(pad.y_offset > (pad.range * -1))
|
||||
pad.y_offset--
|
||||
. = TRUE
|
||||
|
||||
if("up-right")
|
||||
if(pad.y_offset < pad.range)
|
||||
pad.y_offset++
|
||||
if(pad.x_offset < pad.range)
|
||||
pad.x_offset++
|
||||
. = TRUE
|
||||
|
||||
if("up-left")
|
||||
if(pad.y_offset < pad.range)
|
||||
pad.y_offset++
|
||||
if(pad.x_offset > (pad.range * -1))
|
||||
pad.x_offset--
|
||||
. = TRUE
|
||||
|
||||
if("down-right")
|
||||
if(pad.y_offset > (pad.range * -1))
|
||||
pad.y_offset--
|
||||
if(pad.x_offset < pad.range)
|
||||
pad.x_offset++
|
||||
. = TRUE
|
||||
|
||||
if("down-left")
|
||||
if(pad.y_offset > (pad.range * -1))
|
||||
pad.y_offset--
|
||||
if(pad.x_offset > (pad.range * -1))
|
||||
pad.x_offset--
|
||||
. = TRUE
|
||||
|
||||
if("reset")
|
||||
pad.y_offset = 0
|
||||
pad.x_offset = 0
|
||||
. = TRUE
|
||||
|
||||
if("rename")
|
||||
. = TRUE
|
||||
var/new_name = stripped_input(usr, "How do you want to rename the launchpad?", "Launchpad", pad.display_name, 15)
|
||||
var/new_name = params["name"]
|
||||
if(!new_name)
|
||||
return
|
||||
pad.display_name = new_name
|
||||
|
||||
if("remove")
|
||||
. = TRUE
|
||||
if(usr && alert(usr, "Are you sure?", "Unlink Launchpad", "I'm Sure", "Abort") != "Abort")
|
||||
pad = null
|
||||
|
||||
if("launch")
|
||||
sending = TRUE
|
||||
teleport(usr, pad)
|
||||
. = TRUE
|
||||
|
||||
if("pull")
|
||||
sending = FALSE
|
||||
teleport(usr, pad)
|
||||
|
||||
@@ -1,453 +1,453 @@
|
||||
// SUIT STORAGE UNIT /////////////////
|
||||
/obj/machinery/suit_storage_unit
|
||||
name = "suit storage unit"
|
||||
desc = "An industrial unit made to hold and decontaminate irradiated equipment. It comes with a built-in UV cauterization mechanism. A small warning label advises that organic matter should not be placed into the unit."
|
||||
icon = 'icons/obj/machines/suit_storage.dmi'
|
||||
icon_state = "close"
|
||||
density = TRUE
|
||||
max_integrity = 250
|
||||
|
||||
var/obj/item/clothing/suit/space/suit = null
|
||||
var/obj/item/clothing/head/helmet/space/helmet = null
|
||||
var/obj/item/clothing/mask/mask = null
|
||||
var/obj/item/storage = null
|
||||
|
||||
var/suit_type = null
|
||||
var/helmet_type = null
|
||||
var/mask_type = null
|
||||
var/storage_type = null
|
||||
|
||||
state_open = FALSE
|
||||
var/locked = FALSE
|
||||
panel_open = FALSE
|
||||
var/safeties = TRUE
|
||||
|
||||
var/uv = FALSE
|
||||
var/uv_super = FALSE
|
||||
var/uv_cycles = 6
|
||||
var/message_cooldown
|
||||
var/breakout_time = 300
|
||||
|
||||
/obj/machinery/suit_storage_unit/standard_unit
|
||||
suit_type = /obj/item/clothing/suit/space/eva
|
||||
helmet_type = /obj/item/clothing/head/helmet/space/eva
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
|
||||
/obj/machinery/suit_storage_unit/captain
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/captain
|
||||
mask_type = /obj/item/clothing/mask/gas/sechailer
|
||||
storage_type = /obj/item/tank/jetpack/oxygen/captain
|
||||
|
||||
/obj/machinery/suit_storage_unit/engine
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/engine
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type= /obj/item/clothing/shoes/magboots
|
||||
|
||||
/obj/machinery/suit_storage_unit/ce
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/engine/elite
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type= /obj/item/clothing/shoes/magboots/advance
|
||||
|
||||
/obj/machinery/suit_storage_unit/security
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/security
|
||||
mask_type = /obj/item/clothing/mask/gas/sechailer
|
||||
storage_type = /obj/item/tank/jetpack/oxygen/security
|
||||
|
||||
/obj/machinery/suit_storage_unit/hos
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/security/hos
|
||||
mask_type = /obj/item/clothing/mask/gas/sechailer
|
||||
storage_type = /obj/item/tank/internals/oxygen
|
||||
|
||||
/obj/machinery/suit_storage_unit/atmos
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/engine/atmos
|
||||
mask_type = /obj/item/clothing/mask/gas
|
||||
storage_type = /obj/item/watertank/atmos
|
||||
|
||||
/obj/machinery/suit_storage_unit/mining
|
||||
suit_type = /obj/item/clothing/suit/hooded/explorer/standard
|
||||
mask_type = /obj/item/clothing/mask/gas/explorer
|
||||
|
||||
/obj/machinery/suit_storage_unit/mining/eva
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/mining
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
|
||||
/obj/machinery/suit_storage_unit/cmo
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/medical
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
|
||||
/obj/machinery/suit_storage_unit/rd
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/rd
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
|
||||
/obj/machinery/suit_storage_unit/syndicate
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/syndi
|
||||
mask_type = /obj/item/clothing/mask/gas/syndicate
|
||||
storage_type = /obj/item/tank/jetpack/oxygen/harness
|
||||
|
||||
/obj/machinery/suit_storage_unit/ert/command
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/ert
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type = /obj/item/tank/internals/emergency_oxygen/double
|
||||
|
||||
/obj/machinery/suit_storage_unit/ert/security
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/ert/sec
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type = /obj/item/tank/internals/emergency_oxygen/double
|
||||
|
||||
/obj/machinery/suit_storage_unit/ert/engineer
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/ert/engi
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type = /obj/item/tank/internals/emergency_oxygen/double
|
||||
|
||||
/obj/machinery/suit_storage_unit/ert/medical
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/ert/med
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type = /obj/item/tank/internals/emergency_oxygen/double
|
||||
|
||||
/obj/machinery/suit_storage_unit/radsuit
|
||||
name = "radiation suit storage unit"
|
||||
suit_type = /obj/item/clothing/suit/radiation
|
||||
helmet_type = /obj/item/clothing/head/radiation
|
||||
storage_type = /obj/item/geiger_counter
|
||||
|
||||
/obj/machinery/suit_storage_unit/open
|
||||
state_open = TRUE
|
||||
density = FALSE
|
||||
|
||||
/obj/machinery/suit_storage_unit/Initialize()
|
||||
. = ..()
|
||||
wires = new /datum/wires/suit_storage_unit(src)
|
||||
if(suit_type)
|
||||
suit = new suit_type(src)
|
||||
if(helmet_type)
|
||||
helmet = new helmet_type(src)
|
||||
if(mask_type)
|
||||
mask = new mask_type(src)
|
||||
if(storage_type)
|
||||
storage = new storage_type(src)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/suit_storage_unit/Destroy()
|
||||
QDEL_NULL(suit)
|
||||
QDEL_NULL(helmet)
|
||||
QDEL_NULL(mask)
|
||||
QDEL_NULL(storage)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/suit_storage_unit/update_icon()
|
||||
cut_overlays()
|
||||
|
||||
if(uv)
|
||||
if(uv_super)
|
||||
add_overlay("super")
|
||||
else if(occupant)
|
||||
add_overlay("uvhuman")
|
||||
else
|
||||
add_overlay("uv")
|
||||
else if(state_open)
|
||||
if(stat & BROKEN)
|
||||
add_overlay("broken")
|
||||
else
|
||||
add_overlay("open")
|
||||
if(suit)
|
||||
add_overlay("suit")
|
||||
if(helmet)
|
||||
add_overlay("helm")
|
||||
if(storage)
|
||||
add_overlay("storage")
|
||||
else if(occupant)
|
||||
add_overlay("human")
|
||||
|
||||
/obj/machinery/suit_storage_unit/power_change()
|
||||
..()
|
||||
if(!is_operational() && state_open)
|
||||
open_machine()
|
||||
dump_contents()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/suit_storage_unit/proc/dump_contents()
|
||||
dropContents()
|
||||
helmet = null
|
||||
suit = null
|
||||
mask = null
|
||||
storage = null
|
||||
occupant = null
|
||||
|
||||
/obj/machinery/suit_storage_unit/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
open_machine()
|
||||
dump_contents()
|
||||
new /obj/item/stack/sheet/metal (loc, 2)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/suit_storage_unit/MouseDrop_T(atom/A, mob/user)
|
||||
if(user.stat || user.lying || !Adjacent(user) || !Adjacent(A) || !isliving(A))
|
||||
return
|
||||
var/mob/living/target = A
|
||||
if(!state_open)
|
||||
to_chat(user, "<span class='warning'>The unit's doors are shut!</span>")
|
||||
return
|
||||
if(!is_operational())
|
||||
to_chat(user, "<span class='warning'>The unit is not operational!</span>")
|
||||
return
|
||||
if(occupant || helmet || suit || storage)
|
||||
to_chat(user, "<span class='warning'>It's too cluttered inside to fit in!</span>")
|
||||
return
|
||||
|
||||
if(target == user)
|
||||
user.visible_message("<span class='warning'>[user] starts squeezing into [src]!</span>", "<span class='notice'>You start working your way into [src]...</span>")
|
||||
else
|
||||
target.visible_message("<span class='warning'>[user] starts shoving [target] into [src]!</span>", "<span class='userdanger'>[user] starts shoving you into [src]!</span>")
|
||||
|
||||
if(do_mob(user, target, 30))
|
||||
if(occupant || helmet || suit || storage)
|
||||
return
|
||||
if(target == user)
|
||||
user.visible_message("<span class='warning'>[user] slips into [src] and closes the door behind [user.p_them()]!</span>", "<span class=notice'>You slip into [src]'s cramped space and shut its door.</span>")
|
||||
else
|
||||
target.visible_message("<span class='warning'>[user] pushes [target] into [src] and shuts its door!<span>", "<span class='userdanger'>[user] shoves you into [src] and shuts the door!</span>")
|
||||
close_machine(target)
|
||||
add_fingerprint(user)
|
||||
|
||||
/obj/machinery/suit_storage_unit/proc/cook()
|
||||
var/mob/living/mob_occupant = occupant
|
||||
if(uv_cycles)
|
||||
uv_cycles--
|
||||
uv = TRUE
|
||||
locked = TRUE
|
||||
update_icon()
|
||||
if(occupant)
|
||||
if(uv_super)
|
||||
mob_occupant.adjustFireLoss(rand(20, 36))
|
||||
else
|
||||
mob_occupant.adjustFireLoss(rand(10, 16))
|
||||
mob_occupant.emote("scream")
|
||||
addtimer(CALLBACK(src, .proc/cook), 50)
|
||||
else
|
||||
uv_cycles = initial(uv_cycles)
|
||||
uv = FALSE
|
||||
locked = FALSE
|
||||
if(uv_super)
|
||||
visible_message("<span class='warning'>[src]'s door creaks open with a loud whining noise. A cloud of foul black smoke escapes from its chamber.</span>")
|
||||
playsound(src, 'sound/machines/airlock_alien_prying.ogg', 50, 1)
|
||||
helmet = null
|
||||
qdel(helmet)
|
||||
suit = null
|
||||
qdel(suit) // Delete everything but the occupant.
|
||||
mask = null
|
||||
qdel(mask)
|
||||
storage = null
|
||||
qdel(storage)
|
||||
// The wires get damaged too.
|
||||
wires.cut_all()
|
||||
else
|
||||
if(!occupant)
|
||||
visible_message("<span class='notice'>[src]'s door slides open. The glowing yellow lights dim to a gentle green.</span>")
|
||||
else
|
||||
visible_message("<span class='warning'>[src]'s door slides open, barraging you with the nauseating smell of charred flesh.</span>")
|
||||
mob_occupant.radiation = 0
|
||||
playsound(src, 'sound/machines/airlockclose.ogg', 25, 1)
|
||||
var/list/things_to_clear = list() //Done this way since using GetAllContents on the SSU itself would include circuitry and such.
|
||||
if(suit)
|
||||
things_to_clear += suit
|
||||
things_to_clear += suit.GetAllContents()
|
||||
if(helmet)
|
||||
things_to_clear += helmet
|
||||
things_to_clear += helmet.GetAllContents()
|
||||
if(mask)
|
||||
things_to_clear += mask
|
||||
things_to_clear += mask.GetAllContents()
|
||||
if(storage)
|
||||
things_to_clear += storage
|
||||
things_to_clear += storage.GetAllContents()
|
||||
if(occupant)
|
||||
things_to_clear += occupant
|
||||
things_to_clear += occupant.GetAllContents()
|
||||
for(var/atom/movable/AM in things_to_clear) //Scorches away blood and forensic evidence, although the SSU itself is unaffected
|
||||
SEND_SIGNAL(AM, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRONG)
|
||||
AM.clean_blood()
|
||||
AM.fingerprints = list()
|
||||
var/datum/component/radioactive/contamination = AM.GetComponent(/datum/component/radioactive)
|
||||
if(contamination)
|
||||
qdel(contamination)
|
||||
open_machine(FALSE)
|
||||
if(occupant)
|
||||
dump_contents()
|
||||
|
||||
/obj/machinery/suit_storage_unit/proc/shock(mob/user, prb)
|
||||
if(!prob(prb))
|
||||
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
if(electrocute_mob(user, src, src, 1, TRUE))
|
||||
return 1
|
||||
|
||||
/obj/machinery/suit_storage_unit/relaymove(mob/user)
|
||||
if(locked)
|
||||
if(message_cooldown <= world.time)
|
||||
message_cooldown = world.time + 50
|
||||
to_chat(user, "<span class='warning'>[src]'s door won't budge!</span>")
|
||||
return
|
||||
open_machine()
|
||||
dump_contents()
|
||||
|
||||
/obj/machinery/suit_storage_unit/container_resist(mob/living/user)
|
||||
if(!locked)
|
||||
open_machine()
|
||||
dump_contents()
|
||||
return
|
||||
user.changeNext_move(CLICK_CD_BREAKOUT)
|
||||
user.last_special = world.time + CLICK_CD_BREAKOUT
|
||||
user.visible_message("<span class='notice'>You see [user] kicking against the doors of [src]!</span>", \
|
||||
"<span class='notice'>You start kicking against the doors... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
|
||||
"<span class='italics'>You hear a thump from [src].</span>")
|
||||
if(do_after(user,(breakout_time), target = src))
|
||||
if(!user || user.stat != CONSCIOUS || user.loc != src )
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user] successfully broke out of [src]!</span>", \
|
||||
"<span class='notice'>You successfully break out of [src]!</span>")
|
||||
open_machine()
|
||||
dump_contents()
|
||||
|
||||
add_fingerprint(user)
|
||||
if(locked)
|
||||
visible_message("<span class='notice'>You see [user] kicking against the doors of [src]!</span>", \
|
||||
"<span class='notice'>You start kicking against the doors...</span>")
|
||||
addtimer(CALLBACK(src, .proc/resist_open, user), 300)
|
||||
else
|
||||
open_machine()
|
||||
dump_contents()
|
||||
|
||||
/obj/machinery/suit_storage_unit/proc/resist_open(mob/user)
|
||||
if(!state_open && occupant && (user in src) && user.stat == 0) // Check they're still here.
|
||||
visible_message("<span class='notice'>You see [user] burst out of [src]!</span>", \
|
||||
"<span class='notice'>You escape the cramped confines of [src]!</span>")
|
||||
open_machine()
|
||||
|
||||
/obj/machinery/suit_storage_unit/attackby(obj/item/I, mob/user, params)
|
||||
if(state_open && is_operational())
|
||||
if(istype(I, /obj/item/clothing/head/mob_holder))
|
||||
to_chat(user, "<span class='warning'>You can't quite fit that in while you hold it!</span>")
|
||||
return
|
||||
if(istype(I, /obj/item/clothing/suit))
|
||||
if(suit)
|
||||
to_chat(user, "<span class='warning'>The unit already contains a suit!.</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
suit = I
|
||||
else if(istype(I, /obj/item/clothing/head))
|
||||
if(helmet)
|
||||
to_chat(user, "<span class='warning'>The unit already contains a helmet!</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
helmet = I
|
||||
else if(istype(I, /obj/item/clothing/mask))
|
||||
if(mask)
|
||||
to_chat(user, "<span class='warning'>The unit already contains a mask!</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
mask = I
|
||||
else
|
||||
if(storage)
|
||||
to_chat(user, "<span class='warning'>The auxiliary storage compartment is full!</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
storage = I
|
||||
|
||||
visible_message("<span class='notice'>[user] inserts [I] into [src]</span>", "<span class='notice'>You load [I] into [src].</span>")
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(panel_open && is_wire_tool(I))
|
||||
wires.interact(user)
|
||||
return
|
||||
if(!state_open)
|
||||
if(default_deconstruction_screwdriver(user, "panel", "close", I))
|
||||
return
|
||||
if(default_pry_open(I))
|
||||
dump_contents()
|
||||
return
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/suit_storage_unit/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "suit_storage_unit", name, 400, 305, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/suit_storage_unit/ui_data()
|
||||
var/list/data = list()
|
||||
data["locked"] = locked
|
||||
data["open"] = state_open
|
||||
data["safeties"] = safeties
|
||||
data["uv_active"] = uv
|
||||
data["uv_super"] = uv_super
|
||||
if(helmet)
|
||||
data["helmet"] = helmet.name
|
||||
else
|
||||
data["helmet"] = null
|
||||
if(suit)
|
||||
data["suit"] = suit.name
|
||||
else
|
||||
data["suit"] = null
|
||||
if(mask)
|
||||
data["mask"] = mask.name
|
||||
else
|
||||
data["mask"] = null
|
||||
if(storage)
|
||||
data["storage"] = storage.name
|
||||
else
|
||||
data["storage"] = null
|
||||
if(occupant)
|
||||
data["occupied"] = TRUE
|
||||
else
|
||||
data["occupied"] = FALSE
|
||||
return data
|
||||
|
||||
/obj/machinery/suit_storage_unit/ui_act(action, params)
|
||||
if(..() || uv)
|
||||
return
|
||||
switch(action)
|
||||
if("door")
|
||||
if(state_open)
|
||||
close_machine()
|
||||
else
|
||||
open_machine(0)
|
||||
if(occupant)
|
||||
dump_contents() // Dump out contents if someone is in there.
|
||||
. = TRUE
|
||||
if("lock")
|
||||
if(state_open)
|
||||
return
|
||||
locked = !locked
|
||||
. = TRUE
|
||||
if("uv")
|
||||
if(occupant && safeties)
|
||||
return
|
||||
else if(!helmet && !mask && !suit && !storage && !occupant)
|
||||
return
|
||||
else
|
||||
if(occupant)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
to_chat(mob_occupant, "<span class='userdanger'>[src]'s confines grow warm, then hot, then scorching. You're being burned [!mob_occupant.stat ? "alive" : "away"]!</span>")
|
||||
cook()
|
||||
. = TRUE
|
||||
if("dispense")
|
||||
if(!state_open)
|
||||
return
|
||||
|
||||
var/static/list/valid_items = list("helmet", "suit", "mask", "storage")
|
||||
var/item_name = params["item"]
|
||||
if(item_name in valid_items)
|
||||
var/obj/item/I = vars[item_name]
|
||||
vars[item_name] = null
|
||||
if(I)
|
||||
I.forceMove(loc)
|
||||
. = TRUE
|
||||
update_icon()
|
||||
// SUIT STORAGE UNIT /////////////////
|
||||
/obj/machinery/suit_storage_unit
|
||||
name = "suit storage unit"
|
||||
desc = "An industrial unit made to hold and decontaminate irradiated equipment. It comes with a built-in UV cauterization mechanism. A small warning label advises that organic matter should not be placed into the unit."
|
||||
icon = 'icons/obj/machines/suit_storage.dmi'
|
||||
icon_state = "close"
|
||||
density = TRUE
|
||||
max_integrity = 250
|
||||
|
||||
var/obj/item/clothing/suit/space/suit = null
|
||||
var/obj/item/clothing/head/helmet/space/helmet = null
|
||||
var/obj/item/clothing/mask/mask = null
|
||||
var/obj/item/storage = null
|
||||
|
||||
var/suit_type = null
|
||||
var/helmet_type = null
|
||||
var/mask_type = null
|
||||
var/storage_type = null
|
||||
|
||||
state_open = FALSE
|
||||
var/locked = FALSE
|
||||
panel_open = FALSE
|
||||
var/safeties = TRUE
|
||||
|
||||
var/uv = FALSE
|
||||
var/uv_super = FALSE
|
||||
var/uv_cycles = 6
|
||||
var/message_cooldown
|
||||
var/breakout_time = 300
|
||||
|
||||
/obj/machinery/suit_storage_unit/standard_unit
|
||||
suit_type = /obj/item/clothing/suit/space/eva
|
||||
helmet_type = /obj/item/clothing/head/helmet/space/eva
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
|
||||
/obj/machinery/suit_storage_unit/captain
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/captain
|
||||
mask_type = /obj/item/clothing/mask/gas/sechailer
|
||||
storage_type = /obj/item/tank/jetpack/oxygen/captain
|
||||
|
||||
/obj/machinery/suit_storage_unit/engine
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/engine
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type= /obj/item/clothing/shoes/magboots
|
||||
|
||||
/obj/machinery/suit_storage_unit/ce
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/engine/elite
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type= /obj/item/clothing/shoes/magboots/advance
|
||||
|
||||
/obj/machinery/suit_storage_unit/security
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/security
|
||||
mask_type = /obj/item/clothing/mask/gas/sechailer
|
||||
storage_type = /obj/item/tank/jetpack/oxygen/security
|
||||
|
||||
/obj/machinery/suit_storage_unit/hos
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/security/hos
|
||||
mask_type = /obj/item/clothing/mask/gas/sechailer
|
||||
storage_type = /obj/item/tank/internals/oxygen
|
||||
|
||||
/obj/machinery/suit_storage_unit/atmos
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/engine/atmos
|
||||
mask_type = /obj/item/clothing/mask/gas
|
||||
storage_type = /obj/item/watertank/atmos
|
||||
|
||||
/obj/machinery/suit_storage_unit/mining
|
||||
suit_type = /obj/item/clothing/suit/hooded/explorer/standard
|
||||
mask_type = /obj/item/clothing/mask/gas/explorer
|
||||
|
||||
/obj/machinery/suit_storage_unit/mining/eva
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/mining
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
|
||||
/obj/machinery/suit_storage_unit/cmo
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/medical
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
|
||||
/obj/machinery/suit_storage_unit/rd
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/rd
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
|
||||
/obj/machinery/suit_storage_unit/syndicate
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/syndi
|
||||
mask_type = /obj/item/clothing/mask/gas/syndicate
|
||||
storage_type = /obj/item/tank/jetpack/oxygen/harness
|
||||
|
||||
/obj/machinery/suit_storage_unit/ert/command
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/ert
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type = /obj/item/tank/internals/emergency_oxygen/double
|
||||
|
||||
/obj/machinery/suit_storage_unit/ert/security
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/ert/sec
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type = /obj/item/tank/internals/emergency_oxygen/double
|
||||
|
||||
/obj/machinery/suit_storage_unit/ert/engineer
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/ert/engi
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type = /obj/item/tank/internals/emergency_oxygen/double
|
||||
|
||||
/obj/machinery/suit_storage_unit/ert/medical
|
||||
suit_type = /obj/item/clothing/suit/space/hardsuit/ert/med
|
||||
mask_type = /obj/item/clothing/mask/breath
|
||||
storage_type = /obj/item/tank/internals/emergency_oxygen/double
|
||||
|
||||
/obj/machinery/suit_storage_unit/radsuit
|
||||
name = "radiation suit storage unit"
|
||||
suit_type = /obj/item/clothing/suit/radiation
|
||||
helmet_type = /obj/item/clothing/head/radiation
|
||||
storage_type = /obj/item/geiger_counter
|
||||
|
||||
/obj/machinery/suit_storage_unit/open
|
||||
state_open = TRUE
|
||||
density = FALSE
|
||||
|
||||
/obj/machinery/suit_storage_unit/Initialize()
|
||||
. = ..()
|
||||
wires = new /datum/wires/suit_storage_unit(src)
|
||||
if(suit_type)
|
||||
suit = new suit_type(src)
|
||||
if(helmet_type)
|
||||
helmet = new helmet_type(src)
|
||||
if(mask_type)
|
||||
mask = new mask_type(src)
|
||||
if(storage_type)
|
||||
storage = new storage_type(src)
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/suit_storage_unit/Destroy()
|
||||
QDEL_NULL(suit)
|
||||
QDEL_NULL(helmet)
|
||||
QDEL_NULL(mask)
|
||||
QDEL_NULL(storage)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/suit_storage_unit/update_icon()
|
||||
cut_overlays()
|
||||
|
||||
if(uv)
|
||||
if(uv_super)
|
||||
add_overlay("super")
|
||||
else if(occupant)
|
||||
add_overlay("uvhuman")
|
||||
else
|
||||
add_overlay("uv")
|
||||
else if(state_open)
|
||||
if(stat & BROKEN)
|
||||
add_overlay("broken")
|
||||
else
|
||||
add_overlay("open")
|
||||
if(suit)
|
||||
add_overlay("suit")
|
||||
if(helmet)
|
||||
add_overlay("helm")
|
||||
if(storage)
|
||||
add_overlay("storage")
|
||||
else if(occupant)
|
||||
add_overlay("human")
|
||||
|
||||
/obj/machinery/suit_storage_unit/power_change()
|
||||
..()
|
||||
if(!is_operational() && state_open)
|
||||
open_machine()
|
||||
dump_contents()
|
||||
update_icon()
|
||||
|
||||
/obj/machinery/suit_storage_unit/proc/dump_contents()
|
||||
dropContents()
|
||||
helmet = null
|
||||
suit = null
|
||||
mask = null
|
||||
storage = null
|
||||
occupant = null
|
||||
|
||||
/obj/machinery/suit_storage_unit/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
open_machine()
|
||||
dump_contents()
|
||||
new /obj/item/stack/sheet/metal (loc, 2)
|
||||
qdel(src)
|
||||
|
||||
/obj/machinery/suit_storage_unit/MouseDrop_T(atom/A, mob/user)
|
||||
if(user.stat || user.lying || !Adjacent(user) || !Adjacent(A) || !isliving(A))
|
||||
return
|
||||
var/mob/living/target = A
|
||||
if(!state_open)
|
||||
to_chat(user, "<span class='warning'>The unit's doors are shut!</span>")
|
||||
return
|
||||
if(!is_operational())
|
||||
to_chat(user, "<span class='warning'>The unit is not operational!</span>")
|
||||
return
|
||||
if(occupant || helmet || suit || storage)
|
||||
to_chat(user, "<span class='warning'>It's too cluttered inside to fit in!</span>")
|
||||
return
|
||||
|
||||
if(target == user)
|
||||
user.visible_message("<span class='warning'>[user] starts squeezing into [src]!</span>", "<span class='notice'>You start working your way into [src]...</span>")
|
||||
else
|
||||
target.visible_message("<span class='warning'>[user] starts shoving [target] into [src]!</span>", "<span class='userdanger'>[user] starts shoving you into [src]!</span>")
|
||||
|
||||
if(do_mob(user, target, 30))
|
||||
if(occupant || helmet || suit || storage)
|
||||
return
|
||||
if(target == user)
|
||||
user.visible_message("<span class='warning'>[user] slips into [src] and closes the door behind [user.p_them()]!</span>", "<span class=notice'>You slip into [src]'s cramped space and shut its door.</span>")
|
||||
else
|
||||
target.visible_message("<span class='warning'>[user] pushes [target] into [src] and shuts its door!<span>", "<span class='userdanger'>[user] shoves you into [src] and shuts the door!</span>")
|
||||
close_machine(target)
|
||||
add_fingerprint(user)
|
||||
|
||||
/obj/machinery/suit_storage_unit/proc/cook()
|
||||
var/mob/living/mob_occupant = occupant
|
||||
if(uv_cycles)
|
||||
uv_cycles--
|
||||
uv = TRUE
|
||||
locked = TRUE
|
||||
update_icon()
|
||||
if(occupant)
|
||||
if(uv_super)
|
||||
mob_occupant.adjustFireLoss(rand(20, 36))
|
||||
else
|
||||
mob_occupant.adjustFireLoss(rand(10, 16))
|
||||
mob_occupant.emote("scream")
|
||||
addtimer(CALLBACK(src, .proc/cook), 50)
|
||||
else
|
||||
uv_cycles = initial(uv_cycles)
|
||||
uv = FALSE
|
||||
locked = FALSE
|
||||
if(uv_super)
|
||||
visible_message("<span class='warning'>[src]'s door creaks open with a loud whining noise. A cloud of foul black smoke escapes from its chamber.</span>")
|
||||
playsound(src, 'sound/machines/airlock_alien_prying.ogg', 50, 1)
|
||||
helmet = null
|
||||
qdel(helmet)
|
||||
suit = null
|
||||
qdel(suit) // Delete everything but the occupant.
|
||||
mask = null
|
||||
qdel(mask)
|
||||
storage = null
|
||||
qdel(storage)
|
||||
// The wires get damaged too.
|
||||
wires.cut_all()
|
||||
else
|
||||
if(!occupant)
|
||||
visible_message("<span class='notice'>[src]'s door slides open. The glowing yellow lights dim to a gentle green.</span>")
|
||||
else
|
||||
visible_message("<span class='warning'>[src]'s door slides open, barraging you with the nauseating smell of charred flesh.</span>")
|
||||
mob_occupant.radiation = 0
|
||||
playsound(src, 'sound/machines/airlockclose.ogg', 25, 1)
|
||||
var/list/things_to_clear = list() //Done this way since using GetAllContents on the SSU itself would include circuitry and such.
|
||||
if(suit)
|
||||
things_to_clear += suit
|
||||
things_to_clear += suit.GetAllContents()
|
||||
if(helmet)
|
||||
things_to_clear += helmet
|
||||
things_to_clear += helmet.GetAllContents()
|
||||
if(mask)
|
||||
things_to_clear += mask
|
||||
things_to_clear += mask.GetAllContents()
|
||||
if(storage)
|
||||
things_to_clear += storage
|
||||
things_to_clear += storage.GetAllContents()
|
||||
if(occupant)
|
||||
things_to_clear += occupant
|
||||
things_to_clear += occupant.GetAllContents()
|
||||
for(var/atom/movable/AM in things_to_clear) //Scorches away blood and forensic evidence, although the SSU itself is unaffected
|
||||
SEND_SIGNAL(AM, COMSIG_COMPONENT_CLEAN_ACT, CLEAN_STRONG)
|
||||
AM.clean_blood()
|
||||
AM.fingerprints = list()
|
||||
var/datum/component/radioactive/contamination = AM.GetComponent(/datum/component/radioactive)
|
||||
if(contamination)
|
||||
qdel(contamination)
|
||||
open_machine(FALSE)
|
||||
if(occupant)
|
||||
dump_contents()
|
||||
|
||||
/obj/machinery/suit_storage_unit/proc/shock(mob/user, prb)
|
||||
if(!prob(prb))
|
||||
var/datum/effect_system/spark_spread/s = new /datum/effect_system/spark_spread
|
||||
s.set_up(5, 1, src)
|
||||
s.start()
|
||||
if(electrocute_mob(user, src, src, 1, TRUE))
|
||||
return 1
|
||||
|
||||
/obj/machinery/suit_storage_unit/relaymove(mob/user)
|
||||
if(locked)
|
||||
if(message_cooldown <= world.time)
|
||||
message_cooldown = world.time + 50
|
||||
to_chat(user, "<span class='warning'>[src]'s door won't budge!</span>")
|
||||
return
|
||||
open_machine()
|
||||
dump_contents()
|
||||
|
||||
/obj/machinery/suit_storage_unit/container_resist(mob/living/user)
|
||||
if(!locked)
|
||||
open_machine()
|
||||
dump_contents()
|
||||
return
|
||||
user.changeNext_move(CLICK_CD_BREAKOUT)
|
||||
user.last_special = world.time + CLICK_CD_BREAKOUT
|
||||
user.visible_message("<span class='notice'>You see [user] kicking against the doors of [src]!</span>", \
|
||||
"<span class='notice'>You start kicking against the doors... (this will take about [DisplayTimeText(breakout_time)].)</span>", \
|
||||
"<span class='italics'>You hear a thump from [src].</span>")
|
||||
if(do_after(user,(breakout_time), target = src))
|
||||
if(!user || user.stat != CONSCIOUS || user.loc != src )
|
||||
return
|
||||
user.visible_message("<span class='warning'>[user] successfully broke out of [src]!</span>", \
|
||||
"<span class='notice'>You successfully break out of [src]!</span>")
|
||||
open_machine()
|
||||
dump_contents()
|
||||
|
||||
add_fingerprint(user)
|
||||
if(locked)
|
||||
visible_message("<span class='notice'>You see [user] kicking against the doors of [src]!</span>", \
|
||||
"<span class='notice'>You start kicking against the doors...</span>")
|
||||
addtimer(CALLBACK(src, .proc/resist_open, user), 300)
|
||||
else
|
||||
open_machine()
|
||||
dump_contents()
|
||||
|
||||
/obj/machinery/suit_storage_unit/proc/resist_open(mob/user)
|
||||
if(!state_open && occupant && (user in src) && user.stat == 0) // Check they're still here.
|
||||
visible_message("<span class='notice'>You see [user] burst out of [src]!</span>", \
|
||||
"<span class='notice'>You escape the cramped confines of [src]!</span>")
|
||||
open_machine()
|
||||
|
||||
/obj/machinery/suit_storage_unit/attackby(obj/item/I, mob/user, params)
|
||||
if(state_open && is_operational())
|
||||
if(istype(I, /obj/item/clothing/head/mob_holder))
|
||||
to_chat(user, "<span class='warning'>You can't quite fit that in while you hold it!</span>")
|
||||
return
|
||||
if(istype(I, /obj/item/clothing/suit))
|
||||
if(suit)
|
||||
to_chat(user, "<span class='warning'>The unit already contains a suit!.</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
suit = I
|
||||
else if(istype(I, /obj/item/clothing/head))
|
||||
if(helmet)
|
||||
to_chat(user, "<span class='warning'>The unit already contains a helmet!</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
helmet = I
|
||||
else if(istype(I, /obj/item/clothing/mask))
|
||||
if(mask)
|
||||
to_chat(user, "<span class='warning'>The unit already contains a mask!</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
mask = I
|
||||
else
|
||||
if(storage)
|
||||
to_chat(user, "<span class='warning'>The auxiliary storage compartment is full!</span>")
|
||||
return
|
||||
if(!user.transferItemToLoc(I, src))
|
||||
return
|
||||
storage = I
|
||||
|
||||
visible_message("<span class='notice'>[user] inserts [I] into [src]</span>", "<span class='notice'>You load [I] into [src].</span>")
|
||||
update_icon()
|
||||
return
|
||||
|
||||
if(panel_open && is_wire_tool(I))
|
||||
wires.interact(user)
|
||||
return
|
||||
if(!state_open)
|
||||
if(default_deconstruction_screwdriver(user, "panel", "close", I))
|
||||
return
|
||||
if(default_pry_open(I))
|
||||
dump_contents()
|
||||
return
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/machinery/suit_storage_unit/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
|
||||
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.notcontained_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "suit_storage_unit", name, 400, 305, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/machinery/suit_storage_unit/ui_data()
|
||||
var/list/data = list()
|
||||
data["locked"] = locked
|
||||
data["open"] = state_open
|
||||
data["safeties"] = safeties
|
||||
data["uv_active"] = uv
|
||||
data["uv_super"] = uv_super
|
||||
if(helmet)
|
||||
data["helmet"] = helmet.name
|
||||
else
|
||||
data["helmet"] = null
|
||||
if(suit)
|
||||
data["suit"] = suit.name
|
||||
else
|
||||
data["suit"] = null
|
||||
if(mask)
|
||||
data["mask"] = mask.name
|
||||
else
|
||||
data["mask"] = null
|
||||
if(storage)
|
||||
data["storage"] = storage.name
|
||||
else
|
||||
data["storage"] = null
|
||||
if(occupant)
|
||||
data["occupied"] = TRUE
|
||||
else
|
||||
data["occupied"] = FALSE
|
||||
return data
|
||||
|
||||
/obj/machinery/suit_storage_unit/ui_act(action, params)
|
||||
if(..() || uv)
|
||||
return
|
||||
switch(action)
|
||||
if("door")
|
||||
if(state_open)
|
||||
close_machine()
|
||||
else
|
||||
open_machine(0)
|
||||
if(occupant)
|
||||
dump_contents() // Dump out contents if someone is in there.
|
||||
. = TRUE
|
||||
if("lock")
|
||||
if(state_open)
|
||||
return
|
||||
locked = !locked
|
||||
. = TRUE
|
||||
if("uv")
|
||||
if(occupant && safeties)
|
||||
return
|
||||
else if(!helmet && !mask && !suit && !storage && !occupant)
|
||||
return
|
||||
else
|
||||
if(occupant)
|
||||
var/mob/living/mob_occupant = occupant
|
||||
to_chat(mob_occupant, "<span class='userdanger'>[src]'s confines grow warm, then hot, then scorching. You're being burned [!mob_occupant.stat ? "alive" : "away"]!</span>")
|
||||
cook()
|
||||
. = TRUE
|
||||
if("dispense")
|
||||
if(!state_open)
|
||||
return
|
||||
|
||||
var/static/list/valid_items = list("helmet", "suit", "mask", "storage")
|
||||
var/item_name = params["item"]
|
||||
if(item_name in valid_items)
|
||||
var/obj/item/I = vars[item_name]
|
||||
vars[item_name] = null
|
||||
if(I)
|
||||
I.forceMove(loc)
|
||||
. = TRUE
|
||||
update_icon()
|
||||
|
||||
@@ -54,7 +54,7 @@
|
||||
to_chat(user, "<span class='warning'>[src] was shaken recently, it needs time to settle.</span>")
|
||||
return
|
||||
|
||||
user.visible_message("<span class='notice'>[user] starts shaking [src].</span>", "<span class='notice'>You start shaking [src].</span>", "<span class='italics'>You hear shaking and sloshing.</span>")
|
||||
user.visible_message("<span class='notice'>[user] starts shaking [src].</span>", "<span class='notice'>You start shaking [src].</span>", "<span class='hear'>You hear shaking and sloshing.</span>")
|
||||
|
||||
shaking = TRUE
|
||||
|
||||
@@ -95,16 +95,47 @@
|
||||
// except it actually ASKS THE DEAD (wooooo)
|
||||
|
||||
/obj/item/toy/eightball/haunted
|
||||
shake_time = 150
|
||||
cooldown_time = 1800
|
||||
shake_time = 30 SECONDS
|
||||
cooldown_time = 3 MINUTES
|
||||
flags_1 = HEAR_1
|
||||
var/last_message
|
||||
var/selected_message
|
||||
var/list/votes
|
||||
//these kind of store the same thing but one is easier to work with.
|
||||
var/list/votes = list()
|
||||
var/list/voted = list()
|
||||
var/static/list/haunted_answers = list(
|
||||
"yes" = list(
|
||||
"It is certain",
|
||||
"It is decidedly so",
|
||||
"Without a doubt",
|
||||
"Yes definitely",
|
||||
"You may rely on it",
|
||||
"As I see it, yes",
|
||||
"Most likely",
|
||||
"Outlook good",
|
||||
"Yes",
|
||||
"Signs point to yes"
|
||||
),
|
||||
"maybe" = list(
|
||||
"Reply hazy try again",
|
||||
"Ask again later",
|
||||
"Better not tell you now",
|
||||
"Cannot predict now",
|
||||
"Concentrate and ask again"
|
||||
),
|
||||
"no" = list(
|
||||
"Don't count on it",
|
||||
"My reply is no",
|
||||
"My sources say no",
|
||||
"Outlook not so good",
|
||||
"Very doubtful"
|
||||
)
|
||||
)
|
||||
|
||||
/obj/item/toy/eightball/haunted/Initialize(mapload)
|
||||
. = ..()
|
||||
votes = list()
|
||||
for (var/answer in haunted_answers)
|
||||
votes[answer] = 0
|
||||
GLOB.poi_list |= src
|
||||
|
||||
/obj/item/toy/eightball/haunted/Destroy()
|
||||
@@ -122,7 +153,7 @@
|
||||
interact(user)
|
||||
return ..()
|
||||
|
||||
/obj/item/toy/eightball/haunted/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, spans, message_mode, atom/movable/source)
|
||||
/obj/item/toy/eightball/haunted/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, spans, message_mode)
|
||||
. = ..()
|
||||
last_message = raw_message
|
||||
|
||||
@@ -137,38 +168,31 @@
|
||||
if(isobserver(usr))
|
||||
interact(usr)
|
||||
|
||||
/obj/item/toy/eightball/haunted/proc/get_vote_tallies()
|
||||
var/list/answers = list()
|
||||
for(var/ckey in votes)
|
||||
var/selected = votes[ckey]
|
||||
if(selected in answers)
|
||||
answers[selected]++
|
||||
else
|
||||
answers[selected] = 1
|
||||
|
||||
return answers
|
||||
|
||||
|
||||
/obj/item/toy/eightball/haunted/get_answer()
|
||||
if(!votes.len)
|
||||
return pick(possible_answers)
|
||||
var/top_amount = 0
|
||||
var/top_vote
|
||||
|
||||
var/list/tallied_votes = get_vote_tallies()
|
||||
for(var/vote in votes)
|
||||
var/amount_of_votes = length(votes[vote])
|
||||
if(amount_of_votes > top_amount)
|
||||
top_vote = vote
|
||||
top_amount = amount_of_votes
|
||||
//If one option actually has votes and there's a tie, pick between them 50/50
|
||||
else if(top_amount && amount_of_votes == top_amount && prob(50))
|
||||
top_vote = vote
|
||||
top_amount = amount_of_votes
|
||||
|
||||
// I miss python sorting, then I wouldn't have to muck about with
|
||||
// all this
|
||||
var/most_popular_answer
|
||||
var/most_amount = 0
|
||||
// yes, if there is a tie, there is an arbitary decision
|
||||
// but we never said the spirit world was fair
|
||||
for(var/A in tallied_votes)
|
||||
var/amount = tallied_votes[A]
|
||||
if(amount > most_amount)
|
||||
most_popular_answer = A
|
||||
if(isnull(top_vote))
|
||||
top_vote = pick(votes)
|
||||
|
||||
return most_popular_answer
|
||||
for(var/vote in votes)
|
||||
votes[vote] = 0
|
||||
|
||||
/obj/item/toy/eightball/haunted/ui_interact(mob/user, ui_key="main", datum/tgui/ui=null, force_open=0, datum/tgui/master_ui=null, datum/ui_state/state = GLOB.observer_state)
|
||||
voted.Cut()
|
||||
|
||||
return top_vote
|
||||
|
||||
/obj/item/toy/eightball/haunted/ui_interact(mob/user, ui_key="main", datum/tgui/ui=null, force_open=0, datum/tgui/master_ui=null, datum/ui_state/state = GLOB.always_state)
|
||||
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
@@ -179,21 +203,13 @@
|
||||
var/list/data = list()
|
||||
data["shaking"] = shaking
|
||||
data["question"] = selected_message
|
||||
var/list/tallied_votes = get_vote_tallies()
|
||||
|
||||
data["answers"] = list()
|
||||
|
||||
for(var/pa in possible_answers)
|
||||
for(var/pa in haunted_answers)
|
||||
var/list/L = list()
|
||||
L["answer"] = pa
|
||||
var/amount = 0
|
||||
if(pa in tallied_votes)
|
||||
amount = tallied_votes[pa]
|
||||
L["amount"] = amount
|
||||
var/selected = FALSE
|
||||
if(votes[user.ckey] == pa)
|
||||
selected = TRUE
|
||||
L["selected"] = selected
|
||||
L["amount"] = votes[pa]
|
||||
L["selected"] = voted[user.ckey]
|
||||
|
||||
data["answers"] += list(L)
|
||||
return data
|
||||
@@ -206,8 +222,11 @@
|
||||
switch(action)
|
||||
if("vote")
|
||||
var/selected_answer = params["answer"]
|
||||
if(!(selected_answer in possible_answers))
|
||||
if(!(selected_answer in haunted_answers))
|
||||
return
|
||||
if(user.ckey in voted)
|
||||
return
|
||||
else
|
||||
votes[user.ckey] = selected_answer
|
||||
. = TRUE
|
||||
votes[selected_answer] += 1
|
||||
voted[user.ckey] = selected_answer
|
||||
. = TRUE
|
||||
Reference in New Issue
Block a user