home *** CD-ROM | disk | FTP | other *** search
- fsm StockStrongholds : integer;
-
- const
- #include_ <content\ABLScripts\mwconst.abi>
-
- type
- #include_ <content\ABLScripts\mwtype.abi>
-
- var
- static ObjectID Blue_goal1;
- static ObjectID Blue_goal2;
- static ObjectID Red_goal1;
- static ObjectID Red_goal2;
-
- static integer Blue_score_add;
- static integer Red_score_add;
-
- static integer game_timer;
- static integer pause_timer;
- static integer respawn_timer;
-
- static integer Blue_Guard_team;
- static integer Red_Guard_team;
- static boolean winning;
- static boolean RedHQ; // This is whether the Red HQ building is alive
- static boolean RedComm; // This is whether the Red Comm building is alive
- static boolean BlueHQ; // This is whether the Blue HQ building is alive
- static boolean BlueComm; // This is whether the Blue Comm building is alive
- static integer toggler1; // This makes it so there is a lengthier pause b/n some sounds
- static integer toggler2; // This makes it so there is a lengthier pause b/n some sounds
-
- function PlayBigAlerts;
- code
- PlayTeamBettySound(1,SOUND_TRIGGER_MISSILE_LOCKED_ON_ME);
- PlayTeamBettySound(2,SOUND_TRIGGER_MISSILE_LOCKED_ON_ME);
- Return;
- endfunction;
-
- function PlaySmallAlerts;
- code
- PlayTeamBettySound(1,SOUND_TRIGGER_NARC_SIGNAL_START);
- PlayTeamBettySound(2,SOUND_TRIGGER_NARC_SIGNAL_START);
- Return;
- endfunction;
-
- function init;
- code
- // Goal for Team 2 - Kill this
- GroupAddObject(GroupObjectId(20),ebu_Blue_HQ);
- GroupAddObject(GroupObjectId(20),ebu_Blue_Communications);
- MarkBuildingAsScorable(ebu_Blue_HQ);
- MarkBuildingAsScorable(ebu_Blue_Communications);
-
- // Goal for Team 1 - Kill this
- GroupAddObject(GroupObjectId(30),ebu_Red_HQ);
- GroupAddObject(GroupObjectId(30),ebu_Red_Communications);
- MarkBuildingAsScorable(ebu_Red_HQ);
- MarkBuildingAsScorable(ebu_Red_Communications);
-
- Blue_Guard_team = TeamObjectID(1);
- Red_Guard_team = TeamObjectID(2);
-
- Blue_score_add = 350;
- Red_score_add = 350;
-
- SetupScoring_Strongholds;
-
- // Misc setup
- winning = false;
- game_timer = gti_timer_1;
- pause_timer = gti_timer_2;
- respawn_timer = gti_timer_3;
-
- endfunction;
-
- function BlueTeamScores;
- code
- AddPoints(Blue_Guard_team,Blue_score_add);
- endfunction;
-
- function RedTeamScores;
- code
- AddPoints(Red_Guard_team,Red_score_add);
- endfunction;
-
- state StartState;
- code
- revealnavpoint(ena_Nav_Center);
- revealnavpoint(ena_Blue_Base);
- revealnavpoint(ena_Red_Base);
- TeamSetNav(1,ena_Red_Base);
- TeamSetNav(2,ena_Blue_Base);
- ResetTimer(Game_timer);
-
- StartTimer(4); // This is the timer for the warning messages about buildings
- ResetTimer(4);
-
- trans goState;
-
- endstate;
-
- state goState;
- code
-
- if (not winning) then
- if (GroupAllDead(GroupObjectID(20))) then
- RedTeamScores;
- ChatMessage("Blue Team's Base has been destroyed!");
- ChatMessage("Respawn in 5 seconds.");
- LogHQDestroyed(team1,team2);
- ResetTimer(Pause_Timer);
- ResetTimer(Respawn_Timer);
- winning = true;
- trans deadState;
- endif;
- endif;
-
- if (not winning) then
- if (GroupAllDead(GroupObjectID(30))) then
- BlueTeamScores;
- ChatMessage("Red Team's Base has been destroyed!");
- ChatMessage("Respawn in 5 seconds.");
- LogHQDestroyed(team2,team1);
- ResetTimer(Pause_Timer);
- ResetTimer(Respawn_Timer);
- winning = true;
- trans deadState;
- endif;
- endif;
-
- if (timegreater(4,5)) then
- if (not RedComm) then
- if (isshot(GroupObjectID(30))) then
- if (toggler1>3) then
- PlayTeamBettySound(2,SOUND_TRIGGER_ALARM1);
- ChatMessage("Red base is under attack.");
- toggler1=0;
- endif;
- endif;
- endif;
-
- if (not RedHQ) then
- if (isdead(ebu_Red_HQ)) then
- BlueTeamScores;
- ChatMessage("Red HQ has been destroyed.");
- PlayTeamBettySound(1,SOUND_TRIGGER_ALARM2);
- PlayTeamBettySound(2,SOUND_TRIGGER_ALARM2);
- PlayBigAlerts;
- RedHQ = true;
- endif;
- endif;
-
- if (not RedComm) then
- if (isdead(ebu_Red_Communications)) then
- BlueTeamScores;
- PlayTeamBettySound(1,SOUND_TRIGGER_ALARM2);
- PlayTeamBettySound(2,SOUND_TRIGGER_ALARM2);
- ChatMessage("Red Communications has been destroyed.");
- PlayBigAlerts;
- RedComm = true;
- endif;
- endif;
-
- if (not BlueComm) then
- if (isshot(GroupObjectID(20))) then
- if (toggler2>3) then
- PlayTeamBettySound(1,SOUND_TRIGGER_ALARM1);
- ChatMessage("Blue base is under attack.");
- toggler2=0;
- endif;
- endif;
- endif;
-
- if (not BlueHQ) then
- if (isdead(ebu_Blue_HQ)) then
- RedTeamScores;
- PlayTeamBettySound(1,SOUND_TRIGGER_ALARM2);
- PlayTeamBettySound(2,SOUND_TRIGGER_ALARM2);
- ChatMessage("Blue HQ has been destroyed.");
- PlayBigAlerts;
- BlueHQ = true;
- endif;
- endif;
-
- if (not BlueComm) then
- if (isdead(ebu_Blue_Communications)) then
- RedTeamScores;
- PlayTeamBettySound(1,SOUND_TRIGGER_ALARM2);
- PlayTeamBettySound(2,SOUND_TRIGGER_ALARM2);
- ChatMessage("Blue Communications has been destroyed.");
- PlayBigAlerts;
- BlueComm = true;
- endif;
- endif;
-
- Toggler1 = Toggler1 + 1;
- Toggler2 = Toggler2 + 1;
-
- resettimer(4);
- endif;
-
- if (not ismusicplaying) then
- StartMusic("Music\DesertAmbLoop",0.0,10.0,20);
- endif;
-
- endstate;
-
- state deadState;
- code
-
- if (timegreater (pause_timer,5)) then
- LogMMapRespawn;
- Winning = False;
- RedComm = False;
- RedHQ = False;
- BlueComm = False;
- BlueHQ = False;
- RespawnMission;
- ResetTimer(Pause_timer);
- //ChatMessage("Respawn Done, one more in 5 sec.");
- // ChatMessage("Respawn in 5");
- ChatMessage("Game respawned.");
- // trans RestartState;
- trans Startstate
- endif;
-
- endstate;
-
- state over;
- code
-
- endstate;
-
- endfsm.
-