"
- t += "O" //up-left
- t += "^" //up
- t += "O " //up-right
- t += "<"//left
- t += "R"//reset to 0
- t += "> "//right
- t += "O"//down-left
- t += "v"//down
- t += "O "//down-right
- t += " "
- t += "
Current regime: [regime_set] "
- data += "Current target: [(!target) ? "None" : "[get_area(target)] [(regime_set != "Gate") ? "" : "Teleporter"]"] "
- if(calibrating)
- data += "Calibration: In Progress"
- else if(power_station.teleporter_hub.calibrated || power_station.teleporter_hub.accurate >= 3)
- data += "Calibration: Optimal"
- else
- data += "Calibration: Sub-Optimal"
- data += "
"
+ data["calibrated"] = FALSE
- data += "Change regime "
- data += "Set target "
+ return data
- data += " Calibrate Hub"
- 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.teleporter_hub.accurate >= 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.teleporter_hub.accurate)) //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)
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index c31c52c5..84b2e732 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -1434,7 +1434,7 @@
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state)
SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "ai_airlock", name, 550, 456, master_ui, state)
+ ui = new(user, src, ui_key, "ai_airlock", name, 500, 390, master_ui, state)
ui.open()
return TRUE
@@ -1503,83 +1503,24 @@
if("shock-perm")
shock_perm(usr)
. = TRUE
- if("idscan-on")
- if(wires.is_cut(WIRE_IDSCAN))
- to_chat(usr, "You can't enable IdScan - The IdScan wire has been cut.")
- else if(src.aiDisabledIdScanner)
- aiDisabledIdScanner = FALSE
- else
- to_chat(usr, "The IdScan feature is not disabled.")
+ if("idscan-toggle")
+ aiDisabledIdScanner = !aiDisabledIdScanner
. = TRUE
- if("idscan-off")
- if(wires.is_cut(WIRE_IDSCAN))
- to_chat(usr, "The IdScan wire has been cut - So, you can't disable it, but it is already disabled anyways.")
- else if(aiDisabledIdScanner)
- to_chat(usr, "You've already disabled the IdScan feature.")
- else
- aiDisabledIdScanner = TRUE
+ if("emergency-toggle")
+ toggle_emergency(usr)
. = TRUE
- if("emergency-on")
- emergency_on(usr)
+ if("bolt-toggle")
+ toggle_bolt(usr)
. = TRUE
- if("emergency-off")
- emergency_off(usr)
+ if("light-toggle")
+ lights = !lights
+ update_icon()
. = TRUE
- if("bolt-raise")
- bolt_raise(usr)
+ if("safe-toggle")
+ safe = !safe
. = TRUE
- if("bolt-drop")
- bolt_drop(usr)
- . = TRUE
- if("light-on")
- if(wires.is_cut(WIRE_LIGHT))
- to_chat(usr, "Control to door bolt lights has been severed.")
- else if (!src.lights)
- lights = TRUE
- update_icon()
- else
- to_chat(usr, text("Door bolt lights are already enabled!"))
- . = TRUE
- if("light-off")
- if(wires.is_cut(WIRE_LIGHT))
- to_chat(usr, "Control to door bolt lights has been severed.")
- else if (lights)
- lights = FALSE
- update_icon()
- else
- to_chat(usr, "Door bolt lights are already disabled!")
- . = TRUE
- if("safe-on")
- if(wires.is_cut(WIRE_SAFETY))
- to_chat(usr, "Control to door sensors is disabled.")
- else if (!src.safe)
- safe = TRUE
- else
- to_chat(usr, "Firmware reports safeties already in place.")
- . = TRUE
- if("safe-off")
- if(wires.is_cut(WIRE_SAFETY))
- to_chat(usr, "Control to door sensors is disabled.")
- else if (safe)
- safe = FALSE
- else
- to_chat(usr, "Firmware reports safeties already overridden.")
- . = TRUE
- if("speed-on")
- if(wires.is_cut(WIRE_TIMING))
- to_chat(usr, "Control to door timing circuitry has been severed.")
- else if (!src.normalspeed)
- normalspeed = 1
- else
- to_chat(usr,"Door timing circuitry currently operating normally.")
- . = TRUE
- if("speed-off")
- if(wires.is_cut(WIRE_TIMING))
- to_chat(usr, "Control to door timing circuitry has been severed.")
- else if (normalspeed)
- normalspeed = 0
- else
- to_chat(usr, "Door timing circuitry already accelerated.")
+ if("speed-toggle")
+ normalspeed = !normalspeed
. = TRUE
if("open-close")
@@ -1617,45 +1558,26 @@
log_combat(user, src, "electrified")
set_electrified(ELECTRIFIED_PERMANENT)
-/obj/machinery/door/airlock/proc/emergency_on(mob/user)
- if(!user_allowed(user))
- return
- if (!emergency)
- emergency = TRUE
- update_icon()
- else
- to_chat(user, "Emergency access is already enabled!")
-
-/obj/machinery/door/airlock/proc/emergency_off(mob/user)
- if(!user_allowed(user))
- return
- if (emergency)
- emergency = FALSE
- update_icon()
- else
- to_chat(user, "Emergency access is already disabled!")
-
-/obj/machinery/door/airlock/proc/bolt_raise(mob/user)
+/obj/machinery/door/airlock/proc/toggle_bolt(mob/user)
if(!user_allowed(user))
return
if(wires.is_cut(WIRE_BOLTS))
- to_chat(user, "The door bolt drop wire is cut - you can't raise the door bolts")
- else if(!src.locked)
- to_chat(user, "The door bolts are already up")
- else
- if(src.hasPower())
- unbolt()
+ to_chat(user, "The door bolt drop wire is cut - you can't toggle the door bolts.")
+ return
+ if(locked)
+ if(!hasPower())
+ to_chat(user, "The door has no power - you can't raise the door bolts.")
else
- to_chat(user, "Cannot raise door bolts due to power failure")
-
-/obj/machinery/door/airlock/proc/bolt_drop(mob/user)
- if(!user_allowed(user))
- return
- if(wires.is_cut(WIRE_BOLTS))
- to_chat(user, "You can't drop the door bolts - The door bolt dropping wire has been cut.")
+ unbolt()
else
bolt()
+/obj/machinery/door/airlock/proc/toggle_emergency(mob/user)
+ if(!user_allowed(user))
+ return
+ emergency = !emergency
+ update_icon()
+
/obj/machinery/door/airlock/proc/user_toggle_open(mob/user)
if(!user_allowed(user))
return
diff --git a/code/game/machinery/doors/airlock_electronics.dm b/code/game/machinery/doors/airlock_electronics.dm
index 54774a8f..7b90715f 100644
--- a/code/game/machinery/doors/airlock_electronics.dm
+++ b/code/game/machinery/doors/airlock_electronics.dm
@@ -14,7 +14,7 @@
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.hands_state)
SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "airlock_electronics", name, 975, 420, master_ui, state)
+ ui = new(user, src, ui_key, "airlock_electronics", name, 420, 485, master_ui, state)
ui.open()
/obj/item/electronics/airlock/ui_data()
@@ -43,13 +43,16 @@
if(..())
return
switch(action)
- if("clear")
+ if("clear_all")
accesses = list()
one_access = 0
. = TRUE
if("one_access")
one_access = !one_access
. = TRUE
+ if("grant_all")
+ accesses = get_all_accesses()
+ . = TRUE
if("set")
var/access = text2num(params["access"])
if (!(access in accesses))
diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm
index a513d7fe..3bfcecec 100644
--- a/code/game/machinery/doors/brigdoors.dm
+++ b/code/game/machinery/doors/brigdoors.dm
@@ -149,7 +149,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, "brig_timer", name, 300, 200, master_ui, state)
+ ui = new(user, src, ui_key, "brig_timer", name, 300, 138, master_ui, state)
ui.open()
//icon update function
diff --git a/code/game/machinery/gulag_item_reclaimer.dm b/code/game/machinery/gulag_item_reclaimer.dm
index 89ec0dec..d808dd53 100644
--- a/code/game/machinery/gulag_item_reclaimer.dm
+++ b/code/game/machinery/gulag_item_reclaimer.dm
@@ -29,7 +29,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_item_reclaimer", name, 455, 440, master_ui, state)
+ ui = new(user, src, ui_key, "gulag_item_reclaimer", name, 300, 400, master_ui, state)
ui.open()
/obj/machinery/gulag_item_reclaimer/ui_data(mob/user)
diff --git a/code/game/machinery/launch_pad.dm b/code/game/machinery/launch_pad.dm
index db59f3f4..7a507663 100644
--- a/code/game/machinery/launch_pad.dm
+++ b/code/game/machinery/launch_pad.dm
@@ -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
@@ -29,17 +30,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, "You save the data in the [I.name]'s buffer.")
- 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
@@ -47,6 +59,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, "ERROR: Launchpad busy.")
@@ -64,12 +84,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
@@ -86,25 +116,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 += ", "
@@ -250,7 +280,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()
@@ -265,10 +295,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)
@@ -284,76 +313,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)
diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm
index 51970125..4be19b42 100644
--- a/code/game/machinery/suit_storage_unit.dm
+++ b/code/game/machinery/suit_storage_unit.dm
@@ -388,14 +388,24 @@
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"] = 1
+ data["occupied"] = TRUE
+ else
+ data["occupied"] = FALSE
return data
/obj/machinery/suit_storage_unit/ui_act(action, params)
diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm
index ae71a0b8..244aee05 100644
--- a/code/game/machinery/teleporter.dm
+++ b/code/game/machinery/teleporter.dm
@@ -11,7 +11,7 @@
idle_power_usage = 10
active_power_usage = 2000
circuit = /obj/item/circuitboard/machine/teleporter_hub
- var/accurate = FALSE
+ var/accuracy = 0
var/obj/machinery/teleport/station/power_station
var/calibrated //Calibration prevents mutation
@@ -29,7 +29,12 @@
var/A = 0
for(var/obj/item/stock_parts/matter_bin/M in component_parts)
A += M.rating
- accurate = A
+ accuracy = A
+
+/obj/machinery/teleport/hub/examine(mob/user)
+ ..()
+ if(in_range(user, src) || isobserver(user))
+ to_chat(user, "The status display reads: Probability of malfunction decreased by [(accuracy*25)-25]%.")
/obj/machinery/teleport/hub/proc/link_power_station()
if(power_station)
@@ -69,13 +74,13 @@
if(do_teleport(M, com.target, channel = TELEPORT_CHANNEL_BLUESPACE))
use_power(5000)
- if(!calibrated && iscarbon(M) && prob(30 - ((accurate) * 10))) //oh dear a problem
+ if(!calibrated && iscarbon(M) && prob(30 - ((accuracy) * 10))) //oh dear a problem
var/mob/living/carbon/C = M
if(C.dna?.species && C.dna.species.id != "fly" && !HAS_TRAIT(C, TRAIT_RADIMMUNE))
to_chat(C, "You hear a buzzing in your ears.")
C.set_species(/datum/species/fly)
log_game("[C] ([key_name(C)]) was turned into a fly person")
- C.apply_effect((rand(120 - accurate * 40, 180 - accurate * 60)), EFFECT_IRRADIATE, 0)
+ C.apply_effect((rand(120 - accuracy * 40, 180 - accuracy * 60)), EFFECT_IRRADIATE, 0)
calibrated = FALSE
return
@@ -102,7 +107,7 @@
/obj/machinery/teleport/station
- name = "station"
+ name = "teleporter station"
desc = "The power control station for a bluespace teleporter. Used for toggling power, and can activate a test-fire to prevent malfunctions."
icon_state = "controller"
use_power = IDLE_POWER_USE
@@ -125,6 +130,15 @@
E += C.rating
efficiency = E - 1
+/obj/machinery/teleport/station/examine(mob/user)
+ . = ..()
+ if(!panel_open)
+ to_chat(user, "The panel is screwed in, obstructing the linking device and wiring panel.")
+ else
+ to_chat(user, "The linking device is now able to be scanned with a multitool. The wiring can be connected to a nearby console and hub with a pair of wirecutters.")
+ if(in_range(user, src) || isobserver(user))
+ to_chat(user, "The status display reads: This station can be linked to [efficiency] other station(s).")
+
/obj/machinery/teleport/station/proc/link_console_and_hub()
for(var/direction in GLOB.cardinals)
teleporter_hub = locate(/obj/machinery/teleport/hub, get_step(src, direction))
diff --git a/code/game/mecha/mech_bay.dm b/code/game/mecha/mech_bay.dm
index f198bfbd..00c57da5 100644
--- a/code/game/mecha/mech_bay.dm
+++ b/code/game/mecha/mech_bay.dm
@@ -79,7 +79,7 @@
/obj/machinery/computer/mech_bay_power_console/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, "mech_bay_power_console", "Mech Bay Power Control Console", 400, 170, master_ui, state)
+ ui = new(user, src, ui_key, "mech_bay_power_console", "Mech Bay Power Control Console", 400, 200, master_ui, state)
ui.open()
/obj/machinery/computer/mech_bay_power_console/ui_act(action, params)
@@ -96,7 +96,7 @@
if(recharge_port && !QDELETED(recharge_port))
data["recharge_port"] = list("mech" = null)
if(recharge_port.recharging_mech && !QDELETED(recharge_port.recharging_mech))
- data["recharge_port"]["mech"] = list("health" = recharge_port.recharging_mech.obj_integrity, "maxhealth" = recharge_port.recharging_mech.max_integrity, "cell" = null)
+ data["recharge_port"]["mech"] = list("health" = recharge_port.recharging_mech.obj_integrity, "maxhealth" = recharge_port.recharging_mech.max_integrity, "cell" = null, "name" = recharge_port.recharging_mech.name,)
if(recharge_port.recharging_mech.cell && !QDELETED(recharge_port.recharging_mech.cell))
data["recharge_port"]["mech"]["cell"] = list(
"critfail" = recharge_port.recharging_mech.cell.crit_fail,
diff --git a/code/game/objects/items/RPD.dm b/code/game/objects/items/RPD.dm
index 6047b6e7..51701f7c 100644
--- a/code/game/objects/items/RPD.dm
+++ b/code/game/objects/items/RPD.dm
@@ -249,7 +249,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
var/datum/asset/assets = get_asset_datum(/datum/asset/spritesheet/pipes)
assets.send(user)
- ui = new(user, src, ui_key, "rpd", name, 425, 515, master_ui, state)
+ ui = new(user, src, ui_key, "rpd", name, 425, 472, master_ui, state)
ui.open()
/obj/item/pipe_dispenser/ui_data(mob/user)
@@ -316,9 +316,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
playeffect = FALSE
if("mode")
var/n = text2num(params["mode"])
- if(n == 2 && !(mode&1) && !(mode&2))
- mode |= 3
- else if(mode&n)
+ if(mode & n)
mode &= ~n
else
mode |= n
@@ -327,6 +325,7 @@ GLOBAL_LIST_INIT(transit_tube_recipes, list(
spark_system.start()
effectcooldown = world.time + 100
playsound(get_turf(src), 'sound/effects/pop.ogg', 50, 0)
+ return TRUE
/obj/item/pipe_dispenser/pre_attack(atom/A, mob/user)
if(!user.IsAdvancedToolUser() || istype(A, /turf/open/space/transit))
diff --git a/code/game/objects/items/devices/gps.dm b/code/game/objects/items/devices/gps.dm
index bb1c71d1..080fc033 100644
--- a/code/game/objects/items/devices/gps.dm
+++ b/code/game/objects/items/devices/gps.dm
@@ -1,226 +1,224 @@
-GLOBAL_LIST_EMPTY(GPS_list)
-/obj/item/gps
- name = "global positioning system"
- desc = "Helping lost spacemen find their way through the planets since 2016."
- icon = 'icons/obj/telescience.dmi'
- icon_state = "gps-c"
- w_class = WEIGHT_CLASS_SMALL
- slot_flags = ITEM_SLOT_BELT
- obj_flags = UNIQUE_RENAME
- var/gpstag = "COM0"
- var/emped = FALSE
- var/tracking = TRUE
- var/updating = TRUE //Automatic updating of GPS list. Can be set to manual by user.
- var/global_mode = TRUE //If disabled, only GPS signals of the same Z level are shown
-
-/obj/item/gps/examine(mob/user)
- . = ..()
- . += "Alt-click to switch it [tracking ? "off":"on"]."
-
-/obj/item/gps/Initialize()
- . = ..()
- GLOB.GPS_list += src
- name = "global positioning system ([gpstag])"
- add_overlay("working")
-
-/obj/item/gps/Destroy()
- GLOB.GPS_list -= src
- return ..()
-
-/obj/item/gps/emp_act(severity)
- . = ..()
- if (. & EMP_PROTECT_SELF)
- return
- emped = TRUE
- cut_overlay("working")
- add_overlay("emp")
- addtimer(CALLBACK(src, .proc/reboot), 300, TIMER_UNIQUE|TIMER_OVERRIDE) //if a new EMP happens, remove the old timer so it doesn't reactivate early
- SStgui.close_uis(src) //Close the UI control if it is open.
-
-/obj/item/gps/proc/reboot()
- emped = FALSE
- cut_overlay("emp")
- add_overlay("working")
-
-/obj/item/gps/AltClick(mob/user)
- . = ..()
- if(!user.canUseTopic(src, BE_CLOSE))
- return
- toggletracking(user)
- return TRUE
-
-/obj/item/gps/proc/toggletracking(mob/user)
- if(!user.canUseTopic(src, BE_CLOSE))
- return //user not valid to use gps
- if(emped)
- to_chat(user, "It's busted!")
- return
- if(tracking)
- cut_overlay("working")
- to_chat(user, "[src] is no longer tracking, or visible to other GPS devices.")
- tracking = FALSE
- else
- add_overlay("working")
- to_chat(user, "[src] is now tracking, and visible to other GPS devices.")
- tracking = TRUE
-
-
-/obj/item/gps/ui_interact(mob/user, ui_key = "gps", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) // Remember to use the appropriate state.
- if(emped)
- to_chat(user, "[src] fizzles weakly.")
- return
- ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
- if(!ui)
- var/gps_window_height = 300 + GLOB.GPS_list.len * 20 // Variable window height, depending on how many GPS units there are to show
- ui = new(user, src, ui_key, "gps", "Global Positioning System", 600, gps_window_height, master_ui, state) //width, height
- ui.open()
-
- ui.set_autoupdate(state = updating)
-
-
-/obj/item/gps/ui_data(mob/user)
- var/list/data = list()
- data["power"] = tracking
- data["tag"] = gpstag
- data["updating"] = updating
- data["globalmode"] = global_mode
- if(!tracking || emped) //Do not bother scanning if the GPS is off or EMPed
- return data
-
- var/turf/curr = get_turf(src)
- data["current"] = "[get_area_name(curr, TRUE)] ([curr.x], [curr.y], [curr.z])"
-
- var/list/signals = list()
- data["signals"] = list()
-
- for(var/gps in GLOB.GPS_list)
- var/obj/item/gps/G = gps
- if(G.emped || !G.tracking || G == src)
- continue
- var/turf/pos = get_turf(G)
- if(!global_mode && pos.z != curr.z)
- continue
- var/list/signal = list()
- signal["entrytag"] = G.gpstag //Name or 'tag' of the GPS
- signal["area"] = get_area_name(G, TRUE)
- signal["coord"] = "[pos.x], [pos.y], [pos.z]"
- if(pos.z == curr.z) //Distance/Direction calculations for same z-level only
- signal["dist"] = max(get_dist(curr, pos), 0) //Distance between the src and remote GPS turfs
- signal["degrees"] = round(Get_Angle(curr, pos)) //0-360 degree directional bearing, for more precision.
- var/direction = uppertext(dir2text(get_dir(curr, pos))) //Direction text (East, etc). Not as precise, but still helpful.
- if(!direction)
- direction = "CENTER"
- signal["degrees"] = "N/A"
- signal["direction"] = direction
-
- signals += list(signal) //Add this signal to the list of signals
- data["signals"] = signals
- return data
-
-
-
-/obj/item/gps/ui_act(action, params)
- if(..())
- return
- switch(action)
- if("rename")
- var/a = input("Please enter desired tag.", name, gpstag) as text
- a = copytext(sanitize(a), 1, 20)
- gpstag = a
- . = TRUE
- name = "global positioning system ([gpstag])"
-
- if("power")
- toggletracking(usr)
- . = TRUE
- if("updating")
- updating = !updating
- . = TRUE
- if("globalmode")
- global_mode = !global_mode
- . = TRUE
-
-
-/obj/item/gps/science
- icon_state = "gps-s"
- gpstag = "SCI0"
-
-/obj/item/gps/engineering
- icon_state = "gps-e"
- gpstag = "ENG0"
-
-/obj/item/gps/mining
- icon_state = "gps-m"
- gpstag = "MINE0"
- desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
-
-/obj/item/gps/cyborg
- icon_state = "gps-b"
- gpstag = "BORG0"
- desc = "A mining cyborg internal positioning system. Used as a recovery beacon for damaged cyborg assets, or a collaboration tool for mining teams."
-
-/obj/item/gps/cyborg/Initialize()
- . = ..()
- ADD_TRAIT(src, TRAIT_NODROP, CYBORG_ITEM_TRAIT)
-
-/obj/item/gps/internal
- icon_state = null
- item_flags = ABSTRACT
- gpstag = "Eerie Signal"
- desc = "Report to a coder immediately."
- invisibility = INVISIBILITY_MAXIMUM
- var/obj/item/implant/gps/implant
-
-/obj/item/gps/internal/Initialize(mapload, obj/item/implant/gps/_implant)
- . = ..()
- implant = _implant
-
-/obj/item/gps/internal/Destroy()
- if(implant?.imp_in)
- qdel(implant)
- else
- return ..()
-
-/obj/item/gps/internal/mining
- icon_state = "gps-m"
- gpstag = "MINER"
- desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
-
-/obj/item/gps/internal/base
- gpstag = "NT_AUX"
- desc = "A homing signal from Kinaris's mining base."
-
-/obj/item/gps/visible_debug
- name = "visible GPS"
- gpstag = "ADMIN"
- desc = "This admin-spawn GPS unit leaves the coordinates visible \
- on any turf that it passes over, for debugging. Especially useful \
- for marking the area around the transition edges."
- var/list/turf/tagged
-
-/obj/item/gps/visible_debug/Initialize()
- . = ..()
- tagged = list()
- START_PROCESSING(SSfastprocess, src)
-
-/obj/item/gps/visible_debug/process()
- var/turf/T = get_turf(src)
- if(T)
- // I assume it's faster to color,tag and OR the turf in, rather
- // then checking if its there
- T.color = RANDOM_COLOUR
- T.maptext = "[T.x],[T.y],[T.z]"
- tagged |= T
-
-/obj/item/gps/visible_debug/proc/clear()
- while(tagged.len)
- var/turf/T = pop(tagged)
- T.color = initial(T.color)
- T.maptext = initial(T.maptext)
-
-/obj/item/gps/visible_debug/Destroy()
- if(tagged)
- clear()
- tagged = null
- STOP_PROCESSING(SSfastprocess, src)
- . = ..()
+GLOBAL_LIST_EMPTY(GPS_list)
+/obj/item/gps
+ name = "global positioning system"
+ desc = "Helping lost spacemen find their way through the planets since 2016."
+ icon = 'icons/obj/telescience.dmi'
+ icon_state = "gps-c"
+ w_class = WEIGHT_CLASS_SMALL
+ slot_flags = ITEM_SLOT_BELT
+ obj_flags = UNIQUE_RENAME
+ var/gpstag = "COM0"
+ var/emped = FALSE
+ var/tracking = TRUE
+ var/updating = TRUE //Automatic updating of GPS list. Can be set to manual by user.
+ var/global_mode = TRUE //If disabled, only GPS signals of the same Z level are shown
+
+/obj/item/gps/examine(mob/user)
+ . = ..()
+ . += "Alt-click to switch it [tracking ? "off":"on"]."
+
+/obj/item/gps/Initialize()
+ . = ..()
+ GLOB.GPS_list += src
+ name = "global positioning system ([gpstag])"
+ add_overlay("working")
+
+/obj/item/gps/Destroy()
+ GLOB.GPS_list -= src
+ return ..()
+
+/obj/item/gps/emp_act(severity)
+ . = ..()
+ if (. & EMP_PROTECT_SELF)
+ return
+ emped = TRUE
+ cut_overlay("working")
+ add_overlay("emp")
+ addtimer(CALLBACK(src, .proc/reboot), 300, TIMER_UNIQUE|TIMER_OVERRIDE) //if a new EMP happens, remove the old timer so it doesn't reactivate early
+ SStgui.close_uis(src) //Close the UI control if it is open.
+
+/obj/item/gps/proc/reboot()
+ emped = FALSE
+ cut_overlay("emp")
+ add_overlay("working")
+
+/obj/item/gps/AltClick(mob/user)
+ . = ..()
+ if(!user.canUseTopic(src, BE_CLOSE))
+ return
+ toggletracking(user)
+ return TRUE
+
+/obj/item/gps/proc/toggletracking(mob/user)
+ if(!user.canUseTopic(src, BE_CLOSE))
+ return //user not valid to use gps
+ if(emped)
+ to_chat(user, "It's busted!")
+ return
+ if(tracking)
+ cut_overlay("working")
+ to_chat(user, "[src] is no longer tracking, or visible to other GPS devices.")
+ tracking = FALSE
+ else
+ add_overlay("working")
+ to_chat(user, "[src] is now tracking, and visible to other GPS devices.")
+ tracking = TRUE
+
+
+/obj/item/gps/ui_interact(mob/user, ui_key = "gps", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.default_state) // Remember to use the appropriate state.
+ if(emped)
+ to_chat(user, "[src] fizzles weakly.")
+ return
+ ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
+ if(!ui)
+ // Variable window height, depending on how many GPS units there are
+ // to show, clamped to relatively safe range.
+ var/gps_window_height = CLAMP(325 + GLOB.GPS_list.len * 14, 325, 700)
+ ui = new(user, src, ui_key, "gps", "Global Positioning System", 470, gps_window_height, master_ui, state) //width, height
+ ui.open()
+
+ ui.set_autoupdate(state = updating)
+
+
+/obj/item/gps/ui_data(mob/user)
+ var/list/data = list()
+ data["power"] = tracking
+ data["tag"] = gpstag
+ data["updating"] = updating
+ data["globalmode"] = global_mode
+ if(!tracking || emped) //Do not bother scanning if the GPS is off or EMPed
+ return data
+
+ var/turf/curr = get_turf(src)
+ data["current"] = "[get_area_name(curr, TRUE)] ([curr.x], [curr.y], [curr.z])"
+ data["currentArea"] = "[get_area_name(curr, TRUE)]"
+ data["currentCoords"] = "[curr.x], [curr.y], [curr.z]"
+
+ var/list/signals = list()
+ data["signals"] = list()
+
+ for(var/gps in GLOB.GPS_list)
+ var/obj/item/gps/G = gps
+ if(G.emped || !G.tracking || G == src)
+ continue
+ var/turf/pos = get_turf(G)
+ if(!global_mode && pos.z != curr.z)
+ continue
+ var/list/signal = list()
+ signal["entrytag"] = G.gpstag //Name or 'tag' of the GPS
+ signal["coords"] = "[pos.x], [pos.y], [pos.z]"
+ if(pos.z == curr.z) //Distance/Direction calculations for same z-level only
+ signal["dist"] = max(get_dist(curr, pos), 0) //Distance between the src and remote GPS turfs
+ signal["degrees"] = round(Get_Angle(curr, pos)) //0-360 degree directional bearing, for more precision.
+
+ signals += list(signal) //Add this signal to the list of signals
+ data["signals"] = signals
+ return data
+
+
+
+/obj/item/gps/ui_act(action, params)
+ if(..())
+ return
+ switch(action)
+ if("rename")
+ var/a = input("Please enter desired tag.", name, gpstag) as text
+ a = copytext(sanitize(a), 1, 20)
+ gpstag = a
+ . = TRUE
+ name = "global positioning system ([gpstag])"
+
+ if("power")
+ toggletracking(usr)
+ . = TRUE
+ if("updating")
+ updating = !updating
+ . = TRUE
+ if("globalmode")
+ global_mode = !global_mode
+ . = TRUE
+
+
+/obj/item/gps/science
+ icon_state = "gps-s"
+ gpstag = "SCI0"
+
+/obj/item/gps/engineering
+ icon_state = "gps-e"
+ gpstag = "ENG0"
+
+/obj/item/gps/mining
+ icon_state = "gps-m"
+ gpstag = "MINE0"
+ desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
+
+/obj/item/gps/cyborg
+ icon_state = "gps-b"
+ gpstag = "BORG0"
+ desc = "A mining cyborg internal positioning system. Used as a recovery beacon for damaged cyborg assets, or a collaboration tool for mining teams."
+
+/obj/item/gps/cyborg/Initialize()
+ . = ..()
+ ADD_TRAIT(src, TRAIT_NODROP, CYBORG_ITEM_TRAIT)
+
+/obj/item/gps/internal
+ icon_state = null
+ item_flags = ABSTRACT
+ gpstag = "Eerie Signal"
+ desc = "Report to a coder immediately."
+ invisibility = INVISIBILITY_MAXIMUM
+ var/obj/item/implant/gps/implant
+
+/obj/item/gps/internal/Initialize(mapload, obj/item/implant/gps/_implant)
+ . = ..()
+ implant = _implant
+
+/obj/item/gps/internal/Destroy()
+ if(implant?.imp_in)
+ qdel(implant)
+ else
+ return ..()
+
+/obj/item/gps/internal/mining
+ icon_state = "gps-m"
+ gpstag = "MINER"
+ desc = "A positioning system helpful for rescuing trapped or injured miners, keeping one on you at all times while mining might just save your life."
+
+/obj/item/gps/internal/base
+ gpstag = "NT_AUX"
+ desc = "A homing signal from Kinaris's mining base."
+
+/obj/item/gps/visible_debug
+ name = "visible GPS"
+ gpstag = "ADMIN"
+ desc = "This admin-spawn GPS unit leaves the coordinates visible \
+ on any turf that it passes over, for debugging. Especially useful \
+ for marking the area around the transition edges."
+ var/list/turf/tagged
+
+/obj/item/gps/visible_debug/Initialize()
+ . = ..()
+ tagged = list()
+ START_PROCESSING(SSfastprocess, src)
+
+/obj/item/gps/visible_debug/process()
+ var/turf/T = get_turf(src)
+ if(T)
+ // I assume it's faster to color,tag and OR the turf in, rather
+ // then checking if its there
+ T.color = RANDOM_COLOUR
+ T.maptext = "[T.x],[T.y],[T.z]"
+ tagged |= T
+
+/obj/item/gps/visible_debug/proc/clear()
+ while(tagged.len)
+ var/turf/T = pop(tagged)
+ T.color = initial(T.color)
+ T.maptext = initial(T.maptext)
+
+/obj/item/gps/visible_debug/Destroy()
+ if(tagged)
+ clear()
+ tagged = null
+ STOP_PROCESSING(SSfastprocess, src)
+ . = ..()
diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm
index 7823e6bf..3c235de1 100644
--- a/code/game/objects/items/devices/radio/radio.dm
+++ b/code/game/objects/items/devices/radio/radio.dm
@@ -1,428 +1,435 @@
-/obj/item/radio
- icon = 'icons/obj/radio.dmi'
- name = "station bounced radio"
- icon_state = "walkietalkie"
- item_state = "walkietalkie"
- desc = "A basic handheld radio that communicates with local telecommunication networks."
- dog_fashion = /datum/dog_fashion/back
-
- flags_1 = CONDUCT_1 | HEAR_1
- slot_flags = ITEM_SLOT_BELT
- throw_speed = 3
- throw_range = 7
- w_class = WEIGHT_CLASS_SMALL
- materials = list(MAT_METAL=75, MAT_GLASS=25)
- obj_flags = USES_TGUI
-
- var/on = TRUE
- var/frequency = FREQ_COMMON
- var/canhear_range = 3 // The range around the radio in which mobs can hear what it receives.
- var/emped = 0 // Tracks the number of EMPs currently stacked.
-
- var/broadcasting = FALSE // Whether the radio will transmit dialogue it hears nearby.
- var/listening = TRUE // Whether the radio is currently receiving.
- var/prison_radio = FALSE // If true, the transmit wire starts cut.
- var/unscrewed = FALSE // Whether wires are accessible. Toggleable by screwdrivering.
- var/freerange = FALSE // If true, the radio has access to the full spectrum.
- var/subspace_transmission = FALSE // If true, the radio transmits and receives on subspace exclusively.
- var/subspace_switchable = FALSE // If true, subspace_transmission can be toggled at will.
- var/freqlock = FALSE // Frequency lock to stop the user from untuning specialist radios.
- var/use_command = FALSE // If true, broadcasts will be large and BOLD.
- var/command = FALSE // If true, use_command can be toggled at will.
-
- // Encryption key handling
- var/obj/item/encryptionkey/keyslot
- var/translate_binary = FALSE // If true, can hear the special binary channel.
- var/independent = FALSE // If true, can say/hear on the special CentCom channel.
- var/syndie = FALSE // If true, hears all well-known channels automatically, and can say/hear on the Syndicate channel.
- var/list/channels = list() // Map from name (see communications.dm) to on/off. First entry is current department (:h).
- var/list/secure_radio_connections
-
- var/const/FREQ_LISTENING = 1
- //FREQ_BROADCASTING = 2
-
-/obj/item/radio/suicide_act(mob/living/user)
- user.visible_message("[user] starts bouncing [src] off [user.p_their()] head! It looks like [user.p_theyre()] trying to commit suicide!")
- return BRUTELOSS
-
-/obj/item/radio/proc/set_frequency(new_frequency)
- SEND_SIGNAL(src, COMSIG_RADIO_NEW_FREQUENCY, args)
- remove_radio(src, frequency)
- frequency = add_radio(src, new_frequency)
-
-/obj/item/radio/proc/recalculateChannels()
- channels = list()
- translate_binary = FALSE
- syndie = FALSE
- independent = FALSE
-
- if(keyslot)
- for(var/ch_name in keyslot.channels)
- if(!(ch_name in channels))
- channels[ch_name] = keyslot.channels[ch_name]
-
- if(keyslot.translate_binary)
- translate_binary = TRUE
- if(keyslot.syndie)
- syndie = TRUE
- if(keyslot.independent)
- independent = TRUE
-
- for(var/ch_name in channels)
- secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
-
-/obj/item/radio/proc/make_syndie() // Turns normal radios into Syndicate radios!
- qdel(keyslot)
- keyslot = new /obj/item/encryptionkey/syndicate
- syndie = 1
- recalculateChannels()
-
-/obj/item/radio/Destroy()
- remove_radio_all(src) //Just to be sure
- QDEL_NULL(wires)
- QDEL_NULL(keyslot)
- return ..()
-
-/obj/item/radio/Initialize()
- wires = new /datum/wires/radio(src)
- if(prison_radio)
- wires.cut(WIRE_TX) // OH GOD WHY
- secure_radio_connections = new
- . = ..()
- frequency = sanitize_frequency(frequency, freerange)
- set_frequency(frequency)
-
- for(var/ch_name in channels)
- secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
-
-/obj/item/radio/ComponentInitialize()
- . = ..()
- AddComponent(/datum/component/empprotection, EMP_PROTECT_WIRES)
-
-/obj/item/radio/interact(mob/user)
- if(unscrewed && !isAI(user))
- wires.interact(user)
- add_fingerprint(user)
- else
- ..()
-
-/obj/item/radio/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
- datum/tgui/master_ui = null, datum/ui_state/state = GLOB.inventory_state)
- . = ..()
- ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
- if(!ui)
- ui = new(user, src, ui_key, "radio", name, 370, 220 + channels.len * 22, master_ui, state)
- ui.open()
-
-/obj/item/radio/ui_data(mob/user)
- var/list/data = list()
-
- data["broadcasting"] = broadcasting
- data["listening"] = listening
- data["frequency"] = frequency
- data["minFrequency"] = freerange ? MIN_FREE_FREQ : MIN_FREQ
- data["maxFrequency"] = freerange ? MAX_FREE_FREQ : MAX_FREQ
- data["freqlock"] = freqlock
- data["channels"] = list()
- for(var/channel in channels)
- data["channels"][channel] = channels[channel] & FREQ_LISTENING
- data["command"] = command
- data["useCommand"] = use_command
- data["subspace"] = subspace_transmission
- data["subspaceSwitchable"] = subspace_switchable
- data["headset"] = istype(src, /obj/item/radio/headset)
-
- return data
-
-/obj/item/radio/ui_act(action, params, datum/tgui/ui)
- if(..())
- return
- switch(action)
- if("frequency")
- if(freqlock)
- return
- var/tune = params["tune"]
- var/adjust = text2num(params["adjust"])
- if(tune == "input")
- var/min = format_frequency(freerange ? MIN_FREE_FREQ : MIN_FREQ)
- var/max = format_frequency(freerange ? MAX_FREE_FREQ : MAX_FREQ)
- tune = input("Tune frequency ([min]-[max]):", name, format_frequency(frequency)) as null|num
- if(!isnull(tune) && !..())
- if (tune < MIN_FREE_FREQ && tune <= MAX_FREE_FREQ / 10)
- // allow typing 144.7 to get 1447
- tune *= 10
- . = TRUE
- else if(adjust)
- tune = frequency + adjust * 10
- . = TRUE
- else if(text2num(tune) != null)
- tune = tune * 10
- . = TRUE
- if(.)
- set_frequency(sanitize_frequency(tune, freerange))
- if("listen")
- listening = !listening
- . = TRUE
- if("broadcast")
- broadcasting = !broadcasting
- . = TRUE
- if("channel")
- var/channel = params["channel"]
- if(!(channel in channels))
- return
- if(channels[channel] & FREQ_LISTENING)
- channels[channel] &= ~FREQ_LISTENING
- else
- channels[channel] |= FREQ_LISTENING
- . = TRUE
- if("command")
- use_command = !use_command
- . = TRUE
- if("subspace")
- if(subspace_switchable)
- subspace_transmission = !subspace_transmission
- if(!subspace_transmission)
- channels = list()
- else
- recalculateChannels()
- . = TRUE
-
-/obj/item/radio/talk_into(atom/movable/M, message, channel, list/spans, datum/language/language)
- if(!spans)
- spans = list(M.speech_span)
- if(!language)
- language = M.get_default_language()
- INVOKE_ASYNC(src, .proc/talk_into_impl, M, message, channel, spans.Copy(), language)
- return ITALICS | REDUCE_RANGE
-
-/obj/item/radio/proc/talk_into_impl(atom/movable/M, message, channel, list/spans, datum/language/language)
- if(!on)
- return // the device has to be on
- if(!M || !message)
- return
- if(wires.is_cut(WIRE_TX)) // Permacell and otherwise tampered-with radios
- return
- if(!M.IsVocal())
- return
-
- if(use_command)
- spans |= SPAN_COMMAND
-
- /*
- Roughly speaking, radios attempt to make a subspace transmission (which
- is received, processed, and rebroadcast by the telecomms satellite) and
- if that fails, they send a mundane radio transmission.
-
- Headsets cannot send/receive mundane transmissions, only subspace.
- Syndicate radios can hear transmissions on all well-known frequencies.
- CentCom radios can hear the CentCom frequency no matter what.
- */
-
- // From the channel, determine the frequency and get a reference to it.
- var/freq
- if(channel && channels && channels.len > 0)
- if(channel == MODE_DEPARTMENT)
- channel = channels[1]
- freq = secure_radio_connections[channel]
- if (!channels[channel]) // if the channel is turned off, don't broadcast
- return
- else
- freq = frequency
- channel = null
-
- // Nearby active jammers severely gibberish the message
- var/turf/position = get_turf(src)
- for(var/obj/item/jammer/jammer in GLOB.active_jammers)
- var/turf/jammer_turf = get_turf(jammer)
- if(position.z == jammer_turf.z && (get_dist(position, jammer_turf) < jammer.range))
- message = Gibberish(message,100)
- break
-
- // Determine the identity information which will be attached to the signal.
- var/atom/movable/virtualspeaker/speaker = new(null, M, src)
-
- // Construct the signal
- var/datum/signal/subspace/vocal/signal = new(src, freq, speaker, language, message, spans)
-
- // Independent radios, on the CentCom frequency, reach all independent radios
- if (independent && (freq == FREQ_CENTCOM || freq == FREQ_CTF_RED || freq == FREQ_CTF_BLUE))
- signal.data["compression"] = 0
- signal.transmission_method = TRANSMISSION_SUPERSPACE
- signal.levels = list(0) // reaches all Z-levels
- signal.broadcast()
- return
-
- // All radios make an attempt to use the subspace system first
- signal.send_to_receivers()
-
- // If the radio is subspace-only, that's all it can do
- if (subspace_transmission)
- return
-
- // Non-subspace radios will check in a couple of seconds, and if the signal
- // was never received, send a mundane broadcast (no headsets).
- addtimer(CALLBACK(src, .proc/backup_transmission, signal), 20)
-
-/obj/item/radio/proc/backup_transmission(datum/signal/subspace/vocal/signal)
- var/turf/T = get_turf(src)
- if (signal.data["done"] && (T.z in signal.levels))
- return
-
- // Okay, the signal was never processed, send a mundane broadcast.
- signal.data["compression"] = 0
- signal.transmission_method = TRANSMISSION_RADIO
- signal.levels = list(T.z)
- signal.broadcast()
-
-/obj/item/radio/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
- . = ..()
- if(radio_freq || !broadcasting || get_dist(src, speaker) > canhear_range)
- return
-
- if(message_mode == MODE_WHISPER || message_mode == MODE_WHISPER_CRIT)
- // radios don't pick up whispers very well
- raw_message = stars(raw_message)
- else if(message_mode == MODE_L_HAND || message_mode == MODE_R_HAND)
- // try to avoid being heard double
- if (loc == speaker && ismob(speaker))
- var/mob/M = speaker
- var/idx = M.get_held_index_of_item(src)
- // left hands are odd slots
- if (idx && (idx % 2) == (message_mode == MODE_L_HAND))
- return
-
- talk_into(speaker, raw_message, , spans, language=message_language)
-
-// Checks if this radio can receive on the given frequency.
-/obj/item/radio/proc/can_receive(freq, level)
- // deny checks
- if (!on || !listening || wires.is_cut(WIRE_RX))
- return FALSE
- if (freq == FREQ_SYNDICATE && !syndie)
- return FALSE
- if (freq == FREQ_CENTCOM)
- return independent // hard-ignores the z-level check
- if (!(0 in level))
- var/turf/position = get_turf(src)
- if(!position || !(position.z in level))
- return FALSE
-
- // allow checks: are we listening on that frequency?
- if (freq == frequency)
- return TRUE
- for(var/ch_name in channels)
- if(channels[ch_name] & FREQ_LISTENING)
- //the GLOB.radiochannels list is located in communications.dm
- if(GLOB.radiochannels[ch_name] == text2num(freq) || syndie)
- return TRUE
- return FALSE
-
-
-/obj/item/radio/examine(mob/user)
- . = ..()
- if (unscrewed)
- . += "It can be attached and modified."
- else
- . += "It cannot be modified or attached."
-
-/obj/item/radio/attackby(obj/item/W, mob/user, params)
- add_fingerprint(user)
- if(istype(W, /obj/item/screwdriver))
- unscrewed = !unscrewed
- if(unscrewed)
- to_chat(user, "The radio can now be attached and modified!")
- else
- to_chat(user, "The radio can no longer be modified or attached!")
- else
- return ..()
-
-/obj/item/radio/emp_act(severity)
- . = ..()
- if (. & EMP_PROTECT_SELF)
- return
- emped++ //There's been an EMP; better count it
- var/curremp = emped //Remember which EMP this was
- if (listening && ismob(loc)) // if the radio is turned on and on someone's person they notice
- to_chat(loc, "\The [src] overloads.")
- broadcasting = FALSE
- listening = FALSE
- for (var/ch_name in channels)
- channels[ch_name] = 0
- on = FALSE
- spawn(200)
- if(emped == curremp) //Don't fix it if it's been EMP'd again
- emped = 0
- if (!istype(src, /obj/item/radio/intercom)) // intercoms will turn back on on their own
- on = TRUE
-
-///////////////////////////////
-//////////Borg Radios//////////
-///////////////////////////////
-//Giving borgs their own radio to have some more room to work with -Sieve
-
-/obj/item/radio/borg
- name = "cyborg radio"
- subspace_switchable = TRUE
- dog_fashion = null
-
-/obj/item/radio/borg/Initialize(mapload)
- . = ..()
-
-/obj/item/radio/borg/syndicate
- syndie = 1
- keyslot = new /obj/item/encryptionkey/syndicate
-
-/obj/item/radio/borg/syndicate/Initialize()
- . = ..()
- set_frequency(FREQ_SYNDICATE)
-
-/obj/item/radio/borg/attackby(obj/item/W, mob/user, params)
-
- if(istype(W, /obj/item/screwdriver))
- if(keyslot)
- for(var/ch_name in channels)
- SSradio.remove_object(src, GLOB.radiochannels[ch_name])
- secure_radio_connections[ch_name] = null
-
-
- if(keyslot)
- var/turf/T = get_turf(user)
- if(T)
- keyslot.forceMove(T)
- keyslot = null
-
- recalculateChannels()
- to_chat(user, "You pop out the encryption key in the radio.")
-
- else
- to_chat(user, "This radio doesn't have any encryption keys!")
-
- else if(istype(W, /obj/item/encryptionkey/))
- if(keyslot)
- to_chat(user, "The radio can't hold another key!")
- return
-
- if(!keyslot)
- if(!user.transferItemToLoc(W, src))
- return
- keyslot = W
-
- recalculateChannels()
-
-
-/obj/item/radio/off // Station bounced radios, their only difference is spawning with the speakers off, this was made to help the lag.
- listening = 0 // And it's nice to have a subtype too for future features.
- dog_fashion = /datum/dog_fashion/back
-
-/obj/item/radio/internal
- var/obj/item/implant/radio/implant
-
-/obj/item/radio/internal/Initialize(mapload, obj/item/implant/radio/_implant)
- . = ..()
- implant = _implant
-
-/obj/item/radio/internal/Destroy()
- if(implant?.imp_in)
- qdel(implant)
- else
- return ..()
+/obj/item/radio
+ icon = 'icons/obj/radio.dmi'
+ name = "station bounced radio"
+ icon_state = "walkietalkie"
+ item_state = "walkietalkie"
+ desc = "A basic handheld radio that communicates with local telecommunication networks."
+ dog_fashion = /datum/dog_fashion/back
+
+ flags_1 = CONDUCT_1 | HEAR_1
+ slot_flags = ITEM_SLOT_BELT
+ throw_speed = 3
+ throw_range = 7
+ w_class = WEIGHT_CLASS_SMALL
+ materials = list(MAT_METAL=75, MAT_GLASS=25)
+ obj_flags = USES_TGUI
+
+ var/on = TRUE
+ var/frequency = FREQ_COMMON
+ var/canhear_range = 3 // The range around the radio in which mobs can hear what it receives.
+ var/emped = 0 // Tracks the number of EMPs currently stacked.
+
+ var/broadcasting = FALSE // Whether the radio will transmit dialogue it hears nearby.
+ var/listening = TRUE // Whether the radio is currently receiving.
+ var/prison_radio = FALSE // If true, the transmit wire starts cut.
+ var/unscrewed = FALSE // Whether wires are accessible. Toggleable by screwdrivering.
+ var/freerange = FALSE // If true, the radio has access to the full spectrum.
+ var/subspace_transmission = FALSE // If true, the radio transmits and receives on subspace exclusively.
+ var/subspace_switchable = FALSE // If true, subspace_transmission can be toggled at will.
+ var/freqlock = FALSE // Frequency lock to stop the user from untuning specialist radios.
+ var/use_command = FALSE // If true, broadcasts will be large and BOLD.
+ var/command = FALSE // If true, use_command can be toggled at will.
+
+ // Encryption key handling
+ var/obj/item/encryptionkey/keyslot
+ var/translate_binary = FALSE // If true, can hear the special binary channel.
+ var/independent = FALSE // If true, can say/hear on the special CentCom channel.
+ var/syndie = FALSE // If true, hears all well-known channels automatically, and can say/hear on the Syndicate channel.
+ var/list/channels = list() // Map from name (see communications.dm) to on/off. First entry is current department (:h).
+ var/list/secure_radio_connections
+
+ var/const/FREQ_LISTENING = 1
+ //FREQ_BROADCASTING = 2
+
+/obj/item/radio/suicide_act(mob/living/user)
+ user.visible_message("[user] starts bouncing [src] off [user.p_their()] head! It looks like [user.p_theyre()] trying to commit suicide!")
+ return BRUTELOSS
+
+/obj/item/radio/proc/set_frequency(new_frequency)
+ SEND_SIGNAL(src, COMSIG_RADIO_NEW_FREQUENCY, args)
+ remove_radio(src, frequency)
+ frequency = add_radio(src, new_frequency)
+
+/obj/item/radio/proc/recalculateChannels()
+ channels = list()
+ translate_binary = FALSE
+ syndie = FALSE
+ independent = FALSE
+
+ if(keyslot)
+ for(var/ch_name in keyslot.channels)
+ if(!(ch_name in channels))
+ channels[ch_name] = keyslot.channels[ch_name]
+
+ if(keyslot.translate_binary)
+ translate_binary = TRUE
+ if(keyslot.syndie)
+ syndie = TRUE
+ if(keyslot.independent)
+ independent = TRUE
+
+ for(var/ch_name in channels)
+ secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
+
+/obj/item/radio/proc/make_syndie() // Turns normal radios into Syndicate radios!
+ qdel(keyslot)
+ keyslot = new /obj/item/encryptionkey/syndicate
+ syndie = 1
+ recalculateChannels()
+
+/obj/item/radio/Destroy()
+ remove_radio_all(src) //Just to be sure
+ QDEL_NULL(wires)
+ QDEL_NULL(keyslot)
+ return ..()
+
+/obj/item/radio/Initialize()
+ wires = new /datum/wires/radio(src)
+ if(prison_radio)
+ wires.cut(WIRE_TX) // OH GOD WHY
+ secure_radio_connections = new
+ . = ..()
+ frequency = sanitize_frequency(frequency, freerange)
+ set_frequency(frequency)
+
+ for(var/ch_name in channels)
+ secure_radio_connections[ch_name] = add_radio(src, GLOB.radiochannels[ch_name])
+
+/obj/item/radio/ComponentInitialize()
+ . = ..()
+ AddComponent(/datum/component/empprotection, EMP_PROTECT_WIRES)
+
+/obj/item/radio/interact(mob/user)
+ if(unscrewed && !isAI(user))
+ wires.interact(user)
+ add_fingerprint(user)
+ else
+ ..()
+
+/obj/item/radio/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, \
+ datum/tgui/master_ui = null, datum/ui_state/state = GLOB.inventory_state)
+ . = ..()
+ ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
+ if(!ui)
+ var/ui_width = 360
+ var/ui_height = 106
+ if(subspace_transmission)
+ if(channels.len > 0)
+ ui_height += 6 + channels.len * 21
+ else
+ ui_height += 24
+ ui = new(user, src, ui_key, "radio", name, ui_width, ui_height, master_ui, state)
+ ui.open()
+
+/obj/item/radio/ui_data(mob/user)
+ var/list/data = list()
+
+ data["broadcasting"] = broadcasting
+ data["listening"] = listening
+ data["frequency"] = frequency
+ data["minFrequency"] = freerange ? MIN_FREE_FREQ : MIN_FREQ
+ data["maxFrequency"] = freerange ? MAX_FREE_FREQ : MAX_FREQ
+ data["freqlock"] = freqlock
+ data["channels"] = list()
+ for(var/channel in channels)
+ data["channels"][channel] = channels[channel] & FREQ_LISTENING
+ data["command"] = command
+ data["useCommand"] = use_command
+ data["subspace"] = subspace_transmission
+ data["subspaceSwitchable"] = subspace_switchable
+ data["headset"] = istype(src, /obj/item/radio/headset)
+
+ return data
+
+/obj/item/radio/ui_act(action, params, datum/tgui/ui)
+ if(..())
+ return
+ switch(action)
+ if("frequency")
+ if(freqlock)
+ return
+ var/tune = params["tune"]
+ var/adjust = text2num(params["adjust"])
+ if(tune == "input")
+ var/min = format_frequency(freerange ? MIN_FREE_FREQ : MIN_FREQ)
+ var/max = format_frequency(freerange ? MAX_FREE_FREQ : MAX_FREQ)
+ tune = input("Tune frequency ([min]-[max]):", name, format_frequency(frequency)) as null|num
+ if(!isnull(tune) && !..())
+ if (tune < MIN_FREE_FREQ && tune <= MAX_FREE_FREQ / 10)
+ // allow typing 144.7 to get 1447
+ tune *= 10
+ . = TRUE
+ else if(adjust)
+ tune = frequency + adjust * 10
+ . = TRUE
+ else if(text2num(tune) != null)
+ tune = tune * 10
+ . = TRUE
+ if(.)
+ set_frequency(sanitize_frequency(tune, freerange))
+ if("listen")
+ listening = !listening
+ . = TRUE
+ if("broadcast")
+ broadcasting = !broadcasting
+ . = TRUE
+ if("channel")
+ var/channel = params["channel"]
+ if(!(channel in channels))
+ return
+ if(channels[channel] & FREQ_LISTENING)
+ channels[channel] &= ~FREQ_LISTENING
+ else
+ channels[channel] |= FREQ_LISTENING
+ . = TRUE
+ if("command")
+ use_command = !use_command
+ . = TRUE
+ if("subspace")
+ if(subspace_switchable)
+ subspace_transmission = !subspace_transmission
+ if(!subspace_transmission)
+ channels = list()
+ else
+ recalculateChannels()
+ . = TRUE
+
+/obj/item/radio/talk_into(atom/movable/M, message, channel, list/spans, datum/language/language)
+ if(!spans)
+ spans = list(M.speech_span)
+ if(!language)
+ language = M.get_default_language()
+ INVOKE_ASYNC(src, .proc/talk_into_impl, M, message, channel, spans.Copy(), language)
+ return ITALICS | REDUCE_RANGE
+
+/obj/item/radio/proc/talk_into_impl(atom/movable/M, message, channel, list/spans, datum/language/language)
+ if(!on)
+ return // the device has to be on
+ if(!M || !message)
+ return
+ if(wires.is_cut(WIRE_TX)) // Permacell and otherwise tampered-with radios
+ return
+ if(!M.IsVocal())
+ return
+
+ if(use_command)
+ spans |= SPAN_COMMAND
+
+ /*
+ Roughly speaking, radios attempt to make a subspace transmission (which
+ is received, processed, and rebroadcast by the telecomms satellite) and
+ if that fails, they send a mundane radio transmission.
+
+ Headsets cannot send/receive mundane transmissions, only subspace.
+ Syndicate radios can hear transmissions on all well-known frequencies.
+ CentCom radios can hear the CentCom frequency no matter what.
+ */
+
+ // From the channel, determine the frequency and get a reference to it.
+ var/freq
+ if(channel && channels && channels.len > 0)
+ if(channel == MODE_DEPARTMENT)
+ channel = channels[1]
+ freq = secure_radio_connections[channel]
+ if (!channels[channel]) // if the channel is turned off, don't broadcast
+ return
+ else
+ freq = frequency
+ channel = null
+
+ // Nearby active jammers severely gibberish the message
+ var/turf/position = get_turf(src)
+ for(var/obj/item/jammer/jammer in GLOB.active_jammers)
+ var/turf/jammer_turf = get_turf(jammer)
+ if(position.z == jammer_turf.z && (get_dist(position, jammer_turf) < jammer.range))
+ message = Gibberish(message,100)
+ break
+
+ // Determine the identity information which will be attached to the signal.
+ var/atom/movable/virtualspeaker/speaker = new(null, M, src)
+
+ // Construct the signal
+ var/datum/signal/subspace/vocal/signal = new(src, freq, speaker, language, message, spans)
+
+ // Independent radios, on the CentCom frequency, reach all independent radios
+ if (independent && (freq == FREQ_CENTCOM || freq == FREQ_CTF_RED || freq == FREQ_CTF_BLUE))
+ signal.data["compression"] = 0
+ signal.transmission_method = TRANSMISSION_SUPERSPACE
+ signal.levels = list(0) // reaches all Z-levels
+ signal.broadcast()
+ return
+
+ // All radios make an attempt to use the subspace system first
+ signal.send_to_receivers()
+
+ // If the radio is subspace-only, that's all it can do
+ if (subspace_transmission)
+ return
+
+ // Non-subspace radios will check in a couple of seconds, and if the signal
+ // was never received, send a mundane broadcast (no headsets).
+ addtimer(CALLBACK(src, .proc/backup_transmission, signal), 20)
+
+/obj/item/radio/proc/backup_transmission(datum/signal/subspace/vocal/signal)
+ var/turf/T = get_turf(src)
+ if (signal.data["done"] && (T.z in signal.levels))
+ return
+
+ // Okay, the signal was never processed, send a mundane broadcast.
+ signal.data["compression"] = 0
+ signal.transmission_method = TRANSMISSION_RADIO
+ signal.levels = list(T.z)
+ signal.broadcast()
+
+/obj/item/radio/Hear(message, atom/movable/speaker, message_language, raw_message, radio_freq, list/spans, message_mode, atom/movable/source)
+ . = ..()
+ if(radio_freq || !broadcasting || get_dist(src, speaker) > canhear_range)
+ return
+
+ if(message_mode == MODE_WHISPER || message_mode == MODE_WHISPER_CRIT)
+ // radios don't pick up whispers very well
+ raw_message = stars(raw_message)
+ else if(message_mode == MODE_L_HAND || message_mode == MODE_R_HAND)
+ // try to avoid being heard double
+ if (loc == speaker && ismob(speaker))
+ var/mob/M = speaker
+ var/idx = M.get_held_index_of_item(src)
+ // left hands are odd slots
+ if (idx && (idx % 2) == (message_mode == MODE_L_HAND))
+ return
+
+ talk_into(speaker, raw_message, , spans, language=message_language)
+
+// Checks if this radio can receive on the given frequency.
+/obj/item/radio/proc/can_receive(freq, level)
+ // deny checks
+ if (!on || !listening || wires.is_cut(WIRE_RX))
+ return FALSE
+ if (freq == FREQ_SYNDICATE && !syndie)
+ return FALSE
+ if (freq == FREQ_CENTCOM)
+ return independent // hard-ignores the z-level check
+ if (!(0 in level))
+ var/turf/position = get_turf(src)
+ if(!position || !(position.z in level))
+ return FALSE
+
+ // allow checks: are we listening on that frequency?
+ if (freq == frequency)
+ return TRUE
+ for(var/ch_name in channels)
+ if(channels[ch_name] & FREQ_LISTENING)
+ //the GLOB.radiochannels list is located in communications.dm
+ if(GLOB.radiochannels[ch_name] == text2num(freq) || syndie)
+ return TRUE
+ return FALSE
+
+
+/obj/item/radio/examine(mob/user)
+ . = ..()
+ if (unscrewed)
+ . += "It can be attached and modified."
+ else
+ . += "It cannot be modified or attached."
+
+/obj/item/radio/attackby(obj/item/W, mob/user, params)
+ add_fingerprint(user)
+ if(istype(W, /obj/item/screwdriver))
+ unscrewed = !unscrewed
+ if(unscrewed)
+ to_chat(user, "The radio can now be attached and modified!")
+ else
+ to_chat(user, "The radio can no longer be modified or attached!")
+ else
+ return ..()
+
+/obj/item/radio/emp_act(severity)
+ . = ..()
+ if (. & EMP_PROTECT_SELF)
+ return
+ emped++ //There's been an EMP; better count it
+ var/curremp = emped //Remember which EMP this was
+ if (listening && ismob(loc)) // if the radio is turned on and on someone's person they notice
+ to_chat(loc, "\The [src] overloads.")
+ broadcasting = FALSE
+ listening = FALSE
+ for (var/ch_name in channels)
+ channels[ch_name] = 0
+ on = FALSE
+ spawn(200)
+ if(emped == curremp) //Don't fix it if it's been EMP'd again
+ emped = 0
+ if (!istype(src, /obj/item/radio/intercom)) // intercoms will turn back on on their own
+ on = TRUE
+
+///////////////////////////////
+//////////Borg Radios//////////
+///////////////////////////////
+//Giving borgs their own radio to have some more room to work with -Sieve
+
+/obj/item/radio/borg
+ name = "cyborg radio"
+ subspace_switchable = TRUE
+ dog_fashion = null
+
+/obj/item/radio/borg/Initialize(mapload)
+ . = ..()
+
+/obj/item/radio/borg/syndicate
+ syndie = 1
+ keyslot = new /obj/item/encryptionkey/syndicate
+
+/obj/item/radio/borg/syndicate/Initialize()
+ . = ..()
+ set_frequency(FREQ_SYNDICATE)
+
+/obj/item/radio/borg/attackby(obj/item/W, mob/user, params)
+
+ if(istype(W, /obj/item/screwdriver))
+ if(keyslot)
+ for(var/ch_name in channels)
+ SSradio.remove_object(src, GLOB.radiochannels[ch_name])
+ secure_radio_connections[ch_name] = null
+
+
+ if(keyslot)
+ var/turf/T = get_turf(user)
+ if(T)
+ keyslot.forceMove(T)
+ keyslot = null
+
+ recalculateChannels()
+ to_chat(user, "You pop out the encryption key in the radio.")
+
+ else
+ to_chat(user, "This radio doesn't have any encryption keys!")
+
+ else if(istype(W, /obj/item/encryptionkey/))
+ if(keyslot)
+ to_chat(user, "The radio can't hold another key!")
+ return
+
+ if(!keyslot)
+ if(!user.transferItemToLoc(W, src))
+ return
+ keyslot = W
+
+ recalculateChannels()
+
+
+/obj/item/radio/off // Station bounced radios, their only difference is spawning with the speakers off, this was made to help the lag.
+ listening = 0 // And it's nice to have a subtype too for future features.
+ dog_fashion = /datum/dog_fashion/back
+
+/obj/item/radio/internal
+ var/obj/item/implant/radio/implant
+
+/obj/item/radio/internal/Initialize(mapload, obj/item/implant/radio/_implant)
+ . = ..()
+ implant = _implant
+
+/obj/item/radio/internal/Destroy()
+ if(implant?.imp_in)
+ qdel(implant)
+ else
+ return ..()
diff --git a/code/game/objects/items/eightball.dm b/code/game/objects/items/eightball.dm
index 3e7cec1e..1c3644b8 100644
--- a/code/game/objects/items/eightball.dm
+++ b/code/game/objects/items/eightball.dm
@@ -54,7 +54,7 @@
to_chat(user, "[src] was shaken recently, it needs time to settle.")
return
- user.visible_message("[user] starts shaking [src].", "You start shaking [src].", "You hear shaking and sloshing.")
+ user.visible_message("[user] starts shaking [src].", "You start shaking [src].", "You hear shaking and sloshing.")
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()
@@ -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
+ votes[selected_answer] += 1
+ voted[user.ckey] = selected_answer
. = TRUE
diff --git a/code/game/objects/items/tanks/tanks.dm b/code/game/objects/items/tanks/tanks.dm
index f763fe87..55d8c825 100644
--- a/code/game/objects/items/tanks/tanks.dm
+++ b/code/game/objects/items/tanks/tanks.dm
@@ -156,7 +156,7 @@
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.hands_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "tanks", name, 420, 200, master_ui, state)
+ ui = new(user, src, ui_key, "tanks", name, 400, 120, master_ui, state)
ui.open()
/obj/item/tank/ui_data(mob/user)
diff --git a/code/game/objects/structures/ghost_role_spawners.dm b/code/game/objects/structures/ghost_role_spawners.dm
index 4b0b944f..b31b3cc1 100644
--- a/code/game/objects/structures/ghost_role_spawners.dm
+++ b/code/game/objects/structures/ghost_role_spawners.dm
@@ -12,9 +12,11 @@
roundstart = FALSE
death = FALSE
mob_species = /datum/species/pod
- flavour_text = "You are a sentient ecosystem, an example of the mastery over life that your creators possessed. Your masters, benevolent as they were, created uncounted \
- seed vaults and spread them across the universe to every planet they could chart. You are in one such seed vault. Your goal is to cultivate and spread life wherever it will go while waiting \
- for contact from your creators. Estimated time of last contact: Deployment, 5x10^3 millennia ago."
+ short_desc = "You are a sentient ecosystem, an example of the mastery over life that your creators possessed."
+ flavour_text = "Your masters, benevolent as they were, created uncounted seed vaults and spread them across \
+ the universe to every planet they could chart. You are in one such seed vault. \
+ Your goal is to cultivate and spread life wherever it will go while waiting for contact from your creators. \
+ Estimated time of last contact: Deployment, 5000 millennia ago."
assignedrole = "Lifebringer"
/obj/effect/mob_spawn/human/seed_vault/special(mob/living/new_spawn)
@@ -87,8 +89,9 @@
roundstart = FALSE
death = FALSE
mob_species = /datum/species/shadow
- flavour_text = "You are cursed. Years ago, you sacrificed the lives of your trusted friends and the humanity of yourself to reach the Wish Granter. Though you \
- did so, it has come at a cost: your very body rejects the light, dooming you to wander endlessly in this horrible wasteland."
+ short_desc = "You are cursed."
+ flavour_text = "Years ago, you sacrificed the lives of your trusted friends and the humanity of yourself to reach the Wish Granter. Though you \
+ did so, it has come at a cost: your very body rejects the light, dooming you to wander endlessly in this horrible wasteland."
assignedrole = "Exile"
/obj/effect/mob_spawn/human/exile/Destroy()
@@ -125,9 +128,10 @@
var/has_owner = FALSE
var/can_transfer = TRUE //if golems can switch bodies to this new shell
var/mob/living/owner = null //golem's owner if it has one
- flavour_text = "You are a Free Golem. Your family worships The Liberator. In his infinite and divine wisdom, he set your clan free to \
+ short_desc = "You are a Free Golem. Your family worships The Liberator."
+ flavour_text = "In his infinite and divine wisdom, he set your clan free to \
travel the stars with a single declaration: \"Yeah go do whatever.\" Though you are bound to the one who created you, it is customary in your society to repeat those same words to newborn \
- golems, so that no golem may ever be forced to serve again."
+ golems, so that no golem may ever be forced to serve again."
/obj/effect/mob_spawn/human/golem/Initialize(mapload, datum/species/golem/species = null, mob/creator = null)
if(species) //spawners list uses object name to register so this goes before ..()
@@ -138,8 +142,9 @@
if(!mapload && A)
notify_ghosts("\A [initial(species.prefix)] golem shell has been completed in \the [A.name].", source = src, action=NOTIFY_ATTACK, flashwindow = FALSE, ignore_key = POLL_IGNORE_GOLEM)
if(has_owner && creator)
- flavour_text = "You are a Golem. You move slowly, but are highly resistant to heat and cold as well as blunt trauma. You are unable to wear clothes, but can still use most tools. \
- Serve [creator], and assist [creator.p_them()] in completing [creator.p_their()] goals at any cost."
+ short_desc = "You are a golem."
+ flavour_text = "You move slowly, but are highly resistant to heat and cold as well as blunt trauma. You are unable to wear clothes, but can still use most tools."
+ important_info = "Serve [creator], and assist [creator.p_them()] in completing [creator.p_their()] goals at any cost."
owner = creator
/obj/effect/mob_spawn/human/golem/special(mob/living/new_spawn, name)
@@ -212,8 +217,9 @@
death = FALSE
random = TRUE
mob_species = /datum/species/human
- flavour_text = "You've been stranded in this godless prison of a planet for longer than you can remember. Each day you barely scrape by, and between the terrible \
- conditions of your makeshift shelter, the hostile creatures, and the ash drakes swooping down from the cloudless skies, all you can wish for is the feel of soft grass between your toes and \
+ short_desc = "You've been stranded in this godless prison of a planet for longer than you can remember."
+ flavour_text = "Each day you barely scrape by, and between the terrible conditions of your makeshift shelter, \
+ the hostile creatures, and the ash drakes swooping down from the cloudless skies, all you can wish for is the feel of soft grass between your toes and \
the fresh air of Earth. These thoughts are dispelled by yet another recollection of how you got here... "
assignedrole = "Hermit"
mirrorcanloadappearance = TRUE
@@ -225,20 +231,20 @@
if(1)
flavour_text += "you were a [pick("arms dealer", "shipwright", "docking manager")]'s assistant on a small trading station several sectors from here. Raiders attacked, and there was \
only one pod left when you got to the escape bay. You took it and launched it alone, and the crowd of terrified faces crowding at the airlock door as your pod's engines burst to \
- life and sent you to this hell are forever branded into your memory."
+ life and sent you to this hell are forever branded into your memory."
outfit.uniform = /obj/item/clothing/under/assistantformal
outfit.shoes = /obj/item/clothing/shoes/sneakers/black
outfit.back = /obj/item/storage/backpack
if(2)
flavour_text += "you're an exile from the Tiger Cooperative. Their technological fanaticism drove you to question the power and beliefs of the Exolitics, and they saw you as a \
heretic and subjected you to hours of horrible torture. You were hours away from execution when a high-ranking friend of yours in the Cooperative managed to secure you a pod, \
- scrambled its destination's coordinates, and launched it. You awoke from stasis when you landed and have been surviving - barely - ever since."
+ scrambled its destination's coordinates, and launched it. You awoke from stasis when you landed and have been surviving - barely - ever since."
outfit.uniform = /obj/item/clothing/under/rank/prisoner
outfit.shoes = /obj/item/clothing/shoes/sneakers/orange
outfit.back = /obj/item/storage/backpack
if(3)
flavour_text += "you were a doctor on one of Nanotrasen's space stations, but you left behind that damn corporation's tyranny and everything it stood for. From a metaphorical hell \
- to a literal one, you find yourself nonetheless missing the recycled air and warm floors of what you left behind... but you'd still rather be here than there."
+ to a literal one, you find yourself nonetheless missing the recycled air and warm floors of what you left behind... but you'd still rather be here than there."
outfit.uniform = /obj/item/clothing/under/rank/medical
outfit.suit = /obj/item/clothing/suit/toggle/labcoat
outfit.back = /obj/item/storage/backpack/medic
@@ -246,7 +252,7 @@
if(4)
flavour_text += "you were always joked about by your friends for \"not playing with a full deck\", as they so kindly put it. It seems that they were right when you, on a tour \
at one of Nanotrasen's state-of-the-art research facilities, were in one of the escape pods alone and saw the red button. It was big and shiny, and it caught your eye. You pressed \
- it, and after a terrifying and fast ride for days, you landed here. You've had time to wisen up since then, and you think that your old friends wouldn't be laughing now."
+ it, and after a terrifying and fast ride for days, you landed here. You've had time to wisen up since then, and you think that your old friends wouldn't be laughing now."
outfit.uniform = /obj/item/clothing/under/color/grey/glorf
outfit.shoes = /obj/item/clothing/shoes/sneakers/black
outfit.back = /obj/item/storage/backpack
@@ -261,9 +267,10 @@
desc = "A small sleeper typically used to instantly restore minor wounds. This one seems broken, and its occupant is comatose."
job_description = "Lavaland Veterinarian"
mob_name = "a translocated vet"
- flavour_text = "What...? Where are you? Where are the others? This is still the animal hospital - you should know, you've been an intern here for weeks - but \
- everyone's gone. One of the cats scratched you just a few minutes ago. That's why you were in the pod - to heal the scratch. The scabs are still fresh; you see them right now. So where is \
- everyone? Where did they go? What happened to the hospital? And is that smoke you smell? You need to find someone else. Maybe they can tell you what happened."
+ short_desc = "You are a animal doctor who just woke up in lavaland"
+ flavour_text = "What...? Where are you? Where are the others? This is still the animal hospital - you should know, you've been an intern here for weeks - but \
+ you see them right now. So where is \
+ everyone? Where did they go? What happened to the hospital? And is that smoke you smell? You need to find someone else. Maybe they c everyone's gone. One of the cats scratched you just a few minutes ago. That's why you were in the pod - to heal the scratch. The scabs are still fresh; an tell you what happened."
assignedrole = "Translocated Vet"
mirrorcanloadappearance = TRUE
@@ -283,8 +290,9 @@
outfit = /datum/outfit/lavalandprisoner
roundstart = FALSE
death = FALSE
- flavour_text = "Good. It seems as though your ship crashed. You're a prisoner, sentenced to hard work in one of Nanotrasen's labor camps, but it seems as \
- though fate has other plans for you. You remember that you were convicted of "
+ short_desc = "You're a prisoner, sentenced to hard work in one of Nanotrasen's labor camps, but it seems as \
+ though fate has other plans for you."
+ flavour_text = "Good. It seems as though your ship crashed. You remember that you were convicted of "
assignedrole = "Escaped Prisoner"
/obj/effect/mob_spawn/human/prisoner_transport/special(mob/living/L)
@@ -296,7 +304,7 @@
var/list/crimes = list("murder", "larceny", "embezzlement", "unionization", "dereliction of duty", "kidnapping", "gross incompetence", "grand theft", "collaboration with the Syndicate", \
"worship of a forbidden deity", "interspecies relations", "mutiny")
flavour_text += "[pick(crimes)]. but regardless of that, it seems like your crime doesn't matter now. You don't know where you are, but you know that it's out to kill you, and you're not going \
- to lose this opportunity. Find a way to get out of this mess and back to where you rightfully belong - your [pick("house", "apartment", "spaceship", "station")]."
+ to lose this opportunity. Find a way to get out of this mess and back to where you rightfully belong - your [pick("house", "apartment", "spaceship", "station")]."
/datum/outfit/lavalandprisoner
name = "Lavaland Prisoner"
@@ -323,8 +331,9 @@
roundstart = FALSE
random = TRUE
outfit = /datum/outfit/hotelstaff
- flavour_text = "You are a staff member of a top-of-the-line space hotel! Cater to guests and DON'T leave the hotel, lest the manager fire you for\
- dereliction of duty!"
+ short_desc = "You are a staff member of a top-of-the-line space hotel!"
+ flavour_text = "You are a staff member of a top-of-the-line space hotel! Cater to guests and make sure the manager doesn't fire you."
+ important_info = "DON'T leave the hotel"
assignedrole = "Hotel Staff"
mirrorcanloadappearance = TRUE
@@ -341,8 +350,10 @@
mob_name = "hotel security member"
job_description = "Hotel Security"
outfit = /datum/outfit/hotelstaff/security
- flavour_text = "You are a peacekeeper assigned to this hotel to protect the interests of the company while keeping the peace between \
- guests and the staff. Do NOT leave the hotel, as that is grounds for contract termination."
+ short_desc = "You are a peacekeeper."
+ flavour_text = "You have been assigned to this hotel to protect the interests of the company while keeping the peace between \
+ guests and the staff."
+ important_info = "Do NOT leave the hotel, as that is grounds for contract termination."
objectives = "Do not leave your assigned hotel. Try and keep the peace between staff and guests, non-lethal force heavily advised if possible."
mirrorcanloadappearance = TRUE
@@ -379,7 +390,8 @@
/obj/effect/mob_spawn/human/demonic_friend/Initialize(mapload, datum/mind/owner_mind, obj/effect/proc_holder/spell/targeted/summon_friend/summoning_spell)
. = ..()
owner = owner_mind
- flavour_text = "You have been given a reprieve from your eternity of torment, to be [owner.name]'s friend for [owner.p_their()] short mortal coil. Be aware that if you do not live up to [owner.name]'s expectations, they can send you back to hell with a single thought. [owner.name]'s death will also return you to hell."
+ flavour_text = "You have been given a reprieve from your eternity of torment, to be [owner.name]'s friend for [owner.p_their()] short mortal coil."
+ important_info = "Be aware that if you do not live up to [owner.name]'s expectations, they can send you back to hell with a single thought. [owner.name]'s death will also return you to hell."
var/area/A = get_area(src)
if(!mapload && A)
notify_ghosts("\A friendship shell has been completed in \the [A.name].", source = src, action=NOTIFY_ATTACK, flashwindow = FALSE)
@@ -437,9 +449,9 @@
/obj/effect/mob_spawn/human/syndicate/battlecruiser
name = "Syndicate Battlecruiser Ship Operative"
- flavour_text = "You are a crewmember aboard the syndicate flagship: the SBC Starfury.Your job is to follow your captain's orders, maintain the ship, and keep the engine running. If you are not familiar with how the supermatter engine functions: do not attempt to start it. \
- \
- The armory is not a candy store, and your role is not to assault the station directly, leave that work to the assault operatives."
+ short_desc = "You are a crewmember aboard the syndicate flagship: the SBC Starfury."
+ flavour_text = "Your job is to follow your captain's orders, maintain the ship, and keep the engine running. If you are not familiar with how the supermatter engine functions: do not attempt to start it."
+ important_info = "The armory is not a candy store, and your role is not to assault the station directly, leave that work to the assault operatives."
outfit = /datum/outfit/syndicate_empty/SBC
mirrorcanloadappearance = TRUE
@@ -450,10 +462,9 @@
belt = /obj/item/storage/belt/military/assault
/obj/effect/mob_spawn/human/syndicate/battlecruiser/assault
- name = "Syndicate Battlecruiser Assault Operative"
- flavour_text = "You are an assault operative aboard the syndicate flagship: the SBC Starfury.Your job is to follow your captain's orders, keep intruders out of the ship, and assault Space Station 13. There is an armory, multiple assault ships, and beam cannons to attack the station with. \
- \
- Work as a team with your fellow operatives and work out a plan of attack. If you are overwhelmed, escape back to your ship!"
+ short_desc = "You are an assault operative aboard the syndicate flagship: the SBC Starfury."
+ flavour_text = "Your job is to follow your captain's orders, keep intruders out of the ship, and assault Space Station 13. There is an armory, multiple assault ships, and beam cannons to attack the station with."
+ important_info = "Work as a team with your fellow operatives and work out a plan of attack. If you are overwhelmed, escape back to your ship!"
outfit = /datum/outfit/syndicate_empty/SBC/assault
mirrorcanloadappearance = TRUE
@@ -470,9 +481,9 @@
/obj/effect/mob_spawn/human/syndicate/battlecruiser/captain
name = "Syndicate Battlecruiser Captain"
- flavour_text = "You are the captain aboard the syndicate flagship: the SBC Starfury.Your job is to oversee your crew, defend the ship, and destroy Space Station 13. The ship has an armory, multiple ships, beam cannons, and multiple crewmembers to accomplish this goal. \
- \
- As the captain, this whole operation falls on your shoulders. You do not need to nuke the station, causing sufficient damage and preventing your ship from being destroyed will be enough."
+ short_desc = "You are the captain aboard the syndicate flagship: the SBC Starfury."
+ flavour_text = "Your job is to oversee your crew, defend the ship, and destroy Space Station 13. The ship has an armory, multiple ships, beam cannons, and multiple crewmembers to accomplish this goal."
+ important_info = "As the captain, this whole operation falls on your shoulders. You do not need to nuke the station, causing sufficient damage and preventing your ship from being destroyed will be enough."
outfit = /datum/outfit/syndicate_empty/SBC/assault/captain
id_access_list = list(150,151)
mirrorcanloadappearance = TRUE
@@ -499,10 +510,11 @@
death = FALSE
random = TRUE
mob_species = /datum/species/human
- flavour_text = "You are a security officer working for Nanotrasen, stationed onboard a state of the art research station. You vaguely recall rushing into a \
- cryogenics pod due to an oncoming radiation storm. The last thing you remember is the station's Artificial Program telling you that you would only be asleep for eight hours. As you open \
- your eyes, everything seems rusted and broken, a dark feeling swells in your gut as you climb out of your pod. \
- Work as a team with your fellow survivors and do not abandon them."
+ short_desc = "You are a security officer working for Nanotrasen, stationed onboard a state of the art research station."
+ flavour_text = "You vaguely recall rushing into a cryogenics pod due to an oncoming radiation storm. \
+ The last thing you remember is the station's Artificial Program telling you that you would only be asleep for eight hours. As you open \
+ your eyes, everything seems rusted and broken, a dark feeling swells in your gut as you climb out of your pod."
+ important_info = "Work as a team with your fellow survivors and do not abandon them."
uniform = /obj/item/clothing/under/rank/security
shoes = /obj/item/clothing/shoes/jackboots
id = /obj/item/card/id/away/old/sec
@@ -527,10 +539,11 @@
death = FALSE
random = TRUE
mob_species = /datum/species/human
- flavour_text = "You are an engineer working for Nanotrasen, stationed onboard a state of the art research station. You vaguely recall rushing into a \
- cryogenics pod due to an oncoming radiation storm. The last thing you remember is the station's Artificial Program telling you that you would only be asleep for eight hours. As you open \
- your eyes, everything seems rusted and broken, a dark feeling swells in your gut as you climb out of your pod. \
- Work as a team with your fellow survivors and do not abandon them."
+ short_desc = "You are an engineer working for Nanotrasen, stationed onboard a state of the art research station."
+ flavour_text = "You vaguely recall rushing into a cryogenics pod due to an oncoming radiation storm. The last thing \
+ you remember is the station's Artificial Program telling you that you would only be asleep for eight hours. As you open \
+ your eyes, everything seems rusted and broken, a dark feeling swells in your gut as you climb out of your pod."
+ important_info = "Work as a team with your fellow survivors and do not abandon them."
uniform = /obj/item/clothing/under/rank/engineer
shoes = /obj/item/clothing/shoes/workboots
id = /obj/item/card/id/away/old/eng
@@ -553,10 +566,11 @@
death = FALSE
random = TRUE
mob_species = /datum/species/human
- flavour_text = "You are a scientist working for Nanotrasen, stationed onboard a state of the art research station. You vaguely recall rushing into a \
- cryogenics pod due to an oncoming radiation storm. The last thing you remember is the station's Artificial Program telling you that you would only be asleep for eight hours. As you open \
- your eyes, everything seems rusted and broken, a dark feeling swells in your gut as you climb out of your pod. \
- Work as a team with your fellow survivors and do not abandon them."
+ short_desc = "You are a scientist working for Nanotrasen, stationed onboard a state of the art research station."
+ flavour_text = "You vaguely recall rushing into a cryogenics pod due to an oncoming radiation storm. \
+ The last thing you remember is the station's Artificial Program telling you that you would only be asleep for eight hours. As you open \
+ your eyes, everything seems rusted and broken, a dark feeling swells in your gut as you climb out of your pod."
+ important_info = "Work as a team with your fellow survivors and do not abandon them."
uniform = /obj/item/clothing/under/rank/scientist
shoes = /obj/item/clothing/shoes/laceup
id = /obj/item/card/id/away/old/sci
@@ -584,7 +598,8 @@
anchored = TRUE
density = FALSE
show_flavour = FALSE //Flavour only exists for spawners menu
- flavour_text = "You are a space pirate. The station refused to pay for your protection, protect the ship, siphon the credits from the station and raid it for even more loot."
+ short_desc = "You are a space pirate."
+ flavour_text = "The station refused to pay for your protection, protect the ship, siphon the credits from the station and raid it for even more loot."
assignedrole = "Space Pirate"
var/rank = "Mate"
diff --git a/code/game/objects/structures/tank_dispenser.dm b/code/game/objects/structures/tank_dispenser.dm
index f156287d..5fabcafd 100644
--- a/code/game/objects/structures/tank_dispenser.dm
+++ b/code/game/objects/structures/tank_dispenser.dm
@@ -71,7 +71,7 @@
datum/tgui/master_ui = null, datum/ui_state/state = GLOB.physical_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "tank_dispenser", name, 275, 100, master_ui, state)
+ ui = new(user, src, ui_key, "tank_dispenser", name, 275, 103, master_ui, state)
ui.open()
/obj/structure/tank_dispenser/ui_data(mob/user)
diff --git a/code/game/world.dm b/code/game/world.dm
index 9ed3940b..5bd39779 100644
--- a/code/game/world.dm
+++ b/code/game/world.dm
@@ -1,333 +1,336 @@
-#define RESTART_COUNTER_PATH "data/round_counter.txt"
-#define TOPIC_LENGTH_LIMIT 8192 //The reason why this is so large is to allow TGS topic calls to function without issue.
-#define TOPIC_COOLDOWN 1 //90% sure there isnt anything that does multiple topic calls in a single decisecond.
-
-GLOBAL_VAR(restart_counter)
-
-//This happens after the Master subsystem new(s) (it's a global datum)
-//So subsystems globals exist, but are not initialised
-/world/New()
- var/extools = world.GetConfig("env", "EXTOOLS_DLL") || (world.system_type == MS_WINDOWS ? "./byond-extools.dll" : "./libbyond-extools.so")
- if (fexists(extools))
- call(extools, "maptick_initialize")()
- enable_debugger()
-
- log_world("World loaded at [TIME_STAMP("hh:mm:ss", FALSE)]!")
-
- SetupExternalRSC()
-
- GLOB.config_error_log = GLOB.world_manifest_log = GLOB.world_pda_log = GLOB.world_job_debug_log = GLOB.sql_error_log = GLOB.world_href_log = GLOB.world_runtime_log = GLOB.world_attack_log = GLOB.world_game_log = "data/logs/config_error.[GUID()].log" //temporary file used to record errors with loading config, moved to log directory once logging is set bl
-
- make_datum_references_lists() //initialises global lists for referencing frequently used datums (so that we only ever do it once)
-
- TgsNew()
-
- GLOB.revdata = new
-
- config.Load(params[OVERRIDE_CONFIG_DIRECTORY_PARAMETER])
-
- //SetupLogs depends on the RoundID, so lets check
- //DB schema and set RoundID if we can
- SSdbcore.CheckSchemaVersion()
- SSdbcore.SetRoundID()
- SetupLogs()
-
-#ifndef USE_CUSTOM_ERROR_HANDLER
- world.log = file("[GLOB.log_directory]/dd.log")
-#endif
-
- load_admins()
- load_patreons()
- LoadVerbs(/datum/verbs/menu)
- if(CONFIG_GET(flag/usewhitelist))
- load_whitelist()
- LoadBans()
- reload_custom_roundstart_items_list()//Cit change - loads donator items. Remind me to remove when I port over bay's loadout system
-
- GLOB.timezoneOffset = text2num(time2text(0,"hh")) * 36000
-
- if(fexists(RESTART_COUNTER_PATH))
- GLOB.restart_counter = text2num(trim(file2text(RESTART_COUNTER_PATH)))
- fdel(RESTART_COUNTER_PATH)
-
- if(NO_INIT_PARAMETER in params)
- return
-
- cit_initialize()
-
- Master.Initialize(10, FALSE, TRUE)
-
- if(TEST_RUN_PARAMETER in params)
- HandleTestRun()
-
-/world/proc/HandleTestRun()
- //trigger things to run the whole process
- Master.sleep_offline_after_initializations = FALSE
- SSticker.start_immediately = TRUE
- CONFIG_SET(number/round_end_countdown, 0)
- var/datum/callback/cb
-#ifdef UNIT_TESTS
- cb = CALLBACK(GLOBAL_PROC, /proc/RunUnitTests)
-#else
- cb = VARSET_CALLBACK(SSticker, force_ending, TRUE)
-#endif
- SSticker.OnRoundstart(CALLBACK(GLOBAL_PROC, /proc/addtimer, cb, 10 SECONDS))
-
-/world/proc/SetupExternalRSC()
-#if (PRELOAD_RSC == 0)
- GLOB.external_rsc_urls = world.file2list("[global.config.directory]/external_rsc_urls.txt","\n")
- var/i=1
- while(i<=GLOB.external_rsc_urls.len)
- if(GLOB.external_rsc_urls[i])
- i++
- else
- GLOB.external_rsc_urls.Cut(i,i+1)
-#endif
-
-/world/proc/SetupLogs()
- var/override_dir = params[OVERRIDE_LOG_DIRECTORY_PARAMETER]
- if(!override_dir)
- var/realtime = world.realtime
- var/texttime = time2text(realtime, "YYYY/MM/DD")
- GLOB.log_directory = "data/logs/[texttime]/round-"
- GLOB.picture_logging_prefix = "L_[time2text(realtime, "YYYYMMDD")]_"
- GLOB.picture_log_directory = "data/picture_logs/[texttime]/round-"
- if(GLOB.round_id)
- GLOB.log_directory += "[GLOB.round_id]"
- GLOB.picture_logging_prefix += "R_[GLOB.round_id]_"
- GLOB.picture_log_directory += "[GLOB.round_id]"
- else
- var/timestamp = replacetext(TIME_STAMP("hh:mm:ss", FALSE), ":", ".")
- GLOB.log_directory += "[timestamp]"
- GLOB.picture_log_directory += "[timestamp]"
- GLOB.picture_logging_prefix += "T_[timestamp]_"
- else
- GLOB.log_directory = "data/logs/[override_dir]"
- GLOB.picture_logging_prefix = "O_[override_dir]_"
- GLOB.picture_log_directory = "data/picture_logs/[override_dir]"
-
- GLOB.world_game_log = "[GLOB.log_directory]/game.log"
- GLOB.world_virus_log = "[GLOB.log_directory]/virus.log"
- GLOB.world_attack_log = "[GLOB.log_directory]/attack.log"
- GLOB.world_pda_log = "[GLOB.log_directory]/pda.log"
- GLOB.world_telecomms_log = "[GLOB.log_directory]/telecomms.log"
- GLOB.world_manifest_log = "[GLOB.log_directory]/manifest.log"
- GLOB.world_href_log = "[GLOB.log_directory]/hrefs.log"
- GLOB.sql_error_log = "[GLOB.log_directory]/sql.log"
- GLOB.world_qdel_log = "[GLOB.log_directory]/qdel.log"
- GLOB.world_map_error_log = "[GLOB.log_directory]/map_errors.log"
- GLOB.world_runtime_log = "[GLOB.log_directory]/runtime.log"
- GLOB.query_debug_log = "[GLOB.log_directory]/query_debug.log"
- GLOB.world_job_debug_log = "[GLOB.log_directory]/job_debug.log"
-
-#ifdef UNIT_TESTS
- GLOB.test_log = file("[GLOB.log_directory]/tests.log")
- start_log(GLOB.test_log)
-#endif
- start_log(GLOB.world_game_log)
- start_log(GLOB.world_attack_log)
- start_log(GLOB.world_pda_log)
- start_log(GLOB.world_telecomms_log)
- start_log(GLOB.world_manifest_log)
- start_log(GLOB.world_href_log)
- start_log(GLOB.world_qdel_log)
- start_log(GLOB.world_runtime_log)
- start_log(GLOB.world_job_debug_log)
-
- GLOB.changelog_hash = md5('html/changelog.html') //for telling if the changelog has changed recently
- if(fexists(GLOB.config_error_log))
- fcopy(GLOB.config_error_log, "[GLOB.log_directory]/config_error.log")
- fdel(GLOB.config_error_log)
-
- if(GLOB.round_id)
- log_game("Round ID: [GLOB.round_id]")
-
- // This was printed early in startup to the world log and config_error.log,
- // but those are both private, so let's put the commit info in the runtime
- // log which is ultimately public.
- log_runtime(GLOB.revdata.get_log_message())
-
-/world/Topic(T, addr, master, key)
- var/static/list/bannedsourceaddrs = list()
- var/static/list/lasttimeaddr = list()
-
- if(addr in bannedsourceaddrs)
- return
-
- if(length(T) >= TOPIC_LENGTH_LIMIT)
- log_topic("Oversized topic, banning address. from:[addr]")
- bannedsourceaddrs |= addr
- return
-
- if(addr in lasttimeaddr && world.time < (lasttimeaddr["[addr]"] + TOPIC_COOLDOWN))
- log_topic("Too many topic calls from address in [TOPIC_COOLDOWN] ds, banning address. from:[addr]")
- bannedsourceaddrs |= addr
- return
-
- lasttimeaddr["[addr]"] = world.time
-
-
- TGS_TOPIC //redirect to server tools if necessary
-
- var/static/list/topic_handlers = TopicHandlers()
-
- var/list/input = params2list(T)
- var/datum/world_topic/handler
- for(var/I in topic_handlers)
- if(I in input)
- handler = topic_handlers[I]
- break
-
- if((!handler || initial(handler.log)) && config && CONFIG_GET(flag/log_world_topic))
- log_topic("\"[T]\", from:[addr], master:[master], key:[key]")
-
- if(!handler)
- return
-
- handler = new handler()
- return handler.TryRun(input)
-
-/world/proc/AnnouncePR(announcement, list/payload)
- var/static/list/PRcounts = list() //PR id -> number of times announced this round
- var/id = "[payload["pull_request"]["id"]]"
- if(!PRcounts[id])
- PRcounts[id] = 1
- else
- ++PRcounts[id]
- if(PRcounts[id] > PR_ANNOUNCEMENTS_PER_ROUND)
- return
-
- var/final_composed = "PR: [announcement]"
- for(var/client/C in GLOB.clients)
- C.AnnouncePR(final_composed)
-
-/world/proc/FinishTestRun()
- set waitfor = FALSE
- var/list/fail_reasons
- if(GLOB)
- if(GLOB.total_runtimes != 0)
- fail_reasons = list("Total runtimes: [GLOB.total_runtimes]")
-#ifdef UNIT_TESTS
- if(GLOB.failed_any_test)
- LAZYADD(fail_reasons, "Unit Tests failed!")
-#endif
- if(!GLOB.log_directory)
- LAZYADD(fail_reasons, "Missing GLOB.log_directory!")
- else
- fail_reasons = list("Missing GLOB!")
- if(!fail_reasons)
- text2file("Success!", "[GLOB.log_directory]/clean_run.lk")
- else
- log_world("Test run failed!\n[fail_reasons.Join("\n")]")
- sleep(0) //yes, 0, this'll let Reboot finish and prevent byond memes
- qdel(src) //shut it down
-
-/world/Reboot(reason = 0, fast_track = FALSE)
- TgsReboot()
- if (reason || fast_track) //special reboot, do none of the normal stuff
- if (usr)
- log_admin("[key_name(usr)] Has requested an immediate world restart via client side debugging tools")
- message_admins("[key_name_admin(usr)] Has requested an immediate world restart via client side debugging tools")
- to_chat(world, "Rebooting World immediately due to host request")
- else
- to_chat(world, "Rebooting world...")
- Master.Shutdown() //run SS shutdowns
-
- if(TEST_RUN_PARAMETER in params)
- FinishTestRun()
- return
-
- if(TgsAvailable())
- var/do_hard_reboot
- // check the hard reboot counter
- var/ruhr = CONFIG_GET(number/rounds_until_hard_restart)
- switch(ruhr)
- if(-1)
- do_hard_reboot = FALSE
- if(0)
- do_hard_reboot = TRUE
- else
- if(GLOB.restart_counter >= ruhr)
- do_hard_reboot = TRUE
- else
- text2file("[++GLOB.restart_counter]", RESTART_COUNTER_PATH)
- do_hard_reboot = FALSE
-
- if(do_hard_reboot)
- log_world("World hard rebooted at [TIME_STAMP("hh:mm:ss", FALSE)]")
- shutdown_logging() // See comment below.
- TgsEndProcess()
-
- log_world("World rebooted at [TIME_STAMP("hh:mm:ss", FALSE)]")
- shutdown_logging() // Past this point, no logging procs can be used, at risk of data loss.
- ..()
-
-/world/proc/update_status()
-
- var/list/features = list()
-
- /*if(GLOB.master_mode) CIT CHANGE - hides the gamemode from the hub entry, removes some useless info from the hub entry
- features += GLOB.master_mode
-
- if (!GLOB.enter_allowed)
- features += "closed"*/
-
- var/s = ""
- var/hostedby
- if(config)
- var/server_name = CONFIG_GET(string/servername)
- if (server_name)
- s += "[server_name] — "
- /*features += "[CONFIG_GET(flag/norespawn) ? "no " : ""]respawn" CIT CHANGE - removes some useless info from the hub entry
- if(CONFIG_GET(flag/allow_vote_mode))
- features += "vote"
- if(CONFIG_GET(flag/allow_ai))
- features += "AI allowed"*/
- hostedby = CONFIG_GET(string/hostedby)
-
- s += "[station_name()]";
- s += " ("
- s += "" //Change this to wherever you want the hub to link to. CIT CHANGE - links to cit's website on the hub
- s += "Website" //Replace this with something else. Or ever better, delete it and uncomment the game version. CIT CHANGE - modifies the hub entry link
- s += ""
- s += ")\]" //CIT CHANGE - encloses the server title in brackets to make the hub entry fancier
- s += " [CONFIG_GET(string/servertagline)] " //CIT CHANGE - adds a tagline!
-
- var/n = 0
- for (var/mob/M in GLOB.player_list)
- if (M.client)
- n++
-
- if(SSmapping.config) // this just stops the runtime, honk.
- features += "[SSmapping.config.map_name]" //CIT CHANGE - makes the hub entry display the current map
-
- if(get_security_level())//CIT CHANGE - makes the hub entry show the security level
- features += "[get_security_level()] alert"
-
- if (n > 1)
- features += "~[n] players"
- else if (n > 0)
- features += "~[n] player"
-
- if (!host && hostedby)
- features += "hosted by [hostedby]"
-
- if (features)
- s += "\[[jointext(features, ", ")]" //CIT CHANGE - replaces the colon here with a left bracket
-
- status = s
-
-/world/proc/update_hub_visibility(new_visibility)
- if(new_visibility == GLOB.hub_visibility)
- return
- GLOB.hub_visibility = new_visibility
- if(GLOB.hub_visibility)
- hub_password = "kMZy3U5jJHSiBQjr"
- else
- hub_password = "SORRYNOPASSWORD"
-
-/world/proc/incrementMaxZ()
- maxz++
- SSmobs.MaxZChanged()
- SSidlenpcpool.MaxZChanged()
-
+#define RESTART_COUNTER_PATH "data/round_counter.txt"
+#define TOPIC_LENGTH_LIMIT 8192 //The reason why this is so large is to allow TGS topic calls to function without issue.
+#define TOPIC_COOLDOWN 1 //90% sure there isnt anything that does multiple topic calls in a single decisecond.
+
+GLOBAL_VAR(restart_counter)
+
+//This happens after the Master subsystem new(s) (it's a global datum)
+//So subsystems globals exist, but are not initialised
+/world/New()
+ var/extools = world.GetConfig("env", "EXTOOLS_DLL") || (world.system_type == MS_WINDOWS ? "./byond-extools.dll" : "./libbyond-extools.so")
+ if (fexists(extools))
+ call(extools, "maptick_initialize")()
+ enable_debugger()
+
+ log_world("World loaded at [TIME_STAMP("hh:mm:ss", FALSE)]!")
+
+ SetupExternalRSC()
+
+ GLOB.config_error_log = GLOB.world_manifest_log = GLOB.world_pda_log = GLOB.world_job_debug_log = GLOB.sql_error_log = GLOB.world_href_log = GLOB.world_runtime_log = GLOB.world_attack_log = GLOB.world_game_log = "data/logs/config_error.[GUID()].log" //temporary file used to record errors with loading config, moved to log directory once logging is set bl
+
+ make_datum_references_lists() //initialises global lists for referencing frequently used datums (so that we only ever do it once)
+
+ TgsNew()
+
+ GLOB.revdata = new
+
+ config.Load(params[OVERRIDE_CONFIG_DIRECTORY_PARAMETER])
+
+ //SetupLogs depends on the RoundID, so lets check
+ //DB schema and set RoundID if we can
+ SSdbcore.CheckSchemaVersion()
+ SSdbcore.SetRoundID()
+ SetupLogs()
+
+#ifndef USE_CUSTOM_ERROR_HANDLER
+ world.log = file("[GLOB.log_directory]/dd.log")
+#endif
+
+ load_admins()
+ load_patreons()
+ LoadVerbs(/datum/verbs/menu)
+ if(CONFIG_GET(flag/usewhitelist))
+ load_whitelist()
+ LoadBans()
+ reload_custom_roundstart_items_list()//Cit change - loads donator items. Remind me to remove when I port over bay's loadout system
+
+ GLOB.timezoneOffset = text2num(time2text(0,"hh")) * 36000
+
+ if(fexists(RESTART_COUNTER_PATH))
+ GLOB.restart_counter = text2num(trim(file2text(RESTART_COUNTER_PATH)))
+ fdel(RESTART_COUNTER_PATH)
+
+ if(NO_INIT_PARAMETER in params)
+ return
+
+ cit_initialize()
+
+ Master.Initialize(10, FALSE, TRUE)
+
+ if(TEST_RUN_PARAMETER in params)
+ HandleTestRun()
+
+/world/proc/HandleTestRun()
+ //trigger things to run the whole process
+ Master.sleep_offline_after_initializations = FALSE
+ SSticker.start_immediately = TRUE
+ CONFIG_SET(number/round_end_countdown, 0)
+ var/datum/callback/cb
+#ifdef UNIT_TESTS
+ cb = CALLBACK(GLOBAL_PROC, /proc/RunUnitTests)
+#else
+ cb = VARSET_CALLBACK(SSticker, force_ending, TRUE)
+#endif
+ SSticker.OnRoundstart(CALLBACK(GLOBAL_PROC, /proc/addtimer, cb, 10 SECONDS))
+
+/world/proc/SetupExternalRSC()
+#if (PRELOAD_RSC == 0)
+ GLOB.external_rsc_urls = world.file2list("[global.config.directory]/external_rsc_urls.txt","\n")
+ var/i=1
+ while(i<=GLOB.external_rsc_urls.len)
+ if(GLOB.external_rsc_urls[i])
+ i++
+ else
+ GLOB.external_rsc_urls.Cut(i,i+1)
+#endif
+
+/world/proc/SetupLogs()
+ var/override_dir = params[OVERRIDE_LOG_DIRECTORY_PARAMETER]
+ if(!override_dir)
+ var/realtime = world.realtime
+ var/texttime = time2text(realtime, "YYYY/MM/DD")
+ GLOB.log_directory = "data/logs/[texttime]/round-"
+ GLOB.picture_logging_prefix = "L_[time2text(realtime, "YYYYMMDD")]_"
+ GLOB.picture_log_directory = "data/picture_logs/[texttime]/round-"
+ if(GLOB.round_id)
+ GLOB.log_directory += "[GLOB.round_id]"
+ GLOB.picture_logging_prefix += "R_[GLOB.round_id]_"
+ GLOB.picture_log_directory += "[GLOB.round_id]"
+ else
+ var/timestamp = replacetext(TIME_STAMP("hh:mm:ss", FALSE), ":", ".")
+ GLOB.log_directory += "[timestamp]"
+ GLOB.picture_log_directory += "[timestamp]"
+ GLOB.picture_logging_prefix += "T_[timestamp]_"
+ else
+ GLOB.log_directory = "data/logs/[override_dir]"
+ GLOB.picture_logging_prefix = "O_[override_dir]_"
+ GLOB.picture_log_directory = "data/picture_logs/[override_dir]"
+
+ GLOB.world_game_log = "[GLOB.log_directory]/game.log"
+ GLOB.world_virus_log = "[GLOB.log_directory]/virus.log"
+ GLOB.world_attack_log = "[GLOB.log_directory]/attack.log"
+ GLOB.world_pda_log = "[GLOB.log_directory]/pda.log"
+ GLOB.world_telecomms_log = "[GLOB.log_directory]/telecomms.log"
+ GLOB.world_manifest_log = "[GLOB.log_directory]/manifest.log"
+ GLOB.world_href_log = "[GLOB.log_directory]/hrefs.log"
+ GLOB.sql_error_log = "[GLOB.log_directory]/sql.log"
+ GLOB.world_qdel_log = "[GLOB.log_directory]/qdel.log"
+ GLOB.world_map_error_log = "[GLOB.log_directory]/map_errors.log"
+ GLOB.world_runtime_log = "[GLOB.log_directory]/runtime.log"
+ GLOB.query_debug_log = "[GLOB.log_directory]/query_debug.log"
+ GLOB.world_job_debug_log = "[GLOB.log_directory]/job_debug.log"
+ GLOB.tgui_log = "[GLOB.log_directory]/tgui.log"
+
+
+#ifdef UNIT_TESTS
+ GLOB.test_log = file("[GLOB.log_directory]/tests.log")
+ start_log(GLOB.test_log)
+#endif
+ start_log(GLOB.world_game_log)
+ start_log(GLOB.world_attack_log)
+ start_log(GLOB.world_pda_log)
+ start_log(GLOB.world_telecomms_log)
+ start_log(GLOB.world_manifest_log)
+ start_log(GLOB.world_href_log)
+ start_log(GLOB.world_qdel_log)
+ start_log(GLOB.world_runtime_log)
+ start_log(GLOB.world_job_debug_log)
+ start_log(GLOB.tgui_log)
+
+ GLOB.changelog_hash = md5('html/changelog.html') //for telling if the changelog has changed recently
+ if(fexists(GLOB.config_error_log))
+ fcopy(GLOB.config_error_log, "[GLOB.log_directory]/config_error.log")
+ fdel(GLOB.config_error_log)
+
+ if(GLOB.round_id)
+ log_game("Round ID: [GLOB.round_id]")
+
+ // This was printed early in startup to the world log and config_error.log,
+ // but those are both private, so let's put the commit info in the runtime
+ // log which is ultimately public.
+ log_runtime(GLOB.revdata.get_log_message())
+
+/world/Topic(T, addr, master, key)
+ var/static/list/bannedsourceaddrs = list()
+ var/static/list/lasttimeaddr = list()
+
+ if(addr in bannedsourceaddrs)
+ return
+
+ if(length(T) >= TOPIC_LENGTH_LIMIT)
+ log_topic("Oversized topic, banning address. from:[addr]")
+ bannedsourceaddrs |= addr
+ return
+
+ if(addr in lasttimeaddr && world.time < (lasttimeaddr["[addr]"] + TOPIC_COOLDOWN))
+ log_topic("Too many topic calls from address in [TOPIC_COOLDOWN] ds, banning address. from:[addr]")
+ bannedsourceaddrs |= addr
+ return
+
+ lasttimeaddr["[addr]"] = world.time
+
+
+ TGS_TOPIC //redirect to server tools if necessary
+
+ var/static/list/topic_handlers = TopicHandlers()
+
+ var/list/input = params2list(T)
+ var/datum/world_topic/handler
+ for(var/I in topic_handlers)
+ if(I in input)
+ handler = topic_handlers[I]
+ break
+
+ if((!handler || initial(handler.log)) && config && CONFIG_GET(flag/log_world_topic))
+ log_topic("\"[T]\", from:[addr], master:[master], key:[key]")
+
+ if(!handler)
+ return
+
+ handler = new handler()
+ return handler.TryRun(input)
+
+/world/proc/AnnouncePR(announcement, list/payload)
+ var/static/list/PRcounts = list() //PR id -> number of times announced this round
+ var/id = "[payload["pull_request"]["id"]]"
+ if(!PRcounts[id])
+ PRcounts[id] = 1
+ else
+ ++PRcounts[id]
+ if(PRcounts[id] > PR_ANNOUNCEMENTS_PER_ROUND)
+ return
+
+ var/final_composed = "PR: [announcement]"
+ for(var/client/C in GLOB.clients)
+ C.AnnouncePR(final_composed)
+
+/world/proc/FinishTestRun()
+ set waitfor = FALSE
+ var/list/fail_reasons
+ if(GLOB)
+ if(GLOB.total_runtimes != 0)
+ fail_reasons = list("Total runtimes: [GLOB.total_runtimes]")
+#ifdef UNIT_TESTS
+ if(GLOB.failed_any_test)
+ LAZYADD(fail_reasons, "Unit Tests failed!")
+#endif
+ if(!GLOB.log_directory)
+ LAZYADD(fail_reasons, "Missing GLOB.log_directory!")
+ else
+ fail_reasons = list("Missing GLOB!")
+ if(!fail_reasons)
+ text2file("Success!", "[GLOB.log_directory]/clean_run.lk")
+ else
+ log_world("Test run failed!\n[fail_reasons.Join("\n")]")
+ sleep(0) //yes, 0, this'll let Reboot finish and prevent byond memes
+ qdel(src) //shut it down
+
+/world/Reboot(reason = 0, fast_track = FALSE)
+ TgsReboot()
+ if (reason || fast_track) //special reboot, do none of the normal stuff
+ if (usr)
+ log_admin("[key_name(usr)] Has requested an immediate world restart via client side debugging tools")
+ message_admins("[key_name_admin(usr)] Has requested an immediate world restart via client side debugging tools")
+ to_chat(world, "Rebooting World immediately due to host request")
+ else
+ to_chat(world, "Rebooting world...")
+ Master.Shutdown() //run SS shutdowns
+
+ if(TEST_RUN_PARAMETER in params)
+ FinishTestRun()
+ return
+
+ if(TgsAvailable())
+ var/do_hard_reboot
+ // check the hard reboot counter
+ var/ruhr = CONFIG_GET(number/rounds_until_hard_restart)
+ switch(ruhr)
+ if(-1)
+ do_hard_reboot = FALSE
+ if(0)
+ do_hard_reboot = TRUE
+ else
+ if(GLOB.restart_counter >= ruhr)
+ do_hard_reboot = TRUE
+ else
+ text2file("[++GLOB.restart_counter]", RESTART_COUNTER_PATH)
+ do_hard_reboot = FALSE
+
+ if(do_hard_reboot)
+ log_world("World hard rebooted at [TIME_STAMP("hh:mm:ss", FALSE)]")
+ shutdown_logging() // See comment below.
+ TgsEndProcess()
+
+ log_world("World rebooted at [TIME_STAMP("hh:mm:ss", FALSE)]")
+ shutdown_logging() // Past this point, no logging procs can be used, at risk of data loss.
+ ..()
+
+/world/proc/update_status()
+
+ var/list/features = list()
+
+ /*if(GLOB.master_mode) CIT CHANGE - hides the gamemode from the hub entry, removes some useless info from the hub entry
+ features += GLOB.master_mode
+
+ if (!GLOB.enter_allowed)
+ features += "closed"*/
+
+ var/s = ""
+ var/hostedby
+ if(config)
+ var/server_name = CONFIG_GET(string/servername)
+ if (server_name)
+ s += "[server_name] — "
+ /*features += "[CONFIG_GET(flag/norespawn) ? "no " : ""]respawn" CIT CHANGE - removes some useless info from the hub entry
+ if(CONFIG_GET(flag/allow_vote_mode))
+ features += "vote"
+ if(CONFIG_GET(flag/allow_ai))
+ features += "AI allowed"*/
+ hostedby = CONFIG_GET(string/hostedby)
+
+ s += "[station_name()]";
+ s += " ("
+ s += "" //Change this to wherever you want the hub to link to. CIT CHANGE - links to cit's website on the hub
+ s += "Website" //Replace this with something else. Or ever better, delete it and uncomment the game version. CIT CHANGE - modifies the hub entry link
+ s += ""
+ s += ")\]" //CIT CHANGE - encloses the server title in brackets to make the hub entry fancier
+ s += " [CONFIG_GET(string/servertagline)] " //CIT CHANGE - adds a tagline!
+
+ var/n = 0
+ for (var/mob/M in GLOB.player_list)
+ if (M.client)
+ n++
+
+ if(SSmapping.config) // this just stops the runtime, honk.
+ features += "[SSmapping.config.map_name]" //CIT CHANGE - makes the hub entry display the current map
+
+ if(get_security_level())//CIT CHANGE - makes the hub entry show the security level
+ features += "[get_security_level()] alert"
+
+ if (n > 1)
+ features += "~[n] players"
+ else if (n > 0)
+ features += "~[n] player"
+
+ if (!host && hostedby)
+ features += "hosted by [hostedby]"
+
+ if (features)
+ s += "\[[jointext(features, ", ")]" //CIT CHANGE - replaces the colon here with a left bracket
+
+ status = s
+
+/world/proc/update_hub_visibility(new_visibility)
+ if(new_visibility == GLOB.hub_visibility)
+ return
+ GLOB.hub_visibility = new_visibility
+ if(GLOB.hub_visibility)
+ hub_password = "kMZy3U5jJHSiBQjr"
+ else
+ hub_password = "SORRYNOPASSWORD"
+
+/world/proc/incrementMaxZ()
+ maxz++
+ SSmobs.MaxZChanged()
+ SSidlenpcpool.MaxZChanged()
+
diff --git a/code/modules/NTNet/network.dm b/code/modules/NTNet/network.dm
index 645f05ac..a7607fb7 100644
--- a/code/modules/NTNet/network.dm
+++ b/code/modules/NTNet/network.dm
@@ -202,6 +202,11 @@
if(filename == P.filename)
return P
+/datum/ntnet/proc/get_chat_channel_by_id(id)
+ for(var/datum/ntnet_conversation/chan in chat_channels)
+ if(chan.id == id)
+ return chan
+
// Resets the IDS alarm
/datum/ntnet/proc/resetIDS()
intrusion_detection_alarm = FALSE
diff --git a/code/modules/NTNet/relays.dm b/code/modules/NTNet/relays.dm
index eaf2aa46..373f6451 100644
--- a/code/modules/NTNet/relays.dm
+++ b/code/modules/NTNet/relays.dm
@@ -9,6 +9,9 @@
icon_state = "bus"
density = TRUE
circuit = /obj/item/circuitboard/machine/ntnet_relay
+ ui_x = 400
+ ui_y = 300
+
var/datum/ntnet/NTNet = null // This is mostly for backwards reference and to allow varedit modifications from ingame.
var/enabled = 1 // Set to 0 if the relay was turned off
var/dos_failure = 0 // Set to 1 if the relay failed due to (D)DoS attack
@@ -66,7 +69,7 @@
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
- ui = new(user, src, ui_key, "ntnet_relay", "NTNet Quantum Relay", 500, 300, master_ui, state)
+ ui = new(user, src, ui_key, "ntnet_relay", "NTNet Quantum Relay", ui_x, ui_y, master_ui, state)
ui.open()
@@ -88,10 +91,12 @@
dos_failure = 0
update_icon()
SSnetworks.station_network.add_log("Quantum relay manually restarted from overload recovery mode to normal operation mode.")
+ return TRUE
if("toggle")
enabled = !enabled
SSnetworks.station_network.add_log("Quantum relay manually [enabled ? "enabled" : "disabled"].")
update_icon()
+ return TRUE
/obj/machinery/ntnet_relay/Initialize()
uid = gl_uid++
@@ -113,4 +118,4 @@
D.target = null
D.error = "Connection to quantum relay severed"
- return ..()
+ return ..()
\ No newline at end of file
diff --git a/code/modules/antagonists/disease/disease_abilities.dm b/code/modules/antagonists/disease/disease_abilities.dm
index dc224900..7b30d10c 100644
--- a/code/modules/antagonists/disease/disease_abilities.dm
+++ b/code/modules/antagonists/disease/disease_abilities.dm
@@ -57,7 +57,7 @@ GLOBAL_LIST_INIT(disease_ability_singletons, list(
var/short_desc = ""
var/long_desc = ""
var/stat_block = ""
- var/threshold_block = ""
+ var/threshold_block = list()
var/category = ""
var/list/symptoms
@@ -76,7 +76,7 @@ GLOBAL_LIST_INIT(disease_ability_singletons, list(
resistance += initial(S.resistance)
stage_speed += initial(S.stage_speed)
transmittable += initial(S.transmittable)
- threshold_block += "
"
if(symptoms.len == 1) //lazy boy's dream
name = initial(S.name)
diff --git a/code/modules/antagonists/disease/disease_mob.dm b/code/modules/antagonists/disease/disease_mob.dm
index 86a7dd01..e824c5c9 100644
--- a/code/modules/antagonists/disease/disease_mob.dm
+++ b/code/modules/antagonists/disease/disease_mob.dm
@@ -325,7 +325,11 @@ the new instance inside the host to be updated to the template's stats.
var/list/dat = list()
if(examining_ability)
- dat += "Back
[examining_ability.name]
[examining_ability.stat_block][examining_ability.long_desc][examining_ability.threshold_block]"
+ dat += "Back "
+ dat += "
[examining_ability.name]
"
+ dat += "[examining_ability.stat_block][examining_ability.long_desc][examining_ability.threshold_block]"
+ for(var/entry in examining_ability.threshold_block)
+ dat += "[entry]: [examining_ability.threshold_block[entry]] "
else
dat += "