From 2fdf11ca75ecb1a6ae5b3601f26f73678cbbbd66 Mon Sep 17 00:00:00 2001 From: FenodyreeAv Date: Wed, 29 Jul 2026 18:29:31 +0100 Subject: [PATCH] Fixes C4, dirty bombs and nuclear waste (#22945) changes: - bugfix: "Fixes C4 effects not correctly getting their parent item." - bugfix: "Fixes C4 not being placed correctly." - bugfix: "Fixes Dirty Bombs deleting their own radiation source." - bugfix: "Fixes Dirty Bomb goop puddles disapearing long before the radiation does." - bugfix: "Fixes drinking radioactive waste not irradiating you." 3 dirty bombs set off. One on a floor, one on a wall one on a machine. image --------- Signed-off-by: FenodyreeAv --- .../objects/effects/decals/Cleanable/misc.dm | 12 ++++-- .../game/objects/effects/plastic_explosive.dm | 7 ++-- code/game/objects/items/weapons/explosives.dm | 38 ++++++++++++++++--- .../Chemistry-Reagents-Other.dm | 4 +- .../Fenodyree-FixesC4AndDirtyBombs.yml | 8 ++++ 5 files changed, 55 insertions(+), 14 deletions(-) create mode 100644 html/changelogs/Fenodyree-FixesC4AndDirtyBombs.yml diff --git a/code/game/objects/effects/decals/Cleanable/misc.dm b/code/game/objects/effects/decals/Cleanable/misc.dm index 70ac85500e5..bdfdf048398 100644 --- a/code/game/objects/effects/decals/Cleanable/misc.dm +++ b/code/game/objects/effects/decals/Cleanable/misc.dm @@ -55,13 +55,11 @@ /obj/effect/decal/cleanable/greenglow/Initialize(mapload) . = ..() - if (!mapload) // Round-start goo should stick around. - QDEL_IN(src, 2 MINUTES) /obj/effect/decal/cleanable/greenglow/post_sweep(var/mob/user) if(ishuman(user)) var/mob/living/carbon/human/H = user - H.apply_radiation(3) + H.rad_act(30) STOP_PROCESSING(SSprocessing, src) ABSTRACT_TYPE(/obj/effect/decal/cleanable/greenglow/radioactive) @@ -71,6 +69,13 @@ ABSTRACT_TYPE(/obj/effect/decal/cleanable/greenglow/radioactive) light_power = 0.6 light_color = "#64C864" +/obj/effect/decal/cleanable/greenglow/radioactive/post_sweep(var/mob/user) + if(radioactivity) + if(ishuman(user)) + var/mob/living/carbon/human/H = user + H.rad_act(radioactivity) + STOP_PROCESSING(SSprocessing, src) + /obj/effect/decal/cleanable/greenglow/radioactive/antagonist_hints(mob/user, distance, is_adjacent) . += ..() . += "Characters directly adjacent to or on top of this object will be exposed to [radioactivity] IU/s of radiation. Radiation falls off (approximately) by 75% for every tile away you move." @@ -123,7 +128,6 @@ ABSTRACT_TYPE(/obj/effect/decal/cleanable/greenglow/radioactive) /obj/effect/decal/cleanable/greenglow/radioactive/process() SSradiation.radiate(src, radioactivity) - /obj/effect/decal/cleanable/cobweb name = "cobweb" desc = "Somebody should remove that." diff --git a/code/game/objects/effects/plastic_explosive.dm b/code/game/objects/effects/plastic_explosive.dm index 89a5ee5a234..e4887d2f7b7 100644 --- a/code/game/objects/effects/plastic_explosive.dm +++ b/code/game/objects/effects/plastic_explosive.dm @@ -7,6 +7,7 @@ anchored = TRUE density = FALSE mouse_opacity = MOUSE_OPACITY_ICON + layer = ABOVE_DOOR_LAYER var/obj/item/plastique/parent /obj/effect/plastic_explosive/feedback_hints(mob/user, distance, is_adjacent) @@ -16,8 +17,8 @@ /obj/effect/plastic_explosive/Initialize(var/atom/owner_pos, var/atom/target, var/obj/item/plastique/c4) . = ..() + parent = c4 if(parent) - parent = c4 parent.forceMove(src) name = parent.name desc = parent.desc @@ -46,8 +47,8 @@ /obj/effect/plastic_explosive/attack_hand(mob/living/user) to_chat(user, SPAN_WARNING("\The [src] is solidly attached, it doesn't budge!")) -/obj/effect/plastic_explosive/attackby(obj/item/attacking_item, mob/user) - return parent.attackby(attacking_item, user) +/obj/effect/plastic_explosive/attackby(obj/item/attacking_item, mob/user, click_parameters) + return parent.attackby(attacking_item, user, click_parameters) /obj/effect/plastic_explosive/big name = "bundled plastic explosives" diff --git a/code/game/objects/items/weapons/explosives.dm b/code/game/objects/items/weapons/explosives.dm index 8d0196ce998..7ccf1b2384b 100644 --- a/code/game/objects/items/weapons/explosives.dm +++ b/code/game/objects/items/weapons/explosives.dm @@ -48,7 +48,6 @@ /obj/item/plastique/Destroy() qdel(wires) wires = null - qdel(target) target = null return ..() @@ -195,11 +194,40 @@ desc = "A small explosive laced with radium. The explosion is small, but the radioactive material will remain for a fair while." timer = 30 SECONDS -/obj/item/plastique/dirty/explode(turf/location) +/obj/item/plastique/dirty/explode(turf/location) //Does not call parent because we need a different order of operations. + if(!target) + target = get_atom_on_turf(src) + if(!target) + target = src + if(target) + if (istype(target, /turf/simulated/wall)) + var/turf/simulated/wall/W = target + W.dismantle_wall(1, no_product = TRUE) + else if(istype(target, /mob/living)) + target.ex_act(2) // c4 can't gib mobs anymore. + target.rad_act(800) //A dirty bomb going off on top of you completely irradiates you, radsuit or not. + else + target.ex_act(1) + if(location) - SSradiation.radiate(src, 250) - new /obj/effect/decal/cleanable/greenglow/radioactive/medium(get_turf(src)) - ..() + explosion(location, devastation_range, heavy_impact_range, light_impact_range, 3, spreading = 0) + SSradiation.radiate(location, 250) + new /obj/effect/decal/cleanable/greenglow/radioactive/extreme(location) + + for(var/turf/T in RANGE_TURFS(4, location)) + if(T == location) + continue + + if(T in RANGE_TURFS(1, location)) //High radioactive puddles 1 tile from the epicenter, medium up to 4 tiles away. + if(prob(75)) + new /obj/effect/decal/cleanable/greenglow/radioactive/high(T) + else if(prob(25)) + new /obj/effect/decal/cleanable/greenglow/radioactive/medium(T) + + var/obj/effect/plastic_explosive/effect = locate(/obj/effect/plastic_explosive) in get_turf(src) + if(effect) + qdel(effect) + qdel(src) /obj/item/plastique/strong name = "bundled plastic explosives" diff --git a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm index e55cdf7279d..b53197b7def 100644 --- a/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm +++ b/code/modules/reagents/Chemistry-Reagents/Chemistry-Reagents-Other.dm @@ -161,7 +161,7 @@ affect_ingest(M, alien, removed, holder) /singleton/reagent/uranium/affect_blood(var/mob/living/carbon/M, var/alien, var/removed, var/datum/reagents/holder) - M.apply_damage(5 * removed, DAMAGE_RADIATION, damage_flags = DAMAGE_FLAG_DISPERSED) + M.apply_damage(5 * removed, DAMAGE_RADIATION, damage_flags = DAMAGE_FLAG_DISPERSED, armor_pen = 100) //Radiation in the blood shouldn't check your radsuit. /singleton/reagent/uranium/touch_turf(var/turf/T, var/amount, var/datum/reagents/holder) if(amount >= 3) @@ -186,7 +186,7 @@ /singleton/reagent/radioactive_waste/affect_blood(var/mob/living/carbon/M, var/alien, var/removed, var/datum/reagents/holder) var/rad_damage = min(75, 40 * removed) - M.apply_effect(rad_damage, DAMAGE_RADIATION, blocked = 0) + M.apply_damage(rad_damage, DAMAGE_RADIATION, damage_flags = DAMAGE_FLAG_DISPERSED, armor_pen = 100) /singleton/reagent/radioactive_waste/touch_turf(var/turf/T, var/amount, var/datum/reagents/holder) if(amount >= 3) diff --git a/html/changelogs/Fenodyree-FixesC4AndDirtyBombs.yml b/html/changelogs/Fenodyree-FixesC4AndDirtyBombs.yml new file mode 100644 index 00000000000..22b04afc507 --- /dev/null +++ b/html/changelogs/Fenodyree-FixesC4AndDirtyBombs.yml @@ -0,0 +1,8 @@ +author: Fenodyree +delete-after: True +changes: + - bugfix: "Fixes C4 effects not correctly getting their parent item." + - bugfix: "Fixes C4 not being placed correctly." + - bugfix: "Fixes Dirty Bombs deleting their own radiation source." + - bugfix: "Fixes Dirty Bomb goop puddles disapearing long before the radiation does." + - bugfix: "Fixes drinking radioactive waste not irradiating you."