Skip to content

Commit

Permalink
Give ghosts the ability to examine BCIs (tgstation#60500)
Browse files Browse the repository at this point in the history
Examining a mob with a BCI inside them will now give you the ability to look at it. Helpful for admins, but also keeps in line with every other circuit shell.
  • Loading branch information
Mothblocks authored Jul 29, 2021
1 parent 1a6aede commit 6c15afa
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions code/modules/wiremod/shell/brain_computer_interface.dm
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,7 @@
user_port.set_output(owner)
user = WEAKREF(owner)

RegisterSignal(owner, COMSIG_PARENT_EXAMINE, .proc/on_examine)
RegisterSignal(owner, COMSIG_PROCESS_BORGCHARGER_OCCUPANT, .proc/on_borg_charge)
RegisterSignal(owner, COMSIG_LIVING_ELECTROCUTE_ACT, .proc/on_electrocute)

Expand All @@ -234,6 +235,7 @@
user = null

UnregisterSignal(owner, list(
COMSIG_PARENT_EXAMINE,
COMSIG_PROCESS_BORGCHARGER_OCCUPANT,
COMSIG_LIVING_ELECTROCUTE_ACT,
))
Expand All @@ -258,6 +260,21 @@
parent.cell.give(shock_damage * 2)
to_chat(source, span_notice("You absorb some of the shock into your [parent.name]!"))

/obj/item/circuit_component/bci_core/proc/on_examine(datum/source, mob/mob, list/examine_text)
SIGNAL_HANDLER

if (isobserver(mob))
examine_text += span_notice("[source.p_they(capitalized = TRUE)] [source.p_have()] <a href='?src=[REF(src)];open_bci=1'>\a [parent] implanted in [source.p_them()]</a>.")

/obj/item/circuit_component/bci_core/Topic(href, list/href_list)
..()

if (!isobserver(usr))
return

if (href_list["open_bci"])
parent.attack_ghost(usr)

/datum/action/innate/bci_charge_action
name = "Check BCI Charge"
check_flags = NONE
Expand Down

0 comments on commit 6c15afa

Please sign in to comment.