Integrate air defense missions into interception
The ancients designed interception dead simple: when you overfly a sector, you get intercepted by the sector owner. Fine print interception rules govern which planes intercept. Then complexity got piled on top of it. Chainsaw 2 added an extra interception by surface ship owners, in the target sector only. Chainsaw 3 added an extra interception by land unit owners, in the target sector only (Empire 4 later merged this extra land unit interception with the extra surface ship interception). Chainsaw 3 added an entirely separate kind of interception: air defense missions. When you enter a sector in some air defense op area, you get intercepted. Fine print air defense rules govern which planes intercept. These rules differ significantly from the interception fine print. Additional complexity comes from these facts: * Air defense mission interception happens in addition to non-mission interception. You can boost your total interception by setting up air defense. Which means you must set it up, or forgo an advantage. * Air defense planes are not available for non-mission interception duty. You need to decide on a split. * In contrast to non-mission interception, interceptors flying air defense get intercepted. Moreover, the air defense code breaks one of the plane code's design assumptions, namely that just one plane sortie is active at a time. The air defense sortie runs while the sortie it intercepts is in progress. This leads to two interceptions being active at the same time: the one intercepting the original sortie, and the one intercepting the air defense sortie. The same plane can fly in both interceptions, and damage received in the interception of the air defense sortie is wiped out, triggering a seqno mismatch oops. The previous commit already simplified non-mission interception: you get intercepted by anyone who owns the sector, or a surface ship or a land unit there, whether it's the target sector or not. Now simplify mission interception, by merging air defense back into ordinary interception: when you overfly a sector, you get intercepted by anyone who owns the sector, or a surface ship or land unit there, or has an air defense mission covering the sector. That's all. No multiple interceptions, no separate air defense rules. Remove air_defense(). Simplify ac_encounter() and sam_intercept() accordingly; both lose their last parameter. Change sam_intercept() and ac_intercept() to intercept in mission op areas. New parameter only_mission to suppress non-mission interception. Pass zero when the intercepting country owns the sector or a surface ship or land unit in the sector. ac_encounter() can't efficiently predict whether a country intercepts, so it needs to call ac_intercept() unconditionally. This kills the optimization to collect interceptors only when needed; simplify accordingly, replacing getilist() by getilists().
This commit is contained in:
parent
d1490b9ba5
commit
6564ff2240
10 changed files with 71 additions and 306 deletions
|
@ -140,7 +140,7 @@ bomb(void)
|
|||
return RET_FAIL;
|
||||
}
|
||||
pln_arm(&esc_list, 2 * ap_to_target, mission, ip, P_F | P_ESC);
|
||||
ac_encounter(&bomb_list, &esc_list, ax, ay, flightpath, 0, 0);
|
||||
ac_encounter(&bomb_list, &esc_list, ax, ay, flightpath, 0);
|
||||
if (QEMPTY(&bomb_list)) {
|
||||
pr("No planes got through fighter defenses\n");
|
||||
} else if (target.sct_type == SCT_SANCT) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue