Add rubber utility. Graphics are still incomplete. Also flag snow/ice in theme config.
authornemo
Sun, 08 Dec 2013 16:04:40 -0500 (2013-12-08)
changeset 9768 08799c901a42
parent 9767 17df4c8201f6
child 9769 5814e0c47c99
Add rubber utility. Graphics are still incomplete. Also flag snow/ice in theme config.
QTfrontend/weapons.h
hedgewars/uAIAmmoTests.pas
hedgewars/uGears.pas
hedgewars/uGearsHandlersMess.pas
hedgewars/uGearsHedgehog.pas
hedgewars/uGearsRender.pas
hedgewars/uLandGraphics.pas
hedgewars/uLandObjects.pas
hedgewars/uStore.pas
hedgewars/uTypes.pas
hedgewars/uVariables.pas
hedgewars/uVisualGears.pas
share/hedgewars/Data/Graphics/AmmoMenu/Ammos.png
share/hedgewars/Data/Graphics/AmmoMenu/Ammos_bw.png
share/hedgewars/Data/Graphics/amRubber.png
share/hedgewars/Data/Locale/en.txt
share/hedgewars/Data/Themes/Christmas/theme.cfg
share/hedgewars/Data/Themes/Snow/theme.cfg
--- a/QTfrontend/weapons.h	Sun Dec 08 13:49:11 2013 -0500
+++ b/QTfrontend/weapons.h	Sun Dec 08 16:04:40 2013 -0500
@@ -21,45 +21,45 @@
 //skip---------------------------------|
 //structure------------------------------------------------------------------|
 
-#define AMMOLINE_DEFAULT_QT     "9391929422199121032235111001201000000211110101011111121"
-#define AMMOLINE_DEFAULT_PROB   "0405040541600655546554464776576666666155510101115411121"
-#define AMMOLINE_DEFAULT_DELAY  "0000000000000205500000040007004000000000220000000600020"
-#define AMMOLINE_DEFAULT_CRATE  "1311110312111111123114111111111111111211111101111111121"
+#define AMMOLINE_DEFAULT_QT     "93919294221991210322351110012010000002111101010111111211"
+#define AMMOLINE_DEFAULT_PROB   "04050405416006555465544647765766666661555101011154111211"
+#define AMMOLINE_DEFAULT_DELAY  "00000000000002055000000400070040000000002200000006000200"
+#define AMMOLINE_DEFAULT_CRATE  "13111103121111111231141111111111111112111111011111111211"
 
-#define AMMOLINE_CRAZY_QT       "9999999999999999992999999999999999299999999909999992999"
-#define AMMOLINE_CRAZY_PROB     "1111110111111111111111111111111111111111111101111111111"
-#define AMMOLINE_CRAZY_DELAY    "0000000000000000000000000000000000000000000000000000000"
-#define AMMOLINE_CRAZY_CRATE    "1311110312111111123114111111111111111211110101111111121"
+#define AMMOLINE_CRAZY_QT       "99999999999999999929999999999999992999999999099999929999"
+#define AMMOLINE_CRAZY_PROB     "11111101111111111111111111111111111111111111011111111111"
+#define AMMOLINE_CRAZY_DELAY    "00000000000000000000000000000000000000000000000000000000"
+#define AMMOLINE_CRAZY_CRATE    "13111103121111111231141111111111111112111101011111111211"
 
-#define AMMOLINE_PROMODE_QT     "9090009000000000000009000000000000000000000000000000000"
-#define AMMOLINE_PROMODE_PROB   "0000000000000000000000000000000000000000000000000000000"
-#define AMMOLINE_PROMODE_DELAY  "0000000000000205500000040007004000000000200000000000020"
-#define AMMOLINE_PROMODE_CRATE  "1111110111111111111111111111111111111111100101111111121"
+#define AMMOLINE_PROMODE_QT     "90900090000000000000090000000000000000000000000000000000"
+#define AMMOLINE_PROMODE_PROB   "00000000000000000000000000000000000000000000000000000000"
+#define AMMOLINE_PROMODE_DELAY  "00000000000002055000000400070040000000002000000000000200"
+#define AMMOLINE_PROMODE_CRATE  "11111101111111111111111111111111111111111001011111111211"
 
-#define AMMOLINE_SHOPPA_QT      "0000009900000000000000000000000000000000000000000000000"
-#define AMMOLINE_SHOPPA_PROB    "4444410044244402210112121222422000000002000400010011001"
-#define AMMOLINE_SHOPPA_DELAY   "0000000000000000000000000000000000000000000000000000000"
-#define AMMOLINE_SHOPPA_CRATE   "1111110111111111111111111111111111111111101101111111121"
+#define AMMOLINE_SHOPPA_QT      "00000099000000000000000000000000000000000000000000000000"
+#define AMMOLINE_SHOPPA_PROB    "44444100442444022101121212224220000000020004000100110010"
+#define AMMOLINE_SHOPPA_DELAY   "00000000000000000000000000000000000000000000000000000000"
+#define AMMOLINE_SHOPPA_CRATE   "11111101111111111111111111111111111111111011011111111210"
 
-#define AMMOLINE_CLEAN_QT       "1010009000010000011000000000000000000000000000001000000"
-#define AMMOLINE_CLEAN_PROB     "0405040541600655546554464776576666666155510101115411121"
-#define AMMOLINE_CLEAN_DELAY    "0000000000000000000000000000000000000000000000000000020"
-#define AMMOLINE_CLEAN_CRATE    "1311110312111111123114111111111111111211111101111111121"
+#define AMMOLINE_CLEAN_QT       "10100090000100000110000000000000000000000000000010000000"
+#define AMMOLINE_CLEAN_PROB     "04050405416006555465544647765766666661555101011154111211"
+#define AMMOLINE_CLEAN_DELAY    "00000000000000000000000000000000000000000000000000000200"
+#define AMMOLINE_CLEAN_CRATE    "13111103121111111231141111111111111112111111011111111211"
 
-#define AMMOLINE_MINES_QT       "0000009900090000000300000000000000000000000000000000000"
-#define AMMOLINE_MINES_PROB     "0000000000000000000000000000000000000000000000000000000"
-#define AMMOLINE_MINES_DELAY    "0000000000000205500000040007004000000000200000000600020"
-#define AMMOLINE_MINES_CRATE    "1111110111111111111111111111111111111111111101111111121"
+#define AMMOLINE_MINES_QT       "00000099000900000003000000000000000000000000000000000000"
+#define AMMOLINE_MINES_PROB     "00000000000000000000000000000000000000000000000000000000"
+#define AMMOLINE_MINES_DELAY    "00000000000002055000000400070040000000002000000006000200"
+#define AMMOLINE_MINES_CRATE    "11111101111111111111111111111111111111111111011111111211"
 
-#define AMMOLINE_PORTALS_QT     "9000009002000000002100000000000000110000090000000000000"
-#define AMMOLINE_PORTALS_PROB   "0405040541600655546554464776576666666155510101115411121"
-#define AMMOLINE_PORTALS_DELAY  "0000000000000205500000040007004000000000200000000600020"
-#define AMMOLINE_PORTALS_CRATE  "1311110312111111123114111111111111111211111101111111121"
+#define AMMOLINE_PORTALS_QT     "90000090020000000021000000000000001100000900000000000000"
+#define AMMOLINE_PORTALS_PROB   "04050405416006555465544647765766666661555101011154111211"
+#define AMMOLINE_PORTALS_DELAY  "00000000000002055000000400070040000000002000000006000200"
+#define AMMOLINE_PORTALS_CRATE  "13111103121111111231141111111111111112111111011111111211"
 
-#define AMMOLINE_ONEEVERY_QT    "1111119111111111111111111111111111111111111111111111111"
-#define AMMOLINE_ONEEVERY_PROB  "1111110111111111111111111111111111111111111111111111111"
-#define AMMOLINE_ONEEVERY_DELAY "0000000000000000000000000000000000000000000000000000000"
-#define AMMOLINE_ONEEVERY_CRATE "1111110111111111111111111111111111111111111111111111111"
+#define AMMOLINE_ONEEVERY_QT    "11111191111111111111111111111111111111111111111111111111"
+#define AMMOLINE_ONEEVERY_PROB  "11111101111111111111111111111111111111111111111111111111"
+#define AMMOLINE_ONEEVERY_DELAY "00000000000000000000000000000000000000000000000000000000"
+#define AMMOLINE_ONEEVERY_CRATE "11111101111111111111111111111111111111111111111111111111"
 
 //When adding new weapons also insert one element in cDefaultAmmos list (hwconsts.cpp.in)
 
--- a/hedgewars/uAIAmmoTests.pas	Sun Dec 08 13:49:11 2013 -0500
+++ b/hedgewars/uAIAmmoTests.pas	Sun Dec 08 16:04:40 2013 -0500
@@ -121,7 +121,8 @@
             //(proc: nil;              flags: 0), // amStructure
             (proc: nil;              flags: 0), // amLandGun
             (proc: nil;              flags: 0), // amIceGun
-            (proc: nil;              flags: 0)  // amKnife
+            (proc: nil;              flags: 0), // amKnife
+            (proc: nil;              flags: 0)  // amGirder
             );
 
 implementation
--- a/hedgewars/uGears.pas	Sun Dec 08 13:49:11 2013 -0500
+++ b/hedgewars/uGears.pas	Sun Dec 08 16:04:40 2013 -0500
@@ -624,7 +624,7 @@
 snowRight:= max(LAND_WIDTH,4096)+512;
 snowLeft:= -(snowRight-LAND_WIDTH);
 
-if (not hasBorder) and ((Theme = 'Snow') or (Theme = 'Christmas')) then
+if (not hasBorder) and cSnow then
     for i:= vobCount * Longword(max(LAND_WIDTH,4096)) div 2048 downto 1 do
         AddGear(LongInt(GetRandom(snowRight - snowLeft)) + snowLeft, LAND_HEIGHT + LongInt(GetRandom(750)) - 1300, gtFlake, 0, _0, _0, 0);
 end;
--- a/hedgewars/uGearsHandlersMess.pas	Sun Dec 08 13:49:11 2013 -0500
+++ b/hedgewars/uGearsHandlersMess.pas	Sun Dec 08 16:04:40 2013 -0500
@@ -437,7 +437,7 @@
     if ((xland or land) and lfBouncy <> 0) and
         (((Gear^.Radius < 3) and (Gear^.dY < -_0_1)) or
             ((Gear^.Radius >= 3) and
-                ((Gear^.dX.QWordValue > _0_1.QWordValue) or (Gear^.dY.QWordValue > _0_1.QWordValue)))) then
+                ((Gear^.dX.QWordValue > _0_15.QWordValue) or (Gear^.dY.QWordValue > _0_15.QWordValue)))) then
         PlaySound(sndMelonImpact, true)
     else if (Gear^.nImpactSounds > 0) and
         (Gear^.State and gstCollision <> 0) and
@@ -2470,6 +2470,7 @@
     HHGear: PGear;
     x, y, tx, ty: hwFloat;
     rx: LongInt;
+    LandFlags: Word;
 begin
     AllInactive := false;
 
@@ -2480,12 +2481,16 @@
     y := HHGear^.Y;
     rx:= hwRound(x);
 
+    LandFlags:= 0;
+    if cIce then LandFlags:= lfIce
+    else if Gear^.AmmoType = amRubber then LandFlags:= lfBouncy;
+
     if ((Distance(tx - x, ty - y) > _256) and ((WorldEdge <> weWrap) or 
             (
             (Distance(tx - int2hwFloat(rightX+(rx-leftX)), ty - y) > _256) and
             (Distance(tx - int2hwFloat(leftX-(rightX-rx)), ty - y) > _256)
             )))
-    or (not TryPlaceOnLand(Gear^.Target.X - SpritesData[sprAmGirder].Width div 2, Gear^.Target.Y - SpritesData[sprAmGirder].Height div 2, sprAmGirder, Gear^.State, true, false)) then
+    or (not TryPlaceOnLand(Gear^.Target.X - SpritesData[Ammoz[Gear^.AmmoType].PosSprite].Width div 2, Gear^.Target.Y - SpritesData[Ammoz[Gear^.AmmoType].PosSprite].Height div 2, Ammoz[Gear^.AmmoType].PosSprite, Gear^.State, true, false, LandFlags)) then
         begin
         PlaySound(sndDenied);
         HHGear^.Message := HHGear^.Message and (not gmAttack);
--- a/hedgewars/uGearsHedgehog.pas	Sun Dec 08 13:49:11 2013 -0500
+++ b/hedgewars/uGearsHedgehog.pas	Sun Dec 08 16:04:40 2013 -0500
@@ -353,6 +353,10 @@
                        amNapalm: newGear:= AddGear(CurWeapon^.Pos, 0, gtAirAttack, 2, _0, _0, 0);
                     amBlowTorch: newGear:= AddGear(hwRound(lx), hwRound(ly), gtBlowTorch, 0, SignAs(_0_5, dX), _0, 0);
                        amGirder: newGear:= AddGear(0, 0, gtGirder, CurWeapon^.Pos, _0, _0, 0);
+                       amRubber: begin
+                                 newGear:= AddGear(0, 0, gtGirder, CurWeapon^.Pos, _0, _0, 0);
+                                 newGear^.AmmoType:= amRubber
+                                 end;
                      amTeleport: newGear:= AddGear(CurWeapon^.Pos, 0, gtTeleport, 0, _0, _0, 0);
                        amSwitch: newGear:= AddGear(hwRound(lx), hwRound(ly), gtSwitcher, 0, _0, _0, 0);
                        amMortar: begin
--- a/hedgewars/uGearsRender.pas	Sun Dec 08 13:49:11 2013 -0500
+++ b/hedgewars/uGearsRender.pas	Sun Dec 08 16:04:40 2013 -0500
@@ -673,6 +673,7 @@
                     DrawSpriteRotated(sprHandPlane, hx, hy, sign, 0);
                     defaultPos:= false
                     end;
+                amRubber,
                 amGirder: begin
                     DrawSpriteRotated(sprHandConstruction, hx, hy, sign, aangle);
                     if WorldEdge = weWrap then
--- a/hedgewars/uLandGraphics.pas	Sun Dec 08 13:49:11 2013 -0500
+++ b/hedgewars/uLandGraphics.pas	Sun Dec 08 16:04:40 2013 -0500
@@ -47,7 +47,8 @@
 procedure DrawThickLine(X1, Y1, X2, Y2, radius: LongInt; color: Longword);
 procedure DumpLandToLog(x, y, r: LongInt);
 procedure DrawIceBreak(x, y, iceRadius, iceHeight: Longint);
-function TryPlaceOnLand(cpX, cpY: LongInt; Obj: TSprite; Frame: LongInt; doPlace: boolean; indestructible: boolean): boolean;
+function TryPlaceOnLand(cpX, cpY: LongInt; Obj: TSprite; Frame: LongInt; doPlace, indestructible: boolean): boolean; inline;
+function TryPlaceOnLand(cpX, cpY: LongInt; Obj: TSprite; Frame: LongInt; doPlace, indestructible: boolean; LandFlags: Word): boolean;
 
 implementation
 uses SDLh, uLandTexture, uVariables, uUtils, uDebug;
@@ -585,7 +586,12 @@
 UpdateLandTexture(tx, ddx, ty, ddy, false)
 end;
 
-function TryPlaceOnLand(cpX, cpY: LongInt; Obj: TSprite; Frame: LongInt; doPlace: boolean; indestructible: boolean): boolean;
+function TryPlaceOnLand(cpX, cpY: LongInt; Obj: TSprite; Frame: LongInt; doPlace, indestructible: boolean): boolean; inline;
+begin
+TryPlaceOnLand:= TryPlaceOnLand(cpX, cpY, Obj, Frame, doPlace, indestructible, 0);
+end;
+
+function TryPlaceOnLand(cpX, cpY: LongInt; Obj: TSprite; Frame: LongInt; doPlace, indestructible: boolean; LandFlags: Word): boolean;
 var X, Y, bpp, h, w, row, col, gx, gy, numFramesFirstCol: LongInt;
     p: PByteArray;
     Image: PSDL_Surface;
@@ -650,15 +656,12 @@
                      gY:= (cpY + y) div 2;
                     end;
                 if indestructible then
-                    Land[cpY + y, cpX + x]:= lfIndestructible
+                    Land[cpY + y, cpX + x]:= lfIndestructible or LandFlags
                 else if (LandPixels[gY, gX] and AMask) shr AShift = 255 then  // This test assumes lfBasic and lfObject differ only graphically
-                    Land[cpY + y, cpX + x]:= lfBasic
+                    Land[cpY + y, cpX + x]:= lfBasic or LandFlags
                 else
-                    Land[cpY + y, cpX + x]:= lfObject;
-                // For testing only. Intent is to flag this on objects with masks, or use it for an ice ray gun
-                if (Theme = 'Snow') or (Theme = 'Christmas') then
-                    Land[cpY + y, cpX + x]:= Land[cpY + y, cpX + x] or lfIce;
-                    LandPixels[gY, gX]:= PLongword(@(p^[x * 4]))^
+                    Land[cpY + y, cpX + x]:= lfObject or LandFlags;
+                LandPixels[gY, gX]:= PLongword(@(p^[x * 4]))^
                 end;
         p:= @(p^[Image^.pitch]);
         end;
--- a/hedgewars/uLandObjects.pas	Sun Dec 08 13:49:11 2013 -0500
+++ b/hedgewars/uLandObjects.pas	Sun Dec 08 16:04:40 2013 -0500
@@ -26,7 +26,7 @@
 procedure FreeLandObjects();
 procedure LoadThemeConfig;
 procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface); inline;
-procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface; extraFlags: Word);
+procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface; LandFlags: Word);
 procedure BlitImageUsingMask(cpX, cpY: Longword;  Image, Mask: PSDL_Surface);
 procedure AddOnLandObjects(Surface: PSDL_Surface);
 procedure SetLand(var LandWord: Word; Pixel: LongWord); inline;
@@ -95,7 +95,7 @@
     BlitImageAndGenerateCollisionInfo(cpX, cpY, Width, Image, 0);
 end;
     
-procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface; extraFlags: Word);
+procedure BlitImageAndGenerateCollisionInfo(cpX, cpY, Width: Longword; Image: PSDL_Surface; LandFlags: Word);
 var p: PLongwordArray;
     x, y: Longword;
     bpp: LongInt;
@@ -128,7 +128,7 @@
                     LandPixels[(cpY + y) div 2, (cpX + x) div 2]:= p^[x];
 
             if (Land[cpY + y, cpX + x] <= lfAllObjMask) and ((p^[x] and AMask) <> 0) then
-                Land[cpY + y, cpX + x]:= lfObject or extraFlags
+                Land[cpY + y, cpX + x]:= lfObject or LandFlags
             end;
     p:= @(p^[Image^.pitch shr 2])
     end;
@@ -277,8 +277,7 @@
     rr.x:= x1;
     while rr.x < x2 do
         begin
-        // I should theme flag this. also snow...
-        if (Theme = 'Snow') or (Theme = 'Christmas') then 
+        if cIce then 
             BlitImageAndGenerateCollisionInfo(rr.x, y, min(x2 - rr.x, tmpsurf^.w), tmpsurf, lfIce)
         else
             BlitImageAndGenerateCollisionInfo(rr.x, y, min(x2 - rr.x, tmpsurf^.w), tmpsurf);
@@ -706,6 +705,10 @@
         cFlattenFlakes:= true
     else if key = 'flatten-clouds' then
         cFlattenClouds:= true
+    else if key = 'ice' then
+        cIce:= true
+    else if key = 'snow' then
+        cSnow:= true
     else if key = 'sd-water-top' then
         begin
         i:= Pos(',', s);
--- a/hedgewars/uStore.pas	Sun Dec 08 13:49:11 2013 -0500
+++ b/hedgewars/uStore.pas	Sun Dec 08 16:04:40 2013 -0500
@@ -330,7 +330,7 @@
         if (((cReducedQuality and (rqNoBackground or rqLowRes)) = 0) or   // why rqLowRes?
                 (not (ii in [sprSky, sprSkyL, sprSkyR, sprHorizont, sprHorizontL, sprHorizontR]))) and
            (((cReducedQuality and rqPlainSplash) = 0) or ((not (ii in [sprSplash, sprDroplet, sprSDSplash, sprSDDroplet])))) and
-           (((cReducedQuality and rqKillFlakes) = 0) or (Theme = 'Snow') or (Theme = 'Christmas') or ((not (ii in [sprFlake, sprSDFlake])))) and
+           (((cReducedQuality and rqKillFlakes) = 0) or cSnow or ((not (ii in [sprFlake, sprSDFlake])))) and
            ((cCloudsNumber > 0) or (ii <> sprCloud)) and
            ((vobCount > 0) or (ii <> sprFlake)) then
             begin
--- a/hedgewars/uTypes.pas	Sun Dec 08 13:49:11 2013 -0500
+++ b/hedgewars/uTypes.pas	Sun Dec 08 16:04:40 2013 -0500
@@ -86,7 +86,7 @@
             sprHandResurrector, sprCross, sprAirDrill, sprNapalmBomb,
             sprBulletHit, sprSnowball, sprHandSnowball, sprSnow,
             sprSDFlake, sprSDWater, sprSDCloud, sprSDSplash, sprSDDroplet, sprTardis,
-            sprSlider, sprBotlevels, sprHandKnife, sprKnife, sprStar, sprIceTexture, sprIceGun, sprFrozenHog
+            sprSlider, sprBotlevels, sprHandKnife, sprKnife, sprStar, sprIceTexture, sprIceGun, sprFrozenHog, sprAmRubber
             );
 
     // Gears that interact with other Gears and/or Land
@@ -152,7 +152,7 @@
             amRCPlane, amLowGravity, amExtraDamage, amInvulnerable, amExtraTime, // 35
             amLaserSight, amVampiric, amSniperRifle, amJetpack, amMolotov, amBirdy, amPortalGun, // 42
             amPiano, amGasBomb, amSineGun, amFlamethrower, amSMine, amHammer, // 48
-            amResurrector, amDrillStrike, amSnowball, amTardis, {amStructure,} amLandGun, amIceGun, amKnife); // 54
+            amResurrector, amDrillStrike, amSnowball, amTardis, {amStructure,} amLandGun, amIceGun, amKnife, amRubber); // 56
 
     // Different kind of crates that e.g. hedgehogs can pick up
     TCrateType = (HealthCrate, AmmoCrate, UtilityCrate);
@@ -433,7 +433,7 @@
             sidMolotov, sidBirdy, sidPortalGun, sidPiano, sidGasBomb,
             sidSineGun, sidFlamethrower,sidSMine, sidHammer, sidResurrector,
             sidDrillStrike, sidSnowball, sidNothing, sidTardis,
-            {sidStructure,} sidLandGun, sidIceGun, sidKnife);
+            {sidStructure,} sidLandGun, sidIceGun, sidKnife, sidRubber);
 
     TMsgStrId = (sidStartFight, sidDraw, sidWinner, sidVolume, sidPaused,
             sidConfirm, sidSuddenDeath, sidRemaining, sidFuel, sidSync,
--- a/hedgewars/uVariables.pas	Sun Dec 08 13:49:11 2013 -0500
+++ b/hedgewars/uVariables.pas	Sun Dec 08 16:04:40 2013 -0500
@@ -46,6 +46,9 @@
     cShowFPS           : boolean;
     cFlattenFlakes     : boolean;
     cFlattenClouds     : boolean;
+    cIce               : boolean;
+    cSnow              : boolean;
+
     cAltDamage         : boolean;
     cReducedQuality    : LongWord;
     UserNick           : shortstring;
@@ -679,7 +682,9 @@
             (FileName:  'amIceGun'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
             Width: 32; Height: 32; imageWidth: 32; imageHeight: 32; saveSurf: false; priority: tpLow; getDimensions: false; getImageDimensions: false), // sprIceGun
             (FileName:  'amFrozenHog'; Path: ptHedgehog; AltPath: ptNone; Texture: nil; Surface: nil;
-            Width: 64; Height: 64; imageWidth: 64; imageHeight: 64; saveSurf: false; priority: tpLow; getDimensions: false; getImageDimensions: false) // sprFrozenHog
+            Width: 64; Height: 64; imageWidth: 64; imageHeight: 64; saveSurf: false; priority: tpLow; getDimensions: false; getImageDimensions: false), // sprFrozenHog
+            (FileName:   'amRubber'; Path: ptCurrTheme; AltPath: ptGraphics; Texture: nil; Surface: nil;
+            Width: 160; Height:160; imageWidth: 0; imageHeight: 0; saveSurf:  true; priority: tpMedium; getDimensions: false; getImageDimensions: true) // sprAmRubber
             );
 
 const
@@ -1872,7 +1877,7 @@
                 AmmoType: amPortalGun;
                 AttackVoice: sndNone;
                 Bounciness: 1000);
-            Slot: 6;
+            Slot: 7;
             TimeAfterTurn: 0;
             minAngle: 0;
             maxAngle: 0;
@@ -2137,7 +2142,7 @@
                 AmmoType: amTardis;
                 AttackVoice: sndNone;
                 Bounciness: 1000);
-            Slot: 7;
+            Slot: 8;
             TimeAfterTurn: 0;
             minAngle: 0;
             maxAngle: 0;
@@ -2250,6 +2255,33 @@
             PosCount: 1;
             PosSprite: sprWater;
             ejectX: 0;
+            ejectY: 0),
+// Rubber
+            (NameId: sidRubber;
+            NameTex: nil;
+            Probability: 150;
+            NumberInCase: 1;
+            Ammo: (Propz: ammoprop_NoRoundEnd or
+                          ammoprop_NoCrosshair or
+                          ammoprop_NeedTarget or
+                          ammoprop_Utility or
+                          ammoprop_AttackingPut;
+                    Count: 1;
+                    NumPerTurn: 0;
+                    Timer: 0;
+                    Pos: 0;
+                    AmmoType: amRubber;
+                    AttackVoice: sndNone;
+                Bounciness: 1000);
+            Slot: 6;
+            TimeAfterTurn: 3000;
+            minAngle: 0;
+            maxAngle: 0;
+            isDamaging: false;
+            SkipTurns: 0;
+            PosCount: 4;
+            PosSprite: sprAmRubber;
+            ejectX: 0;
             ejectY: 0)
         );
 
@@ -2388,6 +2420,8 @@
 
     cFlattenFlakes      := false;
     cFlattenClouds      := false;
+    cIce                := false;
+    cSnow               := false;
     lastVisualGearByUID := nil;
     lastGearByUID       := nil;
     cReadyDelay         := 5000;
--- a/hedgewars/uVisualGears.pas	Sun Dec 08 13:49:11 2013 -0500
+++ b/hedgewars/uVisualGears.pas	Sun Dec 08 16:04:40 2013 -0500
@@ -487,7 +487,7 @@
 if (cReducedQuality and rqKillFlakes) <> 0 then
     exit;
 
-if hasBorder or ((Theme <> 'Snow') and (Theme <> 'Christmas')) then
+if hasBorder or (not cSnow) then
     for i:= 0 to Pred(vobCount * cScreenSpace div 4096) do
         AddVisualGear(cLeftScreenBorder + random(cScreenSpace), random(1024+200) - 100 + LAND_HEIGHT, vgtFlake)
 else
@@ -515,7 +515,7 @@
         end
         else vg:= vg^.NextGear;
     end;
-if ((GameFlags and gfBorder) <> 0) or ((Theme <> 'Snow') and (Theme <> 'Christmas')) then
+if hasBorder or (not cSnow) then
     for i:= 0 to Pred(vobSDCount * cScreenSpace div 4096) do
         AddVisualGear(cLeftScreenBorder + random(cScreenSpace), random(1024+200) - 100 + LAND_HEIGHT, vgtFlake)
 else
Binary file share/hedgewars/Data/Graphics/AmmoMenu/Ammos.png has changed
Binary file share/hedgewars/Data/Graphics/AmmoMenu/Ammos_bw.png has changed
Binary file share/hedgewars/Data/Graphics/amRubber.png has changed
--- a/share/hedgewars/Data/Locale/en.txt	Sun Dec 08 13:49:11 2013 -0500
+++ b/share/hedgewars/Data/Locale/en.txt	Sun Dec 08 16:04:40 2013 -0500
@@ -58,6 +58,7 @@
 00:54=Land Spray
 00:55=Freezer
 00:56=Cleaver
+00:57=Rubber
 
 01:00=Let's fight!
 01:01=Round draw
--- a/share/hedgewars/Data/Themes/Christmas/theme.cfg	Sun Dec 08 13:49:11 2013 -0500
+++ b/share/hedgewars/Data/Themes/Christmas/theme.cfg	Sun Dec 08 16:04:40 2013 -0500
@@ -14,3 +14,5 @@
 spray = holly, 4
 spray = holly2, 4
 flakes = 100, 3, 99999999, 100, 300
+ice = yes
+snow = yes
--- a/share/hedgewars/Data/Themes/Snow/theme.cfg	Sun Dec 08 13:49:11 2013 -0500
+++ b/share/hedgewars/Data/Themes/Snow/theme.cfg	Sun Dec 08 16:04:40 2013 -0500
@@ -10,3 +10,5 @@
 object = plant3, 3, 26, 0, 48, 1, 1, 25, 15, 50, 60
 object = plant4, 3, 45, 4, 1, 45, 1, 20, 45, 20, 60
 flakes = 100, 3, 99999999, 100, 300
+ice = yes
+snow = yes