Re-implemented a targeting system similar to the original for Classic.
It's not exactly the same technically, but in function it is. The only functional difference is that the original would sometimes show an unexpected health bar for a small(ish) enemy, whereas the new implementation never does that. Also different is that exact location is still shown. Will fix that next.
This commit is contained in:
parent
ac44cbdf75
commit
e86e5210df
12
README.txt
12
README.txt
|
@ -53,13 +53,11 @@ of the game (the last version released by Parallel Realities) as closely
|
||||||
as possible. However, there are a few minor differences in addition to
|
as possible. However, there are a few minor differences in addition to
|
||||||
the changes to graphics, sound, and dialog:
|
the changes to graphics, sound, and dialog:
|
||||||
|
|
||||||
* Where targets are is shown via arrows at the edge of the screen, and
|
* The current target is shown by an arrow at the edge of the screen which
|
||||||
all targets are indicated in this way; the main target is indicated
|
precisely indicates the target's position. In contrast, version 1.1's
|
||||||
with text that says "Target", unless the target is one of the cast of
|
optional target arrow rested in the middle of the screen and only
|
||||||
named characters, and all named characters have their arrows indicated
|
pointed in the general direction (north, south, east, west, northwest,
|
||||||
with their respective arrows. In contrast, version 1.1 only had an
|
northeast, southwest, southeast) of the target.
|
||||||
optional arrow that rested in the middle of the screen and pointed in
|
|
||||||
the general direction of the active (main) target.
|
|
||||||
|
|
||||||
* Selling your secondary weapon leaves you with standard Rockets. In
|
* Selling your secondary weapon leaves you with standard Rockets. In
|
||||||
version 1.1, it instead left you with no secondary weapon at all (with
|
version 1.1, it instead left you with no secondary weapon at all (with
|
||||||
|
|
29
src/game.c
29
src/game.c
|
@ -1774,10 +1774,12 @@ static void game_doArrow(int i)
|
||||||
|
|
||||||
static void game_doHud()
|
static void game_doHud()
|
||||||
{
|
{
|
||||||
|
static int last_arrow = -1;
|
||||||
int shieldColor = 0;
|
int shieldColor = 0;
|
||||||
SDL_Rect bar;
|
SDL_Rect bar;
|
||||||
int fontColor;
|
int fontColor;
|
||||||
char text[25];
|
char text[25];
|
||||||
|
int i;
|
||||||
|
|
||||||
screen_addBuffer(0, 20, screen->w, 25);
|
screen_addBuffer(0, 20, screen->w, 25);
|
||||||
screen_addBuffer(0, screen->h - 50, screen->w, 34);
|
screen_addBuffer(0, screen->h - 50, screen->w, 34);
|
||||||
|
@ -1809,8 +1811,31 @@ static void game_doHud()
|
||||||
gfx_createTextObject(TS_CASH, text, 90, 21, FONT_WHITE);
|
gfx_createTextObject(TS_CASH, text, 90, 21, FONT_WHITE);
|
||||||
screen_blitText(TS_CASH);
|
screen_blitText(TS_CASH);
|
||||||
|
|
||||||
for (int i = 0; i < ALIEN_MAX; i++)
|
if (game.difficulty == DIFFICULTY_ORIGINAL)
|
||||||
game_doArrow(i);
|
{
|
||||||
|
i = engine.targetIndex;
|
||||||
|
if ((i >= 0) && aliens[i].active && (aliens[i].shield > 0) && (!(aliens[i].flags & FL_ISCLOAKED)))
|
||||||
|
game_doArrow(i);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
i = last_arrow;
|
||||||
|
if ((i >= 0) && aliens[i].active && (aliens[i].shield > 0) && (!(aliens[i].flags & FL_ISCLOAKED)))
|
||||||
|
game_doArrow(i);
|
||||||
|
else
|
||||||
|
{
|
||||||
|
last_arrow = rand() % ALIEN_MAX;
|
||||||
|
if (aliens[last_arrow].flags & FL_FRIEND)
|
||||||
|
last_arrow = 0;
|
||||||
|
|
||||||
|
game_doArrow(last_arrow);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
for (i = 0; i < ALIEN_MAX; i++)
|
||||||
|
game_doArrow(i);
|
||||||
|
}
|
||||||
|
|
||||||
fontColor = FONT_WHITE;
|
fontColor = FONT_WHITE;
|
||||||
if (player.ammo[0] > 0)
|
if (player.ammo[0] > 0)
|
||||||
|
|
Loading…
Reference in New Issue