forked from github/server
Gewicht auf Schiffen wird im Report abgerundet.
This commit is contained in:
parent
4e2a3beaa9
commit
afa1c2a804
|
@ -2330,83 +2330,83 @@ report(FILE *F, faction * f, const faction_list * addresses,
|
||||||
/* Schiffe und ihre Einheiten */
|
/* Schiffe und ihre Einheiten */
|
||||||
|
|
||||||
for (sh = r->ships; sh; sh = sh->next) {
|
for (sh = r->ships; sh; sh = sh->next) {
|
||||||
int w = 0;
|
|
||||||
faction *of = NULL;
|
faction *of = NULL;
|
||||||
|
|
||||||
rnl(F);
|
rnl(F);
|
||||||
|
|
||||||
/* Gewicht feststellen */
|
/* Gewicht feststellen */
|
||||||
|
|
||||||
for (u = r->units; u; u = u->next)
|
for (u = r->units; u; u = u->next) {
|
||||||
if (u->ship == sh && fval(u, UFL_OWNER)) {
|
if (u->ship == sh && fval(u, UFL_OWNER)) {
|
||||||
of = u->faction;
|
of = u->faction;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (of == f) {
|
}
|
||||||
for (u = r->units; u; u = u->next) {
|
if (of == f) {
|
||||||
if (u->ship == sh) {
|
int n = 0, p = 0;
|
||||||
w += weight(u);
|
getshipweight(sh, &n, &p);
|
||||||
}
|
|
||||||
}
|
|
||||||
sprintf(buf, "%s, %s, (%d/%d)",
|
|
||||||
shipname(sh), LOC(f->locale, sh->type->name[0]),
|
|
||||||
(w + 99) / 100, shipcapacity(sh) / 100);
|
|
||||||
} else {
|
|
||||||
sprintf(buf, "%s, %s", shipname(sh), LOC(f->locale, sh->type->name[0]));
|
|
||||||
}
|
|
||||||
|
|
||||||
assert(sh->type->construction->improvement==NULL); /* sonst ist construction::size nicht ship_type::maxsize */
|
sprintf(buf, "%s, %s, (%d/%d)", shipname(sh),
|
||||||
if (sh->size!=sh->type->construction->maxsize) {
|
LOC(f->locale, sh->type->name[0]), n / 100, shipcapacity(sh) / 100);
|
||||||
sprintf(buf+strlen(buf), ", %s (%d/%d)",
|
} else {
|
||||||
LOC(f->locale, "nr_undercons"), sh->size,
|
sprintf(buf, "%s, %s", shipname(sh), LOC(f->locale, sh->type->name[0]));
|
||||||
sh->type->construction->maxsize);
|
}
|
||||||
}
|
|
||||||
if (sh->damage) {
|
|
||||||
sprintf(buf+strlen(buf), ", %d%% %s",
|
|
||||||
sh->damage*100/(sh->size*DAMAGE_SCALE),
|
|
||||||
LOC(f->locale, "nr_damaged"));
|
|
||||||
}
|
|
||||||
if (rterrain(r) != T_OCEAN) {
|
|
||||||
if (sh->coast != NODIRECTION) {
|
|
||||||
scat(", ");
|
|
||||||
scat(LOC(f->locale, coasts[sh->coast]));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ch = 0;
|
|
||||||
if (sh->display[0]) {
|
|
||||||
scat("; ");
|
|
||||||
scat(sh->display);
|
|
||||||
|
|
||||||
ch = sh->display[strlen(sh->display) - 1];
|
assert(sh->type->construction->improvement==NULL); /* sonst ist construction::size nicht ship_type::maxsize */
|
||||||
}
|
if (sh->size!=sh->type->construction->maxsize) {
|
||||||
if (ch != '!' && ch != '?' && ch != '.')
|
sprintf(buf+strlen(buf), ", %s (%d/%d)",
|
||||||
scat(".");
|
LOC(f->locale, "nr_undercons"), sh->size,
|
||||||
|
sh->type->construction->maxsize);
|
||||||
|
}
|
||||||
|
if (sh->damage) {
|
||||||
|
sprintf(buf+strlen(buf), ", %d%% %s",
|
||||||
|
sh->damage*100/(sh->size*DAMAGE_SCALE),
|
||||||
|
LOC(f->locale, "nr_damaged"));
|
||||||
|
}
|
||||||
|
if (rterrain(r) != T_OCEAN) {
|
||||||
|
if (sh->coast != NODIRECTION) {
|
||||||
|
scat(", ");
|
||||||
|
scat(LOC(f->locale, coasts[sh->coast]));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ch = 0;
|
||||||
|
if (sh->display[0]) {
|
||||||
|
scat("; ");
|
||||||
|
scat(sh->display);
|
||||||
|
|
||||||
rparagraph(F, buf, 2, 0);
|
ch = sh->display[strlen(sh->display) - 1];
|
||||||
|
}
|
||||||
|
if (ch != '!' && ch != '?' && ch != '.')
|
||||||
|
scat(".");
|
||||||
|
|
||||||
print_curses(F,f,sh,TYP_SHIP,4);
|
rparagraph(F, buf, 2, 0);
|
||||||
|
|
||||||
for (u = r->units; u; u = u->next)
|
print_curses(F,f,sh,TYP_SHIP,4);
|
||||||
if (u->ship == sh && fval(u, UFL_OWNER)) {
|
|
||||||
rpunit(F, f, u, 6, sd->mode);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
for (u = r->units; u; u = u->next)
|
|
||||||
if (u->ship == sh && !fval(u, UFL_OWNER))
|
|
||||||
rpunit(F, f, u, 6, sd->mode);
|
|
||||||
}
|
|
||||||
|
|
||||||
rnl(F);
|
for (u = r->units; u; u = u->next) {
|
||||||
rpline(F);
|
if (u->ship == sh && fval(u, UFL_OWNER)) {
|
||||||
}
|
rpunit(F, f, u, 6, sd->mode);
|
||||||
if (f->no != MONSTER_FACTION) {
|
break;
|
||||||
if (!anyunits) {
|
}
|
||||||
rnl(F);
|
}
|
||||||
rparagraph(F, LOC(f->locale, "nr_youaredead"), 0, 0);
|
for (u = r->units; u; u = u->next) {
|
||||||
} else {
|
if (u->ship == sh && !fval(u, UFL_OWNER)) {
|
||||||
list_address(F, f, addresses);
|
rpunit(F, f, u, 6, sd->mode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
rnl(F);
|
||||||
|
rpline(F);
|
||||||
|
}
|
||||||
|
if (f->no != MONSTER_FACTION) {
|
||||||
|
if (!anyunits) {
|
||||||
|
rnl(F);
|
||||||
|
rparagraph(F, LOC(f->locale, "nr_youaredead"), 0, 0);
|
||||||
|
} else {
|
||||||
|
list_address(F, f, addresses);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
FILE *
|
FILE *
|
||||||
|
|
|
@ -1159,6 +1159,7 @@ entership(unit * u, ship * sh, struct order * ord, boolean lasttry)
|
||||||
getshipweight(sh, &sweight, &scabins);
|
getshipweight(sh, &sweight, &scabins);
|
||||||
sweight += weight(u);
|
sweight += weight(u);
|
||||||
scabins += u->number;
|
scabins += u->number;
|
||||||
|
sweight = (sweight/100) * 100; /* Silberreste abrunden */
|
||||||
|
|
||||||
if (sweight > mweight || scabins > mcabins) {
|
if (sweight > mweight || scabins > mcabins) {
|
||||||
if (lasttry) cmistake(u, ord, 34, MSG_MOVE);
|
if (lasttry) cmistake(u, ord, 34, MSG_MOVE);
|
||||||
|
|
|
@ -433,8 +433,9 @@ cansail(const region * r, ship * sh)
|
||||||
if (sh->type->construction && sh->size!=sh->type->construction->maxsize)
|
if (sh->type->construction && sh->size!=sh->type->construction->maxsize)
|
||||||
return false;
|
return false;
|
||||||
getshipweight(sh, &n, &p);
|
getshipweight(sh, &n, &p);
|
||||||
|
n = (n/100) * 100; /* Silberreste abrunden */
|
||||||
|
|
||||||
if( is_cursed(sh->attribs, C_SHIP_FLYING, 0) ) {
|
if( is_cursed(sh->attribs, C_SHIP_FLYING, 0) ) {
|
||||||
if (sh->type->cargo>500*100)
|
if (sh->type->cargo>500*100)
|
||||||
assert(!"Ein Schiff wurde verzaubert, das zu groß ist");
|
assert(!"Ein Schiff wurde verzaubert, das zu groß ist");
|
||||||
if (n > 10000) return false;
|
if (n > 10000) return false;
|
||||||
|
|
|
@ -338,8 +338,6 @@ update_subscriptions(void)
|
||||||
int
|
int
|
||||||
process_orders()
|
process_orders()
|
||||||
{
|
{
|
||||||
struct summary * begin, * end;
|
|
||||||
|
|
||||||
if (turn == 0) srand(time((time_t *) NULL));
|
if (turn == 0) srand(time((time_t *) NULL));
|
||||||
else srand(turn);
|
else srand(turn);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue