Files
CRUNCH 3fd9106d5a Tidies up grenades. (#26083)
* Clean up grenades

* Update clusterbuster.dm

* Update grenade.dm

* Update flashbang.dm

* Update grenade.dm

* Update frag.dm

* Update code/game/objects/items/weapons/grenades/frag.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>

* Update code/game/objects/items/weapons/grenades/ghettobomb.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>

* update

* Update code/game/objects/items/weapons/grenades/frag.dm

Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>

* update

* update

* Apply suggestions from code review

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>

* Update grenade.dm

* Update code/game/objects/items/weapons/grenades/frag.dm

Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>

* Apply suggestions from code review

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>

* extra var

---------

Signed-off-by: CRUNCH <143041327+Fordoxia@users.noreply.github.com>
Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com>
Co-authored-by: Contrabang <91113370+Contrabang@users.noreply.github.com>
Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
2024-08-09 01:06:23 +00:00

68 lines
2.3 KiB
Plaintext

//improvised explosives//
/obj/item/grenade/iedcasing
name = "improvised firebomb"
desc = "A sketchy improvised incendiary device."
w_class = WEIGHT_CLASS_SMALL
icon = 'icons/obj/grenade.dmi'
icon_state = "improvised_grenade"
item_state = "grenade"
throw_speed = 3
throw_range = 7
flags = CONDUCT
slot_flags = SLOT_FLAG_BELT
active = FALSE
det_time = 5 SECONDS
display_timer = FALSE
modifiable_timer = FALSE
var/list/times
/obj/item/grenade/iedcasing/examine(mob/user)
. = ..()
. += "<span class='warning'>You have no idea how long the fuze will last for until it explodes!</span>"
/obj/item/grenade/iedcasing/Initialize(mapload)
. = ..()
overlays += "improvised_grenade_filled"
overlays += "improvised_grenade_wired"
times = list("5" = 10, "-1" = 20, "[rand(30, 80)]" = 50, "[rand(65, 180)]" = 20)// "Premature, Dud, Short Fuse, Long Fuse"=[weighting value]
det_time = text2num(pickweight(times))
if(det_time < 0) //checking for 'duds'
det_time = rand(30,80)
/obj/item/grenade/iedcasing/CheckParts(list/parts_list)
..()
var/obj/item/reagent_containers/drinks/cans/can = locate() in contents
if(can)
can.pixel_x = 0 //Reset the sprite's position to make it consistent with the rest of the IED
can.pixel_y = 0
var/mutable_appearance/can_underlay = new(can)
can_underlay.layer = FLOAT_LAYER
can_underlay.plane = FLOAT_PLANE
underlays += can_underlay
/obj/item/grenade/iedcasing/attack_self(mob/user) //
if(!active)
if(clown_check(user))
to_chat(user, "<span class='warning'>You light [src]!</span>")
active = TRUE
overlays -= "improvised_grenade_filled"
icon_state = initial(icon_state) + "_active"
add_fingerprint(user)
var/turf/bombturf = get_turf(src)
var/area/A = get_area(bombturf)
log_game("[key_name(user)] has primed a [name] for detonation at [A.name] [COORD(bombturf)].")
investigate_log("[key_name(user)] has primed a [name] for detonation at [A.name] [COORD(bombturf)])", INVESTIGATE_BOMB)
add_attack_logs(user, src, "has primed for detonation", ATKLOG_FEW)
if(iscarbon(user))
var/mob/living/carbon/C = user
C.throw_mode_on()
addtimer(CALLBACK(src, PROC_REF(prime)), det_time)
/obj/item/grenade/iedcasing/prime() //Blowing that can up
update_mob()
explosion(loc, -1, -1, 2, flame_range = 4) // small explosion, plus a very large fireball.
qdel(src)