static int
build_bspan(struct sctstr *sp)
{
- short *vec = sp->sct_item;
struct sctstr sect;
+ short mat[I_MAX+1];
+ int work;
int val;
int newx, newy;
- int avail;
int nx, ny, i, good = 0;
char *p;
char buf[1024];
}
}
- if (sp->sct_effic < 60 && !player->god) {
- pr("Sector %s is not 60%% efficient.\n",
- xyas(sp->sct_x, sp->sct_y, player->cnum));
- return 0;
- }
+ memset(mat, 0, sizeof(mat));
+ mat[I_HCM] = buil_bh;
+ work = (SCT_BLD_WORK(0, buil_bh) * SCT_MINEFF + 99) / 100;
- if (vec[I_HCM] < buil_bh) {
- pr("%s only has %d unit%s of hcm,\n",
- xyas(sp->sct_x, sp->sct_y, player->cnum),
- vec[I_HCM], vec[I_HCM] > 1 ? "s" : "");
- pr("(a bridge span requires %d)\n", buil_bh);
+ if (!sector_can_build(sp, mat, work, 100, dchr[SCT_BSPAN].d_name))
return 0;
- }
-
if (!build_can_afford(buil_bc, 100, dchr[SCT_BSPAN].d_name))
return 0;
- avail = (SCT_BLD_WORK(0, buil_bh) * SCT_MINEFF + 99) / 100;
- if (sp->sct_avail < avail) {
- pr("Not enough available work in %s to build a bridge\n",
- xyas(sp->sct_x, sp->sct_y, player->cnum));
- pr(" (%d available work required)\n", avail);
- return 0;
- }
if (!player->argp[3]) {
pr("Bridge head at %s\n",
xyas(sp->sct_x, sp->sct_y, player->cnum));
if (!p || !*p) {
return 0;
}
- /* Sanity check time */
if (!check_sect_ok(sp))
return 0;
return 0;
}
} /* end EASY_BRIDGES */
- sp->sct_avail -= avail;
- player->dolcost += buil_bc;
+ build_charge(sp, mat, work, buil_bc, 100);
+
sect.sct_type = SCT_BSPAN;
sect.sct_newtype = SCT_BSPAN;
sect.sct_effic = SCT_MINEFF;
putsect(§);
pr("Bridge span built over %s\n",
xyas(sect.sct_x, sect.sct_y, player->cnum));
- vec[I_HCM] -= buil_bh;
return 1;
}
static int
build_btower(struct sctstr *sp)
{
- short *vec = sp->sct_item;
struct sctstr sect;
+ short mat[I_MAX+1];
+ int work;
int val;
int newx, newy;
- int avail;
char *p;
char buf[1024];
int i;
return 0;
}
- if (sp->sct_effic < 60 && !player->god) {
- pr("Sector %s is not 60%% efficient.\n",
- xyas(sp->sct_x, sp->sct_y, player->cnum));
- return 0;
- }
+ memset(mat, 0, sizeof(mat));
+ mat[I_HCM] = buil_tower_bh;
+ work = (SCT_BLD_WORK(0, buil_tower_bh) * SCT_MINEFF + 99) / 100;
- if (vec[I_HCM] < buil_tower_bh) {
- pr("%s only has %d unit%s of hcm,\n",
- xyas(sp->sct_x, sp->sct_y, player->cnum),
- vec[I_HCM], vec[I_HCM] > 1 ? "s" : "");
- pr("(a bridge tower requires %d)\n", buil_tower_bh);
+ if (!sector_can_build(sp, mat, work, 100, dchr[SCT_BTOWER].d_name))
return 0;
- }
-
if (!build_can_afford(buil_tower_bc, 100, dchr[SCT_BTOWER].d_name))
return 0;
- avail = (SCT_BLD_WORK(0, buil_tower_bh) * SCT_MINEFF + 99) / 100;
- if (sp->sct_avail < avail) {
- pr("Not enough available work in %s to build a bridge tower\n",
- xyas(sp->sct_x, sp->sct_y, player->cnum));
- pr(" (%d available work required)\n", avail);
- return 0;
- }
if (!player->argp[3]) {
pr("Building from %s\n", xyas(sp->sct_x, sp->sct_y, player->cnum));
nav_map(sp->sct_x, sp->sct_y, 1);
if (!p || !*p) {
return 0;
}
- /* Sanity check time */
if (!check_sect_ok(sp))
return 0;
}
}
- sp->sct_avail -= avail;
- player->dolcost += buil_tower_bc;
+ build_charge(sp, mat, work, buil_tower_bc, 100);
+
sect.sct_type = SCT_BTOWER;
sect.sct_newtype = SCT_BTOWER;
sect.sct_effic = SCT_MINEFF;
putsect(§);
pr("Bridge tower built in %s\n",
xyas(sect.sct_x, sect.sct_y, player->cnum));
- vec[I_HCM] -= buil_tower_bh;
return 1;
}
Play#5 output Play#5 6 0 639
Play#5 input build b 4:6,4 n
Play#5 command build
- Play#5 output Play#5 1 4,4 only has 0 unit of hcm,
- Play#5 output Play#5 1 (a bridge span requires 100)
+ Play#5 output Play#5 1 Not enough heavy products in 4,4 (need 100 more)
Play#5 output Play#5 1 Sector 6,4 is not 60% efficient.
Play#5 output Play#5 6 0 638
Play#5 input move h 0,4 99 ggh
Play#5 output Play#5 6 0 637
Play#5 input build b -4,4 n
Play#5 command build
- Play#5 output Play#5 1 -4,4 only has 99 units of hcm,
- Play#5 output Play#5 1 (a bridge span requires 100)
+ Play#5 output Play#5 1 Not enough heavy products in -4,4 (need 1 more)
Play#5 output Play#5 6 0 636
Play#5 input move h 0,4 201 ggh
Play#5 command move
Play#5 output Play#5 6 0 629
Play#5 input build b -4:4,4 ?des#c&des#w b
Play#5 command build
- Play#5 output Play#5 1 Not enough available work in -4,4 to build a bridge
+ Play#5 output Play#5 1 Not enough available work in -4,4 to build a bridge span
Play#5 output Play#5 1 (40 available work required)
- Play#5 output Play#5 1 2,4 only has 0 unit of hcm,
- Play#5 output Play#5 1 (a bridge span requires 100)
+ Play#5 output Play#5 1 Not enough heavy products in 2,4 (need 100 more)
Play#5 output Play#5 1 Bridge span built over 3,5
Play#5 output Play#5 1 That just cost you $1000.00
Play#5 output Play#5 6 0 628
Play#9 input build t -9:-8,-5:-4 b
Play#9 command build
Play#9 output Play#9 1 Sector -9,-5 is not 60% efficient.
- Play#9 output Play#9 1 -8,-4 only has 0 unit of hcm,
- Play#9 output Play#9 1 (a bridge tower requires 300)
+ Play#9 output Play#9 1 Not enough heavy products in -8,-4 (need 300 more)
Play#9 output Play#9 6 0 638
Play#9 input move h 0,-4 299 gyggbh
Play#9 command move
Play#9 output Play#9 6 0 637
Play#9 input build t -8,-4 g
Play#9 command build
- Play#9 output Play#9 1 -8,-4 only has 299 units of hcm,
- Play#9 output Play#9 1 (a bridge tower requires 300)
+ Play#9 output Play#9 1 Not enough heavy products in -8,-4 (need 1 more)
Play#9 output Play#9 6 0 636
Play#9 input move h 0,-4 601 gyggbh
Play#9 command move
Play#7 output Play#7 6 0 638
Play#7 input build b 4:6,-2 u
Play#7 command build
- Play#7 output Play#7 1 4,-2 only has 0 unit of hcm,
- Play#7 output Play#7 1 (a bridge span requires 100)
+ Play#7 output Play#7 1 Not enough heavy products in 4,-2 (need 100 more)
Play#7 output Play#7 1 Sector 6,-2 is not 60% efficient.
Play#7 output Play#7 6 0 637
Play#7 input move h 0,-2 99 jh
Play#7 output Play#7 6 0 636
Play#7 input build b 2,-2 u
Play#7 command build
- Play#7 output Play#7 1 2,-2 only has 99 units of hcm,
- Play#7 output Play#7 1 (a bridge span requires 100)
+ Play#7 output Play#7 1 Not enough heavy products in 2,-2 (need 1 more)
Play#7 output Play#7 6 0 635
Play#7 input move h 0,-2 201 jh
Play#7 command move
Play#7 output Play#7 6 0 628
Play#7 input build b 2:4,-2
Play#7 command build
- Play#7 output Play#7 1 Not enough available work in 2,-2 to build a bridge
+ Play#7 output Play#7 1 Not enough available work in 2,-2 to build a bridge span
Play#7 output Play#7 1 (40 available work required)
Play#7 output Play#7 1 Bridge head at 4,-2
Play#7 output Play#7 1 . .