Replaced extraction point with jumpgate.

This commit is contained in:
Steve 2016-03-07 17:12:21 +00:00
parent bd715286a1
commit bc1c5d09a8
27 changed files with 74 additions and 72 deletions

View File

@ -12,11 +12,12 @@ OBJS += ai.o
OBJS += battle.o bullets.o
OBJS += capitalShips.o challengeHome.o challenges.o cJSON.o controls.o
OBJS += debris.o dev.o draw.o
OBJS += effects.o entities.o extractionPoint.o
OBJS += effects.o entities.o
OBJS += fighters.o
OBJS += galacticMap.o game.o
OBJS += hud.o
OBJS += i18n.o init.o input.o io.o items.o
OBJS += jumpgate.o
OBJS += load.o locations.o lookup.o
OBJS += main.o messageBox.o mission.o missionInfo.o modalDialog.o
OBJS += objectives.o options.o

View File

@ -1,6 +1,6 @@
{
"name" : "Defend Extraction Point",
"description" : "Defend Extraction Point",
"name" : "Defend Jumpgate Point",
"description" : "Defend Jumpgate Point",
"background" : "AUTO",
"planet" : "AUTO",
"music" : "AUTO",
@ -41,12 +41,12 @@
"scatter" : 5000,
"number" : 12,
"flags" : "+EF_RETREATING",
"aiFlags" : "+AIF_GOAL_EXTRACTION+AIF_UNLIMITED_RANGE+AIF_DEFENSIVE+AIF_COVERS_RETREAT"
"aiFlags" : "+AIF_GOAL_JUMPGATE+AIF_UNLIMITED_RANGE+AIF_DEFENSIVE+AIF_COVERS_RETREAT"
}
],
"entities" : [
{
"type" : "ET_EXTRACTION_POINT",
"type" : "ET_JUMPGATE",
"x" : 25.1,
"y" : 25.1
}

View File

@ -7,5 +7,5 @@
"shieldRechargeRate" : 0,
"texture" : "gfx/craft/civilian01.png",
"flags" : "EF_MISSION_TARGET+EF_RETREATING+EF_TAKES_DAMAGE",
"aiFlags" : "AIF_GOAL_EXTRACTION+AIF_AVOIDS_COMBAT+AIF_FOLLOWS_PLAYER"
"aiFlags" : "AIF_GOAL_JUMPGATE+AIF_AVOIDS_COMBAT+AIF_FOLLOWS_PLAYER"
}

View File

@ -16,7 +16,7 @@
"targetType" : "TT_DESTROY"
},
{
"description" : "Retreat to extraction point",
"description" : "Retreat to jumpgate",
"targetName" : "Player",
"targetValue" : 1,
"targetType" : "TT_ESCAPED",
@ -70,8 +70,8 @@
],
"entities" : [
{
"name" : "Extraction Point",
"type" : "ET_EXTRACTION_POINT",
"name" : "Jumpgate",
"type" : "ET_JUMPGATE",
"x" : 25,
"y" : 25,
"active" : 0
@ -94,12 +94,12 @@
{
"function" : "ALLIES_KILLED 90",
"lines" : [
"MSG_BOX UNF Talos;All fighters, Captain Bailey has signalled the retreat. Coyote is lost. Fall back to the extraction point.",
"MSG_BOX UNF Talos;All fighters, Captain Bailey has signalled the retreat. Coyote is lost. Fall back to the jumpgate.",
"MSG_BOX de Winter;You all heard the Captain - fall back, we'll cover the retreat.",
"MSG_BOX Dodds;Estelle, we've got this. We can take them.",
"MSG_BOX de Winter;We're taking too many losses, Dodds. Fall back now, that's an order.",
"WAIT_MSG_BOX",
"ACTIVATE_ENTITIES Extraction Point",
"ACTIVATE_ENTITIES Jumpgate",
"RETREAT_ALLIES"
]
}

View File

@ -106,8 +106,8 @@
"active" : 0
},
{
"name" : "Extraction Point",
"type" : "ET_EXTRACTION_POINT",
"name" : "Jumpgate",
"type" : "ET_JUMPGATE",
"x" : 10,
"y" : 8,
"active" : 0
@ -153,7 +153,7 @@
"WAIT 2",
"MSG_BOX Tug;Tow cable attached. Ready to head home.",
"MSG_BOX Carr;We're done here. Let's bring our mystery guest in.",
"ACTIVATE_ENTITIES Extraction Point",
"ACTIVATE_ENTITIES Jumpgate",
"WAIT 20",
"ACTIVATE_ENTITIES Dart",
"ACTIVATE_OBJECTIVES Destroy intercepting Darts",

View File

@ -71,8 +71,8 @@
],
"entities" : [
{
"name" : "Extraction Point",
"type" : "ET_EXTRACTION_POINT",
"name" : "Jumpgate",
"type" : "ET_JUMPGATE",
"x" : 26,
"y" : 25
}

View File

@ -74,8 +74,8 @@
],
"entities" : [
{
"name" : "Extraction Point",
"type" : "ET_EXTRACTION_POINT",
"name" : "Jumpgate",
"type" : "ET_JUMPGATE",
"x" : 8,
"y" : 25
}
@ -84,7 +84,7 @@
{
"function" : "TIME 1",
"lines" : [
"MSG_BOX Strickland;This is a straight forward one, guys: take down all enemy targets. But make sure none of those Nymphs make it to the extraction point."
"MSG_BOX Strickland;This is a straight forward one, guys: take down all enemy targets. But make sure none of those Nymphs make it to the jumpgate ."
]
}
]

View File

@ -50,8 +50,8 @@
],
"entities" : [
{
"name" : "Extraction Point",
"type" : "ET_EXTRACTION_POINT",
"name" : "Jumpgate",
"type" : "ET_JUMPGATE",
"x" : 25,
"y" : 25
}
@ -60,7 +60,7 @@
{
"function" : "TIME 1",
"lines" : [
"MSG_BOX Control;ABCs, this is Control. Round up those civilians and escort them to the extraction point as quick as you can.",
"MSG_BOX Control;ABCs, this is Control. Round up those civilians and escort them to the jumpgate as quick as you can.",
"MSG_BOX Control;We're not expecting any opposition, but be prepared to engage hostiles if needed."
]
}

View File

@ -99,8 +99,8 @@
],
"entities" : [
{
"name" : "Extraction Point",
"type" : "ET_EXTRACTION_POINT",
"name" : "Jumpgate",
"type" : "ET_JUMPGATE",
"x" : 25,
"y" : 25
}

View File

@ -107,8 +107,8 @@
],
"entities" : [
{
"name" : "Extraction Point",
"type" : "ET_EXTRACTION_POINT",
"name" : "Jumpgate",
"type" : "ET_JUMPGATE",
"x" : 25,
"y" : 25
}

View File

@ -142,8 +142,8 @@
],
"entities" : [
{
"name" : "Extraction Point",
"type" : "ET_EXTRACTION_POINT",
"name" : "Jumpgate",
"type" : "ET_JUMPGATE",
"x" : 10,
"y" : 10
}
@ -177,7 +177,7 @@
"ACTIVATE_ENTITY_GROUPS Pandorans-1",
"ACTIVATE_OBJECTIVES Destroy Pandoran fighters",
"MSG_BOX Koonan;Enemy craft detected. Pandorans, in both INF and UNF fighters.",
"MSG_BOX de Winter;Chaz, you're with me. Wiley, you and your boys get those civilians to the extraction point."
"MSG_BOX de Winter;Chaz, you're with me. Wiley, you and your boys get those civilians to the jumpgate."
]
},
{

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

BIN
gfx/entities/jumpgate.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 214 KiB

View File

@ -33,8 +33,8 @@ static void fallback(void);
static void moveToPlayer(void);
static int canAttack(Entity *e);
static int selectWeapon(int type);
static int nearExtractionPoint(void);
static void moveToExtractionPoint(void);
static int nearJumpgate(void);
static void moveToJumpgate(void);
static int nearEnemies(void);
static int nearItems(void);
static void moveToItem(void);
@ -63,9 +63,9 @@ void doAI(void)
return;
}
if ((self->aiFlags & AIF_GOAL_EXTRACTION) && nearExtractionPoint())
if ((self->aiFlags & AIF_GOAL_JUMPGATE) && nearJumpgate())
{
/* near extraction point, but you might decide to continue to fight, anyway */
/* near jumpgate point, but you might decide to continue to fight, anyway */
if ((self->aiFlags & AIF_COVERS_RETREAT) && rand() % 3)
{
return;
@ -534,7 +534,7 @@ static int isRetreating(void)
self->aiFlags |= AIF_AVOIDS_COMBAT;
self->aiFlags |= AIF_UNLIMITED_RANGE;
self->aiFlags |= AIF_GOAL_EXTRACTION;
self->aiFlags |= AIF_GOAL_JUMPGATE;
addHudMessage(colors.red, _("%s is retreating!"), self->name);
@ -627,20 +627,20 @@ static void moveToPlayer(void)
}
}
static int nearExtractionPoint(void)
static int nearJumpgate(void)
{
int dist;
self->target = NULL;
if (battle.extractionPoint)
if (battle.jumpgate)
{
dist = getDistance(self->x, self->y, battle.extractionPoint->x, battle.extractionPoint->y);
dist = getDistance(self->x, self->y, battle.jumpgate->x, battle.jumpgate->y);
if (dist <= 2000 || self->aiFlags & AIF_UNLIMITED_RANGE)
{
self->target = battle.extractionPoint;
self->action = moveToExtractionPoint;
self->target = battle.jumpgate;
self->action = moveToJumpgate;
self->aiActionTime = (!self->towing) ? FPS / 2 : FPS * 2;
}
}
@ -648,7 +648,7 @@ static int nearExtractionPoint(void)
return self->target != NULL;
}
static void moveToExtractionPoint(void)
static void moveToJumpgate(void)
{
faceTarget(self->target);

View File

@ -537,15 +537,15 @@ void updateCapitalShipComponentProperties(Entity *parent)
switch (e->type)
{
case ET_CAPITAL_SHIP_ENGINE:
sprintf(e->name, "%s (Engine)", parent->name);
sprintf(e->name, _("%s (Engine)"), parent->name);
break;
case ET_CAPITAL_SHIP_COMPONENT:
sprintf(e->name, "%s (Component)", parent->name);
sprintf(e->name, _("%s (Component)"), parent->name);
break;
case ET_CAPITAL_SHIP_GUN:
sprintf(e->name, "%s (Gun)", parent->name);
sprintf(e->name, _("%s (Gun)"), parent->name);
break;
}

View File

@ -47,6 +47,7 @@ extern void runScriptFunction(char *format, ...);
extern void updateObjective(char *name, int type);
extern char **getFileList(char *dir, int *count);
extern int getJSONValue(cJSON *node, char *name, int defValue);
extern char *getTranslatedString(char *string);
extern Battle battle;
extern Entity *self;

View File

@ -585,7 +585,7 @@ void retreatAllies(void)
e->aiFlags |= AIF_AVOIDS_COMBAT;
e->aiFlags |= AIF_UNLIMITED_RANGE;
e->aiFlags |= AIF_GOAL_EXTRACTION;
e->aiFlags |= AIF_GOAL_JUMPGATE;
e->aiFlags &= ~AIF_FOLLOWS_PLAYER;
e->aiFlags &= ~AIF_MOVES_TO_PLAYER;
}

View File

@ -326,7 +326,7 @@ static void drawPlayerTargeter(void)
float angle;
int x, y;
if (player->target || battle.missionTarget || battle.extractionPoint)
if (player->target || battle.missionTarget || battle.jumpgate)
{
if (player->target)
{
@ -372,9 +372,9 @@ static void drawPlayerTargeter(void)
blitRotated(targetPointer, x - battle.camera.x, y - battle.camera.y, angle);
}
if (battle.extractionPoint)
if (battle.jumpgate)
{
angle = getAngle(player->x, player->y, battle.extractionPoint->x, battle.extractionPoint->y);
angle = getAngle(player->x, player->y, battle.jumpgate->x, battle.jumpgate->y);
x = player->x;
y = player->y;
@ -467,11 +467,11 @@ static void drawDistancesInfo(void)
y += 25;
}
if (battle.extractionPoint != NULL)
if (battle.jumpgate != NULL)
{
distance = distanceToKM(player->x, player->y, battle.extractionPoint->x, battle.extractionPoint->y);
distance = distanceToKM(player->x, player->y, battle.jumpgate->x, battle.jumpgate->y);
drawText(SCREEN_WIDTH - 15, y, 14, TA_RIGHT, colors.yellow, _("Extraction Point: %.2fkm"), distance);
drawText(SCREEN_WIDTH - 15, y, 14, TA_RIGHT, colors.yellow, _("Jumpgate: %.2fkm"), distance);
y += 25;
}

View File

@ -18,30 +18,30 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*/
#include "extractionPoint.h"
#include "jumpgate.h"
static void think(void);
static void handleFleeingEntities(void);
static void addEscapeEffect(Entity *ent);
Entity *spawnExtractionPoint(void)
Entity *spawnJumpgate(void)
{
Entity *extractionPoint = spawnEntity();
Entity *jumpgate = spawnEntity();
extractionPoint->type = ET_EXTRACTION_POINT;
extractionPoint->health = extractionPoint->maxHealth = FPS;
extractionPoint->texture = getTexture("gfx/entities/extractionPoint.png");
extractionPoint->action = think;
extractionPoint->flags |= EF_NO_MT_BOX;
jumpgate->type = ET_JUMPGATE;
jumpgate->health = jumpgate->maxHealth = FPS;
jumpgate->texture = getTexture("gfx/entities/jumpgate.png");
jumpgate->action = think;
jumpgate->flags |= EF_NO_MT_BOX;
return extractionPoint;
return jumpgate;
}
static void think(void)
{
self->thinkTime = 4;
self->angle++;
self->angle += 0.1;
if (self->angle >= 360)
{
self->angle -= 360;
@ -49,7 +49,7 @@ static void think(void)
handleFleeingEntities();
battle.extractionPoint = self;
battle.jumpgate = self;
}
static void handleFleeingEntities(void)

View File

@ -174,7 +174,7 @@ static void drawChallenges(void)
{
y+= 50;
drawText(SCREEN_WIDTH / 2, y, 20, TA_CENTER, colors.white, "Time Limit: %s", timeToString(game.currentMission->challengeData.timeLimit, 0));
drawText(SCREEN_WIDTH / 2, y, 20, TA_CENTER, colors.white, _("Time Limit: %s"), timeToString(game.currentMission->challengeData.timeLimit, 0));
}
y += 25;

View File

@ -40,7 +40,7 @@ void attachRope(void)
self->towing = e;
e->owner = self;
self->aiFlags |= AIF_GOAL_EXTRACTION;
self->aiFlags |= AIF_GOAL_JUMPGATE;
e->flags |= EF_RETREATING;
@ -98,7 +98,7 @@ void cutRope(Entity *e)
if (e->owner && e->owner->towing == e)
{
e->owner->towing = NULL;
e->owner->aiFlags &= ~AIF_GOAL_EXTRACTION;
e->owner->aiFlags &= ~AIF_GOAL_JUMPGATE;
e->owner = NULL;
}
}

View File

@ -102,7 +102,7 @@ Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#define AIF_COLLECTS_ITEMS (2 << 3)
#define AIF_TOWS (2 << 4)
#define AIF_RETREATS (2 << 5)
#define AIF_GOAL_EXTRACTION (2 << 6)
#define AIF_GOAL_JUMPGATE (2 << 6)
#define AIF_AVOIDS_COMBAT (2 << 7)
#define AIF_DEFENSIVE (2 << 8)
#define AIF_MISSILE_BOAT (2 << 9)
@ -146,7 +146,7 @@ enum
ET_FIGHTER,
ET_ITEM,
ET_WAYPOINT,
ET_EXTRACTION_POINT,
ET_JUMPGATE,
ET_CAPITAL_SHIP_GUN,
ET_CAPITAL_SHIP_COMPONENT,
ET_CAPITAL_SHIP_ENGINE,

View File

@ -589,8 +589,8 @@ static void loadEntities(cJSON *node)
e = spawnWaypoint();
break;
case ET_EXTRACTION_POINT:
e = spawnExtractionPoint();
case ET_JUMPGATE:
e = spawnJumpgate();
break;
default:

View File

@ -37,7 +37,7 @@ extern long flagsToLong(char *flags, int *add);
extern Entity *spawnWaypoint(void);
extern void activateNextWaypoint(void);
extern void selectWidget(const char *name, const char *group);
extern Entity *spawnExtractionPoint(void);
extern Entity *spawnJumpgate(void);
extern Entity *spawnItem(char *type);
extern void failIncompleteObjectives(void);
extern void completeConditions(void);

View File

@ -320,7 +320,7 @@ typedef struct {
int numPlayerGuns;
int numObjectivesComplete, numObjectivesTotal;
Entity *missionTarget;
Entity *extractionPoint;
Entity *jumpgate;
SDL_Texture *background, *planetTexture;
PointF planet;
int planetWidth, planetHeight;

View File

@ -43,7 +43,7 @@ void initLookups(void)
addLookup("CONTROL_PREV_FIGHTER", CONTROL_PREV_FIGHTER);
addLookup("ET_WAYPOINT", ET_WAYPOINT);
addLookup("ET_EXTRACTION_POINT", ET_EXTRACTION_POINT);
addLookup("ET_JUMPGATE", ET_JUMPGATE);
addLookup("ET_CAPITAL_SHIP", ET_CAPITAL_SHIP);
addLookup("EF_NO_KILL", EF_NO_KILL);
@ -68,7 +68,7 @@ void initLookups(void)
addLookup("AIF_COLLECTS_ITEMS", AIF_COLLECTS_ITEMS);
addLookup("AIF_TOWS", AIF_TOWS);
addLookup("AIF_RETREATS", AIF_RETREATS);
addLookup("AIF_GOAL_EXTRACTION", AIF_GOAL_EXTRACTION);
addLookup("AIF_GOAL_JUMPGATE", AIF_GOAL_JUMPGATE);
addLookup("AIF_AVOIDS_COMBAT", AIF_AVOIDS_COMBAT);
addLookup("AIF_DEFENSIVE", AIF_DEFENSIVE);
addLookup("AIF_MISSILE_BOAT", AIF_MISSILE_BOAT);