2015-05-19 21:54:34 +00:00
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
/*
|
|
|
|
Copyright (C) 1997, 2005 - 3D Realms Entertainment
|
|
|
|
|
|
|
|
This file is part of Shadow Warrior version 1.2
|
|
|
|
|
|
|
|
Shadow Warrior is free software; you can redistribute it and/or
|
|
|
|
modify it under the terms of the GNU General Public License
|
|
|
|
as published by the Free Software Foundation; either version 2
|
|
|
|
of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
|
|
|
|
|
|
|
|
See the GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program; if not, write to the Free Software
|
|
|
|
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
|
|
|
|
|
|
|
|
Original Source: 1997 - Frank Maddin and Jim Norwood
|
|
|
|
Prepared for public release: 03/28/2005 - Charlie Wiederhold, 3D Realms
|
|
|
|
*/
|
|
|
|
//-------------------------------------------------------------------------
|
|
|
|
|
2019-10-09 16:09:05 +00:00
|
|
|
#include "ns.h"
|
2015-05-19 21:54:34 +00:00
|
|
|
// scriplib.c
|
|
|
|
#include "build.h"
|
2019-12-17 22:25:07 +00:00
|
|
|
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
#include "names2.h"
|
|
|
|
#include "panel.h"
|
|
|
|
#include "game.h"
|
|
|
|
|
|
|
|
#include "sprite.h"
|
|
|
|
#include "jsector.h"
|
|
|
|
#include "parent.h"
|
2020-09-10 15:46:54 +00:00
|
|
|
#include "sc_man.h"
|
2020-10-04 16:31:48 +00:00
|
|
|
#include "razemenu.h"
|
2019-12-09 17:40:07 +00:00
|
|
|
#include "quotemgr.h"
|
2019-12-11 01:01:11 +00:00
|
|
|
#include "mapinfo.h"
|
2021-04-05 11:55:36 +00:00
|
|
|
#include "hw_voxels.h"
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2019-10-09 16:09:05 +00:00
|
|
|
BEGIN_SW_NS
|
|
|
|
|
2015-05-19 21:54:34 +00:00
|
|
|
ParentalStruct aVoxelArray[MAXTILES];
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
=============================================================================
|
|
|
|
|
|
|
|
PARSING STUFF
|
|
|
|
|
|
|
|
=============================================================================
|
|
|
|
*/
|
2020-08-05 14:40:07 +00:00
|
|
|
#define MAXTOKEN 255
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2020-08-05 14:40:07 +00:00
|
|
|
static char* script_p, * scriptend_p;
|
|
|
|
static char token[MAXTOKEN];
|
|
|
|
static int grabbed;
|
|
|
|
static int scriptline;
|
2020-09-09 18:32:24 +00:00
|
|
|
static bool endofscript;
|
|
|
|
static bool tokenready; // only true if UnGetToken was just called
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
=
|
|
|
|
= LoadScriptFile
|
|
|
|
=
|
|
|
|
==============
|
|
|
|
*/
|
|
|
|
|
2020-08-05 14:40:07 +00:00
|
|
|
TArray<uint8_t> LoadScriptFile(const char *filename)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2019-10-20 15:09:58 +00:00
|
|
|
FileReader fp;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2020-04-11 21:54:33 +00:00
|
|
|
if (!(fp = fileSystem.OpenFileReader(filename)).isOpen())
|
2019-10-20 15:09:58 +00:00
|
|
|
{
|
|
|
|
// If there's no script file, forget it.
|
2020-08-05 14:40:07 +00:00
|
|
|
return TArray<uint8_t>();
|
2019-10-20 15:09:58 +00:00
|
|
|
}
|
|
|
|
|
2020-08-05 14:40:07 +00:00
|
|
|
auto scriptbuffer = fp.Read();
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2020-08-05 14:40:07 +00:00
|
|
|
if (scriptbuffer.Size() != 0)
|
|
|
|
{
|
|
|
|
scriptbuffer.Push(0);
|
|
|
|
scriptline = 1;
|
2020-09-09 17:52:52 +00:00
|
|
|
endofscript = false;
|
|
|
|
tokenready = false;
|
2020-08-05 14:40:07 +00:00
|
|
|
}
|
|
|
|
return scriptbuffer;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
==============
|
|
|
|
=
|
|
|
|
= GetToken
|
|
|
|
=
|
|
|
|
==============
|
|
|
|
*/
|
|
|
|
|
2020-09-09 18:32:24 +00:00
|
|
|
void GetToken(bool crossline)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
char *token_p;
|
|
|
|
|
|
|
|
if (tokenready) // is a token already waiting?
|
|
|
|
{
|
2020-09-09 17:52:52 +00:00
|
|
|
tokenready = false;
|
2015-05-19 21:54:34 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (script_p >= scriptend_p)
|
|
|
|
{
|
|
|
|
if (!crossline)
|
2020-04-11 21:45:45 +00:00
|
|
|
Printf("Error: Line %i is incomplete\n",scriptline);
|
2020-09-09 17:52:52 +00:00
|
|
|
endofscript = true;
|
2015-05-19 21:54:34 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
|
|
|
|
//
|
|
|
|
// skip space
|
|
|
|
//
|
|
|
|
skipspace:
|
|
|
|
while (*script_p <= 32)
|
|
|
|
{
|
|
|
|
if (script_p >= scriptend_p)
|
|
|
|
{
|
|
|
|
if (!crossline)
|
2020-04-11 21:45:45 +00:00
|
|
|
Printf("Error: Line %i is incomplete\n",scriptline);
|
2020-09-09 17:52:52 +00:00
|
|
|
endofscript = true;
|
2015-05-19 21:54:34 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
if (*script_p++ == '\n')
|
|
|
|
{
|
|
|
|
if (!crossline)
|
2020-04-11 21:45:45 +00:00
|
|
|
Printf("Error: Line %i is incomplete\n",scriptline);
|
2015-05-19 21:54:34 +00:00
|
|
|
scriptline++;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (script_p >= scriptend_p)
|
|
|
|
{
|
|
|
|
if (!crossline)
|
2020-08-05 14:40:07 +00:00
|
|
|
Printf("Error: Line %i is incomplete\n", scriptline);
|
2020-09-09 17:52:52 +00:00
|
|
|
endofscript = true;
|
2020-08-05 14:40:07 +00:00
|
|
|
return;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
if (*script_p == '#') // # is comment field
|
|
|
|
{
|
|
|
|
if (!crossline)
|
2020-08-05 14:40:07 +00:00
|
|
|
Printf("Error: Line %i is incomplete\n", scriptline);
|
2015-05-19 21:54:34 +00:00
|
|
|
while (*script_p++ != '\n')
|
|
|
|
if (script_p >= scriptend_p)
|
|
|
|
{
|
2020-09-09 17:52:52 +00:00
|
|
|
endofscript = true;
|
2015-05-19 21:54:34 +00:00
|
|
|
return;
|
|
|
|
}
|
|
|
|
goto skipspace;
|
|
|
|
}
|
|
|
|
|
2020-08-05 14:40:07 +00:00
|
|
|
//
|
|
|
|
// copy token
|
|
|
|
//
|
2015-05-19 21:54:34 +00:00
|
|
|
token_p = token;
|
|
|
|
|
|
|
|
while (*script_p > 32 && *script_p != '#')
|
|
|
|
{
|
|
|
|
*token_p++ = *script_p++;
|
|
|
|
if (script_p == scriptend_p)
|
|
|
|
break;
|
|
|
|
ASSERT(token_p != &token[MAXTOKEN]);
|
2020-08-05 14:40:07 +00:00
|
|
|
// Printf("Error: Token too large on line %i\n",scriptline);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
*token_p = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Load all the voxel files using swvoxfil.txt script file
|
|
|
|
// Script file format:
|
|
|
|
|
|
|
|
// # - Comment
|
|
|
|
// spritenumber (in artfile), voxel number, filename
|
|
|
|
// Ex. 1803 0 medkit2.kvx
|
|
|
|
// 1804 1 shotgun.kvx
|
|
|
|
// etc....
|
|
|
|
|
2020-08-05 14:40:07 +00:00
|
|
|
void LoadKVXFromScript(const char* filename)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-08-05 14:40:07 +00:00
|
|
|
int lNumber = 0, lTile = 0; // lNumber is the voxel no. and lTile is the editart tile being
|
2015-05-19 21:54:34 +00:00
|
|
|
// replaced.
|
|
|
|
|
2020-08-05 14:40:07 +00:00
|
|
|
int grabbed = 0; // Number of lines parsed
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
// zero out the array memory with -1's for pics not being voxelized
|
2020-08-05 14:40:07 +00:00
|
|
|
memset(&aVoxelArray[0], -1, sizeof(struct TILE_INFO_TYPE) * MAXTILES);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
grabbed = 0;
|
|
|
|
|
|
|
|
// Load the file
|
2020-08-05 14:40:07 +00:00
|
|
|
auto buffer = LoadScriptFile(filename);
|
|
|
|
if (!buffer.Size())
|
|
|
|
{
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
script_p = (char*)buffer.Data();
|
|
|
|
scriptend_p = (char*)&buffer.Last();
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
do
|
|
|
|
{
|
2020-09-09 17:52:52 +00:00
|
|
|
GetToken(true); // Crossing a line boundary on the end of line to first token
|
2015-05-19 21:54:34 +00:00
|
|
|
// of a new line is permitted (and expected)
|
|
|
|
if (endofscript)
|
|
|
|
break;
|
|
|
|
|
|
|
|
lTile = atol(token);
|
|
|
|
|
2020-09-09 17:52:52 +00:00
|
|
|
GetToken(false);
|
2015-05-19 21:54:34 +00:00
|
|
|
lNumber = atol(token);
|
|
|
|
|
2020-09-09 17:52:52 +00:00
|
|
|
GetToken(false);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
// Load the voxel file into memory
|
2021-04-05 11:55:36 +00:00
|
|
|
if (!voxDefine(lNumber,token))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
// Store the sprite and voxel numbers for later use
|
|
|
|
aVoxelArray[lTile].Voxel = lNumber; // Voxel num
|
|
|
|
}
|
|
|
|
|
|
|
|
if (lNumber >= nextvoxid) // JBF: so voxels in the def file append to the list
|
|
|
|
nextvoxid = lNumber + 1;
|
|
|
|
|
|
|
|
grabbed++;
|
|
|
|
ASSERT(grabbed < MAXSPRITES);
|
|
|
|
|
|
|
|
}
|
|
|
|
while (script_p < scriptend_p);
|
|
|
|
|
2021-07-10 12:25:18 +00:00
|
|
|
script_p = nullptr;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Here begins JonoF's modding enhancement stuff
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
CM_MAP,
|
|
|
|
CM_EPISODE,
|
|
|
|
CM_TITLE,
|
|
|
|
CM_FILENAME,
|
|
|
|
CM_SONG,
|
|
|
|
CM_CDATRACK,
|
|
|
|
CM_BESTTIME,
|
|
|
|
CM_PARTIME,
|
|
|
|
CM_SUBTITLE,
|
|
|
|
CM_SKILL,
|
|
|
|
CM_TEXT,
|
|
|
|
CM_COOKIE,
|
|
|
|
CM_GOTKEY,
|
|
|
|
CM_NEEDKEY,
|
|
|
|
CM_INVENTORY,
|
|
|
|
CM_AMOUNT,
|
|
|
|
CM_WEAPON,
|
|
|
|
CM_AMMONAME,
|
|
|
|
CM_MAXAMMO,
|
|
|
|
CM_DAMAGEMIN,
|
|
|
|
CM_DAMAGEMAX,
|
2019-12-09 19:12:54 +00:00
|
|
|
CM_THEME,
|
2015-05-19 21:54:34 +00:00
|
|
|
CM_SECRET,
|
|
|
|
CM_QUIT,
|
|
|
|
};
|
|
|
|
|
|
|
|
static const struct _tokset
|
|
|
|
{
|
2019-04-08 06:25:22 +00:00
|
|
|
const char *str;
|
2015-05-19 21:54:34 +00:00
|
|
|
int tokn;
|
|
|
|
} cm_tokens[] =
|
|
|
|
{
|
|
|
|
{ "map", CM_MAP },
|
|
|
|
{ "level", CM_MAP },
|
|
|
|
{ "episode", CM_EPISODE },
|
|
|
|
{ "skill", CM_SKILL },
|
|
|
|
{ "cookie", CM_COOKIE },
|
|
|
|
{ "fortune", CM_COOKIE },
|
|
|
|
{ "gotkey", CM_GOTKEY },
|
|
|
|
{ "inventory", CM_INVENTORY },
|
|
|
|
{ "weapon", CM_WEAPON },
|
|
|
|
{ "needkey", CM_NEEDKEY },
|
2019-12-09 19:12:54 +00:00
|
|
|
{ "theme", CM_THEME },
|
2015-05-19 21:54:34 +00:00
|
|
|
{ "secret", CM_SECRET },
|
|
|
|
{ "quit", CM_QUIT },
|
|
|
|
},
|
|
|
|
cm_map_tokens[] =
|
|
|
|
{
|
|
|
|
{ "title", CM_TITLE },
|
|
|
|
{ "name", CM_TITLE },
|
|
|
|
{ "description", CM_TITLE },
|
|
|
|
{ "filename", CM_FILENAME },
|
|
|
|
{ "file", CM_FILENAME },
|
|
|
|
{ "fn", CM_FILENAME },
|
|
|
|
{ "levelname", CM_FILENAME },
|
|
|
|
{ "song", CM_SONG },
|
|
|
|
{ "music", CM_SONG },
|
|
|
|
{ "songname", CM_SONG },
|
|
|
|
{ "cdatrack", CM_CDATRACK },
|
|
|
|
{ "cdtrack", CM_CDATRACK },
|
|
|
|
{ "besttime", CM_BESTTIME },
|
|
|
|
{ "partime", CM_PARTIME },
|
|
|
|
},
|
|
|
|
cm_episode_tokens[] =
|
|
|
|
{
|
|
|
|
{ "title", CM_TITLE },
|
|
|
|
{ "name", CM_TITLE },
|
|
|
|
{ "description", CM_TITLE },
|
|
|
|
{ "subtitle", CM_SUBTITLE },
|
|
|
|
},
|
|
|
|
cm_skill_tokens[] =
|
|
|
|
{
|
|
|
|
{ "title", CM_TITLE },
|
|
|
|
{ "name", CM_TITLE },
|
|
|
|
{ "description", CM_TITLE },
|
|
|
|
},
|
|
|
|
cm_inventory_tokens[] =
|
|
|
|
{
|
|
|
|
{ "title", CM_TITLE },
|
|
|
|
{ "name", CM_TITLE },
|
|
|
|
{ "description", CM_TITLE },
|
|
|
|
{ "amount", CM_AMOUNT },
|
|
|
|
},
|
|
|
|
cm_weapons_tokens[] =
|
|
|
|
{
|
|
|
|
{ "title", CM_TITLE },
|
|
|
|
{ "name", CM_TITLE },
|
|
|
|
{ "description", CM_TITLE },
|
|
|
|
{ "ammoname", CM_AMMONAME },
|
|
|
|
{ "maxammo", CM_MAXAMMO },
|
|
|
|
{ "mindamage", CM_DAMAGEMIN },
|
|
|
|
{ "maxdamage", CM_DAMAGEMAX },
|
|
|
|
{ "pickup", CM_AMOUNT },
|
|
|
|
{ "weaponpickup",CM_WEAPON },
|
2019-12-09 19:12:54 +00:00
|
|
|
},
|
|
|
|
cm_theme_tokens[] = {
|
|
|
|
{ "song", CM_SONG },
|
|
|
|
{ "music", CM_SONG },
|
|
|
|
{ "cdatrack", CM_CDATRACK },
|
|
|
|
{ "cdtrack", CM_CDATRACK },
|
|
|
|
};
|
2015-05-19 21:54:34 +00:00
|
|
|
#define cm_numtokens (sizeof(cm_tokens)/sizeof(cm_tokens[0]))
|
|
|
|
#define cm_map_numtokens (sizeof(cm_map_tokens)/sizeof(cm_map_tokens[0]))
|
|
|
|
#define cm_episode_numtokens (sizeof(cm_episode_tokens)/sizeof(cm_episode_tokens[0]))
|
|
|
|
#define cm_skill_numtokens (sizeof(cm_skill_tokens)/sizeof(cm_skill_tokens[0]))
|
|
|
|
#define cm_inventory_numtokens (sizeof(cm_inventory_tokens)/sizeof(cm_inventory_tokens[0]))
|
|
|
|
#define cm_weapons_numtokens (sizeof(cm_weapons_tokens)/sizeof(cm_weapons_tokens[0]))
|
2019-12-09 19:12:54 +00:00
|
|
|
#define cm_theme_numtokens (sizeof(cm_theme_tokens)/sizeof(cm_theme_tokens[0]))
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
|
|
|
|
static int cm_transtok(const char *tok, const struct _tokset *set, const unsigned num)
|
|
|
|
{
|
|
|
|
unsigned i;
|
|
|
|
|
|
|
|
for (i=0; i<num; i++)
|
|
|
|
{
|
2020-09-04 19:24:48 +00:00
|
|
|
if (!stricmp(tok, set[i].str))
|
2015-05-19 21:54:34 +00:00
|
|
|
return set[i].tokn;
|
|
|
|
}
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#define WM_DAMAGE 1
|
|
|
|
#define WM_WEAP 2
|
|
|
|
#define WM_AMMO 4
|
|
|
|
static struct
|
|
|
|
{
|
2019-04-08 06:25:22 +00:00
|
|
|
const char *sym;
|
2015-05-19 21:54:34 +00:00
|
|
|
int dmgid;
|
|
|
|
int editable;
|
|
|
|
} weaponmap[] =
|
|
|
|
{
|
|
|
|
{ "WPN_FIST", WPN_FIST, WM_DAMAGE },
|
|
|
|
{ "WPN_SWORD", WPN_SWORD, WM_DAMAGE },
|
|
|
|
{ "WPN_SHURIKEN", WPN_STAR, WM_DAMAGE|WM_WEAP },
|
|
|
|
{ "WPN_STICKYBOMB", WPN_MINE, WM_DAMAGE|WM_WEAP },
|
|
|
|
{ "WPN_UZI", WPN_UZI, WM_DAMAGE|WM_WEAP|WM_AMMO },
|
|
|
|
{ "WPN_MISSILE", WPN_MICRO, WM_DAMAGE|WM_WEAP|WM_AMMO },
|
|
|
|
{ "WPN_NUKE", DMG_NUCLEAR_EXP, WM_DAMAGE|WM_WEAP|WM_AMMO },
|
|
|
|
{ "WPN_GRENADE", WPN_GRENADE, WM_DAMAGE|WM_WEAP|WM_AMMO },
|
|
|
|
{ "WPN_RAILGUN", WPN_RAIL, WM_DAMAGE|WM_WEAP|WM_AMMO },
|
|
|
|
{ "WPN_SHOTGUN", WPN_SHOTGUN, WM_DAMAGE|WM_WEAP|WM_AMMO },
|
|
|
|
{ "WPN_HOTHEAD", WPN_HOTHEAD, WM_DAMAGE|WM_WEAP },
|
|
|
|
{ "WPN_HEART", WPN_HEART, WM_DAMAGE|WM_WEAP },
|
|
|
|
{ "WPN_HOTHEAD_NAPALM", WPN_NAPALM, WM_DAMAGE },
|
|
|
|
{ "WPN_HOTHEAD_RING", WPN_RING, WM_DAMAGE },
|
|
|
|
};
|
|
|
|
|
|
|
|
// FIXME: yes, we are leaking memory here at the end of the program by not freeing anything
|
2019-04-08 06:25:22 +00:00
|
|
|
void LoadCustomInfoFromScript(const char *filename)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-09-10 15:46:54 +00:00
|
|
|
FScanner sc;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2020-09-10 15:46:54 +00:00
|
|
|
int lump = fileSystem.FindFile(filename);
|
|
|
|
if (lump < 0) return;
|
|
|
|
|
|
|
|
sc.OpenLumpNum(lump);
|
|
|
|
sc.SetNoOctals(true);
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.SetCMode(true);
|
|
|
|
sc.SetNoFatalErrors(true);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
// predefine constants for some stuff to give convenience and eliminate the need for a 'define' directive
|
2020-09-10 15:46:54 +00:00
|
|
|
sc.AddSymbol("INV_ARMOR", 1+InvDecl_Armor);
|
|
|
|
sc.AddSymbol("INV_KEVLAR", 1+InvDecl_Kevlar);
|
|
|
|
sc.AddSymbol("INV_SM_MEDKIT", 1+InvDecl_SmMedkit);
|
|
|
|
sc.AddSymbol("INV_FORTUNE", 1+InvDecl_Booster);
|
|
|
|
sc.AddSymbol("INV_MEDKIT", 1+InvDecl_Medkit);
|
|
|
|
sc.AddSymbol("INV_GAS_BOMB", 1+InvDecl_ChemBomb);
|
|
|
|
sc.AddSymbol("INV_FLASH_BOMB", 1+InvDecl_FlashBomb);
|
|
|
|
sc.AddSymbol("INV_CALTROPS", 1+InvDecl_Caltrops);
|
|
|
|
sc.AddSymbol("INV_NIGHT_VIS", 1+InvDecl_NightVision);
|
|
|
|
sc.AddSymbol("INV_REPAIR_KIT", 1+InvDecl_RepairKit);
|
|
|
|
sc.AddSymbol("INV_SMOKE_BOMB", 1+InvDecl_Cloak);
|
2015-05-19 21:54:34 +00:00
|
|
|
|
|
|
|
{
|
|
|
|
unsigned i;
|
|
|
|
for (i=0; i<SIZ(weaponmap); i++)
|
2020-09-10 15:46:54 +00:00
|
|
|
sc.AddSymbol(weaponmap[i].sym, 1+i);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2020-08-16 12:39:18 +00:00
|
|
|
MapRecord* curMap = nullptr;
|
2020-09-12 08:23:47 +00:00
|
|
|
while (sc.GetString())
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-09-10 15:46:54 +00:00
|
|
|
switch (cm_transtok(sc.String, cm_tokens, cm_numtokens))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
case CM_MAP:
|
|
|
|
{
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetNumber(true);
|
|
|
|
int mapno = sc.ParseError? -1 : sc.Number;
|
2020-08-16 12:39:18 +00:00
|
|
|
curMap = FindMapByLevelNum(mapno);
|
|
|
|
if (!curMap)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-08-16 12:39:18 +00:00
|
|
|
curMap = AllocateMap();
|
|
|
|
curMap->levelNumber = mapno;
|
2021-04-27 18:04:11 +00:00
|
|
|
curMap->cluster = mapno < 5 ? 1 : 2;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
2020-09-12 08:23:47 +00:00
|
|
|
if (sc.CheckString("{"))
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2020-09-12 08:23:47 +00:00
|
|
|
while (!sc.CheckString("}"))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetString();
|
2020-09-10 15:46:54 +00:00
|
|
|
switch (cm_transtok(sc.String, cm_map_tokens, cm_map_numtokens))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
case CM_FILENAME:
|
|
|
|
{
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetString();
|
2020-09-10 15:46:54 +00:00
|
|
|
curMap->SetFileName(sc.String);
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case CM_SONG:
|
|
|
|
{
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetString();
|
2020-09-10 15:46:54 +00:00
|
|
|
curMap->music = sc.String;
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case CM_TITLE:
|
|
|
|
{
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetString();
|
2020-09-10 15:46:54 +00:00
|
|
|
curMap->SetName(sc.String);
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case CM_BESTTIME:
|
|
|
|
{
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetNumber();
|
2020-09-10 15:46:54 +00:00
|
|
|
curMap->designerTime = sc.Number;
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case CM_PARTIME:
|
|
|
|
{
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetNumber();
|
2020-09-10 15:46:54 +00:00
|
|
|
curMap->parTime = sc.Number;
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case CM_CDATRACK:
|
|
|
|
{
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetNumber();
|
2020-09-10 15:46:54 +00:00
|
|
|
curMap->cdSongId = sc.Number;
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
2020-09-15 19:45:05 +00:00
|
|
|
sc.ScriptError("Unknown keyword %s", sc.String);
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case CM_EPISODE:
|
|
|
|
{
|
2020-08-16 12:39:18 +00:00
|
|
|
int curep;
|
2020-09-10 15:46:54 +00:00
|
|
|
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetNumber();
|
2020-09-10 15:46:54 +00:00
|
|
|
curep = sc.Number;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2020-09-12 08:23:47 +00:00
|
|
|
if (sc.ParseError) curep = -1;
|
2021-08-24 07:57:36 +00:00
|
|
|
else if ((unsigned)curep > 2u)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-09-10 15:46:54 +00:00
|
|
|
sc.ScriptMessage("Episode number %d not in range 1-2\n", curep + 1);
|
|
|
|
curep = -1;
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2020-09-12 08:23:47 +00:00
|
|
|
if (sc.CheckString("{"))
|
|
|
|
while (!sc.CheckString("}"))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetString();
|
2020-09-10 15:46:54 +00:00
|
|
|
switch (cm_transtok(sc.String, cm_episode_tokens, cm_episode_numtokens))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
case CM_TITLE:
|
|
|
|
{
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetString();
|
2021-05-01 22:35:56 +00:00
|
|
|
auto vol = MustFindVolume(curep);
|
|
|
|
auto clust = MustFindCluster(curep);
|
|
|
|
vol->name = clust->name = sc.String;
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
case CM_SUBTITLE:
|
|
|
|
{
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetString();
|
2021-05-01 22:35:56 +00:00
|
|
|
if (curep != -1)
|
|
|
|
{
|
|
|
|
auto vol = MustFindVolume(curep);
|
|
|
|
vol->subtitle = sc.String;
|
|
|
|
}
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
2020-09-15 19:45:05 +00:00
|
|
|
sc.ScriptError("Unknown keyword %s", sc.String);
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case CM_SKILL:
|
|
|
|
{
|
2020-08-16 12:39:18 +00:00
|
|
|
int curskill;
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetNumber();
|
2020-09-10 15:46:54 +00:00
|
|
|
curskill = sc.Number;
|
2020-09-12 08:23:47 +00:00
|
|
|
if (sc.ParseError) curskill = -1;
|
2020-08-16 12:39:18 +00:00
|
|
|
if ((unsigned)--curskill >= 4u)
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-09-15 19:45:05 +00:00
|
|
|
sc.ScriptMessage("Skill number %d not in range 1-4", curskill + 1);
|
2020-09-10 15:46:54 +00:00
|
|
|
curskill = -1;
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2020-09-12 08:23:47 +00:00
|
|
|
if (sc.CheckString("{"))
|
|
|
|
while (!sc.CheckString("}"))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetString();
|
2020-09-10 15:46:54 +00:00
|
|
|
switch (cm_transtok(sc.String, cm_skill_tokens, cm_skill_numtokens))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
case CM_TITLE:
|
|
|
|
{
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetString();
|
2020-09-10 15:46:54 +00:00
|
|
|
if (curskill != -1) gSkillNames[curskill] = sc.String;
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
default:
|
2020-09-15 19:45:05 +00:00
|
|
|
sc.ScriptError("Unknown keyword %s", sc.String);
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case CM_COOKIE:
|
|
|
|
{
|
|
|
|
int fc = 0;
|
2020-09-12 08:23:47 +00:00
|
|
|
if (sc.CheckString("{"))
|
|
|
|
while (!sc.CheckString("}"))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetString();
|
2020-09-10 15:46:54 +00:00
|
|
|
if (fc < MAX_FORTUNES)
|
|
|
|
{
|
|
|
|
quoteMgr.InitializeQuote(QUOTE_COOKIE + fc, sc.String);
|
|
|
|
}
|
2015-05-19 21:54:34 +00:00
|
|
|
fc++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case CM_GOTKEY:
|
|
|
|
{
|
|
|
|
int fc = 0;
|
2020-09-12 08:23:47 +00:00
|
|
|
if (sc.CheckString("{"))
|
|
|
|
while (!sc.CheckString("}"))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetString();
|
2020-09-10 15:46:54 +00:00
|
|
|
if (fc < MAX_KEYS)
|
|
|
|
{
|
|
|
|
quoteMgr.InitializeQuote(QUOTE_KEYMSG + fc, sc.String);
|
|
|
|
}
|
2015-05-19 21:54:34 +00:00
|
|
|
fc++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case CM_NEEDKEY:
|
|
|
|
{
|
|
|
|
int fc = 0;
|
2020-09-12 08:23:47 +00:00
|
|
|
if (sc.CheckString("{"))
|
|
|
|
while (!sc.CheckString("}"))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetString();
|
2020-09-10 15:46:54 +00:00
|
|
|
if (fc < MAX_KEYS)
|
|
|
|
{
|
|
|
|
quoteMgr.InitializeQuote(QUOTE_DOORMSG + fc, sc.String);
|
|
|
|
}
|
2015-05-19 21:54:34 +00:00
|
|
|
fc++;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case CM_INVENTORY:
|
|
|
|
{
|
|
|
|
int in;
|
2020-09-10 15:46:54 +00:00
|
|
|
FString name;
|
2015-05-19 21:54:34 +00:00
|
|
|
int amt = -1;
|
|
|
|
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetNumber();
|
2020-09-10 15:46:54 +00:00
|
|
|
in = sc.Number;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2020-09-12 08:23:47 +00:00
|
|
|
if (sc.ParseError) in = -1;
|
2015-05-19 21:54:34 +00:00
|
|
|
if ((unsigned)--in >= (unsigned)InvDecl_TOTAL)
|
|
|
|
{
|
2020-09-10 15:46:54 +00:00
|
|
|
sc.ScriptMessage("Inventory item number %d not in range 1-%d\n", in, InvDecl_TOTAL);
|
|
|
|
in = -1;
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2020-09-12 08:23:47 +00:00
|
|
|
if (sc.CheckString("{"))
|
|
|
|
while (!sc.CheckString("}"))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetString();
|
2020-09-10 15:46:54 +00:00
|
|
|
switch (cm_transtok(sc.String, cm_inventory_tokens, cm_inventory_numtokens))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
case CM_TITLE:
|
2020-09-10 15:46:54 +00:00
|
|
|
sc.MustGetToken(TK_StringConst);
|
|
|
|
name = sc.String;
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
case CM_AMOUNT:
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetNumber();
|
2020-09-10 15:46:54 +00:00
|
|
|
amt = sc.Number;
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
default:
|
2020-09-15 19:45:05 +00:00
|
|
|
sc.ScriptError("Unknown keyword %s", sc.String);
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-09-10 15:46:54 +00:00
|
|
|
if (in == -1) break;
|
2020-09-13 08:29:57 +00:00
|
|
|
if (name.IsNotEmpty())
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2019-12-09 18:00:30 +00:00
|
|
|
quoteMgr.InitializeQuote(QUOTE_INVENTORY + in, name);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
if (amt >= 0)
|
|
|
|
{
|
|
|
|
InventoryDecls[in].amount = amt;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
case CM_WEAPON:
|
|
|
|
{
|
2020-09-10 15:46:54 +00:00
|
|
|
FString name, ammo;
|
2015-05-19 21:54:34 +00:00
|
|
|
int maxammo = -1, damagemin = -1, damagemax = -1, pickup = -1, wpickup = -1;
|
|
|
|
int in,id;
|
|
|
|
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetNumber();
|
2020-09-10 15:46:54 +00:00
|
|
|
in = sc.Number;
|
2015-05-19 21:54:34 +00:00
|
|
|
|
2020-09-12 08:23:47 +00:00
|
|
|
if (sc.ParseError) in = -1;
|
2015-05-19 21:54:34 +00:00
|
|
|
if ((unsigned)--in >= (unsigned)SIZ(weaponmap))
|
|
|
|
{
|
2020-09-10 15:46:54 +00:00
|
|
|
sc.ScriptMessage("Error: weapon number %d not in range 1-%d", in+1, (int)SIZ(weaponmap));
|
|
|
|
in = -1;
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2020-09-12 08:23:47 +00:00
|
|
|
if (sc.CheckString("{"))
|
|
|
|
while (!sc.CheckString("}"))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetString();
|
2020-09-10 15:46:54 +00:00
|
|
|
switch (cm_transtok(sc.String, cm_weapons_tokens, cm_weapons_numtokens))
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
|
|
|
case CM_TITLE:
|
2020-09-10 15:46:54 +00:00
|
|
|
sc.MustGetToken(TK_StringConst);
|
|
|
|
name = sc.String;
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
case CM_AMMONAME:
|
2020-09-10 15:46:54 +00:00
|
|
|
sc.MustGetToken(TK_StringConst);
|
|
|
|
ammo = sc.String;
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
case CM_MAXAMMO:
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetNumber();
|
2020-09-10 15:46:54 +00:00
|
|
|
maxammo = sc.Number;
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
2020-09-10 15:46:54 +00:00
|
|
|
case CM_DAMAGEMIN:
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetNumber();
|
2020-09-10 15:46:54 +00:00
|
|
|
damagemin = sc.Number;
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
case CM_DAMAGEMAX:
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetNumber();
|
2020-09-10 15:46:54 +00:00
|
|
|
damagemax = sc.Number;
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
case CM_AMOUNT:
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetNumber();
|
2020-09-10 15:46:54 +00:00
|
|
|
pickup = sc.Number;
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
case CM_WEAPON:
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetNumber();
|
2020-09-10 15:46:54 +00:00
|
|
|
wpickup = sc.Number;
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
default:
|
2020-09-15 19:45:05 +00:00
|
|
|
sc.ScriptError("Unknown keyword %s", sc.String);
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2020-09-10 15:46:54 +00:00
|
|
|
if (in == -1) break;
|
2015-05-19 21:54:34 +00:00
|
|
|
id = weaponmap[in].dmgid;
|
|
|
|
if (weaponmap[in].editable & WM_DAMAGE)
|
|
|
|
{
|
|
|
|
if (damagemin >= 0) DamageData[id].damage_lo = damagemin;
|
|
|
|
if (damagemax >= 0) DamageData[id].damage_hi = damagemax;
|
|
|
|
}
|
|
|
|
if (weaponmap[in].editable & WM_WEAP)
|
|
|
|
{
|
|
|
|
if (maxammo >= 0) DamageData[id].max_ammo = maxammo;
|
2020-09-13 08:29:57 +00:00
|
|
|
if (name.IsNotEmpty())
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2019-12-09 18:49:36 +00:00
|
|
|
quoteMgr.InitializeQuote(QUOTE_WPNFIST + in, name);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
if (wpickup >= 0) DamageData[id].weapon_pickup = wpickup;
|
|
|
|
}
|
|
|
|
if (weaponmap[in].editable & WM_AMMO)
|
|
|
|
{
|
2020-09-13 08:29:57 +00:00
|
|
|
if (ammo.IsNotEmpty())
|
2015-05-19 21:54:34 +00:00
|
|
|
{
|
2020-02-02 12:36:56 +00:00
|
|
|
quoteMgr.InitializeQuote(QUOTE_AMMOFIST + in, ammo);
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
if (pickup >= 0) DamageData[id].ammo_pickup = pickup;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2019-12-09 19:12:54 +00:00
|
|
|
case CM_THEME:
|
|
|
|
{
|
2020-09-10 15:46:54 +00:00
|
|
|
FString name;
|
2019-12-09 19:12:54 +00:00
|
|
|
int trak = -1;
|
2020-08-16 12:39:18 +00:00
|
|
|
int curtheme;
|
2019-12-09 19:12:54 +00:00
|
|
|
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetNumber();
|
2020-09-10 15:46:54 +00:00
|
|
|
curtheme = sc.Number;
|
|
|
|
|
2020-09-12 08:23:47 +00:00
|
|
|
if (sc.ParseError) curtheme = -1;
|
|
|
|
if ((unsigned)--curtheme >= 6u)
|
2019-12-09 19:12:54 +00:00
|
|
|
{
|
2020-09-10 15:46:54 +00:00
|
|
|
sc.ScriptMessage("Theme number %d not in range 1-6", curtheme+1);
|
|
|
|
curtheme = -1;
|
2019-12-09 19:12:54 +00:00
|
|
|
}
|
2020-09-12 08:23:47 +00:00
|
|
|
if (sc.CheckString("{"))
|
|
|
|
while (!sc.CheckString("}"))
|
2020-09-10 15:46:54 +00:00
|
|
|
{
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetString();
|
2020-09-10 15:46:54 +00:00
|
|
|
switch (cm_transtok(sc.String, cm_theme_tokens, cm_theme_numtokens))
|
2019-12-09 19:12:54 +00:00
|
|
|
{
|
|
|
|
case CM_SONG:
|
2020-09-10 15:46:54 +00:00
|
|
|
sc.MustGetToken(TK_StringConst);
|
|
|
|
name = sc.String;
|
|
|
|
break;
|
2019-12-09 19:12:54 +00:00
|
|
|
case CM_CDATRACK:
|
2020-09-12 08:23:47 +00:00
|
|
|
sc.MustGetNumber();
|
2020-09-10 15:46:54 +00:00
|
|
|
trak = sc.Number;
|
2019-12-09 19:12:54 +00:00
|
|
|
break;
|
|
|
|
default:
|
2020-09-15 19:45:05 +00:00
|
|
|
sc.ScriptError("Unknown keyword %s", sc.String);
|
2020-09-10 15:46:54 +00:00
|
|
|
break;
|
2019-12-09 19:12:54 +00:00
|
|
|
}
|
|
|
|
}
|
2020-09-10 15:46:54 +00:00
|
|
|
if (curtheme == -1) break;
|
2020-09-13 08:29:57 +00:00
|
|
|
if (name.IsNotEmpty())
|
2019-12-09 19:12:54 +00:00
|
|
|
{
|
2020-08-16 12:39:18 +00:00
|
|
|
ThemeSongs[curtheme] = name;
|
2019-12-09 19:12:54 +00:00
|
|
|
}
|
|
|
|
if (trak >= 2)
|
|
|
|
{
|
2020-08-16 12:39:18 +00:00
|
|
|
ThemeTrack[curtheme] = trak;
|
2019-12-09 19:12:54 +00:00
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
2015-05-19 21:54:34 +00:00
|
|
|
case CM_SECRET:
|
|
|
|
case CM_QUIT:
|
|
|
|
default:
|
2020-09-15 19:45:05 +00:00
|
|
|
sc.ScriptError("Unknown keyword %s", sc.String);
|
2015-05-19 21:54:34 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2021-08-24 07:57:36 +00:00
|
|
|
auto vol0 = MustFindVolume(1);
|
|
|
|
auto vol1 = MustFindVolume(2);
|
2021-05-01 22:58:54 +00:00
|
|
|
auto map1 = FindMapByLevelNum(1);
|
|
|
|
auto map5 = FindMapByLevelNum(5);
|
|
|
|
if (vol0 && map1) vol0->startmap = map1->labelName;
|
|
|
|
if (vol1 && map5) vol1->startmap = map5->labelName;
|
2015-05-19 21:54:34 +00:00
|
|
|
}
|
|
|
|
|
2019-10-09 16:09:05 +00:00
|
|
|
END_SW_NS
|