Skip to content

Commit

Permalink
Merge pull request #60 from MrDave1999/feat/NewCombos
Browse files Browse the repository at this point in the history
feat!: Add new combos that improve the player's health and armour
  • Loading branch information
MrDave1999 authored Sep 6, 2024
2 parents 81b6442 + 022e66f commit 53fdbff
Show file tree
Hide file tree
Showing 12 changed files with 82 additions and 68 deletions.
1 change: 0 additions & 1 deletion src/Application/Players/Combos/ComboSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,5 @@ public async void ShowCombos(Player player)
});
_worldService.SendClientMessage(Color.Yellow, message);
selectedCombo.Give(player);
ShowCombos(player);
}
}
11 changes: 11 additions & 0 deletions src/Application/Players/Combos/ICombo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,18 @@
/// </summary>
public interface ICombo
{
/// <summary>
/// Gets the name of a combo, e.g., 100 Health and 100 Armour.
/// </summary>
string Name { get; }

/// <summary>
/// Gets the required points that a player must have to acquire the combo.
/// </summary>
int RequiredPoints { get; }

/// <summary>
/// Assigns a combo to a player, e.g., 100 Health and 100 Armour.
/// </summary>
void Give(Player player);
}
10 changes: 5 additions & 5 deletions src/Application/Players/Combos/ServiceCollectionExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ public static class ComboServicesExtensions
public static IServiceCollection AddComboServices(this IServiceCollection services)
{
services
.AddSingleton<ICombo, HealthArmour>()
.AddSingleton<ICombo, GrenadesArmour>()
.AddSingleton<ICombo, MolotovArmour>()
.AddSingleton<ICombo, SatchelChargesArmour>()
.AddSingleton<ICombo, TearGasHealth>();
.AddSingleton<ICombo, FlamethrowerVitality>()
.AddSingleton<ICombo, GrenadesVitality>()
.AddSingleton<ICombo, MolotovVitality>()
.AddSingleton<ICombo, SatchelChargesVitality>()
.AddSingleton<ICombo, TearGasVitality>();

return services;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
namespace CTF.Application.Players.Combos.Services;

public class HealthArmour : ICombo
public class FlamethrowerVitality : ICombo
{
public string Name => "100 Health, 100 Armour and FlameThrower";
public int RequiredPoints => 100;
Expand Down
15 changes: 0 additions & 15 deletions src/Application/Players/Combos/Services/GrenadesArmour.cs

This file was deleted.

16 changes: 16 additions & 0 deletions src/Application/Players/Combos/Services/GrenadesVitality.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace CTF.Application.Players.Combos.Services;

public class GrenadesVitality : ICombo
{
public string Name => "100 Health, 100 Armour and 25 Grenades";
public int RequiredPoints => 100;

public void Give(Player player)
{
PlayerInfo playerInfo = player.GetInfo();
player.Health = 100;
player.Armour = 100;
player.GiveWeapon(Weapon.Grenade, ammo: 25);
playerInfo.StatsPerRound.ResetPoints();
}
}
15 changes: 0 additions & 15 deletions src/Application/Players/Combos/Services/MolotovArmour.cs

This file was deleted.

16 changes: 16 additions & 0 deletions src/Application/Players/Combos/Services/MolotovVitality.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace CTF.Application.Players.Combos.Services;

public class MolotovVitality : ICombo
{
public string Name => "100 Health, 100 Armour and 25 Molotov cocktail";
public int RequiredPoints => 100;

public void Give(Player player)
{
PlayerInfo playerInfo = player.GetInfo();
player.Health = 100;
player.Armour = 100;
player.GiveWeapon(Weapon.Moltov, ammo: 25);
playerInfo.StatsPerRound.ResetPoints();
}
}
16 changes: 0 additions & 16 deletions src/Application/Players/Combos/Services/SatchelChargesArmour.cs

This file was deleted.

17 changes: 17 additions & 0 deletions src/Application/Players/Combos/Services/SatchelChargesVitality.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
namespace CTF.Application.Players.Combos.Services;

public class SatchelChargesVitality : ICombo
{
public string Name => "100 Health, 100 Armour and 25 Satchel charges";
public int RequiredPoints => 100;

public void Give(Player player)
{
PlayerInfo playerInfo = player.GetInfo();
player.Health = 100;
player.Armour = 100;
player.GiveWeapon(Weapon.SatchelCharge, ammo: 25);
player.GiveWeapon(Weapon.Detonator, ammo: 1);
playerInfo.StatsPerRound.ResetPoints();
}
}
15 changes: 0 additions & 15 deletions src/Application/Players/Combos/Services/TearGasHealth.cs

This file was deleted.

16 changes: 16 additions & 0 deletions src/Application/Players/Combos/Services/TearGasVitality.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
namespace CTF.Application.Players.Combos.Services;

public class TearGasVitality : ICombo
{
public string Name => "100 Health, 100 Armour and 50 Tear gas";
public int RequiredPoints => 100;

public void Give(Player player)
{
PlayerInfo playerInfo = player.GetInfo();
player.Health = 100;
player.Armour = 100;
player.GiveWeapon(Weapon.Teargas, ammo: 50);
playerInfo.StatsPerRound.ResetPoints();
}
}

0 comments on commit 53fdbff

Please sign in to comment.