Shannon V. OKeets
Posts: 22095
Joined: 5/19/2005 From: Honolulu, Hawaii Status: offline
|
quote:
ORIGINAL: rkr1958 1D10 CRT? I've looked through the rules, tables, etc. but I can't seem to find a concise listing of die roll modifiers (e.g., for being disorganized, armor attacking a city) anywhere. Is there such a concise list? I didn't see it when doing a quick search. Here is the code for how the 1D10 calculates die roll modifiers; it is followed by the code for the mods for attacking and defending units. Note that some of the code below only applies to the 2D10 CRT and/or the Blitz Bonus optional rules. === // **************************************************************************** // // Final calculations for 1D10 CRT. // // **************************************************************************** begin // **************************************************************************** // RAC Section 11.16.5. Penalty for attacking a city with 2 or 3 printed // factories. Only applies if using the Blitz Bonus. // **************************************************************************** if OptRules.BlitzBonus and (Map.FactoryList.PrintedFactory[Hex.X, Hex.Y] > 1) then DRMTerrain := DRMTerrain - 1; // **************************************************************************** // Increase the die roll modifier due to individual attacking units. // **************************************************************************** LCStckIndx := 0; while LCStckIndx < AttackingStack.Count do begin LCStckUni := AttackingStack.Item[LCStckIndx]; // **************************************************************************** // RAC Section 22.4.1. Coded as per engineer. // **************************************************************************** if (LCStckUni.UnitType in EngineerSet) and LCStckUni.CombatEngineer and (Map.FactoryList.PrintedFactory[Hex.X, Hex.Y] > 1) then DRMTerrain := DRMTerrain + 1; // **************************************************************************** // Armor and paradrop benefits only accrue if using the Blitz Bonus. // **************************************************************************** if OptRules.BlitzBonus then AttackingUnitsDRM(LCStckUni); Inc(LCStckIndx); end; // **************************************************************************** // Decrease the die roll modifier due to individual defending units. // **************************************************************************** LCStckIndx := 0; while LCStckIndx < DefendingStack.Count do begin LCStckUni := DefendingStack.Item[LCStckIndx]; // **************************************************************************** // RAC Section 22.4.1. Coded as per engineer. // **************************************************************************** if (LCStckUni.UnitType in EngineerSet) and (Map.FactoryList.PrintedFactory[Hex.X, Hex.Y] > 1) then DRMTerrain := DRMTerrain - 1; // **************************************************************************** // Armor & anti-tank benefits only accrue if using the Blitz Bonus. However, // the DRM for disorganized units always pertains. // **************************************************************************** DefendingUnitsDRM(LCStckUni); Inc(LCStckIndx); end; procedure AttackingUnitsDRM(var U: TUnit); // **************************************************************************** // Only used by 2D10 CRT & BlitzBonus. Modify DRM due to individual attacking // units. // **************************************************************************** var HS: THexsideRange; HSAM: Integer; AttackHex: TSmallPoint; begin AttackHex := AttackLocation(U); // Hex where attacker started. if (U is TLandUnit) and (not TLandUnit(U).Invading) and (Map.Terrain[AttackHex.X, AttackHex.Y] <> teSea) then begin THexArea.ConnectingHexsideRange(AttackHex, Hex, HS); // This sets HS. HSAM := AttackDivisor(U); if HSAM > 0 then begin // **************************************************************************** // Include jungle benefit for some elite marines and infantry. // **************************************************************************** if OptRules.TwoD10LandCRT and (LCTerrain = teJungle) and TLandUnit(U).Elite and ((U.Country = Japan.ID) or (U.Country = Australia.ID) or ((U.Country = UnitedStates.ID) and (U.UnitType in [utMarine, utMarineEngineer]))) then begin DRMTerrain := DRMTerrain + (1 / HSAM); // Hexside may affect modifier. (* ShowMessageOK('[LandCombatColumn] AttackingUnitsDRM ' + HexName(Hex) + '. Jungle ' + U.Name + '. DRMTerrain = ' + FloatToStr(DRMTerrain)); *) end; // **************************************************************************** // Include bonus for attacking with winterized units. // **************************************************************************** if OptRules.TwoD10LandCRT and SnowUnitsA and TLandUnit(U).SnowUnit then begin DRMWeather := DRMWeather + (1 / HSAM); // Hexside may affect modifier. (* ShowMessageOK('[LandCombatColumn] AttackingUnitsDRM ' + HexName(Hex) + '. Snow units ' + U.Name + '. DRMWeather = ' + FloatToStr(DRMWeather)); *) end; // **************************************************************************** // Include armor bonus for attacker. // **************************************************************************** (* if Map.HexsideTerrainSet[U.Column, U.Row, HS] * FortHexsideSet <> [] then ShowMessageOK('[LandCombatColumn] AttackingUnitsDRM from' + HexName(AttackHex) + ' into ' + HexName(Hex) + ' through hexside ' + IntToStr(HS) + ' has a fort hexside present.'); *) if (not IsAssault) and (U.UnitType in ArmoredSet) and (not InCity) and (LCTerrain in [teClear, teDesert]) and // I.e., tank country. (LCWeather = wFine) and (not Map.FortHexside[AttackHex, Hex]) then // Forts negate bonus. begin // Hexside may affect modifier. if OptRules.BlitzBonus then begin // **************************************************************************** // BlitzBonus: Add 1 to the die roll for each two attacking ARM, MECH, HQ-A // units conducting a blitz attack against a clear or desert (non-city) hex in // fine weather. // **************************************************************************** if U.Small then DRMArmor := DRMArmor + (0.25 / HSAM) // Div. = 1/4. else DRMArmor := DRMArmor + (0.5 / HSAM) // Corps = 1/2. end else if OptRules.TwoD10LandCRT then begin // 2D10 modifier is twice that of BlitzBonus. if U.Small then DRMArmor := DRMArmor + (0.5 / HSAM) // Div. = 1/2. else DRMArmor := DRMArmor + (1 / HSAM); // Corps = 1. end; end; end; end; // **************************************************************************** // Include bonus for paradrop for both 2D10 CRT and BlitzBonus. // **************************************************************************** if (U is TLandUnit) and TLandUnit(U).Paradropping then begin if U.Small then DRMParadrop := DRMParadrop + 0.5 // Div. = 1/2. else DRMParadrop := DRMParadrop + 1; // Corps = 1. end; end; procedure DefendingUnitsDRM(var U: TUnit); // **************************************************************************** // Used by both 1D10 and 2D10 CRTs. Modify DRM due to individual defending // units. // **************************************************************************** var LU: TLandUnit; begin if U is TLandUnit then begin LU := TLandUnit(U); // **************************************************************************** // Increment die roll for disorganized units. // **************************************************************************** if U.Disrupted then begin if OptRules.TwoD10LandCRT then begin if LU.Small then DRMDisorganized := DRMDisorganized + 1 // Div. = 1. else DRMDisorganized := DRMDisorganized + 2; // Corps = 2. end else DRMDisorganized := DRMDisorganized + 1; // 1D10 CRT. end; if OptRules.TwoD10LandCRT or OptRules.BlitzBonus then begin // **************************************************************************** // Benefit for winterized defenders (TwoD10LandCRT only). // **************************************************************************** if OptRules.TwoD10LandCRT and SnowUnitsD and LU.SnowUnit then DRMWeather := DRMWeather - 2; // **************************************************************************** // Benefit for anti-tank and anti-aircraft defenders (TwoD10LandCRT only). // **************************************************************************** if OptRules.TwoD10LandCRT and AHasArmor and (LU.AntiTank <> latNone) then DRMArmor := DRMArmor - 1; // **************************************************************************** // Benefit for armored defenders, regardless of CRT chosen. // **************************************************************************** if (U.UnitType in ArmoredSet) and (not InCity) and (LCTerrain in [teClear, teDesert]) and (LCWeather = wFine) then begin if OptRules.BlitzBonus then begin // **************************************************************************** // BlitzBonus: Subtract 1 from the die roll for each defending ARM, MECH, HQ-A // unit in a clear or desert (non-city) hex in fine weather. // **************************************************************************** if U.Small then DRMArmor := DRMArmor - 0.5 // Div. = -1/2. else DRMArmor := DRMArmor - 1; // Corps = -1. end else begin // OptRules.TwoD10LandCRT. if U.Small then DRMArmor := DRMArmor - 1 // Div. = -1. else DRMArmor := DRMArmor - 2; // Corps = -2. end; end; end; end; end;
_____________________________
Steve Perfection is an elusive goal.
|