Skip to content

Commit 1686611

Browse files
improve new method code style
1 parent 79bd22c commit 1686611

File tree

3 files changed

+26
-17
lines changed

3 files changed

+26
-17
lines changed

MethodSystem/Methods/Scp079Methods/Set079AccessTierMethod.cs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,18 @@ public override void Execute()
2020
{
2121
var plrs = Args.GetPlayers("players");
2222
var value = Args.GetInt("tier");
23-
foreach(Player p in plrs)
23+
24+
foreach (Player p in plrs)
2425
{
25-
if(p.RoleBase is Scp079Role scp)
26+
if (p.RoleBase is not Scp079Role scp)
2627
{
27-
var levelIndex = value - 1;
28-
if (scp.SubroutineModule.TryGetSubroutine(out Scp079TierManager tier))
29-
{
30-
tier.TotalExp = levelIndex != 0 ? tier.AbsoluteThresholds[levelIndex - 1] : 0;
31-
}
28+
continue;
29+
}
30+
31+
var levelIndex = value - 1;
32+
if (scp.SubroutineModule.TryGetSubroutine(out Scp079TierManager tier))
33+
{
34+
tier.TotalExp = levelIndex != 0 ? tier.AbsoluteThresholds[levelIndex - 1] : 0;
3235
}
3336
}
3437
}

MethodSystem/Methods/Scp079Methods/Set079AuxPowerMethod.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,17 @@ public override void Execute()
2020
{
2121
var plrs = Args.GetPlayers("players");
2222
var value = Args.GetInt("power");
23+
2324
foreach (Player p in plrs)
2425
{
25-
if (p.RoleBase is Scp079Role scp)
26+
if (p.RoleBase is not Scp079Role scp)
2627
{
27-
if (scp.SubroutineModule.TryGetSubroutine(out Scp079AuxManager aux))
28-
{
29-
aux.CurrentAux = value;
30-
}
28+
continue;
29+
}
30+
31+
if (scp.SubroutineModule.TryGetSubroutine(out Scp079AuxManager aux))
32+
{
33+
aux.CurrentAux = value;
3134
}
3235
}
3336
}

MethodSystem/Methods/Scp079Methods/Set079ExpMethod.cs

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,14 +20,17 @@ public override void Execute()
2020
{
2121
var plrs = Args.GetPlayers("players");
2222
var value = Args.GetInt("exp");
23+
2324
foreach (Player p in plrs)
2425
{
25-
if (p.RoleBase is Scp079Role scp)
26+
if (p.RoleBase is not Scp079Role scp)
2627
{
27-
if (scp.SubroutineModule.TryGetSubroutine(out Scp079TierManager tier))
28-
{
29-
tier.TotalExp = value;
30-
}
28+
continue;
29+
}
30+
31+
if (scp.SubroutineModule.TryGetSubroutine(out Scp079TierManager tier))
32+
{
33+
tier.TotalExp = value;
3134
}
3235
}
3336
}

0 commit comments

Comments
 (0)