Complete disaster-recovery snapshot: engine/game source, game data assets, VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive. Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false, no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
640 lines
14 KiB
Plaintext
640 lines
14 KiB
Plaintext
|
|
fsm MasterTrial : integer;
|
|
|
|
const
|
|
|
|
#include_ <content\ABLScripts\mwconst.abi>
|
|
|
|
type
|
|
|
|
#include_ <content\ABLScripts\mwtype.abi>
|
|
|
|
var
|
|
|
|
eternal integer playermech;
|
|
|
|
static integer cinema_cut;
|
|
|
|
static integer current_attacker;
|
|
|
|
static locpoint MasterPoint;
|
|
static integer TeleportNav;
|
|
|
|
static integer bot_group;
|
|
static integer bot_auto_attack_range;
|
|
static integer bot_is_shot_radius;
|
|
static integer bot_activated_message_duration;
|
|
static integer bot_activated_timer;
|
|
static integer bot_killed_timer;
|
|
static integer cinema_timer; //added 10-12
|
|
//static integer bot_callout_timer;
|
|
static integer mission_timer;
|
|
static integer Num_Times_Died;
|
|
|
|
static integer LastSound;
|
|
|
|
static boolean OneMinuteWarning;
|
|
|
|
eternal boolean [4]bot_attacking;
|
|
|
|
|
|
function init;
|
|
var
|
|
integer i;
|
|
|
|
code
|
|
playermech = getplayervehicle(epl_player0);
|
|
|
|
cinema_cut = 0;
|
|
|
|
LastSound = -1;
|
|
|
|
TeleportNav = ena_Nav_Master;
|
|
|
|
current_attacker = NO_UNIT;
|
|
|
|
Num_Times_Died = 0;
|
|
OneMinuteWarning = False;
|
|
|
|
endfunction;
|
|
|
|
function PlayNextSong;
|
|
|
|
var
|
|
integer sound;
|
|
|
|
code
|
|
sound = Rand(0,8);
|
|
|
|
if (sound == lastsound) then
|
|
if (sound == 4) then
|
|
sound = 5;
|
|
else
|
|
sound = (8 - lastsound);
|
|
endif;
|
|
endif;
|
|
|
|
LastSound = sound;
|
|
|
|
switch (LastSound)
|
|
|
|
case 8:
|
|
StartMusic("Music\ActionPack",0.5,1.0,50);
|
|
endcase;
|
|
case 7:
|
|
StartMusic("Music\ArmedLoop",0.5,1.0,50);
|
|
endcase;
|
|
case 6:
|
|
StartMusic("Music\Core",0.5,1.0,50);
|
|
endcase;
|
|
case 5:
|
|
StartMusic("Music\Daggers",0.5,1.0,50);
|
|
endcase;
|
|
case 4:
|
|
StartMusic("Music\DFA",0.5,1.0,50);
|
|
endcase;
|
|
case 3:
|
|
StartMusic("Music\Push",0.5,1.0,50);
|
|
endcase;
|
|
case 2:
|
|
StartMusic("Music\T1Loop",0.5,1.0,50);
|
|
endcase;
|
|
case 1:
|
|
StartMusic("Music\T2Loop",0.5,1.0,50);
|
|
endcase;
|
|
case 0:
|
|
StartMusic("Music\T3Loop",0.5,1.0,50);
|
|
endcase;
|
|
|
|
endswitch;
|
|
endfunction;
|
|
|
|
function BotIsShot(integer index) : Integer;
|
|
var
|
|
ObjectID bot;
|
|
code
|
|
bot = GroupGetObject(bot_group,index);
|
|
|
|
if (bot == NO_UNIT) then
|
|
return (0);
|
|
endif;
|
|
|
|
if (IsDead(bot) == TRUE) then
|
|
return (0);
|
|
endif;
|
|
|
|
if (IsShutdown(bot) == FALSE) then
|
|
return (0);
|
|
endif;
|
|
|
|
if (IsWithin(playermech,bot,bot_auto_attack_range) == true) then
|
|
return (1);
|
|
endif;
|
|
|
|
if (IsShot(bot) == TRUE) then
|
|
return (2);
|
|
endif;
|
|
|
|
return (0);
|
|
endfunction;
|
|
|
|
function GetBot(integer index) : Integer;
|
|
code
|
|
return (GroupGetObject(bot_group,index));
|
|
endfunction;
|
|
|
|
function BotIsAttacking(integer index) : Boolean;
|
|
var
|
|
ObjectID bot;
|
|
code
|
|
bot = GroupGetObject(bot_group,index);
|
|
|
|
if (bot == NO_UNIT) then
|
|
return (FALSE);
|
|
endif;
|
|
|
|
if (IsDead(bot) == true) then
|
|
return (FALSE);
|
|
endif;
|
|
|
|
if (IsShutdown(bot) == false) then
|
|
return (TRUE);
|
|
endif;
|
|
|
|
return (FALSE);
|
|
endfunction;
|
|
|
|
function AnyBotIsAttacking : Boolean;
|
|
code
|
|
if (BotIsAttacking(0) == true) then
|
|
return (TRUE);
|
|
endif;
|
|
|
|
if (BotIsAttacking(1) == true) then
|
|
return (TRUE);
|
|
endif;
|
|
|
|
if (BotIsAttacking(2) == true) then
|
|
return (TRUE);
|
|
endif;
|
|
|
|
return (FALSE);
|
|
endfunction;
|
|
|
|
function NotifyNextAttacker;
|
|
code
|
|
switch (GroupNumDead(bot_group))
|
|
case 3:
|
|
//HelpMessage(eob_Obj_Opponent4,bot_activated_message_duration);
|
|
SuccessObjective (eob_master3);
|
|
endcase;
|
|
case 2:
|
|
SuccessObjective (eob_master2);
|
|
PlayNextSong;
|
|
HelpMessage(eob_Obj_Opponent3,bot_activated_message_duration);
|
|
endcase;
|
|
case 1:
|
|
SuccessObjective (eob_master1);
|
|
PlayNextSong;
|
|
HelpMessage(eob_Obj_Opponent2,bot_activated_message_duration);
|
|
endcase;
|
|
case 0:
|
|
HelpMessage(eob_Obj_Opponent1,bot_activated_message_duration);
|
|
endcase;
|
|
endswitch;
|
|
endfunction;
|
|
|
|
function StartAttacking(ObjectID who);
|
|
code
|
|
current_attacker = who;
|
|
|
|
StartTimer(bot_activated_timer);
|
|
NotifyNextAttacker;
|
|
GetLocation(TeleportNav,MasterPoint); //Mike added new code 10/04
|
|
Teleport(current_attacker,MasterPoint);
|
|
Startup(current_attacker);
|
|
endfunction;
|
|
|
|
function CheckToActivateOtherAttackers;
|
|
var
|
|
integer i;
|
|
ObjectID who_is_shot;
|
|
integer bot_is_shot_value;
|
|
|
|
code
|
|
for i = 0 to 2 do
|
|
bot_is_shot_value = BotIsShot(i);
|
|
|
|
if (bot_is_shot_value <> 0) then
|
|
who_is_shot = GetBot(i);
|
|
|
|
if (who_is_shot <> current_attacker) then
|
|
if (IsShutdown(who_is_shot) == true) then
|
|
if (bot_is_shot_value == 1) then
|
|
HelpMessage(eob_Obj_OtherActivated_Approaching,bot_activated_message_duration);
|
|
else
|
|
HelpMessage(eob_Obj_OtherActivated_Firing,bot_activated_message_duration);
|
|
endif;
|
|
|
|
Startup(GetBot(i));
|
|
|
|
StartTimer(bot_activated_timer);
|
|
endif;
|
|
endif;
|
|
endif;
|
|
endfor;
|
|
endfunction;
|
|
|
|
function AttackBotsIfShot : Boolean;
|
|
code
|
|
if (BotIsShot(0) <> 0) then
|
|
StartAttacking(GetBot(0));
|
|
return (TRUE);
|
|
endif;
|
|
|
|
if (BotIsShot(1) <> 0) then
|
|
StartAttacking(GetBot(1));
|
|
return (TRUE);
|
|
endif;
|
|
|
|
if (BotIsShot(2) <> 0) then
|
|
StartAttacking(GetBot(2));
|
|
return (TRUE);
|
|
endif;
|
|
|
|
return (FALSE);
|
|
endfunction;
|
|
|
|
state startState;
|
|
var
|
|
integer i;
|
|
|
|
code
|
|
bot_auto_attack_range = 5; //50
|
|
bot_group = GroupObjectID(951);
|
|
bot_is_shot_radius = 3; //30
|
|
bot_activated_message_duration = 6;
|
|
bot_activated_timer = gti_Timer_10;
|
|
bot_killed_timer = gti_Timer_11;
|
|
//bot_callout_timer = gti_Timer_12;
|
|
mission_timer = gti_Timer_13;
|
|
|
|
cinema_timer = gti_Timer_15;
|
|
|
|
if (GroupSize(bot_group) == 0) then
|
|
trans ThisMustNotBeMasterTrials;
|
|
endif;
|
|
|
|
for i = 0 to 2 do
|
|
TeleportToHell(GetBot(i));
|
|
endfor;
|
|
|
|
Shutdown(bot_group);
|
|
SetIsShotRadius(bot_group,bot_is_shot_radius);
|
|
|
|
StartTimer(bot_killed_timer);
|
|
StartTimer(mission_timer);
|
|
StartTimer(cinema_timer);
|
|
|
|
PlayNextSong;
|
|
|
|
//PlayVoiceOverOnce("VO\Generic\Luck",Talker_Rat);
|
|
|
|
trans opening;
|
|
endstate;
|
|
|
|
state NextAttacker;
|
|
var
|
|
integer i;
|
|
ObjectID bot;
|
|
|
|
code
|
|
SetIsShotRadius(bot_group,bot_is_shot_radius);
|
|
|
|
if (current_attacker <> NO_UNIT) then
|
|
if (IsDead(current_attacker) == TRUE) then
|
|
current_attacker = NO_UNIT;
|
|
else
|
|
trans Attacking;
|
|
endif;
|
|
endif;
|
|
|
|
|
|
if (IsDead(playermech)) then //new code by Mike T. 10/4
|
|
Num_Times_Died = Num_Times_Died + 1;
|
|
If Num_Times_Died <= 1 then
|
|
PlayVoiceOverOnce("VO\Generic\IanDestroyed3",Talker_Fo1);
|
|
trans WaitForPlayer;
|
|
else
|
|
//PlayVoiceOverOnce("VO\Generic\YouLose",Talker_Bet);
|
|
endmission(False,12);
|
|
trans Lost;
|
|
endif;
|
|
//if (IsDead(playermech)) then
|
|
// PlayVoiceOverOnce("VO\Generic\IanDestroyed3",Talker_Fo1);
|
|
else
|
|
if ((GroupNumDead(bot_group)) == 3) then
|
|
trans Finish;
|
|
else
|
|
if (TimeGreater(bot_killed_timer,2.0)) then
|
|
|
|
if (AttackBotsIfShot == TRUE) then
|
|
trans Attacking;
|
|
else
|
|
if ((TimeGreater(bot_killed_timer,15.0)) OR //new code by Mike T. 10/4
|
|
(firedweapongroup(1) == true) OR
|
|
(firedweapongroup(2) == true) OR
|
|
(firedweapongroup(3) == true) OR
|
|
(firedweapongroup(4) == true) OR
|
|
(firedweapongroup(5) == true) OR
|
|
(firedweapongroup(6) == true)) then
|
|
bot = GroupGetFirstObject(bot_group);
|
|
|
|
if (bot <> NO_UNIT) then
|
|
StartAttacking(bot);
|
|
trans Attacking;
|
|
endif;
|
|
else
|
|
HelpMessage(eob_Obj_FireForNextOpponent,5000);
|
|
endif;
|
|
endif;
|
|
endif;
|
|
endif;
|
|
endif;
|
|
endstate;
|
|
|
|
state Attacking;
|
|
code
|
|
if (current_attacker <> NO_UNIT) then
|
|
if (IsDead(current_attacker) == true) then
|
|
current_attacker = NO_UNIT;
|
|
else
|
|
if (TimeGreater(bot_activated_timer,5.0)) then
|
|
CheckToActivateOtherAttackers;
|
|
endif;
|
|
endif;
|
|
endif;
|
|
|
|
if (AnyBotIsAttacking == false) then
|
|
StartTimer(bot_killed_timer);
|
|
|
|
trans NextAttacker;
|
|
endif;
|
|
|
|
if (IsDead(playermech)) then //new code by Mike T. 10/4
|
|
Num_Times_Died = Num_Times_Died + 1;
|
|
If Num_Times_Died <= 1 then
|
|
PlayVoiceOverOnce("VO\Generic\IanDestroyed3",Talker_Fo1);
|
|
trans WaitForPlayer;
|
|
else
|
|
//PlayVoiceOverOnce("VO\Generic\YouLose",Talker_Bet);
|
|
endmission(False,12);
|
|
trans Lost;
|
|
endif;
|
|
endif;
|
|
|
|
if (not TimeGreater(mission_timer,600.0)) then
|
|
if (TimeGreater(mission_timer,540.0)) then
|
|
If OneMinuteWarning == False then
|
|
HelpMessage(eob_Obj_OneMinute,59);
|
|
PlayVoiceOverOnce("VO\Generic\Hurry3",Talker_Rat);
|
|
OneMinuteWarning = True;
|
|
endif;
|
|
endif;
|
|
else;
|
|
if ((GroupNumDead(bot_group)) >= 2) then
|
|
trans Finish;
|
|
else
|
|
PlayVoiceOverOnce("VO\Generic\YouLose",Talker_Bet);
|
|
endmission(False,12);
|
|
trans Lost;
|
|
endif;
|
|
endif;
|
|
|
|
if ((GroupNumDead(bot_group)) >= 2) then
|
|
PlayVoiceOverOnce("VO\Generic\EnemyMech",Talker_Fo3);
|
|
else
|
|
if ((GroupNumDead(bot_group)) >= 1) then
|
|
PlayVoiceOverOnce("VO\Generic\EnemyMech",Talker_Rat);
|
|
endif;
|
|
endif;
|
|
|
|
endstate;
|
|
|
|
state WaitForPlayer; //new code by Mike T. 10/4
|
|
code
|
|
|
|
If (not IsDead(playermech)) then
|
|
trans attacking;
|
|
endif;
|
|
|
|
endstate;
|
|
|
|
state Finish;
|
|
code
|
|
//PlayVoiceOverOnce("VO\Generic\VictoryImminent",Talker_Bet);
|
|
//SuccessObjectiveAll(20);
|
|
trans won;
|
|
endstate;
|
|
|
|
state ThisMustNotBeMasterTrials;
|
|
code
|
|
//if (IsDead(playermech)) then
|
|
// PlayVoiceOverOnce("VO\Generic\IanDestroyed3",Talker_Fo1);
|
|
//endif;
|
|
|
|
if (IsDead(playermech)) then //new code by Mike T. 10/4
|
|
Num_Times_Died = Num_Times_Died + 1;
|
|
If Num_Times_Died <= 1 then
|
|
PlayVoiceOverOnce("VO\Generic\IanDestroyed3",Talker_Fo1);
|
|
trans WaitForPlayer;
|
|
else
|
|
//PlayVoiceOverOnce("VO\Generic\YouLose",Talker_Bet);
|
|
endmission(False,12);
|
|
trans Lost;
|
|
endif;
|
|
endif;
|
|
|
|
endstate;
|
|
|
|
state deadState;
|
|
code
|
|
endstate;
|
|
|
|
//-----------------------------------------
|
|
//HERE THERE BE CINEMAS
|
|
//-----------------------------------------
|
|
|
|
state opening;
|
|
|
|
code
|
|
|
|
PlayVoiceOverOnce("VO\Generic\GoodLuck",Talker_Rat);
|
|
|
|
switch (cinema_cut)
|
|
|
|
case 0:
|
|
CinemaStart;
|
|
|
|
SetActiveCamera (eca_CameraShip);
|
|
|
|
FadeToBlack(0.0);
|
|
|
|
Targetfollowobject(playermech);
|
|
targetoffset(0.0,8.0,0.0,0.0,false);
|
|
|
|
Camerafollowobject(playermech);
|
|
|
|
Cameraoffset(0.0,75.0,75.0,0.0,true);
|
|
Cameraoffset(50.0,35.0,-50.0,6.0,true);
|
|
|
|
FadeFromBlack(3.0);
|
|
|
|
cinema_cut = cinema_cut + 1;
|
|
|
|
endcase;
|
|
|
|
case 1:
|
|
|
|
if (TimeGreater(cinema_timer,5)) then
|
|
//Cameraoffset(50.0,35.0,-50.0,0.0,true);
|
|
Cameraoffset(-1.0,10.0,-5.0,4.0,true);
|
|
resettimer (cinema_timer);
|
|
cinema_cut = cinema_cut + 1;
|
|
endif;
|
|
|
|
endcase;
|
|
|
|
case 2:
|
|
if (TimeGreater(cinema_timer,4)) then
|
|
KillTimer(cinema_timer);
|
|
cinema_cut = 0;
|
|
cinemaend;
|
|
trans NextAttacker;
|
|
endif;
|
|
endcase;
|
|
|
|
endswitch;
|
|
|
|
endstate;
|
|
|
|
state won;
|
|
|
|
code
|
|
|
|
StartMusic("Music\Victory",0.0,0.25,50);
|
|
|
|
if (cinemaskip) then
|
|
//KillVoiceOvers;
|
|
KillTimer(cinema_timer);
|
|
SetGlobalTrigger(0,true);
|
|
playerai(epl_player0,false);
|
|
SetAudioFXEnabled(true);
|
|
FadeToBlack(1.0);
|
|
SetAlwaysIgnoreObstacles(FALSE);
|
|
EndMission(true,1);
|
|
//CinemaEnd; Without the cinema end...this is a nice transition to shell
|
|
endif;
|
|
|
|
|
|
switch (cinema_cut)
|
|
case 0:
|
|
CinemaStart;
|
|
SetAlwaysIgnoreObstacles(TRUE);
|
|
StartTimer(cinema_timer);
|
|
SetActiveCamera (eca_CameraShip);
|
|
FadeToBlack(0.0);
|
|
ResetTimer(cinema_timer);
|
|
Targetfollowobject(playermech);
|
|
camerafollowobject(playermech);
|
|
targetoffset(0.0,9.0,0.0,0.0,false);
|
|
Cameraoffset(30.0,5.0,30.0,0.0,true);
|
|
Cameraoffset(-50.0,60.0,-100.0,12.0,true);
|
|
FadeFromBlack(2.0);
|
|
cinema_cut = cinema_cut + 1;
|
|
|
|
endcase;
|
|
|
|
case 1:
|
|
|
|
if (timegreater(cinema_timer,3)) then
|
|
PlayVoiceOverOnce("VO\Generic\YouWin",Talker_Bet);
|
|
endif;
|
|
|
|
if (timegreater(cinema_timer,10)) then
|
|
FadeToBlack(1.5);
|
|
EndMission(true,2);
|
|
endif;
|
|
|
|
if (timegreater(cinema_timer,13)) then
|
|
cinema_cut = 0;
|
|
resettimer (cinema_timer);
|
|
killtimer(cinema_timer);
|
|
playerai(epl_player0,false);
|
|
cinemaend;
|
|
endif;
|
|
endcase;
|
|
endswitch;
|
|
|
|
endstate;
|
|
|
|
state lost;
|
|
|
|
code
|
|
|
|
StartMusic("Music\Defeat",0.0,0.25,50);
|
|
PlayVoiceOverOnce("VO\Generic\YouLose",Talker_Bet);
|
|
|
|
if (cinemaskip) then
|
|
//KillVoiceOvers;
|
|
KillTimer(cinema_timer);
|
|
SetGlobalTrigger(0,true);
|
|
playerai(epl_player0,false);
|
|
SetAudioFXEnabled(true);
|
|
FadeToBlack(1.0);
|
|
SetAlwaysIgnoreObstacles(FALSE);
|
|
EndMission(false,1);
|
|
//CinemaEnd; Without the cinema end...this is a nice transition to shell
|
|
endif;
|
|
|
|
|
|
switch (cinema_cut)
|
|
case 0:
|
|
CinemaStart;
|
|
SetAlwaysIgnoreObstacles(TRUE);
|
|
StartTimer(cinema_timer);
|
|
SetActiveCamera (eca_CameraShip);
|
|
FadeToBlack(0.0);
|
|
ResetTimer(cinema_timer);
|
|
Targetfollowobject(playermech);
|
|
camerafollowobject(playermech);
|
|
targetoffset(0.0,9.0,0.0,0.0,false);
|
|
Cameraoffset(30.0,5.0,30.0,0.0,true);
|
|
Cameraoffset(-50.0,60.0,-100.0,12.0,true);
|
|
FadeFromBlack(2.0);
|
|
cinema_cut = cinema_cut + 1;
|
|
|
|
endcase;
|
|
|
|
case 1:
|
|
if (timegreater(cinema_timer,6)) then
|
|
FadeToBlack(1.0);
|
|
EndMission(false,2);
|
|
endif;
|
|
|
|
if (timegreater(cinema_timer,12)) then
|
|
cinema_cut = 0;
|
|
resettimer (cinema_timer);
|
|
killtimer(cinema_timer);
|
|
playerai(epl_player0,false);
|
|
cinemaend;
|
|
endif;
|
|
endcase;
|
|
endswitch;
|
|
|
|
endstate;
|
|
|
|
endfsm.
|
|
//******************************************************************
|
|
|