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.
656 lines
15 KiB
Plaintext
656 lines
15 KiB
Plaintext
// Mechwarrior: Vengeance
|
|
// Copyright © 1999-2000
|
|
// Mechbay_main.script
|
|
// Paolo Malabuyo
|
|
// July 11, 2000
|
|
|
|
// jcem begin
|
|
#include "Content\\ShellScripts\\ctcl_params.h"
|
|
#define GAME_START_MSG " Start Game "
|
|
// jcem end
|
|
|
|
#include "Content\\ShellScripts\\stddefs.h"
|
|
#include "Content\\ShellScripts\\MechLabHeaders.h"
|
|
#include "Content\\ShellScripts\\ScriptStrings.h"
|
|
#include "Content\\ShellScripts\\ShellFunctionHeaders.hpp"
|
|
|
|
#include "Content\\ShellScripts\\buttons.script"
|
|
#include "Content\\ShellScripts\\common_shell.script"
|
|
#include "Content\\ShellScripts\\c_MoviePlayer.script"
|
|
|
|
#define PM_INITIALMULTIPLAYSCREEN (-12345)
|
|
#define PM_CHECK_DISPLAY_MODE (-3232)
|
|
|
|
#define MAX_IDLETIME 15000 // 15 secs...
|
|
|
|
//MSL 5.06
|
|
#define USE_O_MECH_LAB !($$g_nMechLabOp$$)
|
|
|
|
main
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
setresource("ScriptStrings.dll")
|
|
font3d garbagefont = FPATH localize$(IDS_F_MAINMENU_GARBAGE)
|
|
font3d smallfont = FPATH localize$(IDS_F_MAINMENU_COMPASS)
|
|
int def_num_color = packcolor(20, 100, 200, 100)
|
|
|
|
object screen = o_MainMenuScreen
|
|
initialize(screen)
|
|
focus(screen)
|
|
}
|
|
}
|
|
|
|
o_MainMenuScreen
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
// jcem - CTCL_IsConsoleX: -ctcltype 2/3, CTCL_IsConsole -ctcltype 1
|
|
if callback($$CTCL_CheckUseJPD$$)
|
|
setpointer(0)
|
|
int nInitialMultiplayScreen
|
|
if callback($$CTCL_IsConsole$$)
|
|
nInitialMultiplayScreen = 1
|
|
else
|
|
nInitialMultiplayScreen = 0
|
|
if callback($$CTCL_CheckCOOP$$)
|
|
{
|
|
object o_fullscrbutton = s_fullscrbutton
|
|
}
|
|
|
|
if !callback($$CTCL_IsConsoleX$$) || callback($$CTCL_CheckCOOP$$)
|
|
{
|
|
if !callback($$CTCL_IsConsole$$)
|
|
{
|
|
object o_planet = panedisplay
|
|
o_planet.filename = GPATH "planet.tga"
|
|
o_planet.location = 800 - (356 + 20), 600 - (285 + 25), 0
|
|
o_planet.panecolor = packcolor(255, 255, 255, 200)
|
|
initialize(o_planet)
|
|
|
|
object o_moon = panedisplay
|
|
o_moon.filename = GPATH "moon.tga"
|
|
o_moon.location = 80, 190, 0
|
|
o_moon.panecolor = packcolor(255, 255, 255, 200)
|
|
initialize(o_moon)
|
|
|
|
} // if !callback($$CTCL_IsConsole$$)
|
|
|
|
object o_frame = frame
|
|
o_frame.type = 0
|
|
o_frame.location = 0, 0, 100
|
|
o_frame.screen_name = "BattleTech" // localize$(DNL_MECHWARRIOR_VENGEANCE)
|
|
initialize(o_frame)
|
|
|
|
|
|
if !callback($$CTCL_IsConsole$$)
|
|
{
|
|
|
|
object o_dropship1 = panedisplay
|
|
o_dropship1.filename = GPATH "MM_dropship1.tga"
|
|
o_dropship1.location = 140, 20, 4
|
|
o_dropship1.panecolor = packcolor(255, 255, 255, 200)
|
|
initialize(o_dropship1)
|
|
|
|
object o_dropship2 = panedisplay
|
|
o_dropship2.filename = GPATH "MM_dropship2.tga"
|
|
o_dropship2.location = 70, 350, 4
|
|
o_dropship2.scalex = 200
|
|
o_dropship2.scaley = 200
|
|
o_dropship2.panecolor = packcolor(255, 255, 255, 200)
|
|
initialize(o_dropship2)
|
|
|
|
} // if !callback($$CTCL_IsConsole$$)
|
|
|
|
int display1 = random(10, 99)
|
|
int display2 = random(100, 999)
|
|
int display3 = random(10, 99)
|
|
}
|
|
|
|
if !callback($$CTCL_IsConsoleX$$) //|| callback($$CTCL_CheckCOOP$$)
|
|
{
|
|
int iloop
|
|
int twidth
|
|
int num_of_buttons
|
|
if callback($$CTCL_CheckCOOP$$)
|
|
{
|
|
num_of_buttons = 1
|
|
}
|
|
else
|
|
{
|
|
if callback($$CTCL_IsConsole$$)
|
|
num_of_buttons = 2
|
|
else
|
|
#if USE_O_MECH_LAB
|
|
num_of_buttons = 4
|
|
#else // USE_O_MECH_LAB
|
|
num_of_buttons = 5
|
|
#endif // USE_O_MECH_LAB
|
|
}
|
|
object mbutton[num_of_buttons]
|
|
for iloop = 0; iloop < num_of_buttons; iloop++
|
|
{
|
|
mbutton[iloop] = s_textbutton
|
|
mbutton[iloop].textcolor = 0xffffffff
|
|
mbutton[iloop].textsize = 1
|
|
mbutton[iloop].id = iloop
|
|
}
|
|
// jcem - start
|
|
if callback($$CTCL_CheckCOOP$$)
|
|
{
|
|
mbutton[0].text = GAME_START_MSG
|
|
}
|
|
else
|
|
{
|
|
if callback($$CTCL_IsConsole$$)
|
|
{
|
|
mbutton[0].text = localize$(IDS_MM_MULTI)
|
|
mbutton[1].text = localize$(IDS_GN_QUIT_LC)
|
|
}
|
|
else
|
|
{
|
|
// jcem - end
|
|
#if USE_O_MECH_LAB
|
|
mbutton[0].text = localize$(IDS_MM_MULTI)
|
|
mbutton[1].text = localize$(IDS_MM_OPTIONS)
|
|
mbutton[2].text = localize$(IDS_MM_CINEMACREDITS)
|
|
mbutton[3].text = localize$(IDS_GN_QUIT_LC)
|
|
#else // USE_O_MECH_LAB
|
|
mbutton[0].text = localize$(IDS_MM_MULTI)
|
|
mbutton[1].text = localize$(DNL_MECHLAB)
|
|
mbutton[2].text = localize$(IDS_MM_OPTIONS)
|
|
mbutton[3].text = localize$(IDS_MM_CINEMACREDITS)
|
|
mbutton[4].text = localize$(IDS_GN_QUIT_LC)
|
|
#endif // USE_O_MECH_LAB
|
|
// jcem - start
|
|
}
|
|
}
|
|
// jcem - end
|
|
for iloop = 0; iloop < num_of_buttons; iloop++
|
|
{
|
|
initialize(mbutton[iloop])
|
|
}
|
|
}
|
|
sound btnTriggeredSound = SPATH "sfx_button5.wav"
|
|
framerate = 10
|
|
int only_once = true
|
|
int game_started = false
|
|
}
|
|
|
|
GUI_INIT
|
|
{
|
|
if !callback($$CTCL_IsConsoleX$$) //|| callback($$CTCL_CheckCOOP$$)
|
|
{
|
|
if callback($$CTCL_CheckCOOP$$)
|
|
{
|
|
mbutton[0].location = (getresx() / 2) - (getprint3dwidth(GAME_START_MSG) / 2), 400, 50
|
|
}
|
|
else
|
|
{
|
|
if callback($$CTCL_IsConsole$$)
|
|
{
|
|
mbutton[0].location = (getresx() / 2) - (getprint3dwidth(localize$(IDS_MM_MULTI)) / 2), 185, 50
|
|
mbutton[1].location = (getresx() / 2) - (getprint3dwidth(localize$(IDS_GN_QUIT_LC)) / 2), 360, 50
|
|
}
|
|
else
|
|
{
|
|
#if USE_O_MECH_LAB
|
|
mbutton[0].location = (getresx() / 2) - (getprint3dwidth(localize$(IDS_MM_MULTI)) / 2), 219, 50
|
|
mbutton[1].location = (getresx() / 2) - (getprint3dwidth(localize$(IDS_MM_OPTIONS)) / 2), 335, 50
|
|
mbutton[2].location = (getresx() / 2) - (getprint3dwidth(localize$(IDS_MM_CINEMACREDITS)) / 2), 393, 50
|
|
mbutton[3].location = (getresx() / 2) - (getprint3dwidth(localize$(IDS_GN_QUIT_LC)) / 2), 509, 50
|
|
#else //USE_O_MECH_LAB
|
|
mbutton[0].location = (getresx() / 2) - (getprint3dwidth(localize$(IDS_MM_MULTI)) / 2), 219, 50
|
|
mbutton[1].location = (getresx() / 2) - (getprint3dwidth(localize$(DNL_MECHLAB)) / 2), 277, 50
|
|
mbutton[2].location = (getresx() / 2) - (getprint3dwidth(localize$(IDS_MM_OPTIONS)) / 2), 335, 50
|
|
mbutton[3].location = (getresx() / 2) - (getprint3dwidth(localize$(IDS_MM_CINEMACREDITS)) / 2), 393, 50
|
|
mbutton[4].location = (getresx() / 2) - (getprint3dwidth(localize$(IDS_GN_QUIT_LC)) / 2), 509, 50
|
|
#endif //USE_O_MECH_LAB
|
|
}
|
|
}
|
|
|
|
int i
|
|
for i = 0; i < num_of_buttons; i++
|
|
{
|
|
initialize(mbutton[i])
|
|
}
|
|
}
|
|
}
|
|
|
|
GUI_EXECUTE
|
|
{
|
|
if (nInitialMultiplayScreen == 1)
|
|
{
|
|
nInitialMultiplayScreen = 0
|
|
mail(PM_INITIALMULTIPLAYSCREEN, this)
|
|
return
|
|
}
|
|
if callback($$CTCL_CheckCOOP$$)
|
|
{
|
|
callback($$CTCL_PosCOOP$$, mouse.x, mouse.y)
|
|
}
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
setpencolor(0xff000000)
|
|
if (!callback($$CTCL_CheckPlayMovie$$))
|
|
{
|
|
drawrect 0,0 to getresx(), getresy()
|
|
}
|
|
|
|
if !callback($$CTCL_IsConsoleX$$) //|| callback($$CTCL_CheckCOOP$$)
|
|
{
|
|
if !callback($$CTCL_IsConsole$$)
|
|
{
|
|
setpencolor(100, 163, 221,random(75, 125)) //(0xaa64a3dd)
|
|
drawframe 570, 35 to 730, 200
|
|
} // if !callback($$CTCL_IsConsoleX$$)
|
|
|
|
print3d_attributes = garbagefont, def_num_color,1,1,1,0,0, just_center
|
|
print3d_margins = 50, 60 to 140, 75
|
|
print3d_position = 50, 60
|
|
print3d conv$(display1) ":" conv$(display2) ":" conv$(display3)
|
|
|
|
}
|
|
}
|
|
|
|
GUI_MAILBOX
|
|
{
|
|
if !callback($$CTCL_IsConsoleX$$) || callback($$CTCL_CheckCOOP$$)
|
|
{
|
|
if callback($$CTCL_CheckCOOP$$)
|
|
{
|
|
if sender == o_fullscrbutton
|
|
{
|
|
if !game_started
|
|
{
|
|
if callback($$CTCL_StartCOOP$$)
|
|
game_started = 1
|
|
else
|
|
play btnTriggeredSound,1
|
|
}
|
|
}
|
|
|
|
}
|
|
else
|
|
{
|
|
if callback($$CTCL_IsConsole$$)
|
|
{
|
|
if ((sender == this) && (getmessage() == PM_INITIALMULTIPLAYSCREEN)) || (sender == mbutton[0])
|
|
{
|
|
play btnTriggeredSound,1
|
|
unfocus
|
|
|
|
callback($$SetShellCommand$$, START_NETWORK_SHELLS_COMMAND)
|
|
@SHELL@currentScreen = LAUNCHGAME
|
|
@SHELL@lastScreenDepth--
|
|
|
|
//@SHELL@lastScreen[@SHELL@lastScreenDepth] = MAINMENU
|
|
//@SHELL@currentScreen = MULTIPLAYER_SCREEN
|
|
}
|
|
if (sender == mbutton[1])
|
|
{
|
|
play btnTriggeredSound,1
|
|
unfocus
|
|
terminate
|
|
}
|
|
}
|
|
else
|
|
{
|
|
if ((sender == this) && (getmessage() == PM_INITIALMULTIPLAYSCREEN)) || (sender == mbutton[0])
|
|
{
|
|
play btnTriggeredSound,1
|
|
unfocus
|
|
|
|
callback($$SetShellCommand$$, START_NETWORK_SHELLS_COMMAND)
|
|
@SHELL@currentScreen = LAUNCHGAME
|
|
@SHELL@lastScreenDepth--
|
|
|
|
}
|
|
#if USE_O_MECH_LAB
|
|
if (sender == mbutton[1])
|
|
{
|
|
play btnTriggeredSound,1
|
|
unfocus
|
|
@SHELL@lastScreenDepth++
|
|
@SHELL@lastScreen[@SHELL@lastScreenDepth] = MAINMENU
|
|
@SHELL@currentScreen = OPTIONS
|
|
}
|
|
if (sender == mbutton[2])
|
|
{
|
|
play btnTriggeredSound,1
|
|
unfocus
|
|
@SHELL@lastScreenDepth++
|
|
@SHELL@lastScreen[@SHELL@lastScreenDepth] = MAINMENU
|
|
@SHELL@currentScreen = CINEMAOPTIONS
|
|
}
|
|
if (sender == mbutton[3])
|
|
{
|
|
play btnTriggeredSound,1
|
|
unfocus
|
|
terminate
|
|
}
|
|
#else // USE_O_MECH_LAB
|
|
if (sender == mbutton[1])
|
|
{
|
|
play btnTriggeredSound,1
|
|
unfocus
|
|
callback($$Shell_CallbackHandler$$, ShellInitMechLabScreen)
|
|
@SHELL@lastScreenDepth++
|
|
@SHELL@lastScreen[@SHELL@lastScreenDepth] = MAINMENU
|
|
@SHELL@currentScreen = MECHBAY_SCREEN
|
|
}
|
|
if (sender == mbutton[2])
|
|
{
|
|
play btnTriggeredSound,1
|
|
unfocus
|
|
@SHELL@lastScreenDepth++
|
|
@SHELL@lastScreen[@SHELL@lastScreenDepth] = MAINMENU
|
|
@SHELL@currentScreen = OPTIONS
|
|
}
|
|
if (sender == mbutton[3])
|
|
{
|
|
play btnTriggeredSound,1
|
|
unfocus
|
|
@SHELL@lastScreenDepth++
|
|
@SHELL@lastScreen[@SHELL@lastScreenDepth] = MAINMENU
|
|
@SHELL@currentScreen = CINEMAOPTIONS
|
|
}
|
|
if (sender == mbutton[4])
|
|
{
|
|
play btnTriggeredSound,1
|
|
unfocus
|
|
terminate
|
|
}
|
|
#endif // USE_O_MECH_LAB
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
randomnumbers
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
int random1
|
|
int random2
|
|
int random3
|
|
int random4
|
|
int random5
|
|
int speed
|
|
int alpha_val = 255
|
|
int num_color = packcolor(255, 255, 255, alpha_val)
|
|
|
|
framerate = 3
|
|
}
|
|
|
|
GUI_INIT
|
|
{
|
|
framerate = speed
|
|
|
|
num_color = packcolor(20, 100, 200, alpha_val)
|
|
}
|
|
|
|
GUI_EXECUTE
|
|
{
|
|
random1 = random(0, 9)
|
|
random2 = random(0, 9)
|
|
random3 = random(0, 9)
|
|
random4 = random(0, 9)
|
|
random5 = random(0, 9)
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
print3d_attributes = garbagefont, num_color,1,1,1,0,0, just_center
|
|
print3d_margins = location.x, location.y to location.x + 10, location.y + 15
|
|
print3d_position = location.x, location.y
|
|
print3d random1
|
|
print3d_margins = location.x + 10, location.y to location.x + 20, location.y + 15
|
|
print3d_position = location.x + 10, location.y
|
|
print3d random2
|
|
print3d_margins = location.x + 20, location.y to location.x + 30, location.y + 15
|
|
print3d_position = location.x + 20, location.y
|
|
print3d random3
|
|
print3d_margins = location.x + 30, location.y to location.x + 40, location.y + 15
|
|
print3d_position = location.x + 30, location.y
|
|
print3d random4
|
|
print3d_margins = location.x + 40, location.y to location.x + 50, location.y + 15
|
|
print3d_position = location.x + 40, location.y
|
|
print3d random5
|
|
}
|
|
}
|
|
|
|
panedisplay
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
pane p_pane
|
|
string filename
|
|
int panecolor = packcolor(255, 255, 255, 255)
|
|
int scalex = 100
|
|
int scaley = 100
|
|
int alphatype
|
|
}
|
|
|
|
GUI_INIT
|
|
{
|
|
p_pane = filename
|
|
color(p_pane) = panecolor
|
|
scale(p_pane) = scalex, scaley
|
|
|
|
if alphatype == 0
|
|
{
|
|
alphamode(p_pane) = am_alpha_alphainvalpha
|
|
}
|
|
else
|
|
{
|
|
if alphatype == -1 // jcem
|
|
alphamode(p_pane) = am_alpha_onezero
|
|
else
|
|
alphamode(p_pane) = am_alpha_oneone
|
|
}
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
render p_pane, location
|
|
}
|
|
}
|
|
|
|
drawbox
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
int boxcolor = packcolor(0, 0, 120, 80)
|
|
int boxtype
|
|
int boxwidth
|
|
int boxheight
|
|
int randomcolor
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
if randomcolor
|
|
{
|
|
setpencolor(100, 163, 221,random(50, 75))
|
|
}
|
|
else
|
|
{
|
|
setpencolor(boxcolor)
|
|
}
|
|
|
|
if boxtype == 0
|
|
{
|
|
ldrawframe 0, 0 to boxwidth, boxheight
|
|
}
|
|
else
|
|
{
|
|
ldrawrect 0, 0 to boxwidth, boxheight
|
|
}
|
|
}
|
|
}
|
|
|
|
compass
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
int linecolor = packcolor(100, 163, 221, 75)
|
|
|
|
int display_num
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
setpencolor(linecolor)
|
|
drawline 0, 560 to 800, 560
|
|
|
|
int i
|
|
for i = 0; i < 80; i++
|
|
{
|
|
if (0 + (10 * i)) % 10 == 0
|
|
{
|
|
if (0 + (10 * i)) % 50 == 0
|
|
{
|
|
drawline 0 + (10 * i), 552 to 0 + (10 * i), 560
|
|
|
|
print3d_attributes = smallfont, linecolor,1,1,1,0,0, just_center
|
|
print3d_margins = (0 + (10 * i)) - 10, 540 to (0 + (10 * i)) + 10, 550
|
|
print3d_position = (0 + (10 * i)) - 10, 540
|
|
display_num = i * 2
|
|
print3d display_num
|
|
}
|
|
else
|
|
{
|
|
drawline 0 + (10 * i), 555 to 0 + (10 * i), 560
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
starfield
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
int num_of_stars = 75
|
|
int starpointx[num_of_stars]
|
|
int starpointy[num_of_stars]
|
|
|
|
int i
|
|
for i = 0; i < num_of_stars; i++
|
|
{
|
|
starpointx[i] = random(20, getresx())
|
|
starpointy[i] = random(20, getresy())
|
|
}
|
|
|
|
framerate = 10
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
int i
|
|
for i = 0; i < num_of_stars; i++
|
|
{
|
|
setpencolor(255, 255, 255, random(100, 150))
|
|
drawline starpointx[i], starpointy[i] to starpointx[i] + 1, starpointy[i] + 1
|
|
|
|
if i % 2 == 0
|
|
{
|
|
drawline starpointx[i], starpointy[i] - 1 to starpointx[i], starpointy[i] + 1
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
s_lighting_movie
|
|
{
|
|
|
|
GUI_CREATE
|
|
{
|
|
location = 0, 285, 10000
|
|
movie mymovie = "hsh\\coop\\Final(lighting).avi"
|
|
//movie mymovie = szPATH_MOVIES "Burnloop_lr_15.avi"
|
|
|
|
scale(mymovie) = 100, 100
|
|
loop mymovie
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
render mymovie, location
|
|
}
|
|
}
|
|
|
|
s_coin_string
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
string text
|
|
font3d text_font = FPATH localize$(IDS_F_ML_LABEL)
|
|
int text_color = packcolor(255,255,255,255)
|
|
framerate = 20
|
|
int width = 100
|
|
int height = 20
|
|
}
|
|
GUI_DRAW
|
|
{
|
|
if length$(text) > 0
|
|
{
|
|
print3d_margins = location.x,location.y to location.x+width, location.y+height
|
|
print3d_attributes = text_font, text_color, 1, 0, 1, 0, 0, just_left
|
|
print3d_position = location.x + (width - getprint3dwidth(text) - 2), location.y + (height - getprint3dheight("text")) / 2
|
|
print3d text
|
|
}
|
|
}
|
|
}
|
|
|
|
s_fullscrbutton
|
|
{
|
|
GUI_CREATE
|
|
{
|
|
location = -500,-500
|
|
int id = -9988 //A R G B
|
|
int width = 2000
|
|
int height = 2000
|
|
region = location.x,location.y to width,height
|
|
|
|
sound btnRolloverSound = SPATH "sfx_button7.wav"
|
|
|
|
// delay is frame based not time based
|
|
int delay = 4
|
|
int time_delayed = 0
|
|
framerate = 2
|
|
}
|
|
|
|
GUI_INIT
|
|
{
|
|
region = 0,0 to width, height
|
|
}
|
|
|
|
LBUTTON_UPDATE
|
|
{
|
|
if (time_delayed == delay)
|
|
{
|
|
if (mouse.left == BUTTON_CLICKED) //|| (mouse.right == BUTTON_CLICKED)
|
|
{
|
|
play btnRolloverSound, 1
|
|
mail(id, parent)
|
|
}
|
|
}
|
|
}
|
|
|
|
GUI_EXECUTE
|
|
{
|
|
if (time_delayed < delay)
|
|
time_delayed++
|
|
}
|
|
|
|
GUI_DRAW
|
|
{
|
|
}
|
|
}
|
|
|