hedgewars/uWorld.pas
changeset 602 f7628ebfccde
parent 564 17fb45c670c1
child 678 5cf90dbcb309
equal deleted inserted replaced
601:78a68cc4d846 602:f7628ebfccde
    90    end;
    90    end;
    91 
    91 
    92 if CurrentTeam = nil then exit;
    92 if CurrentTeam = nil then exit;
    93 Slot:= 0;
    93 Slot:= 0;
    94 Pos:= -1;
    94 Pos:= -1;
    95 with CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog] do
    95 with CurrentHedgehog^ do
    96      begin
    96      begin
    97      if Ammo = nil then exit;
    97      if Ammo = nil then exit;
    98      SlotsNum:= 0;
    98      SlotsNum:= 0;
    99      x:= AMxCurr;
    99      x:= AMxCurr;
   100      y:= cScreenHeight - 40;
   100      y:= cScreenHeight - 40;
   233 if CurrentTeam <> nil then
   233 if CurrentTeam <> nil then
   234    case AttackBar of
   234    case AttackBar of
   235         1: begin
   235         1: begin
   236            r:= StuffPoz[sPowerBar];
   236            r:= StuffPoz[sPowerBar];
   237            {$WARNINGS OFF}
   237            {$WARNINGS OFF}
   238            r.w:= (CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog].Gear^.Power * 256) div cPowerDivisor;
   238            r.w:= (CurrentHedgehog^.Gear^.Power * 256) div cPowerDivisor;
   239            {$WARNINGS ON}
   239            {$WARNINGS ON}
   240            DrawSpriteFromRect(r, cScreenWidth - 272, cScreenHeight - 48, 16, 0, Surface);
   240            DrawSpriteFromRect(r, cScreenWidth - 272, cScreenHeight - 48, 16, 0, Surface);
   241            end;
   241            end;
   242         2: with CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog] do
   242         2: with CurrentHedgehog^ do
   243                 begin
   243                 begin
   244                 tdx:= hwSign(Gear^.dX) * Sin(Gear^.Angle * Pi / cMaxAngle);
   244                 tdx:= hwSign(Gear^.dX) * Sin(Gear^.Angle * Pi / cMaxAngle);
   245                 tdy:= - Cos(Gear^.Angle * Pi / cMaxAngle);
   245                 tdy:= - Cos(Gear^.Angle * Pi / cMaxAngle);
   246                 for i:= (Gear^.Power * 24) div cPowerDivisor downto 0 do
   246                 for i:= (Gear^.Power * 24) div cPowerDivisor downto 0 do
   247                     DrawSprite(sprPower, hwRound(Gear^.X) + system.round(WorldDx + tdx * (24 + i * 2)) - 16,
   247                     DrawSprite(sprPower, hwRound(Gear^.X) + system.round(WorldDx + tdx * (24 + i * 2)) - 16,
   327 
   327 
   328 // Cursor
   328 // Cursor
   329 if isCursorVisible then
   329 if isCursorVisible then
   330    begin
   330    begin
   331    if not bShowAmmoMenu then
   331    if not bShowAmmoMenu then
   332      with CurrentTeam^.Hedgehogs[CurrentTeam^.CurrHedgehog] do
   332      with CurrentHedgehog^ do
   333        if (Gear^.State and gstHHChooseTarget) <> 0 then
   333        if (Gear^.State and gstHHChooseTarget) <> 0 then
   334          begin
   334          begin
   335          i:= Ammo^[CurSlot, CurAmmo].Pos;
   335          i:= Ammo^[CurSlot, CurAmmo].Pos;
   336          with Ammoz[Ammo^[CurSlot, CurAmmo].AmmoType] do
   336          with Ammoz[Ammo^[CurSlot, CurAmmo].AmmoType] do
   337            if PosCount > 1 then
   337            if PosCount > 1 then