mirror of
https://github.com/yogstation13/Yogstation.git
synced 2025-02-26 09:04:50 +00:00
* Refactor several log lines to use datum_info_line and atom_loc_line * Add default return strings from datum_info_line and atom_loc_line * Add parentheses around atom_loc_line data * Change more logs to use atom_loc_line * Add check in atom_loc_line for turfs to avoid calling get_turf on them * Re-add removed 'at' * Replace datum_info_line with key_name and atom_loc_line with loc_name * Refactor logging functions * Avoid double-logging self-interactions * Fallback to simple stringification if all else fails in key_name() * Rewrite muscle spasm logging to use log_message * Standardize logging of martial arts * Tweak individual logging panel look * Fix individual logging panel source * When I typed || I really meant && * Fix Telecomms logging always showing client logs in the panel * Reverts addition of buggy ownership log to panel * Remove colon * Fix missing log_directed_talk tag * Add warning for missing type in log_direted_talk * Change warnings to stack_traces * Add square brackets around fallthrough key_name() case to help parsing * Allow atom arguments/src in log_*() functions * Change log_combat call with null argument to log_message * Change mecha types' log_message() arguments to match atom and mob version * Add key_name() case for atoms * Fix resist_grab() unsetting pulledby before log_combat gets a chance to use it * Fix log_globally logic * Add logging for hitting objects with items * Move log_combat() to atoms.dm * Use utility functions for object stringification in log_combat() * Use utility functions for object stringification in log_combat() * Add missing logs for interacting with display cases * Rewrite log_combat() comment * Add missing space in log_combat() * Add logging for hitting grilles barehanded * Add missing ..()
138 lines
3.9 KiB
Plaintext
138 lines
3.9 KiB
Plaintext
/obj/item/assembly/control
|
|
name = "blast door controller"
|
|
desc = "A small electronic device able to control a blast door remotely."
|
|
icon_state = "control"
|
|
attachable = TRUE
|
|
var/id = null
|
|
var/can_change_id = 0
|
|
var/cooldown = FALSE //Door cooldowns
|
|
|
|
/obj/item/assembly/control/examine(mob/user)
|
|
..()
|
|
if(id)
|
|
to_chat(user, "<span class='notice'>Its channel ID is '[id]'.</span>")
|
|
|
|
/obj/item/assembly/control/activate()
|
|
cooldown = TRUE
|
|
var/openclose
|
|
for(var/obj/machinery/door/poddoor/M in GLOB.machines)
|
|
if(M.id == src.id)
|
|
if(openclose == null)
|
|
openclose = M.density
|
|
INVOKE_ASYNC(M, openclose ? /obj/machinery/door/poddoor.proc/open : /obj/machinery/door/poddoor.proc/close)
|
|
addtimer(VARSET_CALLBACK(src, cooldown, FALSE), 10)
|
|
|
|
|
|
/obj/item/assembly/control/airlock
|
|
name = "airlock controller"
|
|
desc = "A small electronic device able to control an airlock remotely."
|
|
id = "badmin" // Set it to null for MEGAFUN.
|
|
var/specialfunctions = OPEN
|
|
/*
|
|
Bitflag, 1= open (OPEN)
|
|
2= idscan (IDSCAN)
|
|
4= bolts (BOLTS)
|
|
8= shock (SHOCK)
|
|
16= door safties (SAFE)
|
|
*/
|
|
|
|
/obj/item/assembly/control/airlock/activate()
|
|
cooldown = TRUE
|
|
var/doors_need_closing = FALSE
|
|
var/list/obj/machinery/door/airlock/open_or_close = list()
|
|
for(var/obj/machinery/door/airlock/D in GLOB.airlocks)
|
|
if(D.id_tag == src.id)
|
|
if(specialfunctions & OPEN)
|
|
open_or_close += D
|
|
if(!D.density)
|
|
doors_need_closing = TRUE
|
|
if(specialfunctions & IDSCAN)
|
|
D.aiDisabledIdScanner = !D.aiDisabledIdScanner
|
|
if(specialfunctions & BOLTS)
|
|
if(!D.wires.is_cut(WIRE_BOLTS) && D.hasPower())
|
|
D.locked = !D.locked
|
|
D.update_icon()
|
|
if(specialfunctions & SHOCK)
|
|
if(D.secondsElectrified)
|
|
D.secondsElectrified = -1
|
|
LAZYADD(D.shockedby, "\[[time_stamp()]\] [key_name(usr)]")
|
|
log_combat(usr, D, "electrified")
|
|
else
|
|
D.secondsElectrified = 0
|
|
if(specialfunctions & SAFE)
|
|
D.safe = !D.safe
|
|
|
|
for(var/D in open_or_close)
|
|
INVOKE_ASYNC(D, doors_need_closing ? /obj/machinery/door/airlock.proc/close : /obj/machinery/door/airlock.proc/open)
|
|
|
|
addtimer(VARSET_CALLBACK(src, cooldown, FALSE), 10)
|
|
|
|
|
|
/obj/item/assembly/control/massdriver
|
|
name = "mass driver controller"
|
|
desc = "A small electronic device able to control a mass driver."
|
|
|
|
/obj/item/assembly/control/massdriver/activate()
|
|
cooldown = TRUE
|
|
for(var/obj/machinery/door/poddoor/M in GLOB.machines)
|
|
if (M.id == src.id)
|
|
INVOKE_ASYNC(M, /obj/machinery/door/poddoor.proc/open)
|
|
|
|
sleep(10)
|
|
|
|
for(var/obj/machinery/mass_driver/M in GLOB.machines)
|
|
if(M.id == src.id)
|
|
M.drive()
|
|
|
|
sleep(60)
|
|
|
|
for(var/obj/machinery/door/poddoor/M in GLOB.machines)
|
|
if (M.id == src.id)
|
|
INVOKE_ASYNC(M, /obj/machinery/door/poddoor.proc/close)
|
|
|
|
addtimer(VARSET_CALLBACK(src, cooldown, FALSE), 10)
|
|
|
|
|
|
/obj/item/assembly/control/igniter
|
|
name = "ignition controller"
|
|
desc = "A remote controller for a mounted igniter."
|
|
|
|
/obj/item/assembly/control/igniter/activate()
|
|
cooldown = TRUE
|
|
for(var/obj/machinery/sparker/M in GLOB.machines)
|
|
if (M.id == src.id)
|
|
INVOKE_ASYNC(M, /obj/machinery/sparker.proc/ignite)
|
|
|
|
for(var/obj/machinery/igniter/M in GLOB.machines)
|
|
if(M.id == src.id)
|
|
M.use_power(50)
|
|
M.on = !M.on
|
|
M.icon_state = "igniter[M.on]"
|
|
|
|
addtimer(VARSET_CALLBACK(src, cooldown, FALSE), 30)
|
|
|
|
/obj/item/assembly/control/flasher
|
|
name = "flasher controller"
|
|
desc = "A remote controller for a mounted flasher."
|
|
|
|
/obj/item/assembly/control/flasher/activate()
|
|
cooldown = TRUE
|
|
for(var/obj/machinery/flasher/M in GLOB.machines)
|
|
if(M.id == src.id)
|
|
INVOKE_ASYNC(M, /obj/machinery/flasher.proc/flash)
|
|
|
|
addtimer(VARSET_CALLBACK(src, cooldown, FALSE), 50)
|
|
|
|
|
|
/obj/item/assembly/control/crematorium
|
|
name = "crematorium controller"
|
|
desc = "An evil-looking remote controller for a crematorium."
|
|
|
|
/obj/item/assembly/control/crematorium/activate()
|
|
cooldown = TRUE
|
|
for (var/obj/structure/bodycontainer/crematorium/C in GLOB.crematoriums)
|
|
if (C.id == id)
|
|
C.cremate(usr)
|
|
|
|
addtimer(VARSET_CALLBACK(src, cooldown, FALSE), 50)
|