SFWeapon.SFB9Projectile3

00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
//=============================================================================
// Spatial Fear
// Class: SFB9Projectile3
// Descripton: Subclasses of SFB9Projectile3
// Implements the B9  projectiles class for the rifle (Pistol Secondary Fire)
//
// Author: Markus Nuebel
//=============================================================================

class SFB9Projectile3 extends SFB9Projectile;


simulated function Explode(vector HitLocation, vector HitNormal)
{
     if ( Role == ROLE_Authority )
          HurtRadius(Damage,250.0, 'exploded', MomentumTransfer, HitLocation );

	PlaySound(ImpactSound, SLOT_Misc, 2.0);
	MakeNoise(0.3);
	Spawn(class'WallCrack',,,Location, rotator(HitNormal));
  	Spawn(class'SFSpriteBallExplosion2',,,HitLocation);
    Destroy();

}

/////////////////////////////////////////////////////
auto state Flying
{
	simulated function ProcessTouch (Actor Other, Vector HitLocation)
	{
		if ( bCanHitInstigator || (Other != Instigator) )
		{
			if ( Role == ROLE_Authority )
			{
				if ( Other.bIsPawn && (HitLocation.Z - Other.Location.Z > 0.62 * Other.CollisionHeight)
					&& (!Instigator.IsA('Bot') || !Bot(Instigator).bNovice) )
					Other.TakeDamage(3.5 * damage, instigator,HitLocation,
						(MomentumTransfer * Normal(Velocity)), 'decapitated' );
				else
					Other.TakeDamage(damage, instigator,HitLocation,
						(MomentumTransfer * Normal(Velocity)), 'shredded' );
			}
			if ( Other.bIsPawn )
				PlaySound(MiscSound, SLOT_Misc, 2.0);
			else
				PlaySound(ImpactSound, SLOT_Misc, 2.0);
			destroy();
		}
	}

	simulated function SetRoll(vector NewVelocity)
	{
		local rotator newRot;

		newRot = rotator(NewVelocity);
		SetRotation(newRot);
	}

	simulated function HitWall (vector HitNormal, actor Wall)
	{

		Explode(Location, HitNormal);
	}

	function SetUp()
	{
		local vector X;
		X = vector(Rotation);
		Velocity = Speed * X;     // Impart ONLY forward vel

		LifeSpan = Range/Speed;

		if (Instigator.HeadRegion.Zone.bWaterZone)
			bHitWater = True;
	}

	function Tick(float fDelta)
	{
		local rotator rot;

		// Call to base class 
		Super.Tick(fDelta);

		rot = Rotation;
//		rot.yaw		+= fDelta*100000;
//		rot.pitch	+= fDelta*100000;
		rot.roll	+= fDelta*100000;
		SetRotation(rot);
	}

	simulated function BeginState()
	{

		SetTimer(0.2, false);
		SetUp();

		if ( Level.NetMode != NM_DedicatedServer )
		{
			LoopAnim('ALL',1.0);
			if ( Level.NetMode == NM_Standalone )
				SoundPitch = 200 + 50 * FRand();
		}
	}

	simulated function Timer()
	{
		bCanHitInstigator = true;
	}
}

defaultproperties
{
     speed=8700.000000
     MaxSpeed=8700.000000
     Damage=35.000000
     MomentumTransfer=2500
     LifeSpan=12.000000
     DrawScale=8.000000
     AmbientGlow=254
     CollisionRadius=14.000000
     CollisionHeight=8.000000
}

class file time: 12/7/2003 3:58:26 PM - creation time: 12/7/2003 4:03:44 PM
Created with UnCodeX