XIII
Class XIIIBird

source: C:\XIII\XIII\Classes\XIIIBird.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Pawn
         |
         +--XIII.XIIIAmbientPawn
            |
            +--XIII.XIIITransientAPawn
               |
               +--XIII.XIIIBird
Direct Known Subclasses:Mouette

class XIIIBird
extends XIII.XIIITransientAPawn

//----------------------------------------------------------- // //-----------------------------------------------------------
Variables
 float Angle
 float CircleRadius
 float HeightOffset
 bool bDestroyIfHitWall
 bool bDirection

States
Dying

Function Summary
 void DisplayDebug(Canvas Canvas, out float, out float)
     
//_____________________________________________________________________________
 float GetSleepTime()
     
//_____________________________________________________________________________
 void HitWall(vector HitNormal, Actor HitWall)
     
//_____________________________________________________________________________
 void PostBeginPlay()
     
//_____________________________________________________________________________


State Dying Function Summary
 void PlayCall()
     
//_____________________________________________________________________________
 void PlayOnGround()
     
//_____________________________________________________________________________
 void PlayFlying()
     
//_____________________________________________________________________________
 void PlayGlideOrFly(vector Dest)
     
//_____________________________________________________________________________
 void BeginState()



Source Code


00001	//-----------------------------------------------------------
00002	//
00003	//-----------------------------------------------------------
00004	class XIIIBird extends XIIITransientAPawn;
00005	
00006	var float Angle;
00007	var bool bDirection;
00008	var bool bDestroyIfHitWall;
00009	var float CircleRadius;
00010	var float HeightOffset;
00011	
00012	//_____________________________________________________________________________
00013	function PostBeginPlay()
00014	{
00015	    Super.PostBeginPlay();
00016	    LoopAnim('Vole');
00017	    CircleRadius = 400 + 500 * FRand();
00018	    bDirection = ( FRand() < 0.5 );
00019	    HeightOffset = 500 * FRand() + 200;
00020	}
00021	
00022	//_____________________________________________________________________________
00023	function DisplayDebug(Canvas Canvas, out float YL, out float YPos)
00024	{
00025	    Super.DisplayDebug(Canvas, YL, YPos);
00026	
00027	    Canvas.SetDrawColor(255,255,255);
00028	    Canvas.DrawText("Controller Location "$Controller.Location);
00029	    YPos += YL;
00030	    Canvas.SetPos(4,YPos);
00031	    Canvas.DrawText("Master Pawn "$(Controller.Pawn == self));
00032	    YPos += YL;
00033	    Canvas.SetPos(4,YPos);
00034	}
00035	
00036	//_____________________________________________________________________________
00037	function float GetSleepTime()
00038	{
00039	    return SleepTime;
00040	}
00041	
00042	//_____________________________________________________________________________
00043	function HitWall(vector HitNormal, actor HitWall)
00044	{
00045	    Acceleration *= -1;
00046	    DesiredRotation = Rotator(Acceleration);
00047	    if ( bDestroyIfHitWall )
00048	    {
00049	      if ( LastRenderTime > 1 )
00050	        Destroy();
00051	      else
00052	      {
00053	        bDestroySoon = true;
00054	        GotoState('Wandering');
00055	      }
00056	    }
00057	}
00058	
00059	//_____________________________________________________________________________
00060	State Dying
00061	{
00062	    ignores Trigger, Bump, HitWall, HeadVolumeChange, PhysicsVolumeChange, Falling, BreathTimer;
00063	
00064	    function BeginState()
00065	    {
00066	//          PlaySound(sound'injur1m');
00067	      if ( FRand() < 0.5 )
00068	        TweenAnim('Dead1', 0.2);
00069	      else
00070	        TweenAnim('Dead2', 0.2);
00071	    }
00072	}
00073	
00074	//_____________________________________________________________________________
00075	function PlayGlideOrFly(vector Dest)
00076	{
00077	    if ( (Dest.Z > Location.Z + 5) || (FRand() < 0.5) )
00078	      LoopAnim('Vole');
00079	    else
00080	      LoopAnim('Plane');
00081	}
00082	
00083	//_____________________________________________________________________________
00084	function PlayFlying()
00085	{
00086	    LoopAnim('Vole');
00087	}
00088	
00089	//_____________________________________________________________________________
00090	function PlayOnGround()
00091	{
00092	    LoopAnim('Sol');
00093	}
00094	
00095	//_____________________________________________________________________________
00096	function PlayCall()
00097	{
00098	//     PlaySound(sound'call2b',,0.5 + 0.5 * FRand(),,, 0.8 + 0.4 * FRand());
00099	}
00100	
00101	//     Land=None
00102	
00103	
00104	defaultproperties
00105	{
00106	     CircleRadius=600.000000
00107	     bSameZoneHearing=True
00108	     bAdjacentZoneHearing=True
00109	     AirSpeed=500.000000
00110	     AccelRate=800.000000
00111	     Health=1
00112	     LandMovementState="PlayerFlying"
00113	     bCollideActors=True
00114	     bBlockActors=True
00115	     bBlockPlayers=True
00116	     bProjTarget=True
00117	     Physics=PHYS_Flying
00118	     Mesh=SkeletalMesh'XIIIPersos.mouetteM'
00119	     CollisionRadius=28.000000
00120	     CollisionHeight=16.000000
00121	     RotationRate=(Pitch=12000,Yaw=20000,Roll=12000)
00122	}

End Source Code