[Change] Rumble of the afterburners are now stored in outift.xml

This commit is contained in:
Allanis 2013-05-23 16:32:05 +01:00
parent c7deebc62c
commit 9eae9cf71c
4 changed files with 12 additions and 11 deletions

View File

@ -255,6 +255,7 @@
<gfx_store>afterburner</gfx_store>
</general>
<specific type="16">
<rumble>30</rumble>
<thrust_perc>100</thrust_perc>
<thrust_abs>50</thrust_abs>
<speed_perc>50</speed_perc>
@ -272,6 +273,7 @@
<gfx_store>afterburner</gfx_store>
</general>
<specific type="16">
<rumble>50</rumble>
<thrust_perc>185</thrust_perc>
<thrust_abs>100</thrust_abs>
<speed_perc>85</speed_perc>

View File

@ -339,16 +339,14 @@ static void outfit_parseSAfterburner(Outfit* tmp, const xmlNodePtr parent) {
tmp->u.afb.speed_perc = 1.;
do {
xmlr_float(node, "rumble", tmp->u.afb.rumble);
if(xml_isNode(node, "thrust_perc"))
tmp->u.afb.thrust_perc = 1. + xml_getFloat(node)/100.;
else if(xml_isNode(node, "thrust_abs"))
tmp->u.afb.thrust_abs = xml_getFloat(node);
else if(xml_isNode(node, "speed_perc"))
xmlr_float(node, "thrust_abs", tmp->u.afb.thrust_abs);
if(xml_isNode(node, "speed_perc"))
tmp->u.afb.speed_perc = 1. + xml_getFloat(node)/100.;
else if(xml_isNode(node, "speed_abs"))
tmp->u.afb.speed_abs = xml_getFloat(node);
else if(xml_isNode(node, "energy"))
tmp->u.afb.energy = xml_getFloat(node);
xmlr_float(node, "speed_abs", tmp->u.afb.speed_abs);
xmlr_float(node, "energy", tmp->u.afb.energy);
} while((node = node->next));
}

View File

@ -96,9 +96,10 @@ typedef struct Outfit_ {
int cargo; // Cargo space to add.
} mod;
struct { // Afterburner.
double thrust_perc, thrust_abs; // Percent and absolute thrust bonus.
double speed_perc, speed_abs; // Percent and absolute speed bonus.
double energy; // Energy used while active.
double rumble; // Percent of rumble.
double thrust_perc, thrust_abs; // Percent and absolute thrust bonus.
double speed_perc, speed_abs; // Percent and absolute speed bonus.
double energy; // Energy used while active.
} afb;
} u;
} Outfit;

View File

@ -1305,7 +1305,7 @@ void player_afterburn(void) {
if(player->afterburner != NULL) {
player_setFlag(PLAYER_AFTERBURNER);
pilot_setFlag(player, PILOT_AFTERBURNER);
spfx_shake(50.);
spfx_shake(player->afterburner->outfit->u.afb.rumble * SHAKE_MAX);
}
}