[MIRROR] Small implant code cleanup. [MDB IGNORE] (#8971)

* Small implant code cleanup. (#62226)

Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>

* Small implant code cleanup.

* Update mortis.dm

Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
Co-authored-by: Mothblocks <35135081+Mothblocks@ users.noreply.github.com>
Co-authored-by: Gandalf <jzo123@hotmail.com>
This commit is contained in:
SkyratBot
2021-10-23 00:46:43 +01:00
committed by GitHub
co-authored by Mothblocks Ghom Gandalf
parent 7abcc01f5b
commit f24d8a532d
7 changed files with 45 additions and 40 deletions
-5
View File
@@ -101,11 +101,6 @@
msg = replace_pronoun(user, msg)
if(isliving(user))
var/mob/living/sender = user
for(var/obj/item/implant/implant in sender.implants)
implant.trigger(key, sender)
if(!msg)
return
+1 -5
View File
@@ -18,10 +18,6 @@
var/uses = -1
item_flags = DROPDEL
/obj/item/implant/proc/trigger(emote, mob/living/carbon/source)
return
/obj/item/implant/proc/activate()
SEND_SIGNAL(src, COMSIG_IMPLANT_ACTIVATED)
@@ -119,7 +115,7 @@
source.implants -= src
for(var/X in actions)
var/datum/action/implant_action = X
implant_action.Grant(source)
implant_action.Remove(source)
if(ishuman(source))
var/mob/living/carbon/human/human_source = source
human_source.sec_hud_set_implants()
@@ -29,11 +29,19 @@
GLOB.tracked_chem_implants -= src
return ..()
/obj/item/implant/chem/trigger(emote, mob/living/source)
if(emote == "deathgasp")
if(istype(source) && !(source.stat == DEAD))
return
activate(reagents.total_volume)
/obj/item/implant/chem/implant(mob/living/target, mob/user, silent = FALSE, force = FALSE)
. = ..()
if(.)
RegisterSignal(target, COMSIG_LIVING_DEATH, .proc/on_death)
/obj/item/implant/chem/removed(mob/target, silent = FALSE, special = FALSE)
. = ..()
if(.)
UnregisterSignal(target, COMSIG_LIVING_DEATH)
/obj/item/implant/chem/proc/on_death(mob/living/source)
SIGNAL_HANDLER
activate(reagents.total_volume)
/obj/item/implant/chem/activate(cause)
. = ..()
@@ -10,9 +10,19 @@
"}
return dat
/obj/item/implant/sad_trombone/trigger(emote, mob/source)
if(emote == "deathgasp")
playsound(loc, 'sound/misc/sadtrombone.ogg', 50, FALSE)
/obj/item/implant/sad_trombone/implant(mob/living/target, mob/user, silent = FALSE, force = FALSE)
. = ..()
if(.)
RegisterSignal(target, COMSIG_MOB_EMOTED("deathgasp"), .proc/on_deathgasp)
/obj/item/implant/sad_trombone/removed(mob/target, silent = FALSE, special = FALSE)
. = ..()
if(.)
UnregisterSignal(target, COMSIG_MOB_EMOTED("deathgasp"))
/obj/item/implant/sad_trombone/proc/on_deathgasp(mob/source)
SIGNAL_HANDLER
playsound(loc, 'sound/misc/sadtrombone.ogg', 50, FALSE)
///Implanter that spawns with a sad trombone implant, as well as an appropriate name
/obj/item/implanter/sad_trombone
@@ -73,6 +73,11 @@
if(.)
RegisterSignal(target, COMSIG_LIVING_DEATH, .proc/on_death)
/obj/item/implant/explosive/removed(mob/target, silent = FALSE, special = FALSE)
. = ..()
if(.)
UnregisterSignal(target, COMSIG_LIVING_DEATH)
/obj/item/implant/explosive/proc/timed_explosion()
imp_in.visible_message(span_warning("[imp_in] starts beeping ominously!"))
playsound(loc, 'sound/items/timer.ogg', 30, FALSE)
@@ -31,25 +31,6 @@
special_desc_requirement = EXAMINE_CHECK_SYNDICATE // Skyrat edit
special_desc = "A Syndicate implanter used for a EMP implant" // Skyrat edit
//Health Tracker Implant
/obj/item/implant/health
name = "health implant"
activated = FALSE
var/healthstring = ""
/obj/item/implant/health/proc/sensehealth()
if (!imp_in)
return "ERROR"
else
if(isliving(imp_in))
var/mob/living/L = imp_in
healthstring = "<small>Oxygen Deprivation Damage => [round(L.getOxyLoss())]<br />Fire Damage => [round(L.getFireLoss())]<br />Toxin Damage => [round(L.getToxLoss())]<br />Brute Force Damage => [round(L.getBruteLoss())]</small>"
if (!healthstring)
healthstring = "ERROR"
return healthstring
/obj/item/implant/radio
name = "internal radio implant"
activated = TRUE
@@ -9,9 +9,19 @@
"}
return dat
/obj/item/implant/mortis/trigger(emote, mob/source)
if(emote == "deathgasp")
playsound(source.loc, 'modular_skyrat/modules/chaplain/sound/misc/mortis.ogg', 50, 0)
/obj/item/implant/mortis/implant(mob/living/target, mob/user, silent = FALSE, force = FALSE)
. = ..()
if(.)
RegisterSignal(target, COMSIG_MOB_EMOTED("deathgasp"), .proc/on_deathgasp)
/obj/item/implant/mortis/removed(mob/target, silent = FALSE, special = FALSE)
. = ..()
if(.)
UnregisterSignal(target, COMSIG_MOB_EMOTED("deathgasp"))
/obj/item/implant/mortis/proc/on_deathgasp(mob/source)
SIGNAL_HANDLER
playsound(source.loc, 'modular_skyrat/modules/chaplain/sound/misc/mortis.ogg', 50, 0)
/obj/item/implanter/mortis
name = "implanter (MORTIS)"