--- a/hedgewars/GSHandlers.inc Sat Nov 13 20:42:26 2010 +0300
+++ b/hedgewars/GSHandlers.inc Sat Nov 13 23:03:17 2010 +0300
@@ -2076,8 +2076,8 @@
////////////////////////////////////////////////////////////////////////////////
procedure doStepAirAttackWork(Gear: PGear);
-var
- i: Longint;
+//var
+// i: Longint;
begin
AllInactive := false;
Gear^.X := Gear^.X + cAirPlaneSpeed * Gear^.Tag;
@@ -2090,9 +2090,11 @@
Gear^.Tag, _0, 0);
1: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtMine, 0, cBombsSpeed *
Gear^.Tag, _0, 0);
- 2: for i:= -19 to 19 do
- FollowGear := AddGear(hwRound(Gear^.X) + i div 3, hwRound(Gear^.Y), gtFlame, 0,
- _0_001 * i, _0, 0);
+ 2: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtNapalmBomb, 0, cBombsSpeed *
+ Gear^.Tag, _0, 0);
+ //2: for i:= -19 to 19 do
+ // FollowGear := AddGear(hwRound(Gear^.X) + i div 3, hwRound(Gear^.Y), gtFlame, 0,
+ // _0_001 * i, _0, 0);
3: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtDrill, gsttmpFlag, cBombsSpeed *
Gear^.Tag, _0, 0);
//4: FollowGear := AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtWaterMelon, 0, cBombsSpeed *
@@ -2125,7 +2127,7 @@
Gear^.Y := int2hwFloat(topY-300);
Gear^.dX := int2hwFloat(TargetPoint.X - 5 * Gear^.Tag * 15);
- if (int2hwFloat(TargetPoint.Y) - Gear^.Y > _0) and (Gear^.State <> 2) then
+ if (int2hwFloat(TargetPoint.Y) - Gear^.Y > _0) then //and (Gear^.State <> 2) then
Gear^.dX := Gear^.dX - cBombsSpeed * hwSqrt((int2hwFloat(TargetPoint.Y) - Gear^.Y) * 2 /
cGravity) * Gear^.Tag;
@@ -4361,4 +4363,42 @@
end;
////////////////////////////////////////////////////////////////////////////////
-
+procedure doStepNapalmBomb(Gear: PGear);
+var
+ i, gX, gY: LongInt;
+ dX, dY: hwFloat;
+begin
+ AllInactive := false;
+ doStepFallingGear(Gear);
+ if (Gear^.Timer > 0) and ((Gear^.State and gstCollision) <> 0) then
+ begin
+ doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 10, EXPLAutoSound);
+ gX := hwRound(Gear^.X);
+ gY := hwRound(Gear^.Y);
+ for i:= 0 to 10 do
+ begin
+ dX := AngleCos(i * 2) * ((_0_1*(i div 5))) * (GetRandom + _1);
+ dY := AngleSin(i * 8) * _0_5 * (GetRandom + _1);
+ AddGear(gX, gY, gtFlame, 0, dX, dY, 0);
+ AddGear(gX, gY, gtFlame, 0, dX, -dY, 0);
+ AddGear(gX, gY, gtFlame, 0, -dX, dY, 0);
+ AddGear(gX, gY, gtFlame, 0, -dX, -dY, 0);
+ end;
+ DeleteGear(Gear);
+ exit
+ end;
+ if (Gear^.Timer = 0) then
+ begin
+ doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 10, EXPLAutoSound);
+ for i:= -19 to 19 do
+ FollowGear := AddGear(hwRound(Gear^.X) + i div 3, hwRound(Gear^.Y), gtFlame, 0, _0_001 * i, _0, 0);
+ DeleteGear(Gear);
+ exit
+ end;
+ if (GameTicks and $3F) = 0 then
+ AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtSmokeTrace);
+ dec(Gear^.Timer)
+end;
+
+////////////////////////////////////////////////////////////////////////////////
+
--- a/hedgewars/GearDrawing.inc Sat Nov 13 20:42:26 2010 +0300
+++ b/hedgewars/GearDrawing.inc Sat Nov 13 23:03:17 2010 +0300
@@ -716,9 +716,7 @@
Tint($FF, $FF, $FF, $FF)
end
end;
-
gtBee: DrawRotatedF(sprBee, x, y, (GameTicks shr 5) mod 2, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
-
gtPickHammer: DrawSprite(sprPHammer, x - 16, y - 50 + LongInt(((GameTicks shr 5) and 1) * 2), 0);
gtRope: DrawRope(Gear);
gtMine: if (((Gear^.State and gstAttacking) = 0)or((Gear^.Timer and $3FF) < 420)) and (Gear^.Health <> 0) then
@@ -848,6 +846,7 @@
DrawTexture(x - 108, y - 108, SpritesData[sprVampiric].Texture, 4.5);
Tint($FF, $FF, $FF, $FF);
end;
+ gtNapalmBomb: DrawRotated(sprNapalmBomb, x, y, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
end;
if Gear^.RenderTimer and (Gear^.Tex <> nil) then DrawCentered(x + 8, y + 8, Gear^.Tex);
Gear:= Gear^.NextGear
--- a/hedgewars/uConsts.pas Sat Nov 13 20:42:26 2010 +0300
+++ b/hedgewars/uConsts.pas Sat Nov 13 23:03:17 2010 +0300
@@ -75,7 +75,7 @@
sprFeather, sprPiano, sprHandSineGun, sprPortalGun, sprPortal,
sprCheese, sprHandCheese, sprHandFlamethrower, sprChunk, sprNote,
sprSMineOff, sprSMineOn, sprHandSMine, sprHammer,
- sprHandResurrector, sprCross, sprAirDrill
+ sprHandResurrector, sprCross, sprAirDrill, sprNapalmBomb
);
// Gears that interact with other Gears and/or Land
@@ -89,7 +89,8 @@
gtHellishBomb, gtWaterUp, gtDrill, gtBallGun, gtBall, gtRCPlane, // 40
gtSniperRifleShot, gtJetpack, gtMolotov, gtExplosives, gtBirdy, // 45
gtEgg, gtPortal, gtPiano, gtGasBomb, gtSineGunShot, gtFlamethrower, // 51
- gtSMine, gtPoisonCloud, gtHammer, gtHammerHit, gtResurrector); // 56
+ gtSMine, gtPoisonCloud, gtHammer, gtHammerHit, gtResurrector, // 56
+ gtNapalmBomb); // 57
// Gears that are _only_ of visual nature (e.g. background stuff, visual effects, speechbubbles, etc.)
TVisualGearType = (vgtFlake, vgtCloud, vgtExplPart, vgtExplPart2, vgtFire,
@@ -830,8 +831,13 @@
(FileName: 'AirDrill'; Path: ptGraphics; AltPath: ptNone;
Texture: nil; Surface: nil; Width: 16; Height: 16;
imageWidth: 0; imageHeight: 0; saveSurf: false; priority:
+ tpMedium; getDimensions: false; getImageDimensions: true),
+ // sprAirDrill
+ (FileName: 'NapalmBomb'; Path: ptGraphics; AltPath: ptNone;
+ Texture: nil; Surface: nil; Width: 16; Height: 16;
+ imageWidth: 0; imageHeight: 0; saveSurf: false; priority:
tpMedium; getDimensions: false; getImageDimensions: true)
- // sprAirDrill
+ // sprNapalmBomb
);
--- a/hedgewars/uGears.pas Sat Nov 13 20:42:26 2010 +0300
+++ b/hedgewars/uGears.pas Sat Nov 13 23:03:17 2010 +0300
@@ -209,7 +209,8 @@
@doStepPoisonCloud,
@doStepHammer,
@doStepHammerHit,
- @doStepResurrector
+ @doStepResurrector,
+ @doStepNapalmBomb
);
procedure InsertGearToList(Gear: PGear);
@@ -545,6 +546,10 @@
gtWaterUp: begin
gear^.Tag := 47;
end;
+ gtNapalmBomb: begin
+ gear^.Timer:= 1000;
+ gear^.Radius:= 5;
+ end;
end;
InsertGearToList(gear);
Binary file share/hedgewars/Data/Graphics/NapalmBomb.png has changed