]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/show.c
Fix trailing whitespace
[empserver] / src / lib / commands / show.c
index a643ba89da5fbd5f154669e029023477f2c4de94..c4b0e4683d00534fa42c55c3ee46cdecd3c68c3f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2006, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2008, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                           Ken Stevens, Steve McClure
  *
  *  This program is free software; you can redistribute it and/or modify
@@ -26,7 +26,7 @@
  *  ---
  *
  *  show.c: Give info on empire objects, planes, boats, nukes, etc.
- * 
+ *
  *  Known contributors to this file:
  *     Julian Onions, 1988
  *     Steve McClure, 1997
 
 #include <config.h>
 
-#include "misc.h"
-#include "player.h"
-#include "nat.h"
-#include "file.h"
-#include "optlist.h"
-#include "subs.h"
 #include "commands.h"
+#include "nuke.h"
+#include "optlist.h"
 
 int
 show(void)
 {
-    s_char *p;
-    void (*cfunc) (int);
-    void (*sfunc) (int);
-    void (*bfunc) (int);
+    char *p;
+    void (*cfunc)(int);
+    void (*sfunc)(int);
+    void (*bfunc)(int);
     struct natstr *natp;
     int tlev;
-    s_char buf[1024];
+    char buf[1024];
     int rlev;
 
     if (!(p = getstarg(player->argp[1],
-                      "Describe what (plane, nuke, bridge, ship, sect, land unit, tower, item)? ",
+                      "Show what (bridge, item, land, nuke, plane, sect, ship, tower, updates)? ",
                       buf))
        || !*p)
        return RET_SYN;
@@ -74,7 +70,6 @@ show(void)
     }
     if (player->god)
        rlev = 1000;
-    pr("Printing for tech level '%d'\n", tlev);
     switch (*p) {
     case 'b':
        show_bridge(99999);
@@ -86,7 +81,11 @@ show(void)
        show_item(99999);
        return RET_OK;
     case 'n':
-       if (opt_DRNUKE)
+       if (*(p + 1) == 'e') {
+           show_news(99999);
+           return RET_OK;
+       }
+       if (drnuke_const > MIN_DRNUKE_CONST)
            tlev = ((rlev / drnuke_const) > tlev ? tlev :
                    (rlev / drnuke_const));
        bfunc = show_nuke_build;
@@ -99,6 +98,10 @@ show(void)
        cfunc = show_land_capab;
        break;
     case 'p':
+       if (p[1] == 'r') {
+           show_product(99999);
+           return RET_OK;
+       }
        bfunc = show_plane_build;
        sfunc = show_plane_stats;
        cfunc = show_plane_capab;
@@ -114,19 +117,24 @@ show(void)
            cfunc = show_ship_capab;
        }
        break;
+    case 'u':
+       show_updates(player->argp[2] ? atoi(player->argp[2]) : 8);
+       return RET_OK;
     default:
        return RET_SYN;
     }
+
     if (!(p = getstarg(player->argp[2],
                       "Build, stats, or capability data (b,s,c)? ", buf))
        || !*p)
        return RET_SYN;
+    pr("Printing for tech level '%d'\n", tlev);
     if (*p == 'B' || *p == 'b')
-       (*bfunc) (tlev);
+       bfunc(tlev);
     else if (*p == 'C' || *p == 'c')
-       (*cfunc) (tlev);
+       cfunc(tlev);
     else if (*p == 'S' || *p == 's')
-       (*sfunc) (tlev);
+       sfunc(tlev);
     else
        return RET_SYN;
     return RET_OK;