RuneI
Class VikingShortSword

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

class VikingShortSword
extends RuneI.Sword

//============================================================================= // VikingShortSword. //=============================================================================
Variables
 Shield StoredShield
           Stores the current shield while the magic shield is out


Function Summary
 void PowerupEnded()
 void PowerupInit()
     
//=============================================================================
//
// Powerup: Shield
//
// This function is called when the weapon is initially powered up
//=============================================================================



Source Code


00001	//=============================================================================
00002	// VikingShortSword.
00003	//=============================================================================
00004	class VikingShortSword expands sword;
00005	
00006	var Shield StoredShield; // Stores the current shield while the magic shield is out
00007	
00008	//=============================================================================
00009	//
00010	// Powerup: Shield
00011	//
00012	// This function is called when the weapon is initially powered up
00013	//=============================================================================
00014	function PowerupInit()
00015	{
00016		local Pawn PawnOwner;
00017		local Shield shield;
00018	
00019		Super.PowerupInit();
00020	
00021		StoredShield = None;
00022		PawnOwner = Pawn(Owner);
00023		if (PawnOwner!=None)
00024		{
00025			if (PawnOwner.Shield != None)
00026			{	// Powerup up existing shield
00027				StoredShield = PawnOwner.Shield;
00028				StoredShield.bHidden = true;
00029				StoredShield.bSweepable = false;
00030				PawnOwner.DetachActorFromJoint(PawnOwner.JointNamed(PawnOwner.ShieldJoint));
00031			}
00032	
00033			// Give a magic shield
00034			shield = Spawn(class'MagicShield',,,PawnOwner.Location);
00035			PawnOwner.AddInventory( shield );
00036			PawnOwner.AttachActorToJoint(shield, PawnOwner.JointNamed(PawnOwner.ShieldJoint));
00037			PawnOwner.Shield = shield;
00038			Shield.GotoState('Active');
00039		}
00040	}
00041	
00042	function PowerupEnded()
00043	{
00044		local Pawn PawnOwner;
00045		local Shield shield;
00046	
00047		Super.PowerupEnded();
00048	
00049		PawnOwner = Pawn(Owner);
00050		if (PawnOwner!=None)
00051		{
00052			shield = PawnOwner.Shield;
00053			if (shield.IsA('MagicShield'))
00054			{
00055				PawnOwner.DropShield();
00056				shield.Destroy();
00057				PawnOwner.Shield = None;
00058			}
00059	
00060			// Restore stored shield
00061			if(StoredShield != None)
00062			{
00063				PawnOwner.Shield = StoredShield;			
00064				PawnOwner.Shield.bHidden = false;
00065				PawnOwner.Shield.bSweepable = true;
00066				PawnOwner.AttachActorToJoint(PawnOwner.Shield, PawnOwner.JointNamed(PawnOwner.ShieldJoint));
00067				StoredShield = None;
00068			}
00069		}
00070	}
00071	
00072	defaultproperties
00073	{
00074	     StowMesh=1
00075	     Damage=10
00076	     BloodTexture=Texture'weapons.shortswordshortswordblood'
00077	     RunePowerRequired=25
00078	     RunePowerDuration=15.000000
00079	     PowerupMessage="Shield!"
00080	     ThroughAir(0)=Sound'WeaponsSnd.Swings.swing13'
00081	     ThroughAirBerserk(0)=Sound'WeaponsSnd.Swings.bswing01'
00082	     HitFlesh(0)=Sound'WeaponsSnd.ImpFlesh.impfleshsword03'
00083	     HitWood(0)=Sound'WeaponsSnd.ImpWood.impactwood10'
00084	     HitStone(0)=Sound'WeaponsSnd.ImpStone.impactstone01'
00085	     HitMetal(0)=Sound'WeaponsSnd.ImpMetal.impactmetal11'
00086	     HitDirt(0)=Sound'WeaponsSnd.ImpEarth.impactearth02'
00087	     HitShield=Sound'WeaponsSnd.Shields.shield01'
00088	     HitWeapon=Sound'WeaponsSnd.Swords.sword01'
00089	     HitBreakableWood=Sound'WeaponsSnd.ImpWood.impactwood12'
00090	     HitBreakableStone=Sound'WeaponsSnd.ImpStone.impactstone11'
00091	     SheathSound=Sound'WeaponsSnd.Stows.xstow03'
00092	     UnsheathSound=Sound'WeaponsSnd.Stows.xunstow03'
00093	     ThrownSoundLOOP=Sound'WeaponsSnd.Throws.throw01L'
00094	     PowerUpSound=Sound'WeaponsSnd.PowerUps.powerstart27'
00095	     PoweredUpSoundLOOP=Sound'WeaponsSnd.PowerUps.power36L'
00096	     PitchDeviation=0.070000
00097	     PowerupIcon=Texture'RuneFX2.ssword'
00098	     PowerupIconAnim=Texture'RuneFX2.ssword1a'
00099	     PoweredUpSwipeClass=Class'RuneI.WeaponSwipeRed'
00100	     A_AttackD=S1_attackD
00101	     A_AttackDReturn=S1_attackDreturn
00102	     A_AttackStandA=S1_StandingAttackA
00103	     A_AttackStandAReturn=S1_StandingAttackAReturn
00104	     A_AttackStandB=S1_StandingAttackB
00105	     A_AttackStandBReturn=S1_StandingAttackBReturn
00106	     A_AttackBackupB=S1_BackupAttackB
00107	     A_AttackBackupBReturn=S1_BackupAttackBReturn
00108	     A_Throw=S1_Throw
00109	     A_Powerup=S1_Powerup
00110	     A_Defend=S1_DefendTO
00111	     A_DefendIdle=S1_DefendIdle
00112	     A_PainFront=S1_painFront
00113	     A_PainRight=S1_painBack
00114	     A_PickupGroundLeft=S1_PickupLeft
00115	     A_PickupHighLeft=S1_PickupLeftHigh
00116	     A_Taunt=S1_Taunt
00117	     A_PumpTrigger=S1_PumpTrigger
00118	     A_LeverTrigger=S1_LeverTrigger
00119	     PickupMessage="You bear a Viking Short Sword"
00120	     PickupSound=Sound'OtherSnd.Pickups.grab01'
00121	     DropSound=Sound'WeaponsSnd.Drops.sworddrop05'
00122	     Skeletal=SkelModel'weapons.shortsword'
00123	     SkelGroupSkins(0)=Texture'weapons.shortswordshortsword'
00124	     SkelGroupSkins(1)=Texture'weapons.shortswordshortsword'
00125	}

End Source Code