diff --git a/baystation12.dme b/baystation12.dme
index 7e6d204137f..7c4e4f1554c 100644
--- a/baystation12.dme
+++ b/baystation12.dme
@@ -164,7 +164,11 @@
#include "code\datums\spells\trigger.dm"
#include "code\datums\spells\turf_teleport.dm"
#include "code\datums\spells\wizard.dm"
+#include "code\datums\wires\airlock.dm"
+#include "code\datums\wires\alarm.dm"
#include "code\datums\wires\apc.dm"
+#include "code\datums\wires\camera.dm"
+#include "code\datums\wires\robot.dm"
#include "code\datums\wires\smartfridge.dm"
#include "code\datums\wires\suit_storage_unit.dm"
#include "code\datums\wires\vending.dm"
@@ -358,7 +362,6 @@
#include "code\game\machinery\camera\motion.dm"
#include "code\game\machinery\camera\presets.dm"
#include "code\game\machinery\camera\tracking.dm"
-#include "code\game\machinery\camera\wires.dm"
#include "code\game\machinery\computer\ai_core.dm"
#include "code\game\machinery\computer\aifixer.dm"
#include "code\game\machinery\computer\arcade.dm"
@@ -686,7 +689,6 @@
#include "code\game\turfs\unsimulated\beach.dm"
#include "code\game\turfs\unsimulated\floor.dm"
#include "code\game\turfs\unsimulated\walls.dm"
-#include "code\game\verbs\atom_verbs.dm"
#include "code\game\verbs\ooc.dm"
#include "code\game\verbs\suicide.dm"
#include "code\game\verbs\who.dm"
@@ -1062,7 +1064,6 @@
#include "code\modules\mob\living\silicon\robot\robot_items.dm"
#include "code\modules\mob\living\silicon\robot\robot_modules.dm"
#include "code\modules\mob\living\silicon\robot\robot_movement.dm"
-#include "code\modules\mob\living\silicon\robot\wires.dm"
#include "code\modules\mob\living\silicon\robot\drone\drone.dm"
#include "code\modules\mob\living\silicon\robot\drone\drone_abilities.dm"
#include "code\modules\mob\living\silicon\robot\drone\drone_console.dm"
diff --git a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm
index c31f6f92b78..43cab4f6ec7 100644
--- a/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm
+++ b/code/ATMOSPHERICS/components/binary_devices/dp_vent_pump.dm
@@ -200,12 +200,9 @@
if(frequency)
set_frequency(frequency)
-/obj/machinery/atmospherics/binary/dp_vent_pump/examine()
- set src in oview(1)
- ..()
-
- if (get_dist(usr, src) <= 1)
- usr << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
+/obj/machinery/atmospherics/binary/dp_vent_pump/examine(mob/user)
+ if(..(user, 1))
+ user << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
/obj/machinery/atmospherics/unary/vent_pump/power_change()
var/old_stat = stat
diff --git a/code/ATMOSPHERICS/components/unary/cold_sink.dm b/code/ATMOSPHERICS/components/unary/cold_sink.dm
index bd3c3b17965..b48e1c5cbe9 100644
--- a/code/ATMOSPHERICS/components/unary/cold_sink.dm
+++ b/code/ATMOSPHERICS/components/unary/cold_sink.dm
@@ -201,7 +201,7 @@
..()
-/obj/machinery/atmospherics/unary/freezer/examine()
- ..()
+/obj/machinery/atmospherics/unary/freezer/examine(mob/user)
+ ..(user)
if (opened)
- usr << "The maintenance hatch is open."
\ No newline at end of file
+ user << "The maintenance hatch is open."
diff --git a/code/ATMOSPHERICS/components/unary/heat_source.dm b/code/ATMOSPHERICS/components/unary/heat_source.dm
index 15d416fff0f..db193cc2dd2 100644
--- a/code/ATMOSPHERICS/components/unary/heat_source.dm
+++ b/code/ATMOSPHERICS/components/unary/heat_source.dm
@@ -184,7 +184,7 @@
..()
-/obj/machinery/atmospherics/unary/heater/examine()
- ..()
+/obj/machinery/atmospherics/unary/heater/examine(mob/user)
+ ..(user)
if (opened)
- usr << "The maintenance hatch is open."
\ No newline at end of file
+ user << "The maintenance hatch is open."
diff --git a/code/ATMOSPHERICS/components/unary/vent_pump.dm b/code/ATMOSPHERICS/components/unary/vent_pump.dm
index 925994546ee..ff43e913857 100644
--- a/code/ATMOSPHERICS/components/unary/vent_pump.dm
+++ b/code/ATMOSPHERICS/components/unary/vent_pump.dm
@@ -375,15 +375,13 @@
else
..()
-/obj/machinery/atmospherics/unary/vent_pump/examine()
- set src in oview(1)
- ..()
- if (get_dist(usr, src) <= 1)
- usr << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
+/obj/machinery/atmospherics/unary/vent_pump/examine(mob/user)
+ if(..(user, 1))
+ user << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
else
- usr << "You are too far away to read the gauge."
+ user << "You are too far away to read the gauge."
if(welded)
- usr << "It seems welded shut."
+ user << "It seems welded shut."
/obj/machinery/atmospherics/unary/vent_pump/power_change()
var/old_stat = stat
diff --git a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm
index 2bad9230e52..fdae89d97e0 100644
--- a/code/ATMOSPHERICS/components/unary/vent_scrubber.dm
+++ b/code/ATMOSPHERICS/components/unary/vent_scrubber.dm
@@ -260,13 +260,11 @@
new /obj/item/pipe(loc, make_from=src)
del(src)
-/obj/machinery/atmospherics/unary/vent_scrubber/examine()
- set src in oview(1)
- ..()
- if (get_dist(usr, src) <= 1)
- usr << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
+/obj/machinery/atmospherics/unary/vent_scrubber/examine(mob/user)
+ if(..(user, 1))
+ user << "A small gauge in the corner reads [round(last_flow_rate, 0.1)] L/s; [round(last_power_draw)] W"
else
- usr << "You are too far away to read the gauge."
+ user << "You are too far away to read the gauge."
/obj/machinery/atmospherics/unary/vent_scrubber/Del()
if(initial_loc)
diff --git a/code/WorkInProgress/Chinsky/guestpass.dm b/code/WorkInProgress/Chinsky/guestpass.dm
index 5f798fa61af..2fc9c700bcc 100644
--- a/code/WorkInProgress/Chinsky/guestpass.dm
+++ b/code/WorkInProgress/Chinsky/guestpass.dm
@@ -16,12 +16,12 @@
else
return temp_access
-/obj/item/weapon/card/id/guest/examine()
- ..()
+/obj/item/weapon/card/id/guest/examine(mob/user)
+ ..(user)
if (world.time < expiration_time)
- usr << "This pass expires at [worldtime2text(expiration_time)]."
+ user << "This pass expires at [worldtime2text(expiration_time)]."
else
- usr << "It expired at [worldtime2text(expiration_time)]."
+ user << "It expired at [worldtime2text(expiration_time)]."
/obj/item/weapon/card/id/guest/read()
if (world.time > expiration_time)
diff --git a/code/WorkInProgress/SkyMarshal/wardrobes.dm b/code/WorkInProgress/SkyMarshal/wardrobes.dm
index 420345214f0..ffbf4d69837 100755
--- a/code/WorkInProgress/SkyMarshal/wardrobes.dm
+++ b/code/WorkInProgress/SkyMarshal/wardrobes.dm
@@ -63,16 +63,13 @@
user.visible_message("\blue [user] gathers up[could_fill ? " " : " most of "]the pile of items and puts it into [src].")
update_icon()
- examine()
- set src in view()
- ..()
- if(src in usr)
- usr << "It claims to contain [contents.len ? descriptor : descriptor + "... but it looks empty"]."
- if(seal_torn && !contents.len)
- usr << "The seal on the bag is broken."
- else
- usr << "The seal on the bag is[seal_torn ? ", however, not intact" : " intact"]."
- return
+ examine(mob/user)
+ ..(user)
+ user << "It claims to contain [contents.len ? descriptor : descriptor + "... but it looks empty"]."
+ if(seal_torn && !contents.len)
+ user << "The seal on the bag is broken."
+ else
+ user << "The seal on the bag is[seal_torn ? ", however, not intact" : " intact"]."
update_icon()
if(contents.len)
diff --git a/code/WorkInProgress/Wrongnumber/weldbackpack.dm b/code/WorkInProgress/Wrongnumber/weldbackpack.dm
index 18899745c9a..f1c786d3e11 100644
--- a/code/WorkInProgress/Wrongnumber/weldbackpack.dm
+++ b/code/WorkInProgress/Wrongnumber/weldbackpack.dm
@@ -46,8 +46,7 @@
user << "\blue The pack is already full!"
return
-/obj/item/weapon/weldpack/examine()
- set src in usr
- usr << text("\icon[] [] units of fuel left!", src, src.reagents.total_volume)
- ..()
+/obj/item/weapon/weldpack/examine(mob/user)
+ ..(user)
+ user << text("\icon[] [] units of fuel left!", src, src.reagents.total_volume)
return
diff --git a/code/WorkInProgress/computer3/computer.dm b/code/WorkInProgress/computer3/computer.dm
index 456bdf3d71f..4939444ae50 100644
--- a/code/WorkInProgress/computer3/computer.dm
+++ b/code/WorkInProgress/computer3/computer.dm
@@ -131,8 +131,6 @@
for(var/typekey in spawn_files)
hdd.addfile(new typekey,1)
- if(program)
- program.execute(os)
update_icon()
diff --git a/code/WorkInProgress/computer3/laptop.dm b/code/WorkInProgress/computer3/laptop.dm
index 52d996827b6..e0156e874e2 100644
--- a/code/WorkInProgress/computer3/laptop.dm
+++ b/code/WorkInProgress/computer3/laptop.dm
@@ -138,6 +138,9 @@
usr << "You can't reach it."
return
+ close_laptop(usr)
+
+ proc/close_laptop(mob/user = null)
if(istype(loc,/obj/item/device/laptop))
testing("Close closed computer")
return
@@ -146,7 +149,8 @@
return
if(stat&BROKEN)
- usr << "\The [src] is broken! You can't quite get it closed."
+ if(user)
+ user << "\The [src] is broken! You can't quite get it closed."
return
if(!portable)
@@ -157,7 +161,8 @@
portable.loc = loc
loc = portable
stat |= MAINT
- usr << "You close \the [src]."
+ if(user)
+ user << "You close \the [src]."
auto_use_power()
if(stat&MAINT)
diff --git a/code/WorkInProgress/computer3/lapvend.dm b/code/WorkInProgress/computer3/lapvend.dm
index b6f93f4702f..36de9e4cfc9 100644
--- a/code/WorkInProgress/computer3/lapvend.dm
+++ b/code/WorkInProgress/computer3/lapvend.dm
@@ -263,7 +263,7 @@
choose_progs(C)
vend()
popup.close()
- newlap.close_computer()
+ newlap.close_laptop()
newlap = null
cardreader = 0
floppy = 0
diff --git a/code/WorkInProgress/periodic_news.dm b/code/WorkInProgress/periodic_news.dm
index f5219aa4359..099da60ba3d 100644
--- a/code/WorkInProgress/periodic_news.dm
+++ b/code/WorkInProgress/periodic_news.dm
@@ -143,10 +143,5 @@ proc/announce_newscaster_news(datum/news_announcement/news)
sendto.is_admin_channel = 1
news_network.network_channels += sendto
- var/datum/feed_message/newMsg = new /datum/feed_message
- newMsg.author = news.author ? news.author : sendto.author
- newMsg.is_admin_message = !news.can_be_redacted
- newMsg.body = news.message
- newMsg.message_type = news.message_type
-
- news_network.insert_message_in_channel(sendto, newMsg)
+ var/author = news.author ? news.author : sendto.author
+ news_network.SubmitArticle(news.message, author, news.channel_name, null, !news.can_be_redacted, news.message_type)
diff --git a/code/__HELPERS/mobs.dm b/code/__HELPERS/mobs.dm
index 521f07c35e5..3c7582b8164 100644
--- a/code/__HELPERS/mobs.dm
+++ b/code/__HELPERS/mobs.dm
@@ -97,3 +97,21 @@ proc/RoundHealth(health)
else
return "health-100"
return "0"
+
+/*
+Proc for attack log creation, because really why not
+1 argument is the actor
+2 argument is the target of action
+3 is the description of action(like punched, throwed, or any other verb)
+4 should it make adminlog note or not
+5 is the tool with which the action was made(usually item) 5 and 6 are very similar(5 have "by " before it, that it) and are separated just to keep things in a bit more in order
+6 is additional information, anything that needs to be added
+*/
+
+/proc/add_logs(mob/user, mob/target, what_done, var/admin=1, var/object=null, var/addition=null)
+ if(user && ismob(user))
+ user.attack_log += text("\[[time_stamp()]\] Has [what_done] [target ? "[target.name][(ismob(target) && target.ckey) ? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition]")
+ if(target && ismob(target))
+ target.attack_log += text("\[[time_stamp()]\] Has been [what_done] by [user ? "[user.name][(ismob(user) && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition]")
+ if(admin)
+ log_attack("[user ? "[user.name][(ismob(user) && user.ckey) ? "([user.ckey])" : ""]" : "NON-EXISTANT SUBJECT"] [what_done] [target ? "[target.name][(ismob(target) && target.ckey)? "([target.ckey])" : ""]" : "NON-EXISTANT SUBJECT"][object ? " with [object]" : " "][addition]")
diff --git a/code/_onclick/ai.dm b/code/_onclick/ai.dm
index 03fe0d53b2a..280c4aaf593 100644
--- a/code/_onclick/ai.dm
+++ b/code/_onclick/ai.dm
@@ -121,12 +121,10 @@
Topic("aiDisable=4", list("aiDisable"="4"), 1)
/obj/machinery/power/apc/AICtrlClick() // turns off/on APCs.
- Topic("breaker=1", list("breaker"="1"), 1) // 0 meaning window (consistency! wait...)
+ Topic("breaker=1", list("breaker"="1"), 1) // 1 meaning no window (consistency!)
/obj/machinery/turretid/AICtrlClick() //turns off/on Turrets
- if(!ailock)
- src.enabled = !src.enabled
- src.updateTurrets()
+ Topic("toggleOn", list("toggleOn"="1", 1)) // 1 meaning no window (consistency!)
/atom/proc/AIAltClick(var/atom/A)
AltClick(A)
@@ -141,9 +139,7 @@
return
/obj/machinery/turretid/AIAltClick() //toggles lethal on turrets
- if(!ailock)
- src.lethal = !src.lethal
- src.updateTurrets()
+ Topic("toggleLethal", list("toggleLethal"="1", 1)) // 1 meaning no window (consistency!)
/atom/proc/AIMiddleClick()
return
diff --git a/code/_onclick/click.dm b/code/_onclick/click.dm
index 569423ec015..586b2622593 100644
--- a/code/_onclick/click.dm
+++ b/code/_onclick/click.dm
@@ -227,8 +227,7 @@
return
/atom/proc/ShiftClick(var/mob/user)
if(user.client && user.client.eye == user)
- examine()
- user.face_atom(src)
+ user.examinate(src)
return
/*
@@ -304,7 +303,6 @@
// Simple helper to face what you clicked on, in case it should be needed in more than one place
/mob/proc/face_atom(var/atom/A)
-
// Snowflake for space vines.
var/is_buckled = 0
if(buckled)
@@ -313,8 +311,7 @@
is_buckled = 1
else
is_buckled = 0
-
- if( stat || is_buckled || !A || !x || !y || !A.x || !A.y ) return
+ if( is_buckled || !A || !x || !y || !A.x || !A.y || (stat && !isobserver(src))) return
var/dx = A.x - x
var/dy = A.y - y
if(!dx && !dy) return
@@ -326,7 +323,7 @@
else
if(dx > 0) direction = EAST
else direction = WEST
- usr.dir = direction
+ dir = direction
if(buckled && buckled.movable)
buckled.dir = direction
buckled.handle_rotation()
\ No newline at end of file
diff --git a/code/_onclick/observer.dm b/code/_onclick/observer.dm
index 2b941562b05..337a0442355 100644
--- a/code/_onclick/observer.dm
+++ b/code/_onclick/observer.dm
@@ -41,7 +41,7 @@
// Oh by the way this didn't work with old click code which is why clicking shit didn't spam you
/atom/proc/attack_ghost(mob/dead/observer/user as mob)
if(user.client && user.client.inquisitive_ghost)
- examine()
+ user.examinate(src)
return
// ---------------------------------------
diff --git a/code/datums/wires/airlock.dm b/code/datums/wires/airlock.dm
new file mode 100644
index 00000000000..e6cb473f590
--- /dev/null
+++ b/code/datums/wires/airlock.dm
@@ -0,0 +1,195 @@
+// Wires for airlocks
+
+/datum/wires/airlock/secure
+ random = 1
+ wire_count = 14
+
+/datum/wires/airlock
+ holder_type = /obj/machinery/door/airlock
+ wire_count = 12
+ window_y = 570
+
+var/const/AIRLOCK_WIRE_IDSCAN = 1
+var/const/AIRLOCK_WIRE_MAIN_POWER1 = 2
+var/const/AIRLOCK_WIRE_MAIN_POWER2 = 4
+var/const/AIRLOCK_WIRE_DOOR_BOLTS = 8
+var/const/AIRLOCK_WIRE_BACKUP_POWER1 = 16
+var/const/AIRLOCK_WIRE_BACKUP_POWER2 = 32
+var/const/AIRLOCK_WIRE_OPEN_DOOR = 64
+var/const/AIRLOCK_WIRE_AI_CONTROL = 128
+var/const/AIRLOCK_WIRE_ELECTRIFY = 256
+var/const/AIRLOCK_WIRE_SAFETY = 512
+var/const/AIRLOCK_WIRE_SPEED = 1024
+var/const/AIRLOCK_WIRE_LIGHT = 2048
+
+/datum/wires/airlock/CanUse(var/mob/living/L)
+ var/obj/machinery/door/airlock/A = holder
+ if(!istype(L, /mob/living/silicon))
+ if(A.isElectrified())
+ if(A.shock(L, 100))
+ return 0
+ if(A.p_open)
+ return 1
+ return 0
+
+/datum/wires/airlock/GetInteractWindow()
+ var/obj/machinery/door/airlock/A = holder
+ . += ..()
+ . += 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."))
+
+/datum/wires/airlock/UpdateCut(var/index, var/mended)
+
+ var/obj/machinery/door/airlock/A = holder
+ switch(index)
+ if(AIRLOCK_WIRE_IDSCAN)
+ A.aiDisabledIdScanner = !mended
+ if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2)
+
+ if(!mended)
+ //Cutting either one disables the main door power, but unless backup power is also cut, the backup power re-powers the door in 10 seconds. While unpowered, the door may be crowbarred open, but bolts-raising will not work. Cutting these wires may electocute the user.
+ A.loseMainPower()
+ A.shock(usr, 50)
+ else
+ if((!IsIndexCut(AIRLOCK_WIRE_MAIN_POWER1)) && (!IsIndexCut(AIRLOCK_WIRE_MAIN_POWER2)))
+ A.regainMainPower()
+ A.shock(usr, 50)
+
+ if(AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2)
+
+ if(!mended)
+ //Cutting either one disables the backup door power (allowing it to be crowbarred open, but disabling bolts-raising), but may electocute the user.
+ A.loseBackupPower()
+ A.shock(usr, 50)
+ else
+ if((!IsIndexCut(AIRLOCK_WIRE_BACKUP_POWER1)) && (!IsIndexCut(AIRLOCK_WIRE_BACKUP_POWER2)))
+ A.regainBackupPower()
+ A.shock(usr, 50)
+
+ if(AIRLOCK_WIRE_DOOR_BOLTS)
+
+ if(!mended)
+ //Cutting this wire also drops the door bolts, and mending it does not raise them. (This is what happens now, except there are a lot more wires going to door bolts at present)
+ if(A.locked!=1)
+ A.locked = 1
+ A.update_icon()
+
+ if(AIRLOCK_WIRE_AI_CONTROL)
+
+ if(!mended)
+ //one wire for AI control. Cutting this prevents the AI from controlling the door unless it has hacked the door through the power connection (which takes about a minute). If both main and backup power are cut, as well as this wire, then the AI cannot operate or hack the door at all.
+ //aiControlDisabled: If 1, AI control is disabled until the AI hacks back in and disables the lock. If 2, the AI has bypassed the lock. If -1, the control is enabled but the AI had bypassed it earlier, so if it is disabled again the AI would have no trouble getting back in.
+ if(A.aiControlDisabled == 0)
+ A.aiControlDisabled = 1
+ else if(A.aiControlDisabled == -1)
+ A.aiControlDisabled = 2
+ else
+ if(A.aiControlDisabled == 1)
+ A.aiControlDisabled = 0
+ else if(A.aiControlDisabled == 2)
+ A.aiControlDisabled = -1
+
+ if(AIRLOCK_WIRE_ELECTRIFY)
+
+ if(!mended)
+ //Cutting this wire electrifies the door, so that the next person to touch the door without insulated gloves gets electrocuted.
+ if(A.secondsElectrified != -1)
+ A.shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])")
+ add_logs(usr, A, "electrified", admin=0, addition="at [A.x],[A.y],[A.z]")
+ A.secondsElectrified = -1
+ else
+ if(A.secondsElectrified == -1)
+ A.secondsElectrified = 0
+ return // Don't update the dialog.
+
+ if (AIRLOCK_WIRE_SAFETY)
+ A.safe = mended
+
+ if(AIRLOCK_WIRE_SPEED)
+ A.autoclose = mended
+ if(mended)
+ if(!A.density)
+ A.close()
+
+ if(AIRLOCK_WIRE_LIGHT)
+ A.lights = mended
+ A.update_icon()
+
+
+/datum/wires/airlock/UpdatePulsed(var/index)
+
+ var/obj/machinery/door/airlock/A = holder
+ 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)
+ 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).
+ A.loseMainPower()
+ if(AIRLOCK_WIRE_DOOR_BOLTS)
+ //one wire for door bolts. Sending a pulse through this drops door bolts if they're not down (whether power's on or not),
+ //raises them if they are down (only if power's on)
+ if(!A.locked)
+ 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
+ A.locked = 0
+ A.audible_message("You hear a click from the bottom of the door.", null, 1)
+ A.update_icon()
+
+ if(AIRLOCK_WIRE_BACKUP_POWER1 || AIRLOCK_WIRE_BACKUP_POWER2)
+ //two wires for backup power. Sending a pulse through either one causes a breaker to trip, but this does not disable it unless main power is down too (in which case it is disabled for 1 minute or however long it takes main power to come back, whichever is shorter).
+ A.loseBackupPower()
+ if(AIRLOCK_WIRE_AI_CONTROL)
+ if(A.aiControlDisabled == 0)
+ A.aiControlDisabled = 1
+ else if(A.aiControlDisabled == -1)
+ A.aiControlDisabled = 2
+
+ spawn(10)
+ if(A)
+ if(A.aiControlDisabled == 1)
+ A.aiControlDisabled = 0
+ else if(A.aiControlDisabled == 2)
+ A.aiControlDisabled = -1
+
+ if(AIRLOCK_WIRE_ELECTRIFY)
+ //one wire for electrifying the door. Sending a pulse through this electrifies the door for 30 seconds.
+ if(A.secondsElectrified==0)
+ A.shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])")
+ add_logs(usr, A, "electrified", admin=0, addition="at [A.x],[A.y],[A.z]")
+ A.secondsElectrified = 30
+ spawn(10)
+ if(A)
+ //TODO: Move this into process() and make pulsing reset secondsElectrified to 30
+ while (A.secondsElectrified>0)
+ A.secondsElectrified-=1
+ if(A.secondsElectrified<0)
+ A.secondsElectrified = 0
+ sleep(10)
+ return
+ if(AIRLOCK_WIRE_OPEN_DOOR)
+ //tries to open the door without ID
+ //will succeed only if the ID wire is cut or the door requires no access and it's not emagged
+ if(A.emagged) return
+ if(!A.requiresID() || A.check_access(null))
+ if(A.density) A.open()
+ else A.close()
+ if(AIRLOCK_WIRE_SAFETY)
+ A.safe = !A.safe
+ if(!A.density)
+ A.close()
+
+ if(AIRLOCK_WIRE_SPEED)
+ A.normalspeed = !A.normalspeed
+
+ if(AIRLOCK_WIRE_LIGHT)
+ A.lights = !A.lights
+ A.update_icon()
diff --git a/code/datums/wires/alarm.dm b/code/datums/wires/alarm.dm
new file mode 100644
index 00000000000..e8d68d7ffe2
--- /dev/null
+++ b/code/datums/wires/alarm.dm
@@ -0,0 +1,93 @@
+/datum/wires/alarm
+ holder_type = /obj/machinery/alarm
+ wire_count = 5
+
+var/const/AALARM_WIRE_IDSCAN = 1
+var/const/AALARM_WIRE_POWER = 2
+var/const/AALARM_WIRE_SYPHON = 4
+var/const/AALARM_WIRE_AI_CONTROL = 8
+var/const/AALARM_WIRE_AALARM = 16
+
+
+/datum/wires/alarm/CanUse(var/mob/living/L)
+ var/obj/machinery/alarm/A = holder
+ if(A.wiresexposed)
+ return 1
+ return 0
+
+/datum/wires/alarm/GetInteractWindow()
+ var/obj/machinery/alarm/A = holder
+ . += ..()
+ . += text("
\n[(A.locked ? "The Air Alarm is locked." : "The Air Alarm is unlocked.")]
\n[((A.shorted || (A.stat & (NOPOWER|BROKEN))) ? "The Air Alarm is offline." : "The Air Alarm is working properly!")]
\n[(A.aidisabled ? "The 'AI control allowed' light is off." : "The 'AI control allowed' light is on.")]")
+
+/datum/wires/alarm/UpdateCut(var/index, var/mended)
+ var/obj/machinery/alarm/A = holder
+ switch(index)
+ if(AALARM_WIRE_IDSCAN)
+ if(!mended)
+ A.locked = 1
+ //world << "Idscan wire cut"
+
+ if(AALARM_WIRE_POWER)
+ A.shock(usr, 50)
+ A.shorted = !mended
+ A.update_icon()
+ //world << "Power wire cut"
+
+ if (AALARM_WIRE_AI_CONTROL)
+ if (A.aidisabled == !mended)
+ A.aidisabled = mended
+ //world << "AI Control Wire Cut"
+
+ if(AALARM_WIRE_SYPHON)
+ if(!mended)
+ A.mode = 3 // AALARM_MODE_PANIC
+ A.apply_mode()
+ //world << "Syphon Wire Cut"
+
+ if(AALARM_WIRE_AALARM)
+ if (A.alarm_area.atmosalert(2))
+ A.post_alert(2)
+ A.update_icon()
+
+/datum/wires/alarm/UpdatePulsed(var/index)
+ var/obj/machinery/alarm/A = holder
+ switch(index)
+ if(AALARM_WIRE_IDSCAN)
+ A.locked = !A.locked
+ // world << "Idscan wire pulsed"
+
+ if (AALARM_WIRE_POWER)
+ // world << "Power wire pulsed"
+ if(A.shorted == 0)
+ A.shorted = 1
+ A.update_icon()
+
+ spawn(12000)
+ if(A.shorted == 1)
+ A.shorted = 0
+ A.update_icon()
+
+
+ if (AALARM_WIRE_AI_CONTROL)
+ // world << "AI Control wire pulsed"
+ if (A.aidisabled == 0)
+ A.aidisabled = 1
+ A.updateDialog()
+ spawn(100)
+ if (A.aidisabled == 1)
+ A.aidisabled = 0
+
+ if(AALARM_WIRE_SYPHON)
+ // world << "Syphon wire pulsed"
+ if(A.mode == 1) // AALARM_MODE_SCRUB
+ A.mode = 3 // AALARM_MODE_PANIC
+ else
+ A.mode = 1 // AALARM_MODE_SCRUB
+ A.apply_mode()
+
+ if(AALARM_WIRE_AALARM)
+ // world << "Aalarm wire pulsed"
+ if (A.alarm_area.atmosalert(0))
+ A.post_alert(0)
+ A.update_icon()
diff --git a/code/datums/wires/apc.dm b/code/datums/wires/apc.dm
index 7e48809af9a..bdddf048c50 100644
--- a/code/datums/wires/apc.dm
+++ b/code/datums/wires/apc.dm
@@ -2,10 +2,10 @@
holder_type = /obj/machinery/power/apc
wire_count = 4
-var/const/APC_WIRE_IDSCAN = 1
-var/const/APC_WIRE_MAIN_POWER1 = 2
-var/const/APC_WIRE_MAIN_POWER2 = 4
-var/const/APC_WIRE_AI_CONTROL = 8
+#define APC_WIRE_IDSCAN 1
+#define APC_WIRE_MAIN_POWER1 2
+#define APC_WIRE_MAIN_POWER2 4
+#define APC_WIRE_AI_CONTROL 8
/datum/wires/apc/GetInteractWindow()
var/obj/machinery/power/apc/A = holder
@@ -31,7 +31,6 @@ var/const/APC_WIRE_AI_CONTROL = 8
spawn(300)
if(A)
A.locked = 1
- A.updateDialog()
if (APC_WIRE_MAIN_POWER1, APC_WIRE_MAIN_POWER2)
if(A.shorted == 0)
@@ -40,7 +39,6 @@ var/const/APC_WIRE_AI_CONTROL = 8
spawn(1200)
if(A && !IsIndexCut(APC_WIRE_MAIN_POWER1) && !IsIndexCut(APC_WIRE_MAIN_POWER2))
A.shorted = 0
- A.updateDialog()
if (APC_WIRE_AI_CONTROL)
if (A.aidisabled == 0)
@@ -49,9 +47,6 @@ var/const/APC_WIRE_AI_CONTROL = 8
spawn(10)
if(A && !IsIndexCut(APC_WIRE_AI_CONTROL))
A.aidisabled = 0
- A.updateDialog()
-
- A.updateDialog()
/datum/wires/apc/UpdateCut(var/index, var/mended)
var/obj/machinery/power/apc/A = holder
@@ -75,4 +70,3 @@ var/const/APC_WIRE_AI_CONTROL = 8
else
if (A.aidisabled == 1)
A.aidisabled = 0
- A.updateDialog()
diff --git a/code/datums/wires/camera.dm b/code/datums/wires/camera.dm
new file mode 100644
index 00000000000..d03da5fa171
--- /dev/null
+++ b/code/datums/wires/camera.dm
@@ -0,0 +1,74 @@
+// Wires for cameras.
+
+/datum/wires/camera
+ random = 1
+ holder_type = /obj/machinery/camera
+ wire_count = 6
+
+/datum/wires/camera/GetInteractWindow()
+
+ . = ..()
+ var/obj/machinery/camera/C = holder
+ . += "
\n[(C.view_range == initial(C.view_range) ? "The focus light is on." : "The focus light is off.")]"
+ . += "
\n[(C.can_use() ? "The power link light is on." : "The power link light is off.")]"
+ . += "
\n[(C.light_disabled ? "The camera light is off." : "The camera light is on.")]"
+ . += "
\n[(C.alarm_on ? "The alarm light is on." : "The alarm light is off.")]"
+ return .
+
+/datum/wires/camera/CanUse(var/mob/living/L)
+ var/obj/machinery/camera/C = holder
+ return C.panel_open
+
+var/const/CAMERA_WIRE_FOCUS = 1
+var/const/CAMERA_WIRE_POWER = 2
+var/const/CAMERA_WIRE_LIGHT = 4
+var/const/CAMERA_WIRE_ALARM = 8
+var/const/CAMERA_WIRE_NOTHING1 = 16
+var/const/CAMERA_WIRE_NOTHING2 = 32
+
+/datum/wires/camera/UpdateCut(var/index, var/mended)
+ var/obj/machinery/camera/C = holder
+
+ switch(index)
+ if(CAMERA_WIRE_FOCUS)
+ var/range = (mended ? initial(C.view_range) : C.short_range)
+ C.setViewRange(range)
+
+ if(CAMERA_WIRE_POWER)
+ if(C.status && !mended || !C.status && mended)
+ C.deactivate(usr, 1)
+
+ if(CAMERA_WIRE_LIGHT)
+ C.light_disabled = !mended
+
+ if(CAMERA_WIRE_ALARM)
+ if(!mended)
+ C.triggerCameraAlarm()
+ else
+ C.cancelCameraAlarm()
+ return
+
+/datum/wires/camera/UpdatePulsed(var/index)
+ var/obj/machinery/camera/C = holder
+ if(IsIndexCut(index))
+ return
+ switch(index)
+ if(CAMERA_WIRE_FOCUS)
+ var/new_range = (C.view_range == initial(C.view_range) ? C.short_range : initial(C.view_range))
+ C.setViewRange(new_range)
+
+ if(CAMERA_WIRE_POWER)
+ C.deactivate(null) // Deactivate the camera
+
+ if(CAMERA_WIRE_LIGHT)
+ C.light_disabled = !C.light_disabled
+
+ if(CAMERA_WIRE_ALARM)
+ C.visible_message("\icon[C] *beep*", "\icon[C] *beep*")
+ return
+
+/datum/wires/camera/proc/CanDeconstruct()
+ if(IsIndexCut(CAMERA_WIRE_POWER) && IsIndexCut(CAMERA_WIRE_FOCUS) && IsIndexCut(CAMERA_WIRE_LIGHT) && IsIndexCut(CAMERA_WIRE_NOTHING1) && IsIndexCut(CAMERA_WIRE_NOTHING2))
+ return 1
+ else
+ return 0
diff --git a/code/datums/wires/robot.dm b/code/datums/wires/robot.dm
new file mode 100644
index 00000000000..13e53164320
--- /dev/null
+++ b/code/datums/wires/robot.dm
@@ -0,0 +1,103 @@
+/datum/wires/robot
+ random = 1
+ holder_type = /mob/living/silicon/robot
+ wire_count = 5
+
+var/const/BORG_WIRE_LAWCHECK = 1
+var/const/BORG_WIRE_MAIN_POWER = 2 // The power wires do nothing whyyyyyyyyyyyyy
+var/const/BORG_WIRE_LOCKED_DOWN = 4
+var/const/BORG_WIRE_AI_CONTROL = 8
+var/const/BORG_WIRE_CAMERA = 16
+
+/datum/wires/robot/GetInteractWindow()
+
+ . = ..()
+ var/mob/living/silicon/robot/R = holder
+ . += text("
\n[(R.lawupdate ? "The LawSync light is on." : "The LawSync light is off.")]")
+ . += text("
\n[(R.connected_ai ? "The AI link light is on." : "The AI link light is off.")]")
+ . += text("
\n[((!isnull(R.camera) && R.camera.status == 1) ? "The Camera light is on." : "The Camera light is off.")]")
+ . += text("
\n[(R.lockcharge ? "The lockdown light is on." : "The lockdown light is off.")]")
+ return .
+
+/datum/wires/robot/UpdateCut(var/index, var/mended)
+
+ var/mob/living/silicon/robot/R = holder
+ switch(index)
+ if(BORG_WIRE_LAWCHECK) //Cut the law wire, and the borg will no longer receive law updates from its AI
+ if(!mended)
+ if (R.lawupdate == 1)
+ R << "LawSync protocol engaged."
+ R.show_laws()
+ else
+ if (R.lawupdate == 0 && !R.emagged)
+ R.lawupdate = 1
+
+ if (BORG_WIRE_AI_CONTROL) //Cut the AI wire to reset AI control
+ if(!mended)
+ if (R.connected_ai)
+ R.connected_ai = null
+
+ if (BORG_WIRE_CAMERA)
+ if(!isnull(R.camera) && !R.scrambledcodes)
+ R.camera.status = mended
+ R.camera.deactivate(usr, 0) // Will kick anyone who is watching the Cyborg's camera.
+
+ if(BORG_WIRE_LAWCHECK) //Forces a law update if the borg is set to receive them. Since an update would happen when the borg checks its laws anyway, not much use, but eh
+ if (R.lawupdate)
+ R.lawsync()
+
+ if(BORG_WIRE_LOCKED_DOWN)
+ R.SetLockdown(!mended)
+
+
+/datum/wires/robot/UpdatePulsed(var/index)
+
+ var/mob/living/silicon/robot/R = holder
+ switch(index)
+ if (BORG_WIRE_AI_CONTROL) //pulse the AI wire to make the borg reselect an AI
+ if(!R.emagged)
+ var/new_ai = select_active_ai(R)
+ if(new_ai && (new_ai != R.connected_ai))
+ R.connected_ai = new_ai
+ R.notify_ai(1)
+ var/numberer = 1 // Send images the Cyborg has taken to the AI's album upon sync.
+ for(var/datum/picture/z in R.aiCamera.aipictures)
+ if(R.connected_ai.aiCamera.aipictures.len == 0)
+ var/datum/picture/p = new/datum/picture()
+ p = z
+ p.fields["name"] = "Uploaded Image [numberer] (synced from [R.name])"
+ R.connected_ai.aiCamera.aipictures += p
+ numberer++
+ continue
+ for(var/datum/picture/t in R.connected_ai.aiCamera.aipictures) //Hopefully to prevent someone spamming images to silicons, by spamming this wire
+ if((z.fields["pixel_y"] != t.fields["pixel_y"]) && (z.fields["pixel_x"] != t.fields["pixel_x"])) //~2.26 out of 1000 chance this will stop something it shouldn't
+ var/datum/picture/p = new/datum/picture()
+ p = z
+ p.fields["name"] = "Uploaded Image [numberer] (synced from [R.name])"
+ R.connected_ai.aiCamera.aipictures += p
+ else
+ continue
+ numberer++
+ if(R.aiCamera.aipictures.len > 0)
+ R << "Locally saved images synced with AI. Images were retained in local database in case of loss of connection with the AI."
+
+ if (BORG_WIRE_CAMERA)
+ if(!isnull(R.camera) && R.camera.can_use() && !R.scrambledcodes)
+ R.camera.deactivate(usr, 0) // Kick anyone watching the Cyborg's camera, doesn't display you disconnecting the camera.
+ R.visible_message("[R]'s camera lense focuses loudly.")
+ R << "Your camera lense focuses loudly."
+
+ if(BORG_WIRE_LOCKED_DOWN)
+ R.SetLockdown(!R.lockcharge) // Toggle
+
+/datum/wires/robot/CanUse(var/mob/living/L)
+ var/mob/living/silicon/robot/R = holder
+ if(R.wiresexposed)
+ return 1
+ return 0
+
+/datum/wires/robot/proc/IsCameraCut()
+ return wires_status & BORG_WIRE_CAMERA
+
+/datum/wires/robot/proc/LockedCut()
+ return wires_status & BORG_WIRE_LOCKED_DOWN
diff --git a/code/datums/wires/smartfridge.dm b/code/datums/wires/smartfridge.dm
index 0d0fb298706..b611497e796 100644
--- a/code/datums/wires/smartfridge.dm
+++ b/code/datums/wires/smartfridge.dm
@@ -2,6 +2,10 @@
holder_type = /obj/machinery/smartfridge
wire_count = 3
+/datum/wires/smartfridge/secure
+ random = 1
+ wire_count = 4
+
var/const/SMARTFRIDGE_WIRE_ELECTRIFY = 1
var/const/SMARTFRIDGE_WIRE_THROW = 2
var/const/SMARTFRIDGE_WIRE_IDSCAN = 4
@@ -16,11 +20,6 @@ var/const/SMARTFRIDGE_WIRE_IDSCAN = 4
return 1
return 0
-/datum/wires/smartfridge/Interact(var/mob/living/user)
- if(CanUse(user))
- var/obj/machinery/smartfridge/S = holder
- S.attack_hand(user)
-
/datum/wires/smartfridge/GetInteractWindow()
var/obj/machinery/smartfridge/S = holder
. += ..()
diff --git a/code/datums/wires/suit_storage_unit.dm b/code/datums/wires/suit_storage_unit.dm
index 8ef5ce63986..c2d1a130d79 100644
--- a/code/datums/wires/suit_storage_unit.dm
+++ b/code/datums/wires/suit_storage_unit.dm
@@ -16,11 +16,6 @@ var/const/SUIT_STORAGE_WIRE_LOCKED = 4
return 1
return 0
-/datum/wires/suit_storage_unit/Interact(var/mob/living/user)
- if(CanUse(user))
- var/obj/machinery/suit_cycler/S = holder
- S.attack_hand(user)
-
/datum/wires/suit_storage_unit/GetInteractWindow()
var/obj/machinery/suit_cycler/S = holder
. += ..()
diff --git a/code/datums/wires/wires.dm b/code/datums/wires/wires.dm
index 6204c90325e..26feaefe47a 100644
--- a/code/datums/wires/wires.dm
+++ b/code/datums/wires/wires.dm
@@ -6,8 +6,8 @@
#define MAX_FLAG 65535
var/list/same_wires = list()
-// 12 colours, if you're adding more than 12 wires then add more colours here
-var/list/wireColours = list("red", "blue", "green", "black", "orange", "brown", "gold", "gray", "cyan", "navy", "purple", "pink")
+// 14 colours, if you're adding more than 14 wires then add more colours here
+var/list/wireColours = list("red", "blue", "green", "white", "orange", "brown", "gold", "gray", "cyan", "navy", "purple", "pink", "black", "yellow")
/datum/wires
diff --git a/code/defines/procs/announce.dm b/code/defines/procs/announce.dm
index 54bdd953974..b74f7a1c78f 100644
--- a/code/defines/procs/announce.dm
+++ b/code/defines/procs/announce.dm
@@ -7,7 +7,7 @@
var/log = 0
var/sound
var/newscast = 0
- var/channel_name = "Public Station Announcements"
+ var/channel_name = "Station Announcements"
var/announcement_type = "Announcement"
/datum/announcement/New(var/do_log = 0, var/new_sound = null, var/do_newscast = 0)
diff --git a/code/defines/procs/radio.dm b/code/defines/procs/radio.dm
index 0846502ede1..0cbd009076c 100644
--- a/code/defines/procs/radio.dm
+++ b/code/defines/procs/radio.dm
@@ -51,27 +51,26 @@
return TELECOMMS_RECEPTION_RECEIVER
return TELECOMMS_RECEPTION_NONE
-/proc/get_reception(var/atom/sender, var/receiver, var/message = "")
+/proc/get_reception(var/atom/sender, var/receiver, var/message = "", var/do_sleep = 1)
var/datum/reception/reception = new
// check if telecomms I/O route 1459 is stable
- //var/telecomms_intact = telecomms_process(P.owner, owner, t)
reception.message_server = get_message_server()
- var/datum/signal/signal = sender.telecomms_process() // Be aware that this proc calls sleep, to simulate transmition delays
+ var/datum/signal/signal = sender.telecomms_process(do_sleep) // Be aware that this proc calls sleep, to simulate transmition delays
reception.telecomms_reception |= get_sender_reception(sender, signal)
reception.telecomms_reception |= get_receiver_reception(receiver, signal)
reception.message = signal && signal.data["compression"] > 0 ? Gibberish(message, signal.data["compression"] + 50) : message
return reception
-/proc/get_receptions(var/atom/sender, var/list/atom/receivers)
+/proc/get_receptions(var/atom/sender, var/list/atom/receivers, var/do_sleep = 1)
var/datum/receptions/receptions = new
receptions.message_server = get_message_server()
var/datum/signal/signal
if(sender)
- signal = sender.telecomms_process()
+ signal = sender.telecomms_process(do_sleep)
receptions.sender_reception = get_sender_reception(sender, signal)
for(var/atom/receiver in receivers)
diff --git a/code/game/atoms.dm b/code/game/atoms.dm
index b1cfd18551d..bf86972fdc9 100644
--- a/code/game/atoms.dm
+++ b/code/game/atoms.dm
@@ -187,18 +187,22 @@ its easier to just keep the beam vertical.
//All atoms
-/atom/verb/examine()
- set name = "Examine"
- set category = "IC"
- set src in view(usr.client) //If it can be seen, it can be examined.
+/atom/proc/examine(mob/user, var/distance = -1)
+ //This reformat names to get a/an properly working on item descriptions when they are bloody
+ var/f_name = "\a [src]."
+ if(src.blood_DNA && !istype(src, /obj/effect/decal))
+ if(gender == PLURAL)
+ f_name = "some "
+ else
+ f_name = "a "
+ f_name += "blood-stained [name]!"
- if (!( usr ))
- return
- usr << "That's \a [src]." //changed to "That's" from "This is" because "This is some metal sheets" sounds dumb compared to "That's some metal sheets" ~Carn
- usr << desc
- // *****RM
- //usr << "[name]: Dn:[density] dir:[dir] cont:[contents] icon:[icon] is:[icon_state] loc:[loc]"
- return
+ user << "\icon[src] That's [f_name]"
+
+ if(desc)
+ user << desc
+
+ return distance == -1 || (get_dist(src, user) <= distance)
// called by mobs when e.g. having the atom as their machine, pulledby, loc (AKA mob being inside the atom) or buckled var set.
// see code/modules/mob/mob_movement.dm for more.
diff --git a/code/game/gamemodes/cult/ritual.dm b/code/game/gamemodes/cult/ritual.dm
index e60795f5fd9..b78baf2816d 100644
--- a/code/game/gamemodes/cult/ritual.dm
+++ b/code/game/gamemodes/cult/ritual.dm
@@ -20,7 +20,7 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology",
runewords-=cultwords[word]
/obj/effect/rune
- desc = ""
+ desc = "A strange collection of symbols drawn in blood."
anchored = 1
icon = 'icons/obj/rune.dmi'
icon_state = "1"
@@ -68,26 +68,10 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology",
for(var/mob/living/silicon/ai/AI in player_list)
AI.client.images += blood
- examine()
- set src in view(2)
-
- if(!iscultist(usr))
- usr << "A strange collection of symbols drawn in blood."
- return
- /* Explosions... really?
- if(desc && !usr.stat)
- usr << "It reads: [desc]."
- sleep(30)
- explosion(src.loc, 0, 2, 5, 5)
- if(src)
- del(src)
- */
- if(!desc)
- usr << "A spell circle drawn in blood. It reads: [word1] [word2] [word3]."
- else
- usr << "Explosive Runes inscription in blood. It reads: [desc]."
-
- return
+ examine(mob/user)
+ ..()
+ if(iscultist(user))
+ user << "This spell circle reads: [word1] [word2] [word3]."
attackby(I as obj, user as mob)
@@ -346,7 +330,8 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology",
msg_admin_attack("[user.name] ([user.ckey]) used [name] on [M.name] ([M.ckey]) (JMP)")
if(istype(M,/mob/dead))
- M.invisibility = 0
+ var/mob/dead/D = M
+ D.manifest()
user.visible_message( \
"\red [user] drags the ghost to our plan of reality!", \
"\red You drag the ghost to our plan of reality!" \
@@ -510,12 +495,11 @@ var/engwords = list("travel", "blood", "join", "hell", "destroy", "technology",
user << "You copy the translation notes from your tome."
- examine()
- set src in usr
- if(!iscultist(usr))
- usr << "An old, dusty tome with frayed edges and a sinister looking cover."
+ examine(mob/user)
+ if(!iscultist(user))
+ user << "An old, dusty tome with frayed edges and a sinister looking cover."
else
- usr << "The scriptures of Nar-Sie, The One Who Sees, The Geometer of Blood. Contains the details of every ritual his followers could think of. Most of these are useless, though."
+ user << "The scriptures of Nar-Sie, The One Who Sees, The Geometer of Blood. Contains the details of every ritual his followers could think of. Most of these are useless, though."
/obj/item/weapon/book/tome/imbued //admin tome, spawns working runes without waiting
w_class = 2.0
diff --git a/code/game/gamemodes/cult/talisman.dm b/code/game/gamemodes/cult/talisman.dm
index a319e83421e..961f38fc0d9 100644
--- a/code/game/gamemodes/cult/talisman.dm
+++ b/code/game/gamemodes/cult/talisman.dm
@@ -3,13 +3,6 @@
var/imbue = null
var/uses = 0
-
- examine()
- set src in view(2)
- ..()
- return
-
-
attack_self(mob/living/user as mob)
if(iscultist(user))
var/delete = 1
diff --git a/code/game/gamemodes/events/ninja_equipment.dm b/code/game/gamemodes/events/ninja_equipment.dm
index 48b99580fdd..99b127ec1be 100644
--- a/code/game/gamemodes/events/ninja_equipment.dm
+++ b/code/game/gamemodes/events/ninja_equipment.dm
@@ -911,9 +911,8 @@ ________________________________________________________________________________
U.drop_item()
return 0
-/obj/item/clothing/suit/space/space_ninja/examine()
- set src in view()
- ..()
+/obj/item/clothing/suit/space/space_ninja/examine(mob/user)
+ ..(user)
if(s_initialized)
var/mob/living/carbon/human/U = affecting
if(s_control)
@@ -1168,9 +1167,8 @@ ________________________________________________________________________________
U << "You [candrain?"disable":"enable"] special interaction."
candrain=!candrain
-/obj/item/clothing/gloves/space_ninja/examine()
- set src in view()
- ..()
+/obj/item/clothing/gloves/space_ninja/examine(mob/user)
+ ..(user)
if(!canremove)
var/mob/living/carbon/human/U = loc
U << "The energy drain mechanism is: [candrain?"active":"inactive"]."
@@ -1306,12 +1304,11 @@ ________________________________________________________________________________
var/mob/U = loc
U << "Switching mode to [ninja_vision.mode]."
-/obj/item/clothing/mask/gas/voice/space_ninja/examine()
- set src in view()
- ..()
+/obj/item/clothing/mask/gas/voice/space_ninja/examine(mob/user)
+ ..(user)
- usr << "[ninja_vision.mode] is active."//Leaving usr here since it may be on the floor or on a person.
- usr << "Voice mimicking algorithm is set [!vchange?"inactive":"active"]."
+ user << "[ninja_vision.mode] is active."
+ user << "Voice mimicking algorithm is set [!vchange?"inactive":"active"]."
/*
===================================================================================
diff --git a/code/game/gamemodes/mutiny/emergency_authentication_device.dm b/code/game/gamemodes/mutiny/emergency_authentication_device.dm
index 5bdcf27576e..bedd67e64cf 100644
--- a/code/game/gamemodes/mutiny/emergency_authentication_device.dm
+++ b/code/game/gamemodes/mutiny/emergency_authentication_device.dm
@@ -99,7 +99,7 @@
return
..()
-/obj/machinery/emergency_authentication_device/examine()
- usr << {"
+/obj/machinery/emergency_authentication_device/examine(mob/user)
+ user << {"
This is a specialized communications device that is able to instantly send a message to NanoTrasen High Command via quantum entanglement with a sister device at CentCom.
The EAD's status is [get_status()]."}
diff --git a/code/game/gamemodes/mutiny/key_pinpointer.dm b/code/game/gamemodes/mutiny/key_pinpointer.dm
index c481fd5bbc8..7e8d628d85b 100644
--- a/code/game/gamemodes/mutiny/key_pinpointer.dm
+++ b/code/game/gamemodes/mutiny/key_pinpointer.dm
@@ -25,14 +25,14 @@
icon_state = "pinoff"
usr << "\blue You switch \the [src] off."
-/obj/item/weapon/pinpointer/advpinpointer/auth_key/examine()
+/obj/item/weapon/pinpointer/advpinpointer/auth_key/examine(mob/user)
switch(mode)
if (1)
- usr << "Is is calibrated for the Captain's Authentication Key."
+ user << "Is is calibrated for the Captain's Authentication Key."
if (2)
- usr << "It is calibrated for the Emergency Secondary Authentication Key."
+ user << "It is calibrated for the Emergency Secondary Authentication Key."
else
- usr << "It is switched off."
+ user << "It is switched off."
/datum/supply_packs/key_pinpointer
name = "Authentication Key Pinpointer crate"
diff --git a/code/game/gamemodes/nuclear/pinpointer.dm b/code/game/gamemodes/nuclear/pinpointer.dm
index 9b49e37fae1..36137a74a93 100644
--- a/code/game/gamemodes/nuclear/pinpointer.dm
+++ b/code/game/gamemodes/nuclear/pinpointer.dm
@@ -42,11 +42,11 @@
icon_state = "pinonfar"
spawn(5) .()
- examine()
- ..()
+ examine(mob/user)
+ ..(user)
for(var/obj/machinery/nuclearbomb/bomb in world)
if(bomb.timing)
- usr << "Extreme danger. Arming signal detected. Time remaining: [bomb.timeleft]"
+ user << "Extreme danger. Arming signal detected. Time remaining: [bomb.timeleft]"
/obj/item/weapon/pinpointer/advpinpointer
diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm
index 6ca98474f7e..49a13e87b7f 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -2,32 +2,6 @@
//CONTAINS: Air Alarms and Fire Alarms//
////////////////////////////////////////
-/proc/RandomAAlarmWires()
- //to make this not randomize the wires, just set index to 1 and increment it in the flag for loop (after doing everything else).
- var/list/AAlarmwires = list(0, 0, 0, 0, 0)
- AAlarmIndexToFlag = list(0, 0, 0, 0, 0)
- AAlarmIndexToWireColor = list(0, 0, 0, 0, 0)
- AAlarmWireColorToIndex = list(0, 0, 0, 0, 0)
- var/flagIndex = 1
- for (var/flag=1, flag<32, flag+=flag)
- var/valid = 0
- while (!valid)
- var/colorIndex = rand(1, 5)
- if (AAlarmwires[colorIndex]==0)
- valid = 1
- AAlarmwires[colorIndex] = flag
- AAlarmIndexToFlag[flagIndex] = flag
- AAlarmIndexToWireColor[flagIndex] = colorIndex
- AAlarmWireColorToIndex[colorIndex] = flagIndex
- flagIndex+=1
- return AAlarmwires
-
-#define AALARM_WIRE_IDSCAN 1 //Added wires
-#define AALARM_WIRE_POWER 2
-#define AALARM_WIRE_SYPHON 3
-#define AALARM_WIRE_AI_CONTROL 4
-#define AALARM_WIRE_AALARM 5
-
#define AALARM_MODE_SCRUBBING 1
#define AALARM_MODE_REPLACEMENT 2 //like scrubbing, but faster.
#define AALARM_MODE_PANIC 3 //constantly sucks all air
@@ -79,9 +53,10 @@
var/locked = 1
var/wiresexposed = 0 // If it's been screwdrivered open.
var/aidisabled = 0
- var/AAlarmwires = 31
var/shorted = 0
+ var/datum/wires/alarm/wires
+
var/mode = AALARM_MODE_SCRUBBING
var/screen = AALARM_SCREEN_MAIN
var/area_uid
@@ -153,6 +128,9 @@
if (name == "alarm")
name = "[alarm_area.name] Air Alarm"
+ if(!wires)
+ wires = new(src)
+
// breathable air according to human/Life()
TLV["oxygen"] = list(16, 19, 135, 140) // Partial pressure, kpa
TLV["carbon dioxide"] = list(-1.0, -1.0, 5, 10) // Partial pressure, kpa
@@ -482,125 +460,6 @@
frequency.post_signal(src, alert_signal)
-
-///////////
-//HACKING//
-///////////
-/obj/machinery/alarm/proc/isWireColorCut(var/wireColor)
- var/wireFlag = AAlarmWireColorToFlag[wireColor]
- return ((AAlarmwires & wireFlag) == 0)
-
-/obj/machinery/alarm/proc/isWireCut(var/wireIndex)
- var/wireFlag = AAlarmIndexToFlag[wireIndex]
- return ((AAlarmwires & wireFlag) == 0)
-
-/obj/machinery/alarm/proc/allWiresCut()
- var/i = 1
- while(i<=5)
- if(AAlarmwires & AAlarmIndexToFlag[i])
- return 0
- i++
- return 1
-
-/obj/machinery/alarm/proc/cut(var/wireColor)
- var/wireFlag = AAlarmWireColorToFlag[wireColor]
- var/wireIndex = AAlarmWireColorToIndex[wireColor]
- AAlarmwires &= ~wireFlag
- switch(wireIndex)
- if(AALARM_WIRE_IDSCAN)
- locked = 1
-
- if(AALARM_WIRE_POWER)
- shock(usr, 50)
- shorted = 1
- update_icon()
-
- if (AALARM_WIRE_AI_CONTROL)
- if (aidisabled == 0)
- aidisabled = 1
-
- if(AALARM_WIRE_SYPHON)
- mode = AALARM_MODE_PANIC
- apply_mode()
-
- if(AALARM_WIRE_AALARM)
-
- if (alarm_area.atmosalert(2))
- apply_danger_level(2)
- spawn(1)
- updateUsrDialog()
- update_icon()
-
- updateDialog()
-
- return
-
-/obj/machinery/alarm/proc/mend(var/wireColor)
- var/wireFlag = AAlarmWireColorToFlag[wireColor]
- var/wireIndex = AAlarmWireColorToIndex[wireColor] //not used in this function
- AAlarmwires |= wireFlag
- switch(wireIndex)
- if(AALARM_WIRE_IDSCAN)
-
- if(AALARM_WIRE_POWER)
- shorted = 0
- shock(usr, 50)
- update_icon()
-
- if(AALARM_WIRE_AI_CONTROL)
- if (aidisabled == 1)
- aidisabled = 0
-
- updateDialog()
- return
-
-/obj/machinery/alarm/proc/pulse(var/wireColor)
- //var/wireFlag = AAlarmWireColorToFlag[wireColor] //not used in this function
- var/wireIndex = AAlarmWireColorToIndex[wireColor]
- switch(wireIndex)
- if(AALARM_WIRE_IDSCAN) //unlocks for 30 seconds, if you have a better way to hack I'm all ears
- locked = 0
- spawn(300)
- locked = 1
-
- if (AALARM_WIRE_POWER)
- if(shorted == 0)
- shorted = 1
- update_icon()
-
- spawn(1200)
- if(shorted == 1)
- shorted = 0
- update_icon()
-
-
- if (AALARM_WIRE_AI_CONTROL)
- if (aidisabled == 0)
- aidisabled = 1
- updateDialog()
- spawn(10)
- if (aidisabled == 1)
- aidisabled = 0
- updateDialog()
-
- if(AALARM_WIRE_SYPHON)
- mode = AALARM_MODE_REPLACEMENT
- apply_mode()
-
- if(AALARM_WIRE_AALARM)
- if (alarm_area.atmosalert(0))
- apply_danger_level(0)
- spawn(1)
- updateUsrDialog()
- update_icon()
-
- updateDialog()
- return
-
-///////////////
-//END HACKING//
-///////////////
-
/obj/machinery/alarm/attack_ai(mob/user)
return interact(user)
@@ -616,7 +475,7 @@
if(buildstage!=2)
return
- if ( (get_dist(src, user) > 1 ))
+ if((get_dist(src, user) > 1 ))
if (!istype(user, /mob/living/silicon))
user.machine = null
user << browse(null, "window=air_alarm")
@@ -629,30 +488,8 @@
user << browse(null, "window=air_alarm")
return
- if(wiresexposed && (!istype(user, /mob/living/silicon)))
- var/t1 = text("
[alarm_area.name] Air Alarm WiresAccess Panel
\n")
- var/list/wirecolors = list(
- "Orange" = 1,
- "Dark red" = 2,
- "White" = 3,
- "Yellow" = 4,
- "Black" = 5,
- )
- for(var/wiredesc in wirecolors)
- var/is_uncut = AAlarmwires & AAlarmWireColorToFlag[wirecolors[wiredesc]]
- t1 += "[wiredesc] wire: "
- if(!is_uncut)
- t1 += "Mend"
-
- else
- t1 += "Cut "
- t1 += "Pulse "
-
- t1 += "
"
- t1 += text("
\n[(locked ? "The Air Alarm is locked." : "The Air Alarm is unlocked.")]
\n[((shorted || (stat & (NOPOWER|BROKEN))) ? "The Air Alarm is offline." : "The Air Alarm is working properly!")]
\n[(aidisabled ? "The 'AI control allowed' light is off." : "The 'AI control allowed' light is on.")]")
- t1 += text("Close
")
- user << browse(t1, "window=AAlarmwires")
- onclose(user, "AAlarmwires")
+ if(wiresexposed && (!istype(user, /mob/living/silicon/ai)))
+ wires.Interact(user)
if(!shorted)
user << browse(return_text(user),"window=air_alarm")
@@ -1055,35 +892,6 @@ table tr:first-child th:first-child { border: none;}
mode = text2num(href_list["mode"])
apply_mode()
- // hrefs that need the AA wires exposed, note that borgs should be in range here too -walter0o
- if(wiresexposed && Adjacent(usr))
-
- if (href_list["AAlarmwires"])
- var/t1 = text2num(href_list["AAlarmwires"])
- if (!( istype(usr.equipped(), /obj/item/weapon/wirecutters) ))
- usr << "You need wirecutters!"
- return
- if (isWireColorCut(t1))
- mend(t1)
- else
- cut(t1)
- if (AAlarmwires == 0)
- usr << "You cut last of wires inside [src]"
- update_icon()
- buildstage = 1
- return
-
- else if (href_list["pulse"])
- var/t1 = text2num(href_list["pulse"])
- if (!istype(usr.equipped(), /obj/item/device/multitool))
- usr << "You need a multitool!"
- return
- if (isWireColorCut(t1))
- usr << "You can't pulse a cut wire."
- return
- else
- pulse(t1)
-
updateUsrDialog()
@@ -1115,7 +923,7 @@ table tr:first-child th:first-child { border: none;}
user << "It does nothing"
return
else
- if(allowed(usr) && !isWireCut(AALARM_WIRE_IDSCAN))
+ if(allowed(usr) && !wires.IsIndexCut(AALARM_WIRE_IDSCAN))
locked = !locked
user << "\blue You [ locked ? "lock" : "unlock"] the Air Alarm interface."
updateUsrDialog()
@@ -1168,12 +976,12 @@ table tr:first-child th:first-child { border: none;}
spawn(rand(0,15))
update_icon()
-/obj/machinery/alarm/examine()
- ..()
+/obj/machinery/alarm/examine(mob/user)
+ ..(user)
if (buildstage < 2)
- usr << "It is not wired."
+ user << "It is not wired."
if (buildstage < 1)
- usr << "The circuit is missing."
+ user << "The circuit is missing."
/*
AIR ALARM CIRCUIT
Just a object used in constructing air alarms
@@ -1488,7 +1296,7 @@ FIRE ALARM
wiresexposed = 1
pixel_x = (dir & 3)? 0 : (dir == 4 ? -24 : 24)
pixel_y = (dir & 3)? (dir ==1 ? -24 : 24) : 0
-
+
/obj/machinery/firealarm/initialize()
if(z in config.contact_levels)
if(security_level)
diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm
index 1c99ff73448..ad7d55c2aa5 100644
--- a/code/game/machinery/atmoalter/meter.dm
+++ b/code/game/machinery/atmoalter/meter.dm
@@ -65,10 +65,10 @@
)
radio_connection.post_signal(src, signal)
-/obj/machinery/meter/examine()
+/obj/machinery/meter/examine(mob/user)
var/t = "A gas flow meter. "
- if(get_dist(usr, src) > 3 && !(istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/dead)))
+ if(get_dist(user, src) > 3 && !(istype(user, /mob/living/silicon/ai) || istype(user, /mob/dead)))
t += "\blue You are too far away to read it."
else if(stat & (NOPOWER|BROKEN))
@@ -83,12 +83,12 @@
else
t += "The connect error light is blinking."
- usr << t
+ user << t
/obj/machinery/meter/Click()
if(istype(usr, /mob/living/silicon/ai)) // ghosts can call ..() for examine
- examine()
+ usr.examinate(src)
return 1
return ..()
diff --git a/code/game/machinery/bots/bots.dm b/code/game/machinery/bots/bots.dm
index 9289c438e90..d41405aed36 100644
--- a/code/game/machinery/bots/bots.dm
+++ b/code/game/machinery/bots/bots.dm
@@ -43,14 +43,13 @@
emagged = 2
log_and_message_admins("emagged [src]'s inner circuits")
-/obj/machinery/bot/examine()
- set src in view()
- ..()
+/obj/machinery/bot/examine(mob/user)
+ ..(user)
if (src.health < maxhealth)
if (src.health > maxhealth/3)
- usr << "[src]'s parts look loose."
+ user << "[src]'s parts look loose."
else
- usr << "[src]'s parts look very loose!"
+ user << "[src]'s parts look very loose!"
return
/obj/machinery/bot/attack_animal(var/mob/living/simple_animal/M as mob)
diff --git a/code/game/machinery/bots/mulebot.dm b/code/game/machinery/bots/mulebot.dm
index ce76680b0d9..0ff1bec2775 100644
--- a/code/game/machinery/bots/mulebot.dm
+++ b/code/game/machinery/bots/mulebot.dm
@@ -93,7 +93,6 @@
suffix = "#[count]"
name = "Mulebot ([suffix])"
- verbs -= /atom/movable/verb/pull
// set up the wire colours in random order
diff --git a/code/game/machinery/camera/camera.dm b/code/game/machinery/camera/camera.dm
index 1c8298bd0ba..140659a0e51 100644
--- a/code/game/machinery/camera/camera.dm
+++ b/code/game/machinery/camera/camera.dm
@@ -19,11 +19,7 @@
var/obj/item/weapon/camera_assembly/assembly = null
// WIRES
- var/wires = 63 // 0b111111
- var/list/IndexToFlag = list()
- var/list/IndexToWireColor = list()
- var/list/WireColorToIndex = list()
- var/list/WireColorToFlag = list()
+ var/datum/wires/camera/wires = null // Wires datum
//OTHER
@@ -35,7 +31,7 @@
var/busy = 0
/obj/machinery/camera/New()
- WireColorToFlag = randomCameraWires()
+ wires = new(src)
assembly = new(src)
assembly.state = 4
/* // Use this to look for cameras that have the same c_tag.
@@ -115,7 +111,7 @@
else if((iswirecutter(W) || ismultitool(W)) && panel_open)
interact(user)
- else if(iswelder(W) && canDeconstruct())
+ else if(iswelder(W) && wires.CanDeconstruct())
if(weld(W, user))
if(assembly)
assembly.loc = src.loc
@@ -283,4 +279,11 @@
return 0
return 1
busy = 0
- return 0
\ No newline at end of file
+ return 0
+
+/obj/machinery/camera/interact(mob/living/user as mob)
+ if(!panel_open || istype(user, /mob/living/silicon/ai))
+ return
+
+ user.set_machine(src)
+ wires.Interact(user)
diff --git a/code/game/machinery/camera/wires.dm b/code/game/machinery/camera/wires.dm
deleted file mode 100644
index 785b33368a2..00000000000
--- a/code/game/machinery/camera/wires.dm
+++ /dev/null
@@ -1,169 +0,0 @@
-#define CAMERA_WIRE_FOCUS 1
-#define CAMERA_WIRE_POWER 2
-#define CAMERA_WIRE_LIGHT 3
-#define CAMERA_WIRE_ALARM 4
-#define CAMERA_WIRE_NOTHING1 5
-#define CAMERA_WIRE_NOTHING2 6
-
-/obj/machinery/camera/proc/randomCameraWires()
- //to make this not randomize the wires, just set index to 1 and increment it in the flag for loop (after doing everything else).
- var/list/wires = list(0, 0, 0, 0, 0, 0)
- IndexToFlag = list(0, 0, 0, 0, 0, 0)
- IndexToWireColor = list(0, 0, 0, 0, 0, 0)
- WireColorToIndex = list(0, 0, 0, 0, 0, 0)
- var/flagIndex = 1
- //I think it's easier to read this way, also doesn't rely on the random number generator to land on a new wire.
- var/list/colorIndexList = list(CAMERA_WIRE_FOCUS, CAMERA_WIRE_POWER, CAMERA_WIRE_LIGHT, CAMERA_WIRE_ALARM, CAMERA_WIRE_NOTHING1, CAMERA_WIRE_NOTHING2)
- for (var/flag=1, flag<=32, flag+=flag)
- var/colorIndex = pick(colorIndexList)
- if (wires[colorIndex]==0)
- wires[colorIndex] = flag
- IndexToFlag[flagIndex] = flag
- IndexToWireColor[flagIndex] = colorIndex
- WireColorToIndex[colorIndex] = flagIndex
- colorIndexList -= colorIndex // Shortens the list.
- //world.log << "Flag: [flag], CIndex: [colorIndex], FIndex: [flagIndex]"
- flagIndex+=1
- return wires
-
-/obj/machinery/camera/proc/isWireColorCut(var/wireColor)
- var/wireFlag = WireColorToFlag[wireColor]
- return ((src.wires & wireFlag) == 0)
-
-/obj/machinery/camera/proc/isWireCut(var/wireIndex)
- var/wireFlag = IndexToFlag[wireIndex]
- return ((src.wires & wireFlag) == 0)
-
-/obj/machinery/camera/proc/canDeconstruct()
- if(isWireCut(CAMERA_WIRE_POWER) && isWireCut(CAMERA_WIRE_FOCUS) && isWireCut(CAMERA_WIRE_LIGHT) && isWireCut(CAMERA_WIRE_NOTHING1) && isWireCut(CAMERA_WIRE_NOTHING2))
- return 1
- else
- return 0
-
-/obj/machinery/camera/proc/cut(var/wireColor)
- var/wireFlag = WireColorToFlag[wireColor]
- var/wireIndex = WireColorToIndex[wireColor]
- wires &= ~wireFlag
- switch(wireIndex)
- if(CAMERA_WIRE_FOCUS)
- setViewRange(short_range)
-
- if(CAMERA_WIRE_POWER)
- deactivate(usr, 1)
-
- if(CAMERA_WIRE_LIGHT)
- light_disabled = 1
-
- if(CAMERA_WIRE_ALARM)
- triggerCameraAlarm()
-
- src.interact(usr)
-
-/obj/machinery/camera/proc/mend(var/wireColor)
- var/wireFlag = WireColorToFlag[wireColor]
- var/wireIndex = WireColorToIndex[wireColor]
- wires |= wireFlag
- switch(wireIndex)
- if(CAMERA_WIRE_FOCUS)
- setViewRange(initial(view_range))
-
- if(CAMERA_WIRE_POWER)
- deactivate(usr, 1)
-
- if(CAMERA_WIRE_LIGHT)
- light_disabled = 0
-
- if(CAMERA_WIRE_ALARM)
- cancelCameraAlarm()
-
- src.interact(usr)
-
-
-/obj/machinery/camera/proc/pulse(var/wireColor)
- var/wireIndex = WireColorToIndex[wireColor]
- switch(wireIndex)
- if(CAMERA_WIRE_FOCUS)
- var/new_range = (view_range == initial(view_range) ? short_range : initial(view_range))
- setViewRange(new_range)
-
- if(CAMERA_WIRE_POWER)
- deactivate(usr, 0) // Kicks anyone watching the camera
-
- if(CAMERA_WIRE_LIGHT)
- light_disabled = !light_disabled
-
- if(CAMERA_WIRE_ALARM)
- src.visible_message("\icon[src] *beep*", "\icon[src] *beep*")
-
- src.interact(usr)
-
-/obj/machinery/camera/interact(mob/living/user as mob)
- if(!panel_open)
- return
-
- user.set_machine(src)
- var/t1 = text("Access Panel
\n")
- var/list/wires = list(
- "Orange" = 1,
- "Dark red" = 2,
- "White" = 3,
- "Yellow" = 4,
- "Blue" = 5,
- "Pink" = 6
- )
- for(var/wiredesc in wires)
- var/is_uncut = src.wires & WireColorToFlag[wires[wiredesc]]
- t1 += "[wiredesc] wire: "
- if(!is_uncut)
- t1 += "Mend"
- else
- t1 += "Cut "
- t1 += "Pulse "
- t1 += "
"
-
- t1 += "
\n[(src.view_range == initial(view_range) ? "The focus light is on." : "The focus light is off.")]"
- t1 += "
\n[(src.can_use() ? "The power link light is on." : "The power link light is off.")]"
- t1 += "
\n[(light_disabled ? "The camera light is off." : "The camera light is on.")]"
- t1 += "
\n[(alarm_on ? "The alarm light is on." : "The alarm light is off.")]"
-
- t1 += "Close
\n"
- user << browse(t1, "window=wires")
- onclose(user, "wires")
-
-
-
-/obj/machinery/camera/Topic(href, href_list)
- ..()
- if (in_range(src, usr) && istype(src.loc, /turf))
- usr.set_machine(src)
- if (href_list["wires"])
- var/t1 = text2num(href_list["wires"])
- if (!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) ))
- usr << "You need wirecutters!"
- return
- if (src.isWireColorCut(t1))
- src.mend(t1)
- else
- src.cut(t1)
- else if (href_list["pulse"])
- var/t1 = text2num(href_list["pulse"])
- if (!istype(usr.get_active_hand(), /obj/item/device/multitool))
- usr << "You need a multitool!"
- return
- if (src.isWireColorCut(t1))
- usr << "You can't pulse a cut wire."
- return
- else
- src.pulse(t1)
- else if (href_list["close2"])
- usr << browse(null, "window=wires")
- usr.unset_machine()
- return
-
-
-#undef CAMERA_WIRE_FOCUS
-#undef CAMERA_WIRE_POWER
-#undef CAMERA_WIRE_LIGHT
-#undef CAMERA_WIRE_ALARM
-#undef CAMERA_WIRE_NOTHING1
-#undef CAMERA_WIRE_NOTHING2
\ No newline at end of file
diff --git a/code/game/machinery/cell_charger.dm b/code/game/machinery/cell_charger.dm
index 4608944b5f2..171646c4b15 100644
--- a/code/game/machinery/cell_charger.dm
+++ b/code/game/machinery/cell_charger.dm
@@ -28,12 +28,13 @@
else
overlays.Cut()
-/obj/machinery/cell_charger/examine()
- set src in oview(5)
- ..()
- usr << "There's [charging ? "a" : "no"] cell in the charger."
+/obj/machinery/cell_charger/examine(mob/user)
+ if(!..(user, 5))
+ return
+
+ user << "There's [charging ? "a" : "no"] cell in the charger."
if(charging)
- usr << "Current charge: [charging.charge]"
+ user << "Current charge: [charging.charge]"
/obj/machinery/cell_charger/attackby(obj/item/weapon/W, mob/user)
if(stat & BROKEN)
diff --git a/code/game/machinery/cloning.dm b/code/game/machinery/cloning.dm
index 8084ab09ff0..dc1ee050aa8 100644
--- a/code/game/machinery/cloning.dm
+++ b/code/game/machinery/cloning.dm
@@ -96,10 +96,9 @@
src.read_only = !src.read_only
user << "You flip the write-protect tab to [src.read_only ? "protected" : "unprotected"]."
-/obj/item/weapon/disk/data/examine()
- set src in oview(5)
- ..()
- usr << text("The write-protect tab is set to [src.read_only ? "protected" : "unprotected"].")
+/obj/item/weapon/disk/data/examine(mob/user)
+ ..(user)
+ user << text("The write-protect tab is set to [src.read_only ? "protected" : "unprotected"].")
return
//Health Tracker Implant
diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm
index cf36af21c93..5c628354d14 100644
--- a/code/game/machinery/computer/aifixer.dm
+++ b/code/game/machinery/computer/aifixer.dm
@@ -36,7 +36,7 @@
if (src.occupant)
var/laws
- dat += "Stored AI: [src.occupant.name]
System integrity: [(src.occupant.health+100)/2]%
"
+ dat += "Stored AI: [src.occupant.name]
System integrity: [src.occupant.system_integrity()]%
"
for (var/law in occupant.laws.ion)
if(law)
diff --git a/code/game/machinery/constructable_frame.dm b/code/game/machinery/constructable_frame.dm
index 106cd2bbad2..4e5b64c631b 100644
--- a/code/game/machinery/constructable_frame.dm
+++ b/code/game/machinery/constructable_frame.dm
@@ -288,9 +288,9 @@ obj/item/weapon/circuitboard/rdserver
user.visible_message("\blue \The [user] adjusts the jumper on the [src]'s port configuration pins.", "\blue You adjust the jumper on the port configuration pins. Now set to [dir2text(machine_dir)].")
return
-/obj/item/weapon/circuitboard/unary_atmos/examine()
- ..()
- usr << "The jumper is connecting the [dir2text(machine_dir)] pins."
+/obj/item/weapon/circuitboard/unary_atmos/examine(mob/user)
+ ..(user)
+ user << "The jumper is connecting the [dir2text(machine_dir)] pins."
/obj/item/weapon/circuitboard/unary_atmos/construct(var/obj/machinery/atmospherics/unary/U)
//TODO: Move this stuff into the relevant constructor when pipe/construction.dm is cleaned up.
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index f542ff69943..aa38d07ead0 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -1,76 +1,3 @@
-#define AIRLOCK_WIRE_IDSCAN 1
-#define AIRLOCK_WIRE_MAIN_POWER1 2
-#define AIRLOCK_WIRE_MAIN_POWER2 3
-#define AIRLOCK_WIRE_DOOR_BOLTS 4
-#define AIRLOCK_WIRE_BACKUP_POWER1 5
-#define AIRLOCK_WIRE_BACKUP_POWER2 6
-#define AIRLOCK_WIRE_OPEN_DOOR 7
-#define AIRLOCK_WIRE_AI_CONTROL 8
-#define AIRLOCK_WIRE_ELECTRIFY 9
-#define AIRLOCK_WIRE_SAFETY 10
-#define AIRLOCK_WIRE_SPEED 11
-#define AIRLOCK_WIRE_LIGHT 12
-
-/*
- New methods:
- pulse - sends a pulse into a wire for hacking purposes
- cut - cuts a wire and makes any necessary state changes
- mend - mends a wire and makes any necessary state changes
- isWireColorCut - returns 1 if that color wire is cut, or 0 if not
- isWireCut - returns 1 if that wire (e.g. AIRLOCK_WIRE_DOOR_BOLTS) is cut, or 0 if not
- canAIControl - 1 if the AI can control the airlock, 0 if not (then check canAIHack to see if it can hack in)
- canAIHack - 1 if the AI can hack into the airlock to recover control, 0 if not. Also returns 0 if the AI does not *need* to hack it.
- arePowerSystemsOn - 1 if the main or backup power are functioning, 0 if not. Does not check whether the power grid is charged or an APC has equipment on or anything like that. (Check (stat & NOPOWER) for that)
- requiresIDs - 1 if the airlock is requiring IDs, 0 if not
- isAllPowerCut - 1 if the main and backup power both have cut wires.
- regainMainPower - handles the effect of main power coming back on.
- loseMainPower - handles the effect of main power going offline. Usually (if one isn't already running) spawn a thread to count down how long it will be offline - counting down won't happen if main power was completely cut along with backup power, though, the thread will just sleep.
- loseBackupPower - handles the effect of backup power going offline.
- regainBackupPower - handles the effect of main power coming back on.
- shock - has a chance of electrocuting its target.
-*/
-
-//This generates the randomized airlock wire assignments for the game.
-/proc/RandomAirlockWires()
- var/list/wire_assignments = CreateRandomAirlockWires()
-
- globalAirlockIndexToFlag = wire_assignments[2]
- globalAirlockIndexToWireColor = wire_assignments[3]
- globalAirlockWireColorToIndex = wire_assignments[4]
- return wire_assignments[1]
-
-/proc/CreateRandomAirlockWires()
- //to make this not randomize the wires, just set index to 1 and increment it in the flag for loop (after doing everything else).
- var/list/wires = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
- var/airlockIndexToFlag = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
- var/airlockIndexToWireColor = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
- var/airlockWireColorToIndex = list(0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0)
- var/flagIndex = 1
- for (var/flag=1, flag<4096, flag+=flag)
- var/valid = 0
- var/list/colorList = list(AIRLOCK_WIRE_IDSCAN, AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2, AIRLOCK_WIRE_DOOR_BOLTS,
- AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2, AIRLOCK_WIRE_OPEN_DOOR, AIRLOCK_WIRE_AI_CONTROL, AIRLOCK_WIRE_ELECTRIFY,
- AIRLOCK_WIRE_SAFETY, AIRLOCK_WIRE_SPEED, AIRLOCK_WIRE_LIGHT)
-
- while (!valid)
- var/colorIndex = pick(colorList)
- if(wires[colorIndex]==0)
- valid = 1
- wires[colorIndex] = flag
- airlockIndexToFlag[flagIndex] = flag
- airlockIndexToWireColor[flagIndex] = colorIndex
- airlockWireColorToIndex[colorIndex] = flagIndex
- colorList -= colorIndex
- flagIndex+=1
- return list(wires, airlockIndexToFlag, airlockIndexToWireColor, airlockWireColorToIndex)
-
-/* Example:
-Airlock wires color -> flag are { 64, 128, 256, 2, 16, 4, 8, 32, 1 }.
-Airlock wires color -> index are { 7, 8, 9, 2, 5, 3, 4, 6, 1 }.
-Airlock index -> flag are { 1, 2, 4, 8, 16, 32, 64, 128, 256 }.
-Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
-*/
-
/obj/machinery/door/airlock
name = "Airlock"
icon = 'icons/obj/doors/Doorint.dmi'
@@ -86,13 +13,11 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
var/welded = null
var/locked = 0
var/lights = 1 // bolt lights show by default
- var/wires = 4095
secondsElectrified = 0 //How many seconds remain until the door is no longer electrified. -1 if it is permanently electrified until someone fixes it.
var/aiDisabledIdScanner = 0
var/aiHacking = 0
var/obj/machinery/door/airlock/closeOther = null
var/closeOtherId = null
- var/list/signalers[12]
var/lockdownbyai = 0
autoclose = 1
var/assembly_type = /obj/structure/door_assembly
@@ -104,10 +29,7 @@ Airlock index -> wire color are { 9, 4, 6, 7, 5, 8, 1, 2, 3 }.
var/hasShocked = 0 //Prevents multiple shocks from happening
var/secured_wires = 0 //for mapping use
var/security_bolts = 0 //if 1, door bolts when broken
- var/list/airlockIndexToFlag
- var/list/airlockWireColorToFlag
- var/list/airlockIndexToWireColor
- var/list/airlockWireColorToIndex
+ var/datum/wires/airlock/wires = null
/obj/machinery/door/airlock/command
name = "Airlock"
@@ -379,176 +301,14 @@ About the new airlock wires panel:
/obj/machinery/door/airlock/bumpopen(mob/living/simple_animal/user as mob)
..(user)
-
-/obj/machinery/door/airlock/proc/pulse(var/wireColor)
- //var/wireFlag = airlockWireColorToFlag[wireColor] //not used in this function
- var/wireIndex = airlockWireColorToIndex[wireColor]
- switch(wireIndex)
- if(AIRLOCK_WIRE_IDSCAN)
- //Sending a pulse through this flashes the red light on the door (if the door has power).
- if((src.arePowerSystemsOn()) && (!(stat & NOPOWER)))
- 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).
- src.loseMainPower()
- if(AIRLOCK_WIRE_DOOR_BOLTS)
- //one wire for door bolts. Sending a pulse through this drops door bolts if they're not down (whether power's on or not),
- //raises them if they are down (only if power's on)
- if(!src.locked)
- src.lock()
- else
- src.unlock()
- src.updateUsrDialog()
-
- if(AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2)
- //two wires for backup power. Sending a pulse through either one causes a breaker to trip, but this does not disable it unless main power is down too (in which case it is disabled for 1 minute or however long it takes main power to come back, whichever is shorter).
- src.loseBackupPower()
- if(AIRLOCK_WIRE_AI_CONTROL)
- if(src.aiControlDisabled == 0)
- src.aiControlDisabled = 1
- else if(src.aiControlDisabled == -1)
- src.aiControlDisabled = 2
- src.updateDialog()
- spawn(10)
- if(src.aiControlDisabled == 1)
- src.aiControlDisabled = 0
- else if(src.aiControlDisabled == 2)
- src.aiControlDisabled = -1
- src.updateDialog()
- if(AIRLOCK_WIRE_ELECTRIFY)
- //one wire for electrifying the door. Sending a pulse through this electrifies the door for 30 seconds.
- if(src.secondsElectrified==0)
- shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])")
- usr.attack_log += text("\[[time_stamp()]\] Electrified the [name] at [x] [y] [z]")
- src.secondsElectrified = 30
- spawn(10)
- //TODO: Move this into process() and make pulsing reset secondsElectrified to 30
- while (src.secondsElectrified>0)
- src.secondsElectrified-=1
- if(src.secondsElectrified<0)
- src.secondsElectrified = 0
-// src.updateUsrDialog() //Commented this line out to keep the airlock from clusterfucking you with electricity. --NeoFite
- sleep(10)
- if(AIRLOCK_WIRE_OPEN_DOOR)
- //tries to open the door without ID
- //will succeed only if the ID wire is cut or the door requires no access
- if(!src.requiresID() || src.check_access(null))
- if(density) open()
- else close()
- if(AIRLOCK_WIRE_SAFETY)
- safe = !safe
- if(!src.density)
- close()
- src.updateUsrDialog()
-
- if(AIRLOCK_WIRE_SPEED)
- normalspeed = !normalspeed
- src.updateUsrDialog()
-
- if(AIRLOCK_WIRE_LIGHT)
- lights = !lights
- src.updateUsrDialog()
-
-
-/obj/machinery/door/airlock/proc/cut(var/wireColor)
- var/wireFlag = airlockWireColorToFlag[wireColor]
- var/wireIndex = airlockWireColorToIndex[wireColor]
- wires &= ~wireFlag
- switch(wireIndex)
- if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2)
- //Cutting either one disables the main door power, but unless backup power is also cut, the backup power re-powers the door in 10 seconds. While unpowered, the door may be crowbarred open, but bolts-raising will not work. Cutting these wires may electocute the user.
- src.loseMainPower()
- src.shock(usr, 50)
- src.updateUsrDialog()
- if(AIRLOCK_WIRE_DOOR_BOLTS)
- //Cutting this wire also drops the door bolts, and mending it does not raise them. (This is what happens now, except there are a lot more wires going to door bolts at present)
- src.lock()
- src.updateUsrDialog()
- if(AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2)
- //Cutting either one disables the backup door power (allowing it to be crowbarred open, but disabling bolts-raising), but may electocute the user.
- src.loseBackupPower()
- src.shock(usr, 50)
- src.updateUsrDialog()
- if(AIRLOCK_WIRE_AI_CONTROL)
- //one wire for AI control. Cutting this prevents the AI from controlling the door unless it has hacked the door through the power connection (which takes about a minute). If both main and backup power are cut, as well as this wire, then the AI cannot operate or hack the door at all.
- //aiControlDisabled: If 1, AI control is disabled until the AI hacks back in and disables the lock. If 2, the AI has bypassed the lock. If -1, the control is enabled but the AI had bypassed it earlier, so if it is disabled again the AI would have no trouble getting back in.
- if(src.aiControlDisabled == 0)
- src.aiControlDisabled = 1
- else if(src.aiControlDisabled == -1)
- src.aiControlDisabled = 2
- src.updateUsrDialog()
- if(AIRLOCK_WIRE_ELECTRIFY)
- //Cutting this wire electrifies the door, so that the next person to touch the door without insulated gloves gets electrocuted.
- if(src.secondsElectrified != -1)
- shockedby += text("\[[time_stamp()]\][usr](ckey:[usr.ckey])")
- usr.attack_log += text("\[[time_stamp()]\] Electrified the [name] at [x] [y] [z]")
- src.secondsElectrified = -1
- if (AIRLOCK_WIRE_SAFETY)
- safe = 0
- src.updateUsrDialog()
-
- if(AIRLOCK_WIRE_SPEED)
- autoclose = 0
- src.updateUsrDialog()
-
- if(AIRLOCK_WIRE_LIGHT)
- lights = 0
- src.updateUsrDialog()
-
-/obj/machinery/door/airlock/proc/mend(var/wireColor)
- var/wireFlag = airlockWireColorToFlag[wireColor]
- var/wireIndex = airlockWireColorToIndex[wireColor] //not used in this function
- wires |= wireFlag
- switch(wireIndex)
- if(AIRLOCK_WIRE_MAIN_POWER1, AIRLOCK_WIRE_MAIN_POWER2)
- if((!src.isWireCut(AIRLOCK_WIRE_MAIN_POWER1)) && (!src.isWireCut(AIRLOCK_WIRE_MAIN_POWER2)))
- src.regainMainPower()
- src.shock(usr, 50)
- src.updateUsrDialog()
- if(AIRLOCK_WIRE_BACKUP_POWER1, AIRLOCK_WIRE_BACKUP_POWER2)
- if((!src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER1)) && (!src.isWireCut(AIRLOCK_WIRE_BACKUP_POWER2)))
- src.regainBackupPower()
- src.shock(usr, 50)
- src.updateUsrDialog()
- if(AIRLOCK_WIRE_AI_CONTROL)
- //one wire for AI control. Cutting this prevents the AI from controlling the door unless it has hacked the door through the power connection (which takes about a minute). If both main and backup power are cut, as well as this wire, then the AI cannot operate or hack the door at all.
- //aiControlDisabled: If 1, AI control is disabled until the AI hacks back in and disables the lock. If 2, the AI has bypassed the lock. If -1, the control is enabled but the AI had bypassed it earlier, so if it is disabled again the AI would have no trouble getting back in.
- if(src.aiControlDisabled == 1)
- src.aiControlDisabled = 0
- else if(src.aiControlDisabled == 2)
- src.aiControlDisabled = -1
- src.updateUsrDialog()
- if(AIRLOCK_WIRE_ELECTRIFY)
- if(src.secondsElectrified == -1)
- src.secondsElectrified = 0
-
- if (AIRLOCK_WIRE_SAFETY)
- safe = 1
- src.updateUsrDialog()
-
- if(AIRLOCK_WIRE_SPEED)
- autoclose = 1
- if(!src.density)
- close()
- src.updateUsrDialog()
-
- if(AIRLOCK_WIRE_LIGHT)
- lights = 1
- src.updateUsrDialog()
-
-
/obj/machinery/door/airlock/proc/isElectrified()
if(src.secondsElectrified != 0)
return 1
return 0
-/obj/machinery/door/airlock/proc/isWireColorCut(var/wireColor)
- var/wireFlag = airlockWireColorToFlag[wireColor]
- return ((src.wires & wireFlag) == 0)
-
/obj/machinery/door/airlock/proc/isWireCut(var/wireIndex)
- var/wireFlag = airlockIndexToFlag[wireIndex]
- return ((src.wires & wireFlag) == 0)
+ // You can find the wires in the datum folder.
+ return wires.IsIndexCut(wireIndex)
/obj/machinery/door/airlock/proc/canAIControl()
return ((src.aiControlDisabled!=1) && (!src.isAllPowerLoss()));
@@ -874,46 +634,8 @@ About the new airlock wires panel:
**/
if(src.p_open)
-
user.set_machine(src)
- var/t1 = text("Access Panel
\n")
-
- //t1 += text("[]: ", airlockFeatureNames[airlockWireColorToIndex[9]])
- var/list/wires = list(
- "Orange" = 1,
- "Dark red" = 2,
- "White" = 3,
- "Yellow" = 4,
- "Red" = 5,
- "Blue" = 6,
- "Green" = 7,
- "Grey" = 8,
- "Black" = 9,
- "Gold" = 10,
- "Aqua" = 11,
- "Pink" = 12
- )
- for(var/wiredesc in wires)
- var/is_uncut = src.wires & airlockWireColorToFlag[wires[wiredesc]]
- t1 += "[wiredesc] wire: "
- if(!is_uncut)
- t1 += "Mend"
- else
- t1 += "Cut "
- t1 += "Pulse "
- if(src.signalers[wires[wiredesc]])
- t1 += "Detach signaler"
- else
- t1 += "Attach signaler"
- t1 += "
"
-
- t1 += text("
\n[]
\n[]
\n[]
\n[]
\n[]
\n[]", (src.locked ? "The door bolts have fallen!" : "The door bolts look up."), (src.lights ? "The door bolt lights are on." : "The door bolt lights are off!"), ((src.arePowerSystemsOn()) ? "The test light is on." : "The test light is off!"), (src.aiControlDisabled==0 ? "The 'AI control allowed' light is on." : "The 'AI control allowed' light is off."), (src.safe==0 ? "The 'Check Wiring' light is on." : "The 'Check Wiring' light is off."), (src.normalspeed==0 ? "The 'Check Timing Mechanism' light is on." : "The 'Check Timing Mechanism' light is off."))
-
- t1 += text("Close
\n", src)
-
- user << browse(t1, "window=airlock")
- onclose(user, "airlock")
-
+ wires.Interact(user)
else
..(user)
return
@@ -934,69 +656,21 @@ About the new airlock wires panel:
return 1
/obj/machinery/door/airlock/Topic(href, href_list, var/nowindow = 0)
- if(!nowindow)
- ..()
- if(usr.stat || usr.restrained()|| usr.small)
- return
- add_fingerprint(usr)
+ if(..())
+ return 1
+
if(href_list["close"])
usr << browse(null, "window=airlock")
if(usr.machine==src)
usr.unset_machine()
- return
+ return 1
if((in_range(src, usr) && istype(src.loc, /turf)) && src.p_open)
usr.set_machine(src)
- if(href_list["wires"])
- var/t1 = text2num(href_list["wires"])
- if(!( istype(usr.get_active_hand(), /obj/item/weapon/wirecutters) ))
- usr << "You need wirecutters!"
- return
- if(src.isWireColorCut(t1))
- src.mend(t1)
- else
- src.cut(t1)
- else if(href_list["pulse"])
- var/t1 = text2num(href_list["pulse"])
- if(!istype(usr.get_active_hand(), /obj/item/device/multitool))
- usr << "You need a multitool!"
- return
- if(src.isWireColorCut(t1))
- usr << "You can't pulse a cut wire."
- return
- else
- src.pulse(t1)
- else if(href_list["signaler"])
- var/wirenum = text2num(href_list["signaler"])
- if(!istype(usr.get_active_hand(), /obj/item/device/assembly/signaler))
- usr << "You need a signaller!"
- return
- if(src.isWireColorCut(wirenum))
- usr << "You can't attach a signaller to a cut wire."
- return
- var/obj/item/device/assembly/signaler/R = usr.get_active_hand()
- if(R.secured)
- usr << "This radio can't be attached!"
- return
- var/mob/M = usr
- M.drop_item()
- R.loc = src
- R.airlock_wire = wirenum
- src.signalers[wirenum] = R
- else if(href_list["remove-signaler"])
- var/wirenum = text2num(href_list["remove-signaler"])
- if(!(src.signalers[wirenum]))
- usr << "There's no signaller attached to that wire!"
- return
- var/obj/item/device/assembly/signaler/R = src.signalers[wirenum]
- R.loc = usr.loc
- R.airlock_wire = null
- src.signalers[wirenum] = null
-
if(istype(usr, /mob/living/silicon))
if (!check_synth_access(usr))
- return
+ return 1
//AI
//aiDisable - 1 idscan, 2 disrupt main power, 3 disrupt backup power, 4 drop door bolts, 5 un-electrify door, 7 close door, 8 door safties, 9 door speed
@@ -1032,8 +706,8 @@ About the new airlock wires panel:
else if(src.locked)
usr << "The door bolts are already dropped."
else
- src.lock()
- usr << "The door bolts have been dropped."
+ if(src.lock())
+ usr << "The door bolts have been dropped."
if(5)
//un-electrify door
if(src.isWireCut(AIRLOCK_WIRE_ELECTRIFY))
@@ -1172,7 +846,7 @@ About the new airlock wires panel:
update_icon()
if(!nowindow)
updateUsrDialog()
- return
+ return 0
/obj/machinery/door/airlock/attackby(C as obj, mob/user as mob)
//world << text("airlock attackby src [] obj [] mob []", src, C, user)
@@ -1372,12 +1046,13 @@ About the new airlock wires panel:
return
/obj/machinery/door/airlock/proc/lock(var/forced=0)
- if (operating || src.locked) return
+ if (operating || src.locked) return 0
src.locked = 1
for(var/mob/M in range(1,src))
M.show_message("You hear a click from the bottom of the door.", 2)
update_icon()
+ return 1
/obj/machinery/door/airlock/proc/unlock(var/forced=0)
if (operating || !src.locked) return
@@ -1394,13 +1069,10 @@ About the new airlock wires panel:
..()
//wires
- if (!secured_wires)
- airlockWireColorToFlag = globalAirlockWireColorToFlag
- airlockIndexToFlag = globalAirlockIndexToFlag
- airlockIndexToWireColor = globalAirlockIndexToWireColor
- airlockWireColorToIndex = globalAirlockWireColorToIndex
+ if (secured_wires)
+ wires = new/datum/wires/airlock/secure(src)
else
- randomize_wires()
+ wires = new/datum/wires/airlock(src)
if(src.closeOtherId != null)
spawn (5)
@@ -1409,18 +1081,13 @@ About the new airlock wires panel:
src.closeOther = A
break
-/obj/machinery/door/airlock/proc/randomize_wires()
- var/wire_assignments = CreateRandomAirlockWires()
- airlockWireColorToFlag = wire_assignments[1]
- airlockIndexToFlag = wire_assignments[2]
- airlockIndexToWireColor = wire_assignments[3]
- airlockWireColorToIndex = wire_assignments[4]
-
-
/obj/machinery/door/airlock/power_change() //putting this is obj/machinery/door itself makes non-airlock doors turn invisible for some reason
..()
update_icon()
+/obj/machinery/door/airlock/proc/hasPower()
+ return ((src.secondsMainPowerLost==0 || src.secondsBackupPowerLost==0) && !(stat & NOPOWER))
+
/obj/machinery/door/airlock/proc/prison_open()
src.unlock()
src.open()
diff --git a/code/game/machinery/doors/firedoor.dm b/code/game/machinery/doors/firedoor.dm
index 88c97b9bf44..1335f4c2f80 100644
--- a/code/game/machinery/doors/firedoor.dm
+++ b/code/game/machinery/doors/firedoor.dm
@@ -2,7 +2,7 @@
/var/const/CLOSED = 2
#define FIREDOOR_MAX_PRESSURE_DIFF 25 // kPa
-#define FIREDOOR_MAX_TEMP 50 // °C
+#define FIREDOOR_MAX_TEMP 50 // °C
#define FIREDOOR_MIN_TEMP 0
// Bitflags
@@ -72,17 +72,14 @@
. = ..()
-/obj/machinery/door/firedoor/examine()
- set src in view()
- . = ..()
-
- if(get_dist(src, usr) > 1 && !isAI(usr))
+/obj/machinery/door/firedoor/examine(mob/user)
+ if(!..(user, 1) && !isAI(user))
return
if(pdiff >= FIREDOOR_MAX_PRESSURE_DIFF)
- usr << "WARNING: Current pressure differential is [pdiff]kPa! Opening door may result in injury!"
+ user << "WARNING: Current pressure differential is [pdiff]kPa! Opening door may result in injury!"
- usr << "Sensor readings:"
+ user << "Sensor readings:"
for(var/index = 1; index <= tile_info.len; index++)
var/o = " "
switch(index)
@@ -96,7 +93,7 @@
o += "WEST: "
if(tile_info[index] == null)
o += "DATA UNAVAILABLE"
- usr << o
+ user << o
continue
var/celsius = convert_k2c(tile_info[index][1])
var/pressure = tile_info[index][2]
@@ -107,14 +104,14 @@
o += "[celsius]°C "
o += ""
o += "[pressure]kPa"
- usr << o
+ user << o
if(islist(users_to_open) && users_to_open.len)
var/users_to_open_string = users_to_open[1]
if(users_to_open.len >= 2)
for(var/i = 2 to users_to_open.len)
users_to_open_string += ", [users_to_open[i]]"
- usr << "These people have opened \the [src] during an alert: [users_to_open_string]."
+ user << "These people have opened \the [src] during an alert: [users_to_open_string]."
/obj/machinery/door/firedoor/Bumped(atom/AM)
if(p_open || operating)
diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm
index e677e6e8be9..63ad92f017d 100644
--- a/code/game/machinery/iv_drip.dm
+++ b/code/game/machinery/iv_drip.dm
@@ -146,12 +146,11 @@
mode = !mode
usr << "The IV drip is now [mode ? "injecting" : "taking blood"]."
-/obj/machinery/iv_drip/examine()
- set src in view()
- ..()
- if (!(usr in view(2)) && usr!=src.loc) return
+/obj/machinery/iv_drip/examine(mob/user)
+ ..(user)
+ if (!(user in view(2)) && user!=src.loc) return
- usr << "The IV drip is [mode ? "injecting" : "taking blood"]."
+ user << "The IV drip is [mode ? "injecting" : "taking blood"]."
if(beaker)
if(beaker.reagents && beaker.reagents.reagent_list.len)
diff --git a/code/game/machinery/kitchen/smartfridge.dm b/code/game/machinery/kitchen/smartfridge.dm
index ef62417b694..2350b8120cb 100644
--- a/code/game/machinery/kitchen/smartfridge.dm
+++ b/code/game/machinery/kitchen/smartfridge.dm
@@ -23,13 +23,22 @@
var/locked = 0
var/panel_open = 0 //Hacking a smartfridge
var/scan_id = 1
+ var/is_secure = 0
var/datum/wires/smartfridge/wires = null
+/obj/machinery/smartfridge/secure/
+ is_secure = 1
+
/obj/machinery/smartfridge/New()
- wires = new(src)
+ ..()
+ if(is_secure)
+ wires = new/datum/wires/smartfridge/secure(src)
+ else
+ wires = new/datum/wires/smartfridge(src)
/obj/machinery/smartfridge/Del()
del(wires) // qdel
+ ..()
/obj/machinery/smartfridge/proc/accept_check(var/obj/item/O as obj)
if(istype(O,/obj/item/weapon/reagent_containers/food/snacks/grown/) || istype(O,/obj/item/seeds/))
@@ -217,12 +226,7 @@
/obj/machinery/smartfridge/attack_hand(mob/user as mob)
if(!ispowered) return
- if(seconds_electrified != 0)
- if(shock(user, 100))
- return
- if(panel_open)
- wires.Interact(user)
-
+ wires.Interact(user)
ui_interact(user)
/*******************
@@ -232,12 +236,8 @@
/obj/machinery/smartfridge/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
user.set_machine(src)
- var/is_secure = istype(src,/obj/machinery/smartfridge/secure)
-
var/data[0]
data["contents"] = null
- data["wires"] = null
- data["panel_open"] = panel_open
data["electrified"] = seconds_electrified > 0
data["shoot_inventory"] = shoot_inventory
data["locked"] = locked
diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm
index f75ebc4171c..f7c1bcfa8f3 100644
--- a/code/game/machinery/lightswitch.dm
+++ b/code/game/machinery/lightswitch.dm
@@ -37,10 +37,9 @@
else
icon_state = "light0"
-/obj/machinery/light_switch/examine()
- set src in oview(1)
- if(usr && !usr.stat)
- usr << "A light switch. It is [on? "on" : "off"]."
+/obj/machinery/light_switch/examine(mob/user)
+ if(..(user, 1))
+ user << "A light switch. It is [on? "on" : "off"]."
/obj/machinery/light_switch/attack_paw(mob/user)
diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm
index 77b20f0d3f2..3f08862d9a1 100644
--- a/code/game/machinery/machinery.dm
+++ b/code/game/machinery/machinery.dm
@@ -192,7 +192,8 @@ Class Procs:
return (stat & (NOPOWER|BROKEN|additional_flags))
/obj/machinery/Topic(href, href_list)
- ..()
+ if(..())
+ return 1
if(inoperable())
return 1
if(usr.restrained() || usr.lying || usr.stat)
diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm
index 165602fabb0..c9a1ddb6576 100644
--- a/code/game/machinery/newscaster.dm
+++ b/code/game/machinery/newscaster.dm
@@ -7,36 +7,35 @@
var/body =""
var/message_type ="Story"
var/datum/feed_channel/parent_channel
- var/backup_body =""
- var/backup_author =""
var/is_admin_message = 0
var/icon/img = null
- var/icon/backup_img
+ var/icon/caption = ""
+ var/time_stamp = ""
+ var/backup_body = ""
+ var/backup_author = ""
+ var/icon/backup_img = null
+ var/icon/backup_caption = ""
/datum/feed_channel
var/channel_name=""
var/list/datum/feed_message/messages = list()
- //var/message_count = 0
var/locked=0
var/author=""
var/backup_author=""
var/censored=0
var/is_admin_channel=0
var/updated = 0
- //var/page = null //For newspapers
-
-/datum/feed_channel/proc/announce_news()
- return "Breaking news from [channel_name]!"
-
-/datum/feed_channel/station/announce_news()
- return "New Station Announcement Available"
+ var/announcement = ""
/datum/feed_message/proc/clear()
src.author = ""
src.body = ""
+ src.caption = ""
+ src.img = null
+ src.time_stamp = ""
src.backup_body = ""
src.backup_author = ""
- src.img = null
+ src.backup_caption = ""
src.backup_img = null
parent_channel.update()
@@ -51,24 +50,49 @@
src.backup_author = ""
src.censored = 0
src.is_admin_channel = 0
+ src.announcement = ""
update()
/datum/feed_network
var/list/datum/feed_channel/network_channels = list()
var/datum/feed_message/wanted_issue
-/datum/feed_network/proc/add_news(var/channel_name, var/datum/feed_message/newMsg)
- for(var/datum/feed_channel/FC in news_network.network_channels)
+/datum/feed_network/New()
+ CreateFeedChannel("Station Announcements", "SS13", 1, 1, "New Station Announcement Available")
+
+/datum/feed_network/proc/CreateFeedChannel(var/channel_name, var/author, var/locked, var/adminChannel = 0, var/announcement_message)
+ var/datum/feed_channel/newChannel = new /datum/feed_channel
+ newChannel.channel_name = channel_name
+ newChannel.author = author
+ newChannel.locked = locked
+ newChannel.is_admin_channel = adminChannel
+ if(announcement_message)
+ newChannel.announcement = announcement_message
+ else
+ newChannel.announcement = "Breaking news from [channel_name]!"
+ network_channels += newChannel
+
+/datum/feed_network/proc/SubmitArticle(var/msg, var/author, var/channel_name, var/obj/item/weapon/photo/photo, var/adminMessage = 0, var/message_type = "")
+ var/datum/feed_message/newMsg = new /datum/feed_message
+ newMsg.author = author
+ newMsg.body = msg
+ newMsg.time_stamp = "[worldtime2text()]"
+ newMsg.is_admin_message = adminMessage
+ if(message_type)
+ newMsg.message_type = message_type
+ if(photo)
+ newMsg.img = photo.img
+ newMsg.caption = photo.scribble
+ for(var/datum/feed_channel/FC in network_channels)
if(FC.channel_name == channel_name)
- insert_message_in_channel(FC, newMsg)
+ insert_message_in_channel(FC, newMsg) //Adding message to the network's appropriate feed_channel
break
/datum/feed_network/proc/insert_message_in_channel(var/datum/feed_channel/FC, var/datum/feed_message/newMsg)
- FC.messages += newMsg //Adding message to the network's appropriate feed_channel
+ FC.messages += newMsg
newMsg.parent_channel = FC
FC.update()
- var/announcement = FC.announce_news()
- alert_readers(announcement)
+ alert_readers(FC.announcement)
/datum/feed_network/proc/alert_readers(var/annoncement)
for(var/obj/machinery/newscaster/NEWSCASTER in allCasters)
@@ -135,7 +159,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
// 1 = there has
var/scanned_user = "Unknown" //Will contain the name of the person who currently uses the newscaster
var/msg = ""; //Feed message
- var/obj/item/weapon/photo/photo = null
+ var/datum/news_photo/photo_data = null
var/channel_name = ""; //the feed channel which will be receiving the feed, or being created
var/c_locked=0; //Will our new channel be locked to public submissions?
var/hitstaken = 0 //Death at 3 hits from an item with force>=15
@@ -260,14 +284,6 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
dat+="[CHANNEL.channel_name]
"
else
dat+="[CHANNEL.channel_name] [(CHANNEL.censored) ? ("***") : ()]
"
- /*for(var/datum/feed_channel/CHANNEL in src.channel_list)
- dat+="[CHANNEL.channel_name]:
\[created by: [CHANNEL.author]\]
"
- if( isemptylist(CHANNEL.messages) )
- dat+="No feed messages found in channel...
"
- else
- for(var/datum/feed_message/MESSAGE in CHANNEL.messages)
- dat+="-[MESSAGE.body]
\[[MESSAGE.message_type] by [MESSAGE.author]\]
"*/
-
dat+="
Refresh"
dat+="
Back"
if(2)
@@ -281,7 +297,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
dat+="
Receiving Channel: [src.channel_name]
" //MARK
dat+="Message Author: [src.scanned_user]
"
dat+="Message Body: [src.msg]
"
- dat+="Attach Photo: [(src.photo ? "Photo Attached" : "No Photo")]"
+ dat+="Attach Photo: [(src.photo_data ? "Photo Attached" : "No Photo")]"
dat+="
Submit
Cancel
"
if(4)
dat+="Feed story successfully submitted to [src.channel_name].
"
@@ -301,10 +317,8 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
dat+="
Return
"
if(7)
dat+="ERROR: Could not submit Feed Channel to Network.
"
- //var/list/existing_channels = list() //Let's get dem existing channels - OBSOLETE
var/list/existing_authors = list()
for(var/datum/feed_channel/FC in news_network.network_channels)
- //existing_channels += FC.channel_name //OBSOLETE
if(FC.author == "\[REDACTED\]")
existing_authors += FC.backup_author
else
@@ -351,8 +365,11 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
dat+="-[MESSAGE.body]
"
if(MESSAGE.img)
usr << browse_rsc(MESSAGE.img, "tmp_photo[i].png")
- dat+="
"
- dat+="\[[MESSAGE.message_type] by [MESSAGE.author]\]
"
+ dat+="
"
+ if(MESSAGE.caption)
+ dat+="[MESSAGE.caption]
"
+ dat+="
"
+ dat+="\[Story by [MESSAGE.author] - [MESSAGE.time_stamp]\]
"
dat+="
Refresh"
dat+="
Back"
if(10)
@@ -417,7 +434,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
dat+="
"
dat+="Criminal Name: [src.channel_name]
"
dat+="Description: [src.msg]
"
- dat+="Attach Photo: [(src.photo ? "Photo Attached" : "No Photo")]"
+ dat+="Attach Photo: [(src.photo_data ? "Photo Attached" : "No Photo")]"
if(wanted_already)
dat+="Wanted Issue created by: [news_network.wanted_issue.backup_author]
"
else
@@ -468,14 +485,6 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
human_or_robot_user << browse(dat, "window=newscaster_main;size=400x600")
onclose(human_or_robot_user, "newscaster_main")
- /*if(src.isbroken) //debugging shit
- return
- src.hitstaken++
- if(src.hitstaken==3)
- src.isbroken = 1
- src.update_icon()*/
-
-
/obj/machinery/newscaster/Topic(href, href_list)
if(..())
return
@@ -512,14 +521,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
else
var/choice = alert("Please confirm Feed channel creation","Network Channel Handler","Confirm","Cancel")
if(choice=="Confirm")
- var/datum/feed_channel/newChannel = new /datum/feed_channel
- newChannel.channel_name = src.channel_name
- newChannel.author = src.scanned_user
- newChannel.locked = c_locked
- feedback_inc("newscaster_channels",1)
- /*for(var/obj/machinery/newscaster/NEWSCASTER in allCasters) //Let's add the new channel in all casters.
- NEWSCASTER.channel_list += newChannel*/ //Now that it is sane, get it into the list. -OBSOLETE
- news_network.network_channels += newChannel //Adding channel to the global network
+ news_network.CreateFeedChannel(src.channel_name, src.scanned_user, c_locked)
src.screen=5
src.updateUsrDialog()
//src.update_icon()
@@ -547,13 +549,9 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
if(src.msg =="" || src.msg=="\[REDACTED\]" || src.scanned_user == "Unknown" || src.channel_name == "" )
src.screen=6
else
- var/datum/feed_message/newMsg = new /datum/feed_message
- newMsg.author = src.scanned_user
- newMsg.body = src.msg
- if(photo)
- newMsg.img = photo.img
+ var/image = photo_data ? photo_data.photo : null
feedback_inc("newscaster_stories",1)
- news_network.add_news(src.channel_name, newMsg)
+ news_network.SubmitArticle(src.msg, src.scanned_user, src.channel_name, image, 0)
src.screen=4
src.updateUsrDialog()
@@ -620,8 +618,8 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
WANTED.author = src.channel_name
WANTED.body = src.msg
WANTED.backup_author = src.scanned_user //I know, a bit wacky
- if(photo)
- WANTED.img = photo.img
+ if(photo_data)
+ WANTED.img = photo_data.photo.img
news_network.wanted_issue = WANTED
news_network.alert_readers()
src.screen = 15
@@ -632,8 +630,8 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
news_network.wanted_issue.author = src.channel_name
news_network.wanted_issue.body = src.msg
news_network.wanted_issue.backup_author = src.scanned_user
- if(photo)
- news_network.wanted_issue.img = photo.img
+ if(photo_data)
+ news_network.wanted_issue.img = photo_data.photo.img
src.screen = 19
src.updateUsrDialog()
@@ -684,16 +682,18 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
if(MSG.is_admin_message)
alert("This channel was created by a Nanotrasen Officer. You cannot censor it.","Ok")
return
- if(MSG.img != null)
- MSG.backup_img = MSG.img
- MSG.img = null
- else
- MSG.img = MSG.backup_img
if(MSG.body != "\[REDACTED\]")
MSG.backup_body = MSG.body
+ MSG.backup_caption = MSG.caption
+ MSG.backup_img = MSG.img
MSG.body = "\[REDACTED\]"
+ MSG.caption = "\[REDACTED\]"
+ MSG.img = null
else
MSG.body = MSG.backup_body
+ MSG.caption = MSG.caption
+ MSG.img = MSG.backup_img
+
MSG.parent_channel.update()
src.updateUsrDialog()
@@ -744,19 +744,6 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
/obj/machinery/newscaster/attackby(obj/item/I as obj, mob/user as mob)
-
-/* if (istype(I, /obj/item/weapon/card/id) || istype(I, /obj/item/device/pda) ) //Name verification for channels or messages
- if(src.screen == 4 || src.screen == 5)
- if( istype(I, /obj/item/device/pda) )
- var/obj/item/device/pda/P = I
- if(P.id)
- src.scanned_user = "[P.id.registered_name] ([P.id.assignment])"
- src.screen=2
- else
- var/obj/item/weapon/card/id/T = I
- src.scanned_user = text("[T.registered_name] ([T.assignment])")
- src.screen=2*/ //Obsolete after autorecognition
-
if (src.isbroken)
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 100, 1)
for (var/mob/O in hearers(5, src.loc))
@@ -791,25 +778,34 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
user << "The newscaster controls are far too complicated for your tiny brain!"
return
+/datum/news_photo
+ var/is_synth = 0
+ var/obj/item/weapon/photo/photo = null
+
+/datum/news_photo/New(var/obj/item/weapon/photo/p, var/synth)
+ is_synth = synth
+ photo = p
+
/obj/machinery/newscaster/proc/AttachPhoto(mob/user as mob)
- if(photo)
- if(!issilicon(user))
- photo.loc = src.loc
- user.put_in_inactive_hand(photo)
- photo = null
+ if(photo_data)
+ if(!photo_data.is_synth)
+ photo_data.photo.loc = src.loc
+ if(!issilicon(user))
+ user.put_in_inactive_hand(photo_data.photo)
+ del(photo_data)
+
if(istype(user.get_active_hand(), /obj/item/weapon/photo))
- photo = user.get_active_hand()
+ var/obj/item/photo = user.get_active_hand()
user.drop_item()
photo.loc = src
+ photo_data = new(photo, 0)
else if(istype(user,/mob/living/silicon))
var/mob/living/silicon/tempAI = user
- var/datum/picture/selection = tempAI.GetPicture()
+ var/obj/item/weapon/photo/selection = tempAI.GetPicture()
if (!selection)
return
- var/obj/item/weapon/photo/P = new/obj/item/weapon/photo()
- P.construct(selection)
- photo = P
+ photo_data = new(selection, 1)
//########################################################################################################################
@@ -831,10 +827,6 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
var/scribble=""
var/scribble_page = null
-/*obj/item/weapon/newspaper/attack_hand(mob/user as mob)
- ..()
- world << "derp"*/
-
obj/item/weapon/newspaper/attack_self(mob/user as mob)
if(ishuman(user))
var/mob/living/carbon/human/human_user = user
@@ -974,12 +966,12 @@ obj/item/weapon/newspaper/attackby(obj/item/weapon/W as obj, mob/user as mob)
if(istype(human_user.wear_id, /obj/item/device/pda) ) //autorecognition, woo!
var/obj/item/device/pda/P = human_user.wear_id
if(P.id)
- src.scanned_user = "[P.id.registered_name] ([P.id.assignment])"
+ src.scanned_user = GetNameAndAssignmentFromId(P.id)
else
src.scanned_user = "Unknown"
else if(istype(human_user.wear_id, /obj/item/weapon/card/id) )
var/obj/item/weapon/card/id/ID = human_user.wear_id
- src.scanned_user ="[ID.registered_name] ([ID.assignment])"
+ src.scanned_user = GetNameAndAssignmentFromId(ID)
else
src.scanned_user ="Unknown"
else
diff --git a/code/game/machinery/rechargestation.dm b/code/game/machinery/rechargestation.dm
index d4b5f90d681..3049a6f6943 100644
--- a/code/game/machinery/rechargestation.dm
+++ b/code/game/machinery/rechargestation.dm
@@ -70,8 +70,9 @@
allow_drop()
return 0
- examine()
- usr << "The charge meter reads: [round(chargepercentage())]%"
+ examine(mob/user)
+ ..(user)
+ user << "The charge meter reads: [round(chargepercentage())]%"
proc/chargepercentage()
return ((current_internal_charge / max_internal_charge) * 100)
diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm
index f6a1455e78c..bc65e08eb43 100644
--- a/code/game/machinery/spaceheater.dm
+++ b/code/game/machinery/spaceheater.dm
@@ -25,18 +25,14 @@
if(open)
overlays += "sheater-open"
-/obj/machinery/space_heater/examine()
- set src in oview(12)
- if (!( usr ))
- return
- usr << "This is \icon[src] \an [src.name]."
- usr << src.desc
+/obj/machinery/space_heater/examine(mob/user)
+ ..(user)
- usr << "The heater is [on ? "on" : "off"] and the hatch is [open ? "open" : "closed"]."
+ user << "The heater is [on ? "on" : "off"] and the hatch is [open ? "open" : "closed"]."
if(open)
- usr << "The power cell is [cell ? "installed" : "missing"]."
+ user << "The power cell is [cell ? "installed" : "missing"]."
else
- usr << "The charge meter reads [cell ? round(cell.percent(),1) : 0]%"
+ user << "The charge meter reads [cell ? round(cell.percent(),1) : 0]%"
return
/obj/machinery/space_heater/emp_act(severity)
diff --git a/code/game/machinery/status_display.dm b/code/game/machinery/status_display.dm
index a652cd50f0d..8d7ed7fccc4 100644
--- a/code/game/machinery/status_display.dm
+++ b/code/game/machinery/status_display.dm
@@ -124,11 +124,10 @@
return 1
return 0
-/obj/machinery/status_display/examine()
- set src in view()
- . = ..()
+/obj/machinery/status_display/examine(mob/user)
+ . = ..(user)
if(mode != STATUS_DISPLAY_BLANK && mode != STATUS_DISPLAY_ALERT)
- usr << "The display says:
\t[sanitize(message1)]
\t[sanitize(message2)]"
+ user << "The display says:
\t[sanitize(message1)]
\t[sanitize(message2)]"
/obj/machinery/status_display/proc/set_message(m1, m2)
if(m1)
diff --git a/code/game/machinery/telecomms/broadcaster.dm b/code/game/machinery/telecomms/broadcaster.dm
index 5bc531e571f..2efd994578d 100644
--- a/code/game/machinery/telecomms/broadcaster.dm
+++ b/code/game/machinery/telecomms/broadcaster.dm
@@ -452,6 +452,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
for (var/mob/R in heard_gibberish)
R.hear_radio(message, verbage, speaking, part_a, part_b, M, 1)
+ return 1
/proc/Broadcast_SimpleMessage(var/source, var/frequency, var/text, var/data, var/mob/M, var/compression, var/level)
@@ -641,7 +642,7 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
var/turf/position = get_turf(src)
return (position.z in signal.data["level"] && signal.data["done"])
-/atom/proc/telecomms_process()
+/atom/proc/telecomms_process(var/do_sleep = 1)
// First, we want to generate a new radio signal
var/datum/signal/signal = new
@@ -664,8 +665,9 @@ var/message_delay = 0 // To make sure restarting the recentmessages list is kept
//#### Sending the signal to all subspace receivers ####//
for(var/obj/machinery/telecomms/receiver/R in telecomms_list)
R.receive_signal(signal)
-
- sleep(rand(10,25))
+
+ if(do_sleep)
+ sleep(rand(10,25))
//world.log << "Level: [signal.data["level"]] - Done: [signal.data["done"]]"
diff --git a/code/game/machinery/transformer.dm b/code/game/machinery/transformer.dm
index a817c2c3a55..7885a8b8e24 100644
--- a/code/game/machinery/transformer.dm
+++ b/code/game/machinery/transformer.dm
@@ -33,11 +33,12 @@
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
use_power(5000) // Use a lot of power.
var/mob/living/silicon/robot = H.Robotize()
- robot.lying = 1
+ robot.SetLockDown()
spawn(50) // So he can't jump out the gate right away.
playsound(src.loc, 'sound/machines/ping.ogg', 50, 0)
if(robot)
- robot.lying = 0
+ robot.SetLockDown(0)
+ robot.notify_ai(1)
/obj/machinery/transformer/conveyor/New()
..()
diff --git a/code/game/machinery/turret_control.dm b/code/game/machinery/turret_control.dm
index 6c1b6acd11e..f203186eb98 100644
--- a/code/game/machinery/turret_control.dm
+++ b/code/game/machinery/turret_control.dm
@@ -111,20 +111,32 @@
popup.set_title_image(user.browse_rsc_icon(src.icon, src.icon_state))
popup.open()
-/obj/machinery/turretid/Topic(href, href_list)
+/obj/machinery/turretid/Topic(href, href_list, var/nowindow = 0)
if(..())
- return
+ return 1
+
+ if(ailock)
+ usr << "There seems to be a firewall preventing you from accessing this device."
+ return 1
+
if (src.locked)
if (!istype(usr, /mob/living/silicon))
usr << "Control panel is locked!"
- return
+ return 1
if (href_list["toggleOn"])
src.enabled = !src.enabled
src.updateTurrets()
else if (href_list["toggleLethal"])
src.lethal = !src.lethal
src.updateTurrets()
- src.attack_hand(usr)
+
+ if(!nowindow)
+ updateDialog()
+
+/obj/machinery/turretid/updateDialog()
+ if (stat & (BROKEN|MAINT))
+ return
+ ..()
/obj/machinery/turretid/proc/updateTurrets()
if(control_area)
diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm
index 51352e3afb9..2a33539bc86 100644
--- a/code/game/mecha/mecha.dm
+++ b/code/game/mecha/mecha.dm
@@ -83,7 +83,6 @@
add_cell()
add_iterators()
removeVerb(/obj/mecha/verb/disconnect_from_port)
- removeVerb(/atom/movable/verb/pull)
log_message("[src.name] created.")
loc.Entered(src)
mechas_list += src //global mech list
@@ -165,25 +164,24 @@
else
return 0
-/obj/mecha/examine()
- set src in view()
- ..()
+/obj/mecha/examine(mob/user)
+ ..(user)
var/integrity = health/initial(health)*100
switch(integrity)
if(85 to 100)
- usr << "It's fully intact."
+ user << "It's fully intact."
if(65 to 85)
- usr << "It's slightly damaged."
+ user << "It's slightly damaged."
if(45 to 65)
- usr << "It's badly damaged."
+ user << "It's badly damaged."
if(25 to 45)
- usr << "It's heavily damaged."
+ user << "It's heavily damaged."
else
- usr << "It's falling apart."
+ user << "It's falling apart."
if(equipment && equipment.len)
- usr << "It's equipped with:"
+ user << "It's equipped with:"
for(var/obj/item/mecha_parts/mecha_equipment/ME in equipment)
- usr << "\icon[ME] [ME]"
+ user << "\icon[ME] [ME]"
return
@@ -1406,11 +1404,11 @@
/obj/mecha/proc/output_maintenance_dialog(obj/item/weapon/card/id/id_card,mob/user)
if(!id_card || !user) return
-
+
var/maint_options = "Set Cabin Air Pressure"
if (locate(/obj/item/mecha_parts/mecha_equipment/tool/passenger) in contents)
- maint_options += "Remove Passenger"
-
+ maint_options += "Remove Passenger"
+
var/output = {"