/*
* 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-2012, 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/>.
*
* ---
*
* Dave Pare, 1986
* Ken Stevens, 1995
* Steve McClure, 1998-2000
- * Markus Armbruster, 2004-2009
+ * Markus Armbruster, 2004-2011
*/
#include <config.h>
char mission;
struct plist *plp;
struct emp_qelem *qp, *next;
- int rel;
- struct natstr *natp;
char buf[1024];
if (get_planes(&ni_bomb, &ni_esc, player->argp[1], player->argp[2]) < 0)
return RET_SYN;
ax = ap_sect.sct_x;
ay = ap_sect.sct_y;
- if (!getpath(flightpath, player->argp[5], ax, ay, 0, 0, P_FLYING)
+ if (!getpath(flightpath, player->argp[5], ax, ay, 0, 0, MOB_FLY)
|| *flightpath == 0)
return RET_SYN;
tx = ax;
}
break;
case 's':
- if (opt_SLOW_WAR) {
- natp = getnatp(player->cnum);
- if (target.sct_own) {
- rel = getrel(natp, target.sct_own);
- if ((rel != AT_WAR) && (player->cnum != target.sct_own)
- && (target.sct_own) &&
- (target.sct_oldown != player->cnum)) {
- pr("You're not at war with them!\n");
- pln_put(&bomb_list);
- pln_put(&esc_list);
- return RET_FAIL;
- }
- }
- }
nreport(player->cnum, N_SCT_BOMB, target.sct_own, 1);
strat_bomb(&bomb_list, &target);
break;
char *p;
int nsubs;
int nunits;
- struct natstr *natp;
- int rel;
char buf[1024];
int i;
}
switch (*p) {
case 'l':
- if (opt_SLOW_WAR) {
- natp = getnatp(player->cnum);
- if (target->sct_own) {
- rel = getrel(natp, target->sct_own);
- if ((rel != AT_WAR) && (player->cnum != target->sct_own)
- && (target->sct_own) &&
- (target->sct_oldown != player->cnum)) {
- pr("You're not at war with them!\n");
- goto retry;
- }
- }
- }
if (nunits == 0) {
pr("no units there\n");
goto retry;
land_bomb(list, target);
break;
case 'p':
- if (opt_SLOW_WAR) {
- natp = getnatp(player->cnum);
- if (target->sct_own) {
- rel = getrel(natp, target->sct_own);
- if ((rel != AT_WAR) && (player->cnum != target->sct_own)
- && (target->sct_own) &&
- (target->sct_oldown != player->cnum)) {
- pr("You're not at war with them!\n");
- goto retry;
- }
- }
- }
if (nplanes == 0) {
pr("no planes there\n");
goto retry;
ship_bomb(list, target);
break;
case 'c':
- if (opt_SLOW_WAR) {
- natp = getnatp(player->cnum);
- if (target->sct_own) {
- rel = getrel(natp, target->sct_own);
- if ((rel != AT_WAR) && (player->cnum != target->sct_own)
- && (target->sct_own) &&
- (target->sct_oldown != player->cnum)) {
- pr("You're not at war with them!\n");
- goto retry;
- }
- }
- }
-
for (i = 0; i < nbomb; i++) {
if (!target->sct_item[bombcomm[i]])
continue;
comm_bomb(list, target);
break;
case 'e':
- if (opt_SLOW_WAR) {
- natp = getnatp(player->cnum);
- if (target->sct_own) {
- rel = getrel(natp, target->sct_own);
- if ((rel != AT_WAR) && (player->cnum != target->sct_own)
- && (target->sct_own) &&
- (target->sct_oldown != player->cnum)) {
- pr("You're not at war with them!\n");
- goto retry;
- }
- }
- }
eff_bomb(list, target);
break;
case 'q':
mcp = &mchr[(int)ship.shp_type];
if (gun > 0 && !(mcp->m_flags & M_SUB)) {
flak = (int)(techfact(ship.shp_tech, gun) * 2.0);
- PR(ship.shp_own, "Flak! Firing %d guns from ship %s\n",
- flak, prship(&ship));
+ mpr(ship.shp_own, "Flak! Firing %d guns from ship %s\n",
+ flak, prship(&ship));
if (pinflak_planedamage(&plp->plane, plp->pcp, ship.shp_own, flak))
continue;
}
if (aaf) {
flak = roundavg(techfact(land.lnd_tech,
aaf * 3.0 * land.lnd_effic / 100.0));
- PR(land.lnd_own,
- "Flak! Firing flak guns from unit %s (aa rating %d)\n",
- prland(&land), aaf);
+ mpr(land.lnd_own,
+ "Flak! Firing flak guns from unit %s (aa rating %d)\n",
+ prland(&land), aaf);
if (pinflak_planedamage(&plp->plane, plp->pcp, land.lnd_own, flak))
continue;
}
if (dam <= 0)
return 0;
disp = ac_damage_plane(pp, from, dam, 1, dmess);
- PR(pp->pln_own, " Flak! %s takes %d%s%s.\n",
- prplane(pp), dam, *dmess ? " --" : "", dmess);
+ mpr(pp->pln_own, " Flak! %s takes %d%s%s.\n",
+ prplane(pp), dam, *dmess ? " --" : "", dmess);
putplane(pp->pln_uid, pp);
return disp > 0;