hedgewars/HHHandlers.inc
changeset 4372 3836973380b9
parent 4365 4f2b1a152979
child 4578 f3cf226fad16
equal deleted inserted replaced
4371:ae172b2b03ed 4372:3836973380b9
   452 PlaySound(sndShotgunReload);
   452 PlaySound(sndShotgunReload);
   453 case Gear^.Pos of
   453 case Gear^.Pos of
   454        posCaseUtility,
   454        posCaseUtility,
   455        posCaseAmmo: begin
   455        posCaseAmmo: begin
   456                     a:= Gear^.AmmoType;
   456                     a:= Gear^.AmmoType;
   457                     AddAmmo(PHedgehog(HH^.Hedgehog)^, a);
   457                     AddAmmo(HH^.Hedgehog^, a);
   458 // Possibly needs to check shared clan ammo game flag once added.
   458 // Possibly needs to check shared clan ammo game flag once added.
   459 // On the other hand, no obvious reason that clan members shouldn't know what ammo another clan member picked up
   459 // On the other hand, no obvious reason that clan members shouldn't know what ammo another clan member picked up
   460                     if (not (PHedgehog(HH^.Hedgehog)^.Team^.ExtDriven 
   460                     if (not (HH^.Hedgehog^.Team^.ExtDriven 
   461                       or (PHedgehog(HH^.Hedgehog)^.BotLevel > 0)))
   461                       or (HH^.Hedgehog^.BotLevel > 0)))
   462                       or (PHedgehog(HH^.Hedgehog)^.Team^.Clan^.ClanIndex = LocalClan)
   462                       or (HH^.Hedgehog^.Team^.Clan^.ClanIndex = LocalClan)
   463                       or (GameType = gmtDemo)  then
   463                       or (GameType = gmtDemo)  then
   464                         begin
   464                         begin
   465                         s:= trammo[Ammoz[a].NameId] + ' (+' + IntToStr(Ammoz[a].NumberInCase) + ')';
   465                         s:= trammo[Ammoz[a].NameId] + ' (+' + IntToStr(Ammoz[a].NumberInCase) + ')';
   466                         AddCaption(s, PHedgehog(HH^.Hedgehog)^.Team^.Clan^.Color, capgrpAmmoinfo);
   466                         AddCaption(s, HH^.Hedgehog^.Team^.Clan^.Color, capgrpAmmoinfo);
   467 
   467 
   468                         // show ammo icon
   468                         // show ammo icon
   469                         vga:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtAmmo);
   469                         vga:= AddVisualGear(hwRound(Gear^.X), hwRound(Gear^.Y), vgtAmmo);
   470                         if vga <> nil then
   470                         if vga <> nil then
   471                             vga^.Frame:= Longword(a);
   471                             vga^.Frame:= Longword(a);
   472                         end;
   472                         end;
   473 
   473 
   474                     end;
   474                     end;
   475      posCaseHealth: begin
   475      posCaseHealth: begin
   476                     inc(HH^.Health, Gear^.Health);
   476                     inc(HH^.Health, Gear^.Health);
   477                     PHedgehog(HH^.Hedgehog)^.Effects[hePoisoned] := false;
   477                     HH^.Hedgehog^.Effects[hePoisoned] := false;
   478                     str(Gear^.Health, s);
   478                     str(Gear^.Health, s);
   479                     s:= '+' + s;
   479                     s:= '+' + s;
   480                     AddCaption(s, PHedgehog(HH^.Hedgehog)^.Team^.Clan^.Color, capgrpAmmoinfo);
   480                     AddCaption(s, HH^.Hedgehog^.Team^.Clan^.Color, capgrpAmmoinfo);
   481                     RenderHealth(PHedgehog(HH^.Hedgehog)^);
   481                     RenderHealth(HH^.Hedgehog^);
   482                     RecountTeamHealth(PHedgehog(HH^.Hedgehog)^.Team);
   482                     RecountTeamHealth(HH^.Hedgehog^.Team);
   483 
   483 
   484                     i:= 0;
   484                     i:= 0;
   485                     while i < Gear^.Health do
   485                     while i < Gear^.Health do
   486                         begin
   486                         begin
   487                         AddVisualGear(hwRound(HH^.X), hwRound(HH^.Y), vgtHealth);
   487                         AddVisualGear(hwRound(HH^.X), hwRound(HH^.Y), vgtHealth);