]> git.pond.sub.org Git - empserver/commitdiff
Clean up and document nuclear damage's chance to destroy nuke
authorMarkus Armbruster <armbru@pond.sub.org>
Thu, 16 Aug 2012 06:24:15 +0000 (08:24 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Wed, 8 May 2013 04:55:19 +0000 (06:55 +0200)
Change chance in percent from damage-1 to damage.  It's always been
damage-1, but I can't bring myself to document the silly -1.

info/Damage.t
src/lib/subs/detonate.c

index a9abf6c428dfa3a3936dd6a547af318de9099409..b07d70043cb7444bb3ce23e72a19c66d15873aa8 100644 (file)
@@ -87,6 +87,10 @@ Land unit
 Plane
 %damage = damage
 
+Nuke
+can't be damaged by conventional weapons
+nuclear damage may destroy it (chance in percent equal to damage)
+
 Sector
 sectdamage = damage / ((sectdef - 2) * eff + 2)
 %damage = (100 * sectdamage / (sectdamage + 100))
@@ -97,5 +101,8 @@ planes take 1/7 of the damage done to land units
 Commodity
 %damage = (100 * damage / (damage + 50))
 
+Note: when a ship, plane, land unit or bridge is destroyed, its
+contents is lost.  This includes nukes.
+
 .fi
 .SA "fire, launch, torpedo, lmine, bomb, Hitchance, Attacking, Combat"
index 171f98f7fd6f41d356fef96cf426a7500d9c39b3..a60923ad31e8de3ba397b4e9495740768641a584 100644 (file)
@@ -28,7 +28,7 @@
  *
  *  Known contributors to this file:
  *     Steve McClure, 1998-2000
- *     Markus Armbruster, 2004-2010
+ *     Markus Armbruster, 2004-2012
  */
 
 #include <config.h>
@@ -279,7 +279,7 @@ detonate(struct nukstr *np, coord x, coord y, int airburst)
            continue;
        if ((damage = nukedamage(ncp, ni.curdist, airburst)) <= 0)
            continue;
-       if (roll(100) >= damage)
+       if (roll(100) > damage)
            continue;
        nuke.nuk_effic = 0;
        if (own == player->cnum) {