[Add] Escorts kinda work.
125
dat/outfit.xml
@ -531,5 +531,130 @@
|
|||||||
<speed>1000</speed>
|
<speed>1000</speed>
|
||||||
<damage type="kinetic">35</damage>
|
<damage type="kinetic">35</damage>
|
||||||
</specific>
|
</specific>
|
||||||
|
</outfit>
|
||||||
|
<outfit name="Plasteel Plating">
|
||||||
|
<general>
|
||||||
|
<max>1</max>
|
||||||
|
<tech>6</tech>
|
||||||
|
<mass>15</mass>
|
||||||
|
<price>65000</price>
|
||||||
|
<gfx_store>plasteel</gfx_store>
|
||||||
|
<description>Plasteel was one of man's greatest improvements on materials. It's a cheap, very strong armour that seems to take the best from both the plastic and steel. You can bend it relatively easily while keeping it's incredible strength. The Second Growth was only possible with this amazing new material.
|
||||||
|
By adding quite a dense layer of Plasteel to your ship you can increase it's sturdiness by a lot. Although with the advent of even newer materials Plasteel is starting to fade in popularity, although it's lower price tag always seems to keep a loyal customer base.</description>
|
||||||
|
</general>
|
||||||
|
<specific type="modification">
|
||||||
|
<armour>35</armour>
|
||||||
|
</specific>
|
||||||
|
</outfit>
|
||||||
|
<outfit name="Nanobond Plating">
|
||||||
|
<general>
|
||||||
|
<max>1</max>
|
||||||
|
<tech>9</tech>
|
||||||
|
<mass>35</mass>
|
||||||
|
<price>365000</price>
|
||||||
|
<gfx_store>nanobond</gfx_store>
|
||||||
|
<description>Nanobond is the succesor to Plasteel. It follows the same approach but has a much more refined manufacturing process with much more control on the small scale. The result is a much more robust and dense material although much more expensive.</description>
|
||||||
|
</general>
|
||||||
|
<specific type="modification">
|
||||||
|
<armour>120</armour>
|
||||||
|
</specific>
|
||||||
|
</outfit>
|
||||||
|
<outfit name="Biometal Armour">
|
||||||
|
<general>
|
||||||
|
<max>1</max>
|
||||||
|
<tech>15</tech>
|
||||||
|
<mass>57</mass>
|
||||||
|
<price>1120000</price>
|
||||||
|
<gfx_store>biometal</gfx_store>
|
||||||
|
<description>Biometal is a metal armour that will actually regenerate itself thanks to some special bacteria it uses. The downside is that this makes it much bulkier and expensive then just using more refined Nanobond. The results are pretty formidable, but it's hard to equip such an armour on anything short of a Destroyer.</description>
|
||||||
|
</general>
|
||||||
|
<specific type="modification">
|
||||||
|
<armour>150</armour>
|
||||||
|
<armour_regen>60</armour_regen>
|
||||||
|
</specific>
|
||||||
|
</outfit>
|
||||||
|
<outfit name="Droid Repair Crew">
|
||||||
|
<general>
|
||||||
|
<max>3</max>
|
||||||
|
<tech>11</tech>
|
||||||
|
<mass>3</mass>
|
||||||
|
<price>430000</price>
|
||||||
|
<gfx_store>droid</gfx_store>
|
||||||
|
<description>The low maintenance droid crew will scour your ship to repair any damages caused by space hazards. They are very small and able to work both on interior or exterior of the ship. Power is drawn from the ship to feed the robots, although the load is generally very low compared to the benefits of having a robotic repair crew.</description>
|
||||||
|
</general>
|
||||||
|
<specific type="modification">
|
||||||
|
<armour_regen>30</armour_regen>
|
||||||
|
<energy>-5</energy>
|
||||||
|
<energy_regen>-40</energy_regen>
|
||||||
|
</specific>
|
||||||
|
</outfit>
|
||||||
|
<outfit name="Reactor Class I">
|
||||||
|
<general>
|
||||||
|
<max>1</max>
|
||||||
|
<tech>9</tech>
|
||||||
|
<mass>12</mass>
|
||||||
|
<price>170000</price>
|
||||||
|
<gfx_store>reactor_i</gfx_store>
|
||||||
|
<description>Adding a complementary reactor to your ship is a great way to get that extra energy boost you need. This do not replace the existing reactor but work alongside it and hook up directly to the energy flux.</description>
|
||||||
|
</general>
|
||||||
|
<specific type="modification">
|
||||||
|
<energy>20</energy>
|
||||||
|
<energy_regen>330</energy_regen>
|
||||||
|
</specific>
|
||||||
|
</outfit>
|
||||||
|
<outfit name="Reactor Class II">
|
||||||
|
<general>
|
||||||
|
<max>1</max>
|
||||||
|
<tech>12</tech>
|
||||||
|
<mass>23</mass>
|
||||||
|
<price>530000</price>
|
||||||
|
<gfx_store>reactor_ii</gfx_store>
|
||||||
|
<description>The class II reactor takes a different approach to energy creation then the class I reactor. The new fusion design allows it to have a higher energy output, but is deemed unstable at bigger loads. The result is a medium sized reactor that can't really suit the needs of the bigger warships.</description>
|
||||||
|
</general>
|
||||||
|
<specific type="modification">
|
||||||
|
<energy>60</energy>
|
||||||
|
<energy_regen>720</energy_regen>
|
||||||
|
</specific>
|
||||||
|
</outfit>
|
||||||
|
<outfit name="Reactor Class III">
|
||||||
|
<general>
|
||||||
|
<max>1</max>
|
||||||
|
<tech>12</tech>
|
||||||
|
<mass>46</mass>
|
||||||
|
<price>970000</price>
|
||||||
|
<gfx_store>reactor_iii</gfx_store>
|
||||||
|
<description>The class III reactor pretty much makes all your energy worries negligable. It follows the traditional fusion approach of the class I reactor, only making it much bigger. The size increase makes it only fit comfortably on large vessels, but the energy output is also suited for those.</description>
|
||||||
|
</general>
|
||||||
|
<specific type="modification">
|
||||||
|
<energy>100</energy>
|
||||||
|
<energy_regen>1620</energy_regen>
|
||||||
|
</specific>
|
||||||
|
</outfit>
|
||||||
|
<outfit name="Lancelot Fighter Bay">
|
||||||
|
<general>
|
||||||
|
<max>1</max>
|
||||||
|
<tech>14</tech>
|
||||||
|
<mass>80</mass>
|
||||||
|
<price>830000</price>
|
||||||
|
<gfx_store>lancelot_fighter</gfx_store>
|
||||||
|
<description>This fighter bay allows your ship to carry a pair of Lancelot class Fighters. It comes with all the devices required for the maintenance and flight of the fighters.</description>
|
||||||
|
</general>
|
||||||
|
<specific type="fighter bay" secondary="1">
|
||||||
|
<ammo>Lancelot Fighter</ammo>
|
||||||
|
<delay>4000</delay>
|
||||||
|
</specific>
|
||||||
|
</outfit>
|
||||||
|
<outfit name="Lancelot Fighter">
|
||||||
|
<general>
|
||||||
|
<max>2</max>
|
||||||
|
<tech>12</tech>
|
||||||
|
<mass>0</mass>
|
||||||
|
<price>500000</price>
|
||||||
|
<gfx_store>lancelot_fighter</gfx_store>
|
||||||
|
<description>This is a Lancelot class Fighter adapted for usage in the Lancelot Fighter Bay. It contains all the features of the standalone Lancelot with improved encrypted communication.</description>
|
||||||
|
</general>
|
||||||
|
<specific type="fighter">
|
||||||
|
<ship>Lancelot</ship>
|
||||||
|
</specific>
|
||||||
</outfit>
|
</outfit>
|
||||||
</Outfits>
|
</Outfits>
|
||||||
|
@ -238,6 +238,8 @@
|
|||||||
<cap_cargo>10</cap_cargo>
|
<cap_cargo>10</cap_cargo>
|
||||||
</characteristics>
|
</characteristics>
|
||||||
<outfits>
|
<outfits>
|
||||||
|
<outfit quantity="1">Lancelot Fighter Bay</outfit>
|
||||||
|
<outfit quantity="2">Lancelot Fighter</outfit>
|
||||||
<outfit quantity="2">Ripper MK2</outfit>
|
<outfit quantity="2">Ripper MK2</outfit>
|
||||||
<outfit quantity="2">Ragnarok Beam</outfit>
|
<outfit quantity="2">Ragnarok Beam</outfit>
|
||||||
<outfit quantity="2">Orion Beam</outfit>
|
<outfit quantity="2">Orion Beam</outfit>
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<Start>
|
<Start>
|
||||||
<name>Dark Tides</name>
|
<name>Dark Tides</name>
|
||||||
<player>
|
<player>
|
||||||
<ship>Llama</ship>
|
<ship>Lancelot</ship>
|
||||||
<credits>
|
<credits>
|
||||||
<low>10000</low>
|
<low>10000</low>
|
||||||
<high>20000</high>
|
<high>20000</high>
|
||||||
|
BIN
gfx/outfit/store/biometal.png
Normal file
After Width: | Height: | Size: 22 KiB |
Before Width: | Height: | Size: 6.8 KiB |
BIN
gfx/outfit/store/droid.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
gfx/outfit/store/lancelot_fighter.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
gfx/outfit/store/medium.png
Normal file
After Width: | Height: | Size: 6.5 KiB |
BIN
gfx/outfit/store/nanobond.png
Normal file
After Width: | Height: | Size: 11 KiB |
BIN
gfx/outfit/store/orion.png
Normal file
After Width: | Height: | Size: 18 KiB |
BIN
gfx/outfit/store/plasteel.png
Normal file
After Width: | Height: | Size: 14 KiB |
BIN
gfx/outfit/store/reactor_i.png
Normal file
After Width: | Height: | Size: 20 KiB |
BIN
gfx/outfit/store/reactor_ii.png
Normal file
After Width: | Height: | Size: 17 KiB |
BIN
gfx/outfit/store/reactor_iii.png
Normal file
After Width: | Height: | Size: 26 KiB |
76
src/outfit.c
@ -34,8 +34,10 @@ static void outfit_parseSLauncher(Outfit* tmp, const xmlNodePtr parent);
|
|||||||
static void outfit_parseSAmmo(Outfit* tmp, const xmlNodePtr parent);
|
static void outfit_parseSAmmo(Outfit* tmp, const xmlNodePtr parent);
|
||||||
static void outfit_parseSMod(Outfit* tmp, const xmlNodePtr parent);
|
static void outfit_parseSMod(Outfit* tmp, const xmlNodePtr parent);
|
||||||
static void outfit_parseSAfterburner(Outfit* tmp, const xmlNodePtr parent);
|
static void outfit_parseSAfterburner(Outfit* tmp, const xmlNodePtr parent);
|
||||||
static void outfit_parseSMap(Outfit* tmp, const xmlNodePtr parent);
|
|
||||||
static void outfit_parseSJammer(Outfit* tmp, const xmlNodePtr parent);
|
static void outfit_parseSJammer(Outfit* tmp, const xmlNodePtr parent);
|
||||||
|
static void outfit_parseSFighterBay(Outfit* tmp, const xmlNodePtr parent);
|
||||||
|
static void outfit_parseSFighter(Outfit* tmp, const xmlNodePtr parent);
|
||||||
|
static void outfit_parseSMap(Outfit* tmp, const xmlNodePtr parent);
|
||||||
|
|
||||||
/* Return an outfit. */
|
/* Return an outfit. */
|
||||||
Outfit* outfit_get(const char* name) {
|
Outfit* outfit_get(const char* name) {
|
||||||
@ -365,6 +367,18 @@ int outfit_delay(const Outfit* o) {
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @fn char* outfit_ammo(const Outfit* o)
|
||||||
|
*
|
||||||
|
* @brief Get the outfits ammo.
|
||||||
|
* @param o Outfit to get information from.
|
||||||
|
*/
|
||||||
|
char* outfit_ammo(const Outfit* o) {
|
||||||
|
if(outfit_isLauncher(o)) return o->u.lau.ammo;
|
||||||
|
else if(outfit_isFighterBay(o)) return o->u.bay.ammo;
|
||||||
|
return NULL;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @fn double outfit_energy(const Outfit* o)
|
* @fn double outfit_energy(const Outfit* o)
|
||||||
*
|
*
|
||||||
@ -492,6 +506,8 @@ static OutfitType outfit_strToOutfitType(char* buf) {
|
|||||||
O_CMP("modification", OUTFIT_TYPE_MODIFICATION);
|
O_CMP("modification", OUTFIT_TYPE_MODIFICATION);
|
||||||
O_CMP("afterburner", OUTFIT_TYPE_AFTERBURNER);
|
O_CMP("afterburner", OUTFIT_TYPE_AFTERBURNER);
|
||||||
O_CMP("map", OUTFIT_TYPE_MAP);
|
O_CMP("map", OUTFIT_TYPE_MAP);
|
||||||
|
O_CMP("fighter bay", OUTFIT_TYPE_FIGHTER_BAY);
|
||||||
|
O_CMP("fighter", OUTFIT_TYPE_FIGHTER);
|
||||||
O_CMP("jammer", OUTFIT_TYPE_JAMMER);
|
O_CMP("jammer", OUTFIT_TYPE_JAMMER);
|
||||||
|
|
||||||
WARN("Invalid outfit type '%s'", buf);
|
WARN("Invalid outfit type '%s'", buf);
|
||||||
@ -654,8 +670,8 @@ static void outfit_parseSLauncher(Outfit* tmp, const xmlNodePtr parent) {
|
|||||||
node = parent->xmlChildrenNode;
|
node = parent->xmlChildrenNode;
|
||||||
do {
|
do {
|
||||||
/* Load the dataz. */
|
/* Load the dataz. */
|
||||||
if(xml_isNode(node, "delay")) tmp->u.lau.delay = xml_getInt(node);
|
xmlr_int(node, "delay", tmp->u.lau.delay);
|
||||||
else if(xml_isNode(node, "ammo")) tmp->u.lau.ammo = strdup(xml_get(node));
|
xmlr_strd(node, "ammo", tmp->u.lau.ammo);
|
||||||
} while((node = node->next));
|
} while((node = node->next));
|
||||||
|
|
||||||
#define MELEMENT(o,s) if(o) WARN("Outfit '%s' missing '"s"' element", tmp->name)
|
#define MELEMENT(o,s) if(o) WARN("Outfit '%s' missing '"s"' element", tmp->name)
|
||||||
@ -763,6 +779,50 @@ static void outfit_parseSAfterburner(Outfit* tmp, const xmlNodePtr parent) {
|
|||||||
} while((node = node->next));
|
} while((node = node->next));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @fn static void outfit_parseSFighterBay(Outfit* tmp, const xmlNodePtr parent)
|
||||||
|
*
|
||||||
|
* @brief Parse the fighter bay tidbits of the outfit.
|
||||||
|
* @param tmp Outfit to finish laiding.
|
||||||
|
* @param parent Outfits parent node.
|
||||||
|
*/
|
||||||
|
static void outfit_parseSFighterBay(Outfit* tmp, const xmlNodePtr parent) {
|
||||||
|
xmlNodePtr node;
|
||||||
|
node = parent->children;
|
||||||
|
|
||||||
|
do {
|
||||||
|
xmlr_int(node, "delay", tmp->u.bay.delay);
|
||||||
|
xmlr_strd(node, "ammo", tmp->u.bay.ammo);
|
||||||
|
} while(xml_nextNode(node));
|
||||||
|
|
||||||
|
#define MELEMENT(o,s) \
|
||||||
|
if(o) WARN("Outfit '%s' missing/invalid '"s"' element", tmp->name)
|
||||||
|
MELEMENT(tmp->u.bay.delay==0, "delay");
|
||||||
|
MELEMENT(tmp->u.bay.ammo==NULL, "ammo");
|
||||||
|
#undef MELEMENT
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @fn static void outfit_parseSFighter(Outfit* tmp, const xmlNodePtr parent)
|
||||||
|
*
|
||||||
|
* @brief Parse the fighter tidbits of the outfit.
|
||||||
|
* @param tmp Outfit to finish loading.
|
||||||
|
* @param parent Outfits parent node.
|
||||||
|
*/
|
||||||
|
static void outfit_parseSFighter(Outfit* tmp, const xmlNodePtr parent) {
|
||||||
|
xmlNodePtr node;
|
||||||
|
node = parent->children;
|
||||||
|
|
||||||
|
do {
|
||||||
|
xmlr_strd(node, "ship", tmp->u.fig.ship);
|
||||||
|
} while(xml_nextNode(node));
|
||||||
|
|
||||||
|
#define MELEMENT(o,s) \
|
||||||
|
if(o) WARN("Outfit '%s' missing/invalid '"s"' element", tmp->name)
|
||||||
|
MELEMENT(tmp->u.fig.ship==NULL, "ship");
|
||||||
|
#undef MELEMENT
|
||||||
|
}
|
||||||
|
|
||||||
static void outfit_parseSMap(Outfit* tmp, const xmlNodePtr parent) {
|
static void outfit_parseSMap(Outfit* tmp, const xmlNodePtr parent) {
|
||||||
xmlNodePtr node;
|
xmlNodePtr node;
|
||||||
node = parent->children;
|
node = parent->children;
|
||||||
@ -853,10 +913,14 @@ static Outfit* outfit_parse(const xmlNodePtr parent) {
|
|||||||
outfit_parseSMod(tmp, node);
|
outfit_parseSMod(tmp, node);
|
||||||
else if(outfit_isAfterburner(tmp))
|
else if(outfit_isAfterburner(tmp))
|
||||||
outfit_parseSAfterburner(tmp, node);
|
outfit_parseSAfterburner(tmp, node);
|
||||||
else if(outfit_isMap(tmp))
|
|
||||||
outfit_parseSMap(tmp, node);
|
|
||||||
else if(outfit_isJammer(tmp))
|
else if(outfit_isJammer(tmp))
|
||||||
outfit_parseSJammer(tmp, node);
|
outfit_parseSJammer(tmp, node);
|
||||||
|
else if(outfit_isFighterBay(tmp))
|
||||||
|
outfit_parseSFighterBay(tmp, node);
|
||||||
|
else if(outfit_isFighter(tmp))
|
||||||
|
outfit_parseSFighter(tmp, node);
|
||||||
|
else if(outfit_isMap(tmp))
|
||||||
|
outfit_parseSMap(tmp, node);
|
||||||
}
|
}
|
||||||
} while(xml_nextNode(node));
|
} while(xml_nextNode(node));
|
||||||
#define MELEMENT(o,s) if(o) WARN("Outfit '%s' missing '"s"' element", tmp->name)
|
#define MELEMENT(o,s) if(o) WARN("Outfit '%s' missing '"s"' element", tmp->name)
|
||||||
@ -928,6 +992,8 @@ void outfit_free(void) {
|
|||||||
free(o->u.lau.ammo);
|
free(o->u.lau.ammo);
|
||||||
if(outfit_isFighterBay(o) && o->u.bay.ammo)
|
if(outfit_isFighterBay(o) && o->u.bay.ammo)
|
||||||
free(o->u.bay.ammo);
|
free(o->u.bay.ammo);
|
||||||
|
if(outfit_isFighter(o) && o->u.fig.ship)
|
||||||
|
free(o->u.fig.ship);
|
||||||
|
|
||||||
/* Strings. */
|
/* Strings. */
|
||||||
if(o->description)
|
if(o->description)
|
||||||
|
@ -282,6 +282,7 @@ int outfit_spfx(const Outfit* o);
|
|||||||
double outfit_damage(const Outfit* o);
|
double outfit_damage(const Outfit* o);
|
||||||
DamageType outfit_damageType(const Outfit* o);
|
DamageType outfit_damageType(const Outfit* o);
|
||||||
int outfit_delay(const Outfit* o);
|
int outfit_delay(const Outfit* o);
|
||||||
|
char* outfit_ammo(const Outfit* o);
|
||||||
double outfit_energy(const Outfit* o);
|
double outfit_energy(const Outfit* o);
|
||||||
double outfit_range(const Outfit* o);
|
double outfit_range(const Outfit* o);
|
||||||
double outfit_speed(const Outfit* o);
|
double outfit_speed(const Outfit* o);
|
||||||
|
29
src/pilot.c
@ -18,6 +18,7 @@
|
|||||||
#include "hook.h"
|
#include "hook.h"
|
||||||
#include "map.h"
|
#include "map.h"
|
||||||
#include "explosion.h"
|
#include "explosion.h"
|
||||||
|
#include "escort.h"
|
||||||
#include "pilot.h"
|
#include "pilot.h"
|
||||||
|
|
||||||
#define XML_ID "Fleets" /**< XML document identifier. */
|
#define XML_ID "Fleets" /**< XML document identifier. */
|
||||||
@ -215,7 +216,8 @@ void pilot_shoot(Pilot* p, const int secondary) {
|
|||||||
for(i = 0; i < p->noutfits; i++) {
|
for(i = 0; i < p->noutfits; i++) {
|
||||||
o = p->outfits[i].outfit;
|
o = p->outfits[i].outfit;
|
||||||
if(!outfit_isProp(o, OUTFIT_PROP_WEAP_SECONDARY) &&
|
if(!outfit_isProp(o, OUTFIT_PROP_WEAP_SECONDARY) &&
|
||||||
(outfit_isBolt(o) || outfit_isBeam(o))) /** @todo Possibly make the neater. */
|
(outfit_isBolt(o) || outfit_isBeam(o) || outfit_isFighterBay(o)))
|
||||||
|
/** @todo Possibly make this neater. */
|
||||||
pilot_shootWeapon(p, &p->outfits[i]);
|
pilot_shootWeapon(p, &p->outfits[i]);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
@ -320,6 +322,24 @@ static void pilot_shootWeapon(Pilot* p, PilotOutfit* w) {
|
|||||||
p->ammo->quantity -= 1; /* There's no getting this one back. */
|
p->ammo->quantity -= 1; /* There's no getting this one back. */
|
||||||
if(p->ammo->quantity <= 0) /* Out of ammo. */
|
if(p->ammo->quantity <= 0) /* Out of ammo. */
|
||||||
pilot_rmOutfit(p, p->ammo->outfit, 0); /* It'll set p->ammo to NULL. */
|
pilot_rmOutfit(p, p->ammo->outfit, 0); /* It'll set p->ammo to NULL. */
|
||||||
|
}
|
||||||
|
/*
|
||||||
|
* Fighter bays.
|
||||||
|
*
|
||||||
|
* Must be secondary weapon.
|
||||||
|
*/
|
||||||
|
else if(outfit_isFighterBay(w->outfit) && (w == p->secondary)) {
|
||||||
|
/* Must have ammo left. */
|
||||||
|
if((p->ammo == NULL) || (p->ammo->quantity <= 0))
|
||||||
|
return;
|
||||||
|
|
||||||
|
/* Create escort. */
|
||||||
|
escort_create(p->id, p->ammo->outfit->u.fig.ship,
|
||||||
|
&p->solid->pos, &p->solid->vel, 1);
|
||||||
|
|
||||||
|
p->ammo->quantity -= 1; /* We just shot it. */
|
||||||
|
if(p->ammo->quantity <= 0) /* Out of ammo. */
|
||||||
|
pilot_rmOutfit(p, p->ammo->outfit, 0); /* It'll set p->ammo to NULL. */
|
||||||
} else {
|
} else {
|
||||||
WARN("Shooting unknown weapon type: %s", w->outfit->name);
|
WARN("Shooting unknown weapon type: %s", w->outfit->name);
|
||||||
}
|
}
|
||||||
@ -499,15 +519,14 @@ void pilot_setAmmo(Pilot* p) {
|
|||||||
int i;
|
int i;
|
||||||
char* name;
|
char* name;
|
||||||
|
|
||||||
/* Only launchers use ammo. */
|
/* Weapon must use ammo. */
|
||||||
if((p->secondary == NULL) || !outfit_isLauncher(p->secondary->outfit)) {
|
if((p->secondary == NULL) || (outfit_ammo(p->secondary->outfit)==NULL)) {
|
||||||
p->ammo = NULL;
|
p->ammo = NULL;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Find the ammo and set it. */
|
/* Find the ammo and set it. */
|
||||||
name = p->secondary->outfit->u.lau.ammo;
|
name = outfit_ammo(p->secondary->outfit);
|
||||||
|
|
||||||
for(i = 0; i < p->noutfits; i++)
|
for(i = 0; i < p->noutfits; i++)
|
||||||
if(strcmp(p->outfits[i].outfit->name, name)==0) {
|
if(strcmp(p->outfits[i].outfit->name, name)==0) {
|
||||||
p->ammo = &p->outfits[i];
|
p->ammo = &p->outfits[i];
|
||||||
|
@ -985,9 +985,9 @@ void player_renderGUI(void) {
|
|||||||
c = &cConsole;
|
c = &cConsole;
|
||||||
|
|
||||||
/* Launcher. */
|
/* Launcher. */
|
||||||
if(outfit_isLauncher(player->secondary->outfit)) {
|
if(player->ammo != NULL) {
|
||||||
/* Use the ammunitions name. */
|
/* Use the ammunitions name. */
|
||||||
i = gl_printWidth(f, "%s", player->secondary->outfit->u.lau.ammo);
|
i = gl_printWidth(f, "%s", outfit_ammo(player->secondary->outfit));
|
||||||
if(i > gui.weapon.w)
|
if(i > gui.weapon.w)
|
||||||
/* Font is too big. */
|
/* Font is too big. */
|
||||||
f = &gl_smallFont;
|
f = &gl_smallFont;
|
||||||
@ -996,7 +996,7 @@ void player_renderGUI(void) {
|
|||||||
gl_printMid(f, (int)gui.weapon.w, gui.weapon.x,
|
gl_printMid(f, (int)gui.weapon.w, gui.weapon.x,
|
||||||
gui.weapon.y - 5,
|
gui.weapon.y - 5,
|
||||||
(player->ammo) ? c : &cGrey, "%s",
|
(player->ammo) ? c : &cGrey, "%s",
|
||||||
player->secondary->outfit->u.lau.ammo);
|
outfit_ammo(player->secondary->outfit));
|
||||||
|
|
||||||
/* Print ammo underneath to the left. */
|
/* Print ammo underneath to the left. */
|
||||||
gl_printMid(&gl_smallFont, (int)gui.weapon.w, gui.weapon.x,
|
gl_printMid(&gl_smallFont, (int)gui.weapon.w, gui.weapon.x,
|
||||||
|