Files
S.P.L.U.R.T-Station-13/code/game/objects/items/grenades/ghettobomb.dm
Timothy Teakettle 95b8cd3956 first port
2020-06-10 20:33:01 +01:00

61 lines
1.9 KiB
Plaintext

//improvised explosives//
/obj/item/grenade/iedcasing
name = "improvised firebomb"
desc = "A weak, improvised incendiary device."
w_class = WEIGHT_CLASS_SMALL
icon = 'icons/obj/grenade.dmi'
icon_state = "improvised_grenade"
item_state = "flashbang"
lefthand_file = 'icons/mob/inhands/equipment/security_lefthand.dmi'
righthand_file = 'icons/mob/inhands/equipment/security_righthand.dmi'
throw_speed = 3
throw_range = 7
flags_1 = CONDUCT_1
slot_flags = ITEM_SLOT_BELT
active = 0
det_time = 50
display_timer = 0
var/range = 3
var/list/times
/obj/item/grenade/iedcasing/Initialize()
. = ..()
add_overlay("improvised_grenade_filled")
add_overlay("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'
range = 1
det_time = rand(30,80)
else
range = pick(2,2,2,3,3,3,4)
/obj/item/grenade/iedcasing/CheckParts(list/parts_list)
..()
var/obj/item/reagent_containers/food/drinks/soda_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(!botch_check(user))
to_chat(user, "<span class='warning'>You light the [name]!</span>")
cut_overlay("improvised_grenade_filled")
preprime(user, null, FALSE)
/obj/item/grenade/iedcasing/prime() //Blowing that can up
update_mob()
explosion(src.loc,-1,-1,2, flame_range = 4) // small explosion, plus a very large fireball.
qdel(src)
/obj/item/grenade/iedcasing/examine(mob/user)
. = ..()
. += "You can't tell when it will explode!"