Changeset 548 for trunk/Database.pas
- Timestamp:
- Apr 21, 2024, 10:57:18 AM (3 weeks ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Database.pas
r531 r548 262 262 begin 263 263 c0 := TechFormula_M[diff] * (nTech + 4) * 264 exp((nTech + 4) / TechFormula_D[diff]);264 Exp((nTech + 4) / TechFormula_D[diff]); 265 265 if c0 >= $10000000 then 266 266 Result := $10000000 267 267 else 268 Result := trunc(c0);268 Result := Trunc(c0); 269 269 end; 270 270 … … 652 652 Result := 0; 653 653 for I := 1 to D do 654 Result := Result + sin(f1[I] * ((X * 2 + Y and 1) * sa[I] + Y * 1.5 *654 Result := Result + Sin(f1[I] * ((X * 2 + Y and 1) * sa[I] + Y * 1.5 * 655 655 ca[I])) * f2[I]; 656 656 { x values effectively multiplied with 2 to get 2 horizantal periods … … 662 662 begin 663 663 {$IFNDEF SCR} if X = 1 then 664 V := pi / 2 { first wave goes horizontal }665 else {$ENDIF} V := DelphiRandom * 2 * pi;666 sa[X] := sin(V) / lx;667 ca[X] := cos(V) / ly;668 f1[X] := 2 * pi * exp(Detail * (X - 1));669 f2[X] := exp(-X * Smooth);664 V := Pi / 2 { first wave goes horizontal } 665 else {$ENDIF} V := DelphiRandom * 2 * Pi; 666 sa[X] := Sin(V) / lx; 667 ca[X] := Cos(V) / ly; 668 f1[X] := 2 * Pi * Exp(Detail * (X - 1)); 669 f2[X] := Exp(-X * Smooth); 670 670 end; 671 671 … … 679 679 if X * 2 < imerge then 680 680 V := (X * 2 * V + (imerge - X * 2) * Value(X + lx, Y)) / imerge; 681 V := V - sqr(sqr(2 * Y / ly - 1)); { soft cut at poles }681 V := V - Sqr(Sqr(2 * Y / ly - 1)); { soft cut at poles } 682 682 if V > maxv then 683 683 maxv := V; … … 705 705 I := A; 706 706 A := B; 707 B := I 707 B := I; 708 708 end; 709 709 if A > B then … … 763 763 // must be done after FindContinents 764 764 var 765 I, J, Cnt, X, Y, dx, dy, Loc0, Loc1, xworst, yworst, totalrare, RareMaxWater,765 I, J, Cnt, X, Y, dx, dy, Loc0, Loc1, xworst, yworst, TotalRare, RareMaxWater, 766 766 RareType, iBest, jbest, MinDist, xBlock, yBlock, V8: Integer; 767 767 AreaCount, RareByArea, RareAdjacent: array [0 .. 7, 0 .. 4] of Integer; … … 804 804 end; 805 805 end; 806 totalrare := 0;806 TotalRare := 0; 807 807 for X := 0 to 7 do 808 808 for Y := 0 to 4 do 809 809 if AreaCount[X, Y] > 0 then 810 Inc( totalrare);810 Inc(TotalRare); 811 811 Inc(RareMaxWater); 812 until totalrare >= 12;813 814 while totalrare > 12 do812 until TotalRare >= 12; 813 814 while TotalRare > 12 do 815 815 begin // remove rarebyarea resources too close to each other 816 816 FillChar(RareAdjacent, SizeOf(RareAdjacent), 0); … … 876 876 end; 877 877 AreaCount[xworst, yworst] := 0; 878 Dec( totalrare);878 Dec(TotalRare); 879 879 end; 880 880
Note:
See TracChangeset
for help on using the changeset viewer.