RuneI
Class Axe

source: c:\runehov\RuneI\Classes\Axe.uc
Core.Object
   |
   +--Engine.Actor
      |
      +--Engine.Inventory
         |
         +--Engine.Weapon
            |
            +--RuneI.Axe
Direct Known Subclasses:DwarfBattleAxe, GoblinAxe, HandAxe, SigurdAxe, VikingAxe

class Axe
extends Engine.Weapon

//============================================================================= // Axe. //=============================================================================
Variables
 S1, S2
           temp


Function Summary
 
simulated
Debug(Canvas canvas, int mode)
 void SpawnHitEffect(vector HitLoc, vector HitNorm, int LowMask, int HighMask, Actor HitActor)
     
//=============================================================================
//
// SpawnHitEffect
//
// Spawns an effect based upon what was struck
//=============================================================================
 bool StickInWall(EMatterType matter)
     
//=============================================================================
//
// StickInWall
//
//=============================================================================



Source Code


00001	//=============================================================================
00002	// Axe.
00003	//=============================================================================
00004	class Axe expands Weapon
00005		abstract;
00006	
00007	
00008	var vector S1, S2;	//temp
00009	
00010	//=============================================================================
00011	//
00012	// SpawnHitEffect
00013	//
00014	// Spawns an effect based upon what was struck
00015	//=============================================================================
00016	function SpawnHitEffect(vector HitLoc, vector HitNorm, int LowMask, int HighMask, Actor HitActor)
00017	{	
00018		local int i,j;
00019		local EMatterType matter;
00020		local vector start, end;
00021		local texture tex;
00022	
00023		// Determine what kind of matter was hit
00024		if ((HitActor.Skeletal != None) && (LowMask!=0 || HighMask!=0))
00025		{
00026			for (j=0; j<HitActor.NumJoints(); j++)
00027			{
00028				if (((j <  32) && ((LowMask  & (1 <<  j      )) != 0)) ||
00029					((j >= 32) && (j < 64) && ((HighMask & (1 << (j - 32))) != 0)) )
00030				{	// Joint j was hit
00031					matter = HitActor.MatterForJoint(j);
00032					break;
00033				}
00034			}
00035		}
00036		else if(HitActor.IsA('LevelInfo'))
00037		{
00038			matter = HitActor.MatterTrace(HitLoc, Owner.Location, WeaponSweepExtent);
00039	
00040			//TEST: Wall marks (need graphics)
00041			//Spawn(class'WallMark',self,,HitLoc, rotator(HitNorm));
00042		}
00043		else
00044		{
00045			matter = HitActor.MatterForJoint(0);
00046		}
00047	
00048		PlayHitMatterSound(matter);
00049	
00050		// Create effects
00051		switch(matter)
00052		{
00053			case MATTER_FLESH:
00054				if(HitActor.IsA('Sark') || HitActor.IsA('SarkRagnar'))
00055					Spawn(class'SarkBloodMist',,, HitLoc, rotator(HitNorm)); // Sark blood
00056				else
00057					Spawn(class'BloodMist',,, HitLoc, rotator(HitNorm));
00058	
00059				if(BloodTexture != None && !Region.Zone.bWaterZone && !class'GameInfo'.Default.bVeryLowGore)
00060				{
00061					SkelGroupSkins[1] = BloodTexture;
00062				}
00063				break;
00064			case MATTER_WOOD:
00065				Spawn(class'HitWood',,, HitLoc, rotator(HitNorm));
00066				break;
00067			case MATTER_STONE:
00068				Spawn(class'HitStone',,, HitLoc, rotator(HitNorm));
00069				break;
00070			case MATTER_METAL:
00071				Spawn(class'HitMetal',,, HitLoc, rotator(HitNorm));
00072				break;
00073			case MATTER_EARTH:
00074				Spawn(class'GroundDust',,, HitLoc, rotator(HitNorm));
00075				break;
00076			case MATTER_BREAKABLEWOOD:
00077				break;
00078			case MATTER_BREAKABLESTONE:
00079				break;
00080			case MATTER_WEAPON:
00081				Spawn(class'HitWeapon',,, HitLoc, rotator(HitNorm));
00082				break;
00083			case MATTER_SHIELD:
00084				break;
00085			case MATTER_ICE:
00086				Spawn(class'HitIce',,, HitLoc, rotator(HitNorm));
00087				break;
00088			case MATTER_WATER:
00089				break;
00090		}
00091	}
00092	
00093	
00094	//=============================================================================
00095	//
00096	// StickInWall
00097	//
00098	//=============================================================================
00099	function bool StickInWall( EMatterType matter)
00100	{
00101		local rotator r;
00102		local vector X,Y,Z;
00103		local float WeaponLength;
00104	
00105		if (matter!=MATTER_WOOD && matter!=MATTER_ICE &&
00106			matter!=MATTER_EARTH && matter!=MATTER_SNOW &&
00107			matter!=MATTER_FLESH && matter!=MATTER_BREAKABLEWOOD)
00108			return false;
00109	
00110		// Coax any orientation into good range
00111		r = Rotation;
00112		r.Roll = Clamp(r.Roll, 24000, 32000);
00113		//slog("Roll="$R.Roll@"[24000..32000]");
00114	
00115		r.Roll += 8192;
00116		// Determine if it would be sticking into wall
00117		GetAxes(r, X,Y,Z);
00118		r.Roll -= 8192;
00119	
00120		WeaponLength = VSize(GetJointPos(SweepJoint2)-GetJointPos(SweepJoint1));
00121		S1 = Location;
00122		S2 = Location + Y*WeaponLength;
00123	
00124		if (!FastTrace(Location + Y*WeaponLength, Location))
00125		{	// Stuck in wall
00126			SetRotation(r);
00127			return true;
00128		}
00129	
00130		return false;
00131	}
00132	
00133	simulated function Debug(Canvas canvas, int mode)
00134	{
00135		Super.Debug(canvas, mode);
00136	
00137		Canvas.DrawLine3D(S1, S2, 155, 155, 0);
00138	}
00139	
00140	defaultproperties
00141	{
00142	     MeleeType=MELEE_AXE
00143	     bCanBePoweredUp=True
00144	     DamageType=bluntsever
00145	     ThrownDamageType=thrownweaponbluntsever
00146	     SweepVector=(Y=0.867000,Z=-0.500000)
00147	     ThrownSoundLOOP=Sound'WeaponsSnd.Throws.throw02L'
00148	     PoweredUpEndingSound=Sound'WeaponsSnd.PowerUps.powerend23'
00149	     PoweredUpEndSound=Sound'WeaponsSnd.PowerUps.powerend11'
00150	     SwipeClass=Class'RuneI.WeaponSwipeBlue'
00151	     A_Idle=weapon1_idle
00152	     A_Forward=S1_Walk
00153	     A_Backward=weapon1_backup
00154	     A_Forward45Right=S1_Walk45Right
00155	     A_Forward45Left=S1_Walk45Left
00156	     A_Backward45Right=weapon1_backup45Right
00157	     A_Backward45Left=weapon1_backup45Left
00158	     A_StrafeRight=StrafeRight
00159	     A_StrafeLeft=StrafeLeft
00160	     A_Jump=MOV_ALL_jump1_AA0S
00161	     A_ForwardAttack=LegsTest
00162	     A_AttackA=S1_attackA
00163	     A_AttackAReturn=S1_attackAreturn
00164	     A_AttackB=S1_attackB
00165	     A_AttackC=S1_attackC
00166	     A_AttackCReturn=S1_attackCReturn
00167	     A_AttackStandA=S1_attackA
00168	     A_AttackStandAReturn=S1_attackAreturn
00169	     A_AttackStandB=S1_attackB
00170	     A_AttackStandBReturn=S1_attackBreturn
00171	     A_AttackBackupA=S1_BackupAttackA
00172	     A_AttackBackupAReturn=S1_BackupAttackAReturn
00173	     A_AttackStrafeRight=S1_StrafeRightAttack
00174	     A_AttackStrafeLeft=S1_StrafeLeftAttack
00175	     A_JumpAttack=OneHandJumpAttack
00176	     A_Throw=S3_throw
00177	     A_Defend=H3_DefendTO
00178	     A_DefendIdle=H3_DefendIdle
00179	     A_PainFront=Onehand_painRight
00180	     A_PainBack=Onehand_painRight
00181	     A_PainLeft=Onehand_painLeft
00182	     A_PainRight=Onehand_painRight
00183	     A_PickupGroundLeft=H3_PickupLeft
00184	     A_PickupHighLeft=H3_PickupLeftHigh
00185	     A_Taunt=S3_taunt
00186	     RespawnTime=30.000000
00187	     RespawnSound=Sound'OtherSnd.Respawns.respawn01'
00188	     PickupMessageClass=Class'RuneI.PickupMessage'
00189	}

End Source Code