hedgewars/uGearsHedgehog.pas
changeset 7597 1ef520fea21c
parent 7462 9cc5a2586978
child 7598 f06d8603097c
equal deleted inserted replaced
7596:2c12b8cbd002 7597:1ef520fea21c
   570 
   570 
   571 procedure AddPickup(HH: THedgehog; ammo: TAmmoType; cnt, X, Y: LongWord);
   571 procedure AddPickup(HH: THedgehog; ammo: TAmmoType; cnt, X, Y: LongWord);
   572 var s: shortstring;
   572 var s: shortstring;
   573     vga: PVisualGear;
   573     vga: PVisualGear;
   574 begin
   574 begin
   575     PlaySound(sndShotgunReload);
       
   576     if cnt <> 0 then AddAmmo(HH, ammo, cnt)
   575     if cnt <> 0 then AddAmmo(HH, ammo, cnt)
   577     else AddAmmo(HH, ammo);
   576     else AddAmmo(HH, ammo);
   578 
   577 
   579     if (not (HH.Team^.ExtDriven 
   578     if (not (HH.Team^.ExtDriven 
   580     or (HH.BotLevel > 0)))
   579     or (HH.BotLevel > 0)))
   612     doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, HH^.Hedgehog, EXPLAutoSound + EXPLPoisoned + EXPLNoDamage)
   611     doMakeExplosion(hwRound(Gear^.X), hwRound(Gear^.Y), 25, HH^.Hedgehog, EXPLAutoSound + EXPLPoisoned + EXPLNoDamage)
   613 else
   612 else
   614 case Gear^.Pos of
   613 case Gear^.Pos of
   615        posCaseUtility,
   614        posCaseUtility,
   616        posCaseAmmo: begin
   615        posCaseAmmo: begin
       
   616                     PlaySound(sndShotgunReload);
   617                     if Gear^.AmmoType <> amNothing then 
   617                     if Gear^.AmmoType <> amNothing then 
   618                         begin
   618                         begin
   619                         AddPickup(HH^.Hedgehog^, Gear^.AmmoType, Gear^.Power, hwRound(Gear^.X), hwRound(Gear^.Y));
   619                         AddPickup(HH^.Hedgehog^, Gear^.AmmoType, Gear^.Power, hwRound(Gear^.X), hwRound(Gear^.Y));
   620                         end
   620                         end
   621                     else
   621                     else
   634                                 gi^.dX:= _90-(GetRandomf*_360);
   634                                 gi^.dX:= _90-(GetRandomf*_360);
   635                                 gi^.dY:= _90-(GetRandomf*_360)
   635                                 gi^.dY:= _90-(GetRandomf*_360)
   636                                 end;
   636                                 end;
   637                             gi := gi^.NextGear
   637                             gi := gi^.NextGear
   638                             end;
   638                             end;
   639                         ag:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAddAmmo, gstInvisible, _0, _0, GetRandom(200)+100);
   639                         ag:= AddGear(hwRound(Gear^.X), hwRound(Gear^.Y), gtAddAmmo, gstInvisible, _0, _0, GetRandom(100)+10);
   640                         ag^.Pos:= Gear^.Pos;
   640                         ag^.Pos:= Gear^.Pos;
   641                         ag^.Power:= Gear^.Power
   641                         ag^.Power:= Gear^.Power
   642                         end;
   642                         end;
   643                     end;
   643                     end;
   644      posCaseHealth: begin
   644      posCaseHealth: begin