Removed missiles types. Now only homing missiles, and rockets for bombers.
This commit is contained in:
parent
94e0259953
commit
597f6f5cb7
|
@ -59,8 +59,5 @@
|
|||
"y" : 0
|
||||
}
|
||||
],
|
||||
"missiles" : {
|
||||
"type" : "MISSILE_MISSILE",
|
||||
"ammo" : 4
|
||||
}
|
||||
"missiles" : 4
|
||||
}
|
||||
|
|
|
@ -18,8 +18,5 @@
|
|||
"y" : 0
|
||||
}
|
||||
],
|
||||
"missiles" : {
|
||||
"type" : "MISSILE_MISSILE",
|
||||
"ammo" : 2
|
||||
}
|
||||
"missiles" : 2
|
||||
}
|
||||
|
|
|
@ -24,8 +24,5 @@
|
|||
}
|
||||
],
|
||||
"combinedGuns" : 1,
|
||||
"missiles" : {
|
||||
"type" : "MISSILE_MISSILE",
|
||||
"ammo" : 3
|
||||
}
|
||||
"missiles" : 3
|
||||
}
|
||||
|
|
|
@ -16,11 +16,13 @@
|
|||
"type" : "BT_PLASMA",
|
||||
"x" : 12,
|
||||
"y" : 0
|
||||
},
|
||||
{
|
||||
"type" : "BT_ROCKET",
|
||||
"x" : 0,
|
||||
"y" : 0
|
||||
}
|
||||
],
|
||||
"missiles" : {
|
||||
"type" : "MISSILE_MISSILE",
|
||||
"ammo" : 60
|
||||
},
|
||||
"missiles" : 6,
|
||||
"aiFlags" : "AIF_MISSILE_BOAT+AIF_DEFENSIVE"
|
||||
}
|
||||
|
|
|
@ -28,8 +28,5 @@
|
|||
"y" : -12
|
||||
}
|
||||
],
|
||||
"missiles" : {
|
||||
"type" : "MISSILE_MISSILE",
|
||||
"ammo" : 4
|
||||
}
|
||||
"missiles" : 4
|
||||
}
|
||||
|
|
|
@ -28,8 +28,5 @@
|
|||
"y" : -12
|
||||
}
|
||||
],
|
||||
"missiles" : {
|
||||
"type" : "MISSILE_MISSILE",
|
||||
"ammo" : 4
|
||||
}
|
||||
"missiles" : 4
|
||||
}
|
||||
|
|
|
@ -18,8 +18,5 @@
|
|||
"y" : 0
|
||||
}
|
||||
],
|
||||
"missiles" : {
|
||||
"type" : "MISSILE_MISSILE",
|
||||
"ammo" : 3
|
||||
}
|
||||
"missiles" : 3
|
||||
}
|
||||
|
|
|
@ -21,11 +21,13 @@
|
|||
"type" : "BT_PLASMA",
|
||||
"x" : 0,
|
||||
"y" : 0
|
||||
},
|
||||
{
|
||||
"type" : "BT_ROCKET",
|
||||
"x" : 0,
|
||||
"y" : 0
|
||||
}
|
||||
],
|
||||
"missiles" : {
|
||||
"type" : "MISSILE_MISSILE",
|
||||
"ammo" : 80
|
||||
},
|
||||
"missiles" : 8,
|
||||
"aiFlags" : "AIF_MISSILE_BOAT+AIF_DEFENSIVE"
|
||||
}
|
||||
|
|
|
@ -28,8 +28,5 @@
|
|||
"y" : -12
|
||||
}
|
||||
],
|
||||
"missiles" : {
|
||||
"type" : "MISSILE_MISSILE",
|
||||
"ammo" : 4
|
||||
}
|
||||
"missiles" : 4
|
||||
}
|
||||
|
|
|
@ -23,8 +23,5 @@
|
|||
"y" : -16
|
||||
}
|
||||
],
|
||||
"missiles" : {
|
||||
"type" : "MISSILE_MISSILE",
|
||||
"ammo" : 3
|
||||
}
|
||||
"missiles" : 3
|
||||
}
|
||||
|
|
|
@ -29,8 +29,5 @@
|
|||
}
|
||||
],
|
||||
"combinedGuns" : 1,
|
||||
"missiles" : {
|
||||
"type" : "MISSILE_MISSILE",
|
||||
"ammo" : 6
|
||||
}
|
||||
"missiles" : 6
|
||||
}
|
||||
|
|
|
@ -18,8 +18,5 @@
|
|||
"y" : -2
|
||||
}
|
||||
],
|
||||
"missiles" : {
|
||||
"type" : "MISSILE_MISSILE",
|
||||
"ammo" : 3
|
||||
}
|
||||
"missiles" : 3
|
||||
}
|
||||
|
|
|
@ -28,8 +28,5 @@
|
|||
"y" : -12
|
||||
}
|
||||
],
|
||||
"missiles" : {
|
||||
"type" : "MISSILE_MISSILE",
|
||||
"ammo" : 4
|
||||
}
|
||||
"missiles" : 4
|
||||
}
|
||||
|
|
|
@ -28,8 +28,5 @@
|
|||
"y" : 0
|
||||
}
|
||||
],
|
||||
"missiles" : {
|
||||
"type" : "MISSILE_MISSILE",
|
||||
"ammo" : 4
|
||||
}
|
||||
"missiles" : 4
|
||||
}
|
||||
|
|
|
@ -23,9 +23,6 @@
|
|||
"y" : 0
|
||||
}
|
||||
],
|
||||
"missiles" : {
|
||||
"type" : "MISSILE_MISSILE",
|
||||
"ammo" : 8
|
||||
},
|
||||
"missiles" : 8,
|
||||
"aiFlags" : "AIF_MISSILE_BOAT+AIF_DEFENSIVE"
|
||||
}
|
||||
|
|
|
@ -18,8 +18,5 @@
|
|||
"y" : 0
|
||||
}
|
||||
],
|
||||
"missiles" : {
|
||||
"type" : "MISSILE_MISSILE",
|
||||
"ammo" : 2
|
||||
}
|
||||
"missiles" : 2
|
||||
}
|
||||
|
|
|
@ -28,8 +28,5 @@
|
|||
"y" : 0
|
||||
}
|
||||
],
|
||||
"missiles" : {
|
||||
"type" : "MISSILE_MISSILE",
|
||||
"ammo" : 2
|
||||
}
|
||||
"missiles" : 2
|
||||
}
|
||||
|
|
|
@ -18,8 +18,5 @@
|
|||
"y" : -12
|
||||
}
|
||||
],
|
||||
"missiles" : {
|
||||
"type" : "MISSILE_MISSILE",
|
||||
"ammo" : 4
|
||||
}
|
||||
"missiles" : 4
|
||||
}
|
||||
|
|
|
@ -34,8 +34,5 @@
|
|||
}
|
||||
],
|
||||
"combinedGuns" : 1,
|
||||
"missiles" : {
|
||||
"type" : "MISSILE_MISSILE",
|
||||
"ammo" : 4
|
||||
}
|
||||
"missiles" : 4
|
||||
}
|
||||
|
|
|
@ -375,11 +375,11 @@ static void preAttack(void)
|
|||
/* force weapon selection, otherwise we'll keep using lasers / mag */
|
||||
canAttack(self->target);
|
||||
|
||||
if (self->guns[0].type && (self->missiles.ammo == 0 || rand() % 50 > 0))
|
||||
if (self->guns[0].type && (self->missiles == 0 || rand() % 50 > 0))
|
||||
{
|
||||
fireGuns(self);
|
||||
}
|
||||
else if (self->missiles.ammo)
|
||||
else if (self->missiles)
|
||||
{
|
||||
fireMissile(self);
|
||||
}
|
||||
|
|
|
@ -73,7 +73,11 @@ void doBullets(void)
|
|||
b->x += b->dx;
|
||||
b->y += b->dy;
|
||||
|
||||
if (b->type == BT_MISSILE)
|
||||
if (b->type == BT_ROCKET)
|
||||
{
|
||||
addMissileEngineEffect(b);
|
||||
}
|
||||
else if (b->type == BT_MISSILE)
|
||||
{
|
||||
addMissileEngineEffect(b);
|
||||
|
||||
|
@ -315,15 +319,24 @@ void fireGuns(Entity *owner)
|
|||
playBattleSound(b->sound, owner->x, owner->y);
|
||||
}
|
||||
|
||||
void fireRocket(Entity *owner)
|
||||
{
|
||||
Bullet *b;
|
||||
|
||||
b = createBullet(BT_ROCKET, owner->x, owner->y, owner);
|
||||
|
||||
playBattleSound(b->sound, owner->x, owner->y);
|
||||
}
|
||||
|
||||
void fireMissile(Entity *owner)
|
||||
{
|
||||
Bullet *b;
|
||||
|
||||
b = createBullet(BT_ROCKET + owner->missiles.type, owner->x, owner->y, owner);
|
||||
b = createBullet(BT_MISSILE, owner->x, owner->y, owner);
|
||||
|
||||
b->life = FPS * 30;
|
||||
|
||||
owner->missiles.ammo--;
|
||||
owner->missiles--;
|
||||
|
||||
if (owner == player)
|
||||
{
|
||||
|
|
|
@ -116,7 +116,7 @@ static void randomizeDart(Entity *dart)
|
|||
|
||||
randomizeDartGuns(dart);
|
||||
|
||||
dart->missiles.ammo = rand() % 3;
|
||||
dart->missiles = rand() % 3;
|
||||
|
||||
sprintf(textureName, "gfx/fighters/dart0%d.png", 1 + rand() % 7);
|
||||
|
||||
|
@ -666,10 +666,7 @@ static void loadFighterDef(char *filename)
|
|||
|
||||
if (cJSON_GetObjectItem(root, "missiles"))
|
||||
{
|
||||
node = cJSON_GetObjectItem(root, "missiles");
|
||||
|
||||
f->missiles.type = lookup(cJSON_GetObjectItem(node, "type")->valuestring);
|
||||
f->missiles.ammo = f->missiles.maxAmmo = cJSON_GetObjectItem(node, "ammo")->valueint;
|
||||
f->missiles = cJSON_GetObjectItem(root, "missiles")->valueint;
|
||||
}
|
||||
|
||||
if (cJSON_GetObjectItem(root, "flags"))
|
||||
|
|
|
@ -259,7 +259,7 @@ static void drawBoostECMBar(int current, int max, int x, int y, int r, int g, in
|
|||
static void drawWeaponInfo(void)
|
||||
{
|
||||
drawText(10, 70, 14, TA_LEFT, colors.white, (player->selectedGunType != -1) ? gunName[player->selectedGunType] : "(None)");
|
||||
drawText(260, 70, 14, TA_RIGHT, colors.white, "Missiles (%d)", player->missiles.ammo);
|
||||
drawText(260, 70, 14, TA_RIGHT, colors.white, "Missiles (%d)", player->missiles);
|
||||
}
|
||||
|
||||
static void drawPlayerTargeter(void)
|
||||
|
|
|
@ -113,7 +113,7 @@ void doPlayer(void)
|
|||
app.keyboard[SDL_SCANCODE_LSHIFT] = 0;
|
||||
}
|
||||
|
||||
if (app.keyboard[SDL_SCANCODE_RETURN] && player->missiles.ammo && player->target)
|
||||
if (app.keyboard[SDL_SCANCODE_RETURN] && player->missiles && player->target)
|
||||
{
|
||||
if (getDistance(player->x, player->y, player->target->x, player->target->y) <= SCREEN_WIDTH)
|
||||
{
|
||||
|
|
|
@ -140,14 +140,6 @@ enum
|
|||
BT_MAX
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
MISSILE_ROCKET,
|
||||
MISSILE_MISSILE,
|
||||
MISSILE_FF,
|
||||
MISSILE_MAX
|
||||
};
|
||||
|
||||
enum
|
||||
{
|
||||
EFFECT_LINE,
|
||||
|
|
|
@ -106,7 +106,7 @@ struct Entity {
|
|||
int aiAggression;
|
||||
int separationRadius;
|
||||
Weapon guns[MAX_FIGHTER_GUNS];
|
||||
Weapon missiles;
|
||||
int missiles;
|
||||
long flags;
|
||||
long aiFlags;
|
||||
SDL_Point targetLocation;
|
||||
|
|
|
@ -90,10 +90,6 @@ void initLookups(void)
|
|||
addLookup("BF_SHIELD_DAMAGE", BF_SHIELD_DAMAGE);
|
||||
addLookup("BF_EXPLODES", BF_EXPLODES);
|
||||
|
||||
addLookup("MISSILE_ROCKET", MISSILE_ROCKET);
|
||||
addLookup("MISSILE_MISSILE", MISSILE_MISSILE);
|
||||
addLookup("MISSILE_FF", MISSILE_FF);
|
||||
|
||||
addLookup("CHALLENGE_ARMOUR", CHALLENGE_ARMOUR);
|
||||
addLookup("CHALLENGE_TIME", CHALLENGE_TIME);
|
||||
addLookup("CHALLENGE_ACCURACY", CHALLENGE_ACCURACY);
|
||||
|
|
Loading…
Reference in New Issue