From 01c94a8e0a62d3ee961f728fece96a82921fb83d Mon Sep 17 00:00:00 2001 From: iloveloopers <140007537+iloveloopers@users.noreply.github.com> Date: Fri, 19 Apr 2024 12:32:08 -0400 Subject: [PATCH 01/10] Update flamer.dm --- .../modules/projectiles/guns/flamer/flamer.dm | 69 ++++++++++++++++++- 1 file changed, 66 insertions(+), 3 deletions(-) diff --git a/code/modules/projectiles/guns/flamer/flamer.dm b/code/modules/projectiles/guns/flamer/flamer.dm index 64499a71bb12..e76ac78d58b5 100644 --- a/code/modules/projectiles/guns/flamer/flamer.dm +++ b/code/modules/projectiles/guns/flamer/flamer.dm @@ -136,10 +136,13 @@ click_empty(user) else user.track_shot(initial(name)) - if(current_mag.reagents.has_reagent("stablefoam")) - unleash_foam(target, user) + if(istype(current_mag, /obj/item/ammo_magazine/flamer_tank/smoke)) + unleash_smoke(target, user) else - unleash_flame(target, user) + if(current_mag.reagents.has_reagent("stablefoam")) + unleash_foam(target, user) + else + unleash_flame(target, user) return AUTOFIRE_CONTINUE return NONE @@ -229,6 +232,66 @@ new /obj/flamer_fire(to_fire, create_cause_data(initial(name), user), R, max_range, current_mag.reagents, flameshape, target, CALLBACK(src, PROC_REF(show_percentage), user), fuel_pressure, fire_type) +/obj/item/weapon/gun/flamer/proc/unleash_smoke(atom/target, mob/living/user) + last_fired = world.time + if(!current_mag || !current_mag.reagents || !current_mag.reagents.reagent_list.len) + return + + var/source_turf = get_turf(user) + var/smoke_range = 7 // the max range the smoke will travel + var/distance = 0 // the distance traveled + var/use_multiplier = 2 // if you want to increase the ammount of units drained from the tank + var/units_in_smoke = 35 // the smoke overlaps a little so this much is probably already good + + var/datum/reagent/chemical = current_mag.reagents.reagent_list[1] + var/datum/reagents/to_disperse = new() // this is the chemholder that will be used by the chemsmoke + to_disperse.add_reagent(chemical.id, units_in_smoke) + to_disperse.my_atom = src + + var/turf/turfs[] = get_line(user, target, FALSE) + var/turf/first_turf = turfs[1] + var/turf/second_turf = turfs[2] + var/ammount_required = (min(turfs.len, smoke_range) * use_multiplier) // the ammount of units that this click requires + for(var/turf/turf in turfs) + + if(chemical.volume < ammount_required) + smoke_range = round(chemical.volume / use_multiplier) + + if(distance >= smoke_range) + break + + if(turf.density) + break + else + var/obj/effect/particle_effect/smoke/chem/checker = new() + var/atom/blocked = LinkBlocked(checker, source_turf, turf) + if(blocked) + break + + playsound(turf, 'sound/effects/smoke.ogg', 25, 1) + if(turf != first_turf && turf != second_turf) // we skip the first tile and make it small on the second so the smoke doesn't touch the user + var/datum/effect_system/smoke_spread/chem/smoke = new() + smoke.set_up(to_disperse, 5, loca = turf) + smoke.start() + if(turf == second_turf) + var/datum/effect_system/smoke_spread/chem/smoke = new() + smoke.set_up(to_disperse, 1, loca = turf) + smoke.start() + sleep(2) + + distance++ + + var/ammount_used = distance * use_multiplier // the actual ammount of units that we used + + chemical.volume = max(chemical.volume - ammount_used, 0) + + current_mag.reagents.total_volume = chemical.volume // this is needed for show_percentage to work + + if(chemical.volume < use_multiplier) // there aren't enough units left for a single tile of smoke, empty the tank + current_mag.reagents.clear_reagents() + + show_percentage(user) + /obj/item/weapon/gun/flamer/proc/unleash_foam(atom/target, mob/living/user) last_fired = world.time if(!current_mag || !current_mag.reagents || !current_mag.reagents.reagent_list.len) From 11d948162884543e837d8781fdcf6c5129ae7d8b Mon Sep 17 00:00:00 2001 From: iloveloopers <140007537+iloveloopers@users.noreply.github.com> Date: Fri, 19 Apr 2024 12:35:19 -0400 Subject: [PATCH 02/10] Update flamer.dm --- code/modules/projectiles/magazines/flamer.dm | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/code/modules/projectiles/magazines/flamer.dm b/code/modules/projectiles/magazines/flamer.dm index dfd9eda20d8a..65a66cd744de 100644 --- a/code/modules/projectiles/magazines/flamer.dm +++ b/code/modules/projectiles/magazines/flamer.dm @@ -90,7 +90,8 @@ to_chat(user, SPAN_WARNING("You can't mix fuel mixtures!")) return - if(!to_add.intensityfire && to_add.id != "stablefoam") + var/is_smoke_tank = istype(src, /obj/item/ammo_magazine/flamer_tank/smoke) + if(!to_add.intensityfire && to_add.id != "stablefoam" && !is_smoke_tank) to_chat(user, SPAN_WARNING("This chemical is not potent enough to be used in a flamethrower!")) return @@ -236,3 +237,9 @@ max_intensity = 60 max_range = 8 max_duration = 50 + +/obj/item/ammo_magazine/flamer_tank/smoke + name = "Custom incinerator smoke tank" + desc = "A tank holding powdered smoke that expands when exposed to an open flame and carries any chemicals along with it." + matter = list("metal" = 3750) + flamer_chem = null From 206a74818909dd53e1779ee87e76fcbb907c80c7 Mon Sep 17 00:00:00 2001 From: iloveloopers <140007537+iloveloopers@users.noreply.github.com> Date: Fri, 19 Apr 2024 12:36:45 -0400 Subject: [PATCH 03/10] Update gun_attachables.dm --- code/modules/projectiles/gun_attachables.dm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/modules/projectiles/gun_attachables.dm b/code/modules/projectiles/gun_attachables.dm index a2801821349c..de8d544d87bc 100644 --- a/code/modules/projectiles/gun_attachables.dm +++ b/code/modules/projectiles/gun_attachables.dm @@ -2502,7 +2502,7 @@ Defined in conflicts.dm of the #defines folder. /obj/item/attachable/stock/smg/collapsible/brace/apply_on_weapon(obj/item/weapon/gun/G) if(stock_activated) - G.flags_item |= NODROP|FORCEDROP_CONDITIONAL + G.flags_item |= NODROP accuracy_mod = -HIT_ACCURACY_MULT_TIER_3 scatter_mod = SCATTER_AMOUNT_TIER_8 recoil_mod = RECOIL_AMOUNT_TIER_2 //Hurts pretty bad if it's wielded. @@ -2513,7 +2513,7 @@ Defined in conflicts.dm of the #defines folder. icon_state = "smg_brace_on" attach_icon = "smg_brace_a_on" else - G.flags_item &= ~(NODROP|FORCEDROP_CONDITIONAL) + G.flags_item &= ~NODROP accuracy_mod = 0 scatter_mod = 0 recoil_mod = 0 @@ -3225,6 +3225,9 @@ Defined in conflicts.dm of the #defines folder. to_chat(user, SPAN_WARNING("This chemical will clog the nozzle!")) return + if(istype(gun.current_mag, /obj/item/ammo_magazine/flamer_tank/smoke)) // you can't fire smoke like a projectile! + to_chat(user, SPAN_WARNING("\The nozzle can't be used with this fuel tank!")) + gun.last_fired = world.time gun.current_mag.reagents.remove_reagent(flamer_reagent.id, FLAME_REAGENT_USE_AMOUNT * fuel_per_projectile) From d880f374ef52f8132129da031f24e34091b7b95b Mon Sep 17 00:00:00 2001 From: iloveloopers <140007537+iloveloopers@users.noreply.github.com> Date: Fri, 19 Apr 2024 12:38:19 -0400 Subject: [PATCH 04/10] Update gun_attachables.dm --- code/modules/projectiles/gun_attachables.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/projectiles/gun_attachables.dm b/code/modules/projectiles/gun_attachables.dm index de8d544d87bc..de1783c7021a 100644 --- a/code/modules/projectiles/gun_attachables.dm +++ b/code/modules/projectiles/gun_attachables.dm @@ -2502,7 +2502,7 @@ Defined in conflicts.dm of the #defines folder. /obj/item/attachable/stock/smg/collapsible/brace/apply_on_weapon(obj/item/weapon/gun/G) if(stock_activated) - G.flags_item |= NODROP + G.flags_item |= NODROP|FORCEDROP_CONDITIONAL accuracy_mod = -HIT_ACCURACY_MULT_TIER_3 scatter_mod = SCATTER_AMOUNT_TIER_8 recoil_mod = RECOIL_AMOUNT_TIER_2 //Hurts pretty bad if it's wielded. @@ -2513,7 +2513,7 @@ Defined in conflicts.dm of the #defines folder. icon_state = "smg_brace_on" attach_icon = "smg_brace_a_on" else - G.flags_item &= ~NODROP + G.flags_item &= ~(NODROP|FORCEDROP_CONDITIONAL) accuracy_mod = 0 scatter_mod = 0 recoil_mod = 0 From 61103a8effb98114267e2c69e816e2d3c3e16b09 Mon Sep 17 00:00:00 2001 From: iloveloopers <140007537+iloveloopers@users.noreply.github.com> Date: Fri, 19 Apr 2024 12:39:13 -0400 Subject: [PATCH 05/10] Update autolathe_datums.dm --- code/game/machinery/autolathe_datums.dm | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/code/game/machinery/autolathe_datums.dm b/code/game/machinery/autolathe_datums.dm index 01a40b3638f6..8abf2b96bc1c 100644 --- a/code/game/machinery/autolathe_datums.dm +++ b/code/game/machinery/autolathe_datums.dm @@ -331,6 +331,11 @@ path = /obj/item/ammo_magazine/flamer_tank/custom/large category = AUTOLATHE_CATEGORY_EXPLOSIVES +/datum/autolathe/recipe/armylathe/smoke_tank + name = "Custom M240A1 Smoke Tank" + path = /obj/item/ammo_magazine/flamer_tank/smoke + category = AUTOLATHE_CATEGORY_EXPLOSIVES + //Medilathe recipes /datum/autolathe/recipe/medilathe category = AUTOLATHE_CATEGORY_MEDICAL From d601d8cbdce5feed7233d5c72a7b5f81b0f600e4 Mon Sep 17 00:00:00 2001 From: iloveloopers <140007537+iloveloopers@users.noreply.github.com> Date: Fri, 19 Apr 2024 12:46:00 -0400 Subject: [PATCH 06/10] Update gun_attachables.dm --- code/modules/projectiles/gun_attachables.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/projectiles/gun_attachables.dm b/code/modules/projectiles/gun_attachables.dm index de1783c7021a..15ebcf888922 100644 --- a/code/modules/projectiles/gun_attachables.dm +++ b/code/modules/projectiles/gun_attachables.dm @@ -3226,7 +3226,7 @@ Defined in conflicts.dm of the #defines folder. return if(istype(gun.current_mag, /obj/item/ammo_magazine/flamer_tank/smoke)) // you can't fire smoke like a projectile! - to_chat(user, SPAN_WARNING("\The nozzle can't be used with this fuel tank!")) + to_chat(user, SPAN_WARNING("\The [src] can't be used with this fuel tank!")) gun.last_fired = world.time gun.current_mag.reagents.remove_reagent(flamer_reagent.id, FLAME_REAGENT_USE_AMOUNT * fuel_per_projectile) From 84e1eab7dd0e59ba6b4e5384c2263ae3c5e7bc47 Mon Sep 17 00:00:00 2001 From: iloveloopers <140007537+iloveloopers@users.noreply.github.com> Date: Fri, 19 Apr 2024 12:50:24 -0400 Subject: [PATCH 07/10] Update gun_attachables.dm --- code/modules/projectiles/gun_attachables.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/modules/projectiles/gun_attachables.dm b/code/modules/projectiles/gun_attachables.dm index 15ebcf888922..915e891c82dc 100644 --- a/code/modules/projectiles/gun_attachables.dm +++ b/code/modules/projectiles/gun_attachables.dm @@ -3227,6 +3227,7 @@ Defined in conflicts.dm of the #defines folder. if(istype(gun.current_mag, /obj/item/ammo_magazine/flamer_tank/smoke)) // you can't fire smoke like a projectile! to_chat(user, SPAN_WARNING("\The [src] can't be used with this fuel tank!")) + return gun.last_fired = world.time gun.current_mag.reagents.remove_reagent(flamer_reagent.id, FLAME_REAGENT_USE_AMOUNT * fuel_per_projectile) From 844edfb61efeeec05f2d082baf34ef266d0ca83f Mon Sep 17 00:00:00 2001 From: iloveloopers <140007537+iloveloopers@users.noreply.github.com> Date: Tue, 23 Apr 2024 23:30:03 -0400 Subject: [PATCH 08/10] Update code/modules/projectiles/guns/flamer/flamer.dm Co-authored-by: Drathek <76988376+Drulikar@users.noreply.github.com> --- code/modules/projectiles/guns/flamer/flamer.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/projectiles/guns/flamer/flamer.dm b/code/modules/projectiles/guns/flamer/flamer.dm index e76ac78d58b5..0388f5be7aef 100644 --- a/code/modules/projectiles/guns/flamer/flamer.dm +++ b/code/modules/projectiles/guns/flamer/flamer.dm @@ -238,9 +238,9 @@ return var/source_turf = get_turf(user) - var/smoke_range = 7 // the max range the smoke will travel + var/smoke_range = 5 // the max range the smoke will travel var/distance = 0 // the distance traveled - var/use_multiplier = 2 // if you want to increase the ammount of units drained from the tank + var/use_multiplier = 3 // if you want to increase the ammount of units drained from the tank var/units_in_smoke = 35 // the smoke overlaps a little so this much is probably already good var/datum/reagent/chemical = current_mag.reagents.reagent_list[1] From 25008d2d86bc601c4f941e217048fbe59b2dd961 Mon Sep 17 00:00:00 2001 From: iloveloopers <140007537+iloveloopers@users.noreply.github.com> Date: Tue, 23 Apr 2024 23:30:11 -0400 Subject: [PATCH 09/10] Update code/modules/projectiles/gun_attachables.dm Co-authored-by: Drathek <76988376+Drulikar@users.noreply.github.com> --- code/modules/projectiles/gun_attachables.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/projectiles/gun_attachables.dm b/code/modules/projectiles/gun_attachables.dm index 915e891c82dc..bc2b9a5a516f 100644 --- a/code/modules/projectiles/gun_attachables.dm +++ b/code/modules/projectiles/gun_attachables.dm @@ -3226,7 +3226,7 @@ Defined in conflicts.dm of the #defines folder. return if(istype(gun.current_mag, /obj/item/ammo_magazine/flamer_tank/smoke)) // you can't fire smoke like a projectile! - to_chat(user, SPAN_WARNING("\The [src] can't be used with this fuel tank!")) + to_chat(user, SPAN_WARNING("[src] can't be used with this fuel tank!")) return gun.last_fired = world.time From 695ca15bf6b784074a0a48c45476c8e7979b86a8 Mon Sep 17 00:00:00 2001 From: iloveloopers <140007537+iloveloopers@users.noreply.github.com> Date: Tue, 23 Apr 2024 23:30:18 -0400 Subject: [PATCH 10/10] Update code/modules/projectiles/magazines/flamer.dm Co-authored-by: Drathek <76988376+Drulikar@users.noreply.github.com> --- code/modules/projectiles/magazines/flamer.dm | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/code/modules/projectiles/magazines/flamer.dm b/code/modules/projectiles/magazines/flamer.dm index 65a66cd744de..bf5663cad069 100644 --- a/code/modules/projectiles/magazines/flamer.dm +++ b/code/modules/projectiles/magazines/flamer.dm @@ -90,8 +90,7 @@ to_chat(user, SPAN_WARNING("You can't mix fuel mixtures!")) return - var/is_smoke_tank = istype(src, /obj/item/ammo_magazine/flamer_tank/smoke) - if(!to_add.intensityfire && to_add.id != "stablefoam" && !is_smoke_tank) + if(!to_add.intensityfire && to_add.id != "stablefoam" && !istype(src, /obj/item/ammo_magazine/flamer_tank/smoke)) to_chat(user, SPAN_WARNING("This chemical is not potent enough to be used in a flamethrower!")) return