# SFWeapon.SFB9Rifle

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 00290 00291 00292 00293 00294 00295 00296 00297 00298 00299 00300 00301 00302 00303 00304 |
    //=============================================================================
    // Spatial Fear
    // Class: SFB9Rifle
    // Descripton: Subclasses of SFweapon
    //				Implements the B9Pistel weapon, based on the original UT Ripper code.
    //
    // Author: Markus Nuebel
    //=============================================================================
    class SFB9Rifle extends SFWeapon;

    //#exec AUDIO IMPORT FILE="Sounds\B9RiflePrimary.wav"	NAME=Fire PACKAGE=SFWeapon GROUP=B9Rifle
    #exec OBJ LOAD FILE=SPF-Content.uax  PACKAGE=SPF-Content GROUP=Weapons

    // First person view
    #exec MESH IMPORT MESH=SFB9rm ANIVFILE=MODELS\SFB9rm_a.3d DATAFILE=MODELS\SFB9rm_d.3d X=0 Y=0 Z=0
    #exec MESH ORIGIN MESH=SFB9rm X=0 Y=0 Z=0

    #exec MESH SEQUENCE MESH=SFB9rm SEQ=All    STARTFRAME=0 NUMFRAMES=61
    #exec MESH SEQUENCE MESH=SFB9rm SEQ=still  STARTFRAME=0 NUMFRAMES=1
    #exec MESH SEQUENCE MESH=SFB9rm SEQ=still2 STARTFRAME=1 NUMFRAMES=1
    #exec MESH SEQUENCE MESH=SFB9rm SEQ=fire1  STARTFRAME=2 NUMFRAMES=16
    #exec MESH SEQUENCE MESH=SFB9rm SEQ=fire2  STARTFRAME=18 NUMFRAMES=21
    #exec MESH SEQUENCE MESH=SFB9rm SEQ=select STARTFRAME=39 NUMFRAMES=11
    #exec MESH SEQUENCE MESH=SFB9rm SEQ=down   STARTFRAME=50 NUMFRAMES=11

    #exec TEXTURE IMPORT NAME=JSFB9rm1 FILE=TEXTURES\SFB9rm1.PCX GROUP=Skins FLAGS=2 // 1 - Default
    #exec TEXTURE IMPORT NAME=JSFB9rm2 FILE=TEXTURES\SFB9rm2.PCX GROUP=Skins PALETTE=JSFB9rm1 // 2 - Default
    #exec TEXTURE IMPORT NAME=JSFB9rm3 FILE=TEXTURES\SFB9rm3.PCX GROUP=Skins PALETTE=JSFB9rm1 // 3 - Default
    #exec TEXTURE IMPORT NAME=JSFB9rm4 FILE=TEXTURES\SFB9rm4.PCX GROUP=Skins PALETTE=JSFB9rm1 // 4 - Default

    #exec MESHMAP NEW   MESHMAP=SFB9rm MESH=SFB9rm
    #exec MESHMAP SCALE MESHMAP=SFB9rm X=0.04 Y=0.04 Z=0.08

    #exec MESHMAP SETTEXTURE MESHMAP=SFB9rm NUM=1 TEXTURE=JSFB9rm1
    #exec MESHMAP SETTEXTURE MESHMAP=SFB9rm NUM=2 TEXTURE=JSFB9rm2
    #exec MESHMAP SETTEXTURE MESHMAP=SFB9rm NUM=3 TEXTURE=JSFB9rm3
    #exec MESHMAP SETTEXTURE MESHMAP=SFB9rm NUM=4 TEXTURE=JSFB9rm4

    #exec MESH IMPORT MESH=SFB9rhand ANIVFILE=MODELS\SFB9rhand_a.3d DATAFILE=MODELS\SFB9rhand_d.3d X=0 Y=0 Z=0
    #exec MESH ORIGIN MESH=SFB9rhand X=0 Y=0 Z=0

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

    #exec TEXTURE IMPORT NAME=JSFB9rhand1 FILE=TEXTURES\SFB9rhand1.PCX GROUP=Skins FLAGS=2 // 1 - Default
    #exec TEXTURE IMPORT NAME=JSFB9rhand2 FILE=TEXTURES\SFB9rhand2.PCX GROUP=Skins PALETTE=JSFB9rhand1 // 2 - Default
    #exec TEXTURE IMPORT NAME=JSFB9rhand3 FILE=TEXTURES\SFB9rhand3.PCX GROUP=Skins PALETTE=JSFB9rhand1 // 3 - Default

    #exec MESHMAP NEW   MESHMAP=SFB9rhand MESH=SFB9rhand
    #exec MESHMAP SCALE MESHMAP=SFB9rhand X=0.06 Y=0.06 Z=0.12
    //X=0.1 Y=0.1 Z=0.2

    #exec MESHMAP SETTEXTURE MESHMAP=SFB9rhand NUM=1 TEXTURE=JSFB9rhand1
    #exec MESHMAP SETTEXTURE MESHMAP=SFB9rhand NUM=2 TEXTURE=JSFB9rhand2
    #exec MESHMAP SETTEXTURE MESHMAP=SFB9rhand NUM=3 TEXTURE=JSFB9rhand3

    // Pickup mesh
    #exec MESH IMPORT MESH=SFB9rpick ANIVFILE=MODELS\SFB9rpick_a.3d DATAFILE=MODELS\SFB9rpick_d.3d X=0 Y=0 Z=0
    #exec MESH ORIGIN MESH=SFB9rpick X=0 Y=0 Z=0

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

    #exec TEXTURE IMPORT NAME=JSFB9rpick1 FILE=TEXTURES\SFB9rpick1.PCX GROUP=Skins FLAGS=2 // 1 - Default
    #exec TEXTURE IMPORT NAME=JSFB9rpick2 FILE=TEXTURES\SFB9rpick2.PCX GROUP=Skins PALETTE=JSFB9rpick1 // 2 - Default
    #exec TEXTURE IMPORT NAME=JSFB9rpick3 FILE=TEXTURES\SFB9rpick3.PCX GROUP=Skins PALETTE=JSFB9rpick1 // 3 - Default

    #exec MESHMAP NEW   MESHMAP=SFB9rpick MESH=SFB9rpick
    #exec MESHMAP SCALE MESHMAP=SFB9rpick X=0.12 Y=0.12 Z=0.24

    #exec MESHMAP SETTEXTURE MESHMAP=SFB9rpick NUM=1 TEXTURE=JSFB9rpick1
    #exec MESHMAP SETTEXTURE MESHMAP=SFB9rpick NUM=2 TEXTURE=JSFB9rpick2
    #exec MESHMAP SETTEXTURE MESHMAP=SFB9rpick NUM=3 TEXTURE=JSFB9rpick3

    var (SpatialFear) Sound	 m_sndLoading;		// Ambient sound played during loading in secondary fire mode
    var (SpatialFear) Sound	 m_sndVapour;		// Sound played when cooling down after secondary fire
    var vector	m_vectOrgOffset;
    var name	IdleAnims[2];
    var float	m_fShuffleCounter;
    var float	m_fFirstPhase;
    var bool	m_bShuffle;

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

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

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

    }

    function AltFire( float Value )
    {
    	// Ammocheck
    	if ( (AmmoType == None) && (AmmoName != None) )
    		GiveAmmo(Pawn(Owner));

    	if (AmmoType.UseAmmo(AltAmmoPerShot))
    		GotoState('AltFiring');
    	else
    		GotoState('Idle');
    }

    function Finish()
    {
    	Super.Finish();
    }

    state AltFiring
    {
    	function Fire(float F)
    	{
    	}

    	function AltFire(float F)
    	{
    	}

    	function FireTheWeapon()
    	{
    		// Stop loading sound
    		AmbientSound = None;

    		// Play the animations
    		PlayAltFiring();
    		if ( !bRapidFire && (FiringSpeed > 0) )
    			Pawn(Owner).PlayRecoil(FiringSpeed);

    		// Flash and shake
    		if ( PlayerPawn(Owner) != None )
    		{
    			if(bShake)
    				ShakeSecondary();
    			if(bFlash)
    				FlashSecondary();
    		}

    		// Spawn the projectile
    		ProjectileFire(AltProjectileClass, AltProjectileSpeed, bAltWarnTarget);
    		if ( Owner.bHidden )
    			CheckVisibility();
    	}

    	function CoolDown()
    	{
    		local vector		X,Y,Z;
    		local vector		vecStart;
    		local SmokeColumn	oSmoke;
    		// Play cool down sound
    		PlaySound(m_sndVapour, SLOT_None, Pawn(Owner).SoundDampening*3.0);
    		// Spawn smoke
    		GetAxes(Pawn(Owner).ViewRotation,X,Y,Z);
    		// Calculate the spawn position
    		vecStart	= Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z;
    		vecStart.Z	-= FireOffset.Z;
    		oSmoke		= Spawn(class'Unrealshare.SmokeColumn',self,,vecStart);
    		oSmoke.DrawScale = 0.4f;
    		oSmoke.LifeSpan=0.500000;

    	}

    	function Tick(float fDelta)
    	{
    		local float	fRnd;
    		local float	fAmount;

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

    		if(m_bShuffle)
    		{
    			m_fShuffleCounter	+= fDelta;
    			if(m_fShuffleCounter>0.05)
    			{
    				fRnd				= FRand()*2-1;
    				m_fFirstPhase		+= 0.10;
    				fAmount				= fRnd*m_fFirstPhase;
    				PlayerViewOffset.Y	= m_vectOrgOffset.Y + fAmount;
    				PlayerViewOffset.Z	= m_vectOrgOffset.Z + fAmount/2.0f;
    				// Reset the shuffle counter
    				m_fShuffleCounter	= 0.05;
    			}
    		}

    	}

    	function BeginState()
    	{
    		// Call to base class
    		Super.BeginState();

    		//Save the current state
    		m_vectOrgOffset	= PlayerViewOffset;
    		// Start the loading sound
    		AmbientSound = m_sndLoading;
    		SoundVolume = Pawn(Owner).SoundDampening*255;

    		m_fFirstPhase=0.0f;
    	}

    	function AnimEnd()
    	{
    		// Do not call base, because it will call finish immediately.

    		// Restore the original settings at end of fire anim
    		PlayerViewOffset	= m_vectOrgOffset;
    	}

    	function EndState()
    	{
    		// Call to base class
    		Super.EndState();
    		// Reset stuff
    		PlayerViewOffset	= m_vectOrgOffset;
    		AmbientSound			= None;
    	}

    Begin:
    	bPointing=True;
    	m_bShuffle		= true;
    	Sleep(2.5);
    	m_bShuffle		= false;
    	FireTheWeapon();
    	FinishAnim();
    	CoolDown();
    	Sleep(1.0);
    	Finish();
    }

    //	bRapidFire=True

    defaultproperties
    {
         m_sndLoading=Sound'SPF-Content.Weapons.B9RifleLoading'
         m_sndVapour=Sound'SPF-Content.Weapons.B9RifleVapour'
         IdleAnims(0)=Still
         IdleAnims(1)=Still2
         MaxTargetRange=4000
         MaxTargetRangeAlt=4000
         fNormalRate=0.163300
         fDesiredRate=0.040000
         fAltDesiredRate=0.200000
         fDamage=22.000000
         fAltDamage=100.000000
         Icon=Texture'SfResource1.Icons.B9RifleIco'
         fMomentum=100.000000
         fAltMomentum=100.000000
         bCanUpgradeLaserSight=True
         bCanUpgradeEnergyBooster=True
         bShake=True
         bFlash=True
         ShakeMagAlt=400.000000
         ShakeTimeAlt=0.200000
         ShakeVertAlt=8.000000
         InstantFogAlt=(X=170.000000,Y=190.000000,Z=220.000000)
         WeaponDescription="Classification: B-9 Disruptor Rifle\nSame as the Disruptor Pistol but has better energy throughput and accuracy.\nSecondary fire fires a 'disrupter' charge that moves faster, delivers a much wider blast, and takes 5 seconds between shots.  3 seconds before you fire (during which it can make a sort of whiney "
         AmmoName=Class'SFWeapon.SFB9Ammo'
         PickupAmmoCount=40
         FireOffset=(X=65.000000,Y=-17.000000,Z=-5.000000)
         ProjectileClass=Class'SFWeapon.SFB9Projectile2'
         AltProjectileClass=Class'SFWeapon.SFB9Projectile3'
         shakemag=200.000000
         shaketime=0.200000
         shakevert=4.000000
         AltRefireRate=0.300000
         FireSound=Sound'SPF-Content.Weapons.B9RifleFire'
         AltFireSound=Sound'SPF-Content.Weapons.B9RifleAltFire'
         SelectSound=Sound'SPF-Content.Weapons.B9RifleSelect'
         AutoSwitchPriority=4
         InventoryGroup=4
         PickupMessage="You got the B-9 Disruptor Rifle."
         ItemName="B9 Rifle"
         PlayerViewOffset=(X=3.400000,Y=-2.800000,Z=-3.300000)
         PlayerViewMesh=LodMesh'SFWeapon.SFB9rm'
         PlayerViewScale=0.400000
         PickupViewMesh=LodMesh'SFWeapon.SFB9rpick'
         ThirdPersonMesh=LodMesh'SFWeapon.SFB9rhand'
         PickupSound=Sound'SPF-Content.Weapons.B9RiflePickup'
         Mesh=LodMesh'SFWeapon.SFB9rpick'
         DrawScale=0.350000
         bNoSmooth=False
         CollisionRadius=38.000000
         CollisionHeight=17.000000
         Mass=70.000000
    }

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