implement reloading

This commit is contained in:
Vinzenz Schroeter 2024-04-29 17:17:44 +02:00
parent 9164d90443
commit a5a3ca3013
5 changed files with 34 additions and 8 deletions

View file

@ -21,11 +21,16 @@ internal sealed class CollectPowerUp(
continue;
// now the tank overlaps the power up by at least 0.5 tiles
tank.Magazine = tank.Magazine with
{
UsedBullets = 0,
Type = MagazineType.Explosive
Type = tank.Magazine.Type | MagazineType.Explosive
};
if (tank.ReloadingUntil >= DateTime.Now)
tank.ReloadingUntil = DateTime.Now;
tank.Owner.Scores.PowerUpsCollected++;
return true;
}