From 383a331f4634b0963720129176854b0c21814a75 Mon Sep 17 00:00:00 2001 From: datlo Date: Tue, 6 Nov 2018 20:01:19 +0000 Subject: [PATCH 1/4] Adds the toxins payload casing to crafting Adds a new type of bomb payload : The toxins payload. Crafted with a matter bin, metal, and a remote signaller, it must be loaded with a tank transfer valve and put into a plasteel bomb casing in order to do anything. Once the bomb detonates, the toxins payload will open the TTV (causing an explosion if the mix is correct). As with syndicate bombs, a bomb with a toxin payload has a minimum 90 second timer, and will beep loudly to warn nearby crew to evacuate the area. It can be defused (or accidentally detonated early) in the same way a syndicate bomb can. This allows scientists a secure way to test their bombs (less chances of accidental detonations with this method, although it adds extra steps), and antagonists a way to craft their own syndicate bomb, which is better than a simple tank transfer valve if your objective is not killing crew but making sure a specific area is wiped off the station map with little to no casualties. --- code/game/machinery/syndicatebomb.dm | 36 ++++++++++++++++++++++++++++ code/modules/crafting/recipes.dm | 10 ++++++++ 2 files changed, 46 insertions(+) diff --git a/code/game/machinery/syndicatebomb.dm b/code/game/machinery/syndicatebomb.dm index fda550217ad..26181fcd801 100644 --- a/code/game/machinery/syndicatebomb.dm +++ b/code/game/machinery/syndicatebomb.dm @@ -530,6 +530,42 @@ qdel(G) +/obj/item/bombcore/toxins + name = "toxins payload" + desc = "A payload casing designed to secure a gas based bomb. Must be loaded with a tank transfer valve and installed into a plasteel bomb frame in order to be detonated." + origin_tech = "materials=1;engineering=1" + icon_state = "chemcore" + var/obj/item/transfer_valve/ttv = null + +/obj/item/bombcore/toxins/attackby(obj/item/I, mob/user, params) + if(iscrowbar(I) && ttv != null) + playsound(loc, I.usesound, 50, 1) + ttv.loc = get_turf(src) + ttv = null + return + else if(istype(I, /obj/item/transfer_valve)) + if(!ttv) + if(!user.drop_item()) + return + to_chat(user, "You load [src] with [I].") + ttv = I + I.loc = src + else + to_chat(user, "Another tank transfer valve is already loaded.") + return + else + return ..() + +/obj/item/bombcore/toxins/ex_act(severity) //No chain reactions, the explosion only occurs when gas mixes + return + +/obj/item/bombcore/toxins/burn() + return + +/obj/item/bombcore/toxins/detonate() + if(ttv != null) + ttv.toggle_valve() + ///Syndicate Detonator (aka the big red button)/// /obj/item/syndicatedetonator diff --git a/code/modules/crafting/recipes.dm b/code/modules/crafting/recipes.dm index 012c79bab06..47966bb5278 100644 --- a/code/modules/crafting/recipes.dm +++ b/code/modules/crafting/recipes.dm @@ -339,6 +339,16 @@ time = 50 category = CAT_WEAPON +/datum/crafting_recipe/toxins_payload + name = "Toxins Payload Casing" + result = /obj/item/bombcore/toxins + reqs = list( + /obj/item/stock_parts/matter_bin = 1, + /obj/item/assembly/signaler = 1, + /obj/item/stack/sheet/metal = 2 + ) + category = CAT_WEAPON + /datum/crafting_recipe/bonfire name = "Bonfire" time = 60 From 0a18490e16a623ba017a1bc5eec87cd079714950 Mon Sep 17 00:00:00 2001 From: datlo Date: Tue, 6 Nov 2018 20:12:33 +0000 Subject: [PATCH 2/4] removed useless nulls --- code/game/machinery/syndicatebomb.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/syndicatebomb.dm b/code/game/machinery/syndicatebomb.dm index 26181fcd801..35c5c1b6707 100644 --- a/code/game/machinery/syndicatebomb.dm +++ b/code/game/machinery/syndicatebomb.dm @@ -538,7 +538,7 @@ var/obj/item/transfer_valve/ttv = null /obj/item/bombcore/toxins/attackby(obj/item/I, mob/user, params) - if(iscrowbar(I) && ttv != null) + if(iscrowbar(I) && ttv) playsound(loc, I.usesound, 50, 1) ttv.loc = get_turf(src) ttv = null @@ -563,7 +563,7 @@ return /obj/item/bombcore/toxins/detonate() - if(ttv != null) + if(ttv) ttv.toggle_valve() ///Syndicate Detonator (aka the big red button)/// From 93c336d4318c12459451ea75d3e54a8e40ae6c26 Mon Sep 17 00:00:00 2001 From: datlo Date: Tue, 6 Nov 2018 20:26:33 +0000 Subject: [PATCH 3/4] thanks for reviewing my shit code fam --- code/game/machinery/syndicatebomb.dm | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/code/game/machinery/syndicatebomb.dm b/code/game/machinery/syndicatebomb.dm index 35c5c1b6707..15d232845fa 100644 --- a/code/game/machinery/syndicatebomb.dm +++ b/code/game/machinery/syndicatebomb.dm @@ -537,22 +537,20 @@ icon_state = "chemcore" var/obj/item/transfer_valve/ttv = null -/obj/item/bombcore/toxins/attackby(obj/item/I, mob/user, params) +/obj/item/bombcore/toxins/attackby(obj/item/I, mob/user) if(iscrowbar(I) && ttv) playsound(loc, I.usesound, 50, 1) - ttv.loc = get_turf(src) + ttv.forceMove(get_turf(src)) ttv = null - return else if(istype(I, /obj/item/transfer_valve)) if(!ttv) if(!user.drop_item()) return to_chat(user, "You load [src] with [I].") ttv = I - I.loc = src + I.forceMove(src) else to_chat(user, "Another tank transfer valve is already loaded.") - return else return ..() From 8404fc1d5a32a713e23505fa95f67f7dd1fb0861 Mon Sep 17 00:00:00 2001 From: datlo Date: Tue, 6 Nov 2018 22:42:03 +0000 Subject: [PATCH 4/4] Add check for attached component --- code/game/machinery/syndicatebomb.dm | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/syndicatebomb.dm b/code/game/machinery/syndicatebomb.dm index 15d232845fa..d70508e620b 100644 --- a/code/game/machinery/syndicatebomb.dm +++ b/code/game/machinery/syndicatebomb.dm @@ -543,17 +543,25 @@ ttv.forceMove(get_turf(src)) ttv = null else if(istype(I, /obj/item/transfer_valve)) - if(!ttv) + if(!ttv && !check_attached(I)) if(!user.drop_item()) return to_chat(user, "You load [src] with [I].") ttv = I I.forceMove(src) - else + else if (ttv) to_chat(user, "Another tank transfer valve is already loaded.") + else + to_chat(user, "Remove the attached assembly component first.") else return ..() +/obj/item/bombcore/toxins/proc/check_attached(obj/item/transfer_valve/ttv) + if (ttv.attached_device) + return TRUE + else + return FALSE + /obj/item/bombcore/toxins/ex_act(severity) //No chain reactions, the explosion only occurs when gas mixes return