@@ -0,0 +1,114 @@
|
||||
/obj/item/implant
|
||||
name = "implant"
|
||||
icon = 'icons/obj/implants.dmi'
|
||||
icon_state = "generic" //Shows up as the action button icon
|
||||
actions_types = list(/datum/action/item_action/hands_free/activate)
|
||||
var/activated = TRUE //1 for implant types that can be activated, 0 for ones that are "always on" like mindshield implants
|
||||
var/mob/living/imp_in = null
|
||||
item_color = "b"
|
||||
var/allow_multiple = FALSE
|
||||
var/uses = -1
|
||||
item_flags = DROPDEL
|
||||
|
||||
|
||||
/obj/item/implant/proc/trigger(emote, mob/living/carbon/source)
|
||||
return
|
||||
|
||||
/obj/item/implant/proc/on_death(emote, mob/living/carbon/source)
|
||||
return
|
||||
|
||||
/obj/item/implant/proc/activate()
|
||||
SEND_SIGNAL(src, COMSIG_IMPLANT_ACTIVATED)
|
||||
|
||||
/obj/item/implant/ui_action_click()
|
||||
activate("action_button")
|
||||
|
||||
/obj/item/implant/proc/can_be_implanted_in(mob/living/target) // for human-only and other special requirements
|
||||
return TRUE
|
||||
|
||||
/mob/living/proc/can_be_implanted()
|
||||
return TRUE
|
||||
|
||||
/mob/living/silicon/can_be_implanted()
|
||||
return FALSE
|
||||
|
||||
/mob/living/simple_animal/can_be_implanted()
|
||||
return healable //Applies to robots and most non-organics, exceptions can override.
|
||||
|
||||
|
||||
|
||||
//What does the implant do upon injection?
|
||||
//return 1 if the implant injects
|
||||
//return 0 if there is no room for implant / it fails
|
||||
/obj/item/implant/proc/implant(mob/living/target, mob/user, silent = FALSE)
|
||||
if(SEND_SIGNAL(src, COMSIG_IMPLANT_IMPLANTING, args) & COMPONENT_STOP_IMPLANTING)
|
||||
return
|
||||
LAZYINITLIST(target.implants)
|
||||
if(!target.can_be_implanted() || !can_be_implanted_in(target))
|
||||
return FALSE
|
||||
for(var/X in target.implants)
|
||||
var/obj/item/implant/imp_e = X
|
||||
var/flags = SEND_SIGNAL(imp_e, COMSIG_IMPLANT_OTHER, args, src)
|
||||
if(flags & COMPONENT_DELETE_NEW_IMPLANT)
|
||||
UNSETEMPTY(target.implants)
|
||||
qdel(src)
|
||||
return TRUE
|
||||
if(flags & COMPONENT_DELETE_OLD_IMPLANT)
|
||||
qdel(imp_e)
|
||||
continue
|
||||
if(flags & COMPONENT_STOP_IMPLANTING)
|
||||
UNSETEMPTY(target.implants)
|
||||
return FALSE
|
||||
|
||||
if(istype(imp_e, type))
|
||||
if(!allow_multiple)
|
||||
if(imp_e.uses < initial(imp_e.uses)*2)
|
||||
if(uses == -1)
|
||||
imp_e.uses = -1
|
||||
else
|
||||
imp_e.uses = min(imp_e.uses + uses, initial(imp_e.uses)*2)
|
||||
qdel(src)
|
||||
return TRUE
|
||||
else
|
||||
return FALSE
|
||||
|
||||
moveToNullspace()
|
||||
imp_in = target
|
||||
target.implants += src
|
||||
if(activated)
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.Grant(target)
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
H.sec_hud_set_implants()
|
||||
|
||||
if(user)
|
||||
log_combat(user, target, "implanted", "\a [name]")
|
||||
|
||||
return TRUE
|
||||
|
||||
/obj/item/implant/proc/removed(mob/living/source, silent = FALSE, special = 0)
|
||||
SEND_SIGNAL(src, COMSIG_IMPLANT_REMOVING, args)
|
||||
imp_in = null
|
||||
source.implants -= src
|
||||
for(var/X in actions)
|
||||
var/datum/action/A = X
|
||||
A.Remove(source)
|
||||
if(ishuman(source))
|
||||
var/mob/living/carbon/human/H = source
|
||||
H.sec_hud_set_implants()
|
||||
|
||||
return 1
|
||||
|
||||
/obj/item/implant/Destroy()
|
||||
if(imp_in)
|
||||
removed(imp_in)
|
||||
return ..()
|
||||
|
||||
/obj/item/implant/proc/get_data()
|
||||
return "No information available"
|
||||
|
||||
/obj/item/implant/dropped(mob/user)
|
||||
. = 1
|
||||
..()
|
||||
@@ -0,0 +1,47 @@
|
||||
/obj/item/implant/storage
|
||||
name = "storage implant"
|
||||
desc = "Stores up to two big items in a bluespace pocket."
|
||||
icon_state = "storage"
|
||||
item_color = "r"
|
||||
var/max_slot_stacking = 4
|
||||
var/obj/item/storage/bluespace_pocket/pocket
|
||||
|
||||
/obj/item/implant/storage/activate()
|
||||
. = ..()
|
||||
SEND_SIGNAL(pocket, COMSIG_TRY_STORAGE_SHOW, imp_in, TRUE)
|
||||
|
||||
/obj/item/implant/storage/removed(source, silent = FALSE, special = 0)
|
||||
if(!special)
|
||||
QDEL_NULL(pocket)
|
||||
else
|
||||
pocket?.moveToNullspace()
|
||||
return ..()
|
||||
|
||||
/obj/item/implant/storage/implant(mob/living/target, mob/user, silent = FALSE)
|
||||
for(var/X in target.implants)
|
||||
if(istype(X, type))
|
||||
var/obj/item/implant/storage/imp_e = X
|
||||
var/datum/component/storage/STR = imp_e.pocket.GetComponent(/datum/component/storage)
|
||||
if(!STR || (STR && STR.max_items < max_slot_stacking))
|
||||
imp_e.pocket.AddComponent(/datum/component/storage/concrete/implant)
|
||||
qdel(src)
|
||||
return TRUE
|
||||
return FALSE
|
||||
. = ..()
|
||||
if(.)
|
||||
if(!QDELETED(pocket))
|
||||
pocket.forceMove(target)
|
||||
else
|
||||
pocket = new(target)
|
||||
|
||||
/obj/item/storage/bluespace_pocket
|
||||
name = "internal bluespace pocket"
|
||||
icon_state = "pillbox"
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
desc = "A tiny yet spacious pocket, usually found implanted inside sneaky syndicate agents and nowhere else."
|
||||
component_type = /datum/component/storage/concrete/implant
|
||||
resistance_flags = INDESTRUCTIBLE //A bomb!
|
||||
|
||||
/obj/item/implanter/storage
|
||||
name = "implanter (storage)"
|
||||
imp_type = /obj/item/implant/storage
|
||||
@@ -0,0 +1,76 @@
|
||||
/obj/item/implant/tracking
|
||||
name = "tracking implant"
|
||||
desc = "Track with this."
|
||||
activated = FALSE
|
||||
var/lifespan_postmortem = 10 MINUTES //for how many deciseconds after user death will the implant work?
|
||||
var/allow_teleport = TRUE //will people implanted with this act as teleporter beacons?
|
||||
|
||||
/obj/item/implant/tracking/c38
|
||||
name = "TRAC implant"
|
||||
desc = "A smaller tracking implant that supplies power for only a few minutes."
|
||||
var/lifespan = 5 MINUTES //how many deciseconds does the implant last?
|
||||
allow_teleport = FALSE
|
||||
|
||||
/obj/item/implant/tracking/c38/Initialize()
|
||||
. = ..()
|
||||
QDEL_IN(src, lifespan)
|
||||
|
||||
/obj/item/implant/tracking/Initialize()
|
||||
. = ..()
|
||||
GLOB.tracked_implants += src
|
||||
|
||||
/obj/item/implant/tracking/Destroy()
|
||||
. = ..()
|
||||
GLOB.tracked_implants -= src
|
||||
|
||||
/obj/item/implanter/tracking
|
||||
imp_type = /obj/item/implant/tracking
|
||||
|
||||
/obj/item/implanter/tracking/gps
|
||||
imp_type = /obj/item/implant/gps
|
||||
|
||||
/obj/item/implant/gps
|
||||
name = "\improper GPS implant"
|
||||
desc = "Track with this and a GPS."
|
||||
activated = FALSE
|
||||
var/obj/item/gps/internal/mining/real_gps
|
||||
|
||||
/obj/item/implant/gps/implant(mob/living/target, mob/user, silent = FALSE)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
if(real_gps)
|
||||
real_gps.forceMove(target)
|
||||
else
|
||||
real_gps = new(target)
|
||||
|
||||
/obj/item/implant/gps/removed(mob/living/source, silent = FALSE, special = 0)
|
||||
. = ..()
|
||||
if(!.)
|
||||
return
|
||||
if(!special)
|
||||
qdel(real_gps)
|
||||
else
|
||||
real_gps?.moveToNullspace()
|
||||
|
||||
/obj/item/implant/tracking/get_data()
|
||||
var/dat = {"<b>Implant Specifications:</b><BR>
|
||||
<b>Name:</b> Tracking Beacon<BR>
|
||||
<b>Life:</b> 10 minutes after death of host<BR>
|
||||
<b>Important Notes:</b> Implant also works as a teleporter beacon.<BR>
|
||||
<HR>
|
||||
<b>Implant Details:</b> <BR>
|
||||
<b>Function:</b> Continuously transmits low power signal. Useful for tracking.<BR>
|
||||
<b>Special Features:</b><BR>
|
||||
<i>Neuro-Safe</i>- Specialized shell absorbs excess voltages self-destructing the chip if
|
||||
a malfunction occurs thereby securing safety of subject. The implant will melt and
|
||||
disintegrate into bio-safe elements.<BR>
|
||||
<b>Integrity:</b> Gradient creates slight risk of being overcharged and frying the
|
||||
circuitry. As a result neurotoxins can cause massive damage."}
|
||||
return dat
|
||||
|
||||
|
||||
/obj/item/implantcase/track
|
||||
name = "implant case - 'Tracking'"
|
||||
desc = "A glass case containing a tracking implant."
|
||||
imp_type = /obj/item/implant/tracking
|
||||
Reference in New Issue
Block a user