RuneI
Class VikingShield2

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

class VikingShield2
extends Engine.Shield

//============================================================================= // VikingShield2. //=============================================================================

Function Summary
 void DestroyEffect()
     
//-----------------------------------------------------------------------------
//
// DestroyEffect
//
// Used when shield is destroyed
//-----------------------------------------------------------------------------
 void PlayHitSound(name DamageType)
     
//=============================================================================
//
// Sound Functions
//
//=============================================================================



Source Code


00001	//=============================================================================
00002	// VikingShield2.
00003	//=============================================================================
00004	class VikingShield2 expands Shield;
00005	
00006	
00007	//-----------------------------------------------------------------------------
00008	//
00009	// DestroyEffect
00010	//
00011	// Used when shield is destroyed
00012	//-----------------------------------------------------------------------------
00013	function DestroyEffect()
00014	{
00015		local int i, numchunks, NumSourceGroups;
00016		local debris d;
00017		local debriscloud c;
00018		local vector loc;
00019		local float scale;
00020	
00021		// Spawn cloud
00022		c = Spawn(class'DebrisCloud');
00023		if(c != None)
00024			c.SetRadius(Max(CollisionRadius,CollisionHeight));
00025	
00026		// Spawn debris
00027		numchunks = Clamp(Mass/10, 2, 15);
00028	
00029		// Find appropriate size of chunks
00030		scale = (CollisionRadius*CollisionRadius*CollisionHeight) / (numchunks*500);
00031		scale = scale ** 0.3333333;
00032		for (NumSourceGroups=1; NumSourceGroups<16; NumSourceGroups++)
00033		{
00034			if (SkelGroupSkins[NumSourceGroups] == None)
00035				break;
00036		}
00037	
00038		for (i=0; i<numchunks; i++)
00039		{
00040			loc = Location;
00041			loc.X += (FRand()*2-1)*CollisionRadius;
00042			loc.Y += (FRand()*2-1)*CollisionRadius;
00043			loc.Z += (FRand()*2-1)*CollisionHeight;
00044			d = Spawn(class'debriswood',,,loc);
00045			if(d != None)
00046			{
00047				d.SetSize(scale);
00048				d.SetTexture(SkelGroupSkins[i%NumSourceGroups]);
00049			}
00050		}
00051	}
00052	
00053	//=============================================================================
00054	//
00055	// Sound Functions
00056	//
00057	//=============================================================================
00058	function PlayHitSound(name DamageType)
00059	{
00060	}
00061	
00062	defaultproperties
00063	{
00064	     Health=70
00065	     rating=2
00066	     DestroyedSound=Sound'WeaponsSnd.Shields.xtroy02'
00067	     PickupMessage="You have found a Viking Metal Shield"
00068	     RespawnSound=Sound'OtherSnd.Respawns.respawn01'
00069	     DropSound=Sound'WeaponsSnd.Shields.xdrop02'
00070	     PickupMessageClass=Class'RuneI.PickupMessage'
00071	     LODCurve=LOD_CURVE_ULTRA_CONSERVATIVE
00072	     CollisionRadius=13.000000
00073	     CollisionHeight=3.000000
00074	     bCollideWorld=True
00075	     Mass=150.000000
00076	     Skeletal=SkelModel'weapons.VikingShield'
00077	     SkelGroupSkins(0)=Texture'weapons.VikingShieldviking_shield3'
00078	     SkelGroupSkins(1)=Texture'weapons.VikingShieldviking_shield3'
00079	}

End Source Code