]> git.pond.sub.org Git - empserver/blobdiff - src/lib/commands/vers.c
Update copyright notice
[empserver] / src / lib / commands / vers.c
index cde2ce125f4a6a5096593aca8cfd5ab36ad2f48f..d95de6cf752ab5d4a7d6b991643a11cae87a8382 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2011, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2017, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                Ken Stevens, Steve McClure, Markus Armbruster
  *
  *  Empire is free software: you can redistribute it and/or modify
@@ -33,7 +33,7 @@
  *     Ken Stevens
  *     Steve McClure
  *     Ron Koenderink, 2005-2006
- *     Markus Armbruster, 2005-2010
+ *     Markus Armbruster, 2005-2014
  */
 
 #include <config.h>
@@ -44,6 +44,7 @@
 #include "ship.h"
 #include "version.h"
 
+static int have_trade_ships(void);
 static void show_custom(void);
 static void show_opts(int val);
 static char *prwrap(char *, char *, int *);
@@ -67,9 +68,9 @@ vers(void)
     pr("Each country is allowed to be logged in %d minutes a day.\n",
        m_m_p_d);
     if (*game_days != 0)
-       pr("Game days are %s\n", game_days);
+       pr("Game days are %s.\n", game_days);
     if (*game_hours != 0)
-       pr("Game hours are %s\n", game_hours);
+       pr("Game hours are %s.\n", game_hours);
     pr("It takes %.2f civilians to produce a BTU in one time unit.\n",
        (1.0 / (btu_build_rate * 100.0)));
     pr("\n");
@@ -118,7 +119,7 @@ vers(void)
 
     pr("Tech buildup is ");
     if (tech_log_base <= 1.0) {
-       pr("not limited\n");
+       pr("not limited.\n");
     }
     if (tech_log_base > 1.0) {
        pr("limited to logarithmic growth (base %.2f)", tech_log_base);
@@ -155,8 +156,7 @@ vers(void)
        pr("The starting mobility when acquiring a sector or unit is %d.\n",
           -(etu_per_update / sect_mob_neg_factor));
     pr("\n");
-    pr("Ships on autonavigation may use %i cargo holds per ship.\n", TMAX);
-    if (opt_TRADESHIPS) {
+    if (have_trade_ships()) {
        pr("Trade-ships that go at least %d sectors get a return of %.1f%% per sector.\n",
           trade_1_dist, trade_1 * 100.0);
        pr("Trade-ships that go at least %d sectors get a return of %.1f%% per sector.\n",
@@ -169,9 +169,9 @@ vers(void)
           trade_ally_cut * 100.0);
     }
     if (opt_MARKET) {
-       pr("The tax you pay on selling things on the trading block is %.1f%%\n",
+       pr("The tax you pay on selling things on the trading block is %.1f%%.\n",
           (1.00 - tradetax) * 100.0);
-       pr("The tax you pay on buying commodities on the market is %.1f%%\n",
+       pr("The tax you pay on buying commodities on the market is %.1f%%.\n",
           (buytax - 1.00) * 100.0);
        pr("The amount of time to bid on commodities is %d seconds.\n",
           MARK_DELAY);
@@ -182,9 +182,9 @@ vers(void)
     if (!ef_nelem(EF_NUKE_CHR))
        pr("Nukes are disabled.\n");
     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",
+       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",
+       pr("\tExample: In order to build a 300 tech nuke, you need %d research.\n\n",
           (int)(300.0 * drnuke_const));
     }
 
@@ -195,7 +195,7 @@ vers(void)
        assault_penalty);
     pr("%.0f%% of fallout leaks into each surrounding sector.\n",
        fallout_spread * 100.0 * MIN(24, etu_per_update));
-    pr("Fallout decays by %.0f%% per update\n",
+    pr("Fallout decays by %.0f%% per update.\n",
        100.0 - (decay_per_etu + 6.0) * fallout_spread * MIN(24, etu_per_update) * 100.0);
     pr("\n");
     pr("Damage to\t\t\tSpills to\n");
@@ -216,21 +216,38 @@ vers(void)
        collateral_dam * 100.0);
     pr("\n");
     pr("You can have at most %d BTUs.\n", max_btus);
-    pr("You are disconnected after %d minutes of idle time.\n", max_idle);
+    pr("%s are disconnected after %d minute%s of idle time.\n",
+       player->nstat & NONVIS ? "You" : "Players",
+       max_idle, splur(max_idle));
+    pr("%s are disconnected after %d minute%s of idle time.\n",
+       player->nstat & NONVIS ? "Visitors" : "You",
+       max_idle_visitor, splur(max_idle_visitor));
     pr("\nOptions enabled in this game:\n");
     show_opts(1);
     pr("\n\nOptions disabled in this game:\n");
     show_opts(0);
     pr("\n\nSee \"info Options\" for a detailed list of options and descriptions.\n");
     show_custom();
-    pr("\nThe person to annoy if something goes wrong is:\n\t%s\n\t(%s).\n",
+    pr("\nThe person to annoy if something goes wrong is:\n\t%s <%s>.\n",
        privname, privlog);
     pr("\nYou can get your own copy of the source from "
-       "http://www.wolfpackempire.com/\n\n");
+       "<http://www.wolfpackempire.com/>.\n\n");
     pr("%s", legal);
     return RET_OK;
 }
 
+static int
+have_trade_ships(void)
+{
+    int i;
+
+    for (i = ef_nelem(EF_SHIP_CHR) - 1; i >= 0; i--) {
+       if (mchr[i].m_flags & M_TRADE)
+           return 1;
+    }
+    return 0;
+}
+
 static void
 show_custom(void)
 {