hedgewars/uWorld.pas
changeset 2863 9eb53b1f1842
parent 2857 768dfbe276a5
child 2885 518e6e66239d
equal deleted inserted replaced
2862:1d15ca7b7f64 2863:9eb53b1f1842
    73 	missionTimer: LongInt;
    73 	missionTimer: LongInt;
    74 
    74 
    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;
       
    79 
       
    80     // helper function to create the goal/game mode string
       
    81     function AddGoal(s: ansistring; gf: LongInt; si: TGoalStrId): ansistring;
       
    82     begin
       
    83         if (GameFlags and gf) <> 0 then s:= s + trgoal[si] + '|';
       
    84         AddGoal:= s;
       
    85     end;
    78 begin
    86 begin
    79 missionTimer:= 0;
    87 missionTimer:= 0;
    80 
    88 
    81 if (GameFlags and gfRandomOrder) <> 0 then  // shuffle them up a bit
    89 if (GameFlags and gfRandomOrder) <> 0 then  // shuffle them up a bit
    82    begin
    90    begin
    94          else if (LocalClan = 0) then LocalClan:= t
   102          else if (LocalClan = 0) then LocalClan:= t
    95          end;
   103          end;
    96       end;
   104       end;
    97    CurrentTeam:= ClansArray[0]^.Teams[0];
   105    CurrentTeam:= ClansArray[0]^.Teams[0];
    98    end;
   106    end;
       
   107 
       
   108 // if special game flags are set, add them to the game mode notice window and then show it
       
   109 g:= ''; // no text/things to note yet
       
   110 g:= AddGoal(g, gfForts, gidForts); // forts?
       
   111 g:= AddGoal(g, gfLowGravity, gidLowGravity); // low gravity?
       
   112 g:= AddGoal(g, gfInvulnerable, gidInvulnerable); // invulnerability?
       
   113 g:= AddGoal(g, gfVampiric, gidVampiric); // vampirism?
       
   114 g:= AddGoal(g, gfKarma, gidKarma); // karma?
       
   115 g:= AddGoal(g, gfKing, gidKing); // king?
       
   116 g:= AddGoal(g, gfPlaceHog, gidPlaceHog); // placement?
       
   117 g:= AddGoal(g, gfArtillery, gidArtillery); // artillery?
       
   118 g:= AddGoal(g, gfSolidLand, gidSolidLand); // solid land?
       
   119 // if the string has been set, show it for (default timeframe) seconds
       
   120 if g <> '' then ShowMission(trgoal[gidCaption], trgoal[gidSubCaption], g, 1, 0);
    99 
   121 
   100 cWaveWidth:= SpritesData[sprWater].Width;
   122 cWaveWidth:= SpritesData[sprWater].Width;
   101 //cWaveHeight:= SpritesData[sprWater].Height;
   123 //cWaveHeight:= SpritesData[sprWater].Height;
   102 cWaveHeight:= 32;
   124 cWaveHeight:= 32;
   103 
   125