class RainMaker extends Trigger;

var() int MaxDrops;
var() float RainDensity;

var int Dropcount;
var float timer;
var float droptime;

function Tick(float deltaTime)
 {
 local float distance;
 local int direction;
 local RainDrop drop;
 local vector loc;
 local rotator r;
 // spawn a drop if needs be
 if (DropCount>=MaxDrops)
    return;

 timer+=deltaTime;
 if (timer<droptime)
    return;

 // spawn that drop in a random location
	direction=Rand(65535);
	distance=FRand()*CollisionRadius;
	r=RotRand();
	r.Pitch=0;
	r.Roll=0;
	loc=Location+(Vector(r)*distance);
	drop=Spawn(class'RainDrop', self,, loc);
	if (drop==none)
		return;
	timer=0.0;
	drop.master=self;
	dropCount++;
	droptime=1.05-RainDensity;
 }






function LoseADrop()
 {
 DropCount--;
 }

defaultproperties
{
     MaxDrops=256
     RainDensity=0.990000
     bHidden=True
     DrawType=DT_Sprite
     Texture=Texture'Engine.S_Inventory'
     CollisionRadius=250.000000
     CollisionHeight=2.000000
     bCollideActors=True
     LifeSpan=0.0
}
