## XIDMaps
Class Map09_Spads

source: C:\XIII\XIDMaps\Classes\Map09_Spads.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Info
             |
             +--XIII.MapInfo
                |
                +--XIDMaps.Map09_Spads

Direct Known Subclasses:Spads01, Spads02a, Spads02b

class Map09_Spads
extends XIII.MapInfo

    //-----------------------------------------------------------
    //
    //-----------------------------------------------------------

Function Summary
`void` | `FirstFrame()`
`void` | `StartRain(float proportion)`

Source Code

    00001	//-----------------------------------------------------------
    00002	//
    00003	//-----------------------------------------------------------
    00004	class Map09_Spads extends MapInfo placeable;
    00005
    00006	VAR(Rain)	Float Distance;
    00007	VAR(Rain)	Int DropsByCube;
    00008	VAR(Rain)	Texture DropsTexture;
    00009	VAR(Rain)	Float DropsSize;
    00010	VAR(Rain)	Vector BaseDropsSpeed;
    00011	VAR(Rain)	Float DropsSpeedDisturbance;
    00012	VAR(Rain)	Float RandomDropsAcceleration;
    00013	VAR(Rain)	bool Activate;
    00014	VAR(Rain)	float FadeTime;
    00015	VAR			float Alpha_Direction;
    00016
    00017	FUNCTION FirstFrame()
    00018	{
    00019		Disable('tick');
    00020		Super.FirstFrame();
    00021
    00022		if (Activate)
    00023		{
    00024			StartRain(1.0);
    00025			Alpha_Direction=1;
    00026		}
    00027		else
    00028		{
    00029			Alpha_Direction=0;
    00030		}
    00031
    00032	}
    00033
    00034	FUNCTION StartRain(float proportion)
    00035	{
    00036		LOCAL DelimitationVolume dv;
    00037		LOCAL Box dvBox;
    00038
    00039		Level.InitRndCubeSpr( DropsTexture, DropsByCube, proportion, Distance );
    00040		Level.SetRndCubeSprSpeed( BaseDropsSpeed, DropsSpeedDisturbance, RandomDropsAcceleration );
    00041		Level.SetRndCubeSprSize( DropsSize );
    00042
    00043		foreach allactors(class'DelimitationVolume',dv)
    00044		{
    00045			dvBox=dv.GetBoundingBox();
    00046			if (dvBox.IsValid!=0)
    00047				Level.AddRndCubeSprExclude( dvBox.Min, dvBox.Max+vect(1,1,1) );
    00048		}
    00049
    00050		Level.SetRndCubeSprState( True );
    00051	}
    00052
    00053	EVENT Trigger(actor a,pawn p)
    00054	{
    00055		if (!Activate)
    00056		{
    00057			StartRain(0.0);
    00058			Activate=true;
    00059		}
    00060		Alpha_Direction=1-Alpha_Direction;
    00061		Enable('tick');
    00062	}
    00063
    00064	EVENT Tick(float dt)
    00065	{
    00066		if (Alpha_Direction!=-1)
    00067			if (Level.ChangeRndCubeSprProp(Alpha_Direction,dt/FadeTime,0.1/*DropsByCube*/))
    00068				Disable('Tick');
    00069	}
    00070
    00071
    00072
    00073	defaultproperties
    00074	{
    00075	     Distance=512.000000
    00076	     DropsByCube=500
    00077	     DropsTexture=Texture'XIIICine.effets.etincelle'
    00078	     DropsSize=1.000000
    00079	     BaseDropsSpeed=(X=-10.000000,Y=100.000000,Z=-300.000000)
    00080	     RandomDropsAcceleration=1.000000
    00081	     fadeTime=1.000000
    00082	     Alpha_Direction=-1.000000
    00083	}

End Source Code