From 7c5d7c4d75f0afb3fd85a6b42122ceab2348a962 Mon Sep 17 00:00:00 2001 From: Anewbe Date: Thu, 28 Sep 2017 20:25:46 -0500 Subject: [PATCH 1/4] Improves tracking implant code, adds a tracking implant variant to the loadout --- .../objects/items/weapons/implants/implant.dm | 31 ++++++++++++++++++- .../items/weapons/implants/implantpad.dm | 2 +- .../objects/items/weapons/teleportation.dm | 7 +---- .../loadout/loadout_utility.dm | 9 ++++-- code/modules/mob/living/carbon/human/life.dm | 13 ++++---- 5 files changed, 46 insertions(+), 16 deletions(-) diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index 806047ae375..e90a67bc0c7 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -69,8 +69,37 @@ /obj/item/weapon/implant/tracking name = "tracking implant" desc = "Track with this." - var/id = 1.0 + var/id = 1 + var/degrade_time = 10 MINUTES //How long before the implant stops working outside of a living body. +/obj/item/weapon/implant/tracking/weak //This is for the loadout + degrade_time = 2.5 MINUTES + +/obj/item/weapon/implant/tracking/New() + id = rand(1, 1000) + ..() + +/obj/item/weapon/implant/tracking/implanted(var/mob/source) + processing_objects.Add(src) + listening_objects |= src + return 1 + +/obj/item/weapon/implant/tracking/Destroy() + processing_objects.Remove(src) + ..() + +/obj/item/weapon/implant/tracking/process() + var/implant_location = src.loc + if(ismob(implant_location)) + var/mob/living/L = implant_location + if(L.stat == 2) + if(world.time >= L.timeofdeath + degrade_time) + name = "melted implant" + desc = "Charred circuit in melted plastic case. Wonder what that used to be..." + icon_state = "implant_melted" + malfunction = MALFUNCTION_PERMANENT + processing_objects.Remove(src) + return 1 /obj/item/weapon/implant/tracking/get_data() var/dat = {"Implant Specifications:
diff --git a/code/game/objects/items/weapons/implants/implantpad.dm b/code/game/objects/items/weapons/implants/implantpad.dm index dc054536acf..ebc01c6ebb7 100644 --- a/code/game/objects/items/weapons/implants/implantpad.dm +++ b/code/game/objects/items/weapons/implants/implantpad.dm @@ -82,7 +82,7 @@ if (href_list["tracking_id"]) var/obj/item/weapon/implant/tracking/T = src.case.imp T.id += text2num(href_list["tracking_id"]) - T.id = min(100, T.id) + T.id = min(1000, T.id) T.id = max(1, T.id) if (istype(src.loc, /mob)) diff --git a/code/game/objects/items/weapons/teleportation.dm b/code/game/objects/items/weapons/teleportation.dm index b27ef63a4a4..e0e11a6285c 100644 --- a/code/game/objects/items/weapons/teleportation.dm +++ b/code/game/objects/items/weapons/teleportation.dm @@ -79,13 +79,8 @@ Frequency: src.temp += "Extranneous Signals:
" for (var/obj/item/weapon/implant/tracking/W in world) - if (!W.implanted || !(istype(W.loc,/obj/item/organ/external) || ismob(W.loc))) + if (!W.implanted || !(istype(W.loc,/obj/item/organ/external) || ismob(W.loc) || W.malfunction)) continue - else - var/mob/M = W.loc - if (M.stat == 2) - if (M.timeofdeath + 6000 < world.time) - continue var/turf/tr = get_turf(W) if (tr.z == sr.z && tr) diff --git a/code/modules/client/preference_setup/loadout/loadout_utility.dm b/code/modules/client/preference_setup/loadout/loadout_utility.dm index 5e7fa24d9f7..b990906fea9 100644 --- a/code/modules/client/preference_setup/loadout/loadout_utility.dm +++ b/code/modules/client/preference_setup/loadout/loadout_utility.dm @@ -76,12 +76,17 @@ display_name = "cell, device" path = /obj/item/weapon/cell/device -/datum/gear/utility/implant //This does nothing if you don't actually know EAL. +/datum/gear/utility/implant/eal //This does nothing if you don't actually know EAL. display_name = "implant, language, EAL" path = /obj/item/weapon/implant/language/eal cost = 2 slot = "implant" - var/implant_type = "EAL" + +/datum/gear/utility/implant/tracking + display_name = "implant, tracking" + path = /obj/item/weapon/implant/tracking/weak + cost = 10 + slot = "implant" /datum/gear/utility/translator display_name = "universal translator" diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm index 96f5dddc424..6e3fbe43059 100644 --- a/code/modules/mob/living/carbon/human/life.dm +++ b/code/modules/mob/living/carbon/human/life.dm @@ -1649,12 +1649,13 @@ for(var/obj/item/weapon/implant/I in src) if(I.implanted) - if(istype(I,/obj/item/weapon/implant/tracking)) - holder1.icon_state = "hud_imp_tracking" - if(istype(I,/obj/item/weapon/implant/loyalty)) - holder2.icon_state = "hud_imp_loyal" - if(istype(I,/obj/item/weapon/implant/chem)) - holder3.icon_state = "hud_imp_chem" + if(!I.malfunction) + if(istype(I,/obj/item/weapon/implant/tracking)) + holder1.icon_state = "hud_imp_tracking" + if(istype(I,/obj/item/weapon/implant/loyalty)) + holder2.icon_state = "hud_imp_loyal" + if(istype(I,/obj/item/weapon/implant/chem)) + holder3.icon_state = "hud_imp_chem" hud_list[IMPTRACK_HUD] = holder1 hud_list[IMPLOYAL_HUD] = holder2 From 969aa45e9ad69e0671d03ed115b6c2ff717f6f56 Mon Sep 17 00:00:00 2001 From: Anewbe Date: Fri, 29 Sep 2017 12:07:16 -0500 Subject: [PATCH 2/4] Switches 2 for DEAD --- code/game/objects/items/weapons/implants/implant.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index e90a67bc0c7..e2c05c8e86a 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -92,7 +92,7 @@ var/implant_location = src.loc if(ismob(implant_location)) var/mob/living/L = implant_location - if(L.stat == 2) + if(L.stat == DEAD) if(world.time >= L.timeofdeath + degrade_time) name = "melted implant" desc = "Charred circuit in melted plastic case. Wonder what that used to be..." From 5e635aff4673627672e991f628d58985d9901a99 Mon Sep 17 00:00:00 2001 From: Anewbe Date: Mon, 2 Oct 2017 00:11:27 -0500 Subject: [PATCH 3/4] Adds a hacky method to put loadout implants in the user's antag records. Fixes a runtime. --- code/game/objects/items/weapons/implants/implant.dm | 2 +- code/modules/mob/living/carbon/human/human.dm | 2 ++ code/modules/mob/mob_defines.dm | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/code/game/objects/items/weapons/implants/implant.dm b/code/game/objects/items/weapons/implants/implant.dm index e2c05c8e86a..ac433353e05 100644 --- a/code/game/objects/items/weapons/implants/implant.dm +++ b/code/game/objects/items/weapons/implants/implant.dm @@ -86,7 +86,7 @@ /obj/item/weapon/implant/tracking/Destroy() processing_objects.Remove(src) - ..() + return ..() /obj/item/weapon/implant/tracking/process() var/implant_location = src.loc diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 3a24f95360e..7e50773cb50 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -175,6 +175,8 @@ var/obj/item/organ/external/affected = src.organs_by_name[BP_HEAD] affected.implants += I I.part = affected + exploit_addons |= I + exploit_record += " Has an implanted [I.name]." I.implanted(src) /mob/living/carbon/human/proc/implant_loyalty(override = FALSE) // Won't override by default. diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 427786ad41c..ea7520d5a85 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -72,6 +72,7 @@ var/sec_record = "" var/gen_record = "" var/exploit_record = "" + var/exploit_addons = list() var/blinded = null var/bhunger = 0 //Carbon var/ajourn = 0 From 860c1d2e9f6488c90680e6bbb42d8eaf26d6f62d Mon Sep 17 00:00:00 2001 From: Anewbe Date: Mon, 2 Oct 2017 03:08:01 -0500 Subject: [PATCH 4/4] Makes the auto-antag-record logging for loadout items prettier --- code/game/jobs/job_controller.dm | 2 ++ code/modules/client/preference_setup/loadout/loadout.dm | 1 + .../client/preference_setup/loadout/loadout_utility.dm | 3 +++ code/modules/mob/living/carbon/human/human.dm | 2 -- code/modules/mob/mob.dm | 7 +++++++ code/modules/mob/mob_defines.dm | 2 +- 6 files changed, 14 insertions(+), 3 deletions(-) diff --git a/code/game/jobs/job_controller.dm b/code/game/jobs/job_controller.dm index 9e3efc53dab..ee7dd75ebc0 100644 --- a/code/game/jobs/job_controller.dm +++ b/code/game/jobs/job_controller.dm @@ -352,6 +352,8 @@ var/global/datum/controller/occupations/job_master H << "Your current species, job or whitelist status does not permit you to spawn with [thing]!" continue + H.amend_exploitable(G.path) + if(G.slot == "implant") H.implant_loadout(G) continue diff --git a/code/modules/client/preference_setup/loadout/loadout.dm b/code/modules/client/preference_setup/loadout/loadout.dm index 3891bf05627..44a814ac679 100644 --- a/code/modules/client/preference_setup/loadout/loadout.dm +++ b/code/modules/client/preference_setup/loadout/loadout.dm @@ -204,6 +204,7 @@ var/list/gear_datums = list() var/whitelisted //Term to check the whitelist for.. var/sort_category = "General" var/list/gear_tweaks = list() //List of datums which will alter the item after it has been spawned. + var/exploitable = 0 //Does it go on the exploitable information list? /datum/gear/New() ..() diff --git a/code/modules/client/preference_setup/loadout/loadout_utility.dm b/code/modules/client/preference_setup/loadout/loadout_utility.dm index b990906fea9..e973bf232c6 100644 --- a/code/modules/client/preference_setup/loadout/loadout_utility.dm +++ b/code/modules/client/preference_setup/loadout/loadout_utility.dm @@ -76,6 +76,9 @@ display_name = "cell, device" path = /obj/item/weapon/cell/device +/datum/gear/utility/implant + exploitable = 1 + /datum/gear/utility/implant/eal //This does nothing if you don't actually know EAL. display_name = "implant, language, EAL" path = /obj/item/weapon/implant/language/eal diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 7e50773cb50..3a24f95360e 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -175,8 +175,6 @@ var/obj/item/organ/external/affected = src.organs_by_name[BP_HEAD] affected.implants += I I.part = affected - exploit_addons |= I - exploit_record += " Has an implanted [I.name]." I.implanted(src) /mob/living/carbon/human/proc/implant_loyalty(override = FALSE) // Won't override by default. diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm index 9dc1c3eedc5..92a8b3bdebc 100644 --- a/code/modules/mob/mob.dm +++ b/code/modules/mob/mob.dm @@ -1059,6 +1059,13 @@ mob/proc/yank_out_object() /mob/proc/is_muzzled() return 0 +//Exploitable Info Update + +/mob/proc/amend_exploitable(var/obj/item/I) + var/obj/item/exploit_item = new I(src.loc) + exploit_addons |= exploit_item + var/exploitmsg = html_decode("\n" + "Has " + exploit_item.name + ".") + exploit_record += exploitmsg /client/proc/check_has_body_select() return mob && mob.hud_used && istype(mob.zone_sel, /obj/screen/zone_sel) diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index ea7520d5a85..e296db2ab9c 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -72,7 +72,7 @@ var/sec_record = "" var/gen_record = "" var/exploit_record = "" - var/exploit_addons = list() + var/exploit_addons = list() //Assorted things that show up at the end of the exploit_record list var/blinded = null var/bhunger = 0 //Carbon var/ajourn = 0