XIII
Class Mouettes

source: C:\XIII\XIII\Classes\Mouettes.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Controller
         |
         +--Engine.AIController
            |
            +--XIII.XIIITransientACreature
               |
               +--XIII.XIIIBirds
                  |
                  +--XIII.Mouettes
Direct Known Subclasses:None

class Mouettes
extends XIII.XIIIBirds

//----------------------------------------------------------- // //-----------------------------------------------------------
States
WaitingforPerturbation
State WaitingforPerturbation Function Summary
 vector PickDestination(XIIITransientAPawn P)
 void Timer()
 void SeePlayer(Pawn seen)
 void EndState()
 void BeginState()



Source Code


00001	//-----------------------------------------------------------
00002	//
00003	//-----------------------------------------------------------
00004	class Mouettes extends XIIIBirds;
00005	
00006	//_____________________________________________________________________________
00007	// Here we are on ground, waiting for the player to disturb us
00008	auto state WaitingforPerturbation
00009	{
00010	    function BeginState()
00011	    {
00012	      Pawn.SetPhysics(PHYS_Walking);
00013	      XIIIBird(Pawn).PlayOnGround();
00014	      SetTimer(1.0, true);
00015	    }
00016	
00017	    function EndState()
00018	    {
00019	      Pawn.SetPhysics(PHYS_Flying);
00020	      Pawn.Velocity=vect(0,0,400);
00021	      SetTimer(0.0, false);
00022	    }
00023	    
00024	    event HearNoise( float Loudness, Actor NoiseMaker)
00025	    {
00026	      if ( vSize(NoiseMaker.Location - location) < fSecurityDist*2 )
00027	      {
00028	        log(self$" had heard "$NoiseMaker$", Taking Off");
00029	        GotoState('Wandering');
00030	      }
00031	    }
00032	
00033	    event Trigger( Actor Other, Pawn EventInstigator )
00034	    {
00035	//        Log(self@"triggered");
00036	//      if ( vSize(EventInstigator.Location - location) < fSecurityDist*2 )
00037	//      {
00038	        log(self$" had been triggerid by "$EventInstigator$", Taking Off");
00039	        GotoState('Wandering');
00040	//      }
00041	    }
00042	
00043	    function SeePlayer(Pawn seen)
00044	    {
00045	      if ( vSize(seen.Location - location) < fSecurityDist*2 )
00046	      {
00047	        log(self$" had seen "$seen$" near, Taking Off");
00048	        GotoState('Wandering');
00049	      }
00050	    }
00051	
00052	    function Timer()
00053	    {
00054	      local XIIIPawn other;
00055	      
00056	      foreach dynamicactors(class'XIIIPawn', other)
00057	        if (vSize(other.Location - location) < fSecurityDist)
00058	        {
00059	          log(self$" near "$other$", Taking off");
00060	          gotostate('Wandering');
00061	        }
00062	    }
00063	    
00064	    function vector PickDestination(XIIITransientAPawn P)
00065	    {
00066	      // Target in front of me to keep the Beginning node rotation
00067	      return StartingSpot.Location + vector(StartingSpot.Rotation);
00068	    }
00069	
00070	Begin:
00071	    Destination = PickDestination(XIIITransientAPawn(Pawn));
00072	    FocalPoint = Destination;
00073	}
00074	
00075	
00076	
00077	defaultproperties
00078	{
00079	     PawnTypes(0)=Class'XIII.mouette'
00080	     bOffCameraSpawns=False
00081	     LocationTypeForSpawn=Class'XIII.MouetteSpot'
00082	}

End Source Code