Files
Aurora.3/code/game/objects/effects/plastic_explosive.dm
FenodyreeAvandGitHub 2fdf11ca75 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.
<img width="1191" height="1182" alt="image"
src="https://github.com/user-attachments/assets/584e7572-441c-4937-8e0e-7203010fcd54"
/>

---------

Signed-off-by: FenodyreeAv <fenodyree.av@gmail.com>
2026-07-29 17:29:31 +00:00

57 lines
1.8 KiB
Plaintext

/obj/effect/plastic_explosive
name = "plastic explosives"
desc = "Used to put holes in specific areas without too much extra hole."
gender = PLURAL
icon = 'icons/obj/assemblies.dmi'
icon_state = "plastic-explosive2"
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)
. += ..()
if(is_adjacent)
. += SPAN_WARNING("It is set to blow in [round((parent.detonate_time - world.time) / 10)] seconds.")
/obj/effect/plastic_explosive/Initialize(var/atom/owner_pos, var/atom/target, var/obj/item/plastique/c4)
. = ..()
parent = c4
if(parent)
parent.forceMove(src)
name = parent.name
desc = parent.desc
set_position(get_dir(src, target))
/obj/effect/plastic_explosive/Destroy()
QDEL_NULL(parent)
return ..()
/obj/effect/plastic_explosive/proc/set_position(var/dir)
var/dir_text = uppertext(dir2text(dir))
var/list/dir_to_pixel = list(
"NORTH" = list(0, 32),
"NORTHEAST" = list(32, 32),
"EAST" = list(32, 0),
"SOUTHEAST" = list(32, -32),
"SOUTH" = list(0, -32),
"SOUTHWEST" = list(-32, -32),
"WEST" = list(-32, 0),
"NORTHWEST" = list(-32, 32)
)
var/list/pixel_shifts = dir_to_pixel[dir_text]
pixel_x = pixel_shifts[1]
pixel_y = pixel_shifts[2]
/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, click_parameters)
return parent.attackby(attacking_item, user, click_parameters)
/obj/effect/plastic_explosive/big
name = "bundled plastic explosives"
desc = "Used to put big holes in specific areas with a lot of extra hole."
icon_state = "plastic-explosive-big2"