Merge
authorunc0rr
Fri, 01 Jul 2011 10:38:00 +0400
changeset 5366 bfdd925e89a5
parent 5357 ec36f3d53f3c (current diff)
parent 5364 30752b2e99b3 (diff)
child 5368 a66d5141a3ba
child 5385 a864a0aeed96
Merge
hedgewars/GSHandlers.inc
hedgewars/VGSHandlers.inc
hedgewars/uConsts.pas
hedgewars/uGears.pas
hedgewars/uScript.pas
--- a/QTfrontend/gamecfgwidget.cpp	Thu Jun 30 15:09:10 2011 +0400
+++ b/QTfrontend/gamecfgwidget.cpp	Fri Jul 01 10:38:00 2011 +0400
@@ -229,6 +229,20 @@
     QList<QByteArray> bcfg;
     int mapgen = pMapContainer->get_mapgen();
 
+    QString currentMap = pMapContainer->getCurrentMap();
+    if (currentMap.size() > 0)
+    {
+        bcfg << QString("emap " + currentMap).toUtf8();
+        if(pMapContainer->getCurrentIsMission())
+            bcfg << QString("escript Maps/%1/map.lua").arg(currentMap).toUtf8();
+    }
+    bcfg << QString("etheme " + pMapContainer->getCurrentTheme()).toUtf8();
+
+    if (Scripts->currentIndex() > 0)
+    {
+        bcfg << QString("escript Scripts/Multiplayer/%1.lua").arg(Scripts->itemData(Scripts->currentIndex()).toList()[0].toString()).toUtf8();
+    }
+
     bcfg << QString("eseed " + pMapContainer->getCurrentSeed()).toUtf8();
     bcfg << QString("e$gmflags %1").arg(getGameFlags()).toUtf8();
     bcfg << QString("e$damagepct %1").arg(schemeData(25).toInt()).toUtf8();
@@ -270,20 +284,6 @@
         default: ;
     }
 
-    QString currentMap = pMapContainer->getCurrentMap();
-    if (currentMap.size() > 0)
-    {
-        bcfg << QString("emap " + currentMap).toUtf8();
-        if(pMapContainer->getCurrentIsMission())
-            bcfg << QString("escript Maps/%1/map.lua").arg(currentMap).toUtf8();
-    }
-    bcfg << QString("etheme " + pMapContainer->getCurrentTheme()).toUtf8();
-
-    if (Scripts->currentIndex() > 0)
-    {
-        bcfg << QString("escript Scripts/Multiplayer/%1.lua").arg(Scripts->itemData(Scripts->currentIndex()).toList()[0].toString()).toUtf8();
-    }
-
     QByteArray result;
 
     foreach(QByteArray ba, bcfg)
--- a/hedgewars/GSHandlers.inc	Thu Jun 30 15:09:10 2011 +0400
+++ b/hedgewars/GSHandlers.inc	Fri Jul 01 10:38:00 2011 +0400
@@ -606,7 +606,7 @@
     with Gear^ do
         begin
         State:= State and not gstInvisible;
-        X:= X + cWindSpeed * 1600 + dX;
+        X:= X + cWindSpeed * 3200 + dX;
         Y:= Y + dY + cGravity * vobFallSpeed * 8;  // using same value as flakes to try and get similar results
         xx:= hwRound(X);
         yy:= hwRound(Y);
@@ -726,14 +726,15 @@
         end;
 
 if move then
+    begin
     if gun then
-        DeleteGear(Gear)
-    else
         begin
-        Gear^.X:= int2hwFloat(GetRandom(LAND_WIDTH+1024)-512);
-        Gear^.Y:= int2hwFloat(750+(GetRandom(50)-25));
-        Gear^.State:= Gear^.State or gstInvisible;
-        end
+        DeleteGear(Gear);
+        exit
+        end;
+    Gear^.X:= int2hwFloat(GetRandom(LAND_WIDTH+1024)-512);
+    Gear^.Y:= int2hwFloat(750+(GetRandom(50)-25))
+    end
 end;
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -1072,30 +1073,39 @@
     dec(Gear^.Timer);
     case Gear^.Kind of 
         gtATStartGame: 
-        begin
+    begin
         AllInactive := false;
         if Gear^.Timer = 0 then
-            begin
+        begin
             AddCaption(trmsg[sidStartFight], cWhiteColor, capgrpGameState);
-            end
-        end;
-    gtATFinishGame: 
-        begin
-            AllInactive := false;
-            if Gear^.Timer = 1000 then
-                begin
-                ScreenFade := sfToBlack;
-                ScreenFadeValue := 0;
-                ScreenFadeSpeed := 1;
-                end;
-            if Gear^.Timer = 0 then
-                begin
-                SendIPC('N');
-                SendIPC('q');
-                GameState := gsExit
-                end
-        end;
+        end
     end;
+    gtATSmoothWindCh: 
+begin
+    if Gear^.Timer = 0 then
+    begin
+        if WindBarWidth < Gear^.Tag then inc(WindBarWidth)
+        else if WindBarWidth > Gear^.Tag then dec(WindBarWidth);
+        if WindBarWidth <> Gear^.Tag then Gear^.Timer := 10;
+    end
+end;
+gtATFinishGame: 
+begin
+    AllInactive := false;
+    if Gear^.Timer = 1000 then
+    begin
+        ScreenFade := sfToBlack;
+        ScreenFadeValue := 0;
+        ScreenFadeSpeed := 1;
+    end;
+    if Gear^.Timer = 0 then
+    begin
+        SendIPC('N');
+        SendIPC('q');
+        GameState := gsExit
+    end
+end;
+end;
 if Gear^.Timer = 0 then DeleteGear(Gear)
 end;
 
@@ -2556,7 +2566,6 @@
         HHGear := Gear^.Hedgehog^.Gear;
         Msg := Gear^.Message and not gmSwitch;
         DeleteGear(Gear);
-        OnUsedAmmo(HHGear^.Hedgehog^);
         ApplyAmmoChanges(HHGear^.Hedgehog^);
 
         HHGear := CurrentHedgehog^.Gear;
@@ -2605,6 +2614,7 @@
     Gear^.doStep := @doStepSwitcherWork;
 
     HHGear := Gear^.Hedgehog^.Gear;
+    OnUsedAmmo(HHGear^.Hedgehog^);
     with HHGear^ do
     begin
         State := State and not gstAttacking;
--- a/hedgewars/HHHandlers.inc	Thu Jun 30 15:09:10 2011 +0400
+++ b/hedgewars/HHHandlers.inc	Fri Jul 01 10:38:00 2011 +0400
@@ -533,7 +533,13 @@
 begin
 Gear^.Message:= gmDestroy;
 PlaySound(sndShotgunReload);
-if (Gear^.Pos and posCaseTrap) <> 0 then doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, HH^.Hedgehog, EXPLAutoSound)
+if (Gear^.Pos and posCaseExplode) <> 0 then
+    if (Gear^.Pos and posCasePoison) <> 0 then
+        doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, HH^.Hedgehog, EXPLAutoSound + EXPLPoisoned)
+    else
+        doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, HH^.Hedgehog, EXPLAutoSound)
+else if (Gear^.Pos and posCasePoison) <> 0 then
+    doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, HH^.Hedgehog, EXPLAutoSound + EXPLPoisoned + EXPLNoDamage)
 else
 case Gear^.Pos of
        posCaseUtility,
--- a/hedgewars/VGSHandlers.inc	Thu Jun 30 15:09:10 2011 +0400
+++ b/hedgewars/VGSHandlers.inc	Fri Jul 01 10:38:00 2011 +0400
@@ -46,7 +46,7 @@
         inc(Frame);
         if Frame = vobSDFramesCount then Frame:= 0
         end;
-    X:= X + (cWindSpeedf * 600 + dX + tdX) * Steps;
+    X:= X + (cWindSpeedf * 400 + dX + tdX) * Steps;
     if SuddenDeathDmg then
         Y:= Y + (dY + tdY + cGravityf * vobSDFallSpeed) * Steps
     else
--- a/hedgewars/uCommandHandlers.pas	Thu Jun 30 15:09:10 2011 +0400
+++ b/hedgewars/uCommandHandlers.pas	Fri Jul 01 10:38:00 2011 +0400
@@ -445,7 +445,7 @@
 
 procedure chSetMap(var s: shortstring);
 begin
-if isDeveloperMode then
+if isDeveloperMode and (s <> '') then
 begin
 UserPathz[ptMapCurrent]:= UserPathz[ptMaps] + '/' + s;
 Pathz[ptMapCurrent]:= Pathz[ptMaps] + '/' + s;
--- a/hedgewars/uCommands.pas	Thu Jun 30 15:09:10 2011 +0400
+++ b/hedgewars/uCommands.pas	Fri Jul 01 10:38:00 2011 +0400
@@ -33,7 +33,7 @@
 procedure StopMessages(Message: Longword);
 
 implementation
-uses Types, uConsts, uVariables, uConsole, uUtils, uDebug;
+uses Types, uConsts, uVariables, uConsole, uUtils, uDebug, uScript;
 
 type  PVariable = ^TVariable;
       TVariable = record
@@ -68,7 +68,7 @@
 
 procedure ParseCommand(CmdStr: shortstring; TrustedSource: boolean);
 var ii: LongInt;
-    s: shortstring;
+    s, i, o: shortstring;
     t: PVariable;
     c: char;
 begin
@@ -85,6 +85,8 @@
       if t^.Name = CmdStr then
          begin
          if TrustedSource or t^.Trusted then
+            begin
+            if (c <> '$') or (s[0] <> #0) then s:= ParseCommandOverride(CmdStr, s);
             case t^.VType of
               vtCommand: if c='/' then
                          begin
@@ -94,8 +96,12 @@
                          if s[0]=#0 then
                             begin
                             str(PLongInt(t^.Handler)^, s);
-                            WriteLnToConsole('$' + CmdStr + ' is "' + s + '"');
-                            end else val(s, PLongInt(t^.Handler)^);
+                            i:= inttostr(PLongInt(t^.Handler)^);
+                            o:= ParseCommandOverride(CmdStr, i);
+                            if i <> o then val(o, PLongInt(t^.Handler)^) 
+                            else WriteLnToConsole('$' + CmdStr + ' is "' + s + '"');
+                            end 
+                         else val(s, PLongInt(t^.Handler)^);
               vthwFloat: if c='$' then
                          if s[0]=#0 then
                             begin
@@ -106,13 +112,23 @@
                          if s[0]=#0 then
                             begin
                             str(ord(boolean(t^.Handler^)), s);
-                            WriteLnToConsole('$' + CmdStr + ' is "' + s + '"');
-                            end else
+                            if boolean(t^.Handler^) then i:= '1'
+                            else i:= '0';
+                            o:= ParseCommandOverride(CmdStr, i);
+                            if i <> o then 
+                                begin
+                                val(o, ii);
+                                boolean(t^.Handler^):= not (ii = 0)
+                                end
+                            else WriteLnToConsole('$' + CmdStr + ' is "' + s + '"');
+                            end 
+                         else
                             begin
                             val(s, ii);
                             boolean(t^.Handler^):= not (ii = 0)
                             end;
               end;
+              end;
          exit
          end else t:= t^.Next
       end;
--- a/hedgewars/uConsts.pas	Thu Jun 30 15:09:10 2011 +0400
+++ b/hedgewars/uConsts.pas	Fri Jul 01 10:38:00 2011 +0400
@@ -261,7 +261,8 @@
     posCaseHealth  = $00000002;
     posCaseUtility = $00000004;
     posCaseDummy   = $00000008;
-    posCaseTrap    = $00000010;
+    posCaseExplode = $00000010;
+    posCasePoison  = $00000020;
 
     NoPointX = Low(LongInt);
     cTargetPointRef : TPoint = (X: NoPointX; Y: 0);
--- a/hedgewars/uGears.pas	Thu Jun 30 15:09:10 2011 +0400
+++ b/hedgewars/uGears.pas	Fri Jul 01 10:38:00 2011 +0400
@@ -39,7 +39,7 @@
 procedure freeModule;
 function  AddGear(X, Y: LongInt; Kind: TGearType; State: Longword; dX, dY: hwFloat; Timer: LongWord): PGear;
 function  SpawnCustomCrateAt(x, y: LongInt; crate: TCrateType; content: Longword ): PGear;
-function  SpawnFakeCrateAt(x, y: LongInt; crate: TCrateType; trap: boolean ): PGear;
+function  SpawnFakeCrateAt(x, y: LongInt; crate: TCrateType; explode: boolean; poison: boolean ): PGear;
 procedure ResurrectHedgehog(gear: PGear);
 procedure ProcessGears;
 procedure EndTurnCleanup;
@@ -1638,13 +1638,14 @@
     SpawnCustomCrateAt := FollowGear;
 end;
 
-function SpawnFakeCrateAt(x, y: LongInt; crate: TCrateType; trap: boolean): PGear;
+function SpawnFakeCrateAt(x, y: LongInt; crate: TCrateType; explode: boolean; poison: boolean): PGear;
 begin
     FollowGear := AddGear(x, y, gtCase, 0, _0, _0, 0);
     cCaseFactor := 0;
+    FollowGear^.Pos := posCaseDummy;
     
-    if trap then FollowGear^.Pos := posCaseTrap
-    else FollowGear^.Pos := posCaseDummy;
+    if explode then FollowGear^.Pos := FollowGear^.Pos + posCaseExplode;
+    if poison then FollowGear^.Pos := FollowGear^.Pos + posCasePoison;
 
     case crate of
         HealthCrate: begin
--- a/hedgewars/uLandGraphics.pas	Thu Jun 30 15:09:10 2011 +0400
+++ b/hedgewars/uLandGraphics.pas	Fri Jul 01 10:38:00 2011 +0400
@@ -715,7 +715,7 @@
    yy:= Y div 2;
    end;
 pixelsweep:= ((Land[Y, X] and $FF00) = 0) and (LandPixels[yy, xx] <> 0);
-if (((Land[Y, X] and lfDamaged) <> 0) and ((Land[Y, X] and lfIndestructible) = 0)) or pixelsweep then
+if ((Land[Y, X] > 255) and ((Land[Y, X] and lfIndestructible) = 0)) or pixelsweep then
     begin
     c:= 0;
     for i:= -1 to 1 do
@@ -738,8 +738,8 @@
                     else if Land[ny, nx] > 255 then inc(c);
                     end
                 end;
-
-    if c < 4 then // 0-3 neighbours
+    if (c < 2) or
+       ((c < 4) and (((Land[Y, X] and lfDamaged) <> 0) or pixelsweep)) then
         begin
         if ((Land[Y, X] and lfBasic) <> 0) and not disableLandBack then
             LandPixels[yy, xx]:= LandBackPixel(X, Y)
--- a/hedgewars/uScript.pas	Thu Jun 30 15:09:10 2011 +0400
+++ b/hedgewars/uScript.pas	Fri Jul 01 10:38:00 2011 +0400
@@ -43,6 +43,7 @@
 function ScriptCall(fname : shortstring; par1, par2, par3: LongInt) : LongInt;
 function ScriptCall(fname : shortstring; par1, par2, par3, par4 : LongInt) : LongInt;
 function ScriptExists(fname : shortstring) : boolean;
+function ParseCommandOverride(key, value : shortstring) : shortstring;
 
 procedure initModule;
 procedure freeModule;
@@ -226,13 +227,13 @@
 function lc_spawnfakehealthcrate(L: Plua_State) : LongInt; Cdecl;
 var gear: PGear;
 begin
-    if lua_gettop(L) <> 3 then begin
+    if lua_gettop(L) <> 4 then begin
         LuaError('Lua: Wrong number of parameters passed to SpawnFakeHealthCrate!');
         lua_pushnil(L);
     end
     else begin
         gear := SpawnFakeCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2),
-            HealthCrate, lua_toboolean(L, 3));
+            HealthCrate, lua_toboolean(L, 3), lua_toboolean(L, 4));
         lua_pushinteger(L, gear^.uid);
     end;
     lc_spawnfakehealthcrate := 1;        
@@ -241,13 +242,13 @@
 function lc_spawnfakeammocrate(L: PLua_State): LongInt; Cdecl;
 var gear: PGear;
 begin
-    if lua_gettop(L) <> 3 then begin
+    if lua_gettop(L) <> 4 then begin
         LuaError('Lua: Wrong number of parameters passed to SpawnFakeAmmoCrate!');
         lua_pushnil(L);
     end
     else begin
         gear := SpawnFakeCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2),
-            AmmoCrate, lua_toboolean(L, 3));
+            AmmoCrate, lua_toboolean(L, 3), lua_toboolean(L, 4));
         lua_pushinteger(L, gear^.uid);
     end;
     lc_spawnfakeammocrate := 1;
@@ -256,13 +257,13 @@
 function lc_spawnfakeutilitycrate(L: PLua_State): LongInt; Cdecl;
 var gear: PGear;
 begin
-    if lua_gettop(L) <> 3 then begin
+    if lua_gettop(L) <> 4 then begin
         LuaError('Lua: Wrong number of parameters passed to SpawnFakeUtilityCrate!');
         lua_pushnil(L);
     end
     else begin  
         gear := SpawnFakeCrateAt(lua_tointeger(L, 1), lua_tointeger(L, 2),
-            UtilityCrate, lua_toboolean(L, 3));
+            UtilityCrate, lua_toboolean(L, 3), lua_toboolean(L, 4));
         lua_pushinteger(L, gear^.uid);
     end;
     lc_spawnfakeutilitycrate := 1;
@@ -1588,6 +1589,25 @@
 GetGlobals;
 end;
 
+function ParseCommandOverride(key, value : shortstring) : shortstring;
+begin
+ParseCommandOverride:= value;
+if not ScriptExists('ParseCommandOverride') then exit;
+lua_getglobal(luaState, Str2PChar('ParseCommandOverride'));
+lua_pushstring(luaState, Str2PChar(key));
+lua_pushstring(luaState, Str2PChar(value));
+if lua_pcall(luaState, 2, 1, 0) <> 0 then
+    begin
+    LuaError('Lua: Error while calling ParseCommandOverride: ' + lua_tostring(luaState, -1));
+    lua_pop(luaState, 1)
+    end
+else
+    begin
+    ParseCommandOverride:= lua_tostring(luaState, -1);
+    lua_pop(luaState, 1)
+    end;
+end;
+
 function ScriptCall(fname : shortstring; par1: LongInt) : LongInt;
 begin
 ScriptCall:= ScriptCall(fname, par1, 0, 0, 0)
@@ -1669,14 +1689,23 @@
 end;
 
 procedure ScriptApplyAmmoStore;
-var i : LongInt;
+var i, j : LongInt;
 begin
 SetAmmoLoadout(ScriptAmmoLoadout);
 SetAmmoProbability(ScriptAmmoProbability);
 SetAmmoDelay(ScriptAmmoDelay);
 SetAmmoReinforcement(ScriptAmmoReinforcement);
-for i:= 0 to Pred(TeamsCount) do
-    AddAmmoStore;
+
+if (GameFlags and gfSharedAmmo) <> 0 then
+    for i:= 0 to Pred(ClansCount) do
+        AddAmmoStore
+else if (GameFlags and gfPerHogAmmo) <> 0 then
+    for i:= 0 to Pred(TeamsCount) do
+        for j:= 0 to Pred(TeamsArray[i]^.HedgehogsNumber) do
+            AddAmmoStore
+else 
+    for i:= 0 to Pred(TeamsCount) do
+        AddAmmoStore
 end;
 
 procedure initModule;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/misc/theme_editor.html	Fri Jul 01 10:38:00 2011 +0400
@@ -0,0 +1,159 @@
+<!doctype html>
+<html>
+    <head>
+        <title>Hedgewars Theme Editor</title>
+        <script type="text/javascript">
+            var sky, clouds, horizont, water, land, border;
+            var skyColor, waterTopColor, waterBottomColor;
+            var elements = 7;
+            var landArray;
+            
+            function landFunction(x){
+                return 384 - 192 * Math.sin(x * Math.PI/512);
+            }
+            
+            function tryToDraw(){
+                if (--elements <= 0) {
+                    draw();
+                }
+            }
+        
+            function load(){
+                    var canvas = document.getElementById('preview');
+                    if (canvas.getContext){
+                        var ctx = canvas.getContext('2d');
+                    
+                        ctx.fillStyle = '#0b294b';
+                        ctx.fillRect(0, 0, 512, 384);
+                        
+                        ctx.font = "40pt Arial";
+                        ctx.fillStyle = '#2b7bd5';
+                        ctx.fillText('Loading Images...', 32, 212);
+                    }
+                    
+                    sky = new Image();
+                    sky.onload = tryToDraw;
+                    sky.src = 'http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Themes/Nature/Sky.png';
+          
+                    clouds = new Image();
+                    clouds.onload = tryToDraw;
+                    clouds.src = 'http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Graphics/Clouds.png';
+          
+                    horizont = new Image();
+                    horizont.onload = tryToDraw;
+                    horizont.src = 'http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Themes/Nature/horizont.png';
+          
+                    land = new Image();
+                    land.onload = tryToDraw;
+                    land.src = 'http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Themes/Nature/LandTex.png';
+          
+                    border = new Image();
+                    border.onload = tryToDraw;
+                    border.src = 'http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Themes/Nature/Border.png';
+          
+                    water = new Image();
+                    water.onload = tryToDraw;
+                    water.src = 'http://hedgewars.googlecode.com/hg/share/hedgewars/Data/Graphics/BlueWater.png';
+                    
+                    landArray = new Array(512);
+                    for (var x = 0; x < landArray.length; x++)
+                        landArray[x] = landFunction(x);
+                    
+                    skyColor = '#131252';
+                    document.getElementById('skyColor').value = skyColor;
+                    
+                    waterTopColor = '#555C9D';
+                    document.getElementById('waterTopColor').value = waterTopColor;
+                    
+                    waterBottomColor = '#343C7D';
+                    document.getElementById('waterBottomColor').value = waterBottomColor;
+                    
+                    tryToDraw();
+            }
+            
+            function draw(){
+                var canvas = document.getElementById('preview');
+                if (canvas.getContext){
+                    var ctx = canvas.getContext('2d');
+                    
+                    ctx.fillStyle = skyColor;
+                    ctx.fillRect(0, 0, 512, 384);
+                    
+                    ctx.drawImage(sky, 0, 64, 512, 256);
+          
+                    for (var i = 0; i < 4; i++)
+                        ctx.drawImage(clouds, 0, i * 128, 256, 128, i * 128, 64, 128, 64);
+          
+                    ctx.drawImage(horizont, 0, 192, 512, 128);
+                    
+                    ctx.save();
+                    
+                    ctx.beginPath();
+                    ctx.moveTo(0, 384);
+                    for (var x = 0; x < landArray.length; x++)
+                        ctx.lineTo(x, landArray[x]);
+                    ctx.clip();
+                    
+                    for (var i = 0; i < 2; i++)
+                    	for (var k = 0; k < 2; k++)
+                    		ctx.drawImage(land, i * 320, k * 240, 320, 240);
+                    
+                    ctx.restore();
+                    
+                    var k = 0;
+                    for (var x = 0; x < landArray.length; x++) {
+                        if (++k == 64)
+                            k = 0;
+                        ctx.drawImage(border, k, 0, 2, 16, x, landArray[x] - 4, 1, 8);
+                    }
+                        
+                    
+                    var gradient = ctx.createLinearGradient(0, 320, 0, 384);
+                    gradient.addColorStop(0, waterTopColor);
+                    gradient.addColorStop(1, waterBottomColor);
+                    ctx.fillStyle = gradient;
+                    ctx.fillRect(0, 320, 512, 384);
+          
+                    for (var i = 0; i < 8; i++)
+                        ctx.drawImage(water, i * 64, 308, 64, 24);
+                }
+            }
+        </script>
+        <style type="text/css">
+            canvas { border: 1px solid black; }
+        </style>
+    </head>
+    <body onload="load();">
+        <h1>Hedgewars Theme editor</h1>
+        <canvas id="preview" width="512" height="384"></canvas><br>
+        <table>
+        <tr><td>Sky:</td><td>
+        <input id="sky" type="file" accept="image/png" onchange="sky.src = window.URL.createObjectURL(this.files[0])"></input>
+        </td></tr>
+        <tr><td>Sky Color:</td><td>
+        <input id="skyColor" type="color" onchange="skyColor = this.value; draw()"></input>
+        </td></tr>
+        <tr><td>Clouds:</td><td>
+        <input id="clouds" type="file" accept="image/png" onchange="clouds.src = window.URL.createObjectURL(this.files[0])"></input>
+        </td></tr>
+        <tr><td>Horizont:</td><td>
+        <input id="horizont" type="file" accept="image/png" onchange="horizont.src = window.URL.createObjectURL(this.files[0])"></input>
+        </td></tr>
+        <tr><td>Land:</td><td>
+        <input id="land" type="file" accept="image/png" onchange="land.src = window.URL.createObjectURL(this.files[0])"></input>
+        </td></tr>
+        <tr><td>Border:</td><td>
+        <input id="border" type="file" accept="image/png" onchange="border.src = window.URL.createObjectURL(this.files[0])"></input>
+        </td></tr>
+        <tr><td>Water:</td><td>
+        <input id="water" type="file" accept="image/png" onchange="water.src = window.URL.createObjectURL(this.files[0])"></input>
+        </td></tr>
+        <tr><td>Water Top Color:</td><td>
+        <input id="waterTopColor" type="color" onchange="waterTopColor = this.value; draw()"></input>
+        </td></tr>
+        <tr><td>Water Bottom Color:</td><td>
+        <input id="waterBottomColor" type="color" onchange="waterBottomColor = this.value; draw()"></input>
+        </td></tr>
+        </table>
+    </body>
+</html>
--- a/share/hedgewars/Data/Scripts/Multiplayer/Random_Weapon.lua	Thu Jun 30 15:09:10 2011 +0400
+++ b/share/hedgewars/Data/Scripts/Multiplayer/Random_Weapon.lua	Fri Jul 01 10:38:00 2011 +0400
@@ -46,7 +46,7 @@
 
 function onGameInit()
     -- Limit flags that can be set, but allow game schemes to be used
-    GameFlags = band(bor(GameFlags, gfResetWeps), bnot(gfInfAttack + gfPerHogAmmo))
+    GameFlags = band(bor(GameFlags, gfResetWeps), bnot(gfInfAttack))
     -- Set a custom game goal that will show together with the scheme ones
     Goals = loc("Each turn you get one random weapon")
 end
--- a/share/hedgewars/Data/Scripts/Multiplayer/The_Specialists.lua	Thu Jun 30 15:09:10 2011 +0400
+++ b/share/hedgewars/Data/Scripts/Multiplayer/The_Specialists.lua	Fri Jul 01 10:38:00 2011 +0400
@@ -1,5 +1,5 @@
 ----------------------------------
--- THE SPECIALISTS MODE 0.2
+-- THE SPECIALISTS MODE 0.3
 -- by mikade
 ----------------------------------
 
@@ -16,13 +16,19 @@
 -- removed some deprecated variables/methods
 -- fixed lack of portal reset
 
+----------------
+-- version 0.3
+----------------
+-- added switching on start
+-- removed switch from engineer weaponset
+
 --------------------
 --TO DO
 --------------------
 
 -- add proper gameflag checking, maybe
 -- set crate drops etc.
--- assuming place hog mode + gfinfattack doesn't get the fix: somehow end turn after teleport
+-- add alternative switch
 
 loadfile(GetDataPath() .. "Scripts/Locale.lua")()
 
@@ -31,6 +37,8 @@
 
 local currName 
 local lastName
+local started = false
+local switchStage = 0
 
 function CreateTeam()
 
@@ -155,7 +163,7 @@
 		AddAmmo(CurrentHedgehog, amGirder, 2)
 		AddAmmo(CurrentHedgehog, amBlowTorch, 1)
 		AddAmmo(CurrentHedgehog, amPickHammer, 1)	
-		AddAmmo(CurrentHedgehog, amSwitch, 2)	
+		--AddAmmo(CurrentHedgehog, amSwitch, 2)	
 	elseif n == "Ninja" then
 		AddAmmo(CurrentHedgehog, amRope, 100)
 		AddAmmo(CurrentHedgehog, amParachute, 100)
@@ -215,7 +223,13 @@
 	currName = GetHogName(CurrentHedgehog)
 	lastName = GetHogName(CurrentHedgehog)
 	AssignAmmo()
-	AddAmmo(CurrentHedgehog, amSwitch, 1)
+	
+	--AddAmmo(CurrentHedgehog, amSwitch, 1)
+	---------------
+	--switch	
+	started = false
+	switchStage = 0
+	---------------
 end
 
 function onGameTick()
@@ -229,6 +243,22 @@
 			AssignAmmo()		
 		end
 
+		if (TurnTimeLeft > 0) and (TurnTimeLeft ~= TurnTime) and (switchStage < 100) then			
+			
+			switchStage = switchStage + 1	
+			
+			if switchStage == 10 then
+				AddAmmo(CurrentHedgehog, amSwitch, 1)
+			elseif switchStage == 20 then
+				ParseCommand("setweap " .. string.char(amSwitch))
+			elseif switchStage == 30 then
+				SetGearMessage(CurrentHedgehog,gmAttack) 
+				switchStage = 110
+			end
+		end		
+		
+		--------------------------------------------------------------------------------------
+
 		lastName = currName
 
 	end
@@ -249,7 +279,7 @@
 end
 
 function onAmmoStoreInit()
-
+--
 end