Remove hard-coded differences between highways and bridge heads
Let highways build and support bridges. Allow bridge heads anywhere, not just on the coast.
This commit is contained in:
parent
9f1b4e2c81
commit
e3658ff2f0
4 changed files with 14 additions and 17 deletions
|
@ -170,6 +170,9 @@ extern struct dchrstr dchr[SCT_TYPE_MAX + 2];
|
|||
extern struct dchrstr bigcity_dchr;
|
||||
#define IS_BIG_CITY(type) (dchr[(type)].d_pkg == UPKG)
|
||||
|
||||
#define IS_BRIDGE_HEAD(type) \
|
||||
((type) == SCT_BHEAD || (type) == SCT_HIWAY || (type) == SCT_BTOWER)
|
||||
|
||||
/* Minimal efficiency of sectors that can be knocked down (bridges) */
|
||||
#define SCT_MINEFF 20
|
||||
|
||||
|
|
|
@ -528,13 +528,11 @@ build_bridge(struct sctstr *sp, short *vec)
|
|||
char buf[1024];
|
||||
|
||||
if (opt_EASY_BRIDGES == 0) { /* must have a bridge head or tower */
|
||||
if (sp->sct_type != SCT_BTOWER) {
|
||||
if (sp->sct_type != SCT_BHEAD)
|
||||
if (!IS_BRIDGE_HEAD(sp->sct_type))
|
||||
return 0;
|
||||
if (sp->sct_newtype != SCT_BHEAD)
|
||||
if (sp->sct_newtype != sp->sct_type)
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (sp->sct_effic < 60 && !player->god) {
|
||||
pr("Sector %s is not 60%% efficient.\n",
|
||||
|
|
|
@ -97,7 +97,7 @@ desi(void)
|
|||
continue;
|
||||
if (sect.sct_type == SCT_SANCT)
|
||||
breaksanct++;
|
||||
if ((des == SCT_HARBR || des == SCT_BHEAD) && !sect.sct_coastal) {
|
||||
if (des == SCT_HARBR && !sect.sct_coastal) {
|
||||
pr("%s does not border on water.\n",
|
||||
xyas(nstr.x, nstr.y, player->cnum));
|
||||
if (player->god)
|
||||
|
@ -129,12 +129,9 @@ desi(void)
|
|||
if (sect.sct_x == cap_x && sect.sct_y == cap_y
|
||||
&& des != SCT_CAPIT && des != SCT_SANCT && des != SCT_MOUNT)
|
||||
pr("You have redesignated your capital!\n");
|
||||
if (opt_EASY_BRIDGES == 0) { /* may cause a bridge fall */
|
||||
if (n != SCT_BHEAD)
|
||||
continue;
|
||||
if (!opt_EASY_BRIDGES && IS_BRIDGE_HEAD(n))
|
||||
bridgefall(§);
|
||||
}
|
||||
}
|
||||
if (changed)
|
||||
writemap(player->cnum);
|
||||
if (breaksanct)
|
||||
|
|
|
@ -70,7 +70,7 @@ bridge_damaged(struct sctstr *sp)
|
|||
des = sp->sct_type;
|
||||
if (des == SCT_BSPAN || des == SCT_BTOWER)
|
||||
knockdown(sp);
|
||||
if ((des == SCT_BHEAD || des == SCT_BTOWER) && !opt_EASY_BRIDGES)
|
||||
if (IS_BRIDGE_HEAD(des) && !opt_EASY_BRIDGES)
|
||||
bridgefall(sp);
|
||||
}
|
||||
|
||||
|
@ -98,17 +98,16 @@ bridgefall(struct sctstr *sp)
|
|||
if (nnx == sp->sct_x && nny == sp->sct_y)
|
||||
continue;
|
||||
getsect(nnx, nny, &bh_sect);
|
||||
if (bh_sect.sct_type == SCT_BHEAD &&
|
||||
bh_sect.sct_newtype == SCT_BHEAD)
|
||||
break;
|
||||
if (bh_sect.sct_type == SCT_BTOWER)
|
||||
break;
|
||||
/* With EASY_BRIDGES, it just has to be next to any
|
||||
land */
|
||||
if (opt_EASY_BRIDGES) {
|
||||
if (bh_sect.sct_type != SCT_WATER &&
|
||||
bh_sect.sct_type != SCT_BSPAN)
|
||||
break;
|
||||
} else {
|
||||
if (IS_BRIDGE_HEAD(bh_sect.sct_type)
|
||||
&& bh_sect.sct_newtype == bh_sect.sct_type)
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (j > 6) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue