hedgewars/HHHandlers.inc
changeset 2972 82828fd23dea
parent 2948 3f21a9dc93d0
child 2990 b62e567f17b9
equal deleted inserted replaced
2971:c65929077646 2972:82828fd23dea
   305 ////////////////////////////////////////////////////////////////////////////////
   305 ////////////////////////////////////////////////////////////////////////////////
   306 procedure PickUp(HH, Gear: PGear);
   306 procedure PickUp(HH, Gear: PGear);
   307 var s: shortstring;
   307 var s: shortstring;
   308     a: TAmmoType;
   308     a: TAmmoType;
   309     i: Integer;
   309     i: Integer;
       
   310     vga: PVisualGear;
   310 begin
   311 begin
   311 Gear^.Message:= gm_Destroy;
   312 Gear^.Message:= gm_Destroy;
   312 PlaySound(sndShotgunReload);
   313 PlaySound(sndShotgunReload);
   313 case Gear^.Pos of
   314 case Gear^.Pos of
   314        posCaseUtility,
   315        posCaseUtility,
   317                     AddAmmo(PHedgehog(HH^.Hedgehog)^, a);
   318                     AddAmmo(PHedgehog(HH^.Hedgehog)^, a);
   318 // Possibly needs to check shared clan ammo game flag once added.
   319 // Possibly needs to check shared clan ammo game flag once added.
   319 // On the other hand, no obvious reason that clan members shouldn't know what ammo another clan member picked up
   320 // On the other hand, no obvious reason that clan members shouldn't know what ammo another clan member picked up
   320                     if (not (PHedgehog(HH^.Hedgehog)^.Team^.ExtDriven 
   321                     if (not (PHedgehog(HH^.Hedgehog)^.Team^.ExtDriven 
   321                       or (PHedgehog(HH^.Hedgehog)^.BotLevel > 0)))
   322                       or (PHedgehog(HH^.Hedgehog)^.BotLevel > 0)))
   322                     or (PHedgehog(HH^.Hedgehog)^.Team^.Clan^.ClanIndex = LocalClan)
   323                       or (PHedgehog(HH^.Hedgehog)^.Team^.Clan^.ClanIndex = LocalClan)
   323                     or (GameType = gmtDemo)  then
   324                       or (GameType = gmtDemo)  then
   324                        begin
   325                         begin
   325                        s:= trammo[Ammoz[a].NameId] + '(+' + IntToStr(Ammoz[a].NumberInCase) + ')';
   326                         s:= trammo[Ammoz[a].NameId] + '(+' + IntToStr(Ammoz[a].NumberInCase) + ')';
   326                        AddCaption(s, PHedgehog(HH^.Hedgehog)^.Team^.Clan^.Color, capgrpAmmoinfo);
   327                         AddCaption(s, PHedgehog(HH^.Hedgehog)^.Team^.Clan^.Color, capgrpAmmoinfo);
   327                        end
   328 
       
   329                         // show ammo icon
       
   330                         vga:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtAmmo);
       
   331                         if vga <> nil then
       
   332                             vga^.Frame:= Longword(a);
       
   333                         end;
       
   334 
   328                     end;
   335                     end;
   329      posCaseHealth: begin
   336      posCaseHealth: begin
   330                     inc(HH^.Health, Gear^.Health);
   337                     inc(HH^.Health, Gear^.Health);
   331                     str(Gear^.Health, s);
   338                     str(Gear^.Health, s);
   332                     s:= '+' + s;
   339                     s:= '+' + s;