mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-11-19 13:16:56 +00:00
fix
This commit is contained in:
1 parent
0029de60b4
commit
841c504103
2 files changed
+39
-20
No files matched your search
+16
-13
@@ -110,19 +110,22 @@ internal static class SoloPVP
|
||||
}, 3f);
|
||||
Utils.SendRPC(CustomRPC.SoloPVPSync, 1);
|
||||
|
||||
foreach (PlayerControl pc in Main.CachedAlivePlayerControls())
|
||||
foreach (PlayerControl pc in Main.EnumeratePlayerControls())
|
||||
{
|
||||
PlayerHPMax.TryAdd(pc.PlayerId, SoloPVP_HPMax.GetFloat());
|
||||
PlayerHP.TryAdd(pc.PlayerId, SoloPVP_HPMax.GetFloat());
|
||||
PlayerHPReco.TryAdd(pc.PlayerId, SoloPVP_RecoverPerSecond.GetFloat());
|
||||
PlayerATK.TryAdd(pc.PlayerId, SoloPVP_ATK.GetFloat());
|
||||
PlayerDF.TryAdd(pc.PlayerId, 0f);
|
||||
|
||||
PlayerScore.TryAdd(pc.PlayerId, 0);
|
||||
Utils.SendRPC(CustomRPC.SoloPVPSync, 2, pc.PlayerId, 0);
|
||||
|
||||
LastHurt.TryAdd(pc.PlayerId, Utils.TimeStamp);
|
||||
LastCountdownTime.TryAdd(pc.PlayerId, Utils.TimeStamp);
|
||||
try
|
||||
{
|
||||
PlayerHPMax.TryAdd(pc.PlayerId, SoloPVP_HPMax.GetFloat());
|
||||
PlayerHP.TryAdd(pc.PlayerId, SoloPVP_HPMax.GetFloat());
|
||||
PlayerHPReco.TryAdd(pc.PlayerId, SoloPVP_RecoverPerSecond.GetFloat());
|
||||
PlayerATK.TryAdd(pc.PlayerId, SoloPVP_ATK.GetFloat());
|
||||
PlayerDF.TryAdd(pc.PlayerId, 0f);
|
||||
PlayerScore.TryAdd(pc.PlayerId, 0);
|
||||
LastHurt.TryAdd(pc.PlayerId, Utils.TimeStamp);
|
||||
LastCountdownTime.TryAdd(pc.PlayerId, Utils.TimeStamp);
|
||||
|
||||
Utils.SendRPC(CustomRPC.SoloPVPSync, 2, pc.PlayerId, 0);
|
||||
}
|
||||
catch (Exception e) { Utils.ThrowException(e); }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -342,7 +345,7 @@ internal static class SoloPVP
|
||||
if (!GameStates.IsInTask || ExileController.Instance || !Main.IntroDestroyed || Options.CurrentGameMode != CustomGameMode.SoloPVP || !AmongUsClient.Instance.AmHost || id >= 254) return;
|
||||
|
||||
long now = Utils.TimeStamp;
|
||||
if (LastCountdownTime[id] == now) return;
|
||||
if (!LastCountdownTime.TryGetValue(id, out long ts) || ts == now) return;
|
||||
LastCountdownTime[id] = now;
|
||||
|
||||
if (LastHurt[id] + SoloPVP_RecoverAfterSecond.GetInt() < now && PlayerHP[id] < PlayerHPMax[id] && __instance.SoloAlive() && !__instance.inVent)
|
||||
|
||||
+23
-7
@@ -1273,13 +1273,29 @@ internal static class TaskPanelBehaviourPatch
|
||||
{
|
||||
byte playerId = player.PlayerId;
|
||||
|
||||
FinalTextBuilder.Append("\r\n\r\n")
|
||||
.Append(GetString("PVP.ATK")).Append(": ").Append(SoloPVP.PlayerATK[playerId].ToString("N1"))
|
||||
.Append("\r\n")
|
||||
.Append(GetString("PVP.DF")).Append(": ").Append(SoloPVP.PlayerDF[playerId].ToString("N1"))
|
||||
.Append("\r\n")
|
||||
.Append(GetString("PVP.RCO")).Append(": ").Append(SoloPVP.PlayerHPReco[playerId].ToString("N1"))
|
||||
.Append("\r\n").Append("<size=80%>");
|
||||
FinalTextBuilder.Append('\r');
|
||||
FinalTextBuilder.Append('\n');
|
||||
FinalTextBuilder.Append('\r');
|
||||
FinalTextBuilder.Append('\n');
|
||||
FinalTextBuilder.Append(GetString("PVP.ATK"));
|
||||
FinalTextBuilder.Append(':');
|
||||
FinalTextBuilder.Append(' ');
|
||||
FinalTextBuilder.Append(SoloPVP.PlayerATK.GetValueOrDefault(playerId).ToString("N1"));
|
||||
FinalTextBuilder.Append('\r');
|
||||
FinalTextBuilder.Append('\n');
|
||||
FinalTextBuilder.Append(GetString("PVP.DF"));
|
||||
FinalTextBuilder.Append(':');
|
||||
FinalTextBuilder.Append(' ');
|
||||
FinalTextBuilder.Append(SoloPVP.PlayerDF.GetValueOrDefault(playerId).ToString("N1"));
|
||||
FinalTextBuilder.Append('\r');
|
||||
FinalTextBuilder.Append('\n');
|
||||
FinalTextBuilder.Append(GetString("PVP.RCO"));
|
||||
FinalTextBuilder.Append(':');
|
||||
FinalTextBuilder.Append(' ');
|
||||
FinalTextBuilder.Append(SoloPVP.PlayerHPReco.GetValueOrDefault(playerId).ToString("N1"));
|
||||
FinalTextBuilder.Append('\r');
|
||||
FinalTextBuilder.Append('\n');
|
||||
FinalTextBuilder.Append("<size=80%>");
|
||||
|
||||
SortedPlayers.Clear();
|
||||
foreach (var key in playerStates.Keys)
|
||||
|
||||
Reference in new issue
Block a user