hedgewars/uWorld.pas
changeset 2904 209a0c573917
parent 2903 e28356fe532a
child 2905 f3c79f7193a9
equal deleted inserted replaced
2903:e28356fe532a 2904:209a0c573917
    75 procedure InitWorld;
    75 procedure InitWorld;
    76 var i, t: LongInt;
    76 var i, t: LongInt;
    77     cp: PClan;
    77     cp: PClan;
    78     g: ansistring;
    78     g: ansistring;
    79 
    79 
    80     // helper function to create the goal/game mode string
    80     // helper functions to create the goal/game mode string
       
    81     function AddGoal(s: ansistring; gf: LongInt; si: TGoalStrId; i: LongInt): ansistring;
       
    82     var t: string;
       
    83     begin
       
    84         if (GameFlags and gf) <> 0 then
       
    85             begin
       
    86             t:= inttostr(i);
       
    87             s:= s + format(trgoal[si], t) + '|'
       
    88             end;
       
    89         AddGoal:= s;
       
    90     end;
       
    91 
    81     function AddGoal(s: ansistring; gf: LongInt; si: TGoalStrId): ansistring;
    92     function AddGoal(s: ansistring; gf: LongInt; si: TGoalStrId): ansistring;
    82     begin
    93     begin
    83         if (GameFlags and gf) <> 0 then s:= s + trgoal[si] + '|';
    94         if (GameFlags and gf) <> 0 then
       
    95             s:= s + trgoal[si] + '|';
    84         AddGoal:= s;
    96         AddGoal:= s;
    85     end;
    97     end;
    86 begin
    98 begin
    87 missionTimer:= 0;
    99 missionTimer:= 0;
    88 
   100 
   115 g:= AddGoal(g, gfKing, gidKing); // king?
   127 g:= AddGoal(g, gfKing, gidKing); // king?
   116 g:= AddGoal(g, gfPlaceHog, gidPlaceHog); // placement?
   128 g:= AddGoal(g, gfPlaceHog, gidPlaceHog); // placement?
   117 g:= AddGoal(g, gfArtillery, gidArtillery); // artillery?
   129 g:= AddGoal(g, gfArtillery, gidArtillery); // artillery?
   118 g:= AddGoal(g, gfSolidLand, gidSolidLand); // solid land?
   130 g:= AddGoal(g, gfSolidLand, gidSolidLand); // solid land?
   119 g:= AddGoal(g, gfSharedAmmo, gidSharedAmmo); // shared ammo?
   131 g:= AddGoal(g, gfSharedAmmo, gidSharedAmmo); // shared ammo?
       
   132 if cMinesTime <> 3000 then g:= AddGoal(g, gfMines, gidMineTimer, cMinesTime div 1000); // changed mine timer?
   120 // if the string has been set, show it for (default timeframe) seconds
   133 // if the string has been set, show it for (default timeframe) seconds
   121 if g <> '' then ShowMission(trgoal[gidCaption], trgoal[gidSubCaption], g, 1, 0);
   134 if g <> '' then ShowMission(trgoal[gidCaption], trgoal[gidSubCaption], g, 1, 0);
   122 
   135 
   123 cWaveWidth:= SpritesData[sprWater].Width;
   136 cWaveWidth:= SpritesData[sprWater].Width;
   124 //cWaveHeight:= SpritesData[sprWater].Height;
   137 //cWaveHeight:= SpritesData[sprWater].Height;