// // MISSION05 - Battle w/ sacking force // #include "..\\Game\\speechevent.h" #include "..\\Game\\soundmusic.h" LOCALIZATION //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ LSTRING_Savegame "05 - Great Wastelands" "05 - Macro-déserts" "05 - Große Einöde" "05 - Grandes páramos" "05 - Le lande desolate" LSTRING_LocationCard "GREAT WASTELANDS" "MACRO-DESERTS" "GROSSE EINÖDE" "GRANDES PÁRAMOS" "LE LANDE DESOLATE" LSTRING_FISendProbeTASKBAR "Investigate the asteroid belt" "Sondez la ceinture d'astéroïdes" "Den Asteroidengürtel untersuchen." "Investigar el cinturón de asteroides" "Indaga nella fascia asteroidale" LSTRING_FIEradicateTASKBAR "Eradicate all enemy ships" "Elimination totalité vaisseaux ennemis" "Alle feindlichen Schiffe auslöschen." "Erradicar todas las naves enemigas" "Distruggi tutti i vascelli nemici" LSTRING_FIDestroyResTASKBAR "Destroy Enemy Resource Collector" "Destruction Collecteur de Ressources Ennemi." "Rohstoffschiffe des Feindes zerstören." "Destruir recolector de recursos enemigo" "Distruggi i Collettori di Risorse nemici" LSTRING_FITeachDefendersTASKBAR "Research Defender sub-systems" "Recherche sur les sous-systèmes de défense" "Abwehrkreuzer-Subsysteme erforschen." "Investigar subsistemas de defensa" "Ricerca i sotto-sistemi del Difensore" LSTRING_Hyperspace " HYPERSPACE" " HYPERESPACE" " HYPERRAUMSPRUNG" " HIPERESPACIO" " IPERSPAZIO" ENDL //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ FleetIntel ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ FSM FleetIntel States FCIntro, FISendProbeLBXIn, FISendProbeOpenSensors, FISendProbe, FISendProbe2, FISendProbePING, FISendProbe3, FISendProbeLBXOut, FISendProbeEND, FISendProbeWAITEND, FIEradicateEnemiesLBXIn, FIEradicateEnemiesOpenSensors, FIEradicateEnemies, FIEradicateEnemies2, FIEradicateEnemiesPING, FIEradicateEnemiesLBXOut, FIEradicateEnemiesEND, FIEradicateEnemiesWAITEND, FIDestroyResourcer, FITeachMoveAttack, FITeachDefenders, FIPlasmaTech, FIIonTech, FIObjectivesComplete, FIIdle; INIT Jump FIIdle; // Go immediately to FIIdle ENDINIT WATCH ENDWATCH STATE FCIntro //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT SpeechEvent (M05_Fleet_HyperspaceSuccessful, 0); // Hyperspace successful. Current position and pre-jump coordinates are in perfect alignment. We are on target. //SoundEvent (4000); // #define Exp_DestProjectileLarge //SubtitleSimulate (0, 8000, LSTRING_FCIntro); // Hyperspace successful. Current position and pre-jump coordinates are in perfect alignment. We are on target. //TimerCreateSetStart ("FCIntroENDTimer", 8); ENDINIT WATCH //IF (TimerExpiredDestroy ("FCIntroENDTimer")) IF (IntelEventEnded ()) Jump FISendProbeLBXIn; ENDIF ENDWATCH ENDSTATE FCIntro //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FISendProbeLBXIn //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT PauseOtherKAS(); wideScreenIn(90); // letterbox bars fade in over 3 seconds Jump FISendProbeOpenSensors; ENDINIT WATCH ENDWATCH ENDSTATE FISendProbeLBXIn //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FISendProbeOpenSensors //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT TimerCreateSetStart ("FIOpenSensorsTimer", 4); ENDINIT WATCH IF (TimerExpiredDestroy ("FIOpenSensorsTimer")) OpenSensors (TRUE); PauseUniverse(); Jump FISendProbe; ENDIF ENDWATCH ENDSTATE FISendProbeOpenSensors //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FISendProbe //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT TimerCreateSetStart ("FISendProbeTimer", 1); ENDINIT WATCH // FLEET INTEL event for sending the probe IF (TimerExpiredDestroy ("FISendProbeTimer")) Jump FISendProbe2; ENDIF ENDWATCH ENDSTATE FISendProbe //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FISendProbe2 //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT IF (RaceOfHuman () = 0) SpeechEvent (M05_Intel_SendProbesKushan, 0); // We detect large resource deposits but no vessels. It is possible that the Taiidan could be hiding in the denser portions of the belt, which may cause interference with our sensors. ELSEIF (RaceOfHuman () = 1) SpeechEvent (M05_Intel_SendProbesTaiidan, 0); // We detect large resource deposits but no vessels. It is possible that the Kushan could be hiding in the denser portions of the belt, which may cause interference with our sensors. ENDIF TimerCreateSetStart ("FISendProbePINGTimer", 7); //SoundEvent (4000); // #define Exp_DestProjectileLarge //SubtitleSimulate (0, 18000, LSTRING_FISendProbe); // We detect large resource deposits but no vessels. It is possible that the Taiidan / Kushan could be hiding in the denser portions of the belt, which may cause interference with our sensors. Send probes to investigate. All fleet assets should be kept on alert. VarCreateSet ("G_FleetIntelIntroHasPlayed", TRUE); // Tells other parts of the script to do stuff (create the objectives) ENDINIT WATCH VarDestroy ("IntelEvent"); VarCreateSet("IntelEvent", IntelEventEnded()); IF (VarGet("IntelEvent") = 2) IF (VarGet ("NeverCreateSendProbePingAgain") = FALSE) PingAddPoint (POINT_HidingPOINT, "HidingPOINT"); // Create the PINGs for the asteroids VarCreateSet ("NeverCreateSendProbePingAgain", TRUE); ENDIF wideScreenOut (30); // player pressed SPACE or ESC and wants out immediately so remove the LBX in 1 second Jump FISendProbeEND; ELSEIF (VarGet("IntelEvent")) Jump FISendProbeWAITEND; ENDIF IF (TimerExpiredDestroy ("FISendProbePINGTimer")) SoundEvent (267); // Play the movement chime when the pointer is drawn IF (VarGet ("NeverCreateSendProbePingAgain") = FALSE) PingAddPoint (POINT_HidingPOINT, "HidingPOINT"); // Create the PINGs for the asteroids VarCreateSet ("NeverCreateSendProbePingAgain", TRUE); ENDIF TutSetTextDisplayBoxToSubtitleRegion(); TutSetPointerTargetAIVolume("HidingSpherePOINTER", VOLUME_HidingVolume); ENDIF //VarDestroy ("IntelEvent"); //VarCreateSet("IntelEvent", IntelEventEnded()); //IF (VarGet("IntelEvent") = 2) // wideScreenOut (30); // player pressed SPACE or ESC and wants out immediately so remove the LBX in 1 second // Jump FISendProbeEND; //ELSEIF (VarGet("IntelEvent")) // Jump FISendProbePING; //ENDIF ENDWATCH ENDSTATE FISendProbe2 //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FISendProbePING //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT TimerCreateSetStart ("FISendProbePINGTimer", 3); ENDINIT WATCH VarDestroy ("IntelEvent"); VarCreateSet("IntelEvent", IntelEventEnded()); IF (VarGet("IntelEvent") = 2) IF (VarGet ("NeverCreateSendProbePingAgain") = FALSE) PingAddPoint (POINT_HidingPOINT, "HidingPOINT"); // Create the PINGs for the asteroids VarCreateSet ("NeverCreateSendProbePingAgain", TRUE); ENDIF wideScreenOut (30); // player pressed SPACE or ESC and wants out immediately so remove the LBX in 1 second Jump FISendProbeEND; //ELSEIF (VarGet("IntelEvent")) // //Jump FISendProbe3; // Jump FISendProbeWAITEND; ENDIF IF (TimerExpiredDestroy ("FISendProbePINGTimer")) SoundEvent (267); // Play the movement chime when the pointer is drawn IF (VarGet ("NeverCreateSendProbePingAgain") = FALSE) PingAddPoint (POINT_HidingPOINT, "HidingPOINT"); // Create the PINGs for the asteroids VarCreateSet ("NeverCreateSendProbePingAgain", TRUE); ENDIF TutSetTextDisplayBoxToSubtitleRegion(); TutSetPointerTargetAIVolume("HidingSpherePOINTER", VOLUME_HidingVolume); Jump FISendProbeWAITEND; ENDIF ENDWATCH ENDSTATE FISendProbePING //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FISendProbe3 //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT ENDINIT WATCH VarDestroy ("IntelEvent"); VarCreateSet("IntelEvent", IntelEventEnded()); IF (VarGet("IntelEvent") = 2) wideScreenOut (30); // player pressed SPACE or ESC and wants out immediately so remove the LBX in 1 second Jump FISendProbeEND; ELSEIF (VarGet("IntelEvent")) Jump FISendProbeWAITEND; ENDIF ENDWATCH ENDSTATE FISendProbe3 //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FISendProbeLBXOut //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT TimerCreateSetStart ("FISendProbeLBXOutTimer", 30); ENDINIT WATCH IF (TimerExpiredDestroy ("FISendProbeLBXOutTimer")) wideScreenOut(150); // letterbox bars fade out over 5 seconds Jump FISendProbeWAITEND; ENDIF IF (IntelEventEnded()) wideScreenOut (30); // player pressed SPACE or ESC and wants out immediately so remove the LBX in 1 second Jump FISendProbeEND; ENDIF ENDWATCH ENDSTATE FISendProbeLBXOut //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FISendProbeWAITEND //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT TimerCreateSetStart ("FISendProbeENDTimer", 3); ENDINIT WATCH VarDestroy ("IntelEvent"); VarCreateSet("IntelEvent", IntelEventEnded()); IF (VarGet("IntelEvent") = 2) wideScreenOut (30); // player pressed SPACE or ESC and wants out immediately so remove the LBX in 1 second Jump FISendProbeEND; ENDIF IF (TimerExpiredDestroy ("FISendProbeENDTimer")) wideScreenOut (30); // fade out over 1 second Jump FISendProbeEND; ENDIF ENDWATCH ENDSTATE FISendProbeWAITEND //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FISendProbeEND //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT TutRemoveAllPointers (); UnpauseUniverse(); UnpauseOtherKAS(); CloseSensors (TRUE); VarDestroy("G_CLICK_SendProbe"); Jump FIIdle; ENDINIT WATCH ENDWATCH ENDSTATE FISendProbeEND //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FIEradicateEnemiesLBXIn //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT PauseOtherKAS(); wideScreenIn(90); // letterbox bars fade in over 3 seconds Jump FIEradicateEnemiesOpenSensors; ENDINIT WATCH ENDWATCH ENDSTATE FIEradicateEnemiesLBXIn //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FIEradicateEnemiesOpenSensors //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT TimerCreateSetStart ("FIOpenSensorsTimer", 4); ENDINIT WATCH IF (TimerExpiredDestroy ("FIOpenSensorsTimer")) OpenSensors (TRUE); PauseUniverse(); Jump FIEradicateEnemies; ENDIF ENDWATCH ENDSTATE FIEradicateEnemiesOpenSensors //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FIEradicateEnemies //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT TimerCreateSetStart ("FIEradicateEnemiesTimer", 1); ENDINIT WATCH // FLEET INTEL event for sending the probe IF (TimerExpiredDestroy ("FIEradicateEnemiesTimer")) Jump FIEradicateEnemies2; ENDIF ENDWATCH ENDSTATE FIEradicateEnemies //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FIEradicateEnemies2 //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT SpeechEvent (M05_Intel_ProfilesMatch, 0); // Ship profiles and markings match those from the recording at Kharak. There is no doubt that this is the fleet. Destroy them. //SoundEvent (4000); // #define Exp_DestProjectileLarge //SubtitleSimulate (0, 11000, LSTRING_FIEradicateEnemies); // Ship profiles and fleet icons match those from the recording at Kharak. There is no doubt that this is the fleet. Destroy them. VarCreateSet ("G_EradicateEnemiesHasPlayed", TRUE); Jump FIEradicateEnemiesPING; ENDINIT WATCH //VarDestroy ("IntelEvent"); //VarCreateSet("IntelEvent", IntelEventEnded()); //IF (VarGet("IntelEvent") = 2) // wideScreenOut (30); // player pressed SPACE or ESC and wants out immediately so remove the LBX in 1 second // Jump FIEradicateEnemiesEND; //ELSEIF (VarGet("IntelEvent")) // Jump FIEradicateEnemies3; //ENDIF ENDWATCH ENDSTATE FIEradicateEnemies2 //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FIEradicateEnemiesPING //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT TimerCreateSetStart ("FIEradicateEnemiesPINGTimer", 0); ENDINIT WATCH VarDestroy ("IntelEvent"); VarCreateSet("IntelEvent", IntelEventEnded()); IF (VarGet("IntelEvent") = 2) IF (VarGet ("NeverCreateEradicatePingAgain") = FALSE) PingAddShips (TEAMSHIPS_Carrier, "CarrierPING"); // Create the PING for the enemy Carrier VarCreateSet ("NeverCreateEradicatePingAgain", TRUE); ENDIF wideScreenOut (30); // player pressed SPACE or ESC and wants out immediately so remove the LBX in 1 second Jump FIEradicateEnemiesEND; ELSEIF (VarGet("IntelEvent")) Jump FIEradicateEnemiesWAITEND; ENDIF IF (TimerExpiredDestroy ("FIEradicateEnemiesPINGTimer")) SoundEvent (267); // Play the movement chime when the pointer is drawn IF (VarGet ("NeverCreateEradicatePingAgain") = FALSE) PingAddShips (TEAMSHIPS_Carrier, "CarrierPING"); // Create the PING for the enemy Carrier VarCreateSet ("NeverCreateEradicatePingAgain", TRUE); ENDIF TutSetTextDisplayBoxToSubtitleRegion(); TutSetPointerTargetAIVolume("HidingSpherePOINTER", VOLUME_HidingVolume); ENDIF ENDWATCH ENDSTATE FIEradicateEnemiesPING //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FIEradicateEnemiesLBXOut //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT TimerCreateSetStart ("FIEradicateEnemiesLBXOutTimer", 11); ENDINIT WATCH IF (TimerExpiredDestroy ("FIEradicateEnemiesLBXOutTimer")) wideScreenOut(150); // letterbox bars fade out over 5 seconds Jump FIEradicateEnemiesWAITEND; ENDIF IF (IntelEventEnded()) wideScreenOut (30); // player pressed SPACE or ESC and wants out immediately so remove the LBX in 1 second Jump FIEradicateEnemiesEND; ENDIF ENDWATCH ENDSTATE FIEradicateEnemiesLBXOut //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FIEradicateEnemiesWAITEND //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT TimerCreateSetStart ("FIEradicateEnemiesENDTimer", 3); ENDINIT WATCH VarDestroy ("IntelEvent"); VarCreateSet("IntelEvent", IntelEventEnded()); IF (VarGet("IntelEvent") = 2) wideScreenOut (30); // player pressed SPACE or ESC and wants out immediately so remove the LBX in 1 second Jump FIEradicateEnemiesEND; ENDIF IF (TimerExpiredDestroy ("FIEradicateEnemiesENDTimer")) wideScreenOut (30); // player pressed SPACE or ESC and wants out immediately so remove the LBX in 1 second Jump FIEradicateEnemiesEND; ENDIF ENDWATCH ENDSTATE FIEradicateEnemiesWAITEND //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FIEradicateEnemiesEND //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT IFONCE (TRUE) MusicPlay (B04_EvilEmpire); ENDIFONCE TutRemoveAllPointers (); UnpauseUniverse(); UnpauseOtherKAS(); CloseSensors (TRUE); VarDestroy("G_CLICK_EradicateEnemies"); Jump FIIdle; ENDINIT WATCH ENDWATCH ENDSTATE FIEradicateEnemiesEND //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FIDestroyResourcer //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT SpeechEvent (M05_Intel_DestroyEnemyCollector,0); // Sensors indicate the enemy is harvesting resources. Destroy their collector to impair ship production. //SoundEvent (271); // Play a sound event to notify the player that a subtitle is up //SubtitleSimulate (4, 9000, LSTRING_FIDestroyResourcer); IFONCE (TRUE) VarCreateSet ("G_DestroyResourcerHasPlayed", TRUE); PingAddShips (TEAMSHIPS_Collector, "CollectorPING"); IF (ShipsCount (TEAMSHIPS_Collector2) > 0) PingAddShips (TEAMSHIPS_Collector2, "CollectorPING2"); ENDIF ENDIFONCE VarDestroy ("G_CLICK_DestroyResourcer"); ENDINIT WATCH IF (IntelEventEnded ()) Jump FIIdle; ENDIF ENDWATCH ENDSTATE FIDestroyResourcer //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FITeachMoveAttack //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT SpeechEvent (M05_Intel_MoveAttackNEW,0); // Enemy capital ships appear to have lighter armor on the top, bottom, and rear sides. Our capital ships should be issued move orders while attacking to take advantage of this weakness. //SoundEvent (271); // Play a sound event to notify the player that a subtitle is up //SubtitleSimulate (4, 16000, LSTRING_FITeachMoveAttack); ENDINIT WATCH IF (IntelEventEnded ()) Jump FIIdle; ENDIF ENDWATCH ENDSTATE FITeachMoveAttack //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FITeachDefenders //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT SpeechEvent (M05_Intel_ResearchDefenseFighter,0); // The enemy is using a new Fighter class ship with strong defensive capabilities but low maneuverability. Our Research Division reports that it can produce a similar vessel. Begin Research as soon as possible. //SoundEvent (271); // Play a sound event to notify the player that a subtitle is up //SubtitleSimulate (4, 16000, LSTRING_FITeachDefenders); VarCreateSet ("G_TeachDefenderEventHasPlayed", TRUE); VarDestroy ("G_CLICK_ResearchDefenders"); ENDINIT WATCH IF (IntelEventEnded ()) Jump FIIdle; ENDIF ENDWATCH ENDSTATE FITeachDefenders //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FIPlasmaTech //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT SpeechEvent (M05_Intel_ResearchPlasmaBomb, 0); // Research Division reports it is now equipped for Plasma Bomb technology. We advise commencing research immediately. ENDINIT WATCH IF (IntelEventEnded ()) TechSetResearch ("PlasmaWeapons"); Jump FIIdle; ENDIF ENDWATCH ENDSTATE FIPlasmaTech //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FIIonTech //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT SpeechEvent (M05_Intel_ResearchIonCannon, 0); // Research Division reports it is now equipped for Ion Cannon technology. We advise commencing research immediately. ENDINIT WATCH IF (IntelEventEnded ()) TechSetResearch ("IonWeapons"); Jump FIIdle; ENDIF ENDWATCH ENDSTATE FIIonTech //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FIObjectivesComplete //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT IF (RaceOfHuman () = 0) SpeechEvent (M05_Intel_HyperspaceKushan, 0); // Taiidan fleet destroyed. There's nothing left for us to return to. Our only option is to follow the path etched into the Guidestone. Finding our ancient home is our only hope now. Hyperspace coordinates locked in. ELSEIF (RaceOfHuman () = 1) SpeechEvent (M05_Intel_HyperspaceTaiidan, 0); // Kushan fleet destroyed. There's nothing left for us to return to. Our only option is to follow the path etched into the Guidestone. Finding our ancient home is our only hope now.Hyperspace coordinates locked in. ENDIF //SoundEvent (271); // Play a sound event to notify the player that a subtitle is up //SubtitleSimulate(4, 16000, LSTRING_FIObjectivesComplete); //TimerCreateSetStart ("FIObjectivesCompleteENDTimer", 6); ENDINIT WATCH //IF (TimerExpiredDestroy ("FIObjectivesCompleteENDTimer")) IF (IntelEventEnded ()) Jump FIIdle; ENDIF ENDWATCH ENDSTATE FIObjectivesComplete //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE FIIdle //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT ENDINIT WATCH // FIRST TIME watches // play the Fleet Command intro event 5 seconds after you enter the level IFONCE (TimerExpiredDestroy ("G_FCHyperspaceSuccessful")) Jump FCIntro; ENDIFONCE // play the Fleet Intel event telling you to eradicate the enemies IFONCE (ObjectiveGet ("SendProbe") = TRUE) Jump FIEradicateEnemiesLBXIn; ENDIFONCE // when the player has killed off all the enemies, play the objectives complete event IFONCE (TimerExpiredDestroy ("G_WaitToPlayFinalEvent")) Jump FIObjectivesComplete; ENDIFONCE // (after the player discovers the enemy) and when the timer is up, play the secondary objective event (destroy enemy resourcer) IFONCE (TimerExpiredDestroy ("G_WaitToPlayResourcerEvent")) Jump FIDestroyResourcer; ENDIFONCE // when the player has got into some serious capital ship combat, teach them move while attacking IFONCE (TimerExpiredDestroy ("G_PlayTeachMoveWhileAttacking")) Jump FITeachMoveAttack; ENDIFONCE // when the player has seen a Defender guarding a Frigate, teach them about Defenders IFONCE (TimerExpiredDestroy ("G_PlayTeachDefenders")) Jump FITeachDefenders; ENDIFONCE // if the player enters the level with Ion cannon tech, they are allowed to research plasma tech IFONCE (VarGet ("G_PlayPlasmaTechEvent") = TRUE) Jump FIPlasmaTech; ENDIFONCE // if the player enters the level with plasma launcher tech, they are allowed to research ion cannons IFONCE (VarGet ("G_PlayIonTechEvent") = TRUE) Jump FIIonTech; ENDIFONCE // REPLAYING event watches // FLEET INTEL event - send probe to Khar-Selim IF (VarGet ("G_CLICK_SendProbe")) Jump FISendProbeLBXIn; ENDIF // FLEET INTEL event - eradicate all enemy ships IF (VarGet ("G_CLICK_EradicateEnemies")) Jump FIEradicateEnemiesLBXIn; ENDIF // FLEET INTEL event - destroy enemy resourcer IF (VarGet ("G_CLICK_DestroyResourcer")) Jump FIDestroyResourcer; ENDIF // FLEET INTEL event - research defenders IF (VarGet ("G_CLICK_ResearchDefenders")) Jump FITeachDefenders; ENDIF ENDWATCH ENDSTATE FIIdle //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ENDFSM FleetIntel //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ FleetIntel ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Collector ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ FSM Collector States WaitingToCollect, MoveToHarvestArea, Harvest, Docking, DockForGood, NullState; INIT VarCreateSet ("G_CollectorUnderAttack", FALSE); VarCreateSet ("G_CollectorIsHurtin", FALSE); VarCreateSet ("VisitedCollectionPoint", 0); Jump WaitingToCollect; ENDINIT WATCH IF (ThisTeamIs (TEAM_Collector)) IF (UnderAttack (SHIPS_AttackingCollector)) // Do this for other FSM's which watch to see when the collector is being attacked VarSet ("G_CollectorUnderAttack", TRUE); ELSE VarSet ("G_CollectorUnderAttack", FALSE); ENDIF ELSEIF (ThisTeamIs (TEAM_Collector2)) IF (UnderAttack (SHIPS_AttackingCollector)) // Do this for other FSM's which watch to see when the collector is being attacked VarSet ("G_CollectorUnderAttack", TRUE); ELSE VarSet ("G_CollectorUnderAttack", FALSE); ENDIF ENDIF IF (ThisTeamIs (TEAM_Collector)) IF (TeamHealthAverage () < 85) // If you get below 85% health, do this to let other FSM's know you're hurtin' VarSet ("G_CollectorIsHurtin", TRUE); ELSE VarSet ("G_CollectorIsHurtin", FALSE); ENDIF ELSEIF (ThisTeamIs (TEAM_Collector2)) IF (TeamHealthAverage () < 85) // If you get below 85% health, do this to let other FSM's know you're hurtin' VarSet ("G_CollectorIsHurtin", TRUE); ELSE VarSet ("G_CollectorIsHurtin", FALSE); ENDIF ENDIF IFONCE (ShipsCount (THISTEAMSHIPS) = 0) // If you're killed, go to a null state Stop (); Jump NullState; ENDIFONCE IFONCE (TutGameSentMessage ("Game_NonPlayerHarvesterDone")) Jump DockForGood; ENDIFONCE ENDWATCH STATE WaitingToCollect //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT ENDINIT WATCH IF (ObjectiveGet ("SendProbe") = TRUE) // When the player discovers the enemy fleet, take off and start harvesting Jump MoveToHarvestArea; ENDIF ENDWATCH ENDSTATE WaitingToCollect //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE MoveToHarvestArea //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT TacticsAggressive (); IF ( (VarGet ("VisitedCollectionPoint") = 0) OR (VarGet ("VisitedCollectionPoint") = 1) ) MoveTo (POINT_HarvestPoint1); VarCreateSet ("MovingToHarvestPoint1", TRUE); ELSEIF (VarGet ("VisitedCollectionPoint") = 2) MoveTo (POINT_HarvestPoint2); VarCreateSet ("MovingToHarvestPoint2", TRUE); ELSEIF (VarGet ("VisitedCollectionPoint") = 3) MoveTo (POINT_HarvestPoint3); VarCreateSet ("MovingToHarvestPoint3", TRUE); ELSE Jump Harvest; ENDIF ENDINIT WATCH IF ( (VarGet ("MovingToHarvestPoint1") = TRUE) AND (Nearby (POINT_HarvestPoint1, 4000)) ) VarDestroy ("MovingToHarvestPoint1"); Jump Harvest; ELSEIF ( (VarGet ("MovingToHarvestPoint2") = TRUE) AND (Nearby (POINT_HarvestPoint2, 4000)) ) VarDestroy ("MovingToHarvestPoint2"); Jump Harvest; ELSEIF ( (VarGet ("MovingToHarvestPoint3") = TRUE) AND (Nearby (POINT_HarvestPoint3, 4000)) ) VarDestroy ("MovingToHarvestPoint3"); Jump Harvest; ENDIF ENDWATCH ENDSTATE MoveToHarvestArea //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE Harvest //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT TacticsAggressive (); Harvest (); ENDINIT WATCH // If the Collector changes to docking, it must be heading back to the Carrier to drop off its load, so jump to the docking state IF (ShipsOrder (THISTEAMSHIPS) = 3) VarInc ("VisitedCollectionPoint"); Jump Docking; ENDIF ENDWATCH ENDSTATE Harvest //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE Docking //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT ENDINIT WATCH // If the Collector is NOT docking anymore, it must have finished dropping off its load, so jump to the MoveToHarvestArea state IF (ShipsOrder (THISTEAMSHIPS) != 3) Jump MoveToHarvestArea; ENDIF ENDWATCH ENDSTATE Docking //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE DockForGood //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT IF (ShipsCount (TEAMSHIPS_Carrier) > 0) DockStay (TEAM_Carrier); ELSE Kamikaze (SHIPS_PlayerMothership); // If the carrier is dead, the collector is LIVID and goes kamikaze on the mothership ENDIF ENDINIT WATCH IF (TeamDockedReadyForLaunch ()) Jump WaitingToCollect; ENDIF ENDWATCH ENDSTATE DockForGood //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE NullState //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT ENDINIT WATCH ENDWATCH ENDSTATE NullState //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ENDFSM Collector //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Collector ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Interceptors ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ FSM Interceptors States AllDeadWaitForShips, DockInstant, WaitingToPatrol, Launch, Patrol, AttackNearby, AttackCarrierVol, AttackFrigateVol, GuardCollector, DockWithSupportFrigate, BeingServiced, AttackCollector, ACT3Guard, ACT3AttackWorld, NullState; INIT VarCreateSet ("SHIPSOriginal", (ShipsCount (THISTEAMSHIPS))); VarCreateSet ("SHIPSRequested", 0); VarCreateSet ("SHIPSNeeded", 0); VarCreateSet ("SHIPSNewships", 0); VarCreateSet ("SHIPSKilled", 0); // Create a variable = to the number of ships killed VarCreateSet ("DelaySHIPSNeeded", 0); VarSet ("G_TOTALOriginalInterceptors", VarGet ("G_TOTALOriginalInterceptors") + ShipsCount (THISTEAMSHIPS)); Jump DockInstant; ENDINIT WATCH // if there are 0 ships in the team, jump to a wait state to wait for more ships (otherwise the order will get lost) IF ( (ShipsCount (THISTEAMSHIPS) = 0) AND (VarGet ("WaitingForShips") = FALSE) ) Jump AllDeadWaitForShips; ENDIF // if the player has killed 2 'teams' of interceptors, don't let the team request any more ships IFONCE ((VarGet ("G_TOTALInterceptorsKilled")) = 2*(VarGet ("G_TOTALOriginalInterceptors"))) VarCreateSet ("G_DontRequestAnymore", TRUE); ENDIFONCE // if the player has killed 2 'teams' of interceptors, and there are no more ships left in the team, go to a null state //IF ( (VarGet ("G_DontRequestAnymore") = TRUE) AND (ShipsCount (THISTEAMSHIPS) = 0) ) // Stop (); // Jump NullState; //ENDIF // INTERCEPTORS repopulation stuff from Falko IF ( ((ShipsCount (THISTEAMSHIPS) + VarGet ("SHIPSRequested")) < VarGet ("SHIPSOriginal")) AND (VarGet ("G_DontRequestAnymore") = FALSE) ) VarSet ("SHIPSNeeded", (VarGet ("SHIPSOriginal") - (ShipsCount (THISTEAMSHIPS) + VarGet("SHIPSRequested")))); //RequestShips ("HeavyInterceptor", VarGet ("SHIPSNeeded")); VarSet ("DelaySHIPSNeeded", VarGet ("DelaySHIPSNeeded") + VarGet ("SHIPSNeeded")); // To delay the reinforcement VarSet ("SHIPSKilled", VarGet ("SHIPSKilled") + VarGet ("SHIPSNeeded")); //VarSet ("G_TOTALInterceptorsKilled", VarGet ("G_TOTALInterceptorsKilled") + VarGet ("SHIPSKilled")); VarSet("SHIPSRequested", VarGet("SHIPSRequested") + VarGet("SHIPSNeeded")); ENDIF VarSet ("SHIPSNewships", NewShipsAdded()); IF (VarGet("SHIPSNewships")) //FormationDelta3D (); VarSet("SHIPSRequested", VarGet("SHIPSRequested") - VarGet("SHIPSNewships")); ENDIF IF ( (VarGet ("DelaySHIPSNeeded") > 0) AND (TimerExpiredDestroy ("DelaySHIPSRequest")) ) RequestShips ("HeavyInterceptor", VarGet ("DelaySHIPSNeeded")); VarSet ("DelaySHIPSNeeded", 0); ENDIF // Delaying the reinforcement IF ( (VarGet ("DelaySHIPSNeeded") > 0) AND (! TimerRemaining ("DelaySHIPSRequest")) ) TimerCreateSetStart ("DelaySHIPSRequest", 30); ENDIF // when ACT2 has begun, start a timer to attack the player's Resource Collector IFONCE ( (VarGet ("G_ACT2HasBegun") = TRUE) AND (NOT TutGameSentMessage ("Game_PlayerHarvesterDone")) ) TimerCreateSetStart ("StartAttackOnCollector", Random (15, 35)); ENDIFONCE // when the timer is up, one of the teams starts attacking the player's collector IFONCE (TimerExpiredDestroy ("StartAttackOnCollector")) IF (ShipsCount (TEAMSHIPS_Interceptors1) >= ShipsCount (TEAMSHIPS_Interceptors2)) // take whatever team is biggest IF (ThisTeamIs (TEAM_Interceptors1)) Jump AttackCollector; // and attack the player's collector ENDIF ELSE IF (ThisTeamIs (TEAM_Interceptors2)) Jump AttackCollector; ENDIF ENDIF ENDIFONCE // when ACT3 has begun, guard any remaining ships IFONCE (VarGet ("G_ACT3HasBegun") = TRUE) Jump ACT3Guard; ENDIFONCE ENDWATCH STATE AllDeadWaitForShips //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT VarCreateSet ("WaitingForShips", TRUE); ENDINIT WATCH IF (ShipsCount (THISTEAMSHIPS) > 0) VarDestroy ("WaitingForShips"); Jump Patrol; ENDIF ENDWATCH ENDSTATE AllDeadWaitForShips //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE DockInstant //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT DockInstant (TEAM_Carrier); ENDINIT WATCH IF (TeamDockedReadyForLaunch ()) Jump WaitingToPatrol; ENDIF ENDWATCH ENDSTATE DockInstant //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE WaitingToPatrol //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT ENDINIT WATCH IF (ObjectiveGet ("SendProbe") = TRUE) Jump Launch; ENDIF ENDWATCH ENDSTATE WaitingToPatrol //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE Launch //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT Launch (); ENDINIT WATCH IF (TeamFinishedLaunching()) Jump Patrol; ENDIF ENDWATCH ENDSTATE Launch //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE Patrol //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT IFONCE (TRUE) FormationDelta3D (); // Set the formation only once so that this command doesn't end up cancelling their orders ENDIFONCE TacticsNeutral (); IF (ThisTeamIs (TEAM_Interceptors1)) PatrolPath (PATH_InterceptorPath); ELSEIF (ThisTeamIS (TEAM_Interceptors2)) PatrolPath (PATH_InterceptorPath2); ENDIF ENDINIT WATCH // when ACT3 has begun, go attack the player's Mothership IF (VarGet ("G_ACT3HasBegun") = TRUE) Jump ACT3Guard; ENDIF // **** watch everywhere stuff **** IF ( (TeamFuelAverage () < 20) AND (VarGet ("G_NobodyLeftToDockWith") = FALSE) ) Jump DockWithSupportFrigate; ENDIF IF (ShipsCount (SHIPS_CarrierVolTOTAL) > 0) Jump AttackCarrierVol; ENDIF IF ( (VarGet ("G_CollectorIsHurtin") = TRUE) AND (VarGet ("G_CollectorUnderAttack") = TRUE) ) Jump GuardCollector; ENDIF IF (ShipsCount (SHIPS_FrigateVolTOTAL) > 0) Jump AttackFrigateVol; ENDIF IF (FindEnemiesNearTeam (SHIPS_InterceptorNearby, 10000)) // If you find anyone within 10,000m, go attack them ShipsSelectClass (SHIPS_InterceptorMothership, SHIPS_InterceptorNearby, "CLASS_Mothership"); ShipsRemove (SHIPS_InterceptorNearby, SHIPS_InterceptorMothership); IF (ShipsCount (SHIPS_InterceptorNearby) > 0) Jump AttackNearby; ENDIF ENDIF ENDWATCH ENDSTATE Patrol //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE AttackNearby //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT TacticsNeutral (); VarCreateSet ("GoingInWithThisMany", ShipsCount (THISTEAMSHIPS)); ShipsSelectClass (SHIPS_NearbyFighters, SHIPS_InterceptorNearby, "CLASS_Fighter"); // Filter out the Fighters ShipsSelectClass (SHIPS_NearbyCorvettes, SHIPS_InterceptorNearby, "CLASS_Corvettes"); // Filter out the Corvettes ShipsSelectClass (SHIPS_NearbyFrigates, SHIPS_InterceptorNearby, "CLASS_Frigates"); // Filter out the Frigates ShipsSelectClass (SHIPS_InterceptorMothership, SHIPS_InterceptorNearby, "CLASS_Mothership"); ShipsRemove (SHIPS_InterceptorNearby, SHIPS_InterceptorMothership); VarCreateSet ("NearbySHIPS", ShipsCount (SHIPS_InterceptorNearby)); // for debuggin' VarCreateSet ("NearbyFightersSHIPS", ShipsCount (SHIPS_NearbyFighters)); VarCreateSet ("NearbyCorvettesSHIPS", ShipsCount (SHIPS_NearbyCorvettes)); VarCreateSet ("NearbyFrigatesSHIPS", ShipsCount (SHIPS_NearbyFrigates)); IF (Random (1,1000) < 750) // 75% chance they will make the "right" choice IF (ShipsCount (SHIPS_NearbyFrigates) > 0) Attack (SHIPS_NearbyFrigates); // Attack Frigates first VarCreateSet ("AttackingFrigate", TRUE); ELSEIF (ShipsCount (SHIPS_NearbyFighters) > 0) Attack (SHIPS_NearbyFighters); // Attack Fighters second VarCreateSet ("AttackingFighter", TRUE); ELSEIF (ShipsCount (SHIPS_NearbyCorvettes) > 0) Attack (SHIPS_NearbyCorvettes); // Attack the Corvettes third VarCreateSet ("AttackingCorvette", TRUE); ELSEIF (ShipsCount (SHIPS_InterceptorNearby) > 0) Attack (SHIPS_InterceptorNearby); // Attack everyone else as a last resort VarCreateSet ("AttackingRemaining", TRUE); ENDIF ELSE // 25% chance they will make the "wrong" choice IF (ShipsCount (SHIPS_NearbyCorvettes) > 0) Attack (SHIPS_NearbyCorvettes); // Attack the Corvettes first VarCreateSet ("AttackingCorvette", TRUE); ELSEIF (ShipsCount (SHIPS_NearbyFrigates) > 0) Attack (SHIPS_NearbyFrigates); // Attack Frigates second VarCreateSet ("AttackingFrigate", TRUE); ELSEIF (ShipsCount (SHIPS_NearbyFighters) > 0) Attack (SHIPS_NearbyFighters); // Attack Fighters third VarCreateSet ("AttackingFighter", TRUE); ELSEIF (ShipsCount (SHIPS_InterceptorNearby) > 0) Attack (SHIPS_InterceptorNearby); // Attack everyone else as a last resort VarCreateSet ("AttackingRemaining", TRUE); ENDIF ENDIF ENDINIT WATCH // **** watch everywhere stuff **** IF ( (TeamFuelAverage () < 20) AND (VarGet ("G_NobodyLeftToDockWith") = FALSE) ) Jump DockWithSupportFrigate; ENDIF IF ( (VarGet ("G_CollectorIsHurtin") = TRUE) AND (VarGet ("G_CollectorUnderAttack") = TRUE) ) Jump GuardCollector; ENDIF IF (ShipsCount (SHIPS_CarrierVolTOTAL) > 0) Jump AttackCarrierVol; ENDIF IF (ShipsCount (SHIPS_FrigateVolTOTAL) > 0) Jump AttackFrigateVol; ENDIF // if you lose more than 50% of the ships you had when you began the attack, then go dock with the Support Frigate IF ( (ShipsCount (THISTEAMSHIPS) < (5*(VarGet ("GoingInWithThisMany"))/10)) AND (VarGet ("G_NobodyLeftToDockWith") = FALSE) ) Jump DockWithSupportFrigate; ENDIF // if you kill off the ships you're attacking, go back to patrolling IF (VarGet ("AttackingFrigate") = TRUE) // If all Frigates are dead, go back to patrolling IF (ShipsCount (SHIPS_NearbyFrigates) = 0) VarDestroy ("AttackingFrigate"); Jump Patrol; ENDIF ELSEIF (VarGet ("AttackingCorvette") = TRUE) // If all Corvettes are dead, go back to patrolling IF (ShipsCount (SHIPS_NearbyCorvettes) = 0) VarDestroy ("AttackingCorvette"); Jump Patrol; ENDIF ELSEIF (VarGet ("AttackingFighter") = TRUE) // If all Fighters are dead, go back to patrolling IF (ShipsCount (SHIPS_NearbyFighters) = 0) VarDestroy ("AttackingFighter"); Jump Patrol; ENDIF ELSEIF (VarGet ("AttackingRemaining") = TRUE) // If everything else is dead, go back to patrolling IF (ShipsCount (SHIPS_InterceptorNearby) = 0) VarDestroy ("AttackingRemaining"); Jump Patrol; ENDIF ENDIF // if you stop attacking for some reason, go patrol again IF ( (ShipsOrder (TEAMSHIPS_Interceptors1) != 2) OR (ShipsOrder (TEAMSHIPS_Interceptors2) != 2) ) Jump Patrol; ENDIF ENDWATCH ENDSTATE AttackNearby //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE AttackCarrierVol //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT TacticsNeutral (); VarCreateSet ("GoingInWithThisMany", ShipsCount (THISTEAMSHIPS)); IF (Random (1,1000) < 750) // 75% chance they will make the "right" choice IF (ShipsCount (SHIPS_CarrierVolFrigates) > 0) Attack (SHIPS_CarrierVolFrigates); // Attack Frigates first VarCreateSet ("AttackingFrigate", TRUE); ELSEIF (ShipsCount (SHIPS_CarrierVolFighters) > 0) Attack (SHIPS_CarrierVolFighters); // Attack Fighters second VarCreateSet ("AttackingFighter", TRUE); ELSEIF (ShipsCount (SHIPS_CarrierVolCorvettes) > 0) Attack (SHIPS_CarrierVolCorvettes); // Attack the Corvettes third VarCreateSet ("AttackingCorvette", TRUE); ELSEIF (ShipsCount (SHIPS_CarrierVolTOTAL) > 0) Attack (SHIPS_CarrierVolTOTAL); // Attack everyone else as a last resort VarCreateSet ("AttackingRemaining", TRUE); ENDIF ELSE // 25% chance they will make the "wrong" choice IF (ShipsCount (SHIPS_CarrierVolCorvettes) > 0) Attack (SHIPS_CarrierVolCorvettes); // Attack the Corvettes first VarCreateSet ("AttackingCorvette", TRUE); ELSEIF (ShipsCount (SHIPS_CarrierVolFrigates) > 0) Attack (SHIPS_CarrierVolFrigates); // Attack Frigates second VarCreateSet ("AttackingFrigate", TRUE); ELSEIF (ShipsCount (SHIPS_CarrierVolFighters) > 0) Attack (SHIPS_CarrierVolFighters); // Attack Fighters third VarCreateSet ("AttackingFighter", TRUE); ELSEIF (ShipsCount (SHIPS_CarrierVolTOTAL) > 0) Attack (SHIPS_CarrierVolTOTAL); // Attack everyone else as a last resort VarCreateSet ("AttackingRemaining", TRUE); ENDIF ENDIF ENDINIT WATCH // **** watch everywhere stuff **** IF ( (TeamFuelAverage () < 20) AND (VarGet ("G_NobodyLeftToDockWith") = FALSE) ) Jump DockWithSupportFrigate; ENDIF IF ( (VarGet ("G_CollectorIsHurtin") = TRUE) AND (VarGet ("G_CollectorUnderAttack") = TRUE) ) Jump GuardCollector; ENDIF // if you lose more than 50% of the ships you had when you began the attack, then go dock with the Support Frigate IF ( (ShipsCount (THISTEAMSHIPS) < (5*(VarGet ("GoingInWithThisMany"))/10)) AND (VarGet ("G_NobodyLeftToDockWith") = FALSE) ) Jump DockWithSupportFrigate; ENDIF // if you kill off the ships you're attacking, go back to patrolling IF (VarGet ("AttackingFrigate") = TRUE) // If all Frigates are dead, go back to patrolling IF (ShipsCount (SHIPS_CarrierVolFrigates) = 0) VarDestroy ("AttackingFrigate"); Jump Patrol; ENDIF ELSEIF (VarGet ("AttackingCorvette") = TRUE) // If all Corvettes are dead, go back to patrolling IF (ShipsCount (SHIPS_CarrierVolCorvettes) = 0) VarDestroy ("AttackingCorvette"); Jump Patrol; ENDIF ELSEIF (VarGet ("AttackingFighter") = TRUE) // If all Fighters are dead, go back to patrolling IF (ShipsCount (SHIPS_CarrierVolFighters) = 0) VarDestroy ("AttackingFighter"); Jump Patrol; ENDIF ELSEIF (VarGet ("AttackingRemaining") = TRUE) // If everything else is dead, go back to patrolling IF (ShipsCount (SHIPS_CarrierVolTOTAL) = 0) VarDestroy ("AttackingRemaining"); Jump Patrol; ENDIF ENDIF // if you stop attacking for some reason, go patrol again IF ( (ShipsOrder (TEAMSHIPS_Interceptors1) != 2) OR (ShipsOrder (TEAMSHIPS_Interceptors2) != 2) ) Jump Patrol; ENDIF ENDWATCH ENDSTATE AttackCarrierVol //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE AttackFrigateVol //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT TacticsNeutral (); VarCreateSet ("GoingInWithThisMany", ShipsCount (THISTEAMSHIPS)); IF (Random (1,1000) < 750) // 75% chance they will make the "right" choice IF (ShipsCount (SHIPS_FrigateVolFrigates) > 0) Attack (SHIPS_FrigateVolFrigates); // Attack Frigates first VarCreateSet ("AttackingFrigate", TRUE); ELSEIF (ShipsCount (SHIPS_FrigateVolFighters) > 0) Attack (SHIPS_FrigateVolFighters); // Attack Fighters second VarCreateSet ("AttackingFighter", TRUE); ELSEIF (ShipsCount (SHIPS_FrigateVolCorvettes) > 0) Attack (SHIPS_FrigateVolCorvettes); // Attack the Corvettes third VarCreateSet ("AttackingCorvette", TRUE); ELSEIF (ShipsCount (SHIPS_FrigateVolTOTAL) > 0) Attack (SHIPS_FrigateVolTOTAL); // Attack everyone else as a last resort VarCreateSet ("AttackingRemaining", TRUE); ENDIF ELSE // 25% chance they will make the "wrong" choice IF (ShipsCount (SHIPS_FrigateVolCorvettes) > 0) Attack (SHIPS_FrigateVolCorvettes); // Attack the Corvettes first VarCreateSet ("AttackingCorvette", TRUE); ELSEIF (ShipsCount (SHIPS_FrigateVolFrigates) > 0) Attack (SHIPS_FrigateVolFrigates); // Attack Frigates second VarCreateSet ("AttackingFrigate", TRUE); ELSEIF (ShipsCount (SHIPS_FrigateVolFighters) > 0) Attack (SHIPS_FrigateVolFighters); // Attack Fighters third VarCreateSet ("AttackingFighter", TRUE); ELSEIF (ShipsCount (SHIPS_FrigateVolTOTAL) > 0) Attack (SHIPS_FrigateVolTOTAL); // Attack everyone else as a last resort VarCreateSet ("AttackingRemaining", TRUE); ENDIF ENDIF ENDINIT WATCH // **** watch everywhere stuff **** IF ( (TeamFuelAverage () < 20) AND (VarGet ("G_NobodyLeftToDockWith") = FALSE) ) Jump DockWithSupportFrigate; ENDIF IF ( (VarGet ("G_CollectorIsHurtin") = TRUE) AND (VarGet ("G_CollectorUnderAttack") = TRUE) ) Jump GuardCollector; ENDIF IF (ShipsCount (SHIPS_CarrierVolTOTAL) > 0) Jump AttackCarrierVol; ENDIF // if you lose more than 50% of the ships you had when you began the attack, then go dock with the Support Frigate IF ( (ShipsCount (THISTEAMSHIPS) < (5*(VarGet ("GoingInWithThisMany"))/10)) AND (VarGet ("G_NobodyLeftToDockWith") = FALSE) ) Jump DockWithSupportFrigate; ENDIF // if you kill off the ships you're attacking, go back to patrolling IF (VarGet ("AttackingFrigate") = TRUE) // If all Frigates are dead, go back to patrolling IF (ShipsCount (SHIPS_FrigateVolFrigates) = 0) VarDestroy ("AttackingFrigate"); Jump Patrol; ENDIF ELSEIF (VarGet ("AttackingCorvette") = TRUE) // If all Corvettes are dead, go back to patrolling IF (ShipsCount (SHIPS_FrigateVolCorvettes) = 0) VarDestroy ("AttackingCorvette"); Jump Patrol; ENDIF ELSEIF (VarGet ("AttackingFighter") = TRUE) // If all Fighters are dead, go back to patrolling IF (ShipsCount (SHIPS_FrigateVolFighters) = 0) VarDestroy ("AttackingFighter"); Jump Patrol; ENDIF ELSEIF (VarGet ("AttackingRemaining") = TRUE) // If everything else is dead, go back to patrolling IF (ShipsCount (SHIPS_FrigateVolTOTAL) = 0) VarDestroy ("AttackingRemaining"); Jump Patrol; ENDIF ENDIF // if you stop attacking for some reason, go patrol again IF ( (ShipsOrder (TEAMSHIPS_Interceptors1) != 2) OR (ShipsOrder (TEAMSHIPS_Interceptors2) != 2) ) Jump Patrol; ENDIF ENDWATCH ENDSTATE AttackFrigateVol //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE GuardCollector //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT IF (ShipsCount (TEAMSHIPS_Collector) > 0) Guard (TEAMSHIPS_Collector); ELSEIF (ShipsCount (TEAMSHIPS_Collector2) > 0) Guard (TEAMSHIPS_Collector2); ELSE Jump Patrol; ENDIF ENDINIT WATCH // **** watch everywhere stuff **** IF ( (TeamFuelAverage () < 20) AND (VarGet ("G_NobodyLeftToDockWith") = FALSE) ) Jump DockWithSupportFrigate; ENDIF IF (VarGet ("G_CollectorUnderAttack") = FALSE) // if the collector is no longer under attack, go back to patrolling Jump Patrol; ENDIF // if the enemy retreats, go back to patrolling IF (FindEnemiesNearTeam (SHIPS_InterceptorNearby, 10000) = 0) Jump Patrol; ENDIF ENDWATCH ENDSTATE GuardCollector //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE DockWithSupportFrigate //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT IF (ShipsCount (TEAMSHIPS_SupportFrigate) > 0) TacticsEvasive (); //DockStay (TEAM_SupportFrigate); DockSupportWith (TEAM_SupportFrigate); ELSEIF (ShipsCount (TEAMSHIPS_Carrier) > 0) TacticsEvasive (); //DockStay (TEAM_Carrier); DockSupportWith (TEAM_Carrier); ELSE VarCreateSet ("G_NobodyLeftToDockWith", TRUE); Jump Patrol; ENDIF ENDINIT WATCH //IF (TeamDockedReadyForLaunch ()) // //Jump BeingServiced; // Jump Launch; //ENDIF IF (NOT TeamDocking ()) Jump Patrol; ENDIF IF (VarGet ("G_NobodyLeftToDockWith") = TRUE) Jump Patrol; ENDIF ENDWATCH ENDSTATE DockWithSupportFrigate //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE BeingServiced //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT TimerCreateSetStart ("WaitToFinishServicing", 30); // Give the team some time to be refuelled / repaired ENDINIT WATCH IF (TimerExpiredDestroy ("WaitToFinishServicing")) Jump Launch; ENDIF IF (VarGet ("G_NobodyLeftToDockWith") = TRUE) Jump Patrol; ENDIF ENDWATCH ENDSTATE BeingServiced //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE AttackCollector //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT FindEnemiesInside (VOLUME_EntireWorld, SHIPS_EntireWorld, 1000); ShipsSelectType (SHIPS_Collectors, SHIPS_EntireWorld, "ResourceCollector"); IF (ShipsCount (SHIPS_Collectors) > 0) Attack (SHIPS_Collectors); VarCreateSet ("CollectorsOriginal", ShipsCount (SHIPS_Collectors)); VarCreateSet ("CollectorsKilled", 0); VarCreateSet ("KilledAtStartOfCollectorAttack", VarGet ("SHIPSKilled")); VarCreateSet ("KilledWhileAttackingCollector", 0); TimerCreateSetStart ("AttackingCollector", 600); ELSE Jump Patrol; ENDIF ENDINIT WATCH VarSet ("KilledWhileAttackingCollector", VarGet ("SHIPSKilled") - VarGet ("KilledAtStartOfCollectorAttack")); IF (ShipsCount (SHIPS_Collectors) < VarGet ("CollectorsOriginal")) // a collector must have died, so get out Jump Patrol; ELSEIF (TimerExpiredDestroy ("AttackingCollector")) // if the attack is taking forever, get outta there Jump Patrol; ELSEIF (VarGet ("KilledWhileAttackingCollector") >= 10) // if you lose more than 10 of your own guys while attacking, get out Jump Patrol; ELSEIF (TutGameSentMessage ("Game_PlayerHarvesterDone")) // if there are no more resources left in the world, go patrol Jump Patrol; ENDIF // if you stop attacking for some reason, go patrol again IF ( (ShipsOrder (TEAMSHIPS_Interceptors1) != 2) OR (ShipsOrder (TEAMSHIPS_Interceptors2) != 2) ) Jump Patrol; ENDIF ENDWATCH ENDSTATE AttackCollector //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE ACT3Guard //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT IF (ShipsCount (TEAMSHIPS_Carrier) > 0) Guard (TEAMSHIPS_Carrier); ELSEIF (ShipsCount (TEAMSHIPS_Destroyers1) > 0) Guard (TEAMSHIPS_Destroyers1); ELSEIF (ShipsCount (TEAMSHIPS_Destroyers2) > 0) Guard (TEAMSHIPS_Destroyers2); ELSEIF (ShipsCount (TEAMSHIPS_Frigates1) > 0) Guard (TEAMSHIPS_Frigates1); ELSEIF (ShipsCount (TEAMSHIPS_Frigates2) > 0) Guard (TEAMSHIPS_Frigates2); ELSEIF (ShipsCount (TEAMSHIPS_Frigates3) > 0) Guard (TEAMSHIPS_Frigates3); ELSE Jump ACT3AttackWorld; ENDIF ENDINIT WATCH ENDWATCH ENDSTATE ACT3Guard //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE ACT3AttackWorld //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT FindEnemiesInside (VOLUME_MothershipVolume, SHIPS_ACT3IntFound, 1000); IF (ShipsSelectClass (SHIPS_ACT3IntTargets, SHIPS_ACT3IntFound, "CLASS_Fighter")) ELSEIF (ShipsSelectClass (SHIPS_ACT3IntTargets, SHIPS_ACT3IntFound, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_ACT3IntTargets, SHIPS_ACT3IntFound, "CLASS_Corvette")) ELSE ShipsAdd (SHIPS_ACT3IntTargets, SHIPS_ACT3IntFound); ShipsSelectClass (SHIPS_Mothership, SHIPS_ACT3IntFound, "CLASS_Mothership"); ShipsSelectClass (SHIPS_Resource, SHIPS_ACT3IntFound, "CLASS_Resource"); ShipsSelectClass (SHIPS_NonCombat, SHIPS_ACT3IntFound, "CLASS_NonCombat"); ShipsSelectType (SHIPS_ResourceControllers, SHIPS_ACT3IntFound, "ResourceController"); ShipsRemove (SHIPS_ACT3IntTargets, SHIPS_Mothership); ShipsRemove (SHIPS_ACT3IntTargets, SHIPS_Resource); ShipsRemove (SHIPS_ACT3IntTargets, SHIPS_NonCombat); ShipsRemove (SHIPS_ACT3IntTargets, SHIPS_ResourceController); ENDIF IF (ShipsCount (SHIPS_ACT3IntTargets) > 0) Attack (SHIPS_ACT3IntTargets); ELSE Kamikaze (SHIPS_Mothership); ENDIF ENDINIT WATCH // if you stop attacking for some reason, go back to the same state IF ( (ShipsOrder (TEAMSHIPS_Interceptors1) != 2) OR (ShipsOrder (TEAMSHIPS_Interceptors2) != 2) ) Jump ACT3AttackWorld; ENDIF ENDWATCH ENDSTATE ACT3AttackWorld //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE NullState //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT ENDINIT WATCH ENDWATCH ENDSTATE NullState //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ENDFSM Interceptors //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Interceptors ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Frigates ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ FSM Frigates States AllDeadWaitForShips, WaitingToPatrol, Patrol, DefendYourself, AttackLeftBox, AttackRightBox, AttackCentreBox, AttackBottomBox, AttackTopBox, ACT3AttackMothership, ACT3DefendYourself, NullState; //AttackCarrierVol, AttackFrigateVol, NullState; INIT TeamHealthSet (60); // This puppy is hurtin VarCreateSet ("SHIPSOriginal", (ShipsCount (THISTEAMSHIPS))); VarCreateSet ("SHIPSRequested", 0); VarCreateSet ("SHIPSNeeded", 0); VarCreateSet ("SHIPSNewships", 0); VarCreateSet ("SHIPSKilled", 0); // Create a variable = to the number of ships killed VarSet ("G_TOTALOriginalFrigates", VarGet ("G_TOTALOriginalFrigates") + ShipsCount (THISTEAMSHIPS)); VarInc ("G_NumFrigateTeams"); // Used for identifying the teams VarCreateSet ("ThisFrigateNum", VarGet("G_NumFrigateTeams")); Jump WaitingToPatrol; ENDINIT WATCH // if there are 0 ships in the team, jump to a wait state to wait for more ships (otherwise the order will get lost) IF ( (ShipsCount (THISTEAMSHIPS) = 0) AND (VarGet ("WaitingForShips") = FALSE) ) Jump AllDeadWaitForShips; ENDIF // FRIGATES repopulation stuff from Falko IF ( (ShipsCount (THISTEAMSHIPS) + VarGet ("SHIPSRequested")) < VarGet ("SHIPSOriginal") ) VarSet ("SHIPSNeeded", (VarGet ("SHIPSOriginal") - (ShipsCount (THISTEAMSHIPS) + VarGet("SHIPSRequested")))); RequestShips ("StandardFrigate", VarGet ("SHIPSNeeded")); VarSet ("SHIPSKilled", VarGet ("SHIPSKilled") + VarGet ("SHIPSNeeded")); //VarSet ("G_TOTALFrigatesKilled", VarGet ("G_TOTALFrigatesKilled") + VarGet ("SHIPSKilled")); VarSet("SHIPSRequested", VarGet("SHIPSRequested") + VarGet("SHIPSNeeded")); ENDIF VarSet ("SHIPSNewships", NewShipsAdded()); IF (VarGet("SHIPSNewships")) //FormationBroad (); VarSet("SHIPSRequested", VarGet("SHIPSRequested") - VarGet("SHIPSNewships")); ENDIF // if you're under attack, set a variable (used for playing the 'teach move while attacking' speech event) IF (UnderAttack (SHIPS_FrigatesUnderAttack) AND (VarGet ("G_FrigatesUnderAttack") = 0)) ShipsSelectClass (SHIPS_FrigatesVsFrigates, SHIPS_FrigatesUnderAttack, "CLASS_Frigate"); IF (ShipsCount (SHIPS_FrigatesVsFrigates) > 0) VarSet ("G_FrigatesUnderAttack", VarGet("ThisFrigateNum")); ENDIF ELSEIF ((NOT UnderAttack (SHIPS_NullFalkoIsCool)) AND (VarGet("G_FrigatesUnderAttack") = VarGet("ThisFrigateNum"))) VarSet ("G_FrigatesUnderAttack", 0); ENDIF // when ACT3 has begun, go attack the player's Mothership IFONCE (VarGet ("G_ACT3HasBegun") = TRUE) Jump ACT3AttackMothership; ENDIFONCE ENDWATCH STATE AllDeadWaitForShips //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT VarCreateSet ("WaitingForShips", TRUE); ENDINIT WATCH IF (ShipsCount (THISTEAMSHIPS) > 0) VarDestroy ("WaitingForShips"); Jump Patrol; ENDIF ENDWATCH ENDSTATE AllDeadWaitForShips //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE WaitingToPatrol //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT ENDINIT WATCH TeamHealthSet (60); // Keep resetting health until the player finds them IF (ObjectiveGet ("SendProbe") = TRUE) Jump Patrol; ENDIF ENDWATCH ENDSTATE WaitingToPatrol //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE Patrol //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT FormationBroad (); IF (ThisTeamIs (TEAM_Frigates1)) PatrolPath (PATH_Frigate1Path); ELSEIF (ThisTeamIS (TEAM_Frigates2)) PatrolPath (PATH_Frigate2Path); ELSEIF (ThisTeamIS (TEAM_Frigates3)) PatrolPath (PATH_Frigate3Path); ENDIF ENDINIT WATCH // when ACT3 has begun, go attack the player's Mothership IF (VarGet ("G_ACT3HasBegun") = TRUE) Jump ACT3AttackMothership; ENDIF // check all the volumes and decide where to go IF (ThisTeamIs (TEAM_Frigates1)) IF (TimerExpiredDestroy ("RightBoxDelayTIMER")) TimerDestroy ("BottomBoxDelayTIMER"); TimerDestroy ("TopBoxDelayTIMER"); Jump AttackRightBox; ENDIF IF (TimerExpiredDestroy ("BottomBoxDelayTIMER")) TimerDestroy ("RightBoxDelayTIMER"); TimerDestroy ("TopBoxDelayTIMER"); Jump AttackBottomBox; ENDIF IF (TimerExpiredDestroy ("TopBoxDelayTIMER")) TimerDestroy ("BottomBoxDelayTIMER"); TimerDestroy ("TopBoxDelayTIMER"); Jump AttackTopBox; ENDIF IF (FindEnemiesInside (VOLUME_LeftBox, SHIPS_Frig1LeftBoxFOUND, 1000)) TimerDestroy ("RightBoxDelayTIMER"); TimerDestroy ("BottomBoxDelayTIMER"); TimerDestroy ("TopBoxDelayTIMER"); Jump AttackLeftBox; ELSEIF (FindEnemiesInside (VOLUME_CentreBox, SHIPS_Frig1CentreBoxFOUND, 1000)) TimerDestroy ("RightBoxDelayTIMER"); TimerDestroy ("BottomBoxDelayTIMER"); TimerDestroy ("TopBoxDelayTIMER"); Jump AttackCentreBox; ELSEIF ( (FindEnemiesInside (VOLUME_RightBox, SHIPS_Frig1RightBoxFOUND, 1000)) AND (NOT TimerRemaining ("RightBoxDelayTIMER")) ) TimerCreateSetStart ("RightBoxDelayTIMER", 90); ELSEIF ( (FindEnemiesInside (VOLUME_BottomBox, SHIPS_Frig1BottomBoxFOUND, 1000)) AND (NOT TimerRemaining ("BottomBoxDelayTIMER")) ) TimerCreateSetStart ("BottomBoxDelayTIMER", 120); ELSEIF ( (FindEnemiesInside (VOLUME_TopBox, SHIPS_Frig1TopBoxFOUND, 1000)) AND (NOT TimerRemaining ("TopBoxDelayTIMER")) ) TimerCreateSetStart ("TopBoxDelayTIMER", 120); ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF (TimerExpiredDestroy ("LeftBoxDelayTIMER")) TimerDestroy ("BottomBoxDelayTIMER"); TimerDestroy ("TopBoxDelayTIMER"); Jump AttackLeftBox; ENDIF IF (TimerExpiredDestroy ("BottomBoxDelayTIMER")) TimerDestroy ("RightBoxDelayTIMER"); TimerDestroy ("TopBoxDelayTIMER"); Jump AttackBottomBox; ENDIF IF (TimerExpiredDestroy ("TopBoxDelayTIMER")) TimerDestroy ("BottomBoxDelayTIMER"); TimerDestroy ("TopBoxDelayTIMER"); Jump AttackTopBox; ENDIF IF (FindEnemiesInside (VOLUME_RightBox, SHIPS_Frig2RightBoxFOUND, 1000)) TimerDestroy ("RightBoxDelayTIMER"); TimerDestroy ("BottomBoxDelayTIMER"); TimerDestroy ("TopBoxDelayTIMER"); Jump AttackRightBox; ELSEIF (FindEnemiesInside (VOLUME_CentreBox, SHIPS_Frig2CentreBoxFOUND, 1000)) TimerDestroy ("RightBoxDelayTIMER"); TimerDestroy ("BottomBoxDelayTIMER"); TimerDestroy ("TopBoxDelayTIMER"); Jump AttackCentreBox; ELSEIF ( (FindEnemiesInside (VOLUME_LeftBox, SHIPS_Frig2LeftBoxFOUND, 1000)) AND (NOT TimerRemaining ("LeftBoxDelayTIMER")) ) TimerCreateSetStart ("LeftBoxDelayTIMER", 90); ELSEIF ( (FindEnemiesInside (VOLUME_BottomBox, SHIPS_Frig2BottomBoxFOUND, 1000)) AND (NOT TimerRemaining ("BottomBoxDelayTIMER")) ) TimerCreateSetStart ("BottomBoxDelayTIMER", 120); ELSEIF ( (FindEnemiesInside (VOLUME_TopBox, SHIPS_Frig2TopBoxFOUND, 1000)) AND (NOT TimerRemaining ("TopBoxDelayTIMER")) ) TimerCreateSetStart ("TopBoxDelayTIMER", 120); ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates3)) IF (TimerExpiredDestroy ("RightBoxDelayTIMER")) TimerDestroy ("LeftBoxDelayTIMER"); TimerDestroy ("CentreBoxDelayTIMER"); TimerDestroy ("TopBoxDelayTIMER"); Jump AttackRightBox; ENDIF IF (TimerExpiredDestroy ("LeftBoxDelayTIMER")) TimerDestroy ("RightBoxDelayTIMER"); TimerDestroy ("CentreBoxDelayTIMER"); TimerDestroy ("TopBoxDelayTIMER"); Jump AttackLeftBox; ENDIF IF (TimerExpiredDestroy ("CentreBoxDelayTIMER")) TimerDestroy ("RightBoxDelayTIMER"); TimerDestroy ("LeftBoxDelayTIMER"); TimerDestroy ("TopBoxDelayTIMER"); Jump AttackCentreBox; ENDIF IF (TimerExpiredDestroy ("TopBoxDelayTIMER")) TimerDestroy ("RightBoxDelayTIMER"); TimerDestroy ("CentreBoxDelayTIMER"); TimerDestroy ("LeftBoxDelayTIMER"); Jump AttackTopBox; ENDIF IF (FindEnemiesInside (VOLUME_BottomBox, SHIPS_Frig3BottomBoxFOUND, 1000)) TimerDestroy ("RightBoxDelayTIMER"); TimerDestroy ("LeftBoxDelayTIMER"); TimerDestroy ("TopBoxDelayTIMER"); Jump AttackLeftBox; ELSEIF ( (FindEnemiesInside (VOLUME_RightBox, SHIPS_Frig3RightBoxFOUND, 1000)) AND (NOT TimerRemaining ("RightBoxDelayTIMER")) ) TimerCreateSetStart ("RightBoxDelayTIMER", 90); ELSEIF ( (FindEnemiesInside (VOLUME_LeftBox, SHIPS_Frig3LeftBoxFOUND, 1000)) AND (NOT TimerRemaining ("LeftBoxDelayTIMER")) ) TimerCreateSetStart ("LeftBoxDelayTIMER", 90); ELSEIF ( (FindEnemiesInside (VOLUME_CentreBox, SHIPS_Frig3CentreBoxFOUND, 1000)) AND (NOT TimerRemaining ("CentreBoxDelayTIMER")) ) TimerCreateSetStart ("CentreBoxDelayTIMER", 90); ELSEIF ( (FindEnemiesInside (VOLUME_TopBox, SHIPS_Frig3TopBoxFOUND, 1000)) AND (NOT TimerRemaining ("TopBoxDelayTIMER")) ) TimerCreateSetStart ("TopBoxDelayTIMER", 120); ENDIF ENDIF // if you're under attack, defend yourself IF (ThisTeamIs (TEAM_Frigates1)) IF (UnderAttack (SHIPS_Frig1UnderAttack)) ShipsSelectClass (SHIPS_Mothership, SHIPS_Frig1UnderAttack, "CLASS_Mothership"); // Select the Mothership ShipsRemove (SHIPS_Frig1UnderAttack, SHIPS_Mothership); // And filter it out IF (ShipsCount (SHIPS_Frig1UnderAttack) > 0) TimerDestroy ("RightBoxDelayTIMER"); TimerDestroy ("LeftBoxDelayTIMER"); TimerDestroy ("CentreBoxDelayTIMER"); TimerDestroy ("BottomBoxDelayTIMER"); TimerDestroy ("TopBoxDelayTIMER"); Jump DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF (UnderAttack (SHIPS_Frig2UnderAttack)) ShipsSelectClass (SHIPS_Mothership, SHIPS_Frig2UnderAttack, "CLASS_Mothership"); // Select the Mothership ShipsRemove (SHIPS_Frig2UnderAttack, SHIPS_Mothership); // And filter it out IF (ShipsCount (SHIPS_Frig2UnderAttack) > 0) TimerDestroy ("RightBoxDelayTIMER"); TimerDestroy ("LeftBoxDelayTIMER"); TimerDestroy ("CentreBoxDelayTIMER"); TimerDestroy ("BottomBoxDelayTIMER"); TimerDestroy ("TopBoxDelayTIMER"); Jump DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates3)) IF (UnderAttack (SHIPS_Frig3UnderAttack)) ShipsSelectClass (SHIPS_Mothership, SHIPS_Frig3UnderAttack, "CLASS_Mothership"); // Select the Mothership ShipsRemove (SHIPS_Frig3UnderAttack, SHIPS_Mothership); // And filter it out IF (ShipsCount (SHIPS_Frig3UnderAttack) > 0) TimerDestroy ("RightBoxDelayTIMER"); TimerDestroy ("LeftBoxDelayTIMER"); TimerDestroy ("CentreBoxDelayTIMER"); TimerDestroy ("BottomBoxDelayTIMER"); TimerDestroy ("TopBoxDelayTIMER"); Jump DefendYourself; ENDIF ENDIF ENDIF // if some Salvage Corvettes show up, jump to DefendYourself state to kill them IF (ThisTeamIs (TEAM_Frigates1)) IF (FindEnemiesNearTeam (SHIPS_Frig1L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig1FoundSomeSCs, SHIPS_Frig1L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig1FoundSomeSCs) > 0) Jump DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF (FindEnemiesNearTeam (SHIPS_Frig2L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig2FoundSomeSCs, SHIPS_Frig2L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig2FoundSomeSCs) > 0) Jump DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates3)) IF (FindEnemiesNearTeam (SHIPS_Frig3L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig3FoundSomeSCs, SHIPS_Frig3L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig3FoundSomeSCs) > 0) Jump DefendYourself; ENDIF ENDIF ENDIF ENDWATCH ENDSTATE Patrol //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE DefendYourself //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT IF (ThisTeamIs (TEAM_Frigates1)) IF (ShipsSelectType (SHIPS_Frig1NearbyTargets, SHIPS_Frig1UnderAttack, "SalCapCorvette")) ELSEIF (ShipsSelectType (SHIPS_Frig1NearbyTargets, SHIPS_Frig1FoundSomeSCs, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig1NearbyTargets, SHIPS_Frig1UnderAttack, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig1NearbyTargets, SHIPS_Frig1UnderAttack, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Frig1NearbyTargets, SHIPS_Frig1UnderAttack, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Frig1NearbyTargets, SHIPS_Frig1UnderAttack); ENDIF IF (ShipsCount (SHIPS_Frig1NearbyTargets) > 0) Attack (SHIPS_Frig1NearbyTargets); ELSE Jump Patrol; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF (ShipsSelectType (SHIPS_Frig2NearbyTargets, SHIPS_Frig2UnderAttack, "SalCapCorvette")) ELSEIF (ShipsSelectType (SHIPS_Frig2NearbyTargets, SHIPS_Frig2FoundSomeSCs, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig2NearbyTargets, SHIPS_Frig2UnderAttack, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig2NearbyTargets, SHIPS_Frig2UnderAttack, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Frig2NearbyTargets, SHIPS_Frig2UnderAttack, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Frig2NearbyTargets, SHIPS_Frig2UnderAttack); ENDIF IF (ShipsCount (SHIPS_Frig2NearbyTargets) > 0) Attack (SHIPS_Frig2NearbyTargets); ELSE Jump Patrol; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates3)) IF (ShipsSelectType (SHIPS_Frig3NearbyTargets, SHIPS_Frig3UnderAttack, "SalCapCorvette")) ELSEIF (ShipsSelectType (SHIPS_Frig3NearbyTargets, SHIPS_Frig3FoundSomeSCs, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig3NearbyTargets, SHIPS_Frig3UnderAttack, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig3NearbyTargets, SHIPS_Frig3UnderAttack, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Frig3NearbyTargets, SHIPS_Frig3UnderAttack, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Frig3NearbyTargets, SHIPS_Frig3UnderAttack); ENDIF IF (ShipsCount (SHIPS_Frig3NearbyTargets) > 0) Attack (SHIPS_Frig3NearbyTargets); ELSE Jump Patrol; ENDIF ENDIF ENDINIT WATCH // if the ships you're attacking die OR you stop attacking for some reason, jump back into this state to kill the rest of the baddies IF (ThisTeamIs (TEAM_Frigates1)) IF ( (ShipsCount (SHIPS_Frig1NearbyTargets) = 0) OR (ShipsOrder (TEAMSHIPS_Frigates1) != 2) ) Jump DefendYourself; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF ( (ShipsCount (SHIPS_Frig2NearbyTargets) = 0) OR (ShipsOrder (TEAMSHIPS_Frigates2) != 2) ) Jump DefendYourself; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates3)) IF ( (ShipsCount (SHIPS_Frig3NearbyTargets) = 0) OR (ShipsOrder (TEAMSHIPS_Frigates3) != 2) ) Jump DefendYourself; ENDIF ENDIF // if some Salvage Corvettes show up, jump back into this state to kill them IF (ThisTeamIs (TEAM_Frigates1)) IF (FindEnemiesNearTeam (SHIPS_Frig1L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig1FoundSomeSCs, SHIPS_Frig1L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig1FoundSomeSCs) > 0) Jump DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF (FindEnemiesNearTeam (SHIPS_Frig2L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig2FoundSomeSCs, SHIPS_Frig2L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig2FoundSomeSCs) > 0) Jump DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates3)) IF (FindEnemiesNearTeam (SHIPS_Frig3L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig3FoundSomeSCs, SHIPS_Frig3L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig3FoundSomeSCs) > 0) Jump DefendYourself; ENDIF ENDIF ENDIF ENDWATCH ENDSTATE DefendYourself //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE AttackLeftBox //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT IF (ThisTeamIs (TEAM_Frigates1)) FindEnemiesInside (VOLUME_LeftBox, SHIPS_Frig1LeftBoxFOUND, 1000); IF (ShipsSelectType (SHIPS_FrigNearbyTargets, SHIPS_FrigUnderAttack, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig1LeftBoxTargets, SHIPS_Frig1LeftBoxFOUND, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig1LeftBoxTargets, SHIPS_Frig1LeftBoxFOUND, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Frig1LeftBoxTargets, SHIPS_Frig1LeftBoxFOUND, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Frig1LeftBoxTargets, SHIPS_Frig1LeftBoxFOUND); ENDIF IF (ShipsCount (SHIPS_Frig1LeftBoxTargets) > 0) Attack (SHIPS_Frig1LeftBoxTargets); ELSE Jump Patrol; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) FindEnemiesInside (VOLUME_LeftBox, SHIPS_Frig2LeftBoxFOUND, 1000); IF (ShipsSelectType (SHIPS_FrigNearbyTargets, SHIPS_FrigUnderAttack, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig2LeftBoxTargets, SHIPS_Frig2LeftBoxFOUND, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig2LeftBoxTargets, SHIPS_Frig2LeftBoxFOUND, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Frig2LeftBoxTargets, SHIPS_Frig2LeftBoxFOUND, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Frig2LeftBoxTargets, SHIPS_Frig2LeftBoxFOUND); ENDIF IF (ShipsCount (SHIPS_Frig2LeftBoxTargets) > 0) Attack (SHIPS_Frig2LeftBoxTargets); ELSE Jump Patrol; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates3)) FindEnemiesInside (VOLUME_LeftBox, SHIPS_Frig3LeftBoxFOUND, 1000); IF (ShipsSelectType (SHIPS_FrigNearbyTargets, SHIPS_FrigUnderAttack, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig3LeftBoxTargets, SHIPS_Frig3LeftBoxFOUND, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig3LeftBoxTargets, SHIPS_Frig3LeftBoxFOUND, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Frig3LeftBoxTargets, SHIPS_Frig3LeftBoxFOUND, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Frig3LeftBoxTargets, SHIPS_Frig3LeftBoxFOUND); ENDIF IF (ShipsCount (SHIPS_Frig3LeftBoxTargets) > 0) Attack (SHIPS_Frig3LeftBoxTargets); ELSE Jump Patrol; ENDIF ENDIF ENDINIT WATCH VarCreateSet ("G_SHIPSLeftBoxTargets", ShipsCount (SHIPS_Frig1LeftBoxTargets)); VarCreateSet ("G_Frigates1ShipsORDER", ShipsOrder (TEAMSHIPS_Frigates1)); // if the ships you're attacking die OR you stop attacking for some reason, jump back into this state to kill the rest of the baddies IF (ThisTeamIs (TEAM_Frigates1)) IF ( (ShipsCount (SHIPS_Frig1LeftBoxTargets) = 0) OR (ShipsOrder (TEAMSHIPS_Frigates1) != 2) ) Jump AttackLeftBox; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF ( (ShipsCount (SHIPS_Frig2LeftBoxTargets) = 0) OR (ShipsOrder (TEAMSHIPS_Frigates2) != 2) ) Jump AttackLeftBox; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates3)) IF ( (ShipsCount (SHIPS_Frig3LeftBoxTargets) = 0) OR (ShipsOrder (TEAMSHIPS_Frigates3) != 2) ) Jump AttackLeftBox; ENDIF ENDIF // if some Salvage Corvettes show up, jump to the DefendYourself state to kill them IF (ThisTeamIs (TEAM_Frigates1)) IF (FindEnemiesNearTeam (SHIPS_Frig1L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig1FoundSomeSCs, SHIPS_Frig1L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig1FoundSomeSCs) > 0) Jump DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF (FindEnemiesNearTeam (SHIPS_Frig2L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig2FoundSomeSCs, SHIPS_Frig2L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig2FoundSomeSCs) > 0) Jump DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates3)) IF (FindEnemiesNearTeam (SHIPS_Frig3L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig3FoundSomeSCs, SHIPS_Frig3L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig3FoundSomeSCs) > 0) Jump DefendYourself; ENDIF ENDIF ENDIF ENDWATCH ENDSTATE AttackLeftBox //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE AttackRightBox //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT IF (ThisTeamIs (TEAM_Frigates1)) FindEnemiesInside (VOLUME_RightBox, SHIPS_Frig1RightBoxFOUND, 1000); IF (ShipsSelectType (SHIPS_FrigNearbyTargets, SHIPS_FrigUnderAttack, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig1RightBoxTargets, SHIPS_Frig1RightBoxFOUND, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig1RightBoxTargets, SHIPS_Frig1RightBoxFOUND, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Frig1RightBoxTargets, SHIPS_Frig1RightBoxFOUND, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Frig1RightBoxTargets, SHIPS_Frig1RightBoxFOUND); ENDIF IF (ShipsCount (SHIPS_Frig1RightBoxTargets) > 0) Attack (SHIPS_Frig1RightBoxTargets); ELSE Jump Patrol; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) FindEnemiesInside (VOLUME_RightBox, SHIPS_Frig2RightBoxFOUND, 1000); IF (ShipsSelectType (SHIPS_FrigNearbyTargets, SHIPS_FrigUnderAttack, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig2RightBoxTargets, SHIPS_Frig2RightBoxFOUND, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig2RightBoxTargets, SHIPS_Frig2RightBoxFOUND, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Frig2RightBoxTargets, SHIPS_Frig2RightBoxFOUND, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Frig2RightBoxTargets, SHIPS_Frig2RightBoxFOUND); ENDIF IF (ShipsCount (SHIPS_Frig2RightBoxTargets) > 0) Attack (SHIPS_Frig2RightBoxTargets); ELSE Jump Patrol; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates3)) FindEnemiesInside (VOLUME_RightBox, SHIPS_Frig3RightBoxFOUND, 1000); IF (ShipsSelectType (SHIPS_FrigNearbyTargets, SHIPS_FrigUnderAttack, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig3RightBoxTargets, SHIPS_Frig3RightBoxFOUND, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig3RightBoxTargets, SHIPS_Frig3RightBoxFOUND, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Frig3RightBoxTargets, SHIPS_Frig3RightBoxFOUND, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Frig3RightBoxTargets, SHIPS_Frig3RightBoxFOUND); ENDIF IF (ShipsCount (SHIPS_Frig3RightBoxTargets) > 0) Attack (SHIPS_Frig3RightBoxTargets); ELSE Jump Patrol; ENDIF ENDIF ENDINIT WATCH // if the ships you're attacking die OR you stop attacking for some reason, jump back into this state to kill the rest of the baddies IF (ThisTeamIs (TEAM_Frigates1)) IF ( (ShipsCount (SHIPS_Frig1RightBoxTargets) = 0) OR (ShipsOrder (TEAMSHIPS_Frigates1) != 2) ) Jump AttackRightBox; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF ( (ShipsCount (SHIPS_Frig2RightBoxTargets) = 0) OR (ShipsOrder (TEAMSHIPS_Frigates2) != 2) ) Jump AttackRightBox; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates3)) IF ( (ShipsCount (SHIPS_Frig3RightBoxTargets) = 0) OR (ShipsOrder (TEAMSHIPS_Frigates3) != 2) ) Jump AttackRightBox; ENDIF ENDIF // if some Salvage Corvettes show up, jump to the DefendYourself state to kill them IF (ThisTeamIs (TEAM_Frigates1)) IF (FindEnemiesNearTeam (SHIPS_Frig1L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig1FoundSomeSCs, SHIPS_Frig1L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig1FoundSomeSCs) > 0) Jump DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF (FindEnemiesNearTeam (SHIPS_Frig2L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig2FoundSomeSCs, SHIPS_Frig2L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig2FoundSomeSCs) > 0) Jump DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF (FindEnemiesNearTeam (SHIPS_Frig3L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig3FoundSomeSCs, SHIPS_Frig3L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig3FoundSomeSCs) > 0) Jump DefendYourself; ENDIF ENDIF ENDIF ENDWATCH ENDSTATE AttackRightBox //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE AttackCentreBox //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT IF (ThisTeamIs (TEAM_Frigates1)) FindEnemiesInside (VOLUME_CentreBox, SHIPS_Frig1CentreBoxFOUND, 1000); IF (ShipsSelectType (SHIPS_FrigNearbyTargets, SHIPS_FrigUnderAttack, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig1CentreBoxTargets, SHIPS_Frig1CentreBoxFOUND, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig1CentreBoxTargets, SHIPS_Frig1CentreBoxFOUND, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Frig1CentreBoxTargets, SHIPS_Frig1CentreBoxFOUND, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Frig1CentreBoxTargets, SHIPS_Frig1CentreBoxFOUND); ENDIF IF (ShipsCount (SHIPS_Frig1CentreBoxTargets) > 0) Attack (SHIPS_Frig1CentreBoxTargets); ELSE Jump Patrol; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) FindEnemiesInside (VOLUME_CentreBox, SHIPS_Frig2CentreBoxFOUND, 1000); IF (ShipsSelectType (SHIPS_FrigNearbyTargets, SHIPS_FrigUnderAttack, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig2CentreBoxTargets, SHIPS_Frig2CentreBoxFOUND, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig2CentreBoxTargets, SHIPS_Frig2CentreBoxFOUND, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Frig2CentreBoxTargets, SHIPS_Frig2CentreBoxFOUND, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Frig2CentreBoxTargets, SHIPS_Frig2CentreBoxFOUND); ENDIF IF (ShipsCount (SHIPS_Frig2CentreBoxTargets) > 0) Attack (SHIPS_Frig2CentreBoxTargets); ELSE Jump Patrol; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates3)) FindEnemiesInside (VOLUME_CentreBox, SHIPS_Frig3CentreBoxFOUND, 1000); IF (ShipsSelectType (SHIPS_FrigNearbyTargets, SHIPS_FrigUnderAttack, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig3CentreBoxTargets, SHIPS_Frig3CentreBoxFOUND, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig3CentreBoxTargets, SHIPS_Frig3CentreBoxFOUND, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Frig3CentreBoxTargets, SHIPS_Frig3CentreBoxFOUND, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Frig3CentreBoxTargets, SHIPS_Frig3CentreBoxFOUND); ENDIF IF (ShipsCount (SHIPS_Frig3CentreBoxTargets) > 0) Attack (SHIPS_Frig3CentreBoxTargets); ELSE Jump Patrol; ENDIF ENDIF ENDINIT WATCH // if the ships you're attacking die OR you stop attacking for some reason, jump back into this state to kill the rest of the baddies IF (ThisTeamIs (TEAM_Frigates1)) IF ( (ShipsCount (SHIPS_Frig1CentreBoxTargets) = 0) OR (ShipsOrder (TEAMSHIPS_Frigates1) != 2) ) Jump AttackCentreBox; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF ( (ShipsCount (SHIPS_Frig2CentreBoxTargets) = 0) OR (ShipsOrder (TEAMSHIPS_Frigates2) = !2) ) Jump AttackCentreBox; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates3)) IF ( (ShipsCount (SHIPS_Frig3CentreBoxTargets) = 0) OR (ShipsOrder (TEAMSHIPS_Frigates3) != 2) ) Jump AttackCentreBox; ENDIF ENDIF // if some Salvage Corvettes show up, jump to the DefendYourself state to kill them IF (ThisTeamIs (TEAM_Frigates1)) IF (FindEnemiesNearTeam (SHIPS_Frig1L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig1FoundSomeSCs, SHIPS_Frig1L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig1FoundSomeSCs) > 0) Jump DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF (FindEnemiesNearTeam (SHIPS_Frig2L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig2FoundSomeSCs, SHIPS_Frig2L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig2FoundSomeSCs) > 0) Jump DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF (FindEnemiesNearTeam (SHIPS_Frig3L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig3FoundSomeSCs, SHIPS_Frig3L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig3FoundSomeSCs) > 0) Jump DefendYourself; ENDIF ENDIF ENDIF ENDWATCH ENDSTATE AttackCentreBox //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE AttackBottomBox //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT IF (ThisTeamIs (TEAM_Frigates1)) FindEnemiesInside (VOLUME_BottomBox, SHIPS_Frig1BottomBoxFOUND, 1000); IF (ShipsSelectType (SHIPS_FrigNearbyTargets, SHIPS_FrigUnderAttack, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig1BottomBoxTargets, SHIPS_Frig1BottomBoxFOUND, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig1BottomBoxTargets, SHIPS_Frig1BottomBoxFOUND, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Frig1BottomBoxTargets, SHIPS_Frig1BottomBoxFOUND, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Frig1BottomBoxTargets, SHIPS_Frig1BottomBoxFOUND); ENDIF IF (ShipsCount (SHIPS_Frig1BottomBoxTargets) > 0) Attack (SHIPS_Frig1BottomBoxTargets); ELSE Jump Patrol; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) FindEnemiesInside (VOLUME_BottomBox, SHIPS_Frig2BottomBoxFOUND, 1000); IF (ShipsSelectType (SHIPS_FrigNearbyTargets, SHIPS_FrigUnderAttack, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig2BottomBoxTargets, SHIPS_Frig2BottomBoxFOUND, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig2BottomBoxTargets, SHIPS_Frig2BottomBoxFOUND, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Frig2BottomBoxTargets, SHIPS_Frig2BottomBoxFOUND, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Frig2BottomBoxTargets, SHIPS_Frig2BottomBoxFOUND); ENDIF IF (ShipsCount (SHIPS_Frig2BottomBoxTargets) > 0) Attack (SHIPS_Frig2BottomBoxTargets); ELSE Jump Patrol; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates3)) FindEnemiesInside (VOLUME_BottomBox, SHIPS_Frig3BottomBoxFOUND, 1000); IF (ShipsSelectType (SHIPS_FrigNearbyTargets, SHIPS_FrigUnderAttack, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig3BottomBoxTargets, SHIPS_Frig3BottomBoxFOUND, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig3BottomBoxTargets, SHIPS_Frig3BottomBoxFOUND, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Frig3BottomBoxTargets, SHIPS_Frig3BottomBoxFOUND, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Frig3BottomBoxTargets, SHIPS_Frig3BottomBoxFOUND); ENDIF IF (ShipsCount (SHIPS_Frig3BottomBoxTargets) > 0) Attack (SHIPS_Frig3BottomBoxTargets); ELSE Jump Patrol; ENDIF ENDIF ENDINIT WATCH // if the ships you're attacking die OR you stop attacking for some reason, jump back into this state to kill the rest of the baddies IF (ThisTeamIs (TEAM_Frigates1)) IF ( (ShipsCount (SHIPS_Frig1BottomBoxTargets) = 0) OR (ShipsOrder (TEAMSHIPS_Frigates1) != 2) ) Jump AttackBottomBox; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF ( (ShipsCount (SHIPS_Frig2BottomBoxTargets) = 0) OR (ShipsOrder (TEAMSHIPS_Frigates2) != 2) ) Jump AttackBottomBox; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates3)) IF ( (ShipsCount (SHIPS_Frig3BottomBoxTargets) = 0) OR (ShipsOrder (TEAMSHIPS_Frigates3) != 2) ) Jump AttackBottomBox; ENDIF ENDIF // if some Salvage Corvettes show up, jump to the DefendYourself state to kill them IF (ThisTeamIs (TEAM_Frigates1)) IF (FindEnemiesNearTeam (SHIPS_Frig1L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig1FoundSomeSCs, SHIPS_Frig1L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig1FoundSomeSCs) > 0) Jump DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF (FindEnemiesNearTeam (SHIPS_Frig2L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig2FoundSomeSCs, SHIPS_Frig2L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig2FoundSomeSCs) > 0) Jump DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF (FindEnemiesNearTeam (SHIPS_Frig3L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig3FoundSomeSCs, SHIPS_Frig3L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig3FoundSomeSCs) > 0) Jump DefendYourself; ENDIF ENDIF ENDIF ENDWATCH ENDSTATE AttackBottomBox //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE AttackTopBox //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT IF (ThisTeamIs (TEAM_Frigates1)) FindEnemiesInside (VOLUME_TopBox, SHIPS_Frig1TopBoxFOUND, 1000); IF (ShipsSelectType (SHIPS_FrigNearbyTargets, SHIPS_FrigUnderAttack, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig1TopBoxTargets, SHIPS_Frig1TopBoxFOUND, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig1TopBoxTargets, SHIPS_Frig1TopBoxFOUND, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Frig1TopBoxTargets, SHIPS_Frig1TopBoxFOUND, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Frig1TopBoxTargets, SHIPS_Frig1TopBoxFOUND); ENDIF IF (ShipsCount (SHIPS_Frig1TopBoxTargets) > 0) Attack (SHIPS_Frig1TopBoxTargets); ELSE Jump Patrol; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) FindEnemiesInside (VOLUME_TopBox, SHIPS_Frig2TopBoxFOUND, 1000); IF (ShipsSelectType (SHIPS_FrigNearbyTargets, SHIPS_FrigUnderAttack, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig2TopBoxTargets, SHIPS_Frig2TopBoxFOUND, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig2TopBoxTargets, SHIPS_Frig2TopBoxFOUND, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Frig2TopBoxTargets, SHIPS_Frig2TopBoxFOUND, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Frig2TopBoxTargets, SHIPS_Frig2TopBoxFOUND); ENDIF IF (ShipsCount (SHIPS_Frig2TopBoxTargets) > 0) Attack (SHIPS_Frig2TopBoxTargets); ELSE Jump Patrol; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates3)) FindEnemiesInside (VOLUME_TopBox, SHIPS_Frig3TopBoxFOUND, 1000); IF (ShipsSelectType (SHIPS_FrigNearbyTargets, SHIPS_FrigUnderAttack, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig3TopBoxTargets, SHIPS_Frig3TopBoxFOUND, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig3TopBoxTargets, SHIPS_Frig3TopBoxFOUND, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Frig3TopBoxTargets, SHIPS_Frig3TopBoxFOUND, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Frig3TopBoxTargets, SHIPS_Frig3TopBoxFOUND); ENDIF IF (ShipsCount (SHIPS_Frig3TopBoxTargets) > 0) Attack (SHIPS_Frig3TopBoxTargets); ELSE Jump Patrol; ENDIF ENDIF ENDINIT WATCH //VarCreateSet ("G_SHIPSTopBoxTargets", ShipsCount (SHIPS_Frig1TopBoxTargets)); //VarCreateSet ("G_Frigates1ShipsORDER", ShipsOrder (TEAMSHIPS_Frigates1)); // if the ships you're attacking die OR you stop attacking for some reason, jump back into this state to kill the rest of the baddies IF (ThisTeamIs (TEAM_Frigates1)) IF ( (ShipsCount (SHIPS_Frig1TopBoxTargets) = 0) OR (ShipsOrder (TEAMSHIPS_Frigates1) != 2) ) Jump AttackTopBox; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF ( (ShipsCount (SHIPS_Frig2TopBoxTargets) = 0) OR (ShipsOrder (TEAMSHIPS_Frigates2) != 2) ) Jump AttackTopBox; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates3)) IF ( (ShipsCount (SHIPS_Frig3TopBoxTargets) = 0) OR (ShipsOrder (TEAMSHIPS_Frigates3) != 2) ) Jump AttackTopBox; ENDIF ENDIF // if some Salvage Corvettes show up, jump to the DefendYourself state to kill them IF (ThisTeamIs (TEAM_Frigates1)) IF (FindEnemiesNearTeam (SHIPS_Frig1L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig1FoundSomeSCs, SHIPS_Frig1L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig1FoundSomeSCs) > 0) Jump DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF (FindEnemiesNearTeam (SHIPS_Frig2L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig2FoundSomeSCs, SHIPS_Frig2L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig2FoundSomeSCs) > 0) Jump DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF (FindEnemiesNearTeam (SHIPS_Frig3L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig3FoundSomeSCs, SHIPS_Frig3L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig3FoundSomeSCs) > 0) Jump DefendYourself; ENDIF ENDIF ENDIF ENDWATCH ENDSTATE AttackTopBox //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE ACT3AttackMothership //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT FindEnemiesInside (VOLUME_MothershipVolume, SHIPS_ACT3FrigFound, 1000); ShipsSelectClass (SHIPS_Mothership, SHIPS_ACT3FrigFound, "CLASS_Mothership"); MoveAttack (SHIPS_Mothership); ENDINIT WATCH IF (ThisTeamIs (TEAM_Frigates1)) IF (UnderAttack (SHIPS_AttackingFrig1)) ShipsSelectClass (SHIPS_Mothership, SHIPS_AttackingFrig1, "CLASS_Mothership"); // Select the Mothership ShipsRemove (SHIPS_AttackingFrig1, SHIPS_Mothership); // And filter it out IF (ShipsCount (SHIPS_AttackingFrig1) > 0) Jump ACT3DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF (UnderAttack (SHIPS_AttackingFrig2)) ShipsSelectClass (SHIPS_Mothership, SHIPS_AttackingFrig2, "CLASS_Mothership"); // Select the Mothership ShipsRemove (SHIPS_AttackingFrig2, SHIPS_Mothership); // And filter it out IF (ShipsCount (SHIPS_AttackingFrig2) > 0) Jump ACT3DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates3)) IF (UnderAttack (SHIPS_AttackingFrig3)) ShipsSelectClass (SHIPS_Mothership, SHIPS_AttackingFrig3, "CLASS_Mothership"); // Select the Mothership ShipsRemove (SHIPS_AttackingFrig3, SHIPS_Mothership); // And filter it out IF (ShipsCount (SHIPS_AttackingFrig3) > 0) Jump ACT3DefendYourself; ENDIF ENDIF ENDIF // if some Salvage Corvettes show up, jump to the ACT3DefendYourself state to kill them IF (ThisTeamIs (TEAM_Frigates1)) IF (FindEnemiesNearTeam (SHIPS_Frig1L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig1FoundSomeSCs, SHIPS_Frig1L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig1FoundSomeSCs) > 0) Jump ACT3DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF (FindEnemiesNearTeam (SHIPS_Frig2L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig2FoundSomeSCs, SHIPS_Frig2L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig2FoundSomeSCs) > 0) Jump ACT3DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF (FindEnemiesNearTeam (SHIPS_Frig3L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig3FoundSomeSCs, SHIPS_Frig3L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig3FoundSomeSCs) > 0) Jump ACT3DefendYourself; ENDIF ENDIF ENDIF ENDWATCH ENDSTATE ACT3AttackMothership //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE ACT3DefendYourself //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT IF (ThisTeamIs (TEAM_Frigates1)) IF (ShipsSelectType (SHIPS_Frig1Targets, SHIPS_Frig1FoundSomeSCs, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig1Targets, SHIPS_AttackingFrig1, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig1Targets, SHIPS_AttackingFrig1, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Frig1Targets, SHIPS_AttackingFrig1, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Frig1Targets, SHIPS_AttackingFrig1); ENDIF IF (ShipsCount (SHIPS_Frig1Targets) > 0) Attack (SHIPS_Frig1Targets); ELSE Jump ACT3AttackMothership; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF (ShipsSelectType (SHIPS_Frig2Targets, SHIPS_Frig2FoundSomeSCs, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig2Targets, SHIPS_AttackingFrig2, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig2Targets, SHIPS_AttackingFrig2, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Frig2Targets, SHIPS_AttackingFrig2, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Frig2Targets, SHIPS_AttackingFrig2); ENDIF IF (ShipsCount (SHIPS_Frig2Targets) > 0) Attack (SHIPS_Frig2Targets); ELSE Jump ACT3AttackMothership; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates3)) IF (ShipsSelectType (SHIPS_Frig3Targets, SHIPS_Frig3FoundSomeSCs, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig3Targets, SHIPS_AttackingFrig3, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Frig3Targets, SHIPS_AttackingFrig3, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Frig3Targets, SHIPS_AttackingFrig3, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Frig3Targets, SHIPS_AttackingFrig3); ENDIF IF (ShipsCount (SHIPS_Frig3Targets) > 0) Attack (SHIPS_Frig3Targets); ELSE Jump ACT3AttackMothership; ENDIF ENDIF ENDINIT WATCH // if the ships you're attacking die OR you stop attacking for some reason, jump back into this state to kill the rest of the baddies IF (ThisTeamIs (TEAM_Frigates1)) IF ( (ShipsCount (SHIPS_Frig1Targets) = 0) OR (ShipsOrder (TEAMSHIPS_Frigates1) != 2) ) Jump ACT3DefendYourself; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF ( (ShipsCount (SHIPS_Frig2Targets) = 0) OR (ShipsOrder (TEAMSHIPS_Frigates2) != 2) ) Jump ACT3DefendYourself; ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates3)) IF ( (ShipsCount (SHIPS_Frig3Targets) = 0) OR (ShipsOrder (TEAMSHIPS_Frigates3) != 2) ) Jump ACT3DefendYourself; ENDIF ENDIF // if some Salvage Corvettes show up, jump to the ACT3DefendYourself state to kill them IF (ThisTeamIs (TEAM_Frigates1)) IF (FindEnemiesNearTeam (SHIPS_Frig1L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig1FoundSomeSCs, SHIPS_Frig1L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig1FoundSomeSCs) > 0) Jump ACT3DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF (FindEnemiesNearTeam (SHIPS_Frig2L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig2FoundSomeSCs, SHIPS_Frig2L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig2FoundSomeSCs) > 0) Jump ACT3DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Frigates2)) IF (FindEnemiesNearTeam (SHIPS_Frig3L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Frig3FoundSomeSCs, SHIPS_Frig3L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Frig3FoundSomeSCs) > 0) Jump ACT3DefendYourself; ENDIF ENDIF ENDIF ENDWATCH ENDSTATE ACT3DefendYourself //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE NullState //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT ENDINIT WATCH ENDWATCH ENDSTATE NullState //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ENDFSM Frigates //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Frigates ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Destroyers ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ FSM Destroyers States AllDeadWaitForShips, WaitingToPatrol, Patrol, AttackCarrierVol, ACT3AttackMothership, ACT3DefendYourself, NullState; INIT TacticsEvasive (); TeamHealthSet (60); // This puppy is hurtin VarCreateSet ("SHIPSOriginal", (ShipsCount (THISTEAMSHIPS))); VarCreateSet ("SHIPSRequested", 0); VarCreateSet ("SHIPSNeeded", 0); VarCreateSet ("SHIPSNewships", 0); VarCreateSet ("SHIPSKilled", 0); // Create a variable = to the number of ships killed VarSet ("G_TOTALOriginalDestroyers", VarGet ("G_TOTALOriginalDestroyers") + ShipsCount (THISTEAMSHIPS)); VarInc ("G_NumDestroyerTeams"); // Used for identifying the teams VarCreateSet ("ThisDestroyerNum", VarGet("G_NumDestroyerTeams")); Jump WaitingToPatrol; ENDINIT WATCH // DESTROYERS repopulation stuff from Falko (except here they don't request ships) IF ( (ShipsCount (THISTEAMSHIPS) + VarGet ("SHIPSRequested")) < VarGet ("SHIPSOriginal") ) VarSet ("SHIPSNeeded", (VarGet ("SHIPSOriginal") - (ShipsCount (THISTEAMSHIPS) + VarGet("SHIPSRequested")))); //RequestShips ("StandardFrigate", VarGet ("SHIPSNeeded")); VarSet ("SHIPSKilled", VarGet ("SHIPSKilled") + VarGet ("SHIPSNeeded")); //VarSet ("G_TOTALDestroyersKilled", VarGet ("G_TOTALDestroyersKilled") + VarGet ("SHIPSKilled")); VarSet ("SHIPSRequested", VarGet("SHIPSRequested") + VarGet("SHIPSNeeded")); ENDIF //VarSet ("SHIPSRequested", VarGet("G_TOTALDestroyersKilled")); //VarSet ("SHIPSNewships", NewShipsAdded()); //IF (VarGet("SHIPSNewships")) // //FormationBroad (); // VarSet("SHIPSRequested", VarGet("SHIPSRequested") - VarGet("SHIPSNewships")); //ENDIF // if you're under attack, set a variable (used for playing the 'teach move while attacking' speech event) IF (UnderAttack (SHIPS_DestroyersUnderAttack) AND (VarGet("G_DestroyersUnderAttack") = 0)) ShipsSelectClass (SHIPS_DestroyersVsFrigates, SHIPS_DestroyersUnderAttack, "CLASS_Frigate"); IF (ShipsCount (SHIPS_DestroyersVsFrigates) > 0) VarSet ("G_DestroyersUnderAttack", VarGet("ThisDestroyerNum")); ENDIF ELSEIF ((NOT UnderAttack (SHIPS_Null022092)) AND (VarGet("G_DestroyersUnderAttack") = VarGet("ThisDestroyerNum"))) VarSet ("G_DestroyersUnderAttack", 0); ENDIF // when ACT3 has begun, go attack the player's Mothership IFONCE (VarGet ("G_ACT3HasBegun") = TRUE) Jump ACT3AttackMothership; ENDIFONCE ENDWATCH STATE AllDeadWaitForShips //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT VarCreateSet ("WaitingForShips", TRUE); ENDINIT WATCH IF (ShipsCount (THISTEAMSHIPS) > 0) VarDestroy ("WaitingForShips"); Jump Patrol; ENDIF ENDWATCH ENDSTATE AllDeadWaitForShips //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE WaitingToPatrol //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT ENDINIT WATCH TeamHealthSet (60); // Keep resetting health until the player finds them IF (ObjectiveGet ("SendProbe") = TRUE) Jump Patrol; ENDIF ENDWATCH ENDSTATE WaitingToPatrol //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE Patrol //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT IF (ThisTeamIs (TEAM_Destroyers1)) PatrolPath (PATH_Destroyer1Path); ELSEIF (ThisTeamIs (TEAM_Destroyers2)) PatrolPath (PATH_Destroyer2Path); ENDIF ENDINIT WATCH // **** watch everywhere stuff **** IF (ShipsCount (SHIPS_CarrierVolTOTAL) > 0) Jump AttackCarrierVol; ENDIF ENDWATCH ENDSTATE Patrol //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE AttackCarrierVol //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT IF (ThisTeamIs (TEAM_Destroyers1)) IF (ShipsSelectType (SHIPS_Destroyer1Targets, SHIPS_CarrierVolTOTAL, "SalCapCorvette")) ELSEIF (ShipsSelectType (SHIPS_Destroyer1Targets, SHIPS_Des1FoundSomeSCs, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Destroyer1Targets, SHIPS_CarrierVolTOTAL, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Destroyer1Targets, SHIPS_CarrierVolTOTAL, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Destroyer1Targets, SHIPS_CarrierVolTOTAL, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Destroyer1Targets, SHIPS_CarrierVolTOTAL); ENDIF IF (ShipsCount (SHIPS_Destroyer1Targets) > 0) Attack (SHIPS_Destroyer1Targets); ELSE Jump Patrol; ENDIF ELSEIF (ThisTeamIs (TEAM_Destroyers2)) IF (ShipsSelectType (SHIPS_Destroyer2Targets, SHIPS_CarrierVolTOTAL, "SalCapCorvette")) ELSEIF (ShipsSelectType (SHIPS_Destroyer2Targets, SHIPS_Des2FoundSomeSCs, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Destroyer2Targets, SHIPS_CarrierVolTOTAL, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Destroyer2Targets, SHIPS_CarrierVolTOTAL, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Destroyer2Targets, SHIPS_CarrierVolTOTAL, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Destroyer2Targets, SHIPS_CarrierVolTOTAL); ENDIF IF (ShipsCount (SHIPS_Destroyer2Targets) > 0) Attack (SHIPS_Destroyer2Targets); ELSE Jump Patrol; ENDIF ENDIF ENDINIT WATCH // if the ships you're attacking die OR you stop attacking for some reason, jump back into this state to kill the rest of the baddies IF (ThisTeamIs (TEAM_Destroyers1)) IF ( (ShipsCount (SHIPS_Destroyer1Targets) = 0) OR (ShipsOrder (TEAMSHIPS_Destroyers1) != 2) ) Jump AttackCarrierVol; ENDIF ELSEIF (ThisTeamIs (TEAM_Destroyers2)) IF ( (ShipsCount (SHIPS_Destroyer1Targets) = 0) OR (ShipsOrder (TEAMSHIPS_Destroyers2) != 2) ) Jump AttackCarrierVol; ENDIF ENDIF // if some Salvage Corvettes show up, jump back into this state to kill them IF (ThisTeamIs (TEAM_Destroyers1)) IF (FindEnemiesNearTeam (SHIPS_Des1L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Des1FoundSomeSCs, SHIPS_Des1L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Des1FoundSomeSCs) > 0) Jump AttackCarrierVol; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Destroyers2)) IF (FindEnemiesNearTeam (SHIPS_Des2L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Des2FoundSomeSCs, SHIPS_Des2L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Des2FoundSomeSCs) > 0) Jump AttackCarrierVol; ENDIF ENDIF ENDIF ENDWATCH ENDSTATE AttackCarrierVol //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE ACT3AttackMothership //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT FindEnemiesInside (VOLUME_MothershipVolume, SHIPS_ACT3DesFound, 1000); ShipsSelectClass (SHIPS_Mothership, SHIPS_ACT3DesFound, "CLASS_Mothership"); MoveAttack (SHIPS_Mothership); ENDINIT WATCH IF (ThisTeamIs (TEAM_Destroyers1)) IF (UnderAttack (SHIPS_AttackingDes1)) ShipsSelectClass (SHIPS_Mothership, SHIPS_AttackingDes1, "CLASS_Mothership"); // Select the Mothership ShipsRemove (SHIPS_AttackingDes1, SHIPS_Mothership); // And filter it out IF (ShipsCount (SHIPS_AttackingDes1) > 0) Jump ACT3DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Destroyers2)) IF (UnderAttack (SHIPS_AttackingDes2)) ShipsSelectClass (SHIPS_Mothership, SHIPS_AttackingDes2, "CLASS_Mothership"); // Select the Mothership ShipsRemove (SHIPS_AttackingDes2, SHIPS_Mothership); // And filter it out IF (ShipsCount (SHIPS_AttackingDes2) > 0) Jump ACT3DefendYourself; ENDIF ENDIF ENDIF // if some Salvage Corvettes show up, jump to the ACT3DefendYourself state to kill them IF (ThisTeamIs (TEAM_Destroyers1)) IF (FindEnemiesNearTeam (SHIPS_Des1L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Des1FoundSomeSCs, SHIPS_Des1L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Des1FoundSomeSCs) > 0) Jump ACT3DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Destroyers2)) IF (FindEnemiesNearTeam (SHIPS_Des2L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Des2FoundSomeSCs, SHIPS_Des2L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Des2FoundSomeSCs) > 0) Jump ACT3DefendYourself; ENDIF ENDIF ENDIF ENDWATCH ENDSTATE ACT3AttackMothership //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE ACT3DefendYourself //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT IF (ThisTeamIs (TEAM_Destroyers1)) IF (ShipsSelectType (SHIPS_Des1Targets, SHIPS_AttackingDes1, "SalCapCorvette")) ELSEIF (ShipsSelectType (SHIPS_Des1Targets, SHIPS_Des1FoundSomeSCs, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Des1Targets, SHIPS_AttackingDes1, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Des1Targets, SHIPS_AttackingDes1, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Des1Targets, SHIPS_AttackingDes1, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Des1Targets, SHIPS_AttackingDes1); ENDIF IF (ShipsCount (SHIPS_Des1Targets) > 0) Attack (SHIPS_Des1Targets); ELSE Jump ACT3AttackMothership; ENDIF ELSEIF (ThisTeamIs (TEAM_Destroyers2)) IF (ShipsSelectType (SHIPS_Des2Targets, SHIPS_AttackingDes2, "SalCapCorvette")) ELSEIF (ShipsSelectType (SHIPS_Des2Targets, SHIPS_Des2FoundSomeSCs, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Des2Targets, SHIPS_AttackingDes2, "CLASS_Frigate")) ELSEIF (ShipsSelectClass (SHIPS_Des2Targets, SHIPS_AttackingDes2, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Des2Targets, SHIPS_AttackingDes2, "CLASS_Fighter")) ELSE ShipsAdd (SHIPS_Des2Targets, SHIPS_AttackingDes2); ENDIF IF (ShipsCount (SHIPS_Des2Targets) > 0) Attack (SHIPS_Des2Targets); ELSE Jump ACT3AttackMothership; ENDIF ENDIF ENDINIT WATCH // if the ships you're attacking die OR you stop attacking for some reason, jump back into this state to kill the rest of the baddies IF (ThisTeamIs (TEAM_Destroyers1)) IF ( (ShipsCount (SHIPS_Des1Targets) = 0) OR (ShipsOrder (TEAMSHIPS_Destroyers1) != 2) ) Jump ACT3DefendYourself; ENDIF ELSEIF (ThisTeamIs (TEAM_Destroyers2)) IF ( (ShipsCount (SHIPS_Des2Targets) = 0) OR (ShipsOrder (TEAMSHIPS_Destroyers2) != 2) ) Jump ACT3DefendYourself; ENDIF ENDIF // if some Salvage Corvettes show up, jump back into this state to kill them IF (ThisTeamIs (TEAM_Destroyers1)) IF (FindEnemiesNearTeam (SHIPS_Des1L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Des1FoundSomeSCs, SHIPS_Des1L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Des1FoundSomeSCs) > 0) Jump ACT3DefendYourself; ENDIF ENDIF ELSEIF (ThisTeamIs (TEAM_Destroyers2)) IF (FindEnemiesNearTeam (SHIPS_Des2L00kingForSCs, 15000)) ShipsSelectType (SHIPS_Des2FoundSomeSCs, SHIPS_Des2L00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_Des2FoundSomeSCs) > 0) Jump ACT3DefendYourself; ENDIF ENDIF ENDIF ENDWATCH ENDSTATE ACT3DefendYourself //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE NullState //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT ENDINIT WATCH ENDWATCH ENDSTATE NullState //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ENDFSM Destroyers //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Destroyers ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ SupportFrigate ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ FSM SupportFrigate States Wait, GuardCarrier, ACT3AttackMothership, ACT3DefendYourself, NullState; INIT TeamHealthSet (60); // This puppy is hurtin Jump Wait; ENDINIT WATCH // if the Support Frigate gets killed, jump to a null state IFONCE (ShipsCount (TEAMSHIPS_SupportFrigate) = 0) Stop (); Jump NullState; ENDIFONCE // if you're under attack, set a variable (used for playing the 'teach move while attacking' speech event) IF (UnderAttack (SHIPS_SupportFrigateUnderAttack)) ShipsSelectClass (SHIPS_SupportFrigateVsFrigates, SHIPS_SupportFrigateUnderAttack, "CLASS_Frigate"); IF (ShipsCount (SHIPS_SupportFrigateVsFrigates) > 0) VarCreateSet ("G_SupportFrigateUnderAttack", TRUE); ENDIF ELSE VarSet ("G_SupportFrigateUnderAttack", FALSE); ENDIF // when ACT3 has begun, go attack the player's Mothership IFONCE ( (VarGet ("G_ACT3HasBegun") = TRUE) AND (ShipsCount (TEAMSHIPS_Carrier) = 0) ) Jump ACT3AttackMothership; ENDIFONCE ENDWATCH STATE Wait //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT ENDINIT WATCH TeamHealthSet (60); // Keep resetting health until the player finds them IF (ObjectiveGet ("SendProbe") = TRUE) Jump GuardCarrier; ENDIF ENDWATCH ENDSTATE Wait //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE GuardCarrier //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT Guard (TEAMSHIPS_Carrier); ENDINIT WATCH ENDWATCH ENDSTATE GuardCarrier //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE ACT3AttackMothership //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT FindEnemiesInside (VOLUME_MothershipVolume, SHIPS_ACT3SupFound, 1000); ShipsSelectClass (SHIPS_Mothership, SHIPS_ACT3SupFound, "CLASS_Mothership"); MoveAttack (SHIPS_Mothership); ENDINIT WATCH IF (UnderAttack (SHIPS_AttackingSup1)) ShipsSelectClass (SHIPS_Mothership, SHIPS_AttackingSup1, "CLASS_Mothership"); // Select the Mothership ShipsRemove (SHIPS_AttackingSup1, SHIPS_Mothership); // And filter it out IF (ShipsCount (SHIPS_AttackingSup1) > 0) Jump ACT3DefendYourself; ENDIF ENDIF // if some Salvage Corvettes show up, jump to the ACT3DefendYourself state to kill them IF (FindEnemiesNearTeam (SHIPS_SupportL00kingForSCs, 15000)) ShipsSelectType (SHIPS_SupportFoundSomeSCs, SHIPS_SupportL00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_SupportFoundSomeSCs) > 0) Jump ACT3DefendYourself; ENDIF ENDIF ENDWATCH ENDSTATE ACT3AttackMothership //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE ACT3DefendYourself //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT IF (ShipsSelectType (SHIPS_Sup1Targets, SHIPS_SupportFoundSomeSCs, "SalCapCorvette")) ELSEIF (ShipsSelectType (SHIPS_Sup1Targets, SHIPS_AttackingSup1, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Sup1Targets, SHIPS_AttackingSup1, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Sup1Targets, SHIPS_AttackingSup1, "CLASS_Fighter")) ELSEIF (ShipsSelectClass (SHIPS_Sup1Targets, SHIPS_AttackingSup1, "CLASS_Frigate")) ELSE ShipsAdd (SHIPS_Sup1Targets, SHIPS_AttackingSup1); ENDIF IF (ShipsCount (SHIPS_Sup1Targets) > 0) Attack (SHIPS_Sup1Targets); ELSE Jump ACT3AttackMothership; ENDIF ENDINIT WATCH // if the ships you're attacking die OR you stop attacking for some reason, jump back into this state to kill the rest of the baddies IF ( (ShipsCount (SHIPS_Sup1Targets) = 0) OR (ShipsOrder (TEAMSHIPS_SupportFrigate) != 2) ) Jump ACT3DefendYourself; ENDIF // if some Salvage Corvettes show up, jump back into this state to kill them IF (FindEnemiesNearTeam (SHIPS_SupportL00kingForSCs, 15000)) ShipsSelectType (SHIPS_SupportFoundSomeSCs, SHIPS_SupportL00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_SupportFoundSomeSCs) > 0) Jump ACT3DefendYourself; ENDIF ENDIF ENDWATCH ENDSTATE ACT3DefendYourself //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE NullState //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT ENDINIT WATCH ENDWATCH ENDSTATE NullState //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ENDFSM SupportFrigate //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ SupportFrigate ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Carrier ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ FSM Carrier States Wait, Patrol, UnderAttack, ACT3AttackMothership, ACT3DefendYourself; INIT TeamHealthSet (65); // This puppy is hurtin VarCreateSet ("CarrierIsInUnderAttackState", FALSE); Jump Wait; ENDINIT WATCH // if you're under attack, set a variable (used for playing the 'teach move while attacking' speech event) IF ( (UnderAttack (SHIPS_CarrierUnderAttack)) AND (VarGet ("G_ACT3HasBegun") = FALSE) ) //ShipsSelectClass (SHIPS_CarrierVsFrigates, SHIPS_CarrierUnderAttack, "CLASS_Frigate"); //IF (ShipsCount (SHIPS_CarrierVsFrigates) > 0) IF ( (ShipsCount (SHIPS_CarrierUnderAttack) > 0) AND (VarGet ("CarrierIsInUnderAttackState") = FALSE) ) VarSet ("G_CarrierUnderAttack", TRUE); Jump UnderAttack; ENDIF ELSE VarSet ("G_CarrierUnderAttack", FALSE); ENDIF IFONCE (TeamHealthAverage () < 40) VarCreateSet ("G_ACT2HasBegun", TRUE); ENDIFONCE // when ACT3 has begun, go attack the player's Mothership IFONCE (VarGet ("G_ACT3HasBegun") = TRUE) Jump ACT3AttackMothership; ENDIFONCE ENDWATCH STATE Wait //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT VarSet ("CarrierIsInUnderAttackState", FALSE); ENDINIT WATCH TeamHealthSet (65); // Keep resetting health until the player finds them IF (ObjectiveGet ("SendProbe") = TRUE) Jump Patrol; ENDIF ENDWATCH ENDSTATE Wait //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE Patrol //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT VarSet ("CarrierIsInUnderAttackState", FALSE); TacticsNeutral (); PatrolPath (PATH_CarrierPath); ENDINIT WATCH // if some Salvage Corvettes show up, jump to the UnderAttack state to kill them IF (FindEnemiesNearTeam (SHIPS_CarrierL00kingForSCs, 15000)) ShipsSelectType (SHIPS_CarrierFoundSomeSCs, SHIPS_CarrierL00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_CarrierFoundSomeSCs) > 0) Jump UnderAttack; ENDIF ENDIF ENDWATCH ENDSTATE Patrol //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE UnderAttack //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT VarSet ("CarrierIsInUnderAttackState", TRUE); //TacticsEvasive (); // Do this so that when enemy ships come in, the Carrier will "run away" IF (ShipsSelectType (SHIPS_CarrierTargets, SHIPS_CarrierFoundSomeSCs, "SalCapCorvette")) VarCreateSet ("CarrierAttackingSC", TRUE); ELSEIF (ShipsSelectType (SHIPS_CarrierTargets, SHIPS_CarrierUnderAttack, "SalCapCorvette")) VarCreateSet ("CarrierAttackingSC", TRUE); ELSEIF (ShipsSelectClass (SHIPS_CarrierTargets, SHIPS_CarrierUnderAttack, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_CarrierTargets, SHIPS_CarrierUnderAttack, "CLASS_Fighter")) ELSEIF (ShipsSelectClass (SHIPS_CarrierTargets, SHIPS_CarrierUnderAttack, "CLASS_Frigate")) ELSE ShipsAdd (SHIPS_CarrierTargets, SHIPS_CarrierUnderAttack); ENDIF IF (ShipsCount (SHIPS_CarrierTargets) > 0) Attack (SHIPS_CarrierTargets); ELSE VarDestroy ("CarrierAttackingSC"); Jump Patrol; ENDIF ENDINIT WATCH //IF (FindShipsInside (VOLUME_CarrierVolume, SHIPS_LookingForCarrier)) // If the Carrier gets outside the CarrierVol, go back inside // ShipsSelectClass (SHIPS_HaveIFoundACarrier, SHIPS_LookingForCarrier, "CLASS_Carrier"); // IF (ShipsCount (SHIPS_HaveIFoundACarrier) = 0) // Jump Patrol; // ENDIF //ENDIF IF ( (NOT UnderAttack (SHIPS_Null8239823)) AND (VarGet ("CarrierAttackingSC") = FALSE) ) VarDestroy ("CarrierAttackingSC"); Jump Patrol; ENDIF // if some Salvage Corvettes show up, jump back into this state to kill them IF (FindEnemiesNearTeam (SHIPS_CarrierL00kingForSCs, 15000)) ShipsSelectType (SHIPS_CarrierFoundSomeSCs, SHIPS_CarrierL00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_CarrierFoundSomeSCs) > 0) Jump UnderAttack; ENDIF ENDIF ENDWATCH ENDSTATE UnderAttack //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE ACT3AttackMothership //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT FindEnemiesInside (VOLUME_MothershipVolume, SHIPS_ACT3CarFound, 1000); ShipsSelectClass (SHIPS_Mothership, SHIPS_ACT3CarFound, "CLASS_Mothership"); MoveAttack (SHIPS_Mothership); ENDINIT WATCH IF (UnderAttack (SHIPS_AttackingCar1)) Jump ACT3DefendYourself; ENDIF IFONCE (Nearby (SHIPSPOINT_Mothership, 14000)) // If you're within visual range of the Mothership, begin the Kamikaze assault!! VarCreateSet ("G_BeginKamikaze", TRUE); ENDIFONCE // if some Salvage Corvettes show up, jump to the ACT3DefendYourself state to kill them IF (FindEnemiesNearTeam (SHIPS_CarrierL00kingForSCs, 15000)) ShipsSelectType (SHIPS_CarrierFoundSomeSCs, SHIPS_CarrierL00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_CarrierFoundSomeSCs) > 0) Jump ACT3DefendYourself; ENDIF ENDIF ENDWATCH ENDSTATE ACT3AttackMothership //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE ACT3DefendYourself //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT IF (ShipsSelectType (SHIPS_Car1Targets, SHIPS_AttackingCar1, "SalCapCorvette")) ELSEIF (ShipsSelectType (SHIPS_Car1Targets, SHIPS_CarrierFoundSomeSCs, "SalCapCorvette")) ELSEIF (ShipsSelectClass (SHIPS_Car1Targets, SHIPS_AttackingCar1, "CLASS_Corvette")) ELSEIF (ShipsSelectClass (SHIPS_Car1Targets, SHIPS_AttackingCar1, "CLASS_Fighter")) ELSEIF (ShipsSelectClass (SHIPS_Car1Targets, SHIPS_AttackingCar1, "CLASS_Frigate")) ELSE ShipsAdd (SHIPS_Car1Targets, SHIPS_AttackingCar1); ENDIF IF (ShipsCount (SHIPS_Car1Targets) > 0) Attack (SHIPS_Car1Targets); ELSE Jump ACT3AttackMothership; ENDIF ENDINIT WATCH // if the ships you're attacking die OR you stop attacking for some reason, jump back into this state to kill the rest of the baddies IF ( (ShipsCount (SHIPS_Car1Targets) = 0) OR (ShipsOrder (TEAMSHIPS_Carrier) != 2) ) Jump ACT3DefendYourself; ENDIF IFONCE (Nearby (SHIPSPOINT_Mothership, 14000)) // If you're within visual range of the Mothership, begin the Kamikaze assault!! VarCreateSet ("G_BeginKamikaze", TRUE); ENDIFONCE // if some Salvage Corvettes show up, jump back into this state to kill them IF (FindEnemiesNearTeam (SHIPS_CarrierL00kingForSCs, 15000)) ShipsSelectType (SHIPS_CarrierFoundSomeSCs, SHIPS_CarrierL00kingForSCs, "SalCapCorvette"); IF (ShipsCount (SHIPS_CarrierFoundSomeSCs) > 0) Jump ACT3DefendYourself; ENDIF ENDIF ENDWATCH ENDSTATE ACT3DefendYourself //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ENDFSM Carrier //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Carrier ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Probes ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ FSM Probes States Wait, RequestShips, Move, NullState; INIT VarCreateSet ("SHIPSNewships", 0); Jump Wait; ENDINIT WATCH ENDWATCH STATE Wait //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT ENDINIT WATCH IF (VarGet ("G_ACT2HasBegun")) Jump RequestShips; ENDIF ENDWATCH ENDSTATE Wait //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE RequestShips //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT IF (ThisTeamIs (TEAM_Probes1)) RequestShips ("Probe", 1); ELSEIF (ThisTeamIs (TEAM_Probes2)) RequestShips ("Probe", 1); ELSEIF (ThisTeamIs (TEAM_Probes3)) RequestShips ("Probe", 1); ENDIF ENDINIT WATCH VarSet ("SHIPSNewships", NewShipsAdded()); IF (VarGet("SHIPSNewships")) Jump Move; ENDIF ENDWATCH ENDSTATE RequestShips //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE Move //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT IF (ThisTeamIs (TEAM_Probes1)) MoveTo (POINT_Probe1POINT); ELSEIF (ThisTeamIs (TEAM_Probes2)) MoveTo (POINT_Probe2POINT); ELSEIF (ThisTeamIs (TEAM_Probes3)) MoveTo (POINT_Probe3POINT); ENDIF ENDINIT WATCH ENDWATCH ENDSTATE Move //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE NullState //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT ENDINIT WATCH ENDWATCH ENDSTATE NullState //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ENDFSM Probes //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Probes ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Defenders ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ FSM Defenders States DockInstant, Wait, Launch, Guard, NullState; INIT Jump DockInstant; ENDINIT WATCH IF (ShipsCount (THISTEAMSHIPS) = 0) Jump NullState; ENDIF ENDWATCH STATE DockInstant //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT DockInstant (TEAM_Carrier); ENDINIT WATCH IF (TeamDockedReadyForLaunch ()) Jump Wait; ENDIF ENDWATCH ENDSTATE DockInstant //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE Wait //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT ENDINIT WATCH IF (VarGet ("G_ACT2HasBegun")) TimerCreateSetStart ("G_OrderToGuardHasBeenGiven", 90); Jump Launch; ENDIF ENDWATCH ENDSTATE Wait //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE Launch //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT Launch (); ENDINIT WATCH IF (TeamFinishedLaunching()) Jump Guard; ENDIF ENDWATCH ENDSTATE Launch //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE Guard //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT FormationSphere (); IF (ThisTeamIs (TEAM_Defenders1)) IF (ShipsCount (TEAMSHIPS_Frigates1) > 0) Guard (TEAMSHIPS_Frigates1); VarCreateSet ("GuardingFrigate1", TRUE); ELSEIF (ShipsCount (TEAMSHIPS_Frigates2) > 0) Guard (TEAMSHIPS_Frigates2); VarCreateSet ("GuardingFrigate2", TRUE); ELSEIF (ShipsCount (TEAMSHIPS_Frigates3) > 0) Guard (TEAMSHIPS_Frigates3); VarCreateSet ("GuardingFrigate3", TRUE); ELSIF (ShipsCount (TEAMSHIPS_Destroyers1) > 0) Guard (TEAMSHIPS_Destroyers1); VarCreateSet ("GuardingDestroyer1", TRUE); ELSIF (ShipsCount (TEAMSHIPS_Destroyers2) > 0) Guard (TEAMSHIPS_Destroyers2); VarCreateSet ("GuardingDestroyer2", TRUE); ELSIF (ShipsCount (TEAMSHIPS_Carrier) > 0) Guard (TEAMSHIPS_Carrier); VarCreateSet ("GuardingCarrier", TRUE); ELSIF (ShipsCount (TEAMSHIPS_SupportFrigate) > 0) Guard (TEAMSHIPS_SupportFrigate); VarCreateSet ("GuardingSupportFrigate", TRUE); ELSE Kamikaze (SHIPS_PlayerMothership); ENDIF ELSEIF (ThisTeamIs (TEAM_Defenders2)) IF (ShipsCount (TEAMSHIPS_Frigates2) > 0) Guard (TEAMSHIPS_Frigates2); VarCreateSet ("GuardingFrigate2", TRUE); ELSEIF (ShipsCount (TEAMSHIPS_Frigates1) > 0) Guard (TEAMSHIPS_Frigates1); VarCreateSet ("GuardingFrigate1", TRUE); ELSEIF (ShipsCount (TEAMSHIPS_Frigates3) > 0) Guard (TEAMSHIPS_Frigates3); VarCreateSet ("GuardingFrigate3", TRUE); ELSIF (ShipsCount (TEAMSHIPS_Destroyers1) > 0) Guard (TEAMSHIPS_Destroyers1); VarCreateSet ("GuardingDestroyer1", TRUE); ELSIF (ShipsCount (TEAMSHIPS_Destroyers2) > 0) Guard (TEAMSHIPS_Destroyers2); VarCreateSet ("GuardingDestroyer2", TRUE); ELSIF (ShipsCount (TEAMSHIPS_Carrier) > 0) Guard (TEAMSHIPS_Carrier); VarCreateSet ("GuardingCarrier", TRUE); ELSIF (ShipsCount (TEAMSHIPS_SupportFrigate) > 0) Guard (TEAMSHIPS_SupportFrigate); VarCreateSet ("GuardingSupportFrigate", TRUE); ELSE Kamikaze (SHIPS_PlayerMothership); ENDIF ELSEIF (ThisTeamIs (TEAM_Defenders3)) IF (ShipsCount (TEAMSHIPS_Frigates3) > 0) Guard (TEAMSHIPS_Frigates3); VarCreateSet ("GuardingFrigate3", TRUE); ELSEIF (ShipsCount (TEAMSHIPS_Frigates1) > 0) Guard (TEAMSHIPS_Frigates1); VarCreateSet ("GuardingFrigate1", TRUE); ELSEIF (ShipsCount (TEAMSHIPS_Frigates2) > 0) Guard (TEAMSHIPS_Frigates2); VarCreateSet ("GuardingFrigate2", TRUE); ELSIF (ShipsCount (TEAMSHIPS_Destroyers1) > 0) Guard (TEAMSHIPS_Destroyers1); VarCreateSet ("GuardingDestroyer1", TRUE); ELSIF (ShipsCount (TEAMSHIPS_Destroyers2) > 0) Guard (TEAMSHIPS_Destroyers2); VarCreateSet ("GuardingDestroyer2", TRUE); ELSIF (ShipsCount (TEAMSHIPS_Carrier) > 0) Guard (TEAMSHIPS_Carrier); VarCreateSet ("GuardingCarrier", TRUE); ELSIF (ShipsCount (TEAMSHIPS_SupportFrigate) > 0) Guard (TEAMSHIPS_SupportFrigate); VarCreateSet ("GuardingSupportFrigate", TRUE); ELSE Kamikaze (SHIPS_PlayerMothership); ENDIF ENDIF ENDINIT WATCH IF (VarGet ("GuardingFrigate1") = TRUE) IF (ShipsCount (TEAMSHIPS_Frigates1) = 0) VarDestroy ("GuardingFrigate1"); Jump Guard; ENDIF ELSEIF (VarGet ("GuardingFrigate2") = TRUE) IF (ShipsCount (TEAMSHIPS_Frigates2) = 0) VarDestroy ("GuardingFrigate2"); Jump Guard; ENDIF ELSEIF (VarGet ("GuardingFrigate3") = TRUE) IF (ShipsCount (TEAMSHIPS_Frigates3) = 0) VarDestroy ("GuardingFrigate3"); Jump Guard; ENDIF ELSEIF (VarGet ("GuardingDestroyer1") = TRUE) IF (ShipsCount (TEAMSHIPS_Destroyers1) = 0) VarDestroy ("GuardingDestroyer1"); Jump Guard; ENDIF ELSEIF (VarGet ("GuardingDestroyer2") = TRUE) IF (ShipsCount (TEAMSHIPS_Destroyers2) = 0) VarDestroy ("GuardingDestroyer2"); Jump Guard; ENDIF ELSEIF (VarGet ("GuardingCarrier") = TRUE) IF (ShipsCount (TEAMSHIPS_Carrier) = 0) VarDestroy ("GuardingCarrier"); Jump Guard; ENDIF ELSEIF (VarGet ("GuardingSupportFrigate") = TRUE) IF (ShipsCount (TEAMSHIPS_SupportFrigate) = 0) VarDestroy ("GuardingSupportFrigate"); Jump Guard; ENDIF ENDIF ENDWATCH ENDSTATE Guard //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE NullState //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT ENDINIT WATCH ENDWATCH ENDSTATE NullState //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ENDFSM Defenders //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Defenders ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Kamikaze! ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ FSM Kamikaze States Dock, Launch, Kamikaze, NullState; INIT Jump Dock; ENDINIT WATCH IFONCE ( (ShipsCount (TEAMSHIPS_Kamikaze) = 0) AND (ShipsCount (TEAMSHIPS_Carrier) = 0) ) Jump NullState; ENDIFONCE ENDWATCH STATE Dock //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT DockInstant (TEAM_Carrier); ENDINIT WATCH IF (VarGet ("G_BeginKamikaze") = TRUE) Jump Launch; ENDIF ENDWATCH ENDSTATE Dock //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE Launch //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT Launch (); ENDINIT WATCH IF (TeamFinishedLaunching ()) Jump Kamikaze; ENDIF ENDWATCH ENDSTATE Launch //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE Kamikaze //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT Kamikaze (SHIPS_Mothership); ENDINIT WATCH IF ( (ShipsCount (TEAMSHIPS_Kamikaze) = 0) AND (VarGet ("WaitingForShips") = FALSE) ) RUsSet (1, (RUsGet (1) + 35)); // Set RUs = Current RUs + Amount req'd to build 1 Scout RequestShips ("LightInterceptor", 1); VarCreateSet ("WaitingForShips", TRUE); ENDIF IF (ShipsCount (TEAMSHIPS_Kamikaze) > 0) Kamikaze (SHIPS_Mothership); VarCreateSet ("WaitingForShips", FALSE); ENDIF ENDWATCH ENDSTATE Kamikaze //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE NullState //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT ENDINIT WATCH ENDWATCH ENDSTATE NullState //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ENDFSM Kamikaze //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Kamikaze! ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Kamikaze! ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ FSM Kamikaze2 States Dock, Launch, Kamikaze, NullState; INIT Jump Dock; ENDINIT WATCH IFONCE ( (ShipsCount (TEAMSHIPS_Kamikaze2) = 0) AND (ShipsCount (TEAMSHIPS_Carrier) = 0) ) Jump NullState; ENDIFONCE ENDWATCH STATE Dock //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT DockInstant (TEAM_Carrier); ENDINIT WATCH IF (VarGet ("G_BeginKamikaze") = TRUE) Jump Launch; ENDIF ENDWATCH ENDSTATE Dock //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE Launch //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT Launch (); ENDINIT WATCH IF (TeamFinishedLaunching ()) Jump Kamikaze; ENDIF ENDWATCH ENDSTATE Launch //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE Kamikaze //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT Kamikaze (SHIPS_Mothership); ENDINIT WATCH IF ( (ShipsCount (TEAMSHIPS_Kamikaze2) = 0) AND (VarGet ("WaitingForShips") = FALSE) ) RUsSet (1, (RUsGet (1) + 55)); // Set RUs = Current RUs + Amount req'd to build 1 Scout RequestShips ("HeavyInterceptor", 1); VarCreateSet ("WaitingForShips", TRUE); ENDIF IF (ShipsCount (TEAMSHIPS_Kamikaze2) > 0) Kamikaze (SHIPS_Mothership); VarCreateSet ("WaitingForShips", FALSE); ENDIF ENDWATCH ENDSTATE Kamikaze //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ STATE NullState //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ INIT ENDINIT WATCH ENDWATCH ENDSTATE NullState //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ENDFSM Kamikaze2 //ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ Kamikaze! ÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ //ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ Global Stuff ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ INIT //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ // AI stuffs // // INTERCEPTOR variables used for determining how many ships have been killed VarCreateSet ("G_TOTALInterceptorsKilled", 0); VarCreateSet ("G_TOTALInterceptorsInLevel", 0); VarCreateSet ("G_TOTALOriginalInterceptors", 0); VarCreateSet ("G_InterceptorsKilledTOTAL", 0); // FRIGATE variables used for determining how many ships have been killed VarCreateSet ("G_TOTALFrigatesKilled", 0); VarCreateSet ("G_TOTALFrigatesInLevel", 0); VarCreateSet ("G_TOTALOriginalFrigates", 0); VarCreateSet ("G_NumFrigateTeams", 0); // DESTROYER variables used for determining how many ships have been killed VarCreateSet ("G_TOTALDestroyersKilled", 0); VarCreateSet ("G_TOTALDestroyersInLevel", 0); VarCreateSet ("G_TOTALOriginalDestroyers", 0); VarCreateSet ("G_NumDestroyerTeams", 0); // variables used in determining which capital ships are under attack VarCreateSet ("G_FrigatesUnderAttack", 0); VarCreateSet ("G_DestroyersUnderAttack", 0); VarCreateSet ("G_CarrierUnderAttack", FALSE); VarCreateSet ("G_SupportFrigateUnderAttack", 0); VarCreateSet ("G_LASTInterceptorsInLevel", (ShipsCount (TEAMSHIPS_Interceptors1) + ShipsCount (TEAMSHIPS_Interceptors2))); VarCreateSet ("G_LASTFrigatesInLevel", (ShipsCount (TEAMSHIPS_Frigates1) + ShipsCount (TEAMSHIPS_Frigates2) + ShipsCount (TEAMSHIPS_Frigates3))); VarCreateSet ("G_LASTDestroyersInLevel", (ShipsCount (TEAMSHIPS_Destroyers1) + ShipsCount (TEAMSHIPS_Destroyers2))); VarCreateSet ("G_CURRENTInterceptorsInLevel", 0); VarCreateSet ("G_CURRENTFrigatesInLevel", 0); VarCreateSet ("G_CURRENTDestroyersInLevel", 0); //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ // FSM creates // FSMCreate (FleetIntel, TEAM_FleetIntel); // FSM used only for displaying Fleet Intel events; bound to a dummy ship in the MM FSMCreate (Collector, TEAM_Collector); FSMCreate (Collector, TEAM_Collector2); FSMCreate (Interceptors, TEAM_Interceptors1); FSMCreate (Interceptors, TEAM_Interceptors2); FSMCreate (Frigates, TEAM_Frigates1); FSMCreate (Frigates, TEAM_Frigates2); FSMCreate (Frigates, TEAM_Frigates3); FSMCreate (Destroyers, TEAM_Destroyers1); FSMCreate (Destroyers, TEAM_Destroyers2); FSMCreate (SupportFrigate, TEAM_SupportFrigate); FSMCreate (Probes, TEAM_Probes1); FSMCreate (Probes, TEAM_Probes2); FSMCreate (Probes, TEAM_Probes3); FSMCreate (Defenders, TEAM_Defenders1); FSMCreate (Defenders, TEAM_Defenders2); FSMCreate (Defenders, TEAM_Defenders3); FSMCreate (Carrier, TEAM_Carrier); FSMCreate (Kamikaze, TEAM_Kamikaze); FSMCreate (Kamikaze2, TEAM_Kamikaze2); //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ // technology // //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ // save the level! SaveLevel (5, LSTRING_Savegame); ENDINIT WATCH //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ // location card // IFONCE (TRUE) TimerCreateSetStart ("LocationCardTimer", 1); ENDIFONCE IF (TimerExpiredDestroy ("LocationCardTimer")) LocationCard (5000, LSTRING_LocationCard); ENDIF //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ // fleet intel // // when the player has completed all the objectives and the P1 are gone, start a timer to create the hyperspace objective and play the FI event IFONCE (VarGet ("G_ReadyToHYPERSPACE") = TRUE) TimerCreateSetStart ("G_WaitToPlayFinalEvent", 5); ENDIFONCE // if the Fleet Intel Intro has played, start a timer to play the secondary objective event (destroy enemy resourcer) IFONCE (ObjectiveGet ("SendProbe")) TimerCreateSetStart ("G_WaitToPlayResourcerEvent", Random (105, 165)); ENDIFONCE //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ // AI stuffs // // find everyone inside the Frigate Volume (for use in many places throughout the script) FindEnemiesInside (VOLUME_FrigateVolume, SHIPS_FrigateVolTOTAL, 3000); // Find all the enemies inside the Frigate volume ShipsSelectClass (SHIPS_FrigateVolFighters, SHIPS_FrigateVolTOTAL, "CLASS_Fighter"); // Then filter their asses ShipsSelectClass (SHIPS_FrigateVolCorvettes, SHIPS_FrigateVolTOTAL, "CLASS_Corvette"); ShipsSelectClass (SHIPS_FrigateVolFrigates, SHIPS_FrigateVolTOTAL, "CLASS_Frigate"); //VarCreateSet ("FrigateVolTOTALSHIPS", ShipsCount (SHIPS_FrigateVolTOTAL)); // for debuggin' //VarCreateSet ("FrigateVolFighterSHIPS", ShipsCount (SHIPS_FrigateVolFighters)); //VarCreateSet ("FrigateVolCorvetteSHIPS", ShipsCount (SHIPS_FrigateVolCorvettes)); //VarCreateSet ("FrigateVolFrigateSHIPS", ShipsCount (SHIPS_FrigateVolFrigates)); // find everyone inside the Carrier Volume (for use in many places throughout the script) FindEnemiesInside (VOLUME_CarrierVolume, SHIPS_CarrierVolTOTAL, 3000); // Find all the enemies inside the Frigate volume ShipsSelectClass (SHIPS_CarrierVolFighters, SHIPS_CarrierVolTOTAL, "CLASS_Fighter"); // Then filter their asses ShipsSelectClass (SHIPS_CarrierVolCorvettes, SHIPS_CarrierVolTOTAL, "CLASS_Corvette"); ShipsSelectClass (SHIPS_CarrierVolFrigates, SHIPS_CarrierVolTOTAL, "CLASS_Frigate"); //VarCreateSet ("CarrierVolTOTALSHIPS", ShipsCount (SHIPS_CarrierVolTOTAL)); // for debuggin' //VarCreateSet ("CarrierVolFighterSHIPS", ShipsCount (SHIPS_CarrierVolFighters)); //VarCreateSet ("CarrierVolCorvetteSHIPS", ShipsCount (SHIPS_CarrierVolCorvettes)); //VarCreateSet ("CarrierVolFrigateSHIPS", ShipsCount (SHIPS_CarrierVolFrigates)); VarSet ("G_CURRENTInterceptorsInLevel", (ShipsCount (TEAMSHIPS_Interceptors1) + ShipsCount (TEAMSHIPS_Interceptors2))); VarSet ("G_CURRENTFrigatesInLevel", (ShipsCount (TEAMSHIPS_Frigates1) + ShipsCount (TEAMSHIPS_Frigates2) + ShipsCount (TEAMSHIPS_Frigates3))); VarSet ("G_CURRENTDestroyersInLevel", (ShipsCount (TEAMSHIPS_Destroyers1) + ShipsCount (TEAMSHIPS_Destroyers2))); // For the Interceptors IF (VarGet ("G_CURRENTInterceptorsInLevel") < VarGet ("G_LASTInterceptorsInLevel")) VarSet ("G_TOTALInterceptorsKilled", VarGet ("G_TOTALInterceptorsKilled") + (VarGet ("G_LASTInterceptorsInLevel") - VarGet ("CURRENTInterceptorsInLevel"))); ENDIF VarSet ("G_LASTInterceptorsInLevel", VarGet ("G_CURRENTInterceptorsInLevel")); // For the Frigates IF (VarGet ("G_CURRENTFrigatesInLevel") < VarGet ("G_LASTFrigatesInLevel")) VarSet ("G_TOTALFrigatesKilled", VarGet ("G_TOTALFrigatesKilled") + (VarGet ("G_LASTFrigatesInLevel") - VarGet ("CURRENTFrigatesInLevel"))); ENDIF VarSet ("G_LASTFrigatesInLevel", VarGet ("G_CURRENTFrigatesInLevel")); // For the Destroyers IF (VarGet ("G_CURRENTDestroyersInLevel") < VarGet ("G_LASTDestroyersInLevel")) VarSet ("G_TOTALDestroyersKilled", VarGet ("G_TOTALDestroyersKilled") + (VarGet ("G_LASTDestroyersInLevel") - VarGet ("CURRENTDestroyersInLevel"))); ENDIF VarSet ("G_LASTDestroyersInLevel", VarGet ("G_CURRENTDestroyersInLevel")); // a bunch of stuff to determine when "ACT 2" has begun VarSet ("G_InterceptorsKilledTOTAL", (VarGet ("G_TOTALInterceptorsKilled") / VarGet ("G_TOTALOriginalInterceptors"))); IFONCE ( 5*(VarGet ("G_InterceptorsKilledTOTAL")) + 7*(VarGet ("G_TOTALFrigatesKilled")) + 17*(VarGet ("G_TOTALDestroyersKilled")) >= 25) VarCreateSet ("G_ACT2HasBegun", TRUE); //Print ("ACT2 has begun!"); ENDIFONCE // a bunch of stuff to determine when "ACT 3" has begun IFONCE ( (ShipsCount (TEAMSHIPS_Carrier) = 0) OR (VarGet ("G_TOTALDestroyersKilled") > 1) OR (VarGet ("G_TOTALFrigatesKilled") > 8 ) ) VarCreateSet ("G_ACT3HasBegun", TRUE); ENDIFONCE // find everyone inside the Motheship Volume (for use in ACT3) FindEnemiesInside (VOLUME_MothershipVolume, SHIPS_MothershipVolTOTAL, 3000); ShipsSelectClass (SHIPS_PlayerMothership, SHIPS_MothershipVolTOTAL, "CLASS_Mothership"); //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ // in-game events // // When you come out of hyperspace, start a timer to trigger an in-game Fleet Command event which talks about the jump IFONCE (TRUE) TimerCreateSetStart ("G_FCHyperspaceSuccessful", 5); ENDIFONCE // when the player is involved in some capital ship combat, create a timer to play the event telling them to use move while attacking // the conditions for this are: // 1) At least one enemy capital ship is under attack **by a Frigate-class ship** // 2) At least one enemy capital ship has been rendered on screen IFONCE ( (VarGet ("G_FrigatesUnderAttack") = TRUE) OR (VarGet ("G_DestroyersUnderAttack") = TRUE) OR (VarGet ("G_CarrierUnderAttack") = TRUE) OR (VarGet ("G_SupportFrigateUnderAttack") = TRUE) ) //Print ("TRYING TO PLAY MOVE WHILE ATTACKING NOW!!!!!!!!"); TimerCreateSetStart ("G_PlayTeachMoveWhileAttacking", 1); ENDIFONCE // when the order to guard the Frigates with Defenders has been given, AND the player has seen one of the Defenders, // set a timer to play the in-game event to teach the player about Defenders IFONCE ( ((RenderedShips (TEAMSHIPS_Defenders1, 4)) OR (RenderedShips (TEAMSHIPS_Defenders1, 3)) OR (RenderedShips (TEAMSHIPS_Defenders1, 2)) OR (RenderedShips (TEAMSHIPS_Defenders1, 1)) OR (RenderedShips (TEAMSHIPS_Defenders1, 0)) OR (RenderedShips (TEAMSHIPS_Defenders2, 4)) OR (RenderedShips (TEAMSHIPS_Defenders2, 3)) OR (RenderedShips (TEAMSHIPS_Defenders2, 2)) OR (RenderedShips (TEAMSHIPS_Defenders2, 1)) OR (RenderedShips (TEAMSHIPS_Defenders2, 0)) OR (RenderedShips (TEAMSHIPS_Defenders3, 4)) OR (RenderedShips (TEAMSHIPS_Defenders3, 3)) OR (RenderedShips (TEAMSHIPS_Defenders3, 2)) OR (RenderedShips (TEAMSHIPS_Defenders3, 1)) OR (RenderedShips (TEAMSHIPS_Defenders3, 0))) AND (TimerExpiredDestroy ("G_OrderToGuardHasBeenGiven")) ) TimerCreateSetStart ("G_PlayTeachDefenders", Random (5, 10)); ENDIFONCE //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ // mission objectives // // if the Fleet Intel intro is playing, create the initial objectives: IFONCE (VarGet ("G_FleetIntelIntroHasPlayed") = TRUE) ObjectiveCreate ("SendProbe", LSTRING_FISendProbeTASKBAR, LSTRING_FISendProbeTASKBAR); VarCreateSet ("G_SendProbeObjectiveCreated", TRUE); ENDIFONCE // if the player sends a probe near the enemy fleet, the "SendProbe" objective is met IFONCE (FindEnemiesInside (VOLUME_HidingVolume2, SHIPS_Null91919191, 3000)) ObjectiveSet ("SendProbe", TRUE); PingRemove ("HidingPOINT"); ENDIFONCE // if the Fleet Intel event telling you to eradicate all the enemy ships has played, create the Eradicate Enemies objective IFONCE (VarGet ("G_EradicateEnemiesHasPlayed") = TRUE) ObjectiveCreate ("EradicateEnemies", LSTRING_FIEradicateTASKBAR, LSTRING_FIEradicateTASKBAR); ENDIFONCE // if the Fleet Intel event telling you to eradicate all the enemy ships has played, create the Eradicate Enemies objective IFONCE (VarGet ("G_DestroyResourcerHasPlayed") = TRUE) ObjectiveCreateSecondary ("DestroyResourcer", LSTRING_FIDestroyResTASKBAR, LSTRING_FIDestroyResTASKBAR); ENDIFONCE // if the enemy collector is destroyer, the "DestroyResourcer" objective is met IFONCE ( (ShipsCount (TEAMSHIPS_Collector) = 0) AND (ShipsCount (TEAMSHIPS_Collector2) = 0) ) ObjectiveSet ("DestroyResourcer", TRUE); ENDIFONCE // if the FITeachDefenders event has played, create the objective to research Defender sub-systems IFONCE (VarGet ("G_TeachDefenderEventHasPlayed") = TRUE) ObjectiveCreateSecondary ("ResearchDefenders", LSTRING_FITeachDefendersTASKBAR, LSTRING_FITeachDefendersTASKBAR); ENDIFONCE // if the player researches Defenders, the "ResearchDefenders" objective is met IFONCE (TechGet ("FireControl")) ObjectiveSet ("ResearchDefenders", TRUE); ENDIFONCE // if all the enemies are dead, the "EradicateEnemies" objective is met IFONCE ( (ShipsCount (TEAMSHIPS_Collector) = 0) AND (ShipsCount (TEAMSHIPS_Collector2) = 0) AND (ShipsCount (TEAMSHIPS_Interceptors1) = 0) AND (ShipsCount (TEAMSHIPS_Interceptors2) = 0) AND (ShipsCount (TEAMSHIPS_Frigates1) = 0) AND (ShipsCount (TEAMSHIPS_Frigates2) = 0) AND (ShipsCount (TEAMSHIPS_Frigates3) = 0) AND (ShipsCount (TEAMSHIPS_Destroyers1) = 0) AND (ShipsCount (TEAMSHIPS_Destroyers2) = 0) AND (ShipsCount (TEAMSHIPS_SupportFrigate) = 0) AND (ShipsCount (TEAMSHIPS_Carrier) = 0) ) VarCreateSet ("G_ReadyToHYPERSPACE", TRUE); TimerCreateSetStart ("G_MissionCompleteTimer", 5); ObjectiveSet ("EradicateEnemies", TRUE); MusicStop (4); // Stop the battle music ENDIFONCE // when the timer's up, create the HYPERSPACE objective and the ReadyToHYPERSPACE variable (which tells other parts of the script to do stuff) IF (TimerExpiredDestroy ("G_MissionCompleteTimer")) ObjectiveCreate ("Hyperspace", LSTRING_Hyperspace, LSTRING_Hyperspace); ENDIF //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ // technology // IFONCE (TRUE) TimerCreateSetStart ("G_PlayIonOrPlasmaEvent", Random (195, 250)); ENDIFONCE // MISSION 05 Tech stuff: //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ // BRUTE FORCE METHOD #1 - if the player has Ion Cannons (not researched), they are allowed to research Plasma Bombs IF (VarGet ("G_TechEventHasPlayed") = FALSE) IFONCE ( (TimerExpired ("G_PlayIonOrPlasmaEvent")) AND (TechGetResearch ("IonWeapons")) ) // (Build: Attack Bomber) IF (VarGet ("G_PlayPlasmaTechEvent") = FALSE) VarCreateSet ("G_PlayPlasmaTechEvent", TRUE); VarCreateSet ("G_TechEventHasPlayed", TRUE); ENDIF ENDIFONCE ENDIF // BRUTE FORCE METHOD #2 - if the player has Ion Cannons (fully researched), they are allowed to research Plasma Bombs IF (VarGet ("G_TechEventHasPlayed") = FALSE) IFONCE ( (TimerExpired ("G_PlayIonOrPlasmaEvent")) AND (TechGet ("IonWeapons")) ) // (Build: Attack Bomber) IF (VarGet ("G_PlayPlasmaTechEvent") = FALSE) VarCreateSet ("G_PlayPlasmaTechEvent", TRUE); VarCreateSet ("G_TechEventHasPlayed", TRUE); ENDIF ENDIFONCE ENDIF // MISSION 05 Tech stuff: //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ // BRUTE FORCE METHOD #1 - if the player has Plasma Bombs (not researched), they are allowed to research Ion Weapons IF (VarGet ("G_TechEventHasPlayed") = FALSE) IFONCE ( (TimerExpired ("G_PlayIonOrPlasmaEvent")) AND (TechGetResearch ("PlasmaWeapons")) ) // (Build: Ion Cannon Frigate) IF (VarGet ("G_PlayIonTechEvent") = FALSE) VarCreateSet ("G_PlayIonTechEvent", TRUE); VarCreateSet ("G_TechEventHasPlayed", TRUE); ENDIF ENDIFONCE ENDIF // BRUTE FORCE METHOD #2 - if the player has Plasma Bombs (fully researched), they are allowed to research Ion Weapons IF (VarGet ("G_TechEventHasPlayed") = FALSE) IFONCE ( (TimerExpired ("G_PlayIonOrPlasmaEvent")) AND (TechGet ("PlasmaWeapons")) ) // (Build: Ion Cannon Frigate) IF (VarGet ("G_PlayIonTechEvent") = FALSE) VarCreateSet ("G_PlayIonTechEvent", TRUE); VarCreateSet ("G_TechEventHasPlayed", TRUE); ENDIF ENDIFONCE ENDIF // MISSION 05 Tech stuff: //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ // if the player has NEITHER Plasma Bombs OR Ion Cannons, they are allowed to research Plasma Bombs IF (VarGet ("G_TechEventHasPlayed") = FALSE) IFONCE ( (TimerExpired ("G_PlayIonOrPlasmaEvent")) AND ( (NOT (TechGetResearch ("PlasmaWeapons"))) AND (NOT (TechGetResearch ("IonWeapons"))) ) ) // (Build: Attack Bomber) IF (VarGet ("G_PlayPlasmaTechEvent") = FALSE) VarCreateSet ("G_PlayPlasmaTechEvent", TRUE); VarCreateSet ("G_TechEventHasPlayed", TRUE); ENDIF ENDIFONCE ENDIF // MISSION 05 Tech stuff: //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ // when the FI event teaching you about Defenders has played, allow Defenders to be researched IFONCE (VarGet ("G_TeachDefenderEventHasPlayed") = TRUE) TechSetResearch ("FireControl"); ENDIFONCE // MISSION 02 Tech stuff: //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ // if player researches Corvette drive, allow Corvette chassis // (Build: Light Corvette) IFONCE (TechGet ("MassDrive10Kt")) TechSetResearch ("Chassis2"); ENDIFONCE // if player researches Corvette chassis, allow Heavy Corvette upgrade // (Build: Heavy Corvette) IF ((TechGet ("Chassis2")) AND (VarGet ("SetMediumGuns") = FALSE)) TechSetResearch ("MediumGuns"); VarCreateSet ("SetMediumGuns", TRUE); ENDIF // MISSION 01 Tech stuff: //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ // if player researches Fighter chassis, allow Corvette Drive // (Build: Repair Corvette) IFONCE (TechGet ("Chassis1")) TechSetResearch ("MassDrive10Kt"); ENDIFONCE //ÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ ENDWATCH //ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ Global Stuff ÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛÛ