# HG changeset patch # User smaxx # Date 1280788596 -7200 # Node ID de20260318339a940c7ad94c28304f46e25f4582 # Parent de3b3df215c37e663a6bd62524883a42410c91ad Engine: * Added a poison cloud effect to Limburger's explosion diff -r de3b3df215c3 -r de2026031833 hedgewars/GSHandlers.inc --- a/hedgewars/GSHandlers.inc Mon Aug 02 23:15:34 2010 +0200 +++ b/hedgewars/GSHandlers.inc Tue Aug 03 00:36:36 2010 +0200 @@ -401,7 +401,12 @@ if i mod 2 <> 0 then Fire^.State := Fire^.State or gsttmpFlag; end end; - gtGasBomb: doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, EXPLAutoSound or EXPLPoisoned); + gtGasBomb: + begin + doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 20, EXPLAutoSound); + for i:= 0 to 2 do + AddGear(hwRound(Gear^.X) - 30 + GetRandom(60), hwRound(Gear^.Y) - 20 + GetRandom(40), gtPoisonCloud, 0, _0, _0, 0); + end; end; DeleteGear(Gear); exit @@ -3864,4 +3869,19 @@ Gear^.doStep := @doStepFlamethrowerWork end; - +procedure doStepPoisonCloud(Gear: PGear); +begin + if Gear^.Timer = 0 then + begin + DeleteGear(Gear); + exit + end; + dec(Gear^.Timer); + Gear^.X:= Gear^.X + Gear^.dX; + Gear^.Y:= Gear^.Y + Gear^.dY; + Gear^.dX := Gear^.dX + cWindSpeed / 2; + Gear^.dY := Gear^.dY + cGravity / 100; + if (GameTicks mod 250) = 0 then + doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 30, EXPLDontDraw or EXPLNoGfx or EXPLNoDamage or EXPLDoNotTouchAny or EXPLPoisoned); + AllInactive:= false; +end; \ No newline at end of file diff -r de3b3df215c3 -r de2026031833 hedgewars/GearDrawing.inc --- a/hedgewars/GearDrawing.inc Mon Aug 02 23:15:34 2010 +0200 +++ b/hedgewars/GearDrawing.inc Tue Aug 03 00:36:36 2010 +0200 @@ -800,6 +800,17 @@ end; DrawRotatedTextureF(SpritesData[sprPiano].Texture, 1, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 128, 128, 0); end; + gtPoisonCloud: begin + Tint($00, $FF, $40, $80); + if Gear^.Timer < 1000 then + i:= Gear^.Timer + else if Gear^.Timer > 4000 then + i:= 5000 - Gear^.Timer + else + i:= 1000; + DrawRotatedTextureF(SpritesData[sprSmokeWhite].texture, i / 250, 0, 0, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, 1, 22, 22, (RealTicks shr 36 + Gear^.UID * 100) mod 360); + Tint($FF, $FF, $FF, $FF) + end; end; if Gear^.RenderTimer and (Gear^.Tex <> nil) then DrawCentered(hwRound(Gear^.X) + 8 + WorldDx, hwRound(Gear^.Y) + 8 + WorldDy, Gear^.Tex); Gear:= Gear^.NextGear diff -r de3b3df215c3 -r de2026031833 hedgewars/uConsts.pas --- a/hedgewars/uConsts.pas Mon Aug 02 23:15:34 2010 +0200 +++ b/hedgewars/uConsts.pas Tue Aug 03 00:36:36 2010 +0200 @@ -88,7 +88,7 @@ gtHellishBomb, gtWaterUp, gtDrill, gtBallGun, gtBall, gtRCPlane, // 40 gtSniperRifleShot, gtJetpack, gtMolotov, gtExplosives, gtBirdy, // 45 gtEgg, gtPortal, gtPiano, gtGasBomb, gtSineGunShot, gtFlamethrower, // 51 - gtSMine); + gtSMine, gtPoisonCloud); // Gears that are _only_ of visual nature (e.g. background stuff, visual effects, speechbubbles, etc.) TVisualGearType = (vgtFlake, vgtCloud, vgtExplPart, vgtExplPart2, vgtFire, @@ -414,6 +414,7 @@ EXPLDontDraw = $00000010; EXPLNoGfx = $00000020; EXPLPoisoned = $00000040; + EXPLDoNotTouchAny = $00000080; posCaseAmmo = $00000001; posCaseHealth = $00000002; diff -r de3b3df215c3 -r de2026031833 hedgewars/uGears.pas --- a/hedgewars/uGears.pas Mon Aug 02 23:15:34 2010 +0200 +++ b/hedgewars/uGears.pas Tue Aug 03 00:36:36 2010 +0200 @@ -202,7 +202,8 @@ @doStepBomb, @doStepSineGunShot, @doStepFlamethrower, - @doStepSMine + @doStepSMine, + @doStepPoisonCloud ); procedure InsertGearToList(Gear: PGear); @@ -517,6 +518,9 @@ gear^.Timer:= 10; gear^.Health:= 500; end; + gtPoisonCloud: begin + gear^.Timer:= 5000; + end; end; InsertGearToList(gear); AddGear:= gear; @@ -1239,7 +1243,7 @@ else Gear^.State:= Gear^.State or gstWinner; end; - if ((Mask and EXPLDoNotTouchHH) = 0) or (Gear^.Kind <> gtHedgehog) then + if ((Mask and EXPLDoNotTouchAny) = 0) and (((Mask and EXPLDoNotTouchHH) = 0) or (Gear^.Kind <> gtHedgehog)) then begin DeleteCI(Gear); Gear^.dX:= Gear^.dX + SignAs(_0_005 * dmg + cHHKick, Gear^.X - fX);