From 692c80e55d071298875b071efc4715c09bf7d044 Mon Sep 17 00:00:00 2001 From: SkyratBot <59378654+SkyratBot@users.noreply.github.com> Date: Mon, 24 Aug 2020 23:53:10 +0200 Subject: [PATCH] [MIRROR] Disposable Sentry Gun Deployment System (#495) * Disposable Sentry Gun Deployment System (#52931) Adds a new engineer only traitor item, the disposable sentry gun deployment system. It's a red toolbox that works and functions as a normal toolbox, until you attack it on harm intent with a wrench. Upon bashing it with a wrench, the toolbox will transform into a ballistic sentry gun, theoretically shooting at your enemies, and not you. The turret only has 100 health however, so it will not last long to anyone with any weapon that can deal enough damage. * Disposable Sentry Gun Deployment System Co-authored-by: Paxilmaniac <57122098+Paxilmaniac@users.noreply.github.com> --- .../machinery/porta_turret/portable_turret.dm | 3 +++ .../objects/items/devices/traitordevices.dm | 22 +++++++++++++++++++ code/modules/uplink/uplink_items.dm | 7 ++++++ 3 files changed, 32 insertions(+) diff --git a/code/game/machinery/porta_turret/portable_turret.dm b/code/game/machinery/porta_turret/portable_turret.dm index 02e8cdb52d9..30a78ea4410 100644 --- a/code/game/machinery/porta_turret/portable_turret.dm +++ b/code/game/machinery/porta_turret/portable_turret.dm @@ -750,6 +750,9 @@ addtimer(CALLBACK(src, .proc/shootAt, target), 15) return TRUE +/obj/machinery/porta_turret/syndicate/pod/toolbox + max_integrity = 100 + /obj/machinery/porta_turret/ai faction = list("silicon") turret_flags = TURRET_FLAG_SHOOT_CRIMINALS | TURRET_FLAG_SHOOT_ANOMALOUS | TURRET_FLAG_SHOOT_HEADS diff --git a/code/game/objects/items/devices/traitordevices.dm b/code/game/objects/items/devices/traitordevices.dm index dc3de0a6312..f92adab3ff7 100644 --- a/code/game/objects/items/devices/traitordevices.dm +++ b/code/game/objects/items/devices/traitordevices.dm @@ -262,3 +262,25 @@ effective or pretty fucking useless. else GLOB.active_jammers -= src update_icon() + +/obj/item/storage/toolbox/emergency/turret + desc = "You feel a strange urge to hit this with a wrench." + +/obj/item/storage/toolbox/emergency/turret/PopulateContents() + new /obj/item/screwdriver(src) + new /obj/item/wrench(src) + new /obj/item/weldingtool(src) + new /obj/item/crowbar(src) + new /obj/item/analyzer(src) + new /obj/item/wirecutters(src) + +/obj/item/storage/toolbox/emergency/turret/attackby(obj/item/I, mob/living/user, params) + if(I.tool_behaviour == TOOL_WRENCH && user.a_intent == INTENT_HARM) + user.visible_message("[user] bashes [src] with [I]!", \ + "You bash [src] with [I]!", null, COMBAT_MESSAGE_RANGE) + playsound(src, "sound/items/drill_use.ogg", 80, TRUE, -1) + var/obj/machinery/porta_turret/syndicate/pod/toolbox/turret = new(get_turf(loc)) + turret.faction = list("[REF(user)]") + qdel(src) + + ..() diff --git a/code/modules/uplink/uplink_items.dm b/code/modules/uplink/uplink_items.dm index 714d5e8dc3e..4882de8e98d 100644 --- a/code/modules/uplink/uplink_items.dm +++ b/code/modules/uplink/uplink_items.dm @@ -1954,6 +1954,13 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item)) cost = 11 restricted_roles = list("Cook") +/datum/uplink_item/role_restricted/turretbox + name = "Disposable Sentry Gun" + desc = "A disposable sentry gun deployment system cleverly disguised as a toolbox, apply wrench for functionality." + item = /obj/item/storage/toolbox/emergency/turret + cost = 11 + restricted_roles = list("Station Engineer") + // Pointless /datum/uplink_item/badass category = "(Pointless) Badassery"