# SFWeapon.SFAlien

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 |
    //=============================================================================
    // Spatial Fear
    // Class: SFUSRifle
    // Descripton: Subclasses of SFweapon
    //				Implements the SFAlien weapon
    //
    // Author: Markus Nuebel
    //=============================================================================
    class SFAlien expands SFWeapon;

    #exec AUDIO IMPORT FILE="Sounds\SelfD1.wav"	NAME=SelfD1 PACKAGE=SFWeapon GROUP=Alien
    #exec AUDIO IMPORT FILE="Sounds\SelfD2.wav"	NAME=SelfD2 PACKAGE=SFWeapon GROUP=Alien

    #exec MESH IMPORT MESH=SFAlienhand ANIVFILE=MODELS\SFAlienhand_a.3d DATAFILE=MODELS\SFAlienhand_d.3d X=0 Y=0 Z=0
    #exec MESH ORIGIN MESH=SFAlienhand X=0 Y=0 Z=0

    #exec MESH SEQUENCE MESH=SFAlienhand SEQ=All         STARTFRAME=0 NUMFRAMES=1
    #exec MESH SEQUENCE MESH=SFAlienhand SEQ=SFAlienhand STARTFRAME=0 NUMFRAMES=1
    #exec MESH SEQUENCE MESH=SFAlienhand SEQ=select		STARTFRAME=0 NUMFRAMES=1
    #exec MESH SEQUENCE MESH=SFAlienhand SEQ=still  STARTFRAME=0 NUMFRAMES=1
    #exec MESH SEQUENCE MESH=SFAlienhand SEQ=still2 STARTFRAME=0 NUMFRAMES=1
    #exec MESH SEQUENCE MESH=SFAlienhand SEQ=fire1  STARTFRAME=0 NUMFRAMES=1
    #exec MESH SEQUENCE MESH=SFAlienhand SEQ=fire2  STARTFRAME=0 NUMFRAMES=1
    #exec MESH SEQUENCE MESH=SFAlienhand SEQ=down   STARTFRAME=0 NUMFRAMES=1

    #exec TEXTURE IMPORT NAME=JSFAlienhand1 FILE=TEXTURES\SFAlienhand1.PCX GROUP=Skins FLAGS=2 // 1 - Default
    #exec TEXTURE IMPORT NAME=JSFAlienhand2 FILE=TEXTURES\SFAlienhand2.PCX GROUP=Skins PALETTE=JSFAlienhand1 // 3 - Default
    #exec TEXTURE IMPORT NAME=JSFAlienhand3 FILE=TEXTURES\SFAlienhand3.PCX GROUP=Skins PALETTE=JSFAlienhand1 // 2 - Default

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

    #exec MESHMAP SETTEXTURE MESHMAP=SFAlienhand NUM=1 TEXTURE=JSFAlienhand1
    #exec MESHMAP SETTEXTURE MESHMAP=SFAlienhand NUM=2 TEXTURE=JSFAlienhand2
    #exec MESHMAP SETTEXTURE MESHMAP=SFAlienhand NUM=3 TEXTURE=JSFAlienhand3

    var float 			m_fTimerInterval;
    var Sound			m_sndTick1;
    var Sound			m_sndTick2;
    var SFStunnedEffect m_oSelfDestructEffect; // Effect displayed during self destruct phase

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

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

    function float RateSelf( out int bUseAltMode )
    {
    	if ( AmmoType.AmmoAmount <=0 )
    		return -2;

    	bUseAltMode = 0;
    	return AIRating;

    }

    function Explode()
    {
    	local UT_SpriteBallExplosion s;
    	HurtRadius(30, 250, 'WeaponExplo', 1000, Location);
    	MakeNoise(1.0);
    	if ( Level.NetMode != NM_DedicatedServer )
    	{
    		spawn(class'Botpack.BlastMark',,,,rot(16384,0,0));
      		s = spawn(class'UT_SpriteBallExplosion',,,Location);
    		s.RemoteRole = ROLE_None;
    	}

     	Destroy(); // Self

     	// Kill the effect
    	m_oSelfDestructEffect.Destroy();
    	m_oSelfDestructEffect= None;

    }

    // Toss this weapon out
    function DropFrom(vector StartLocation)
    {
    	// Call to base class
    	Super.DropFrom(StartLocation);

    	// Spawn the effect
    	m_oSelfDestructEffect 			= Spawn(class'SFStunnedEffect', Self,,Self.Location, Self.Rotation);
    	m_oSelfDestructEffect.Mesh 		= Mesh;
    	m_oSelfDestructEffect.DrawScale 	= Drawscale;
    	m_oSelfDestructEffect.Texture 	= FireTexture'k_GorillaTex.FX.sfhwstun';

    	// Make it collidable
    	SetCollision(true, true, true);

    	// Do the timer
    	SetTimer(Default.m_fTimerInterval, false);
    }

    function Fire( float Value )
    {
    	if ( (AmmoType == None) && (AmmoName != None) )
    	{
    		// ammocheck
    		GiveAmmo(Pawn(Owner));
    	}
    	if ( AmmoType.UseAmmo(AmmoPerShot) )
    	{
     		GotoState('NormalFire');
    		bPointing=True;
    		bCanClientFire = true;
    		ClientFire(Value);
    		if ( bRapidFire || (FiringSpeed > 0) )
    		{
    			Pawn(Owner).PlayRecoil(FiringSpeed);
    		}
    		if ( bInstantHit )
    		{
    			TraceFire(Value);
    			TraceFire(Value);
    		}
    		else
    		{
    			ProjectileFire(ProjectileClass, ProjectileSpeed, bWarnTarget);
    		}
    	}
    }

    auto state Pickup
    {
    	function BeginState()
    	{
    		// Call to base class
    		Super.BeginState();
    	}

    	function Timer()
    	{
    		if(0.1<m_fTimerInterval)
    		{
    			m_fTimerInterval -=0.1;
    			SetTimer(m_fTimerInterval, false);
    			if((0.6<m_fTimerInterval) || (0.2>m_fTimerInterval))
    				PlaySound(m_sndTick1,,2.0);
    			else
    				PlaySound(m_sndTick2,,2.0);
    		}
    		else
    			Explode();
    	}

    	function Tick(float fDelta)
    	{
    		local int IdealFatness;

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

    		if(None != m_oSelfDestructEffect)
    		{
    			IdealFatness	= Fatness; // Convert to int for safety.
    			IdealFatness	+= m_oSelfDestructEffect.FatnessOffset;

    			if ( m_oSelfDestructEffect.Fatness > IdealFatness )
    				m_oSelfDestructEffect.Fatness = Max(IdealFatness, m_oSelfDestructEffect.Fatness - 130 * fDelta);
    			else
    				m_oSelfDestructEffect.Fatness = Min(IdealFatness, 255);
    		}
    	}

    }

    state NormalFire
    {
    	function Fire(float F)
    	{
    	}

    	function AltFire(float F)
    	{
    	}

    Begin:
    	Sleep(0.5);
    	FinishAnim();
    	Finish();
    }

    defaultproperties
    {
         m_fTimerInterval=1.300000
         m_sndTick1=Sound'SFWeapon.Alien.SelfD1'
         m_sndTick2=Sound'SFWeapon.Alien.SelfD2'
         MaxTargetRange=6000
         MaxTargetRangeAlt=6000
         fNormalRate=0.333300
         fDesiredRate=0.200000
         fDamage=10.000000
         fAltDamage=10.000000
         bInstantHit=True
         fMomentum=1000.000000
         fAltMomentum=20000.000000
         m_fTrailEffectIntervallSize=151.000000
         bAlienWeapon=True
         m_clsHitWallEffect=Class'SFWeapon.AlienRingExplosion'
         m_clsTrailEffect=Class'SFWeapon.SFAlienBeam'
         m_bSemiAuto=True
         m_bHasLaserSight=True
         WeaponDescription="Classification: Alient Rifle:"
         InstFlash=-0.300000
         AmmoName=Class'SFWeapon.SFHardWaveAmmo'
         PickupAmmoCount=999
         bAltInstantHit=True
         FireOffset=(X=80.000000,Y=14.000000,Z=-42.000000)
         AltDamageType=SFAlien
         aimerror=550.000000
         RefireRate=0.300000
         AltRefireRate=0.830000
         FireSound=Sound'UnrealI.BioRifle.GelShot'
         SelectSound=Sound'UnrealI.BioRifle.GelSelect'
         bDrawMuzzleFlash=True
         ItemName="Alien Rifle"
         PlayerViewOffset=(X=2.200000,Y=-1.000000,Z=-1.600000)
         PlayerViewMesh=LodMesh'SFWeapon.SFAlienhand'
         PlayerViewScale=0.200000
         BobDamping=0.975000
         PickupViewMesh=LodMesh'SFWeapon.SFAlienhand'
         ThirdPersonMesh=LodMesh'SFWeapon.SFAlienhand'
         PickupSound=Sound'UnrealShare.Pickups.WeaponPickup'
         Mesh=LodMesh'SFWeapon.SFAlienhand'
         bNoSmooth=False
         CollisionRadius=34.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