Core.Object | +--Engine.Actor | +--Engine.Inventory | +--Engine.Weapon | +--Botpack.TournamentWeapon | +--Botpack.ImpactHammer
sound
AltFireSound
ChargeSize,
Count
TensionSound
void
AltFire(float Value)
bool
ClientFire(float Value)
simulated
ClientWeaponEvent(name EventType)
Fire(float Value)
PlayAltFiring()
PlayFiring()
PlayPostSelect()
float
RateSelf(out int)
SuggestAttackStyle()
SuggestDefenseStyle()
ProcessAltTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)
TraceAltFire()
ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)
TraceFire(float accuracy)
ClientAltFire(float Value)
AltFire(float F)
Fire(float F)
EndState()
BeginState()
Tick(float DeltaTime)
00001 //============================================================================= 00002 // ImpactHammer. 00003 //============================================================================= 00004 class ImpactHammer extends TournamentWeapon; 00005 00006 #exec MESH IMPORT MESH=ImpactHammer ANIVFILE=MODELS\impact_a.3D DATAFILE=MODELS\impact_d.3D X=0 Y=0 Z=0 00007 #exec MESH ORIGIN MESH=ImpactHammer X=0 Y=0 Z=0 YAW=64 PITCH=0 ROLL=-56 00008 #exec MESH SEQUENCE MESH=ImpactHammer SEQ=All STARTFRAME=0 NUMFRAMES=56 00009 #exec MESH SEQUENCE MESH=ImpactHammer SEQ=Select STARTFRAME=0 NUMFRAMES=17 00010 #exec MESH SEQUENCE MESH=ImpactHammer SEQ=Still STARTFRAME=17 NUMFRAMES=1 00011 #exec MESH SEQUENCE MESH=ImpactHammer SEQ=Pull STARTFRAME=17 NUMFRAMES=5 00012 #exec MESH SEQUENCE MESH=ImpactHammer SEQ=Shake STARTFRAME=22 NUMFRAMES=10 00013 #exec MESH SEQUENCE MESH=ImpactHammer SEQ=Fire STARTFRAME=35 NUMFRAMES=16 00014 #exec MESH SEQUENCE MESH=ImpactHammer SEQ=Down STARTFRAME=51 NUMFRAMES=5 00015 #exec TEXTURE IMPORT NAME=JImpactHammer1 FILE=MODELS\imp1.PCX GROUP=Skins LODSET=2 00016 #exec TEXTURE IMPORT NAME=JImpactHammer2 FILE=MODELS\imp2.PCX GROUP=Skins LODSET=2 00017 #exec TEXTURE IMPORT NAME=JImpactHammer3 FILE=MODELS\imp3.pCX GROUP=Skins LODSET=2 00018 #exec TEXTURE IMPORT NAME=JImpactHammer4 FILE=MODELS\imp4.PCX GROUP=Skins LODSET=2 00019 #exec MESHMAP SCALE MESHMAP=ImpactHammer X=0.006 Y=0.006 Z=0.007 00020 #exec MESHMAP SETTEXTURE MESHMAP=ImpactHammer NUM=0 TEXTURE=JImpactHammer1 00021 #exec MESHMAP SETTEXTURE MESHMAP=ImpactHammer NUM=1 TEXTURE=JImpactHammer2 00022 #exec MESHMAP SETTEXTURE MESHMAP=ImpactHammer NUM=2 TEXTURE=JImpactHammer3 00023 #exec MESHMAP SETTEXTURE MESHMAP=ImpactHammer NUM=3 TEXTURE=JImpactHammer4 00024 00025 #exec MESH IMPORT MESH=ImpPick ANIVFILE=MODELS\imppick_a.3D DATAFILE=MODELS\imppick_d.3D X=0 Y=0 Z=0 00026 #exec MESH ORIGIN MESH=ImpPick X=0 Y=0 Z=0 YAW=0 ROLL=-64 00027 #exec MESH SEQUENCE MESH=ImpPick SEQ=All STARTFRAME=0 NUMFRAMES=1 00028 #exec MESH SEQUENCE MESH=ImpPick SEQ=Still STARTFRAME=0 NUMFRAMES=1 00029 #exec TEXTURE IMPORT NAME=JImpPick1 FILE=MODELS\imp0.PCX GROUP=Skins LODSET=2 00030 #exec MESHMAP SCALE MESHMAP=ImpPick X=0.1 Y=0.1 Z=0.2 00031 #exec MESHMAP SETTEXTURE MESHMAP=ImpPick NUM=1 TEXTURE=JImpPick1 00032 00033 #exec MESH IMPORT MESH=ImpactHandm ANIVFILE=MODELS\impacthand_a.3D DATAFILE=MODELS\impacthand_d.3D 00034 #exec MESH ORIGIN MESH=ImpactHandm X=30 Y=-130 Z=-157 YAW=64 ROLL=-64 00035 #exec MESH SEQUENCE MESH=ImpactHandm SEQ=All STARTFRAME=0 NUMFRAMES=13 00036 #exec MESH SEQUENCE MESH=ImpactHandm SEQ=Pull STARTFRAME=1 NUMFRAMES=10 00037 #exec MESH SEQUENCE MESH=ImpactHandm SEQ=Shake STARTFRAME=12 NUMFRAMES=1 00038 #exec MESH SEQUENCE MESH=ImpactHandm SEQ=Still STARTFRAME=0 NUMFRAMES=1 00039 #exec MESHMAP SCALE MESHMAP=ImpactHandm X=0.06 Y=0.06 Z=0.12 00040 #exec MESHMAP SETTEXTURE MESHMAP=ImpactHandm NUM=1 TEXTURE=JImpPick1 00041 00042 #exec TEXTURE IMPORT NAME=IconHammer FILE=TEXTURES\HUD\WpnMpact.PCX GROUP="Icons" MIPS=OFF 00043 #exec TEXTURE IMPORT NAME=UseHammer FILE=TEXTURES\HUD\UseMpact.PCX GROUP="Icons" MIPS=OFF 00044 00045 #exec AUDIO IMPORT FILE="Sounds\ImpactHammer\impact-regularfire.WAV" NAME="ImpactFire" GROUP="ASMD" 00046 #exec AUDIO IMPORT FILE="Sounds\ImpactHammer\impact-altfireSTART.WAV" NAME="ImpactAltFireStart" GROUP="ASMD" 00047 #exec AUDIO IMPORT FILE="Sounds\ImpactHammer\impact-altfireRELEASE.WAV" NAME="ImpactAltFireRelease" GROUP="ASMD" 00048 #exec AUDIO IMPORT FILE="Sounds\ImpactHammer\impacthammerloop.WAV" NAME="ImpactLoop" GROUP="ASMD" 00049 #exec AUDIO IMPORT FILE="Sounds\ImpactHammer\impactpickup.WAV" NAME="ImpactPickup" GROUP="ASMD" 00050 00051 var float ChargeSize, Count; 00052 var() sound AltFireSound; 00053 var() sound TensionSound; 00054 00055 00056 function float RateSelf( out int bUseAltMode ) 00057 { 00058 local float EnemyDist; 00059 local bool bRetreating; 00060 local Pawn P; 00061 00062 bUseAltMode = 0; 00063 P = Pawn(Owner); 00064 00065 if ( (P == None) || (P.Enemy == None) ) 00066 return 0; 00067 00068 EnemyDist = VSize(P.Enemy.Location - Owner.Location); 00069 if ( (EnemyDist < 750) && P.IsA('Bot') && Bot(P).bNovice && (P.Skill <= 2) && !P.Enemy.IsA('Bot') && (ImpactHammer(P.Enemy.Weapon) != None) ) 00070 return FClamp(300/(EnemyDist + 1), 0.6, 0.75); 00071 00072 if ( EnemyDist > 400 ) 00073 return 0.1; 00074 if ( (P.Weapon != self) && (EnemyDist < 120) ) 00075 return 0.25; 00076 00077 return ( FMin(0.8, 81/(EnemyDist + 1)) ); 00078 } 00079 00080 function float SuggestAttackStyle() 00081 { 00082 return 10.0; 00083 } 00084 00085 function float SuggestDefenseStyle() 00086 { 00087 return -2.0; 00088 } 00089 00090 simulated function PlayPostSelect() 00091 { 00092 local Bot B; 00093 00094 if ( Level.NetMode == NM_Client ) 00095 { 00096 Super.PlayPostSelect(); 00097 return; 00098 } 00099 00100 B = Bot(Owner); 00101 00102 if ( (B != None) && (B.Enemy != None) ) 00103 { 00104 B.PlayFiring(); 00105 B.bFire = 1; 00106 B.bAltFire = 0; 00107 Fire(1.0); 00108 } 00109 } 00110 00111 simulated function bool ClientFire( float Value ) 00112 { 00113 if ( bCanClientFire ) 00114 { 00115 if ( (PlayerPawn(Owner) != None) 00116 && ((Level.NetMode == NM_Standalone) || PlayerPawn(Owner).Player.IsA('ViewPort')) ) 00117 { 00118 if ( InstFlash != 0.0 ) 00119 PlayerPawn(Owner).ClientInstantFlash( InstFlash, InstFog); 00120 PlayerPawn(Owner).ShakeView(ShakeTime, ShakeMag, ShakeVert); 00121 } 00122 if ( Affector != None ) 00123 Affector.FireEffect(); 00124 Owner.PlayOwnedSound(Misc1Sound, SLOT_Misc, 1.3*Pawn(Owner).SoundDampening); 00125 PlayAnim('Pull', 0.2, 0.05); 00126 if ( Role < ROLE_Authority ) 00127 GotoState('ClientFiring'); 00128 return true; 00129 } 00130 return false; 00131 } 00132 00133 function Fire( float Value ) 00134 { 00135 bPointing=True; 00136 bCanClientFire = true; 00137 ClientFire(Value); 00138 Pawn(Owner).PlayRecoil(FiringSpeed); 00139 GoToState('Firing'); 00140 } 00141 00142 function AltFire( float Value ) 00143 { 00144 bPointing=True; 00145 bCanClientFire = true; 00146 Pawn(Owner).PlayRecoil(FiringSpeed); 00147 TraceAltFire(); 00148 ClientAltFire(value); 00149 GoToState('AltFiring'); 00150 } 00151 00152 simulated function ClientWeaponEvent(name EventType) 00153 { 00154 if ( EventType == 'FireBlast' ) 00155 { 00156 PlayFiring(); 00157 GotoState('ClientFireBlast'); 00158 } 00159 } 00160 00161 simulated function PlayFiring() 00162 { 00163 if (Owner != None) 00164 { 00165 if ( Affector != None ) 00166 Affector.FireEffect(); 00167 Owner.PlayOwnedSound(FireSound, SLOT_Misc, 1.7*Pawn(Owner).SoundDampening,,,); 00168 if ( PlayerPawn(Owner) != None ) 00169 PlayerPawn(Owner).ShakeView(ShakeTime, ShakeMag, ShakeVert); 00170 PlayAnim( 'Fire', 0.65 ); 00171 } 00172 } 00173 00174 simulated function PlayAltFiring() 00175 { 00176 if (Owner != None) 00177 { 00178 if ( Affector != None ) 00179 Affector.FireEffect(); 00180 PlayOwnedSound(AltFireSound, SLOT_Misc, 1.7*Pawn(Owner).SoundDampening,,,); 00181 LoopAnim( 'Fire', 0.65); 00182 } 00183 } 00184 00185 state Firing 00186 { 00187 function AltFire(float F) 00188 { 00189 } 00190 00191 function Tick( float DeltaTime ) 00192 { 00193 local Pawn P; 00194 local Rotator EnemyRot; 00195 local vector HitLocation, HitNormal, StartTrace, EndTrace, X, Y, Z; 00196 local actor HitActor; 00197 00198 if ( bChangeWeapon ) 00199 GotoState('DownWeapon'); 00200 00201 if ( Bot(Owner) != None ) 00202 { 00203 if ( Bot(Owner).Enemy == None ) 00204 Bot(Owner).bFire = 0; 00205 else 00206 Bot(Owner).bFire = 1; 00207 } 00208 P = Pawn(Owner); 00209 if ( P == None ) 00210 { 00211 AmbientSound = None; 00212 GotoState(''); 00213 return; 00214 } 00215 else if( P.bFire==0 ) 00216 { 00217 TraceFire(0); 00218 PlayFiring(); 00219 GoToState('FireBlast'); 00220 return; 00221 } 00222 00223 ChargeSize += 0.75 * DeltaTime; 00224 00225 Count += DeltaTime; 00226 if ( Count > 0.2 ) 00227 { 00228 Count = 0; 00229 Owner.MakeNoise(1.0); 00230 } 00231 if (ChargeSize > 1) 00232 { 00233 if ( !P.IsA('PlayerPawn') && (P.Enemy != None) ) 00234 { 00235 EnemyRot = Rotator(P.Enemy.Location - P.Location); 00236 EnemyRot.Yaw = EnemyRot.Yaw & 65535; 00237 if ( (abs(EnemyRot.Yaw - (P.Rotation.Yaw & 65535)) > 8000) 00238 && (abs(EnemyRot.Yaw - (P.Rotation.Yaw & 65535)) < 57535) ) 00239 return; 00240 GetAxes(EnemyRot,X,Y,Z); 00241 } 00242 else 00243 GetAxes(P.ViewRotation, X, Y, Z); 00244 StartTrace = P.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z; 00245 if ( (Level.NetMode == NM_Standalone) && P.IsA('PlayerPawn') ) 00246 EndTrace = StartTrace + 25 * X; 00247 else 00248 EndTrace = StartTrace + 60 * X; 00249 HitActor = Trace(HitLocation, HitNormal, EndTrace, StartTrace, true); 00250 if ( (HitActor != None) && (HitActor.DrawType == DT_Mesh) ) 00251 { 00252 ProcessTraceHit(HitActor, HitLocation, HitNormal, vector(AdjustedAim), Y, Z); 00253 PlayFiring(); 00254 GoToState('FireBlast'); 00255 } 00256 } 00257 } 00258 00259 function BeginState() 00260 { 00261 ChargeSize = 0.0; 00262 Count = 0.0; 00263 } 00264 00265 function EndState() 00266 { 00267 Super.EndState(); 00268 AmbientSound = None; 00269 } 00270 00271 Begin: 00272 FinishAnim(); 00273 AmbientSound = TensionSound; 00274 SoundVolume = 255*Pawn(Owner).SoundDampening; 00275 LoopAnim('Shake', 0.9); 00276 } 00277 00278 state ClientFiring 00279 { 00280 simulated function AnimEnd() 00281 { 00282 AmbientSound = TensionSound; 00283 SoundVolume = 255*Pawn(Owner).SoundDampening; 00284 LoopAnim('Shake', 0.9); 00285 Disable('AnimEnd'); 00286 } 00287 } 00288 00289 state FireBlast 00290 { 00291 function Fire(float F) 00292 { 00293 } 00294 function AltFire(float F) 00295 { 00296 } 00297 00298 Begin: 00299 if ( (Level.NetMode != NM_Standalone) && Owner.IsA('PlayerPawn') 00300 && (ViewPort(PlayerPawn(Owner).Player) == None) ) 00301 PlayerPawn(Owner).ClientWeaponEvent('FireBlast'); 00302 FinishAnim(); 00303 Finish(); 00304 } 00305 00306 state ClientFireBlast 00307 { 00308 simulated function bool ClientFire(float Value) 00309 { 00310 return false; 00311 } 00312 00313 simulated function bool ClientAltFire(float Value) 00314 { 00315 return false; 00316 } 00317 00318 simulated function AnimEnd() 00319 { 00320 if ( Pawn(Owner) == None ) 00321 { 00322 PlayIdleAnim(); 00323 GotoState(''); 00324 } 00325 else if ( !bCanClientFire ) 00326 GotoState(''); 00327 else if ( Pawn(Owner).bFire != 0 ) 00328 Global.ClientFire(0); 00329 else if ( Pawn(Owner).bAltFire != 0 ) 00330 Global.ClientAltFire(0); 00331 else 00332 { 00333 PlayIdleAnim(); 00334 GotoState(''); 00335 } 00336 } 00337 } 00338 00339 function TraceFire(float accuracy) 00340 { 00341 local vector HitLocation, HitNormal, StartTrace, EndTrace, X, Y, Z; 00342 local actor Other; 00343 00344 Owner.MakeNoise(Pawn(Owner).SoundDampening); 00345 GetAxes(Pawn(owner).ViewRotation, X, Y, Z); 00346 StartTrace = Owner.Location + CalcDrawOffset() + FireOffset.Y * Y + FireOffset.Z * Z; 00347 AdjustedAim = pawn(owner).AdjustAim(1000000, StartTrace, AimError, False, False); 00348 EndTrace = StartTrace + 120.0 * vector(AdjustedAim); 00349 Other = Pawn(Owner).TraceShot(HitLocation, HitNormal, EndTrace, StartTrace); 00350 ProcessTraceHit(Other, HitLocation, HitNormal, vector(AdjustedAim), Y, Z); 00351 } 00352 00353 function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z) 00354 { 00355 if ( (Other == None) || (Other == Owner) || (Other == self) || (Owner == None)) 00356 return; 00357 00358 ChargeSize = FMin(ChargeSize, 1.5); 00359 if ( (Other == Level) || Other.IsA('Mover') ) 00360 { 00361 ChargeSize = FMax(ChargeSize, 1.0); 00362 if ( VSize(HitLocation - Owner.Location) < 80 ) 00363 Spawn(class'ImpactMark',,, HitLocation+HitNormal, Rotator(HitNormal)); 00364 Owner.TakeDamage(36.0, Pawn(Owner), HitLocation, -69000.0 * ChargeSize * X, MyDamageType); 00365 } 00366 if ( Other != Level ) 00367 { 00368 if ( Other.bIsPawn && (VSize(HitLocation - Owner.Location) > 90) ) 00369 return; 00370 Other.TakeDamage(60.0 * ChargeSize, Pawn(Owner), HitLocation, 66000.0 * ChargeSize * X, MyDamageType); 00371 if ( !Other.bIsPawn && !Other.IsA('Carcass') ) 00372 spawn(class'UT_SpriteSmokePuff',,,HitLocation+HitNormal*9); 00373 } 00374 } 00375 00376 function TraceAltFire() 00377 { 00378 local vector HitLocation, HitNormal, StartTrace, EndTrace, X, Y, Z; 00379 local actor Other; 00380 local Projectile P; 00381 local float speed; 00382 00383 Owner.MakeNoise(Pawn(Owner).SoundDampening); 00384 GetAxes(Pawn(owner).ViewRotation, X, Y, Z); 00385 StartTrace = Owner.Location + CalcDrawOffset() + FireOffset.X * X + FireOffset.Y * Y + FireOffset.Z * Z; 00386 AdjustedAim = pawn(owner).AdjustAim(1000000, StartTrace, AimError, False, False); 00387 EndTrace = StartTrace + 180 * vector(AdjustedAim); 00388 Other = Pawn(Owner).TraceShot(HitLocation, HitNormal, EndTrace, StartTrace); 00389 ProcessAltTraceHit(Other, HitLocation, HitNormal, vector(AdjustedAim), Y, Z); 00390 00391 // push aside projectiles 00392 ForEach VisibleCollidingActors(class'Projectile', P, 550, Owner.Location) 00393 if ( ((P.Physics == PHYS_Projectile) || (P.Physics == PHYS_Falling)) 00394 && (Normal(P.Location - Owner.Location) Dot X) > 0.9 ) 00395 { 00396 P.speed = VSize(P.Velocity); 00397 if ( P.Velocity Dot Y > 0 ) 00398 P.Velocity = P.Speed * Normal(P.Velocity + (750 - VSize(P.Location - Owner.Location)) * Y); 00399 else 00400 P.Velocity = P.Speed * Normal(P.Velocity - (750 - VSize(P.Location - Owner.Location)) * Y); 00401 } 00402 } 00403 00404 function ProcessAltTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z) 00405 { 00406 local vector realLoc; 00407 local float scale; 00408 00409 if ( (Other == None) || (Other == Owner) || (Other == self) || (Owner == None) ) 00410 return; 00411 00412 realLoc = Owner.Location + CalcDrawOffset(); 00413 scale = VSize(realLoc - HitLocation)/180; 00414 if ( (Other == Level) || Other.IsA('Mover') ) 00415 { 00416 Owner.TakeDamage(24.0 * scale, Pawn(Owner), HitLocation, -40000.0 * X * scale, MyDamageType); 00417 } 00418 else 00419 { 00420 Other.TakeDamage(20 * scale, Pawn(Owner), HitLocation, 30000.0 * X * scale, MyDamageType); 00421 if ( !Other.bIsPawn && !Other.IsA('Carcass') ) 00422 spawn(class'UT_SpriteSmokePuff',,,HitLocation+HitNormal*9); 00423 } 00424 } 00425 00426 simulated function PlayIdleAnim() 00427 { 00428 local Bot B; 00429 00430 B = Bot(Owner); 00431 00432 if ( (B != None) && (B.Enemy != None) ) 00433 { 00434 B.PlayFiring(); 00435 B.bFire = 1; 00436 B.bAltFire = 0; 00437 Fire(1.0); 00438 } 00439 else if ( Mesh != PickupViewMesh ) 00440 TweenAnim( 'Still', 1.0); 00441 } 00442 00443 defaultproperties 00444 { 00445 AltFireSound=Sound'Botpack.ASMD.ImpactFire' 00446 TensionSound=Sound'Botpack.ASMD.ImpactLoop' 00447 WeaponDescription="Classification: Melee Piston\n\nPrimary Fire: When trigger is held down, touch opponents with this piston to inflict massive damage.\n\nSecondary Fire: Damages opponents at close range and has the ability to deflect projectiles.\n\nTechniques: Shoot at the ground while jumping to jump extra high." 00448 InstFog=(X=475.000000,Y=325.000000,Z=145.000000) 00449 bMeleeWeapon=True 00450 bRapidFire=True 00451 MyDamageType=impact 00452 RefireRate=1.000000 00453 AltRefireRate=1.000000 00454 FireSound=Sound'Botpack.ASMD.ImpactAltFireRelease' 00455 SelectSound=Sound'Botpack.ASMD.ImpactPickup' 00456 Misc1Sound=Sound'Botpack.ASMD.ImpactAltFireStart' 00457 DeathMessage="%o got smeared by %k's piston." 00458 NameColor=(G=192,B=0) 00459 PickupMessage="You got the Impact Hammer." 00460 ItemName="Impact Hammer" 00461 PlayerViewOffset=(X=3.800000,Y=-1.600000,Z=-1.800000) 00462 PlayerViewMesh=LodMesh'Botpack.ImpactHammer' 00463 PickupViewMesh=LodMesh'Botpack.ImpPick' 00464 ThirdPersonMesh=LodMesh'Botpack.ImpactHandm' 00465 StatusIcon=Texture'Botpack.Icons.UseHammer' 00466 PickupSound=Sound'UnrealShare.Pickups.WeaponPickup' 00467 Icon=Texture'Botpack.Icons.UseHammer' 00468 Mesh=LodMesh'Botpack.ImpPick' 00469 bNoSmooth=False 00470 SoundRadius=50 00471 SoundVolume=200 00472 }