hedgewars/uWorld.pas
changeset 3836 833c0f32e326
parent 3811 967363197f01
child 3890 e4b7b30232fd
equal deleted inserted replaced
3835:cbee69165c6a 3836:833c0f32e326
   188 const BORDERSIZE = 2;
   188 const BORDERSIZE = 2;
   189 var x, y, i, t, g: LongInt;
   189 var x, y, i, t, g: LongInt;
   190     Slot, Pos, STurns: LongInt;
   190     Slot, Pos, STurns: LongInt;
   191     Ammo: PHHAmmo;
   191     Ammo: PHHAmmo;
   192 begin
   192 begin
   193 if  (TurnTimeLeft = 0) or (not CurrentTeam^.ExtDriven and (((CurAmmoGear = nil) or ((CurAmmoGear^.Ammo^.Propz and ammoprop_AltAttack) = 0)) and hideAmmoMenu)) then bShowAmmoMenu:= false;
   193 if  (TurnTimeLeft = 0) or (not CurrentTeam^.ExtDriven and (((CurAmmoGear = nil) or ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) = 0)) and hideAmmoMenu)) then bShowAmmoMenu:= false;
   194 if bShowAmmoMenu then
   194 if bShowAmmoMenu then
   195    begin
   195    begin
   196    FollowGear:= nil;
   196    FollowGear:= nil;
   197    if AMxShift = AMWidth then prevPoint.X:= 0;
   197    if AMxShift = AMWidth then prevPoint.X:= 0;
   198    if (cReducedQuality and rqSlowMenu) <> 0 then
   198    if (cReducedQuality and rqSlowMenu) <> 0 then
   611                 begin
   611                 begin
   612                 tdx:= hwSign(Gear^.dX) * Sin(Gear^.Angle * Pi / cMaxAngle);
   612                 tdx:= hwSign(Gear^.dX) * Sin(Gear^.Angle * Pi / cMaxAngle);
   613                 tdy:= - Cos(Gear^.Angle * Pi / cMaxAngle);
   613                 tdy:= - Cos(Gear^.Angle * Pi / cMaxAngle);
   614                 for i:= (Gear^.Power * 24) div cPowerDivisor downto 0 do
   614                 for i:= (Gear^.Power * 24) div cPowerDivisor downto 0 do
   615                     DrawSprite(sprPower,
   615                     DrawSprite(sprPower,
   616                             hwRound(Gear^.X) + GetLaunchX(Ammo^[CurSlot, CurAmmo].AmmoType, hwSign(Gear^.dX), Gear^.Angle) + round(WorldDx + tdx * (24 + i * 2)) - 16,
   616                             hwRound(Gear^.X) + GetLaunchX(CurAmmoType, hwSign(Gear^.dX), Gear^.Angle) + round(WorldDx + tdx * (24 + i * 2)) - 16,
   617                             hwRound(Gear^.Y) + GetLaunchY(Ammo^[CurSlot, CurAmmo].AmmoType, Gear^.Angle) + round(WorldDy + tdy * (24 + i * 2)) - 16,
   617                             hwRound(Gear^.Y) + GetLaunchY(CurAmmoType, Gear^.Angle) + round(WorldDy + tdy * (24 + i * 2)) - 16,
   618                             i)
   618                             i)
   619                 end
   619                 end
   620         end;
   620         end;
   621 
   621 
   622     DrawVisualGears(1);
   622     DrawVisualGears(1);
   647 // Target
   647 // Target
   648 if (TargetPoint.X <> NoPointX) and (CurrentTeam <> nil) and (CurrentHedgehog <> nil) then
   648 if (TargetPoint.X <> NoPointX) and (CurrentTeam <> nil) and (CurrentHedgehog <> nil) then
   649     begin
   649     begin
   650     with PHedgehog(CurrentHedgehog)^ do
   650     with PHedgehog(CurrentHedgehog)^ do
   651         begin
   651         begin
   652         if (Ammo^[CurSlot, CurAmmo].AmmoType = amBee) then
   652         if (CurAmmoType = amBee) then
   653             DrawRotatedF(sprTargetBee, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360)
   653             DrawRotatedF(sprTargetBee, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360)
   654         else
   654         else
   655             DrawRotatedF(sprTargetP, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360);
   655             DrawRotatedF(sprTargetP, TargetPoint.X + WorldDx, TargetPoint.Y + WorldDy, 0, 0, (RealTicks shr 3) mod 360);
   656         end;
   656         end;
   657     end;
   657     end;
   985    if not bShowAmmoMenu then
   985    if not bShowAmmoMenu then
   986      begin
   986      begin
   987      with CurrentHedgehog^ do
   987      with CurrentHedgehog^ do
   988        if (Gear <> nil) and ((Gear^.State and gstHHChooseTarget) <> 0) then
   988        if (Gear <> nil) and ((Gear^.State and gstHHChooseTarget) <> 0) then
   989          begin
   989          begin
   990          i:= Ammo^[CurSlot, CurAmmo].Pos;
   990          i:= GetAmmoEntry(CurrentHedgehog^)^.Pos;
   991          with Ammoz[Ammo^[CurSlot, CurAmmo].AmmoType] do
   991          with Ammoz[CurAmmoType] do
   992            if PosCount > 1 then
   992            if PosCount > 1 then
   993              DrawSprite(PosSprite, CursorPoint.X - (SpritesData[PosSprite].Width shr 1), cScreenHeight - CursorPoint.Y - (SpritesData[PosSprite].Height shr 1),i);
   993              DrawSprite(PosSprite, CursorPoint.X - (SpritesData[PosSprite].Width shr 1), cScreenHeight - CursorPoint.Y - (SpritesData[PosSprite].Height shr 1),i);
   994          end;
   994          end;
   995      DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8)
   995      DrawSprite(sprArrow, CursorPoint.X, cScreenHeight - CursorPoint.Y, (RealTicks shr 6) mod 8)
   996      end
   996      end