hedgewars/uGears.pas
changeset 1573 cf88e0ace609
parent 1560 e140bc57ff68
child 1586 2c6f1d1f43c1
equal deleted inserted replaced
1572:e1b40c3560bb 1573:cf88e0ace609
   142 			@doStepSeduction,
   142 			@doStepSeduction,
   143 			@doStepWatermelon,
   143 			@doStepWatermelon,
   144 			@doStepCluster,
   144 			@doStepCluster,
   145 			@doStepBomb,
   145 			@doStepBomb,
   146 			@doStepSmokeTrace,
   146 			@doStepSmokeTrace,
   147 			@doStepWaterUp
   147 			@doStepWaterUp,
       
   148 			@doStepDrill
   148 			);
   149 			);
   149 
   150 
   150 procedure InsertGearToList(Gear: PGear);
   151 procedure InsertGearToList(Gear: PGear);
   151 var tmp, ptmp: PGear;
   152 var tmp, ptmp: PGear;
   152 begin
   153 begin
   339                 end;
   340                 end;
   340  gtHellishBomb: begin
   341  gtHellishBomb: begin
   341                 Result^.Radius:= 4;
   342                 Result^.Radius:= 4;
   342                 Result^.Elasticity:= _0_5;
   343                 Result^.Elasticity:= _0_5;
   343                 Result^.Friction:= _0_96;
   344                 Result^.Friction:= _0_96;
       
   345                 end;
       
   346        gtDrill: begin
       
   347                 Result^.Timer:= 5000;
       
   348                 Result^.Radius:= 4;
   344                 end;
   349                 end;
   345      end;
   350      end;
   346 InsertGearToList(Result);
   351 InsertGearToList(Result);
   347 AddGear:= Result
   352 AddGear:= Result
   348 end;
   353 end;
   781 	begin
   786 	begin
   782 		amt:= CurrentHedgehog^.Ammo^[CurrentHedgehog^.CurSlot, CurrentHedgehog^.CurAmmo].AmmoType;
   787 		amt:= CurrentHedgehog^.Ammo^[CurrentHedgehog^.CurSlot, CurrentHedgehog^.CurAmmo].AmmoType;
   783 		case amt of
   788 		case amt of
   784 			amBazooka,
   789 			amBazooka,
   785 			amMortar: DrawRotated(sprHandBazooka, hx, hy, hwSign(Gear^.dX), aangle);
   790 			amMortar: DrawRotated(sprHandBazooka, hx, hy, hwSign(Gear^.dX), aangle);
       
   791                         amDrill: DrawRotated(sprHandDrill, hx, hy, hwSign(Gear^.dX), aangle);
   786 			amRope: DrawRotated(sprHandRope, hx, hy, hwSign(Gear^.dX), aangle);
   792 			amRope: DrawRotated(sprHandRope, hx, hy, hwSign(Gear^.dX), aangle);
   787 			amShotgun: DrawRotated(sprHandShotgun, hx, hy, hwSign(Gear^.dX), aangle);
   793 			amShotgun: DrawRotated(sprHandShotgun, hx, hy, hwSign(Gear^.dX), aangle);
   788 			amDEagle: DrawRotated(sprHandDEagle, hx, hy, hwSign(Gear^.dX), aangle);
   794 			amDEagle: DrawRotated(sprHandDEagle, hx, hy, hwSign(Gear^.dX), aangle);
   789 			amBlowTorch: DrawRotated(sprHandBlowTorch, hx, hy, hwSign(Gear^.dX), aangle);
   795 			amBlowTorch: DrawRotated(sprHandBlowTorch, hx, hy, hwSign(Gear^.dX), aangle);
   790 		end;
   796 		end;
  1031 Gear:= GearsList;
  1037 Gear:= GearsList;
  1032 while Gear<>nil do
  1038 while Gear<>nil do
  1033       begin
  1039       begin
  1034       case Gear^.Kind of
  1040       case Gear^.Kind of
  1035        gtAmmo_Bomb: DrawRotated(sprBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle);
  1041        gtAmmo_Bomb: DrawRotated(sprBomb, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, Gear^.DirAngle);
       
  1042        gtDrill: DrawRotated(sprDrill, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1036         gtHedgehog: DrawHH(Gear);
  1043         gtHedgehog: DrawHH(Gear);
  1037     gtAmmo_Grenade: DrawRotated(sprGrenade, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1044     gtAmmo_Grenade: DrawRotated(sprGrenade, hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, 0, DxDy2Angle(Gear^.dY, Gear^.dX));
  1038        gtHealthTag: if Gear^.Tex <> nil then DrawCentered(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Tex);
  1045        gtHealthTag: if Gear^.Tex <> nil then DrawCentered(hwRound(Gear^.X) + WorldDx, hwRound(Gear^.Y) + WorldDy, Gear^.Tex);
  1039            gtGrave: DrawSurfSprite(hwRound(Gear^.X) + WorldDx - 16, hwRound(Gear^.Y) + WorldDy - 16, 32, (GameTicks shr 7) and 7, PHedgehog(Gear^.Hedgehog)^.Team^.GraveTex);
  1046            gtGrave: DrawSurfSprite(hwRound(Gear^.X) + WorldDx - 16, hwRound(Gear^.Y) + WorldDy - 16, 32, (GameTicks shr 7) and 7, PHedgehog(Gear^.Hedgehog)^.Team^.GraveTex);
  1040              gtUFO: DrawSprite(sprUFO, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, (GameTicks shr 7) mod 4);
  1047              gtUFO: DrawSprite(sprUFO, hwRound(Gear^.X) - 16 + WorldDx, hwRound(Gear^.Y) - 16 + WorldDy, (GameTicks shr 7) mod 4);
  1243 		case t^.ar[i]^.Kind of
  1250 		case t^.ar[i]^.Kind of
  1244 			gtHedgehog,
  1251 			gtHedgehog,
  1245 			gtMine,
  1252 			gtMine,
  1246 			gtTarget,
  1253 			gtTarget,
  1247 			gtCase: begin
  1254 			gtCase: begin
       
  1255 					if (Ammo^.Kind = gtDrill) then begin Ammo^.Timer:= 0; exit; end;
  1248 					inc(t^.ar[i]^.Damage, Damage);
  1256 					inc(t^.ar[i]^.Damage, Damage);
  1249 
  1257 
  1250 					if (t^.ar[i]^.Kind = gtHedgehog) and (Damage > 0) then
  1258 					if (t^.ar[i]^.Kind = gtHedgehog) and (Damage > 0) then
  1251 						AddDamageTag(hwRound(t^.ar[i]^.X), hwRound(t^.ar[i]^.Y), Damage, PHedgehog(t^.ar[i]^.Hedgehog)^.Team^.Clan^.Color);
  1259 						AddDamageTag(hwRound(t^.ar[i]^.X), hwRound(t^.ar[i]^.Y), Damage, PHedgehog(t^.ar[i]^.Hedgehog)^.Team^.Clan^.Color);
  1252 
  1260