Annihigate ActivateStarShip().
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@3702 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
+2
-1
@@ -1,5 +1,6 @@
|
||||
Changes towards version 0.8:
|
||||
- Removed obsolete RESPONSE_TO_REF - SvdB
|
||||
- Annigilate ActivateStarShip() - SvdB
|
||||
- Removed obsolete RESPONSE_TO_REF() - SvdB
|
||||
- Don't require the 'shadow' dir in addon packs, from Alex
|
||||
- Make use of GAME_STATE_FILE consistently, from Scott A. Colcord
|
||||
- Fixed unconst(), from Scott A. Colcord
|
||||
|
||||
+206
-151
@@ -69,75 +69,68 @@ GetStarShipFromIndex (QUEUE *pShipQ, COUNT Index)
|
||||
}
|
||||
|
||||
/*
|
||||
* What this function does depends on the value of the 'state' argument:
|
||||
* SPHERE_TRACKING:
|
||||
* The sphere of influence for the race for 'which_ship' will be shown
|
||||
* on the starmap in the future.
|
||||
* The value returned is 'which_ship', unless the type of ship is only
|
||||
* available in SuperMelee, in which case 0 is returned.
|
||||
* SPHERE_KNOWN:
|
||||
* The size of the fleet of the race of 'which_ship' when the starmap was
|
||||
* last checked is returned.
|
||||
* ESCORT_WORTH:
|
||||
* The total value of all the ships escorting the SIS is returned.
|
||||
* 'which_ship' is ignored.
|
||||
* ESCORTING_FLAGSHIP:
|
||||
* Test if a ship of type 'which_ship' is among the escorts of the SIS
|
||||
* 0 is returned if false, 1 if true.
|
||||
* FEASIBILITY_STUDY:
|
||||
* Test if the SIS can have an escort of type 'which_ship'.
|
||||
* 0 is returned if 'which_ship' is not available.
|
||||
* Otherwise, the number of ships that can be added is returned.
|
||||
* CHECK_ALLIANCE:
|
||||
* Test the alliance status of the race of 'which_ship'.
|
||||
* Either GOOD_GUY (allied) or BAD_GUY (not allied) is returned.
|
||||
* SET_ALLIED (0):
|
||||
* Ally with the race of 'which_ship'. This makes their ship available
|
||||
* for building in the shipyard.
|
||||
* SET_NOT_ALLIED:
|
||||
* End an alliance with the race of 'which_ship'. This ends the possibility
|
||||
* of building their ships in the shipyard.
|
||||
* REMOVE_BUILT:
|
||||
* Make the already built escorts of the race of 'which_ship' disappear.
|
||||
* (as for the Orz when the alliance with them ends)
|
||||
* any other positive number:
|
||||
* Give the player this many ships of type 'which_ship'.
|
||||
* Give the player 'count' ships of the specified race,
|
||||
* limited by the number of free slots.
|
||||
* Returns the number of ships added.
|
||||
*/
|
||||
COUNT
|
||||
ActivateStarShip (COUNT which_ship, SIZE state)
|
||||
AddEscortShips (COUNT race, SIZE count)
|
||||
{
|
||||
HFLEETINFO hFleet;
|
||||
BYTE which_window;
|
||||
COUNT i;
|
||||
|
||||
hFleet = GetStarShipFromIndex (&GLOBAL (avail_race_q), which_ship);
|
||||
hFleet = GetStarShipFromIndex (&GLOBAL (avail_race_q), race);
|
||||
if (!hFleet)
|
||||
return 0;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case SPHERE_TRACKING:
|
||||
case SPHERE_KNOWN:
|
||||
{
|
||||
FLEET_INFO *FleetPtr;
|
||||
assert (count > 0);
|
||||
|
||||
FleetPtr = LockFleetInfo (&GLOBAL (avail_race_q), hFleet);
|
||||
if (state == SPHERE_KNOWN)
|
||||
which_ship = FleetPtr->known_strength;
|
||||
else if (FleetPtr->actual_strength == 0)
|
||||
which_window = 0;
|
||||
for (i = 0; i < (COUNT) count; i++)
|
||||
{
|
||||
if (FleetPtr->allied_state == DEAD_GUY)
|
||||
which_ship = 0;
|
||||
}
|
||||
else if (FleetPtr->known_strength == 0
|
||||
&& FleetPtr->actual_strength != INFINITE_RADIUS)
|
||||
HSHIPFRAG hStarShip;
|
||||
HSHIPFRAG hOldShip;
|
||||
SHIP_FRAGMENT *StarShipPtr;
|
||||
|
||||
hStarShip = CloneShipFragment (race, &GLOBAL (built_ship_q), 0);
|
||||
if (!hStarShip)
|
||||
break;
|
||||
|
||||
RemoveQueue (&GLOBAL (built_ship_q), hStarShip);
|
||||
|
||||
/* Find first available escort window */
|
||||
while ((hOldShip = GetStarShipFromIndex (
|
||||
&GLOBAL (built_ship_q), which_window++)))
|
||||
{
|
||||
FleetPtr->known_strength = 1;
|
||||
FleetPtr->known_loc = FleetPtr->loc;
|
||||
BYTE win_loc;
|
||||
|
||||
StarShipPtr = LockShipFrag (&GLOBAL (built_ship_q), hOldShip);
|
||||
win_loc = StarShipPtr->index;
|
||||
UnlockShipFrag (&GLOBAL (built_ship_q), hOldShip);
|
||||
if (which_window <= win_loc)
|
||||
break;
|
||||
}
|
||||
UnlockFleetInfo (&GLOBAL (avail_race_q), hFleet);
|
||||
return (which_ship);
|
||||
|
||||
StarShipPtr = LockShipFrag (&GLOBAL (built_ship_q), hStarShip);
|
||||
StarShipPtr->index = which_window - 1;
|
||||
UnlockShipFrag (&GLOBAL (built_ship_q), hStarShip);
|
||||
|
||||
InsertQueue (&GLOBAL (built_ship_q), hStarShip, hOldShip);
|
||||
}
|
||||
case ESCORT_WORTH:
|
||||
{
|
||||
|
||||
LockMutex (GraphicsLock);
|
||||
DeltaSISGauges (UNDEFINED_DELTA, UNDEFINED_DELTA, UNDEFINED_DELTA);
|
||||
UnlockMutex (GraphicsLock);
|
||||
return i;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns the total value of all the ships escorting the SIS.
|
||||
*/
|
||||
COUNT
|
||||
CalculateEscortsWorth (void)
|
||||
{
|
||||
COUNT ShipCost[] =
|
||||
{
|
||||
RACE_SHIP_COST
|
||||
@@ -156,13 +149,118 @@ ActivateStarShip (COUNT which_ship, SIZE state)
|
||||
UnlockShipFrag (&GLOBAL (built_ship_q), hStarShip);
|
||||
}
|
||||
return total;
|
||||
}
|
||||
case ESCORTING_FLAGSHIP:
|
||||
}
|
||||
|
||||
#if 0
|
||||
/*
|
||||
* Returns the size of the fleet of the specified race when the starmap was
|
||||
* last checked. If the race has no SoI, 0 is returned.
|
||||
*/
|
||||
COUNT
|
||||
GetRaceKnownSize (COUNT race)
|
||||
{
|
||||
HFLEETINFO hFleet;
|
||||
FLEET_INFO *FleetPtr;
|
||||
COUNT result;
|
||||
|
||||
hFleet = GetStarShipFromIndex (&GLOBAL (avail_race_q), race);
|
||||
if (!hFleet)
|
||||
return 0;
|
||||
|
||||
FleetPtr = LockFleetInfo (&GLOBAL (avail_race_q), hFleet);
|
||||
|
||||
result = FleetPtr->known_strength;
|
||||
|
||||
UnlockFleetInfo (&GLOBAL (avail_race_q), hFleet);
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
/*
|
||||
* Start or end an alliance with the specified race.
|
||||
* Being in an alliance with a race makes their ships available for building
|
||||
* in the shipyard.
|
||||
* flag == TRUE: start an alliance
|
||||
* flag == TRUE: end an alliance
|
||||
*/
|
||||
COUNT
|
||||
SetRaceAllied (COUNT race, BOOLEAN flag) {
|
||||
HFLEETINFO hFleet;
|
||||
FLEET_INFO *FleetPtr;
|
||||
|
||||
hFleet = GetStarShipFromIndex (&GLOBAL (avail_race_q), race);
|
||||
if (!hFleet)
|
||||
return 0;
|
||||
|
||||
FleetPtr = LockFleetInfo (&GLOBAL (avail_race_q), hFleet);
|
||||
|
||||
if (FleetPtr->allied_state == DEAD_GUY)
|
||||
{
|
||||
/* Strange request, silently ignore it */
|
||||
}
|
||||
else
|
||||
{
|
||||
FleetPtr->allied_state = (flag ? GOOD_GUY : BAD_GUY);
|
||||
}
|
||||
|
||||
UnlockFleetInfo (&GLOBAL (avail_race_q), hFleet);
|
||||
return 1;
|
||||
}
|
||||
|
||||
/*
|
||||
* Make the sphere of influence for the specified race shown on the starmap
|
||||
* in the future.
|
||||
* The value returned is 'race', unless the type of ship is only available
|
||||
* in SuperMelee, in which case 0 is returned.
|
||||
*/
|
||||
COUNT
|
||||
StartSphereTracking (COUNT race)
|
||||
{
|
||||
HFLEETINFO hFleet;
|
||||
FLEET_INFO *FleetPtr;
|
||||
|
||||
hFleet = GetStarShipFromIndex (&GLOBAL (avail_race_q), race);
|
||||
if (!hFleet)
|
||||
return 0;
|
||||
|
||||
FleetPtr = LockFleetInfo (&GLOBAL (avail_race_q), hFleet);
|
||||
|
||||
if (FleetPtr->actual_strength == 0)
|
||||
{
|
||||
if (FleetPtr->allied_state == DEAD_GUY)
|
||||
{
|
||||
// Race is extinct.
|
||||
UnlockFleetInfo (&GLOBAL (avail_race_q), hFleet);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
else if (FleetPtr->known_strength == 0
|
||||
&& FleetPtr->actual_strength != INFINITE_RADIUS)
|
||||
{
|
||||
FleetPtr->known_strength = 1;
|
||||
FleetPtr->known_loc = FleetPtr->loc;
|
||||
}
|
||||
|
||||
UnlockFleetInfo (&GLOBAL (avail_race_q), hFleet);
|
||||
return race;
|
||||
}
|
||||
|
||||
/*
|
||||
* Returns true if and only if a ship of the specified race is among the
|
||||
* escort ships.
|
||||
*/
|
||||
BOOLEAN
|
||||
HaveEscortShip (COUNT race)
|
||||
{
|
||||
HFLEETINFO hFleet;
|
||||
HSHIPFRAG hStarShip, hNextShip;
|
||||
|
||||
for (hStarShip = GetHeadLink (&GLOBAL (built_ship_q));
|
||||
hStarShip; hStarShip = hNextShip)
|
||||
hFleet = GetStarShipFromIndex (&GLOBAL (avail_race_q), race);
|
||||
if (!hFleet)
|
||||
return FALSE;
|
||||
|
||||
for (hStarShip = GetHeadLink (&GLOBAL (built_ship_q)); hStarShip;
|
||||
hStarShip = hNextShip)
|
||||
{
|
||||
BYTE ship_type;
|
||||
SHIP_FRAGMENT *StarShipPtr;
|
||||
@@ -172,64 +270,75 @@ ActivateStarShip (COUNT which_ship, SIZE state)
|
||||
ship_type = StarShipPtr->race_id;
|
||||
UnlockShipFrag (&GLOBAL (built_ship_q), hStarShip);
|
||||
|
||||
if (ship_type == which_ship)
|
||||
return 1;
|
||||
if (ship_type == race)
|
||||
return TRUE;
|
||||
}
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
/*
|
||||
* Test if the SIS can have an escort of the specified race.
|
||||
* Returns 0 if 'race' is not available.
|
||||
* Otherwise, returns the number of ships that can be added.
|
||||
*/
|
||||
COUNT
|
||||
EscortFeasibilityStudy (COUNT race)
|
||||
{
|
||||
HFLEETINFO hFleet;
|
||||
|
||||
hFleet = GetStarShipFromIndex (&GLOBAL (avail_race_q), race);
|
||||
if (!hFleet)
|
||||
return 0;
|
||||
}
|
||||
case FEASIBILITY_STUDY:
|
||||
{
|
||||
|
||||
return (MAX_BUILT_SHIPS - CountLinks (&GLOBAL (built_ship_q)));
|
||||
}
|
||||
case CHECK_ALLIANCE:
|
||||
{
|
||||
}
|
||||
|
||||
/*
|
||||
* Test the alliance status of the specified race.
|
||||
* Either DEAD_GUY (extinct), GOOD_GUY (allied), or BAD_GUY (not allied) is
|
||||
* returned.
|
||||
*/
|
||||
COUNT
|
||||
CheckAlliance (COUNT race)
|
||||
{
|
||||
HFLEETINFO hFleet;
|
||||
UWORD flags;
|
||||
FLEET_INFO *FleetPtr = LockFleetInfo (&GLOBAL (avail_race_q),
|
||||
hFleet);
|
||||
FLEET_INFO *FleetPtr;
|
||||
|
||||
hFleet = GetStarShipFromIndex (&GLOBAL (avail_race_q), race);
|
||||
if (!hFleet)
|
||||
return 0;
|
||||
|
||||
FleetPtr = LockFleetInfo (&GLOBAL (avail_race_q), hFleet);
|
||||
flags = FleetPtr->allied_state;
|
||||
UnlockFleetInfo (&GLOBAL (avail_race_q), hFleet);
|
||||
|
||||
return flags;
|
||||
}
|
||||
case SET_ALLIED:
|
||||
case SET_NOT_ALLIED:
|
||||
{
|
||||
FLEET_INFO *FleetPtr = LockFleetInfo (&GLOBAL (avail_race_q),
|
||||
hFleet);
|
||||
}
|
||||
|
||||
if (FleetPtr->allied_state == DEAD_GUY)
|
||||
{ /* Strange request, silently ignore it */
|
||||
UnlockFleetInfo (&GLOBAL (avail_race_q), hFleet);
|
||||
break;
|
||||
}
|
||||
|
||||
if (state == SET_ALLIED)
|
||||
FleetPtr->allied_state = GOOD_GUY;
|
||||
else
|
||||
FleetPtr->allied_state = BAD_GUY;
|
||||
|
||||
UnlockFleetInfo (&GLOBAL (avail_race_q), hFleet);
|
||||
break;
|
||||
}
|
||||
case REMOVE_BUILT:
|
||||
{
|
||||
/*
|
||||
* Remove all escort ships of the specified race.
|
||||
*/
|
||||
void
|
||||
RemoveEscortShips (COUNT race)
|
||||
{
|
||||
HSHIPFRAG hStarShip, hNextShip;
|
||||
BOOLEAN ShipRemoved = FALSE;
|
||||
|
||||
for (hStarShip = GetHeadLink (&GLOBAL (built_ship_q));
|
||||
hStarShip; hStarShip = hNextShip)
|
||||
for (hStarShip = GetHeadLink (&GLOBAL (built_ship_q)); hStarShip;
|
||||
hStarShip = hNextShip)
|
||||
{
|
||||
BOOLEAN RemoveShip;
|
||||
SHIP_FRAGMENT *StarShipPtr;
|
||||
|
||||
StarShipPtr = LockShipFrag (&GLOBAL (built_ship_q), hStarShip);
|
||||
hNextShip = _GetSuccLink (StarShipPtr);
|
||||
RemoveShip = (StarShipPtr->race_id == which_ship);
|
||||
RemoveShip = (StarShipPtr->race_id == race);
|
||||
UnlockShipFrag (&GLOBAL (built_ship_q), hStarShip);
|
||||
|
||||
if (RemoveShip)
|
||||
{
|
||||
ShipRemoved = TRUE;
|
||||
|
||||
RemoveQueue (&GLOBAL (built_ship_q), hStarShip);
|
||||
FreeShipFrag (&GLOBAL (built_ship_q), hStarShip);
|
||||
}
|
||||
@@ -238,63 +347,9 @@ ActivateStarShip (COUNT which_ship, SIZE state)
|
||||
if (ShipRemoved)
|
||||
{
|
||||
LockMutex (GraphicsLock);
|
||||
DeltaSISGauges (UNDEFINED_DELTA, UNDEFINED_DELTA,
|
||||
UNDEFINED_DELTA);
|
||||
DeltaSISGauges (UNDEFINED_DELTA, UNDEFINED_DELTA, UNDEFINED_DELTA);
|
||||
UnlockMutex (GraphicsLock);
|
||||
}
|
||||
break;
|
||||
}
|
||||
default:
|
||||
{
|
||||
BYTE which_window;
|
||||
COUNT i;
|
||||
|
||||
assert (state > 0);
|
||||
/* Add ships to the escorts */
|
||||
which_window = 0;
|
||||
for (i = 0; i < (COUNT)state; i++)
|
||||
{
|
||||
HSHIPFRAG hStarShip;
|
||||
HSHIPFRAG hOldShip;
|
||||
SHIP_FRAGMENT *StarShipPtr;
|
||||
|
||||
hStarShip = CloneShipFragment (which_ship,
|
||||
&GLOBAL (built_ship_q), 0);
|
||||
if (!hStarShip)
|
||||
break;
|
||||
|
||||
RemoveQueue (&GLOBAL (built_ship_q), hStarShip);
|
||||
|
||||
/* Find first available escort window */
|
||||
while ((hOldShip = GetStarShipFromIndex (
|
||||
&GLOBAL (built_ship_q), which_window++)))
|
||||
{
|
||||
BYTE win_loc;
|
||||
|
||||
StarShipPtr = LockShipFrag (&GLOBAL (built_ship_q),
|
||||
hOldShip);
|
||||
win_loc = StarShipPtr->index;
|
||||
UnlockShipFrag (&GLOBAL (built_ship_q), hOldShip);
|
||||
if (which_window <= win_loc)
|
||||
break;
|
||||
}
|
||||
|
||||
StarShipPtr = LockShipFrag (&GLOBAL (built_ship_q), hStarShip);
|
||||
StarShipPtr->index = which_window - 1;
|
||||
UnlockShipFrag (&GLOBAL (built_ship_q), hStarShip);
|
||||
|
||||
InsertQueue (&GLOBAL (built_ship_q), hStarShip, hOldShip);
|
||||
}
|
||||
|
||||
LockMutex (GraphicsLock);
|
||||
DeltaSISGauges (UNDEFINED_DELTA,
|
||||
UNDEFINED_DELTA, UNDEFINED_DELTA);
|
||||
UnlockMutex (GraphicsLock);
|
||||
return i;
|
||||
}
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
COUNT
|
||||
|
||||
@@ -60,6 +60,16 @@ extern COUNT GetIndexFromStarShip (QUEUE *pShipQ, HLINK hStarShip);
|
||||
extern int SetEscortCrewComplement (COUNT which_ship, COUNT crew_level,
|
||||
BYTE captain);
|
||||
|
||||
COUNT AddEscortShips (COUNT race, SIZE count);
|
||||
extern COUNT CalculateEscortsWorth (void);
|
||||
//extern COUNT GetRaceKnownSize (COUNT race);
|
||||
extern COUNT SetRaceAllied (COUNT race, BOOLEAN flag);
|
||||
extern COUNT StartSphereTracking (COUNT race);
|
||||
BOOLEAN HaveEscortShip (COUNT race);
|
||||
extern COUNT EscortFeasibilityStudy (COUNT race);
|
||||
extern COUNT CheckAlliance (COUNT race);
|
||||
extern void RemoveEscortShips (COUNT race);
|
||||
|
||||
extern RACE_DESC *load_ship (SPECIES_ID SpeciesID, BOOLEAN LoadBattleData);
|
||||
extern void free_ship (RACE_DESC *RaceDescPtr, BOOLEAN FreeIconData,
|
||||
BOOLEAN FreeBattleData);
|
||||
|
||||
+2
-2
@@ -1394,7 +1394,7 @@ InitCommunication (CONVERSATION which_comm)
|
||||
status = HUMAN_SHIP;
|
||||
}
|
||||
}
|
||||
ActivateStarShip (status, SPHERE_TRACKING);
|
||||
StartSphereTracking (status);
|
||||
|
||||
if (which_comm == ORZ_CONVERSATION
|
||||
|| (which_comm == TALKING_PET_CONVERSATION
|
||||
@@ -1402,7 +1402,7 @@ InitCommunication (CONVERSATION which_comm)
|
||||
|| LOBYTE (GLOBAL (CurrentActivity)) == IN_LAST_BATTLE))
|
||||
|| (which_comm != CHMMR_CONVERSATION
|
||||
&& which_comm != SYREEN_CONVERSATION
|
||||
))//&& ActivateStarShip (status, CHECK_ALLIANCE) == BAD_GUY))
|
||||
))//&& CheckAlliance (status) == BAD_GUY))
|
||||
BuildBattle (NPC_PLAYER_NUM);
|
||||
}
|
||||
|
||||
|
||||
@@ -134,7 +134,7 @@ ExitConversation (RESPONSE_REF R)
|
||||
|
||||
NPCPhrase (TAKE_2_WEEKS);
|
||||
|
||||
ActivateStarShip (CHMMR_SHIP, SET_ALLIED);
|
||||
SetRaceAllied (CHMMR_SHIP, TRUE);
|
||||
|
||||
SET_GAME_STATE (CHMMR_HOME_VISITS, 0);
|
||||
SET_GAME_STATE (CHMMR_STACK, 0);
|
||||
@@ -248,7 +248,7 @@ NotReady (RESPONSE_REF R)
|
||||
{
|
||||
NPCPhrase (USE_OUR_SHIPS_BEFORE);
|
||||
|
||||
ActivateStarShip (CHMMR_SHIP, SET_ALLIED);
|
||||
SetRaceAllied (CHMMR_SHIP, TRUE);
|
||||
}
|
||||
else if (PLAYER_SAID (R, where_weapon))
|
||||
{
|
||||
@@ -263,7 +263,7 @@ NotReady (RESPONSE_REF R)
|
||||
DISABLE_PHRASE (where_distraction);
|
||||
}
|
||||
|
||||
if (ActivateStarShip (CHMMR_SHIP, CHECK_ALLIANCE) != GOOD_GUY)
|
||||
if (CheckAlliance (CHMMR_SHIP) != GOOD_GUY)
|
||||
Response (tech_help, NotReady);
|
||||
else if (PHRASE_ENABLED (further_assistance))
|
||||
Response (further_assistance, NotReady);
|
||||
@@ -301,7 +301,7 @@ ImproveBomb (RESPONSE_REF R)
|
||||
{
|
||||
NPCPhrase (USE_OUR_SHIPS_AFTER);
|
||||
|
||||
ActivateStarShip (CHMMR_SHIP, SET_ALLIED);
|
||||
SetRaceAllied (CHMMR_SHIP, TRUE);
|
||||
}
|
||||
|
||||
if (PHRASE_ENABLED (what_now))
|
||||
@@ -310,7 +310,7 @@ ImproveBomb (RESPONSE_REF R)
|
||||
Response (wont_hurt_my_ship, ImproveBomb);
|
||||
else if (PHRASE_ENABLED (bummer_about_my_ship))
|
||||
Response (bummer_about_my_ship, ImproveBomb);
|
||||
if (ActivateStarShip (CHMMR_SHIP, CHECK_ALLIANCE) != GOOD_GUY)
|
||||
if (CheckAlliance (CHMMR_SHIP) != GOOD_GUY)
|
||||
Response (other_assistance, ImproveBomb);
|
||||
Response (proceed, ExitConversation);
|
||||
}
|
||||
|
||||
@@ -240,7 +240,7 @@ Buy (RESPONSE_REF R)
|
||||
#define SHIP_CREW_COST 100
|
||||
if (GLOBAL_SIS (CrewEnlisted) < SHIP_CREW_COST)
|
||||
NPCPhrase (NOT_ENOUGH_CREW);
|
||||
else if (ActivateStarShip (DRUUGE_SHIP, FEASIBILITY_STUDY) == 0)
|
||||
else if (EscortFeasibilityStudy (DRUUGE_SHIP) == 0)
|
||||
NPCPhrase (NOT_ENOUGH_ROOM);
|
||||
else
|
||||
{
|
||||
@@ -248,7 +248,7 @@ Buy (RESPONSE_REF R)
|
||||
DeltaSISGauges (-SHIP_CREW_COST, 0, 0);
|
||||
UnlockMutex (GraphicsLock);
|
||||
SlaveryCount += SHIP_CREW_COST;
|
||||
ActivateStarShip (DRUUGE_SHIP, 1);
|
||||
AddEscortShips (DRUUGE_SHIP, 1);
|
||||
|
||||
NPCPhrase (BOUGHT_SHIP);
|
||||
}
|
||||
@@ -403,7 +403,7 @@ DoTransaction (RESPONSE_REF R)
|
||||
|
||||
trade_gas = 0;
|
||||
ships_to_trade = 0;
|
||||
ship_slots = ActivateStarShip (DRUUGE_SHIP, FEASIBILITY_STUDY);
|
||||
ship_slots = EscortFeasibilityStudy (DRUUGE_SHIP);
|
||||
if (PLAYER_SAID (R, sell_maidens))
|
||||
{
|
||||
NPCPhrase (BOUGHT_MAIDENS);
|
||||
@@ -430,7 +430,7 @@ DoTransaction (RESPONSE_REF R)
|
||||
NPCPhrase (YOU_GET);
|
||||
if (ships_to_trade)
|
||||
{
|
||||
ActivateStarShip (DRUUGE_SHIP, ships_to_trade);
|
||||
AddEscortShips (DRUUGE_SHIP, ships_to_trade);
|
||||
|
||||
if (ship_slots >= ships_to_trade)
|
||||
NPCPhrase (DEAL_FOR_STATED_SHIPS);
|
||||
|
||||
@@ -213,7 +213,7 @@ ExitConversation (RESPONSE_REF R)
|
||||
SET_GAME_STATE (ORZ_GENERAL_INFO, 0);
|
||||
SET_GAME_STATE (ORZ_PERSONAL_INFO, 0);
|
||||
SET_GAME_STATE (ORZ_MANNER, 3);
|
||||
ActivateStarShip (ORZ_SHIP, SET_ALLIED);
|
||||
SetRaceAllied (ORZ_SHIP, TRUE);
|
||||
}
|
||||
else if (PLAYER_SAID (R, demand_to_land))
|
||||
{
|
||||
@@ -234,8 +234,8 @@ ExitConversation (RESPONSE_REF R)
|
||||
SET_GAME_STATE (BATTLE_SEGUE, 1);
|
||||
if (PLAYER_SAID (R, about_andro_3))
|
||||
{
|
||||
ActivateStarShip (ORZ_SHIP, SET_NOT_ALLIED);
|
||||
ActivateStarShip (ORZ_SHIP, REMOVE_BUILT);
|
||||
SetRaceAllied (ORZ_SHIP, FALSE);
|
||||
RemoveEscortShips (ORZ_SHIP);
|
||||
}
|
||||
|
||||
XFormColorMap (GetColorMapAddress (
|
||||
@@ -322,8 +322,7 @@ TaaloWorld (RESPONSE_REF R)
|
||||
|
||||
if (PHRASE_ENABLED (may_we_land))
|
||||
{
|
||||
if (Manner == 3 &&
|
||||
ActivateStarShip (ORZ_SHIP, CHECK_ALLIANCE) == GOOD_GUY)
|
||||
if (Manner == 3 && CheckAlliance (ORZ_SHIP) == GOOD_GUY)
|
||||
Response (may_we_land, ExitConversation);
|
||||
else
|
||||
Response (may_we_land, TaaloWorld);
|
||||
@@ -705,8 +704,7 @@ Intro (void)
|
||||
|
||||
TaaloWorld ((RESPONSE_REF)0);
|
||||
}
|
||||
else if (Manner == 3 &&
|
||||
ActivateStarShip (ORZ_SHIP, CHECK_ALLIANCE) == GOOD_GUY)
|
||||
else if (Manner == 3 && CheckAlliance (ORZ_SHIP) == GOOD_GUY)
|
||||
{
|
||||
if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 7))
|
||||
{
|
||||
|
||||
@@ -110,7 +110,7 @@ static void
|
||||
PrepareShip (void)
|
||||
{
|
||||
#define MAX_PKUNK_SHIPS 4
|
||||
if (ActivateStarShip (PKUNK_SHIP, MAX_PKUNK_SHIPS))
|
||||
if (AddEscortShips (PKUNK_SHIP, MAX_PKUNK_SHIPS))
|
||||
{
|
||||
BYTE mi, di, yi;
|
||||
|
||||
@@ -157,7 +157,7 @@ ExitConversation (RESPONSE_REF R)
|
||||
SET_GAME_STATE (PKUNK_INFO, 0);
|
||||
|
||||
AddEvent (RELATIVE_EVENT, 6, 0, 0, ADVANCE_PKUNK_MISSION);
|
||||
if (ActivateStarShip (PKUNK_SHIP, FEASIBILITY_STUDY) == 0)
|
||||
if (EscortFeasibilityStudy (PKUNK_SHIP) == 0)
|
||||
NPCPhrase (INIT_NO_ROOM);
|
||||
else
|
||||
{
|
||||
@@ -949,7 +949,7 @@ Intro (void)
|
||||
{
|
||||
if (NumVisits && ShipsReady ())
|
||||
{
|
||||
if (ActivateStarShip (PKUNK_SHIP, FEASIBILITY_STUDY) == 0)
|
||||
if (EscortFeasibilityStudy (PKUNK_SHIP) == 0)
|
||||
NPCPhrase (NO_ROOM);
|
||||
else
|
||||
{
|
||||
|
||||
@@ -324,7 +324,7 @@ Rebels (RESPONSE_REF R)
|
||||
|| ((NumVisits == 0 && (NumVisits = GLOBAL (GameClock.month_index) - GET_GAME_STATE (YEHAT_SHIP_MONTH)) < 0)
|
||||
|| (NumVisits == 0 && GLOBAL (GameClock.day_index) < GET_GAME_STATE (YEHAT_SHIP_DAY)))))
|
||||
NPCPhrase (NO_SHIPS_YET);
|
||||
else if ((NumVisits = ActivateStarShip (YEHAT_SHIP, FEASIBILITY_STUDY)) == 0)
|
||||
else if ((NumVisits = EscortFeasibilityStudy (YEHAT_SHIP)) == 0)
|
||||
NPCPhrase (NO_ROOM);
|
||||
else
|
||||
{
|
||||
@@ -338,7 +338,7 @@ Rebels (RESPONSE_REF R)
|
||||
}
|
||||
|
||||
AlienTalkSegue ((COUNT)~0);
|
||||
ActivateStarShip (YEHAT_SHIP, NumVisits);
|
||||
AddEscortShips (YEHAT_SHIP, NumVisits);
|
||||
PrepareShip ();
|
||||
}
|
||||
|
||||
@@ -382,12 +382,11 @@ Intro (void)
|
||||
NPCPhrase (YEHAT_CAVALRY);
|
||||
AlienTalkSegue ((COUNT)~0);
|
||||
|
||||
if ((NumVisits = (BYTE)ActivateStarShip (
|
||||
YEHAT_REBEL_SHIP, FEASIBILITY_STUDY
|
||||
)) > 8)
|
||||
NumVisits = (BYTE) EscortFeasibilityStudy (YEHAT_REBEL_SHIP);
|
||||
if (NumVisits > 8)
|
||||
NumVisits = 8;
|
||||
ActivateStarShip (YEHAT_REBEL_SHIP, NumVisits - (NumVisits >> 1));
|
||||
ActivateStarShip (PKUNK_SHIP, NumVisits >> 1);
|
||||
AddEscortShips (YEHAT_REBEL_SHIP, NumVisits - (NumVisits >> 1));
|
||||
AddEscortShips (PKUNK_SHIP, NumVisits >> 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -251,7 +251,7 @@ ExitConversation (RESPONSE_REF R)
|
||||
{
|
||||
NPCPhrase (DEPART_FOR_EARTH);
|
||||
|
||||
ActivateStarShip (SPATHI_SHIP, SET_ALLIED);
|
||||
SetRaceAllied (SPATHI_SHIP, TRUE);
|
||||
AddEvent (RELATIVE_EVENT, 6, 0, 0, SPATHI_SHIELD_EVENT);
|
||||
SET_GAME_STATE (SPATHI_HOME_VISITS, 0);
|
||||
SET_GAME_STATE (SPATHI_VISITS, 0);
|
||||
@@ -821,7 +821,7 @@ SpathiCouncil (RESPONSE_REF R)
|
||||
{
|
||||
if (PHRASE_ENABLED (spathi_on_pluto))
|
||||
Response (spathi_on_pluto, SpathiCouncil);
|
||||
else if (ActivateStarShip (SPATHI_SHIP, ESCORTING_FLAGSHIP))
|
||||
else if (HaveEscortShip (SPATHI_SHIP))
|
||||
{
|
||||
if (PHRASE_ENABLED (hostage))
|
||||
Response (hostage, SpathiCouncil);
|
||||
@@ -915,7 +915,7 @@ Intro (void)
|
||||
{
|
||||
SpathiAngry ((RESPONSE_REF)0);
|
||||
}
|
||||
else if (ActivateStarShip (SPATHI_SHIP, CHECK_ALLIANCE) == GOOD_GUY)
|
||||
else if (CheckAlliance (SPATHI_SHIP) == GOOD_GUY)
|
||||
{
|
||||
CommData.AlienColorMap =
|
||||
SetAbsColorMapIndex (CommData.AlienColorMap, 1);
|
||||
|
||||
@@ -188,14 +188,14 @@ ExitConversation (RESPONSE_REF Response)
|
||||
}
|
||||
else if (PLAYER_SAID (Response, join_us))
|
||||
{
|
||||
if (ActivateStarShip (SPATHI_SHIP, FEASIBILITY_STUDY) == 0)
|
||||
if (EscortFeasibilityStudy (SPATHI_SHIP) == 0)
|
||||
NPCPhrase (TOO_SCARY);
|
||||
else
|
||||
{
|
||||
NPCPhrase (WILL_JOIN);
|
||||
|
||||
AlienTalkSegue ((COUNT)~0);
|
||||
ActivateStarShip (SPATHI_SHIP, 1);
|
||||
AddEscortShips (SPATHI_SHIP, 1);
|
||||
/* Make the Eluder escort captained by Fwiffo alone */
|
||||
SetEscortCrewComplement (SPATHI_SHIP, 1,
|
||||
NAME_OFFSET + NUM_CAPTAINS_NAMES);
|
||||
@@ -750,7 +750,7 @@ Intro (void)
|
||||
Response (we_fight_again_space, ExitConversation);
|
||||
Response (bye_angry_space, ExitConversation);
|
||||
}
|
||||
else if (ActivateStarShip (SPATHI_SHIP, CHECK_ALLIANCE) == GOOD_GUY)
|
||||
else if (CheckAlliance (SPATHI_SHIP) == GOOD_GUY)
|
||||
{
|
||||
SpathiAllies ((RESPONSE_REF)0);
|
||||
}
|
||||
|
||||
@@ -700,11 +700,10 @@ AnalyzeCondition (void)
|
||||
COUNT FleetStrength;
|
||||
BOOLEAN HasMaximum;
|
||||
|
||||
FleetStrength = ActivateStarShip (0, ESCORT_WORTH);
|
||||
FleetStrength = CalculateEscortsWorth ();
|
||||
for (i = 0; i < NUM_AVAILABLE_RACES; ++i)
|
||||
{
|
||||
if (i != HUMAN_SHIP
|
||||
&& ActivateStarShip (i, CHECK_ALLIANCE) == GOOD_GUY)
|
||||
if (i != HUMAN_SHIP && CheckAlliance (i) == GOOD_GUY)
|
||||
++num_aliens;
|
||||
}
|
||||
|
||||
@@ -1377,36 +1376,31 @@ CheckBulletins (BOOLEAN Repeat)
|
||||
switch (b0)
|
||||
{
|
||||
case 0:
|
||||
if (ActivateStarShip (SPATHI_SHIP, CHECK_ALLIANCE)
|
||||
== GOOD_GUY)
|
||||
if (CheckAlliance (SPATHI_SHIP) == GOOD_GUY)
|
||||
{
|
||||
pStr = STARBASE_BULLETIN_1;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
if (ActivateStarShip (ZOQFOTPIK_SHIP, CHECK_ALLIANCE)
|
||||
== GOOD_GUY)
|
||||
if (CheckAlliance (ZOQFOTPIK_SHIP) == GOOD_GUY)
|
||||
{
|
||||
pStr = STARBASE_BULLETIN_2;
|
||||
}
|
||||
break;
|
||||
case 2:
|
||||
if (ActivateStarShip (SUPOX_SHIP, CHECK_ALLIANCE)
|
||||
== GOOD_GUY)
|
||||
if (CheckAlliance (SUPOX_SHIP) == GOOD_GUY)
|
||||
{
|
||||
pStr = STARBASE_BULLETIN_3;
|
||||
}
|
||||
break;
|
||||
case 3:
|
||||
if (ActivateStarShip (UTWIG_SHIP, CHECK_ALLIANCE)
|
||||
== GOOD_GUY)
|
||||
if (CheckAlliance (UTWIG_SHIP) == GOOD_GUY)
|
||||
{
|
||||
pStr = STARBASE_BULLETIN_4;
|
||||
}
|
||||
break;
|
||||
case 4:
|
||||
if (ActivateStarShip (ORZ_SHIP, CHECK_ALLIANCE)
|
||||
== GOOD_GUY)
|
||||
if (CheckAlliance (ORZ_SHIP) == GOOD_GUY)
|
||||
{
|
||||
pStr = STARBASE_BULLETIN_5;
|
||||
}
|
||||
@@ -1415,14 +1409,13 @@ CheckBulletins (BOOLEAN Repeat)
|
||||
if (GET_GAME_STATE (ARILOU_MANNER) == 2)
|
||||
BulletinMask |= 1L << b0;
|
||||
else if (GET_GAME_STATE (PORTAL_SPAWNER)
|
||||
&& (Repeat || ActivateStarShip (
|
||||
ARILOU_SHIP, FEASIBILITY_STUDY
|
||||
)))
|
||||
&& (Repeat || EscortFeasibilityStudy (
|
||||
ARILOU_SHIP)))
|
||||
{
|
||||
#define NUM_GIFT_ARILOUS 3
|
||||
pStr = STARBASE_BULLETIN_6;
|
||||
if (!Repeat)
|
||||
ActivateStarShip (ARILOU_SHIP, NUM_GIFT_ARILOUS);
|
||||
AddEscortShips (ARILOU_SHIP, NUM_GIFT_ARILOUS);
|
||||
}
|
||||
break;
|
||||
case 6:
|
||||
@@ -1471,15 +1464,13 @@ CheckBulletins (BOOLEAN Repeat)
|
||||
}
|
||||
break;
|
||||
case 12:
|
||||
if (ActivateStarShip (CHMMR_SHIP, CHECK_ALLIANCE)
|
||||
== GOOD_GUY)
|
||||
if (CheckAlliance (CHMMR_SHIP) == GOOD_GUY)
|
||||
{
|
||||
pStr = STARBASE_BULLETIN_13;
|
||||
}
|
||||
break;
|
||||
case 13:
|
||||
if (ActivateStarShip (SHOFIXTI_SHIP, CHECK_ALLIANCE)
|
||||
== GOOD_GUY)
|
||||
if (CheckAlliance (SHOFIXTI_SHIP) == GOOD_GUY)
|
||||
{
|
||||
pStr = STARBASE_BULLETIN_14;
|
||||
}
|
||||
|
||||
@@ -126,14 +126,14 @@ ExitConversation (RESPONSE_REF R)
|
||||
else if (PLAYER_SAID (R, can_you_help))
|
||||
{
|
||||
NPCPhrase (HOW_HELP);
|
||||
if (ActivateStarShip (SUPOX_SHIP, FEASIBILITY_STUDY) == 0)
|
||||
if (EscortFeasibilityStudy (SUPOX_SHIP) == 0)
|
||||
NPCPhrase (DONT_NEED);
|
||||
else
|
||||
{
|
||||
NPCPhrase (HAVE_4_SHIPS);
|
||||
|
||||
AlienTalkSegue ((COUNT)~0);
|
||||
ActivateStarShip (SUPOX_SHIP, 4);
|
||||
AddEscortShips (SUPOX_SHIP, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -357,7 +357,7 @@ NeutralSupox (RESPONSE_REF R)
|
||||
|
||||
LastStack = 2;
|
||||
SET_GAME_STATE (SUPOX_WAR_NEWS, 1);
|
||||
ActivateStarShip (UTWIG_SHIP, SPHERE_TRACKING);
|
||||
StartSphereTracking (UTWIG_SHIP);
|
||||
}
|
||||
else if (PLAYER_SAID (R, what_relation_to_utwig))
|
||||
{
|
||||
@@ -552,7 +552,7 @@ Intro (void)
|
||||
|
||||
SET_GAME_STATE (BATTLE_SEGUE, 0);
|
||||
}
|
||||
else if (ActivateStarShip (SUPOX_SHIP, CHECK_ALLIANCE) == GOOD_GUY)
|
||||
else if (CheckAlliance (SUPOX_SHIP) == GOOD_GUY)
|
||||
{
|
||||
if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 7))
|
||||
{
|
||||
|
||||
@@ -740,7 +740,7 @@ Intro (void)
|
||||
{
|
||||
case 0:
|
||||
NPCPhrase (HELLO_AFTER_AMBUSH_1);
|
||||
ActivateStarShip (SYREEN_SHIP, SET_ALLIED);
|
||||
SetRaceAllied (SYREEN_SHIP, TRUE);
|
||||
break;
|
||||
case 1:
|
||||
NPCPhrase (HELLO_AFTER_AMBUSH_2);
|
||||
|
||||
@@ -780,7 +780,7 @@ Intro (void)
|
||||
}
|
||||
else
|
||||
{
|
||||
if (ActivateStarShip (UMGAH_SHIP, SPHERE_TRACKING))
|
||||
if (StartSphereTracking (UMGAH_SHIP))
|
||||
{
|
||||
NPCPhrase (LETS_MAKE_A_DEAL);
|
||||
}
|
||||
|
||||
@@ -505,7 +505,7 @@ ThraddWorship (RESPONSE_REF R)
|
||||
SET_GAME_STATE (THRADD_VISITS, 0);
|
||||
SET_GAME_STATE (THRADD_MANNER, 1);
|
||||
SET_GAME_STATE (THRADD_STACK_1, 0);
|
||||
ActivateStarShip (THRADDASH_SHIP, SET_ALLIED);
|
||||
SetRaceAllied (THRADDASH_SHIP, TRUE);
|
||||
|
||||
Response (be_polite, ThraddCulture);
|
||||
Response (speak_pig_latin, ThraddCulture);
|
||||
|
||||
@@ -242,7 +242,7 @@ CombatIsInevitable (RESPONSE_REF R)
|
||||
NPCPhrase (FUNNY_IDEA);
|
||||
|
||||
AlienTalkSegue ((COUNT)~0);
|
||||
ActivateStarShip (UMGAH_SHIP, 4);
|
||||
AddEscortShips (UMGAH_SHIP, 4);
|
||||
SET_GAME_STATE (UMGAH_HOSTILE, 1);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -288,22 +288,22 @@ ExitConversation (RESPONSE_REF R)
|
||||
SET_GAME_STATE (SUPOX_HOSTILE, 0);
|
||||
SET_GAME_STATE (UTWIG_HOSTILE, 0);
|
||||
|
||||
ActivateStarShip (UTWIG_SHIP, SET_ALLIED);
|
||||
ActivateStarShip (SUPOX_SHIP, SET_ALLIED);
|
||||
SetRaceAllied (UTWIG_SHIP, TRUE);
|
||||
SetRaceAllied (SUPOX_SHIP, TRUE);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (PLAYER_SAID (R, can_you_help))
|
||||
{
|
||||
NPCPhrase (HOW_HELP);
|
||||
if (ActivateStarShip (UTWIG_SHIP, FEASIBILITY_STUDY) == 0)
|
||||
if (EscortFeasibilityStudy (UTWIG_SHIP) == 0)
|
||||
NPCPhrase (DONT_NEED);
|
||||
else
|
||||
{
|
||||
NPCPhrase (HAVE_4_SHIPS);
|
||||
|
||||
AlienTalkSegue ((COUNT)~0);
|
||||
ActivateStarShip (UTWIG_SHIP, 4);
|
||||
AddEscortShips (UTWIG_SHIP, 4);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -390,7 +390,7 @@ AlliedHome (RESPONSE_REF R)
|
||||
Response (what_now_homeworld, AlliedHome);
|
||||
if (PHRASE_ENABLED (how_is_ultron))
|
||||
Response (how_is_ultron, AlliedHome);
|
||||
if (NumVisits == 0 && ActivateStarShip (UTWIG_SHIP, FEASIBILITY_STUDY) != 0)
|
||||
if (NumVisits == 0 && EscortFeasibilityStudy (UTWIG_SHIP) != 0)
|
||||
Response (can_you_help, ExitConversation);
|
||||
Response (bye_allied_homeworld, ExitConversation);
|
||||
}
|
||||
@@ -525,7 +525,7 @@ NeutralUtwig (RESPONSE_REF R)
|
||||
NPCPhrase (ABOUT_US_2);
|
||||
|
||||
LastStack = 2;
|
||||
ActivateStarShip (SUPOX_SHIP, SPHERE_TRACKING);
|
||||
StartSphereTracking (SUPOX_SHIP);
|
||||
SET_GAME_STATE (UTWIG_WAR_NEWS, 2);
|
||||
}
|
||||
else if (PLAYER_SAID (R, what_about_you_3))
|
||||
@@ -807,7 +807,7 @@ Intro (void)
|
||||
Response (hey_wait_got_ultron, ExitConversation);
|
||||
}
|
||||
}
|
||||
else if (ActivateStarShip (UTWIG_SHIP, CHECK_ALLIANCE) == GOOD_GUY)
|
||||
else if (CheckAlliance (UTWIG_SHIP) == GOOD_GUY)
|
||||
{
|
||||
if (GET_GAME_STATE (GLOBAL_FLAGS_AND_DATA) & (1 << 7))
|
||||
{
|
||||
|
||||
@@ -309,7 +309,7 @@ StartRevolt (RESPONSE_REF R)
|
||||
else if (PLAYER_SAID (R, shofixti_alive_2))
|
||||
NPCPhrase (SEND_HIM_OVER_2);
|
||||
|
||||
if (ActivateStarShip (SHOFIXTI_SHIP, ESCORTING_FLAGSHIP))
|
||||
if (HaveEscortShip (SHOFIXTI_SHIP))
|
||||
Response (ok_send, ExitConversation);
|
||||
else
|
||||
Response (not_here, ExitConversation);
|
||||
|
||||
@@ -224,7 +224,7 @@ ExitConversation (RESPONSE_REF R)
|
||||
NPCPhrase_cb (WE_ALLY4, &SelectAlienZOQ);
|
||||
NPCPhrase_cb (WE_ALLY5, &SelectAlienPIK);
|
||||
ZFPTalkSegue ((COUNT)~0);
|
||||
ActivateStarShip (ZOQFOTPIK_SHIP, SET_ALLIED);
|
||||
SetRaceAllied (ZOQFOTPIK_SHIP, TRUE);
|
||||
AddEvent (RELATIVE_EVENT, 3, 0, 0, ZOQFOT_DISTRESS_EVENT);
|
||||
SET_GAME_STATE (ZOQFOT_HOME_VISITS, 0);
|
||||
}
|
||||
@@ -735,7 +735,7 @@ ZoqFotHome (RESPONSE_REF R)
|
||||
NPCPhrase_cb (GOOD9, &SelectAlienPIK);
|
||||
ZFPTalkSegue ((COUNT)~0);
|
||||
|
||||
ActivateStarShip (ZOQFOTPIK_SHIP, SET_ALLIED);
|
||||
SetRaceAllied (ZOQFOTPIK_SHIP, TRUE);
|
||||
AddEvent (RELATIVE_EVENT, 3, 0, 0, ZOQFOT_DISTRESS_EVENT);
|
||||
}
|
||||
else if (PLAYER_SAID (R, enough_info))
|
||||
@@ -748,7 +748,7 @@ ZoqFotHome (RESPONSE_REF R)
|
||||
Response (whats_up_homeworld, ZoqFotHome);
|
||||
if (PHRASE_ENABLED (any_war_news))
|
||||
Response (any_war_news, ZoqFotHome);
|
||||
if (ActivateStarShip (ZOQFOTPIK_SHIP, CHECK_ALLIANCE) != GOOD_GUY)
|
||||
if (CheckAlliance (ZOQFOTPIK_SHIP) != GOOD_GUY)
|
||||
Response (i_want_alliance, ZoqFotHome);
|
||||
else if (PHRASE_ENABLED (want_specific_info))
|
||||
{
|
||||
@@ -870,12 +870,12 @@ Intro (void)
|
||||
ZFPTalkSegue ((COUNT)~0);
|
||||
|
||||
SET_GAME_STATE (ZOQFOT_DISTRESS, 0);
|
||||
ActivateStarShip (ZOQFOTPIK_SHIP, MAX_ZFP_SHIPS);
|
||||
AddEscortShips (ZOQFOTPIK_SHIP, MAX_ZFP_SHIPS);
|
||||
}
|
||||
else
|
||||
{
|
||||
NumVisits = GET_GAME_STATE (ZOQFOT_HOME_VISITS);
|
||||
if (ActivateStarShip (ZOQFOTPIK_SHIP, CHECK_ALLIANCE) != GOOD_GUY)
|
||||
if (CheckAlliance (ZOQFOTPIK_SHIP) != GOOD_GUY)
|
||||
{
|
||||
switch (NumVisits++)
|
||||
{
|
||||
@@ -960,7 +960,7 @@ init_zoqfot_comm (void)
|
||||
|
||||
zoqfot_desc.AlienTextWidth = (SIS_TEXT_WIDTH >> 1) - TEXT_X_OFFS;
|
||||
|
||||
if (ActivateStarShip (ZOQFOTPIK_SHIP, CHECK_ALLIANCE) == GOOD_GUY
|
||||
if (CheckAlliance (ZOQFOTPIK_SHIP) == GOOD_GUY
|
||||
|| LOBYTE (GLOBAL (CurrentActivity)) == WON_LAST_BATTLE)
|
||||
{
|
||||
SET_GAME_STATE (BATTLE_SEGUE, 0);
|
||||
|
||||
@@ -120,7 +120,7 @@ EventHandler (BYTE selector)
|
||||
}
|
||||
break;
|
||||
case SHOFIXTI_RETURN_EVENT:
|
||||
ActivateStarShip (SHOFIXTI_SHIP, SET_ALLIED);
|
||||
SetRaceAllied (SHOFIXTI_SHIP, TRUE);
|
||||
GLOBAL (CrewCost) -= 2;
|
||||
/* crew is not an issue anymore */
|
||||
SET_GAME_STATE (CREW_PURCHASED0, 0);
|
||||
@@ -145,7 +145,7 @@ EventHandler (BYTE selector)
|
||||
|
||||
if (SpathiPtr->actual_strength)
|
||||
{
|
||||
ActivateStarShip (SPATHI_SHIP, SET_NOT_ALLIED);
|
||||
SetRaceAllied (SPATHI_SHIP, FALSE);
|
||||
SET_GAME_STATE (SPATHI_SHIELDED_SELVES, 1);
|
||||
SpathiPtr->actual_strength = 0;
|
||||
}
|
||||
@@ -181,7 +181,7 @@ EventHandler (BYTE selector)
|
||||
RebelPtr->loc.y = 0;
|
||||
UnlockFleetInfo (&GLOBAL (avail_race_q), hRoyalist);
|
||||
UnlockFleetInfo (&GLOBAL (avail_race_q), hRebel);
|
||||
ActivateStarShip (YEHAT_REBEL_SHIP, SPHERE_TRACKING);
|
||||
StartSphereTracking (YEHAT_REBEL_SHIP);
|
||||
break;
|
||||
}
|
||||
case SLYLANDRO_RAMP_UP:
|
||||
@@ -439,7 +439,7 @@ pkunk_mission (void)
|
||||
{
|
||||
SET_GAME_STATE (YEHAT_ABSORBED_PKUNK, 1);
|
||||
PkunkPtr->allied_state = DEAD_GUY;
|
||||
ActivateStarShip (YEHAT_SHIP, SPHERE_TRACKING);
|
||||
StartSphereTracking (YEHAT_SHIP);
|
||||
}
|
||||
else
|
||||
{
|
||||
@@ -577,7 +577,7 @@ ilwrath_mission (void)
|
||||
|
||||
SET_GAME_STATE (THRADD_VISITS, 0);
|
||||
if (ThraddPtr->allied_state == GOOD_GUY)
|
||||
ActivateStarShip (THRADDASH_SHIP, SET_NOT_ALLIED);
|
||||
SetRaceAllied (THRADDASH_SHIP, FALSE);
|
||||
}
|
||||
|
||||
ThraddState = GET_GAME_STATE (THRADD_MISSION);
|
||||
|
||||
@@ -337,7 +337,7 @@ InitGameStructures (void)
|
||||
sizeof (GLOBAL_SIS (CommanderName)),
|
||||
GAME_STRING (NAMING_STRING_BASE + 3));
|
||||
|
||||
ActivateStarShip (HUMAN_SHIP, SET_ALLIED);
|
||||
SetRaceAllied (HUMAN_SHIP, TRUE);
|
||||
CloneShipFragment (HUMAN_SHIP, &GLOBAL (built_ship_q), 0);
|
||||
|
||||
GLOBAL_SIS (log_x) = UNIVERSE_TO_LOGX (SOL_X);
|
||||
|
||||
@@ -258,7 +258,7 @@ UseCaster (void)
|
||||
HIPGROUP hGroup;
|
||||
|
||||
FoundIlwrath = (CurStarDescPtr->Index == ILWRATH_DEFINED)
|
||||
&& ActivateStarShip (ILWRATH_SHIP, SPHERE_TRACKING);
|
||||
&& StartSphereTracking (ILWRATH_SHIP);
|
||||
// In the Ilwrath home system and they are alive?
|
||||
|
||||
if (!FoundIlwrath &&
|
||||
|
||||
@@ -107,7 +107,7 @@ GenerateChmmr_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
||||
}
|
||||
else if (GET_GAME_STATE (SUN_DEVICE_ON_SHIP)
|
||||
&& !GET_GAME_STATE (ILWRATH_DECEIVED)
|
||||
&& ActivateStarShip (ILWRATH_SHIP, SPHERE_TRACKING))
|
||||
&& StartSphereTracking (ILWRATH_SHIP))
|
||||
{
|
||||
PutGroupInfo (GROUPS_RANDOM, GROUP_SAVE_IP);
|
||||
ReinitQueue (&GLOBAL (ip_group_q));
|
||||
|
||||
@@ -88,7 +88,7 @@ GenerateDruuge_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
||||
{
|
||||
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
||||
{
|
||||
if (ActivateStarShip (DRUUGE_SHIP, SPHERE_TRACKING))
|
||||
if (StartSphereTracking (DRUUGE_SHIP))
|
||||
{
|
||||
NotifyOthers (DRUUGE_SHIP, IPNL_ALL_CLEAR);
|
||||
PutGroupInfo (GROUPS_RANDOM, GROUP_SAVE_IP);
|
||||
|
||||
@@ -78,7 +78,7 @@ GenerateIlwrath_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
||||
{
|
||||
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
||||
{
|
||||
if (ActivateStarShip (ILWRATH_SHIP, SPHERE_TRACKING))
|
||||
if (StartSphereTracking (ILWRATH_SHIP))
|
||||
{
|
||||
NotifyOthers (ILWRATH_SHIP, IPNL_ALL_CLEAR);
|
||||
PutGroupInfo (GROUPS_RANDOM, GROUP_SAVE_IP);
|
||||
|
||||
@@ -89,7 +89,7 @@ GenerateMycon_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
||||
{
|
||||
if ((CurStarDescPtr->Index == MYCON_DEFINED
|
||||
|| CurStarDescPtr->Index == SUN_DEVICE_DEFINED)
|
||||
&& ActivateStarShip (MYCON_SHIP, SPHERE_TRACKING))
|
||||
&& StartSphereTracking (MYCON_SHIP))
|
||||
{
|
||||
if (CurStarDescPtr->Index == MYCON_DEFINED
|
||||
|| !GET_GAME_STATE (SUN_DEVICE_UNGUARDED))
|
||||
|
||||
@@ -93,7 +93,7 @@ GenerateOrz_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
||||
|
||||
if ((CurStarDescPtr->Index == ORZ_DEFINED
|
||||
|| !GET_GAME_STATE (TAALO_UNPROTECTED))
|
||||
&& ActivateStarShip (ORZ_SHIP, SPHERE_TRACKING))
|
||||
&& StartSphereTracking (ORZ_SHIP))
|
||||
{
|
||||
NotifyOthers (ORZ_SHIP, IPNL_ALL_CLEAR);
|
||||
PutGroupInfo (GROUPS_RANDOM, GROUP_SAVE_IP);
|
||||
|
||||
@@ -83,14 +83,14 @@ GenerateTalkingPet_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world
|
||||
if (matchWorld (solarSys, world, 0, MATCH_PLANET)
|
||||
&& (GET_GAME_STATE (UMGAH_ZOMBIE_BLOBBIES)
|
||||
|| !GET_GAME_STATE (TALKING_PET)
|
||||
|| ActivateStarShip (UMGAH_SHIP, SPHERE_TRACKING)))
|
||||
|| StartSphereTracking (UMGAH_SHIP)))
|
||||
{
|
||||
NotifyOthers (UMGAH_SHIP, IPNL_ALL_CLEAR);
|
||||
PutGroupInfo (GROUPS_RANDOM, GROUP_SAVE_IP);
|
||||
ReinitQueue (&GLOBAL (ip_group_q));
|
||||
assert (CountLinks (&GLOBAL (npc_built_ship_q)) == 0);
|
||||
|
||||
if (ActivateStarShip (UMGAH_SHIP, SPHERE_TRACKING))
|
||||
if (StartSphereTracking (UMGAH_SHIP))
|
||||
{
|
||||
GLOBAL (CurrentActivity) |= START_INTERPLANETARY;
|
||||
SET_GAME_STATE (GLOBAL_FLAGS_AND_DATA, 1 << 7);
|
||||
@@ -129,7 +129,7 @@ GenerateTalkingPet_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world
|
||||
// Defeated the zombie fleet.
|
||||
InitCommunication (TALKING_PET_CONVERSATION);
|
||||
}
|
||||
else if (!(ActivateStarShip (UMGAH_SHIP, SPHERE_TRACKING)))
|
||||
else if (!(StartSphereTracking (UMGAH_SHIP)))
|
||||
{
|
||||
// The Kohr-Ah have destroyed the Umgah, but the
|
||||
// talking pet survived.
|
||||
|
||||
@@ -79,7 +79,7 @@ GeneratePkunk_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
||||
{
|
||||
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
||||
{
|
||||
if (ActivateStarShip (PKUNK_SHIP, SPHERE_TRACKING))
|
||||
if (StartSphereTracking (PKUNK_SHIP))
|
||||
{
|
||||
NotifyOthers (PKUNK_SHIP, IPNL_ALL_CLEAR);
|
||||
PutGroupInfo (GROUPS_RANDOM, GROUP_SAVE_IP);
|
||||
|
||||
@@ -215,9 +215,8 @@ GenerateSaMatra_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
||||
EncounterRace = -1;
|
||||
GLOBAL (CurrentActivity) = IN_LAST_BATTLE | START_ENCOUNTER;
|
||||
if (GET_GAME_STATE (YEHAT_CIVIL_WAR)
|
||||
&& ActivateStarShip (YEHAT_SHIP, SPHERE_TRACKING)
|
||||
&& ActivateStarShip (YEHAT_REBEL_SHIP,
|
||||
FEASIBILITY_STUDY))
|
||||
&& StartSphereTracking (YEHAT_SHIP)
|
||||
&& EscortFeasibilityStudy (YEHAT_REBEL_SHIP))
|
||||
InitCommunication (YEHAT_REBEL_CONVERSATION);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -121,7 +121,7 @@ GenerateSpathi_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
||||
{
|
||||
/* Spathiwa's moon */
|
||||
if (!GET_GAME_STATE (SPATHI_SHIELDED_SELVES)
|
||||
&& ActivateStarShip (SPATHI_SHIP, SPHERE_TRACKING))
|
||||
&& StartSphereTracking (SPATHI_SHIP))
|
||||
{
|
||||
NotifyOthers (SPATHI_SHIP, IPNL_ALL_CLEAR);
|
||||
PutGroupInfo (GROUPS_RANDOM, GROUP_SAVE_IP);
|
||||
|
||||
@@ -79,7 +79,7 @@ GenerateSupox_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
||||
{
|
||||
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
||||
{
|
||||
if (ActivateStarShip (SUPOX_SHIP, SPHERE_TRACKING))
|
||||
if (StartSphereTracking (SUPOX_SHIP))
|
||||
{
|
||||
NotifyOthers (SUPOX_SHIP, IPNL_ALL_CLEAR);
|
||||
PutGroupInfo (GROUPS_RANDOM, GROUP_SAVE_IP);
|
||||
|
||||
@@ -96,7 +96,7 @@ GenerateThraddash_generateOrbital (SOLARSYS_STATE *solarSys,
|
||||
{
|
||||
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
||||
{
|
||||
if (ActivateStarShip (THRADDASH_SHIP, SPHERE_TRACKING)
|
||||
if (StartSphereTracking (THRADDASH_SHIP)
|
||||
&& (CurStarDescPtr->Index == THRADD_DEFINED
|
||||
|| (!GET_GAME_STATE (HELIX_UNPROTECTED)
|
||||
&& (BYTE)(GET_GAME_STATE (THRADD_MISSION) - 1) >= 3)))
|
||||
|
||||
@@ -109,7 +109,7 @@ GenerateUtwig_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
||||
{
|
||||
if ((CurStarDescPtr->Index == UTWIG_DEFINED
|
||||
|| !GET_GAME_STATE (UTWIG_HAVE_ULTRON))
|
||||
&& ActivateStarShip (UTWIG_SHIP, SPHERE_TRACKING))
|
||||
&& StartSphereTracking (UTWIG_SHIP))
|
||||
{
|
||||
NotifyOthers (UTWIG_SHIP, IPNL_ALL_CLEAR);
|
||||
PutGroupInfo (GROUPS_RANDOM, GROUP_SAVE_IP);
|
||||
@@ -141,7 +141,7 @@ GenerateUtwig_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
||||
|
||||
if (CurStarDescPtr->Index == BOMB_DEFINED
|
||||
&& !GET_GAME_STATE (BOMB_UNPROTECTED)
|
||||
&& ActivateStarShip (DRUUGE_SHIP, SPHERE_TRACKING))
|
||||
&& StartSphereTracking (DRUUGE_SHIP))
|
||||
{
|
||||
COUNT i;
|
||||
|
||||
|
||||
@@ -125,7 +125,7 @@ GenerateVux_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
||||
&& (CurStarDescPtr->Index == VUX_DEFINED
|
||||
|| (CurStarDescPtr->Index == MAIDENS_DEFINED
|
||||
&& !GET_GAME_STATE (ZEX_IS_DEAD))))
|
||||
&& ActivateStarShip (VUX_SHIP, SPHERE_TRACKING))
|
||||
&& StartSphereTracking (VUX_SHIP))
|
||||
{
|
||||
NotifyOthers (VUX_SHIP, IPNL_ALL_CLEAR);
|
||||
PutGroupInfo (GROUPS_RANDOM, GROUP_SAVE_IP);
|
||||
|
||||
@@ -77,7 +77,7 @@ GenerateYehat_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
||||
{
|
||||
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
||||
{
|
||||
if (ActivateStarShip (YEHAT_SHIP, SPHERE_TRACKING))
|
||||
if (StartSphereTracking (YEHAT_SHIP))
|
||||
{
|
||||
NotifyOthers (YEHAT_SHIP, IPNL_ALL_CLEAR);
|
||||
PutGroupInfo (GROUPS_RANDOM, GROUP_SAVE_IP);
|
||||
|
||||
@@ -87,7 +87,7 @@ GenerateZoqFotPik_generateOrbital (SOLARSYS_STATE *solarSys, PLANET_DESC *world)
|
||||
{
|
||||
if (matchWorld (solarSys, world, 0, MATCH_PLANET))
|
||||
{
|
||||
if (ActivateStarShip (ZOQFOTPIK_SHIP, SPHERE_TRACKING))
|
||||
if (StartSphereTracking (ZOQFOTPIK_SHIP))
|
||||
{
|
||||
PutGroupInfo (GROUPS_RANDOM, GROUP_SAVE_IP);
|
||||
ReinitQueue (&GLOBAL (ip_group_q));
|
||||
|
||||
+3
-3
@@ -384,9 +384,9 @@ typedef struct
|
||||
// Values for FLEET_INFO.allied_state
|
||||
enum
|
||||
{
|
||||
DEAD_GUY = 0,
|
||||
GOOD_GUY,
|
||||
BAD_GUY,
|
||||
DEAD_GUY = 0, // Race is extinct
|
||||
GOOD_GUY, // Race is allied with the player
|
||||
BAD_GUY, // Race is not allied with the player
|
||||
};
|
||||
|
||||
static inline FLEET_INFO *
|
||||
|
||||
@@ -525,7 +525,7 @@ CrewTransaction (SIZE crew_delta)
|
||||
LockMutex (GraphicsLock);
|
||||
}
|
||||
}
|
||||
if (ActivateStarShip (SHOFIXTI_SHIP, CHECK_ALLIANCE) != GOOD_GUY)
|
||||
if (CheckAlliance (SHOFIXTI_SHIP) != GOOD_GUY)
|
||||
{
|
||||
SET_GAME_STATE (CREW_PURCHASED0, LOBYTE (crew_bought));
|
||||
SET_GAME_STATE (CREW_PURCHASED1, HIBYTE (crew_bought));
|
||||
|
||||
+12
-12
@@ -85,18 +85,18 @@ debugKeyPressed (void)
|
||||
// Give the player the ships you can't ally with under normal
|
||||
// conditions.
|
||||
clearEscorts ();
|
||||
ActivateStarShip (ARILOU_SHIP, 1);
|
||||
ActivateStarShip (PKUNK_SHIP, 1);
|
||||
ActivateStarShip (VUX_SHIP, 1);
|
||||
ActivateStarShip (YEHAT_SHIP, 1);
|
||||
ActivateStarShip (MELNORME_SHIP, 1);
|
||||
ActivateStarShip (DRUUGE_SHIP, 1);
|
||||
ActivateStarShip (ILWRATH_SHIP, 1);
|
||||
ActivateStarShip (MYCON_SHIP, 1);
|
||||
ActivateStarShip (SLYLANDRO_SHIP, 1);
|
||||
ActivateStarShip (UMGAH_SHIP, 1);
|
||||
ActivateStarShip (URQUAN_SHIP, 1);
|
||||
ActivateStarShip (BLACK_URQUAN_SHIP, 1);
|
||||
AddEscortShips (ARILOU_SHIP, 1);
|
||||
AddEscortShips (PKUNK_SHIP, 1);
|
||||
AddEscortShips (VUX_SHIP, 1);
|
||||
AddEscortShips (YEHAT_SHIP, 1);
|
||||
AddEscortShips (MELNORME_SHIP, 1);
|
||||
AddEscortShips (DRUUGE_SHIP, 1);
|
||||
AddEscortShips (ILWRATH_SHIP, 1);
|
||||
AddEscortShips (MYCON_SHIP, 1);
|
||||
AddEscortShips (SLYLANDRO_SHIP, 1);
|
||||
AddEscortShips (UMGAH_SHIP, 1);
|
||||
AddEscortShips (URQUAN_SHIP, 1);
|
||||
AddEscortShips (BLACK_URQUAN_SHIP, 1);
|
||||
|
||||
resetCrewBattle ();
|
||||
resetEnergyBattle ();
|
||||
|
||||
Reference in New Issue
Block a user