Fix long lines. No functional changes.
This commit is contained in:
parent
ba2c537ce5
commit
4836f6c543
29 changed files with 141 additions and 79 deletions
|
@ -46,7 +46,8 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
int
|
int
|
||||||
login(int s, char *uname, char *cname, char *cpass, int kill_proc, int utf8)
|
login(int s, char *uname, char *cname, char *cpass,
|
||||||
|
int kill_proc, int utf8)
|
||||||
{
|
{
|
||||||
char tmp[128];
|
char tmp[128];
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
|
|
|
@ -54,7 +54,8 @@ getsose(void)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if (setupterm(NULL, fileno(stdout), &err) != OK) {
|
if (setupterm(NULL, fileno(stdout), &err) != OK) {
|
||||||
fprintf(stderr, "Can't setup terminal, check environment variable TERM\n");
|
fprintf(stderr,
|
||||||
|
"Can't setup terminal, check environment variable TERM\n");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -86,7 +86,8 @@ anti(void)
|
||||||
pr("No available mil or mob in sector.\n");
|
pr("No available mil or mob in sector.\n");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
pr("Sector mobility/troop strength will allow %d troops to engage.\n", avail_mil);
|
pr("Sector mobility/troop strength will allow %d troops to engage.\n",
|
||||||
|
avail_mil);
|
||||||
|
|
||||||
if (target == player->cnum) {
|
if (target == player->cnum) {
|
||||||
amil = mil;
|
amil = mil;
|
||||||
|
|
|
@ -109,7 +109,8 @@ boar(void)
|
||||||
foundland = 1;
|
foundland = 1;
|
||||||
}
|
}
|
||||||
if (!foundland) {
|
if (!foundland) {
|
||||||
pr("You don't have any mobility (sector or land units) in %s!\n", xyas(off->x, off->y, player->cnum));
|
pr("You don't have any mobility (sector or land units) in %s!\n",
|
||||||
|
xyas(off->x, off->y, player->cnum));
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -574,8 +574,8 @@ ship_bomb(struct emp_qelem *list, struct sctstr *target)
|
||||||
} else {
|
} else {
|
||||||
pr("splash\n");
|
pr("splash\n");
|
||||||
/* Bombs that miss have to land somewhere! */
|
/* Bombs that miss have to land somewhere! */
|
||||||
dam = pln_damage(&plp->plane, target->sct_x, target->sct_y, 'p',
|
dam = pln_damage(&plp->plane, target->sct_x, target->sct_y,
|
||||||
&nukedam, 0);
|
'p', &nukedam, 0);
|
||||||
collateral_damage(target->sct_x, target->sct_y, dam, list);
|
collateral_damage(target->sct_x, target->sct_y, dam, list);
|
||||||
dam = 0;
|
dam = 0;
|
||||||
}
|
}
|
||||||
|
@ -798,8 +798,8 @@ land_bomb(struct emp_qelem *list, struct sctstr *target)
|
||||||
} else {
|
} else {
|
||||||
pr("thud\n");
|
pr("thud\n");
|
||||||
/* Bombs that miss have to land somewhere! */
|
/* Bombs that miss have to land somewhere! */
|
||||||
dam = pln_damage(&plp->plane, target->sct_x, target->sct_y, 'p',
|
dam = pln_damage(&plp->plane, target->sct_x, target->sct_y,
|
||||||
&nukedam, 0);
|
'p', &nukedam, 0);
|
||||||
collateral_damage(target->sct_x, target->sct_y, dam, list);
|
collateral_damage(target->sct_x, target->sct_y, dam, list);
|
||||||
dam = 0;
|
dam = 0;
|
||||||
}
|
}
|
||||||
|
@ -838,8 +838,8 @@ strat_bomb(struct emp_qelem *list, struct sctstr *target)
|
||||||
if ((plp->pcp->pl_flags & P_C) && (!(plp->pcp->pl_flags & P_T)))
|
if ((plp->pcp->pl_flags & P_C) && (!(plp->pcp->pl_flags & P_T)))
|
||||||
continue;
|
continue;
|
||||||
if (plp->bombs || plp->plane.pln_nuketype != -1)
|
if (plp->bombs || plp->plane.pln_nuketype != -1)
|
||||||
dam += pln_damage(&plp->plane, target->sct_x, target->sct_y, 's',
|
dam += pln_damage(&plp->plane, target->sct_x, target->sct_y,
|
||||||
&nukedam, 1);
|
's', &nukedam, 1);
|
||||||
}
|
}
|
||||||
if (dam <= 0) /* dam == 0 if only nukes were delivered */
|
if (dam <= 0) /* dam == 0 if only nukes were delivered */
|
||||||
return;
|
return;
|
||||||
|
|
|
@ -121,7 +121,8 @@ buil(void)
|
||||||
}
|
}
|
||||||
if (type < 0) {
|
if (type < 0) {
|
||||||
pr("You can't build that!\n");
|
pr("You can't build that!\n");
|
||||||
pr("Use `show plane build %d' to show types you can build.\n", tlev);
|
pr("Use `show plane build %d' to show types you can build.\n",
|
||||||
|
tlev);
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -140,7 +141,8 @@ buil(void)
|
||||||
}
|
}
|
||||||
if (type < 0) {
|
if (type < 0) {
|
||||||
pr("You can't build that!\n");
|
pr("You can't build that!\n");
|
||||||
pr("Use `show ship build %d' to show types you can build.\n", tlev);
|
pr("Use `show ship build %d' to show types you can build.\n",
|
||||||
|
tlev);
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -159,7 +161,8 @@ buil(void)
|
||||||
}
|
}
|
||||||
if (type < 0) {
|
if (type < 0) {
|
||||||
pr("You can't build that!\n");
|
pr("You can't build that!\n");
|
||||||
pr("Use `show land build %d' to show types you can build.\n", tlev);
|
pr("Use `show land build %d' to show types you can build.\n",
|
||||||
|
tlev);
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -203,7 +206,8 @@ buil(void)
|
||||||
tt = (tlev < (rlev / drnuke_const) ? (int)tlev :
|
tt = (tlev < (rlev / drnuke_const) ? (int)tlev :
|
||||||
(int)(rlev / drnuke_const));
|
(int)(rlev / drnuke_const));
|
||||||
pr("You can't build that!\n");
|
pr("You can't build that!\n");
|
||||||
pr("Use `show nuke build %d' to show types you can build.\n", tt);
|
pr("Use `show nuke build %d' to show types you can build.\n",
|
||||||
|
tt);
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -572,8 +576,8 @@ build_bridge(struct sctstr *sp, short *vec)
|
||||||
xyas(sp->sct_x, sp->sct_y, player->cnum));
|
xyas(sp->sct_x, sp->sct_y, player->cnum));
|
||||||
nav_map(sp->sct_x, sp->sct_y, 1);
|
nav_map(sp->sct_x, sp->sct_y, 1);
|
||||||
}
|
}
|
||||||
if (!(p = getstarg(player->argp[3], "build span in what direction? ", buf))
|
p = getstarg(player->argp[3], "build span in what direction? ", buf);
|
||||||
|| !*p) {
|
if (!p || !*p) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* Sanity check time */
|
/* Sanity check time */
|
||||||
|
@ -836,8 +840,8 @@ build_tower(struct sctstr *sp, short *vec)
|
||||||
pr("Building from %s\n", xyas(sp->sct_x, sp->sct_y, player->cnum));
|
pr("Building from %s\n", xyas(sp->sct_x, sp->sct_y, player->cnum));
|
||||||
nav_map(sp->sct_x, sp->sct_y, 1);
|
nav_map(sp->sct_x, sp->sct_y, 1);
|
||||||
}
|
}
|
||||||
if (!(p = getstarg(player->argp[3], "build tower in what direction? ", buf))
|
p = getstarg(player->argp[3], "build tower in what direction? ", buf);
|
||||||
|| !*p) {
|
if (!p || !*p) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
/* Sanity check time */
|
/* Sanity check time */
|
||||||
|
|
|
@ -162,7 +162,8 @@ cede_sect(struct nstr_sect *ns, natid to)
|
||||||
bad = 0;
|
bad = 0;
|
||||||
}
|
}
|
||||||
if (bad) {
|
if (bad) {
|
||||||
pr("%s has no sector with mobility adjacent to or ship in %s!\n", cname(to), xyas(sect.sct_x, sect.sct_y, player->cnum));
|
pr("%s has no sector with mobility adjacent to or ship in %s!\n",
|
||||||
|
cname(to), xyas(sect.sct_x, sect.sct_y, player->cnum));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -126,7 +126,8 @@ do_desi(struct natstr *natp, s_char *sects, s_char *deschar, long int cash,
|
||||||
}
|
}
|
||||||
if (dchr[des].d_cost < 0) {
|
if (dchr[des].d_cost < 0) {
|
||||||
if (for_real)
|
if (for_real)
|
||||||
pr("Only %s can make a %s!\n", cname(0), dchr[des].d_name);
|
pr("Only %s can make a %s!\n",
|
||||||
|
cname(0), dchr[des].d_name);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -161,7 +161,8 @@ explore(void)
|
||||||
amount - left, ip->i_name, left, ip->i_name,
|
amount - left, ip->i_name, left, ip->i_name,
|
||||||
xyas(endsect.sct_x, endsect.sct_y, player->cnum));
|
xyas(endsect.sct_x, endsect.sct_y, player->cnum));
|
||||||
} else {
|
} else {
|
||||||
pr("All of the %s you were exploring with were destroyed!\n", ip->i_name);
|
pr("All of the %s you were exploring with were destroyed!\n",
|
||||||
|
ip->i_name);
|
||||||
}
|
}
|
||||||
amount = left;
|
amount = left;
|
||||||
}
|
}
|
||||||
|
|
|
@ -71,7 +71,8 @@ fort(void)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (land.lnd_land >= 0) {
|
if (land.lnd_land >= 0) {
|
||||||
pr("%s is on a land unit and can't be fortified\n", prland(&land));
|
pr("%s is on a land unit and can't be fortified\n",
|
||||||
|
prland(&land));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -429,8 +429,9 @@ launch_sat(struct plnstr *pp, int sublaunch)
|
||||||
pp->pln_x = sx;
|
pp->pln_x = sx;
|
||||||
pp->pln_y = sy;
|
pp->pln_y = sy;
|
||||||
pp->pln_flags |= PLN_LAUNCHED;
|
pp->pln_flags |= PLN_LAUNCHED;
|
||||||
pp->pln_mobil = (pp->pln_mobil > dist) ? (pp->pln_mobil - dist) : 0;
|
pp->pln_mobil = pp->pln_mobil > dist ? pp->pln_mobil - dist : 0;
|
||||||
putplane(pp->pln_uid, pp);
|
putplane(pp->pln_uid, pp);
|
||||||
pr(", will be ready for use in %d time units\n", plane_mob_max - pp->pln_mobil);
|
pr(", will be ready for use in %d time units\n",
|
||||||
|
plane_mob_max - pp->pln_mobil);
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -621,7 +621,8 @@ load_land_ship(struct sctstr *sectp, struct shpstr *sp, int noisy,
|
||||||
(sp->shp_nland >= mchr[(int)sp->shp_type].m_nland)) {
|
(sp->shp_nland >= mchr[(int)sp->shp_type].m_nland)) {
|
||||||
if (noisy) {
|
if (noisy) {
|
||||||
if (mchr[(int)sp->shp_type].m_nland)
|
if (mchr[(int)sp->shp_type].m_nland)
|
||||||
pr("%s doesn't have room for any more land units!\n", prship(sp));
|
pr("%s doesn't have room for any more land units!\n",
|
||||||
|
prship(sp));
|
||||||
else
|
else
|
||||||
pr("%s cannot carry land units!\n", prship(sp));
|
pr("%s cannot carry land units!\n", prship(sp));
|
||||||
}
|
}
|
||||||
|
@ -1079,7 +1080,8 @@ load_land_land(struct sctstr *sectp, struct lndstr *lp, int noisy,
|
||||||
if (lp->lnd_nland >= lp->lnd_maxland) {
|
if (lp->lnd_nland >= lp->lnd_maxland) {
|
||||||
if (noisy) {
|
if (noisy) {
|
||||||
if (lp->lnd_nland)
|
if (lp->lnd_nland)
|
||||||
pr("%s doesn't have room for any more land units!\n", prland(lp));
|
pr("%s doesn't have room for any more land units!\n",
|
||||||
|
prland(lp));
|
||||||
else
|
else
|
||||||
pr("%s cannot carry land units!\n", prland(lp));
|
pr("%s cannot carry land units!\n", prland(lp));
|
||||||
}
|
}
|
||||||
|
|
|
@ -82,10 +82,8 @@ pr_mark(struct comstr *comm)
|
||||||
if (tleft < 0.0)
|
if (tleft < 0.0)
|
||||||
tleft = 0.0;
|
tleft = 0.0;
|
||||||
pr(" %3d $%12.2f %2d %5.2f hrs (%3d) %c %6d ",
|
pr(" %3d $%12.2f %2d %5.2f hrs (%3d) %c %6d ",
|
||||||
comm->com_uid,
|
comm->com_uid, comm->com_price, comm->com_maxbidder, tleft,
|
||||||
comm->com_price,
|
comm->com_owner, ichr[comm->com_type].i_mnem, comm->com_amount);
|
||||||
comm->com_maxbidder,
|
|
||||||
tleft, comm->com_owner, ichr[comm->com_type].i_mnem, comm->com_amount);
|
|
||||||
if (comm->com_owner == player->cnum || player->god)
|
if (comm->com_owner == player->cnum || player->god)
|
||||||
pr("%s", xyas(comm->sell_x, comm->sell_y, player->cnum));
|
pr("%s", xyas(comm->sell_x, comm->sell_y, player->cnum));
|
||||||
pr("\n");
|
pr("\n");
|
||||||
|
|
|
@ -188,7 +188,8 @@ multifire(void)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (fland.lnd_effic < LAND_MINFIREEFF) {
|
if (fland.lnd_effic < LAND_MINFIREEFF) {
|
||||||
pr("Unit %d cannot fire because it is less than %d%% efficient\n", fland.lnd_uid, LAND_MINFIREEFF);
|
pr("Unit %d cannot fire because it is less than %d%% efficient\n",
|
||||||
|
fland.lnd_uid, LAND_MINFIREEFF);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
resupply_commod(&fland, I_SHELL); /* Get more shells */
|
resupply_commod(&fland, I_SHELL); /* Get more shells */
|
||||||
|
|
|
@ -163,7 +163,12 @@ landmine(void)
|
||||||
else
|
else
|
||||||
pr("\n");
|
pr("\n");
|
||||||
} else
|
} else
|
||||||
pr("%s ran out of %s before it could finish the job\nOnly %d mines were laid in %s\n", prland(&land), land.lnd_mobil > 0 ? "supply" : "mobility", total_mines_laid, xyas(sect.sct_x, sect.sct_y, land.lnd_own));
|
pr("%s ran out of %s before it could finish the job\n"
|
||||||
|
"Only %d mines were laid in %s\n",
|
||||||
|
prland(&land),
|
||||||
|
land.lnd_mobil > 0 ? "supply" : "mobility",
|
||||||
|
total_mines_laid,
|
||||||
|
xyas(sect.sct_x, sect.sct_y, land.lnd_own));
|
||||||
}
|
}
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -275,7 +275,9 @@ mission(void)
|
||||||
|
|
||||||
pcp = &plchr[(int)gp->type];
|
pcp = &plchr[(int)gp->type];
|
||||||
if (!(pcp->pl_flags & P_T)) {
|
if (!(pcp->pl_flags & P_T)) {
|
||||||
pr("Only planes with the tactical ability can interdict.\n%s #%d is ineligible\n", pcp->pl_name, gp->uid);
|
pr("Only planes with the tactical ability can interdict.\n"
|
||||||
|
"%s #%d is ineligible\n",
|
||||||
|
pcp->pl_name, gp->uid);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -285,7 +287,9 @@ mission(void)
|
||||||
|
|
||||||
pcp = &plchr[(int)gp->type];
|
pcp = &plchr[(int)gp->type];
|
||||||
if (!(pcp->pl_flags & P_F)) {
|
if (!(pcp->pl_flags & P_F)) {
|
||||||
pr("Only planes with the intercept abilities can perform air defense.\n%s #%d is ineligible\n", pcp->pl_name, gp->uid);
|
pr("Only planes with the intercept abilities can perform air defense.\n"
|
||||||
|
"%s #%d is ineligible\n",
|
||||||
|
pcp->pl_name, gp->uid);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -295,7 +299,9 @@ mission(void)
|
||||||
|
|
||||||
pcp = &plchr[(int)gp->type];
|
pcp = &plchr[(int)gp->type];
|
||||||
if (!(pcp->pl_flags & P_ESC) && !(pcp->pl_flags & P_F)) {
|
if (!(pcp->pl_flags & P_ESC) && !(pcp->pl_flags & P_F)) {
|
||||||
pr("Only planes with the escort or intercept abilities can escort.\n%s #%d is ineligible\n", pcp->pl_name, gp->uid);
|
pr("Only planes with the escort or intercept abilities can escort.\n"
|
||||||
|
"%s #%d is ineligible\n",
|
||||||
|
pcp->pl_name, gp->uid);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -306,7 +312,9 @@ mission(void)
|
||||||
|
|
||||||
pcp = &plchr[(int)gp->type];
|
pcp = &plchr[(int)gp->type];
|
||||||
if (!(pcp->pl_flags & P_T)) {
|
if (!(pcp->pl_flags & P_T)) {
|
||||||
pr("Only planes with the tactical ability can support.\n%s #%d is ineligible\n", pcp->pl_name, gp->uid);
|
pr("Only planes with the tactical ability can support.\n"
|
||||||
|
"%s #%d is ineligible\n",
|
||||||
|
pcp->pl_name, gp->uid);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -277,7 +277,8 @@ pdump(void)
|
||||||
case 19:
|
case 19:
|
||||||
if ((plchr[(int)plane.pln_type].pl_flags & (P_O | P_M)) ==
|
if ((plchr[(int)plane.pln_type].pl_flags & (P_O | P_M)) ==
|
||||||
P_O) {
|
P_O) {
|
||||||
pr(" %c", (plane.pln_flags & PLN_SYNCHRONOUS) ? 'Y' : 'N');
|
pr(" %c",
|
||||||
|
(plane.pln_flags & PLN_SYNCHRONOUS) ? 'Y' : 'N');
|
||||||
} else
|
} else
|
||||||
pr(" N");
|
pr(" N");
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -120,7 +120,8 @@ prod(void)
|
||||||
/* during the update, but it's the best we can really do */
|
/* during the update, but it's the best we can really do */
|
||||||
work = new_work(§,
|
work = new_work(§,
|
||||||
total_work(sect.sct_work, etu_per_update,
|
total_work(sect.sct_work, etu_per_update,
|
||||||
civs, sect.sct_item[I_MILIT], uws, maxpop));
|
civs, sect.sct_item[I_MILIT], uws,
|
||||||
|
maxpop));
|
||||||
bwork = work / 2;
|
bwork = work / 2;
|
||||||
|
|
||||||
if (sect.sct_off)
|
if (sect.sct_off)
|
||||||
|
|
|
@ -90,7 +90,9 @@ reje(void)
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
while (nxtitem(&ni, &nat)) {
|
while (nxtitem(&ni, &nat)) {
|
||||||
if (nat.nat_stat == STAT_GOD) {
|
if (nat.nat_stat == STAT_GOD) {
|
||||||
pr("You may not reject/accept stuff from %s\nbecause they are a deity.\n", nat.nat_cnam);
|
pr("You may not reject/accept stuff from %s\n"
|
||||||
|
"because they are a deity.\n",
|
||||||
|
nat.nat_cnam);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (nat.nat_stat == STAT_UNUSED)
|
if (nat.nat_stat == STAT_UNUSED)
|
||||||
|
|
|
@ -117,7 +117,8 @@ printdiff(struct natstr *plnatp, struct natstr *natp, int what)
|
||||||
int tolerance;
|
int tolerance;
|
||||||
|
|
||||||
if (ours
|
if (ours
|
||||||
&& plnatp->nat_stat >= STAT_ACTIVE && natp->nat_stat >= STAT_ACTIVE) {
|
&& plnatp->nat_stat >= STAT_ACTIVE
|
||||||
|
&& natp->nat_stat >= STAT_ACTIVE) {
|
||||||
theirs = natp->nat_level[what];
|
theirs = natp->nat_level[what];
|
||||||
if ((shift = MIN((int)theirs, (int)ours) - 100) > 0) {
|
if ((shift = MIN((int)theirs, (int)ours) - 100) > 0) {
|
||||||
ours -= shift;
|
ours -= shift;
|
||||||
|
|
|
@ -78,7 +78,8 @@ set(void)
|
||||||
check_market();
|
check_market();
|
||||||
check_trade();
|
check_trade();
|
||||||
|
|
||||||
if ((p = getstarg(player->argp[1], "Ship, plane, land unit or nuke? ", buf)) == 0)
|
p = getstarg(player->argp[1], "Ship, plane, land unit or nuke? ", buf);
|
||||||
|
if (p == 0)
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
if ((type = ef_byname_from(p, ef_saleable)) < 0) {
|
if ((type = ef_byname_from(p, ef_saleable)) < 0) {
|
||||||
pr("You can sell only ships, planes, land units or nukes\n");
|
pr("You can sell only ships, planes, land units or nukes\n");
|
||||||
|
|
|
@ -72,7 +72,8 @@ surv(void)
|
||||||
static s_char **map = NULL;
|
static s_char **map = NULL;
|
||||||
|
|
||||||
nsect = 0;
|
nsect = 0;
|
||||||
if ((ptr = getstarg(player->argp[1], "commodity or variable? ", buf)) == 0)
|
ptr = getstarg(player->argp[1], "commodity or variable? ", buf);
|
||||||
|
if (ptr == 0)
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
ptr = nstr_comp_val(ptr, &val, EF_SECTOR);
|
ptr = nstr_comp_val(ptr, &val, EF_SECTOR);
|
||||||
if (!ptr)
|
if (!ptr)
|
||||||
|
|
|
@ -226,7 +226,8 @@ tend_land(struct shpstr *tenderp, s_char *units)
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!(lchr[(int)land.lnd_type].l_flags & L_ASSAULT)) {
|
if (!(lchr[(int)land.lnd_type].l_flags & L_ASSAULT)) {
|
||||||
pr("%s does not have \"assault\" capability and can't be tended\n", prland(&land));
|
pr("%s does not have \"assault\" capability and can't be tended\n",
|
||||||
|
prland(&land));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (!snxtitem(&targets, EF_SHIP,
|
if (!snxtitem(&targets, EF_SHIP,
|
||||||
|
|
|
@ -135,7 +135,8 @@ upda(void)
|
||||||
if (*update_demandtimes != 0)
|
if (*update_demandtimes != 0)
|
||||||
pr("Demand updates are allowed during: %s\n",
|
pr("Demand updates are allowed during: %s\n",
|
||||||
update_demandtimes);
|
update_demandtimes);
|
||||||
pr("Demand updates require %d country(s) to want one.\n", update_wantmin);
|
pr("Demand updates require %d country(s) to want one.\n",
|
||||||
|
update_wantmin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (*game_days != 0)
|
if (*game_days != 0)
|
||||||
|
|
|
@ -109,8 +109,9 @@ lupgr(void)
|
||||||
if (sect.sct_type != SCT_HEADQ || sect.sct_effic < 60)
|
if (sect.sct_type != SCT_HEADQ || sect.sct_effic < 60)
|
||||||
continue;
|
continue;
|
||||||
rel = getrel(getnatp(land.lnd_own), sect.sct_own);
|
rel = getrel(getnatp(land.lnd_own), sect.sct_own);
|
||||||
if ((rel < FRIENDLY) && (sect.sct_own != land.lnd_own)) {
|
if (rel < FRIENDLY && sect.sct_own != land.lnd_own) {
|
||||||
pr("You are not on friendly terms with the owner of unit %d!\n", land.lnd_uid);
|
pr("You are not on friendly terms with the owner of unit %d!\n",
|
||||||
|
land.lnd_uid);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
n++;
|
n++;
|
||||||
|
@ -192,8 +193,9 @@ supgr(void)
|
||||||
if (sect.sct_type != SCT_HARBR || sect.sct_effic < 60)
|
if (sect.sct_type != SCT_HARBR || sect.sct_effic < 60)
|
||||||
continue;
|
continue;
|
||||||
rel = getrel(getnatp(ship.shp_own), sect.sct_own);
|
rel = getrel(getnatp(ship.shp_own), sect.sct_own);
|
||||||
if ((rel < FRIENDLY) && (sect.sct_own != ship.shp_own)) {
|
if (rel < FRIENDLY && sect.sct_own != ship.shp_own) {
|
||||||
pr("You are not on friendly terms with the owner of ship %d!\n", ship.shp_uid);
|
pr("You are not on friendly terms with the owner of ship %d!\n",
|
||||||
|
ship.shp_uid);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
n++;
|
n++;
|
||||||
|
@ -274,8 +276,9 @@ pupgr(void)
|
||||||
if (sect.sct_type != SCT_AIRPT || sect.sct_effic < 60)
|
if (sect.sct_type != SCT_AIRPT || sect.sct_effic < 60)
|
||||||
continue;
|
continue;
|
||||||
rel = getrel(getnatp(plane.pln_own), sect.sct_own);
|
rel = getrel(getnatp(plane.pln_own), sect.sct_own);
|
||||||
if ((rel < FRIENDLY) && (sect.sct_own != plane.pln_own)) {
|
if (rel < FRIENDLY && sect.sct_own != plane.pln_own) {
|
||||||
pr("You are not on friendly terms with the owner of plane %d!\n", plane.pln_uid);
|
pr("You are not on friendly terms with the owner of plane %d!\n",
|
||||||
|
plane.pln_uid);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
n++;
|
n++;
|
||||||
|
|
|
@ -95,11 +95,13 @@ vers(void)
|
||||||
|
|
||||||
pr("Banks pay $%.2f in interest per 1000 gold bars per etu.\n",
|
pr("Banks pay $%.2f in interest per 1000 gold bars per etu.\n",
|
||||||
bankint * 1000.0);
|
bankint * 1000.0);
|
||||||
pr("1000 civilians generate $%.2f, uncompensated workers $%.2f each time unit.\n", 1000.0 * money_civ, 1000.0 * money_uw);
|
pr("1000 civilians generate $%.2f, uncompensated workers $%.2f each time unit.\n",
|
||||||
|
1000.0 * money_civ, 1000.0 * money_uw);
|
||||||
pr("1000 active military cost $%.2f, reserves cost $%.2f.\n",
|
pr("1000 active military cost $%.2f, reserves cost $%.2f.\n",
|
||||||
-money_mil * 1000.0, -money_res * 1000.0);
|
-money_mil * 1000.0, -money_res * 1000.0);
|
||||||
if (rollover_avail_max)
|
if (rollover_avail_max)
|
||||||
pr("Up to %d avail can roll over an update.\n", rollover_avail_max);
|
pr("Up to %d avail can roll over an update.\n",
|
||||||
|
rollover_avail_max);
|
||||||
if (opt_SLOW_WAR)
|
if (opt_SLOW_WAR)
|
||||||
pr("Declaring war will cost you $%i\n\n", War_Cost);
|
pr("Declaring war will cost you $%i\n\n", War_Cost);
|
||||||
pr("Happiness p.e. requires 1 happy stroller per %d civ.\n",
|
pr("Happiness p.e. requires 1 happy stroller per %d civ.\n",
|
||||||
|
@ -109,9 +111,11 @@ vers(void)
|
||||||
pr("Happiness is averaged over %d time units.\n", (int)hap_avg);
|
pr("Happiness is averaged over %d time units.\n", (int)hap_avg);
|
||||||
pr("Education is averaged over %d time units.\n", (int)edu_avg);
|
pr("Education is averaged over %d time units.\n", (int)edu_avg);
|
||||||
if (opt_ALL_BLEED == 0)
|
if (opt_ALL_BLEED == 0)
|
||||||
pr("The technology/research boost you get from your allies is %.2f%%.\n", 100.0 / ally_factor);
|
pr("The technology/research boost you get from your allies is %.2f%%.\n",
|
||||||
|
100.0 / ally_factor);
|
||||||
else
|
else
|
||||||
pr("The technology/research boost you get from the world is %.2f%%.\n", 100.0 / ally_factor);
|
pr("The technology/research boost you get from the world is %.2f%%.\n",
|
||||||
|
100.0 / ally_factor);
|
||||||
|
|
||||||
pr("Nation levels (tech etc.) decline 1%% every %d time units.\n",
|
pr("Nation levels (tech etc.) decline 1%% every %d time units.\n",
|
||||||
(int)(level_age_rate));
|
(int)(level_age_rate));
|
||||||
|
@ -160,27 +164,39 @@ vers(void)
|
||||||
-(etu_per_update / sect_mob_neg_factor));
|
-(etu_per_update / sect_mob_neg_factor));
|
||||||
pr("\n");
|
pr("\n");
|
||||||
if (opt_FUEL)
|
if (opt_FUEL)
|
||||||
pr("For ships and land units, fuelu makes %d mobility.\n\n", fuel_mult);
|
pr("For ships and land units, fuelu makes %d mobility.\n\n",
|
||||||
|
fuel_mult);
|
||||||
pr("Ships on autonavigation may use %i cargo holds per ship.\n", TMAX);
|
pr("Ships on autonavigation may use %i cargo holds per ship.\n", TMAX);
|
||||||
if (opt_TRADESHIPS) {
|
if (opt_TRADESHIPS) {
|
||||||
pr("Trade-ships that go at least %d sectors get a return of %.1f%% per sector.\n", trade_1_dist, (float)(trade_1 * 100.0));
|
pr("Trade-ships that go at least %d sectors get a return of %.1f%% per sector.\n",
|
||||||
pr("Trade-ships that go at least %d sectors get a return of %.1f%% per sector.\n", trade_2_dist, (float)(trade_2 * 100.0));
|
trade_1_dist, (float)(trade_1 * 100.0));
|
||||||
pr("Trade-ships that go at least %d sectors get a return of %.1f%% per sector.\n", trade_3_dist, (float)(trade_3 * 100.0));
|
pr("Trade-ships that go at least %d sectors get a return of %.1f%% per sector.\n",
|
||||||
pr("Cashing in trade-ships with an ally nets you a %.1f%% bonus.\n", trade_ally_bonus * 100.0);
|
trade_2_dist, (float)(trade_2 * 100.0));
|
||||||
pr("Cashing in trade-ships with an ally nets your ally a %.1f%% bonus.\n\n", trade_ally_cut * 100.0);
|
pr("Trade-ships that go at least %d sectors get a return of %.1f%% per sector.\n",
|
||||||
|
trade_3_dist, (float)(trade_3 * 100.0));
|
||||||
|
pr("Cashing in trade-ships with an ally nets you a %.1f%% bonus.\n",
|
||||||
|
trade_ally_bonus * 100.0);
|
||||||
|
pr("Cashing in trade-ships with an ally nets your ally a %.1f%% bonus.\n\n",
|
||||||
|
trade_ally_cut * 100.0);
|
||||||
}
|
}
|
||||||
if (opt_MARKET) {
|
if (opt_MARKET) {
|
||||||
pr("The tax you pay on selling things on the trading block is %.1f%%\n", (1.00 - tradetax) * 100.0);
|
pr("The tax you pay on selling things on the trading block is %.1f%%\n",
|
||||||
pr("The tax you pay on buying commodities on the market is %.1f%%\n", (buytax - 1.00) * 100.0);
|
(1.00 - tradetax) * 100.0);
|
||||||
pr("The amount of time to bid on commodities is %d seconds.\n", MARK_DELAY);
|
pr("The tax you pay on buying commodities on the market is %.1f%%\n",
|
||||||
pr("The amount of time to bid on a unit is %d seconds.\n\n", TRADE_DELAY);
|
(buytax - 1.00) * 100.0);
|
||||||
|
pr("The amount of time to bid on commodities is %d seconds.\n",
|
||||||
|
MARK_DELAY);
|
||||||
|
pr("The amount of time to bid on a unit is %d seconds.\n\n",
|
||||||
|
TRADE_DELAY);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!ef_nelem(EF_NUKE_CHR))
|
if (!ef_nelem(EF_NUKE_CHR))
|
||||||
pr("Nukes are disabled.\n");
|
pr("Nukes are disabled.\n");
|
||||||
else if (drnuke_const > MIN_DRNUKE_CONST) {
|
else if (drnuke_const > MIN_DRNUKE_CONST) {
|
||||||
pr("In order to build a nuke, you need %1.2f times the tech level in research\n", drnuke_const);
|
pr("In order to build a nuke, you need %1.2f times the tech level in research\n",
|
||||||
pr("\tExample: In order to build a 300 tech nuke, you need %d research\n\n", (int)(300.0 * drnuke_const));
|
drnuke_const);
|
||||||
|
pr("\tExample: In order to build a 300 tech nuke, you need %d research\n\n",
|
||||||
|
(int)(300.0 * drnuke_const));
|
||||||
}
|
}
|
||||||
|
|
||||||
pr("Fire ranges are scaled by %.2f.\n", fire_range_factor);
|
pr("Fire ranges are scaled by %.2f.\n", fire_range_factor);
|
||||||
|
@ -218,9 +234,9 @@ vers(void)
|
||||||
show_opts(0);
|
show_opts(0);
|
||||||
pr("\n\nSee \"info Options\" for a detailed list of options and descriptions.\n");
|
pr("\n\nSee \"info Options\" for a detailed list of options and descriptions.\n");
|
||||||
show_custom();
|
show_custom();
|
||||||
pr("\nThe person to annoy if something goes wrong is:\n\t%s\n\t(%s).\n\n",
|
pr("\nThe person to annoy if something goes wrong is:\n\t%s\n\t(%s).\n",
|
||||||
privname, privlog);
|
privname, privlog);
|
||||||
pr("You can get your own copy of the source from "
|
pr("\nYou can get your own copy of the source from "
|
||||||
"http://www.wolfpackempire.com/\n\n");
|
"http://www.wolfpackempire.com/\n\n");
|
||||||
pr("%s", legal);
|
pr("%s", legal);
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
|
|
|
@ -92,7 +92,8 @@ work(void)
|
||||||
eff_amt = MIN(land.lnd_mobil, work_amt);
|
eff_amt = MIN(land.lnd_mobil, work_amt);
|
||||||
w = ldround(((double)eff_amt * land.lnd_effic / 600.0), 1);
|
w = ldround(((double)eff_amt * land.lnd_effic / 600.0), 1);
|
||||||
if (w < 1) {
|
if (w < 1) {
|
||||||
pr("%s doesn't work enough to change efficiency (try increasing amount)\n", prland(&land));
|
pr("%s doesn't work enough to change efficiency (try increasing amount)\n",
|
||||||
|
prland(&land));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
nunits++;
|
nunits++;
|
||||||
|
|
|
@ -237,10 +237,8 @@ msl_intercept(coord x, coord y, natid bombown, int hardtarget,
|
||||||
news_item = N_SAT_KILL;
|
news_item = N_SAT_KILL;
|
||||||
if (sect.sct_own) {
|
if (sect.sct_own) {
|
||||||
mpr(sect.sct_own, "%s has positioned a satellite over %s\n",
|
mpr(sect.sct_own, "%s has positioned a satellite over %s\n",
|
||||||
sublaunch ? (s_char *)"someone" : cname(bombown), xyas(x,
|
sublaunch ? "someone" : cname(bombown),
|
||||||
y,
|
xyas(x, y, sect.sct_own));
|
||||||
sect.
|
|
||||||
sct_own));
|
|
||||||
}
|
}
|
||||||
} else if (wantflags == P_N && nowantflags == P_O) {
|
} else if (wantflags == P_N && nowantflags == P_O) {
|
||||||
att_name = "warhead";
|
att_name = "warhead";
|
||||||
|
|
|
@ -206,23 +206,27 @@ main(int argc, char **argv)
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
ef_init();
|
ef_init();
|
||||||
if (chdir(configdir)) {
|
if (chdir(configdir)) {
|
||||||
fprintf(stderr, "Can't chdir to %s (%s)\n", configdir, strerror(errno));
|
fprintf(stderr, "Can't chdir to %s (%s)\n",
|
||||||
|
configdir, strerror(errno));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
if (chdir(builtindir)) {
|
if (chdir(builtindir)) {
|
||||||
fprintf(stderr, "Can't chdir to %s (%s)\n", builtindir, strerror(errno));
|
fprintf(stderr, "Can't chdir to %s (%s)\n",
|
||||||
|
builtindir, strerror(errno));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
if (read_builtin_tables() < 0)
|
if (read_builtin_tables() < 0)
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
if (chdir(configdir)) {
|
if (chdir(configdir)) {
|
||||||
fprintf(stderr, "Can't chdir to %s (%s)\n", configdir, strerror(errno));
|
fprintf(stderr, "Can't chdir to %s (%s)\n",
|
||||||
|
configdir, strerror(errno));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
if (read_custom_tables() < 0)
|
if (read_custom_tables() < 0)
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
if (chdir(gamedir)) {
|
if (chdir(gamedir)) {
|
||||||
fprintf(stderr, "Can't chdir to %s (%s)\n", gamedir, strerror(errno));
|
fprintf(stderr, "Can't chdir to %s (%s)\n",
|
||||||
|
gamedir, strerror(errno));
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -235,7 +239,10 @@ main(int argc, char **argv)
|
||||||
|
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
if (daemonize != 0) {
|
if (daemonize != 0) {
|
||||||
SERVICE_TABLE_ENTRY DispatchTable[]={{"Empire Server", service_main},{NULL, NULL}};
|
SERVICE_TABLE_ENTRY DispatchTable[]={
|
||||||
|
{"Empire Server", service_main},
|
||||||
|
{NULL, NULL}
|
||||||
|
};
|
||||||
if (StartServiceCtrlDispatcher(DispatchTable))
|
if (StartServiceCtrlDispatcher(DispatchTable))
|
||||||
return 0;
|
return 0;
|
||||||
else {
|
else {
|
||||||
|
@ -244,7 +251,8 @@ main(int argc, char **argv)
|
||||||
* start server in the foreground
|
* start server in the foreground
|
||||||
*/
|
*/
|
||||||
if (GetLastError() != ERROR_FAILED_SERVICE_CONTROLLER_CONNECT) {
|
if (GetLastError() != ERROR_FAILED_SERVICE_CONTROLLER_CONNECT) {
|
||||||
logerror("Failed to dispatch service (%lu)", GetLastError());
|
logerror("Failed to dispatch service (%lu)",
|
||||||
|
GetLastError());
|
||||||
finish_server();
|
finish_server();
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue