Core.Object | +--Engine.Actor | +--Engine.Inventory | +--Engine.Weapon | +--UnrealShare.Stinger
bool
bAlreadyFiring
void
PlayAltFiring()
PlayFiring()
float
RateSelf(out int)
PlayIdleAnim()
///////////////////////////////////////////////////////////
EndState()
Tick(float DeltaTime)
00001 //============================================================================= 00002 // Stinger. 00003 //============================================================================= 00004 class Stinger extends Weapon; 00005 00006 #exec MESH IMPORT MESH=StingerM ANIVFILE=MODELS\aniv51.3D DATAFILE=MODELS\data51.3D X=0 Y=0 Z=0 00007 #exec MESH ORIGIN MESH=StingerM X=0 Y=0 Z=0 YAW=64 00008 #exec MESH SEQUENCE MESH=StingerM SEQ=All STARTFRAME=0 NUMFRAMES=44 00009 #exec MESH SEQUENCE MESH=StingerM SEQ=Select STARTFRAME=0 NUMFRAMES=21 GROUP=Select 00010 #exec MESH SEQUENCE MESH=StingerM SEQ=Still STARTFRAME=21 NUMFRAMES=1 00011 #exec MESH SEQUENCE MESH=StingerM SEQ=Down STARTFRAME=22 NUMFRAMES=11 00012 #exec MESH SEQUENCE MESH=StingerM SEQ=FireOne STARTFRAME=33 NUMFRAMES=3 00013 #exec MESH SEQUENCE MESH=StingerM SEQ=FireThree STARTFRAME=36 NUMFRAMES=7 00014 00015 #exec TEXTURE IMPORT NAME=SpikHand1 FILE=MODELS\Spikegun.PCX GROUP="Skins" 00016 #exec OBJ LOAD FILE=Textures\FireEffect18.utx PACKAGE=UnrealShare.Effect18 00017 #exec MESHMAP SCALE MESHMAP=StingerM X=0.005 Y=0.005 Z=0.01 00018 #exec MESHMAP SETTEXTURE MESHMAP=StingerM NUM=1 TEXTURE=SpikHand1 00019 #exec MESHMAP SETTEXTURE MESHMAP=StingerM NUM=0 TEXTURE=UnrealShare.Effect18.FireEffect18 00020 00021 #exec MESH IMPORT MESH=StingerPickup ANIVFILE=MODELS\aniv55.3D DATAFILE=MODELS\data55.3D X=0 Y=0 Z=0 00022 #exec MESH ORIGIN MESH=StingerPickup X=100 Y=-100 Z=0 YAW=0 PITCH=0 00023 #exec MESH SEQUENCE MESH=StingerPickup SEQ=All STARTFRAME=0 NUMFRAMES=1 00024 #exec MESH SEQUENCE MESH=StingerPickup SEQ=Still STARTFRAME=0 NUMFRAMES=1 00025 #exec TEXTURE IMPORT NAME=Sting1 FILE=MODELS\spikegun.PCX GROUP="Skins" 00026 #exec MESHMAP SCALE MESHMAP=StingerPickup X=0.03 Y=0.03 Z=0.06 00027 #exec MESHMAP SETTEXTURE MESHMAP=StingerPickup NUM=1 TEXTURE=Sting1 00028 00029 #exec MESH IMPORT MESH=Stinger3rd ANIVFILE=MODELS\Sting3_a.3D DATAFILE=MODELS\Sting3_d.3D X=0 Y=0 Z=0 00030 #exec MESH ORIGIN MESH=Stinger3rd X=0 Y=320 Z=-50 YAW=-64 ROLL=119 PITCH=128 00031 #exec MESH SEQUENCE MESH=Stinger3rd SEQ=All STARTFRAME=0 NUMFRAMES=6 00032 #exec MESH SEQUENCE MESH=Stinger3rd SEQ=Still STARTFRAME=0 NUMFRAMES=1 00033 #exec MESH SEQUENCE MESH=Stinger3rd SEQ=FireOne STARTFRAME=1 NUMFRAMES=5 00034 #exec TEXTURE IMPORT NAME=JSting2 FILE=MODELS\sting3.PCX GROUP="Skins" 00035 #exec OBJ LOAD FILE=textures\FireEffect18.utx PACKAGE=UnrealShare.Effect18 00036 #exec MESHMAP SCALE MESHMAP=Stinger3rd X=0.035 Y=0.035 Z=0.07 00037 #exec MESHMAP SETTEXTURE MESHMAP=Stinger3rd NUM=1 TEXTURE=JSting2 00038 #exec MESHMAP SETTEXTURE MESHMAP=Stinger3rd NUM=0 TEXTURE=UnrealShare.Effect18.FireEffect18 00039 00040 #exec AUDIO IMPORT FILE="Sounds\stinger\sshot10d.WAV" NAME="StingerFire" GROUP="Stinger" 00041 #exec AUDIO IMPORT FILE="Sounds\stinger\sshot20d.WAV" NAME="StingerTwoFire" GROUP="Stinger" 00042 #exec AUDIO IMPORT FILE="Sounds\stinger\saltf1.WAV" NAME="StingerAltFire" GROUP="Stinger" 00043 #exec AUDIO IMPORT FILE="Sounds\stinger\load1.WAV" NAME="StingerLoad" GROUP="Stinger" 00044 #exec AUDIO IMPORT FILE="Sounds\stinger\Ends1.WAV" NAME="EndFire" GROUP="Stinger" 00045 00046 var bool bAlreadyFiring; 00047 00048 function float RateSelf( out int bUseAltMode ) 00049 { 00050 local float EnemyDist; 00051 00052 if ( AmmoType.AmmoAmount <=0 ) 00053 return -2; 00054 if ( Pawn(Owner).Enemy == None ) 00055 { 00056 bUseAltMode = 0; 00057 return AIRating; 00058 } 00059 00060 EnemyDist = VSize(Pawn(Owner).Enemy.Location - Owner.Location); 00061 bUseAltMode = int( 600 * FRand() > EnemyDist - 140 ); 00062 return AIRating; 00063 } 00064 00065 function PlayFiring() 00066 { 00067 if ( bAlreadyFiring ) 00068 { 00069 AmbientSound = sound'StingerTwoFire'; 00070 SoundVolume = Pawn(Owner).SoundDampening*255; 00071 LoopAnim( 'FireOne', 0.7); 00072 } 00073 else 00074 { 00075 Owner.PlaySound(FireSound, SLOT_Misc,2.0*Pawn(Owner).SoundDampening); 00076 PlayAnim( 'FireOne', 0.7 ); 00077 } 00078 bAlreadyFiring = true; 00079 bWarnTarget = (FRand() < 0.2); 00080 } 00081 00082 function PlayAltFiring() 00083 { 00084 Owner.PlaySound(AltFireSound, SLOT_Misc,2.0*Pawn(Owner).SoundDampening); 00085 PlayAnim( 'FireOne', 0.6 ); 00086 } 00087 00088 /////////////////////////////////////////////////////// 00089 state NormalFire 00090 { 00091 00092 function Tick( float DeltaTime ) 00093 { 00094 if (Owner==None) AmbientSound=None; 00095 else 00096 SetLocation(Owner.Location); 00097 } 00098 00099 function EndState() 00100 { 00101 if (AmbientSound!=None && Owner!=None) Owner.PlaySound(Misc1Sound, SLOT_Misc,2.0*Pawn(Owner).SoundDampening); 00102 AmbientSound = None; 00103 bAlreadyFiring = false; 00104 Super.EndState(); 00105 } 00106 00107 Begin: 00108 Sleep(0.2); 00109 SetLocation(Owner.Location); 00110 Finish(); 00111 } 00112 00113 /////////////////////////////////////////////////////////////// 00114 state AltFiring 00115 { 00116 function Projectile ProjectileFire(class<projectile> ProjClass, float ProjSpeed, bool bWarn) 00117 { 00118 local Projectile S; 00119 local int i; 00120 local vector Start,X,Y,Z; 00121 local Rotator StartRot, AltRotation; 00122 00123 S = Global.ProjectileFire(ProjClass, ProjSpeed, bWarn); 00124 StartRot = S.Rotation; 00125 Start = S.Location; 00126 for (i = 0; i< 4; i++) 00127 { 00128 if (AmmoType.UseAmmo(1)) 00129 { 00130 AltRotation = StartRot; 00131 AltRotation.Pitch += FRand()*3000-1500; 00132 AltRotation.Yaw += FRand()*3000-1500; 00133 AltRotation.Roll += FRand()*9000-4500; 00134 S = Spawn(AltProjectileClass,,, Start - 2 * VRand(), AltRotation); 00135 } 00136 } 00137 StingerProjectile(S).bLighting = True; 00138 } 00139 00140 Begin: 00141 FinishAnim(); 00142 PlayAnim('Still'); 00143 Sleep(1.0); 00144 Finish(); 00145 } 00146 00147 /////////////////////////////////////////////////////////// 00148 function PlayIdleAnim() 00149 { 00150 PlayAnim('Still'); 00151 } 00152 00153 defaultproperties 00154 { 00155 AmmoName=Class'UnrealShare.StingerAmmo' 00156 PickupAmmoCount=40 00157 bAltWarnTarget=True 00158 FireOffset=(X=12.000000,Y=-10.000000,Z=-15.000000) 00159 ProjectileClass=Class'UnrealShare.StingerProjectile' 00160 AltProjectileClass=Class'UnrealShare.StingerProjectile' 00161 shakemag=120.000000 00162 AIRating=0.400000 00163 RefireRate=0.800000 00164 FireSound=Sound'UnrealShare.Stinger.StingerFire' 00165 AltFireSound=Sound'UnrealShare.Stinger.StingerAltFire' 00166 SelectSound=Sound'UnrealShare.Stinger.StingerLoad' 00167 Misc1Sound=Sound'UnrealShare.Stinger.EndFire' 00168 DeathMessage="%o was perforated by %k's %w." 00169 AutoSwitchPriority=3 00170 InventoryGroup=3 00171 PickupMessage="You picked up the Stinger" 00172 ItemName="Stinger" 00173 PlayerViewOffset=(X=4.200000,Y=-3.000000,Z=-4.000000) 00174 PlayerViewMesh=LodMesh'UnrealShare.StingerM' 00175 PlayerViewScale=1.700000 00176 PickupViewMesh=LodMesh'UnrealShare.StingerPickup' 00177 ThirdPersonMesh=LodMesh'UnrealShare.Stinger3rd' 00178 PickupSound=Sound'UnrealShare.Pickups.WeaponPickup' 00179 Mesh=LodMesh'UnrealShare.StingerPickup' 00180 bNoSmooth=False 00181 SoundRadius=64 00182 SoundVolume=255 00183 CollisionRadius=27.000000 00184 CollisionHeight=8.000000 00185 }