[Fix] Guess who found out the correct spelling of armour!
-- find . -iname \*.c -exec sed -i -e "s/armor/armour/g" {} \;
This commit is contained in:
parent
de91004814
commit
2b3852c25b
24
src/ai.c
24
src/ai.c
@ -90,9 +90,9 @@ static int ai_taskname(lua_State* L); // Number taskname.
|
|||||||
// Consult values.
|
// Consult values.
|
||||||
static int ai_gettarget(lua_State* L); // Pointer gettarget()
|
static int ai_gettarget(lua_State* L); // Pointer gettarget()
|
||||||
static int ai_gettargetid(lua_State* L); // Number gettargetis()
|
static int ai_gettargetid(lua_State* L); // Number gettargetis()
|
||||||
static int ai_armor(lua_State* L); // armor()
|
static int ai_armour(lua_State* L); // armour()
|
||||||
static int ai_shield(lua_State* L); // shield()
|
static int ai_shield(lua_State* L); // shield()
|
||||||
static int ai_parmor(lua_State* L); // parmor()
|
static int ai_parmour(lua_State* L); // parmour()
|
||||||
static int ai_pshield(lua_State* L); // pshield()
|
static int ai_pshield(lua_State* L); // pshield()
|
||||||
static int ai_getdistance(lua_State* L); // Number getdist(Vec2)
|
static int ai_getdistance(lua_State* L); // Number getdist(Vec2)
|
||||||
static int ai_getpos(lua_State* L); // getpos(number)
|
static int ai_getpos(lua_State* L); // getpos(number)
|
||||||
@ -196,9 +196,9 @@ static int ai_loadProfile(char* filename) {
|
|||||||
// Consult.
|
// Consult.
|
||||||
lua_register(L, "gettarget", ai_gettarget);
|
lua_register(L, "gettarget", ai_gettarget);
|
||||||
lua_register(L, "gettargetid", ai_gettargetid);
|
lua_register(L, "gettargetid", ai_gettargetid);
|
||||||
lua_register(L, "armor", ai_armor);
|
lua_register(L, "armour", ai_armour);
|
||||||
lua_register(L, "shield", ai_shield);
|
lua_register(L, "shield", ai_shield);
|
||||||
lua_register(L, "parmor", ai_parmor);
|
lua_register(L, "parmour", ai_parmour);
|
||||||
lua_register(L, "pshield", ai_pshield);
|
lua_register(L, "pshield", ai_pshield);
|
||||||
lua_register(L, "getdist", ai_getdistance);
|
lua_register(L, "getdist", ai_getdistance);
|
||||||
lua_register(L, "getpos", ai_getpos);
|
lua_register(L, "getpos", ai_getpos);
|
||||||
@ -403,12 +403,12 @@ static int ai_gettargetid(lua_State* L) {
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the pilots armor.
|
// Get the pilots armour.
|
||||||
static int ai_armor(lua_State* L) {
|
static int ai_armour(lua_State* L) {
|
||||||
double d;
|
double d;
|
||||||
|
|
||||||
if(lua_isnumber(L,1)) d = pilot_get((unsigned int)lua_tonumber(L,1))->armor;
|
if(lua_isnumber(L,1)) d = pilot_get((unsigned int)lua_tonumber(L,1))->armour;
|
||||||
else d = cur_pilot->armor;
|
else d = cur_pilot->armour;
|
||||||
|
|
||||||
lua_pushnumber(L, d);
|
lua_pushnumber(L, d);
|
||||||
return 1;
|
return 1;
|
||||||
@ -425,16 +425,16 @@ static int ai_shield(lua_State* L) {
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Get the pilot's armor in percentage.
|
// Get the pilot's armour in percentage.
|
||||||
static int ai_parmor(lua_State* L) {
|
static int ai_parmour(lua_State* L) {
|
||||||
double d;
|
double d;
|
||||||
Pilot* p;
|
Pilot* p;
|
||||||
|
|
||||||
if(lua_isnumber(L,1)) {
|
if(lua_isnumber(L,1)) {
|
||||||
p = pilot_get((unsigned int)lua_tonumber(L,1));
|
p = pilot_get((unsigned int)lua_tonumber(L,1));
|
||||||
d = p->armor / p->armor_max * 100.;
|
d = p->armour / p->armour_max * 100.;
|
||||||
}
|
}
|
||||||
else d = cur_pilot->armor / cur_pilot->armor_max * 100.;
|
else d = cur_pilot->armour / cur_pilot->armour_max * 100.;
|
||||||
|
|
||||||
lua_pushnumber(L, d);
|
lua_pushnumber(L, d);
|
||||||
return 1;
|
return 1;
|
||||||
|
@ -92,7 +92,7 @@ static void outfit_parseSWeapon(Outfit* tmp, const xmlNodePtr parent) {
|
|||||||
else if(xml_isNode(node, "damage")) {
|
else if(xml_isNode(node, "damage")) {
|
||||||
cur = node->children;
|
cur = node->children;
|
||||||
do {
|
do {
|
||||||
if(xml_isNode(cur, "armor")) tmp->damage_armor = xml_getFloat(cur);
|
if(xml_isNode(cur, "armour")) tmp->damage_armour = xml_getFloat(cur);
|
||||||
else if(xml_isNode(cur, "shield")) tmp->damage_shield = xml_getFloat(cur);
|
else if(xml_isNode(cur, "shield")) tmp->damage_shield = xml_getFloat(cur);
|
||||||
} while((cur = cur->next));
|
} while((cur = cur->next));
|
||||||
}
|
}
|
||||||
@ -103,7 +103,7 @@ static void outfit_parseSWeapon(Outfit* tmp, const xmlNodePtr parent) {
|
|||||||
MELEMENT(tmp->speed, "speed");
|
MELEMENT(tmp->speed, "speed");
|
||||||
MELEMENT(tmp->range, "range");
|
MELEMENT(tmp->range, "range");
|
||||||
MELEMENT(tmp->accuracy, "accuracy");
|
MELEMENT(tmp->accuracy, "accuracy");
|
||||||
MELEMENT(tmp->damage_armor, "armor' from element 'damage");
|
MELEMENT(tmp->damage_armour, "armour' from element 'damage");
|
||||||
MELEMENT(tmp->damage_shield, "shield' from element 'damage");
|
MELEMENT(tmp->damage_shield, "shield' from element 'damage");
|
||||||
#undef MELEMENT
|
#undef MELEMENT
|
||||||
}
|
}
|
||||||
|
32
src/pilot.c
32
src/pilot.c
@ -131,18 +131,18 @@ void pilot_shoot(Pilot* p, const int secondary) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Damage the pilot.
|
// Damage the pilot.
|
||||||
void pilot_hit(Pilot* p, const double damage_shield, const double damage_armor) {
|
void pilot_hit(Pilot* p, const double damage_shield, const double damage_armour) {
|
||||||
if(p->shield - damage_shield > 0.)
|
if(p->shield - damage_shield > 0.)
|
||||||
p->shield -= damage_shield;
|
p->shield -= damage_shield;
|
||||||
else if(p->shield > 0.) {
|
else if(p->shield > 0.) {
|
||||||
// Shields can take part of the blow.
|
// Shields can take part of the blow.
|
||||||
p->armor -= p->shield/damage_shield*damage_armor;
|
p->armour -= p->shield/damage_shield*damage_armour;
|
||||||
p->shield = 0.;
|
p->shield = 0.;
|
||||||
}
|
}
|
||||||
else if(p->armor-damage_armor > 0.)
|
else if(p->armour-damage_armour > 0.)
|
||||||
p->armor -= damage_armor;
|
p->armour -= damage_armour;
|
||||||
else
|
else
|
||||||
p->armor = 0.;
|
p->armour = 0.;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Render the pilot.
|
// Render the pilot.
|
||||||
@ -157,7 +157,7 @@ void pilot_render(Pilot* p) {
|
|||||||
|
|
||||||
// Update the pilot.
|
// Update the pilot.
|
||||||
static void pilot_update(Pilot* pilot, const double dt) {
|
static void pilot_update(Pilot* pilot, const double dt) {
|
||||||
if(pilot != player && pilot->armor < PILOT_DISABLED_ARMOR * pilot->armor_max) {
|
if(pilot != player && pilot->armour < PILOT_DISABLED_ARMOR * pilot->armour_max) {
|
||||||
// We are disabled.
|
// We are disabled.
|
||||||
pilot_setFlag(pilot, PILOT_DISABLED);
|
pilot_setFlag(pilot, PILOT_DISABLED);
|
||||||
// Come to a halt slowly.
|
// Come to a halt slowly.
|
||||||
@ -170,12 +170,12 @@ static void pilot_update(Pilot* pilot, const double dt) {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
// We are still alive.
|
// We are still alive.
|
||||||
else if(pilot->armor < pilot->armor_max)
|
else if(pilot->armour < pilot->armour_max)
|
||||||
pilot->armor += pilot->ship->armor_regen*dt;
|
pilot->armour += pilot->ship->armour_regen*dt;
|
||||||
else
|
else
|
||||||
pilot->shield += pilot->ship->shield_regen*dt;
|
pilot->shield += pilot->ship->shield_regen*dt;
|
||||||
|
|
||||||
if(pilot->armor > pilot->armor_max) pilot->armor = pilot->armor_max;
|
if(pilot->armour > pilot->armour_max) pilot->armour = pilot->armour_max;
|
||||||
if(pilot->shield > pilot->shield_max) pilot->shield = pilot->shield_max;
|
if(pilot->shield > pilot->shield_max) pilot->shield = pilot->shield_max;
|
||||||
|
|
||||||
// Update the solid.
|
// Update the solid.
|
||||||
@ -217,13 +217,13 @@ void pilot_init(Pilot* pilot, Ship* ship, char* name, Faction* faction, AI_Profi
|
|||||||
// Solid.
|
// Solid.
|
||||||
pilot->solid = solid_create(ship->mass, dir, pos, vel);
|
pilot->solid = solid_create(ship->mass, dir, pos, vel);
|
||||||
|
|
||||||
// Max shields armor.
|
// Max shields armour.
|
||||||
pilot->armor_max = ship->armor;
|
pilot->armour_max = ship->armour;
|
||||||
pilot->shield_max = ship->shield;
|
pilot->shield_max = ship->shield;
|
||||||
pilot->energy_max = ship->energy;
|
pilot->energy_max = ship->energy;
|
||||||
pilot->armor = pilot->armor_max;
|
pilot->armour = pilot->armour_max;
|
||||||
pilot->shield = pilot->shield_max;
|
pilot->shield = pilot->shield_max;
|
||||||
pilot->energy = pilot->energy_max;
|
pilot->energy = pilot->energy_max;
|
||||||
|
|
||||||
|
|
||||||
// Initially idle.
|
// Initially idle.
|
||||||
|
16
src/player.c
16
src/player.c
@ -106,7 +106,7 @@ typedef struct {
|
|||||||
gl_texture* gfx_targetPilot, *gfx_targetPlanet;
|
gl_texture* gfx_targetPilot, *gfx_targetPlanet;
|
||||||
Radar radar;
|
Radar radar;
|
||||||
Rect nav;
|
Rect nav;
|
||||||
Rect shield, armor, energy;
|
Rect shield, armour, energy;
|
||||||
Rect weapon;
|
Rect weapon;
|
||||||
Rect misc;
|
Rect misc;
|
||||||
|
|
||||||
@ -114,7 +114,7 @@ typedef struct {
|
|||||||
Vec2 pos_frame;
|
Vec2 pos_frame;
|
||||||
Vec2 pos_radar;
|
Vec2 pos_radar;
|
||||||
Vec2 pos_nav;
|
Vec2 pos_nav;
|
||||||
Vec2 pos_shield, pos_armor, pos_energy;
|
Vec2 pos_shield, pos_armour, pos_energy;
|
||||||
Vec2 pos_weapon;
|
Vec2 pos_weapon;
|
||||||
Vec2 pos_target, pos_target_health, pos_target_name, pos_target_faction;
|
Vec2 pos_target, pos_target_health, pos_target_name, pos_target_faction;
|
||||||
Vec2 pos_misc;
|
Vec2 pos_misc;
|
||||||
@ -336,7 +336,7 @@ void player_render(void) {
|
|||||||
|
|
||||||
// Health
|
// Health
|
||||||
gui_renderBar(&cShield, &gui.pos_shield, &gui.shield, player->shield / player->shield_max);
|
gui_renderBar(&cShield, &gui.pos_shield, &gui.shield, player->shield / player->shield_max);
|
||||||
gui_renderBar(&cArmor, &gui.pos_armor, &gui.armor, player->armor / player->armor_max);
|
gui_renderBar(&cArmor, &gui.pos_armour, &gui.armour, player->armour / player->armour_max);
|
||||||
gui_renderBar(&cEnergy, &gui.pos_energy, &gui.energy, player->energy / player->energy_max);
|
gui_renderBar(&cEnergy, &gui.pos_energy, &gui.energy, player->energy / player->energy_max);
|
||||||
|
|
||||||
// Weapon.
|
// Weapon.
|
||||||
@ -369,8 +369,8 @@ void player_render(void) {
|
|||||||
// On shields.
|
// On shields.
|
||||||
gl_print(&gui.smallFont, &gui.pos_target_health, NULL, "%s: %.0f%%", "Shield", p->shield/p->shield_max*100.);
|
gl_print(&gui.smallFont, &gui.pos_target_health, NULL, "%s: %.0f%%", "Shield", p->shield/p->shield_max*100.);
|
||||||
else
|
else
|
||||||
// On armor.
|
// On armour.
|
||||||
gl_print(&gui.smallFont, &gui.pos_target_health, NULL, "%s: %.0f%%", "Armor", p->armor/p->armor_max*100.);
|
gl_print(&gui.smallFont, &gui.pos_target_health, NULL, "%s: %.0f%%", "Armor", p->armour/p->armour_max*100.);
|
||||||
} else {
|
} else {
|
||||||
// No target.
|
// No target.
|
||||||
i = gl_printWidth(NULL, "No Target");
|
i = gl_printWidth(NULL, "No Target");
|
||||||
@ -662,9 +662,9 @@ static int gui_parse(const xmlNodePtr parent, const char* name) {
|
|||||||
VY(gui.pos_frame) + gui.gfx_frame->h - y);
|
VY(gui.pos_frame) + gui.gfx_frame->h - y);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(xml_isNode(cur, "armor")) {
|
if(xml_isNode(cur, "armour")) {
|
||||||
rect_parse(cur, &x, &y, &gui.armor.w, &gui.armor.h);
|
rect_parse(cur, &x, &y, &gui.armour.w, &gui.armour.h);
|
||||||
vect_csetmin(&gui.pos_armor,
|
vect_csetmin(&gui.pos_armour,
|
||||||
VX(gui.pos_frame) + x,
|
VX(gui.pos_frame) + x,
|
||||||
VY(gui.pos_frame) + gui.gfx_frame->h - y);
|
VY(gui.pos_frame) + gui.gfx_frame->h - y);
|
||||||
}
|
}
|
||||||
|
12
src/ship.c
12
src/ship.c
@ -75,14 +75,14 @@ static Ship* ship_parse(xmlNodePtr parent) {
|
|||||||
else if(strcmp((char*)node->name, "health")==0) {
|
else if(strcmp((char*)node->name, "health")==0) {
|
||||||
cur = node->children;
|
cur = node->children;
|
||||||
do {
|
do {
|
||||||
if(strcmp((char*)cur->name, "armor")==0)
|
if(strcmp((char*)cur->name, "armour")==0)
|
||||||
tmp->armor = (double)atoi((char*)cur->children->content);
|
tmp->armour = (double)atoi((char*)cur->children->content);
|
||||||
else if(strcmp((char*)cur->name, "shield")==0)
|
else if(strcmp((char*)cur->name, "shield")==0)
|
||||||
tmp->shield = (double)atoi((char*)cur->children->content);
|
tmp->shield = (double)atoi((char*)cur->children->content);
|
||||||
else if(strcmp((char*)cur->name, "energy")==0)
|
else if(strcmp((char*)cur->name, "energy")==0)
|
||||||
tmp->energy = (double)atoi((char*)cur->children->content);
|
tmp->energy = (double)atoi((char*)cur->children->content);
|
||||||
else if(strcmp((char*)cur->name, "armor_regen")==0)
|
else if(strcmp((char*)cur->name, "armour_regen")==0)
|
||||||
tmp->armor_regen = (double)(atoi((char*)cur->children->content))/60.0;
|
tmp->armour_regen = (double)(atoi((char*)cur->children->content))/60.0;
|
||||||
else if(strcmp((char*)cur->name, "shield_regen")==0)
|
else if(strcmp((char*)cur->name, "shield_regen")==0)
|
||||||
tmp->shield_regen = (double)(atoi((char*)cur->children->content))/60.0;
|
tmp->shield_regen = (double)(atoi((char*)cur->children->content))/60.0;
|
||||||
else if(strcmp((char*)cur->name, "energy_regen")==0)
|
else if(strcmp((char*)cur->name, "energy_regen")==0)
|
||||||
@ -135,8 +135,8 @@ static Ship* ship_parse(xmlNodePtr parent) {
|
|||||||
MELEMENT(tmp->speed, "speed");
|
MELEMENT(tmp->speed, "speed");
|
||||||
MELEMENT(tmp->crew, "crew");
|
MELEMENT(tmp->crew, "crew");
|
||||||
MELEMENT(tmp->mass, "mass");
|
MELEMENT(tmp->mass, "mass");
|
||||||
MELEMENT(tmp->armor, "armor");
|
MELEMENT(tmp->armour, "armour");
|
||||||
MELEMENT(tmp->armor_regen, "armor_regen");
|
MELEMENT(tmp->armour_regen, "armour_regen");
|
||||||
MELEMENT(tmp->shield, "shield");
|
MELEMENT(tmp->shield, "shield");
|
||||||
MELEMENT(tmp->shield_regen, "shield_regen");
|
MELEMENT(tmp->shield_regen, "shield_regen");
|
||||||
MELEMENT(tmp->energy, "energy");
|
MELEMENT(tmp->energy, "energy");
|
||||||
|
@ -139,7 +139,7 @@ static void weapon_update(Weapon* w, const double dt, WeaponLayer layer) {
|
|||||||
pilot_setFlag(pilot_stack[i], PILOT_HOSTILE);
|
pilot_setFlag(pilot_stack[i], PILOT_HOSTILE);
|
||||||
|
|
||||||
// Inform the ship that it should take some damage.
|
// Inform the ship that it should take some damage.
|
||||||
pilot_hit(pilot_stack[i], w->outfit->damage_shield, w->outfit->damage_armor);
|
pilot_hit(pilot_stack[i], w->outfit->damage_shield, w->outfit->damage_armour);
|
||||||
// No need for the weapon particle anymore.
|
// No need for the weapon particle anymore.
|
||||||
weapon_destroy(w, layer);
|
weapon_destroy(w, layer);
|
||||||
return;
|
return;
|
||||||
|
Loading…
Reference in New Issue
Block a user