extern void as_delete(struct as_data *adp);
extern void as_reset(struct as_data *adp);
extern void as_stats(struct as_data *adp, FILE * fp);
-extern struct as_path *as_find_cachepath(coord fx,
- coord fy, coord tx, coord ty);
+extern struct as_path *as_find_cachepath(coord fx, coord fy,
+ coord tx, coord ty);
/* Functions that are "private" to algorithm */
snxtitem_all(&ni, EF_LAND);
while (nxtitem(&ni, &land)) {
if (land.lnd_own == coun) {
- makelost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x,
- land.lnd_y);
+ makelost(EF_LAND, land.lnd_own, land.lnd_uid,
+ land.lnd_x, land.lnd_y);
land.lnd_own = 0;
pr("Land unit %d wiped\n", land.lnd_uid);
putland(land.lnd_uid, &land);
sect.sct_item[I_MILIT] = ache;
if (sect.sct_own == sect.sct_oldown)
sect.sct_oldown = 0;
- makelost(EF_SECTOR, sect.sct_own, 0, sect.sct_x,
- sect.sct_y);
- makenotlost(EF_SECTOR, sect.sct_oldown, 0, sect.sct_x,
- sect.sct_y);
+ makelost(EF_SECTOR, sect.sct_own, 0,
+ sect.sct_x, sect.sct_y);
+ makenotlost(EF_SECTOR, sect.sct_oldown, 0,
+ sect.sct_x, sect.sct_y);
sect.sct_own = sect.sct_oldown;
sect.sct_off = 1; /* Turn the sector off */
putsect(§);
if (gun > 0) {
shell = ship.shp_item[I_SHELL];
if (shell <= 0)
- shell = supply_commod(ship.shp_own, ship.shp_x,
- ship.shp_y, I_SHELL, 1);
+ shell = supply_commod(ship.shp_own,
+ ship.shp_x, ship.shp_y, I_SHELL, 1);
}
mcp = &mchr[(int)ship.shp_type];
if (gun > 0 && shell > 0 && !(mcp->m_flags & M_SUB)) {
own = plane.pln_own;
if (dam > plane.pln_effic) {
plane.pln_effic = 0;
- makelost(EF_PLANE, plane.pln_own, plane.pln_uid, plane.pln_x,
- plane.pln_y);
+ makelost(EF_PLANE, plane.pln_own, plane.pln_uid,
+ plane.pln_x, plane.pln_y);
plane.pln_own = 0;
} else
plane.pln_effic -= dam;
if (sp->sct_pstage == PLG_INFECT)
ship.shp_pstage = PLG_EXPOSED;
- makenotlost(EF_SHIP, ship.shp_own, ship.shp_uid, ship.shp_x,
- ship.shp_y);
+ makenotlost(EF_SHIP, ship.shp_own, ship.shp_uid,
+ ship.shp_x, ship.shp_y);
putship(ship.shp_uid, &ship);
pr("%s", prship(&ship));
pr(" built in sector %s\n", xyas(sp->sct_x, sp->sct_y, player->cnum));
if (sp->sct_pstage == PLG_INFECT)
land.lnd_pstage = PLG_EXPOSED;
putland(nstr.cur, &land);
- makenotlost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x,
- land.lnd_y);
+ makenotlost(EF_LAND, land.lnd_own, land.lnd_uid,
+ land.lnd_x, land.lnd_y);
pr("%s", prland(&land));
pr(" built in sector %s\n", xyas(sp->sct_x, sp->sct_y, player->cnum));
return 1;
vec[I_HCM] -= hcm;
vec[I_MILIT] -= mil;
- makenotlost(EF_PLANE, plane.pln_own, plane.pln_uid, plane.pln_x,
- plane.pln_y);
+ makenotlost(EF_PLANE, plane.pln_own, plane.pln_uid,
+ plane.pln_x, plane.pln_y);
putplane(plane.pln_uid, &plane);
pr("%s built in sector %s\n", prplane(&plane),
xyas(sp->sct_x, sp->sct_y, player->cnum));
prplane(pp), cname(player->cnum));
makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, pp->pln_y);
pp->pln_own = to;
- makenotlost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x,
- pp->pln_y);
+ makenotlost(EF_PLANE, pp->pln_own, pp->pln_uid,
+ pp->pln_x, pp->pln_y);
pp->pln_mobil = 0;
pp->pln_mission = 0;
putplane(pp->pln_uid, pp);
prnuke(np), cname(player->cnum));
makelost(EF_NUKE, np->nuk_own, np->nuk_uid, np->nuk_x, np->nuk_y);
np->nuk_own = to;
- makenotlost(EF_NUKE, np->nuk_own, np->nuk_uid, np->nuk_x,
- np->nuk_y);
+ makenotlost(EF_NUKE, np->nuk_own, np->nuk_uid,
+ np->nuk_x, np->nuk_y);
putnuke(ni.cur, np);
}
prplane(pp), cname(player->cnum));
makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, pp->pln_y);
pp->pln_own = to;
- makenotlost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x,
- pp->pln_y);
+ makenotlost(EF_PLANE, pp->pln_own, pp->pln_uid,
+ pp->pln_x, pp->pln_y);
pp->pln_mobil = 0;
pp->pln_mission = 0;
putplane(pp->pln_uid, pp);
xyas(sect->sct_x, sect->sct_y, player->cnum),
cname(sect->sct_own), sect->sct_own, cname(newown), newown);
if (sect->sct_own) {
- makelost(EF_SECTOR, sect->sct_own, 0, sect->sct_x,
- sect->sct_y);
+ makelost(EF_SECTOR, sect->sct_own, 0,
+ sect->sct_x, sect->sct_y);
wu(player->cnum, sect->sct_own,
- "Sector %s lost to deity intervention\n", xyas(sect->sct_x,
- sect->sct_y,
- sect->
- sct_own));
+ "Sector %s lost to deity intervention\n",
+ xyas(sect->sct_x, sect->sct_y, sect->sct_own));
}
benefit(sect->sct_own, 0);
sect->sct_own = newown;
if (arg && arg < MAXNOC) {
wu(player->cnum, (natid)arg,
"%s given to you by deity intervention!\n", prship(ship));
- makelost(EF_SHIP, ship->shp_own, ship->shp_uid, ship->shp_x,
- ship->shp_y);
+ makelost(EF_SHIP, ship->shp_own, ship->shp_uid,
+ ship->shp_x, ship->shp_y);
ship->shp_own = (natid)arg;
- makenotlost(EF_SHIP, ship->shp_own, ship->shp_uid, ship->shp_x,
- ship->shp_y);
+ makenotlost(EF_SHIP, ship->shp_own, ship->shp_uid,
+ ship->shp_x, ship->shp_y);
} else if (!arg) {
ship->shp_effic = 0;
- makelost(EF_SHIP, ship->shp_own, ship->shp_uid, ship->shp_x,
- ship->shp_y);
+ makelost(EF_SHIP, ship->shp_own, ship->shp_uid,
+ ship->shp_x, ship->shp_y);
ship->shp_own = (natid)0;
}
break;
if (arg && arg < MAXNOC) {
wu(player->cnum, (natid)arg,
"%s given to you by deity intervention!\n", prland(land));
- makelost(EF_LAND, land->lnd_own, land->lnd_uid, land->lnd_x,
- land->lnd_y);
+ makelost(EF_LAND, land->lnd_own, land->lnd_uid,
+ land->lnd_x, land->lnd_y);
land->lnd_own = (natid)arg;
- makenotlost(EF_LAND, land->lnd_own, land->lnd_uid, land->lnd_x,
- land->lnd_y);
+ makenotlost(EF_LAND, land->lnd_own, land->lnd_uid,
+ land->lnd_x, land->lnd_y);
} else if (!arg) {
- makelost(EF_LAND, land->lnd_own, land->lnd_uid, land->lnd_x,
- land->lnd_y);
+ makelost(EF_LAND, land->lnd_own, land->lnd_uid,
+ land->lnd_x, land->lnd_y);
land->lnd_effic = 0;
land->lnd_own = (natid)0;
}
if (sect.sct_effic < 2) {
pr("The harbor at %s is not 2%% efficient yet.\n",
- xyas(item.ship.shp_x,
- item.ship.shp_y, player->cnum));
+ xyas(item.ship.shp_x, item.ship.shp_y,
+ player->cnum));
harbor = 0;
}
if ((sect.sct_own != player->cnum) && sect.sct_own)
if (retval != RET_OK)
return retval;
if (gone) {
- makelost(EF_PLANE, plane.pln_own, plane.pln_uid, plane.pln_x,
- plane.pln_y);
+ makelost(EF_PLANE, plane.pln_own, plane.pln_uid,
+ plane.pln_x, plane.pln_y);
plane.pln_own = 0;
putplane(plane.pln_uid, &plane);
}
sprintf(buf, "loaded on your %s at %s",
prship(sp), xyas(sp->shp_x, sp->shp_y, sp->shp_own));
gift(sp->shp_own, player->cnum, &pln, EF_PLANE, buf);
- makelost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x,
- pln.pln_y);
+ makelost(EF_PLANE, pln.pln_own, pln.pln_uid,
+ pln.pln_x, pln.pln_y);
pln.pln_own = sp->shp_own;
- makenotlost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x,
- pln.pln_y);
+ makenotlost(EF_PLANE, pln.pln_own, pln.pln_uid,
+ pln.pln_x, pln.pln_y);
pln.pln_mission = 0;
putplane(pln.pln_uid, &pln);
} else {
dchr[sectp->sct_type].d_name,
xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own));
gift(sectp->sct_own, player->cnum, &pln, EF_PLANE, buf);
- makelost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x,
- pln.pln_y);
+ makelost(EF_PLANE, pln.pln_own, pln.pln_uid,
+ pln.pln_x, pln.pln_y);
pln.pln_own = sectp->sct_own;
- makenotlost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x,
- pln.pln_y);
+ makenotlost(EF_PLANE, pln.pln_own, pln.pln_uid,
+ pln.pln_x, pln.pln_y);
putplane(pln.pln_uid, &pln);
}
pr("%s %s %s at %s.\n",
sprintf(buf, "loaded on your %s at %s",
prship(sp), xyas(sp->shp_x, sp->shp_y, sp->shp_own));
gift(sp->shp_own, player->cnum, &land, EF_LAND, buf);
- makelost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x,
- land.lnd_y);
+ makelost(EF_LAND, land.lnd_own, land.lnd_uid,
+ land.lnd_x, land.lnd_y);
land.lnd_own = sp->shp_own;
- makenotlost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x,
- land.lnd_y);
+ makenotlost(EF_LAND, land.lnd_own, land.lnd_uid,
+ land.lnd_x, land.lnd_y);
land.lnd_ship = sp->shp_uid;
land.lnd_harden = 0;
land.lnd_mission = 0;
sprintf(buf, "loaded on %s at %s",
prland(lp), xyas(lp->lnd_x, lp->lnd_y, lp->lnd_own));
gift(lp->lnd_own, player->cnum, &pln, EF_PLANE, buf);
- makelost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x,
- pln.pln_y);
+ makelost(EF_PLANE, pln.pln_own, pln.pln_uid,
+ pln.pln_x, pln.pln_y);
pln.pln_own = lp->lnd_own;
- makenotlost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x,
- pln.pln_y);
+ makenotlost(EF_PLANE, pln.pln_own, pln.pln_uid,
+ pln.pln_x, pln.pln_y);
putplane(pln.pln_uid, &pln);
} else {
if (!take_plane_off_land(&pln, lp)) {
sprintf(buf, "unloaded at your sector at %s",
xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own));
gift(sectp->sct_own, player->cnum, &pln, EF_PLANE, buf);
- makelost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x,
- pln.pln_y);
+ makelost(EF_PLANE, pln.pln_own, pln.pln_uid,
+ pln.pln_x, pln.pln_y);
pln.pln_own = sectp->sct_own;
- makenotlost(EF_PLANE, pln.pln_own, pln.pln_uid, pln.pln_x,
- pln.pln_y);
+ makenotlost(EF_PLANE, pln.pln_own, pln.pln_uid,
+ pln.pln_x, pln.pln_y);
putplane(pln.pln_uid, &pln);
}
pr("%s %s %s at %s.\n",
sprintf(buf, "loaded on your %s at %s",
prland(lp), xyas(lp->lnd_x, lp->lnd_y, lp->lnd_own));
gift(lp->lnd_own, player->cnum, &land, EF_LAND, buf);
- makelost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x,
- land.lnd_y);
+ makelost(EF_LAND, land.lnd_own, land.lnd_uid,
+ land.lnd_x, land.lnd_y);
land.lnd_own = lp->lnd_own;
- makenotlost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x,
- land.lnd_y);
+ makenotlost(EF_LAND, land.lnd_own, land.lnd_uid,
+ land.lnd_x, land.lnd_y);
land.lnd_land = lp->lnd_uid;
land.lnd_harden = 0;
land.lnd_mission = 0;
dchr[sectp->sct_type].d_name,
xyas(sectp->sct_x, sectp->sct_y, sectp->sct_own));
gift(sectp->sct_own, player->cnum, &land, EF_LAND, buf);
- makelost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x,
- land.lnd_y);
+ makelost(EF_LAND, land.lnd_own, land.lnd_uid,
+ land.lnd_x, land.lnd_y);
land.lnd_own = sectp->sct_own;
- makenotlost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x,
- land.lnd_y);
+ makenotlost(EF_LAND, land.lnd_own, land.lnd_uid,
+ land.lnd_x, land.lnd_y);
land.lnd_land = -1;
lp->lnd_nland--;
putland(land.lnd_uid, &land);
}
shell = fship.shp_item[I_SHELL];
if (shell < 2)
- shell += supply_commod(fship.shp_own, fship.shp_x,
- fship.shp_y, I_SHELL, 2 - shell);
+ shell += supply_commod(fship.shp_own,
+ fship.shp_x, fship.shp_y,
+ I_SHELL, 2 - shell);
if (shell <= 0) {
pr("Klick! ...\n");
continue;
fy = fsect.sct_y;
if (fsect.sct_own != player->cnum ||
fsect.sct_type != SCT_FORTR) {
- pr("No fortress at %s\n", xyas(fsect.sct_x,
- fsect.sct_y, player->cnum));
+ pr("No fortress at %s\n",
+ xyas(fsect.sct_x, fsect.sct_y, player->cnum));
continue;
}
if (target == targ_land) {
}
shell = fsect.sct_item[I_SHELL];
if (shell <= 0)
- shell += supply_commod(fsect.sct_own, fsect.sct_x,
- fsect.sct_y, I_SHELL, 1);
+ shell += supply_commod(fsect.sct_own,
+ fsect.sct_x, fsect.sct_y,
+ I_SHELL, 1);
if (shell <= 0) {
pr("Klick! ...\n");
continue;
if (mchr[(int)ship.shp_type].m_flags & M_SUB) {
if (shell < SHP_TORP_SHELLS)
- shell += supply_commod(ship.shp_own, ship.shp_x, ship.shp_y,
+ shell += supply_commod(ship.shp_own,
+ ship.shp_x, ship.shp_y,
I_SHELL, SHP_TORP_SHELLS - shell);
if (shell < SHP_TORP_SHELLS)
continue;
continue;
/* must have gun, shell, and milit to fire */
if (shell < 1)
- shell += supply_commod(ship.shp_own, ship.shp_x, ship.shp_y,
- I_SHELL, 1);
+ shell += supply_commod(ship.shp_own,
+ ship.shp_x, ship.shp_y, I_SHELL, 1);
/* only need 1 shell, so don't check that */
if (shell < 1)
continue;
#include "optlist.h"
/*
-** Command syntax:
-**
-** ORDER <ship> Show orders
-** ORDER <ship> c[ancel] Cancel orders
-** ORDER <ship> s[top] Suspend orders
-** ORDER <ship> r[esume] Resume orders
-** ORDER <ship> d[eclare] <dest1> Set destination
-** d[eclare] <dest1> <dest2>
-** ORDER <ship> l[evel] <field> <start/end> <comm> <level>
-**
-**
-** New syntax:
-** qorder <ship> display cargo levels
-** sorder <ship> display statistical info
+ * Command syntax:
+ *
+ * ORDER <ship> Show orders
+ * ORDER <ship> c[ancel] Cancel orders
+ * ORDER <ship> s[top] Suspend orders
+ * ORDER <ship> r[esume] Resume orders
+ * ORDER <ship> d[eclare] <dest1> Set destination
+ * d[eclare] <dest1> <dest2>
+ * ORDER <ship> l[evel] <field> <start/end> <comm> <level>
+ *
+ * New syntax:
+ * qorder <ship> display cargo levels
+ * sorder <ship> display statistical info
*/
int
else {
/* ETA calculation */
- c = BestShipPath(buf, ship.shp_x,
- ship.shp_y, ship.shp_destx[0],
- ship.shp_desty[0], ship.shp_own);
+ c = BestShipPath(buf, ship.shp_x, ship.shp_y,
+ ship.shp_destx[0], ship.shp_desty[0],
+ ship.shp_own);
if (!c)
pr(" no route possible");
else if (*c == 'h')
wu(player->cnum, amt,
"Sector %s gained from deity intervention\n",
xyas(sect.sct_x, sect.sct_y, amt));
- makelost(EF_SECTOR, sect.sct_own, 0, sect.sct_x,
- sect.sct_y);
+ makelost(EF_SECTOR, sect.sct_own, 0,
+ sect.sct_x, sect.sct_y);
makenotlost(EF_SECTOR, amt, 0, sect.sct_x, sect.sct_y);
-
sect.sct_own = (natid)amt;
putsect(§);
}
tmcp = &mchr[(int)targ->shp_type];
if (!(tmcp->m_flags & M_SUB))
continue;
- if (roll(100) >
- pln_identchance(pp, shp_hardtarget(targ), EF_SHIP))
+ if (roll(100) > pln_identchance(pp, shp_hardtarget(targ),
+ EF_SHIP))
continue;
pingrange = MAX(targ->shp_visib, 10) * range / 10;
vrange = pingrange * (pp->pln_effic / 200.0);
if (getrel(getnatp(targ->shp_own), pp->pln_own) < FRIENDLY &&
roll(100) > pln_identchance(pp, shp_hardtarget(targ),
EF_SHIP))
- if (roll(100) >
- pln_identchance(pp, shp_hardtarget(targ), EF_SHIP))
+ if (roll(100) > pln_identchance(pp, shp_hardtarget(targ),
+ EF_SHIP))
mpr(pp->pln_own, "sub #%d %s\n", targ->shp_uid,
xyas(targ->shp_x, targ->shp_y, pp->pln_own));
else
} else {
insert(table, &t_len, nx, ny);
spyline(&dsect);
- changed += map_set(player->cnum, dsect.sct_x,
- dsect.sct_y,
+ changed += map_set(player->cnum, dsect.sct_x, dsect.sct_y,
dchr[dsect.sct_type].d_mnem, 0);
prunits(dsect.sct_x, dsect.sct_y);
prplanes(dsect.sct_x, dsect.sct_y);
if (nrecon && caught) {
insert(table, &t_len, nx, ny);
spyline(&dsect);
- changed += map_set(player->cnum, dsect.sct_x,
- dsect.sct_y,
+ changed += map_set(player->cnum, dsect.sct_x, dsect.sct_y,
dchr[dsect.sct_type].d_mnem, 0);
prunits(dsect.sct_x, dsect.sct_y);
prplanes(dsect.sct_x, dsect.sct_y);
prship(&target), xyas(target.shp_x, target.shp_y,
target.shp_own));
gift(target.shp_own, player->cnum, &land, EF_LAND, buf);
- makelost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x,
- land.lnd_y);
+ makelost(EF_LAND, land.lnd_own, land.lnd_uid,
+ land.lnd_x, land.lnd_y);
land.lnd_own = target.shp_own;
- makenotlost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x,
- land.lnd_y);
+ makenotlost(EF_LAND, land.lnd_own, land.lnd_uid,
+ land.lnd_x, land.lnd_y);
land.lnd_ship = target.shp_uid;
land.lnd_harden = 0;
land.lnd_mission = 0;
gun = MIN(gun, sp->shp_glim);
gun = MIN(gun, sp->shp_item[I_MILIT] / 2);
- shells +=
- supply_commod(sp->shp_own, sp->shp_x, sp->shp_y, I_SHELL,
- (gun + 1) / 2 - shells);
+ shells += supply_commod(sp->shp_own, sp->shp_x, sp->shp_y,
+ I_SHELL, (gun + 1) / 2 - shells);
gun = MIN(gun, shells * 2);
if (gun == 0)
shells = sp->shp_item[I_SHELL];
if (shells < SHP_TORP_SHELLS)
- shells += supply_commod(sp->shp_own, sp->shp_x, sp->shp_y, I_SHELL,
- SHP_TORP_SHELLS - shells);
+ shells += supply_commod(sp->shp_own, sp->shp_x, sp->shp_y,
+ I_SHELL, SHP_TORP_SHELLS - shells);
if (sp->shp_item[I_GUN] == 0 || shells < SHP_TORP_SHELLS)
return 0;
case EF_NUKE:
tg.nuk.nuk_x = trade.trd_x;
tg.nuk.nuk_y = trade.trd_y;
- makelost(EF_NUKE, tg.nuk.nuk_own, tg.nuk.nuk_uid, tg.nuk.nuk_x,
- tg.nuk.nuk_y);
+ makelost(EF_NUKE, tg.nuk.nuk_own, tg.nuk.nuk_uid,
+ tg.nuk.nuk_x, tg.nuk.nuk_y);
tg.nuk.nuk_own = trade.trd_maxbidder;
makenotlost(EF_NUKE, tg.nuk.nuk_own, tg.nuk.nuk_uid,
tg.nuk.nuk_x, tg.nuk.nuk_y);
ship.shp_nland--;
putship(ship.shp_uid, &ship);
}
- makelost(EF_LAND, tg.lnd.lnd_own, tg.lnd.lnd_uid, tg.lnd.lnd_x,
- tg.lnd.lnd_y);
+ makelost(EF_LAND, tg.lnd.lnd_own, tg.lnd.lnd_uid,
+ tg.lnd.lnd_x, tg.lnd.lnd_y);
tg.lnd.lnd_own = trade.trd_maxbidder;
makenotlost(EF_LAND, tg.lnd.lnd_own, tg.lnd.lnd_uid,
tg.lnd.lnd_x, tg.lnd.lnd_y);
}
pr("\n");
pr("\t\t\t\tSectors\tShips\tPlanes\tUnits\n");
- pr("Maximum mobility\t\t%d\t%d\t%d\t%d\n", sect_mob_max,
- ship_mob_max, plane_mob_max, land_mob_max);
+ pr("Maximum mobility\t\t%d\t%d\t%d\t%d\n",
+ sect_mob_max, ship_mob_max, plane_mob_max, land_mob_max);
pr("Max mob gain per update\t\t%d\t%d\t%d\t%d\n",
(int)(sect_mob_scale * (float)etu_per_update),
(int)(ship_mob_scale * (float)etu_per_update),
mpr(land.lnd_own, "\07");
mpr(land.lnd_own, " AARGH! %s tumbles to its doom!\n",
prland(&land));
- makelost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x,
- land.lnd_y);
+ makelost(EF_LAND, land.lnd_own, land.lnd_uid,
+ land.lnd_x, land.lnd_y);
land.lnd_own = 0;
land.lnd_effic = 0;
putland(land.lnd_uid, &land);
mpr(plane.pln_own, "\07");
mpr(plane.pln_own, " AARGH! %s tumbles to its doom!\n",
prplane(&plane));
- makelost(EF_PLANE, plane.pln_own, plane.pln_uid, plane.pln_x,
- plane.pln_y);
+ makelost(EF_PLANE, plane.pln_own, plane.pln_uid,
+ plane.pln_x, plane.pln_y);
plane.pln_own = 0;
plane.pln_effic = 0;
putplane(plane.pln_uid, &plane);
mpr(nuke.nuk_own, "\07");
mpr(nuke.nuk_own, " %s sinks to the bottom of the sea!\n",
prnuke(&nuke));
- makelost(EF_NUKE, nuke.nuk_own, nuke.nuk_uid, nuke.nuk_x,
- nuke.nuk_y);
+ makelost(EF_NUKE, nuke.nuk_own, nuke.nuk_uid,
+ nuke.nuk_x, nuke.nuk_y);
nuke.nuk_own = 0;
nuke.nuk_effic = 0;
putnuke(nuke.nuk_uid, &nuke);
} else {
PR(plane_owner, "flying over %s at %s\n",
dchr[sect.sct_type].d_name, xyas(x, y, plane_owner));
- changed += map_set(plane_owner, sect.sct_x,
- sect.sct_y, dchr[sect.sct_type].d_mnem, 0);
+ changed += map_set(plane_owner, sect.sct_x, sect.sct_y,
+ dchr[sect.sct_type].d_mnem, 0);
}
if ((rel = getrel(over, plane_owner)) == ALLIED)
continue;
/* Flag that we intercepted */
intown = 1;
/* And now intercept again */
- ac_intercept(bomb_list, esc_list, &ilist[cn], cn, x,
- y);
+ ac_intercept(bomb_list, esc_list, &ilist[cn],
+ cn, x, y);
}
}
}
if (!evaded) {
if (intown == -1) {
/* We haven't intercepted yet, so intercept */
- ac_intercept(bomb_list, esc_list, &ilist[cn], cn,
- x, y);
+ ac_intercept(bomb_list, esc_list, &ilist[cn],
+ cn, x, y);
}
}
}
if (gun) {
shell = ship.shp_item[I_SHELL];
if (shell <= 0) {
- shell = supply_commod(ship.shp_own, ship.shp_x,
- ship.shp_y, I_SHELL, 1);
+ shell = supply_commod(ship.shp_own, ship.shp_x, ship.shp_y,
+ I_SHELL, 1);
ship.shp_item[I_SHELL] = shell;
putship(ship.shp_uid, &ship);
}
else
land.lnd_mobil = (signed char)(com->mob - com->mobcost);
}
- makelost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x,
- land.lnd_y);
+ makelost(EF_LAND, land.lnd_own, land.lnd_uid,
+ land.lnd_x, land.lnd_y);
land.lnd_own = com->own;
- makenotlost(EF_LAND, land.lnd_own, land.lnd_uid, land.lnd_x,
- land.lnd_y);
+ makenotlost(EF_LAND, land.lnd_own, land.lnd_uid,
+ land.lnd_x, land.lnd_y);
if (com->plague) {
if (land.lnd_pstage == PLG_HEALTHY)
land.lnd_pstage = PLG_EXPOSED;
else
ship.shp_mobil = (signed char)(com->mob - com->mobcost);
}
- makelost(EF_SHIP, ship.shp_own, ship.shp_uid, ship.shp_x,
- ship.shp_y);
+ makelost(EF_SHIP, ship.shp_own, ship.shp_uid,
+ ship.shp_x, ship.shp_y);
ship.shp_own = com->own;
- makenotlost(EF_SHIP, ship.shp_own, ship.shp_uid, ship.shp_x,
- ship.shp_y);
+ makenotlost(EF_SHIP, ship.shp_own, ship.shp_uid,
+ ship.shp_x, ship.shp_y);
if (com->plague) {
if (ship.shp_pstage == PLG_HEALTHY)
ship.shp_pstage = PLG_EXPOSED;
continue;
if (roll(100) >= damage)
continue;
- makelost(EF_NUKE, nuke.nuk_own, nuke.nuk_uid, nuke.nuk_x,
- nuke.nuk_y);
+ makelost(EF_NUKE, nuke.nuk_own, nuke.nuk_uid,
+ nuke.nuk_x, nuke.nuk_y);
nuke.nuk_own = 0;
if (own == bombown) {
mpr(bombown, "%s at %s destroyed\n",
else
wu(0, ship.shp_own,
"%s supported %s attacks against %s at %s, doing %d damage.\n",
- prship(&ship), cname(own), cname(att), xyas(x, y,
- ship.
- shp_own),
- dam);
+ prship(&ship), cname(own), cname(att),
+ xyas(x, y, ship.shp_own), dam);
}
}
}
return 0;
shell = sp->sct_item[I_SHELL];
if (shell <= 0)
- shell += supply_commod(sp->sct_own, sp->sct_x, sp->sct_y, I_SHELL,
- 1);
+ shell += supply_commod(sp->sct_own, sp->sct_x, sp->sct_y,
+ I_SHELL, 1);
if (shell <= 0)
return 0;
sp->sct_item[I_SHELL] = shell - 1;
if (sp->sct_own != def)
wu(0, sp->sct_own,
"%s fired on %s in %s in defense of %s, doing %d damage!\n",
- xyas(sp->sct_x, sp->sct_y, sp->sct_own), cname(att), xyas(tx,
- ty,
- sp->
- sct_own),
- cname(def), damage);
+ xyas(sp->sct_x, sp->sct_y, sp->sct_own), cname(att),
+ xyas(tx, ty, sp->sct_own), cname(def), damage);
if (defending)
nreport(sp->sct_own, N_FIRE_BACK, att, 1);
else
time(&llp->lnd_timestamp);
if (llp->lnd_own && llp->lnd_effic < LAND_MINEFF) {
- makelost(EF_LAND, llp->lnd_own, llp->lnd_uid, llp->lnd_x,
- llp->lnd_y);
+ makelost(EF_LAND, llp->lnd_own, llp->lnd_uid,
+ llp->lnd_x, llp->lnd_y);
llp->lnd_own = 0;
getland(n, &land);
for (i = 0; NULL != (lp = getlandp(i)); i++) {
if (lp->lnd_own && lp->lnd_land == n) {
mpr(lp->lnd_own, "%s MIA!\n", prland(lp));
- makelost(EF_LAND, lp->lnd_own, lp->lnd_uid, lp->lnd_x,
- lp->lnd_y);
+ makelost(EF_LAND, lp->lnd_own, lp->lnd_uid,
+ lp->lnd_x, lp->lnd_y);
lp->lnd_own = 0;
lp->lnd_effic = 0;
lp->lnd_ship = -1;
for (i = 0; NULL != (pp = getplanep(i)); i++) {
if (pp->pln_own && pp->pln_land == n) {
mpr(pp->pln_own, "%s MIA!\n", prplane(pp));
- makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x,
- pp->pln_y);
+ makelost(EF_PLANE, pp->pln_own, pp->pln_uid,
+ pp->pln_x, pp->pln_y);
pp->pln_own = 0;
pp->pln_effic = 0;
pp->pln_ship = -1;
continue;
shell = fsect.sct_item[I_SHELL];
if (shell < 1)
- shell += supply_commod(fsect.sct_own,
- fsect.sct_x, fsect.sct_y, I_SHELL, 1);
+ shell += supply_commod(fsect.sct_own, fsect.sct_x, fsect.sct_y,
+ I_SHELL, 1);
if (shell < 1)
continue;
shell--;
/* use up missiles */
if (plp->pcp->pl_flags & P_M) {
- makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x,
- pp->pln_y);
+ makelost(EF_PLANE, pp->pln_own, pp->pln_uid,
+ pp->pln_x, pp->pln_y);
pp->pln_own = 0;
}
}
if (pp->pln_effic < PLANE_MINEFF) {
if (pp->pln_own)
- makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x,
- pp->pln_y);
+ makelost(EF_PLANE, pp->pln_own, pp->pln_uid,
+ pp->pln_x, pp->pln_y);
pp->pln_own = 0;
pp->pln_effic = 0;
for (i = 0; NULL != (np = getnukep(i)); i++) {
} else {
if (pp->pln_own != sect.sct_own) {
wu(0, sect.sct_own, "%s %s prepares for takeoff from %s\n",
- cname(pp->pln_own), prplane(pp), xyas(sect.sct_x,
- sect.sct_y,
- sect.sct_own));
+ cname(pp->pln_own), prplane(pp),
+ xyas(sect.sct_x, sect.sct_y, sect.sct_own));
}
putsect(§);
}
for (i = 0; NULL != (lp = getlandp(i)); i++) {
if (lp->lnd_own && lp->lnd_ship == n) {
mpr(lp->lnd_own, "%s sunk!\n", prland(lp));
- makelost(EF_LAND, lp->lnd_own, lp->lnd_uid, lp->lnd_x,
- lp->lnd_y);
+ makelost(EF_LAND, lp->lnd_own, lp->lnd_uid,
+ lp->lnd_x, lp->lnd_y);
lp->lnd_own = 0;
lp->lnd_effic = 0;
lp->lnd_ship = -1;
for (i = 0; NULL != (pp = getplanep(i)); i++) {
if (pp->pln_own && pp->pln_ship == n) {
mpr(pp->pln_own, "%s sunk!\n", prplane(pp));
- makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x,
- pp->pln_y);
+ makelost(EF_PLANE, pp->pln_own, pp->pln_uid,
+ pp->pln_x, pp->pln_y);
pp->pln_own = 0;
pp->pln_effic = 0;
pp->pln_ship = -1;
}
static int
-shp_count(struct emp_qelem *list, int wantflags, int nowantflags, int x,
- int y)
+shp_count(struct emp_qelem *list, int wantflags, int nowantflags,
+ int x, int y)
{
struct emp_qelem *qp;
struct emp_qelem *next;
continue;
shell = fsect.sct_item[I_SHELL];
if (shell < 1)
- shell += supply_commod(fsect.sct_own,
- fsect.sct_x, fsect.sct_y, I_SHELL, 1);
+ shell += supply_commod(fsect.sct_own, fsect.sct_x, fsect.sct_y,
+ I_SHELL, 1);
if (shell < 1)
continue;
shell--;
/* Ok, do we now have enough? */
amt = get_minimum(lp, type) - lp->lnd_item[type];
if (amt > 0) {
- lp->lnd_item[type] += supply_commod(lp->lnd_own, lp->lnd_x, lp->lnd_y,
+ lp->lnd_item[type] += supply_commod(lp->lnd_own,
+ lp->lnd_x, lp->lnd_y,
type, amt);
amt = get_minimum(lp, type) - lp->lnd_item[type];
}
if (shells < shells_needed) {
lp->lnd_item[I_SHELL] = 0;
putland(lp->lnd_uid, lp);
- shells += supply_commod(lp->lnd_own, lp->lnd_x, lp->lnd_y, I_SHELL,
- (shells_needed - shells));
+ shells += supply_commod(lp->lnd_own, lp->lnd_x, lp->lnd_y,
+ I_SHELL, shells_needed - shells);
lp->lnd_item[I_SHELL] = shells;
}
if (food < food_needed) {
lp->lnd_item[I_FOOD] = 0;
putland(lp->lnd_uid, lp);
- food += supply_commod(lp->lnd_own, lp->lnd_x, lp->lnd_y, I_FOOD,
- (food_needed - food));
+ food += supply_commod(lp->lnd_own, lp->lnd_x, lp->lnd_y,
+ I_FOOD, food_needed - food);
lp->lnd_item[I_FOOD] = food;
}
if (petrol < petrol_needed) {
lp->lnd_item[I_PETROL] = 0;
putland(lp->lnd_uid, lp);
- petrol += supply_commod(lp->lnd_own,
- lp->lnd_x, lp->lnd_y,
- I_PETROL, (petrol_needed - petrol));
+ petrol += supply_commod(lp->lnd_own, lp->lnd_x, lp->lnd_y,
+ I_PETROL, petrol_needed - petrol);
lp->lnd_item[I_PETROL] = petrol;
}
pp->pln_mission = 0;
makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, pp->pln_y);
pp->pln_own = newown;
- makenotlost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x,
- pp->pln_y);
+ makenotlost(EF_PLANE, pp->pln_own, pp->pln_uid,
+ pp->pln_x, pp->pln_y);
putplane(pp->pln_uid, pp);
}
/* Take over land units */
if (opt_MARKET)
trdswitchown(EF_LAND, landp, newown);
landp->lnd_mission = 0;
- makelost(EF_LAND, landp->lnd_own, landp->lnd_uid, landp->lnd_x,
- landp->lnd_y);
+ makelost(EF_LAND, landp->lnd_own, landp->lnd_uid,
+ landp->lnd_x, landp->lnd_y);
landp->lnd_own = newown;
- makenotlost(EF_LAND, landp->lnd_own, landp->lnd_uid, landp->lnd_x,
- landp->lnd_y);
+ makenotlost(EF_LAND, landp->lnd_own, landp->lnd_uid,
+ landp->lnd_x, landp->lnd_y);
pp = &p;
lp = &llp;
/* Take over planes */
pp->pln_mission = 0;
makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x, pp->pln_y);
pp->pln_own = newown;
- makenotlost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x,
- pp->pln_y);
+ makenotlost(EF_PLANE, pp->pln_own, pp->pln_uid,
+ pp->pln_x, pp->pln_y);
putplane(pp->pln_uid, pp);
}
/* Take over land units */
/* now, get the dist sector */
dist = getsectp(sp->sct_dist_x, sp->sct_dist_y);
if (dist == NULL) {
- logerror("Bad dist sect %d,%d for %d,%d !\n", sp->sct_dist_x,
- sp->sct_dist_y, sp->sct_x, sp->sct_y);
+ logerror("Bad dist sect %d,%d for %d,%d !\n",
+ sp->sct_dist_x, sp->sct_dist_y,
+ sp->sct_x, sp->sct_y);
continue;
}
/* Now, get the best distribution path over roads */
needed = ldround((double)(1 + etu * people * eatrate), 1);
/* Now, find some food */
- vec[I_FOOD] = supply_commod(sp->sct_own, sp->sct_x,
- sp->sct_y, I_FOOD, needed);
-
+ vec[I_FOOD] = supply_commod(sp->sct_own,
+ sp->sct_x, sp->sct_y,
+ I_FOOD, needed);
}
}
starved = feed_people(vec, etu, &needed);
if (np->nat_priorities[PRI_LBUILD] == 0 || np->nat_money < 0)
return;
if (lp->lnd_effic < LAND_MINEFF || !landrepair(lp, np, bp, etus)) {
- makelost(EF_LAND, lp->lnd_own, lp->lnd_uid, lp->lnd_x,
- lp->lnd_y);
+ makelost(EF_LAND, lp->lnd_own, lp->lnd_uid,
+ lp->lnd_x, lp->lnd_y);
lp->lnd_own = 0;
return;
}
if ((eff = lp->lnd_effic - etus / 5) < LAND_MINEFF) {
wu(0, lp->lnd_own,
"%s lost to lack of maintenance\n", prland(lp));
- makelost(EF_LAND, lp->lnd_own, lp->lnd_uid, lp->lnd_x,
- lp->lnd_y);
+ makelost(EF_LAND, lp->lnd_own, lp->lnd_uid,
+ lp->lnd_x, lp->lnd_y);
lp->lnd_own = 0;
return;
}
if ((d - (int)d) > 0.0)
d++;
need = (int)d;
- newfuel = supply_commod(sp->shp_own, sp->shp_x,
- sp->shp_y, I_PETROL, need);
+ newfuel = supply_commod(sp->shp_own, sp->shp_x, sp->shp_y,
+ I_PETROL, need);
sp->shp_fuel += newfuel * 5;
}
if ((d - (int)d) > 0.0)
d++;
need = (int)d;
- newfuel = supply_commod(sp->shp_own, sp->shp_x,
- sp->shp_y, I_OIL, need);
+ newfuel = supply_commod(sp->shp_own, sp->shp_x, sp->shp_y,
+ I_OIL, need);
sp->shp_fuel += newfuel * 50;
}
if ((d - (int)d) > 0.0)
d++;
need = (int)d;
- newfuel = supply_commod(lp->lnd_own, lp->lnd_x,
- lp->lnd_y, I_PETROL, need);
+ newfuel = supply_commod(lp->lnd_own, lp->lnd_x, lp->lnd_y,
+ I_PETROL, need);
lp->lnd_fuel += newfuel * 5;
}
if ((d - (int)d) > 0.0)
d++;
need = (int)d;
- newfuel = supply_commod(lp->lnd_own, lp->lnd_x,
- lp->lnd_y, I_OIL, need);
+ newfuel = supply_commod(lp->lnd_own, lp->lnd_x, lp->lnd_y,
+ I_OIL, need);
lp->lnd_fuel += newfuel * 50;
}
d++;
need = (int)d;
- newfuel = supply_commod(sp->shp_own, sp->shp_x,
- sp->shp_y, I_PETROL, need);
+ newfuel = supply_commod(sp->shp_own, sp->shp_x, sp->shp_y,
+ I_PETROL, need);
add_fuel += newfuel * 5;
if (add_fuel > maxfuel)
add_fuel = maxfuel;
d++;
need = (int)d;
- newfuel = supply_commod(sp->shp_own, sp->shp_x,
- sp->shp_y, I_OIL, need);
+ newfuel = supply_commod(sp->shp_own, sp->shp_x, sp->shp_y,
+ I_OIL, need);
add_fuel = newfuel * 50;
if (add_fuel > maxfuel)
add_fuel = maxfuel;
/* nplane is unsigned... */
if (shp->shp_nplane > 0)
shp->shp_nplane--;
- makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x,
- pp->pln_y);
+ makelost(EF_PLANE, pp->pln_own, pp->pln_uid,
+ pp->pln_x, pp->pln_y);
pp->pln_own = 0;
continue;
}
if ((eff = pp->pln_effic - etus / 5) < PLANE_MINEFF) {
wu(0, pp->pln_own,
"%s lost to lack of maintenance\n", prplane(pp));
- makelost(EF_PLANE, pp->pln_own, pp->pln_uid, pp->pln_x,
- pp->pln_y);
+ makelost(EF_PLANE, pp->pln_own, pp->pln_uid,
+ pp->pln_x, pp->pln_y);
pp->pln_own = 0;
continue;
}
if (np->nat_priorities[PRI_SBUILD] == 0 || np->nat_money < 0)
return;
if (sp->shp_effic < SHIP_MINEFF || !shiprepair(sp, np, bp, etus)) {
- makelost(EF_SHIP, sp->shp_own, sp->shp_uid, sp->shp_x,
- sp->shp_y);
+ makelost(EF_SHIP, sp->shp_own, sp->shp_uid,
+ sp->shp_x, sp->shp_y);
sp->shp_own = 0;
return;
}
if ((eff = sp->shp_effic - etus / 5) < SHIP_MINEFF) {
wu(0, sp->shp_own,
"%s lost to lack of maintenance\n", prship(sp));
- makelost(EF_SHIP, sp->shp_own, sp->shp_uid, sp->shp_x,
- sp->shp_y);
+ makelost(EF_SHIP, sp->shp_own, sp->shp_uid,
+ sp->shp_x, sp->shp_y);
sp->shp_own = 0;
return;
}