Oldcode Fireworks!

This commit is contained in:
ZomgPonies
2013-12-21 06:00:40 -05:00
parent 4b79fe595a
commit b0dca0269f
4 changed files with 152 additions and 0 deletions
@@ -1114,3 +1114,88 @@ steam.start() -- spawns the effect
dmglevel = 3
if(dmglevel<4) holder.ex_act(dmglevel)
//////////////////////////////////
//////SPARKELS FIREWORKS
/////////////////////////////////
////////////////////////////
/obj/effects/sparkels
name = "sparkel"
icon = 'icons/obj/fireworks.dmi'//findback
icon_state = "sparkel"
var/amount = 6.0
anchored = 1.0
mouse_opacity = 0
/obj/effects/sparkels/New()
..()
var/icon/I = new(src.icon,src.icon_state)
var/r = rand(0,255)
var/g = rand(0,255)
var/b = rand(0,255)
world.log << "Colour , [r],[g],[b]"
I.Blend(rgb(r,g,b),ICON_MULTIPLY)
src.icon = I
playsound(src.loc, "sparks", 100, 1)
var/turf/T = src.loc
if (istype(T, /turf))
T.hotspot_expose(3000,100)
spawn (100)
del(src)
return
/obj/effects/sparkels/Del()
var/turf/T = src.loc
if (istype(T, /turf))
T.hotspot_expose(3000,100)
..()
return
/obj/effects/sparkels/Move()
..()
var/turf/T = src.loc
if (istype(T, /turf))
T.hotspot_expose(3000,100)
return
/datum/effects/system/sparkel_spread
var/number = 3
var/cardinals = 0
var/turf/location
var/atom/holder
var/total_sparks = 0 // To stop it being spammed and lagging!
/datum/effects/system/sparkel_spread/proc/set_up(n = 3, c = 0, loca)
if(n > 10)
n = 10
number = n
cardinals = c
if(istype(loca, /turf/))
location = loca
else
location = get_turf(loca)
/datum/effects/system/sparkel_spread/proc/attach(atom/atom)
holder = atom
/datum/effects/system/sparkel_spread/proc/start()
var/i = 0
for(i=0, i<src.number, i++)
if(src.total_sparks > 20)
return
spawn(0)
if(holder)
src.location = get_turf(holder)
var/obj/effects/sparkels/sparks = new(src.location)
src.total_sparks++
var/direction
if(src.cardinals)
direction = pick(cardinal)
else
direction = pick(alldirs)
for(i=0, i<pick(1,2,3), i++)
sleep(5)
step(sparks,direction)
spawn(20)
del(sparks)
src.total_sparks--