# SFWeapon.SFHardWave

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 00137 00138 00139 00140 00141 00142 00143 00144 00145 00146 00147 00148 00149 00150 00151 00152 00153 00154 00155 00156 00157 00158 00159 00160 00161 00162 00163 00164 00165 00166 00167 00168 00169 00170 00171 00172 00173 00174 00175 00176 00177 00178 00179 00180 00181 00182 00183 00184 00185 00186 00187 00188 00189 00190 00191 00192 00193 00194 00195 00196 00197 00198 00199 00200 00201 00202 00203 00204 00205 00206 00207 00208 00209 00210 00211 00212 00213 00214 00215 00216 00217 00218 00219 00220 00221 00222 00223 00224 00225 00226 00227 00228 00229 00230 00231 00232 00233 00234 00235 00236 00237 00238 00239 00240 00241 00242 00243 00244 00245 00246 00247 00248 00249 00250 00251 00252 00253 00254 00255 00256 00257 00258 00259 00260 00261 00262 00263 00264 00265 00266 00267 00268 00269 00270 00271 00272 00273 00274 00275 00276 00277 00278 00279 00280 00281 00282 00283 00284 00285 00286 00287 00288 00289 |
    //=============================================================================
    // Spatial Fear
    // Class: SFHardWave
    // Descripton: Subclasses of SFweapon
    //				Implements The Hard Wave Rifle
    //
    // Author: Markus Nuebel
    //=============================================================================

    class SFHardWave expands SFWeapon;

    #exec OBJ LOAD FILE=SPF-Content.uax  PACKAGE=SPF-Content GROUP=Weapons

    //#exec AUDIO IMPORT FILE="Sounds\HWImpact.wav"	NAME=Impact PACKAGE=SFWeapon GROUP=HardWave
    //#exec AUDIO IMPORT FILE="Sounds\HWAltFire.wav"	NAME=AltFire PACKAGE=SFWeapon GROUP=HardWave
    //#exec AUDIO IMPORT FILE="Sounds\HWPrimaryFire.wav"	NAME=Fire PACKAGE=SFWeapon GROUP=HardWave

    #exec MESH IMPORT MESH=SFHardwavem ANIVFILE=MODELS\SFHardwavem_a.3d DATAFILE=MODELS\SFHardwavem_d.3d X=0 Y=0 Z=0
    #exec MESH ORIGIN MESH=SFHardwavem X=0 Y=0 Z=0

    #exec MESH SEQUENCE MESH=SFHardwavem SEQ=All    STARTFRAME=0 NUMFRAMES=58
    #exec MESH SEQUENCE MESH=SFHardwavem SEQ=still  STARTFRAME=0 NUMFRAMES=1
    #exec MESH SEQUENCE MESH=SFHardwavem SEQ=still2 STARTFRAME=1 NUMFRAMES=1
    #exec MESH SEQUENCE MESH=SFHardwavem SEQ=select STARTFRAME=2 NUMFRAMES=11
    #exec MESH SEQUENCE MESH=SFHardwavem SEQ=down   STARTFRAME=13 NUMFRAMES=11
    #exec MESH SEQUENCE MESH=SFHardwavem SEQ=fire1  STARTFRAME=24 NUMFRAMES=17
    #exec MESH SEQUENCE MESH=SFHardwavem SEQ=fire2  STARTFRAME=41 NUMFRAMES=17

    #exec TEXTURE IMPORT NAME=JSFHardwavem1 FILE=TEXTURES\SFHardwavem1.PCX GROUP=Skins FLAGS=2 // 4 - Default
    #exec TEXTURE IMPORT NAME=JSFHardwavem2 FILE=TEXTURES\SFHardwavem2.PCX GROUP=Skins PALETTE=JSFHardwavem1 // 1 - Default
    #exec TEXTURE IMPORT NAME=JSFHardwavem3 FILE=TEXTURES\SFHardwavem3.PCX GROUP=Skins PALETTE=JSFHardwavem1 // 2 - Default
    #exec TEXTURE IMPORT NAME=JSFHardwavem4 FILE=TEXTURES\SFHardwavem4.PCX GROUP=Skins PALETTE=JSFHardwavem1 // 3 - Default
    #exec TEXTURE IMPORT NAME=JSFHardwavem5 FILE=TEXTURES\SFHardwavem5.PCX GROUP=Skins PALETTE=JSFHardwavem1 // 6- Default

    #exec MESHMAP NEW   MESHMAP=SFHardwavem MESH=SFHardwavem
    #exec MESHMAP SCALE MESHMAP=SFHardWavem X=0.03 Y=0.03 Z=0.06

    #exec MESHMAP SETTEXTURE MESHMAP=SFHardwavem NUM=1 TEXTURE=JSFHardwavem1
    #exec MESHMAP SETTEXTURE MESHMAP=SFHardwavem NUM=2 TEXTURE=JSFHardwavem2
    #exec MESHMAP SETTEXTURE MESHMAP=SFHardwavem NUM=3 TEXTURE=JSFHardwavem3
    #exec MESHMAP SETTEXTURE MESHMAP=SFHardwavem NUM=4 TEXTURE=JSFHardwavem4
    #exec MESHMAP SETTEXTURE MESHMAP=SFHardwavem NUM=5 TEXTURE=JSFHardwavem5

    #exec MESH IMPORT MESH=SFHardwavehand ANIVFILE=MODELS\SFHardwavehand_a.3d DATAFILE=MODELS\SFHardwavehand_d.3d X=0 Y=0 Z=0
    #exec MESH ORIGIN MESH=SFHardwavehand X=0 Y=0 Z=0

    #exec MESH SEQUENCE MESH=SFHardwavehand SEQ=All            STARTFRAME=0 NUMFRAMES=1
    #exec MESH SEQUENCE MESH=SFHardwavehand SEQ=SFHardwavehand STARTFRAME=0 NUMFRAMES=1

    #exec TEXTURE IMPORT NAME=JSFHardwavehand1 FILE=TEXTURES\SFHardwavehand1.PCX GROUP=Skins FLAGS=2 // 4 - Default
    #exec TEXTURE IMPORT NAME=JSFHardwavehand2 FILE=TEXTURES\SFHardwavehand2.PCX GROUP=Skins PALETTE=JSFHardwavehand1 // 1 - Default
    #exec TEXTURE IMPORT NAME=JSFHardwavehand3 FILE=TEXTURES\SFHardwavehand3.PCX GROUP=Skins PALETTE=JSFHardwavehand1 // 2 - Default
    #exec TEXTURE IMPORT NAME=JSFHardwavehand4 FILE=TEXTURES\SFHardwavehand4.PCX GROUP=Skins PALETTE=JSFHardwavehand1 // 3 - Default

    #exec MESHMAP NEW   MESHMAP=SFHardwavehand MESH=SFHardwavehand
    #exec MESHMAP SCALE MESHMAP=SFHardWavehand X=0.08 Y=0.08 Z=0.16

    #exec MESHMAP SETTEXTURE MESHMAP=SFHardwavehand NUM=1 TEXTURE=JSFHardwavehand1
    #exec MESHMAP SETTEXTURE MESHMAP=SFHardwavehand NUM=2 TEXTURE=JSFHardwavehand2
    #exec MESHMAP SETTEXTURE MESHMAP=SFHardwavehand NUM=3 TEXTURE=JSFHardwavehand3
    #exec MESHMAP SETTEXTURE MESHMAP=SFHardwavehand NUM=4 TEXTURE=JSFHardwavehand4

    #exec MESH IMPORT MESH=SFhardwavepick ANIVFILE=MODELS\SFhardwavepick_a.3d DATAFILE=MODELS\SFhardwavepick_d.3d X=0 Y=0 Z=0
    #exec MESH ORIGIN MESH=SFhardwavepick X=0 Y=0 Z=0

    #exec MESH SEQUENCE MESH=SFhardwavepick SEQ=All            STARTFRAME=0 NUMFRAMES=1
    #exec MESH SEQUENCE MESH=SFhardwavepick SEQ=SFHardwavepick STARTFRAME=0 NUMFRAMES=1

    #exec TEXTURE IMPORT NAME=JSFhardwavepick1 FILE=TEXTURES\SFhardwavepick1.PCX GROUP=Skins FLAGS=2 // 4 - Default
    #exec TEXTURE IMPORT NAME=JSFhardwavepick2 FILE=TEXTURES\SFhardwavepick2.PCX GROUP=Skins PALETTE=JSFhardwavepick1 // 1 - Default
    #exec TEXTURE IMPORT NAME=JSFhardwavepick3 FILE=TEXTURES\SFhardwavepick3.PCX GROUP=Skins PALETTE=JSFhardwavepick1 // 2 - Default
    #exec TEXTURE IMPORT NAME=JSFhardwavepick4 FILE=TEXTURES\SFhardwavepick4.PCX GROUP=Skins PALETTE=JSFhardwavepick1 // 3 - Default

    #exec MESHMAP NEW   MESHMAP=SFhardwavepick MESH=SFhardwavepick
    #exec MESHMAP SCALE MESHMAP=SFhardwavepick X=0.064 Y=0.064 Z=0.128

    #exec MESHMAP SETTEXTURE MESHMAP=SFhardwavepick NUM=1 TEXTURE=JSFhardwavepick1
    #exec MESHMAP SETTEXTURE MESHMAP=SFhardwavepick NUM=2 TEXTURE=JSFhardwavepick2
    #exec MESHMAP SETTEXTURE MESHMAP=SFhardwavepick NUM=3 TEXTURE=JSFhardwavepick3
    #exec MESHMAP SETTEXTURE MESHMAP=SFhardwavepick NUM=4 TEXTURE=JSFhardwavepick4

    var name IdleAnims[2];
    var bool bVisionEnabled;

    // Spawns a configured wallhit effect
    function spawnWallHitEffect(vector HitLocation, vector HitNormal)
    {
    	// Call to baseclass
    	Super.spawnWallHitEffect(HitLocation, HitNormal);
    	Spawn(class'SFSpriteBallExplosion2',,, HitLocation+HitNormal, Rotator(HitNormal));
    }

    function spawnPawnHitEffect(vector HitLocation, vector HitNormal)
    {
    	// Call to baseclass
    	Super.spawnPawnHitEffect(HitLocation, HitNormal);
    	Spawn(class'SFSpriteBallExplosion2',,, HitLocation+HitNormal, Rotator(HitNormal));
    }

    simulated function PlayFiring()
    {
    	PlaySound(FireSound, SLOT_Misc, Pawn(Owner).SoundDampening*3.0);
    	PlayAnim('Fire1',m_fCurrentRate, 0.05);
    }

    function PlayAltFiring()
    {
    	PlaySound(AltFireSound, SLOT_Misc, Pawn(Owner).SoundDampening*3.0);
    	PlayAnim( 'Fire2', m_fCurrentRate, 0.05);
    }

    simulated function PlayIdleAnim()
    {
    	if ( Mesh != PickupViewMesh )
    		LoopAnim(IdleAnims[Rand(2)],0.6, 0.3);

    }

    state Idle
    {

    	function AnimEnd()
    	{
    		PlayIdleAnim();
    	}

    Begin:
    	bPointing=False;
    	if ( AmmoType.AmmoAmount<=0 )
    	{
    		if(!Pawn(Owner).SwitchToBestWeapon())  //Goto Weapon that has Ammo
    		{
    			if(None == Weapon(Pawn(Owner).FindInventoryType(class'SFNullGun')))
    			{
    				// Spawn the null gun
    				Pawn(Owner).PendingWeapon = spawn(class'SFNullGun', Owner);
    			}
    			PutDown();
    		}
    	}
    	if ( Pawn(Owner).bFire!=0 )
    		Fire(0.0);
    	PlayIdleAnim();
    }

    state AltFiring
    {
    ignores Fire, AltFire;

    	// Simplified ProcessTraceHit, that handles a normal trace hit.
    	// Does not spawn a shellcase !!
    	function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)
    	{
    		local float fDistRate;

    		fDistRate	= MaxTargetRangeAlt-VSize(HitLocation-Owner.Location);
    		if(fDistRate < 0)
    			fDistRate=0.0f;
    		else
    			fDistRate	= fDistRate/MaxTargetRangeAlt;

    		// Spawn trail effect
    		// SpawnTrailEffect(class'ShockBeam', HitLocation,  Owner.Location + CalcDrawOffset() + FireOffset.X  * X + FireOffset.Y * Y + FireOffset.Z * Z, 140.0f, 9999.0f);

    		if ( (Other!=self) && (Other != None) )
    		{
    			// Hit something
    			if ( !Other.bIsPawn && !Other.IsA('Carcass') )
    				spawn(m_clsSmokeEffect,,,HitLocation+HitNormal*9);
    			Other.TakeDamage(fAltDamage, Pawn(Owner), HitLocation, fDistRate*fAltMomentum*X, AltDamageType);
    		}
    	}

    	// Retrieves the angle between the two given vectors in radians
    	function float getAngle(vector vecFirst, vector vecSecond)
    	{
    		return Normal(vecFirst) dot Normal(vecSecond);
    	}

    	// to do the wave
    	function TraceFire( float Accuracy )
    	{
    		local vector X,Y,Z;
    		local ScriptedPawn oPawn;
    		local float fAngle, fAngleLimit;
    		local vector vecHitLoc, vecHitNorm;

    		// Some inits
    		fAngleLimit =0.7;

    		// Make some sound
    		Owner.MakeNoise(Pawn(Owner).SoundDampening);
    		// Get the player rotation
    		GetAxes(Pawn(Owner).ViewRotation,X,Y,Z);
    		// Roll out the damage wave

    // 		spawn(class'HardWaveWave',,,Owner.Location + CalcDrawOffset() + 10*FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z);
     		spawn(class'HardWaveWave',,,Owner.Location + CalcDrawOffset() + 2*FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z);

    		foreach VisibleCollidingActors(class'ScriptedPawn', oPawn, float(MaxTargetRangeAlt), Owner.Location)
    		{
    			if(None != oPawn)
    			{
    				if(oPawn.IsA('ScriptedPawn') && !oPawn.bHidden && (Self!=oPawn) && (!oPawn.IsInState('Dying')))
    				{
    					fAngle	= getAngle(X, oPawn.Location-Owner.Location);
    					if(fAngle > fAngleLimit)
    					{
    						vecHitNorm	= Normal(Owner.Location - oPawn.Location);
    						vecHitLoc	= oPawn.Location + vecHitNorm*oPawn.CollisionRadius;

    						ProcessTraceHit(oPawn, vecHitLoc, vecHitNorm, X,Y,Z);
    					}
    				}
    			}
    		}
    	}

    }

    defaultproperties
    {
         IdleAnims(0)=Still
         IdleAnims(1)=Still2
         MaxTargetRange=6000
         MaxTargetRangeAlt=200
         fNormalRate=0.333300
         fDesiredRate=0.400000
         fAltDesiredRate=0.400000
         fDamage=35.000000
         fAltDamage=0.000000
         AltAmmoPerShot=6
         Icon=Texture'SfResource1.Icons.hardwaveico'
         bInstantHit=True
         fAltMomentum=20000.000000
         bCanUpgradeLaserSight=True
         bCanUpgradeEnergyBooster=True
         LaserSightUpgradeMessage="Upgraded Hard Wave Rifle with Laser Sight"
         bShake=True
         bFlash=True
         ShakeMagAlt=100.000000
         ShakeTimeAlt=0.500000
         ShakeVertAlt=7.000000
         m_fTrailEffectIntervallSize=91.000000
         m_clsHitWallEffect=Class'SFWeapon.SFRingExplosion'
         m_clsTrailEffect=Class'SFWeapon.SFHWBeam'
         WeaponDescription="Classification: Hard Wave Rifle:\nA portable containment field generator mounted to a gun frame.\nProjects a very small field instantly for a light long range attack.\nIt can also generate a very fast short range wave in a wide arc that will not harm, but will temporarily stun enemies."
         InstFlash=-0.300000
         InstFog=(X=400.000000,Y=200.000000)
         AmmoName=Class'SFWeapon.SFHardWaveAmmo'
         PickupAmmoCount=20
         bAltInstantHit=True
         FireOffset=(X=39.000000,Y=-7.000000,Z=-10.000000)
         AltDamageType=SFstunned
         shakemag=100.000000
         shaketime=0.500000
         shakevert=7.000000
         RefireRate=1.000000
         AltRefireRate=0.830000
         FireSound=Sound'SPF-Content.Weapons.HWPrimaryFire'
         AltFireSound=Sound'SPF-Content.Weapons.HWAltFire'
         SelectSound=Sound'SPF-Content.Weapons.HWSelect'
         bDrawMuzzleFlash=True
         AutoSwitchPriority=6
         InventoryGroup=6
         PickupMessage="You got the Hard Wave Rifle."
         ItemName="Hard Wave Rifle"
         PlayerViewOffset=(X=2.600000,Y=-1.450000,Z=-1.600000)
         PlayerViewMesh=LodMesh'SFWeapon.SFHardwavem'
         PlayerViewScale=0.250000
         BobDamping=0.965000
         PickupViewMesh=LodMesh'SFWeapon.SFHardwavehand'
         ThirdPersonMesh=LodMesh'SFWeapon.SFhardwavepick'
         PickupSound=Sound'SPF-Content.Weapons.HWPickup'
         Mesh=LodMesh'SFWeapon.SFHardwavehand'
         bNoSmooth=False
         CollisionRadius=25.000000
         CollisionHeight=7.000000
         Mass=50.000000
    }

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