@name Rainbow
@outputs R G B A Mul

interval(10)

if(first())
{
    runOnLast(1)
    
    A = 255
    #ifdef entity:propFreeze(number)
        entity():propFreeze(0)
        entity():propNotSolid(1)
    #endif
    entity():setTrails(8,0,8,"skybox/sky_fake_white",vec(0,128,255),255)
    owner():setTrails(8,0,8,"skybox/sky_fake_white",vec(0,128,255),255)
    entity():setMaterial("skybox/sky_fake_white")
    owner():setMaterial("skybox/sky_fake_white")
}

Color = hsv2rgb((curtime() * 10) % 360,1,1)
R = Color:x()
G = Color:y()
B = Color:z()

entity():applyForce(((owner():shootPos()+vec(cos(curtime() * 32) * 64,sin(curtime() * 32) * 64,sin(curtime() * 128) * 16)-entity():pos())*10-entity():vel())*entity():mass())

entity():setColor(vec(R,G,B))
owner():setColor(vec(R,G,B))

if(last())
{
    owner():setMaterial("")
    owner():setColor(vec(255,255,255))
    owner():removeTrails()
}
