(SNEAK_ATTACK, opt_SNEAK_ATTACK, Options, do_sneak, att_abort)

(att_fight): Remove option SNEAK_ATTACK.
This commit is contained in:
Markus Armbruster 2005-10-02 14:35:18 +00:00
parent 8733aa8a1a
commit 687cacd887
4 changed files with 10 additions and 78 deletions

View file

@ -83,7 +83,6 @@
#endif
/*#define TRADESHIPS*//* Use Tradeships */
/*#define SLOW_WAR*//* Declaring war takes time */
/*#define SNEAK_ATTACK*//* Allows sneak attacks */
#define PINPOINTMISSILE /**/
#define FALLOUT /* Enables secondary effects caused by radiation */
#define SAIL /* A update routine to move ships */
@ -102,11 +101,10 @@
#ifdef UPDATESCHED /* be used */
#define DEMANDUPDATE /* NOTE! Depends on UPDATESCHED! Don't use without it! */
#endif /* UPDATESCHED */
/*#define NOFOOD*/ /**/
#ifdef BLITZ
#define NOFOOD /* automatically have no food for blitzes */
#endif /* BLITZ */
/*#define NOFOOD*/ /**/
#ifndef SLOW_WAR
#undef SNEAK_ATTACK /* SNEAK_ATTACK is only useful with SLOW_WAR */
#endif /* SLOW_WAR */
#endif /* _OPTIONS_H_ */

View file

@ -82,7 +82,6 @@ extern int opt_RES_POP;
extern int opt_SAIL;
extern int opt_SHOWPLANE;
extern int opt_SLOW_WAR;
extern int opt_SNEAK_ATTACK;
extern int opt_SUPER_BARS;
extern int opt_TECH_POP;
extern int opt_TRADESHIPS;

View file

@ -129,12 +129,6 @@ int opt_NOFOOD = 1;
int opt_NOFOOD = 0;
#endif
#ifdef SNEAK_ATTACK
int opt_SNEAK_ATTACK = 1;
#else
int opt_SNEAK_ATTACK = 0;
#endif
#ifdef BLITZ
int opt_BLITZ = 1;
#else
@ -314,7 +308,6 @@ struct option_list Options[] = {
{"SAIL", &opt_SAIL},
{"SHOWPLANE", &opt_SHOWPLANE},
{"SLOW_WAR", &opt_SLOW_WAR},
{"SNEAK_ATTACK", &opt_SNEAK_ATTACK},
{"SUPER_BARS", &opt_SUPER_BARS},
{"TECH_POP", &opt_TECH_POP},
{"TRADESHIPS", &opt_TRADESHIPS},

View file

@ -152,39 +152,6 @@ prcom(int inon, struct combat *com)
return pr_com(inon, com, player->cnum);
}
/* Doing a sneak attack */
static void
do_sneak(struct combat *def, int success)
{
struct sctstr sect;
struct natstr *natp = getnatp(player->cnum);
int issneak = getrel(natp, def->own);
if (def->type != EF_SECTOR)
return;
getsect(def->x, def->y, &sect);
if (issneak == AT_WAR || !def->own || sect.sct_oldown == player->cnum)
return;
if (success)
pr("Your sneak attack was successful\nBut ");
else
pr("Your sneak attack was unsuccessful\nAnd ");
pr("it will cost you $5000\n");
pr("War has been declared!!!!\n");
wu(0, def->own, "Country %s (#%d) has Sneak Attacked!!\n",
cname(player->cnum), player->cnum);
wu(0, def->own, "Country %s (#%d) has Declared WAR on you!!\n",
cname(player->cnum), player->cnum);
player->dolcost += 5000;
issneak = min(issneak, MOBILIZATION);
nreport(player->cnum, N_DECL_WAR, def->own, 1);
setrel(player->cnum, def->own, issneak);
}
/*
* This is the combat object "type" based integrity check. It basically
* splits along three divisions: ship/sector, attacker/defender,
@ -476,7 +443,7 @@ int
att_abort(int combat_mode, struct combat *off, struct combat *def)
{
struct sctstr sect;
int issneak;
int rel;
s_char y_or_n[512];
struct natstr *natp;
@ -555,40 +522,19 @@ att_abort(int combat_mode, struct combat *off, struct combat *def)
}
if (opt_SLOW_WAR && def->own != player->cnum) {
natp = getnatp(player->cnum);
issneak = getrel(natp, def->own);
rel = getrel(natp, def->own);
if (issneak == ALLIED) {
if (rel == ALLIED) {
sprintf(y_or_n, "Sector is owned by %s, your ally, %s [yn]? ",
cname(def->own), att_mode[combat_mode]);
if (!confirm(y_or_n))
return abort_attack();
}
if (opt_SNEAK_ATTACK) {
getsect(def->x, def->y, &sect);
if ((issneak != AT_WAR) && (def->own)
&& (def->own != player->cnum)
&& (sect.sct_oldown != player->cnum)
&& (issneak != SITZKRIEG) && (issneak != MOBILIZATION)) {
pr("You're not at war with them!\n");
if (!confirm("Do you really want to sneak attack (it will cost you $5000) [yn]? ")) {
pr("Sneak attack cancelled!\n");
return abort_attack();
}
}
if ((issneak != AT_WAR) && (def->own)
&& (def->own != player->cnum)
&& (sect.sct_oldown != player->cnum)
&& ((issneak == MOBILIZATION) || (issneak == SITZKRIEG))) {
pr("You're not at war with them!\n");
return abort_attack();
}
} else {
if ((issneak != AT_WAR) && (def->own) &&
(sect.sct_oldown != player->cnum)) {
pr("You're not at war with them!\n");
return abort_attack();
}
if ((rel != AT_WAR) && (def->own) &&
(sect.sct_oldown != player->cnum)) {
pr("You're not at war with them!\n");
return abort_attack();
}
}
return 0;
@ -2057,10 +2003,6 @@ att_fight(int combat_mode, struct combat *off, struct emp_qelem *olist,
action, pr_com(0, def, def->own), d_cas);
}
if (opt_SNEAK_ATTACK) {
do_sneak(def, success);
}
send_reacting_units_home(dlist);
/* putland the defending land */