RuneI
Class LokiBust

source: c:\runehov\RuneI\Classes\LokiBust.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Pawn
         |
         +--RuneI.ScriptPawn
            |
            +--RuneI.LokiBust
Direct Known Subclasses:None

class LokiBust
extends RuneI.ScriptPawn

//============================================================================= // LokiBust. //=============================================================================
Variables
 float HeadTime
 float MaxDeviation
 bFadingIn, bFadingOut
 LokiEffect plaque

States
Disappear, Appear, Acquisition

Function Summary
 void Destroyed()
 Texture PainSkin(int BodyPart)
 void PreBeginPlay()
 void PreSetMovement()
 void Tick(float DeltaTime)
 void UpdateOdinAlpha(float DeltaTime)
 void UpdateOdinLocation(float DeltaTime)


State Disappear Function Summary
 void Died(Pawn Killer, name DamageType, vector HitLocation)
     
//============================================================
//
// Died
// 
// Used as a convenient way to remove the Odin Head
//============================================================
 EMatterType MatterForJoint(int joint)
     
//============================================================
//
// MatterForJoint
//
// Returns what kind of material joint is associated with
//============================================================
 void Tick(float DeltaTime)
     
	{
		Style = STY_AlphaBlend;
	}

	
 void BeginState()
     
{
	


State Appear Function Summary
 void Tick(float DeltaTime)
     
	{
		Style = STY_AlphaBlend;
		AlphaScale = 0;
	}

	
 void BeginState()
     
{
	


State Acquisition Function Summary



Source Code


00001	//=============================================================================
00002	// LokiBust.
00003	//=============================================================================
00004	class LokiBust expands ScriptPawn;
00005	
00006	// Emit light
00007	
00008	var() float MaxDeviation;
00009	var float HeadTime;
00010	var LokiEffect plaque;
00011	var bool bFadingIn, bFadingOut;
00012	
00013	function PreBeginPlay()
00014	{
00015		// Background sprite/smoke effect
00016		plaque = Spawn(class'LokiEffect',self,, Location - vect(0,0,7) * DrawScale);
00017	
00018		HeadTime=0;
00019		HomeBase = Location;
00020		
00021		// Move to defaults
00022		Style = STY_AlphaBlend;
00023		AlphaScale = 0;
00024		bFadingIn = true;
00025	
00026		Super.PreBeginPlay();
00027	}
00028	
00029	function Destroyed()
00030	{
00031		if (plaque != None)
00032			plaque.Destroy();
00033		Super.Destroyed();
00034	}
00035	
00036	function Texture PainSkin(int BodyPart)
00037	{
00038	}
00039	
00040	function PreSetMovement()
00041	{
00042		bCanFly = true;
00043	}
00044	
00045	function Tick(float DeltaTime)
00046	{
00047		UpdateOdinLocation(DeltaTime);
00048		UpdateOdinAlpha(DeltaTime);
00049		Super.Tick(DeltaTime);
00050	}
00051	
00052	function UpdateOdinLocation(float DeltaTime)
00053	{
00054		local vector loc;
00055		local vector X,Y,Z;
00056	
00057		HeadTime += DeltaTime;
00058	
00059		GetAxes(Rotation, X,Y,Z);
00060	
00061		loc = HomeBase + (Y * Sin(HeadTime) * MaxDeviation) + (Z * Cos(HeadTime) * 2 * MaxDeviation);
00062		SetLocation(loc);
00063	}
00064	
00065	function UpdateOdinAlpha(float DeltaTime)
00066	{
00067		if (bFadingIn)
00068		{
00069			AlphaScale += DeltaTime * 0.3;
00070			if(AlphaScale >= 1.0)
00071			{
00072				AlphaScale = 1.0;
00073				Style = STY_Normal;
00074				bFadingIn = false;
00075			}
00076		}
00077		else if (bFadingOut)
00078		{
00079			AlphaScale -= DeltaTime * 0.3;
00080			if(AlphaScale <= 0)
00081			{
00082				AlphaScale = 0;
00083				Destroy();
00084			}
00085		}
00086	}
00087	
00088	State Acquisition
00089	{
00090	ignores EnemyAcquired, SeePlayer, HearNoise;
00091	}
00092	
00093	/*
00094	auto state Appear
00095	{
00096		function BeginState()
00097		{
00098			Style = STY_AlphaBlend;
00099			AlphaScale = 0;
00100		}
00101	
00102		function Tick(float DeltaTime)
00103		{
00104			UpdateOdinLocation(DeltaTime);
00105			
00106			AlphaScale += DeltaTime * 0.3;
00107			if(AlphaScale >= 0.75)
00108			{
00109				AlphaScale = 0.75;
00110				GotoState('');
00111			}
00112			Super.Tick(DeltaTime);
00113		}
00114	}
00115	
00116	state Disappear
00117	{
00118		function BeginState()
00119		{
00120			Style = STY_AlphaBlend;
00121		}
00122	
00123		function Tick(float DeltaTime)
00124		{
00125			UpdateOdinLocation(DeltaTime);
00126			
00127			AlphaScale -= DeltaTime * 0.3;
00128			if(AlphaScale <= 0)
00129			{
00130				AlphaScale = 0;
00131				Destroy();
00132			}
00133			Super.Tick(DeltaTime);
00134		}
00135	}
00136	*/
00137	
00138	//============================================================
00139	//
00140	// MatterForJoint
00141	//
00142	// Returns what kind of material joint is associated with
00143	//============================================================
00144	function EMatterType MatterForJoint(int joint)
00145	{
00146		return MATTER_NONE;
00147	}
00148	
00149	//============================================================
00150	//
00151	// Died
00152	// 
00153	// Used as a convenient way to remove the Odin Head
00154	//============================================================
00155	
00156	function Died(pawn Killer, name DamageType, vector HitLocation)
00157	{
00158		bFadingOut=true;
00159		Style = STY_AlphaBlend;
00160	}
00161	
00162	defaultproperties
00163	{
00164	     MaxDeviation=5.000000
00165	     bFallAtStartup=False
00166	     ClassID=15
00167	     AttitudeToPlayer=ATTITUDE_Ignore
00168	     MaxMouthRot=7000
00169	     MaxMouthRotRate=65535
00170	     bDynamicLight=True
00171	     DrawScale=5.000000
00172	     CollisionRadius=60.000000
00173	     CollisionHeight=93.000000
00174	     bCollideActors=False
00175	     bCollideWorld=False
00176	     bBlockActors=False
00177	     bBlockPlayers=False
00178	     Skeletal=SkelModel'creatures.LokiHead'
00179	}

End Source Code