Skip to content

Commit d3c4a96

Browse files
Create AddHumeMethod.cs
1 parent 1ecb211 commit d3c4a96

File tree

1 file changed

+28
-0
lines changed

1 file changed

+28
-0
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
using System;
2+
using SER.ArgumentSystem.Arguments;
3+
using SER.ArgumentSystem.BaseArguments;
4+
using SER.MethodSystem.BaseMethods;
5+
6+
namespace SER.MethodSystem.Methods.HealthMethods;
7+
8+
public class AddHumeMethod : SynchronousMethod
9+
{
10+
public override string Description => $"Adds hume shield to players. Do not confuse this method with {nameof(SetHumeShieldMethod)}";
11+
12+
public override Argument[] ExpectedArguments { get; } =
13+
[
14+
new PlayersArgument("players"),
15+
new FloatArgument("amount", 0)
16+
];
17+
18+
public override void Execute()
19+
{
20+
var players = Args.GetPlayers("players");
21+
var amount = Args.GetFloat("amount");
22+
23+
players.ForEach(plr =>
24+
{
25+
plr.HumeShield += Math.Min(plr.MaxHumeShield, plr.HumeShield + amount);
26+
});
27+
}
28+
}

0 commit comments

Comments
 (0)