# SFWeapon.SFRapidEddy

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 00305 00306 00307 00308 |
    //=============================================================================
    // Spatial Fear
    // Class: SFRadidEddy
    // Descripton: Subclasses of SFweapon
    //				Implements the Rapid Eddy
    //
    // Author: Markus Nuebel
    //=============================================================================

    class SFRapidEddy expands SFWeapon;

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

    // First Person model
    #exec MESH IMPORT MESH=SFRapidEddym ANIVFILE=MODELS\SFRapidEddym_a.3d DATAFILE=MODELS\SFRapidEddym_d.3d X=0 Y=0 Z=0
    #exec MESH ORIGIN MESH=SFRapidEddym X=0 Y=0 Z=0

    #exec MESH SEQUENCE MESH=SFRapideddym SEQ=All    STARTFRAME=0 NUMFRAMES=70
    #exec MESH SEQUENCE MESH=SFRapideddym SEQ=Still  STARTFRAME=0 NUMFRAMES=1
    #exec MESH SEQUENCE MESH=SFRapideddym SEQ=Still2 STARTFRAME=1 NUMFRAMES=1
    #exec MESH SEQUENCE MESH=SFRapideddym SEQ=Select STARTFRAME=2 NUMFRAMES=17
    #exec MESH SEQUENCE MESH=SFRapideddym SEQ=Down   STARTFRAME=19 NUMFRAMES=17
    #exec MESH SEQUENCE MESH=SFRapideddym SEQ=Fire1  STARTFRAME=36 NUMFRAMES=17
    #exec MESH SEQUENCE MESH=SFRapideddym SEQ=Fire2  STARTFRAME=53 NUMFRAMES=17

    #exec TEXTURE IMPORT NAME=JSFRapideddym1 FILE=TEXTURES\SFRapideddym1.PCX GROUP=Skins FLAGS=2 // 1 - Default
    #exec TEXTURE IMPORT NAME=JSFRapideddym2 FILE=TEXTURES\SFRapideddym2.PCX GROUP=Skins PALETTE=JSFRapideddym1 // 2 - Default
    #exec TEXTURE IMPORT NAME=JSFRapideddym3 FILE=TEXTURES\SFRapideddym3.PCX GROUP=Skins PALETTE=JSFRapideddym1 // 3 - Default
    #exec TEXTURE IMPORT NAME=JSFRapideddym4 FILE=TEXTURES\SFRapideddym4.PCX GROUP=Skins PALETTE=JSFRapideddym1 // 6- Default

    #exec MESHMAP NEW   MESHMAP=SFRapidEddym MESH=SFRapidEddym
    #exec MESHMAP SCALE MESHMAP=SFRapidEddym X=0.1 Y=0.1 Z=0.2

    #exec MESHMAP SETTEXTURE MESHMAP=SFRapideddym NUM=1 TEXTURE=JSFRapideddym1
    #exec MESHMAP SETTEXTURE MESHMAP=SFRapideddym NUM=2 TEXTURE=JSFRapideddym2
    #exec MESHMAP SETTEXTURE MESHMAP=SFRapideddym NUM=3 TEXTURE=JSFRapideddym3
    #exec MESHMAP SETTEXTURE MESHMAP=SFRapideddym NUM=4 TEXTURE=JSFRapideddym4

    // Pickup Model
    #exec MESH IMPORT MESH=SFRapidEddypick ANIVFILE=MODELS\SFRapidEddypick_a.3d DATAFILE=MODELS\SFRapidEddypick_d.3d X=0 Y=0 Z=0
    #exec MESH ORIGIN MESH=SFRapidEddypick X=0 Y=0 Z=0

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

    #exec TEXTURE IMPORT NAME=JSFRapidEddypick1 FILE=TEXTURES\SFRapideddyhand1.PCX GROUP=Skins FLAGS=2 // 1 - Default
    #exec TEXTURE IMPORT NAME=JSFRapidEddypick2 FILE=TEXTURES\SFRapideddyhand2.PCX GROUP=Skins PALETTE=JSFRapideddyhand1 // 2 - Default
    #exec TEXTURE IMPORT NAME=JSFRapidEddypick3 FILE=TEXTURES\SFRapideddyhand3.PCX GROUP=Skins PALETTE=JSFRapideddyhand1 // 3 - Default

    #exec MESHMAP NEW   MESHMAP=SFRapidEddypick MESH=SFRapidEddypick
    #exec MESHMAP SCALE MESHMAP=SFRapidEddypick X=0.1 Y=0.1 Z=0.2

    #exec MESHMAP SETTEXTURE MESHMAP=SFRapidEddypick NUM=1 TEXTURE=JSFRapidEddypick1
    #exec MESHMAP SETTEXTURE MESHMAP=SFRapidEddypick NUM=2 TEXTURE=JSFRapidEddypick2
    #exec MESHMAP SETTEXTURE MESHMAP=SFRapidEddypick NUM=3 TEXTURE=JSFRapidEddypick3

    // Third Person Model
    #exec MESH IMPORT MESH=SFRapidEddy3p ANIVFILE=MODELS\SFRapidEddypick_a.3d DATAFILE=MODELS\SFRapidEddypick_d.3d X=0 Y=0 Z=0
    #exec MESH ORIGIN MESH=SFRapidEddy3p X=0 Y=0 Z=0

    #exec MESH SEQUENCE MESH=SFRapidEddy3p SEQ=All          STARTFRAME=0 NUMFRAMES=1
    #exec MESH SEQUENCE MESH=SFRapidEddy3p SEQ=SFRapidEddypick STARTFRAME=0 NUMFRAMES=1

    #exec TEXTURE IMPORT NAME=JSFRapidEddy3p1 FILE=TEXTURES\SFRapideddypick1.PCX GROUP=Skins FLAGS=2 // 1 - Default
    #exec TEXTURE IMPORT NAME=JSFRapidEddy3p2 FILE=TEXTURES\SFRapideddypick2.PCX GROUP=Skins PALETTE=JSFRapideddypick1 // 2 - Default
    #exec TEXTURE IMPORT NAME=JSFRapidEddy3p3 FILE=TEXTURES\SFRapideddypick3.PCX GROUP=Skins PALETTE=JSFRapideddypick1 // 3 - Default

    #exec MESHMAP NEW   MESHMAP=SFRapidEddy3p MESH=SFRapidEddypick
    #exec MESHMAP SCALE MESHMAP=SFRapidEddy3p X=0.06 Y=0.06 Z=0.12

    #exec MESHMAP SETTEXTURE MESHMAP=SFRapidEddy3p NUM=1 TEXTURE=JSFRapidEddy3p1
    #exec MESHMAP SETTEXTURE MESHMAP=SFRapidEddy3p NUM=2 TEXTURE=JSFRapidEddy3p2
    #exec MESHMAP SETTEXTURE MESHMAP=SFRapidEddy3p NUM=3 TEXTURE=JSFRapidEddy3p3

    var SFEddyFlashEffect	m_oElectroEffect;

    simulated function Tick(float fDelta)
    {
    	local vector X,Y,Z;

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

    	// Update effect
    	if(None != m_oElectroEffect)
    	{
    		// Get the player rotation
    		GetAxes(Pawn(Owner).ViewRotation,X,Y,Z);

    		m_oElectroEffect.SetLocation(Location + CalcDrawOffset() - Y*0.5f);
    		m_oElectroEffect.SetRotation(Rotation);
    	}
    }
    simulated function PlayIdleAnim()
    {
    	if ( Mesh != PickupViewMesh )
    		LoopAnim('Still',0.6, 0.3);

    }

    // Overwritten to spawn the special RE sphere
    function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)
    {
    	local float fCurrentMomentum;

    	if(!IsInState('AltFiring'))
    		fCurrentMomentum = fMomentum;
    	else
    		fCurrentMomentum = fAltMomentum;

    	// Check for level hit
    	if (Other == Level)
    	{
    		spawnWallHitEffect(HitLocation, HitNormal);
    	}
    	else if ( (Other!=self) && (Other != None) )
    	{
    		// Hit something
    		if ( !Other.bIsPawn && !Other.IsA('Carcass') )
    		{
    			spawnSmokeEffect(HitLocation, HitNormal);
    			Other.TakeDamage(fDamage, Pawn(Owner), HitLocation, fCurrentMomentum*X, MyDamageType);
    		}
    		else
    		{
    			Spawn(m_clsHitPawnEffect,Other,, HitLocation+HitNormal, Rotator(HitNormal));
    			Other.TakeDamage(fDamage, Pawn(Owner), HitLocation, fCurrentMomentum*X, MyDamageType);
    		}
    	}
    }

    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);
    }

    state NormalFire
    {
      function Fire(float F)
      {
      }
      function AltFire(float F)
      {
      }

    Begin:
      FinishAnim();

      Finish();
    }

    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(fDistRate*fAltDamage, Pawn(Owner), HitLocation, fDistRate*fAltMomentum*X, AltDamageType);
    		}
    	}

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

    		// 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 the shere
     		spawn(class'SFRapidEddyDefenseSphere',Owner,,Owner.Location + CalcDrawOffset() + 2*FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z);
     		// Spawn the wepon effect
    		if(None != m_oElectroEffect)
    			m_oElectroEffect.Destroy();
    		m_oElectroEffect 			= Spawn(class'SFEddyFlashEffect', Self,,Location, Rotation);
    		m_oElectroEffect.Mesh 		= PlayerViewMesh;
    		m_oElectroEffect.DrawScale 	= 1.1*PlayerViewScale;
    		m_oElectroEffect.Texture 	= FireTexture'k_GorillaTex.FX.sfhwstun';

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

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

    Begin:
      FinishAnim();
      Finish();

    }

    State DownWeapon
    {
    ignores Fire, AltFire;

    	function BeginState()
    	{
    		Super.BeginState();
    		if(None != m_oElectroEffect)
    		{
    			m_oElectroEffect.Destroy();
    			m_oElectroEffect = None;
    		}
    	}
    }

    defaultproperties
    {
         MaxTargetRangeAlt=150
         fNormalRate=0.272700
         fDesiredRate=0.180000
         fAltDesiredRate=0.200000
         fDamage=50.000000
         fAltDamage=40.000000
         Icon=Texture'SfResource1.Icons.RapidEddyIco'
         bInstantHit=True
         fAltMomentum=40000.000000
         bCanUpgradeEnergyBooster=True
         bShake=True
         bFlash=True
         ShakeMagAlt=250.000000
         ShakeTimeAlt=0.700000
         ShakeVertAlt=3.000000
         InstantFlashAlt=4.000000
         InstantFogAlt=(X=170.000000,Y=190.000000,Z=220.000000)
         m_fTrailEffectIntervallSize=61.000000
         m_clsSmokeEffect=Class'SFWeapon.SFBlueSmokePuff'
         m_clsTrailEffect=Class'SFWeapon.SFRingExplosion1'
         m_clsHitPawnEffect=Class'SFWeapon.SFRapidEddySphere'
         WeaponDescription="Classification: RapidEddy:\n\nThe Electrical Displacement weapon, officially called the 'Offensive/Defensive Electrical Displacement 2.0', fires electricity in the shape of a ball.\n"
         AmmoName=Class'SFWeapon.SFRapidEddyAmmo'
         PickupAmmoCount=20
         bAltInstantHit=True
         bSplashDamage=True
         FireOffset=(X=32.000000,Y=-5.000000,Z=-8.000000)
         shaketime=0.200000
         shakevert=4.000000
         RefireRate=0.250000
         AltRefireRate=0.250000
         FireSound=Sound'SPF-Content.Weapons.EddyPrimaryFire'
         AltFireSound=Sound'SPF-Content.Weapons.EddySecondaryFire'
         SelectSound=Sound'SPF-Content.Weapons.EddySelect'
         AutoSwitchPriority=3
         InventoryGroup=3
         PickupMessage="You got the Rapid Eddy"
         ItemName="Rapid Eddy"
         PlayerViewOffset=(X=5.000000,Y=-3.600000)
         PlayerViewMesh=LodMesh'SFWeapon.SFRapidEddym'
         PlayerViewScale=0.200000
         PickupViewMesh=LodMesh'SFWeapon.SFRapidEddypick'
         ThirdPersonMesh=LodMesh'SFWeapon.SFRapidEddy3p'
         PickupSound=Sound'SPF-Content.Weapons.EddyPickup'
         Mesh=LodMesh'SFWeapon.SFRapidEddypick'
         bNoSmooth=False
         CollisionRadius=34.000000
         CollisionHeight=20.000000
    }

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