/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2010, Dave Pare, Jeff Bailey, Thomas Ruschak,
- * Ken Stevens, Steve McClure
+ * Copyright (C) 1986-2011, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Ken Stevens, Steve McClure, Markus Armbruster
*
- * This program is free software; you can redistribute it and/or modify
+ * Empire is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2 of the License, or
+ * the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
- * along with this program; if not, write to the Free Software
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
*
* ---
*
if (che > (civ + uw) * 3)
return;
che_uw = 0;
- che_civ = 0;
/* che due to civilian unrest */
n = 10 - (random() % 20);
che_civ = 3 + (civ * n / 500);
sp->sct_item[I_CIVIL] = civ;
if (che_uw > 0)
sp->sct_item[I_UW] = uw;
-#ifdef DEBUG
- logerror("(#%d) %d che fired up in %s",
- sp->sct_own, che, ownxy(sp));
-#endif
}
}
while (NULL != (lp = nxtitemp(&ni))) {
if (lp->lnd_own != sp->sct_own)
continue;
+ if (lp->lnd_ship >= 0 || lp->lnd_land >= 0)
+ continue;
mil += lp->lnd_item[I_MILIT];
* guerrillas have to resort to blowing things up.
* Note this disrupts work in the sector.
*/
- n = 0;
n = (random() % 10) + (random() % che);
if (n > 100)
n = 100;
uw -= n;
sp->sct_item[I_UW] = uw;
}
- domove:
+domove:
if (move && che > 0) {
struct sctstr *nicest_sp = NULL;
if (convert)
if (sp->sct_own == target)
wu(0, target, " body count: troops: %d, rebels: %d\n", mc, cc);
else
- wu(0, target,
- " rebels murder %d military\n", mc);
+ wu(0, target, " rebels murder %d military\n", mc);
nreport(actor, N_FREEDOM_FIGHT, victim, 1);
}
if (sp->sct_own != victim)
*/
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
while (NULL != (lp = nxtitemp(&ni))) {
+ if (lp->lnd_own != sp->sct_own)
+ continue;
+ if (lp->lnd_ship >= 0 || lp->lnd_land >= 0)
+ continue;
nunits++;
if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY)
nunits++;
/* kill some security troops */
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
while (NULL != (lp = nxtitemp(&ni))) {
+ if (lp->lnd_own != sp->sct_own)
+ continue;
+ if (lp->lnd_ship >= 0 || lp->lnd_land >= 0)
+ continue;
if (!(lchr[(int)lp->lnd_type].l_flags & L_SECURITY))
continue;
/* kill some normal troops */
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
while (NULL != (lp = nxtitemp(&ni))) {
+ if (lp->lnd_own != sp->sct_own)
+ continue;
+ if (lp->lnd_ship >= 0 || lp->lnd_land >= 0)
+ continue;
if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY)
continue;
/* kill some normal troops */
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
while (NULL != (lp = nxtitemp(&ni))) {
+ if (lp->lnd_own != sp->sct_own)
+ continue;
+ if (lp->lnd_ship >= 0 || lp->lnd_land >= 0)
+ continue;
if (lchr[(int)lp->lnd_type].l_flags & L_SECURITY)
continue;
/* kill some security troops */
snxtitem_xy(&ni, EF_LAND, sp->sct_x, sp->sct_y);
while (NULL != (lp = nxtitemp(&ni))) {
+ if (lp->lnd_own != sp->sct_own)
+ continue;
+ if (lp->lnd_ship >= 0 || lp->lnd_land >= 0)
+ continue;
if (!(lchr[(int)lp->lnd_type].l_flags & L_SECURITY))
continue;