still fixing 💀

This commit is contained in:
Gurge44 committed 2025-09-26 17:19:14 +02:00
1 parent 186f77f8b8
commit 05b2f728ca
9 files changed
+40 -18

No files matched your search

+1 -1
View File
@@ -361,6 +361,7 @@ internal static class CustomRolesHelper
CustomRoles.Silencer => Silencer.SilenceMode.GetValue() == 1 ? CustomRoles.Shapeshifter : CustomRoles.Impostor,
CustomRoles.NoteKiller => CustomRoles.Crewmate,
CustomRoles.RoomRusher => RoomRusher.CanVent ? CustomRoles.Engineer : CustomRoles.Crewmate,
CustomRoles.Clerk => CustomRoles.Crewmate,
CustomRoles.CovenMember => CustomRoles.Crewmate,
CustomRoles.Augur => Augur.CanVent.GetBool() ? CustomRoles.Engineer : CustomRoles.Crewmate,
@@ -524,7 +525,6 @@ internal static class CustomRolesHelper
CustomRoles.Postman => RoleTypes.Impostor,
CustomRoles.Dealer => RoleTypes.Impostor,
CustomRoles.Auditor => RoleTypes.Impostor,
CustomRoles.Clerk => RoleTypes.Impostor,
CustomRoles.Seamstress => RoleTypes.Shapeshifter,
CustomRoles.Spirit => RoleTypes.Shapeshifter,
CustomRoles.Starspawn => RoleTypes.Impostor,
+8 -2
View File
@@ -1483,11 +1483,14 @@ internal static class ExtendedPlayerControl
{
if (!Main.Invisible.Add(player.PlayerId)) return;
if (phantom && Options.CurrentGameMode != CustomGameMode.Standard) return;
player.RpcSetPet("");
if (!(phantom && PlayerControl.LocalPlayer.IsImpostor()))
player.MakeInvisible();
if (!phantom)
{
player.MakeInvisible();
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(player.NetId, (byte)CustomRPC.Invisibility, SendOption.Reliable);
writer.WritePacked(1);
AmongUsClient.Instance.FinishRpcImmediately(writer);
@@ -1528,11 +1531,14 @@ internal static class ExtendedPlayerControl
{
if (!Main.Invisible.Remove(player.PlayerId)) return;
if (phantom && Options.CurrentGameMode != CustomGameMode.Standard) return;
if (Options.UsePets.GetBool()) PetsHelper.SetPet(player, PetsHelper.GetPetId());
if (!(phantom && PlayerControl.LocalPlayer.IsImpostor()))
player.MakeVisible();
if (!phantom)
{
player.MakeVisible();
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(player.NetId, (byte)CustomRPC.Invisibility, SendOption.Reliable);
writer.WritePacked(0);
AmongUsClient.Instance.FinishRpcImmediately(writer);
+2
View File
@@ -69,6 +69,8 @@ public class PlayerState(byte playerId)
OutOfOxygen,
Retribution,
Taxes,
DidntVote,
SkippedVote,
// Natural Disasters
Meteor,
+4 -2
View File
@@ -2584,7 +2584,8 @@ public static class Utils
break;
}
SelfSuffix.Append(string.Join('\n', additionalSuffixes.ConvertAll(x => x.Trim()).FindAll(x => !string.IsNullOrEmpty(x))));
List<string> addSuff = additionalSuffixes.ConvertAll(x => x.Trim()).FindAll(x => !string.IsNullOrEmpty(x));
if (addSuff.Count > 0) SelfSuffix.Append("\n" + string.Join('\n', addSuff));
}
string seerRealName = seer.GetRealName(forMeeting);
@@ -2920,7 +2921,8 @@ public static class Utils
TargetSuffix.Append(BuildSuffix(seer, target, meeting: forMeeting));
TargetSuffix.Append(string.Join('\n', additionalSuffixes.ConvertAll(x => x.Trim()).FindAll(x => !string.IsNullOrEmpty(x))));
List<string> addSuff = additionalSuffixes.ConvertAll(x => x.Trim()).FindAll(x => !string.IsNullOrEmpty(x));
if (addSuff.Count > 0) TargetSuffix.Append("\n" + string.Join('\n', addSuff));
}
var targetDeathReason = string.Empty;
+5 -5
View File
@@ -131,7 +131,7 @@ internal static class CheckForEndVotingPatch
switch (Options.GetWhenSkipVote())
{
case VoteMode.Suicide:
TryAddAfterMeetingDeathPlayers(PlayerState.DeathReason.Suicide, ps.TargetPlayerId);
TryAddAfterMeetingDeathPlayers(PlayerState.DeathReason.SkippedVote, ps.TargetPlayerId);
voteLog.Info($"{voter.GetNameWithRole().RemoveHtmlTags()} Commit suicide for skipping voting");
break;
case VoteMode.SelfVote:
@@ -146,7 +146,7 @@ internal static class CheckForEndVotingPatch
switch (Options.GetWhenNonVote())
{
case VoteMode.Suicide:
TryAddAfterMeetingDeathPlayers(PlayerState.DeathReason.Suicide, ps.TargetPlayerId);
TryAddAfterMeetingDeathPlayers(PlayerState.DeathReason.DidntVote, ps.TargetPlayerId);
voteLog.Info($"{voter.GetNameWithRole().RemoveHtmlTags()} Committed suicide for not voting");
break;
case VoteMode.SelfVote:
@@ -158,11 +158,11 @@ internal static class CheckForEndVotingPatch
voteLog.Info($"{voter.GetNameWithRole().RemoveHtmlTags()} Skip for not voting");
break;
}
if (voter.Is(CustomRoles.Compelled))
TryAddAfterMeetingDeathPlayers(PlayerState.DeathReason.Suicide, ps.TargetPlayerId);
}
}
if (ps.VotedFor == 254 && !voter.Data.IsDead && voter.Is(CustomRoles.Compelled))
TryAddAfterMeetingDeathPlayers(PlayerState.DeathReason.DidntVote, ps.TargetPlayerId);
if (CheckRole(ps.TargetPlayerId, CustomRoles.Divinator) && Divinator.HideVote.GetBool()) continue;
if (CheckRole(ps.TargetPlayerId, CustomRoles.Eraser) && Eraser.HideVote.GetBool()) continue;
+6 -2
View File
@@ -2008,10 +2008,14 @@ internal static class FixedUpdatePatch
if (MeetingStates.FirstMeeting && Main.ShieldPlayer == target.FriendCode && !string.IsNullOrEmpty(target.FriendCode) && !self && Options.CurrentGameMode is CustomGameMode.Standard or CustomGameMode.SoloKombat or CustomGameMode.FFA)
additionalSuffixes.Add(GetString("DiedR1Warning"));
Suffix.Append(string.Join('\n', additionalSuffixes.ConvertAll(x => x.Trim()).FindAll(x => !string.IsNullOrEmpty(x))));
List<string> addSuff = additionalSuffixes.ConvertAll(x => x.Trim()).FindAll(x => !string.IsNullOrEmpty(x));
if (addSuff.Count > 0) Suffix.Append("\n" + string.Join('\n', addSuff));
if (self && GameStartTimeStamp + 44 > TimeStamp && Main.HasPlayedGM.TryGetValue(Options.CurrentGameMode, out HashSet<string> playedFCs) && !playedFCs.Contains(seer.FriendCode))
Suffix.Append($"\n\n<#ffffff>{GetString($"GameModeTutorial.{Options.CurrentGameMode}")}</color>\n");
if (Suffix.Length > 0 && !Suffix.ToString().StartsWith('\n'))
Suffix.Insert(0, "\n");
// Devourer
if (Devourer.HideNameOfConsumedPlayer.GetBool() && Devourer.PlayerIdList.Any(x => Main.PlayerStates[x].Role is Devourer { IsEnable: true } dv && dv.PlayerSkinsCosumed.Contains(target.PlayerId)))
@@ -2044,7 +2048,7 @@ internal static class FixedUpdatePatch
if (Suffix.ToString() != string.Empty)
{
offset += moveandstop ? 0.15f : 0.2f;
offset += moveandstop ? 0.15f : 0.1f;
offset += moveandstop ? 0f : Suffix.ToString().Count(x => x == '\n') * 0.15f;
}
+3 -1
View File
@@ -1960,6 +1960,8 @@
"DeathReason.WipedOut": "Wiped Out",
"DeathReason.Retribution": "Retribution",
"DeathReason.Taxes": "Taxes",
"DeathReason.DidntVote": "Didn't Vote",
"DeathReason.SkippedVote": "Skipped Voting",
"ND_DRLaughMessage.Meteor": "Meteor.... I hardly knew her!",
"ND_DRLaughMessage.Lava": "Lava is not the best place to swim, huh?",
"ND_DRLaughMessage.Tornado": "Out for a spin? I hope this tornado didn't make you dizzy!",
@@ -9316,7 +9318,7 @@
"ClerkInfoLong": "(Neutrals):\\nAs the Clerk, you may vote for someone in a meeting to check their taxes. If they've completed a task in the last round (or finished them all, or they have none), they get a tax refund (speed & vision boost for the next round). Otherwise, they die.\\n\\nYou win if crewmates lose. Or if the game ends due to a task win (everyone did their taxes)!",
"Clerk.CanUseAbilityOnFirstMeeting": "Can Use Ability on First Meeting",
"Clerk.DidTax": "{0} did their taxes. They got a refund!",
"Clerk.Killed": "{0} was cought not doing their taxes (tasks). They were killed!",
"Clerk.Killed": "{0} was caught not doing their taxes (tasks). They were killed!",
"Decryptor": "Decryptor",
"DecryptorInfo": "Get Letters From Everyone's Roles",
"DecryptorInfoLong": "(Crewmates):\\nAs the Decryptor, each X tasks you complete (X is set by the host), you get to know one more letter from everyone's roles. You can see these characters below players' names. The letters are not in order and each letter only appears once for every occurance in the role name. Settings determine whether you can guess.",
+2 -2
View File
@@ -6,8 +6,8 @@ public class Tree : RoleBase
{
public static bool On;
public const string Sprite = "<line-height=67%><alpha=#00>█<alpha=#00>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<alpha=#00>█<alpha=#00>█<br><alpha=#00>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<alpha=#00>█<br><#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<br><#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<br><#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<br><alpha=#00>█<alpha=#00>█<alpha=#00>█<#711e1e>█<#711e1e>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<br><alpha=#00>█<alpha=#00>█<alpha=#00>█<#711e1e>█<#711e1e>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<br><alpha=#00>█<alpha=#00>█<alpha=#00>█<#711e1e>█<#711e1e>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<br></line-height>";
public const string FallenSprite = "<line-height=67%><alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<br><alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<br><alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<br><alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<#6ef514>█<#6ef514>█<alpha=#00>█<alpha=#00>█<br><alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<#6ef514>█<#6ef514>█<#6ef514>█<alpha=#00>█<br><alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<br><#6f1515>█<#6f1515>█<#6f1515>█<#6f1515>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<br><#6f1515>█<#6f1515>█<#6f1515>█<#6f1515>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<br></line-height>";
public const string Sprite = "<voffset=7em><alpha=#00>.</alpha></voffset><size=150%><font=\"VCR SDF\"><line-height=67%><alpha=#00>█<alpha=#00>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<alpha=#00>█<alpha=#00>█<br><alpha=#00>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<alpha=#00>█<br><#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<br><#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<br><#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<br><alpha=#00>█<alpha=#00>█<alpha=#00>█<#711e1e>█<#711e1e>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<br><alpha=#00>█<alpha=#00>█<alpha=#00>█<#711e1e>█<#711e1e>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<br><alpha=#00>█<alpha=#00>█<alpha=#00>█<#711e1e>█<#711e1e>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<br></line-height></font></size>";
public const string FallenSprite = "<size=150%><font=\"VCR SDF\"><line-height=67%><alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<br><alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<br><alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<br><alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<#6ef514>█<#6ef514>█<alpha=#00>█<alpha=#00>█<br><alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<#6ef514>█<#6ef514>█<#6ef514>█<alpha=#00>█<br><alpha=#00>█<alpha=#00>█<alpha=#00>█<alpha=#00>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<br><#6f1515>█<#6f1515>█<#6f1515>█<#6f1515>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<br><#6f1515>█<#6f1515>█<#6f1515>█<#6f1515>█<#6ef514>█<#6ef514>█<#6ef514>█<#6ef514>█<br></line-height></font></size>";
public override bool IsEnable => On;
+9 -3
View File
@@ -141,6 +141,8 @@ public class Ambusher : RoleBase
DontCheck = true;
AbilityEndTimer = InvisDurAfterSuccessfulAmbush.GetFloat();
FragilePlayers[TargetId] = now + FragileDuration.GetInt();
Utils.SendRPC(CustomRPC.SyncRoleData, AmbusherId, 3, TargetId);
Utils.NotifyRoles(SpecifySeer: pc, SpecifyTarget: TargetId.GetPlayer());
TargetId = byte.MaxValue;
TargetTimer = FollowDuration.GetFloat();
}
@@ -151,8 +153,8 @@ public class Ambusher : RoleBase
if (AbilityEndTimer <= 0)
{
pc.SetKillCooldown(KillCooldown.GetFloat());
pc.RpcMakeVisible(true);
pc.SetKillCooldown(KillCooldown.GetFloat());
AbilityEndTimer = AbilityDuration.GetFloat();
LastRPCTS = 0;
Count = 30;
@@ -162,7 +164,7 @@ public class Ambusher : RoleBase
if (LastRPCTS != now)
{
pc.RpcResetAbilityCooldown();
Utils.SendRPC(CustomRPC.SyncRoleData, AmbusherId, TargetId, TargetTimer, AbilityEndTimer, DontCheck);
Utils.SendRPC(CustomRPC.SyncRoleData, AmbusherId, 1, TargetId, TargetTimer, AbilityEndTimer, DontCheck);
LastRPCTS = now;
}
@@ -176,7 +178,11 @@ public class Ambusher : RoleBase
public override void OnGlobalFixedUpdate(PlayerControl pc, bool lowLoad)
{
if (!lowLoad && FragilePlayers.TryGetValue(pc.PlayerId, out long endTS) && Utils.TimeStamp >= endTS)
{
FragilePlayers.Remove(pc.PlayerId);
Utils.SendRPC(CustomRPC.SyncRoleData, AmbusherId, 2, pc.PlayerId);
Utils.NotifyRoles(SpecifySeer: AmbusherId.GetPlayer(), SpecifyTarget: pc);
}
}
public override void OnReportDeadBody()
@@ -185,7 +191,7 @@ public class Ambusher : RoleBase
TargetTimer = FollowDuration.GetFloat();
AbilityEndTimer = AbilityDuration.GetFloat();
DontCheck = false;
Utils.SendRPC(CustomRPC.SyncRoleData, AmbusherId, TargetId, TargetTimer, AbilityEndTimer, DontCheck);
Utils.SendRPC(CustomRPC.SyncRoleData, AmbusherId, 1, TargetId, TargetTimer, AbilityEndTimer, DontCheck);
}
public void ReceiveRPC(MessageReader reader)