Files
CHOMPStation2/code/game/objects/items/weapons/explosives.dm
n3ophyt3@gmail.com 2b33e966d1 Bugfixes for those explodies I made for noize
You can now only plant them on items you are next to
  The item has to stay within one tile of you during the entire process
  You can no longer plant them on shuttle or unsimulated turfs, as these are apparently not meant to ever be damaged in any way short of a badmin using the Delete verb

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@674 316c924e-a436-60f5-8080-3fe189b3f50e
2010-12-20 00:20:15 +00:00

32 lines
1.1 KiB
Plaintext

/obj/item/weapon/plastique/attack_self(mob/user as mob)
var/newtime = input(usr, "Please set the timer.", "Timer", 10)
src.timer = newtime
user << "Timer set for [src.timer] seconds."
/obj/item/weapon/plastique/afterattack(atom/target as obj|turf, mob/user as mob, flag)
if (!flag)
return
if (istype(target, /turf/unsimulated) || istype(target, /turf/simulated/shuttle))
return
user << "Planting explosives..."
if(do_after(user, 50) && get_dist(user, target) <= 1)
user.drop_item()
src.target = target
src.loc = null
var/location
if (isturf(target)) location = target
if (isobj(target)) location = target.loc
target.overlays += image('assemblies.dmi', "plastic-explosive2")
user << "Bomb has been planted. Timer counting down from [src.timer]."
spawn(src.timer*10)
explosion(location, -1, -1, 2, 3)
if (istype(src.target, /turf/simulated/wall)) src.target:dismantle_wall(1)
else src.target.ex_act(1)
if (isobj(src.target))
if (src.target)
del(src.target)
if (src)
del(src)
/obj/item/weapon/plastique/attack(mob/M as mob, mob/user as mob, def_zone)
return