Changeset 522 for trunk/AI/StdAI/Barbarina.pas
- Timestamp:
- Jan 7, 2024, 10:24:51 PM (10 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/AI/StdAI/Barbarina.pas
r486 r522 762 762 begin 763 763 Inc(BestCount); 764 if random(BestCount) = 0 then764 if Random(BestCount) = 0 then 765 765 begin 766 766 PatrolScore := TestScore; … … 888 888 var 889 889 I, F, uix, Loc1, A, B: Integer; 890 ready, go: Boolean;890 Ready, Go: Boolean; 891 891 TransportPlan: TGroupTransportPlan; 892 892 begin 893 go := False;893 Go := False; 894 894 for F := 0 to maxCOD - 1 do 895 895 if (F < nContinent) and (ContinentPresence[F] and not 896 896 (1 shl Me or PresenceUnknown) <> 0) then 897 go := True; // any enemy island known?898 if not go then897 Go := True; // any enemy island known? 898 if not Go then 899 899 Exit; 900 900 901 901 SeaTransport_BeginInitialize; 902 go := False;902 Go := False; 903 903 for uix := 0 to RO.nUn - 1 do 904 904 if not Moved[uix] then … … 915 915 end; 916 916 end; 917 if go then917 if Go then 918 918 begin 919 go := False;919 Go := False; 920 920 for uix := 0 to RO.nUn - 1 do 921 921 if not Moved[uix] then … … 928 928 end; 929 929 end; 930 if go then930 if Go then 931 931 for Loc1 := 0 to MapSize - 1 do 932 932 if Map[Loc1] and fTerrain >= fGrass then … … 941 941 begin 942 942 Moved[TransportPlan.uixTransport] := True; 943 ready := MyUnit[TransportPlan.uixTransport].Loc = TransportPlan.LoadLoc;944 if not ready then943 Ready := MyUnit[TransportPlan.uixTransport].Loc = TransportPlan.LoadLoc; 944 if not Ready then 945 945 begin 946 946 Unit_MoveEx(TransportPlan.uixTransport, TransportPlan.LoadLoc); 947 ready := MyUnit[TransportPlan.uixTransport].Loc = TransportPlan.LoadLoc;948 end; 949 if ready then947 Ready := MyUnit[TransportPlan.uixTransport].Loc = TransportPlan.LoadLoc; 948 end; 949 if Ready then 950 950 for I := 0 to TransportPlan.nLoad - 1 do 951 951 begin 952 952 Loc_to_ab(TransportPlan.LoadLoc, 953 953 MyUnit[TransportPlan.uixLoad[I]].Loc, A, B); 954 ready := ready and (abs(A) <= 1) and (abs(B) <= 1);955 end; 956 if ready then954 Ready := Ready and (Abs(A) <= 1) and (Abs(B) <= 1); 955 end; 956 if Ready then 957 957 begin 958 958 for I := 0 to TransportPlan.nLoad - 1 do … … 1646 1646 begin 1647 1647 Inc(nPreq); 1648 if random(nPreq) = 0 then1648 if Random(nPreq) = 0 then 1649 1649 ChosenPreq := ad; 1650 1650 end; … … 1736 1736 I := 0; 1737 1737 while (I < nResearchOrder) and (not NeedSeaUnits and (ResearchOrder[I] < 0) or 1738 IsResearched( abs(ResearchOrder[I]))) do1738 IsResearched(Abs(ResearchOrder[I]))) do 1739 1739 Inc(I); 1740 1740 if I >= nResearchOrder then // list done, continue with future tech 1741 1741 begin 1742 if random(2) = 1 then1742 if Random(2) = 1 then 1743 1743 Result := futArtificialIntelligence 1744 1744 else … … 1750 1750 nPreq := 0; 1751 1751 ChosenPreq := -1; 1752 ChoosePreq( abs(ResearchOrder[I]));1752 ChoosePreq(Abs(ResearchOrder[I])); 1753 1753 Assert(nPreq > 0); 1754 1754 Result := ChosenPreq;
Note:
See TracChangeset
for help on using the changeset viewer.