Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |
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 |
/** * Copyright 1998-2007 Epic Games, Inc. All Rights Reserved. */ class UTVWeap_ShockTurretBase extends UTVehicleWeapon HideDropDown; /** This array holds the list of current balls available */ var array<UTProj_VehicleShockBallBase> ShockBalls; /** This is the mininum aim variance for auto aiming */ var float MinAim; /** AI flag - set by shock ball that reaches target to tell bot to do the combo */ var bool bDoCombo; /** shock ball bot will shoot at when it wants to do the combo */ var UTProj_ShockBall ComboTarget; function byte BestMode() { local UTBot B; if (bDoCombo && ComboTarget != None && !ComboTarget.bDeleteMe) { B = UTBot(Instigator.Controller); if (B == None || B.Enemy == None || B.Enemy != B.Focus || B.LineOfSightTo(B.Enemy)) { return 1; } else { return 0; } } else { return 0; } } simulated function Rotator GetAdjustedAim(vector StartFireLoc) { // if ready to combo, aim at shockball if (UTBot(Instigator.Controller) != None && CurrentFireMode == 1 && bDoCombo && ComboTarget != None && !ComboTarget.bDeleteMe) { return rotator(ComboTarget.Location - StartFireLoc); } else { return Super.GetAdjustedAim(StartFireLoc); } } function SetComboTarget(UTProj_ShockBall ShockBall) { if (UTBot(Instigator.Controller) != None && Instigator.Controller.Enemy != None) { ComboTarget = ShockBall; ShockBall.Monitor(Instigator.Controller.Enemy); } } simulated function Projectile ProjectileFire() { local UTProj_VehicleShockBallBase SB; local vector VelDir; // Add it to the array to track SB = UTProj_VehicleShockBallBase(Super.ProjectileFire()); if (SB!=none) { ShockBalls[ShockBalls.Length] = SB; AimingTraceIgnoredActors[AimingTraceIgnoredActors.length] = SB; SB.InstigatorWeapon = self; SetComboTarget(SB); if ( (MyVehicle.Velocity dot SB.Velocity) > 0 ) { // increase shock ball velocity based on momentum imparted by vehicle VelDir = Normal(SB.Velocity); SB.Velocity = VelDir * (SB.Speed + 0.5*(MyVehicle.Velocity dot VelDir)); } } return SB; } /** * We override InstantFire (copied from UTVehicle) and adjust the endtrace if there is a good shockball * to combo against */ simulated function InstantFire() { local vector StartTrace, EndTrace; local array<ImpactInfo> ImpactsList; local int Idx, x; local ImpactInfo RealImpact; local float BestAim, CurAim; local vector WeaponAim; local UTProj_ShockBall BestProj; // define range to use for CalcWeaponFire() StartTrace = MyVehicle.GetPhysicalFireStartLoc(self); WeaponAim = vector(MyVehicle.GetWeaponAim(self)); EndTrace = StartTrace + WeaponAim * GetTraceRange(); // Look to see if there is a ShockBall to auto-aim at BestAim = MinAim; for (x=0; x < ShockBalls.Length; x++) { // Remove old entries if (ShockBalls[x] == None) { ShockBalls.Remove(x,1); x--; } else { // Who is the best case CurAim = Normal(ShockBalls[x].Location - StartTrace) dot WeaponAim; if (CurAim > BestAim) { BestAim = CurAim; BestProj = ShockBalls[x]; } } } // If we found one, set the trace if (BestProj != None) { EndTrace = BestProj.Location; bDoCombo = false; } // Perform shot RealImpact = CalcWeaponFire( StartTrace, EndTrace, ImpactsList ); // Set flash location to trigger client side effects. // if HitActor == None, then HitLocation represents the end of the trace (maxrange) // Remote clients perform another trace to retrieve the remaining Hit Information (HitActor, HitNormal, HitInfo...) // Here, The final impact is replicated. More complex bullet physics (bounce, penetration...) // would probably have to run a full simulation on remote clients. SetFlashLocation( RealImpact.HitLocation ); // Process all Instant Hits on local player and server (gives damage, spawns any effects). for( Idx=0; Idx<ImpactsList.Length; Idx++ ) { ProcessInstantHit( CurrentFireMode, ImpactsList[Idx] ); } } defaultproperties { MinAim=0.925000 FireTriggerTags(0)="ShockTurretFire" AltFireTriggerTags(0)="ShockTurretAltFire" DefaultImpactEffect=(Sound=SoundCue'A_Weapon_ShockRifle.Cue.A_Weapon_SR_AltFireImpactCue',ParticleTemplate=ParticleSystem'VH_Hellbender.Effects.P_VH_Hellbender_PrimeImpact') bFastRepeater=True WeaponFireSnd(0)=SoundCue'A_Vehicle_Hellbender.SoundCues.A_Vehicle_Hellbender_BallFire' WeaponFireSnd(1)=SoundCue'A_Vehicle_Hellbender.SoundCues.A_Vehicle_Hellbender_BeamFire' AimingHelpRadius(0)=0.000000 AimingHelpRadius(1)=0.000000 WeaponFireTypes(0)=EWFT_Projectile FireInterval(0)=0.400000 FireInterval(1)=0.750000 InstantHitDamage(1)=25.000000 bInstantHit=True Begin Object Class=UTSkeletalMeshComponent Name=FirstPersonMesh ObjName=FirstPersonMesh Archetype=UTSkeletalMeshComponent'UTGame.Default__UTVehicleWeapon:FirstPersonMesh' ObjectArchetype=UTSkeletalMeshComponent'UTGame.Default__UTVehicleWeapon:FirstPersonMesh' End Object Mesh=FirstPersonMesh Begin Object Class=SkeletalMeshComponent Name=PickupMesh ObjName=PickupMesh Archetype=SkeletalMeshComponent'UTGame.Default__UTVehicleWeapon:PickupMesh' ObjectArchetype=SkeletalMeshComponent'UTGame.Default__UTVehicleWeapon:PickupMesh' End Object DroppedPickupMesh=PickupMesh PickupFactoryMesh=PickupMesh Name="Default__UTVWeap_ShockTurretBase" ObjectArchetype=UTVehicleWeapon'UTGame.Default__UTVehicleWeapon' } |
Overview | Package | Class | Source | Class tree | Glossary | UnrealScript Documentation |
previous class next class | frames no frames |