mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 21:18:37 +01:00
Allows charging batteries of integrated circuits with inducers and allows scanning ids on unregistered circuits through shells. (#60227)
Co-authored-by: Watermelon914 <3052169-Watermelon914@users.noreply.gitlab.com>
This commit is contained in:
co-authored by
Watermelon914
parent
d5613ffee3
commit
4a30ee038c
@@ -97,17 +97,28 @@
|
||||
/datum/component/shell/proc/on_attack_by(atom/source, obj/item/item, mob/living/attacker)
|
||||
SIGNAL_HANDLER
|
||||
if(istype(item, /obj/item/stock_parts/cell))
|
||||
source.balloon_alert(attacker, "can't pull cell in directly!")
|
||||
source.balloon_alert(attacker, "can't put cell in directly!")
|
||||
return
|
||||
|
||||
if(attached_circuit?.owner_id && item == attached_circuit.owner_id.resolve())
|
||||
set_locked(!locked)
|
||||
source.balloon_alert(attacker, "[locked? "locked" : "unlocked"] [source]")
|
||||
if(istype(item, /obj/item/inducer))
|
||||
var/obj/item/inducer/inducer = item
|
||||
INVOKE_ASYNC(inducer, /obj/item.proc/attack_obj, attached_circuit, attacker, list())
|
||||
return COMPONENT_NO_AFTERATTACK
|
||||
|
||||
if(attached_circuit && istype(item, /obj/item/circuit_component))
|
||||
attached_circuit.add_component_manually(item, attacker)
|
||||
return
|
||||
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]")
|
||||
return COMPONENT_NO_AFTERATTACK
|
||||
|
||||
if(!attached_circuit.owner_id && istype(item, /obj/item/card/id))
|
||||
source.balloon_alert(attacker, "owner id set for [item]")
|
||||
attached_circuit.owner_id = WEAKREF(item)
|
||||
return COMPONENT_NO_AFTERATTACK
|
||||
|
||||
if(istype(item, /obj/item/circuit_component))
|
||||
attached_circuit.add_component_manually(item, attacker)
|
||||
return
|
||||
|
||||
if(!istype(item, /obj/item/integrated_circuit))
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user