Clean up and document nuclear damage's chance to destroy nuke

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.
This commit is contained in:
Markus Armbruster 2012-08-16 08:24:15 +02:00
parent b288f62538
commit f18c46824d
2 changed files with 9 additions and 2 deletions

View file

@ -87,6 +87,10 @@ Land unit
Plane Plane
%damage = damage %damage = damage
Nuke
can't be damaged by conventional weapons
nuclear damage may destroy it (chance in percent equal to damage)
Sector Sector
sectdamage = damage / ((sectdef - 2) * eff + 2) sectdamage = damage / ((sectdef - 2) * eff + 2)
%damage = (100 * sectdamage / (sectdamage + 100)) %damage = (100 * sectdamage / (sectdamage + 100))
@ -97,5 +101,8 @@ planes take 1/7 of the damage done to land units
Commodity Commodity
%damage = (100 * damage / (damage + 50)) %damage = (100 * damage / (damage + 50))
Note: when a ship, plane, land unit or bridge is destroyed, its
contents is lost. This includes nukes.
.fi .fi
.SA "fire, launch, torpedo, lmine, bomb, Hitchance, Attacking, Combat" .SA "fire, launch, torpedo, lmine, bomb, Hitchance, Attacking, Combat"

View file

@ -28,7 +28,7 @@
* *
* Known contributors to this file: * Known contributors to this file:
* Steve McClure, 1998-2000 * Steve McClure, 1998-2000
* Markus Armbruster, 2004-2010 * Markus Armbruster, 2004-2012
*/ */
#include <config.h> #include <config.h>
@ -279,7 +279,7 @@ detonate(struct nukstr *np, coord x, coord y, int airburst)
continue; continue;
if ((damage = nukedamage(ncp, ni.curdist, airburst)) <= 0) if ((damage = nukedamage(ncp, ni.curdist, airburst)) <= 0)
continue; continue;
if (roll(100) >= damage) if (roll(100) > damage)
continue; continue;
nuke.nuk_effic = 0; nuke.nuk_effic = 0;
if (own == player->cnum) { if (own == player->cnum) {