Files
Paradise/code/game/objects/grenades/flashbang.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

148 lines
4.2 KiB
Plaintext

/obj/item/weapon/grenade/flashbang
name = "flashbang"
icon_state = "flashbang"
item_state = "flashbang"
origin_tech = "materials=2;combat=1"
var/banglet = 0
prime()
..()
for(var/obj/structure/closet/L in view(get_turf(src), null))
if(locate(/mob/living/carbon/, L))
for(var/mob/living/carbon/M in L)
bang(get_turf(src), M)
for(var/mob/living/carbon/M in viewers(get_turf(src), null))
bang(get_turf(src), M)
for(var/obj/effect/blob/B in view(8,get_turf(src))) //Blob damage here
var/damage = round(30/(get_dist(B,get_turf(src))+1))
B.health -= damage
B.update_icon()
del(src)
return
proc/bang(var/turf/T , var/mob/living/carbon/M) // Added a new proc called 'bang' that takes a location and a person to be banged.
if (locate(/obj/item/weapon/cloaking_device, M)) // Called during the loop that bangs people in lockers/containers and when banging
for(var/obj/item/weapon/cloaking_device/S in M) // people in normal view. Could theroetically be called during other explosions.
S.active = 0 // -- Polymorph
S.icon_state = "shield0"
M << "\red <B>BANG</B>"
playsound(src.loc, 'bang.ogg', 25, 1)
//Checking for protections
var/eye_safety = 0
var/ear_safety = 0
if(iscarbon(M))
eye_safety = M.eyecheck()
if(ishuman(M))
if(istype(M:ears, /obj/item/clothing/ears/earmuffs))
ear_safety += 2
if(HULK in M.mutations)
ear_safety += 1
if(istype(M:head, /obj/item/clothing/head/helmet))
ear_safety += 1
//Flashing everyone
if(eye_safety < 1)
flick("e_flash", M.flash)
M.eye_stat += rand(1, 3)
M.Stun(2)
M.Weaken(10)
//Now applying sound
if((get_dist(M, T) <= 2 || src.loc == M.loc || src.loc == M))
if(ear_safety > 0)
M.Stun(2)
M.Weaken(1)
else
M.Stun(10)
M.Weaken(3)
if ((prob(14) || (M == src.loc && prob(70))))
M.ear_damage += rand(1, 10)
else
M.ear_damage += rand(0, 5)
M.ear_deaf = max(M.ear_deaf,15)
else if(get_dist(M, T) <= 5)
if(!ear_safety)
M.Stun(8)
M.ear_damage += rand(0, 3)
M.ear_deaf = max(M.ear_deaf,10)
else if(!ear_safety)
M.Stun(4)
M.ear_damage += rand(0, 1)
M.ear_deaf = max(M.ear_deaf,5)
//This really should be in mob not every check
if (M.eye_stat >= 20)
M << "\red Your eyes start to burn badly!"
M.disabilities |= NEARSIGHTED
if(!banglet && !(istype(src , /obj/item/weapon/grenade/flashbang/clusterbang)))
if (prob(M.eye_stat - 20 + 1))
M << "\red You can't see anything!"
M.sdisabilities |= BLIND
if (M.ear_damage >= 15)
M << "\red Your ears start to ring badly!"
if(!banglet && !(istype(src , /obj/item/weapon/grenade/flashbang/clusterbang)))
if (prob(M.ear_damage - 10 + 5))
M << "\red You can't hear anything!"
M.sdisabilities |= DEAF
else
if (M.ear_damage >= 5)
M << "\red Your ears start to ring!"
M.update_icons()
/obj/item/weapon/grenade/flashbang/clusterbang
desc = "Use of this weapon may constiute a war crime in your area, consult your local captain."
name = "clusterbang"
icon = 'grenade.dmi'
icon_state = "clusterbang"
var/child = 0
prime()
//world << "Armed!"
var/numspawned = rand(4,8)
//world << numspawned
var/again = 0
if(!child)
for(var/more = numspawned,more > 0,more--)
if(prob(35))
again++
numspawned --
for(,numspawned > 0, numspawned--)
//world << "Spawned Flashbang!"
spawn(0)
var/obj/item/weapon/grenade/flashbang/F = new /obj/item/weapon/grenade/flashbang(src)
F.loc = src.loc
F.icon_state = "flashbang_active"
playsound(src.loc, 'armbomb.ogg', 75, 1, -3)
F.active = 1
F.banglet = 1
var/stepdist = rand(1,3)
walk_away(F,src,stepdist)
var/dettime = rand(15,60)
spawn(dettime)
F.prime()
for(,again > 0, again--)
//world << "Spawned CFlashbang!"
spawn(0)
var/obj/item/weapon/grenade/flashbang/clusterbang/F = new /obj/item/weapon/grenade/flashbang/clusterbang(src)
F.loc = src.loc
F.active = 1
F.child = 1
F.icon_state = "clusterbang_active"
var/stepdist = rand(1,4)
walk_away(F,src,stepdist)
spawn(det_time)
F.prime()
return