hedgewars/uGearsHandlersMess.pas
changeset 13096 d78e65c66573
parent 13058 004f4f7dc9d4
child 13140 e330feceb662
equal deleted inserted replaced
13095:4118006fab95 13096:d78e65c66573
  1361         or (hwRound(Gear^.X) and LAND_WIDTH_MASK <> 0)
  1361         or (hwRound(Gear^.X) and LAND_WIDTH_MASK <> 0)
  1362         or (hwRound(Gear^.Y) and LAND_HEIGHT_MASK <> 0) then
  1362         or (hwRound(Gear^.Y) and LAND_HEIGHT_MASK <> 0) then
  1363             begin
  1363             begin
  1364             if (Gear^.Kind = gtSniperRifleShot) then
  1364             if (Gear^.Kind = gtSniperRifleShot) then
  1365                 cLaserSightingSniper := false;
  1365                 cLaserSightingSniper := false;
  1366             if (Ammoz[Gear^.AmmoType].Ammo.NumPerTurn <= CurrentHedgehog^.MultiShootAttacks) and ((GameFlags and gfArtillery) = 0) then
  1366             if (Ammoz[Gear^.AmmoType].Ammo.NumPerTurn <= CurrentHedgehog^.MultiShootAttacks) and (CurrentHedgehog^.Effects[heArtillery] = 2) then
  1367                 cArtillery := false;
  1367                 CurrentHedgehog^.Effects[heArtillery]:= 0;
  1368 
  1368 
  1369         // Bullet Hit
  1369         // Bullet Hit
  1370             if ((Gear^.State and gstDrowning) = 0) and (hwRound(Gear^.X) and LAND_WIDTH_MASK = 0) and (hwRound(Gear^.Y) and LAND_HEIGHT_MASK = 0) then
  1370             if ((Gear^.State and gstDrowning) = 0) and (hwRound(Gear^.X) and LAND_WIDTH_MASK = 0) and (hwRound(Gear^.Y) and LAND_HEIGHT_MASK = 0) then
  1371                 begin
  1371                 begin
  1372                 if Gear^.Kind = gtMinigunBullet then
  1372                 if Gear^.Kind = gtMinigunBullet then
  1408 procedure doStepSniperRifleShot(Gear: PGear);
  1408 procedure doStepSniperRifleShot(Gear: PGear);
  1409 var HHGear: PGear;
  1409 var HHGear: PGear;
  1410     shell: PVisualGear;
  1410     shell: PVisualGear;
  1411 begin
  1411 begin
  1412 
  1412 
  1413     cArtillery := true;
       
  1414     HHGear := Gear^.Hedgehog^.Gear;
  1413     HHGear := Gear^.Hedgehog^.Gear;
       
  1414     if (Gear^.Hedgehog^.Effects[heArtillery] <> 1) then
       
  1415         Gear^.Hedgehog^.Effects[heArtillery]:= 2;
  1415 
  1416 
  1416     if HHGear = nil then
  1417     if HHGear = nil then
  1417         begin
  1418         begin
  1418         DeleteGear(gear);
  1419         DeleteGear(gear);
  1419         exit
  1420         exit
  4858             begin
  4859             begin
  4859             CurWeapon:= GetCurAmmoEntry(CurrentHedgehog^);
  4860             CurWeapon:= GetCurAmmoEntry(CurrentHedgehog^);
  4860             // let's save the HH's dX's direction so we can decide where the "top" of the portal hole
  4861             // let's save the HH's dX's direction so we can decide where the "top" of the portal hole
  4861             newPortal^.Elasticity.isNegative := CurrentHedgehog^.Gear^.dX.isNegative;
  4862             newPortal^.Elasticity.isNegative := CurrentHedgehog^.Gear^.dX.isNegative;
  4862             // when doing a backjump the dx is the opposite of the facing direction
  4863             // when doing a backjump the dx is the opposite of the facing direction
  4863             if ((Gear^.State and gstHHHJump) <> 0) and (not cArtillery) then
  4864             if ((Gear^.State and gstHHHJump) <> 0) and (Effects[heArtillery] = 0) then
  4864                 newPortal^.Elasticity.isNegative := not newPortal^.Elasticity.isNegative;
  4865                 newPortal^.Elasticity.isNegative := not newPortal^.Elasticity.isNegative;
  4865 
  4866 
  4866             // make portal gun look unloaded
  4867             // make portal gun look unloaded
  4867             if (CurWeapon <> nil) and (CurAmmoType = amPortalGun) then
  4868             if (CurWeapon <> nil) and (CurAmmoType = amPortalGun) then
  4868                 CurWeapon^.Timer := CurWeapon^.Timer or 2;
  4869                 CurWeapon^.Timer := CurWeapon^.Timer or 2;