RuneI
Class DwarfBattleSword

source: c:\runehov\RuneI\Classes\DwarfBattleSword.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Inventory
         |
         +--Engine.Weapon
            |
            +--RuneI.Sword
               |
               +--RuneI.DwarfBattleSword
Direct Known Subclasses:None

class DwarfBattleSword
extends RuneI.Sword

//============================================================================= // DwarfBattleSword. //=============================================================================
Variables
 float DropDelay
 float EffectRadius
 float ElapsedTime
 int RockCount
 bool bAvalanche
 int testint


Function Summary
 void PowerupEnded()
 void PowerupEndingPulseOff()
 void PowerupEndingPulseOn()
 void PowerupInit()
     
//=============================================================================
//
// Powerup: Avalanche
//
//=============================================================================
 
simulated
RemovePowerupEffect()
 
simulated
SpawnPowerupEffect()
 void Tick(float DeltaTime)
 void WeaponFire(int SwingCount)



Source Code


00001	//=============================================================================
00002	// DwarfBattleSword.
00003	//=============================================================================
00004	class DwarfBattleSword expands sword;
00005	
00006	var float EffectRadius;
00007	var int RockCount;
00008	var() float DropDelay;
00009	var float ElapsedTime;
00010	var bool bAvalanche;
00011	var int testint;
00012	
00013	//=============================================================================
00014	//
00015	// Powerup: Avalanche
00016	//
00017	//=============================================================================
00018	function PowerupInit()
00019	{
00020		SpawnPowerupEffect();
00021		SwipeClass = PoweredUpSwipeClass;
00022		DesiredColorAdjust.X = 44;
00023		DesiredColorAdjust.Y = 33;
00024		DesiredColorAdjust.Z = 15;
00025	}
00026	
00027	function PowerupEndingPulseOn()
00028	{
00029		PlaySound(PoweredUpEndingSound, SLOT_None);
00030		DesiredFatness = 140;
00031		DesiredColorAdjust.X = 200;
00032		DesiredColorAdjust.Y = 0;
00033		DesiredColorAdjust.Z = 0;
00034	}
00035	
00036	function PowerupEndingPulseOff()
00037	{
00038		DesiredFatness = 128;
00039		DesiredColorAdjust.X = 0;
00040	}
00041	
00042	
00043	function PowerupEnded()
00044	{
00045		Super.PowerupEnded();
00046		DesiredColorAdjust.X = 0;
00047		DesiredColorAdjust.Y = 0;
00048		DesiredColorAdjust.Z = 0;
00049	
00050		bAvalanche = false;
00051	}
00052	
00053	simulated function SpawnPowerupEffect()
00054	{
00055		local EffectSkeleton ES;
00056	
00057		// Spawn an EffectSkeleton that will display all powered up effects
00058		ES = Spawn(class'EffectSkelAvalancheSword', self);
00059		if (ES != None)
00060		{
00061			AttachActorToJoint(ES, 0);
00062		}
00063	}
00064	
00065	simulated function RemovePowerupEffect()
00066	{
00067		local actor A;
00068		// Remove Effect skeleton
00069		A = DetachActorFromJoint(0);
00070		A.Destroy();
00071	}
00072	
00073	
00074	function WeaponFire(int SwingCount)
00075	{
00076		if (bPoweredUp)
00077		{
00078			bAvalanche = true;
00079			ElapsedTime=DropDelay;
00080			RockCount = Default.RockCount;
00081		}
00082	}
00083	
00084	function Tick(float DeltaTime)
00085	{
00086		local RockAvalanche R;
00087		local vector loc;
00088		local vector outward;
00089		local int angle;
00090	
00091		if (bPoweredUp && bAvalanche)
00092		{
00093			ElapsedTime += DeltaTime;
00094	
00095			if (ElapsedTime > DropDelay)
00096			{
00097				ElapsedTime -= DropDelay;
00098	
00099				// Drop a rock
00100				angle = RandRange(Owner.Rotation.Yaw-4096, Owner.Rotation.Yaw+4096);
00101				outward = vector(rot(0,1,0)*angle);
00102				loc = Owner.Location + outward*RandRange(0, 50);
00103				loc.Z += 3*Owner.CollisionRadius + FRand()*Owner.CollisionRadius;
00104				switch(Rand(3))
00105				{
00106				case 0:	R = spawn(class'RockAvalancheSmall',Owner,,loc);		break;
00107				case 1:	R = spawn(class'RockAvalancheMed',  Owner,,loc);		break;
00108				case 2:	R = spawn(class'RockAvalancheLarge',Owner,,loc);		break;
00109				}
00110				R.Velocity = outward * 500;
00111				R.Instigator = Pawn(Owner);
00112	
00113				if (--RockCount <= 0)
00114				{
00115					RockCount = Default.RockCount;
00116					bAvalanche = false;
00117				}
00118			}
00119		}
00120	}
00121	
00122	defaultproperties
00123	{
00124	     EffectRadius=150.000000
00125	     RockCount=15
00126	     DropDelay=0.100000
00127	     StowMesh=1
00128	     Damage=40
00129	     rating=4
00130	     RunePowerRequired=100
00131	     RunePowerDuration=5.000000
00132	     PowerupMessage="Avalanche!"
00133	     ThroughAir(0)=Sound'WeaponsSnd.Swings.swing02'
00134	     ThroughAirBerserk(0)=Sound'WeaponsSnd.Swings.bswing05'
00135	     HitFlesh(0)=Sound'WeaponsSnd.ImpFlesh.impfleshsword10'
00136	     HitWood(0)=Sound'WeaponsSnd.ImpWood.impactwood09'
00137	     HitStone(0)=Sound'WeaponsSnd.ImpStone.impactstone04'
00138	     HitMetal(0)=Sound'WeaponsSnd.ImpMetal.impactmetal12'
00139	     HitDirt(0)=Sound'WeaponsSnd.ImpEarth.impactearth05'
00140	     HitShield=Sound'WeaponsSnd.Shields.shield05'
00141	     HitWeapon=Sound'WeaponsSnd.Swords.sword05'
00142	     HitBreakableWood=Sound'WeaponsSnd.ImpWood.impactwood12'
00143	     HitBreakableStone=Sound'WeaponsSnd.ImpStone.impactstone13'
00144	     SheathSound=Sound'WeaponsSnd.Stows.xstow04'
00145	     UnsheathSound=Sound'WeaponsSnd.Stows.xunstow04'
00146	     ThrownSoundLOOP=Sound'WeaponsSnd.Throws.throw03L'
00147	     PowerUpSound=Sound'WeaponsSnd.PowerUps.powerstart29'
00148	     PoweredUpSoundLOOP=Sound'WeaponsSnd.PowerUps.power63L'
00149	     PowerupIcon=Texture'RuneFX2.dsword'
00150	     PowerupIconAnim=Texture'RuneFX2.dsword1a'
00151	     PoweredUpSwipeClass=Class'RuneI.WeaponSwipeGray'
00152	     A_Idle=S5_idle
00153	     A_Forward=S4_walk
00154	     A_Backward=S4_backup
00155	     A_Forward45Right=S4_walk45right
00156	     A_Forward45Left=S4_walk45left
00157	     A_Backward45Right=S4_backup45Right
00158	     A_Backward45Left=S4_backup45Left
00159	     A_StrafeRight=S4_strafeRight
00160	     A_StrafeLeft=S4_strafeLeft
00161	     A_AttackA=S5_attackA
00162	     A_AttackAReturn=S5_attackAreturn
00163	     A_AttackB=S5_attackB
00164	     A_AttackBReturn=S5_attackBreturn
00165	     A_AttackC=None
00166	     A_AttackCReturn=None
00167	     A_AttackStandA=S5_StandingAttackA
00168	     A_AttackStandAReturn=S5_StandingAttackAreturn
00169	     A_AttackStandB=S5_StandingAttackB
00170	     A_AttackStandBReturn=S5_StandingAttackBreturn
00171	     A_AttackBackupA=S5_Backupattack
00172	     A_AttackBackupAReturn=None
00173	     A_AttackStrafeRight=S4_StrafeRightAttack
00174	     A_AttackStrafeLeft=S4_StrafeLeftAttack
00175	     A_Throw=S5_Throw
00176	     A_Powerup=S5_Powerup
00177	     A_Defend=None
00178	     A_DefendIdle=None
00179	     A_PainFront=S5_painFront
00180	     A_PainBack=S5_painBack
00181	     A_PainLeft=S5_painLeft
00182	     A_PainRight=S5_painRight
00183	     A_PickupGroundLeft=S5_PickupLeft
00184	     A_PickupHighLeft=S5_PickupLeftHigh
00185	     A_Taunt=s5_taunt
00186	     A_PumpTrigger=S5_PumpTrigger
00187	     A_LeverTrigger=S5_LeverTrigger
00188	     PickupMessage="You have claimed a Dwarven Battle Sword"
00189	     PickupSound=Sound'OtherSnd.Pickups.grab05'
00190	     DropSound=Sound'WeaponsSnd.Drops.sworddrop01'
00191	     Mass=18.000000
00192	     Skeletal=SkelModel'weapons.battlesword'
00193	     SkelGroupSkins(0)=Texture'weapons.battleswordsword'
00194	     SkelGroupSkins(1)=Texture'weapons.battleswordChrome'
00195	     SkelGroupSkins(2)=Texture'weapons.battleswordsword'
00196	}

End Source Code