//********************************************************************************* module mc2_05 : 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 MiddleOfBaseTrigger; eternal integer NorthBridgeTrigger; eternal boolean NorthBridgeFlag; eternal boolean MiddleOfBaseFlag; static boolean Prison_Trigger; static boolean Prison_Trigger2; static real PrisonVOTimerDelay; static real PrisonVOTimerDelay2; static boolean Prison_Vo; static boolean Prison_Vo2; static boolean WF_Trigger; static boolean WF_Vo; static real WFVOTimerDelay; //--------------------------------------- // MUSIC STUFF eternal boolean AttackMusicTrigger1; eternal boolean AttackMusicTrigger2; eternal boolean AttackMusicTrigger3; static real StartMusicTimer; static boolean StartMusicCheck; static boolean StartCheck; static integer SensorPlayCount; static boolean PlayCountCheck; #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; #include_ "sndinit.abi" Prison_Vo = FALSE; Prison_Vo2 = FALSE; Prison_Trigger = FALSE; Prison_Trigger2 = FALSE; WF_Trigger = FALSE; WF_Vo = FALSE; NorthBridgeFlag = false; MiddleOfBaseFlag = false; worldLoc[0] = 832.000; worldLoc[1] = 448.000; 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] = -4288.000; worldLoc[1] = -3648.000; worldLoc[2] = 0.0; convertCoords(0, worldLoc, cellLoc); MiddleOfBaseTrigger = addTriggerArea(cellLoc[0] - 8, cellLoc[1] - 8, cellLoc[0] + 8, cellLoc[1] + 8, 2, 0); //--------------------------------------- // MUSIC STUFF AttackMusicTrigger1 = FALSE; AttackMusicTrigger2 = FALSE; AttackMusicTrigger3 = FALSE; StartMusicCheck = FALSE; StartCheck = FALSE; PlayCountCheck = FALSE; endfunction; //------------------------------------------------------------------ // Main Code //------------------------------------------------------------------ code if ((not NorthBridgeFlag) and isTriggerAreaHit(NorthBridgeTrigger)) then NorthBridgeFlag = true; endif; if ((not MiddleOfBaseFlag) and isTriggerAreaHit(MiddleOfBaseTrigger)) then MiddleOfBaseFlag = true; endif; //******************************************************* //Trigger for to Powerup and attack player if (checkObjectiveStatus(3) == 1) then if (NOT Prison_Trigger) then Prison_Trigger = True; PrisonVOTimerDelay = getTime + 4; //Wait 15 secs before playing VO else if ((getTime > PrisonVOTimerDelay) AND (Not Prison_Vo)) then Prison_Vo = True; playWave("data\sound\mc2_05_1.WAV", -1); //Tac Officer VO plays endif; endif; endif; //******************************************************* //Trigger for to Powerup and attack player if (checkObjectiveStatus(3) == 1) then if (NOT Prison_Trigger2) then Prison_Trigger2 = True; PrisonVOTimerDelay2 = getTime + 23; //Wait 15 secs before playing VO else if ((getTime > PrisonVOTimerDelay2) AND (Not Prison_Vo2)) then Prison_Vo2 = True; playVideo("MC2_05A.bik"); // playWave("data\sound\mc2_05_2.WAV", -1); //Tac Officer VO plays endif; endif; endif; //******************************************************* //Trigger for to Powerup and attack player if (checkObjectiveStatus(1) == 1) then if (NOT WF_Trigger) then WF_Trigger = True; WFVOTimerDelay = getTime + 3; //Wait 15 secs before playing VO else if ((getTime > WFVOTimerDelay) AND (Not WF_Vo)) then WF_Vo = True; playVideo("W02.bik"); // playWave("data\sound\mc2_05_3.WAV", -1); //Tac Officer VO plays endif; 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 (checkObjectiveStatus (3) == 1) AND (NOT PlayCountCheck) then PlayCountCheck = TRUE; SensorPlayCount = 3; endif; if (not playMissionStartTune) then if (getSensorsActive and ((getCurrentMusicId == -1) or (playingCombatTune and not getPlayerInCombat) or (playingAmbientTune))) then if (random(100) < 1) then if (SensorPlayCount < 5) then SensorPlayCount = SensorPlayCount + 1; mcprint (SensorPlayCount); playDigitalMusic(SensorTune2); playingMissionResultTune = false; playingObjectiveTune = false; playingDeathTune = false; playingNONCombatTune = true; playingCombatTune = false; playingAmbientTune = false; playingSensorTune = true; else // if (NOT playingCombatTune) then playDigitalMusic(AmbientTune0); mcprint ("Playing Ambient Tune Sensorstyle"); playingMissionResultTune = false; playingObjectiveTune = false; playingDeathTune = false; playingNONCombatTune = true; playingCombatTune = false; playingAmbientTune = false; playingSensorTune = true; endif; endif; 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; if (NOT (checkObjectiveStatus(1) == 1)) then if (getPlayerInCombat and ((getCurrentMusicId == -1) or playingNONCombatTune)) then if (AttackMusicTrigger1) then if (random(100) < 90) then mcprint ("Playing 1st Combat Tune2"); playDigitalMusic(CombatTune2); playingMissionResultTune = false; playingObjectiveTune = false; playingDeathTune = false; playingNONCombatTune = false; playingCombatTune = true; playingAmbientTune = false; playingSensorTune = false; else mcprint ("Playing 2nd Combat Tune3"); playDigitalMusic(CombatTune3); playingMissionResultTune = false; playingObjectiveTune = false; playingDeathTune = false; playingNONCombatTune = false; playingCombatTune = true; playingAmbientTune = false; playingSensorTune = false; endif; endif; endif; endif; if (NOT (checkObjectiveStatus(3) == 1)) then if (getPlayerInCombat and ((getCurrentMusicId == -1) or playingNONCombatTune)) then if (AttackMusicTrigger2) then if (random(100) < 90) then mcprint ("Playing 1st Combat Tune2"); playDigitalMusic(CombatTune2); playingMissionResultTune = false; playingObjectiveTune = false; playingDeathTune = false; playingNONCombatTune = false; playingCombatTune = true; playingAmbientTune = false; playingSensorTune = false; else mcprint ("Playing 2nd Combat Tune3"); playDigitalMusic(CombatTune3); playingMissionResultTune = false; playingObjectiveTune = false; playingDeathTune = false; playingNONCombatTune = false; playingCombatTune = true; playingAmbientTune = false; playingSensorTune = false; endif; endif; endif; endif; //ALWAYS play mission start tune if we just started if (playMissionStartTune and (gametime > 1)) then if (NOT StartCheck) then playDigitalMusic(MissionStartTune1); StartMusicTimer = getTime + 23; //Setting Timer //playMissionStartTune = true; StartCheck = TRUE; else if (Not StartMusicCheck) and (getTime > StartMusicTimer) then StartMusicCheck = TRUE; playMissionStartTune = false; endif; endif; 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. //******************************************************************