c4 tweaks

This commit is contained in:
Cheridan
2017-03-05 13:18:32 -06:00
parent ecb47c5b4f
commit 14e384b2e8
@@ -10,6 +10,9 @@
var/image_overlay = null
var/obj/item/device/assembly_holder/nadeassembly = null
var/assemblyattacher
var/directional = FALSE
var/aim_dir = NORTH
var/boom_sizes = list(0, 0, 3)
/obj/item/weapon/grenade/plastic/New()
image_overlay = image('icons/obj/grenade.dmi', "[item_state]2")
@@ -42,6 +45,26 @@
return
..()
/obj/item/weapon/grenade/plastic/prime()
var/turf/location
if(target)
if(!QDELETED(target))
location = get_turf(target)
target.cut_overlay(image_overlay, TRUE)
else
location = get_turf(src)
if(location)
if(directional && target && target.density)
var/turf/T = get_step(location, aim_dir)
explosion(get_step(T, aim_dir), boom_sizes[1], boom_sizes[2], boom_sizes[3])
else
explosion(location, boom_sizes[1], boom_sizes[2], boom_sizes[3])
location.ex_act(2, target)
if(istype(target, /mob))
var/mob/M = target
M.gib()
qdel(src)
//assembly stuff
/obj/item/weapon/grenade/plastic/receive_signal()
prime()
@@ -65,9 +88,10 @@
user << "Timer set for [det_time] seconds."
/obj/item/weapon/grenade/plastic/afterattack(atom/movable/AM, mob/user, flag)
if (!flag)
aim_dir = get_dir(user,AM)
if(!flag)
return
if (ismob(AM))
if(ismob(AM))
return
user << "<span class='notice'>You start planting the [src]. The timer is set to [det_time]...</span>"
@@ -78,6 +102,12 @@
src.target = AM
forceMove(null) //Yep
if(istype(AM, /obj/item)) //your crappy throwing star can't fly so good with a giant brick of c4 on it.
var/obj/item/I = AM
I.throw_speed = max(1, (I.throw_speed - 3))
I.throw_range = max(1, (I.throw_range - 3))
I.embed_chance = 0
message_admins("[ADMIN_LOOKUPFLW(user)] planted [name] on [target.name] at [ADMIN_COORDJMP(target)] with [det_time] second fuse",0,1)
log_game("[key_name(user)] planted [name] on [target.name] at [COORD(src)] with [det_time] second fuse")
@@ -125,22 +155,6 @@
name = "C4"
desc = "Used to put holes in specific areas without too much extra hole. A saboteur's favorite."
/obj/item/weapon/grenade/plastic/c4/prime()
var/turf/location
if(target)
if(!QDELETED(target))
location = get_turf(target)
target.cut_overlay(image_overlay, TRUE)
else
location = get_turf(src)
if(location)
location.ex_act(2, target)
explosion(location,0,0,3)
if(istype(target, /mob))
var/mob/M = target
M.gib()
qdel(src)
// X4 is an upgraded directional variant of c4 which is relatively safe to be standing next to. And much less safe to be standing on the other side of.
// C4 is intended to be used for infiltration, and destroying tech. X4 is intended to be used for heavy breaching and tight spaces.
// Intended to replace C4 for nukeops, and to be a randomdrop in surplus/random traitor purchases.
@@ -148,34 +162,7 @@
/obj/item/weapon/grenade/plastic/x4
name = "X4"
desc = "A shaped high-explosive breaching charge. Designed to ensure user safety and wall nonsafety."
var/aim_dir = NORTH
icon_state = "plasticx40"
item_state = "plasticx4"
/obj/item/weapon/grenade/plastic/x4/prime()
var/turf/location
if(target)
if(!QDELETED(target))
location = get_turf(target)
target.cut_overlay(image_overlay, TRUE)
else
location = get_turf(src)
if(location)
if(istype(loc, /obj/item/weapon/twohanded/spear) || !target)
explosion(location, 0, 2, 3)
else if(target && target.density)
var/turf/T = get_step(location, aim_dir)
explosion(get_step(T, aim_dir),0,0,3)
explosion(T,0,2,0)
location.ex_act(2, target)
else
explosion(location, 0, 2, 3)
location.ex_act(2, target)
if(istype(target, /mob))
var/mob/M = target
M.gib()
qdel(src)
/obj/item/weapon/grenade/plastic/x4/afterattack(atom/movable/AM, mob/user, flag)
aim_dir = get_dir(user,AM)
..()
directional = TRUE
boom_sizes = list(0, 2, 5)