forked from github/server
Noch mehr Änderungen wg. Gewichten. 1 GE = [1..100] Silber
This commit is contained in:
parent
6b69cd9560
commit
0c2a0080cb
3 changed files with 24 additions and 23 deletions
|
@ -562,19 +562,19 @@ cr_output_buildings(FILE * F, building * b, unit * u, int fno, faction *f)
|
||||||
|
|
||||||
/* prints a ship */
|
/* prints a ship */
|
||||||
static void
|
static void
|
||||||
cr_output_ship(FILE * F, const ship * s, const unit * u, int fcaptain, const faction * f, const region * r)
|
cr_output_ship(FILE * F, const ship * sh, const unit * u, int fcaptain, const faction * f, const region * r)
|
||||||
{
|
{
|
||||||
unit *u2;
|
unit *u2;
|
||||||
int w = 0;
|
int w = 0;
|
||||||
assert(s);
|
assert(sh);
|
||||||
fprintf(F, "SCHIFF %d\n", s->no);
|
fprintf(F, "SCHIFF %d\n", sh->no);
|
||||||
fprintf(F, "\"%s\";Name\n", s->name);
|
fprintf(F, "\"%s\";Name\n", sh->name);
|
||||||
if (strlen(s->display))
|
if (strlen(sh->display))
|
||||||
fprintf(F, "\"%s\";Beschr\n", s->display);
|
fprintf(F, "\"%s\";Beschr\n", sh->display);
|
||||||
fprintf(F, "\"%s\";Typ\n", add_translation(s->type->name[0], locale_string(f->locale, s->type->name[0])));
|
fprintf(F, "\"%s\";Typ\n", add_translation(sh->type->name[0], locale_string(f->locale, sh->type->name[0])));
|
||||||
fprintf(F, "%d;Groesse\n", s->size);
|
fprintf(F, "%d;Groesse\n", sh->size);
|
||||||
if (s->damage) {
|
if (sh->damage) {
|
||||||
int percent = s->damage*100/(s->size*DAMAGE_SCALE);
|
int percent = sh->damage*100/(sh->size*DAMAGE_SCALE);
|
||||||
fprintf(F, "%d;Schaden\n", percent);
|
fprintf(F, "%d;Schaden\n", percent);
|
||||||
}
|
}
|
||||||
if (u)
|
if (u)
|
||||||
|
@ -584,20 +584,20 @@ cr_output_ship(FILE * F, const ship * s, const unit * u, int fcaptain, const fac
|
||||||
|
|
||||||
/* calculate cargo */
|
/* calculate cargo */
|
||||||
if (u && (u->faction == f || omniscient(f))) {
|
if (u && (u->faction == f || omniscient(f))) {
|
||||||
for (u2 = r->units; u2; u2 = u2->next)
|
int n = 0, p = 0;
|
||||||
if (u2->ship == s)
|
getshipweight(sh, &n, &p);
|
||||||
w += weight(u2);
|
n = (n+99) / 100; /* 1 Silber = 1 GE */
|
||||||
|
|
||||||
fprintf(F, "%d;Ladung\n", (w + 99) / 100);
|
fprintf(F, "%d;Ladung\n", n);
|
||||||
fprintf(F, "%d;MaxLadung\n", shipcapacity(s) / 100);
|
fprintf(F, "%d;MaxLadung\n", shipcapacity(sh) / 100);
|
||||||
}
|
}
|
||||||
/* shore */
|
/* shore */
|
||||||
w = NODIRECTION;
|
w = NODIRECTION;
|
||||||
if (rterrain(r) != T_OCEAN) w = s->coast;
|
if (rterrain(r) != T_OCEAN) w = sh->coast;
|
||||||
if (w != NODIRECTION)
|
if (w != NODIRECTION)
|
||||||
fprintf(F, "%d;Kueste\n", w);
|
fprintf(F, "%d;Kueste\n", w);
|
||||||
|
|
||||||
print_curses(F, f, s, TYP_SHIP);
|
print_curses(F, f, sh, TYP_SHIP);
|
||||||
}
|
}
|
||||||
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
|
/* = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = */
|
||||||
|
|
||||||
|
|
|
@ -2345,9 +2345,10 @@ report(FILE *F, faction * f, const faction_list * addresses,
|
||||||
if (of == f) {
|
if (of == f) {
|
||||||
int n = 0, p = 0;
|
int n = 0, p = 0;
|
||||||
getshipweight(sh, &n, &p);
|
getshipweight(sh, &n, &p);
|
||||||
|
n = (n+99) / 100; /* 1 Silber = 1 GE */
|
||||||
|
|
||||||
sprintf(buf, "%s, %s, (%d/%d)", shipname(sh),
|
sprintf(buf, "%s, %s, (%d/%d)", shipname(sh),
|
||||||
LOC(f->locale, sh->type->name[0]), n / 100, shipcapacity(sh) / 100);
|
LOC(f->locale, sh->type->name[0]), n, shipcapacity(sh) / 100);
|
||||||
} else {
|
} else {
|
||||||
sprintf(buf, "%s, %s", shipname(sh), LOC(f->locale, sh->type->name[0]));
|
sprintf(buf, "%s, %s", shipname(sh), LOC(f->locale, sh->type->name[0]));
|
||||||
}
|
}
|
||||||
|
|
|
@ -974,11 +974,11 @@ showunits(region * r)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (sh = r->ships; sh; sh = sh->next) {
|
for (sh = r->ships; sh; sh = sh->next) {
|
||||||
f=0;
|
int n = 0, p = 0;
|
||||||
for (u = r->units; u; u = u->next)
|
getshipweight(sh, &n, &p);
|
||||||
if (u->ship == sh) f += weight(u);
|
n = (n+99) / 100; /* 1 Silber = 1 GE */
|
||||||
sprintf(lbuf, "\023%s, %s, (%d/%d)", shipname(sh), sh->type->name[0],
|
sprintf(lbuf, "\023%s, %s, (%d/%d)", shipname(sh), sh->type->name[0],
|
||||||
(f+99)/100, shipcapacity(sh)/100);
|
n, shipcapacity(sh)/100);
|
||||||
if (sh->type->construction && sh->size!=sh->type->construction->maxsize) {
|
if (sh->type->construction && sh->size!=sh->type->construction->maxsize) {
|
||||||
f = 100 * (sh->size) / sh->type->construction->maxsize;
|
f = 100 * (sh->size) / sh->type->construction->maxsize;
|
||||||
sncat(lbuf, ", im Bau (", BUFSIZE);
|
sncat(lbuf, ", im Bau (", BUFSIZE);
|
||||||
|
|
Loading…
Reference in a new issue