File tree Expand file tree Collapse file tree 1 file changed +28
-0
lines changed
MethodSystem/Methods/HealthMethods Expand file tree Collapse file tree 1 file changed +28
-0
lines changed Original file line number Diff line number Diff line change 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+ }
You can’t perform that action at this time.
0 commit comments