Core.Object | +--Engine.Actor | +--Engine.Inventory | +--Engine.Weapon | +--UnrealShare.ASMD
Pickup
Amp
int
HitDamage
Projectile
Tracked
bool
bBotSpecialMove
void
AltFire(float Value)
BecomePickup()
Finish()
PlayAltFiring()
PlayFiring()
///////////////////////////////////////////////////////
PlayIdleAnim()
ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)
float
RateSelf(out int)
Inventory
SpawnCopy(Pawn Other)
SpawnEffect(Vector DVector, int NumPoints, rotator SmokeRotation, vector SmokeLocation)
Timer()
TraceFire(float Accuracy)
Tick(float DeltaTime)
AltFire(float F)
Fire(float F)
EndState()
BeginState()
00001 //============================================================================= 00002 // ASMD. 00003 //============================================================================= 00004 class ASMD extends Weapon; 00005 00006 #exec MESH IMPORT MESH=ASMDM ANIVFILE=MODELS\ASMD_a.3D DATAFILE=MODELS\ASMD_d.3D X=0 Y=0 Z=0 00007 #exec MESH ORIGIN MESH=ASMDM X=0 Y=0 Z=0 YAW=-64 PITCH=0 00008 #exec MESH SEQUENCE MESH=ASMDM SEQ=All STARTFRAME=0 NUMFRAMES=80 00009 #exec MESH SEQUENCE MESH=ASMDM SEQ=Select STARTFRAME=0 NUMFRAMES=14 RATE=27 GROUP=Select 00010 #exec MESH SEQUENCE MESH=ASMDM SEQ=Still STARTFRAME=14 NUMFRAMES=2 00011 #exec MESH SEQUENCE MESH=ASMDM SEQ=Down STARTFRAME=16 NUMFRAMES=10 00012 #exec MESH SEQUENCE MESH=ASMDM SEQ=Still2 STARTFRAME=26 NUMFRAMES=2 00013 #exec MESH SEQUENCE MESH=ASMDM SEQ=Fire1 STARTFRAME=28 NUMFRAMES=9 RATE=24 00014 #exec MESH SEQUENCE MESH=ASMDM SEQ=Fire2 STARTFRAME=37 NUMFRAMES=10 00015 #exec MESH SEQUENCE MESH=ASMDM SEQ=Steam STARTFRAME=47 NUMFRAMES=10 00016 #exec MESH SEQUENCE MESH=ASMDM SEQ=Cocking STARTFRAME=57 NUMFRAMES=19 00017 #exec MESH SEQUENCE MESH=ASMDM SEQ=Sway STARTFRAME=76 NUMFRAMES=4 00018 #exec TEXTURE IMPORT NAME=ASMD1 FILE=MODELS\ASMD.PCX GROUP="Skins" 00019 #exec OBJ LOAD FILE=Textures\SmokeEffect3.utx PACKAGE=UnrealShare.SEffect3 00020 #exec MESHMAP SCALE MESHMAP=ASMDM X=0.007 Y=0.005 Z=0.01 00021 #exec MESHMAP SETTEXTURE MESHMAP=ASMDM NUM=1 TEXTURE=ASMD1 00022 #exec MESHMAP SETTEXTURE MESHMAP=ASMDM NUM=0 TEXTURE=UnrealShare.SEffect3.SmokeEffect3 00023 00024 #exec MESH IMPORT MESH=ASMDPick ANIVFILE=MODELS\Tazlo_a.3D DATAFILE=MODELS\Tazlo_d.3D X=0 Y=0 Z=0 00025 #exec MESH ORIGIN MESH=ASMDPick X=0 Y=-10 Z=-13 YAW=-64 PITCH=0 00026 #exec MESH SEQUENCE MESH=ASMDPick SEQ=All STARTFRAME=0 NUMFRAMES=6 00027 #exec TEXTURE IMPORT NAME=ASMD1 FILE=MODELS\ASMD.PCX GROUP="Skins" 00028 #exec MESHMAP SCALE MESHMAP=ASMDPick X=0.1 Y=0.1 Z=0.2 00029 #exec MESHMAP SETTEXTURE MESHMAP=ASMDPick NUM=1 TEXTURE=ASMD1 00030 00031 #exec MESH IMPORT MESH=ASMD3 ANIVFILE=MODELS\Tazlo_a.3D DATAFILE=MODELS\Tazlo_d.3D X=0 Y=0 Z=0 00032 #exec MESH ORIGIN MESH=ASMD3 X=0 Y=-190 Z=-40 YAW=-64 ROLL=9 00033 #exec MESH SEQUENCE MESH=ASMD3 SEQ=All STARTFRAME=0 NUMFRAMES=1 00034 #exec MESH SEQUENCE MESH=ASMD3 SEQ=Still STARTFRAME=0 NUMFRAMES=1 00035 #exec MESH SEQUENCE MESH=ASMD3 SEQ=Fire1 STARTFRAME=0 NUMFRAMES=1 00036 #exec TEXTURE IMPORT NAME=ASMD1 FILE=MODELS\ASMD.PCX GROUP="Skins" 00037 #exec MESHMAP SCALE MESHMAP=ASMD3 X=0.065 Y=0.065 Z=0.13 00038 #exec MESHMAP SETTEXTURE MESHMAP=ASMD3 NUM=1 TEXTURE=ASMD1 00039 00040 #exec AUDIO IMPORT FILE="Sounds\Tazer\TSHOTA6.WAV" NAME="TazerFire" GROUP="ASMD" 00041 #exec AUDIO IMPORT FILE="Sounds\Tazer\TSHOTB1.WAV" NAME="TazerAltFire" GROUP="ASMD" 00042 #exec AUDIO IMPORT FILE="Sounds\Tazer\TPICKUP3.WAV" NAME="TazerSelect" GROUP="ASMD" 00043 #exec AUDIO IMPORT FILE="Sounds\Tazer\Vapour1.WAV" NAME="Vapour" GROUP="ASMD" 00044 00045 var() int HitDamage; 00046 var Pickup Amp; 00047 var Projectile Tracked; 00048 var bool bBotSpecialMove; 00049 00050 function inventory SpawnCopy( pawn Other ) 00051 { 00052 local inventory Copy; 00053 local Inventory I; 00054 00055 Copy = Super.SpawnCopy(Other); 00056 I = Other.FindInventoryType(class'Amplifier'); 00057 if ( Amplifier(I) != None ) 00058 ASMD(Copy).Amp = Amplifier(I); 00059 00060 return Copy; 00061 } 00062 00063 function AltFire( float Value ) 00064 { 00065 local actor HitActor; 00066 local vector HitLocation, HitNormal, Start; 00067 00068 if ( Owner.IsA('Bots') || Owner.IsA('Bot') ) //make sure won't blow self up 00069 { 00070 Start = Owner.Location + CalcDrawOffset() + FireOffset.Z * vect(0,0,1); 00071 HitActor = Trace(HitLocation, HitNormal, Start + 250 * Normal(Pawn(Owner).Enemy.Location - Start), Start, false, vect(12,12,12)); 00072 if ( HitActor != None ) 00073 { 00074 Global.Fire(Value); 00075 return; 00076 } 00077 if ( Owner.IsInState('TacticalMove') && (Owner.Target == Pawn(Owner).Enemy) 00078 && (Owner.Physics == PHYS_Walking) 00079 && (Pawn(Owner).Skill > 1) && (FRand() < 0.35) ) 00080 Pawn(Owner).SpecialFire(); 00081 } 00082 if (AmmoType.UseAmmo(1)) 00083 { 00084 GotoState('AltFiring'); 00085 if ( PlayerPawn(Owner) != None ) 00086 { 00087 PlayerPawn(Owner).ClientInstantFlash( -0.4, vect(0, 0, 800)); 00088 PlayerPawn(Owner).ShakeView(ShakeTime, ShakeMag, ShakeVert); 00089 } 00090 bPointing=True; 00091 ProjectileFire(AltProjectileClass, AltProjectileSpeed, bAltWarnTarget); 00092 PlayAltFiring(); 00093 if ( Owner.bHidden ) 00094 CheckVisibility(); 00095 } 00096 } 00097 00098 function TraceFire( float Accuracy ) 00099 { 00100 local vector HitLocation, HitNormal, StartTrace, EndTrace, X,Y,Z; 00101 local actor Other; 00102 00103 Owner.MakeNoise(Pawn(Owner).SoundDampening); 00104 GetAxes(Pawn(owner).ViewRotation,X,Y,Z); 00105 StartTrace = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z; 00106 EndTrace = StartTrace + Accuracy * (FRand() - 0.5 )* Y * 1000 00107 + Accuracy * (FRand() - 0.5 ) * Z * 1000 ; 00108 00109 if ( bBotSpecialMove && (Tracked != None) 00110 && (((Owner.Acceleration == vect(0,0,0)) && (VSize(Owner.Velocity) < 40)) || 00111 (Normal(Owner.Velocity) Dot Normal(Tracked.Velocity) > 0.95)) ) 00112 EndTrace += 10000 * Normal(Tracked.Location - StartTrace); 00113 else 00114 { 00115 bSplashDamage = false; 00116 AdjustedAim = pawn(owner).AdjustAim(1000000, StartTrace, 2.75*AimError, False, False); 00117 bSplashDamage = true; 00118 EndTrace += (10000 * vector(AdjustedAim)); 00119 } 00120 00121 Tracked = None; 00122 bBotSpecialMove = false; 00123 00124 Other = Pawn(Owner).TraceShot(HitLocation,HitNormal,EndTrace,StartTrace); 00125 ProcessTraceHit(Other, HitLocation, HitNormal, vector(AdjustedAim),Y,Z); 00126 } 00127 00128 function float RateSelf( out int bUseAltMode ) 00129 { 00130 local float rating; 00131 00132 if ( Amp != None ) 00133 rating = 2 * AIRating; 00134 else 00135 rating = AIRating; 00136 00137 if ( AmmoType.AmmoAmount <=0 ) 00138 return -2; 00139 00140 if ( Pawn(Owner).Enemy == None ) 00141 bUseAltMode = 0; 00142 else if ( Pawn(Owner).IsInState('Hunting') || Pawn(Owner).IsInState('StakeOut') 00143 || Pawn(Owner).IsInState('RangedAttack') 00144 || !Pawn(Owner).LineOfSightTo(Pawn(Owner).Enemy) ) 00145 { 00146 bUseAltMode = 1; 00147 return (Rating + 0.3); 00148 } 00149 else if ( (Pawn(Owner).Skill > 1) && (Owner.Acceleration == vect(0,0,0)) ) 00150 bUseAltMode = 1; 00151 else 00152 bUseAltMode = int( FRand() < 0.4 ); 00153 00154 return rating; 00155 } 00156 00157 function BecomePickup() 00158 { 00159 Amp = None; 00160 Super.BecomePickup(); 00161 } 00162 00163 function Timer() 00164 { 00165 local actor targ; 00166 local float bestAim, bestDist; 00167 local vector FireDir; 00168 00169 bestAim = 0.95; 00170 if ( Pawn(Owner) == None ) 00171 { 00172 GotoState(''); 00173 return; 00174 } 00175 FireDir = vector(Pawn(Owner).ViewRotation); 00176 targ = Pawn(Owner).PickTarget(bestAim, bestDist, FireDir, Owner.Location); 00177 if ( Pawn(targ) != None ) 00178 { 00179 bPointing = true; 00180 Pawn(targ).WarnTarget(Pawn(Owner), 300, FireDir); 00181 SetTimer(1 + 4 * FRand(), false); 00182 } 00183 else 00184 { 00185 SetTimer(0.5 + 2 * FRand(), false); 00186 bPointing = false; 00187 } 00188 } 00189 00190 function Finish() 00191 { 00192 if ( (Pawn(Owner).bFire!=0) && (FRand() < 0.6) ) 00193 Timer(); 00194 if ( !bChangeWeapon && (Tracked != None) && !Tracked.bDeleteMe && (Owner != None) 00195 && (Owner.IsA('Bots') || Owner.IsA('Bot')) && (Pawn(Owner).Enemy != None) 00196 && (AmmoType.AmmoAmount > 0) && (Pawn(Owner).Skill > 1) ) 00197 { 00198 if ( (Owner.Acceleration == vect(0,0,0)) || 00199 (Abs(Normal(Owner.Velocity) dot Normal(Tracked.Velocity)) > 0.95) ) 00200 { 00201 bBotSpecialMove = true; 00202 GotoState('ComboMove'); 00203 return; 00204 } 00205 } 00206 00207 bBotSpecialMove = false; 00208 Tracked = None; 00209 Super.Finish(); 00210 } 00211 00212 /////////////////////////////////////////////////////// 00213 function PlayFiring() 00214 { 00215 Owner.PlaySound(FireSound, SLOT_None, Pawn(Owner).SoundDampening*4.0); 00216 PlayAnim('Fire1', 0.5,0.05); 00217 } 00218 00219 function Projectile ProjectileFire(class<projectile> ProjClass, float ProjSpeed, bool bWarn) 00220 { 00221 local Vector Start, X,Y,Z; 00222 local float Mult; 00223 00224 if (Amp!=None) Mult = Amp.UseCharge(80); 00225 else Mult=1.0; 00226 00227 Owner.MakeNoise(Pawn(Owner).SoundDampening); 00228 GetAxes(Pawn(owner).ViewRotation,X,Y,Z); 00229 Start = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z; 00230 bSplashDamage = false; 00231 AdjustedAim = pawn(owner).AdjustAim(ProjSpeed, Start, AimError, True, bWarn); 00232 bSplashDamage = true; 00233 Tracked = Spawn(ProjClass,,, Start,AdjustedAim); 00234 Tracked.Damage = Tracked.Damage*Mult; 00235 } 00236 00237 function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z) 00238 { 00239 local vector SmokeLocation,DVector; 00240 local rotator SmokeRotation; 00241 local float NumPoints,Mult; 00242 local int i; 00243 local class<RingExplosion> rc; 00244 local RingExplosion r; 00245 00246 if (Other==None) 00247 { 00248 HitNormal = -X; 00249 HitLocation = Owner.Location + X*10000.0; 00250 } 00251 00252 if (Amp!=None) Mult = Amp.UseCharge(100); 00253 else Mult=1.0; 00254 SmokeLocation = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * 3.3 * Y + FireOffset.Z * Z * 3.0; 00255 DVector = HitLocation - SmokeLocation; 00256 NumPoints = VSize(DVector)/70.0; 00257 SmokeLocation += DVector/NumPoints; 00258 SmokeRotation = rotator(HitLocation-Owner.Location); 00259 if (NumPoints>15) NumPoints=15; 00260 if ( NumPoints>1.0 ) SpawnEffect(DVector, NumPoints, SmokeRotation, SmokeLocation); 00261 00262 if ( TazerProj(Other)!=None ) 00263 { 00264 AmmoType.UseAmmo(2); 00265 TazerProj(Other).SuperExplosion(); 00266 } 00267 else 00268 { 00269 if (Mult>1.5) 00270 rc = class'RingExplosion3'; 00271 else 00272 rc = class'RingExplosion'; 00273 00274 r = Spawn(rc,,, HitLocation+HitNormal*8,rotator(HitNormal)); 00275 if ( r != None ) 00276 r.PlaySound(r.ExploSound,,6); 00277 } 00278 00279 if ( (Other != self) && (Other != Owner) && (Other != None) ) 00280 Other.TakeDamage(HitDamage*Mult, Pawn(Owner), HitLocation, 50000.0*X, 'jolted'); 00281 } 00282 00283 00284 function SpawnEffect(Vector DVector, int NumPoints, rotator SmokeRotation, vector SmokeLocation) 00285 { 00286 local RingExplosion4 Smoke; 00287 00288 Smoke = Spawn(class'RingExplosion4',,,SmokeLocation,SmokeRotation); 00289 Smoke.MoveAmount = DVector/NumPoints; 00290 Smoke.NumPuffs = NumPoints; 00291 } 00292 00293 function PlayAltFiring() 00294 { 00295 Owner.PlaySound(AltFireSound, SLOT_None,Pawn(Owner).SoundDampening*4.0); 00296 PlayAnim('Fire1',0.8,0.05); 00297 } 00298 00299 function PlayIdleAnim() 00300 { 00301 if ( AnimSequence == 'Fire1' && FRand()<0.2) 00302 { 00303 Owner.PlaySound(Misc1Sound, SLOT_None, Pawn(Owner).SoundDampening*0.5); 00304 PlayAnim('Steam',0.1,0.4); 00305 } 00306 else if ( VSize(Owner.Velocity) > 20 ) 00307 { 00308 if ( AnimSequence=='Still' ) 00309 LoopAnim('Sway',0.1,0.3); 00310 } 00311 else if ( AnimSequence!='Still' ) 00312 { 00313 if (FRand()<0.5) 00314 { 00315 PlayAnim('Steam',0.1,0.4); 00316 Owner.PlaySound(Misc1Sound, SLOT_None, Pawn(Owner).SoundDampening*0.5); 00317 } 00318 else LoopAnim('Still',0.04,0.3); 00319 } 00320 Enable('AnimEnd'); 00321 } 00322 00323 state Idle 00324 { 00325 00326 function BeginState() 00327 { 00328 bPointing = false; 00329 SetTimer(0.5 + 2 * FRand(), false); 00330 Super.BeginState(); 00331 if (Pawn(Owner).bFire!=0) Fire(0.0); 00332 if (Pawn(Owner).bAltFire!=0) AltFire(0.0); 00333 } 00334 00335 function EndState() 00336 { 00337 SetTimer(0.0, false); 00338 Super.EndState(); 00339 } 00340 } 00341 00342 state ComboMove 00343 { 00344 function Fire(float F); 00345 function AltFire(float F); 00346 00347 function Tick(float DeltaTime) 00348 { 00349 if ( (Owner == None) || (Pawn(Owner).Enemy == None) ) 00350 { 00351 Tracked = None; 00352 bBotSpecialMove = false; 00353 Finish(); 00354 return; 00355 } 00356 if ( (Tracked == None) || Tracked.bDeleteMe 00357 || (((Tracked.Location - Owner.Location) 00358 dot (Tracked.Location - Pawn(Owner).Enemy.Location)) >= 0) 00359 || (VSize(Tracked.Location - Pawn(Owner).Enemy.Location) < 100) ) 00360 Global.Fire(0); 00361 } 00362 00363 Begin: 00364 Sleep(7.0); 00365 Tracked = None; 00366 bBotSpecialMove = false; 00367 Global.Fire(0); 00368 } 00369 00370 defaultproperties 00371 { 00372 hitdamage=35 00373 AmmoName=Class'UnrealShare.ASMDAmmo' 00374 PickupAmmoCount=20 00375 bInstantHit=True 00376 bAltWarnTarget=True 00377 bSplashDamage=True 00378 FireOffset=(X=12.000000,Y=-6.000000,Z=-7.000000) 00379 AltProjectileClass=Class'UnrealShare.TazerProj' 00380 AIRating=0.600000 00381 AltRefireRate=0.700000 00382 FireSound=Sound'UnrealShare.ASMD.TazerFire' 00383 AltFireSound=Sound'UnrealShare.ASMD.TazerAltFire' 00384 SelectSound=Sound'UnrealShare.ASMD.TazerSelect' 00385 Misc1Sound=Sound'UnrealShare.ASMD.Vapour' 00386 DeathMessage="%k inflicted mortal damage upon %o with the %w." 00387 AutoSwitchPriority=4 00388 InventoryGroup=4 00389 PickupMessage="You got the ASMD" 00390 ItemName="ASMD" 00391 PlayerViewOffset=(X=3.500000,Y=-1.800000,Z=-2.000000) 00392 PlayerViewMesh=LodMesh'UnrealShare.ASMDM' 00393 PickupViewMesh=LodMesh'UnrealShare.ASMDPick' 00394 ThirdPersonMesh=LodMesh'UnrealShare.ASMD3' 00395 PickupSound=Sound'UnrealShare.Pickups.WeaponPickup' 00396 Mesh=LodMesh'UnrealShare.ASMDPick' 00397 bNoSmooth=False 00398 CollisionRadius=28.000000 00399 CollisionHeight=8.000000 00400 Mass=50.000000 00401 }