Cleanups.
git-svn-id: svn://svn.code.sf.net/p/sc2/code/trunk@2319 8092fc87-c524-0410-9efc-e669fe64eaf9
This commit is contained in:
+45
-39
@@ -33,17 +33,55 @@ QUEUE disp_q;
|
|||||||
SIZE battle_counter;
|
SIZE battle_counter;
|
||||||
BOOLEAN instantVictory;
|
BOOLEAN instantVictory;
|
||||||
|
|
||||||
|
static BOOLEAN
|
||||||
|
RunAwayAllowed (void)
|
||||||
|
{
|
||||||
|
return (LOBYTE (GLOBAL (CurrentActivity)) == IN_ENCOUNTER
|
||||||
|
|| LOBYTE (GLOBAL (CurrentActivity)) == IN_LAST_BATTLE)
|
||||||
|
&& GET_GAME_STATE (STARBASE_AVAILABLE)
|
||||||
|
&& !GET_GAME_STATE (BOMB_CARRIER);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
DoRunAway (STARSHIPPTR StarShipPtr)
|
||||||
|
{
|
||||||
|
ELEMENTPTR ElementPtr;
|
||||||
|
|
||||||
|
LockElement (StarShipPtr->hShip, &ElementPtr);
|
||||||
|
if (GetPrimType (&DisplayArray[ElementPtr->PrimIndex]) == STAMP_PRIM
|
||||||
|
&& ElementPtr->life_span == NORMAL_LIFE
|
||||||
|
&& !(ElementPtr->state_flags & FINITE_LIFE)
|
||||||
|
&& ElementPtr->mass_points != MAX_SHIP_MASS * 10
|
||||||
|
&& !(ElementPtr->state_flags & APPEARING))
|
||||||
|
{
|
||||||
|
extern void flee_preprocess (PELEMENT);
|
||||||
|
|
||||||
|
battle_counter -= MAKE_WORD (1, 0);
|
||||||
|
|
||||||
|
ElementPtr->turn_wait = 3;
|
||||||
|
ElementPtr->thrust_wait = MAKE_BYTE (4, 0);
|
||||||
|
ElementPtr->preprocess_func = flee_preprocess;
|
||||||
|
ElementPtr->mass_points = MAX_SHIP_MASS * 10;
|
||||||
|
ZeroVelocityComponents (&ElementPtr->velocity);
|
||||||
|
StarShipPtr->cur_status_flags &=
|
||||||
|
~(SHIP_AT_MAX_SPEED | SHIP_BEYOND_MAX_SPEED);
|
||||||
|
|
||||||
|
SetPrimColor (&DisplayArray[ElementPtr->PrimIndex],
|
||||||
|
BUILD_COLOR (MAKE_RGB15 (0xB, 0x00, 0x00), 0x2E));
|
||||||
|
SetPrimType (&DisplayArray[ElementPtr->PrimIndex], STAMPFILL_PRIM);
|
||||||
|
|
||||||
|
CyborgDescPtr->ship_input_state = 0;
|
||||||
|
}
|
||||||
|
UnlockElement (StarShipPtr->hShip);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ProcessInput (void)
|
ProcessInput (void)
|
||||||
{
|
{
|
||||||
BOOLEAN CanRunAway;
|
BOOLEAN CanRunAway;
|
||||||
|
|
||||||
CanRunAway = (BOOLEAN)(
|
CanRunAway = RunAwayAllowed ();
|
||||||
(LOBYTE (GLOBAL (CurrentActivity)) == IN_ENCOUNTER
|
|
||||||
|| LOBYTE (GLOBAL (CurrentActivity)) == IN_LAST_BATTLE)
|
|
||||||
&& GET_GAME_STATE (STARBASE_AVAILABLE)
|
|
||||||
&& !GET_GAME_STATE (BOMB_CARRIER)
|
|
||||||
);
|
|
||||||
for (cur_player = NUM_SIDES - 1; cur_player >= 0; --cur_player)
|
for (cur_player = NUM_SIDES - 1; cur_player >= 0; --cur_player)
|
||||||
{
|
{
|
||||||
HSTARSHIP hBattleShip, hNextShip;
|
HSTARSHIP hBattleShip, hNextShip;
|
||||||
@@ -83,39 +121,7 @@ ProcessInput (void)
|
|||||||
|
|
||||||
if (CanRunAway && cur_player == 0 &&
|
if (CanRunAway && cur_player == 0 &&
|
||||||
(InputState & BATTLE_ESCAPE))
|
(InputState & BATTLE_ESCAPE))
|
||||||
{
|
DoRunAway (StarShipPtr);
|
||||||
ELEMENTPTR ElementPtr;
|
|
||||||
|
|
||||||
LockElement (StarShipPtr->hShip, &ElementPtr);
|
|
||||||
if (GetPrimType (&DisplayArray[
|
|
||||||
ElementPtr->PrimIndex]) == STAMP_PRIM
|
|
||||||
&& ElementPtr->life_span == NORMAL_LIFE
|
|
||||||
&& !(ElementPtr->state_flags & FINITE_LIFE)
|
|
||||||
&& ElementPtr->mass_points != MAX_SHIP_MASS * 10
|
|
||||||
&& !(ElementPtr->state_flags & APPEARING))
|
|
||||||
{
|
|
||||||
extern void flee_preprocess (PELEMENT);
|
|
||||||
|
|
||||||
battle_counter -= MAKE_WORD (1, 0);
|
|
||||||
|
|
||||||
ElementPtr->turn_wait = 3;
|
|
||||||
ElementPtr->thrust_wait = MAKE_BYTE (4, 0);
|
|
||||||
ElementPtr->preprocess_func = flee_preprocess;
|
|
||||||
ElementPtr->mass_points = MAX_SHIP_MASS * 10;
|
|
||||||
ZeroVelocityComponents (&ElementPtr->velocity);
|
|
||||||
StarShipPtr->cur_status_flags &=
|
|
||||||
~(SHIP_AT_MAX_SPEED | SHIP_BEYOND_MAX_SPEED);
|
|
||||||
|
|
||||||
SetPrimColor (&DisplayArray[ElementPtr->PrimIndex],
|
|
||||||
BUILD_COLOR (
|
|
||||||
MAKE_RGB15 (0xB, 0x00, 0x00), 0x2E));
|
|
||||||
SetPrimType (&DisplayArray[
|
|
||||||
ElementPtr->PrimIndex], STAMPFILL_PRIM);
|
|
||||||
|
|
||||||
CyborgDescPtr->ship_input_state = 0;
|
|
||||||
}
|
|
||||||
UnlockElement (StarShipPtr->hShip);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -838,16 +838,13 @@ DoMissions (void)
|
|||||||
SHIP_FRAGMENTPTR StarShipPtr;
|
SHIP_FRAGMENTPTR StarShipPtr;
|
||||||
|
|
||||||
StarShipPtr = (SHIP_FRAGMENTPTR)LockStarShip (
|
StarShipPtr = (SHIP_FRAGMENTPTR)LockStarShip (
|
||||||
&GLOBAL (npc_built_ship_q), hStarShip
|
&GLOBAL (npc_built_ship_q), hStarShip);
|
||||||
);
|
|
||||||
hNextShip = _GetSuccLink (StarShipPtr);
|
hNextShip = _GetSuccLink (StarShipPtr);
|
||||||
|
|
||||||
if (StarShipPtr->ShipInfo.crew_level)
|
if (StarShipPtr->ShipInfo.crew_level)
|
||||||
spawn_ip_group (StarShipPtr);
|
spawn_ip_group (StarShipPtr);
|
||||||
|
|
||||||
UnlockStarShip (
|
UnlockStarShip (&GLOBAL (npc_built_ship_q), hStarShip);
|
||||||
&GLOBAL (npc_built_ship_q), hStarShip
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+71
-70
@@ -188,16 +188,16 @@ DrawShipBox (PMELEE_STATE pMS, BOOLEAN HiLite)
|
|||||||
DrawStarConBox (&r, 1,
|
DrawStarConBox (&r, 1,
|
||||||
BUILD_COLOR (MAKE_RGB15 (0x7, 0x00, 0xC), 0x3E),
|
BUILD_COLOR (MAKE_RGB15 (0x7, 0x00, 0xC), 0x3E),
|
||||||
BUILD_COLOR (MAKE_RGB15 (0xC, 0x00, 0x14), 0x3C),
|
BUILD_COLOR (MAKE_RGB15 (0xC, 0x00, 0x14), 0x3C),
|
||||||
(BOOLEAN)(StarShip != (BYTE)~0),
|
(BOOLEAN)(StarShip != MELEE_NONE),
|
||||||
BUILD_COLOR (MAKE_RGB15 (0xA, 0x00, 0x11), 0x3D));
|
BUILD_COLOR (MAKE_RGB15 (0xA, 0x00, 0x11), 0x3D));
|
||||||
else
|
else
|
||||||
DrawStarConBox (&r, 1,
|
DrawStarConBox (&r, 1,
|
||||||
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x9), 0x56),
|
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0x9), 0x56),
|
||||||
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0xE), 0x54),
|
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0xE), 0x54),
|
||||||
(BOOLEAN)(StarShip != (BYTE)~0),
|
(BOOLEAN)(StarShip != MELEE_NONE),
|
||||||
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0xC), 0x55));
|
BUILD_COLOR (MAKE_RGB15 (0x00, 0x00, 0xC), 0x55));
|
||||||
|
|
||||||
if (StarShip != (BYTE)~0)
|
if (StarShip != MELEE_NONE)
|
||||||
{
|
{
|
||||||
STAMP s;
|
STAMP s;
|
||||||
HSTARSHIP hStarShip;
|
HSTARSHIP hStarShip;
|
||||||
@@ -640,7 +640,7 @@ DrawMeleeShipStrings (PMELEE_STATE pMS, BYTE NewStarShip)
|
|||||||
SetContextClipRect (&r);
|
SetContextClipRect (&r);
|
||||||
BatchGraphics ();
|
BatchGraphics ();
|
||||||
|
|
||||||
if (NewStarShip == (BYTE)~0)
|
if (NewStarShip == MELEE_NONE)
|
||||||
{
|
{
|
||||||
RECT r;
|
RECT r;
|
||||||
TEXT t;
|
TEXT t;
|
||||||
@@ -704,13 +704,13 @@ GetTeamValue (TEAM_IMAGE *pTI)
|
|||||||
BYTE StarShip;
|
BYTE StarShip;
|
||||||
|
|
||||||
StarShip = pTI->ShipList[row][col];
|
StarShip = pTI->ShipList[row][col];
|
||||||
if (StarShip != (BYTE) ~0)
|
if (StarShip != MELEE_NONE)
|
||||||
{
|
{
|
||||||
HSTARSHIP hStarShip;
|
HSTARSHIP hStarShip;
|
||||||
|
|
||||||
hStarShip = GetStarShipFromIndex (&master_q, StarShip);
|
hStarShip = GetStarShipFromIndex (&master_q, StarShip);
|
||||||
if (hStarShip == 0)
|
if (hStarShip == 0)
|
||||||
pTI->ShipList[row][col] = (BYTE)~0;
|
pTI->ShipList[row][col] = MELEE_NONE;
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
STARSHIPPTR StarShipPtr;
|
STARSHIPPTR StarShipPtr;
|
||||||
@@ -869,7 +869,7 @@ DrawFileStrings (PMELEE_STATE pMS, int HiLiteState)
|
|||||||
BYTE StarShip;
|
BYTE StarShip;
|
||||||
|
|
||||||
StarShip = pMS->FileList[bot - top].ShipList[row][col];
|
StarShip = pMS->FileList[bot - top].ShipList[row][col];
|
||||||
if (StarShip != (BYTE)~0)
|
if (StarShip != MELEE_NONE)
|
||||||
{
|
{
|
||||||
HSTARSHIP hStarShip;
|
HSTARSHIP hStarShip;
|
||||||
STARSHIPPTR StarShipPtr;
|
STARSHIPPTR StarShipPtr;
|
||||||
@@ -1135,7 +1135,7 @@ DeleteCurrentShip (PMELEE_STATE pMS)
|
|||||||
StarShipPtr->RaceDescPtr->ship_info.ship_cost;
|
StarShipPtr->RaceDescPtr->ship_info.ship_cost;
|
||||||
UnlockStarShip (&master_q, hStarShip);
|
UnlockStarShip (&master_q, hStarShip);
|
||||||
|
|
||||||
pMS->TeamImage[pMS->side].ShipList[pMS->row][pMS->col] = (BYTE)~0;
|
pMS->TeamImage[pMS->side].ShipList[pMS->row][pMS->col] = MELEE_NONE;
|
||||||
}
|
}
|
||||||
LockMutex (GraphicsLock);
|
LockMutex (GraphicsLock);
|
||||||
GetShipBox (&r, pMS->side, pMS->row, pMS->col);
|
GetShipBox (&r, pMS->side, pMS->row, pMS->col);
|
||||||
@@ -1311,7 +1311,7 @@ DoEdit (PMELEE_STATE pMS)
|
|||||||
pMS->row = row;
|
pMS->row = row;
|
||||||
pMS->col = col;
|
pMS->col = col;
|
||||||
if (row == NUM_MELEE_ROWS)
|
if (row == NUM_MELEE_ROWS)
|
||||||
pMS->CurIndex = (BYTE)~0;
|
pMS->CurIndex = MELEE_NONE;
|
||||||
else
|
else
|
||||||
pMS->CurIndex = pMS->TeamImage[side].ShipList[row][col];
|
pMS->CurIndex = pMS->TeamImage[side].ShipList[row][col];
|
||||||
UnlockMutex (GraphicsLock);
|
UnlockMutex (GraphicsLock);
|
||||||
@@ -1583,7 +1583,8 @@ BuildAndDrawShipList (PMELEE_STATE pMS)
|
|||||||
{
|
{
|
||||||
BYTE StarShip;
|
BYTE StarShip;
|
||||||
|
|
||||||
if ((StarShip = pMS->TeamImage[i].ShipList[j][k]) != (BYTE)~0)
|
StarShip = pMS->TeamImage[i].ShipList[j][k];
|
||||||
|
if (StarShip != MELEE_NONE)
|
||||||
{
|
{
|
||||||
BYTE ship_cost;
|
BYTE ship_cost;
|
||||||
HSTARSHIP hStarShip, hBuiltShip;
|
HSTARSHIP hStarShip, hBuiltShip;
|
||||||
@@ -1823,11 +1824,11 @@ InitPreBuilt (PMELEE_STATE pMS)
|
|||||||
pMS->PreBuiltList[0].ShipList[0][6] = MELEE_SPATHI;
|
pMS->PreBuiltList[0].ShipList[0][6] = MELEE_SPATHI;
|
||||||
pMS->PreBuiltList[0].ShipList[1][0] = MELEE_SYREEN;
|
pMS->PreBuiltList[0].ShipList[1][0] = MELEE_SYREEN;
|
||||||
pMS->PreBuiltList[0].ShipList[1][1] = MELEE_UTWIG;
|
pMS->PreBuiltList[0].ShipList[1][1] = MELEE_UTWIG;
|
||||||
pMS->PreBuiltList[0].ShipList[1][2] = (BYTE)~0;
|
pMS->PreBuiltList[0].ShipList[1][2] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[0].ShipList[1][3] = (BYTE)~0;
|
pMS->PreBuiltList[0].ShipList[1][3] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[0].ShipList[1][4] = (BYTE)~0;
|
pMS->PreBuiltList[0].ShipList[1][4] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[0].ShipList[1][5] = (BYTE)~0;
|
pMS->PreBuiltList[0].ShipList[1][5] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[0].ShipList[1][6] = (BYTE)~0;
|
pMS->PreBuiltList[0].ShipList[1][6] = MELEE_NONE;
|
||||||
|
|
||||||
utf8StringCopy (pMS->PreBuiltList[1].TeamName,
|
utf8StringCopy (pMS->PreBuiltList[1].TeamName,
|
||||||
sizeof (pMS->PreBuiltList[1].TeamName),
|
sizeof (pMS->PreBuiltList[1].TeamName),
|
||||||
@@ -1843,9 +1844,9 @@ InitPreBuilt (PMELEE_STATE pMS)
|
|||||||
pMS->PreBuiltList[1].ShipList[1][1] = MELEE_THRADDASH;
|
pMS->PreBuiltList[1].ShipList[1][1] = MELEE_THRADDASH;
|
||||||
pMS->PreBuiltList[1].ShipList[1][2] = MELEE_ZOQFOTPIK;
|
pMS->PreBuiltList[1].ShipList[1][2] = MELEE_ZOQFOTPIK;
|
||||||
pMS->PreBuiltList[1].ShipList[1][3] = MELEE_SHOFIXTI;
|
pMS->PreBuiltList[1].ShipList[1][3] = MELEE_SHOFIXTI;
|
||||||
pMS->PreBuiltList[1].ShipList[1][4] = (BYTE)~0;
|
pMS->PreBuiltList[1].ShipList[1][4] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[1].ShipList[1][5] = (BYTE)~0;
|
pMS->PreBuiltList[1].ShipList[1][5] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[1].ShipList[1][6] = (BYTE)~0;
|
pMS->PreBuiltList[1].ShipList[1][6] = MELEE_NONE;
|
||||||
|
|
||||||
utf8StringCopy (pMS->PreBuiltList[2].TeamName,
|
utf8StringCopy (pMS->PreBuiltList[2].TeamName,
|
||||||
sizeof (pMS->PreBuiltList[2].TeamName),
|
sizeof (pMS->PreBuiltList[2].TeamName),
|
||||||
@@ -1861,9 +1862,9 @@ InitPreBuilt (PMELEE_STATE pMS)
|
|||||||
pMS->PreBuiltList[2].ShipList[1][1] = MELEE_SPATHI;
|
pMS->PreBuiltList[2].ShipList[1][1] = MELEE_SPATHI;
|
||||||
pMS->PreBuiltList[2].ShipList[1][2] = MELEE_ILWRATH;
|
pMS->PreBuiltList[2].ShipList[1][2] = MELEE_ILWRATH;
|
||||||
pMS->PreBuiltList[2].ShipList[1][3] = MELEE_VUX;
|
pMS->PreBuiltList[2].ShipList[1][3] = MELEE_VUX;
|
||||||
pMS->PreBuiltList[2].ShipList[1][4] = (BYTE)~0;
|
pMS->PreBuiltList[2].ShipList[1][4] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[2].ShipList[1][5] = (BYTE)~0;
|
pMS->PreBuiltList[2].ShipList[1][5] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[2].ShipList[1][6] = (BYTE)~0;
|
pMS->PreBuiltList[2].ShipList[1][6] = MELEE_NONE;
|
||||||
|
|
||||||
utf8StringCopy (pMS->PreBuiltList[3].TeamName,
|
utf8StringCopy (pMS->PreBuiltList[3].TeamName,
|
||||||
sizeof (pMS->PreBuiltList[3].TeamName),
|
sizeof (pMS->PreBuiltList[3].TeamName),
|
||||||
@@ -1878,10 +1879,10 @@ InitPreBuilt (PMELEE_STATE pMS)
|
|||||||
pMS->PreBuiltList[3].ShipList[1][0] = MELEE_URQUAN;
|
pMS->PreBuiltList[3].ShipList[1][0] = MELEE_URQUAN;
|
||||||
pMS->PreBuiltList[3].ShipList[1][1] = MELEE_UTWIG;
|
pMS->PreBuiltList[3].ShipList[1][1] = MELEE_UTWIG;
|
||||||
pMS->PreBuiltList[3].ShipList[1][2] = MELEE_UTWIG;
|
pMS->PreBuiltList[3].ShipList[1][2] = MELEE_UTWIG;
|
||||||
pMS->PreBuiltList[3].ShipList[1][3] = (BYTE)~0;
|
pMS->PreBuiltList[3].ShipList[1][3] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[3].ShipList[1][4] = (BYTE)~0;
|
pMS->PreBuiltList[3].ShipList[1][4] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[3].ShipList[1][5] = (BYTE)~0;
|
pMS->PreBuiltList[3].ShipList[1][5] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[3].ShipList[1][6] = (BYTE)~0;
|
pMS->PreBuiltList[3].ShipList[1][6] = MELEE_NONE;
|
||||||
|
|
||||||
utf8StringCopy (pMS->PreBuiltList[4].TeamName,
|
utf8StringCopy (pMS->PreBuiltList[4].TeamName,
|
||||||
sizeof (pMS->PreBuiltList[4].TeamName),
|
sizeof (pMS->PreBuiltList[4].TeamName),
|
||||||
@@ -1898,8 +1899,8 @@ InitPreBuilt (PMELEE_STATE pMS)
|
|||||||
pMS->PreBuiltList[4].ShipList[1][2] = MELEE_DRUUGE;
|
pMS->PreBuiltList[4].ShipList[1][2] = MELEE_DRUUGE;
|
||||||
pMS->PreBuiltList[4].ShipList[1][3] = MELEE_PKUNK;
|
pMS->PreBuiltList[4].ShipList[1][3] = MELEE_PKUNK;
|
||||||
pMS->PreBuiltList[4].ShipList[1][4] = MELEE_ORZ;
|
pMS->PreBuiltList[4].ShipList[1][4] = MELEE_ORZ;
|
||||||
pMS->PreBuiltList[4].ShipList[1][5] = (BYTE)~0;
|
pMS->PreBuiltList[4].ShipList[1][5] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[4].ShipList[1][6] = (BYTE)~0;
|
pMS->PreBuiltList[4].ShipList[1][6] = MELEE_NONE;
|
||||||
|
|
||||||
utf8StringCopy (pMS->PreBuiltList[5].TeamName,
|
utf8StringCopy (pMS->PreBuiltList[5].TeamName,
|
||||||
sizeof (pMS->PreBuiltList[5].TeamName),
|
sizeof (pMS->PreBuiltList[5].TeamName),
|
||||||
@@ -1910,14 +1911,14 @@ InitPreBuilt (PMELEE_STATE pMS)
|
|||||||
pMS->PreBuiltList[5].ShipList[0][3] = MELEE_SUPOX;
|
pMS->PreBuiltList[5].ShipList[0][3] = MELEE_SUPOX;
|
||||||
pMS->PreBuiltList[5].ShipList[0][4] = MELEE_UTWIG;
|
pMS->PreBuiltList[5].ShipList[0][4] = MELEE_UTWIG;
|
||||||
pMS->PreBuiltList[5].ShipList[0][5] = MELEE_UMGAH;
|
pMS->PreBuiltList[5].ShipList[0][5] = MELEE_UMGAH;
|
||||||
pMS->PreBuiltList[5].ShipList[0][6] = (BYTE)~0;
|
pMS->PreBuiltList[5].ShipList[0][6] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[5].ShipList[1][0] = (BYTE)~0;
|
pMS->PreBuiltList[5].ShipList[1][0] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[5].ShipList[1][1] = (BYTE)~0;
|
pMS->PreBuiltList[5].ShipList[1][1] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[5].ShipList[1][2] = (BYTE)~0;
|
pMS->PreBuiltList[5].ShipList[1][2] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[5].ShipList[1][3] = (BYTE)~0;
|
pMS->PreBuiltList[5].ShipList[1][3] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[5].ShipList[1][4] = (BYTE)~0;
|
pMS->PreBuiltList[5].ShipList[1][4] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[5].ShipList[1][5] = (BYTE)~0;
|
pMS->PreBuiltList[5].ShipList[1][5] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[5].ShipList[1][6] = (BYTE)~0;
|
pMS->PreBuiltList[5].ShipList[1][6] = MELEE_NONE;
|
||||||
|
|
||||||
utf8StringCopy (pMS->PreBuiltList[6].TeamName,
|
utf8StringCopy (pMS->PreBuiltList[6].TeamName,
|
||||||
sizeof (pMS->PreBuiltList[6].TeamName),
|
sizeof (pMS->PreBuiltList[6].TeamName),
|
||||||
@@ -1927,15 +1928,15 @@ InitPreBuilt (PMELEE_STATE pMS)
|
|||||||
pMS->PreBuiltList[6].ShipList[0][2] = MELEE_MYCON;
|
pMS->PreBuiltList[6].ShipList[0][2] = MELEE_MYCON;
|
||||||
pMS->PreBuiltList[6].ShipList[0][3] = MELEE_ORZ;
|
pMS->PreBuiltList[6].ShipList[0][3] = MELEE_ORZ;
|
||||||
pMS->PreBuiltList[6].ShipList[0][4] = MELEE_URQUAN;
|
pMS->PreBuiltList[6].ShipList[0][4] = MELEE_URQUAN;
|
||||||
pMS->PreBuiltList[6].ShipList[0][5] = (BYTE)~0;
|
pMS->PreBuiltList[6].ShipList[0][5] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[6].ShipList[0][6] = (BYTE)~0;
|
pMS->PreBuiltList[6].ShipList[0][6] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[6].ShipList[1][0] = (BYTE)~0;
|
pMS->PreBuiltList[6].ShipList[1][0] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[6].ShipList[1][1] = (BYTE)~0;
|
pMS->PreBuiltList[6].ShipList[1][1] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[6].ShipList[1][2] = (BYTE)~0;
|
pMS->PreBuiltList[6].ShipList[1][2] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[6].ShipList[1][3] = (BYTE)~0;
|
pMS->PreBuiltList[6].ShipList[1][3] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[6].ShipList[1][4] = (BYTE)~0;
|
pMS->PreBuiltList[6].ShipList[1][4] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[6].ShipList[1][5] = (BYTE)~0;
|
pMS->PreBuiltList[6].ShipList[1][5] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[6].ShipList[1][6] = (BYTE)~0;
|
pMS->PreBuiltList[6].ShipList[1][6] = MELEE_NONE;
|
||||||
|
|
||||||
utf8StringCopy (pMS->PreBuiltList[7].TeamName,
|
utf8StringCopy (pMS->PreBuiltList[7].TeamName,
|
||||||
sizeof (pMS->PreBuiltList[7].TeamName),
|
sizeof (pMS->PreBuiltList[7].TeamName),
|
||||||
@@ -1950,10 +1951,10 @@ InitPreBuilt (PMELEE_STATE pMS)
|
|||||||
pMS->PreBuiltList[7].ShipList[1][0] = MELEE_ORZ;
|
pMS->PreBuiltList[7].ShipList[1][0] = MELEE_ORZ;
|
||||||
pMS->PreBuiltList[7].ShipList[1][1] = MELEE_PKUNK;
|
pMS->PreBuiltList[7].ShipList[1][1] = MELEE_PKUNK;
|
||||||
pMS->PreBuiltList[7].ShipList[1][2] = MELEE_SPATHI;
|
pMS->PreBuiltList[7].ShipList[1][2] = MELEE_SPATHI;
|
||||||
pMS->PreBuiltList[7].ShipList[1][3] = (BYTE)~0;
|
pMS->PreBuiltList[7].ShipList[1][3] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[7].ShipList[1][4] = (BYTE)~0;
|
pMS->PreBuiltList[7].ShipList[1][4] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[7].ShipList[1][5] = (BYTE)~0;
|
pMS->PreBuiltList[7].ShipList[1][5] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[7].ShipList[1][6] = (BYTE)~0;
|
pMS->PreBuiltList[7].ShipList[1][6] = MELEE_NONE;
|
||||||
|
|
||||||
utf8StringCopy (pMS->PreBuiltList[8].TeamName,
|
utf8StringCopy (pMS->PreBuiltList[8].TeamName,
|
||||||
sizeof (pMS->PreBuiltList[8].TeamName),
|
sizeof (pMS->PreBuiltList[8].TeamName),
|
||||||
@@ -1982,14 +1983,14 @@ InitPreBuilt (PMELEE_STATE pMS)
|
|||||||
pMS->PreBuiltList[9].ShipList[0][3] = MELEE_EARTHLING;
|
pMS->PreBuiltList[9].ShipList[0][3] = MELEE_EARTHLING;
|
||||||
pMS->PreBuiltList[9].ShipList[0][4] = MELEE_VUX;
|
pMS->PreBuiltList[9].ShipList[0][4] = MELEE_VUX;
|
||||||
pMS->PreBuiltList[9].ShipList[0][5] = MELEE_ZOQFOTPIK;
|
pMS->PreBuiltList[9].ShipList[0][5] = MELEE_ZOQFOTPIK;
|
||||||
pMS->PreBuiltList[9].ShipList[0][6] = (BYTE)~0;
|
pMS->PreBuiltList[9].ShipList[0][6] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[9].ShipList[1][0] = (BYTE)~0;
|
pMS->PreBuiltList[9].ShipList[1][0] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[9].ShipList[1][1] = (BYTE)~0;
|
pMS->PreBuiltList[9].ShipList[1][1] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[9].ShipList[1][2] = (BYTE)~0;
|
pMS->PreBuiltList[9].ShipList[1][2] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[9].ShipList[1][3] = (BYTE)~0;
|
pMS->PreBuiltList[9].ShipList[1][3] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[9].ShipList[1][4] = (BYTE)~0;
|
pMS->PreBuiltList[9].ShipList[1][4] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[9].ShipList[1][5] = (BYTE)~0;
|
pMS->PreBuiltList[9].ShipList[1][5] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[9].ShipList[1][6] = (BYTE)~0;
|
pMS->PreBuiltList[9].ShipList[1][6] = MELEE_NONE;
|
||||||
|
|
||||||
utf8StringCopy (pMS->PreBuiltList[10].TeamName,
|
utf8StringCopy (pMS->PreBuiltList[10].TeamName,
|
||||||
sizeof (pMS->PreBuiltList[10].TeamName),
|
sizeof (pMS->PreBuiltList[10].TeamName),
|
||||||
@@ -2019,13 +2020,13 @@ InitPreBuilt (PMELEE_STATE pMS)
|
|||||||
pMS->PreBuiltList[11].ShipList[0][4] = MELEE_SHOFIXTI;
|
pMS->PreBuiltList[11].ShipList[0][4] = MELEE_SHOFIXTI;
|
||||||
pMS->PreBuiltList[11].ShipList[0][5] = MELEE_SYREEN;
|
pMS->PreBuiltList[11].ShipList[0][5] = MELEE_SYREEN;
|
||||||
pMS->PreBuiltList[11].ShipList[0][6] = MELEE_YEHAT;
|
pMS->PreBuiltList[11].ShipList[0][6] = MELEE_YEHAT;
|
||||||
pMS->PreBuiltList[11].ShipList[1][0] = (BYTE)~0;
|
pMS->PreBuiltList[11].ShipList[1][0] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[11].ShipList[1][1] = (BYTE)~0;
|
pMS->PreBuiltList[11].ShipList[1][1] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[11].ShipList[1][2] = (BYTE)~0;
|
pMS->PreBuiltList[11].ShipList[1][2] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[11].ShipList[1][3] = (BYTE)~0;
|
pMS->PreBuiltList[11].ShipList[1][3] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[11].ShipList[1][4] = (BYTE)~0;
|
pMS->PreBuiltList[11].ShipList[1][4] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[11].ShipList[1][5] = (BYTE)~0;
|
pMS->PreBuiltList[11].ShipList[1][5] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[11].ShipList[1][6] = (BYTE)~0;
|
pMS->PreBuiltList[11].ShipList[1][6] = MELEE_NONE;
|
||||||
|
|
||||||
utf8StringCopy (pMS->PreBuiltList[12].TeamName,
|
utf8StringCopy (pMS->PreBuiltList[12].TeamName,
|
||||||
sizeof (pMS->PreBuiltList[12].TeamName),
|
sizeof (pMS->PreBuiltList[12].TeamName),
|
||||||
@@ -2037,13 +2038,13 @@ InitPreBuilt (PMELEE_STATE pMS)
|
|||||||
pMS->PreBuiltList[12].ShipList[0][4] = MELEE_UMGAH;
|
pMS->PreBuiltList[12].ShipList[0][4] = MELEE_UMGAH;
|
||||||
pMS->PreBuiltList[12].ShipList[0][5] = MELEE_URQUAN;
|
pMS->PreBuiltList[12].ShipList[0][5] = MELEE_URQUAN;
|
||||||
pMS->PreBuiltList[12].ShipList[0][6] = MELEE_VUX;
|
pMS->PreBuiltList[12].ShipList[0][6] = MELEE_VUX;
|
||||||
pMS->PreBuiltList[12].ShipList[1][0] = (BYTE)~0;
|
pMS->PreBuiltList[12].ShipList[1][0] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[12].ShipList[1][1] = (BYTE)~0;
|
pMS->PreBuiltList[12].ShipList[1][1] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[12].ShipList[1][2] = (BYTE)~0;
|
pMS->PreBuiltList[12].ShipList[1][2] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[12].ShipList[1][3] = (BYTE)~0;
|
pMS->PreBuiltList[12].ShipList[1][3] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[12].ShipList[1][4] = (BYTE)~0;
|
pMS->PreBuiltList[12].ShipList[1][4] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[12].ShipList[1][5] = (BYTE)~0;
|
pMS->PreBuiltList[12].ShipList[1][5] = MELEE_NONE;
|
||||||
pMS->PreBuiltList[12].ShipList[1][6] = (BYTE)~0;
|
pMS->PreBuiltList[12].ShipList[1][6] = MELEE_NONE;
|
||||||
|
|
||||||
utf8StringCopy (pMS->PreBuiltList[13].TeamName,
|
utf8StringCopy (pMS->PreBuiltList[13].TeamName,
|
||||||
sizeof (pMS->PreBuiltList[13].TeamName),
|
sizeof (pMS->PreBuiltList[13].TeamName),
|
||||||
|
|||||||
@@ -54,7 +54,9 @@ enum
|
|||||||
MELEE_YEHAT,
|
MELEE_YEHAT,
|
||||||
MELEE_ZOQFOTPIK,
|
MELEE_ZOQFOTPIK,
|
||||||
|
|
||||||
NUM_MELEE_SHIPS
|
NUM_MELEE_SHIPS,
|
||||||
|
|
||||||
|
MELEE_NONE = (BYTE) ~0
|
||||||
};
|
};
|
||||||
|
|
||||||
#define NUM_MELEE_ROWS 2
|
#define NUM_MELEE_ROWS 2
|
||||||
|
|||||||
@@ -268,9 +268,7 @@ ship_preprocess (PELEMENT ElementPtr)
|
|||||||
if (!OBJECT_CLOAKED (ElementPtr)
|
if (!OBJECT_CLOAKED (ElementPtr)
|
||||||
&& LOBYTE (GLOBAL (CurrentActivity)) <= IN_ENCOUNTER)
|
&& LOBYTE (GLOBAL (CurrentActivity)) <= IN_ENCOUNTER)
|
||||||
{
|
{
|
||||||
extern void spawn_ion_trail
|
extern void spawn_ion_trail (PELEMENT ElementPtr);
|
||||||
(PELEMENT
|
|
||||||
ElementPtr);
|
|
||||||
|
|
||||||
spawn_ion_trail (ElementPtr);
|
spawn_ion_trail (ElementPtr);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,8 +133,7 @@ pump_up_preprocess (PELEMENT ElementPtr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
ElementPtr->next.image.frame = SetAbsFrameIndex (
|
ElementPtr->next.image.frame = SetAbsFrameIndex (
|
||||||
ElementPtr->current.image.frame, frame_index
|
ElementPtr->current.image.frame, frame_index);
|
||||||
);
|
|
||||||
|
|
||||||
ElementPtr->state_flags |= CHANGING;
|
ElementPtr->state_flags |= CHANGING;
|
||||||
}
|
}
|
||||||
@@ -178,10 +177,10 @@ pump_up_postprocess (PELEMENT ElementPtr)
|
|||||||
{
|
{
|
||||||
++EPtr->turn_wait;
|
++EPtr->turn_wait;
|
||||||
EPtr->current.image.frame = SetRelFrameIndex (
|
EPtr->current.image.frame = SetRelFrameIndex (
|
||||||
EPtr->current.image.frame, NUM_PUMP_ANIMS
|
EPtr->current.image.frame, NUM_PUMP_ANIMS);
|
||||||
);
|
|
||||||
ProcessSound (SetAbsSoundIndex (
|
ProcessSound (SetAbsSoundIndex (
|
||||||
StarShipPtr->RaceDescPtr->ship_data.ship_sounds, 2), EPtr);
|
StarShipPtr->RaceDescPtr->ship_data.ship_sounds, 2),
|
||||||
|
EPtr);
|
||||||
}
|
}
|
||||||
EPtr->thrust_wait = LEVEL_COUNTER;
|
EPtr->thrust_wait = LEVEL_COUNTER;
|
||||||
}
|
}
|
||||||
@@ -210,12 +209,10 @@ pump_up_postprocess (PELEMENT ElementPtr)
|
|||||||
}
|
}
|
||||||
|
|
||||||
EPtr->current.image.frame = SetAbsFrameIndex (
|
EPtr->current.image.frame = SetAbsFrameIndex (
|
||||||
EPtr->current.image.frame, frame_index
|
EPtr->current.image.frame, frame_index);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (StarShipPtr->cur_status_flags
|
if (StarShipPtr->cur_status_flags & StarShipPtr->old_status_flags
|
||||||
& StarShipPtr->old_status_flags
|
|
||||||
& WEAPON)
|
& WEAPON)
|
||||||
{
|
{
|
||||||
StarShipPtr->weapon_counter = WEAPON_WAIT;
|
StarShipPtr->weapon_counter = WEAPON_WAIT;
|
||||||
@@ -240,10 +237,8 @@ pump_up_postprocess (PELEMENT ElementPtr)
|
|||||||
UnlockElement (hPumpUp);
|
UnlockElement (hPumpUp);
|
||||||
PutElement (hPumpUp);
|
PutElement (hPumpUp);
|
||||||
|
|
||||||
SetPrimType (
|
SetPrimType (&(GLOBAL (DisplayArray))[ElementPtr->PrimIndex],
|
||||||
&(GLOBAL (DisplayArray))[ElementPtr->PrimIndex],
|
NO_PRIM);
|
||||||
NO_PRIM
|
|
||||||
);
|
|
||||||
ElementPtr->state_flags |= NONSOLID;
|
ElementPtr->state_flags |= NONSOLID;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -345,8 +340,7 @@ confuse_preprocess (PELEMENT ElementPtr)
|
|||||||
{
|
{
|
||||||
ElementPtr->next.image.frame = SetAbsFrameIndex (
|
ElementPtr->next.image.frame = SetAbsFrameIndex (
|
||||||
ElementPtr->current.image.frame,
|
ElementPtr->current.image.frame,
|
||||||
(GetFrameIndex (ElementPtr->current.image.frame) + 1) & 7
|
(GetFrameIndex (ElementPtr->current.image.frame) + 1) & 7);
|
||||||
);
|
|
||||||
ElementPtr->state_flags |= CHANGING;
|
ElementPtr->state_flags |= CHANGING;
|
||||||
}
|
}
|
||||||
else if (ElementPtr->hTarget == 0)
|
else if (ElementPtr->hTarget == 0)
|
||||||
@@ -388,10 +382,8 @@ confuse_preprocess (PELEMENT ElementPtr)
|
|||||||
eptr->life_span = 1;
|
eptr->life_span = 1;
|
||||||
eptr->current = eptr->next = ElementPtr->next;
|
eptr->current = eptr->next = ElementPtr->next;
|
||||||
eptr->preprocess_func = confuse_preprocess;
|
eptr->preprocess_func = confuse_preprocess;
|
||||||
SetPrimType (
|
SetPrimType (&(GLOBAL (DisplayArray))[eptr->PrimIndex],
|
||||||
&(GLOBAL (DisplayArray))[eptr->PrimIndex],
|
STAMP_PRIM);
|
||||||
STAMP_PRIM
|
|
||||||
);
|
|
||||||
|
|
||||||
GetElementStarShip (ElementPtr, &StarShipPtr);
|
GetElementStarShip (ElementPtr, &StarShipPtr);
|
||||||
SetElementStarShip (eptr, StarShipPtr);
|
SetElementStarShip (eptr, StarShipPtr);
|
||||||
|
|||||||
+11
-16
@@ -130,11 +130,8 @@ initialize_missile (PMISSILE_BLOCK pMissileBlock)
|
|||||||
}
|
}
|
||||||
|
|
||||||
HELEMENT
|
HELEMENT
|
||||||
weapon_collision (PELEMENT
|
weapon_collision (PELEMENT WeaponElementPtr, PPOINT pWPt,
|
||||||
WeaponElementPtr, PPOINT
|
PELEMENT HitElementPtr, PPOINT pHPt)
|
||||||
pWPt, PELEMENT
|
|
||||||
HitElementPtr, PPOINT
|
|
||||||
pHPt)
|
|
||||||
{
|
{
|
||||||
SIZE damage;
|
SIZE damage;
|
||||||
HELEMENT hBlastElement;
|
HELEMENT hBlastElement;
|
||||||
@@ -202,21 +199,19 @@ weapon_collision (PELEMENT
|
|||||||
if ((blast_offs = WeaponElementPtr->blast_offset) > 0)
|
if ((blast_offs = WeaponElementPtr->blast_offset) > 0)
|
||||||
{
|
{
|
||||||
BlastElementPtr->current.location.x +=
|
BlastElementPtr->current.location.x +=
|
||||||
COSINE (angle,
|
COSINE (angle, DISPLAY_TO_WORLD (blast_offs));
|
||||||
DISPLAY_TO_WORLD (blast_offs));
|
|
||||||
BlastElementPtr->current.location.y +=
|
BlastElementPtr->current.location.y +=
|
||||||
SINE (angle,
|
SINE (angle, DISPLAY_TO_WORLD (blast_offs));
|
||||||
DISPLAY_TO_WORLD (blast_offs));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
blast_index = NORMALIZE_FACING (
|
blast_index =
|
||||||
ANGLE_TO_FACING (angle + HALF_CIRCLE)
|
NORMALIZE_FACING (ANGLE_TO_FACING (angle + HALF_CIRCLE));
|
||||||
);
|
blast_index = ((blast_index >> 2) << 1) +
|
||||||
blast_index = ((blast_index >> 2) << 1) + (blast_index & 0x3 ? 1 : 0);
|
(blast_index & 0x3 ? 1 : 0);
|
||||||
|
|
||||||
if ((num_blast_frames =
|
num_blast_frames =
|
||||||
GetFrameCount (WeaponElementPtr->next.image.frame)) <=
|
GetFrameCount (WeaponElementPtr->next.image.frame);
|
||||||
ANGLE_TO_FACING (FULL_CIRCLE))
|
if (num_blast_frames <= ANGLE_TO_FACING (FULL_CIRCLE))
|
||||||
{
|
{
|
||||||
BlastElementPtr->life_span = 2;
|
BlastElementPtr->life_span = 2;
|
||||||
BlastElementPtr->current.image.farray = blast;
|
BlastElementPtr->current.image.farray = blast;
|
||||||
|
|||||||
Reference in New Issue
Block a user