UnrealShare
Class ArrowSpawner

source: e:\games\UnrealTournament\UnrealShare\Classes\ArrowSpawner.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Effects
         |
         +--UnrealShare.ArrowSpawner
Direct Known Subclasses:None

class ArrowSpawner
extends Engine.Effects

//============================================================================= // ArrowSpawner. //=============================================================================
Variables
 int ArrowCount
 int ArrowSpeed
 int ArrowsToShootAfterDeactivated
 TriggerDelay, RepeatDelay

States
Active

Function Summary
 void Trigger(Actor Other, Pawn EventInstigator)


State Active Function Summary
 void Timer()
 void UnTrigger(Actor Other, Pawn EventInstigator)
 void Trigger(Actor Other, Pawn EventInstigator)



Source Code


00001	//=============================================================================
00002	// ArrowSpawner.
00003	//=============================================================================
00004	class ArrowSpawner extends Effects;
00005	
00006	var() float TriggerDelay, RepeatDelay;
00007	var() int ArrowsToShootAfterDeactivated;
00008	var() int ArrowSpeed;
00009	var int ArrowCount;
00010	
00011	function Trigger( actor Other, pawn EventInstigator )
00012	{
00013		Instigator = EventInstigator;
00014		GoToState('Active');
00015	}
00016	
00017	
00018	
00019	state Active
00020	{
00021		function Trigger( actor Other, pawn EventInstigator);
00022	
00023		function UnTrigger( actor Other, pawn EventInstigator ) 
00024		{
00025			ArrowCount = ArrowsToShootAfterDeactivated;
00026			if (ArrowCount<1) ArrowCount = 1;
00027		}
00028	
00029	
00030		function Timer()
00031		{
00032			local Arrow a;
00033			
00034			If (ArrowCount > 0) {
00035				If (ArrowCount==1) {
00036					SetTimer(0.0, False);
00037					GoToState('');
00038				}
00039				a = Spawn(class'Arrow',, '', Location+Vector(Rotation)*20);			
00040				a.Speed = ArrowSpeed;
00041				ArrowCount--;
00042			}
00043			else {
00044				a = Spawn(class'Arrow',,, Location+Vector(Rotation)*20);
00045				a.Speed = ArrowSpeed;
00046				SetTimer(RepeatDelay, True);
00047			}
00048		}
00049	Begin:
00050		ArrowCount = 0;
00051		SetTimer(TriggerDelay, True);
00052	
00053	}
00054	
00055	defaultproperties
00056	{
00057	     TriggerDelay=0.100000
00058	     RepeatDelay=0.500000
00059	     ArrowsToShootAfterDeactivated=1
00060	     ArrowSpeed=1000
00061	     bHidden=True
00062	     bNetTemporary=False
00063	     bDirectional=True
00064	     DrawType=DT_Sprite
00065	}

End Source Code