/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2013, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2014, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
#include <math.h>
#include <stdlib.h>
+#include "chance.h"
#include "combat.h"
#include "damage.h"
#include "empobj.h"
/* Have to make a retreat check */
ret_chance = llp->unit.land.lnd_retreat - llp->unit.land.lnd_effic;
- if (roll(100) <= ret_chance) {
+ if (pct_chance(ret_chance)) {
pr("\n");
lnd_print(llp->unit.land.lnd_own, llp, "fails morale check!");
llp->unit.land.lnd_mission = 0;
nreport(land.lnd_own, N_FIRE_BACK, victim, 1);
else
nreport(land.lnd_own, N_FIRE_L_ATTACK, victim, 1);
- if (roll(100) < lnd_acc(&land))
+ if (pct_chance(lnd_acc(&land) - 1))
dam2 /= 2;
dam += dam2;
if (land.lnd_own != attacker)