[Add] outfits and ships now have a price tag.

This commit is contained in:
Allanis 2013-02-27 15:12:59 +00:00
parent fb57dde3ed
commit ae84dcf911
6 changed files with 19 additions and 4 deletions

View File

@ -5,6 +5,7 @@
<max>5</max>
<tech>2</tech>
<mass>0</mass>
<price>5000</price>
</general>
<specific type="1">
<gfx>lasergreen</gfx>
@ -25,6 +26,7 @@
<max>2</max>
<tech>4</tech>
<mass>10</mass>
<price>25000</price>
</general>
<specific type="5" secondary="1">
<ammo>Missile</ammo>
@ -36,6 +38,7 @@
<max>60</max>
<tech>2</tech>
<mass>1</mass>
<price>800</price>
</general>
<specific type="6">
<gfx>missile</gfx>

View File

@ -5,6 +5,7 @@
<GUI>minimal</GUI>
<sound>engine</sound>
<class>1</class>
<price>120000</price>
<movement>
<thrust>320</thrust>
<turn>150</turn>
@ -33,6 +34,7 @@
<GUI>minimal</GUI>
<sound>engine</sound>
<class>1</class>
<price>180000</price>
<movement>
<thrust>400</thrust>
<turn>180</turn>
@ -61,6 +63,7 @@
<GUI>minimal</GUI>
<sound>engine</sound>
<class>2</class>
<price>600000</price>
<movement>
<thrust>320</thrust>
<turn>150</turn>

View File

@ -244,6 +244,7 @@ static Outfit* outfit_parse(const xmlNodePtr parent) {
if(xml_isNode(cur, "max")) tmp->max = xml_getInt(cur);
else if(xml_isNode(cur, "tech")) tmp->tech = xml_getInt(cur);
else if(xml_isNode(cur, "mass")) tmp->mass = xml_getInt(cur);
else if(xml_isNode(cur, "price")) tmp->price = xml_getInt(cur);
} while((cur = cur->next));
}
else if(xml_isNode(node, "specific")) {
@ -278,6 +279,7 @@ static Outfit* outfit_parse(const xmlNodePtr parent) {
MELEMENT(tmp->tech==0, "tech");
//MELEMENT(tmp->mass==0, "mass");
MELEMENT(tmp->type==0, "type");
MELEMENT(tmp->price==0, "price");
#undef MELEMENT
return tmp;

View File

@ -31,6 +31,7 @@ typedef struct Outfit_ {
int max;
int tech;
int mass;
unsigned int price;
glTexture gfx_store; // Store graphic.

View File

@ -80,7 +80,9 @@ static Ship* ship_parse(xmlNodePtr parent) {
else if(xml_isNode(node, "sound"))
tmp->sound = sound_get(xml_get(node));
else if(xml_isNode(node, "class"))
tmp->class = atoi(xml_get(node));
tmp->class = xml_getInt(node);
else if(xml_isNode(node, "price"))
tmp->price = xml_getInt(node);
else if(xml_isNode(node, "movement")) {
cur = node->children;
do {
@ -151,6 +153,8 @@ static Ship* ship_parse(xmlNodePtr parent) {
MELEMENT(tmp->name == NULL, "name");
MELEMENT(tmp->gfx_space == NULL, "GFX");
MELEMENT(tmp->gui == NULL, "GUI");
MELEMENT(tmp->class==0, "class");
MELEMENT(tmp->price==0, "price");
MELEMENT(tmp->thrust==0, "thrust");
MELEMENT(tmp->turn==0, "turn");
MELEMENT(tmp->speed==0, "speed");

View File

@ -27,6 +27,8 @@ typedef struct Ship_ {
char* name; // Ship name.
ShipClass class; // Ship class.
unsigned int price; // Price!
// Movement.
double thrust, turn, speed;