Autolathe Menu:
"
dat += materials_printout()
@@ -380,4 +386,4 @@
//Called when the object is constructed by an autolathe
//Has a reference to the autolathe so you can do !!FUN!! things with hacked lathes
/obj/item/proc/autolathe_crafted(obj/machinery/autolathe/A)
- return
\ No newline at end of file
+ return
diff --git a/code/game/machinery/bank_machine.dm b/code/game/machinery/bank_machine.dm
index 0b9ed6bb3f..41867a8520 100644
--- a/code/game/machinery/bank_machine.dm
+++ b/code/game/machinery/bank_machine.dm
@@ -46,34 +46,37 @@
new /obj/item/stack/spacecash/c200(drop_location()) // will autostack
playsound(src.loc, 'sound/items/poster_being_created.ogg', 100, 1)
SSshuttle.points -= 200
- if(next_warning < world.time && prob(15))
- var/area/A = get_area(loc)
- var/message = "Unauthorized credit withdrawal underway in [A.map_name]!!"
- radio.talk_into(src, message, radio_channel)
- next_warning = world.time + minimum_time_between_warnings
+ if(next_warning < world.time && prob(15))
+ var/area/A = get_area(loc)
+ var/message = "Unauthorized credit withdrawal underway in [A.map_name]!!"
+ radio.talk_into(src, message, radio_channel)
+ next_warning = world.time + minimum_time_between_warnings
-/obj/machinery/computer/bank_machine/ui_interact(mob/user)
- . = ..()
- var/dat = "[station_name()] secure vault. Authorized personnel only.
"
- dat += "Current Balance: [SSshuttle.points] credits.
"
- if(!siphoning)
- dat += "
Siphon Credits"
- else
- dat += "
Halt Credit Siphon"
+/obj/machinery/computer/bank_machine/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, "bank_machine", name, 320, 165, master_ui, state)
+ ui.open()
- dat += "
Close"
+/obj/machinery/computer/bank_machine/ui_data(mob/user)
+ var/list/data = list()
+ data["current_balance"] = SSshuttle.points
+ data["siphoning"] = siphoning
+ data["station_name"] = station_name()
- var/datum/browser/popup = new(user, "computer", "Bank Vault", 300, 200)
- popup.set_content("
[dat]")
- popup.set_title_image(usr.browse_rsc_icon(src.icon, src.icon_state))
- popup.open()
+ return data
-/obj/machinery/computer/bank_machine/Topic(href, href_list)
+/obj/machinery/computer/bank_machine/ui_act(action, params)
if(..())
return
- if(href_list["siphon"])
- say("Siphon of station credits has begun!")
- siphoning = TRUE
- if(href_list["halt"])
- say("Station credit withdrawal halted.")
- siphoning = FALSE
+
+ switch(action)
+ if("siphon")
+ say("Siphon of station credits has begun!")
+ siphoning = TRUE
+ . = TRUE
+ if("halt")
+ say("Station credit withdrawal halted.")
+ siphoning = FALSE
+ . = TRUE
diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm
index bef5effb54..22c1ff811c 100644
--- a/code/game/machinery/camera/camera.dm
+++ b/code/game/machinery/camera/camera.dm
@@ -319,7 +319,8 @@
if(status)
change_msg = "reactivates"
triggerCameraAlarm()
- addtimer(CALLBACK(src, .proc/cancelCameraAlarm), 100)
+ if(!QDELETED(src)) //We'll be doing it anyway in destroy
+ addtimer(CALLBACK(src, .proc/cancelCameraAlarm), 100)
if(displaymessage)
if(user)
visible_message("
[user] [change_msg] [src]!")
diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm
index a982411692..991577e123 100644
--- a/code/game/machinery/cell_charger.dm
+++ b/code/game/machinery/cell_charger.dm
@@ -28,6 +28,8 @@
. += "There's [charging ? "a" : "no"] cell in the charger."
if(charging)
. += "Current charge: [round(charging.percent(), 1)]%."
+ if(in_range(user, src) || isobserver(user))
+ . += "
The status display reads: Charge rate at [charge_rate]J per cycle."
/obj/machinery/cell_charger/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/stock_parts/cell) && !panel_open)
@@ -44,7 +46,7 @@
var/area/a = loc.loc // Gets our locations location, like a dream within a dream
if(!isarea(a))
return
- if(a.power_equip == 0) // There's no APC in this area, don't try to cheat power!
+ if(!a.powered(EQUIP)) // There's no APC in this area, don't try to cheat power!
to_chat(user, "
[src] blinks red as you try to insert the cell!")
return
if(!user.transferItemToLoc(W,src))
diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm
index 413621d8b9..afb882598e 100644
--- a/code/game/machinery/cloning.dm
+++ b/code/game/machinery/cloning.dm
@@ -4,7 +4,7 @@
//Potential replacement for genetics revives or something I dunno (?)
#define CLONE_INITIAL_DAMAGE 150 //Clones in clonepods start with 150 cloneloss damage and 150 brainloss damage, thats just logical
-#define MINIMUM_HEAL_LEVEL 40
+#define MINIMUM_HEAL_LEVEL 20
#define SPEAK(message) radio.talk_into(src, message, radio_channel)
@@ -61,18 +61,15 @@
QDEL_LIST(unattached_flesh)
. = ..()
-/obj/machinery/clonepod/RefreshParts()
+/obj/machinery/clonepod/RefreshParts()
speed_coeff = 0
efficiency = 0
for(var/obj/item/stock_parts/scanning_module/S in component_parts)
efficiency += S.rating
for(var/obj/item/stock_parts/manipulator/P in component_parts)
- speed_coeff += P.rating
- heal_level = (efficiency * 15) + 10
- if(heal_level < MINIMUM_HEAL_LEVEL)
- heal_level = MINIMUM_HEAL_LEVEL
- if(heal_level > 100)
- heal_level = 100
+ speed_coeff += (P.rating / 2)
+ speed_coeff = max(1, speed_coeff)
+ heal_level = CLAMP((efficiency * 10) + 10, MINIMUM_HEAL_LEVEL, 100)
//The return of data disks?? Just for transferring between genetics machine/cloning machine.
//TO-DO: Make the genetics machine accept them.
@@ -102,8 +99,13 @@
/obj/machinery/clonepod/examine(mob/user)
. = ..()
var/mob/living/mob_occupant = occupant
+ . += "
The linking device can be scanned with a multitool."
if(mess)
. += "It's filled with blood and viscera. You swear you can see it moving..."
+ if(in_range(user, src) || isobserver(user))
+ . += "
The status display reads: Cloning speed at [speed_coeff*50]%.
Predicted amount of cellular damage: [100-heal_level]%."
+ if(efficiency > 5)
+ to_chat(user, "
Pod has been upgraded to support autoprocessing.")
if(is_operational() && mob_occupant)
if(mob_occupant.stat != DEAD)
. += "Current clone cycle is [round(get_completion())]% complete."
@@ -164,9 +166,7 @@
var/mob/living/carbon/human/H = new /mob/living/carbon/human(src)
H.hardset_dna(ui, se, H.real_name, null, mrace, features)
-
- if(prob(50 - efficiency*10)) //Chance to give a bad mutation.
- H.randmutb() //100% bad mutation. Can be cured with mutadone.
+ H.randmutb() //100% bad mutation. Can be cured with mutadone.
H.silent = 20 //Prevents an extreme edge case where clones could speak if they said something at exactly the right moment.
occupant = H
diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm
index 3c021d0bd1..7439fd1b8b 100644
--- a/code/game/machinery/computer/Operating.dm
+++ b/code/game/machinery/computer/Operating.dm
@@ -11,7 +11,6 @@
var/obj/structure/table/optable/table
var/list/advanced_surgeries = list()
var/datum/techweb/linked_techweb
- var/menu = MENU_OPERATION
light_color = LIGHT_COLOR_BLUE
/obj/machinery/computer/operating/Initialize()
@@ -54,8 +53,6 @@
var/list/data = list()
data["table"] = table
if(table)
- data["menu"] = menu
-
var/list/surgeries = list()
for(var/X in advanced_surgeries)
var/datum/surgery/S = X
@@ -64,9 +61,8 @@
surgery["desc"] = initial(S.desc)
surgeries += list(surgery)
data["surgeries"] = surgeries
-
- data["patient"] = list()
if(table.check_patient())
+ data["patient"] = list()
patient = table.patient
switch(patient.stat)
if(CONSCIOUS)
@@ -110,15 +106,14 @@
"alternative_step" = alternative_step,
"alt_chems_needed" = alt_chems_needed
))
+ else
+ data["patient"] = null
return data
/obj/machinery/computer/operating/ui_act(action, params)
if(..())
return
switch(action)
- if("change_menu")
- menu = text2num(params["menu"])
- . = TRUE
if("sync")
sync_surgeries()
. = TRUE
diff --git a/code/game/machinery/computer/apc_control.dm b/code/game/machinery/computer/apc_control.dm
index 8ddbd68c7b..6d22f9d6c8 100644
--- a/code/game/machinery/computer/apc_control.dm
+++ b/code/game/machinery/computer/apc_control.dm
@@ -198,7 +198,7 @@
/obj/machinery/computer/apc_control/proc/log_activity(log_text)
var/op_string = operator && !(obj_flags & EMAGGED) ? operator : "\[NULL OPERATOR\]"
- LAZYADD(logs, "([STATION_TIME_TIMESTAMP("hh:mm:ss")]) [op_string] [log_text]")
+ LAZYADD(logs, "([STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)]) [op_string] [log_text]")
/mob/proc/using_power_flow_console()
for(var/obj/machinery/computer/apc_control/A in range(1, src))
diff --git a/code/game/machinery/computer/atmos_control.dm b/code/game/machinery/computer/atmos_control.dm
index f9d2a3c103..d6ce850da8 100644
--- a/code/game/machinery/computer/atmos_control.dm
+++ b/code/game/machinery/computer/atmos_control.dm
@@ -91,6 +91,8 @@ GLOBAL_LIST_EMPTY(atmos_air_controllers)
icon_screen = "tank"
icon_keyboard = "atmos_key"
circuit = /obj/item/circuitboard/computer/atmos_control
+ ui_x = 400
+ ui_y = 925
var/frequency = FREQ_ATMOS_STORAGE
var/list/sensors = list(
@@ -125,7 +127,7 @@ GLOBAL_LIST_EMPTY(atmos_air_controllers)
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, "atmos_control", name, 400, 925, master_ui, state)
+ ui = new(user, src, ui_key, "atmos_control", name, ui_x, ui_y, master_ui, state)
ui.open()
/obj/machinery/computer/atmos_control/ui_data(mob/user)
@@ -161,6 +163,20 @@ GLOBAL_LIST_EMPTY(atmos_air_controllers)
frequency = new_frequency
radio_connection = SSradio.add_object(src, frequency, RADIO_ATMOSIA)
+//Incinerator sensor only
+/obj/machinery/computer/atmos_control/incinerator
+ name = "Incinerator Air Control"
+ sensors = list(ATMOS_GAS_MONITOR_SENSOR_INCINERATOR = "Incinerator Chamber")
+ ui_x = 400
+ ui_y = 300
+
+//Toxins mix sensor only
+/obj/machinery/computer/atmos_control/toxinsmix
+ name = "Toxins Mixing Air Control"
+ sensors = list(ATMOS_GAS_MONITOR_SENSOR_TOXINS_LAB = "Toxins Mixing Chamber")
+ ui_x = 400
+ ui_y = 300
+
/////////////////////////////////////////////////////////////
// LARGE TANK CONTROL
/////////////////////////////////////////////////////////////
@@ -174,6 +190,9 @@ GLOBAL_LIST_EMPTY(atmos_air_controllers)
var/list/input_info
var/list/output_info
+ ui_x = 500
+ ui_y = 315
+
/obj/machinery/computer/atmos_control/tank/oxygen_tank
name = "Oxygen Supply Control"
input_tag = ATMOS_GAS_MONITOR_INPUT_O2
@@ -216,12 +235,6 @@ GLOBAL_LIST_EMPTY(atmos_air_controllers)
output_tag = ATMOS_GAS_MONITOR_OUTPUT_CO2
sensors = list(ATMOS_GAS_MONITOR_SENSOR_CO2 = "Carbon Dioxide Tank")
-/obj/machinery/computer/atmos_control/tank/incinerator
- name = "Incinerator Air Control"
- input_tag = ATMOS_GAS_MONITOR_INPUT_INCINERATOR
- output_tag = ATMOS_GAS_MONITOR_OUTPUT_INCINERATOR
- sensors = list(ATMOS_GAS_MONITOR_SENSOR_INCINERATOR = "Incinerator Chamber")
-
// This hacky madness is the evidence of the fact that a lot of machines were never meant to be constructable, im so sorry you had to see this
/obj/machinery/computer/atmos_control/tank/proc/reconnect(mob/user)
var/list/IO = list()
@@ -235,7 +248,7 @@ GLOBAL_LIST_EMPTY(atmos_air_controllers)
IO |= text[1]
if(!IO.len)
to_chat(user, "No machinery detected.")
- var/S = input("Select the device set: ", "Selection", IO[1]) as anything in IO
+ var/S = input("Select the device set: ", "Selection", IO[1]) as anything in sortList(IO)
if(src)
src.input_tag = "[S]_in"
src.output_tag = "[S]_out"
@@ -256,7 +269,7 @@ GLOBAL_LIST_EMPTY(atmos_air_controllers)
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, "atmos_control", name, 500, 305, master_ui, state)
+ ui = new(user, src, ui_key, "atmos_control", name, ui_x, ui_y, master_ui, state)
ui.open()
/obj/machinery/computer/atmos_control/tank/ui_data(mob/user)
@@ -280,13 +293,19 @@ GLOBAL_LIST_EMPTY(atmos_air_controllers)
if("input")
signal.data += list("tag" = input_tag, "power_toggle" = TRUE)
. = TRUE
+ if("rate")
+ var/target = text2num(params["rate"])
+ if(!isnull(target))
+ target = CLAMP(target, 0, MAX_TRANSFER_RATE)
+ signal.data += list("tag" = input_tag, "set_volume_rate" = target)
+ . = TRUE
if("output")
signal.data += list("tag" = output_tag, "power_toggle" = TRUE)
. = TRUE
if("pressure")
- var/target = input("New target pressure:", name, output_info ? output_info["internal"] : 0) as num|null
- if(!isnull(target) && !..())
- target = CLAMP(target, 0, 50 * ONE_ATMOSPHERE)
+ var/target = text2num(params["pressure"])
+ if(!isnull(target))
+ target = CLAMP(target, 0, MAX_OUTPUT_PRESSURE)
signal.data += list("tag" = output_tag, "set_internal_pressure" = target)
. = TRUE
radio_connection.post_signal(src, signal, filter = RADIO_ATMOSIA)
diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm
index 90969bf4a1..4d21ae77b0 100644
--- a/code/game/machinery/computer/cloning.dm
+++ b/code/game/machinery/computer/cloning.dm
@@ -482,7 +482,7 @@
R.fields["ckey"] = mob_occupant.ckey
R.fields["name"] = mob_occupant.real_name
- R.fields["id"] = copytext(md5(mob_occupant.real_name), 2, 6)
+ R.fields["id"] = copytext_char(md5(mob_occupant.real_name), 2, 6)
R.fields["UE"] = dna.unique_enzymes
R.fields["UI"] = dna.uni_identity
R.fields["SE"] = dna.struc_enzymes
diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm
index 1bc8a82147..59574bc603 100755
--- a/code/game/machinery/computer/communications.dm
+++ b/code/game/machinery/computer/communications.dm
@@ -443,7 +443,7 @@
var/dat = ""
if(SSshuttle.emergency.mode == SHUTTLE_CALL)
var/timeleft = SSshuttle.emergency.timeLeft()
- dat += "Emergency shuttle\n
\nETA: [timeleft / 60 % 60]:[add_zero(num2text(timeleft % 60), 2)]"
+ dat += "Emergency shuttle\n
\nETA: [timeleft / 60 % 60]:[add_leading(num2text(timeleft % 60), 2, "0")]"
var/datum/browser/popup = new(user, "communications", "Communications Console", 400, 500)
diff --git a/code/game/machinery/computer/dna_console.dm b/code/game/machinery/computer/dna_console.dm
index 7330ae26e7..9cf988884f 100644
--- a/code/game/machinery/computer/dna_console.dm
+++ b/code/game/machinery/computer/dna_console.dm
@@ -274,13 +274,18 @@
var/max_line_len = 7*DNA_BLOCK_SIZE
if(viable_occupant)
temp_html += "1
"
- var/len = length(viable_occupant.dna.uni_identity)
- for(var/i=1, i<=len, i++)
- temp_html += "[copytext(viable_occupant.dna.uni_identity,i,i+1)]"
- if ((i % max_line_len) == 0)
+ var/char = ""
+ var/ui_text = viable_occupant.dna.uni_identity
+ var/len_byte = length(ui_text)
+ var/char_it = 0
+ for(var/byte_it = 1, byte_it <= len_byte, byte_it += length(char))
+ char_it++
+ char = ui_text[byte_it]
+ temp_html += "[char]"
+ if((char_it % max_line_len) == 0)
temp_html += "No launchpad located.
No power station linked.
"
- else if(!power_station.teleporter_hub)
- data += "No hub linked.
"
+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 += "