RuneI
Class Odin

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

class Odin
extends RuneI.ScriptPawn

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

End Source Code