diff --git a/.gitignore b/.gitignore
index 8a1fc47c9d..aa2528a7fe 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,7 +1,8 @@
-#ignore misc BYOND files
-*.log
-*.int
-*.rsc
-*.dmb
-*.lk
-data/
+#ignore misc BYOND files
+*.log
+*.int
+*.rsc
+*.dmb
+*.lk
+*.backup
+data/
diff --git a/baystation12.dme b/baystation12.dme
index 9b5820432b..5e9dd2471c 100644
--- a/baystation12.dme
+++ b/baystation12.dme
@@ -383,7 +383,6 @@
#include "code\game\machinery\computer\computer.dm"
#include "code\game\machinery\computer\crew.dm"
#include "code\game\machinery\computer\guestpass.dm"
-#include "code\game\machinery\computer\hologram.dm"
#include "code\game\machinery\computer\law.dm"
#include "code\game\machinery\computer\medical.dm"
#include "code\game\machinery\computer\message.dm"
@@ -553,6 +552,7 @@
#include "code\game\objects\items\devices\pipe_painter.dm"
#include "code\game\objects\items\devices\powersink.dm"
#include "code\game\objects\items\devices\scanners.dm"
+#include "code\game\objects\items\devices\spy_bug.dm"
#include "code\game\objects\items\devices\suit_cooling.dm"
#include "code\game\objects\items\devices\taperecorder.dm"
#include "code\game\objects\items\devices\traitordevices.dm"
@@ -707,6 +707,7 @@
#include "code\game\objects\structures\tank_dispenser.dm"
#include "code\game\objects\structures\target_stake.dm"
#include "code\game\objects\structures\transit_tubes.dm"
+#include "code\game\objects\structures\under_wardrobe.dm"
#include "code\game\objects\structures\watercloset.dm"
#include "code\game\objects\structures\windoor_assembly.dm"
#include "code\game\objects\structures\window.dm"
@@ -875,7 +876,6 @@
#include "code\modules\clothing\spacesuits\rig\modules\computer.dm"
#include "code\modules\clothing\spacesuits\rig\modules\modules.dm"
#include "code\modules\clothing\spacesuits\rig\modules\ninja.dm"
-#include "code\modules\clothing\spacesuits\rig\modules\rig_weapons.dm"
#include "code\modules\clothing\spacesuits\rig\modules\utility.dm"
#include "code\modules\clothing\spacesuits\rig\modules\vision.dm"
#include "code\modules\clothing\spacesuits\rig\suits\alien.dm"
@@ -1136,6 +1136,7 @@
#include "code\modules\mob\living\silicon\ai\life.dm"
#include "code\modules\mob\living\silicon\ai\login.dm"
#include "code\modules\mob\living\silicon\ai\logout.dm"
+#include "code\modules\mob\living\silicon\ai\nano.dm"
#include "code\modules\mob\living\silicon\ai\say.dm"
#include "code\modules\mob\living\silicon\ai\freelook\cameranet.dm"
#include "code\modules\mob\living\silicon\ai\freelook\chunk.dm"
@@ -1225,7 +1226,11 @@
#include "code\modules\nano\nanoexternal.dm"
#include "code\modules\nano\nanomanager.dm"
#include "code\modules\nano\nanomapgen.dm"
+#include "code\modules\nano\nanoprocs.dm"
#include "code\modules\nano\nanoui.dm"
+#include "code\modules\nano\modules\crew_monitor.dm"
+#include "code\modules\nano\modules\power_monitor.dm"
+#include "code\modules\nano\modules\rcon.dm"
#include "code\modules\organs\blood.dm"
#include "code\modules\organs\organ.dm"
#include "code\modules\organs\organ_alien.dm"
@@ -1320,6 +1325,7 @@
#include "code\modules\projectiles\ammunition\bullets.dm"
#include "code\modules\projectiles\guns\alien.dm"
#include "code\modules\projectiles\guns\energy.dm"
+#include "code\modules\projectiles\guns\launcher.dm"
#include "code\modules\projectiles\guns\projectile.dm"
#include "code\modules\projectiles\guns\energy\laser.dm"
#include "code\modules\projectiles\guns\energy\nuclear.dm"
@@ -1327,14 +1333,17 @@
#include "code\modules\projectiles\guns\energy\special.dm"
#include "code\modules\projectiles\guns\energy\stun.dm"
#include "code\modules\projectiles\guns\energy\temperature.dm"
+#include "code\modules\projectiles\guns\launcher\crossbow.dm"
+#include "code\modules\projectiles\guns\launcher\grenade_launcher.dm"
+#include "code\modules\projectiles\guns\launcher\pneumatic.dm"
+#include "code\modules\projectiles\guns\launcher\rocket.dm"
+#include "code\modules\projectiles\guns\launcher\syringe_gun.dm"
#include "code\modules\projectiles\guns\projectile\automatic.dm"
-#include "code\modules\projectiles\guns\projectile\crossbow.dm"
-#include "code\modules\projectiles\guns\projectile\launcher.dm"
+#include "code\modules\projectiles\guns\projectile\dartgun.dm"
#include "code\modules\projectiles\guns\projectile\pistol.dm"
-#include "code\modules\projectiles\guns\projectile\pneumatic.dm"
#include "code\modules\projectiles\guns\projectile\revolver.dm"
-#include "code\modules\projectiles\guns\projectile\rocket.dm"
#include "code\modules\projectiles\guns\projectile\shotgun.dm"
+#include "code\modules\projectiles\guns\projectile\sniper.dm"
#include "code\modules\projectiles\projectile\animate.dm"
#include "code\modules\projectiles\projectile\beams.dm"
#include "code\modules\projectiles\projectile\bullets.dm"
@@ -1351,11 +1360,8 @@
#include "code\modules\reagents\Chemistry-Reagents-Antidepressants.dm"
#include "code\modules\reagents\Chemistry-Reagents.dm"
#include "code\modules\reagents\Chemistry-Recipes.dm"
-#include "code\modules\reagents\dartgun.dm"
-#include "code\modules\reagents\grenade_launcher.dm"
#include "code\modules\reagents\reagent_containers.dm"
#include "code\modules\reagents\reagent_dispenser.dm"
-#include "code\modules\reagents\syringe_gun.dm"
#include "code\modules\reagents\reagent_containers\blood_pack.dm"
#include "code\modules\reagents\reagent_containers\borghydro.dm"
#include "code\modules\reagents\reagent_containers\dropper.dm"
diff --git a/code/ATMOSPHERICS/components/binary_devices/circulator.dm b/code/ATMOSPHERICS/components/binary_devices/circulator.dm
index cb9ecfbdc5..a4b720302b 100644
--- a/code/ATMOSPHERICS/components/binary_devices/circulator.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/circulator.dm
@@ -1,37 +1,50 @@
//node1, air1, network1 correspond to input
//node2, air2, network2 correspond to output
+#define ADIABATIC_EXPONENT 0.667 //Actually adiabatic exponent - 1.
+
/obj/machinery/atmospherics/binary/circulator
- name = "circulator/heat exchanger"
- desc = "A gas circulator pump and heat exchanger."
+ name = "circulator"
+ desc = "A gas circulator turbine and heat exchanger."
icon = 'icons/obj/pipes.dmi'
icon_state = "circ-off"
anchored = 0
+ var/kinetic_efficiency = 0.04 //combined kinetic and kinetic-to-electric efficiency
+ var/volume_ratio = 0.2
+
var/recent_moles_transferred = 0
var/last_heat_capacity = 0
var/last_temperature = 0
var/last_pressure_delta = 0
var/last_worldtime_transfer = 0
+ var/last_stored_energy_transferred = 0
+ var/volume_capacity_used = 0
+ var/stored_energy = 0
density = 1
/obj/machinery/atmospherics/binary/circulator/New()
..()
- desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]."
+ desc = initial(desc) + " Its outlet port is to the [dir2text(dir)]."
+ air1.volume = 400
/obj/machinery/atmospherics/binary/circulator/proc/return_transfer_air()
var/datum/gas_mixture/removed
- if(anchored && !(stat&BROKEN) )
+ if(anchored && !(stat&BROKEN) && network1)
var/input_starting_pressure = air1.return_pressure()
var/output_starting_pressure = air2.return_pressure()
- last_pressure_delta = max(input_starting_pressure - output_starting_pressure + 10, 0)
+ last_pressure_delta = max(input_starting_pressure - output_starting_pressure - 5, 0)
- //only circulate air if there is a pressure difference (plus 10 kPa to represent friction in the machine)
- if(air1.temperature > 0 && last_pressure_delta > 0)
+ //only circulate air if there is a pressure difference (plus 5kPa kinetic, 10kPa static friction)
+ if(air1.temperature > 0 && last_pressure_delta > 5)
//Calculate necessary moles to transfer using PV = nRT
- recent_moles_transferred = last_pressure_delta*air2.volume/(air1.temperature * R_IDEAL_GAS_EQUATION)
+ recent_moles_transferred = (last_pressure_delta*network1.volume/(air1.temperature * R_IDEAL_GAS_EQUATION))/3 //uses the volume of the whole network, not just itself
+ volume_capacity_used = min( (last_pressure_delta*network1.volume/3)/(input_starting_pressure*air1.volume) , 1) //how much of the gas in the input air volume is consumed
+
+ //Calculate energy generated from kinetic turbine
+ stored_energy += 1/ADIABATIC_EXPONENT * min(last_pressure_delta * network1.volume , input_starting_pressure*air1.volume) * (1 - volume_ratio**ADIABATIC_EXPONENT) * kinetic_efficiency
//Actually transfer the gas
removed = air1.remove(recent_moles_transferred)
@@ -40,8 +53,7 @@
last_temperature = removed.temperature
//Update the gas networks.
- if(network1)
- network1.update = 1
+ network1.update = 1
last_worldtime_transfer = world.time
else
@@ -50,6 +62,11 @@
update_icon()
return removed
+/obj/machinery/atmospherics/binary/circulator/proc/return_stored_energy()
+ last_stored_energy_transferred = stored_energy
+ stored_energy = 0
+ return last_stored_energy_transferred
+
/obj/machinery/atmospherics/binary/circulator/process()
..()
@@ -72,8 +89,11 @@
/obj/machinery/atmospherics/binary/circulator/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(W, /obj/item/weapon/wrench))
+ playsound(src.loc, 'sound/items/Ratchet.ogg', 75, 1)
anchored = !anchored
- user << "\blue You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor."
+ user.visible_message("[user.name] [anchored ? "secures" : "unsecures"] the bolts holding [src.name] to the floor.", \
+ "You [anchored ? "secure" : "unsecure"] the bolts holding [src] to the floor.", \
+ "You hear a ratchet")
if(anchored)
if(dir & (NORTH|SOUTH))
diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm
index ed7290b00f..4961d22e79 100644
--- a/code/ATMOSPHERICS/components/unary/vent_pump.dm
+++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm
@@ -89,7 +89,7 @@
/obj/machinery/atmospherics/unary/vent_pump/engine
name = "Engine Core Vent"
power_channel = ENVIRON
- power_rating = 15000 //15 kW ~ 20 HP
+ power_rating = 30000 //15 kW ~ 20 HP
/obj/machinery/atmospherics/unary/vent_pump/engine/New()
..()
@@ -183,11 +183,11 @@
//JESUS FUCK. THERE ARE LITERALLY 250 OF YOU MOTHERFUCKERS ON ZLEVEL ONE AND YOU DO THIS SHIT EVERY TICK WHEN VERY OFTEN THERE IS NO REASON TO
if(pump_direction && pressure_checks == PRESSURE_CHECK_EXTERNAL && controller_iteration > 10) //99% of all vents
- //Fucking hibernate because you ain't doing shit.
+ //Fucking hibernate because you ain't doing shit.
hibernate = 1
spawn(rand(100,200)) //hibernate for 10 or 20 seconds randomly
- hibernate = 0
-
+ hibernate = 0
+
if (power_draw >= 0)
last_power_draw = power_draw
diff --git a/code/__HELPERS/game.dm b/code/__HELPERS/game.dm
index dcfcb50fcb..0dae7ecc0c 100644
--- a/code/__HELPERS/game.dm
+++ b/code/__HELPERS/game.dm
@@ -9,6 +9,13 @@
src:Topic(href, href_list)
return null
+/proc/is_on_same_plane_or_station(var/z1, var/z2)
+ if(z1 == z2)
+ return 1
+ if((z1 in config.station_levels) && (z2 in config.station_levels))
+ return 1
+ return 0
+
/proc/get_area(O)
var/turf/loc = get_turf(O)
if(!loc)
@@ -43,7 +50,7 @@
return level in config.station_levels
/proc/isNotStationLevel(var/level)
- return !isStationLevel()
+ return !isStationLevel(level)
/proc/isPlayerLevel(var/level)
return level in config.player_levels
diff --git a/code/__HELPERS/global_lists.dm b/code/__HELPERS/global_lists.dm
index df53342cee..68c74c614e 100644
--- a/code/__HELPERS/global_lists.dm
+++ b/code/__HELPERS/global_lists.dm
@@ -42,10 +42,10 @@ var/global/list/facial_hair_styles_male_list = list()
var/global/list/facial_hair_styles_female_list = list()
var/global/list/skin_styles_female_list = list() //unused
//Underwear
-var/global/list/underwear_m = list("White", "Grey", "Green", "Blue", "Black", "Mankini", "None") //Curse whoever made male/female underwear diffrent colours
-var/global/list/underwear_f = list("Red", "White", "Yellow", "Blue", "Black", "Thong", "Black Sports","White Sports","None")
+var/global/list/underwear_m = list("White" = "m1", "Grey" = "m2", "Green" = "m3", "Blue" = "m4", "Black" = "m5", "Mankini" = "m6", "None") //Curse whoever made male/female underwear diffrent colours
+var/global/list/underwear_f = list("Red" = "f1", "White" = "f2", "Yellow" = "f3", "Blue" = "f4", "Black" = "f5", "Thong" = "f6", "Black Sports" = "f7","White Sports" = "f8","None")
//undershirt
-var/global/list/undershirt_t = list("Black Tank top", "White Tank top", "Black shirt", "White shirt", "None")
+var/global/list/undershirt_t = list("Black Tank top" = "u1", "White Tank top" = "u2", "Black shirt" = "u3", "White shirt" = "u4", "None")
//Backpacks
var/global/list/backbaglist = list("Nothing", "Backpack", "Satchel", "Satchel Alt")
diff --git a/code/__HELPERS/lists.dm b/code/__HELPERS/lists.dm
index 56e04a21cc..1e8ccb6a4d 100644
--- a/code/__HELPERS/lists.dm
+++ b/code/__HELPERS/lists.dm
@@ -375,6 +375,12 @@ proc/listclearnulls(list/list)
i++
return null
+// Returns the key based on the index
+/proc/get_key_by_value(var/list/L, var/value)
+ for(var/key in L)
+ if(L[key] == value)
+ return key
+
/proc/count_by_type(var/list/L, type)
var/i = 0
for(var/T in L)
diff --git a/code/__HELPERS/text.dm b/code/__HELPERS/text.dm
index c14976bb78..27f5f98aa4 100644
--- a/code/__HELPERS/text.dm
+++ b/code/__HELPERS/text.dm
@@ -329,14 +329,25 @@ proc/TextPreview(var/string,var/len=40)
//This means that it doesn't just remove < and > and call it a day.
//Also limit the size of the input, if specified.
/proc/strip_html_properly(var/input, var/max_length = MAX_MESSAGE_LEN)
+ if(!input)
+ return
var/opentag = 1 //These store the position of < and > respectively.
var/closetag = 1
while(1)
opentag = findtext(input, "<")
closetag = findtext(input, ">")
- if(!closetag || !opentag)
+ if(closetag && opentag)
+ if(closetag < opentag)
+ input = copytext(input, (closetag + 1))
+ else
+ input = copytext(input, 1, opentag) + copytext(input, (closetag + 1))
+ else if(closetag || opentag)
+ if(opentag)
+ input = copytext(input, 1, opentag)
+ else
+ input = copytext(input, (closetag + 1))
+ else
break
- input = copytext(input, 1, opentag) + copytext(input, (closetag + 1))
if(max_length)
input = copytext(input,1,max_length)
return sanitize(input)
diff --git a/code/_onclick/hud/human.dm b/code/_onclick/hud/human.dm
index 33a14d2e4d..9f3991bbc2 100644
--- a/code/_onclick/hud/human.dm
+++ b/code/_onclick/hud/human.dm
@@ -433,9 +433,6 @@
f_style = "Shaved"
if(dna.species == "Human") //no more xenos losing ears/tentacles
h_style = pick("Bedhead", "Bedhead 2", "Bedhead 3")
- undershirt = undershirt_t.Find("None")
- if(gender == MALE)
- underwear = underwear_m.Find("None")
- else
- underwear = underwear_f.Find("None")
+ undershirt = null
+ underwear = null
regenerate_icons()
diff --git a/code/_onclick/hud/monkey.dm b/code/_onclick/hud/monkey.dm
index 65924284b5..0081fbe6b5 100644
--- a/code/_onclick/hud/monkey.dm
+++ b/code/_onclick/hud/monkey.dm
@@ -226,7 +226,7 @@
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
mymob.gun_setting_icon.set_dir(2)
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
- if (G.target)
+ if (G.aim_targets)
mymob.item_use_icon = new /obj/screen/gun/item(null)
if (mymob.client.target_can_click)
mymob.item_use_icon.set_dir(1)
diff --git a/code/_onclick/hud/robot.dm b/code/_onclick/hud/robot.dm
index 644b811376..2738cf3a7d 100644
--- a/code/_onclick/hud/robot.dm
+++ b/code/_onclick/hud/robot.dm
@@ -157,7 +157,7 @@ var/obj/screen/robot_inventory
if (mymob.client.gun_mode) // If in aim mode, correct the sprite
mymob.gun_setting_icon.set_dir(2)
for(var/obj/item/weapon/gun/G in mymob) // If targeting someone, display other buttons
- if (G.target)
+ if (G.aim_targets)
mymob.item_use_icon = new /obj/screen/gun/item(null)
if (mymob.client.target_can_click)
mymob.item_use_icon.set_dir(1)
diff --git a/code/controllers/master_controller.dm b/code/controllers/master_controller.dm
index 8675033ef0..97e4c8074b 100644
--- a/code/controllers/master_controller.dm
+++ b/code/controllers/master_controller.dm
@@ -288,6 +288,7 @@ datum/controller/game_controller/proc/process_machines_process()
last_thing_processed = Machine.type
if(Machine.process() != PROCESS_KILL)
if(Machine)
+ Machine.power_change()
if(Machine.use_power)
Machine.auto_use_power()
continue
diff --git a/code/datums/wires/airlock.dm b/code/datums/wires/airlock.dm
index e6cb473f59..f8b796269f 100644
--- a/code/datums/wires/airlock.dm
+++ b/code/datums/wires/airlock.dm
@@ -34,14 +34,17 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048
/datum/wires/airlock/GetInteractWindow()
var/obj/machinery/door/airlock/A = holder
+ var/haspower = A.arePowerSystemsOn() //If there's no power, then no lights will be on.
+
. += ..()
- . += text("
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]", (A.locked ? "The door bolts have fallen!" : "The door bolts look up."),
- (A.lights ? "The door bolt lights are on." : "The door bolt lights are off!"),
- ((A.hasPower()) ? "The test light is on." : "The test light is off!"),
- ((A.aiControlDisabled==0 && !A.emagged) ? "The 'AI control allowed' light is on." : "The 'AI control allowed' light is off."),
- (A.safe==0 ? "The 'Check Wiring' light is on." : "The 'Check Wiring' light is off."),
- (A.normalspeed==0 ? "The 'Check Timing Mechanism' light is on." : "The 'Check Timing Mechanism' light is off."),
- (A.aiDisabledIdScanner==0 ? "The IDScan light is on." : "The IDScan light is off."))
+ . += text("
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]",
+ (A.locked ? "The door bolts have fallen!" : "The door bolts look up."),
+ ((A.lights && haspower) ? "The door bolt lights are on." : "The door bolt lights are off!"),
+ ((haspower) ? "The test light is on." : "The test light is off!"),
+ ((A.aiControlDisabled==0 && !A.emagged && haspower)? "The 'AI control allowed' light is on." : "The 'AI control allowed' light is off."),
+ ((A.safe==0 && haspower)? "The 'Check Wiring' light is on." : "The 'Check Wiring' light is off."),
+ ((A.normalspeed==0 && haspower)? "The 'Check Timing Mechanism' light is on." : "The 'Check Timing Mechanism' light is off."),
+ ((A.aiDisabledIdScanner==0 && haspower)? "The IDScan light is on." : "The IDScan light is off."))
/datum/wires/airlock/UpdateCut(var/index, var/mended)
@@ -127,7 +130,7 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048
switch(index)
if(AIRLOCK_WIRE_IDSCAN)
//Sending a pulse through flashes the red light on the door (if the door has power).
- if(A.hasPower() && A.density)
+ if(A.arePowerSystemsOn() && A.density)
A.do_animate("deny")
if(AIRLOCK_WIRE_MAIN_POWER1 || AIRLOCK_WIRE_MAIN_POWER2)
//Sending a pulse through either one causes a breaker to trip, disabling the door for 10 seconds if backup power is connected, or 1 minute if not (or until backup power comes back on, whichever is shorter).
@@ -139,7 +142,7 @@ var/const/AIRLOCK_WIRE_LIGHT = 2048
A.locked = 1
A.audible_message("You hear a click from the bottom of the door.", null, 1)
else
- if(A.hasPower()) //only can raise bolts if power's on
+ if(A.arePowerSystemsOn()) //only can raise bolts if power's on
A.locked = 0
A.audible_message("You hear a click from the bottom of the door.", null, 1)
A.update_icon()
diff --git a/code/datums/wires/alarm.dm b/code/datums/wires/alarm.dm
index e8d68d7ffe..6ebc937265 100644
--- a/code/datums/wires/alarm.dm
+++ b/code/datums/wires/alarm.dm
@@ -11,7 +11,7 @@ var/const/AALARM_WIRE_AALARM = 16
/datum/wires/alarm/CanUse(var/mob/living/L)
var/obj/machinery/alarm/A = holder
- if(A.wiresexposed)
+ if(A.wiresexposed && A.buildstage == 2)
return 1
return 0
diff --git a/code/datums/wires/vending.dm b/code/datums/wires/vending.dm
index 91a95b47a7..7f9c4ed10a 100644
--- a/code/datums/wires/vending.dm
+++ b/code/datums/wires/vending.dm
@@ -1,3 +1,5 @@
+#define CAT_HIDDEN 2 // Also in code/game/machinery/vending.dm
+
/datum/wires/vending
holder_type = /obj/machinery/vending
wire_count = 4
@@ -17,17 +19,12 @@ var/const/VENDING_WIRE_IDSCAN = 8
return 1
return 0
-/datum/wires/vending/Interact(var/mob/living/user)
- if(CanUse(user))
- var/obj/machinery/vending/V = holder
- V.attack_hand(user)
-
/datum/wires/vending/GetInteractWindow()
var/obj/machinery/vending/V = holder
. += ..()
. += "
The orange light is [V.seconds_electrified ? "off" : "on"].
"
. += "The red light is [V.shoot_inventory ? "off" : "blinking"].
"
- . += "The green light is [V.extended_inventory ? "on" : "off"].
"
+ . += "The green light is [(V.categories & CAT_HIDDEN) ? "on" : "off"].
"
. += "The [V.scan_id ? "purple" : "yellow"] light is on.
"
/datum/wires/vending/UpdatePulsed(var/index)
@@ -36,7 +33,7 @@ var/const/VENDING_WIRE_IDSCAN = 8
if(VENDING_WIRE_THROW)
V.shoot_inventory = !V.shoot_inventory
if(VENDING_WIRE_CONTRABAND)
- V.extended_inventory = !V.extended_inventory
+ V.categories ^= CAT_HIDDEN
if(VENDING_WIRE_ELECTRIFY)
V.seconds_electrified = 30
if(VENDING_WIRE_IDSCAN)
@@ -48,7 +45,7 @@ var/const/VENDING_WIRE_IDSCAN = 8
if(VENDING_WIRE_THROW)
V.shoot_inventory = !mended
if(VENDING_WIRE_CONTRABAND)
- V.extended_inventory = 0
+ V.categories &= ~CAT_HIDDEN
if(VENDING_WIRE_ELECTRIFY)
if(mended)
V.seconds_electrified = 0
diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm
index 634121b08c..e513a7db37 100644
--- a/code/defines/obj/weapon.dm
+++ b/code/defines/obj/weapon.dm
@@ -67,7 +67,7 @@
icon_state = "bike_horn"
item_state = "bike_horn"
throwforce = 3
- w_class = 1.0
+ w_class = 2
throw_speed = 3
throw_range = 15
attack_verb = list("HONKED")
@@ -84,7 +84,6 @@
throw_speed = 4
throw_range = 5
-
/obj/item/weapon/cane
name = "cane"
desc = "A cane used by a true gentlemen. Or a clown."
@@ -98,6 +97,46 @@
matter = list("metal" = 50)
attack_verb = list("bludgeoned", "whacked", "disciplined", "thrashed")
+/obj/item/weapon/cane/concealed
+ var/concealed_blade
+
+/obj/item/weapon/cane/concealed/New()
+ ..()
+ concealed_blade = new/obj/item/weapon/butterfly/switchblade(src)
+
+/obj/item/weapon/cane/concealed/attack_self(mob/user)
+ if(concealed_blade)
+ user.visible_message("[user] has unsheathed \a [concealed_blade] from \his [src]!", "You unsheathe \the [concealed_blade] from \the [src].")
+ // Calling drop/put in hands to properly call item drop/pickup procs
+ playsound(user.loc, 'sound/weapons/flipblade.ogg', 50, 1)
+ user.drop_from_inventory(src)
+ user.put_in_hands(concealed_blade)
+ user.put_in_hands(src)
+ concealed_blade = null
+ update_icon()
+ else
+ ..()
+
+/obj/item/weapon/cane/concealed/attackby(var/obj/item/weapon/butterfly/W, var/mob/user)
+ if(!src.concealed_blade && istype(W))
+ user.visible_message("[user] has sheathed \a [W] into \his [src]!", "You sheathe \the [W] into \the [src].")
+ user.drop_from_inventory(W)
+ W.loc = src
+ src.concealed_blade = W
+ update_icon()
+ else
+ ..()
+
+/obj/item/weapon/cane/concealed/update_icon()
+ if(concealed_blade)
+ name = initial(name)
+ icon_state = initial(icon_state)
+ item_state = initial(icon_state)
+ else
+ name = "cane shaft"
+ icon_state = "nullrod"
+ item_state = "foldcane"
+
/obj/item/weapon/disk
name = "disk"
icon = 'icons/obj/items.dmi'
diff --git a/code/defines/procs/announce.dm b/code/defines/procs/announce.dm
index b74f7a1c78..d3aef96c45 100644
--- a/code/defines/procs/announce.dm
+++ b/code/defines/procs/announce.dm
@@ -36,7 +36,7 @@
var/tmp/message_title = new_title ? new_title : title
var/tmp/message_sound = new_sound ? sound(new_sound) : sound
- message = html_encode(message)
+ message = trim_strip_html_properly(message)
message_title = html_encode(message_title)
Message(message, message_title)
diff --git a/code/game/gamemodes/changeling/changeling_powers.dm b/code/game/gamemodes/changeling/changeling_powers.dm
index 5dcc891fa9..8d15141df1 100644
--- a/code/game/gamemodes/changeling/changeling_powers.dm
+++ b/code/game/gamemodes/changeling/changeling_powers.dm
@@ -679,11 +679,16 @@ var/list/datum/dna/hivemind_bank = list()
//////////
/mob/proc/sting_can_reach(mob/M as mob, sting_range = 1)
- if(M.loc == src.loc) return 1 //target and source are in the same thing
- if(!isturf(src.loc) || !isturf(M.loc)) return 0 //One is inside, the other is outside something.
- if(AStar(src.loc, M.loc, /turf/proc/AdjacentTurfs, /turf/proc/Distance, sting_range)) //If a path exists, good!
- return 1
- return 0
+ if(M.loc == src.loc)
+ return 1 //target and source are in the same thing
+ if(!isturf(src.loc) || !isturf(M.loc))
+ src << "We cannot reach \the [M] with a sting!"
+ return 0 //One is inside, the other is outside something.
+ // Maximum queued turfs set to 25; I don't *think* anything raises sting_range above 2, but if it does the 25 may need raising
+ if(!AStar(src.loc, M.loc, /turf/proc/AdjacentTurfs, /turf/proc/Distance, max_nodes=25, max_node_depth=sting_range)) //If we can't find a path, fail
+ src << "We cannot find a path to sting \the [M] by!"
+ return 0
+ return 1
//Handles the general sting code to reduce on copypasta (seeming as somebody decided to make SO MANY dumb abilities)
/mob/proc/changeling_sting(var/required_chems=0, var/verb_path)
diff --git a/code/game/gamemodes/factions.dm b/code/game/gamemodes/factions.dm
index 1aaa70e2a5..47c8586f6e 100644
--- a/code/game/gamemodes/factions.dm
+++ b/code/game/gamemodes/factions.dm
@@ -119,7 +119,7 @@
operative_notes = "We'd like to remind our operatives to keep it professional. You are not here to have a good time, you are here to accomplish your objectives. These vile communists must be stopped at all costs. You may collaborate with any friends of the Syndicate coalition, but keep an eye on any of those Tiger punks if they do show up. You are completely free to accomplish your objectives any way you see fit."
uplink_contents = {"Highly Visible and Dangerous Weapons;
-/obj/item/weapon/gun/projectile:6:Revolver;
+/obj/item/weapon/gun/projectile/revolver:6:Revolver;
/obj/item/ammo_magazine/a357:2:Ammo-357;
/obj/item/weapon/gun/energy/crossbow:5:Energy Crossbow;
/obj/item/weapon/melee/energy/sword:4:Energy Sword;
diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm
index fca51edf83..8ad2d72288 100644
--- a/code/game/gamemodes/game_mode.dm
+++ b/code/game/gamemodes/game_mode.dm
@@ -33,47 +33,58 @@
var/uplink_uses = 10
var/list/datum/uplink_item/uplink_items = list(
"Highly Visible and Dangerous Weapons" = list(
- new/datum/uplink_item(/obj/item/weapon/gun/projectile, 6, "Revolver", "RE"),
+ new/datum/uplink_item(/obj/item/ammo_magazine/mc9mm, 2, "Ammo-9mm", "R9"),
new/datum/uplink_item(/obj/item/ammo_magazine/a357, 2, "Ammo-357", "RA"),
- new/datum/uplink_item(/obj/item/weapon/gun/energy/crossbow, 5, "Energy Crossbow", "XB"),
+ new/datum/uplink_item(/obj/item/weapon/storage/box/emps, 3, "5 EMP Grenades", "EM"),
new/datum/uplink_item(/obj/item/weapon/melee/energy/sword, 4, "Energy Sword", "ES"),
+ new/datum/uplink_item(/obj/item/weapon/gun/energy/crossbow, 5, "Energy Crossbow", "XB"),
+ new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/g9mm, 5, "Silenced 9mm", "S9"),
new/datum/uplink_item(/obj/item/mecha_parts/mecha_equipment/weapon/energy/riggedlaser, 6, "Exosuit Rigged Laser", "RL"),
- new/datum/uplink_item(/obj/item/weapon/storage/box/syndicate, 10, "Mercenary Bundle", "BU"),
- new/datum/uplink_item(/obj/item/weapon/storage/box/emps, 3, "5 EMP Grenades", "EM")
+ new/datum/uplink_item(/obj/item/weapon/gun/projectile/revolver, 6, "Revolver", "RE"),
+ new/datum/uplink_item(/obj/item/weapon/storage/box/syndicate, 10, "Mercenary Bundle", "BU")
),
"Stealthy and Inconspicuous Weapons" = list(
- new/datum/uplink_item(/obj/item/weapon/pen/paralysis, 3, "Paralysis Pen", "PP"),
new/datum/uplink_item(/obj/item/weapon/soap/syndie, 1, "Subversive Soap", "SP"),
- new/datum/uplink_item(/obj/item/weapon/cartridge/syndicate, 3, "Detomatix PDA Cartridge", "DC")
+ new/datum/uplink_item(/obj/item/weapon/cane/concealed, 2, "Concealed Cane Sword", "CC"),
+ new/datum/uplink_item(/obj/item/weapon/cartridge/syndicate, 3, "Detomatix PDA Cartridge", "DC"),
+ new/datum/uplink_item(/obj/item/weapon/pen/paralysis, 3, "Paralysis Pen", "PP"),
+ new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/cigarette, 4, "Cigarette Kit", "BH")
),
"Stealth and Camouflage Items" = list(
- new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/chameleon, 3, "Chameleon Kit", "CB"),
- new/datum/uplink_item(/obj/item/clothing/shoes/syndigaloshes, 2, "No-Slip Shoes", "SH"),
new/datum/uplink_item(/obj/item/weapon/card/id/syndicate, 2, "Agent ID card", "AC"),
+ new/datum/uplink_item(/obj/item/clothing/shoes/syndigaloshes, 2, "No-Slip Shoes", "SH"),
+ new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/spy, 2, "Bug Kit", "SK"),
+ new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/chameleon, 3, "Chameleon Kit", "CB"),
+ new/datum/uplink_item(/obj/item/device/chameleon, 4, "Chameleon-Projector", "CP"),
new/datum/uplink_item(/obj/item/clothing/mask/gas/voice, 4, "Voice Changer", "VC"),
- new/datum/uplink_item(/obj/item/device/chameleon, 4, "Chameleon-Projector", "CP")
+ new/datum/uplink_item(/obj/item/weapon/disk/file/cameras/syndicate, 6, "Camera Network Access - Floppy", "SF")
),
"Devices and Tools" = list(
- new/datum/uplink_item(/obj/item/weapon/card/emag, 3, "Cryptographic Sequencer", "EC"),
new/datum/uplink_item(/obj/item/weapon/storage/toolbox/syndicate, 1, "Fully Loaded Toolbox", "ST"),
+ new/datum/uplink_item(/obj/item/weapon/plastique, 2, "C-4 (Destroys walls)", "C4"),
+ new/datum/uplink_item(/obj/item/device/encryptionkey/binary, 3, "Binary Translator Key", "BT"),
+ new/datum/uplink_item(/obj/item/weapon/card/emag, 3, "Cryptographic Sequencer", "EC"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/clerical, 3, "Morphic Clerical Kit", "CK"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/space, 3, "Space Suit", "SS"),
new/datum/uplink_item(/obj/item/clothing/glasses/thermal/syndi, 3, "Thermal Imaging Glasses", "TM"),
- new/datum/uplink_item(/obj/item/device/encryptionkey/binary, 3, "Binary Translator Key", "BT"),
new/datum/uplink_item(/obj/item/weapon/aiModule/syndicate, 7, "Hacked AI Upload Module", "AI"),
- new/datum/uplink_item(/obj/item/weapon/plastique, 2, "C-4 (Destroys walls)", "C4"),
new/datum/uplink_item(/obj/item/device/powersink, 5, "Powersink (DANGER!)", "PS",),
new/datum/uplink_item(/obj/item/device/radio/beacon/syndicate, 7, "Singularity Beacon (DANGER!)", "SB"),
new/datum/uplink_item(/obj/item/weapon/circuitboard/teleporter, 20, "Teleporter Circuit Board", "TP")
),
"Implants" = list(
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_freedom, 3, "Freedom Implant", "FI"),
- new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_uplink, 10, "Uplink Implant (Contains 5 Telecrystals)", "UI"),
+ new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_compress, 4, "Compressed Matter Implant", "CI"),
new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_explosive, 6, "Explosive Implant (DANGER!)", "EI"),
- new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_compress, 4, "Compressed Matter Implant", "CI")
+ new/datum/uplink_item(/obj/item/weapon/storage/box/syndie_kit/imp_uplink, 10, "Uplink Implant (Contains 5 Telecrystals)", "UI")
),
+ "Health Aids" = list(
+ new/datum/uplink_item(/obj/item/weapon/storage/box/donkpockets, 1, "Box of Donk-Pockets", "DP"),
+ new/datum/uplink_item(/obj/item/weapon/storage/firstaid/combat, 5, "Combat medical kit", "CM")
+ ),
"(Pointless) Badassery" = list(
- new/datum/uplink_item(/obj/item/toy/syndicateballoon, 10, "For showing that You Are The BOSS (Useless Balloon)", "BS")
+ new/datum/uplink_item(/obj/item/toy/syndicateballoon, 10, "For showing that You Are The BOSS (Useless Balloon)", "BS"),
+ new/datum/uplink_item(/obj/item/toy/nanotrasenballoon, 10, "For showing that you love NT SOO much (Useless Balloon)", "NT")
)
)
diff --git a/code/game/gamemodes/wizard/rightandwrong.dm b/code/game/gamemodes/wizard/rightandwrong.dm
index ccce7f9bff..1e16da590b 100644
--- a/code/game/gamemodes/wizard/rightandwrong.dm
+++ b/code/game/gamemodes/wizard/rightandwrong.dm
@@ -26,7 +26,7 @@
if("revolver")
new /obj/item/weapon/gun/projectile(get_turf(H))
if("detective")
- new /obj/item/weapon/gun/projectile/detective(get_turf(H))
+ new /obj/item/weapon/gun/projectile/revolver/detective(get_turf(H))
if("smg")
new /obj/item/weapon/gun/projectile/automatic/c20r(get_turf(H))
if("nuclear")
@@ -49,7 +49,7 @@
if("combatshotgun")
new /obj/item/weapon/gun/projectile/shotgun/pump/combat(get_turf(H))
if("mateba")
- new /obj/item/weapon/gun/projectile/mateba(get_turf(H))
+ new /obj/item/weapon/gun/projectile/revolver/mateba(get_turf(H))
if("smg")
new /obj/item/weapon/gun/projectile/automatic(get_turf(H))
if("uzi")
diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm
index 1dd4615461..2ffdcc6e2f 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -921,8 +921,13 @@ table tr:first-child th:first-child { border: none;}
update_icon()
return
- if (wiresexposed && ((istype(W, /obj/item/device/multitool) || istype(W, /obj/item/weapon/wirecutters))))
- return attack_hand(user)
+ if (wiresexposed && istype(W, /obj/item/weapon/wirecutters))
+ user.visible_message("[user] has cut the wires inside \the [src]!", "You have cut the wires inside \the [src].")
+ playsound(src.loc, 'sound/items/Wirecutter.ogg', 50, 1)
+ new/obj/item/stack/cable_coil(get_turf(src), 5)
+ buildstage = 1
+ update_icon()
+ return
if (istype(W, /obj/item/weapon/card/id) || istype(W, /obj/item/device/pda))// trying to unlock the interface with an ID card
if(stat & (NOPOWER|BROKEN))
@@ -1309,7 +1314,7 @@ FIRE ALARM
/obj/machinery/firealarm/proc/delayed_reset()
var/area/A = get_area(src)
if (!A) return
-
+
src = null
spawn(600)
A.firereset()
diff --git a/code/game/machinery/autolathe_datums.dm b/code/game/machinery/autolathe_datums.dm
index f13c3dc634..38989d2905 100644
--- a/code/game/machinery/autolathe_datums.dm
+++ b/code/game/machinery/autolathe_datums.dm
@@ -201,6 +201,11 @@
path = /obj/item/weapon/reagent_containers/syringe
category = "Medical"
+/datum/autolathe/recipe/syringegun_ammo
+ name = "syringe"
+ path = /obj/item/weapon/syringe_cartridge
+ category = "Arms and Ammunition"
+
/datum/autolathe/recipe/shotgun_blanks
name = "ammunition (shotgun, blank)"
path = /obj/item/ammo_casing/shotgun/blank
@@ -217,13 +222,13 @@
category = "Arms and Ammunition"
/datum/autolathe/recipe/magazine_rubber
- name = "ammunition (rubber)"
- path = /obj/item/ammo_magazine/c45r
+ name = "ammunition (.45, rubber)"
+ path = /obj/item/ammo_magazine/c45m/rubber
category = "Arms and Ammunition"
/datum/autolathe/recipe/magazine_flash
- name = "ammunition (flash)"
- path = /obj/item/ammo_magazine/c45f
+ name = "ammunition (.45, flash)"
+ path = /obj/item/ammo_magazine/c45m/flash
category = "Arms and Ammunition"
/datum/autolathe/recipe/consolescreen
@@ -294,6 +299,24 @@
hidden = 1
category = "Arms and Ammunition"
+/datum/autolathe/recipe/magazine_stetchkin
+ name = "ammunition (9mm)"
+ path = /obj/item/ammo_magazine/mc9mm
+ hidden = 1
+ category = "Arms and Ammunition"
+
+/datum/autolathe/recipe/magazine_stetchkin_flash
+ name = "ammunition (9mm, flash)"
+ path = /obj/item/ammo_magazine/mc9mm/flash
+ hidden = 1
+ category = "Arms and Ammunition"
+
+/datum/autolathe/recipe/magazine_c20r
+ name = "ammunition (12mm)"
+ path = /obj/item/ammo_magazine/a12mm
+ hidden = 1
+ category = "Arms and Ammunition"
+
/datum/autolathe/recipe/shotgun
name = "ammunition (slug, shotgun)"
path = /obj/item/ammo_casing/shotgun
@@ -306,6 +329,12 @@
hidden = 1
category = "Arms and Ammunition"
+/datum/autolathe/recipe/stunshell
+ name = "ammunition (stun cartridge, shotgun)"
+ path = /obj/item/ammo_casing/shotgun/stunshell
+ hidden = 1
+ category = "Arms and Ammunition"
+
/datum/autolathe/recipe/rcd
name = "rapid construction device"
path = /obj/item/weapon/rcd
diff --git a/code/game/machinery/bots/ed209bot.dm b/code/game/machinery/bots/ed209bot.dm
index 24e29e2839..639da55bf5 100644
--- a/code/game/machinery/bots/ed209bot.dm
+++ b/code/game/machinery/bots/ed209bot.dm
@@ -34,10 +34,10 @@
var/obj/item/weapon/gun/energy/taser/G = new /obj/item/weapon/gun/energy/taser(Tsec)
G.power_supply.charge = 0
else if(lasercolor == "b")
- var/obj/item/weapon/gun/energy/laser/bluetag/G = new /obj/item/weapon/gun/energy/laser/bluetag(Tsec)
+ var/obj/item/weapon/gun/energy/lasertag/blue/G = new (Tsec)
G.power_supply.charge = 0
else if(lasercolor == "r")
- var/obj/item/weapon/gun/energy/laser/redtag/G = new /obj/item/weapon/gun/energy/laser/redtag(Tsec)
+ var/obj/item/weapon/gun/energy/lasertag/red/G = new (Tsec)
G.power_supply.charge = 0
if (prob(50))
new /obj/item/robot_parts/l_leg(Tsec)
@@ -137,11 +137,11 @@
if(7)
switch(lasercolor)
if("b")
- if( !istype(W, /obj/item/weapon/gun/energy/laser/bluetag) )
+ if( !istype(W, /obj/item/weapon/gun/energy/lasertag/blue) )
return
name = "bluetag ED-209 assembly"
if("r")
- if( !istype(W, /obj/item/weapon/gun/energy/laser/redtag) )
+ if( !istype(W, /obj/item/weapon/gun/energy/lasertag/red) )
return
name = "redtag ED-209 assembly"
if("")
diff --git a/code/game/machinery/bots/medbot.dm b/code/game/machinery/bots/medbot.dm
index 65a40289d0..a83f59d03f 100644
--- a/code/game/machinery/bots/medbot.dm
+++ b/code/game/machinery/bots/medbot.dm
@@ -455,7 +455,7 @@
return
/obj/machinery/bot/medbot/bullet_act(var/obj/item/projectile/Proj)
- if(Proj.flag == "taser")
+ if(Proj.taser_effect)
src.stunned = min(stunned+10,20)
..()
diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm
index 1dcc02fbb9..6aa43c1b39 100644
--- a/code/game/machinery/bots/secbot.dm
+++ b/code/game/machinery/bots/secbot.dm
@@ -702,10 +702,10 @@ Auto Patrol: []"},
switch(lasercolor)
if("b")
target_suit = /obj/item/clothing/suit/redtag
- target_weapon = /obj/item/weapon/gun/energy/laser/redtag
+ target_weapon = /obj/item/weapon/gun/energy/lasertag/red
if("r")
target_suit = /obj/item/clothing/suit/bluetag
- target_weapon = /obj/item/weapon/gun/energy/laser/bluetag
+ target_weapon = /obj/item/weapon/gun/energy/lasertag/blue
if((istype(perp.r_hand, target_weapon)) || (istype(perp.l_hand, target_weapon)))
threat += 4
diff --git a/code/game/machinery/computer/RCON_Console.dm b/code/game/machinery/computer/RCON_Console.dm
index a28b6ad42d..f80f0b93c4 100644
--- a/code/game/machinery/computer/RCON_Console.dm
+++ b/code/game/machinery/computer/RCON_Console.dm
@@ -5,19 +5,18 @@
// Allows remote operation of electrical systems on station (SMESs and Breaker Boxes)
/obj/machinery/computer/rcon
- name = "\improper RCON remote control console"
+ name = "\improper RCON console"
desc = "Console used to remotely control machinery on the station."
icon = 'icons/obj/computer.dmi'
icon_state = "ai-fixer"
circuit = /obj/item/weapon/circuitboard/rcon_console
req_one_access = list(access_engine)
var/current_tag = null
- var/list/known_SMESs = null
- var/list/known_breakers = null
- // Allows you to hide specific parts of the UI
- var/hide_SMES = 0
- var/hide_SMES_details = 0
- var/hide_breakers = 0
+ var/obj/nano_module/rcon/rcon
+
+/obj/machinery/computer/rcon/New()
+ ..()
+ rcon = new(src)
// Proc: attack_hand()
// Parameters: 1 (user - Person which clicked this computer)
@@ -29,106 +28,5 @@
// Proc: ui_interact()
// Parameters: 4 (standard NanoUI parameters)
// Description: Uses dark magic (NanoUI) to render this machine's UI
-/obj/machinery/computer/rcon/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
- FindDevices() // Update our devices list
- var/data[0]
-
- // SMES DATA (simplified view)
- var/list/smeslist[0]
- for(var/obj/machinery/power/smes/buildable/SMES in known_SMESs)
- smeslist.Add(list(list(
- "charge" = round(SMES.Percentage()),
- "input_set" = SMES.input_attempt,
- "input_val" = round(SMES.input_level),
- "output_set" = SMES.output_attempt,
- "output_val" = round(SMES.output_level),
- "output_load" = round(SMES.output_used),
- "RCON_tag" = SMES.RCon_tag
- )))
-
- data["smes_info"] = sortByKey(smeslist, "RCON_tag")
-
- // BREAKER DATA (simplified view)
- var/list/breakerlist[0]
- for(var/obj/machinery/power/breakerbox/BR in known_breakers)
- breakerlist.Add(list(list(
- "RCON_tag" = BR.RCon_tag,
- "enabled" = BR.on
- )))
- data["breaker_info"] = breakerlist
- data["hide_smes"] = hide_SMES
- data["hide_smes_details"] = hide_SMES_details
- data["hide_breakers"] = hide_breakers
-
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
- ui = new(user, src, ui_key, "rcon.tmpl", "RCON Control Console", 600, 400)
- ui.set_initial_data(data)
- ui.open()
- ui.set_auto_update(1)
-
-// Proc: Topic()
-// Parameters: 2 (href, href_list - allows us to process UI clicks)
-// Description: Allows us to process UI clicks, which are relayed in form of hrefs.
-/obj/machinery/computer/rcon/Topic(href, href_list)
- if(href_list["smes_in_toggle"])
- var/obj/machinery/power/smes/buildable/SMES = GetSMESByTag(href_list["smes_in_toggle"])
- if(SMES)
- SMES.toggle_input()
- if(href_list["smes_out_toggle"])
- var/obj/machinery/power/smes/buildable/SMES = GetSMESByTag(href_list["smes_out_toggle"])
- if(SMES)
- SMES.toggle_output()
- if(href_list["smes_in_set"])
- var/obj/machinery/power/smes/buildable/SMES = GetSMESByTag(href_list["smes_in_set"])
- if(SMES)
- var/inputset = input(usr, "Enter new input level (0-[SMES.input_level_max])", "SMES Input Power Control") as num
- SMES.set_input(inputset)
- if(href_list["smes_out_set"])
- var/obj/machinery/power/smes/buildable/SMES = GetSMESByTag(href_list["smes_out_set"])
- if(SMES)
- var/outputset = input(usr, "Enter new output level (0-[SMES.output_level_max])", "SMES Input Power Control") as num
- SMES.set_output(outputset)
-
- if(href_list["toggle_breaker"])
- var/obj/machinery/power/breakerbox/toggle = null
- for(var/obj/machinery/power/breakerbox/breaker in known_breakers)
- if(breaker.RCon_tag == href_list["toggle_breaker"])
- toggle = breaker
- if(toggle)
- if(toggle.update_locked)
- usr << "The breaker box was recently toggled. Please wait before toggling it again."
- else
- toggle.auto_toggle()
- if(href_list["hide_smes"])
- hide_SMES = !hide_SMES
- if(href_list["hide_smes_details"])
- hide_SMES_details = !hide_SMES_details
- if(href_list["hide_breakers"])
- hide_breakers = !hide_breakers
-
-
-// Proc: GetSMESByTag()
-// Parameters: 1 (tag - RCON tag of SMES we want to look up)
-// Description: Looks up and returns SMES which has matching RCON tag
-/obj/machinery/computer/rcon/proc/GetSMESByTag(var/tag)
- if(!tag)
- return
-
- for(var/obj/machinery/power/smes/buildable/S in known_SMESs)
- if(S.RCon_tag == tag)
- return S
-
-// Proc: FindDevices()
-// Parameters: None
-// Description: Refreshes local list of known devices.
-/obj/machinery/computer/rcon/proc/FindDevices()
- known_SMESs = new /list()
- for(var/obj/machinery/power/smes/buildable/SMES in machines)
- if(SMES.RCon_tag && (SMES.RCon_tag != "NO_TAG") && SMES.RCon)
- known_SMESs.Add(SMES)
-
- known_breakers = new /list()
- for(var/obj/machinery/power/breakerbox/breaker in machines)
- if(breaker.RCon_tag != "NO_TAG")
- known_breakers.Add(breaker)
\ No newline at end of file
+/obj/machinery/computer/rcon/ui_interact(mob/user, ui_key = "rcon", var/datum/nanoui/ui = null, var/force_open = 1)
+ rcon.ui_interact(user, ui_key, ui, force_open)
diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm
index f18d906383..a8403bbede 100644
--- a/code/game/machinery/computer/communications.dm
+++ b/code/game/machinery/computer/communications.dm
@@ -110,7 +110,7 @@
if(message_cooldown)
usr << "Please allow at least one minute to pass between announcements"
return
- var/input = stripped_input(usr, "Please write a message to announce to the station crew.", "Priority Announcement")
+ var/input = input(usr, "Please write a message to announce to the station crew.", "Priority Announcement")
if(!input || !(usr in view(1,src)))
return
crew_announcement.Announce(input)
diff --git a/code/game/machinery/computer/crew.dm b/code/game/machinery/computer/crew.dm
index fdbaae21cc..b5394328b8 100644
--- a/code/game/machinery/computer/crew.dm
+++ b/code/game/machinery/computer/crew.dm
@@ -6,11 +6,10 @@
idle_power_usage = 250
active_power_usage = 500
circuit = "/obj/item/weapon/circuitboard/crew"
- var/list/tracked = list( )
-
+ var/obj/nano_module/crew_monitor/crew_monitor
/obj/machinery/computer/crew/New()
- tracked = list()
+ crew_monitor = new(src)
..()
@@ -25,6 +24,8 @@
return
ui_interact(user)
+/obj/machinery/computer/crew/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
+ crew_monitor.ui_interact(user, ui_key, ui, force_open)
/obj/machinery/computer/crew/update_icon()
@@ -38,90 +39,5 @@
icon_state = initial(icon_state)
stat &= ~NOPOWER
-
-/obj/machinery/computer/crew/Topic(href, href_list)
- if(..()) return
- if (src.z > 6)
- usr << "\red Unable to establish a connection: \black You're too far away from the station!"
- return 0
- if( href_list["close"] )
- var/mob/user = usr
- var/datum/nanoui/ui = nanomanager.get_open_ui(user, src, "main")
- usr.unset_machine()
- ui.close()
- return 0
- if(href_list["update"])
- src.updateDialog()
- return 1
-
/obj/machinery/computer/crew/interact(mob/user)
- ui_interact(user)
-
-/obj/machinery/computer/crew/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
- if(stat & (BROKEN|NOPOWER))
- return
- user.set_machine(src)
- src.scan()
-
- var/data[0]
- var/list/crewmembers = list()
-
- for(var/obj/item/clothing/under/C in src.tracked)
-
-
- var/turf/pos = get_turf(C)
-
- if((C) && (C.has_sensor) && (pos) && (pos.z == src.z) && C.sensor_mode)
- if(istype(C.loc, /mob/living/carbon/human))
-
- var/mob/living/carbon/human/H = C.loc
- if(H.w_uniform != C)
- continue
-
- var/list/crewmemberData = list()
-
- crewmemberData["sensor_type"] = C.sensor_mode
- crewmemberData["dead"] = H.stat > 1
- crewmemberData["oxy"] = round(H.getOxyLoss(), 1)
- crewmemberData["tox"] = round(H.getToxLoss(), 1)
- crewmemberData["fire"] = round(H.getFireLoss(), 1)
- crewmemberData["brute"] = round(H.getBruteLoss(), 1)
-
- crewmemberData["name"] = H.get_authentification_name(if_no_id="Unknown")
- crewmemberData["rank"] = H.get_authentification_rank(if_no_id="Unknown", if_no_job="No Job")
- crewmemberData["assignment"] = H.get_assignment(if_no_id="Unknown", if_no_job="No Job")
-
- var/area/A = get_area(H)
- crewmemberData["area"] = sanitize(A.name)
- crewmemberData["x"] = pos.x
- crewmemberData["y"] = pos.y
-
- crewmembers[++crewmembers.len] = crewmemberData
-
- crewmembers = sortByKey(crewmembers, "name")
-
- data["crewmembers"] = crewmembers
-
- ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if(!ui)
- ui = new(user, src, ui_key, "crew_monitor.tmpl", "Crew Monitoring Computer", 900, 800)
-
- // adding a template with the key "mapContent" enables the map ui functionality
- ui.add_template("mapContent", "crew_monitor_map_content.tmpl")
- // adding a template with the key "mapHeader" replaces the map header content
- ui.add_template("mapHeader", "crew_monitor_map_header.tmpl")
-
- ui.set_initial_data(data)
- ui.open()
-
- // should make the UI auto-update; doesn't seem to?
- ui.set_auto_update(1)
-
-
-/obj/machinery/computer/crew/proc/scan()
- for(var/mob/living/carbon/human/H in mob_list)
- if(istype(H.w_uniform, /obj/item/clothing/under))
- var/obj/item/clothing/under/C = H.w_uniform
- if (C.has_sensor)
- tracked |= C
- return 1
+ crew_monitor.ui_interact(user)
diff --git a/code/game/machinery/computer/hologram.dm b/code/game/machinery/computer/hologram.dm
deleted file mode 100644
index e0ceb33c17..0000000000
--- a/code/game/machinery/computer/hologram.dm
+++ /dev/null
@@ -1,109 +0,0 @@
-//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:31
-
-/obj/machinery/computer/hologram_comp
- name = "hologram computer"
- desc = "Rumoured to control holograms."
- icon = 'icons/obj/stationobjs.dmi'
- icon_state = "holo_console0"
- var/obj/machinery/hologram/projector/projector = null
- var/temp = null
- var/lumens = 0.0
- var/h_r = 245.0
- var/h_g = 245.0
- var/h_b = 245.0
-
-
-/obj/machinery/computer/hologram_comp/New()
- ..()
- spawn( 10 )
- src.projector = locate(/obj/machinery/hologram/projector, get_step(src.loc, NORTH))
- return
- return
-
-/obj/machinery/computer/hologram_comp/DblClick()
- if (!in_range(src, usr))
- return 0
- src.show_console(usr)
- return
-
-/obj/machinery/computer/hologram_comp/proc/render()
- var/icon/I = new /icon('icons/mob/human.dmi', "body_m_s")
-
- if (src.lumens >= 0)
- I.Blend(rgb(src.lumens, src.lumens, src.lumens), ICON_ADD)
- else
- I.Blend(rgb(- src.lumens, -src.lumens, -src.lumens), ICON_SUBTRACT)
-
- I.Blend(new /icon('icons/mob/human.dmi', "mouth_m_s"), ICON_OVERLAY)
- I.Blend(new /icon('icons/mob/human.dmi', "underwear1_m_s"), ICON_OVERLAY)
-
- var/icon/U = new /icon('icons/mob/human_face.dmi', "hair_a_s")
- U.Blend(rgb(src.h_r, src.h_g, src.h_b), ICON_ADD)
-
- I.Blend(U, ICON_OVERLAY)
-
- src.projector.hologram.icon = I
-
-/obj/machinery/computer/hologram_comp/proc/show_console(var/mob/user as mob)
- var/dat
- user.set_machine(src)
- if (src.temp)
- dat = text("[]
Clear", src.temp, src)
- else
- dat = text("Hologram Status:
\nPower: []
\nHologram Control:
\nColor Luminosity: []/220 \[Reset\]
\nLighten: 1 10
\nDarken: 1 10
\n
\nHair Color: ([],[],[]) \[Reset\]
\nRed (0-255): \[0\] -10 -1 [] 1 10 \[255\]
\nGreen (0-255): \[0\] -10 -1 [] 1 10 \[255\]
\nBlue (0-255): \[0\] -10 -1 [] 1 10 \[255\]
", src, (src.projector.hologram ? "On" : "Off"), -src.lumens + 35, src, src, src, src, src, src.h_r, src.h_g, src.h_b, src, src, src, src, src.h_r, src, src, src, src, src, src, src.h_g, src, src, src, src, src, src, src.h_b, src, src, src)
- user << browse(dat, "window=hologram_console")
- onclose(user, "hologram_console")
- return
-
-/obj/machinery/computer/hologram_comp/Topic(href, href_list)
- if(..())
- return
- if (in_range(src, usr))
- flick("holo_console1", src)
- if (href_list["power"])
- if (src.projector.hologram)
- src.projector.icon_state = "hologram0"
- //src.projector.hologram = null
- del(src.projector.hologram)
- else
- src.projector.hologram = new(src.projector.loc)
- src.projector.hologram.icon = 'icons/mob/human.dmi'
- src.projector.hologram.icon_state = "body_m_s"
- src.projector.icon_state = "hologram1"
- src.render()
- else
- if (href_list["h_r"])
- if (src.projector.hologram)
- src.h_r += text2num(href_list["h_r"])
- src.h_r = min(max(src.h_r, 0), 255)
- render()
- else
- if (href_list["h_g"])
- if (src.projector.hologram)
- src.h_g += text2num(href_list["h_g"])
- src.h_g = min(max(src.h_g, 0), 255)
- render()
- else
- if (href_list["h_b"])
- if (src.projector.hologram)
- src.h_b += text2num(href_list["h_b"])
- src.h_b = min(max(src.h_b, 0), 255)
- render()
- else
- if (href_list["light"])
- if (src.projector.hologram)
- src.lumens += text2num(href_list["light"])
- src.lumens = min(max(src.lumens, -185.0), 35)
- render()
- else
- if (href_list["reset"])
- if (src.projector.hologram)
- src.lumens = 0
- render()
- else
- if (href_list["temp"])
- src.temp = null
- for(var/mob/M in viewers(1, src))
- if ((M.client && M.machine == src))
- src.show_console(M)
- return
diff --git a/code/game/machinery/computer3/computers/camera.dm b/code/game/machinery/computer3/computers/camera.dm
index 9342d2731f..17f14e0cbf 100644
--- a/code/game/machinery/computer3/computers/camera.dm
+++ b/code/game/machinery/computer3/computers/camera.dm
@@ -123,6 +123,12 @@
desc = "Monitors the prison."
networks = list("Prison")
+/datum/file/camnet_key/syndicate
+ name = "Camera Network Key"
+ title = "%!#BUFFER OVERFLOW"
+ desc = "Connects to security cameras."
+ networks = list("SS13")
+ hidden_file = 1
/*
@@ -174,7 +180,7 @@
/datum/file/program/security
name = "camera monitor"
- desc = "Connets to the Nanotrasen Camera Network"
+ desc = "Connects to the Nanotrasen Camera Network"
image = 'icons/ntos/camera.png'
active_state = "camera-static"
@@ -268,15 +274,19 @@
reset_current()
usr.reset_view(null)
key = input(usr,"Select a camera network key:", "Key Select", null) as null|anything in computer.list_files(/datum/file/camnet_key)
- camera_list = null
- update_icon()
- computer.update_icon()
+ select_key(key)
if(key)
interact()
else
usr << "The screen turns to static."
return
+/datum/file/program/security/proc/select_key(var/selected_key)
+ key = selected_key
+ camera_list = null
+ update_icon()
+ computer.update_icon()
+
/datum/file/program/security/proc/set_current(var/obj/machinery/camera/C)
if(current == C)
return
@@ -300,3 +310,35 @@
// Atlantis: Required for camnetkeys to work.
/datum/file/program/security/hidden
hidden_file = 1
+
+/*
+ Camera monitoring program
+
+ Works much as the parent program, except:
+ * It requires a camera to be found using the proximity network card.
+ * It begins with all cam-access.
+*/
+
+/datum/file/program/security/syndicate
+ name = "camer# moni!%r"
+ desc = "Cons the Nanotrash Camera Network"
+ var/special_key = new/datum/file/camnet_key/syndicate
+ var/camera_conn = null
+
+ interact()
+ if(!interactable())
+ return
+
+ if(!computer.net)
+ computer.Crash(MISSING_PERIPHERAL)
+ return
+
+ camera_conn = computer.net.connect_to(/obj/machinery/camera,camera_conn)
+
+ if(!camera_conn)
+ computer.Crash(NETWORK_FAILURE)
+ return
+
+ // On interact, override camera key selection
+ select_key(special_key)
+ ..()
diff --git a/code/game/machinery/computer3/computers/communications.dm b/code/game/machinery/computer3/computers/communications.dm
index bb268ba0c0..527a2e2c5a 100644
--- a/code/game/machinery/computer3/computers/communications.dm
+++ b/code/game/machinery/computer3/computers/communications.dm
@@ -115,7 +115,7 @@
if(message_cooldown)
usr << "Please allow at least one minute to pass between announcements"
return
- var/input = stripped_input(usr, "Please write a message to announce to the station crew.", "Priority Announcement")
+ var/input = input(usr, "Please write a message to announce to the station crew.", "Priority Announcement")
if(!input || !interactable())
return
crew_announcement.Announce(input)
diff --git a/code/game/machinery/computer3/networking.dm b/code/game/machinery/computer3/networking.dm
index 4e39da0406..27d7789008 100644
--- a/code/game/machinery/computer3/networking.dm
+++ b/code/game/machinery/computer3/networking.dm
@@ -169,6 +169,9 @@
if(typekey == null)
typekey = /obj/machinery
var/list/machines = list()
+ for(var/obj/O in T)
+ if(istype(O,typekey))
+ machines += O
for(var/d in cardinal)
var/turf/T2 = get_step(T,d)
for(var/obj/O in T2)
diff --git a/code/game/machinery/computer3/program_disks.dm b/code/game/machinery/computer3/program_disks.dm
index 201fff3939..e9a649499b 100644
--- a/code/game/machinery/computer3/program_disks.dm
+++ b/code/game/machinery/computer3/program_disks.dm
@@ -28,6 +28,13 @@
icon_state = "datadisk_arcade"
spawn_files = list(/datum/file/program/security)
+/obj/item/weapon/disk/file/cameras/syndicate
+ name = "Camera Viewer"
+ desc = "A program install disk. A crude skull has been drawn on it and there is a list of items:\nFloppy Drive\nCamera Card\nNetwork Card: Adjacent\nPosition laptop nearby camera, enjoy."
+ icon = 'icons/obj/stock_parts.dmi'
+ icon_state = "datadisk_arcade"
+ spawn_files = list(/datum/file/program/security/syndicate)
+
/obj/item/weapon/disk/file/card
name = "ID Card Modifier"
desc = "A program install disk."
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index 62e89cf03d..a548739960 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -94,6 +94,10 @@
secured_wires = 1
assembly_type = /obj/structure/door_assembly/door_assembly_highsecurity //Until somebody makes better sprites.
+/obj/machinery/door/airlock/vault/bolted
+ icon_state = "door_locked"
+ locked = 1
+
/obj/machinery/door/airlock/freezer
name = "Freezer Airlock"
icon = 'icons/obj/doors/Doorfreezer.dmi'
@@ -330,7 +334,7 @@ About the new airlock wires panel:
return ((src.aiControlDisabled==1) && (!hackProof) && (!src.isAllPowerLoss()));
/obj/machinery/door/airlock/proc/arePowerSystemsOn()
- if (stat & NOPOWER)
+ if (stat & (NOPOWER|BROKEN))
return 0
return (src.secondsMainPowerLost==0 || src.secondsBackupPowerLost==0)
@@ -451,7 +455,7 @@ About the new airlock wires panel:
if(density)
flick("door_spark", src)
if("deny")
- if(density && !(stat & (BROKEN|NOPOWER)))
+ if(density && src.arePowerSystemsOn())
flick("door_deny", src)
return
@@ -900,12 +904,7 @@ About the new airlock wires panel:
var/obj/item/weapon/pai_cable/cable = C
cable.plugin(src, user)
else if(!repairing && istype(C, /obj/item/weapon/crowbar))
- var/beingcrowbarred = null
- if(istype(C, /obj/item/weapon/crowbar) )
- beingcrowbarred = 1 //derp, Agouri
- else
- beingcrowbarred = 0
- if( beingcrowbarred && src.p_open && (operating < 0 || (!operating && welded && !src.arePowerSystemsOn() && density && (!src.locked || (stat & BROKEN)))) )
+ if(src.p_open && (operating < 0 || (!operating && welded && !src.arePowerSystemsOn() && density && (!src.locked || (stat & BROKEN)))) )
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("[user] removes the electronics from the airlock assembly.", "You start to remove electronics from the airlock assembly.")
if(do_after(user,40))
@@ -936,7 +935,7 @@ About the new airlock wires panel:
del(src)
return
- else if(arePowerSystemsOn() && !(stat & BROKEN))
+ else if(arePowerSystemsOn())
user << "\blue The airlock's motors resist your efforts to force it."
else if(locked)
user << "\blue The airlock's bolts prevent it from being forced."
@@ -946,22 +945,22 @@ About the new airlock wires panel:
else
spawn(0) close(1)
- else if(istype(C, /obj/item/weapon/twohanded/fireaxe) && (!arePowerSystemsOn() || (stat & BROKEN)))
+ else if(istype(C, /obj/item/weapon/twohanded/fireaxe) && !arePowerSystemsOn())
if(locked)
user << "\blue The airlock's bolts prevent it from being forced."
else if( !welded && !operating )
if(density)
var/obj/item/weapon/twohanded/fireaxe/F = C
- if(F:wielded)
+ if(F.wielded)
spawn(0) open(1)
else
- user << "\red You need to be wielding the Fire axe to do that."
+ user << "\red You need to be wielding \the [C] to do that."
else
var/obj/item/weapon/twohanded/fireaxe/F = C
- if(F:wielded)
+ if(F.wielded)
spawn(0) close(1)
else
- user << "\red You need to be wielding the Fire axe to do that."
+ user << "\red You need to be wielding \the [C] to do that."
else
..()
@@ -1007,7 +1006,9 @@ About the new airlock wires panel:
if(operating || welded || locked)
return
if(!forced)
- if( !arePowerSystemsOn() || isWireCut(AIRLOCK_WIRE_DOOR_BOLTS) )
+ //despite the name, this wire is for general door control.
+ //Bolts are already covered by the check for locked, above
+ if( !arePowerSystemsOn() || isWireCut(AIRLOCK_WIRE_OPEN_DOOR) )
return
if(safe)
for(var/turf/turf in locs)
@@ -1131,9 +1132,6 @@ About the new airlock wires panel:
..()
update_icon()
-/obj/machinery/door/airlock/proc/hasPower()
- return ((src.secondsMainPowerLost==0 || src.secondsBackupPowerLost==0) && !(stat & (NOPOWER|BROKEN)))
-
/obj/machinery/door/airlock/proc/prison_open()
src.unlock()
src.open()
diff --git a/code/game/machinery/doors/airlock_control.dm b/code/game/machinery/doors/airlock_control.dm
index 7ad909c8eb..ad9d991036 100644
--- a/code/game/machinery/doors/airlock_control.dm
+++ b/code/game/machinery/doors/airlock_control.dm
@@ -8,11 +8,6 @@ obj/machinery/door/airlock
var/datum/radio_frequency/radio_connection
var/cur_command = null //the command the door is currently attempting to complete
-obj/machinery/door/airlock/proc/can_radio()
- if(!arePowerSystemsOn())
- return 0
- return 1
-
obj/machinery/door/airlock/process()
..()
if (arePowerSystemsOn())
@@ -21,8 +16,6 @@ obj/machinery/door/airlock/process()
obj/machinery/door/airlock/receive_signal(datum/signal/signal)
if (!arePowerSystemsOn()) return //no power
- if (!can_radio()) return //no radio
-
if(!signal || signal.encryption) return
if(id_tag != signal.data["tag"] || !signal.data["command"]) return
diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm
index 2d5b9394d0..71894c2983 100644
--- a/code/game/machinery/hologram.dm
+++ b/code/game/machinery/hologram.dm
@@ -24,10 +24,12 @@ Possible to do for anyone motivated enough:
* Holopad
*/
-// HOLOPAD MODE
-// 0 = RANGE BASED
-// 1 = AREA BASED
-var/const/HOLOPAD_MODE = 0
+#define HOLOPAD_PASSIVE_POWER_USAGE 1
+#define HOLOGRAM_POWER_USAGE 2
+#define RANGE_BASED 4
+#define AREA_BASED 6
+
+var/const/HOLOPAD_MODE = RANGE_BASED
/obj/machinery/hologram/holopad
name = "\improper AI holopad"
@@ -36,7 +38,7 @@ var/const/HOLOPAD_MODE = 0
layer = TURF_LAYER+0.1 //Preventing mice and drones from sneaking under them.
- var/mob/living/silicon/ai/master//Which AI, if any, is controlling the object? Only one AI may control a hologram at any time.
+ var/list/mob/living/silicon/ai/masters = new() //List of AIs that use the holopad
var/last_request = 0 //to prevent request spam. ~Carn
var/holo_range = 5 // Change to change how far the AI can move away from the holopad before deactivating.
@@ -62,52 +64,53 @@ var/const/HOLOPAD_MODE = 0
This may change in the future but for now will suffice.*/
if(user.eyeobj.loc != src.loc)//Set client eye on the object if it's not already.
user.eyeobj.setLoc(get_turf(src))
- else if(!hologram)//If there is no hologram, possibly make one.
+ else if(!masters[user])//If there is no hologram, possibly make one.
activate_holo(user)
- else if(master==user)//If there is a hologram, remove it. But only if the user is the master. Otherwise do nothing.
- clear_holo()
+ else//If there is a hologram, remove it.
+ clear_holo(user)
return
/obj/machinery/hologram/holopad/proc/activate_holo(mob/living/silicon/ai/user)
- if(!(stat & NOPOWER) && user.eyeobj.loc == src.loc)//If the projector has power and client eye is on it.
- if(!hologram)//If there is not already a hologram.
- create_holo(user)//Create one.
- src.visible_message("A holographic image of [user] flicks to life right before your eyes!")
- else
- user << "\red ERROR: \black Image feed in progress."
+ if(!(stat & NOPOWER) && user.eyeobj.loc == src.loc)//If the projector has power and client eye is on it
+ if (user.holo)
+ user << "ERROR: Image feed in progress."
+ return
+ create_holo(user)//Create one.
+ src.visible_message("A holographic image of [user] flicks to life right before your eyes!")
else
- user << "\red ERROR: \black Unable to project hologram."
+ user << "ERROR: Unable to project hologram."
return
/*This is the proc for special two-way communication between AI and holopad/people talking near holopad.
For the other part of the code, check silicon say.dm. Particularly robot talk.*/
/obj/machinery/hologram/holopad/hear_talk(mob/living/M, text, verb, datum/language/speaking)
- if(M&&hologram&&master)//Master is mostly a safety in case lag hits or something.
- if(!master.say_understands(M, speaking))//The AI will be able to understand most mobs talking through the holopad.
+ if(M)
+ for(var/mob/living/silicon/ai/master in masters)
+ if(!master.say_understands(M, speaking))//The AI will be able to understand most mobs talking through the holopad.
+ if(speaking)
+ text = speaking.scramble(text)
+ else
+ text = stars(text)
+ var/name_used = M.GetVoice()
+ //This communication is imperfect because the holopad "filters" voices and is only designed to connect to the master only.
+ var/rendered
if(speaking)
- text = speaking.scramble(text)
+ rendered = "Holopad received, [name_used] [speaking.format_message(text, verb)]"
else
- text = stars(text)
- var/name_used = M.GetVoice()
- //This communication is imperfect because the holopad "filters" voices and is only designed to connect to the master only.
- var/rendered
- if(speaking)
- rendered = "Holopad received, [name_used] [speaking.format_message(text, verb)]"
- else
- rendered = "Holopad received, [name_used] [verb], \"[text]\""
- master.show_message(rendered, 2)
- return
+ rendered = "Holopad received, [name_used] [verb], \"[text]\""
+ master.show_message(rendered, 2)
/obj/machinery/hologram/holopad/see_emote(mob/living/M, text)
- if(M && hologram && master)
- //var/name_used = M.GetVoice()
- var/rendered = "Holopad received, [text]"
- //The lack of name_used is needed, because message already contains a name. This is needed for simple mobs to emote properly.
- master.show_message(rendered, 2)
+ if(M)
+ for(var/mob/living/silicon/ai/master in masters)
+ //var/name_used = M.GetVoice()
+ var/rendered = "Holopad received, [text]"
+ //The lack of name_used is needed, because message already contains a name. This is needed for simple mobs to emote properly.
+ master.show_message(rendered, 2)
return
/obj/machinery/hologram/holopad/proc/create_holo(mob/living/silicon/ai/A, turf/T = loc)
- hologram = new(T)//Spawn a blank effect at the location.
+ var/obj/effect/overlay/hologram = new(T)//Spawn a blank effect at the location.
hologram.icon = A.holo_icon
hologram.mouse_opacity = 0//So you can't click on it.
hologram.layer = FLY_LAYER//Above all the other objects/mobs. Or the vast majority of them.
@@ -115,32 +118,33 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
hologram.name = "[A.name] (Hologram)"//If someone decides to right click.
hologram.SetLuminosity(2) //hologram lighting
hologram.color = color //painted holopad gives coloured holograms
+ masters[A] = hologram
SetLuminosity(2) //pad lighting
icon_state = "holopad1"
A.holo = src
- master = A//AI is the master.
- use_power = 2//Active power usage.
+ use_power += HOLOGRAM_POWER_USAGE
return 1
-/obj/machinery/hologram/holopad/proc/clear_holo()
-// hologram.SetLuminosity(0)//Clear lighting. //handled by the lighting controller when its ower is deleted
- del(hologram)//Get rid of hologram.
- if(master.holo == src)
- master.holo = null
- master = null//Null the master, since no-one is using it now.
- SetLuminosity(0) //pad lighting (hologram lighting will be handled automatically since its owner was deleted)
- icon_state = "holopad0"
- use_power = 1//Passive power usage.
+/obj/machinery/hologram/holopad/proc/clear_holo(mob/living/silicon/ai/user)
+ if(user.holo == src)
+ user.holo = null
+ del(masters[user])//Get rid of user's hologram //qdel
+ masters -= user //Discard AI from the list of those who use holopad
+ use_power = max(HOLOPAD_PASSIVE_POWER_USAGE, use_power - HOLOGRAM_POWER_USAGE)//Reduce power usage
+ if (!masters.len)//If no users left
+ SetLuminosity(0) //pad lighting (hologram lighting will be handled automatically since its owner was deleted)
+ icon_state = "holopad0"
+ use_power = HOLOPAD_PASSIVE_POWER_USAGE
return 1
/obj/machinery/hologram/holopad/process()
- if(hologram)//If there is a hologram.
+ for (var/mob/living/silicon/ai/master in masters)
if(master && !master.stat && master.client && master.eyeobj)//If there is an AI attached, it's not incapacitated, it has a client, and the client eye is centered on the projector.
if(!(stat & NOPOWER))//If the machine has power.
- if((HOLOPAD_MODE == 0 && (get_dist(master.eyeobj, src) <= holo_range)))
+ if((HOLOPAD_MODE == RANGE_BASED && (get_dist(master.eyeobj, src) <= holo_range)))
return 1
- else if (HOLOPAD_MODE == 1)
+ else if (HOLOPAD_MODE == AREA_BASED)
var/area/holo_area = get_area(src)
var/area/eye_area = get_area(master.eyeobj)
@@ -148,14 +152,15 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
if(eye_area in holo_area.master.related)
return 1
- clear_holo()//If not, we want to get rid of the hologram.
+ clear_holo(master)//If not, we want to get rid of the hologram.
return 1
-/obj/machinery/hologram/holopad/proc/move_hologram()
- if(hologram)
- step_to(hologram, master.eyeobj) // So it turns.
- hologram.loc = get_turf(master.eyeobj)
-
+/obj/machinery/hologram/holopad/proc/move_hologram(mob/living/silicon/ai/user)
+ if(masters[user])
+ step_to(masters[user], user.eyeobj) // So it turns.
+ var/obj/effect/overlay/H = masters[user]
+ H.loc = get_turf(user.eyeobj)
+ masters[user] = H
return 1
/*
@@ -167,7 +172,6 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
use_power = 1
idle_power_usage = 5
active_power_usage = 100
- var/obj/effect/overlay/hologram//The projection itself. If there is one, the instrument is on, off otherwise.
//Destruction procs.
/obj/machinery/hologram/ex_act(severity)
@@ -190,9 +194,9 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
del(src)
return
-/obj/machinery/hologram/Del()
- if(hologram)
- src:clear_holo()
+/obj/machinery/hologram/holopad/Del()
+ for (var/mob/living/silicon/ai/master in masters)
+ clear_holo(master)
..()
/*
@@ -224,3 +228,9 @@ Holographic project of everything else.
desc = "It makes a hologram appear...with magnets or something..."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "hologram0"
+
+
+#undef RANGE_BASED
+#undef AREA_BASED
+#undef HOLOPAD_PASSIVE_POWER_USAGE
+#undef HOLOGRAM_POWER_USAGE
diff --git a/code/game/machinery/jukebox.dm b/code/game/machinery/jukebox.dm
index 4301d34495..2a6755015b 100644
--- a/code/game/machinery/jukebox.dm
+++ b/code/game/machinery/jukebox.dm
@@ -70,7 +70,7 @@ datum/track/New(var/title_name, var/audio)
return
if(stat & (NOPOWER|BROKEN))
- usr << "\the [src] doesn't appear to function."
+ usr << "\The [src] doesn't appear to function."
return
if(href_list["change_track"])
@@ -109,7 +109,7 @@ datum/track/New(var/title_name, var/audio)
/obj/machinery/media/jukebox/interact(mob/user)
if(stat & (NOPOWER|BROKEN))
- usr << "\the [src] doesn't appear to function."
+ usr << "\The [src] doesn't appear to function."
return
ui_interact(user)
diff --git a/code/game/machinery/portable_tag_turret.dm b/code/game/machinery/portable_tag_turret.dm
index 13f7032aa3..c9c2331e6d 100644
--- a/code/game/machinery/portable_tag_turret.dm
+++ b/code/game/machinery/portable_tag_turret.dm
@@ -5,13 +5,13 @@
/obj/machinery/porta_turret/tag
// Reasonable defaults, in case someone manually spawns us
var/lasercolor = "r" //Something to do with lasertag turrets, blame Sieve for not adding a comment.
- installation = /obj/item/weapon/gun/energy/laser/redtag
+ installation = /obj/item/weapon/gun/energy/lasertag/red
/obj/machinery/porta_turret/tag/red
/obj/machinery/porta_turret/tag/blue
lasercolor = "b"
- installation = /obj/item/weapon/gun/energy/laser/bluetag
+ installation = /obj/item/weapon/gun/energy/lasertag/blue
/obj/machinery/porta_turret/tag/New()
..()
@@ -19,8 +19,8 @@
/obj/machinery/porta_turret/tag/weapon_setup(var/obj/item/weapon/gun/energy/E)
switch(E.type)
- if(/obj/item/weapon/gun/energy/laser/bluetag)
- eprojectile = /obj/item/weapon/gun/energy/laser/bluetag
+ if(/obj/item/weapon/gun/energy/lasertag/blue)
+ eprojectile = /obj/item/weapon/gun/energy/lasertag/blue
lasercolor = "b"
req_access = list(access_maint_tunnels, access_theatre)
check_arrest = 0
@@ -30,8 +30,8 @@
check_anomalies = 0
shot_delay = 30
- if(/obj/item/weapon/gun/energy/laser/redtag)
- eprojectile = /obj/item/weapon/gun/energy/laser/redtag
+ if(/obj/item/weapon/gun/energy/lasertag/red)
+ eprojectile = /obj/item/weapon/gun/energy/lasertag/red
lasercolor = "r"
req_access = list(access_maint_tunnels, access_theatre)
check_arrest = 0
@@ -86,13 +86,13 @@
..()
if(lasercolor == "b" && disabled == 0)
- if(istype(Proj, /obj/item/weapon/gun/energy/laser/redtag))
+ if(istype(Proj, /obj/item/weapon/gun/energy/lasertag/red))
disabled = 1
del(Proj) // qdel
sleep(100)
disabled = 0
if(lasercolor == "r" && disabled == 0)
- if(istype(Proj, /obj/item/weapon/gun/energy/laser/bluetag))
+ if(istype(Proj, /obj/item/weapon/gun/energy/lasertag/blue))
disabled = 1
del(Proj) // qdel
sleep(100)
@@ -110,10 +110,10 @@
switch(lasercolor)
if("b")
target_suit = /obj/item/clothing/suit/redtag
- target_weapon = /obj/item/weapon/gun/energy/laser/redtag
+ target_weapon = /obj/item/weapon/gun/energy/lasertag/red
if("r")
target_suit = /obj/item/clothing/suit/bluetag
- target_weapon = /obj/item/weapon/gun/energy/laser/bluetag
+ target_weapon = /obj/item/weapon/gun/energy/lasertag/blue
if(target_suit)//Lasertag turrets target the opposing team, how great is that? -Sieve
diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm
index c531e53f96..a2dda1e400 100644
--- a/code/game/machinery/portable_turret.dm
+++ b/code/game/machinery/portable_turret.dm
@@ -733,7 +733,7 @@
gun_charge = E.power_supply.charge //the gun's charge is stored in gun_charge
user << "You add [I] to the turret."
- if(istype(installation, /obj/item/weapon/gun/energy/laser/bluetag) || istype(installation, /obj/item/weapon/gun/energy/laser/redtag))
+ if(istype(installation, /obj/item/weapon/gun/energy/lasertag/blue) || istype(installation, /obj/item/weapon/gun/energy/lasertag/red))
target_type = /obj/machinery/porta_turret/tag
else
target_type = /obj/machinery/porta_turret
diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm
index 7d7ee3113d..f88b7895ae 100644
--- a/code/game/machinery/vending.dm
+++ b/code/game/machinery/vending.dm
@@ -1,17 +1,38 @@
-#define CAT_NORMAL 0
-#define CAT_HIDDEN 1
-#define CAT_COIN 2
+#define CAT_NORMAL 1
+#define CAT_HIDDEN 2 // also used in corresponding wires/vending.dm
+#define CAT_COIN 4
+/**
+ * Datum used to hold information about a product in a vending machine
+ */
/datum/data/vending_product
- var/product_name = "generic"
+ var/product_name = "generic" // Display name for the product
var/product_path = null
- var/amount = 0
- var/price = 0
- var/display_color = "blue"
- var/category = CAT_NORMAL
-
+ var/amount = 0 // Amount held in the vending machine
+ var/price = 0 // Price to buy one
+ var/display_color = null // Display color for vending machine listing
+ var/category = CAT_NORMAL // CAT_HIDDEN for contraband, CAT_COIN for premium
+/datum/data/vending_product/New(var/path, var/name = null, var/amount = 1, var/price = 0, var/color = null, var/category = CAT_NORMAL)
+ ..()
+
+ src.product_path = path
+
+ if(!name)
+ var/atom/tmp = new path
+ src.product_name = initial(tmp.name)
+ del(tmp)
+ else
+ src.product_name = name
+
+ src.amount = amount
+ src.price = price
+ src.display_color = color
+ src.category = category
+/**
+ * A vending machine
+ */
/obj/machinery/vending
name = "Vendomat"
desc = "A generic vending machine."
@@ -21,68 +42,107 @@
anchored = 1
density = 1
+ var/icon_vend //Icon_state when vending
+ var/icon_deny //Icon_state when denying access
+
+ // Power
use_power = 1
idle_power_usage = 10
var/vend_power_usage = 150 //actuators and stuff
+ // Vending-related
var/active = 1 //No sales pitches if off!
var/vend_ready = 1 //Are we ready to vend?? Is it time??
var/vend_delay = 10 //How long does it take to vend?
- var/datum/data/vending_product/currently_vending = null // A /datum/data/vending_product instance of what we're paying for right now.
-
- // To be filled out at compile time
+ var/categories = CAT_NORMAL // Bitmask of cats we're currently showing
+ var/datum/data/vending_product/currently_vending = null // What we're requesting payment for right now
+ var/status_message = "" // Status screen messages like "insufficient funds", displayed in NanoUI
+ var/status_error = 0 // Set to 1 if status_message is an error
+
+ /*
+ Variables used to initialize the product list
+ These are used for initialization only, and so are optional if
+ product_records is specified
+ */
var/list/products = list() // For each, use the following pattern:
var/list/contraband = list() // list(/type/path = amount,/type/path2 = amount2)
var/list/premium = list() // No specified amount = only one in stock
var/list/prices = list() // Prices for each item, list(/type/path = price), items not in the list don't have a price.
- var/product_slogans = "" //String of slogans separated by semicolons, optional
- var/product_ads = "" //String of small ad messages in the vending screen - random chance
+ // List of vending_product items available.
var/list/product_records = list()
- var/list/hidden_records = list()
- var/list/coin_records = list()
+
+
+ // Variables used to initialize advertising
+ var/product_slogans = "" //String of slogans spoken out loud, separated by semicolons
+ var/product_ads = "" //String of small ad messages in the vending screen
+
+ var/list/ads_list = list()
+
+ // Stuff relating vocalizations
var/list/slogan_list = list()
- var/list/small_ads = list() // small ad messages in the vending screen - random chance of popping up whenever you open it
+ var/shut_up = 1 //Stop spouting those godawful pitches!
var/vend_reply //Thank you for shopping!
var/last_reply = 0
var/last_slogan = 0 //When did we last pitch?
var/slogan_delay = 6000 //How long until we can pitch again?
- var/icon_vend //Icon_state when vending!
- var/icon_deny //Icon_state when vending!
- //var/emagged = 0 //Ignores if somebody doesn't have card access to that machine.
+
+ // Things that can go wrong
+ emagged = 0 //Ignores if somebody doesn't have card access to that machine.
var/seconds_electrified = 0 //Shock customers like an airlock.
var/shoot_inventory = 0 //Fire items at customers! We're broken!
- var/shut_up = 1 //Stop spouting those godawful pitches!
- var/extended_inventory = 0 //can we access the hidden inventory?
+
var/scan_id = 1
var/obj/item/weapon/coin/coin
var/datum/wires/vending/wires = null
- var/check_accounts = 0 // 1 = requires PIN and checks accounts. 0 = You slide an ID, it vends, SPACE COMMUNISM!
- var/obj/item/weapon/spacecash/ewallet/ewallet
-
-
/obj/machinery/vending/New()
..()
wires = new(src)
spawn(4)
- src.slogan_list = text2list(src.product_slogans, ";")
+ if(src.product_slogans)
+ src.slogan_list += text2list(src.product_slogans, ";")
- // So not all machines speak at the exact same time.
- // The first time this machine says something will be at slogantime + this random value,
- // so if slogantime is 10 minutes, it will say it at somewhere between 10 and 20 minutes after the machine is crated.
- src.last_slogan = world.time + rand(0, slogan_delay)
+ // So not all machines speak at the exact same time.
+ // The first time this machine says something will be at slogantime + this random value,
+ // so if slogantime is 10 minutes, it will say it at somewhere between 10 and 20 minutes after the machine is crated.
+ src.last_slogan = world.time + rand(0, slogan_delay)
- src.build_inventory(products)
- //Add hidden inventory
- src.build_inventory(contraband, 1)
- src.build_inventory(premium, 0, 1)
+ if(src.product_ads)
+ src.ads_list += text2list(src.product_ads, ";")
+
+ src.build_inventory()
power_change()
return
return
+/**
+ * Build src.produdct_records from the products lists
+ *
+ * src.products, src.contraband, src.premium, and src.prices allow specifying
+ * products that the vending machine is to carry without manually populating
+ * src.product_records.
+ */
+/obj/machinery/vending/proc/build_inventory()
+ var/list/all_products = list(
+ list(src.products, CAT_NORMAL),
+ list(src.contraband, CAT_HIDDEN),
+ list(src.premium, CAT_COIN))
+
+ for(var/current_list in all_products)
+ var/category = current_list[2]
+
+ for(var/entry in current_list[1])
+ var/datum/data/vending_product/product = new/datum/data/vending_product(entry)
+
+ product.price = (entry in src.prices) ? src.prices[entry] : 0
+ product.amount = (current_list[1][entry]) ? current_list[1][entry] : 1
+ product.category = category
+
+ src.product_records.Add(product)
+
/obj/machinery/vending/Del()
del(wires) // qdel
wires = null
@@ -118,37 +178,30 @@
return
-/obj/machinery/vending/proc/build_inventory(var/list/productlist,hidden=0,req_coin=0)
-
- for(var/typepath in productlist)
- var/amount = productlist[typepath]
- var/price = prices[typepath]
- if(isnull(amount)) amount = 1
-
- var/datum/data/vending_product/R = new /datum/data/vending_product()
-
- R.product_path = typepath
- R.amount = amount
- R.price = price
- R.display_color = pick("red","blue","green")
-
- if(hidden)
- R.category=CAT_HIDDEN
- hidden_records += R
- else if(req_coin)
- R.category=CAT_COIN
- coin_records += R
- else
- R.category=CAT_NORMAL
- product_records += R
-
- var/atom/temp = typepath
- R.product_name = initial(temp.name)
-
-// world << "Added: [R.product_name]] - [R.amount] - [R.product_path]"
- return
-
/obj/machinery/vending/attackby(obj/item/weapon/W as obj, mob/user as mob)
+ if (currently_vending && vendor_account && !vendor_account.suspended)
+ var/paid = 0
+ var/handled = 0
+ if(istype(W, /obj/item/weapon/card/id))
+ var/obj/item/weapon/card/id/C = W
+ paid = pay_with_card(C)
+ handled = 1
+ else if (istype(W, /obj/item/weapon/spacecash/ewallet))
+ var/obj/item/weapon/spacecash/ewallet/C = W
+ paid = pay_with_ewallet(C)
+ handled = 1
+ else if (istype(W, /obj/item/weapon/spacecash))
+ var/obj/item/weapon/spacecash/C = W
+ paid = pay_with_cash(C, user)
+ handled = 1
+
+ if(paid)
+ src.vend(currently_vending, usr)
+ return
+ else if(handled)
+ nanomanager.update_uis(src)
+ return // don't smack that machine with your 2 thalers
+
if (istype(W, /obj/item/weapon/card/emag))
src.emagged = 1
user << "You short out the product lock on [src]"
@@ -159,7 +212,8 @@
src.overlays.Cut()
if(src.panel_open)
src.overlays += image(src.icon, "[initial(icon_state)]-panel")
- src.updateUsrDialog()
+
+ nanomanager.update_uis(src) // Speaker switch is on the main UI, not wires UI
return
else if(istype(W, /obj/item/device/multitool)||istype(W, /obj/item/weapon/wirecutters))
if(src.panel_open)
@@ -169,19 +223,11 @@
user.drop_item()
W.loc = src
coin = W
+ categories |= CAT_COIN
user << "\blue You insert the [W] into the [src]"
+ nanomanager.update_uis(src)
return
- else if(istype(W, /obj/item/weapon/card) && currently_vending)
- var/obj/item/weapon/card/I = W
- scan_card(I)
- else if (istype(W, /obj/item/weapon/spacecash/ewallet))
- user.drop_item()
- W.loc = src
- ewallet = W
- user << "\blue You insert the [W] into the [src]"
-
else if(istype(W, /obj/item/weapon/wrench))
-
if(do_after(user, 20))
if(!src) return
playsound(src.loc, 'sound/items/Ratchet.ogg', 100, 1)
@@ -204,162 +250,205 @@
else
..()
-/obj/machinery/vending/proc/scan_card(var/obj/item/weapon/card/I)
- if(!currently_vending) return
- if (istype(I, /obj/item/weapon/card/id))
- var/obj/item/weapon/card/id/C = I
- visible_message("[usr] swipes a card through [src].")
- var/datum/money_account/CH = get_account(C.associated_account_number)
- if (CH) // Only proceed if card contains proper account number.
- if(!CH.suspended)
- if(CH.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2)
- if(vendor_account)
- var/attempt_pin = input("Enter pin code", "Vendor transaction") as num
- var/datum/money_account/D = attempt_account_access(C.associated_account_number, attempt_pin, 2)
- transfer_and_vend(D)
- else
- usr << "\icon[src]Unable to access account. Check security settings and try again."
- else
- //Just Vend it.
- transfer_and_vend(CH)
- else
- usr << "\icon[src]Connected account has been suspended."
+/**
+ * Receive payment with cashmoney.
+ *
+ * usr is the mob who gets the change.
+ */
+/obj/machinery/vending/proc/pay_with_cash(var/obj/item/weapon/spacecash/cashmoney, mob/user)
+ if(currently_vending.price > cashmoney.worth)
+
+ // This is not a status display message, since it's something the character
+ // themselves is meant to see BEFORE putting the money in
+ usr << "\icon[cashmoney] That is not enough money."
+ return 0
+
+ if(istype(cashmoney, /obj/item/weapon/spacecash/bundle))
+ // Bundles can just have money subtracted, and will work
+
+ visible_message("[usr] inserts some cash into [src].")
+ var/obj/item/weapon/spacecash/bundle/cashmoney_bundle = cashmoney
+ cashmoney_bundle.worth -= currently_vending.price
+
+ if(cashmoney_bundle.worth <= 0)
+ usr.drop_from_inventory(cashmoney_bundle)
+ del(cashmoney_bundle)
else
- usr << "\icon[src]Error: Unable to access your account. Please contact technical support if problem persists."
-
-/obj/machinery/vending/proc/transfer_and_vend(var/datum/money_account/acc)
- if(acc)
- var/transaction_amount = currently_vending.price
- if(transaction_amount <= acc.money)
-
- //transfer the money
- acc.money -= transaction_amount
- vendor_account.money += transaction_amount
-
- //create entries in the two account transaction logs
- var/datum/transaction/T = new()
- T.target_name = "[vendor_account.owner_name] (via [src.name])"
- T.purpose = "Purchase of [currently_vending.product_name]"
- if(transaction_amount > 0)
- T.amount = "([transaction_amount])"
- else
- T.amount = "[transaction_amount]"
- T.source_terminal = src.name
- T.date = current_date_string
- T.time = worldtime2text()
- acc.transaction_log.Add(T)
- //
- T = new()
- T.target_name = acc.owner_name
- T.purpose = "Purchase of [currently_vending.product_name]"
- T.amount = "[transaction_amount]"
- T.source_terminal = src.name
- T.date = current_date_string
- T.time = worldtime2text()
- vendor_account.transaction_log.Add(T)
-
- // Vend the item
- src.vend(src.currently_vending, usr)
- currently_vending = null
- else
- usr << "\icon[src]You don't have that much money!"
+ cashmoney_bundle.update_icon()
else
- usr << "\icon[src]Error: Unable to access your account. Please contact technical support if problem persists."
+ // Bills (banknotes) cannot really have worth different than face value,
+ // so we have to eat the bill and spit out change in a bundle
+ // This is really dirty, but there's no superclass for all bills, so we
+ // just assume that all spacecash that's not something else is a bill
+
+ visible_message("[usr] inserts a bill into [src].")
+ var/left = cashmoney.worth - currently_vending.price
+ usr.drop_from_inventory(cashmoney)
+ del(cashmoney)
+
+ if(left)
+ spawn_money(left, src.loc, user)
+
+ // Vending machines have no idea who paid with cash
+ credit_purchase("(cash)")
+ return 1
+
+/**
+ * Scan a chargecard and deduct payment from it.
+ *
+ * Takes payment for whatever is the currently_vending item. Returns 1 if
+ * successful, 0 if failed.
+ */
+/obj/machinery/vending/proc/pay_with_ewallet(var/obj/item/weapon/spacecash/ewallet/wallet)
+ visible_message("[usr] swipes a card through [src].")
+ if(currently_vending.price > wallet.worth)
+ src.status_message = "Insufficient funds on chargecard."
+ src.status_error = 1
+ return 0
+ else
+ wallet.worth -= currently_vending.price
+ credit_purchase("[wallet.owner_name] (chargecard)")
+ return 1
+
+/**
+ * Scan a card and attempt to transfer payment from associated account.
+ *
+ * Takes payment for whatever is the currently_vending item. Returns 1 if
+ * successful, 0 if failed
+ */
+/obj/machinery/vending/proc/pay_with_card(var/obj/item/weapon/card/id/I)
+ visible_message("[usr] swipes a card through [src].")
+ var/datum/money_account/customer_account = get_account(I.associated_account_number)
+ if (!customer_account)
+ src.status_message = "Error: Unable to access account. Please contact technical support if problem persists."
+ src.status_error = 1
+ return 0
+
+ if(customer_account.suspended)
+ src.status_message = "Unable to access account: account suspended."
+ src.status_error = 1
+ return 0
+
+ // Have the customer punch in the PIN before checking if there's enough money. Prevents people from figuring out acct is
+ // empty at high security levels
+ if(customer_account.security_level != 0) //If card requires pin authentication (ie seclevel 1 or 2)
+ var/attempt_pin = input("Enter pin code", "Vendor transaction") as num
+ customer_account = attempt_account_access(I.associated_account_number, attempt_pin, 2)
+
+ if(!customer_account)
+ src.status_message = "Unable to access account: incorrect credentials."
+ src.status_error = 1
+ return 0
+
+ if(currently_vending.price > customer_account.money)
+ src.status_message = "Insufficient funds in account."
+ src.status_error = 1
+ return 0
+ else
+ // Okay to move the money at this point
+
+ // debit money from the purchaser's account
+ customer_account.money -= currently_vending.price
+
+ // create entry in the purchaser's account log
+ var/datum/transaction/T = new()
+ T.target_name = "[vendor_account.owner_name] (via [src.name])"
+ T.purpose = "Purchase of [currently_vending.product_name]"
+ if(currently_vending.price > 0)
+ T.amount = "([currently_vending.price])"
+ else
+ T.amount = "[currently_vending.price]"
+ T.source_terminal = src.name
+ T.date = current_date_string
+ T.time = worldtime2text()
+ customer_account.transaction_log.Add(T)
+
+ // Give the vendor the money. We use the account owner name, which means
+ // that purchases made with stolen/borrowed card will look like the card
+ // owner made them
+ credit_purchase(customer_account.owner_name)
+ return 1
+
+/**
+ * Add money for current purchase to the vendor account.
+ *
+ * Called after the money has already been taken from the customer.
+ */
+/obj/machinery/vending/proc/credit_purchase(var/target as text)
+ vendor_account.money += currently_vending.price
+
+ var/datum/transaction/T = new()
+ T.target_name = target
+ T.purpose = "Purchase of [currently_vending.product_name]"
+ T.amount = "[currently_vending.price]"
+ T.source_terminal = src.name
+ T.date = current_date_string
+ T.time = worldtime2text()
+ vendor_account.transaction_log.Add(T)
/obj/machinery/vending/attack_ai(mob/user as mob)
return attack_hand(user)
-/obj/machinery/vending/proc/GetProductIndex(var/datum/data/vending_product/P)
- var/list/plist
- switch(P.category)
- if(CAT_NORMAL)
- plist=product_records
- if(CAT_HIDDEN)
- plist=hidden_records
- if(CAT_COIN)
- plist=coin_records
- else
- warning("UNKNOWN CATEGORY [P.category] IN TYPE [P.product_path] INSIDE [type]!")
- return plist.Find(P)
-
-/obj/machinery/vending/proc/GetProductByID(var/pid, var/category)
- switch(category)
- if(CAT_NORMAL)
- return product_records[pid]
- if(CAT_HIDDEN)
- return hidden_records[pid]
- if(CAT_COIN)
- return coin_records[pid]
- else
- warning("UNKNOWN PRODUCT: PID: [pid], CAT: [category] INSIDE [type]!")
- return null
-
/obj/machinery/vending/attack_hand(mob/user as mob)
if(stat & (BROKEN|NOPOWER))
return
- user.set_machine(src)
if(src.seconds_electrified != 0)
if(src.shock(user, 100))
return
- var/vendorname = (src.name) //import the machine's name
+ wires.Interact(user)
+ ui_interact(user)
- if(src.currently_vending)
- var/dat = "[vendorname]
" //display the name, and added a horizontal rule
- dat += "You have selected [currently_vending.product_name].
Please swipe your ID to pay for the article.
"
- dat += "Cancel"
- user << browse(dat, "window=vending")
- onclose(user, "")
- return
-
- var/dat = "[vendorname]
" //display the name, and added a horizontal rule
- dat += "Select an item:
" //the rest is just general spacing and bolding
-
- if (premium.len > 0)
- dat += "Coin slot: [coin ? coin : "No coin inserted"] (Remove)
"
-
- if (ewallet)
- dat += "Charge card's credits: [ewallet ? ewallet.worth : "No charge card inserted"] (Remove)
"
-
- if (src.product_records.len == 0)
- dat += "No product loaded!"
+/**
+ * Display the NanoUI window for the vending machine.
+ *
+ * See NanoUI documentation for details.
+ */
+/obj/machinery/vending/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
+ user.set_machine(src)
+
+ var/list/data = list()
+ if(currently_vending)
+ data["mode"] = 1
+ data["product"] = currently_vending.product_name
+ data["price"] = currently_vending.price
+ data["message_err"] = 0
+ data["message"] = src.status_message
+ data["message_err"] = src.status_error
else
- var/list/display_records = list()
- display_records += src.product_records
+ data["mode"] = 0
+ var/list/listed_products = list()
- if(src.extended_inventory)
- display_records += src.hidden_records
- if(src.coin)
- display_records += src.coin_records
-
- for (var/datum/data/vending_product/R in display_records)
- dat += "[R.product_name]:"
- dat += " [R.amount] "
- if(R.price)
- dat += " (Price: [R.price])"
- if (R.amount > 0)
- var/idx=GetProductIndex(R)
- dat += " (Vend)"
- else
- dat += " SOLD OUT"
- dat += "
"
-
- dat += ""
-
- if(panel_open)
- dat += wires()
-
- if(product_slogans != "")
- dat += "The speaker switch is [shut_up ? "off" : "on"]. Toggle"
-
- user << browse(dat, "window=vending")
- onclose(user, "")
- return
-
-// returns the wire panel text
-/obj/machinery/vending/proc/wires()
- return wires.GetInteractWindow()
+ for(var/key = 1 to src.product_records.len)
+ var/datum/data/vending_product/I = src.product_records[key]
+
+ if(!(I.category & src.categories))
+ continue
+
+ listed_products.Add(list(list(
+ "key" = key,
+ "name" = I.product_name,
+ "price" = I.price,
+ "color" = I.display_color,
+ "amount" = I.amount)))
+
+ data["products"] = listed_products
+
+ if(src.coin)
+ data["coin"] = src.coin.name
+
+ if(src.panel_open)
+ data["panel"] = 1
+ data["speaker"] = src.shut_up ? 0 : 1
+ else
+ data["panel"] = 0
+
+ ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
+ if (!ui)
+ ui = new(user, src, ui_key, "vending_machine.tmpl", src.name, 440, 600)
+ ui.set_initial_data(data)
+ ui.open()
/obj/machinery/vending/Topic(href, href_list)
if(stat & (BROKEN|NOPOWER))
@@ -377,19 +466,9 @@
usr.put_in_hands(coin)
usr << "\blue You remove the [coin] from the [src]"
coin = null
-
- if(href_list["remove_ewallet"] && !istype(usr,/mob/living/silicon))
- if (!ewallet)
- usr << "There is no charge card in this machine."
- return
- ewallet.loc = src.loc
- if(!usr.get_active_hand())
- usr.put_in_hands(ewallet)
- usr << "\blue You remove the [ewallet] from the [src]"
- ewallet = null
+ categories &= ~CAT_COIN
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))))
- usr.set_machine(src)
if ((href_list["vend"]) && (src.vend_ready) && (!currently_vending))
if(istype(usr,/mob/living/silicon))
@@ -407,43 +486,32 @@
flick(icon_deny,src)
return
- var/idx=text2num(href_list["vend"])
- var/cat=text2num(href_list["cat"])
-
- var/datum/data/vending_product/R = GetProductByID(idx,cat)
- if (!R || !istype(R) || !R.product_path || R.amount <= 0)
+ var/key = text2num(href_list["vend"])
+ var/datum/data/vending_product/R = product_records[key]
+
+ // This should not happen unless the request from NanoUI was bad
+ if(!(R.category & src.categories))
return
-
- if(R.price == null)
+
+ if(R.price <= 0)
src.vend(R, usr)
else
- if (ewallet)
- if (R.price <= ewallet.worth)
- ewallet.worth -= R.price
- src.vend(R, usr)
- else
- usr << "\red The ewallet doesn't have enough money to pay for that."
- src.currently_vending = R
- src.updateUsrDialog()
+ src.currently_vending = R
+ if(!vendor_account || vendor_account.suspended)
+ src.status_message = "This machine is currently unable to process payments due to problems with the associated account."
+ src.status_error = 1
else
- src.currently_vending = R
- src.updateUsrDialog()
- return
+ src.status_message = "Please swipe a card or insert cash to pay for the item."
+ src.status_error = 0
- else if (href_list["cancel_buying"])
+ else if (href_list["cancelpurchase"])
src.currently_vending = null
- src.updateUsrDialog()
- return
else if ((href_list["togglevoice"]) && (src.panel_open))
src.shut_up = !src.shut_up
src.add_fingerprint(usr)
- src.updateUsrDialog()
- else
- usr << browse(null, "window=vending")
- return
- return
+ nanomanager.update_uis(src)
/obj/machinery/vending/proc/vend(datum/data/vending_product/R, mob/user)
if((!allowed(usr)) && !emagged && scan_id) //For SECURE VENDING MACHINES YEAH
@@ -451,8 +519,11 @@
flick(src.icon_deny,src)
return
src.vend_ready = 0 //One thing at a time!!
-
- if (R in coin_records)
+ src.status_message = "Vending..."
+ src.status_error = 0
+ nanomanager.update_uis(src)
+
+ if (R.category & CAT_COIN)
if(!coin)
user << "\blue You need to insert a coin to get this item."
return
@@ -462,8 +533,10 @@
else
user << "\blue You weren't able to pull the coin out fast enough, the machine ate it, string and all."
del(coin)
+ categories &= ~CAT_COIN
else
del(coin)
+ categories &= ~CAT_COIN
R.amount--
@@ -477,17 +550,18 @@
flick(src.icon_vend,src)
spawn(src.vend_delay)
new R.product_path(get_turf(src))
+ src.status_message = ""
+ src.status_error = 0
src.vend_ready = 1
- return
-
- src.updateUsrDialog()
+ currently_vending = null
+ nanomanager.update_uis(src)
/obj/machinery/vending/proc/stock(var/datum/data/vending_product/R, var/mob/user)
if(src.panel_open)
user << "\blue You stock the [src] with \a [R.product_name]"
R.amount++
- src.updateUsrDialog()
+ nanomanager.update_uis(src)
/obj/machinery/vending/process()
if(stat & (BROKEN|NOPOWER))
@@ -545,7 +619,7 @@
new dump_path(src.loc)
R.amount--
break
-
+
stat |= BROKEN
src.icon_state = "[initial(icon_state)]-broken"
return
@@ -793,35 +867,32 @@
contraband = list(/obj/item/seeds/amanitamycelium = 2,/obj/item/seeds/glowshroom = 2,/obj/item/seeds/libertymycelium = 2,/obj/item/seeds/mtearseed = 2,
/obj/item/seeds/nettleseed = 2,/obj/item/seeds/reishimycelium = 2,/obj/item/seeds/reishimycelium = 2,/obj/item/seeds/shandseed = 2,)
premium = list(/obj/item/toy/waterflower = 1)
+
+/**
+ * Populate hydroseeds product_records
+ *
+ * This needs to be customized to fetch the actual names of the seeds, otherwise
+ * the machine would simply list "packet of seeds" times 20
+ */
+/obj/machinery/vending/hydroseeds/build_inventory()
+ var/list/all_products = list(
+ list(src.products, CAT_NORMAL),
+ list(src.contraband, CAT_HIDDEN),
+ list(src.premium, CAT_COIN))
-/obj/machinery/vending/hydroseeds/build_inventory(var/list/productlist,hidden=0,req_coin=0)
+ for(var/current_list in all_products)
+ var/category = current_list[2]
- for(var/typepath in productlist)
- var/amount = productlist[typepath]
- var/price = prices[typepath]
- if(isnull(amount)) amount = 1
+ for(var/entry in current_list[1])
+ var/obj/item/seeds/S = new entry(src)
+ var/name = S.name
+ var/datum/data/vending_product/product = new/datum/data/vending_product(entry, name)
- var/datum/data/vending_product/R = new /datum/data/vending_product()
-
- R.product_path = typepath
- R.amount = amount
- R.price = price
- R.display_color = pick("red","blue","green")
-
- if(hidden)
- R.category=CAT_HIDDEN
- hidden_records += R
- else if(req_coin)
- R.category=CAT_COIN
- coin_records += R
- else
- R.category=CAT_NORMAL
- product_records += R
-
- var/obj/item/seeds/S = new typepath(src)
- R.product_name = S.name
- del(S)
- return
+ product.price = (entry in src.prices) ? src.prices[entry] : 0
+ product.amount = (current_list[1][entry]) ? current_list[1][entry] : 1
+ product.category = category
+
+ src.product_records.Add(product)
/obj/machinery/vending/magivend
name = "MagiVend"
diff --git a/code/game/mecha/combat/marauder.dm b/code/game/mecha/combat/marauder.dm
index cdb3645c62..d7e64c1ece 100644
--- a/code/game/mecha/combat/marauder.dm
+++ b/code/game/mecha/combat/marauder.dm
@@ -151,6 +151,7 @@
smoke_ready = 1
return
+//TODO replace this with zoom code that doesn't increase peripherial vision
/obj/mecha/combat/marauder/verb/zoom()
set category = "Exosuit Interface"
set name = "Zoom"
diff --git a/code/game/mecha/equipment/tools/tools.dm b/code/game/mecha/equipment/tools/tools.dm
index 5b71a34ec6..8338e2caa7 100644
--- a/code/game/mecha/equipment/tools/tools.dm
+++ b/code/game/mecha/equipment/tools/tools.dm
@@ -585,7 +585,7 @@
chassis.visible_message("The [chassis.name] armor deflects the projectile")
chassis.log_append_to_last("Armor saved.")
else
- chassis.take_damage(round(Proj.damage*src.damage_coeff),Proj.flag)
+ chassis.take_damage(round(Proj.damage*src.damage_coeff),Proj.check_armour)
chassis.check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST))
Proj.on_hit(chassis)
set_ready_state(0)
diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm
index 4790550700..f57e2e046d 100644
--- a/code/game/mecha/mecha.dm
+++ b/code/game/mecha/mecha.dm
@@ -487,7 +487,7 @@
/obj/mecha/bullet_act(var/obj/item/projectile/Proj) //wrapper
- src.log_message("Hit by projectile. Type: [Proj.name]([Proj.flag]).",1)
+ src.log_message("Hit by projectile. Type: [Proj.name]([Proj.check_armour]).",1)
call((proc_res["dynbulletdamage"]||src), "dynbulletdamage")(Proj) //calls equipment
..()
return
@@ -506,10 +506,10 @@
var/ignore_threshold
if(istype(Proj, /obj/item/projectile/beam/pulse))
ignore_threshold = 1
- src.take_damage(Proj.damage, Proj.flag)
+ src.take_damage(Proj.damage, Proj.check_armour)
if(prob(25)) spark_system.start()
src.check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST,MECHA_INT_SHORT_CIRCUIT),ignore_threshold)
-
+
//AP projectiles have a chance to cause additional damage
if(Proj.penetrating)
var/distance = get_dist(Proj.starting, get_turf(loc))
@@ -520,9 +520,9 @@
hit_occupant = 0
else
src.check_for_internal_damage(list(MECHA_INT_FIRE,MECHA_INT_TEMP_CONTROL,MECHA_INT_TANK_BREACH,MECHA_INT_CONTROL_LOST,MECHA_INT_SHORT_CIRCUIT), 1)
-
+
Proj.penetrating--
-
+
if(prob(15))
break //give a chance to exit early
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index eb2e5c65a6..63447c5168 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -141,9 +141,9 @@
if(isliving(src.loc))
return
user.next_move = max(user.next_move+2,world.time + 2)
- src.pickup(user)
- add_fingerprint(user)
user.put_in_active_hand(src)
+ if(src.loc == user)
+ src.pickup(user)
return
@@ -637,8 +637,8 @@ For zooming with scope or binoculars. This is called from
modules/mob/mob_movement.dm if you move you will be zoomed out
modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
*/
-
-/obj/item/proc/zoom(var/tileoffset = 11,var/viewsize = 12) //tileoffset is client view offset in the direction the user is facing. viewsize is how far out this thing zooms. 7 is normal view
+//Looking through a scope or binoculars should /not/ improve your periphereal vision. Still, increase viewsize a tiny bit so that sniping isn't as restricted to NSEW
+/obj/item/proc/zoom(var/tileoffset = 14,var/viewsize = 9) //tileoffset is client view offset in the direction the user is facing. viewsize is how far out this thing zooms. 7 is normal view
var/devicename
@@ -685,14 +685,6 @@ modules/mob/living/carbon/human/life.dm if you die, you will be zoomed out.
usr.visible_message("[usr] peers through the [zoomdevicename ? "[zoomdevicename] of the [src.name]" : "[src.name]"].")
- /*
- if(istype(usr,/mob/living/carbon/human/))
- var/mob/living/carbon/human/H = usr
- usr.visible_message("[usr] holds [devicename] up to [H.get_visible_gender() == MALE ? "his" : H.get_visible_gender() == FEMALE ? "her" : "their"] eyes.")
- else
- usr.visible_message("[usr] holds [devicename] up to its eyes.")
- */
-
else
usr.client.view = world.view
if(!usr.hud_used.hud_shown)
diff --git a/code/game/objects/items/devices/flash.dm b/code/game/objects/items/devices/flash.dm
index 6e924ba719..644278ab28 100644
--- a/code/game/objects/items/devices/flash.dm
+++ b/code/game/objects/items/devices/flash.dm
@@ -2,7 +2,7 @@
name = "flash"
desc = "Used for blinding and being an asshole."
icon_state = "flash"
- item_state = "flashbang" //looks exactly like a flash (and nothing like a flashbang)
+ item_state = "flash"
throwforce = 5
w_class = 2.0
throw_speed = 4
diff --git a/code/game/objects/items/devices/radio/radio.dm b/code/game/objects/items/devices/radio/radio.dm
index 24c44694f5..93ce1d9eab 100644
--- a/code/game/objects/items/devices/radio/radio.dm
+++ b/code/game/objects/items/devices/radio/radio.dm
@@ -115,13 +115,10 @@
listening = !listening && !(wires.IsIndexCut(WIRE_RECEIVE) || wires.IsIndexCut(WIRE_SIGNAL))
/obj/item/device/radio/Topic(href, href_list)
- //..()
- if (usr.stat || !on)
- return
-
- if (!(issilicon(usr) || (usr.contents.Find(src) || ( in_range(src, usr) && istype(loc, /turf) ))))
+ if(..() || !on)
usr << browse(null, "window=radio")
return
+
usr.set_machine(src)
if (href_list["track"])
var/mob/target = locate(href_list["track"])
@@ -152,17 +149,7 @@
else
channels[chan_name] |= FREQ_LISTENING
- if (!( master ))
- if (istype(loc, /mob))
- interact(loc)
- else
- updateDialog()
- else
- if (istype(master.loc, /mob))
- interact(master.loc)
- else
- updateDialog()
- add_fingerprint(usr)
+ interact(usr)
/obj/item/device/radio/proc/autosay(var/message, var/from, var/channel) //BS12 EDIT
var/datum/radio_frequency/connection = null
diff --git a/code/game/objects/items/devices/spy_bug.dm b/code/game/objects/items/devices/spy_bug.dm
new file mode 100644
index 0000000000..70e3628f67
--- /dev/null
+++ b/code/game/objects/items/devices/spy_bug.dm
@@ -0,0 +1,154 @@
+/obj/item/device/spy_bug
+ name = "bug"
+ desc = "" // Nothing to see here
+ icon = 'icons/obj/weapons.dmi'
+ icon_state = "eshield0"
+ item_state = "nothing"
+ layer = TURF_LAYER+0.2
+
+ flags = CONDUCT
+ force = 5.0
+ w_class = 1.0
+ throwforce = 5.0
+ throw_range = 15
+ throw_speed = 3
+
+ origin_tech = "programming=1;engineering=1;syndicate=3"
+
+ var/obj/item/device/radio/spy/radio
+ var/obj/machinery/camera/spy/camera
+
+/obj/item/device/spy_bug/New()
+ ..()
+ radio = new(src)
+ camera = new(src)
+
+/obj/item/device/spy_bug/examine(mob/user)
+ . = ..(user, 0)
+ if(.)
+ user << "It's a tiny camera, microphone, and transmission device in a happy union."
+ user << "Needs to be both configured and brought in contact with monitor device to be fully functional."
+
+/obj/item/device/spy_bug/attack_self(mob/user)
+ radio.attack_self(user)
+
+/obj/item/device/spy_bug/attackby(obj/W as obj, mob/living/user as mob)
+ if(istype(W, /obj/item/device/spy_monitor))
+ var/obj/item/device/spy_monitor/SM = W
+ SM.pair(src, user)
+ else
+ ..()
+
+/obj/item/device/spy_bug/hear_talk(mob/M, var/msg, verb, datum/language/speaking)
+ radio.hear_talk(M, msg, speaking)
+
+
+/obj/item/device/spy_monitor
+ name = "\improper PDA"
+ desc = "A portable microcomputer by Thinktronic Systems, LTD. Functionality determined by a preprogrammed ROM cartridge."
+ icon = 'icons/obj/pda.dmi'
+ icon_state = "pda"
+ item_state = "electronic"
+
+ w_class = 2.0
+
+ origin_tech = "programming=1;engineering=1;syndicate=3"
+
+ var/operating = 0
+ var/obj/item/device/radio/spy/radio
+ var/obj/machinery/camera/spy/selected_camera
+ var/list/obj/machinery/camera/spy/cameras = new()
+
+/obj/item/device/spy_monitor/New()
+ radio = new(src)
+
+/obj/item/device/spy_monitor/examine(mob/user)
+ . = ..(user, 1)
+ if(.)
+ user << "The time '12:00' is blinking in the corner of the screen and \the [src] looks very cheaply made."
+
+/obj/item/device/spy_monitor/attack_self(mob/user)
+ if(operating)
+ return
+
+ radio.attack_self(user)
+ view_cameras(user)
+
+/obj/item/device/spy_monitor/attackby(obj/W as obj, mob/living/user as mob)
+ if(istype(W, /obj/item/device/spy_bug))
+ pair(W, user)
+ else
+ return ..()
+
+/obj/item/device/spy_monitor/proc/pair(var/obj/item/device/spy_bug/SB, var/mob/living/user)
+ if(SB.camera in cameras)
+ user << "\The [SB] has been unpaired from \the [src]."
+ cameras -= SB.camera
+ else
+ user << "\The [SB] has been paired with \the [src]."
+ cameras += SB.camera
+
+/obj/item/device/spy_monitor/proc/view_cameras(mob/user)
+ if(!can_use_cam(user))
+ return
+
+ selected_camera = cameras[1]
+ view_camera(user)
+
+ operating = 1
+ while(selected_camera && Adjacent(user))
+ selected_camera = input("Select camera bug to view.") as null|anything in cameras
+ selected_camera = null
+ operating = 0
+
+/obj/item/device/spy_monitor/proc/view_camera(mob/user)
+ spawn(0)
+ while(selected_camera && Adjacent(user))
+ var/turf/T = get_turf(selected_camera)
+ if(!T || !is_on_same_plane_or_station(T.z, user.z) || !selected_camera.can_use())
+ user.unset_machine()
+ user.reset_view(null)
+ user << "[selected_camera] unavailable."
+ sleep(90)
+ else
+ user.set_machine(selected_camera)
+ user.reset_view(selected_camera)
+ sleep(10)
+ user.unset_machine()
+ user.reset_view(null)
+
+/obj/item/device/spy_monitor/proc/can_use_cam(mob/user)
+ if(operating)
+ return
+
+ if(!cameras.len)
+ user << "No paired cameras detected!"
+ user << "Bring a bug in contact with this device to pair the camera."
+ return
+
+ return 1
+
+/obj/item/device/spy_monitor/hear_talk(mob/M, var/msg, verb, datum/language/speaking)
+ return radio.hear_talk(M, msg, speaking)
+
+
+/obj/machinery/camera/spy
+ // These cheap toys are accessible from the mercenary camera console as well
+ network = list("NUKE")
+
+/obj/machinery/camera/spy/New()
+ ..()
+ name = "DV-136ZB #[rand(1000,9999)]"
+ c_tag = name
+ cameranet.removeCamera(src) // Sorry, no AI spying.
+
+/obj/machinery/camera/spy/check_eye(var/mob/user as mob)
+ return 1
+
+/obj/item/device/radio/spy
+ listening = 0
+ frequency = 1473
+ broadcasting = 0
+ canhear_range = 1
+ name = "spy device"
+ icon_state = "syn_cypherkey"
diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm
index f9d3e356ce..9bc40c779d 100644
--- a/code/game/objects/items/robot/robot_upgrades.dm
+++ b/code/game/objects/items/robot/robot_upgrades.dm
@@ -121,7 +121,7 @@
usr << "There's no mounting point for the module!"
return 0
- var/obj/item/weapon/gun/energy/taser/cyborg/T = locate() in R.module
+ var/obj/item/weapon/gun/energy/taser/mounted/cyborg/T = locate() in R.module
if(!T)
T = locate() in R.module.contents
if(!T)
diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm
index 6cd12cf137..e9b7a54562 100644
--- a/code/game/objects/items/toys.dm
+++ b/code/game/objects/items/toys.dm
@@ -98,6 +98,18 @@
icon_state = "syndballoon"
item_state = "syndballoon"
w_class = 4.0
+
+/obj/item/toy/nanotrasenballoon
+ name = "criminal balloon"
+ desc = "Across the balloon the following is printed: \"Man, I love NT soooo much. I use only NanoTrasen products. You have NO idea.\""
+ throwforce = 0
+ throw_speed = 4
+ throw_range = 20
+ force = 0
+ icon = 'icons/obj/weapons.dmi'
+ icon_state = "ntballoon"
+ item_state = "ntballoon"
+ w_class = 4.0
/*
* Fake telebeacon
@@ -128,7 +140,7 @@
icon_state = "revolver"
item_state = "gun"
flags = CONDUCT
- slot_flags = SLOT_BELT
+ slot_flags = SLOT_BELT|SLOT_HOLSTER
w_class = 3.0
matter = list("glass" = 10,"metal" = 10)
diff --git a/code/game/objects/items/weapons/grenades/flashbang.dm b/code/game/objects/items/weapons/grenades/flashbang.dm
index a332f6fa92..bda28f83b1 100644
--- a/code/game/objects/items/weapons/grenades/flashbang.dm
+++ b/code/game/objects/items/weapons/grenades/flashbang.dm
@@ -21,6 +21,7 @@
B.health -= damage
B.update_icon()
+ new/obj/effect/effect/sparks(src.loc)
new/obj/effect/effect/smoke/illumination(src.loc, brightness=15)
del(src)
return
diff --git a/code/game/objects/items/weapons/manuals.dm b/code/game/objects/items/weapons/manuals.dm
index f64473ba54..f026313034 100644
--- a/code/game/objects/items/weapons/manuals.dm
+++ b/code/game/objects/items/weapons/manuals.dm
@@ -75,10 +75,10 @@
/obj/item/weapon/book/manual/supermatter_engine
- name = "Supermatter Engine User's Guide"
+ name = "Supermatter Engine Operating Manual"
icon_state = "bookSupermatter"
- author = "Waleed Asad"
- title = "Supermatter Engine User's Guide"
+ author = "Nanotrasen Central Engineering Division"
+ title = "Supermatter Engine Operating Manual"
/obj/item/weapon/book/manual/supermatter_engine/New()
..()
@@ -94,95 +94,56 @@
+ OPERATING MANUAL FOR MK 1 PROTOTYPE THERMOELECTRIC SUPERMATTER ENGINE 'TOMBOLA'
- Engineering notes on the single-stage supermatter engine,
- -Waleed Asad
-
- Station,
- Exodus
-
- A word of caution, do not enter the engine room for any reason without radiation protection and meson scanners on. The status of the engine may be unpredictable even when you believe it is 'off.' This is an important level of personal protection.
-
- The engine has two basic modes of functionality. It has been observed that it is capable of both a safe level of operation and a modified, high output mode.
-
- Heat-Primary Mode
- Notes on starting the basic function mode
+ OPERATING PRINCIPLES
+
+ The supermatter crystal serves as the fundamental power source of the engine. Upon being charged, it begins to emit large amounts of heat and radiation, as well and oxygen and plasma. As oxygen accelerates the reaction, and plasma carries the risk of fire, these must be filtered out. NOTE: Supermatter radiation will not charge radiation collectors.
+
+ Air in the reactor chamber housing the supermatter is circulated through the reactor loop, which passes through the filters and thermoelectric generators. The thermoelectric generators transfer heat from the reactor loop to the colder radiator loop, thereby generating power. Additional power is generated from internal turbines in the circulators.
+
+ Air in the radiator loop is circulated through the radiator bank, located in space. This rapidly cools the air, preserving the temperature differential needed for power generation.
+
+ The MK 1 Prototype Thermoelectric Supermatter Engine is designed to operate at reactor temperatures of 3000K to 4000K and generate up to 1MW of power. Beyond 1MW, the thermoelectric generators will begin to lose power through electrical discharge, reducing efficiency, but additional power generation remains feasible.
+
+ The crystal structure of the supermatter will begin to liquefy if its temperature exceeds 5000K. This eventually results in a massive release of light, heat and radiation, disintegration of both the supermatter crystal and most of the surrounding area, and as as-of-yet poorly documented psychological effects on all animals within a 2km. Appropriate action should be taken to stabilize or eject the supermatter before such occurs.
+
+ SUPERMATTER HANDLING
+ Do not expose supermatter to oxygen.
+ Do not touch supermatter without gloves without exosuit protection allow supermatter to contact any solid object apart from specially-designed supporting pallet.
+ Do not directly view supermatter without meson goggles.
+ While handles on pallet allow moving the supermatter via pulling, pushing should not be attempted.
+
+ STARTUP PROCEDURE
- - Prepare collector arrays: As is standard, begin by wrenching them down, filling six plasma tanks with a plasma canister, and inserting the tank into the collectors one by one. Finally, initialize each collector.
-
- - Prepare gas system: Before introducing any gas into the supermatter engine room, it is important to remember the small, but vital steps to preparing this section. First, set the input gas pump and output gas flow pump to 4500 kPa, or maximum flow. Second, switch the digital switching valve into the 'up' position, so the green light is on north side of the valve, in order to circulate the gas back toward the coolers and collectors.
-
- - Apply N2 gas: Retrieve the two N2 canisters from storage and bring them to the engine room. Attach one of them to the input section of the engine gas system located next to the collectors. Keep it attached until the N2 pressure is low enough to turn the canister light red. Replace it with the second canister to keep N2 pressure at optimal levels.
-
- - Open supermatter shielding: This button is located in the engine room, to the left of the engine monitoring room blast doors. At this point, the supermatter chamber is mostly a gas mixture of N2 and is producing no radiation. It is considered 'safe' up until this point. Do not forget radiation shielding and meson scanners.
-
- - Begin primary emitter burst series: Begin by firing four shots into the supermatter using the emitter. It is important to move to this step quickly. The onboard SMES units may not have enough power to run the emitters if left alone too long on-station. This engine can produce enough power on its own to run the entire station, ignoring the SMES units completely, and is wired to do so.
-
- - Switch SMES units to primary settings: Maximize input and set the devices to automatically charge, additionally turn their outputs on if they are off unless power is to be saved (Which can be useful in case of later failures).
-
- - Begin secondary emitter burst series: Before firing the emitter again, check the power in the line with a multimeter (Do not forget electrical gloves). The engine is running at high efficiency when the value exceeds 200,000 power units.
-
- - Maintain engine power: When power in the lines get low, add an additional emitter burst series to bring power to normal levels.
+ - Fill reactor loop and radiator loop with two (2) standard canisters of nitrogen gas each.
+ - Ensure that pumps and filters are on and operating at maximum power.
+ - Fire
5 15 2 UNKNOWN 8-12 pulses from emitter at supermatter crystal. Reactor blast doors must be open for this procedure.
-
-
- O2-Reaction Mode
-
- The second mode for running the engine uses a gas mixture to produce a reaction within the supermatter. This mode requires the CE's or Atmospheric's help to set up. This is called 'O2-Reaction Mode.'
-
- THIS MODE CAN CAUSE A RUNAWAY REACTION, LEADING TO CATASTROPHIC FAILURE IF NOT MAINTAINED. NEVER FORGET ABOUT THE ENGINE IN THIS MODE.
-
- Additionally, this mode can be used for what is called a 'Cold Start.' If the station has no power in the SMES to run the emitters, using this mode will allow enough power output to run them, and quickly reach an acceptable level of power output.
-
+
+ OPERATION AND MAINTENANCE
- - Prepare collector arrays: As is standard, begin by wrenching them down, filling six plasma tanks with a plasma canister, and inserting the tank into the collectors one by one. Finally, initialize each collector.
-
- - Prepare gas system: Before introducing any gas into the supermatter engine room, it is important to remember the small, but vital steps to preparing this section. First, set the input gas pump and output gas flow pump to 4500 kPa, or maximum flow. Second, switch the digital switching valve into the 'up' position, so the green light is on north side of the valve, in order to circulate the gas back toward the coolers and collectors.
-
- - Modify the engine room filters: Unlike the Heat-Primary Mode, it is important to change the filters attached to the gas system to stop filtering O2, and start filtering carbon molecules. O2-Reaction Mode produces far more plasma than Heat-Primary, therefore filtering it off is essential.
-
- - Switch SMES units to primary settings: Maximize input and set the devices to automatically charge, additionally turn their outputs on if they are off unless power is to be saved (Which can be useful in case of later failures). If you check the power in the system lines at this point, you will find that it is constantly going up. Indeed, with just the addition of O2 to the supermatter, it will begin outputting power.
-
- - Begin primary emitter burst series: Begin by firing four shots into the supermatter using the emitter. Do not over power the supermatter. The reaction is self sustaining and propagating. As long as O2 is in the chamber, it will continue outputting MORE power.
-
- - Maintain follow up operations: Remember to check the temperature of the core gas and switch to the Heat-Primary function, or vent the core room when problems begin if required.
-
-
- Notes on Supermatter Reaction Function and Drawbacks
-
- After several hours of observation, an interesting phenomenon was witnessed. The supermatter undergoes a constant, self-sustaining reaction when given an extremely high O2 concentration. Anything about 80% or higher typically will cause this reaction. The supermatter will continue to react whenever this gas mixture is in the same room as the supermatter.
-
- To understand why O2-Reaction mode is dangerous, the core principle of the supermatter must be understood. The supermatter emits three things when 'not safe,' that is any time it is giving off power. These things are:
-
-
- - Radiation (which is converted into power by the collectors)
- - Heat (which is removed via the gas exchange system and coolers)
- - External gas (in the form of plasma and O2)
-
-
- When in Heat-Primary mode, far more heat and plasma are produced than radiation. In O2-Reaction mode, very little heat and only moderate amounts of plasma are produced, however HUGE amounts of energy leaving the supermatter is in the form of radiation.
-
- The O2-Reaction engine mode has a single drawback which has been eluded to more than once so far and that is very simple. The engine room will continue to grow hotter as the constant reaction continues. Eventually, there will be what is called a 'critical gas mixture.' This is the point at which the constant adding of plasma to the mixture of air around the supermatter changes the gas concentration to below the tolerance. When this happens, two things occur. First, the supermatter switches to its primary mode of operation wherein huge amounts of heat are produced by the engine rather than low amounts with high power output. Second, an uncontrollable increase in heat within the supermatter chamber will occur. This will lead to a spark-up, igniting the plasma in the supermatter chamber, wildly increasing both pressure and temperature.
-
- While the O2-Reaction mode is dangerous, it does produce heavy amounts of energy. Consider using this mode only in short amounts to fill the SMES, and switch back later in the shift to keep things flowing normally.
-
-
- Notes on Supermatter Containment and Emergency Procedures
-
- While a constant vigil on the supermatter is not required, regular checkups are important. Check the temperature of gas leaving the supermatter chamber for unsafe levels and ensure that the plasma in the chamber is at a safe concentration. Of course, also make sure the chamber is not on fire. A fire in the core chamber is very difficult to put out. As any toxin scientist can tell you, even low amounts of plasma can burn at very high temperatures. This burning creates a huge increase in pressure and more importantly, temperature of the crystal itself.
-
- The supermatter is strong, but not invincible. When the supermatter is heated too much, its crystal structure will attempt to liquefy. The change in atomic structure of the supermatter leads to a single reaction, a massive explosion. The computer chip attached to the supermatter core will warn the station when stability is threatened. It will then offer a second warning, when things have become dangerously close to total destruction of the core.
-
- Located both within the CE office and engine room is the engine ventilatory control button. This button allows the core vent controls to be accessed, venting the room to space. Remember however, that this process takes time. If a fire is raging, and the pressure is higher than fathomable, it will take a great deal of time to vent the room. Also located in the CE's office is the emergency core eject button. A new core can be ordered from cargo. It is often not worth the lives of the crew to hold on to it, not to mention the structural damage. However, if by some mistake the supermatter is pushed off or removed from the mass driver it sits on, manual reposition will be required. Which is very dangerous and often leads to death.
-
- The supermatter is extremely dangerous. More dangerous than people give it credit for. It can destroy you in an instant, without hesitation, reducing you to a pile of dust. When working closely with supermatter, it is suggested to get a genetic backup and do not wear any items of value to you. The supermatter core can be pulled if grabbed properly by the base, but pushing is not possible.
-
-
- In Closing
-
- Remember that the supermatter is dangerous, and the core is dangerous still. Venting the core room is always an option if you are even remotely worried, utilizing Atmospherics to properly ready the room once more for core function. It is always a good idea to check up regularly on the temperature of gas leaving the chamber, as well as the power in the system lines. Lastly, once again remember, never touch the supermatter with anything. Ever.
-
- -Waleed Asad, Senior Engine Technician
+ Ensure that radiation protection and meson goggles are worn at all times while working in the engine room.
+ Ensure that reactor and radiator loops are undamaged and unobstructed.
+ Ensure that plasma and oxygen gas exhaust from filters is properly contained or disposed. Do not allow exhaust pressure to exceed 4500 kPa.
+ Ensure that engine room Area Power Controller (APC) and engine Superconducting Magnetic Energy Storage unit (SMES) are properly charged.
+ Ensure that reactor temperature does not exceed 5000K. In event of reactor temperature exceeding 5000K, see EMERGENCY COOLING PROCEDURE.
+ In event of imminent and/or unavoidable delamination, see EJECTION PROCEDURE.
+
+
+ EMERGENCY COOLING PROCEDURE
+
+ - Open Emergency Cooling Valve 1 and Emergency Cooling Valve 2.
+ - When reactor temperature returns to safe operating levels, close Emergency Cooling Valve 1 and Emergency Cooling Valve 2.
+ - If reactor temperature does not return to safe operating levels, see EJECTION PROCEDURE.
+
+
+ EJECTION PROCEDURE
+
+ - Press Engine Ventilatory Control button to open engine core vent to space.
+ - Press Emergency Core Eject button to eject supermatter crystal. NOTE: Attempting crystal ejection while engine core vent is closed will result in ejection failure.
+ - In event of ejection failure, pending
+