hedgewars/uGearsHedgehog.pas
changeset 7602 a620319d377e
parent 7598 f06d8603097c
child 7615 b39beffcf05e
equal deleted inserted replaced
7601:c96ff1a053d0 7602:a620319d377e
   232         if  (CurAmmoGear <> nil)
   232         if  (CurAmmoGear <> nil)
   233         and ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0)
   233         and ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) <> 0)
   234         and ((Gear^.Message and gmLJump) <> 0)
   234         and ((Gear^.Message and gmLJump) <> 0)
   235         and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then
   235         and ((Ammoz[CurAmmoType].Ammo.Propz and ammoprop_AltUse) <> 0) then
   236             begin
   236             begin
   237             newDx:= dX / _2; 
   237             newDx:= dX / CurAmmoGear^.stepFreq; 
   238             newDy:= dY / _2;
   238             newDy:= dY / CurAmmoGear^.stepFreq;
   239             altUse:= true;
   239             altUse:= true
   240             end
   240             end
   241         else
   241         else
   242             begin
   242             begin
   243             newDx:= xx*Power/cPowerDivisor;
   243             newDx:= xx*Power/cPowerDivisor;
   244             newDy:= yy*Power/cPowerDivisor;
   244             newDy:= yy*Power/cPowerDivisor;
   258                                  newGear:= AddGear(hwRound(lx), hwRound(ly), gtShotgunShot,  0, xx * _0_5, yy * _0_5, 0);
   258                                  newGear:= AddGear(hwRound(lx), hwRound(ly), gtShotgunShot,  0, xx * _0_5, yy * _0_5, 0);
   259                                  end;
   259                                  end;
   260                    amPickHammer: newGear:= AddGear(hwRound(lx), hwRound(ly) + cHHRadius, gtPickHammer, 0, _0, _0, 0);
   260                    amPickHammer: newGear:= AddGear(hwRound(lx), hwRound(ly) + cHHRadius, gtPickHammer, 0, _0, _0, 0);
   261                          amSkip: ParseCommand('/skip', true);
   261                          amSkip: ParseCommand('/skip', true);
   262                          amRope: newGear:= AddGear(hwRound(lx), hwRound(ly), gtRope, 0, xx, yy, 0);
   262                          amRope: newGear:= AddGear(hwRound(lx), hwRound(ly), gtRope, 0, xx, yy, 0);
   263                          amMine: if altUse then
   263                          amMine: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtMine, gstWait, SignAs(_0_02, dX), _0, 3000);
   264                                      newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtMine, gstWait, newDx, newDy, 3000)
       
   265                                  else
       
   266                                      newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtMine, gstWait, SignAs(_0_02, dX), _0, 3000);
       
   267                         amSMine: newGear:= AddGear(hwRound(lx), hwRound(ly), gtSMine,    0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0);
   264                         amSMine: newGear:= AddGear(hwRound(lx), hwRound(ly), gtSMine,    0, xx*Power/cPowerDivisor, yy*Power/cPowerDivisor, 0);
   268                        amDEagle: newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtDEagleShot, 0, xx * _0_5, yy * _0_5, 0);
   265                        amDEagle: newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtDEagleShot, 0, xx * _0_5, yy * _0_5, 0);
   269                       amSineGun: newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtSineGunShot, 0, xx * _0_5, yy * _0_5, 0);
   266                       amSineGun: newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtSineGunShot, 0, xx * _0_5, yy * _0_5, 0);
   270                     amPortalGun: begin
   267                     amPortalGun: begin
   271                                  newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtPortal, 0, xx * _0_6, yy * _0_6, 
   268                                  newGear:= AddGear(hwRound(lx + xx * cHHRadius), hwRound(ly + yy * cHHRadius), gtPortal, 0, xx * _0_6, yy * _0_6, 
   358                                  end;
   355                                  end;
   359                     amStructure: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtStructure, gstWait, SignAs(_0_02, dX), _0, 3000);
   356                     amStructure: newGear:= AddGear(hwRound(lx) + hwSign(dX) * 7, hwRound(ly), gtStructure, gstWait, SignAs(_0_02, dX), _0, 3000);
   360                        amTardis: newGear:= AddGear(hwRound(X), hwRound(Y), gtTardis, 0, _0, _0, 5000);
   357                        amTardis: newGear:= AddGear(hwRound(X), hwRound(Y), gtTardis, 0, _0, _0, 5000);
   361                        amIceGun: newGear:= AddGear(hwRound(X), hwRound(Y), gtIceGun, 0, _0, _0, 0);
   358                        amIceGun: newGear:= AddGear(hwRound(X), hwRound(Y), gtIceGun, 0, _0, _0, 0);
   362              end;
   359              end;
       
   360              if altUse then
       
   361                 begin
       
   362                 newGear^.dX:= newDx / newGear^.Density;
       
   363                 newGear^.dY:= newDY / newGear^.Density
       
   364                 end;
   363              
   365              
   364              case CurAmmoType of
   366              case CurAmmoType of
   365                       amGrenade, amMolotov, 
   367                       amGrenade, amMolotov, 
   366                   amClusterBomb, amGasBomb, 
   368                   amClusterBomb, amGasBomb, 
   367                       amBazooka, amSnowball, 
   369                       amBazooka, amSnowball,