[MIRROR] At first i thought that i was being forced to add a feature 🤮 but then i realized i was being encouraged to refactor 😄. Electrified chair is now a component instead of a failure (#3801)

* At first i thought that i was being forced to add a feature 🤮 but then i realized i was being encouraged to refactor 😄. Electrified chair is now a component instead of a failure (#57117)

* At first i thought that i was being forced to add a feature 🤮 but then i realized i was being encouraged to refactor 😄. Electrified chair is now a component instead of a failure

Co-authored-by: Kylerace <kylerlumpkin1@gmail.com>
This commit is contained in:
SkyratBot
2021-03-03 14:19:19 +00:00
committed by GitHub
co-authored by Kylerace
parent 0d9d2f6643
commit 6250754697
12 changed files with 303 additions and 79 deletions
+4 -3
View File
@@ -58,15 +58,16 @@
return FALSE
return TRUE
//Called when another assembly acts on this one, var/radio will determine where it came from for wire calcs
///Called when another assembly acts on this one, var/radio will determine where it came from for wire calcs
/obj/item/assembly/proc/pulsed(radio = FALSE)
if(wire_type & WIRE_RECEIVE)
INVOKE_ASYNC(src, .proc/activate)
if(radio && (wire_type & WIRE_RADIO_RECEIVE))
INVOKE_ASYNC(src, .proc/activate)
SEND_SIGNAL(src, COMSIG_ASSEMBLY_PULSED)
return TRUE
//Called when this device attempts to act on another device, var/radio determines if it was sent via radio or direct
///Called when this device attempts to act on another device, var/radio determines if it was sent via radio or direct
/obj/item/assembly/proc/pulse(radio = FALSE)
if(connected && wire_type)
connected.pulse_assembly(src)
@@ -77,7 +78,7 @@
holder.process_activation(src, 0, 1)
return TRUE
// What the device does when turned on
/// What the device does when turned on
/obj/item/assembly/proc/activate()
if(QDELETED(src) || !secured || (next_activate > world.time))
return FALSE
+23 -20
View File
@@ -3,38 +3,41 @@
desc = "This appears to be made from both an electropack and a helmet."
icon = 'icons/obj/assemblies.dmi'
icon_state = "shock_kit"
var/obj/item/clothing/head/helmet/part1 = null
var/obj/item/electropack/part2 = null
var/obj/item/clothing/head/helmet/helmet_part = null
var/obj/item/electropack/electropack_part = null
w_class = WEIGHT_CLASS_HUGE
flags_1 = CONDUCT_1
/obj/item/assembly/shock_kit/Destroy()
qdel(part1)
qdel(part2)
QDEL_NULL(helmet_part)
QDEL_NULL(electropack_part)
return ..()
/obj/item/assembly/shock_kit/Initialize()
. = ..()
if(!helmet_part)
helmet_part = new(src)
helmet_part.master = src
if(!electropack_part)
electropack_part = new(src)
electropack_part.master = src
/obj/item/assembly/shock_kit/wrench_act(mob/living/user, obj/item/I)
..()
to_chat(user, "<span class='notice'>You disassemble [src].</span>")
if(part1)
part1.forceMove(drop_location())
part1.master = null
part1 = null
if(part2)
part2.forceMove(drop_location())
part2.master = null
part2 = null
if(helmet_part)
helmet_part.forceMove(drop_location())
helmet_part.master = null
helmet_part = null
if(electropack_part)
electropack_part.forceMove(drop_location())
electropack_part.master = null
electropack_part = null
qdel(src)
return TRUE
/obj/item/assembly/shock_kit/attack_self(mob/user)
part1.attack_self(user)
part2.attack_self(user)
helmet_part.attack_self(user)
electropack_part.attack_self(user)
add_fingerprint(user)
return
/obj/item/assembly/shock_kit/receive_signal()
if(istype(loc, /obj/structure/chair/e_chair))
var/obj/structure/chair/e_chair/C = loc
C.shock()
return