- indentation fixes

- statistics beautification
This commit is contained in:
Enno Rehling 2006-01-29 14:05:28 +00:00
parent 7819848524
commit 7a3ca3ce5b
3 changed files with 262 additions and 258 deletions

View file

@ -1009,9 +1009,9 @@ describe(FILE * F, const region * r, int partial, faction * f)
/* Terrain */
bufp += strxcpy(bufp, ", ");
if(is_cursed(r->attribs,C_MAELSTROM, 0))
if (is_cursed(r->attribs,C_MAELSTROM, 0)) {
tname = "maelstrom";
else {
} else {
tname = terrain_name(r);
}
bufp += strxcpy(bufp, LOC(f->locale, tname));
@ -1024,17 +1024,19 @@ describe(FILE * F, const region * r, int partial, faction * f)
if (trees > 0 || ytrees > 0) {
bufp += sprintf(bufp, ", %d/%d ", trees, ytrees);
if (fval(r, RF_MALLORN)) {
if (trees == 1)
if (trees == 1) {
bufp += strxcpy(bufp, LOC(f->locale, "nr_mallorntree"));
else
} else {
bufp += strxcpy(bufp, LOC(f->locale, "nr_mallorntree_p"));
}
else if (trees == 1)
}
else if (trees == 1) {
bufp += strxcpy(bufp, LOC(f->locale, "nr_tree"));
else
} else {
bufp += strxcpy(bufp, LOC(f->locale, "nr_tree_p"));
}
}
}
/* iron & stone */
if (partial == 0 && f != (faction *) NULL) {
@ -1101,9 +1103,10 @@ describe(FILE * F, const region * r, int partial, faction * f)
bufp += strxcpy(bufp, r->display);
n = r->display[strlen(r->display) - 1];
if (n != '!' && n != '?' && n != '.')
if (n != '!' && n != '?' && n != '.') {
strcpy(bufp++, ".");
}
}
{
const faction * owner = region_owner(r);
@ -1250,39 +1253,39 @@ statistics(FILE * F, const region * r, const faction * f)
number = 0;
/* zählen */
for (u = r->units; u; u = u->next)
for (u = r->units; u; u = u->next) {
if (u->faction == f && u->race != new_race[RC_SPELL]) {
for (itm=u->items;itm;itm=itm->next) {
i_change(&items, itm->type, itm->number);
}
number += u->number;
}
}
/* Ausgabe */
rnl(F);
m = msg_message("nr_stat_header", "region", r);
nr_render(m, f->locale, buf, sizeof(buf), f);
rps(F, buf);
msg_release(m);
rparagraph(F, buf, 0, 0);
rnl(F);
/* Region */
if (fval(r->terrain, LAND_REGION) && rmoney(r)) {
m = msg_message("nr_stat_maxentertainment", "max", entertainmoney(r));
nr_render(m, f->locale, buf, sizeof(buf), f);
rps(F, buf);
rparagraph(F, buf, 2, 0);
msg_release(m);
}
if (production(r) && (!fval(r->terrain, SEA_REGION) || f->race == new_race[RC_AQUARIAN])) {
m = msg_message("nr_stat_salary", "max", wage(r, f, f->race));
nr_render(m, f->locale, buf, sizeof(buf), f);
rps(F, buf);
rparagraph(F, buf, 2, 0);
msg_release(m);
}
if (p) {
m = msg_message("nr_stat_recruits", "max", p / RECRUITFRACTION);
nr_render(m, f->locale, buf, sizeof(buf), f);
rps(F, buf);
rparagraph(F, buf, 2, 0);
msg_release(m);
if (!TradeDisabled()) {
@ -1294,7 +1297,7 @@ statistics(FILE * F, const region * r, const faction * f)
p / TRADE_FRACTION);
}
nr_render(m, f->locale, buf, sizeof(buf), f);
rps(F, buf);
rparagraph(F, buf, 2, 0);
msg_release(m);
}
}
@ -1302,14 +1305,14 @@ statistics(FILE * F, const region * r, const faction * f)
m = msg_message("nr_stat_people", "max", number);
nr_render(m, f->locale, buf, sizeof(buf), f);
rps(F, buf);
rparagraph(F, buf, 2, 0);
msg_release(m);
for (itm = items; itm; itm=itm->next) {
sprintf(buf, "%s: %d",
LOC(f->locale, resourcename(itm->type->rtype, GR_PLURAL)),
itm->number);
rps(F, buf);
rparagraph(F, buf, 2, 0);
}
while (items) i_free(i_remove(&items, items));
}

View file

@ -336,10 +336,11 @@ create_mage(unit * u, magic_t mtyp)
sc_mage *mage;
attrib *a;
#ifndef NDEBUG
a = a_find(u->attribs, &at_mage);
assert(a==NULL);
#endif
if (a!=NULL) {
mage = a->data.v;
assert(mage->spells==NULL && mage->magietyp == mtyp);
}
a = a_add(&u->attribs, a_new(&at_mage));
mage = a->data.v;

View file

@ -464,9 +464,9 @@
<type>
<arg name="max" type="int"/>
</type>
<text locale="de">"Rekruten: max. $int($max) Bauern."</text>
<text locale="en">"Recruits: $int($max) peasants."</text>
<text locale="fr">"Recruits: $int($max) peasants."</text>
<text locale="de">"Rekruten: max. $int($max) Bauern"</text>
<text locale="en">"Recruits: $int($max) peasants"</text>
<text locale="fr">"Recruits: $int($max) peasants"</text>
</message>
<message name="nr_score" section="nr">
<type>