Add deathrattle implant for nuclear operatives (#55903)

Deathrattle implant, comes in box of 8, implant yourself and others, and
you'll get a little notification when they die.

Intended for nuke ops, price around the same as the codebook, since it's
a utility communication item, that actually "plans to fail", so it can't
be too expensive, because it doesn't help them win, just lets them know
how much they are losing by.
This commit is contained in:
coiax
2021-01-20 19:30:30 -03:00
committed by GitHub
parent 13a57cd807
commit 25e476e92a
6 changed files with 117 additions and 1 deletions
+7
View File
@@ -657,6 +657,13 @@
//#define COMPONENT_STOP_IMPLANTING (1<<0) //The name makes sense for both
#define COMPONENT_DELETE_NEW_IMPLANT (1<<1)
#define COMPONENT_DELETE_OLD_IMPLANT (1<<2)
/// called on implants, after a successful implantation: (mob/living/target, mob/user, silent, force)
#define COMSIG_IMPLANT_IMPLANTED "implant_implanted"
/// called on implants, after an implant has been removed: (mob/living/source, silent, special)
#define COMSIG_IMPLANT_REMOVED "implant_removed"
///called on implants being implanted into someone with an uplink implant: (datum/component/uplink)
#define COMSIG_IMPLANT_EXISTING_UPLINK "implant_uplink_exists"
//This uses all return values of COMSIG_IMPLANT_OTHER
+3 -1
View File
@@ -83,6 +83,7 @@
if(user)
log_combat(user, target, "implanted", "\a [name]")
SEND_SIGNAL(src, COMSIG_IMPLANT_IMPLANTED, target, user, silent, force)
return TRUE
/obj/item/implant/proc/removed(mob/living/source, silent = FALSE, special = 0)
@@ -96,7 +97,8 @@
var/mob/living/carbon/human/H = source
H.sec_hud_set_implants()
return 1
SEND_SIGNAL(src, COMSIG_IMPLANT_REMOVED, source, silent, special)
return TRUE
/obj/item/implant/Destroy()
if(imp_in)
@@ -0,0 +1,77 @@
/datum/deathrattle_group
var/name
var/list/implants = list()
/datum/deathrattle_group/New(name)
if(name)
src.name = name
else
// Give the group a unique name for debugging, and possible future
// use for making custom linked groups.
src.name = "[rand(100,999)] [pick(GLOB.phonetic_alphabet)]"
/*
* Proc called by new implant being added to the group. Listens for the
* implant being implanted, removed and destroyed.
*
* If implant is already implanted in a person, then trigger the implantation
* code.
*/
/datum/deathrattle_group/proc/register(obj/item/implant/deathrattle/implant)
if(implant in implants)
return
RegisterSignal(implant, COMSIG_IMPLANT_IMPLANTED, .proc/on_implant_implantation)
RegisterSignal(implant, COMSIG_IMPLANT_REMOVED, .proc/on_implant_removal)
RegisterSignal(implant, COMSIG_PARENT_QDELETING, .proc/on_implant_destruction)
implants += implant
if(implant.imp_in)
on_implant_implantation(implant.imp_in)
/datum/deathrattle_group/proc/on_implant_implantation(obj/item/implant/implant, mob/living/target, mob/user, silent = FALSE, force = FALSE)
SIGNAL_HANDLER
RegisterSignal(target, COMSIG_MOB_STATCHANGE, .proc/on_user_statchange)
/datum/deathrattle_group/proc/on_implant_removal(obj/item/implant/implant, mob/living/source, silent = FALSE, special = 0)
SIGNAL_HANDLER
UnregisterSignal(source, COMSIG_MOB_STATCHANGE)
/datum/deathrattle_group/proc/on_implant_destruction(obj/item/implant/implant)
implants -= implant
/datum/deathrattle_group/proc/on_user_statchange(mob/living/owner, new_stat)
SIGNAL_HANDLER
if(new_stat != DEAD)
return
var/name = owner.mind ? owner.mind.name : owner.real_name
var/area = get_area_name(get_turf(owner))
for(var/_implant in implants)
var/obj/item/implant/deathrattle/implant = _implant
// Skip the unfortunate soul, and any unimplanted implants
if(implant.imp_in == owner || !implant.imp_in)
continue
// Deliberately the same message framing as nanite message + ghost deathrattle
to_chat(implant.imp_in, "<i>You hear a strange, robotic voice in your head...</i> \"<span class='robot'><b>[name]</b> has died at <b>[area]</b>.</span>\"")
/obj/item/implant/deathrattle
name = "deathrattle implant"
desc = "Hope no one else dies, prepare for when they do."
activated = FALSE
/obj/item/implant/deathrattle/can_be_implanted_in(mob/living/target)
// Can be implanted in anything that's a mob. Syndicate cyborgs, talking fish, humans...
return TRUE
/obj/item/implantcase/deathrattle
name = "implant case - 'Deathrattle'"
desc = "A glass case containing a deathrattle implant."
imp_type = /obj/item/implant/deathrattle
@@ -565,3 +565,21 @@
/obj/item/storage/box/syndie_kit/signaler/PopulateContents()
for(var/i in 1 to 6)
new /obj/item/assembly/signaler(src)
/obj/item/storage/box/syndie_kit/imp_deathrattle
name = "deathrattle implant box"
desc = "Contains eight linked deathrattle implants."
/obj/item/storage/box/syndie_kit/imp_deathrattle/PopulateContents()
new /obj/item/implanter(src)
var/datum/deathrattle_group/group = new
var/implants = list()
for(var/j in 1 to 8)
var/obj/item/implantcase/deathrattle/case = new (src)
implants += case.imp
for(var/i in implants)
group.register(i)
desc += " The implants are registered to the \"[group.name]\" group."
+11
View File
@@ -1701,6 +1701,17 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
surplus = 0
include_modes = list(/datum/game_mode/nuclear)
/datum/uplink_item/implants/deathrattle
name = "Box of Deathrattle Implants"
desc = "A collection of implants (and one reusable implanter) that should be injected into the team. When one of the team \
dies, all other implant holders recieve a mental message informing them of their teammates' name \
and the location of their death. Unlike most implants, these are designed to be implanted \
in any creature, biological or mechanical."
item = /obj/item/storage/box/syndie_kit/imp_deathrattle
cost = 4
surplus = 0
include_modes = list(/datum/game_mode/nuclear)
//Race-specific items
/datum/uplink_item/race_restricted
+1
View File
@@ -1156,6 +1156,7 @@
#include "code\game\objects\items\implants\implant_abductor.dm"
#include "code\game\objects\items\implants\implant_chem.dm"
#include "code\game\objects\items\implants\implant_clown.dm"
#include "code\game\objects\items\implants\implant_deathrattle.dm"
#include "code\game\objects\items\implants\implant_exile.dm"
#include "code\game\objects\items\implants\implant_explosive.dm"
#include "code\game\objects\items\implants\implant_freedom.dm"