Files
Paradise/code/game/objects/grenades/grenade.dm
johnsonmt88@gmail.com 8231234a64 Pile of bugfixes
Nodrak:
- Bags of Holding can no longer be brought to the clown planet
- Made a quick new sprite for broken telescreens
- Removed the clusterbang from the HoS safe. It is currently bugged and not in presentable condition, however, someone is working on it. 
- Added a machine check to shift+click. Partial fixes issue 534 (see Zek's stuff for more.) I'm not really sure of a better way to fix this that wouldn't involve a whole pile of coding...
- Cigarettes now evenly distribute chemicals injected into a pack of cigarettes. Partial fix for issue 548 (see Zek's stuff for more.)

Commit for Zekkeit/39kk9t
- The gibber now provides attack logs of who the mob gibbed, or who the mob was gibbed by. How can you tell who a mob was gibbed by when the mob gets destroyed? Well read the next enhancement!
- Attack logs now transfer to the ghost of the mob who dies
- You can no longer survive cold by cooling yourself down before jumping into space. Fixes issue 206.
- Ghost() is now a client proc, not a mob proc. Fixes issue 442
- Fix for issue 493.
- Added a range check to shift+click. Fixes issue 534.
- Cigarette packs are now limited to (15*number of cigarettes) units of reagents. Fixes Issue 548.
- Added organ inaccuracy to guns. This means, for example, that you wont hit the mob's chest with 100% accuracy. You may end up hitting the mob's arm, or head instead. Accuracy is directly related to distance.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4022 316c924e-a436-60f5-8080-3fe189b3f50e
2012-07-10 06:10:22 +00:00

88 lines
2.5 KiB
Plaintext

/obj/item/weapon/grenade
var/det_time = 50
desc = "It is set to detonate in 5 seconds."
name = "grenade"
w_class = 2.0
icon = 'grenade.dmi'
icon_state = "grenade"
item_state = "grenade"
throw_speed = 4
throw_range = 20
flags = FPRINT | TABLEPASS | CONDUCT
slot_flags = SLOT_BELT
var/active = 0
proc/clown_check(var/mob/living/user)
if((CLUMSY in user.mutations) && prob(50))
user << "\red Huh? How does this thing work?!"
src.active = 1
src.icon_state = initial(icon_state) + "_active"
playsound(src.loc, 'armbomb.ogg', 75, 1, -3)
spawn(5)
src.prime()
return 0
return 1
afterattack(atom/target as mob|obj|turf|area, mob/user as mob)
if (istype(target, /obj/item/weapon/storage)) return ..() // Trying to put it in a full container
if (istype(target, /obj/item/weapon/gun/grenadelauncher)) return ..()
if((user.get_active_hand() == src) && (!active) && (clown_check(user)) && target.loc != src.loc)
user << "\red You prime the [name]! [det_time/10] seconds!"
src.active = 1
src.icon_state = initial(icon_state) + "_active"
playsound(src.loc, 'armbomb.ogg', 75, 1, -3)
spawn(src.det_time)
src.prime()
return
user.dir = get_dir(user, target)
user.drop_item()
var/t = (isturf(target) ? target : target.loc)
walk_towards(src, t, 3)
return
attack_self(mob/user as mob)
if(!active)
if(clown_check(user))
user << "\red You prime the [name]! [det_time/10] seconds!"
src.active = 1
src.icon_state = initial(icon_state) + "_active"
add_fingerprint(user)
spawn(src.det_time)
src.prime()
return
return
proc/prime()
playsound(src.loc, 'Welder2.ogg', 25, 1)
var/turf/T = get_turf(src)
if(T)
T.hotspot_expose(700,125)
attackby(obj/item/weapon/W as obj, mob/user as mob)
if (isscrewdriver(W))
switch(src.det_time)
if ("1")
src.det_time = 30
user.show_message("\blue You set the [name] for 3 second detonation time.")
if ("30")
src.det_time = 100
user.show_message("\blue You set the [name] for 10 second detonation time.")
if ("100")
src.det_time = 1
user.show_message("\blue You set the [name] for instant detonation.")
src.add_fingerprint(user)
src.desc = "It is set to detonate [det_time-1 ? "in [det_time/10] seconds." : "instantly."]"
..()
return
attack_hand()
walk(src, null, null)
..()
return
attack_paw(mob/user as mob)
return src.attack_hand(user)