This commit is contained in:
Fikou
2021-12-24 21:00:24 +01:00
committed by GitHub
parent fc5c9e2900
commit 7b38dd4ff7
191 changed files with 6749 additions and 2189 deletions
+10 -9
View File
@@ -40,12 +40,13 @@
attach_circuit(starting_circuit)
/datum/component/shell/RegisterWithParent()
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/on_attack_by)
RegisterSignal(parent, COMSIG_PARENT_EXAMINE, .proc/on_examine)
RegisterSignal(parent, COMSIG_ATOM_ATTACK_GHOST, .proc/on_attack_ghost)
if(!(shell_flags & SHELL_FLAG_CIRCUIT_FIXED))
RegisterSignal(parent, COMSIG_ATOM_TOOL_ACT(TOOL_SCREWDRIVER), .proc/on_screwdriver_act)
if(!(shell_flags & SHELL_FLAG_CIRCUIT_UNMODIFIABLE))
RegisterSignal(parent, COMSIG_ATOM_TOOL_ACT(TOOL_MULTITOOL), .proc/on_multitool_act)
RegisterSignal(parent, COMSIG_PARENT_ATTACKBY, .proc/on_attack_by)
if(!(shell_flags & SHELL_FLAG_CIRCUIT_UNREMOVABLE))
RegisterSignal(parent, COMSIG_ATOM_TOOL_ACT(TOOL_SCREWDRIVER), .proc/on_screwdriver_act)
RegisterSignal(parent, COMSIG_OBJ_DECONSTRUCT, .proc/on_object_deconstruct)
if(shell_flags & SHELL_FLAG_REQUIRE_ANCHOR)
RegisterSignal(parent, COMSIG_MOVABLE_SET_ANCHORED, .proc/on_set_anchored)
@@ -110,7 +111,7 @@
return
if(attached_circuit.admin_only)
return
if(shell_flags & SHELL_FLAG_CIRCUIT_FIXED)
if(shell_flags & SHELL_FLAG_CIRCUIT_UNREMOVABLE)
return
remove_circuit()
@@ -175,7 +176,7 @@
if(attached_circuit)
if(attached_circuit.owner_id && item == attached_circuit.owner_id.resolve())
set_locked(!locked)
source.balloon_alert(attacker, "[locked? "locked" : "unlocked"] [source]")
source.balloon_alert(attacker, "[locked ? "locked" : "unlocked"] [source]")
return COMPONENT_NO_AFTERATTACK
if(!attached_circuit.owner_id && istype(item, /obj/item/card/id))
@@ -304,7 +305,7 @@
return
locked = FALSE
attached_circuit = circuitboard
if(!(shell_flags & SHELL_FLAG_CIRCUIT_FIXED) && !circuitboard.admin_only)
if(!(shell_flags & SHELL_FLAG_CIRCUIT_UNREMOVABLE) && !circuitboard.admin_only)
RegisterSignal(circuitboard, COMSIG_MOVABLE_MOVED, .proc/on_circuit_moved)
if(shell_flags & SHELL_FLAG_REQUIRE_ANCHOR)
RegisterSignal(circuitboard, COMSIG_CIRCUIT_PRE_POWER_USAGE, .proc/override_power_usage)
@@ -320,7 +321,7 @@
if(shell_flags & SHELL_FLAG_REQUIRE_ANCHOR)
attached_circuit.on = parent_atom.anchored
if((shell_flags & SHELL_FLAG_CIRCUIT_FIXED) || circuitboard.admin_only)
if((shell_flags & SHELL_FLAG_CIRCUIT_UNREMOVABLE) || circuitboard.admin_only)
circuitboard.moveToNullspace()
else if(circuitboard.loc != parent_atom)
circuitboard.forceMove(parent_atom)
@@ -364,7 +365,7 @@
if(attached_circuit.locked)
source.balloon_alert(user, "circuit is locked!")
return COMSIG_CANCEL_USB_CABLE_ATTACK
usb_cable.attached_circuit = attached_circuit
return COMSIG_USB_CABLE_CONNECTED_TO_CIRCUIT
@@ -375,7 +376,7 @@
* * user - The user to check if they are authorized
*/
/datum/component/shell/proc/is_authorized(mob/user)
if(shell_flags & SHELL_FLAG_CIRCUIT_FIXED)
if((shell_flags & SHELL_FLAG_CIRCUIT_UNREMOVABLE) && (shell_flags & SHELL_FLAG_CIRCUIT_UNMODIFIABLE))
return FALSE
if(attached_circuit?.admin_only)