some improvements

This commit is contained in:
Gurge44 committed 2026-05-14 12:13:07 +02:00
1 parent 0b982e9430
commit 412d185b13
5 files changed
+26 -18

No files matched your search

+8
View File
@@ -810,6 +810,14 @@ namespace EHR
Despawn();
}
}
public override void OnMeeting()
{
if (Options.CurrentGameMode == CustomGameMode.BedWars)
base.OnMeeting();
else
Despawn();
}
}
internal sealed class Portal : CustomNetObject
+1 -1
View File
@@ -1848,7 +1848,7 @@ internal static class ChatCommands
string result = winners.Length == 1
? string.Format(GetString("Poll.Winner"), winners[0].Key, PollAnswers[winners[0].Key], winners[0].Value) +
PollVotes.Where(x => x.Key != winners[0].Key).Aggregate("<size=70%>", (s, t) => s + $"{t.Key} - {t.Value} {PollAnswers[t.Key]}\n")
PollVotes.Where(x => x.Value > 0 && x.Key != winners[0].Key).Aggregate("<size=70%>", (s, t) => s + $"{t.Key} - {t.Value} {PollAnswers[t.Key]}\n")
: string.Format(GetString("Poll.Tie"), string.Join(" & ", winners.Select(x => $"{x.Key}{PollAnswers[x.Key]}")), maxVotes);
Utils.SendMessage(result, title: Utils.ColorString(new(0, 255, 165, 255), GetString("PollResultTitle")));
+13 -9
View File
@@ -1150,7 +1150,7 @@ internal static class TaskPanelBehaviourPatch
case CustomGameMode.StopAndGo:
{
Dictionary<byte, string> SummaryText3 = new Dictionary<byte, string>();
Dictionary<byte, string> summaryText3 = new Dictionary<byte, string>();
foreach (byte id in Main.PlayerStates.Keys)
{
@@ -1158,7 +1158,7 @@ internal static class TaskPanelBehaviourPatch
var summary = $"{Utils.GetProgressText(id)} {Utils.ColorString(Main.PlayerColors[id], name)}";
if (Utils.GetProgressText(id).Trim() == string.Empty) continue;
SummaryText3[id] = summary;
summaryText3[id] = summary;
}
List<(int, byte)> list3 = [];
@@ -1167,29 +1167,33 @@ internal static class TaskPanelBehaviourPatch
list3.Sort();
list3 = list3.OrderBy(x => !Utils.GetPlayerById(x.Item2).IsAlive()).ToList();
foreach ((int, byte) id in list3.Where(x => SummaryText3.ContainsKey(x.Item2)).ToArray())
foreach ((int, byte) id in list3.Where(x => summaryText3.ContainsKey(x.Item2)).ToArray())
{
bool alive = Utils.GetPlayerById(id.Item2).IsAlive();
finalTextBuilder.Append($"{(!alive ? "<#777777>" : string.Empty)}<size=1.6>\r\n{(alive ? SummaryText3[id.Item2].Replace("<size=2>", "<size=1.6>") : SummaryText3[id.Item2].RemoveHtmlTags())}{(!alive ? $" <#ff0000>{GetString("Dead")}</color>" : string.Empty)}</size>");
finalTextBuilder.Append($"{(!alive ? "<#777777>" : string.Empty)}<size=1.6>\r\n{(alive ? summaryText3[id.Item2].Replace("<size=2>", "<size=1.6>") : summaryText3[id.Item2].RemoveHtmlTags())}{(!alive ? $" <#ff0000>{GetString("Dead")}</color>" : string.Empty)}</size>");
}
break;
}
case CustomGameMode.HotPotato:
{
List<string> summaryText4 = [];
summaryText4.AddRange(from pc in Main.EnumeratePlayerControls() let alive = pc.IsAlive() select $"{(!alive ? "<size=90%><#777777>" : "<size=90%>")}{HotPotato.GetIndicator(pc.PlayerId)}{pc.PlayerId.ColoredPlayerName()}{(!alive ? $"</color> <#ff0000>{GetString("Dead")}</color></size>" : "</size>")}");
finalTextBuilder.Append("\r\n\r\n").Append(string.Join('\n', summaryText4));
finalTextBuilder.Append("\r\n\r\n");
finalTextBuilder.Append("<size=90%>");
finalTextBuilder.Append(string.Join('\n', Main.EnumeratePlayerControls().Select(pc => new { pc, alive = pc.IsAlive() }).OrderByDescending(x => x.alive).Select(x => $"{(!x.alive ? "<#777777><s>" : "")}{HotPotato.GetIndicator(x.pc.PlayerId)}{(x.alive ? x.pc.PlayerId.ColoredPlayerName() : Main.AllPlayerNames.GetValueOrDefault(x.pc.PlayerId, $"ID {x.pc.PlayerId}"))}{(!x.alive ? $"</color> <#ff0000>{GetString("Dead")}</color></s>" : "")}")));
finalTextBuilder.Append("</size>");
break;
}
case CustomGameMode.HideAndSeek:
{
finalTextBuilder.Append("\r\n\r\n").Append(CustomHnS.GetTaskBarText());
finalTextBuilder.Append("\r\n\r\n");
finalTextBuilder.Append(CustomHnS.GetTaskBarText());
break;
}
case CustomGameMode.Speedrun:
{
finalTextBuilder.Append("\r\n<size=90%>").Append(Speedrun.GetTaskBarText()).Append("</size>");
finalTextBuilder.Append("\r\n<size=90%>");
finalTextBuilder.Append(Speedrun.GetTaskBarText());
finalTextBuilder.Append("</size>");
break;
}
case CustomGameMode.NaturalDisasters:
@@ -148,13 +148,11 @@ public class Abyssbringer : RoleBase
public override void OnFixedUpdate(PlayerControl pc)
{
if (Count++ < 3) return;
Count = 0;
PlayerControl abyssbringer = AbyssbringerId.GetPlayer();
int count = BlackHoles.Count;
for (var i = 0; i < count; i++)
for (int i = BlackHoles.Count - 1; i >= 0; i--)
{
BlackHoleData blackHole = BlackHoles[i];
@@ -182,6 +180,7 @@ public class Abyssbringer : RoleBase
if (FastVector2.DistanceWithinRange(pos, blackHole.Position, BlackHoleRadius.GetFloat()) && !nearestPlayer.Is(CustomRoles.Pestilence))
{
nearestPlayer.SetRealKiller(abyssbringer);
nearestPlayer.RpcExileV2();
RPC.PlaySoundRPC(pc.PlayerId, Sounds.KillSound);
blackHole.PlayersConsumed++;
@@ -190,7 +189,6 @@ public class Abyssbringer : RoleBase
PlayerState state = Main.PlayerStates[nearestPlayer.PlayerId];
state.deathReason = PlayerState.DeathReason.Consumed;
state.RealKiller = (DateTime.Now, AbyssbringerId);
state.SetDead();
Utils.AfterPlayerDeathTasks(nearestPlayer);
@@ -204,8 +202,6 @@ public class Abyssbringer : RoleBase
void RemoveBlackHole()
{
BlackHoles.RemoveAt(i);
i--;
count--;
blackHole.NetObject.Despawn();
Utils.SendRPC(CustomRPC.SyncRoleData, AbyssbringerId, 3, i);
Notify();
@@ -126,10 +126,10 @@ public class Explosivist : RoleBase
{
PlayerControl pc = ExplosivistId.GetPlayer();
pc.RevertFreeze(RealPosition);
Explosive.Despawn();
Explosive = null;
RealPosition = Vector2.zero;
ExplodeTS = 0;
Explosive.Despawn();
Explosive = null;
}
}