diff --git a/include/combat.h b/include/combat.h index 594505f8..7c539c59 100644 --- a/include/combat.h +++ b/include/combat.h @@ -81,8 +81,8 @@ extern int att_ask_support(int, int *, int *, int *, int *); extern int att_ask_offense(int, struct combat *, struct combat *, struct emp_qelem *, int *, int *); extern double sector_strength(struct sctstr *); -extern int att_estimate_defense(int, struct combat *, struct emp_qelem *, - struct combat *, int); +extern int att_get_offense(int, struct combat *, struct emp_qelem *, + struct combat *); extern int att_empty_attack(int, int, struct combat *); extern int att_get_defense(struct emp_qelem *, struct combat *, struct emp_qelem *, int, int); diff --git a/src/lib/commands/assa.c b/src/lib/commands/assa.c index 325e0b98..4e7d35f7 100644 --- a/src/lib/commands/assa.c +++ b/src/lib/commands/assa.c @@ -129,11 +129,7 @@ assa(void) return RET_OK; } - /* - * Estimate the defense strength and give the player a chance to abort - */ - - ototal = att_estimate_defense(A_ASSAULT, off, &olist, def, a_spy); + ototal = att_get_offense(A_ASSAULT, off, &olist, def); if (att_abort(A_ASSAULT, off, def)) { pr("Assault aborted\n"); att_empty_attack(A_ASSAULT, 0, def); diff --git a/src/lib/commands/atta.c b/src/lib/commands/atta.c index db7d5252..c38e3f59 100644 --- a/src/lib/commands/atta.c +++ b/src/lib/commands/atta.c @@ -120,11 +120,7 @@ atta(void) return att_free_lists(&olist, 0); } - /* - * Estimate the defense strength and give the player a chance to abort - */ - - ototal = att_estimate_defense(A_ATTACK, off, &olist, def, a_spy); + ototal = att_get_offense(A_ATTACK, off, &olist, def); if (att_abort(A_ATTACK, off, def)) { pr("Attack aborted\n"); att_empty_attack(A_ATTACK, 0, def); diff --git a/src/lib/commands/boar.c b/src/lib/commands/boar.c index 08db07e8..4ba1f3aa 100644 --- a/src/lib/commands/boar.c +++ b/src/lib/commands/boar.c @@ -147,11 +147,7 @@ boar(void) return att_free_lists(&olist, 0); } - /* - * Estimate the defense strength and give the player a chance to abort - */ - - ototal = att_estimate_defense(A_BOARD, off, &olist, def, a_spy); + ototal = att_get_offense(A_BOARD, off, &olist, def); if (att_abort(A_BOARD, off, def)) { pr("Board aborted\n"); att_empty_attack(A_BOARD, 0, def); diff --git a/src/lib/commands/lboard.c b/src/lib/commands/lboard.c index 03ed71c4..a6e2442f 100644 --- a/src/lib/commands/lboard.c +++ b/src/lib/commands/lboard.c @@ -118,11 +118,7 @@ lboa(void) return att_free_lists(&olist, 0); } - /* - * Estimate the defense strength and give the player a chance to abort - */ - - ototal = att_estimate_defense(A_LBOARD, off, &olist, def, a_spy); + ototal = att_get_offense(A_LBOARD, off, &olist, def); if (att_abort(A_LBOARD, off, def)) { pr("Land unit boarding aborted\n"); att_empty_attack(A_LBOARD, 0, def); diff --git a/src/lib/commands/para.c b/src/lib/commands/para.c index f0bec69f..62b0a6a9 100644 --- a/src/lib/commands/para.c +++ b/src/lib/commands/para.c @@ -168,9 +168,7 @@ paradrop(struct emp_qelem *list, coord x, coord y) return RET_OK; } - /* Get ototal */ - - ototal = att_estimate_defense(A_PARA, off, &olist, def, a_spy); + ototal = att_get_offense(A_PARA, off, &olist, def); if (att_abort(A_PARA, off, def)) { pr("Air-assault aborted\n"); return RET_OK; diff --git a/src/lib/subs/attsub.c b/src/lib/subs/attsub.c index 034d9717..39321771 100644 --- a/src/lib/subs/attsub.c +++ b/src/lib/subs/attsub.c @@ -1107,11 +1107,9 @@ att_combat_eff(struct combat *com) * Estimate the defense strength and give the attacker a chance to abort * if the odds are less than 50% */ - int -att_estimate_defense(int combat_mode, struct combat *off, - struct emp_qelem *olist, struct combat *def, - int a_spy) +att_get_offense(int combat_mode, struct combat *off, + struct emp_qelem *olist, struct combat *def) { int ototal; int estimate; @@ -1128,30 +1126,6 @@ att_estimate_defense(int combat_mode, struct combat *off, if (combat_mode == A_PARA) return ototal; pr("\n Initial attack strength: %8d\n", ototal); - - estimate = att_combat_eff(def) * roundintby(def->troops, 10); - estimate += att_combat_eff(def) * get_dlist(def, 0, a_spy, 0); - - /* - * Calculate the initial (pre-support) attack odds. If they're less - * than 50%, ask for a confirmation. - */ - - odds = (int)(att_calcodds(ototal, estimate) * 100); - -/* - if (odds < 50) { - pr(" Estimated defense strength: %8d\n", estimate); - pr(" Estimated odds: %8d%%\n\n",odds); - sprintf(prompt, "Are you sure you want to %s [yn]? ", - att_mode[combat_mode]); - if (!confirm(prompt)) - return abort_attack(); - ototal = get_ototal(combat_mode, off, olist,1.0,1); - if (att_empty_attack(combat_mode, ototal, def)) - return abort_attack(); - } - */ return ototal; }