//Smear Particle script
//Author aSSTaRD (Rasher8940@aol.com)
//Minor enhancements by xplo (xplo@xplo.org)

(declare init
 (set $numparticles 3)
 (set $Xchangea (rnd 0.01 0.09))
 (set $Ychangea (rnd 0.01 0.09))
 (set $Xchangeb (rnd 0.01 0.09))
 (set $Ychangeb (rnd 0.01 0.09))
 (set $Xchangec (rnd 0.01 0.09))
 (set $Ychangec (rnd 0.01 0.09))
 (set $Xa (rnd -1 1))
 (set $Ya (rnd -1 1))
 (set $Xb (rnd -1 1))
 (set $Yb (rnd -1 1))
 (set $Xc (rnd -1 1))
 (set $Yc (rnd -1 1))
 (set $UseBlendType 2)
)

(declare newframe)

(declare particle
 (if (== $particle 0)
  (block (set $Xo $Xa)
         (set $Yo $Ya)
         (set $Xchange $Xchangea)
         (set $Ychange $Ychangea)
  )
 )
 (if (== $particle 1)
  (block (set $Xo $Xb)
         (set $Yo $Yb)
         (set $Xchange $Xchangeb)
         (set $Ychange $Ychangeb)
  )
 )
 (if (== $particle 2)
  (block (set $Xo $Xc)
         (set $Yo $Yc)
         (set $Xchange $Xchangec)
         (set $Ychange $Ychangec)
  )
 )
 (if (>= $Xo 1) (set $Xchange (- 0 $Xchange)))
 (if (<= $Xo -1) (set $Xchange (abs $Xchange)))
 (if (>= $Yo 1) (set $Ychange (- 0 $Ychange)))
 (if (<= $Yo -1) (set $Ychange (abs $Ychange)))
 (+= $Xo $Xchange)
 (+= $Yo $Ychange)
 (set $X $Xo)
 (set $Y $Yo)
 (set $Size 1.0)
 (set $Style 1)
 (set $fade (- 1.0 (* $midpeak 10)))
 (if (== $particle 0)
  (block (set $Xa $Xo)
         (set $Ya $Yo)
         (set $Xchangea $Xchange)
         (set $Ychangea $Ychange)
  )
 )
 (if (== $particle 1)
  (block (set $Xb $Xo)
         (set $Yb $Yo)
         (set $Xchangeb $Xchange)
         (set $Ychangeb $Ychange)
  )
 )
 (if (== $particle 2)
  (block (set $Xc $Xo)
         (set $Yc $Yo)
         (set $Xchangec $Xchange)
         (set $Ychangec $Ychange)
  )
 )
)
