Change nuke storage and commands to match other units:
(nukstr): Hold one nuke instead of a stockpile: replace members nuk_n, nuk_types by nuk_type, nuk_plane. Add nuk_land for completeness, like nuk_ship it's not yet used. (nuke_ca): Update accordingly: replace selectors number and types by type and plane. (build_nuke): Update accordingly. (ndump, nuke): Update accordingly. Output is no longer sorted by location, and nukes in same location no longer share id. nuke's extra columns for nuclear plants are repeated for every nuke. (trade_desc): Update accordingly. (cede, grab_sect, check_nuke_ok, detonate, trade_nameof): Talk about nukes instead of nuclear stockpiles. (arm, disarm): Rewrite, split off new disarm(). Don't remove nuke from the nuke file on arm. Allow usual plane syntax, not just plane number. Change second argument from nuke type to nuke number. When plane is already armed, ignore nuke argument and rearm (broken in 4.2.6). (tran_nuke): Update for changed struct nukstr, make as similar as possible to tran_plane. Change syntax to match transport plane. (player_coms): Update arm, disarm and transport accordingly. (prnuke, nuk_on_plane): New. (nuk_add, nuk_delete): Stockpile management, remove.
This commit is contained in:
parent
e86beb9626
commit
2e40a4bb90
16 changed files with 220 additions and 293 deletions
|
@ -42,13 +42,12 @@ struct nukstr {
|
||||||
short ef_type;
|
short ef_type;
|
||||||
natid nuk_own;
|
natid nuk_own;
|
||||||
short nuk_uid;
|
short nuk_uid;
|
||||||
coord nuk_x; /* current loc of device */
|
coord nuk_x, nuk_y; /* current loc of device */
|
||||||
coord nuk_y;
|
signed char nuk_type; /* index in plchr[] */
|
||||||
/* end of part matching struct genitem */
|
/* end of part matching struct genitem */
|
||||||
signed char nuk_n; /* number of nukes in list */
|
|
||||||
short nuk_ship; /* currently aboard ship (unused) */
|
short nuk_ship; /* currently aboard ship (unused) */
|
||||||
short nuk_trade; /* index into trade file (unused) */
|
short nuk_plane; /* currently aboard plane */
|
||||||
short nuk_types[N_MAXNUKE]; /* # of nukes in sector of given type */
|
short nuk_land; /* currently aboard land (unused) */
|
||||||
time_t nuk_timestamp; /* Last time this nuke was touched */
|
time_t nuk_timestamp; /* Last time this nuke was touched */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -109,6 +109,7 @@ int deli(void);
|
||||||
int demo(void);
|
int demo(void);
|
||||||
int desi(void);
|
int desi(void);
|
||||||
int disa(void);
|
int disa(void);
|
||||||
|
int disarm(void);
|
||||||
int dist(void);
|
int dist(void);
|
||||||
int drop(void);
|
int drop(void);
|
||||||
int dump(void);
|
int dump(void);
|
||||||
|
@ -528,11 +529,11 @@ extern void delete_old_news(void);
|
||||||
extern void init_nreport(void);
|
extern void init_nreport(void);
|
||||||
extern void nreport(natid, int, natid, int);
|
extern void nreport(natid, int, natid, int);
|
||||||
/* nuke.c */
|
/* nuke.c */
|
||||||
|
extern char *prnuke(struct nukstr *);
|
||||||
extern int nuk_postread(int, void *);
|
extern int nuk_postread(int, void *);
|
||||||
extern int nuk_prewrite(int, void *);
|
extern int nuk_prewrite(int, void *);
|
||||||
extern void nuk_init(int, void *);
|
extern void nuk_init(int, void *);
|
||||||
extern void nuk_add(coord, coord, int, int);
|
extern int nuk_on_plane(struct nukstr *, int);
|
||||||
extern void nuk_delete(struct nukstr *, int, int);
|
|
||||||
/* nxtitem.c */
|
/* nxtitem.c */
|
||||||
extern int nxtitem(struct nstr_item *, void *);
|
extern int nxtitem(struct nstr_item *, void *);
|
||||||
/* nxtsct.c */
|
/* nxtsct.c */
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
.TH Command ARM
|
.TH Command ARM
|
||||||
.NA arm "Load nuclear weapons onto planes or missiles"
|
.NA arm "Load nuclear weapons onto planes or missiles"
|
||||||
.LV Expert
|
.LV Expert
|
||||||
.SY "arm <PLANE> <NUKETYPE> <airburst?>"
|
.SY "arm <PLANE> <NUKE> <airburst?>"
|
||||||
The \*Qarm\*U command loads nuclear devices
|
The \*Qarm\*U command loads nuclear devices
|
||||||
aboard delivery systems such as planes or missiles.
|
aboard delivery systems such as planes or missiles.
|
||||||
.s1
|
.s1
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
.NA transport "Move planes or nuclear devices around"
|
.NA transport "Move planes or nuclear devices around"
|
||||||
.LV Basic
|
.LV Basic
|
||||||
.SY "transport plane <PLANES> <ROUTE|DESTINATION>"
|
.SY "transport plane <PLANES> <ROUTE|DESTINATION>"
|
||||||
.SY "transport nuke <SECT> <NUKETYPE> <number> <ROUTE|DESTINATION>"
|
.SY "transport nuke <NUKES> <ROUTE|DESTINATION>"
|
||||||
The transport command is used to move planes and nuclear devices from
|
The transport command is used to move planes and nuclear devices from
|
||||||
one sector to another, along the ground.
|
one sector to another, along the ground.
|
||||||
.s1
|
.s1
|
||||||
|
@ -11,8 +11,8 @@ one sector to another, along the ground.
|
||||||
the route, and empire will use the cheapest path (in terms of mobility)
|
the route, and empire will use the cheapest path (in terms of mobility)
|
||||||
from the current sector to the destination sector.
|
from the current sector to the destination sector.
|
||||||
.s1
|
.s1
|
||||||
You would move 5 small nukes from 2,0 to 8,0 as follows:
|
You would move nuke #666 to 8,0 as follows:
|
||||||
.EX transport nuke 2,0 small 5 8,0
|
.EX transport nuke 666 8,0
|
||||||
.s1
|
.s1
|
||||||
You could move all planes in wing d to -6,0 as follows:
|
You could move all planes in wing d to -6,0 as follows:
|
||||||
.EX transport plane d -6,0
|
.EX transport plane d -6,0
|
||||||
|
|
|
@ -52,73 +52,55 @@ arm(void)
|
||||||
struct nchrstr *ncp;
|
struct nchrstr *ncp;
|
||||||
struct plchrstr *plc;
|
struct plchrstr *plc;
|
||||||
struct plnstr pl;
|
struct plnstr pl;
|
||||||
struct plnstr start; /* Used for sanity checking */
|
|
||||||
struct nukstr nuke;
|
struct nukstr nuke;
|
||||||
char *p;
|
char *p;
|
||||||
int pno;
|
int pno, nukno;
|
||||||
int nuketype;
|
|
||||||
int found;
|
|
||||||
struct nstr_item ni;
|
struct nstr_item ni;
|
||||||
char buf[1024];
|
char buf[1024];
|
||||||
int disarm = **player->argp == 'd';
|
char prompt[128];
|
||||||
char *prompt = disarm ? "Disarm plane: " : "Arm plane: ";
|
|
||||||
|
|
||||||
if (!(p = getstarg(player->argp[1], prompt, buf)) || !*p)
|
if (!snxtitem(&ni, EF_PLANE, player->argp[1]))
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
pno = atoi(p);
|
while (nxtitem(&ni, &pl)) {
|
||||||
if (pno < 0 || !getplane(pno, &pl) || pl.pln_own != player->cnum)
|
if (!player->owner)
|
||||||
return RET_FAIL;
|
continue;
|
||||||
memcpy(&start, &pl, sizeof(struct plnstr));
|
plc = &plchr[(int)pl.pln_type];
|
||||||
plc = &plchr[(int)pl.pln_type];
|
if ((plc->pl_flags & (P_O | P_M)) == (P_O | P_M)) {
|
||||||
if ((plc->pl_flags & (P_O | P_M)) == (P_O | P_M)) {
|
pr("A %s cannot carry nuclear devices!\n", plc->pl_name);
|
||||||
pr("A %s cannot carry nuclear devices!\n", plc->pl_name);
|
|
||||||
return RET_FAIL;
|
|
||||||
}
|
|
||||||
if (opt_MARKET) {
|
|
||||||
if (ontradingblock(EF_PLANE, &pl)) {
|
|
||||||
pr("You cannot arm/disarm an item on the trading block!\n");
|
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
}
|
}
|
||||||
}
|
if (opt_MARKET) {
|
||||||
if (pl.pln_nuketype == -1) {
|
if (ontradingblock(EF_PLANE, &pl)) {
|
||||||
if (disarm) {
|
pr("You cannot disarm %s while it is on the trading block!\n",
|
||||||
pr("%s is not carrying any nuclear devices\n", prplane(&pl));
|
prplane(&pl));
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
}
|
|
||||||
if ((p = getstarg(player->argp[2], "Device type: ", buf)) == 0)
|
|
||||||
return RET_SYN;
|
|
||||||
if (!check_plane_ok(&start))
|
|
||||||
return RET_FAIL;
|
|
||||||
nuketype = typematch(p, EF_NUKE);
|
|
||||||
if (nuketype < 0) {
|
|
||||||
pr("No such nuke type!\n");
|
|
||||||
return RET_SYN;
|
|
||||||
}
|
|
||||||
ncp = &nchr[nuketype];
|
|
||||||
found = 0;
|
|
||||||
snxtitem_xy(&ni, EF_NUKE, pl.pln_x, pl.pln_y);
|
|
||||||
while (nxtitem(&ni, &nuke)) {
|
|
||||||
if (nuke.nuk_own == player->cnum) {
|
|
||||||
found = 1;
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (!found) {
|
if (pl.pln_nuketype < 0) {
|
||||||
pr("You don't own any nukes in that sector.\n");
|
sprintf(prompt, "Nuclear device for %s: ", prplane(&pl));
|
||||||
return RET_FAIL;
|
p = getstarg(player->argp[2], prompt, buf);
|
||||||
}
|
if (!p || !*p)
|
||||||
if (nuke.nuk_types[nuketype] == 0) {
|
return RET_SYN;
|
||||||
pr("No nukes of that type in that sector.\n");
|
if (!check_plane_ok(&pl))
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
|
nukno = atoi(p);
|
||||||
|
if (!getnuke(nukno, &nuke) || !player->owner)
|
||||||
|
return RET_FAIL;
|
||||||
|
} else {
|
||||||
|
if (nuk_on_plane(&nuke, pl.pln_uid) < 0) {
|
||||||
|
CANT_REACH();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
ncp = &nchr[nuke.nuk_type];
|
||||||
if (pl.pln_load < ncp->n_weight) {
|
if (pl.pln_load < ncp->n_weight) {
|
||||||
pr("A %s cannot carry %s devices!\n", plc->pl_name,
|
pr("A %s cannot carry %s devices!\n",
|
||||||
ncp->n_name);
|
plc->pl_name, ncp->n_name);
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
}
|
}
|
||||||
p = getstarg(player->argp[3], "Airburst [n]? ", buf);
|
p = getstarg(player->argp[3], "Airburst [n]? ", buf);
|
||||||
|
|
||||||
if (!check_plane_ok(&start))
|
if (!check_plane_ok(&pl) || !check_nuke_ok(&nuke))
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
|
|
||||||
if (p && (*p == 'y' || *p == 'Y'))
|
if (p && (*p == 'y' || *p == 'Y'))
|
||||||
|
@ -126,26 +108,52 @@ arm(void)
|
||||||
else
|
else
|
||||||
pl.pln_flags &= ~PLN_AIRBURST;
|
pl.pln_flags &= ~PLN_AIRBURST;
|
||||||
|
|
||||||
pl.pln_nuketype = nuketype;
|
pl.pln_nuketype = nuke.nuk_type;
|
||||||
nuk_delete(&nuke, nuketype, 1);
|
nuke.nuk_plane = pl.pln_uid;
|
||||||
} else if (!disarm) {
|
putplane(pl.pln_uid, &pl);
|
||||||
pr("%s already carrying a warhead.\n", prplane(&pl));
|
putnuke(nuke.nuk_uid, &nuke);
|
||||||
}
|
pr("%s armed with %s.\n", prplane(&pl), prnuke(&nuke));
|
||||||
if (disarm) {
|
|
||||||
pr("%s warhead removed from %s and added to %s\n",
|
|
||||||
nchr[(int)pl.pln_nuketype].n_name,
|
|
||||||
prplane(&pl), xyas(pl.pln_x, pl.pln_y, player->cnum));
|
|
||||||
nuk_add(pl.pln_x, pl.pln_y, pl.pln_nuketype, 1);
|
|
||||||
pl.pln_nuketype = -1;
|
|
||||||
pl.pln_flags &= ~PLN_AIRBURST;
|
|
||||||
} else {
|
|
||||||
pr("%s armed with a %s warhead.\n", prplane(&pl),
|
|
||||||
nchr[(int)pl.pln_nuketype].n_name);
|
|
||||||
pr("Warhead on %s is programmed to %s\n",
|
pr("Warhead on %s is programmed to %s\n",
|
||||||
prplane(&pl),
|
prplane(&pl),
|
||||||
pl.pln_flags & PLN_AIRBURST ? "airburst" : "groundburst");
|
pl.pln_flags & PLN_AIRBURST ? "airburst" : "groundburst");
|
||||||
}
|
}
|
||||||
|
|
||||||
putplane(pl.pln_uid, &pl);
|
return RET_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
disarm(void)
|
||||||
|
{
|
||||||
|
struct plnstr pl;
|
||||||
|
struct nukstr nuke;
|
||||||
|
struct nstr_item ni;
|
||||||
|
|
||||||
|
if (!snxtitem(&ni, EF_PLANE, player->argp[1]))
|
||||||
|
return RET_SYN;
|
||||||
|
while (nxtitem(&ni, &pl)) {
|
||||||
|
if (!player->owner)
|
||||||
|
continue;
|
||||||
|
if (pl.pln_nuketype == -1)
|
||||||
|
continue;
|
||||||
|
if (opt_MARKET) {
|
||||||
|
if (ontradingblock(EF_PLANE, &pl)) {
|
||||||
|
pr("You cannot disarm %s while it is on the trading block!\n",
|
||||||
|
prplane(&pl));
|
||||||
|
return RET_FAIL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (nuk_on_plane(&nuke, pl.pln_uid) < 0) {
|
||||||
|
CANT_REACH();
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
nuke.nuk_plane = -1;
|
||||||
|
pl.pln_nuketype = -1;
|
||||||
|
pl.pln_flags &= ~PLN_AIRBURST;
|
||||||
|
putplane(pl.pln_uid, &pl);
|
||||||
|
putnuke(nuke.nuk_uid, &nuke);
|
||||||
|
pr("%s removed from %s and added to %s\n",
|
||||||
|
prnuke(&nuke), prplane(&pl),
|
||||||
|
xyas(pl.pln_x, pl.pln_y, player->cnum));
|
||||||
|
}
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -639,10 +639,12 @@ build_bridge(struct sctstr *sp, short *vec)
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
build_nuke(struct sctstr *sp, struct nchrstr *np,
|
build_nuke(struct sctstr *sp, struct nchrstr *np, short *vec)
|
||||||
short *vec)
|
|
||||||
{
|
{
|
||||||
|
struct nukstr nuke;
|
||||||
|
struct nstr_item nstr;
|
||||||
int avail;
|
int avail;
|
||||||
|
int freenuke;
|
||||||
|
|
||||||
if (sp->sct_type != SCT_NUKE && !player->god) {
|
if (sp->sct_type != SCT_NUKE && !player->god) {
|
||||||
pr("Nuclear weapons must be built in nuclear plants.\n");
|
pr("Nuclear weapons must be built in nuclear plants.\n");
|
||||||
|
@ -681,12 +683,34 @@ build_nuke(struct sctstr *sp, struct nchrstr *np,
|
||||||
return 0;
|
return 0;
|
||||||
sp->sct_avail -= avail;
|
sp->sct_avail -= avail;
|
||||||
player->dolcost += np->n_cost;
|
player->dolcost += np->n_cost;
|
||||||
nuk_add(sp->sct_x, sp->sct_y, np - nchr, 1);
|
snxtitem_all(&nstr, EF_NUKE);
|
||||||
|
freenuke = 0;
|
||||||
|
while (nxtitem(&nstr, &nuke)) {
|
||||||
|
if (nuke.nuk_own == 0) {
|
||||||
|
freenuke++;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (freenuke == 0) {
|
||||||
|
ef_extend(EF_NUKE, 50);
|
||||||
|
}
|
||||||
|
memset(&nuke, 0, sizeof(struct nukstr));
|
||||||
|
nuke.nuk_x = sp->sct_x;
|
||||||
|
nuke.nuk_y = sp->sct_y;
|
||||||
|
nuke.nuk_own = sp->sct_own;
|
||||||
|
nuke.nuk_type = np - nchr;
|
||||||
|
nuke.nuk_ship = nuke.nuk_plane = nuke.nuk_land = -1;
|
||||||
|
nuke.nuk_uid = nstr.cur;
|
||||||
|
|
||||||
vec[I_HCM] -= np->n_hcm;
|
vec[I_HCM] -= np->n_hcm;
|
||||||
vec[I_LCM] -= np->n_lcm;
|
vec[I_LCM] -= np->n_lcm;
|
||||||
vec[I_OIL] -= np->n_oil;
|
vec[I_OIL] -= np->n_oil;
|
||||||
vec[I_RAD] -= np->n_rad;
|
vec[I_RAD] -= np->n_rad;
|
||||||
pr("%s warhead created in %s\n", np->n_name,
|
|
||||||
|
makenotlost(EF_NUKE, nuke.nuk_own, nuke.nuk_uid,
|
||||||
|
nuke.nuk_x, nuke.nuk_y);
|
||||||
|
putnuke(nuke.nuk_uid, &nuke);
|
||||||
|
pr("%s created in %s\n", prnuke(&nuke),
|
||||||
xyas(sp->sct_x, sp->sct_y, player->cnum));
|
xyas(sp->sct_x, sp->sct_y, player->cnum));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -701,7 +725,7 @@ build_plane(struct sctstr *sp, struct plchrstr *pp,
|
||||||
double cost;
|
double cost;
|
||||||
float eff = PLANE_MINEFF / 100.0;
|
float eff = PLANE_MINEFF / 100.0;
|
||||||
int hcm, lcm, mil;
|
int hcm, lcm, mil;
|
||||||
int freeplane = 0;
|
int freeplane;
|
||||||
|
|
||||||
mil = roundavg(((double)pp->pl_crew * eff));
|
mil = roundavg(((double)pp->pl_crew * eff));
|
||||||
/* Always use at least 1 mil to build a plane */
|
/* Always use at least 1 mil to build a plane */
|
||||||
|
|
|
@ -231,8 +231,8 @@ grab_sect(struct sctstr *sp, natid to)
|
||||||
if (np->nuk_own == 0)
|
if (np->nuk_own == 0)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
wu(0, to, "\tnuclear stockpile #%d ceded to you by %s\n",
|
wu(0, to, "\t%s ceded to you by %s\n",
|
||||||
np->nuk_uid, cname(player->cnum));
|
prnuke(np), cname(player->cnum));
|
||||||
makelost(EF_NUKE, np->nuk_own, np->nuk_uid, np->nuk_x, np->nuk_y);
|
makelost(EF_NUKE, np->nuk_own, np->nuk_uid, np->nuk_x, np->nuk_y);
|
||||||
np->nuk_own = to;
|
np->nuk_own = to;
|
||||||
makenotlost(EF_NUKE, np->nuk_own, np->nuk_uid, np->nuk_x,
|
makenotlost(EF_NUKE, np->nuk_own, np->nuk_uid, np->nuk_x,
|
||||||
|
|
|
@ -67,17 +67,13 @@ ndump(void)
|
||||||
if (nuk.nuk_own == 0)
|
if (nuk.nuk_own == 0)
|
||||||
continue;
|
continue;
|
||||||
nnukes++;
|
nnukes++;
|
||||||
for (i = 0; i < N_MAXNUKE; i++) {
|
if (player->god)
|
||||||
if (nuk.nuk_types[i] > 0) {
|
pr("%d ", nuk.nuk_own);
|
||||||
if (player->god)
|
pr("%d ", nuk.nuk_uid);
|
||||||
pr("%d ", nuk.nuk_own);
|
prxy("%d %d", nuk.nuk_x, nuk.nuk_y, player->cnum);
|
||||||
pr("%d ", nuk.nuk_uid);
|
pr(" %d", 1);
|
||||||
prxy("%d %d", nuk.nuk_x, nuk.nuk_y, player->cnum);
|
pr(" %.5s", nchr[(int)nuk.nuk_type].n_name);
|
||||||
pr(" %d", nuk.nuk_types[i]);
|
pr("\n");
|
||||||
pr(" %.5s", nchr[i].n_name);
|
|
||||||
pr("\n");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
if (nnukes == 0) {
|
if (nnukes == 0) {
|
||||||
if (player->argp[1])
|
if (player->argp[1])
|
||||||
|
|
|
@ -47,7 +47,6 @@ int
|
||||||
nuke(void)
|
nuke(void)
|
||||||
{
|
{
|
||||||
int first_line = 0;
|
int first_line = 0;
|
||||||
int first_nuke;
|
|
||||||
int show_comm;
|
int show_comm;
|
||||||
int i;
|
int i;
|
||||||
struct nstr_item nstr;
|
struct nstr_item nstr;
|
||||||
|
@ -68,41 +67,31 @@ nuke(void)
|
||||||
pr(" sect eff num nuke-type lcm hcm oil rad avail\n");
|
pr(" sect eff num nuke-type lcm hcm oil rad avail\n");
|
||||||
}
|
}
|
||||||
getsect(nuk.nuk_x, nuk.nuk_y, §);
|
getsect(nuk.nuk_x, nuk.nuk_y, §);
|
||||||
first_nuke = 1;
|
|
||||||
show_comm = 0;
|
show_comm = 0;
|
||||||
if (sect.sct_type == SCT_NUKE && sect.sct_effic >= 60)
|
if (sect.sct_type == SCT_NUKE && sect.sct_effic >= 60)
|
||||||
show_comm = 1;
|
show_comm = 1;
|
||||||
for (i = 0; i < N_MAXNUKE; i++) {
|
if (player->god)
|
||||||
if (nuk.nuk_types[i] > 0) {
|
pr("%-3d ", nuk.nuk_own);
|
||||||
if (first_nuke) {
|
prxy("%4d,%-4d", sect.sct_x, sect.sct_y, player->cnum);
|
||||||
if (player->god)
|
pr(" %c", dchr[sect.sct_type].d_mnem);
|
||||||
pr("%-3d ", nuk.nuk_own);
|
if (sect.sct_newtype != sect.sct_type)
|
||||||
prxy("%4d,%-4d", sect.sct_x, sect.sct_y, player->cnum);
|
pr("%c", dchr[sect.sct_newtype].d_mnem);
|
||||||
pr(" %c", dchr[sect.sct_type].d_mnem);
|
else
|
||||||
if (sect.sct_newtype != sect.sct_type)
|
pr(" ");
|
||||||
pr("%c", dchr[sect.sct_newtype].d_mnem);
|
pr("%4d%%", sect.sct_effic);
|
||||||
else
|
|
||||||
pr(" ");
|
|
||||||
pr("%4d%%", sect.sct_effic);
|
|
||||||
first_nuke = 0;
|
|
||||||
} else {
|
|
||||||
pr(" ");
|
|
||||||
}
|
|
||||||
|
|
||||||
pr("%3d ", nuk.nuk_types[i]);
|
pr("%3d ", 1);
|
||||||
pr("%-16.16s ", nchr[i].n_name);
|
pr("%-16.16s ", nchr[(int)nuk.nuk_type].n_name);
|
||||||
|
|
||||||
if (show_comm) {
|
if (show_comm) {
|
||||||
pr("%5d ", sect.sct_item[I_LCM]);
|
pr("%5d ", sect.sct_item[I_LCM]);
|
||||||
pr("%5d ", sect.sct_item[I_HCM]);
|
pr("%5d ", sect.sct_item[I_HCM]);
|
||||||
pr("%5d ", sect.sct_item[I_OIL]);
|
pr("%5d ", sect.sct_item[I_OIL]);
|
||||||
pr("%5d ", sect.sct_item[I_RAD]);
|
pr("%5d ", sect.sct_item[I_RAD]);
|
||||||
pr("%5d", sect.sct_avail);
|
pr("%5d", sect.sct_avail);
|
||||||
show_comm = 0;
|
show_comm = 0;
|
||||||
}
|
|
||||||
pr("\n");
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
pr("\n");
|
||||||
}
|
}
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
|
@ -69,122 +69,89 @@ tran(void)
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* Kinda silly; only moves the first nuke.
|
|
||||||
* Maybe nukes should be made into commodities?
|
|
||||||
*/
|
|
||||||
static int
|
static int
|
||||||
tran_nuke(void)
|
tran_nuke(void)
|
||||||
{
|
{
|
||||||
struct nchrstr *ncp;
|
coord srcx, srcy;
|
||||||
coord x, y;
|
|
||||||
coord dstx, dsty;
|
coord dstx, dsty;
|
||||||
int found;
|
int mcost;
|
||||||
char *p;
|
int weight, count;
|
||||||
int nuketype;
|
int type, dam;
|
||||||
int moving;
|
struct nstr_item nstr;
|
||||||
struct nukstr nuke;
|
struct nukstr nuke;
|
||||||
struct sctstr sect;
|
struct sctstr sect;
|
||||||
struct sctstr endsect;
|
struct sctstr endsect;
|
||||||
int mcost, dam;
|
|
||||||
struct nstr_item nstr;
|
|
||||||
char buf[1024];
|
|
||||||
|
|
||||||
if (!(p = getstarg(player->argp[2], "from sector : ", buf)))
|
weight = 0;
|
||||||
|
count = 0;
|
||||||
|
if (!snxtitem(&nstr, EF_NUKE, player->argp[2]))
|
||||||
return RET_SYN;
|
return RET_SYN;
|
||||||
if (!sarg_xy(p, &x, &y))
|
|
||||||
return RET_SYN;
|
|
||||||
if (!getsect(x, y, §) || !player->owner) {
|
|
||||||
pr("Not yours\n");
|
|
||||||
return RET_FAIL;
|
|
||||||
}
|
|
||||||
snxtitem_xy(&nstr, EF_NUKE, sect.sct_x, sect.sct_y);
|
|
||||||
found = 0;
|
|
||||||
while (nxtitem(&nstr, &nuke)) {
|
while (nxtitem(&nstr, &nuke)) {
|
||||||
if (player->owner) {
|
if (!player->owner)
|
||||||
found = 1;
|
continue;
|
||||||
break;
|
type = nuke.nuk_type;
|
||||||
}
|
if (nuke.nuk_plane >= 0) {
|
||||||
}
|
pr("%s is armed and can't be transported\n", prnuke(&nuke));
|
||||||
if (!found) {
|
|
||||||
pr("There are no nukes in %s\n",
|
|
||||||
xyas(sect.sct_x, sect.sct_y, player->cnum));
|
|
||||||
return RET_FAIL;
|
|
||||||
}
|
|
||||||
if (!(p = getstarg(player->argp[3], "warhead type : ", buf)))
|
|
||||||
return RET_SYN;
|
|
||||||
if (!check_sect_ok(§))
|
|
||||||
return RET_FAIL;
|
|
||||||
nuketype = typematch(p, EF_NUKE);
|
|
||||||
if (nuketype < 0) {
|
|
||||||
pr("No such nuke type!\n");
|
|
||||||
return RET_SYN;
|
|
||||||
}
|
|
||||||
ncp = &nchr[nuketype];
|
|
||||||
if (!nuke.nuk_types[nuketype]) {
|
|
||||||
pr("No %s nukes in %s\n",
|
|
||||||
ncp->n_name, xyas(sect.sct_x, sect.sct_y, player->cnum));
|
|
||||||
return RET_FAIL;
|
|
||||||
}
|
|
||||||
p = getstarg(player->argp[4], "number of warheads : ", buf);
|
|
||||||
if (!check_sect_ok(§))
|
|
||||||
return RET_FAIL;
|
|
||||||
if (p == 0 || *p == 0 || (moving = atoi(p)) < 0)
|
|
||||||
return RET_FAIL;
|
|
||||||
if (moving > nuke.nuk_types[nuketype]) {
|
|
||||||
moving = nuke.nuk_types[nuketype];
|
|
||||||
if (moving)
|
|
||||||
pr("only moving %d\n", moving);
|
|
||||||
else
|
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
|
}
|
||||||
|
if (count == 0) {
|
||||||
|
srcx = nuke.nuk_x;
|
||||||
|
srcy = nuke.nuk_y;
|
||||||
|
} else {
|
||||||
|
if (nuke.nuk_x != srcx || nuke.nuk_y != srcy) {
|
||||||
|
pr("All nukes must be in the same sector.\n");
|
||||||
|
return RET_FAIL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
weight += nchr[type].n_weight;
|
||||||
|
++count;
|
||||||
|
}
|
||||||
|
if (count == 0) {
|
||||||
|
pr("No planes\n");
|
||||||
|
return RET_FAIL;
|
||||||
|
}
|
||||||
|
if (!getsect(srcx, srcy, §) || !player->owner) {
|
||||||
|
pr("You don't own %s\n", xyas(srcx, srcy, player->cnum));
|
||||||
|
return RET_FAIL;
|
||||||
}
|
}
|
||||||
if (!military_control(§)) {
|
if (!military_control(§)) {
|
||||||
pr("Military control required to move nukes.\n");
|
pr("Military control required to move nukes.\n");
|
||||||
return RET_FAIL;
|
return RET_FAIL;
|
||||||
}
|
}
|
||||||
dam = 0;
|
dam = 0;
|
||||||
mcost = move_ground(§, &endsect, (double)ncp->n_weight * moving,
|
mcost = move_ground(§, &endsect, weight,
|
||||||
player->argp[5], tran_map, 0, &dam);
|
player->argp[3], tran_map, 0, &dam);
|
||||||
|
|
||||||
if (mcost < 0)
|
if (mcost < 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
|
dstx = endsect.sct_x;
|
||||||
|
dsty = endsect.sct_y;
|
||||||
|
snxtitem_rewind(&nstr);
|
||||||
|
while (nxtitem(&nstr, &nuke)) {
|
||||||
|
if (!player->owner)
|
||||||
|
continue;
|
||||||
|
/* TODO apply dam */
|
||||||
|
nuke.nuk_x = dstx;
|
||||||
|
nuke.nuk_y = dsty;
|
||||||
|
putnuke(nuke.nuk_uid, &nuke);
|
||||||
|
}
|
||||||
if (mcost > 0)
|
if (mcost > 0)
|
||||||
pr("Total movement cost = %d\n", mcost);
|
pr("Total movement cost = %d\n", mcost);
|
||||||
else
|
else
|
||||||
pr("No mobility used\n");
|
pr("No mobility used\n");
|
||||||
|
getsect(srcx, srcy, §);
|
||||||
dstx = endsect.sct_x;
|
|
||||||
dsty = endsect.sct_y;
|
|
||||||
/*
|
|
||||||
* decrement mobility from src sector
|
|
||||||
*/
|
|
||||||
getsect(nuke.nuk_x, nuke.nuk_y, §);
|
|
||||||
sect.sct_mobil -= mcost;
|
sect.sct_mobil -= mcost;
|
||||||
if (sect.sct_mobil < 0)
|
if (sect.sct_mobil < 0)
|
||||||
sect.sct_mobil = 0;
|
sect.sct_mobil = 0;
|
||||||
putsect(§);
|
putsect(§);
|
||||||
/*
|
|
||||||
* update old nuke
|
|
||||||
*/
|
|
||||||
if (!getnuke(nuke.nuk_uid, &nuke)) {
|
|
||||||
pr("Could not find that stockpile again.\n");
|
|
||||||
return RET_FAIL;
|
|
||||||
}
|
|
||||||
if (nuke.nuk_types[nuketype] < moving || nuke.nuk_own != player->cnum) {
|
|
||||||
pr("Stockpile changed!\n");
|
|
||||||
return RET_FAIL;
|
|
||||||
}
|
|
||||||
nuk_delete(&nuke, nuketype, moving);
|
|
||||||
nuk_add(dstx, dsty, nuketype, moving);
|
|
||||||
return RET_OK;
|
return RET_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
tran_plane(void)
|
tran_plane(void)
|
||||||
{
|
{
|
||||||
int srcx, srcy;
|
coord srcx, srcy;
|
||||||
int dstx, dsty;
|
coord dstx, dsty;
|
||||||
int mcost;
|
int mcost;
|
||||||
int weight, count;
|
int weight, count;
|
||||||
int type, dam;
|
int type, dam;
|
||||||
|
|
|
@ -129,7 +129,7 @@ check_nuke_ok(struct nukstr *nukep)
|
||||||
memcpy(&tnuke, nukep, sizeof(struct nukstr));
|
memcpy(&tnuke, nukep, sizeof(struct nukstr));
|
||||||
tnuke.nuk_timestamp = chknuke.nuk_timestamp = 0;
|
tnuke.nuk_timestamp = chknuke.nuk_timestamp = 0;
|
||||||
if (memcmp(&tnuke, &chknuke, sizeof(struct nukstr))) {
|
if (memcmp(&tnuke, &chknuke, sizeof(struct nukstr))) {
|
||||||
pr("Nuclear stockpile %d has changed!\n", nukep->nuk_uid);
|
pr("Nuke %d has changed!\n", nukep->nuk_uid);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
return 1;
|
return 1;
|
||||||
|
|
|
@ -384,8 +384,8 @@ struct castr nuke_ca[] = {
|
||||||
{NSC_NATID, 0, 0, fldoff(nukstr, nuk_own), "owner", EF_NATION},
|
{NSC_NATID, 0, 0, fldoff(nukstr, nuk_own), "owner", EF_NATION},
|
||||||
{NSC_XCOORD, 0, 0, fldoff(nukstr, nuk_x), "xloc", EF_BAD},
|
{NSC_XCOORD, 0, 0, fldoff(nukstr, nuk_x), "xloc", EF_BAD},
|
||||||
{NSC_YCOORD, 0, 0, fldoff(nukstr, nuk_y), "yloc", EF_BAD},
|
{NSC_YCOORD, 0, 0, fldoff(nukstr, nuk_y), "yloc", EF_BAD},
|
||||||
{NSC_CHAR, 0, 0, fldoff(nukstr, nuk_n), "number", EF_BAD},
|
{NSC_TYPEID, 0, 0, fldoff(nukstr, nuk_type), "type", EF_NUKE_CHR},
|
||||||
{NSC_SHORT, 0, N_MAXNUKE, fldoff(nukstr, nuk_types), "types", EF_BAD},
|
{NSC_SHORT, 0, 0, fldoff(nukstr, nuk_plane), "plane", EF_BAD},
|
||||||
{NSC_TIME, NSC_EXTRA, 0, fldoff(nukstr, nuk_timestamp), "timestamp",
|
{NSC_TIME, NSC_EXTRA, 0, fldoff(nukstr, nuk_timestamp), "timestamp",
|
||||||
EF_BAD},
|
EF_BAD},
|
||||||
{NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
|
{NSC_NOTYPE, 0, 0, 0, NULL, EF_BAD}
|
||||||
|
|
|
@ -47,8 +47,7 @@ struct cmndstr player_coms[] = {
|
||||||
{"announce {message}", 0, tele, C_MOD, VIS},
|
{"announce {message}", 0, tele, C_MOD, VIS},
|
||||||
{"anti <SECT>", 3, anti, C_MOD, NORM + MONEY + CAP},
|
{"anti <SECT>", 3, anti, C_MOD, NORM + MONEY + CAP},
|
||||||
{"apropos <topic>", 0, apro, 0, VIS},
|
{"apropos <topic>", 0, apro, 0, VIS},
|
||||||
{"arm <PLANE> <NUKETYPE> <airburst?>", 3, arm, C_MOD,
|
{"arm <PLANE> <NUKE> <airburst?>", 3, arm, C_MOD, NORM + MONEY + CAP},
|
||||||
NORM + MONEY + CAP},
|
|
||||||
{"army <ARMY> <UNITS>", 0, army, C_MOD, NORM},
|
{"army <ARMY> <UNITS>", 0, army, C_MOD, NORM},
|
||||||
{"assault <to-SECT> <from-SHIP> [<forts?> <ships?> <arty?> <planes?>]",
|
{"assault <to-SECT> <from-SHIP> [<forts?> <ships?> <arty?> <planes?>]",
|
||||||
3, assa, C_MOD, NORM + MONEY + CAP},
|
3, assa, C_MOD, NORM + MONEY + CAP},
|
||||||
|
@ -90,7 +89,7 @@ struct cmndstr player_coms[] = {
|
||||||
NORM + CAP},
|
NORM + CAP},
|
||||||
{"designate <SECTS> <type> [sure?]", 1, desi, C_MOD, NORM},
|
{"designate <SECTS> <type> [sure?]", 1, desi, C_MOD, NORM},
|
||||||
{"disable", 0, disa, C_MOD, GOD},
|
{"disable", 0, disa, C_MOD, GOD},
|
||||||
{"disarm <PLANE>", 2, arm, C_MOD, NORM + MONEY + CAP},
|
{"disarm <PLANE>", 2, disarm, C_MOD, NORM + MONEY + CAP},
|
||||||
{"distribute <SECTS> <DISTSECT|.|h>", 1, dist, C_MOD, NORM},
|
{"distribute <SECTS> <DISTSECT|.|h>", 1, dist, C_MOD, NORM},
|
||||||
{"drop <cargo-PLANES> <fighter-PLANES> <ap-SECT> <PATH|DESTINATION> <COMM>", 1, drop, C_MOD, NORM + MONEY + CAP},
|
{"drop <cargo-PLANES> <fighter-PLANES> <ap-SECT> <PATH|DESTINATION> <COMM>", 1, drop, C_MOD, NORM + MONEY + CAP},
|
||||||
{"dump <SECTS> [<fields>]", 0, dump, 0, NORM},
|
{"dump <SECTS> [<fields>]", 0, dump, 0, NORM},
|
||||||
|
@ -253,7 +252,8 @@ struct cmndstr player_coms[] = {
|
||||||
{"torpedo <submarine-SHIPS> <target-SHIP>", 3, torp, C_MOD,
|
{"torpedo <submarine-SHIPS> <target-SHIP>", 3, torp, C_MOD,
|
||||||
NORM + MONEY + CAP},
|
NORM + MONEY + CAP},
|
||||||
{"trade", 1, trad, C_MOD, NORM + CAP + MONEY},
|
{"trade", 1, trad, C_MOD, NORM + CAP + MONEY},
|
||||||
{"transport <\"nuke\"|\"plane\"> <SECT|PLANES> [<NUKETYPE> <number>] <PATH|DESTINATION>", 1, tran, C_MOD, NORM + CAP},
|
{"transport <\"nuke\"|\"plane\"> <NUKES|PLANES> <PATH|DESTINATION>",
|
||||||
|
1, tran, C_MOD, NORM + CAP},
|
||||||
{"treaty <TREATIES>", 0, trea, 0, NORM + MONEY + CAP},
|
{"treaty <TREATIES>", 0, trea, 0, NORM + MONEY + CAP},
|
||||||
{"turn <\"on\"|\"off\"|\"mess\">", 0, turn, C_MOD, GOD},
|
{"turn <\"on\"|\"off\"|\"mess\">", 0, turn, C_MOD, GOD},
|
||||||
{"unload <COMM|\"land\"|\"plane\"> <SHIPS> <NUM|UNIT|PLANE>", 1, load,
|
{"unload <COMM|\"land\"|\"plane\"> <SHIPS> <NUM|UNIT|PLANE>", 1, load,
|
||||||
|
|
|
@ -301,12 +301,12 @@ detonate(struct plnstr *pp, int x, int y)
|
||||||
nuke.nuk_y);
|
nuke.nuk_y);
|
||||||
nuke.nuk_own = 0;
|
nuke.nuk_own = 0;
|
||||||
if (own == bombown) {
|
if (own == bombown) {
|
||||||
mpr(bombown, "nuclear stockpile #%d at %s destroyed\n",
|
mpr(bombown, "%s at %s destroyed\n",
|
||||||
ni.cur, xyas(nuke.nuk_x, nuke.nuk_y, own));
|
prnuke(&nuke), xyas(nuke.nuk_x, nuke.nuk_y, own));
|
||||||
} else {
|
} else {
|
||||||
if (own != 0)
|
if (own != 0)
|
||||||
mpr(own, "nuclear stockpile #%d at %s destroyed\n",
|
mpr(own, "%s at %s destroyed\n",
|
||||||
ni.cur, xyas(nuke.nuk_x, nuke.nuk_y, own));
|
prnuke(&nuke), xyas(nuke.nuk_x, nuke.nuk_y, own));
|
||||||
}
|
}
|
||||||
putnuke(ni.cur, &nuke);
|
putnuke(ni.cur, &nuke);
|
||||||
}
|
}
|
||||||
|
|
|
@ -84,68 +84,22 @@ nuk_init(int n, void *ptr)
|
||||||
np->nuk_own = 0;
|
np->nuk_own = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
int
|
||||||
nuk_add(coord x, coord y, int type, int num)
|
nuk_on_plane(struct nukstr *np, int pluid)
|
||||||
{
|
{
|
||||||
struct nukstr nuke;
|
struct nstr_item ni;
|
||||||
struct sctstr sect;
|
|
||||||
int nuk_uid;
|
|
||||||
natid own;
|
|
||||||
int n;
|
|
||||||
|
|
||||||
/* getsect in case of world wraparound */
|
snxtitem_all(&ni, EF_NUKE);
|
||||||
getsect(x, y, §);
|
while (nxtitem(&ni, np)) {
|
||||||
if (!(own = sect.sct_own))
|
if (np->nuk_plane == pluid)
|
||||||
return;
|
return np->nuk_uid;
|
||||||
x = sect.sct_x;
|
|
||||||
y = sect.sct_y;
|
|
||||||
|
|
||||||
/*
|
|
||||||
* either find a stockpile in x,y or add a new one
|
|
||||||
*/
|
|
||||||
nuk_uid = -1;
|
|
||||||
for (n = 0; getnuke(n, &nuke); n++) {
|
|
||||||
if (nuke.nuk_own == own) {
|
|
||||||
if (nuke.nuk_x == x && nuke.nuk_y == y) {
|
|
||||||
nuk_uid = n;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
} else if (nuke.nuk_own == 0 && nuk_uid == -1)
|
|
||||||
nuk_uid = n;
|
|
||||||
}
|
}
|
||||||
if (nuk_uid == -1)
|
return -1;
|
||||||
nuk_uid = n;
|
|
||||||
if (getnuke(nuk_uid, &nuke) == 0) {
|
|
||||||
ef_extend(EF_NUKE, 10);
|
|
||||||
memset(&nuke, 0, sizeof(struct nukstr));
|
|
||||||
nuke.nuk_uid = nuk_uid;
|
|
||||||
}
|
|
||||||
if (nuke.nuk_own == 0) {
|
|
||||||
nuke.nuk_ship = -1;
|
|
||||||
nuke.nuk_x = x;
|
|
||||||
nuke.nuk_y = y;
|
|
||||||
nuke.nuk_own = own;
|
|
||||||
makenotlost(EF_NUKE, nuke.nuk_own, nuke.nuk_uid, nuke.nuk_x,
|
|
||||||
nuke.nuk_y);
|
|
||||||
}
|
|
||||||
nuke.nuk_types[type] += num;
|
|
||||||
nuke.nuk_n += num;
|
|
||||||
|
|
||||||
if (!putnuke(nuke.nuk_uid, &nuke))
|
|
||||||
pr("Problem with the nuclear stockpiles, tell the deity.\n");
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
char *
|
||||||
nuk_delete(struct nukstr *np, int type, int num)
|
prnuke(struct nukstr *np)
|
||||||
{
|
{
|
||||||
if (np->nuk_types[type] < num)
|
return prbuf("%s warhead #%d",
|
||||||
num = np->nuk_types[type];
|
nchr[(int)np->nuk_type].n_name, np->nuk_uid);
|
||||||
np->nuk_types[type] -= num;
|
|
||||||
np->nuk_n -= num;
|
|
||||||
if (np->nuk_n <= 0) {
|
|
||||||
makelost(EF_NUKE, np->nuk_own, np->nuk_uid, np->nuk_x, np->nuk_y);
|
|
||||||
np->nuk_own = 0;
|
|
||||||
}
|
|
||||||
putnuke(np->nuk_uid, np);
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -79,7 +79,7 @@ trade_nameof(struct trdstr *tp, union trdgenstr *tgp)
|
||||||
{
|
{
|
||||||
switch (tp->trd_type) {
|
switch (tp->trd_type) {
|
||||||
case EF_NUKE:
|
case EF_NUKE:
|
||||||
return "nuclear stockpile";
|
return nchr[(int)tgp->nuk.nuk_type].n_name;
|
||||||
case EF_PLANE:
|
case EF_PLANE:
|
||||||
return plchr[(int)tgp->pln.pln_type].pl_name;
|
return plchr[(int)tgp->pln.pln_type].pl_name;
|
||||||
case EF_SHIP:
|
case EF_SHIP:
|
||||||
|
@ -105,7 +105,6 @@ trade_desc(struct trdstr *tp, union trdgenstr *tgp)
|
||||||
struct shpstr *sp;
|
struct shpstr *sp;
|
||||||
struct plnstr *pp;
|
struct plnstr *pp;
|
||||||
struct lndstr *lp;
|
struct lndstr *lp;
|
||||||
struct natstr *natp;
|
|
||||||
int needcomma;
|
int needcomma;
|
||||||
struct nstr_item ni;
|
struct nstr_item ni;
|
||||||
struct plnstr plane;
|
struct plnstr plane;
|
||||||
|
@ -114,20 +113,10 @@ trade_desc(struct trdstr *tp, union trdgenstr *tgp)
|
||||||
switch (tp->trd_type) {
|
switch (tp->trd_type) {
|
||||||
case EF_NUKE:
|
case EF_NUKE:
|
||||||
np = &tgp->nuk;
|
np = &tgp->nuk;
|
||||||
if (!getsect(np->nuk_x, np->nuk_y, §))
|
tp->trd_owner = np->nuk_own;
|
||||||
return 0;
|
pr("(%3d) %s #%d",
|
||||||
tp->trd_owner = sect.sct_own;
|
tp->trd_owner,
|
||||||
natp = getnatp(tp->trd_owner);
|
nchr[(int)np->nuk_type].n_name, tp->trd_unitid);
|
||||||
pr("(%3d) ", sect.sct_own);
|
|
||||||
needcomma = 0;
|
|
||||||
for (i = 0; i < N_MAXNUKE; i++) {
|
|
||||||
if (np->nuk_types[i]) {
|
|
||||||
if (needcomma)
|
|
||||||
pr(",");
|
|
||||||
pr("%dx%s", np->nuk_types[i], nchr[i].n_name);
|
|
||||||
needcomma = 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case EF_SHIP:
|
case EF_SHIP:
|
||||||
sp = &tgp->shp;
|
sp = &tgp->shp;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue