hedgewars/uWorld.pas
branch0.9.18
changeset 7946 a99a79bbd857
parent 7858 2566fc2621d4
child 8026 4a4f21070479
child 8138 cfb228baa598
equal deleted inserted replaced
7944:a94f4ef5ba2b 7946:a99a79bbd857
   509 const BORDERSIZE = 2;
   509 const BORDERSIZE = 2;
   510 var Slot, Pos: LongInt;
   510 var Slot, Pos: LongInt;
   511     Ammo: PHHAmmo;
   511     Ammo: PHHAmmo;
   512     c,i,g,t,STurns: LongInt;
   512     c,i,g,t,STurns: LongInt;
   513 begin
   513 begin
   514 if (TurnTimeLeft = 0) or (not CurrentTeam^.ExtDriven and (((CurAmmoGear = nil)
   514 if TurnTimeLeft = 0 then bShowAmmoMenu:= false;
   515 or ((Ammoz[CurAmmoGear^.AmmoType].Ammo.Propz and ammoprop_AltAttack) = 0)) and hideAmmoMenu)) then
       
   516     bShowAmmoMenu:= false;
       
   517 
   515 
   518 // give the assigned ammo to hedgehog
   516 // give the assigned ammo to hedgehog
   519 Ammo:= nil;
   517 Ammo:= nil;
   520 if (CurrentTeam <> nil) and (CurrentHedgehog <> nil)
   518 if (CurrentTeam <> nil) and (CurrentHedgehog <> nil)
   521 and (not CurrentTeam^.ExtDriven) and (CurrentHedgehog^.BotLevel = 0) then
   519 and (not CurrentTeam^.ExtDriven) and (CurrentHedgehog^.BotLevel = 0) then
   550         end;
   548         end;
   551 {$ELSE}
   549 {$ELSE}
   552         AmmoRect.x:= (cScreenWidth shr 1) - AmmoRect.w - AMSlotSize;
   550         AmmoRect.x:= (cScreenWidth shr 1) - AmmoRect.w - AMSlotSize;
   553         AmmoRect.y:= cScreenHeight - (AmmoRect.h + AMSlotSize);
   551         AmmoRect.y:= cScreenHeight - (AmmoRect.h + AMSlotSize);
   554 {$ENDIF}
   552 {$ENDIF}
   555     AMShiftTargetX:= (cScreenWidth shr 1) - AmmoRect.x;
   553     if AMState <> AMShowing then
   556     AMShiftTargetY:= cScreenHeight        - AmmoRect.y;
   554         begin
   557 
   555         AMShiftTargetX:= (cScreenWidth shr 1) - AmmoRect.x;
   558     if (AMAnimType and AMTypeMaskX) <> 0 then AMShiftTargetX:= (cScreenWidth shr 1) - AmmoRect.x
   556         AMShiftTargetY:= cScreenHeight        - AmmoRect.y;
   559     else AMShiftTargetX:= 0;
   557 
   560     if (AMAnimType and AMTypeMaskY) <> 0 then AMShiftTargetY:= cScreenHeight        - AmmoRect.y
   558         if (AMAnimType and AMTypeMaskX) <> 0 then AMShiftTargetX:= (cScreenWidth shr 1) - AmmoRect.x
   561     else AMShiftTargetY:= 0;
   559         else AMShiftTargetX:= 0;
   562 
   560         if (AMAnimType and AMTypeMaskY) <> 0 then AMShiftTargetY:= cScreenHeight        - AmmoRect.y
   563     AMShiftX:= AMShiftTargetX;
   561         else AMShiftTargetY:= 0;
   564     AMShiftY:= AMShiftTargetY;
   562 
       
   563         AMShiftX:= AMShiftTargetX;
       
   564         AMShiftY:= AMShiftTargetY
       
   565         end
   565 end;
   566 end;
   566 
   567 
   567 AMAnimState:= (RealTicks - AMAnimStartTime) / AMAnimDuration;
   568 AMAnimState:= (RealTicks - AMAnimStartTime) / AMAnimDuration;
   568 
   569 
   569 if AMState = AMShowing then
   570 if AMState = AMShowing then