* Known contributors to this file:
* Ken Stevens, 1995
* Steve McClure, 1996-2000
- * Markus Armbruster, 2006-2010
+ * Markus Armbruster, 2006-2013
*/
#include <config.h>
teff = ship.shp_tech / (ship.shp_tech + 200.0);
/* raise 4.5 for better interception -KHS */
hitchance = (int)(gun * eff * teff * 4.5) - hardtarget;
- if (hitchance < 0)
- hitchance = 0;
- if (hitchance > 100)
- hitchance = 100;
- hit = roll(100) <= hitchance;
+ hitchance = LIMIT_TO(hitchance, 0, 100);
+ hit = pct_chance(hitchance);
mpr(bombown, "%s anti-missile system activated...%s\n",
cname(ship.shp_own),