{ Tries to save the French, but if that doesn't work it just comes in and kicks ass. } const LAND = 0; const AIR = 1; const SEA = 2; NbrZones := GetZoneCount(); NbrUnits := GetUnitCount(); NbrNations := GetNationCount(); CurrentPlayer := GetCurrentPlayer(); Version( 4.0 ); US := -1; Germany := -1; France := -1; Spain := -1; For i := 0 to NbrNations - 1 do begin name := getnationname(i); If name = 'Germany' then Germany := i; If name = 'United States' then US := i; If name = 'Spain' then Spain := i; If name = 'France' then France := i; end; {Diplomatics} like := - 100; friend := -1; points := 0; For i := 0 to NbrNations - 1 do begin stance := getnationstance(CurrentPlayer, i); npoints := 0; If isnationmajorpower(i) then npoints := 1; If (stance > like) AND (stance < 100) AND (npoints >= points) AND ( isnationactive(i) ) AND (i <> CurrentPlayer) then begin friend := i; points := npoints; like := getnationstance(CurrentPlayer, i); end; end; If getnationdiplomaticactions(CurrentPlayer) > 0 then If friend <> -1 then orderdiplomatic(friend, 3); MyCap := FindZoneName( 'England' ); tNF := FindZoneName( 'Northern France'); tNormandy := FindZoneName('Normandy'); tGermany := FindZoneName('Germany'); SeaZone := getzoneneighbor(MyCap, 1); For i := 0 to getzoneneighborcount(tGermany) - 1 do If (NOT isZoneland(getzoneneighbor(tGermany, i))) then dZone := getzoneneighbor(tGermany, i); For i := 0 to NbrZones - 1 do If (getzoneowner(i) = CurrentPlayer) AND (isZoneport(i)) AND (getzonename(i) <> 'Scotland') then begin orderGlobalRouteresources(i, 20); orderautorouteresources(i, MyCap); end; if (getzoneresources(MyCap) > 80) AND (getzonefactories(MyCap) < getzonevalue(MyCap)) then orderbuildfactory(MyCap); transports := 0; for i := 0 to NbrUnits - 1 do If (getunitclass(i) = SEA) AND (getunitowner(i) = CurrentPlayer) then transports := transports + getunittransportroom(i); for i := 0 to getzoneunitcount(MyCap) - 1 do transports := transports - getunittransportweight(getzoneunit(MyCap, i)); tb := (0 - transports) div 2; If getzoneresources(MyCap) div 4 < tb then tb := getzoneresources(MyCap) div 4; if tb = 0 then tb := 1; Troops := getzoneresources(MyCap) div 2; fighters := getzoneresources(MyCap) div 8; f := 5 * getzonefactories(MyCap); If Troops > f then Troops := f; If transports < 0 then orderbuildnavy(MyCap, 0, tb, 0, 0, 0, 0, 0) else If( getzoneforcecountdefense(tNF, True, false, false, true, false, false) < 600) AND (isnationactive(France)) then orderbuildarmy(MyCap, 0, 0, Troops, 0) else orderbuildarmy(MyCap, Troops, 0, 0, 0); SetArray(Unit, NbrZones); For i := 0 to NbrZones - 1 do Unit[i] := -1; Artillery := 0; If iszonevisible(SeaZone) then For i := 0 to Getzoneunitcount(SeaZone) - 1 do begin tunit := getzoneunit(SeaZone, i); Artillery := Artillery + getunitforcecounttype(tunit, 1); end; If iszonevisible(tNF) then For i := 0 to Getzoneunitcount(tNF) - 1 do begin tunit := getzoneunit(tNF, i); Artillery := Artillery + getunitforcecounttype(tunit, 1); end; Attack := Artillery >= 15; If isZoneembattled(tGermany) then Attack := true; If Attack then Attack := isnationactive(Germany); EngWater := -1; For i := 0 to Getzoneneighborcount(MyCap) - 1 do If NOT iszoneland(getzoneneighbor(MyCap, i)) then If getzoneforcecount(getzoneneighbor(MyCap, i), false, true, false, false, false, true) > 0 then EngWater := getzoneneighbor(MyCap, i); for i := 0 to NbrUnits - 1 do begin if ( GetUnitOwner( i ) = CurrentPlayer ) then begin uc := GetUnitClass( i ); nCode := GetUnitID( i ); sCode := IntToStr( nCode ); uZone := getunitzone(i); if ( uc = LAND ) then begin if Unit[uZone] = -1 then Unit[uZone] := i else OrderUnitMerge( Unit[uZone], i ); If (isnationactive(Germany)) AND (isnationactive(France)) AND (iszoneneighbor(uZone, tNF)) then begin orderunitmove(i, tNF) end else if (getzonename(uZone) = 'Scotland') then begin orderunitmove(i, MyCap) end else if (isnationactive(Germany)) AND (uZone = tNF) then begin If Attack then orderunitinvade(i, tGermany); end else if (isnationactive(Germany)) AND (uZone = tGermany) then begin end else begin nTarget := FindClosestEnemyZone( GetUnitZone( i ), 20 ); if ( nTarget >= 0 ) then begin if IsZoneNeighbor( GetUnitZone( i ), nTarget ) then OrderUnitInvade( i, nTarget ) else OrderUnitMove( i, nTarget ); end; end; end else if ( uc = AIR ) then begin if GetZoneOwner( GetUnitZone( i ) ) <> CurrentPlayer then begin if GetZoneForceCount( GetUnitZone( i ), false, true, true, true, true, true ) = 0 then OrderUnitReturnToBase( i ); end else begin If getunitorder(i) <> 0 then begin orderunitreturntobase(i); end else begin If isnationactive(Germany) then begin If Attack then orderunitairstrike(i, findzonename('Germany')) else If (isnationactive(France)) AND (uZone <> tNF) then orderunitrebase(i, tNF) else If (NOT isnationactive(France)) AND (uZone <> MyCap) then orderunitrebase(i, MyCap); end else begin nTarget := FindClosestEnemyZone( GetUnitZone( i ), 20 ); If nTarget <> -1 then If (getunitrange(i) >= truedistance(nTarget, uZone)) AND (ntarget <> -1) then orderunitairstrike(i, nTarget) else orderunitrebase(i, MyCap); end; end; end end else if ( uc = SEA ) then begin If getunitforcecounttype(i, 0) = 0 then begin If getunitboardedcount(i) > 0 then begin if (isnationactive(Germany)) AND (NOT isnationactive(France)) then begin If uZone = dZone then orderunitdisembarkall(i , tGermany) else if (Attack) OR (distance(uZone, dZone) < distance(SeaZone, dZone)) then orderunitmove(i, dZone) else if uZone <> SeaZone then orderunitmove(i, SeaZone); end else if isnationactive(France) then begin If iszoneneighbor(uZone, tNF) then orderunitdisembarkall(i, tNF) else For j := 0 to getzoneneighborcount(tNF) - 1 do If NOT iszoneland(getzoneneighbor(tNF, j)) then orderunitmove(i, getzoneneighbor(tNF, j)); end else begin targzone := findclosestenemyzone(uZone, 50); If iszoneneighbor(uZone, targzone) then orderunitdisembarkall(i, targzone) else For j := 0 to getzoneneighborcount(targzone) - 1 do if NOT iszoneland(getzoneneighbor(targzone, j)) then orderunitmove(i, getzoneneighbor(targzone, j)); end; end else begin If iszoneneighbor(uZone, MyCap) then begin orderunitembarkall(i, MyCap) end else begin ezone := -1; dist := 999999; for j := 0 to getzoneneighborcount(MyCap) - 1 do begin tzone := getzoneneighbor(MyCap, j); ndist := distance(tzone, uzone); If (NOT iszoneland(tzone)) AND (ndist < dist) then begin ezone := tzone; dist := ndist; end; end; orderunitmove(i, ezone); end; end; If (EngWater <> -1) AND (NOT iszoneembattled(tNF)) then orderunitmove(i, EngWater); end; end; end; end;