Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions MethodSystem/Methods/RoleMethods/Set079AuxPowerMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@
namespace SER.MethodSystem.Methods.RoleMethods;
public class Set079AuxPowerMethod : SynchronousMethod
{
public override string Description => "Sets players EXP if he is SCP-079";
public override string Description => "Sets players Aux power if he is SCP-079";

public override Argument[] ExpectedArguments =>
[
new PlayersArgument("players"),
new IntArgument("exp")
new IntArgument("power")
];

public override void Execute()
{
var pls = Args.GetPlayers("players");
int exp = Args.GetInt("exp");
int pow = Args.GetInt("power");
foreach(Player p in pls)
{
if(p.RoleBase is Scp079Role scp)
{
if(scp.SubroutineModule.TryGetSubroutine<Scp079TierManager>(out Scp079TierManager tier))
if(scp.SubroutineModule.TryGetSubroutine<Scp079AuxManager>(out Scp079AuxManager aux))
{
tier.TotalExp = exp;
aux.CurrentAux = pow;
}
}
}
Expand Down
33 changes: 33 additions & 0 deletions MethodSystem/Methods/RoleMethods/Set079ExpMethod.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
using LabApi.Features.Wrappers;
using PlayerRoles.PlayableScps.Scp079;
using SER.ArgumentSystem.Arguments;
using SER.ArgumentSystem.BaseArguments;
using SER.MethodSystem.BaseMethods;

namespace SER.MethodSystem.Methods.RoleMethods;
public class Set079ExpMethod : SynchronousMethod
{
public override string Description => "Sets players EXP if he is SCP-079";

public override Argument[] ExpectedArguments =>
[
new PlayersArgument("players"),
new IntArgument("exp")
];

public override void Execute()
{
var pls = Args.GetPlayers("players");
int exp = Args.GetInt("exp");
foreach (Player p in pls)
{
if (p.RoleBase is Scp079Role scp)
{
if (scp.SubroutineModule.TryGetSubroutine<Scp079TierManager>(out Scp079TierManager tier))
{
tier.TotalExp = exp;
}
}
}
}
}
4 changes: 3 additions & 1 deletion MethodSystem/Methods/WarheadMethods/WarheadInfoMethod.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ public class WarheadInfoMethod : ReturningMethod
[
new OptionsArgument("property",
"isLocked",
"isOpen",
"isArmed",
"hasStarted",
"isDetonated",
Expand All @@ -29,7 +30,8 @@ public override void Execute()
ReturnValue = Args.GetOption("property") switch
{
"islocked" => new BoolValue(Warhead.IsLocked),
"isarmed" => new BoolValue(Warhead.IsAuthorized),
"isopen" => new BoolValue(Warhead.IsAuthorized),
"isarmed" => new BoolValue(Warhead.LeverStatus),
"hasstarted" => new BoolValue(Warhead.IsDetonationInProgress),
"isdetonated" => new BoolValue(Warhead.IsDetonated),
"duration" => new DurationValue(TimeSpan.FromSeconds(AlphaWarheadController.TimeUntilDetonation)),
Expand Down
13 changes: 13 additions & 0 deletions TokenSystem/Tokens/ExpressionTokens/PlayerExpressionToken.cs
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ public enum PlayerProperty
RoleSpawnFlags,
AuxiliaryPower,
Emotion,
Experience
}

public abstract class Info
Expand Down Expand Up @@ -110,6 +111,18 @@ public class Info<T>(Func<Player, T> handler, string? description) : Info
[PlayerProperty.RoleChangeReason] = new Info<TextValue>(plr => plr.RoleBase._spawnReason.ToString(), null),
[PlayerProperty.RoleSpawnFlags] = new Info<TextValue>(plr => plr.RoleBase._spawnFlags.ToString(), null),
[PlayerProperty.AuxiliaryPower] = new Info<NumberValue>(plr =>
{
if (plr.RoleBase is Scp079Role scp)
{
if (scp.SubroutineModule.TryGetSubroutine<Scp079AuxManager>(out Scp079AuxManager man))
{
return (decimal)man.CurrentAux;
}
else return -1;
}
else return -1;
}, "Returns player Aux power if he is SCP-079, otherwise returns -1"),
[PlayerProperty.Experience] = new Info<NumberValue>(plr =>
{
if (plr.RoleBase is Scp079Role scp)
{
Expand Down