# SFWeapon.SFB9Projectile

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 00124 00125 00126 00127 00128 00129 00130 00131 00132 00133 00134 00135 00136 |
    //=============================================================================
    // Spatial Fear
    // Class: SFB9Projectile
    // Descripton: Subclasses of SFProjectile
    // Implements the B9  projectiles class. (Pistol Primary Fire)
    //
    // Author: Markus Nuebel
    //=============================================================================

    class SFB9Projectile extends SFProjectile;

    #exec obj load file=k_GorillaTex.utx package=k_GorillaTex
    #exec OBJ LOAD FILE=SPF-Content.uax  PACKAGE=SPF-Content GROUP=Weapons

    #exec mesh import mesh=B9Ball anivfile=Models\B9Ball_a.3d datafile=Models\B9Ball_d.3d x=0 y=0 z=0
    #exec mesh origin mesh=B9Ball x=0 y=0 z=0
    #exec mesh sequence mesh=B9Ball seq=All startframe=0 numframes=1

    #exec meshmap new meshmap=B9Ball mesh=B9Ball
    #exec meshmap scale meshmap=B9Ball x=0.00781 y=0.00781 z=0.01563

    //var int NumWallHits;
    var bool bCanHitInstigator, bHitWater;

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

    	PlaySound(ImpactSound, SLOT_Misc, 2.0);
    	MakeNoise(0.3);
    	Spawn(class'WallCrack',,,Location, rotator(HitNormal));
    	Spawn(class'SFB9WallHit',,, Location+HitNormal, Rotator(HitNormal));
        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;
    	}

    	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
    {
         WaterSplashScale=0.500000
         speed=4500.000000
         MaxSpeed=4500.000000
         Damage=20.000000
         MomentumTransfer=15
         ImpactSound=Sound'SPF-Content.Weapons.B9PistolWallHit'
         MiscSound=Sound'SPF-Content.Weapons.B9PistolBodyHit'
         RemoteRole=ROLE_SimulatedProxy
         LifeSpan=6.000000
         AnimSequence=All
         AmbientSound=Sound'UnrealI.Razorjack.RazorHum'
         Mesh=LodMesh'SFWeapon.B9Ball'
         DrawScale=2.800000
         AmbientGlow=167
         bUnlit=True
         bCollideWhenPlacing=True
         MultiSkins(0)=FireTexture'k_GorillaTex.FX.B9_Shot'
         SoundRadius=12
         SoundVolume=255
         SoundPitch=200
         CollisionRadius=4.000000
         CollisionHeight=2.000000
         bBounce=True
    }

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