//********************************************************************************* module mc2_gencon : integer; const #include_ "misconst.abi" #include_ "sndconst.abi" type var static boolean Objective_0_Decided; static integer ScenarioResult; eternal boolean ExitTimerSet; static integer VictoryLevel; char[40] dstring; eternal real gametime; static real nextsecond; integer x; integer y; Position aPoint; static Position startP; eternal boolean PlayerForceDead; eternal boolean ClanForceDead; eternal boolean AlliedForceDead; eternal boolean GeneralAlarm; eternal boolean Flag1; eternal boolean Flag2; eternal boolean Flag3; eternal boolean Flag4; eternal boolean Flag5; eternal boolean Flag6; eternal boolean Flag7; eternal boolean Flag8; eternal boolean Flag9; eternal boolean Flag10; static boolean PlayPASound; static boolean PlayGASound; eternal integer GeneralAlarmCounter; boolean PerimeterBreach; static boolean startCam; static boolean endCam; static real velTime; static real zoomFOV; static real startFOV; static integer camObject; eternal integer FrontOfBaseTrigger; eternal integer NorthBridgeTrigger; eternal integer NorthBridge2Trigger; eternal integer CenterZoneTrigger; eternal integer SouthZoneTrigger; eternal integer NorthZoneTrigger; eternal boolean Group0AttacksFlag; eternal boolean Group1AttacksFlag; eternal boolean Group2AttacksFlag; eternal boolean Group3AttacksFlag; eternal boolean Group4RunAwayFlag; eternal boolean GoToBaseFlag; eternal boolean NorthBridgeFlag; eternal boolean NorthBridge2Flag; eternal integer ZoneEntered; static boolean BridgeVO; eternal boolean Group4RunVO; eternal real FactoryCapturedVO; #include_ "sndvar.abi" //------------------------------------------------------------------ // Init Function (automatically run first time through) //------------------------------------------------------------------ function init; var real[3] worldLoc; integer[2] cellLoc; code ScenarioResult = PLAYING; PlayerForceDead = FALSE; ClanForceDead = FALSE; AlliedForceDead = FALSE; ExitTimerSet = FALSE; VictoryLevel = 0; // New Scheme NextSecond = 1.0; GeneralAlarmCounter = -1; GeneralAlarm = FALSE; Flag1 = FALSE; Flag2 = FALSE; Flag3 = FALSE; Flag4 = FALSE; Flag5 = FALSE; Flag6 = FALSE; Flag7 = FALSE; Flag8 = FALSE; Flag9 = FALSE; Flag10 = FALSE; PlayPASound = FALSE; PlayGASound = FALSE; Objective_0_Decided = FALSE; startCam = FALSE; endCam = FALSE; velTime = 0; zoomFOV = 75.0; startFOV = 75.0; camObject = -1; GoToBaseFlag = false; Group0AttacksFlag = false; Group1AttacksFlag = false; Group2AttacksFlag = false; Group3AttacksFlag = false; Group4RunAwayFlag = false; NorthBridgeFlag = false; NorthBridge2Flag = false; ZoneEntered = 0; BridgeVO = true; Group4RunVO = true; FactoryCapturedVO = -1.0; worldLoc[0] = 64.0; worldLoc[1] = 2752.0; worldLoc[2] = 0.0; convertCoords(0, worldLoc, cellLoc); FrontOfBaseTrigger = addTriggerArea(cellLoc[0] - 21, cellLoc[1] - 15, cellLoc[0] + 4, cellLoc[1] + 36, 2, 0); worldLoc[0] = -490.667; worldLoc[1] = 4074.667; worldLoc[2] = 0.0; convertCoords(0, worldLoc, cellLoc); NorthBridgeTrigger = addTriggerArea(cellLoc[0] - 12, cellLoc[1] - 12, cellLoc[0] + 12, cellLoc[1] + 12, 2, 0); worldLoc[0] = -448.000; worldLoc[1] = 2752.000; worldLoc[2] = 0.0; convertCoords(0, worldLoc, cellLoc); NorthBridge2Trigger = addTriggerArea(cellLoc[0] - 12, cellLoc[1] - 12, cellLoc[0] + 9, cellLoc[1] + 12, 2, 0); worldLoc[0] = -4672.0; worldLoc[1] = 2240.0; worldLoc[2] = 0.0; convertCoords(0, worldLoc, cellLoc); CenterZoneTrigger = addTriggerArea(cellLoc[0] - 12, cellLoc[1] - 12, cellLoc[0] + 12, cellLoc[1] + 12, 2, 0); worldLoc[0] = -4714.667; worldLoc[1] = 1130.667; worldLoc[2] = 0.0; convertCoords(0, worldLoc, cellLoc); SouthZoneTrigger = addTriggerArea(cellLoc[0] - 12, cellLoc[1] - 12, cellLoc[0] + 12, cellLoc[1] + 12, 2, 0); worldLoc[0] = -4714.667; worldLoc[1] = 2794.667; worldLoc[2] = 0.0; convertCoords(0, worldLoc, cellLoc); NorthZoneTrigger = addTriggerArea(cellLoc[0] - 12, cellLoc[1] - 12, cellLoc[0] + 12, cellLoc[1] + 12, 2, 0); #include_ "sndinit.abi" endfunction; //------------------------------------------------------------------ // Main Code //------------------------------------------------------------------ code if ((not GoToBaseFlag) and isTriggerAreaHit(FrontOfBaseTrigger)) then GoToBaseFlag = true; //if (BridgeVO) then // BridgeVO = false; // playWave("data\sound\mc2_gencon_vo1.wav", -1); //endif; endif; if ((not NorthBridgeFlag) and isTriggerAreaHit(NorthBridgeTrigger)) then NorthBridgeFlag = true; if (BridgeVO) then BridgeVO = false; playWave("data\sound\mc2_gencon_vo1.wav", -1); endif; endif; if ((not NorthBridge2Flag) and isTriggerAreaHit(NorthBridge2Trigger)) then NorthBridge2Flag = true; if (BridgeVO) then BridgeVO = false; playWave("data\sound\mc2_gencon_vo1.wav", -1); endif; endif; if (ZoneEntered == 0) then if (isTriggerAreaHit(CenterZoneTrigger)) then ZoneEntered = 0; else if (isTriggerAreaHit(SouthZoneTrigger)) then ZoneEntered = 1; else if (isTriggerAreaHit(NorthZoneTrigger)) then ZoneEntered = 2; endif; endif; endif; endif; if (factoryCapturedVO > 1.0) then if (factoryCapturedVO < getTime) then playWave("data\sound\mc2_gencon_vo3.wav", -1); factoryCapturedVO = 0.5; endif; endif; //------------------------------------------------------------- //MUSIC CODE // Generic Music Selection code based on mission events. // /* if (getMissionWon) then playDigitalMusic(MissionWonTune0); playingMissionResultTune = true; playingObjectiveTune = false; playingDeathTune = false; playingNONCombatTune = false; playingAmbientTune = false; playingSensorTune = false; playingCombatTune = false; endif; if (getMissionLost) then playDigitalMusic(MissionLostTune0); playingMissionResultTune = true; playingObjectiveTune = false; playingDeathTune = false; playingNONCombatTune = false; playingAmbientTune = false; playingSensorTune = false; playingCombatTune = false; endif; if (getObjectiveSuccess and NOT playingMissionResultTune and NOT playingObjectiveTune) then playDigitalMusic(ObjectiveSuccessTune); playingObjectiveTune = true; playingNONCombatTune = false; playingAmbientTune = false; playingSensorTune = false; playingDeathTune = false; playingCombatTune = false; endif; if (getObjectiveFailed and NOT playingMissionResultTune and NOT playingObjectiveTune) then playDigitalMusic(ObjectiveFailedTune); playingObjectiveTune = true; playingCombatTune = false; playingNONCombatTune = false; playingAmbientTune = false; playingSensorTune = false; playingDeathTune = false; endif; if (getEnemyDestroyed and NOT playingMissionResultTune and NOT playingObjectiveTune and NOT playingDeathTune) then playDigitalMusic(EnemyDiedTune); playingDeathTune = true; playingAmbientTune = false; playingNONCombatTune = false; playingSensorTune = false; playingCombatTune = false; endif; if (getFriendlyDestroyed and NOT playingMissionResultTune and NOT playingObjectiveTune and NOT playingDeathTune) then playDigitalMusic(FriendlyDiedTune); playingAmbientTune = false; playingDeathTune = true; playingSensorTune = false; playingNONCombatTune = false; playingCombatTune = false; endif; if (not playMissionStartTune) then if (getSensorsActive and ((getCurrentMusicId == -1) or (playingCombatTune and not getPlayerInCombat) or (playingAmbientTune))) then playDigitalMusic(SensorTune0); playingMissionResultTune = false; playingObjectiveTune = false; playingDeathTune = false; playingNONCombatTune = true; playingCombatTune = false; playingAmbientTune = false; playingSensorTune = true; endif; if (NOT getSensorsActive and ((getCurrentMusicId == -1) or (playingCombatTune and not getPlayerInCombat) or (playingSensorTune))) then playDigitalMusic(AmbientTune0); playingMissionResultTune = false; playingObjectiveTune = false; playingDeathTune = false; playingNONCombatTune = true; playingAmbientTune = true; playingSensorTune = false; playingCombatTune = false; endif; endif; //ALWAYS switch to Combat if you can. if (getPlayerInCombat and ((getCurrentMusicId == -1) or playingNONCombatTune)) then playDigitalMusic(CombatTune0 + Random(NumCombatTunes)); playingMissionResultTune = false; playingObjectiveTune = false; playingDeathTune = false; playingNONCombatTune = false; playingCombatTune = true; playingAmbientTune = false; playingSensorTune = false; endif; //ALWAYS play mission start tune if we just started if (playMissionStartTune and (gametime > 1)) then playDigitalMusic(getMissionTune); playMissionStartTune = false; endif; */ //------------------------------------------------------------- //------------------------------------------------ // Debug Window Game Clock Second Counter // Note: This is used by some included functions. //------------------------------------------------ gametime = gettime; If (gametime >= nextsecond) Then nextsecond = gametime + 1; If (GeneralAlarm) then GeneralAlarmCounter = GeneralAlarmCounter + 1; endif; // dstring = "Gametime: "; // concat(dstring,gametime); // Print (dstring); endif; if ((PlayGASound) and (NextSecond == gametime + 1)) then playSoundEffect(GENERAL_ALARM_SOUND); endif; if (PlayPASound) then playSoundEffect(PERIMETER_ALARM_SOUND); endif; PerimeterBreach = FALSE; return (ScenarioResult); endmodule. //******************************************************************