diff --git a/.travis.yml b/.travis.yml
index bfdb40e23b..432d409314 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -6,11 +6,9 @@ env:
BYOND_MAJOR="510"
BYOND_MINOR="1346"
MACRO_COUNT=986
- NODE_VERSION="4"
cache:
directories:
- - tgui/node_modules
- $HOME/BYOND-${BYOND_MAJOR}.${BYOND_MINOR}
addons:
@@ -21,13 +19,10 @@ addons:
- libstdc++6:i386
before_script:
- - cd tgui && npm install && cd ..
- chmod +x ./install-byond.sh
- ./install-byond.sh
install:
- - rm -rf ~/.nvm && git clone https://github.com/creationix/nvm.git ~/.nvm && (cd ~/.nvm && git checkout `git describe --abbrev=0 --tags`) && source ~/.nvm/nvm.sh && nvm install $NODE_VERSION
- - npm install -g gulp-cli
- pip install --user PyYaml -q
- pip install --user beautifulsoup4 -q
@@ -39,8 +34,6 @@ script:
- awk -f tools/indentation.awk **/*.dm
- md5sum -c - <<< "88490b460c26947f5ec1ab1bb9fa9f17 *html/changelogs/example.yml"
- (num=`grep -E '\\\\(red|blue|green|black|b|i[^mc])' **/*.dm | wc -l`; echo "$num escapes (expecting ${MACRO_COUNT} or less)"; [ $num -le ${MACRO_COUNT} ])
- - cd tgui && gulp
- - cd ..
- source $HOME/BYOND-${BYOND_MAJOR}.${BYOND_MINOR}/byond/bin/byondsetup
- python tools/TagMatcher/tag-matcher.py ../..
- echo "#define UNIT_TEST 1" > code/_unit_tests.dm
diff --git a/code/__defines/tgui.dm b/code/__defines/tgui.dm
deleted file mode 100644
index 5ba0096d1b..0000000000
--- a/code/__defines/tgui.dm
+++ /dev/null
@@ -1,4 +0,0 @@
-#define UI_INTERACTIVE 2 // Green/Interactive
-#define UI_UPDATE 1 // Orange/Updates Only
-#define UI_DISABLED 0 // Red/Disabled
-#define UI_CLOSE -1 // Closed
\ No newline at end of file
diff --git a/code/__defines/tick.dm b/code/__defines/tick.dm
deleted file mode 100644
index 71a63af628..0000000000
--- a/code/__defines/tick.dm
+++ /dev/null
@@ -1,5 +0,0 @@
-#define TICK_LIMIT_RUNNING 90
-#define TICK_LIMIT_TO_RUN 85
-
-#define TICK_CHECK ( world.tick_usage > TICK_LIMIT_RUNNING ? stoplag() : 0 )
-#define CHECK_TICK if(world.tick_usage > TICK_LIMIT_RUNNING) stoplag()
\ No newline at end of file
diff --git a/code/_compatibility/509/text.dm b/code/_compatibility/509/text.dm
index 7e17e82795..c22790ccb8 100644
--- a/code/_compatibility/509/text.dm
+++ b/code/_compatibility/509/text.dm
@@ -1,22 +1,6 @@
#if DM_VERSION < 510
-//Case Sensitive!
-/proc/text2listEx(text, delimiter="\n")
- var/delim_len = length(delimiter)
- if(delim_len < 1) return list(text)
- . = list()
- var/last_found = 1
- var/found
- do
- found = findtextEx(text, delimiter, last_found, 0)
- . += copytext(text, last_found, found)
- last_found = found + delim_len
- while(found)
-
/proc/replacetext(text, find, replacement)
return jointext(splittext(text, find), replacement)
-/proc/replacetextEx(text, find, replacement)
- return jointext(text2listEx(text, find), replacement)
-
#endif
\ No newline at end of file
diff --git a/code/_helpers/atom_movables.dm b/code/_helpers/atom_movables.dm
deleted file mode 100644
index 1dc8ba2749..0000000000
--- a/code/_helpers/atom_movables.dm
+++ /dev/null
@@ -1,28 +0,0 @@
-/proc/get_turf_pixel(atom/movable/AM)
- if(!istype(AM))
- return
-
- //Find AM's matrix so we can use it's X/Y pixel shifts
- var/matrix/M = matrix(AM.transform)
-
- var/pixel_x_offset = AM.pixel_x + M.get_x_shift()
- var/pixel_y_offset = AM.pixel_y + M.get_y_shift()
-
- //Irregular objects
- if(AM.bound_height != world.icon_size || AM.bound_width != world.icon_size)
- var/icon/AMicon = icon(AM.icon, AM.icon_state)
- pixel_x_offset += ((AMicon.Width()/world.icon_size)-1)*(world.icon_size*0.5)
- pixel_y_offset += ((AMicon.Height()/world.icon_size)-1)*(world.icon_size*0.5)
- qdel(AMicon)
-
- //DY and DX
- var/rough_x = round(round(pixel_x_offset,world.icon_size)/world.icon_size)
- var/rough_y = round(round(pixel_y_offset,world.icon_size)/world.icon_size)
-
- //Find coordinates
- var/turf/T = get_turf(AM) //use AM's turfs, as it's coords are the same as AM's AND AM's coords are lost if it is inside another atom
- var/final_x = T.x + rough_x
- var/final_y = T.y + rough_y
-
- if(final_x || final_y)
- return locate(final_x, final_y, T.z)
\ No newline at end of file
diff --git a/code/_helpers/lists.dm b/code/_helpers/lists.dm
index cd4f1d2f4c..d4e6710b35 100644
--- a/code/_helpers/lists.dm
+++ b/code/_helpers/lists.dm
@@ -323,30 +323,6 @@ proc/listclearnulls(list/list)
return (result + L.Copy(Li, 0))
return (result + R.Copy(Ri, 0))
-/proc/sortByVar(var/list/L, var/key)
- if(L.len < 2)
- return L
- var/middle = L.len / 2 + 1
- return mergeVaredLists(sortByVar(L.Copy(0, middle), key), sortByVar(L.Copy(middle), key), key)
-
-/proc/mergeVaredLists(var/list/L, var/list/R, var/key)
- var/Li=1
- var/Ri=1
- var/list/result = new()
- while(Li <= L.len && Ri <= R.len)
- var/datum/LO = L[Li]
- var/datum/RO = R[Ri]
- if(LO.vars[key] > RO.vars[key])
- // Works around list += list2 merging lists; it's not pretty but it works
- result += "temp item"
- result[result.len] = R[Ri++]
- else
- result += "temp item"
- result[result.len] = L[Li++]
-
- if(Li <= L.len)
- return (result + L.Copy(Li, 0))
- return (result + R.Copy(Ri, 0))
//Mergesort: any value in a list, preserves key=value structure
/proc/sortAssoc(var/list/L)
diff --git a/code/_helpers/logging.dm b/code/_helpers/logging.dm
index 9cf853f456..35618c9b66 100644
--- a/code/_helpers/logging.dm
+++ b/code/_helpers/logging.dm
@@ -82,13 +82,6 @@
if(config.log_world_output)
diary << "\[[time_stamp()]]DD_OUTPUT: [text][log_end]"
-/*
- Standardized method for tracking startup times.
-*/
-/proc/log_startup_progress(var/message)
- admin_notice("[message]", R_DEBUG)
- log_to_dd(message)
-
/proc/log_misc(text)
diary << "\[[time_stamp()]]MISC: [text][log_end]"
diff --git a/code/_helpers/matrices.dm b/code/_helpers/matrices.dm
index 52edb17088..abb0366382 100644
--- a/code/_helpers/matrices.dm
+++ b/code/_helpers/matrices.dm
@@ -15,11 +15,3 @@
animate(src, transform = m120, time = speed, loops)
animate(transform = m240, time = speed)
animate(transform = m360, time = speed)
-
-//The X pixel offset of this matrix
-/matrix/proc/get_x_shift()
- . = c
-
-//The Y pixel offset of this matrix
-/matrix/proc/get_y_shift()
- . = f
\ No newline at end of file
diff --git a/code/_helpers/time.dm b/code/_helpers/time.dm
index 633ef3773a..991d64e20b 100644
--- a/code/_helpers/time.dm
+++ b/code/_helpers/time.dm
@@ -100,16 +100,4 @@ var/round_start_time = 0
/hook/startup/proc/set_roundstart_hour()
roundstart_hour = pick(2,7,12,17)
- return 1
-/*
- Returns "watch handle" (really just a timestamp)
-*/
-/proc/start_watch()
- return world.timeofday
-
-/*
- Returns number of seconds elapsed.
- @param wh number The "Watch Handle" from start_watch(). (timestamp)
-*/
-/proc/stop_watch(wh)
- return round(0.1*(world.timeofday-wh),0.1)
\ No newline at end of file
+ return 1
\ No newline at end of file
diff --git a/code/_helpers/unsorted.dm b/code/_helpers/unsorted.dm
index ff349379b1..d8623fa3eb 100644
--- a/code/_helpers/unsorted.dm
+++ b/code/_helpers/unsorted.dm
@@ -1315,15 +1315,3 @@ var/mob/dview/dview_mob = new
tY = max(1, min(world.maxy, origin.y + (text2num(tY) - (world.view + 1))))
return locate(tX, tY, tZ)
-//Key thing that stops lag. Cornerstone of performance in ss13, Just sitting here, in unsorted.dm.
-/proc/stoplag()
- . = 1
- sleep(world.tick_lag)
- if(world.tick_usage > TICK_LIMIT_TO_RUN) //woke up, still not enough tick, sleep for more.
- . += 2
- sleep(world.tick_lag*2)
- if(world.tick_usage > TICK_LIMIT_TO_RUN) //woke up, STILL not enough tick, sleep for more.
- . += 4
- sleep(world.tick_lag*4)
- //you might be thinking of adding more steps to this, or making it use a loop and a counter var
- // not worth it.
\ No newline at end of file
diff --git a/code/controllers/Processes/garbage.dm b/code/controllers/Processes/garbage.dm
index b993c46222..2d56dde1a2 100644
--- a/code/controllers/Processes/garbage.dm
+++ b/code/controllers/Processes/garbage.dm
@@ -66,9 +66,6 @@ world/loop_checks = 0
testing("GC: [refID] old enough to test: GCd_at_time: [GCd_at_time] time_to_kill: [time_to_kill] current: [world.time]")
#endif
if(A && A.gcDestroyed == GCd_at_time) // So if something else coincidently gets the same ref, it's not deleted by mistake
- #ifdef GC_FINDREF
- LocateReferences(A)
- #endif
// Something's still referring to the qdel'd object. Kill it.
testing("GC: -- \ref[A] | [A.type] was unable to be GC'd and was deleted --")
logging["[A.type]"]++
@@ -91,47 +88,29 @@ world/loop_checks = 0
#undef GC_COLLECTIONS_PER_TICK
#ifdef GC_FINDREF
-
-/datum/controller/process/garbage_collector/proc/LocateReferences(var/atom/A)
- testing("GC: Attempting to locate references to [A] | [A.type]. This is a potentially long-running operation.")
- if(istype(A))
- if(A.loc != null)
- testing("GC: [A] | [A.type] is located in [A.loc] instead of null")
- if(A.contents.len)
- testing("GC: [A] | [A.type] has contents: [jointext(A.contents)]")
- var/ref_count = 0
- for(var/atom/atom)
- ref_count += LookForRefs(atom, A)
- for(var/datum/datum) // This is strictly /datum, not subtypes.
- ref_count += LookForRefs(datum, A)
- for(var/client/client)
- ref_count += LookForRefs(client, A)
- var/message = "GC: References found to [A] | [A.type]: [ref_count]."
- if(!ref_count)
- message += " Has likely been supplied as an 'in list' argment to a proc."
- testing(message)
-
-/datum/controller/process/garbage_collector/proc/LookForRefs(var/datum/D, var/datum/A)
+/datum/controller/process/garbage_collector/proc/LookForRefs(var/datum/D, var/list/targ)
. = 0
for(var/V in D.vars)
if(V == "contents")
continue
- if(!islist(D.vars[V]))
- if(D.vars[V] == A)
+ if(istype(D.vars[V], /atom))
+ var/atom/A = D.vars[V]
+ if(A in targ)
testing("GC: [A] | [A.type] referenced by [D] | [D.type], var [V]")
. += 1
- else
- . += LookForListRefs(D.vars[V], A, D, V)
+ else if(islist(D.vars[V]))
+ . += LookForListRefs(D.vars[V], targ, D, V)
-/datum/controller/process/garbage_collector/proc/LookForListRefs(var/list/L, var/datum/A, var/datum/D, var/V)
+/datum/controller/process/garbage_collector/proc/LookForListRefs(var/list/L, var/list/targ, var/datum/D, var/V)
. = 0
for(var/F in L)
- if(!islist(F))
- if(F == A || L[F] == A)
+ if(istype(F, /atom))
+ var/atom/A = F
+ if(A in targ)
testing("GC: [A] | [A.type] referenced by [D] | [D.type], list [V]")
. += 1
- else
- . += LookForListRefs(F, A, D, "[F] in list [V]")
+ if(islist(F))
+ . += LookForListRefs(F, targ, D, "[F] in list [V]")
#endif
/datum/controller/process/garbage_collector/proc/AddTrash(datum/A)
diff --git a/code/controllers/Processes/tgui.dm b/code/controllers/Processes/tgui.dm
deleted file mode 100644
index 4eef090f2e..0000000000
--- a/code/controllers/Processes/tgui.dm
+++ /dev/null
@@ -1,28 +0,0 @@
-var/global/datum/controller/process/tgui/tgui_process
-
-/datum/controller/process/tgui
- var/list/tg_open_uis = list() // A list of open UIs, grouped by src_object and ui_key.
- var/list/processing_uis = list() // A list of processing UIs, ungrouped.
- var/basehtml // The HTML base used for all UIs.
-
-/datum/controller/process/tgui/setup()
- name = "tgui"
- schedule_interval = 10 // every 2 seconds
- start_delay = 23
-
- basehtml = file2text('tgui/tgui.html') // Read the HTML from disk.
- tgui_process = src
-
-/datum/controller/process/tgui/doWork()
- for(var/gui in processing_uis)
- var/datum/tgui/ui = gui
- if(ui && ui.user && ui.src_object)
- ui.process()
- SCHECK
- continue
- processing_uis.Remove(ui)
- SCHECK
-
-/datum/controller/process/tgui/statProcess()
- ..()
- stat(null, "[tgui_process.processing_uis.len] UI\s")
\ No newline at end of file
diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm
index 44cdeb8b79..682b0fb3d0 100644
--- a/code/controllers/master_controller.dm
+++ b/code/controllers/master_controller.dm
@@ -21,13 +21,11 @@ datum/controller/game_controller/New()
qdel(master_controller)
master_controller = src
- var/watch = 0
if(!job_master)
- watch = start_watch()
job_master = new /datum/controller/occupations()
job_master.SetupOccupations()
job_master.LoadJobs("config/jobs.txt")
- log_startup_progress("Job setup complete in [stop_watch(watch)]s.")
+ admin_notice("Job setup complete", R_DEBUG)
if(!syndicate_code_phrase) syndicate_code_phrase = generate_code_phrase()
if(!syndicate_code_response) syndicate_code_response = generate_code_phrase()
@@ -46,56 +44,31 @@ datum/controller/game_controller/proc/setup()
datum/controller/game_controller/proc/setup_objects()
- var/watch = start_watch()
- var/count = 0
- var/overwatch = start_watch() //Overall.
-
- log_startup_progress("Populating asset cache...")
- populate_asset_cache()
- log_startup_progress(" Populated [asset_cache.len] assets in [stop_watch(watch)]s.")
-
- watch = start_watch()
- log_startup_progress("Initializing objects")
-// sleep(-1)
+ admin_notice("Initializing objects", R_DEBUG)
+ sleep(-1)
for(var/atom/movable/object in world)
if(isnull(object.gcDestroyed))
object.initialize()
- count++
- log_startup_progress(" Initialized [count] objects in [stop_watch(watch)]s.")
- watch = start_watch()
- count = 0
- log_startup_progress("Initializing areas")
-// sleep(-1)
+ admin_notice("Initializing areas", R_DEBUG)
+ sleep(-1)
for(var/area/area in all_areas)
area.initialize()
- count++
- log_startup_progress(" Initialized [count] areas in [stop_watch(watch)]s.")
- watch = start_watch()
- count = 0
- log_startup_progress("Initializing pipe networks")
-// sleep(-1)
+ admin_notice("Initializing pipe networks", R_DEBUG)
+ sleep(-1)
for(var/obj/machinery/atmospherics/machine in machines)
machine.build_network()
- count++
- log_startup_progress(" Initialized [count] pipe networks in [stop_watch(watch)]s.")
- watch = start_watch()
- count = 0
- log_startup_progress("Initializing atmos machinery.")
-// sleep(-1)
+ admin_notice("Initializing atmos machinery.", R_DEBUG)
+ sleep(-1)
for(var/obj/machinery/atmospherics/unary/U in machines)
if(istype(U, /obj/machinery/atmospherics/unary/vent_pump))
var/obj/machinery/atmospherics/unary/vent_pump/T = U
T.broadcast_status()
- count++
else if(istype(U, /obj/machinery/atmospherics/unary/vent_scrubber))
var/obj/machinery/atmospherics/unary/vent_scrubber/T = U
T.broadcast_status()
- count++
- log_startup_progress(" Initialized [count] atmospherics devices in [stop_watch(watch)]s.")
- log_startup_progress("Finished object initializations in [stop_watch(overwatch)]s.")
// Set up antagonists.
populate_antag_type_list()
@@ -103,5 +76,5 @@ datum/controller/game_controller/proc/setup_objects()
//Set up spawn points.
populate_spawn_points()
- log_startup_progress("Initializations complete.")
-// sleep(-1)
+ admin_notice("Initializations complete.", R_DEBUG)
+ sleep(-1)
diff --git a/code/datums/weakref.dm b/code/datums/weakref.dm
deleted file mode 100644
index 3c04580c40..0000000000
--- a/code/datums/weakref.dm
+++ /dev/null
@@ -1,31 +0,0 @@
-/datum
- var/weakref
-
-/datum/Destroy()
- weakref = null // Clear this reference to ensure it's kept for as brief duration as possible.
- . = ..()
-
-//obtain a weak reference to a datum
-/proc/weakref(datum/D)
- if(D.gcDestroyed)
- return
- if(!D.weakref)
- D.weakref = new /datum/weakref(D)
- return D.weakref
-
-/datum/weakref
- var/ref
-
-/datum/weakref/New(datum/D)
- ref = "\ref[D]"
-
-/datum/weakref/Destroy()
- // A weakref datum should not be manually destroyed as it is a shared resource,
- // rather it should be automatically collected by the BYOND GC when all references are gone.
- return 0
-
-/datum/weakref/proc/resolve()
- var/datum/D = locate(ref)
- if(D && D.weakref == src)
- return D
- return null
\ No newline at end of file
diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm
index 9c59c9f62c..3fd49c4828 100644
--- a/code/game/machinery/adv_med.dm
+++ b/code/game/machinery/adv_med.dm
@@ -286,7 +286,6 @@
occupantData["name"] = H.name
occupantData["stat"] = H.stat
occupantData["health"] = H.health
- occupantData["maxHealth"] = H.maxHealth
occupantData["hasVirus"] = H.virus2.len
@@ -310,7 +309,6 @@
var/blood_volume = round(H.vessel.get_reagent_amount("blood"))
bloodData["volume"] = blood_volume
bloodData["percent"] = round(((blood_volume / 560)*100))
- bloodData["bloodLevel"] = round(H.vessel.get_reagent_amount("blood"))
occupantData["blood"] = bloodData
@@ -331,10 +329,6 @@
organData["germ_level"] = E.germ_level
organData["bruteLoss"] = E.brute_dam
organData["fireLoss"] = E.burn_dam
- organData["totalLoss"] = E.brute_dam + E.burn_dam
- organData["maxHealth"] = E.max_damage
- organData["bruised"] = E.min_bruised_damage
- organData["broken"] = E.min_broken_damage
var/implantData[0]
for(var/obj/I in E.implants)
@@ -379,16 +373,13 @@
var/organData[0]
organData["name"] = I.name
if(I.status & ORGAN_ASSISTED)
- organData["robotic"] = 1
+ organData["desc"] = "Assisted"
else if(I.robotic >= ORGAN_ROBOT)
- organData["robotic"] = 2
+ organData["desc"] = "Mechanical"
else
- organData["robotic"] = null
+ organData["desc"] = null
organData["germ_level"] = I.germ_level
organData["damage"] = I.damage
- organData["maxHealth"] = I.max_damage
- organData["bruised"] = I.min_broken_damage
- organData["broken"] = I.min_bruised_damage
intOrganData.Add(list(organData))
@@ -426,9 +417,6 @@
printing = null
printing_text = null
- if (href_list["ejectify"])
- src.connected.eject()
-
/obj/machinery/body_scanconsole/proc/generate_printing_text()
var/dat = ""
diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm
index f24e2fa388..80b33cfaa0 100644
--- a/code/game/machinery/atmoalter/canister.dm
+++ b/code/game/machinery/atmoalter/canister.dm
@@ -265,17 +265,20 @@ update_flag
return src.attack_hand(user)
/obj/machinery/portable_atmospherics/canister/attack_hand(var/mob/user as mob)
- return src.tg_ui_interact(user)
+ return src.ui_interact(user)
-/obj/machinery/portable_atmospherics/canister/ui_data(mob/user)
- var/list/data = list()
+/obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
+ if (src.destroyed)
+ return
+
+ // this is the data which will be sent to the ui
+ var/data[0]
data["name"] = name
data["canLabel"] = can_label ? 1 : 0
data["portConnected"] = connected_port ? 1 : 0
data["tankPressure"] = round(air_contents.return_pressure() ? air_contents.return_pressure() : 0)
data["releasePressure"] = round(release_pressure ? release_pressure : 0)
data["minReleasePressure"] = round(ONE_ATMOSPHERE/10)
- data["defaultReleasePressure"] = ONE_ATMOSPHERE
data["maxReleasePressure"] = round(10*ONE_ATMOSPHERE)
data["valveOpen"] = valve_open ? 1 : 0
@@ -283,70 +286,83 @@ update_flag
if (holding)
data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure()))
- return data
-
-/obj/machinery/portable_atmospherics/canister/tg_ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, datum/tgui/master_ui = null, datum/ui_state/state = tg_physical_state)
- if (src.destroyed)
- return
- ui = tgui_process.try_update_ui(user, src, ui_key, ui, force_open)
- if(!ui)
- ui = new(user, src, ui_key, "canister", name, 400, 400, master_ui, state)
+ // update the ui if it exists, returns null if no ui is passed/found
+ ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ if (!ui)
+ // the ui does not exist, so we'll create a new() one
+ // for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
+ ui = new(user, src, ui_key, "canister.tmpl", "Canister", 480, 400)
+ // when the ui is first opened this is the data it will use
+ ui.set_initial_data(data)
+ // open the new ui window
ui.open()
+ // auto update every Master Controller tick
+ ui.set_auto_update(1)
-/obj/machinery/portable_atmospherics/canister/ui_status(mob/user, datum/ui_state/state)
- if(!istype(src.loc, /turf))
- return UI_CLOSE
- return ..()
+/obj/machinery/portable_atmospherics/canister/Topic(href, href_list)
-/obj/machinery/portable_atmospherics/canister/ui_act(action, params)
- switch(action)
- if("relabel")
- if (can_label)
- var/list/colors = list(\
- "\[N2O\]" = "redws", \
- "\[N2\]" = "red", \
- "\[O2\]" = "blue", \
- "\[Phoron\]" = "orange", \
- "\[CO2\]" = "black", \
- "\[Air\]" = "grey", \
- "\[CAUTION\]" = "yellow", \
- )
- var/label = input("Choose canister label", "Gas canister") as null|anything in colors
- if (label)
- src.canister_color = colors[label]
- src.icon_state = colors[label]
- src.name = "\improper Canister: [label]"
- if("pressure")
- var/diff = text2num(params["adjust"])
- if(diff > 0)
- release_pressure = min(10*ONE_ATMOSPHERE, release_pressure+diff)
+ //Do not use "if(..()) return" here, canisters will stop working in unpowered areas like space or on the derelict. // yeah but without SOME sort of Topic check any dick can mess with them via exploits as he pleases -walter0o
+ //First comment might be outdated.
+ if (!istype(src.loc, /turf))
+ return 0
+
+ if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr)) // exploit protection -walter0o
+ usr << browse(null, "window=canister")
+ onclose(usr, "canister")
+ return
+
+ if(href_list["toggle"])
+ if (valve_open)
+ if (holding)
+ release_log += "Valve was closed by [usr] ([usr.ckey]), stopping the transfer into the [holding]
"
else
- release_pressure = max(ONE_ATMOSPHERE/10, release_pressure+diff)
+ release_log += "Valve was closed by [usr] ([usr.ckey]), stopping the transfer into the air
"
+ else
+ if (holding)
+ release_log += "Valve was opened by [usr] ([usr.ckey]), starting the transfer into the [holding]
"
+ else
+ release_log += "Valve was opened by [usr] ([usr.ckey]), starting the transfer into the air
"
+ log_open()
+ valve_open = !valve_open
- if("valve")
+ if (href_list["remove_tank"])
+ if(holding)
if (valve_open)
- if (holding)
- release_log += "Valve was closed by [usr] ([usr.ckey]), stopping the transfer into the [holding]
"
- else
- release_log += "Valve was closed by [usr] ([usr.ckey]), stopping the transfer into the air
"
- else
- if (holding)
- release_log += "Valve was opened by [usr] ([usr.ckey]), starting the transfer into the [holding]
"
- else
- release_log += "Valve was opened by [usr] ([usr.ckey]), starting the transfer into the air
"
- log_open()
- valve_open = !valve_open
+ valve_open = 0
+ release_log += "Valve was closed by [usr] ([usr.ckey]), stopping the transfer into the [holding]
"
+ if(istype(holding, /obj/item/weapon/tank))
+ holding.manipulated_by = usr.real_name
+ holding.loc = loc
+ holding = null
- if("eject")
- if(holding)
- if (valve_open)
- valve_open = 0
- release_log += "Valve was closed by [usr] ([usr.ckey]), stopping the transfer into the [holding]
"
- if(istype(holding, /obj/item/weapon/tank))
- holding.manipulated_by = usr.real_name
- holding.loc = loc
- holding = null
- return TRUE
+ if (href_list["pressure_adj"])
+ var/diff = text2num(href_list["pressure_adj"])
+ if(diff > 0)
+ release_pressure = min(10*ONE_ATMOSPHERE, release_pressure+diff)
+ else
+ release_pressure = max(ONE_ATMOSPHERE/10, release_pressure+diff)
+
+ if (href_list["relabel"])
+ if (can_label)
+ var/list/colors = list(\
+ "\[N2O\]" = "redws", \
+ "\[N2\]" = "red", \
+ "\[O2\]" = "blue", \
+ "\[Phoron\]" = "orange", \
+ "\[CO2\]" = "black", \
+ "\[Air\]" = "grey", \
+ "\[CAUTION\]" = "yellow", \
+ )
+ var/label = input("Choose canister label", "Gas canister") as null|anything in colors
+ if (label)
+ src.canister_color = colors[label]
+ src.icon_state = colors[label]
+ src.name = "Canister: [label]"
+
+ src.add_fingerprint(usr)
+ update_icon()
+
+ return 1
/obj/machinery/portable_atmospherics/canister/phoron/New()
..()
diff --git a/code/game/machinery/doors/airlock_electronics.dm b/code/game/machinery/doors/airlock_electronics.dm
index cd1b44e446..3ae0891b89 100644
--- a/code/game/machinery/doors/airlock_electronics.dm
+++ b/code/game/machinery/doors/airlock_electronics.dm
@@ -11,91 +11,103 @@
req_access = list(access_engine)
var/secure = 0 //if set, then wires will be randomized and bolts will drop if the door is broken
- var/list/conf_access = list()
+ var/list/conf_access = null
var/one_access = 0 //if set to 1, door would receive req_one_access instead of req_access
var/last_configurator = null
var/locked = 1
-/obj/item/weapon/airlock_electronics/attack_self(mob/user as mob)
- if (!ishuman(user) && !istype(user,/mob/living/silicon/robot))
- return ..(user)
+ attack_self(mob/user as mob)
+ if (!ishuman(user) && !istype(user,/mob/living/silicon/robot))
+ return ..(user)
- tg_ui_interact(user)
+ var/t1 = text("Access control
\n")
-//tgui interact code generously lifted from tgstation.
-/obj/item/weapon/airlock_electronics/tg_ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = 0, \
- datum/tgui/master_ui = null, datum/ui_state/state = hands_state)
+ if (last_configurator)
+ t1 += "Operator: [last_configurator]
"
- tgui_process.try_update_ui(user, src, ui_key, ui, force_open)
- if(!ui)
- ui = new(user, src, ui_key, "airlock_electronics", src.name, 1000, 500, master_ui, state)
- ui.open()
+ if (locked)
+ t1 += "Swipe ID


Requesting AI personalities from central database... If there are no entries, or if a suitable entry is not listed, check again later as more personalities may be added.
- Searching for personalities, please wait...
Searching for personalities| t |
| Brute: | +{{:data.occupant.bruteLoss}} | +Brain: | +{{:data.occupant.brainLoss}} | +
| Burn: | +{{:data.occupant.fireLoss}} | +Radiation: | +{{:data.occupant.radLoss}} | +
| Oxygen: | +{{:data.occupant.oxyLoss}} | +Genetic: | +{{:data.occupant.cloneLoss}} | +
| Toxins: | +{{:data.occupant.toxLoss}} | +Paralysis: | +{{:data.occupant.paralysis}}% ({{:data.occupant.paralysisSeconds}} seconds left!) | +
| Body Temperature: | +{{:helper.round(data.occupant.bodyTempC*10)/10}}°C, {{:helper.round(data.occupant.bodyTempF*10)/10}}°F | +
| Brute Damage: | -Brain Damage: | -|||
| {{:helper.displayBar(data.occupant.bruteLoss, 0, data.occupant.maxHealth+100, (data.occupant.bruteLoss < 15) ? 'notgood' : (data.occupant.bruteLoss < 40) ? 'average' : 'bad', data.occupant.bruteLoss != 0 ? "" + data.occupant.bruteLoss + "" : data.occupant.bruteLoss) }} | -{{:helper.displayBar(data.occupant.brainLoss, 0, data.occupant.maxHealth+100, (data.occupant.brainLoss < 15) ? 'notgood' : (data.occupant.brainLoss < 40) ? 'average' : 'bad', data.occupant.brainLoss != 0 ? "" + data.occupant.brainLoss + "" : data.occupant.brainLoss)}} | -|||
| Resp. Damage: | -Radiation Level: | -|||
| {{:helper.displayBar(data.occupant.oxyLoss, 0, data.occupant.maxHealth+100, (data.occupant.oxyLoss < 15) ? 'notgood' : (data.occupant.oxyLoss < 40) ? 'average' : 'bad', data.occupant.oxyLoss != 0 ? "" + data.occupant.oxyLoss + "" : data.occupant.oxyLoss)}} | -{{:helper.displayBar(data.occupant.radLoss, 0, data.occupant.maxHealth+100, (data.occupant.radLoss < 15) ? 'notgood' : (data.occupant.radLoss < 40) ? 'average' : 'bad', data.occupant.radLoss != 0 ? "" + data.occupant.radLoss + "" : data.occupant.radLoss)}} | -|||
| Toxin Damage: | -Genetic Damage: | -|||
| {{:helper.displayBar(data.occupant.toxLoss, 0, data.occupant.maxHealth+100, (data.occupant.toxLoss < 15) ? 'notgood' : (data.occupant.toxLoss < 40) ? 'average' : 'bad', data.occupant.toxLoss != 0 ? "" + data.occupant.toxLoss + "" : data.occupant.toxLoss)}} | -{{:helper.displayBar(data.occupant.cloneLoss, 0, data.occupant.maxHealth+100, (data.occupant.cloneLoss < 15) ? 'notgood' : (data.occupant.cloneLoss < 40) ? 'average' : 'bad', data.occupant.cloneLoss != 0 ? "" + data.occupant.cloneLoss + "" : data.occupant.cloneLoss)}} | -|||
| Burn Severity: | -Paralysis %: ({{:helper.smoothRound(data.occupant.paralysisSeconds)}} seconds left) | -|||
| {{:helper.displayBar(data.occupant.fireLoss, 0, data.occupant.maxHealth+100, (data.occupant.fireLoss < 15) ? 'notgood' : (data.occupant.fireLoss < 40) ? 'average' : 'bad', data.occupant.fireLoss != 0 ? "" + data.occupant.fireLoss + "" : data.occupant.fireLoss)}} | -{{:helper.displayBar(data.occupant.paralysis, 0, 100, (data.occupant.paralysis < 25) ? 'notgood' : (data.occupant.paralysis < 50) ? 'average' : 'bad', data.occupant.paralysis != 0 ? "" + data.occupant.paralysis + "" : data.occupant.paralysis)}} | -
| Volume: | +{{:data.occupant.blood.volume}} | +Percent: | +{{:data.occupant.blood.percent}}% | +
| {{:value.name}} |
| Name | -Total damage | -Brute damage | -Burn damage | -Injuries | -
|---|---|---|---|---|
| {{:value.name}} | -{{:helper.displayBar(value.totalLoss, 0, value.maxHealth, (value.totalLoss < value.bruised) ? 'notgood' : (value.totalLoss < value.broken) ? 'average' : 'bad', value.totalLoss != 0 ? "" + value.totalLoss + "" : value.totalLoss) }} | -{{if value.bruteLoss> 0}} {{else}} {{/if}} {{:helper.smoothRound(value.bruteLoss)}} | -{{if value.fireLoss> 0}} {{else}} {{/if}} {{:helper.smoothRound(value.fireLoss)}} | -
-
- {{if value.status.destroyed}} DESTROYED {{/if}} - {{if value.status.bleeding}} external bleeding {{/if}} - {{if value.internalBleeding}} internal bleeding {{/if}} - {{if value.lungRuptured}} lung ruptured {{/if}} - {{if value.status.broken}} {{:value.status.broken}} {{/if}} - {{if value.germ_level > 100}} - {{if value.germ_level < 300}} - mild infection - {{else value.germ_level < 400}} - mild infection+ - {{else value.germ_level < 500}} - mild infection++ - {{else value.germ_level < 700}} - acute infection - {{else value.germ_level < 800}} - acute infection+ - {{else value.germ_level < 900}} - acute infection++ - {{else value.germ_level >= 900}} - septic - {{/if}} + External Organs+
+ {{for data.occupant.extOrgan}}
+
+ {{if value.status.destroyed}}
+
+ {{:value.name}} - DESTROYED
+
+ {{else}}
+
+
+
+ {{:value.name}}
+
+
+ {{if value.status.broken}}
+ {{:value.status.broken}}
+ {{else value.status.splinted}}
+ Splinted
+ {{else value.status.robotic}}
+ Robotic
+ {{/if}}
+
+
+ Brute/Burn
+
+
+ {{:value.bruteLoss}}/{{:value.fireLoss}}
+
+
+ Injuries
+
+
+ {{if !value.status.bleeding}}
+ {{if !value.status.internalBleeding}}
+ No Injuries Detected
+ {{else}}
+ Internal Bleeding Detected
{{/if}}
- {{if value.open}} open incision {{/if}} - - {{if value.status.splinted}} splinted {{/if}} - {{if value.status.robotic}} robotic {{/if}} - {{if value.status.dead}} DEAD - {{/for}} + {{else}} + {{if value.status.internalBleeding}} + Internal Bleeding Detected. External Bleeding Detected.
+ {{else}}
+ External Bleeding Detected
{{/if}}
- |
-
| Name | -Brute damage | -Injuries | -
|---|---|---|
| {{:value.name}} |
- {{:helper.displayBar(value.damage, 0, value.maxHealth, (value.damage < value.bruised) ? 'notgood' : (value.damage < value.broken) ? 'average' : 'bad', value.damage != 0 ? "" + value.damage + "" : value.damage) }} | -
-
- {{if value.germ_level > 100}}
- {{if value.germ_level < 300}}
- mild infection - {{else value.germ_level < 400}} - mild infection+ - {{else value.germ_level < 500}} - mild infection++ - {{else value.germ_level < 700}} - acute Infection - {{else value.germ_level < 800}} - acute Infection+ - {{else value.germ_level < 900}} - acute Infection++ - {{else value.germ_level >= 900}} - septic - {{/if}} - {{/if}} - - {{if value.robotic == 1}} assisted {{/if}} - {{if value.robotic == 2}} mechanical {{/if}} - |
-
| {{:value.s_lighting}} | {{:value.s_environment}} {{if value.cell_status == "N"}} - | {{:helper.link(value.cell_charge + '%', 'battery-empty', null,'disabled', 'width75btn')}} + | {{:helper.link(value.cell_charge + '%', 'batt_disc', null,'disabled', 'width75btn')}} {{else value.cell_status == "C"}} - | {{:helper.link(value.cell_charge + '%', 'battery-half', null,'disabled', 'width75btn')}} + | {{:helper.link(value.cell_charge + '%', 'batt_chrg', null,'disabled', 'width75btn')}} {{else}} - | {{:helper.link(value.cell_charge + '%', 'battery-full', null,'disabled', 'width75btn')}} + | {{:helper.link(value.cell_charge + '%', 'batt_full', null,'disabled', 'width75btn')}} {{/if}} | {{:value.total_load}} {{empty}} diff --git a/nano/templates/rcon.tmpl b/nano/templates/rcon.tmpl index ac70e34afb..e16062aec4 100644 --- a/nano/templates/rcon.tmpl +++ b/nano/templates/rcon.tmpl @@ -29,12 +29,12 @@ |
| Input: {{:value.input_val}} kW - {{:value.input_set ? "AUTO" : "OFF"}} | - {{:helper.link('', 'power-off', { 'smes_in_toggle' : value.RCON_tag})}} + {{:helper.link('', 'power', { 'smes_in_toggle' : value.RCON_tag})}} {{:helper.link('', 'pencil', { 'smes_in_set' : value.RCON_tag})}} |
| Output: {{:value.output_val}} kW - {{:value.output_set ? "ONLINE" : "OFFLINE"}} | - {{:helper.link('', 'power-off', { 'smes_out_toggle' : value.RCON_tag})}} + {{:helper.link('', 'power', { 'smes_out_toggle' : value.RCON_tag})}} {{:helper.link('', 'pencil', { 'smes_out_set' : value.RCON_tag})}} |
| @@ -63,7 +63,7 @@ | |
| {{:value.enabled ? "[ENABLED]" : "[DISABLED]"}} | - {{:helper.link('', 'power-off', {'toggle_breaker' : value.RCON_tag})}} + {{:helper.link('', 'power', {'toggle_breaker' : value.RCON_tag})}} |
There are no available departments to request supplies from. |
There are no available departments to relay information to. |
| {{name}} | - {{/each}}
|---|
| {{#each accesses}}
- - {{/each}} |
- {{/each}}
| Date | -Time | -Target | -Purpose | -Value | -Source terminal ID | -
|---|---|---|---|---|---|
| {{date}} | -{{time}} | -{{target_name}} | -{{purpose}} | -${{amount}} | -{{source_terminal}} | -