//********************************************************************************* module mc2_20: integer; const #include_ "misconst.abi" #include_ "sndconst.abi" type var #include_ "sndvar.abi" 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; //*******************************************NEW eternal boolean baseAttacked; //Trigger when Mog Base has been attacked eternal boolean DshipAttacked; //Trigger for the Ambushing Units eternal boolean MogAttacked; //Trigger when the Mog POWERDOWN is attacked eternal integer MogM_PartID; //Moving Mogs partID eternal worldposition MogM_StartPos; //Start Position of the Moving Mog eternal boolean PrisionAttack; //Trigger used to trigger when Prision is attakced static boolean DavionVO_Played; //Trigger used to check if the DavionVO has been played static real DavionVO_Timer; //Timer used to played the Davion VO static real DavionPrisonVO; //Timer used to play vo for Davion Prisioner static boolean PrisonVO2Go; static boolean PrisonVO; static boolean PrisonVOCheck; static real DavionPrisonVO2; //--------------------------------------- // 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; //------------------------------------------------------------------ // Init Function (automatically run first time through) //------------------------------------------------------------------ function init; var real[3] worldLoc; integer[2] cellLoc; integer moverID; WorldPosition moverPos; code #include_ "sndinit.abi" 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; //************************************ baseAttacked = False; DshipAttacked = False; MogAttacked = False; PrisionAttack = False; DavionVO_Played = False; DavionVO_Timer = -1; DavionPrisonVO = -1; //--------------------------------------- // MUSIC STUFF AttackMusicTrigger1 = FALSE; AttackMusicTrigger2 = FALSE; AttackMusicTrigger3 = FALSE; StartMusicCheck = FALSE; StartCheck = FALSE; PlayCountCheck = FALSE; PrisonVO2Go = FALSE; PrisonVO = FALSE; PrisonVOCheck = FALSE; endfunction; //------------------------------------------------------------------ // Main Code //------------------------------------------------------------------ code //--------------------------------------------------- Mission 20 Stuff //--------------------------------------------------- //Used to Trigger Drop Ship ambush if ((checkObjectiveStatus(0) == 1)) then DshipAttacked = True; endif; //--------------------------------------------------- //Used when Perimeter Alarms are triggered if (GetGeneralAlarm == 1) then baseAttacked = True; endif; //--------------------------------------------------- //When Prision is attacked play VO if ((PrisionAttack) and (DavionVO_Timer == -1)) then DavionVO_Timer = getTime + 2; endif; if ((getTime > DavionVO_Timer) and (DavionVO_Timer > 0)) And (Not DavionVO_Played) then DavionVO_Timer = 0; DavionVO_Played = True; playWave("data\sound\mc2_20_0.wav", -1); //Son attacks the player endif; //--------------------------------------------------- //When Prision is attacked play VO if ((checkObjectiveStatus(1) == 1)) and (DavionPrisonVO == -1) then DavionPrisonVO = getTime + 2; endif; if ((getTime > DavionPrisonVO ) and (DavionPrisonVO > 0)) then DavionPrisonVO = 0; // PrisonVO2Go = TRUE; playWave("data\sound\mc2_20_1.wav", -1); //Son attacks the player endif; if ((checkObjectiveStatus(1) == 1)) then if (NOT PrisonVOCheck) then DavionPrisonVO2 = getTime + 14; PrisonVOCheck = TRUE; else if (getTime > DavionPrisonVO2 ) and (NOT PrisonVO) then PrisonVO = TRUE; playWave("data\sound\mc2_20_2.wav", -1); //Son attacks the player endif; endif; endif; //---------------------------------------------------- Mission 20 Stuff End //------------------------------------------------------------- //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 (1) == 1) AND (NOT PlayCountCheck) then PlayCountCheck = TRUE; SensorPlayCount = 1; 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 < 3) then SensorPlayCount = SensorPlayCount + 1; // mcprint (SensorPlayCount); playDigitalMusic(AmbientTune1); // playDigitalMusic(SensorTune3); // playDigitalMusic(SensorTune3); playingMissionResultTune = false; playingObjectiveTune = false; playingDeathTune = false; playingNONCombatTune = true; playingCombatTune = false; playingAmbientTune = false; playingSensorTune = true; else // if (NOT playingCombatTune) then playDigitalMusic(AmbientTune1); // 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(AmbientTune1); playingMissionResultTune = false; playingObjectiveTune = false; playingDeathTune = false; playingNONCombatTune = true; playingAmbientTune = true; playingSensorTune = false; playingCombatTune = false; endif; endif; if (NOT (checkObjectiveStatus(1) == 1)) then // if ((NOT (checkObjectiveStatus(2) == 1)) AND (NOT (checkObjectiveStatus(3) == 1)) AND (NOT (checkObjectiveStatus(4) == 1))) then if (getPlayerInCombat and ((getCurrentMusicId == -1) or playingNONCombatTune)) then if (AttackMusicTrigger1) then // mcprint ("Playing Random Combat Tune"); playDigitalMusic(CombatTune0 + Random(NumCombatTunes)); playingMissionResultTune = false; playingObjectiveTune = false; playingDeathTune = false; playingNONCombatTune = false; playingCombatTune = true; playingAmbientTune = false; playingSensorTune = false; endif; endif; endif; //ALWAYS play mission start tune if we just started if (playMissionStartTune and (gametime > 1)) then if (NOT StartCheck) then playDigitalMusic(MissionStartTune4); StartMusicTimer = getTime + 32; //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. //******************************************************************