(buil, drnuke_const, opt_DRNUKE, show, show_nuke_build)

(show_nuke_capab, vers, xdvisible, build.t, Options.t):
Remove opt_DRNUKE and replace with the following check
drnuke_const > MIN_DRNUKE_CONST.
Set MIN_DRNUKE_CONST to 0.001 to prevent issues with tiny values.
Change the default drnuke_const to 0.0 because in the stock game
opt_DRNUKE was disabled.
This commit is contained in:
Ron Koenderink 2006-02-16 02:14:08 +00:00
parent d5f6d74d05
commit b7d0b66161
11 changed files with 20 additions and 22 deletions

View file

@ -195,12 +195,13 @@ buil(void)
np = &nchr[type];
rqtech = np->n_tech;
if (rqtech > tlev
|| (opt_DRNUKE && np->n_tech * drnuke_const > rlev))
|| (drnuke_const > MIN_DRNUKE_CONST &&
np->n_tech * drnuke_const > rlev))
type = -1;
}
if (type < 0) {
int tt = tlev;
if (opt_DRNUKE)
if (drnuke_const > MIN_DRNUKE_CONST)
tt = (tlev < (rlev / drnuke_const) ? (int)tlev :
(int)(rlev / drnuke_const));
pr("You can't build that!\n");

View file

@ -90,7 +90,7 @@ show(void)
show_news(99999);
return RET_OK;
}
if (opt_DRNUKE)
if (drnuke_const > MIN_DRNUKE_CONST)
tlev = ((rlev / drnuke_const) > tlev ? tlev :
(rlev / drnuke_const));
bfunc = show_nuke_build;

View file

@ -173,7 +173,7 @@ vers(void)
if (!ef_nelem(EF_NUKE_CHR))
pr("Nukes are disabled.\n");
else if (opt_DRNUKE) { /* NUKES && DRNUKE enabled */
else if (drnuke_const > MIN_DRNUKE_CONST) {
pr("In order to build a nuke, you need %1.2f times the tech level in research\n", drnuke_const);
pr("\tExample: In order to build a 300 tech nuke, you need %d research\n\n", (int)(300.0 * drnuke_const));
}

View file

@ -242,7 +242,7 @@ xdvisible(int type, void *p)
return player->god || tlev <= (int)(1.25 * natp->nat_level[NAT_TLEV]);
case EF_NUKE_CHR:
tlev = ((struct nchrstr *)p)->n_tech;
if (opt_DRNUKE) {
if (drnuke_const > MIN_DRNUKE_CONST) {
natp = getnatp(player->cnum);
if (tlev > (int)((int)(1.25 * natp->nat_level[NAT_RLEV])
/ drnuke_const))