From d1490b9ba5b285c0efd8568ac1d628893bd76c5f Mon Sep 17 00:00:00 2001 From: Markus Armbruster Date: Thu, 25 Sep 2008 10:22:53 -0400 Subject: [PATCH] Intercept the same all along the flight path In each sector, any country owning the sector, a surface ship or a land unit gets to intercept. Before, only the sector owner got to intercept, except for the target sector. There, any country owning surface ships or land units got to intercept in addition to the sector owner. Thus, a sector owner with surface ships or land units there got to intercept twice. Info Intercept claimed you get to intercept once for ships and once again for land units, which was wrong since 4.0.9. Info bomb suggested that flak fires only in the target sector, which was wrong since 4.2.8. Drop that. --- info/Interception.t | 14 ++++---------- info/bomb.t | 24 ++---------------------- info/drop.t | 3 +++ info/fly.t | 5 +++-- info/paradrop.t | 3 +++ info/recon.t | 4 +++- info/sweep.t | 4 +++- src/lib/subs/aircombat.c | 35 +++++++++-------------------------- 8 files changed, 30 insertions(+), 62 deletions(-) diff --git a/info/Interception.t b/info/Interception.t index 0fc483208..83d297156 100644 --- a/info/Interception.t +++ b/info/Interception.t @@ -3,9 +3,9 @@ .LV Expert .s1 Each time an enemy plane (i.e. a plane owned by a country that your are -HOSTILE to or worse) flies into over a sector you own, planes you +HOSTILE to or worse) flies into over a sector, surface ship or land +unit you own, planes you have with the intercept ability will intercept them if: - .NF a) The incoming plane is not stealthy, or is detected. b) The sector is within 1/2 the interceptor's range (as modified @@ -23,6 +23,8 @@ e) There is petrol there equal to 1/2 the plane's fuel rating. (rounded down) .FI .s1 +Neutral and friendly planes will be reported, but not intercepted. +.s1 Before planes scramble to intercept incoming planes, flak fires (see info Flak), air defense missions are executed (see info mission), and any SAMs in range @@ -115,12 +117,4 @@ his flight path, perhaps to have combat again. ABM's do not use the normal combat procedure. They simply have a % chance of destroying an incoming warhead equal to their defensive value. .s1 -If you have land units in the enemy plane's target sector, your plane will -intercept the enemy planes AGAIN. If you have non-sub ships in the enemy plane's -target sector, your planes will intercept them yet again. If you own -the target sector, and have ships & units there, your planes will therefore -intercept them a total of three times in that sector. Note that a 'target -sector' is a sector that is the target of a bombing or para mission. Merely -having ships in a sector will not cause interception of planes flying over. -.s1 .SA "Plane-types, plane, fly, recon, bomb, range, mission, Flak, Planes" diff --git a/info/bomb.t b/info/bomb.t index c77fa73fe..c0b6addd0 100644 --- a/info/bomb.t +++ b/info/bomb.t @@ -51,28 +51,8 @@ Heavy bombers (with the bomber capability), while they can perform pinpoint bombing, are notoriously inaccurate and in general miss what they are aiming at. They are used mainly for strategic bombing. .s1 -During the course of a mission, -your planes may fly over someone else's land. -If you fly over land owned by another country, -and this country is either hostile or in any war state (see info relation) -with you, fighter planes from the enemy country will scramble -and attempt to intercept your force. -If the country is simply neutral, -he will be notified that his radar tracked your planes -as they flew over his country. -If the country is allied, then nothing will occur. -.s1 -If you manage to fight though the enemy fighters and arrive -at the target sector, your force must still contend with -any flak guns which your enemy has stationed there. -What's more, any enemy ship in the target sector will also -shoot at each of your bombers before any attacks are performed. -Any enemy land units with the 'flak' ability will also fire at -all your planes at this time. -.s1 -A well-equipped fleet of battleships in a heavily-defended harbor -can be very risky to attack, even though hitting ships in harbor is -like shooting fish in a barrel. +Bombing missions can be intercepted just like any other mission. See +info \*QIntercept\*U. .s1 When bombing ships/planes/units, entering a '~' character will cause a particular plane not to bomb. Other planes on the mission will still diff --git a/info/drop.t b/info/drop.t index 00039930e..a0ccf2a4f 100644 --- a/info/drop.t +++ b/info/drop.t @@ -33,6 +33,9 @@ When getting a path interactively, empire will show you the information you have (from your bmap) concerning the current area, to help you plot your course. .s1 +Air drop missions can be intercepted just like any other mission. See +info \*QIntercept\*U. +.s1 Planes which arrive safely at the target sector will drop the goodies off to the waiting people below. .s1 diff --git a/info/fly.t b/info/fly.t index b426c2ff7..98d15e0fd 100644 --- a/info/fly.t +++ b/info/fly.t @@ -33,8 +33,9 @@ When getting a path interactively, empire will show you the information you have (from your bmap) concerning the current area, to help you plot your course. .s1 -If the transports stray over enemy territory, then they will be -intercepted and shot at just like any other mission. +Transport missions can be intercepted just like any other mission. See +info \*QIntercept\*U. +.s1 If the destination sector is not an airport, then all planes in the mission must have VTOL capability. .s1 diff --git a/info/paradrop.t b/info/paradrop.t index 150eb79dd..f92d18206 100644 --- a/info/paradrop.t +++ b/info/paradrop.t @@ -28,6 +28,9 @@ destination sector on the command line, or at any time while giving the route, and empire will use the best path from the current sector to the desired destination sector. .s1 +Paradrop missions can be intercepted just like any other mission. See +info \*QIntercept\*U. +.s1 If the planes manage to fight through enemy air defenses and arrive on-target, each transport in the mission will be shot at by any guns present on the ground. diff --git a/info/recon.t b/info/recon.t index f6f8f6774..558a75178 100644 --- a/info/recon.t +++ b/info/recon.t @@ -33,7 +33,9 @@ your course. .s1 Information given by recon is not totally accurate. .s1 -Recon missions can be intercepted just like any other mission. +Recon missions can be intercepted just like any other mission. See +info \*QIntercept\*U. +.s1 If the destination sector is not an airport, then all planes in the mission must have V/STOL capability. .s1 diff --git a/info/sweep.t b/info/sweep.t index 7d21e955c..8daf3a713 100644 --- a/info/sweep.t +++ b/info/sweep.t @@ -32,7 +32,9 @@ your course. .s1 Information given by sweep/recon is not totally accurate. .s1 -Sweep/recon missions can be intercepted just like any other mission. +Sweep missions can be intercepted just like any other mission. See +info \*QIntercept\*U. +.s1 If the destination sector is not an airport, then all planes in the mission must have V/STOL capability. .s1 diff --git a/src/lib/subs/aircombat.c b/src/lib/subs/aircombat.c index 13efbb5d8..8413a102a 100644 --- a/src/lib/subs/aircombat.c +++ b/src/lib/subs/aircombat.c @@ -231,13 +231,16 @@ ac_encounter(struct emp_qelem *bomb_list, struct emp_qelem *esc_list, if (!no_air_defense) air_defense(x, y, plane_owner, bomb_list, esc_list); - if (rel[sect.sct_own] <= HOSTILE) { - if (!gotilist[sect.sct_own]) { - getilist(&ilist[sect.sct_own], sect.sct_own); - gotilist[sect.sct_own]++; + for (cn = 1; cn < MAXNOC && !QEMPTY(bomb_list); cn++) { + if (rel[cn] > HOSTILE) + continue; + if (cn != sect.sct_own && !gotships[cn] && !gotlands[cn]) + continue; + if (!gotilist[cn]) { + getilist(&ilist[cn], cn); + gotilist[cn]++; } - ac_intercept(bomb_list, esc_list, &ilist[sect.sct_own], - sect.sct_own, x, y); + ac_intercept(bomb_list, esc_list, &ilist[cn], cn, x, y); } } @@ -258,27 +261,7 @@ ac_encounter(struct emp_qelem *bomb_list, struct emp_qelem *esc_list, /* If the map changed, update it */ if (changed) writemap(player->cnum); - /* Now, if the bomber and escort lists are empty, we are done */ - if (QEMPTY(bomb_list) && QEMPTY(esc_list)) - goto out; - /* Something made it through */ - - /* Now, let's make life a little rougher. */ - for (cn = 1; cn < MAXNOC && !QEMPTY(bomb_list); cn++) { - if (plane_owner == cn) - continue; - if (gotships[cn] || gotlands[cn]) { - if (rel[cn] <= HOSTILE && !evaded) { - if (!gotilist[cn]) { - getilist(&ilist[cn], cn); - gotilist[cn]++; - } - ac_intercept(bomb_list, esc_list, &ilist[cn], cn, x, y); - } - } - } -out: free_shiplist(&head); for (cn = 1; cn < MAXNOC; cn++) { if (gotilist[cn]) -- 2.43.0