hedgewars/uWorld.pas
changeset 2908 bd1909984a09
parent 2905 f3c79f7193a9
child 2921 b7a636503298
equal deleted inserted replaced
2907:b29c1358498d 2908:bd1909984a09
    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 functions 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;
    81     function AddGoal(s: ansistring; gf: longword; si: TGoalStrId; i: LongInt): ansistring;
    82     var t: ansistring;
    82     var t: ansistring;
    83     begin
    83     begin
    84         if (GameFlags and gf) <> 0 then
    84         if (GameFlags and gf) <> 0 then
    85             begin
    85             begin
    86             t:= inttostr(i);
    86             t:= inttostr(i);
    87             s:= s + format(trgoal[si], t) + '|'
    87             s:= s + format(trgoal[si], t) + '|'
    88             end;
    88             end;
    89         AddGoal:= s;
    89         AddGoal:= s;
    90     end;
    90     end;
    91 
    91 
    92     function AddGoal(s: ansistring; gf: LongInt; si: TGoalStrId): ansistring;
    92     function AddGoal(s: ansistring; gf: longword; si: TGoalStrId): ansistring;
    93     begin
    93     begin
    94         if (GameFlags and gf) <> 0 then
    94         if (GameFlags and gf) <> 0 then
    95             s:= s + trgoal[si] + '|';
    95             s:= s + trgoal[si] + '|';
    96         AddGoal:= s;
    96         AddGoal:= s;
    97     end;
    97     end;
   115          end;
   115          end;
   116       end;
   116       end;
   117    CurrentTeam:= ClansArray[0]^.Teams[0];
   117    CurrentTeam:= ClansArray[0]^.Teams[0];
   118    end;
   118    end;
   119 
   119 
   120 // if special game flags are set, add them to the game mode notice window and then show it
   120 // if special game flags/settings are changed, add them to the game mode notice window and then show it
   121 g:= ''; // no text/things to note yet
   121 g:= ''; // no text/things to note yet
       
   122 
       
   123 // modified damage modificator?
       
   124 if cDamagePercent <> 100 then
       
   125 	g:= AddGoal(g, gfAny, gidDamageModifier, cDamagePercent);
       
   126 
       
   127 // modified mine timers?
       
   128 if cMinesTime <> 3000 then
       
   129 	begin
       
   130 	if cMinesTime = 0 then
       
   131 		g:= AddGoal(g, gfMines, gidNoMineTimer)
       
   132 	else if cMinesTime < 0 then
       
   133 		g:= AddGoal(g, gfMines, gidRandomMineTimer)
       
   134 	else
       
   135 		g:= AddGoal(g, gfMines, gidMineTimer, cMinesTime div 1000);
       
   136 	end;
       
   137 
       
   138 // check different game flags
   122 g:= AddGoal(g, gfForts, gidForts); // forts?
   139 g:= AddGoal(g, gfForts, gidForts); // forts?
   123 g:= AddGoal(g, gfLowGravity, gidLowGravity); // low gravity?
   140 g:= AddGoal(g, gfLowGravity, gidLowGravity); // low gravity?
   124 g:= AddGoal(g, gfInvulnerable, gidInvulnerable); // invulnerability?
   141 g:= AddGoal(g, gfInvulnerable, gidInvulnerable); // invulnerability?
   125 g:= AddGoal(g, gfVampiric, gidVampiric); // vampirism?
   142 g:= AddGoal(g, gfVampiric, gidVampiric); // vampirism?
   126 g:= AddGoal(g, gfKarma, gidKarma); // karma?
   143 g:= AddGoal(g, gfKarma, gidKarma); // karma?
   127 g:= AddGoal(g, gfKing, gidKing); // king?
   144 g:= AddGoal(g, gfKing, gidKing); // king?
   128 g:= AddGoal(g, gfPlaceHog, gidPlaceHog); // placement?
   145 g:= AddGoal(g, gfPlaceHog, gidPlaceHog); // placement?
   129 g:= AddGoal(g, gfArtillery, gidArtillery); // artillery?
   146 g:= AddGoal(g, gfArtillery, gidArtillery); // artillery?
   130 g:= AddGoal(g, gfSolidLand, gidSolidLand); // solid land?
   147 g:= AddGoal(g, gfSolidLand, gidSolidLand); // solid land?
   131 g:= AddGoal(g, gfSharedAmmo, gidSharedAmmo); // shared ammo?
   148 g:= AddGoal(g, gfSharedAmmo, gidSharedAmmo); // shared ammo?
   132 if cMinesTime <> 3000 then // changed mine timer?
   149 
   133 	begin
       
   134 	if cMinesTime = 0 then
       
   135 		g:= AddGoal(g, gfMines, gidNoMineTimer)
       
   136 	else if cMinesTime < 0 then
       
   137 		g:= AddGoal(g, gfMines, gidRandomMineTimer)
       
   138 	else
       
   139 		g:= AddGoal(g, gfMines, gidMineTimer, cMinesTime div 1000);
       
   140 	end;
       
   141 // if the string has been set, show it for (default timeframe) seconds
   150 // if the string has been set, show it for (default timeframe) seconds
   142 if g <> '' then ShowMission(trgoal[gidCaption], trgoal[gidSubCaption], g, 1, 0);
   151 if g <> '' then ShowMission(trgoal[gidCaption], trgoal[gidSubCaption], g, 1, 0);
   143 
   152 
   144 cWaveWidth:= SpritesData[sprWater].Width;
   153 cWaveWidth:= SpritesData[sprWater].Width;
   145 //cWaveHeight:= SpritesData[sprWater].Height;
   154 //cWaveHeight:= SpritesData[sprWater].Height;