## XIDMaps
Class USA02HelicoBossController

source: C:\XIII\XIDMaps\Classes\USA02HelicoBossController.uc

    Core.Object
       |
       +--Engine.Actor
          |
          +--Engine.Controller
             |
             +--Engine.AIController
                |
                +--XIDMaps.USA02HelicoBossController

Direct Known Subclasses:None

class USA02HelicoBossController
extends Engine.AIController

    //-----------------------------------------------------------
    //
    //-----------------------------------------------------------

Variables
`Trail` | `BT` BulletTrail once spawned to handle update
`Vector` | `BTEndLocation` To make traces accurate
`int` | `BossState` memory of the boss current action
`USA02HelicoBossPoint` | `CrashPoint` The location the HCrash effect must be made
`BulletScorch` | `DecalProjector` projector to update (to avoid spawn each time)
`class` | `DecalProjectorClass` Visual Impact to leave on geometry
`float` | `DefaultFiringTimer` Duration of MachineGunning phase
`USA02HelicoBossPoint` | `EndPoint` The location the HExplo effect must be made
`float` | `FiringTimer` Duration of MachineGunning phase
`float` | `MinAcquisitionTime` min time before lock-on for firing missiles
`USA02HelicoMuzzleFlash` | `Muzzle` The muzzleflash for machine gun
`class` | `MyDamageType` Damage type for machinegun
`NavPoint1,` | `NavPoint2` The points making a line we must stay on
`class` | `TraceClass` Class of BulletTrace to spawn
`Array` | `UnsafePoints` To make traces accurate
`vector` | `VMACHINEGUNOFFSET` min time before lock-on for firing missiles
`vector` | `VMISSILEOFFSET` min time before lock-on for firing missiles
`XIIIPawn` | `XIII` Our main target
`bool` | `bExploDone` to make HExplo only once
`bool` | `bHaveSeenXIII` used to force the boss to advance on his rail until he see XIII
`bool` | `bStabiliteEntreTirs` To make traces accurate
`bool` | `bTrace` to make HExplo only once
`float` | `fEndRotationFactor` to make Helico spin on himself progressivly
`float` | `fLocationFactor` percent of our potential target location on the rail
`float` | `fStabilityBeforeMissileDelay` duration of stability for firing missile aquisition.
`sound` | `hBeginFightMusic` min time before lock-on for firing missiles
`sound` | `hDestructsound` min time before lock-on for firing missiles
`sound` | `hFireSound` firing sound for machinegun
`sound` | `hHelicoTouchMusic` min time before lock-on for firing missiles
`sound` | `hMissileFireSound` firing sound for missiles
`sound` | `hSnapShotSound` min time before lock-on for firing missiles
`vector` | `vFiringLocation` target for missile
`vector` | `vFocalPointOffset` to change this before firing

States
EndOfMe, MachineGunPhase, FiringMissilePhase, AcquisitionPhase

Function Summary
`bool` | `CheckUnsafePoints()`
`void` | `NotifyTakeDamage()`
    //_____________________________________________________________________________

State EndOfMe Function Summary

State MachineGunPhase Function Summary
`void` | `ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z)`
`void` | `FireMachinegun()`

State FiringMissilePhase Function Summary

State AcquisitionPhase Function Summary

Source Code

    00001	//-----------------------------------------------------------
    00002	//
    00003	//-----------------------------------------------------------
    00004	class USA02HelicoBossController extends AIController;
    00005
    00006	var bool bHaveSeenXIII;             // used to force the boss to advance on his rail until he see XIII
    00007	var bool bExploDone;                // to make HExplo only once
    00008	var bool bTrace;
    00009
    00010	var XIIIPawn XIII;                  // Our main target
    00011	var USA02HelicoBossPoint NavPoint1, NavPoint2;  // The points making a line we must stay on
    00012	var USA02HelicoBossPoint EndPoint;  // The location the HExplo effect must be made
    00013	var USA02HelicoBossPoint CrashPoint;// The location the HCrash effect must be made
    00014
    00015	var float fLocationFactor;          // percent of our potential target location on the rail
    00016	var int BossState;                  // memory of the boss current action
    00017	var vector vFocalPointOffset;       // to change this before firing
    00018	var vector vFiringLocation;         // target for missile
    00019	var float FiringTimer;              // Duration of MachineGunning phase
    00020	var() float DefaultFiringTimer;           // Duration of MachineGunning phase
    00021	var() float fStabilityBeforeMissileDelay; // duration of stability for firing missile aquisition.
    00022	var float fEndRotationFactor;       // to make Helico spin on himself progressivly
    00023
    00024	var sound hFireSound;               // firing sound for machinegun
    00025	var sound hMissileFireSound;        // firing sound for missiles
    00026	var class<BulletScorch> DecalProjectorClass;// Visual Impact to leave on geometry
    00027	var BulletScorch DecalProjector;              // projector to update (to avoid spawn each time)
    00028	var class<DamageType> MyDamageType; // Damage type for machinegun
    00029
    00030	var USA02HelicoMuzzleFlash Muzzle;  // The muzzleflash for machine gun
    00031
    00032	var() float MinAcquisitionTime;     // min time before lock-on for firing missiles
    00033
    00034	var const vector VMACHINEGUNOFFSET;
    00035	var const vector VMISSILEOFFSET;
    00036
    00037	var sound hBeginFightMusic;
    00038	var sound hHelicoTouchMusic;
    00039	var sound hSnapShotSound;
    00040	var sound hDestructsound;
    00041
    00042	var class<Trail> TraceClass;    // Class of BulletTrace to spawn
    00043	var Trail BT;                   // BulletTrail once spawned to handle update
    00044	var Vector BTEndLocation;       // To make traces accurate
    00045
    00046	var bool bStabiliteEntreTirs;
    00047
    00048	VAR Array<PositionInfo> UnsafePoints;
    00049
    00050	// BossState ==
    00051	  // -1 = Initialisation, wait for Cartoon window sfx
    00052	  // 0 = After Init
    00053	  // 1,3 = AcquireforMissile 1 & 2
    00054	  // 2,4 = PrepareMissile 1 & 2
    00055	  // 5 = Acquire for MachineGun
    00056	  // 6 = Firing Machinegun
    00057	  // 7 = End of Me (before explo)
    00058	  // 8 = Very End of me (after explo, before crash)
    00059
    00060	//_____________________________________________________________________________
    00061	event PostBeginPlay()
    00062	{
    00063		LOCAL PositionInfo pi;
    00064
    00065	    DebugLog("\ HelicoBoss -- PostBeginPlay");
    00066		//Pawn.PlaySound(hBeginFightSound);
    00067		PlayMusic(hBeginFightMusic);
    00068	    BossState = -1;
    00069	    XIII = XIIIPlayerPawn(XIIIGameInfo(Level.Game).Mapinfo.XIIIpawn);
    00070	    SetTimer(1.5, true);
    00071	    Pawn.AirSpeed = 10000.0;
    00072
    00073		foreach DynamicActors(class'PositionInfo',pi,'HiddenXIII')
    00074		{
    00075			LOG( "UNSAFE POINT :"@pi );
    00076			UnsafePoints.Insert(0,1);
    00077			UnsafePoints[0]=pi;
    00078		}
    00079	}
    00080
    00081	FUNCTION bool CheckUnsafePoints()
    00082	{
    00083		LOCAL int i;
    00084		LOCAL Vector v;
    00085
    00086		for ( i=0; i<UnsafePoints.Length; i++ )
    00087		{
    00088			v=(UnsafePoints[i].Location-XIII.Location);
    00089			v.Z=0;
    00090			if ( vSize(v)<UnsafePoints[i].CollisionRadius )
    00091				return true;
    00092		}
    00093		return false;
    00094	}
    00095
    00096	//_____________________________________________________________________________
    00097	event Tick(float dT)
    00098	{
    00099	    // Move there
    00100	//    DebugLog("\ HelicoBoss -- Tick");
    00101		//log(self@" ---> STABILITE OR NOT :"@bStabiliteEntreTirs);
    00102		if ( CheckUnsafePoints() )
    00103			SeePlayer(XIII);
    00104		if ( !bStabiliteEntreTirs )
    00105			Pawn.Acceleration = 0.25*(Destination - Pawn.Location)/dT*0.5;
    00106		else
    00107			Pawn.Acceleration = 0.25*(Destination - Pawn.Location)/dT*0.01;
    00108	    FocalPoint = (FocalPoint * 5.0 + XIII.Location + vFocalPointOffset)/6.0;
    00109	}
    00110
    00111	//_____________________________________________________________________________
    00112	event Timer()
    00113	{
    00114	    local vector vT, vT2;
    00115
    00116	    if ( Muzzle == none )
    00117	    {
    00118	      if ( Pawn != none )
    00119	      {
    00120	        Muzzle = Spawn(class'USA02HelicoMuzzleFlash',Pawn);
    00121	        Muzzle.SetBase(Pawn);
    00122	        Muzzle.SetRelativeLocation(-VMACHINEGUNOFFSET*DrawScale);
    00123	        Muzzle.SetRelativeRotation(rot(0,0,0));
    00124	      }
    00125	    }
    00126	    if ( !bHaveSeenXIII )
    00127	    {
    00128	      fLocationFactor = 0.1;
    00129	      Destination = NavPoint2.Location*fLocationFactor + NavPoint1.Location*(1.0-fLocationFactor);
    00130	      return;
    00131	    }
    00132	    else
    00133	    {
    00134	      vT = NavPoint2.Location*fLocationFactor + NavPoint1.Location*(1.0-fLocationFactor);
    00135	      vT2 = normal(FocalPoint - Pawn.Location);
    00136	  //      DebugLog("\ HelicoBoss -- Dist="$vSize(vT-XIII.Location)@"fLocationFactor="$fLocationFactor);
    00137	      if ( (vSize(vT-XIII.Location) < 1700) || (vT2.Z < -0.7) )
    00138	      { // must change fLocationfactor to increase medium distance between XIII and my pawn
    00139	        if ( (NavPoint2.Location - NavPoint1.Location) dot (XIII.location - vT) < 0 )
    00140	        {
    00141	          DebugLog("\            -- INC fLocationFactor");
    00142	          fLocationFactor += 0.1;
    00143	          if ( fLocationFactor > 1.0 )
    00144	            fLocationFactor = 0.3;
    00145	        }
    00146	        else
    00147	        {
    00148	          DebugLog("\            -- DEC fLocationFactor");
    00149	          fLocationFactor -= 0.1;
    00150	          if ( fLocationFactor < 0.0 )
    00151	            fLocationFactor = 0.7;
    00152	        }
    00153	      }
    00154	      else if ( vSize(vT-XIII.Location) > 3200 )
    00155	      {
    00156	        if ( (NavPoint2.Location - NavPoint1.Location) dot (XIII.location - vT) > 0 )
    00157	        {
    00158	          DebugLog("\            -- INC fLocationFactor");
    00159	          fLocationFactor += 0.1;
    00160	          if ( fLocationFactor > 1.0 )
    00161	            fLocationFactor = 1.0;
    00162	        }
    00163	        else
    00164	        {
    00165	          DebugLog("\            -- DEC fLocationFactor");
    00166	          fLocationFactor -= 0.1;
    00167	          if ( fLocationFactor < 0.0 )
    00168	            fLocationFactor = 0.0;
    00169	        }
    00170	      }
    00171	    }
    00172
    00173	    // Update Destination there ?
    00174	    Destination = NavPoint2.Location*fLocationFactor + NavPoint1.Location*(1.0-fLocationFactor);
    00175	    Destination += vect(0,0,1)*(fRand()-0.5)*NavPoint1.CollisionHeight;
    00176	    Destination += vect(1,0,0)*(fRand()-0.5)*NavPoint1.CollisionRadius;
    00177	    Destination += vect(0,1,0)*(fRand()-0.5)*NavPoint1.CollisionRadius;
    00178	}
    00179
    00180	//_____________________________________________________________________________
    00181	singular event SeePlayer(pawn Seen)
    00182	{
    00183	    //local CWndUSA02BossIntro CWnd;
    00184
    00185	//    DebugLog("\ HelicoBoss -- SeePlayer BossState="$BossState);
    00186	    if ( BossState == -1 ) // add Cartoon window
    00187	    {
    00188	      /*Level.Game.SetGameSpeed(0.1);
    00189	      CWnd = Spawn(class'CWndUSA02BossIntro', Pawn);
    00190	      if (CWnd != none)
    00191	        CWnd.MyHudForFX = XIIIBaseHUD(XIIIPlayerController(XIII.controller).MyHud);*/
    00192	      BossState ++;
    00193	      bHaveSeenXIII = true;
    00194	      Pawn.AirSpeed = Pawn.Default.AirSpeed;
    00195	    }
    00196	    else if ( (BossState == 0) || (BossState == 2) )
    00197	    {
    00198	      GotoState('AcquisitionPhase');
    00199	    }
    00200	    else if ( BossState == 4 )
    00201	    {
    00202	      GotoState('MachineGunPhase');
    00203	    }
    00204	}
    00205
    00206	//_____________________________________________________________________________
    00207	function NotifyTakeDamage()
    00208	{
    00209		// gestion du son à chaque fois que l helico est touche
    00210		PlayMusic(hHelicoTouchMusic);
    00211		Pawn.PlaySound(hSnapShotSound);
    00212	}
    00213
    00214	//_____________________________________________________________________________
    00215	state AcquisitionPhase
    00216	{
    00217	    event BeginState()
    00218	    {
    00219	      //DebugLog("\ HelicoBoss -AcquisitionPhase BeginState");
    00220
    00221		  //Pawn.Acceleration *= 0.2;
    00222	      SetTimer2(MinAcquisitionTime, false);
    00223	    }
    00224	    singular event SeePlayer(pawn Seen)
    00225	    {
    00226	      if ( (BossState == 1) || (BossState == 3) )
    00227	      { // Prepare to launch missile
    00228	        vFiringLocation = Seen.Location - Seen.CollisionHeight*vect(0,0,0.5);
    00229	        GotoState('FiringMissilePhase');
    00230	      }
    00231	    }
    00232	    event Timer2()
    00233	    {
    00234	      //DebugLog("\ HelicoBoss -- Timer2 BossState="$BossState);
    00235
00236 if ( (BossState == 0) || (BossState == 2) ) 00237 BossState ++; 00238 } 00239 } 00240 00241 //_____________________________________________________________________________ 00242 state FiringMissilePhase 00243 { 00244 event BeginState() 00245 { 00246 //DebugLog("\ HelicoBoss -FiringMissilePhase BeginState BossState="$BossState); 00247 00248 vFocalPointOffset = vect(0,0,0); 00249 Pawn.AirSpeed = 20.0; 00250 SetTimer2(fStabilityBeforeMissileDelay, false); 00251 } 00252 event EndState() 00253 { 00254 Pawn.AirSpeed = Pawn.Default.AirSpeed; 00255 } 00256 event Timer2() 00257 { 00258 // Local USA02HelicoMissile MyMissile; 00259 Local USA02HelicoMissileSpawnEmitter Emit; 00260 local vector X,Y,Z; 00261 00262 GetAxes(Pawn.Rotation, X,Y,Z); 00263 00264 /* MyMissile = */ 00265 Spawn(class'USA02HelicoMissile', pawn,, Pawn.Location - X*VMISSILEOFFSET.X*DrawScale - Z*VMISSILEOFFSET.Z*DrawScale + (BossState-2)*Y*VMISSILEOFFSET.Y*DrawScale, rotator(vFiringLocation - Pawn.Location)); 00266 Emit = Spawn(class'USA02HelicoMissileSpawnEmitter', none,, Pawn.Location - X*VMISSILEOFFSET.X*DrawScale - Z*VMISSILEOFFSET.Z*DrawScale + (BossState-2)*Y*VMISSILEOFFSET.Y*DrawScale, rotator(-vFiringLocation + Pawn.Location)); 00267 // Emit.SetBase(Pawn); 00268 // Emit.SetRelativeLocation(vect(-1,0,0)*VMISSILEOFFSET.X*DrawScale + vect(0,0,-1)*VMISSILEOFFSET.Z*DrawScale + vect(0,1,0)*(BossState-2)*VMISSILEOFFSET.Y*DrawScale); 00269 // Emit.SetRelativeRotation(rot(0,32768,0)); 00270 PlayFiringSound(); 00271 BossState ++; 00272 vFocalPointOffset = default.vFocalPointOffset; 00273 if (BossState == 2) 00274 bStabiliteEntreTirs = true; 00275 else 00276 bStabiliteEntreTirs = false; 00277 GotoState(''); 00278 } 00279 simulated function PlayFiringSound() 00280 { 00281 Pawn.MakeNoise(1.0); 00282 Pawn.PlaySound(hMissileFireSound, 0, 0); 00283 } 00284 } 00285 00286 //_____________________________________________________________________________ 00287 state MachineGunPhase 00288 { 00289 event SeePlayer(Pawn Seen); 00290 event Timer3 () 00291 { 00292 if ( bTrace ) 00293 { 00294 if (BT == none) 00295 { 00296 BT = Spawn(TraceClass,Pawn,,Location, Pawn.Rotation); 00297 BT.Instigator = Pawn; 00298 BT.ActorOffset = -(VMACHINEGUNOFFSET.X*vect(1,0,0) + vect(0,0,1)*VMACHINEGUNOFFSET.Z)/1.2; 00299 BT.Init(); 00300 } 00301 if ( BT != none ) 00302 { 00303 BT.Reset(); 00304 BT.RibbonColor = BT.default.RibbonColor * fRand(); 00305 BT.OutlineColor = BT.default.OutlineColor * fRand(); 00306 BT.SetDrawType(DT_Trail); 00307 // Add sections to draw bullet traces 00308 BT.AddSection(BTEndLocation); 00309 BT.AddSection(BT.Location); 00310 } 00311 bTrace = false; 00312 SetTimer3(0.5, true); 00313 } 00314 else 00315 { // bullet traces should be reseted often to avoid presence in lot of Leaves & crash the engine 00316 if ( BT != none ) 00317 { 00318 BT.SetDrawType(DT_None); 00319 BT.Reset(); 00320 } 00321 SetTimer3(1.0+fRand(), true); 00322 } 00323 } 00324 function FireMachinegun() 00325 { 00326 local vector HitLocation, HitNormal, StartTrace, EndTrace, X,Y,Z; 00327 local material HitMat; 00328 local actor Other; 00329 00330 GetAxes(Pawn.Rotation,X,Y,Z); 00331 StartTrace = Pawn.Location + 100*VRand() - X*VMACHINEGUNOFFSET.X - Z*VMACHINEGUNOFFSET.Z; 00332 EndTrace = StartTrace + (10000 * X); 00333 // EndTrace += vRand() * fRand() * (TraceAccuracy/100.0) * TraceDist; 00334 Other = Trace(HitLocation,HitNormal,EndTrace,StartTrace,True,vect(0,0,0),HitMat,TRACETYPE_DiscardIfCanShootThroughWithRayCastingWeapon); 00335 Muzzle.Flash(); 00336 ProcessTraceHit(Other, HitLocation, HitNormal, X,Y,Z); 00337 } 00338 function ProcessTraceHit(Actor Other, Vector HitLocation, Vector HitNormal, Vector X, Vector Y, Vector Z) 00339 { 00340 Local int ActualDamages; 00341 // local XIIITrajectoireBalle xtb; 00342 // local vector DepartTrajectoire; 00343 local ImpactEmitter B; 00344 00345 PlayFiringSound(); 00346 00347 // DepartTrajectoire = Pawn.Location - VMACHINEGUNOFFSET.X*X - Z*VMACHINEGUNOFFSET.Z; 00348 // xtb=Spawn(class'XIIITrajectoireBalle',self,,DepartTrajectoire,rotator(HitLocation-DepartTrajectoire)); //Instigator.GetViewRotation()); 00349 // xtb.Longueur= VSize(HitLocation-DepartTrajectoire); 00350 bTrace = true; 00351 BTEndLocation = HitLocation; 00352 Timer3(); 00353 00354 00355 if ( Other == None ) 00356 return; 00357 00358 ActualDamages = 25; 00359 00360 if ( ActualDamages <= 0) 00361 return; 00362 00363 if ( Other.bWorldGeometry ) 00364 { 00365 B = Spawn(class'BulletDustEmitter',,, HitLocation+HitNormal, Rotator(HitNormal)); 00366 if (B!=none) 00367 B.NoiseMake(Pawn, 0.4); 00368 if ( (DecalProjectorClass != None) && (Level.NetMode != NM_DedicatedServer) ) 00369 { 00370 if ( DecalProjector == none ) 00371 { 00372 DecalProjector = Spawn(DecalProjectorClass,self,,HitLocation + HitNormal, rotator(X-HitNormal)); 00373 } 00374 else 00375 { 00376 DecalProjector.SetLocation( HitLocation + HitNormal ); 00377 DecalProjector.SetRotation( rotator(X-HitNormal) ); 00378 DecalProjector.UpdateScorch(); 00379 } 00380 } 00381 } 00382 else if ( (Other != self) && (Other != Pawn) && (Other != Owner) ) 00383 { 00384 Other.TakeDamage(ActualDamages, Pawn, HitLocation, 30000.0*X, MyDamageType); 00385 if ( Pawn(Other)!=none ) 00386 Spawn(class'BloodShotEmitter',,, HitLocation+HitNormal, Rotator(-X)); 00387 else 00388 { 00389 B = Spawn(class'BulletDustEmitter',,, HitLocation+HitNormal, Rotator(HitNormal)); 00390 if (B!=none) 00391 B.NoiseMake(Pawn, 0.15); 00392 } 00393 } 00394 } 00395 simulated function PlayFiringSound() 00396 { 00397 Pawn.MakeNoise(1.0); 00398 Pawn.PlaySound(hFireSound, 0, 0); 00399 } 00400 event Timer2() 00401 { 00402 // DebugLog("\ HelicoBoss -MachinegunPhase Timer2 vFocalPointOffset="$vFocalPointOffset); 00403 FireMachinegun(); 00404 FiringTimer -= 0.1; 00405 if ( Firingtimer < 0.0 ) 00406 { 00407 BossState = 0; 00408 GotoState(''); 00409 } 00410 } 00411 event BeginState() 00412 { 00413 DebugLog("\ HelicoBoss -MachineGunPhase BeginState"); 00414 vFocalPointOffset = vect(0,0,-380); 00415 FiringTimer = DefaultFiringTimer; 00416 // SetTimer2(0.1, true); 00417 00418 } 00419 event Tick(float dT) 00420 { 00421 if ( CheckUnsafePoints() ) 00422 SeePlayer(XIII); 00423 00424 Pawn.Acceleration = 0.25*(Destination - Pawn.Location)/dT*0.5; 00425 vFocalPointOffset *= 0.95; 00426 FocalPoint = (FocalPoint * 5 + XIII.Location + vect(0,0,50) + vFocalPointOffset)/6.0; 00427 } 00428 Begin: 00429 Sleep(1.5); 00430 DebugLog("\ HelicoBoss -MachineGunPhase Setting Timer2 to 0.1,true, Starting Firing"); 00431 SetTimer2(0.1, true); 00432 } 00433 00434 //_____________________________________________________________________________ 00435 // Should start to go to the end position and create necessary events 00436 state EndOfMe 00437 { 00438 event SeePlayer(Pawn Seen); 00439 event Tick(float dT) 00440 { 00441 local CWndUSA02BossEnd CWnd; 00442 local vector tV, tV2, tV3; 00443 local float tF; 00444 00445 // Update Acceleration 00446 Pawn.Acceleration = 1.0*(Destination - Pawn.Location)/dT; 00447 00448 // Update FocalPoint to make Helico turn on himself 00449 if ( BossState == 7 ) 00450 { 00451 fEndRotationFactor += dT * 5; 00452 FocalPoint = Pawn.Location + normal(vector(Pawn.Rotation) * 100 - (Vector(Pawn.rotation) cross vect(0,0,1)) * fEndRotationFactor)*100; 00453 } 00454 else if ( BossState == 8 ) 00455 { // Should continue turning until aligned 00456 tV2 = FocalPoint - Pawn.Location; 00457 tV3 = vector(CrashPoint.Rotation); 00458 // tV = tV2 cross tV3; 00459 tV2.z = 0.0; 00460 tV3.z = 0.0; 00461 tF = normal(tV2) dot normal(tV3); 00462 // if ( (tv.z > 0) || tF < 0.95) // keep turning 00463 if ( tF < 0.95 ) // keep turning 00464 { 00465 // fEndRotationFactor += dT * 5; 00466 FocalPoint = Pawn.Location + normal(vector(Pawn.Rotation) * 100 - (Vector(Pawn.rotation) cross vect(0,0,1)) * fEndRotationFactor)*100; 00467 } 00468 else 00469 FocalPoint = CrashPoint.Location + vector(CrashPoint.Rotation)*5000.0; 00470 00471 // tV = Vector(Pawn.rotation) cross vect(0,0,1); 00472 // fEndRotationFactor += dT * 5; 00473 // FocalPoint = Pawn.Location + normal(vector(Pawn.Rotation) * 100 + tV * fEndRotationFactor)*100; 00474 // FocalPoint = CrashPoint.Location + vector(CrashPoint.Rotation)*5000.0; 00475 } 00476 00477 // triggering events 00478 if ( (BossState==7) && !bExploDone && (vSize(Destination - Pawn.Location) < 350.0) ) 00479 { 00480 DebugLog("\ HelicoBoss -EndOfMe hExplo event"); 00481 TriggerEvent('hExplo', self, Pawn); 00482 bExploDone = true; 00483 } 00484 if ( vSize(Destination - Pawn.Location) < 250.0 ) 00485 { 00486 if (BossState == 7) 00487 { 00488 /*CWnd = Spawn(class'CWndUSA02BossEnd', Pawn); 00489 if (CWnd != none) 00490 CWnd.MyHudForFX = XIIIBaseHUD(XIIIPlayerController(XIII.controller).MyHud);*/ 00491 BossState ++; 00492 Destination = CrashPoint.Location; 00493 // FocalPoint = CrashPoint.Location + vector(CrashPoint.Rotation)*5000; 00494 Pawn.Velocity=vect(0,0,0); 00495 Pawn.AirSpeed = 12000; 00496 Pawn.PlaySound(hDestructSound); 00497 } 00498 else 00499 { 00500 DebugLog("\ HelicoBoss -EndOfMe hCrash event"); 00501 TriggerEvent('hCrash', self, Pawn); 00502 USA02HelicoBoss(Pawn).Notify(); 00503 Pawn.Destroy(); 00504 Destroy(); 00505 } 00506 } 00507 } 00508 event BeginState() 00509 { 00510 SetTimer(0.0, false); 00511 Pawn.AirSpeed = 1200; 00512 Pawn.SetCollision(false,false,false); // Clear colls to avoid anything being stuck in some background 00513 Pawn.bCollideWorld = false; 00514 Destination = EndPoint.Location; 00515 FocalPoint = Pawn.Location + vector(Pawn.Rotation) * 100; 00516 BossState = 7; 00517 DebugLog("\ HelicoBoss -EndOfMe BeginState"); 00518 //XIIIGameInfo(Level.Game).MapInfo.SetGoalComplete(91); 00519 } 00520 } 00521 00522 00523 00524 defaultproperties 00525 { 00526 vFocalPointOffset=(Z=380.000000) 00527 DefaultFiringTimer=4.000000 00528 fStabilityBeforeMissileDelay=1.000000 00529 hFireSound=Sound'XIIIsound.Guns__M60Fire.M60Fire__hM60Fire' 00530 hMissileFireSound=Sound'XIIIsound.Guns__BazFire.BazFire__hBazFire' 00531 DecalProjectorClass=Class'XIII.BulletScorch' 00532 MyDamageType=Class'XIII.DTGunned' 00533 MinAcquisitionTime=1.500000 00534 VMACHINEGUNOFFSET=(X=-640.000000,Z=90.000000) 00535 VMISSILEOFFSET=(X=-130.000000,Y=205.000000,Z=100.000000) 00536 hBeginFightMusic=Sound'XIIIsound.Music__USA02.USA02__hBeginFight' 00537 hHelicoTouchMusic=Sound'XIIIsound.Music__USA02.USA02__hHelicoTouch' 00538 hSnapShotSound=Sound'XIIIsound.Vehicles__USABossHelico.USABossHelico__hSnapShot' 00539 hDestructsound=Sound'XIIIsound.Vehicles__USABossHelico.USABossHelico__hDestruct' 00540 TraceClass=Class'XIDMaps.USA02HelicoBulletTrail' 00541 bControlAnimations=True 00542 bRotateToDesired=True 00543 }

End Source Code