]> git.pond.sub.org Git - empserver/commitdiff
(SNEAK_ATTACK, opt_SNEAK_ATTACK, Options, do_sneak, att_abort)
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 2 Oct 2005 14:35:18 +0000 (14:35 +0000)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 2 Oct 2005 14:35:18 +0000 (14:35 +0000)
(att_fight): Remove option SNEAK_ATTACK.

include/options.h
include/optlist.h
src/lib/global/options.c
src/lib/subs/attsub.c

index 5b2b49305a3968b6ba0fd420d115b372bcd38b07..38765514341c0a5113065c3420d0742bbd557a1b 100644 (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 */
 #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_ */
index 081071680b81ba00ad8ce28567b24a70d72c5e9d..cc608285da5d1f97daf00b272f36ce07f628f4b0 100644 (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;
index e447cd1fd5dbdb3b0283d869d8a90fe8e390d31a..3b55cea6dc9c512f126255a4206e817e2f0761b6 100644 (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},
index 12c92cbbb8c5b952bab76ad67a6446692b04f881..6df4660132b6553bccc0b5d2d67545608bfd2c92 100644 (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 */