An experiment with increasing number of caves by selecting a few potential non-cave maps and adding to the cave map array. Ones selected here might not actually be that playable as caves.
--- a/hedgewars/uLand.pas Sun Aug 30 08:04:59 2009 +0000
+++ b/hedgewars/uLand.pas Sun Aug 30 13:53:27 2009 +0000
@@ -392,8 +392,43 @@
FillPoints^[i].x:= LAND_WIDTH - 1 - FillPoints^[i].x;
end;
- if canFlip then
- if getrandom(2) = 0 then
+(* Experiment in making this option more useful
+ if ((not isNegative) and (cTemplateFilter = 4)) or
+ (canFlip and (getrandom(2) = 0)) then
+ begin
+ for i:= 0 to pred(BasePointsCount) do
+ begin
+ pa.ar[i].y:= LAND_HEIGHT - 1 - pa.ar[i].y + (LAND_HEIGHT - TemplateHeight) * 2;
+ if pa.ar[i].y > LAND_HEIGHT - 1 then
+ pa.ar[i].y:= LAND_HEIGHT - 1;
+ end;
+ for i:= 0 to pred(FillPointsCount) do
+ begin
+ FillPoints^[i].y:= LAND_HEIGHT - 1 - FillPoints^[i].y + (LAND_HEIGHT - TemplateHeight) * 2;
+ if FillPoints^[i].y > LAND_HEIGHT - 1 then
+ FillPoints^[i].y:= LAND_HEIGHT - 1;
+ end;
+ end;
+ end
+*)
+// template recycling. Pull these off the floor a bit
+ if (not isNegative) and (cTemplateFilter = 4) then
+ begin
+ for i:= 0 to pred(BasePointsCount) do
+ begin
+ dec(pa.ar[i].y, 100);
+ if pa.ar[i].y < 0 then
+ pa.ar[i].y:= 0;
+ end;
+ for i:= 0 to pred(FillPointsCount) do
+ begin
+ dec(FillPoints^[i].y, 100);
+ if FillPoints^[i].y < 0 then
+ FillPoints^[i].y:= 0;
+ end;
+ end;
+
+ if (canFlip and (getrandom(2) = 0)) then
begin
for i:= 0 to pred(BasePointsCount) do
pa.ar[i].y:= LAND_HEIGHT - 1 - pa.ar[i].y;
@@ -517,7 +552,8 @@
topY:= LAND_HEIGHT - playHeight;
// force to only cavern even if a cavern map is invertable if cTemplateFilter = 4 ?
-if (Template.canInvert and (getrandom(2) = 0)) or
+if (cTemplateFilter = 4) or
+ (Template.canInvert and (getrandom(2) = 0)) or
(not Template.canInvert and Template.isNegative) then
begin
hasBorder:= true;
--- a/hedgewars/uLandTemplates.pas Sun Aug 30 08:04:59 2009 +0000
+++ b/hedgewars/uLandTemplates.pas Sun Aug 30 13:53:27 2009 +0000
@@ -1917,7 +1917,7 @@
18, 19, 20, 21, 22, 23, 24, 25, 26, 27,
28, 29, 30, 31, 32, 33, 34, 35, 37, 38
);
-const CavernTemplates: array[0..0] of Longword = (36);
+const CavernTemplates: array[0..5] of Longword = (36, 15, 2, 3, 21, 29);
const WackyTemplates: array[0..3] of Longword = (37, 38, 39, 40);
implementation