/*
* Empire - A multi-player, client/server Internet based war game.
- * Copyright (C) 1986-2016, Dave Pare, Jeff Bailey, Thomas Ruschak,
+ * Copyright (C) 1986-2017, Dave Pare, Jeff Bailey, Thomas Ruschak,
* Ken Stevens, Steve McClure, Markus Armbruster
*
* Empire is free software: you can redistribute it and/or modify
#include "combat.h"
#include "damage.h"
#include "empobj.h"
-#include "file.h"
#include "misc.h"
#include "mission.h"
#include "news.h"
lcp = &lchr[(int)lp->lnd_type];
-/* Spies always count as 1 during assaults. If they are the only ones
- in the assault, they get to sneak on anyway. */
-
- if (lcp->l_flags & L_SPY && combat_mode == A_ASSAULT)
- return 1;
-
men = lp->lnd_item[I_MILIT];
value = men * lnd_att(lp) * lp->lnd_effic / 100.0;
signed char orig;
int mob;
+ if (CANT_HAPPEN(lchr[llp->unit.land.lnd_type].l_flags & L_SPY))
+ return 0;
+
taken = llp->unit.land.lnd_item[I_MILIT];
- /* Spies always die */
- if (lchr[llp->unit.land.lnd_type].l_flags & L_SPY)
- llp->unit.land.lnd_effic = 0;
- else {
- eff_eq = ldround(cas * 100.0 /
- lchr[llp->unit.land.lnd_type].l_item[I_MILIT], 1);
- llp->unit.land.lnd_effic -= eff_eq;
- lnd_submil(&llp->unit.land, cas);
- }
+ eff_eq = ldround(cas * 100.0 /
+ lchr[llp->unit.land.lnd_type].l_item[I_MILIT], 1);
+ llp->unit.land.lnd_effic -= eff_eq;
+ lnd_submil(&llp->unit.land, cas);
if (llp->unit.land.lnd_effic < LAND_MINEFF) {
- sprintf(buf, "dies %s %s!",
- combat_mode ? att_mode[combat_mode] : "defending",
+ if (llp->unit.land.lnd_own == player->cnum)
+ pr("\n");
+ sprintf(buf, "dies %sing %s!",
+ att_mode[combat_mode],
xyas(llp->unit.land.lnd_x, llp->unit.land.lnd_y,
llp->unit.land.lnd_own));
lnd_print(llp->unit.land.lnd_own, llp, buf);
ret_chance = llp->unit.land.lnd_retreat - llp->unit.land.lnd_effic;
if (pct_chance(ret_chance)) {
- pr("\n");
+ if (llp->unit.land.lnd_own == player->cnum)
+ pr("\n");
lnd_print(llp->unit.land.lnd_own, llp, "fails morale check!");
llp->unit.land.lnd_mission = 0;
llp->unit.land.lnd_harden = 0;
buf2[0] = buf3[0] = 0;
}
if (destination == player->cnum)
- pr("%s%s%s", buf1, buf2, buf3);
+ pr("%s%s%s\n", buf1, buf2, buf3);
else
wu(0, destination, "%s%s%s\n", buf1, buf2, buf3);
}
coord newx;
coord newy;
int move;
- int rel;
+ enum relations rel;
int oldown;
if (CANT_HAPPEN(QEMPTY(list)))