XIII
Class SixSenseSkill

source: C:\XIII\XIII\Classes\SixSenseSkill.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Inventory
         |
         +--Engine.Powerups
            |
            +--XIII.XIIISkill
               |
               +--XIII.SixSenseSkill
Direct Known Subclasses:None

class SixSenseSkill
extends XIII.XIIISkill

//----------------------------------------------------------- // //-----------------------------------------------------------
Variables
 bool bImOn
 float fSixSenseTimer

States
ImOn, SixSStandBy

Function Summary
 void Heard(Actor A)
     
//____________________________________________________________________
 void PickupFunction(Pawn Other)
     
//_____________________________________________________________________________
// skills don't go into selected slot
 void PostBeginPlay()
     
//____________________________________________________________________
 void ResetTimer()
     
//____________________________________________________________________
 void Timer()
     
//____________________________________________________________________


State ImOn Function Summary
 void Heard(Actor A)
 void EndState()
 void BeginState()


State SixSStandBy Function Summary
 void BeginState()



Source Code


00001	//-----------------------------------------------------------
00002	//
00003	//-----------------------------------------------------------
00004	class SixSenseSkill extends XIIISkill;
00005	
00006	var float fSixSenseTimer;
00007	var bool bImOn;
00008	
00009	//____________________________________________________________________
00010	function PostBeginPlay()
00011	{
00012	    if ( XIIIPlayerPawn(Owner) != none )
00013	    {
00014	      XIIIPlayerPawn(Owner).SSSk = self;
00015	    }
00016	    GotoState('SixSStandBy');
00017	}
00018	
00019	//_____________________________________________________________________________
00020	// skills don't go into selected slot
00021	function PickupFunction(Pawn Other)
00022	{
00023	    Super.PickupFunction(Other);
00024	    if ( XIIIPlayerPawn(Other) != none )
00025	    {
00026	      XIIIPlayerPawn(Other).SSSk = self;
00027	    }
00028	    GotoState('SixSStandBy');
00029	}
00030	
00031	//____________________________________________________________________
00032	function ResetTimer()
00033	{
00034	    fSixSenseTimer = 2.0;
00035	    if ( bImOn )
00036	      GotoState('SixSStandBy');
00037	}
00038	
00039	//____________________________________________________________________
00040	function Timer()
00041	{
00042	    if ( XIIIPlayerPawn(Owner) != none )
00043	      XIIIPlayerPawn(Owner).SSSk = self;
00044	    fSixSenseTimer -= 0.5;
00045	    if ( fSixSenseTimer <= 0.0 )
00046	      GotoState('ImOn');
00047	}
00048	
00049	//____________________________________________________________________
00050	function Heard(Actor A);
00051	
00052	//____________________________________________________________________
00053	// Waiting for good conditions to be activated
00054	State SixSStandBy
00055	{
00056	    function BeginState()
00057	    {
00058	      SetTimer(0.5, true);
00059	      bImOn = false;
00060	      fSixSenseTimer = 2.0;
00061	    }
00062	}
00063	
00064	//____________________________________________________________________
00065	state ImOn
00066	{
00067	    function BeginState()
00068	    {
00069	      bImOn = true;
00070	      SetTimer(0.0,false);
00071	      XIIIBaseHud(XIIIPlayerController(Pawn(Owner).Controller).MyHud).bDrawSixSense=true;
00072	      XIIIBaseHud(XIIIPlayerController(Pawn(Owner).Controller).MyHud).ResetSixSenseSFX();
00073	    }
00074	    function EndState()
00075	    {
00076	      XIIIBaseHud(XIIIPlayerController(Pawn(Owner).Controller).MyHud).bDrawSixSense=false;
00077	      XIIIBaseHud(XIIIPlayerController(Pawn(Owner).Controller).MyHud).ResetSixSenseSFX();
00078	    }
00079	    function Heard(Actor A)
00080	    {
00081	      local vector V;
00082	
00083	// iKi: Don't use sound-display when sound-instigator is visible
00084	// ELR No, Use it anytime
00085	       if ( (XIIIPawn(A) != none) ) //&& (!Pawn(Owner).Controller.CanSee(XIIIPawn(A))) )
00086	      {
00087	        if ( vector(Pawn(owner).rotation) dot normal(A.Location-Pawn(Owner).Location) > 0.707 )
00088	        {
00089	          V = XIIIPlayerController(Pawn(Owner).Controller).Player.Console.WorldToScreen(A.Location - vect(0,0,1)*A.CollisionHeight);
00090	          V.Z = 1.0 - (vSize(Owner.Location - A.Location) / Pawn(Owner).HearingThreshold) * 3;
00091	          XIIIBaseHud(XIIIPlayerController(Pawn(Owner).Controller).MyHud).AddSixSenseFX(V);
00092	        }
00093	      }
00094	    }
00095	}
00096	
00097	
00098	
00099	defaultproperties
00100	{
00101	     bHidden=False
00102	}

End Source Code