]> git.pond.sub.org Git - empserver/commitdiff
(buil, drnuke_const, opt_DRNUKE, show, show_nuke_build)
authorRon Koenderink <rkoenderink@yahoo.ca>
Thu, 16 Feb 2006 02:14:08 +0000 (02:14 +0000)
committerRon Koenderink <rkoenderink@yahoo.ca>
Thu, 16 Feb 2006 02:14:08 +0000 (02:14 +0000)
(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.

include/econfig-spec.h
include/nuke.h
info/Options.t
info/build.t
src/lib/commands/buil.c
src/lib/commands/show.c
src/lib/commands/vers.c
src/lib/commands/xdump.c
src/lib/global/constants.c
src/lib/global/options.c
src/lib/subs/show.c

index cc15145c1a5d6e12b077dd31fc6151af381349dc..e89880ca63fc36af4f18e3c9d84844fc58362438 100644 (file)
@@ -133,8 +133,6 @@ EMPCF_OPT("DEFENSE_INFRA", opt_DEFENSE_INFRA,
     "Allow the improvement of defensive infrastructure")
 EMPCF_OPT("DEMANDUPDATE", opt_DEMANDUPDATE,
     "Allow demand updates")
     "Allow the improvement of defensive infrastructure")
 EMPCF_OPT("DEMANDUPDATE", opt_DEMANDUPDATE,
     "Allow demand updates")
-EMPCF_OPT("DRNUKE", opt_DRNUKE,
-    "Require research for nuke building")
 EMPCF_OPT("EASY_BRIDGES", opt_EASY_BRIDGES,
     "Allow bridge building without bridge heads")
 EMPCF_OPT("FALLOUT", opt_FALLOUT,
 EMPCF_OPT("EASY_BRIDGES", opt_EASY_BRIDGES,
     "Allow bridge building without bridge heads")
 EMPCF_OPT("FALLOUT", opt_FALLOUT,
@@ -344,7 +342,7 @@ EMPCFBOTH("decay_per_etu", decay_per_etu, double, NSC_DOUBLE, 0,
 EMPCFBOTH("fallout_spread", fallout_spread, double, NSC_DOUBLE, 0,
     "Amount of fallout that leaks into surrounding sectors")
 EMPCFBOTH("drnuke_const", drnuke_const, float, NSC_FLOAT, 0,
 EMPCFBOTH("fallout_spread", fallout_spread, double, NSC_DOUBLE, 0,
     "Amount of fallout that leaks into surrounding sectors")
 EMPCFBOTH("drnuke_const", drnuke_const, float, NSC_FLOAT, 0,
-    "Amount of research to tech needed to build a nuke (if DRNUKE is on)")
+    "Amount of research to tech needed to build a nuke, a common value is 0.33")
 
 EMPCF_COMMENT("\n\n### Market/Trade")
 EMPCFBOTH("MARK_DELAY", MARK_DELAY, int, NSC_INT, 0,
 
 EMPCF_COMMENT("\n\n### Market/Trade")
 EMPCFBOTH("MARK_DELAY", MARK_DELAY, int, NSC_INT, 0,
index 8ef24c854da5e261ffa3c7d154d2caf122dcdab5..0a5cbb942be3f21a6cb5194273dfc757f0c1a22a 100644 (file)
@@ -35,6 +35,7 @@
 #define NUKE_H
 
 #define        N_MAXNUKE       20
 #define NUKE_H
 
 #define        N_MAXNUKE       20
+#define        MIN_DRNUKE_CONST        0.001
 
 struct nukstr {
     /* initial part must match struct genitem */
 
 struct nukstr {
     /* initial part must match struct genitem */
index d05e6b73a3172fcb29f348ced55eba495e46df1e..ade9d21f7c0123f25d11259959da21da6fffc983 100644 (file)
@@ -14,7 +14,6 @@ The following options were introduced in the Chainsaw server:
 EASY_BRIDGES:  bridges can be built from any sector
 SUPER_BARS:    gold bars aren't destroyed by shelling or bombing
 ALL_BLEED:     you get tech bleed from all countries, not just allies
 EASY_BRIDGES:  bridges can be built from any sector
 SUPER_BARS:    gold bars aren't destroyed by shelling or bombing
 ALL_BLEED:     you get tech bleed from all countries, not just allies
-DRNUKE:                research is required to make nukes
 SLOW_WAR:      War declaring takes time. No land attacks unless at war.
 NOMOBCOST:     ships pay 0 mob to fire. Subs pay 1/2 a sect's movement cost
 TRADESHIPS:    you can build/nav/scuttle trade ships to make money
 SLOW_WAR:      War declaring takes time. No land attacks unless at war.
 NOMOBCOST:     ships pay 0 mob to fire. Subs pay 1/2 a sect's movement cost
 TRADESHIPS:    you can build/nav/scuttle trade ships to make money
@@ -53,4 +52,4 @@ TREATIES:       Sign treaties with your friends and enemies, and breaking of
                  them is reported in the news.
 .fi
 
                  them is reported in the news.
 .fi
 
-.SA "Hidden, Server"
+.SA "Hidden, Server, version"
index 35e0e369d4f442854b7acf6b4d2c44420d59091b..b15d078b2be8dc2de8d375346d2bfcb1b824d4e0 100644 (file)
@@ -11,6 +11,10 @@ also used to build bridges.
 To build stuff, you generally need available work, raw materials
 (e.g. light and heavy construction materials, oil, radioactive
 materials), cash, and technology, depending on the thing being built.
 To build stuff, you generally need available work, raw materials
 (e.g. light and heavy construction materials, oil, radioactive
 materials), cash, and technology, depending on the thing being built.
+For nukes, you may also need research, depending on game
+configuration.
+Try commands \*Qversion\*U and \*Qshow\*U to learn
+how your game is configured.
 .s1
 A sector's available work is work not used up by the update (building
 efficiency, working on things, etc).  It is shown in the output of the
 .s1
 A sector's available work is work not used up by the update (building
 efficiency, working on things, etc).  It is shown in the output of the
@@ -118,11 +122,6 @@ Nuclear devices are built in nuclear plants.  All of the materials
 listed by \*Qshow\*U must be available at the time of building.  New nukes
 appear fully operational.
 .s1
 listed by \*Qshow\*U must be available at the time of building.  New nukes
 appear fully operational.
 .s1
-Note: If the DRNUKE option is enabled, you will need a certain amount
-of research to make nukes. At the present time, it is 1/3 the amount of 
-tech needed to make the nuke. See the \*Qshow\*U command, which lists 
-this if applicable.
-.s1
 BUILDING BRIDGES
 .s1
 A bridge is built in a sea sector by an adjacent sector.
 BUILDING BRIDGES
 .s1
 A bridge is built in a sea sector by an adjacent sector.
index 1fe994f74ea3ade394ad2461a7b47c1e0c27bac9..da71333606b8edba77a85f6968889300ace4eec6 100644 (file)
@@ -195,12 +195,13 @@ buil(void)
                np = &nchr[type];
                rqtech = np->n_tech;
                if (rqtech > tlev
                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;
                    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");
                    tt = (tlev < (rlev / drnuke_const) ? (int)tlev :
                          (int)(rlev / drnuke_const));
                pr("You can't build that!\n");
index 5314847f179966d5d122759dc25d523c9c7ae32d..0bbbdf958fba8698c6902d0be5e19e3564cfbcba 100644 (file)
@@ -90,7 +90,7 @@ show(void)
            show_news(99999);
            return RET_OK;
        }
            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;
            tlev = ((rlev / drnuke_const) > tlev ? tlev :
                    (rlev / drnuke_const));
        bfunc = show_nuke_build;
index aaf1ae4b2ccf6a6ed8b8fda7c231881c82b32311..07a0d4da5adf71556759761b68eb37d651e75637 100644 (file)
@@ -173,7 +173,7 @@ vers(void)
 
     if (!ef_nelem(EF_NUKE_CHR))
        pr("Nukes are disabled.\n");
 
     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));
     }
        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));
     }
index 6058220a45fa3bc26154f09b2944b29c36fb44a3..12dfc9d92bc2e098802f2513ec39b4b2cc6e913d 100644 (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;
        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))
            natp = getnatp(player->cnum);
            if (tlev > (int)((int)(1.25 * natp->nat_level[NAT_RLEV])
                             / drnuke_const))
index 90d81b407a7a6c23ac0cbf76c8ac3c08f5b79655..b714097382995229c3ac3ceec41325cc06ff9be9 100644 (file)
@@ -199,8 +199,7 @@ double buil_tower_bc = 7500.0;      /* cash required to build a bridge tower */
 /* opt_SLOW_WAR */
 int War_Cost = 1000;           /* Cost to declare war */
 
 /* opt_SLOW_WAR */
 int War_Cost = 1000;           /* Cost to declare war */
 
-/* opt_DRNUKE */
-float drnuke_const = .33;      /* research must be at least drnuke_const*tech */
+float drnuke_const = 0.0;      /* research must be at least drnuke_const*tech */
                                /* in order to build a nuke. For example, if
                                 * drnuke_const is .25, you need a 75 res to
                                 * build a nuke that takes 300 tech
                                /* in order to build a nuke. For example, if
                                 * drnuke_const is .25, you need a 75 res to
                                 * build a nuke that takes 300 tech
index 9249bbe6c2dc5c1896a138207fe88c4003bbeb73..6f6ba31478f32a0e39d2a0c3f6ee692812801680 100644 (file)
@@ -42,7 +42,6 @@ int opt_BLITZ = 1;
 int opt_BRIDGETOWERS = 1;
 int opt_DEFENSE_INFRA = 0;
 int opt_DEMANDUPDATE = 1;
 int opt_BRIDGETOWERS = 1;
 int opt_DEFENSE_INFRA = 0;
 int opt_DEMANDUPDATE = 1;
-int opt_DRNUKE = 0;
 int opt_EASY_BRIDGES = 1;
 int opt_FALLOUT = 1;
 int opt_FUEL = 0;
 int opt_EASY_BRIDGES = 1;
 int opt_FALLOUT = 1;
 int opt_FUEL = 0;
index 6cb1e5f22ef9e8a4a8cce5f0b0bcd596eee1ff57..b179df37d5939fd6bbb4711f476cd57ef23f3dcc 100644 (file)
@@ -173,10 +173,11 @@ show_nuke_build(int tlev)
        avail = NUK_BLD_WORK(np->n_lcm, np->n_hcm, np->n_oil, np->n_rad);
        if (np->n_tech > tlev)
            continue;
        avail = NUK_BLD_WORK(np->n_lcm, np->n_hcm, np->n_oil, np->n_rad);
        if (np->n_tech > tlev)
            continue;
-       pr("%-13.13s %3d %3d %4d %4d %5d %4d %3d $%6d\n",
+       pr("%-13.13s %3d %3d %4d %4d %5d %4d %3.0f $%6d\n",
           np->n_name, np->n_lcm, np->n_hcm, np->n_oil,
           np->n_rad, avail, np->n_tech,
           np->n_name, np->n_lcm, np->n_hcm, np->n_oil,
           np->n_rad, avail, np->n_tech,
-          opt_DRNUKE ? (int)(np->n_tech * drnuke_const) + 1 : 0,
+          drnuke_const > MIN_DRNUKE_CONST ?
+               (np->n_tech * drnuke_const) + 1.0 : 0.0,
           np->n_cost);
     }
 }
           np->n_cost);
     }
 }
@@ -193,10 +194,11 @@ show_nuke_capab(int tlev)
     for (np = nchr; np->n_name; np++) {
        if (np->n_tech > tlev)
            continue;
     for (np = nchr; np->n_name; np++) {
        if (np->n_tech > tlev)
            continue;
-       pr("%-13.13s %4d %3d %3d %4d %3d $%7d ",
+       pr("%-13.13s %4d %3d %3d %4d %3.0f $%7d ",
           np->n_name, np->n_blast, np->n_dam,
           np->n_weight, np->n_tech,
           np->n_name, np->n_blast, np->n_dam,
           np->n_weight, np->n_tech,
-          opt_DRNUKE ? (int)(np->n_tech * drnuke_const) + 1 : 0,
+          drnuke_const > MIN_DRNUKE_CONST ?
+               (np->n_tech * drnuke_const) + 1.0 : 0.0,
           np->n_cost);
        for (i = j = 0; i < 32; i++) {
            if (!(np->n_flags & bit(i)))
           np->n_cost);
        for (i = j = 0; i < 32; i++) {
            if (!(np->n_flags & bit(i)))