hedgewars/uLand.pas
changeset 2338 8f6508c97f3f
parent 2308 4c39fb2bea6e
child 2376 ece7b87f1334
equal deleted inserted replaced
2337:723f1cbe2ef3 2338:8f6508c97f3f
   390                pa.ar[i].x:= LAND_WIDTH - 1 - pa.ar[i].x;
   390                pa.ar[i].x:= LAND_WIDTH - 1 - pa.ar[i].x;
   391            for i:= 0 to pred(FillPointsCount) do
   391            for i:= 0 to pred(FillPointsCount) do
   392                FillPoints^[i].x:= LAND_WIDTH - 1 - FillPoints^[i].x;
   392                FillPoints^[i].x:= LAND_WIDTH - 1 - FillPoints^[i].x;
   393            end;
   393            end;
   394 
   394 
   395      if canFlip then
   395 (*  Experiment in making this option more useful
   396         if getrandom(2) = 0 then
   396      if ((not isNegative) and (cTemplateFilter = 4)) or 
       
   397         (canFlip and (getrandom(2) = 0)) then
       
   398            begin
       
   399            for i:= 0 to pred(BasePointsCount) do
       
   400                begin
       
   401                pa.ar[i].y:= LAND_HEIGHT - 1 - pa.ar[i].y + (LAND_HEIGHT - TemplateHeight) * 2;
       
   402                if pa.ar[i].y > LAND_HEIGHT - 1 then
       
   403                    pa.ar[i].y:= LAND_HEIGHT - 1;
       
   404                end;
       
   405            for i:= 0 to pred(FillPointsCount) do
       
   406                begin
       
   407                FillPoints^[i].y:= LAND_HEIGHT - 1 - FillPoints^[i].y + (LAND_HEIGHT - TemplateHeight) * 2;
       
   408                if FillPoints^[i].y > LAND_HEIGHT - 1 then
       
   409                    FillPoints^[i].y:= LAND_HEIGHT - 1;
       
   410                end;
       
   411            end;
       
   412      end 
       
   413 *)
       
   414 // template recycling.  Pull these off the floor a bit
       
   415      if (not isNegative) and (cTemplateFilter = 4) then
       
   416            begin
       
   417            for i:= 0 to pred(BasePointsCount) do
       
   418                begin
       
   419                dec(pa.ar[i].y, 100);
       
   420                if pa.ar[i].y < 0 then
       
   421                    pa.ar[i].y:= 0;
       
   422                end;
       
   423            for i:= 0 to pred(FillPointsCount) do
       
   424                begin
       
   425                dec(FillPoints^[i].y, 100);
       
   426                if FillPoints^[i].y < 0 then
       
   427                    FillPoints^[i].y:= 0;
       
   428                end;
       
   429            end;
       
   430 
       
   431      if (canFlip and (getrandom(2) = 0)) then
   397            begin
   432            begin
   398            for i:= 0 to pred(BasePointsCount) do
   433            for i:= 0 to pred(BasePointsCount) do
   399                pa.ar[i].y:= LAND_HEIGHT - 1 - pa.ar[i].y;
   434                pa.ar[i].y:= LAND_HEIGHT - 1 - pa.ar[i].y;
   400            for i:= 0 to pred(FillPointsCount) do
   435            for i:= 0 to pred(FillPointsCount) do
   401                FillPoints^[i].y:= LAND_HEIGHT - 1 - FillPoints^[i].y;
   436                FillPoints^[i].y:= LAND_HEIGHT - 1 - FillPoints^[i].y;
   515 leftX:= ((LAND_WIDTH - playWidth) div 2);
   550 leftX:= ((LAND_WIDTH - playWidth) div 2);
   516 rightX:= (playWidth + ((LAND_WIDTH - playWidth) div 2)) - 1;
   551 rightX:= (playWidth + ((LAND_WIDTH - playWidth) div 2)) - 1;
   517 topY:= LAND_HEIGHT - playHeight;
   552 topY:= LAND_HEIGHT - playHeight;
   518 
   553 
   519 // force to only cavern even if a cavern map is invertable if cTemplateFilter = 4 ?
   554 // force to only cavern even if a cavern map is invertable if cTemplateFilter = 4 ?
   520 if (Template.canInvert and (getrandom(2) = 0)) or
   555 if (cTemplateFilter = 4) or 
       
   556    (Template.canInvert and (getrandom(2) = 0)) or
   521     (not Template.canInvert and Template.isNegative) then 
   557     (not Template.canInvert and Template.isNegative) then 
   522     begin
   558     begin
   523     hasBorder:= true;
   559     hasBorder:= true;
   524     for y:= 0 to LAND_HEIGHT - 1 do
   560     for y:= 0 to LAND_HEIGHT - 1 do
   525         for x:= 0 to LAND_WIDTH - 1 do
   561         for x:= 0 to LAND_WIDTH - 1 do