hedgewars/uGearsUtils.pas
changeset 13812 1f15b0ee8e34
parent 13780 8a7699ccb608
child 13856 f01798038c2e
equal deleted inserted replaced
13811:54725a1d1db8 13812:1f15b0ee8e34
  1330         Gear^.Hedgehog^.Effects[heFrozen]:= max(255,Gear^.Hedgehog^.Effects[heFrozen]-10000);
  1330         Gear^.Hedgehog^.Effects[heFrozen]:= max(255,Gear^.Hedgehog^.Effects[heFrozen]-10000);
  1331     tmpDmg:= ModifyDamage(Damage, Gear);
  1331     tmpDmg:= ModifyDamage(Damage, Gear);
  1332     if (Gear^.State and gstNoDamage) = 0 then
  1332     if (Gear^.State and gstNoDamage) = 0 then
  1333         begin
  1333         begin
  1334 
  1334 
  1335         if (not (Gear^.Kind in [gtMinigun, gtPortal])) and
       
  1336             (Ammo^.Kind in [gtDEagleShot, gtSniperRifleShot, gtMinigunBullet]) then
       
  1337             begin
       
  1338             VGear := AddVisualGear(t^.cX[i], t^.cY[i], vgtBulletHit);
       
  1339             if VGear <> nil then
       
  1340                 VGear^.Angle := DxDy2Angle(-Ammo^.dX, Ammo^.dY);
       
  1341             end;
       
  1342 
       
  1343         if (Gear^.Kind = gtHedgehog) and (Ammo^.State and gsttmpFlag <> 0) and (Ammo^.Kind = gtShover) then
  1335         if (Gear^.Kind = gtHedgehog) and (Ammo^.State and gsttmpFlag <> 0) and (Ammo^.Kind = gtShover) then
  1344             Gear^.FlightTime:= 1;
  1336             Gear^.FlightTime:= 1;
  1345 
       
  1346 
  1337 
  1347         case Gear^.Kind of
  1338         case Gear^.Kind of
  1348             gtHedgehog,
  1339             gtHedgehog,
  1349             gtMine,
  1340             gtMine,
  1350             gtAirMine,
  1341             gtAirMine,
  1353             gtTarget,
  1344             gtTarget,
  1354             gtCase,
  1345             gtCase,
  1355             gtExplosives: //,
  1346             gtExplosives: //,
  1356             //gtStructure:
  1347             //gtStructure:
  1357             begin
  1348             begin
       
  1349             if Ammo^.Kind in [gtDEagleShot, gtSniperRifleShot, gtMinigunBullet] then
       
  1350                 begin
       
  1351                 VGear := AddVisualGear(t^.cX[i], t^.cY[i], vgtBulletHit);
       
  1352                 if VGear <> nil then
       
  1353                     VGear^.Angle := DxDy2Angle(-Ammo^.dX, Ammo^.dY);
       
  1354                 end;
  1358             if (Ammo^.Kind = gtDrill) then
  1355             if (Ammo^.Kind = gtDrill) then
  1359                 begin
  1356                 begin
  1360                 Ammo^.Timer:= 0;
  1357                 Ammo^.Timer:= 0;
  1361                 exit;
  1358                 exit;
  1362                 end;
  1359                 end;
  1395                 ApplyDamage(Gear, Ammo^.Hedgehog, tmpDmg * 100, dsUnknown); // crank up damage for explosives + blowtorch
  1392                 ApplyDamage(Gear, Ammo^.Hedgehog, tmpDmg * 100, dsUnknown); // crank up damage for explosives + blowtorch
  1396                 end;
  1393                 end;
  1397 
  1394 
  1398             if (Gear^.Kind = gtHedgehog) and (Gear^.Hedgehog^.King or (Gear^.Hedgehog^.Effects[heFrozen] > 0)) then
  1395             if (Gear^.Kind = gtHedgehog) and (Gear^.Hedgehog^.King or (Gear^.Hedgehog^.Effects[heFrozen] > 0)) then
  1399                 begin
  1396                 begin
  1400                 Gear^.dX:= Gear^.dX + Ammo^.dX * Power * _0_005;
  1397                 Gear^.dX:= Ammo^.dX * Power * _0_005;
  1401                 Gear^.dY:= Gear^.dY + Ammo^.dY * Power * _0_005
  1398                 Gear^.dY:= Ammo^.dY * Power * _0_005
  1402                 end
  1399                 end
  1403             else if ((Ammo^.Kind <> gtFlame) or (Gear^.Kind = gtHedgehog)) and (Power <> 0) then
  1400             else if ((Ammo^.Kind <> gtFlame) or (Gear^.Kind = gtHedgehog)) and (Power <> 0) then
  1404                 begin
  1401                 begin
  1405                 Gear^.dX:= Gear^.dX + Ammo^.dX * Power * _0_01;
  1402                 Gear^.dX:= Ammo^.dX * Power * _0_01;
  1406                 Gear^.dY:= Gear^.dY + Ammo^.dY * Power * _0_01
  1403                 Gear^.dY:= Ammo^.dY * Power * _0_01
  1407                 end;
  1404                 end;
  1408 
  1405 
  1409             if (not isZero(Gear^.dX)) or (not isZero(Gear^.dY)) then
  1406             if (not isZero(Gear^.dX)) or (not isZero(Gear^.dY)) then
  1410                 begin
  1407                 begin
  1411                 Gear^.Active:= true;
  1408                 Gear^.Active:= true;