hedgewars/uLand.pas
branchtransitional_engine
changeset 16064 0caa3dfb3ba2
parent 16062 1860852892c0
equal deleted inserted replaced
16063:09beeec033ba 16064:0caa3dfb3ba2
   361     SelectTemplate:= '';
   361     SelectTemplate:= '';
   362     if (cReducedQuality and rqLowRes) <> 0 then
   362     if (cReducedQuality and rqLowRes) <> 0 then
   363         SelectTemplate:= 'small'
   363         SelectTemplate:= 'small'
   364     else
   364     else
   365         begin
   365         begin
   366         if cTemplateFilter = 0 then
   366         if (cTemplateFilter = 0) and (cMapGen <> mgMaze) then
   367             begin
   367             begin
   368             l:= getRandom(GroupedTemplatesCount);
   368             l:= getRandom(GroupedTemplatesCount);
   369             repeat
   369             repeat
   370                 inc(cTemplateFilter);
   370                 inc(cTemplateFilter);
   371                 dec(l, TemplateCounts[cTemplateFilter]);
   371                 dec(l, TemplateCounts[cTemplateFilter]);
   372             until l < 0;
   372             until l < 0;
   373             end
   373             end
   374             else getRandom(1);
   374             else getRandom(1);
   375 
   375 
   376             case cTemplateFilter of
   376             case cMapGen of
   377             0: OutError('Error selecting TemplateFilter. Ask unC0Rr about what you did wrong', true);
   377                 mgMaze:
   378             1: SelectTemplate:= 'small';
   378                     case cTemplateFilter of
   379             2: SelectTemplate:= 'medium';
   379                     0: SelectTemplate:= 'small_tunnels';
   380             3: SelectTemplate:= 'large';
   380                     1: SelectTemplate:= 'medium_tunnels';
   381             4: SelectTemplate:= 'cavern';
   381                     2: SelectTemplate:= 'large_tunnels';
   382             5: SelectTemplate:= 'wacky';
   382                     3: SelectTemplate:= 'small_islands';
   383     // For lua only!
   383                     4: SelectTemplate:= 'medium_islands';
   384             6: begin
   384                     5: SelectTemplate:= 'large_islands';
   385                SelectTemplate:= 'small';
   385                     else OutError('Error selecting TemplateFilter', true);
   386                GetRandom(2) // burn 1
   386                     end
   387                end
   387               else              
   388             end
   388                     case cTemplateFilter of
       
   389                     1: SelectTemplate:= 'small';
       
   390                     2: SelectTemplate:= 'medium';
       
   391                     3: SelectTemplate:= 'large';
       
   392                     4: SelectTemplate:= 'cavern';
       
   393                     5: SelectTemplate:= 'wacky';
       
   394                     // For lua only!
       
   395                     6: begin
       
   396                        SelectTemplate:= 'small';
       
   397                        GetRandom(2) // burn 1
       
   398                        end
       
   399                     else OutError('Error selecting TemplateFilter', true);
       
   400                     end
       
   401               end
   389         end;
   402         end;
   390 
   403 
   391     WriteLnToConsole('Using template filter '+SelectTemplate);
   404     WriteLnToConsole('Using template filter '+SelectTemplate);
   392 end;
   405 end;
   393 
   406