]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/attsub.c
Update copyright notice
[empserver] / src / lib / subs / attsub.c
index fd36afce876d8da9d64456a4d0538a4907c1f416..b9242f962fc4ac69f2ac37edc594e7210972d87f 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  Empire - A multi-player, client/server Internet based war game.
- *  Copyright (C) 1986-2016, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ *  Copyright (C) 1986-2021, Dave Pare, Jeff Bailey, Thomas Ruschak,
  *                Ken Stevens, Steve McClure, Markus Armbruster
  *
  *  Empire is free software: you can redistribute it and/or modify
@@ -188,7 +188,8 @@ att_get_combat(struct combat *com, int isdef)
        y = com->y;
        break;
     case EF_LAND:
-       if (!getland(com->lnd_uid, &land) || !land.lnd_own) {
+       if (!getland(com->lnd_uid, &land) || !land.lnd_own
+           || land.lnd_ship >= 0 || land.lnd_land >= 0) {
            if (isdef)
                pr("Land unit #%d is not in the same sector!\n",
                   com->lnd_uid);
@@ -1041,7 +1042,14 @@ ask_olist(int combat_mode, struct combat *off, struct combat *def,
            return;
        }
        att_val = attack_val(combat_mode, &land);
-       if (att_val < 1.0) {
+       /*
+        * We need to let spies assault even though they have no
+        * offensive strength, because assault is how they sneak
+        * ashore.  If this assault turns out to be a fight, they'll
+        * be removed by get_ototal().
+        */
+       if (att_val < 1.0
+           && !(combat_mode == A_ASSAULT && (lcp->l_flags & L_SPY))) {
            pr("%s has no offensive strength\n", prland(&land));
            continue;
        }
@@ -1245,9 +1253,9 @@ get_ototal(int combat_mode, struct combat *off, struct emp_qelem *olist,
        if (check && att_val < 1.0) {
            /*
             * No offensive strength, and fighting hasn't even begun.
-            * Since ask_olist() doesn't offer such land units, the
-            * strength must have been destroyed since then.  Leave it
-            * behind.
+            * Since ask_olist() doesn't offer such land units, except
+            * for spies sometimes, it's either a spy, or the strength
+            * must have been destroyed since then.  Leave it behind.
             */
            lnd_print(player->cnum, llp, "has no offensive strength");
            lnd_put_one(llp);
@@ -1894,7 +1902,7 @@ att_fight(int combat_mode, struct combat *off, struct emp_qelem *olist,
 
     pr("- Casualties -\n     Yours: %d\n", a_cas);
     pr("    Theirs: %d\n", d_cas);
-    pr("Papershuffling ... %.1f B.T.U\n", (d_cas + a_cas) * 0.15);
+    pr("Paper-shuffling ... %.1f BTU\n", (d_cas + a_cas) * 0.15);
     player->btused += (int)((d_cas + a_cas) * 0.015 + 0.5);
 
     if (success) {