Changeset 663 for trunk/UnitProcessing.pas
- Timestamp:
- Jul 5, 2025, 10:57:12 AM (5 hours ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/UnitProcessing.pas
r558 r663 21 21 Worked: array [0 .. nPl - 1] of Integer; { settler work statistics } 22 22 23 23 // Moving/Combat 24 24 function HostileDamage(P, mix, Loc, MP: Integer): Integer; 25 25 function CalculateMove(P, uix, ToLoc, MoveLength: Integer; TestOnly: Boolean; … … 79 79 ToWork: ^TToWorkList; { work left for each tile and job } 80 80 81 82 83 84 81 { 82 Moving/Combat 83 ____________________________________________________________________ 84 } 85 85 function HostileDamage(P, mix, Loc, MP: Integer): Integer; 86 86 var … … 97 97 begin 98 98 Assert((Tile and fTerImp <> tiIrrigation) and (Tile and fTerImp <> tiFarm)); 99 Result := (DesertThurst * MP - 1) div RW[P].Model[mix].Speed + 1 99 Result := (DesertThurst * MP - 1) div RW[P].Model[mix].Speed + 1; 100 100 end 101 101 else if Tile and fTerrain = fArctic then 102 102 begin 103 103 Assert((Tile and fTerImp <> tiIrrigation) and (Tile and fTerImp <> tiFarm)); 104 Result := (ArcticThurst * MP - 1) div RW[P].Model[mix].Speed + 1 104 Result := (ArcticThurst * MP - 1) div RW[P].Model[mix].Speed + 1; 105 105 end 106 106 else … … 346 346 begin 347 347 Result := eOK; 348 MoveInfo.MountainDelay := True 348 MoveInfo.MountainDelay := True; 349 349 end; 350 350 end; … … 748 748 Recovery := FastRecovery { city has baracks/shipyard/airport } 749 749 else 750 Recovery := CityRecovery 750 Recovery := CityRecovery; 751 751 end 752 752 else if (RealMap[Loc] and fTerrain >= fGrass) and (Model[mix].Domain <> dAir) … … 778 778 gmaAlpine = 8; 779 779 var 780 I, FromLoc, EndLoc, T, T1, maxmov, initmov, Loc, Loc1, FromTile, ToTile, V8,780 I, FromLoc, EndLoc, T, T1, MaxMov, InitMov, Loc, Loc1, FromTile, ToTile, V8, 781 781 MoveInfo, HeavyCost, RailCost, MoveCost, AddDamage, MaxDamage, 782 782 MovementLeft: Integer; … … 867 867 Damage[FromLoc] := 0; 868 868 Q := TIPQ.Create(MapSize); 869 Q.Put(FromLoc, ( maxmov - RW[P].Un[uix].Movement) shl 8);869 Q.Put(FromLoc, (MaxMov - RW[P].Un[uix].Movement) shl 8); 870 870 while Q.Get(Loc, T) do 871 871 begin … … 955 955 3: 956 956 begin 957 MoveCost := maxmov;957 MoveCost := MaxMov; 958 958 MountainDelay := True; 959 959 end; … … 967 967 if V8 and 1 <> 0 then 968 968 AddDamage := ((DesertThurst * 3) * MoveCost - 1) 969 div maxmov + 1969 div MaxMov + 1 970 970 else 971 971 AddDamage := ((DesertThurst * 2) * MoveCost - 1) 972 div maxmov + 1972 div MaxMov + 1; 973 973 end 974 974 else if ToTile and (fTerrain or fCity or fRiver or fCanal) = fArctic … … 977 977 if V8 and 1 <> 0 then 978 978 AddDamage := ((ArcticThurst * 3) * MoveCost - 1) 979 div maxmov + 1979 div MaxMov + 1 980 980 else 981 981 AddDamage := ((ArcticThurst * 2) * MoveCost - 1) 982 div maxmov + 1982 div MaxMov + 1; 983 983 end; 984 end 985 else 986 MoveCost := -1; 987 984 end else MoveCost := -1; 988 985 end; 989 986 … … 998 995 fOwned) // assume ship/airplane is transport -- load! 999 996 or (MoveCost >= 0) and (FromTile and fTerrain < fGrass)) then 1000 MoveCost := maxmov; // transport load or unload997 MoveCost := MaxMov; // transport load or unload 1001 998 1002 999 if MoveCost >= 0 then 1003 1000 begin { valid move } 1004 MovementLeft := maxmov - T shr 8 and $FFF - MoveCost;1001 MovementLeft := MaxMov - T shr 8 and $FFF - MoveCost; 1005 1002 if (MovementLeft < 0) or ((MoveCost = 0) and (MovementLeft = 0)) 1006 1003 then … … 1011 1008 if FromTile and (fTerrain or fCity or fRiver or fCanal or 1012 1009 fSpecial1 { Oasis } ) = fDesert then 1013 Inc(AddDamage, (DesertThurst * ( maxmov - T shr 8 and $FFF) -1014 1) div maxmov + 1)1010 Inc(AddDamage, (DesertThurst * (MaxMov - T shr 8 and $FFF) - 1011 1) div MaxMov + 1) 1015 1012 else if FromTile and (fTerrain or fCity or fRiver or fCanal) = fArctic 1016 1013 then 1017 Inc(AddDamage, (ArcticThurst * ( maxmov - T shr 8 and $FFF) -1018 1) div maxmov + 1);1019 1020 T1 := T and $7FF000FF + $100000 + ( initmov + MoveCost) shl 8;1014 Inc(AddDamage, (ArcticThurst * (MaxMov - T shr 8 and $FFF) - 1015 1) div MaxMov + 1); 1016 1017 T1 := T and $7FF000FF + $100000 + (InitMov + MoveCost) shl 8; 1021 1018 end 1022 1019 else … … 1062 1059 mod (2 * lx) - lx; 1063 1060 A.dy[I] := Loc div lx - From[Loc] div lx; 1064 end 1061 end; 1065 1062 end; 1066 1063 Loc := From[Loc]; 1067 1064 end; 1068 A.MaxHostile_MovementLeft := maxmov - Time[EndLoc] shr 8 and $FFF;1065 A.MaxHostile_MovementLeft := MaxMov - Time[EndLoc] shr 8 and $FFF; 1069 1066 if A.nStep > 25 then 1070 1067 A.nStep := 25; 1071 Result := eOK 1068 Result := eOK; 1072 1069 end 1073 1070 else … … 1412 1409 for uix1 := 0 to RW[P].nUn - 1 do 1413 1410 if (RW[P].Un[uix1].Loc = Loc) and (RW[P].Un[uix1].Job = j0) then 1414 RW[P].Un[uix1].Job := jNone 1411 RW[P].Un[uix1].Job := jNone; 1415 1412 end 1416 1413 else … … 1421 1418 Health := Health - HostileDamage(P, mix, Loc, Movement); 1422 1419 Movement := 0; 1423 end 1424 end 1420 end; 1421 end; 1425 1422 end; 1426 1423
Note:
See TracChangeset
for help on using the changeset viewer.