hedgewars/uGearsHedgehog.pas
changeset 8987 47cf32305d99
parent 8947 e906ebd59612
child 8992 5b0be812dcdb
equal deleted inserted replaced
8986:f7bb323a6934 8987:47cf32305d99
   255             if  (CurAmmoGear <> nil)
   255             if  (CurAmmoGear <> nil)
   256             and ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0)
   256             and ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0)
   257             and ((Gear^.Message and gmLJump) <> 0)
   257             and ((Gear^.Message and gmLJump) <> 0)
   258             and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then
   258             and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then
   259                 begin
   259                 begin
   260                 newDx:= dX;
   260                 if (CurAmmoGear^.AmmoType = amJetpack) and (Gear^.Message and gmPrecise <> 0) then
   261                 newDy:= dY;
   261                     begin
       
   262                     if hwRound(Gear^.Y) > cWaterLine then
       
   263                         begin
       
   264                         newDx:= xx*cMaxPower/cPowerDivisor/2;
       
   265                         newDy:= yy*cMaxPower/cPowerDivisor/2
       
   266                         end
       
   267                     else
       
   268                         begin
       
   269                         newDx:= xx*cMaxPower/cPowerDivisor;
       
   270                         newDy:= yy*cMaxPower/cPowerDivisor
       
   271                         end
       
   272                     end
       
   273                 else
       
   274                     begin
       
   275                     newDx:= dX;
       
   276                     newDy:= dY
       
   277                     end;
   262                 altUse:= true
   278                 altUse:= true
   263                 end
   279                 end
   264             else
   280             else
   265                 begin
   281                 begin
   266                 newDx:= xx*Power/cPowerDivisor;
   282                 newDx:= xx*Power/cPowerDivisor;
   383                                  end;
   399                                  end;
   384                     //amStructure: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtStructure, gstWait, SignAs(_0_02, dX), _0, 3000);
   400                     //amStructure: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtStructure, gstWait, SignAs(_0_02, dX), _0, 3000);
   385                        amTardis: newGear:= AddGear(hwRound(X), hwRound(Y), gtTardis, 0, _0, _0, 5000);
   401                        amTardis: newGear:= AddGear(hwRound(X), hwRound(Y), gtTardis, 0, _0, _0, 5000);
   386                        amIceGun: newGear:= AddGear(hwRound(X), hwRound(Y), gtIceGun, 0, _0, _0, 0);
   402                        amIceGun: newGear:= AddGear(hwRound(X), hwRound(Y), gtIceGun, 0, _0, _0, 0);
   387             end;
   403             end;
   388             if altUse and (newGear <> nil) then
   404             if altUse and (newGear <> nil) and 
       
   405                ((CurAmmoGear = nil) or (CurAmmoGear^.AmmoType <> amJetpack) or (Gear^.Message and gmPrecise = 0)) then
   389                begin
   406                begin
   390                newGear^.dX:= newDx / newGear^.Density;
   407                newGear^.dX:= newDx / newGear^.Density;
   391                newGear^.dY:= newDY / newGear^.Density
   408                newGear^.dY:= newDY / newGear^.Density
   392                end;
   409                end;
       
   410             if (CurAmmoGear <> nil) and (CurAmmoGear^.AmmoType = amJetpack) and
       
   411                (Gear^.Message and gmPrecise <> 0) and (hwRound(Y) > cWaterLine) then
       
   412                 newGear^.State:= newGear^.State or gstNoDrown;
   393 
   413 
   394             case CurAmmoType of
   414             case CurAmmoType of
   395                      amGrenade, amMolotov,
   415                      amGrenade, amMolotov,
   396                  amClusterBomb, amGasBomb,
   416                  amClusterBomb, amGasBomb,
   397                      amBazooka, amSnowball,
   417                      amBazooka, amSnowball,
   796     if ((CurAmmoGear <> nil) and (CurAmmoGear^.AmmoType = amRope) and ((HHGear^.State and (gstMoving or gstHHJumping)) = gstMoving))
   816     if ((CurAmmoGear <> nil) and (CurAmmoGear^.AmmoType = amRope) and ((HHGear^.State and (gstMoving or gstHHJumping)) = gstMoving))
   797     or ((CurAmmoType = amPortalGun) and ((HHGear^.State and gstMoving) <> 0)) then
   817     or ((CurAmmoType = amPortalGun) and ((HHGear^.State and gstMoving) <> 0)) then
   798         da:= 2
   818         da:= 2
   799     else da:= 1;
   819     else da:= 1;
   800 
   820 
   801 if (((HHGear^.Message and gmPrecise) = 0) or ((GameTicks mod 5) = 1)) then
   821 if ((HHGear^.Message and gmPrecise = 0) or ((CurAmmoGear <> nil) and (CurAmmoGear^.AmmoType = amJetpack))) or (GameTicks mod 5 = 1) then
   802     if ((HHGear^.Message and gmUp) <> 0) and (HHGear^.Angle >= CurMinAngle + da) then
   822     if ((HHGear^.Message and gmUp) <> 0) and (HHGear^.Angle >= CurMinAngle + da) then
   803         dec(HHGear^.Angle, da)
   823         dec(HHGear^.Angle, da)
   804     else
   824     else
   805         if ((HHGear^.Message and gmDown) <> 0) and (HHGear^.Angle + da <= CurMaxAngle) then
   825         if ((HHGear^.Message and gmDown) <> 0) and (HHGear^.Angle + da <= CurMaxAngle) then
   806             inc(HHGear^.Angle, da)
   826             inc(HHGear^.Angle, da)