]> git.pond.sub.org Git - empserver/commitdiff
(land, nuke, plan, shi): Change stop prefix to `!'. Explain it in the
authorMarkus Armbruster <armbru@pond.sub.org>
Thu, 1 Jun 2006 16:29:54 +0000 (16:29 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Thu, 1 Jun 2006 16:29:54 +0000 (16:29 +0000)
footer when actually present.

src/lib/commands/land.c
src/lib/commands/nuke.c
src/lib/commands/plan.c
src/lib/commands/shi.c

index bfdcbed46d2b9fffaa3e4b04ef0616ba6fa4ad42..bb70f452fdef6075536e7304da47cdf06f29e2c9 100644 (file)
 int
 land(void)
 {
-    int nunits;
+    int nunits, noff;
     struct nstr_item ni;
     struct lndstr land;
 
     if (!snxtitem(&ni, EF_LAND, player->argp[1]))
        return RET_SYN;
 
-    nunits = 0;
+    nunits = noff = 0;
     while (nxtitem(&ni, &land)) {
        if (land.lnd_own == 0)
            continue;
@@ -69,13 +69,15 @@ land(void)
                pr(" fl");
            pr(" tch retr rd xl ln carry\n");
        }
+       if (land.lnd_off)
+           noff++;
        if (player->god)
            pr("%3d ", land.lnd_own);
        pr("%4d ", ni.cur);
        pr("%-15.15s", lchr[(int)land.lnd_type].l_name);
        prxy(" %4d,%-4d", land.lnd_x, land.lnd_y, player->cnum);
        pr("%1.1s", &land.lnd_army);
-       pr(" %c%3d%%", land.lnd_off ? '=' : ' ', land.lnd_effic);
+       pr(" %c%3d%%", land.lnd_off ? '!' : ' ', land.lnd_effic);
        pr("%4d", land.lnd_item[I_MILIT]);
        pr("%4d", land.lnd_harden);
        pr("%4d", land.lnd_mobil);
@@ -99,7 +101,11 @@ land(void)
        else
            pr("%s: No unit(s)\n", "");
        return RET_FAIL;
-    } else
-       pr("%d unit%s\n", nunits, splur(nunits));
+    } else {
+       pr("%d unit%s", nunits, splur(nunits));
+       if (noff)
+           pr(", %d stopped (eff marked with !)", noff);
+       pr("\n");
+    }
     return RET_OK;
 }
index bd106f6155e1e7c02581bb60c4953d3cef8ceab0..6c51498a4dc90a05cd3f39a3cddea30d7f73c9cf 100644 (file)
 int
 nuke(void)
 {
-    int nnukes;
+    int nnukes, noff;
     struct nstr_item nstr;
     struct nukstr nuk;
     struct plnstr plane;
 
     if (!snxtitem(&nstr, EF_NUKE, player->argp[1]))
        return RET_SYN;
-    nnukes = 0;
+    nnukes = noff = 0;
     while (nxtitem(&nstr, &nuk)) {
        if (!player->owner || nuk.nuk_own == 0)
            continue;
@@ -63,12 +63,14 @@ nuke(void)
                pr("own ");
            pr("   # nuke type              x,y    s   eff tech carry burst\n");
        }
+       if (nuk.nuk_off)
+           noff++;
        if (player->god)
            pr("%-3d ", nuk.nuk_own);
        pr("%4d %-19.19s ", nstr.cur, nchr[(int)nuk.nuk_type].n_name);
        prxy("%4d,%-4d", nuk.nuk_x, nuk.nuk_y, player->cnum);
        pr(" %1.1s %c%3d%% %4d",
-          &nuk.nuk_stockpile, nuk.nuk_off ? '=' : ' ', nuk.nuk_effic,
+          &nuk.nuk_stockpile, nuk.nuk_off ? '!' : ' ', nuk.nuk_effic,
           nuk.nuk_tech);
        if (nuk.nuk_plane >= 0) {
            getplane(nuk.nuk_plane, &plane);
@@ -85,8 +87,12 @@ nuke(void)
        else
            pr("%s: No nuke(s)\n", "");
        return RET_FAIL;
-    } else
-       pr("%d nuke%s\n", nnukes, splur(nnukes));
+    } else {
+       pr("%d nuke%s", nnukes, splur(nnukes));
+       if (noff)
+           pr(", %d stopped (eff marked with !)", noff);
+       pr("\n");
+    }
 
     return RET_OK;
 }
index 285080bd08b03fef5e5658b4f2f022d00246866d..69c883a8cdf082f545646c55698d0f47ee6e0a1e 100644 (file)
 int
 plan(void)
 {
-    int nplanes;
+    int nplanes, noff;
     struct nstr_item np;
     struct plnstr plane;
 
     if (!snxtitem(&np, EF_PLANE, player->argp[1]))
        return RET_SYN;
-    nplanes = 0;
+    nplanes = noff = 0;
     while (nxtitem(&np, &plane)) {
        if (!player->owner || plane.pln_own == 0)
            continue;
@@ -62,12 +62,14 @@ plan(void)
                pr("own ");
            pr("   #    type                x,y    w   eff  mu def tech ran hard carry special\n");
        }
+       if (plane.pln_off)
+           noff++;
        if (player->god)
            pr("%3d ", plane.pln_own);
        pr("%4d %-19.19s ", np.cur, plchr[(int)plane.pln_type].pl_name);
        prxy("%4d,%-4d", plane.pln_x, plane.pln_y, player->cnum);
        pr(" %1.1s %c%3d%% %3d %3d %4d %3d  %3d",
-          &plane.pln_wing, plane.pln_off ? '=' : ' ', plane.pln_effic,
+          &plane.pln_wing, plane.pln_off ? '!' : ' ', plane.pln_effic,
           plane.pln_mobil, plane.pln_def, plane.pln_tech,
           plane.pln_range, plane.pln_harden);
        if (plane.pln_ship >= 0)
@@ -93,8 +95,12 @@ plan(void)
        else
            pr("%s: No plane(s)\n", "");
        return RET_FAIL;
-    } else
-       pr("%d plane%s\n", nplanes, splur(nplanes));
+    } else {
+       pr("%d plane%s", nplanes, splur(nplanes));
+       if (noff)
+           pr(", %d stopped (eff marked with !)", noff);
+       pr("\n");
+    }
 
     return RET_OK;
 }
index 6371edd5aa5209fb2a118126617f822537590e2d..434011e64177e7adf52134eea27a2e3244686ba2 100644 (file)
 int
 shi(void)
 {
-    int nships;
+    int nships, noff;
     struct nstr_item ni;
     struct shpstr ship;
 
     if (!snxtitem(&ni, EF_SHIP, player->argp[1]))
        return RET_SYN;
 
-    nships = 0;
+    nships = noff = 0;
     while (nxtitem(&ni, &ship)) {
        if (!player->owner || ship.shp_own == 0)
            continue;
@@ -67,13 +67,15 @@ shi(void)
                pr(" fuel");
            pr(" tech\n");
        }
+       if (ship.shp_off)
+           noff++;
        if (player->god)
            pr("%3d ", ship.shp_own);
        pr("%4d ", ni.cur);
        pr("%-16.16s ", mchr[(int)ship.shp_type].m_name);
        prxy("%4d,%-4d ", ship.shp_x, ship.shp_y, player->cnum);
        pr("%1.1s", &ship.shp_fleet);
-       pr(" %c%3d%%", ship.shp_off ? '=' : ' ', ship.shp_effic);
+       pr(" %c%3d%%", ship.shp_off ? '!' : ' ', ship.shp_effic);
 
        pr("%4d", ship.shp_item[I_CIVIL]);
        pr("%4d", ship.shp_item[I_MILIT]);
@@ -100,7 +102,11 @@ shi(void)
        else
            pr("%s: No ship(s)\n", "");
        return RET_FAIL;
-    } else
-       pr("%d ship%s\n", nships, splur(nships));
+    } else {
+       pr("%d ship%s", nships, splur(nships));
+       if (noff)
+           pr(", %d stopped (eff marked with !)", noff);
+       pr("\n");
+    }
     return RET_OK;
 }