unused last parameter. Callers changed.
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);
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);
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);
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);
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);
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;
* 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;
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;
}