RuneI
Class RomanSword

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

class RomanSword
extends RuneI.Sword

//============================================================================= // RomanSword. //=============================================================================

Function Summary
 int CalculateDamage(Actor Victim)
 void PowerupEnded()
 void PowerupEndingPulseOff()
 void PowerupEndingPulseOn()
 void PowerupInit()
     
//=============================================================================
//
// Powerup: FireSword
//
// This function is called when the weapon is initially powered up
//=============================================================================
 
simulated
RemovePowerupEffect()
 
simulated
SpawnPowerupEffect()



Source Code


00001	//=============================================================================
00002	// RomanSword.
00003	//=============================================================================
00004	class RomanSword expands Sword;
00005	
00006	//=============================================================================
00007	//
00008	// Powerup: FireSword
00009	//
00010	// This function is called when the weapon is initially powered up
00011	//=============================================================================
00012	
00013	function PowerupInit()
00014	{
00015		SpawnPowerupEffect();
00016		SwipeClass = PoweredUpSwipeClass;
00017		DamageType='fire';
00018		ThrownDamageType='fire';
00019	}
00020	
00021	function PowerupEndingPulseOn()
00022	{
00023		PlaySound(PoweredUpEndingSound, SLOT_None);
00024	}
00025	
00026	function PowerupEndingPulseOff()
00027	{
00028	}
00029	
00030	function PowerupEnded()
00031	{
00032		local int i;
00033		local actor fire;
00034		
00035		Super.PowerupEnded();
00036	
00037		DamageType=Default.DamageType;
00038		ThrownDamageType=Default.ThrownDamageType;
00039	}
00040	
00041	simulated function SpawnPowerupEffect()
00042	{
00043		local EffectSkeleton ES;
00044	
00045		// Spawn an EffectSkeleton that will display all powered up effects
00046		ES = Spawn(class'EffectSkelFlameSword', self);
00047		if (ES != None)
00048		{
00049			AttachActorToJoint(ES, 0);
00050		}
00051	}
00052	
00053	simulated function RemovePowerupEffect()
00054	{
00055		local actor A;
00056		// Remove Effect skeleton
00057		A = DetachActorFromJoint(0);
00058		A.Destroy();
00059	}
00060	
00061	function int CalculateDamage(actor Victim)
00062	{
00063		local int dam;
00064		local bool bCollisionJoints;
00065		local int i;
00066	
00067		dam = Super.CalculateDamage(Victim);
00068	
00069		if(bPoweredUp)
00070		{
00071			if (Pawn(Victim)!=None)
00072			{
00073				if(Victim.IsA('ScriptPawn') && !ScriptPawn(Victim).bIsBoss)
00074				{
00075					Pawn(Victim).PowerupFire(Pawn(Owner));
00076					dam *= 2;
00077				}
00078			}
00079			else
00080			{
00081				for (i=0; i<Victim.NumJoints(); i++)
00082				{
00083					if ((Victim.JointFlags[i] & JOINT_FLAG_COLLISION)!=0)
00084					{
00085						bCollisionJoints = true;
00086						Victim.SetOnFire(Pawn(Owner), i);
00087					}
00088				}
00089				if (bCollisionJoints)
00090					return 0;
00091			}
00092		}
00093	
00094		return(dam);
00095	}
00096	
00097	defaultproperties
00098	{
00099	     StowMesh=1
00100	     Damage=15
00101	     BloodTexture=Texture'weapons.romanswordroman_blood'
00102	     rating=1
00103	     SweepJoint2=6
00104	     RunePowerRequired=50
00105	     RunePowerDuration=15.000000
00106	     PowerupMessage="FlameSword!"
00107	     ThroughAir(0)=Sound'WeaponsSnd.Swings.swing14'
00108	     ThroughAirBerserk(0)=Sound'WeaponsSnd.Swings.bswing02'
00109	     HitFlesh(0)=Sound'WeaponsSnd.ImpFlesh.impfleshsword05'
00110	     HitWood(0)=Sound'WeaponsSnd.ImpWood.impactwood02'
00111	     HitStone(0)=Sound'WeaponsSnd.ImpStone.impactstone16'
00112	     HitMetal(0)=Sound'WeaponsSnd.ImpMetal.impactmetal05'
00113	     HitDirt(0)=Sound'WeaponsSnd.ImpEarth.impactearth01'
00114	     HitShield=Sound'WeaponsSnd.Shields.shield02'
00115	     HitWeapon=Sound'WeaponsSnd.Swords.sword02'
00116	     HitBreakableWood=Sound'WeaponsSnd.ImpWood.impactwood12'
00117	     HitBreakableStone=Sound'WeaponsSnd.ImpStone.impactstone11'
00118	     SheathSound=Sound'WeaponsSnd.Stows.xstow03'
00119	     UnsheathSound=Sound'WeaponsSnd.Stows.xunstow03'
00120	     ThrownSoundLOOP=Sound'WeaponsSnd.Throws.throw01L'
00121	     PowerUpSound=Sound'WeaponsSnd.PowerUps.powerstart26'
00122	     PoweredUpSoundLOOP=Sound'WeaponsSnd.PowerUps.power03L'
00123	     PitchDeviation=0.075000
00124	     PowerupIcon=Texture'RuneFX2.rsword'
00125	     PowerupIconAnim=Texture'RuneFX2.rsword1a'
00126	     PoweredUpSwipeClass=Class'RuneI.WeaponSwipeFire'
00127	     A_Idle=S2_idle
00128	     A_AttackA=S2_attackA
00129	     A_AttackAReturn=S2_attackAReturn
00130	     A_AttackB=S2_attackB
00131	     A_AttackBReturn=S2_attackBReturn
00132	     A_AttackC=S2_attackC
00133	     A_AttackCReturn=S2_attackCReturn
00134	     A_AttackStandA=S2_StandingAttackA
00135	     A_AttackStandAReturn=S2_StandingattackAreturn
00136	     A_AttackStandB=S2_StandingAttackB
00137	     A_AttackStandBReturn=S2_StandingAttackBReturn
00138	     A_AttackBackupB=S1_BackupAttackB
00139	     A_AttackBackupBReturn=S1_BackupAttackBReturn
00140	     A_Throw=S2_Throw
00141	     A_Powerup=s2_powerup
00142	     A_Defend=S2_DefendTo
00143	     A_DefendIdle=S2_DefendIdle
00144	     A_PainFront=S2_painFront
00145	     A_PainRight=S1_painBack
00146	     A_PickupGroundLeft=S2_PickupLeft
00147	     A_PickupHighLeft=S2_PickupLeftHigh
00148	     A_Taunt=s2_taunt
00149	     A_PumpTrigger=S2_PumpTrigger
00150	     A_LeverTrigger=S2_LeverTrigger
00151	     PickupMessage="You now carry a Roman Sword"
00152	     PickupSound=Sound'OtherSnd.Pickups.grab02'
00153	     DropSound=Sound'WeaponsSnd.Drops.sworddrop04'
00154	     Mass=12.000000
00155	     Skeletal=SkelModel'weapons.romansword'
00156	     SkelGroupSkins(0)=Texture'weapons.romanswordroman_sword'
00157	     SkelGroupSkins(1)=Texture'weapons.romanswordroman_sword'
00158	}

End Source Code