RuneI
Class BoneClub

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

class BoneClub
extends RuneI.Hammer

//============================================================================= // BoneClub. //=============================================================================

Function Summary
 void PowerupEnded()
 void PowerupEndingPulseOff()
 void PowerupEndingPulseOn()
 void PowerupInit()
     
//=============================================================================
//
// Powerup: SonicBlast
//
// This function is called when the weapon is initially powered up
//=============================================================================
 
simulated
RemovePowerupEffect()
 void SonicDamage(float dist, vector dir)
 
simulated
SpawnPowerupEffect()
 void WeaponFire(int SwingCount)



Source Code


00001	//=============================================================================
00002	// BoneClub.
00003	//=============================================================================
00004	class BoneClub expands Hammer;
00005	
00006	var(Sounds) Sound PoweredUpFireSound;
00007	//=============================================================================
00008	//
00009	// Powerup: SonicBlast
00010	//
00011	// This function is called when the weapon is initially powered up
00012	//=============================================================================
00013	
00014	
00015	function PowerupInit()
00016	{	
00017		SpawnPowerupEffect();
00018		SwipeClass = PoweredUpSwipeClass;
00019		//DesiredColorAdjust.Z = 140;
00020	}
00021	
00022	function PowerupEndingPulseOn()
00023	{
00024		DesiredFatness = 140;
00025		PlaySound(PoweredUpEndingSound, SLOT_None);
00026	}
00027	
00028	function PowerupEndingPulseOff()
00029	{
00030		DesiredFatness = 128;
00031	}
00032	
00033	function PowerupEnded()
00034	{
00035		Super.PowerupEnded();
00036	}
00037	
00038	
00039	simulated function SpawnPowerupEffect()
00040	{
00041		local EffectSkeleton ES;
00042	
00043		// Spawn an EffectSkeleton that will display all powered up effects
00044		ES = Spawn(class'EffectSkelSonicClub', self);
00045		if (ES != None)
00046		{
00047			AttachActorToJoint(ES, 0);
00048		}
00049	}
00050	
00051	simulated function RemovePowerupEffect()
00052	{
00053		local actor A;
00054		// Remove Effect skeleton
00055		A = DetachActorFromJoint(0);
00056		A.Destroy();
00057	}
00058	
00059	
00060	function WeaponFire(int SwingCount)
00061	{
00062		local SonicBlast B;
00063		local SonicBlastHighlight C;
00064		local BeamSystem beam;
00065		local vector loc;
00066		local int i, count;
00067		local float speed;
00068		local vector end;
00069		local vector HitLocation, HitNormal;
00070		local float dist;
00071		local vector X, Y, Z;
00072	
00073		if (bPoweredUp && SwingCount == 0)
00074		{
00075			GetAxes(PlayerPawn(Owner).ViewRotation, X, Y, Z);
00076			loc = Owner.Location + X * 30;
00077			speed = 0.6;
00078			
00079			end = Owner.Location + X * 350;
00080			if(Trace(HitLocation, HitNormal, end, Owner.Location, false) == None)
00081				HitLocation = end;
00082	
00083			dist = VSize(HitLocation - Owner.Location);
00084			count = dist / 50;
00085			for(i = 0; i < count; i++)
00086			{
00087				B = Spawn(class'SonicBlast',,, loc, rotator(X));
00088				B.DrawScale = 0.3 * speed;
00089				C = Spawn(class'SonicBlastHighlight',,, loc, rotator(X));
00090				C.DrawScale = 0.3 * speed;
00091				loc += X * 50;
00092				speed += 0.35;
00093			}
00094			
00095	//		beam = Spawn(class'SonicBeam',,, Owner.Location + X * 25);
00096	//		beam.TargetLocation = HitLocation;
00097	
00098			// Damage all actors along the sonic blast range
00099			SonicDamage(dist, X);	
00100			
00101			PlaySound(PoweredUpFireSound, SLOT_Interface);	
00102		}
00103	}
00104	
00105	function SonicDamage(float dist, vector dir)
00106	{
00107		// Note:  This is a method that damages all actors in a given cone
00108		local actor A;
00109		local vector v1;
00110		local float dot;
00111	
00112		foreach VisibleActors(class'actor', A, dist, Owner.Location)
00113		{
00114			if(A == Owner || A.Owner == Owner)
00115				continue;
00116	
00117			if(A.IsA('ScriptPawn') && ScriptPawn(A).bIsBoss)
00118				continue;
00119	
00120			v1 = Normal(A.Location - Location);
00121	
00122			dot = v1 dot dir;
00123	
00124			// If the target actor is within the cone, damage it
00125			if(abs(dot) > 0.75)
00126				a.JointDamaged(Damage * 1.25, Pawn(Owner), a.Location, vect(0, 0, 0), 'blunt', 0);
00127		}	
00128	
00129	/* This method damages actors in a cylinder emminating from the Player
00130		extent.x = 50;
00131		extent.y = 50;
00132		extent.z = 50;
00133		foreach TraceActors(class'actor', a, hitLoc, hitNorm, end, start, extent, false)
00134		{
00135			if(a != Owner && a.Owner != Owner)		
00136				a.JointDamaged(Damage * 1.5, Pawn(Owner), a.Location, vect(0, 0, 0), 'blunt', 0);
00137		}
00138	*/
00139	}
00140	
00141	defaultproperties
00142	{
00143	     PoweredUpFireSound=Sound'WeaponsSnd.PowerUps.atwilight04'
00144	     StowMesh=1
00145	     Damage=20
00146	     BloodTexture=Texture'weapons.GoblinClubgoblin_spikeclubblood'
00147	     rating=1
00148	     RunePowerRequired=25
00149	     RunePowerDuration=10.000000
00150	     PowerupMessage="Sonic Blast!"
00151	     ThroughAir(0)=Sound'WeaponsSnd.Swings.swing20'
00152	     ThroughAirBerserk(0)=Sound'WeaponsSnd.Swings.bswing07'
00153	     HitFlesh(0)=Sound'WeaponsSnd.ImpFlesh.impfleshhammer05'
00154	     HitWood(0)=Sound'WeaponsSnd.ImpWood.impactwood01'
00155	     HitStone(0)=Sound'WeaponsSnd.ImpStone.impactstone19'
00156	     HitMetal(0)=Sound'WeaponsSnd.ImpMetal.impactmetal10'
00157	     HitDirt(0)=Sound'WeaponsSnd.ImpEarth.impactearth02'
00158	     HitShield=Sound'WeaponsSnd.Shields.shield07'
00159	     HitWeapon=Sound'WeaponsSnd.Swords.sword07'
00160	     HitBreakableWood=Sound'WeaponsSnd.ImpWood.impactwood12'
00161	     HitBreakableStone=Sound'WeaponsSnd.ImpStone.impactstone11'
00162	     SheathSound=Sound'WeaponsSnd.Stows.xstow01'
00163	     UnsheathSound=Sound'WeaponsSnd.Stows.xunstow01'
00164	     ThrownSoundLOOP=Sound'WeaponsSnd.Throws.throw01L'
00165	     PowerUpSound=Sound'WeaponsSnd.PowerUps.powerstart30'
00166	     PoweredUpSoundLOOP=Sound'WeaponsSnd.PowerUps.power70L'
00167	     PitchDeviation=0.075000
00168	     PowerupIcon=Texture'RuneFX2.gclub'
00169	     PowerupIconAnim=Texture'RuneFX2.gclub1a'
00170	     PoweredUpSwipeClass=Class'RuneI.WeaponSwipeRed'
00171	     A_Idle=X1_Idle
00172	     A_AttackA=H2_attackA
00173	     A_AttackAReturn=H2_attackAreturn
00174	     A_AttackB=H2_attackB
00175	     A_AttackBReturn=H2_attackBreturn
00176	     A_AttackC=H2_attackC
00177	     A_AttackCReturn=H2_attackCreturn
00178	     A_AttackStandA=H2_StandingAttackA
00179	     A_AttackStandAReturn=H2_StandingAttackAReturn
00180	     A_AttackStandB=H2_StandingAttackB
00181	     A_AttackStandBReturn=H2_StandingAttackBReturn
00182	     A_AttackBackupA=H2_BackupAttackA
00183	     A_AttackBackupAReturn=H2_BackupAttackAreturn
00184	     A_AttackBackupB=H2_BackupAttackB
00185	     A_Throw=H3_throw
00186	     A_Powerup=X1_Powerup
00187	     A_Defend=X1_DefendTO
00188	     A_DefendIdle=X1_DefendIdle
00189	     A_PainFront=X1_painFront
00190	     A_PainRight=S1_painBack
00191	     A_PickupGroundLeft=X1_PickupLeft
00192	     A_PickupHighLeft=X1_PickupLeftHigh
00193	     A_Taunt=H2_Taunt
00194	     A_PumpTrigger=X1_PumpTrigger
00195	     A_LeverTrigger=X1_LeverTrigger
00196	     PickupMessage="You have discovered a Bone Club"
00197	     PickupSound=Sound'OtherSnd.Pickups.grab02'
00198	     DropSound=Sound'WeaponsSnd.Drops.hammerdrop04'
00199	     Mass=12.000000
00200	     Skeletal=SkelModel'weapons.GoblinClub'
00201	     SkelGroupSkins(0)=Texture'weapons.GoblinClubgoblin_spikeclub'
00202	     SkelGroupSkins(1)=Texture'weapons.GoblinClubgoblin_spikeclub'
00203	}

End Source Code