Starbase menu is now accessible by a function.
The original game did a bunch of one-off specifics to enter the starbase menu. Since I want to make this available in multiple places (even via script... and maybe by *building* new starbases), I'll need a simple function to call. I've tested it by making the Chmmr and Syreen starbase both call this function -- it works. (It's kinda neat to have starbases all over the galaxy! It totally makes for a different kind of game.) Of course, since I intend to make all planet stuff customizable via Lua -- one can make their own game have whatever they want. A main starbase, which might get conquered and then have to be relocated could be interesting. I aim to make "nearly anything" possible.
This commit is contained in:
@@ -29,6 +29,8 @@
|
||||
#include "../../state.h"
|
||||
#include "libs/mathlib.h"
|
||||
|
||||
#include "../../starbase.h"
|
||||
|
||||
|
||||
static bool GenerateSol_initNpcs (SOLARSYS_STATE *solarSys);
|
||||
static bool GenerateSol_reinitNpcs (SOLARSYS_STATE *solarSys);
|
||||
@@ -260,15 +262,7 @@ GenerateSol_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
||||
|
||||
if (matchWorld (solarSys, world, 2, 0))
|
||||
{
|
||||
/* Starbase */
|
||||
PutGroupInfo (GROUPS_RANDOM, GROUP_SAVE_IP);
|
||||
ReinitQueue (&GLOBAL (ip_group_q));
|
||||
assert (CountLinks (&GLOBAL (npc_built_ship_q)) == 0);
|
||||
|
||||
EncounterGroup = 0;
|
||||
GLOBAL (CurrentActivity) |= START_ENCOUNTER;
|
||||
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, (BYTE)~0);
|
||||
return true;
|
||||
return PrepareToVisitStarBase();
|
||||
}
|
||||
|
||||
DoPlanetaryAnalysis (&solarSys->SysInfo, world);
|
||||
|
||||
@@ -33,6 +33,11 @@
|
||||
#include "libs/graphics/gfx_common.h"
|
||||
#include "libs/tasklib.h"
|
||||
|
||||
#include "encount.h"
|
||||
#include "globdata.h"
|
||||
#include "state.h"
|
||||
#include "grpinfo.h"
|
||||
|
||||
|
||||
static void CleanupAfterStarBase (void);
|
||||
|
||||
@@ -600,3 +605,16 @@ WrapText (const UNICODE *pStr, COUNT len, TEXT *tarray, SIZE field_width)
|
||||
return (num_lines);
|
||||
}
|
||||
|
||||
bool
|
||||
PrepareToVisitStarBase( void )
|
||||
{
|
||||
PutGroupInfo (GROUPS_RANDOM, GROUP_SAVE_IP);
|
||||
ReinitQueue (&GLOBAL (ip_group_q));
|
||||
assert (CountLinks (&GLOBAL (npc_built_ship_q)) == 0);
|
||||
|
||||
EncounterGroup = 0;
|
||||
GLOBAL (CurrentActivity) |= START_ENCOUNTER;
|
||||
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, (BYTE)~0);
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -48,6 +48,8 @@ extern COUNT WrapText (const UNICODE *pStr, COUNT len, TEXT *tarray, SIZE
|
||||
field_width);
|
||||
// XXX: Doesn't really belong in this file.
|
||||
|
||||
extern bool PrepareToVisitStarBase( void );
|
||||
|
||||
#if defined(__cplusplus)
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user