]> git.pond.sub.org Git - empserver/commitdiff
(shp_nav_one_sector, mchr[], ship_chr_flags[], Ship-types, Sector-types):
authorRon Koenderink <rkoenderink@yahoo.ca>
Sun, 18 Dec 2005 15:16:52 +0000 (15:16 +0000)
committerRon Koenderink <rkoenderink@yahoo.ca>
Sun, 18 Dec 2005 15:16:52 +0000 (15:16 +0000)
Add M_CANAL flag to indicate which ships can navigate a canal
in a big city.  Remove the hard code values for canal from
shp_nav_one_sector() for which ships can navigate a canal.
Set M_CANAL flag in ship_chr_flags[] to match the hard
coding in shp_nav_one_sector().
Update Ship-types.t with new canal flag.
Update Sector-types.t to indicate that cities have canals.

include/ship.h
info/Concepts/Sector-types.t
info/Concepts/Ship-types.t
src/lib/global/nsc.c
src/lib/global/ship.c
src/lib/subs/shpsub.c

index e7554441222eeefb311f7097c7523ca53d73f32d..489147260c5436eaeb505080fcc9aa3bec247f90 100644 (file)
@@ -174,6 +174,7 @@ struct mchrstr {
 #define M_CHOPPER      bit(16) /* can hold choppers */
 #define M_OILER                bit(17) /* can re-fuel ships */
 #define M_SUPPLY       bit(18) /* Can supply units/sects/ships */
+#define M_CANAL                bit(19) /* Can navigate a canal (BIG CITY) */
 #define M_ANTIMISSILE   bit(20)        /* Shoot down missile */
 
 #define getship(n, p) \
index be75fea40ea1f3949f021da8e895c36a3ffd24e7..fa04cefe5b84e68a0910e083056f76b963879fbe 100644 (file)
@@ -83,6 +83,9 @@ perhaps like Pancho Villa.  Note that if the BIG_CITY option is
 enabled, then 'c' sectors stand for 'cities' and can hold 10x as many
 civs.  They also get a 10x packing bonus for moving civs, and require
 a certain number of lcm's, hcm's, and $$ to build (see show sect build).
+Cities also have canals which allows ships with canal cability
+(see info \*QShip-types\*U) to navigate
+through them.
 .s1
 PARK - Parks are provided solely for the convenience of the 
 people.
@@ -413,4 +416,4 @@ one product, tech and edu requirements, production efficiency
 multiplier, monetary cost and resource depletion.  See info
 \*QProducts\*U for details.
 .s1
-.SA "improve, designate, show, BTU, Sectors"
+.SA "improve, designate, show, BTU, Sectors, Ship-types"
index f7a98b7eb0ebdc7a113c31cf28e282bc746a36c7..0604f507a14381c02de78f0d95e9292b2a2ba37a 100644 (file)
@@ -267,6 +267,8 @@ The vessel is a trade ship. (only if TRADESHIPS are enabled)
 .L supply
 The vessel can supply other units.
 Unless the vessel is a submarine, it can load non-light land units.
+.L canal
+The vessel can navigate canals (see info \*QSector-types\*U).
 .L anti-missile
 The vessel will intercept enemy marine missiles (see \*Qinfo Hitchance\*U).
 .in
@@ -312,4 +314,4 @@ battleship 1               120m 20s 4g 120f semi-land
 fishing boat 2             300c 10m 900f 15u fish
 .FI
 .s1
-.SA "coastwatch, fire, load, lookout, mine, navigate, tend, torpedo, fly, show, Trade-ships, Ships"
+.SA "coastwatch, fire, load, lookout, mine, navigate, tend, torpedo, fly, show, Trade-ships, Ships, Sector-types"
index 899555897a3a58718373e6662c1c977c02eece85..f2ac80687f93a6677260ac2b1944a5360e1942d8 100644 (file)
@@ -567,6 +567,7 @@ struct symbol ship_chr_flags[] = {
     {M_SEMILAND, "semi-land"},
     {M_OILER, "oiler"},
     {M_SUPPLY, "supply"},
+    {M_CANAL, "canal"},
     {M_ANTIMISSILE, "anti-missile"},
     {0, NULL}
 };
index 406c31db043f52adac1acc56ea93eba464f607ff..c4393f1b75b274c67f77ed17637b4a3ab39eece3 100644 (file)
@@ -57,11 +57,11 @@ struct mchrstr mchr[] = {
 
     {{300,  10,   0,   0,   0,   0,   0,   0, 900,   0,   0,   0,  15,   0},
      25, 15, 10, 10, 15, 2, 0, 0, 0, 0, 0, 0, "fb   fishing boat",
-     0, 180, M_FOOD, 0, 0},
+     0, 180, M_FOOD | M_CANAL, 0, 0},
 
     {{300,  10,   0,   0,   0,   0,   0,   0, 900,   0,   0,   0,  15,   0},
      25, 15, 10, 25, 15, 2, 0, 0, 0, 0, 20, 1, "ft   fishing trawler",
-     35, 300, M_FOOD, 0, 0},
+     35, 300, M_FOOD | M_CANAL, 0, 0},
 
     {{600,  50, 300,  50,   0,   0,   0,   0, 900,   0,1400, 900, 250,   0},
      60, 40, 20, 25, 35, 3, 0, 0, 1, 0, 0, 0, "cs   cargo ship",
@@ -85,7 +85,7 @@ struct mchrstr mchr[] = {
 
     {{10,   5,   0,   0,   0,   0,   0,   0, 100,   1,   0,   0,   0,   0},
      25, 15, 10, 25, 15, 2, 0, 0, 0, 0, 20, 1, "oe   oil exploration boat",
-     40, 800, M_OIL, 0, 0},
+     40, 800, M_OIL | M_CANAL, 0, 0},
 
     {{990,  80,   0,   0,   0,   0,   0,   0, 990, 990,   0,   0, 990,   0},
      60, 60, 30, 15, 65, 3, 0, 0, 2, 0, 0, 0, "od   oil derrick",
@@ -93,7 +93,7 @@ struct mchrstr mchr[] = {
 
     {{0,   2,  12,   2,   0,   0,   0,   0,   5,   0,   0,   0,   0,   0},
      20, 10, 10, 38, 10, 2, 1, 1, 0, 0, 4, 1, "pt   patrol boat",
-     40, 300, M_TORP, 0, 0},
+     40, 300, M_TORP | M_CANAL, 0, 0},
 
     {{0, 100,  40,   5,   0,   0,   0,   0, 100,   0,   0,   0,   0,   0},
      30, 40, 50, 30, 30, 5, 6, 3, 1, 0, 40, 1, "lc   light cruiser",
@@ -121,7 +121,7 @@ struct mchrstr mchr[] = {
 
     {{0,  10, 100,   1,   0,   0,   0,   0,  90,   0,   0,   0,   0,   0},
      25, 15, 10, 25, 15, 2, 0, 0, 0, 0, 20, 1, "ms   minesweeper",
-     40, 400, M_MINE | M_SWEEP, 0, 0},
+     40, 400, M_MINE | M_SWEEP | M_CANAL, 0, 0},
 
     {{0,  60,  40,   4,   0,   0,   0,   0,  80,   0,   0,   0,   0,   0},
      30, 30, 45, 35, 20, 4, 6, 3, 1, 0, 30, 1, "dd   destroyer",
index ccb72fd56e194d634127fc96f28a4e71ef4668bb..62493fa95ad52acf7b1fe714151df4de08748887 100644 (file)
@@ -835,7 +835,7 @@ shp_nav_one_sector(struct emp_qelem *list, int dir, natid actor,
            }
        }
        if (IS_BIG_CITY(sect.sct_type)) {
-           if (mlp->mcp->m_lcm + 2 * mlp->mcp->m_hcm >= 60) {
+           if (!(mlp->mcp->m_flags & M_CANAL)) {
                sprintf(dp,
                        "is too large to fit into the canal system at %s",
                        xyas(newx, newy, actor));