diff --git a/.vs/EvilSatellites/v16/.suo b/.vs/EvilSatellites/v16/.suo index c07cd40..21c6bbf 100644 Binary files a/.vs/EvilSatellites/v16/.suo and b/.vs/EvilSatellites/v16/.suo differ diff --git a/EvilSatellites/Objects/Debris.cs b/EvilSatellites/Objects/Debris.cs index b1dfb66..95e690f 100644 --- a/EvilSatellites/Objects/Debris.cs +++ b/EvilSatellites/Objects/Debris.cs @@ -56,6 +56,8 @@ namespace EvilSatellites.Objects var player = (Player)obj; if (player.Vacuuming) { + player.CurrentWeapon.RemainingAmmo += rnd.Next(player.CurrentWeapon.MaxAmmo); + Destroy(); return; } player.TakeDamage(25); diff --git a/EvilSatellites/Objects/Player.cs b/EvilSatellites/Objects/Player.cs index 10976e6..2c683a3 100644 --- a/EvilSatellites/Objects/Player.cs +++ b/EvilSatellites/Objects/Player.cs @@ -103,6 +103,10 @@ namespace EvilSatellites.Objects sfxTurn.Update(gameTime); sfxElevator.Update(gameTime); sfxVacuum.Update(gameTime); + if (Health < 100) + { + IncreaseHealth(0.01f); + } if (Movement.Length() != 0) { if (Movement.X > 0) @@ -201,6 +205,16 @@ namespace EvilSatellites.Objects Screen.Manager.Sound.PlayOneshot(dmgSound); } + public void IncreaseHealth(float amount) + { + Health += amount; + if (Health > 25 && IsDamaged) + { + IsDamaged = false; + sfxDamage.Pause(); + } + } + public void PlayTap() { sfxTaps.Play(); diff --git a/EvilSatellites/Screens/GameScreen.cs b/EvilSatellites/Screens/GameScreen.cs index 54cec5a..32f2f8f 100644 --- a/EvilSatellites/Screens/GameScreen.cs +++ b/EvilSatellites/Screens/GameScreen.cs @@ -179,7 +179,16 @@ namespace EvilSatellites.Screens Tolk.Output("Satellites"); } } - + if (Input.IsJustPressed(Keys.H)) + { + _player.PlayTap(); + Tolk.Output(_player.Health.ToString() + " health", true); + } + if (Input.IsJustPressed(Keys.X)) + { + _player.PlayTap(); + Tolk.Output(_player.CurrentWeapon.RemainingAmmo.ToString() + " rounds", true); + } if (Input.IsJustPressed(Keys.O)) { DavyKager.Tolk.Output(Objects.Count.ToString()); diff --git a/EvilSatellites/Weapons/LaserMG.cs b/EvilSatellites/Weapons/LaserMG.cs index 48a63ee..0501b6b 100644 --- a/EvilSatellites/Weapons/LaserMG.cs +++ b/EvilSatellites/Weapons/LaserMG.cs @@ -17,6 +17,7 @@ namespace EvilSatellites.Weapons public ISoundEffect sfxSpindown; public ISoundEffect sfxSpinup; public ISoundEffect sfxSpinning; + public ISoundEffect sfxEmpty; public GameScreen Screen; public LaserMG(IGameObject wielder, GameScreen screen) { @@ -37,6 +38,8 @@ namespace EvilSatellites.Weapons sfxSpinning = Screen.Manager.Sound.Load(@"sfx/weapons/LaserMG/spinning.wav", false); sfxSpinning.Loop = true; sfxShoot = new AudioAsset(Screen.Manager.Sound, @"sfx/weapons/LaserMG/fire", 1, 4); + sfxEmpty = Screen.Manager.Sound.Load(@"sfx/weapons/LaserMG/empty.wav", false); + sfxEmpty.ConnectToEffect(Screen.Manager.EnvironmentEffect); sfxReload.ConnectToEffect(Screen.Manager.EnvironmentEffect); sfxShoot.AddEffect(Screen.Manager.EnvironmentEffect); sfxSpindown.ConnectToEffect(Screen.Manager.EnvironmentEffect); @@ -84,10 +87,19 @@ namespace EvilSatellites.Weapons { if (TimerEnd - TimerStart > FireRate) { - sfxShoot.Play(); - TimerStart = TimerEnd; - Projectile proj = new Projectile(Screen, _wielder.Position, _wielder.Rotation, _wielder); - Screen.AddObject(proj); + if (RemainingAmmo > 0) + { + sfxShoot.Play(); + RemainingAmmo--; + TimerStart = TimerEnd; + Projectile proj = new Projectile(Screen, _wielder.Position, _wielder.Rotation, _wielder); + Screen.AddObject(proj); + } else + { + sfxEmpty.Reset(); + sfxEmpty.Play(); + TimerStart = TimerEnd; + } } } if (State == WeaponState.Stopping) diff --git a/EvilSatellites/sfx/weapons/LaserMG/empty.wav b/EvilSatellites/sfx/weapons/LaserMG/empty.wav new file mode 100644 index 0000000..199c8ac --- /dev/null +++ b/EvilSatellites/sfx/weapons/LaserMG/empty.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f8abd1efdf4645a55976cea45a1537b59bf312d27729442e2b1c52106777de4 +size 103016 diff --git a/alarmAltitude.wav b/alarmAltitude.wav new file mode 100644 index 0000000..199c8ac --- /dev/null +++ b/alarmAltitude.wav @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:8f8abd1efdf4645a55976cea45a1537b59bf312d27729442e2b1c52106777de4 +size 103016