Adds colored smoke grenades and ability for them to take color

This commit is contained in:
Yoshax
2016-04-29 17:19:08 +01:00
parent 25d4590d4f
commit b57ea6a752
2 changed files with 17 additions and 12 deletions
+6 -5
View File
@@ -321,7 +321,7 @@ steam.start() -- spawns the effect
if(direct)
direction = direct
/datum/effect/effect/system/smoke_spread/start()
/datum/effect/effect/system/smoke_spread/start(var/I)
var/i = 0
for(i=0, i<src.number, i++)
if(src.total_smoke > 20)
@@ -331,6 +331,7 @@ steam.start() -- spawns the effect
src.location = get_turf(holder)
var/obj/effect/effect/smoke/smoke = PoolOrNew(smoke_type, src.location)
src.total_smoke++
smoke.color = I
var/direction = src.direction
if(!direction)
if(src.cardinals)
@@ -507,9 +508,9 @@ steam.start() -- spawns the effect
M << "<span class='warning'>The solution violently explodes.</span>"
explosion(
location,
round(min(devst, BOMBCAP_DVSTN_RADIUS)),
round(min(heavy, BOMBCAP_HEAVY_RADIUS)),
round(min(light, BOMBCAP_LIGHT_RADIUS)),
location,
round(min(devst, BOMBCAP_DVSTN_RADIUS)),
round(min(heavy, BOMBCAP_HEAVY_RADIUS)),
round(min(light, BOMBCAP_LIGHT_RADIUS)),
round(min(flash, BOMBCAP_FLASH_RADIUS))
)
@@ -7,6 +7,14 @@
item_state = "flashbang"
slot_flags = SLOT_BELT
var/datum/effect/effect/system/smoke_spread/bad/smoke
var/smoke_color
var/smoke_strength = 4
/obj/item/weapon/grenade/smokebomb/red
smoke_color = "#FF0000"
/obj/item/weapon/grenade/smokebomb/blue
smoke_color = "#0000FF"
/obj/item/weapon/grenade/smokebomb/New()
..()
@@ -22,13 +30,9 @@
playsound(src.loc, 'sound/effects/smoke.ogg', 50, 1, -3)
src.smoke.set_up(10, 0, usr.loc)
spawn(0)
src.smoke.start()
sleep(10)
src.smoke.start()
sleep(10)
src.smoke.start()
sleep(10)
src.smoke.start()
for(var/i = 1 to smoke_strength)
src.smoke.start(smoke_color)
sleep(10)
for(var/obj/effect/blob/B in view(8,src))
var/damage = round(30/(get_dist(B,src)+1))