extern int islist(s_char *);
/* src/lib/subs/mission.c */
extern s_char *mission_name(short);
-extern s_char *nameofitem(s_char *, struct genitem *, int);
+extern s_char *nameofitem(struct genitem *, int);
extern int collateral_damage(coord, coord, int, struct emp_qelem *);
extern int mission_pln_equip(struct plist *, struct ichrstr *, int,
s_char);
extern void prepare_sects(int, int *);
extern int bank_income(struct sctstr *, int);
/* produce.c */
-extern int produce(struct natstr *, struct sctstr *, int *, int, int, int,
+extern int produce(struct natstr *, struct sctstr *, int *, int, int,
int, int *, int *);
/* removewants.c */
extern int update_removewants(void);
mission == MI_DSUPPORT || mission == MI_INTERDICT ||
mission == MI_AIR_DEFENSE) {
pr("%s on %s mission, centered on %s, radius %d\n",
- nameofitem(buf, gp, type), mission_name(mission),
+ nameofitem(gp, type), mission_name(mission),
xyas(x, y, player->cnum), gp->radius);
} else if (mission == MI_RESERVE) {
int plus = 2;
}
pr("%s on %s mission with maximum reaction radius %d\n",
- nameofitem(buf, gp, type), mission_name(mission), plus);
+ nameofitem(gp, type), mission_name(mission), plus);
} else if (mission) {
- pr("%s on %s mission\n", nameofitem(buf, gp, type),
+ pr("%s on %s mission\n", nameofitem(gp, type),
mission_name(mission));
}
static void repo_list(struct stats *stat, natid cn, struct natstr *natp);
static int check(s_char *buf, double theirs, double min, double max,
- int shift, int what, int tolerance);
+ int shift, int tolerance);
int
repo(void)
}
if (tolerance > 2 * ours)
tolerance = (int)(2 * ours);
- if (check(buf, theirs, 2 * ours, -1.0, shift, what, tolerance)) ;
- else if (check(buf, theirs, 1.5 * ours, 2.0 * ours, shift, what,
- tolerance)) ;
- else if (check(buf, theirs, 1.2 * ours, 1.5 * ours, shift, what,
- tolerance)) ;
- else if (check(buf, theirs, 1.1 * ours, 1.2 * ours, shift, what,
- tolerance)) ;
- else if (check(buf, theirs, ours / 1.1, 1.1 * ours, shift, what,
- tolerance)) ;
- else if (check(buf, theirs, ours / 1.2, ours / 1.1, shift, what,
- tolerance)) ;
- else if (check(buf, theirs, ours / 1.5, ours / 1.2, shift, what,
- tolerance)) ;
- else if (check(buf, theirs, ours / 2.0, ours / 1.5, shift, what,
- tolerance)) ;
- else if (check(buf, theirs, -1.0, ours / 2.0, shift, what,
- tolerance)) ;
+ if (check(buf, theirs, 2 * ours, -1.0, shift, tolerance))
+ ;
+ else if (check(buf, theirs, 1.5 * ours, 2.0 * ours, shift, tolerance))
+ ;
+ else if (check(buf, theirs, 1.2 * ours, 1.5 * ours, shift, tolerance))
+ ;
+ else if (check(buf, theirs, 1.1 * ours, 1.2 * ours, shift, tolerance))
+ ;
+ else if (check(buf, theirs, ours / 1.1, 1.1 * ours, shift, tolerance))
+ ;
+ else if (check(buf, theirs, ours / 1.2, ours / 1.1, shift, tolerance))
+ ;
+ else if (check(buf, theirs, ours / 1.5, ours / 1.2, shift, tolerance))
+ ;
+ else if (check(buf, theirs, ours / 2.0, ours / 1.5, shift, tolerance))
+ ;
+ else if (check(buf, theirs, -1.0, ours / 2.0, shift, tolerance)) ;
else
sprintf(buf, " n/a");
} else
static int
check(s_char *buf, double theirs, double min, double max, int shift,
- int what, int tolerance)
+ int tolerance)
{
double shove;
static int candchrg(struct shpstr *, struct shpstr *);
static int canshoot(struct shpstr *, struct shpstr *);
static int cantorp(struct shpstr *, struct shpstr *);
-static void fire_dchrg(struct shpstr *sp, struct shpstr *targ, int range,
- int ntargets);
+static void fire_dchrg(struct shpstr *sp, struct shpstr *targ, int ntargets);
static int fire_torp(struct shpstr *, struct shpstr *, int, int);
int
/* Try torping.. if we can, maybe we can fire */
if (!fire_torp(&dd, &sub, range, ntorping))
if (candchrg(&dd, &sub))
- fire_dchrg(&dd, &sub, range, ntorping);
+ fire_dchrg(&dd, &sub, ntorping);
} else
- fire_dchrg(&dd, &sub, range, ntorping);
+ fire_dchrg(&dd, &sub, ntorping);
}
}
}
static void
-fire_dchrg(struct shpstr *sp, struct shpstr *targ, int range, int ntargets)
+fire_dchrg(struct shpstr *sp, struct shpstr *targ, int ntargets)
{
int dam;
int shells;
static int take_casualty(int combat_mode, struct combat *off,
struct emp_qelem *olist);
-static void send_reacting_units_home(struct combat *def,
- struct emp_qelem *list);
+static void send_reacting_units_home(struct emp_qelem *list);
static int take_def(int combat_mode, struct emp_qelem *list,
struct combat *off, struct combat *def);
do_sneak(def, success);
}
- send_reacting_units_home(def, dlist);
+ send_reacting_units_home(dlist);
/* putland the defending land */
lnd_put(dlist, 0);
/* Send reacting defense units back to where they came from (at no mob cost) */
static void
-send_reacting_units_home(struct combat *def, struct emp_qelem *list)
+send_reacting_units_home(struct emp_qelem *list)
{
struct emp_qelem *qp, *next;
struct llist *llp;
* 2 = update only bmap with force
*/
-static int do_map_set(natid cnum, s_char *map, coord x, coord y,
- s_char t, int force, int sync);
+static int do_map_set(s_char *map, coord x, coord y, s_char t, int force);
int
map_set(natid cnum, coord x, coord y, s_char t, int only_bmap)
if (!t)
return 0;
if (!only_bmap)
- set |= do_map_set(cnum, ef_ptr(EF_MAP, cnum), x, y, t, 0, 0);
- set |=
- do_map_set(cnum, ef_ptr(EF_BMAP, cnum), x, y, t, only_bmap > 1, 1);
+ set |= do_map_set(ef_ptr(EF_MAP, cnum), x, y, t, 0);
+ set |= do_map_set(ef_ptr(EF_BMAP, cnum), x, y, t, only_bmap > 1);
return set;
}
static int
-do_map_set(natid cnum, s_char *map, coord x, coord y, s_char t, int force,
- int sync)
+do_map_set(s_char *map, coord x, coord y, s_char t, int force)
{
int id;
s_char ot;
}
s_char *
-nameofitem(s_char *buf, struct genitem *gp, int type)
+nameofitem(struct genitem *gp, int type)
{
switch (type) {
case EF_SHIP:
int size, first = 1, radius;
s_char *block;
struct genitem *gp;
- s_char buf[128];
size = max(sizeof(struct lndstr), sizeof(struct plnstr));
size = max(size, sizeof(struct shpstr));
pr("Thing x,y op-sect rad mission\n");
first = 0;
}
- pr("%-25s", nameofitem(buf, gp, type));
+ pr("%-25s", nameofitem(gp, type));
pr(" %7s", xyas(gp->x, gp->y, player->cnum));
if (gp->mission == MI_INTERDICT || gp->mission == MI_SUPPORT ||
gp->mission == MI_OSUPPORT ||
static int landrepair(register struct lndstr *, int *, struct natstr *,
int *, int);
-static void upd_land(register struct lndstr *lp, int landno, register int etus,
+static void upd_land(register struct lndstr *lp, register int etus,
struct natstr *np, int *bp, int build);
int
}
np = getnatp(lp->lnd_own);
start_money = np->nat_money;
- upd_land(lp, n, etus, np, bp, build);
+ upd_land(lp, etus, np, bp, build);
lnd_money[lp->lnd_own] += np->nat_money - start_money;
if ((build && (np->nat_money != start_money)) || (!build))
k++;
}
static void
-upd_land(register struct lndstr *lp, int landno, register int etus,
+upd_land(register struct lndstr *lp, register int etus,
struct natstr *np, int *bp, int build)
/* build = 1, maintain = 0 */
{
}
static void
-nav_check_atdest(register struct shpstr *sp, struct mchrstr *mcp)
+nav_check_atdest(register struct shpstr *sp)
{
if ((sp->shp_x == sp->shp_destx[0]) && (sp->shp_y == sp->shp_desty[0])) {
if ((sp->shp_destx[0] == sp->shp_destx[1]) &&
*/
/* Ship not sunk */
if (sp->shp_own)
- nav_check_atdest(sp, mcp);
+ nav_check_atdest(sp);
}
quit = 0; /* stop loop */
int
produce(struct natstr *np, struct sctstr *sp, int *vec, int work,
- int sctwork, int desig, int neweff, int *cost, int *amount)
+ int desig, int neweff, int *cost, int *amount)
{
register struct pchrstr *product;
int vtype;
}
/*
- * now do the production (if sector effic >= 60%)
+ * now do the production (if sector effic >= 60%)
*/
if (neweff >= 60) {
if (np->nat_money > 0 && dchr[desig].d_prd)
work -=
- produce(np, sp, vec, work, sctwork, desig, neweff,
- &pcost, &amount);
+ produce(np, sp, vec, work, desig, neweff, &pcost, &amount);
}
pt_bg_nmbr(bp, sp, I_MAX + 1, work);
static int shiprepair(register struct shpstr *, int *, struct natstr *,
int *, int);
-static void upd_ship(register struct shpstr *, int, register int,
+static void upd_ship(register struct shpstr *, register int,
struct natstr *, int *, int);
int
bp_clear_cachepath();
bp_enable_cachepath();
}
- upd_ship(sp, n, etus, np, bp, build);
+ upd_ship(sp, etus, np, bp, build);
if (build && !player->simulation) /* make sure to only autonav once */
nav_ship(sp); /* autonav the ship */
sea_money[sp->shp_own] += np->nat_money - start_money;
}
static void
-upd_ship(register struct shpstr *sp, int shipno, register int etus,
+upd_ship(register struct shpstr *sp, register int etus,
struct natstr *np, int *bp, int build)
/* build = 1, maintain = 0 */
{