Shannon V. OKeets
Posts: 22095
Joined: 5/19/2005 From: Honolulu, Hawaii Status: offline
|
Overruns can be done by any land combat unit - against hexes occupied by enemy air and/or naval units. Adding in even more conditionals to whether supply should be recalculated when a land unit moves would not be a good thing - from the programmer's perspective. The routine that makes this determination is 2350 lines long. Here is my in-line comment on what it does. Note that towards the end, I got tired of looking up the name of the individual routines that perform the work and just used ??????? as the procedure/function name. === // **************************************************************************** // Variables that control when supply is recalcuated. // **************************************************************************** // SupplyExecutedOnce is set to True when supply is calculated from scratch. // That forces the full execution of UnitMenuSupplySources when creating a new // game or restoring a saved game. // Thereafter, the routines LeaveMapHex and EnterMapHex call EvalSup routines // based on the unit type and whether the hex the unit is leaving/entering is an // all-sea or a land hex. SetHexControl calls EvalSupHexControlChange to // process changes in hex control which affects which units can use a given hex // in a supply path. // // The EvalSup routines set Eval Supply flags (e.g., EvalInSupplyAxisLand): // (1) to validate overland supply paths for in-supply units on a side, // (2) to validate overseas supply paths for in-supply units on a side, // (3) to search for overland supply paths for OOS units on a side, // (4) to search for overseas supply paths for OOS units on a side, and // (5) to execute FindSupplyPathForStack for the moving units. // // The last of the above is executed for the units in the moving stack if their // destination is a land hex, since a new supply path has to be found for them. // // The routines that initiate calls to LeaveMapHex/EnterMapHex, or cause changes // in hex control (e.g., Conquest), post-process those calls by executing // UnitMenuSupplySources, part or all of which executes, depending on which // flags were set to True. // **************************************************************************** // // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // // **************************************************************************** // FindSupplyPathU(U, False) updates an individual unit's supply. // FindSupplyPathForStack updates supply for all units in a hex which are OOS. // ValidateHex determines if a hex is valid/invalid for a major power to use in // a supply path. // ValidateSeaArea checks if a sea area has changed between valid/invalid for a // major power to use in a supply path. // // SupplyUpToDateAxis & SupplyUpToDateAllied is set to False when: // 1 - In the Weather phase, if the weather changes in any weather zone. // 2 - Units enter or leave a hex. // 3 - At the end of phases where large blocks of territory change control: // Declaration of war [TMajorCountry.DeclareWar]. // Claim of minor country territory [TCountryTable.Conquer], // OccupyBalticStatesEffects, OccupyEasternPolandEffects, // CheckBorderRectification, [TMinorCountry.Peace] // Alignment of a minor country [TMajorCountry.AlignCountry]. // US Entry - control of territory may change: // OccupyGreenlandIcelandEffects, OccupyNorthernIrelandEffects. // Conquest [TCountryTable.Conquer]. // Surrender [TCountryTable.Conquer]. // Liberation [TMajorCountry.Liberate]. // Declaration of Vichy France [CreateVichyFr]. // Collapse of Vichy France [TCountryTable.CollapseVichyFrance]. // Ukraine. // Mutual peace. // 4 - Computing odds ratio for Notional units. // **************************************************************************** // // ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ // // **************************************************************************** // When EvalOSSAxisLand or EvalOSSAlliedLand is True, execute // FindRailwaySupplyPath & FindBasicSupplyPath3rd2nd to check if supply sources // previously OOS are now in supply. Then execute FindSupplyPathU to check if // units previously OOS are now in supply. // // When EvalInSupplyAxisLand or EvalInSupplyAlliedLand is True, execute // TrySavedPath2nd1st and TrySavedPath3rd2nd to check if a supply source // previously in supply can still use its old path, and execute TrySavedPathUnit // to check if a unit previously in supply can still use its old path. If // either fails execute FindRailwaySupplyPath & FindBasicSupplyPath3rd2nd to // check if the supply sources can find new paths, and execute FindSupplyPathU // to check if units can find new paths. // // When EvalOSSAxisSea or EvalOSSAlliedSea is True, execute ????????? to see if // supply sources and/or units that were previously in supply are now OOS. // // When EvalInSupplyAxisSea or EvalInSupplyAlliedSea is True, execute ????????? // to see if supply sources and/or units that were previously OOS are now in // supply. EDIT: Note that changing control of a single land hex could affect supply paths for units needing to go overseas to find supply. For instance, cutting off a path to a port could put an HQ out of supply and that could have a ripple effect on whole swaths of other secondary/tertiary supply sources and/or units.
< Message edited by Shannon V. OKeets -- 9/15/2019 7:57:19 PM >
_____________________________
Steve Perfection is an elusive goal.
|