This commit is contained in:
Gurge44 committed 2026-02-02 09:20:21 +01:00
1 parent 9d030afedd
commit a31bbe1459
7 files changed
+65 -27

No files matched your search

+1
View File
@@ -262,6 +262,7 @@ public static class SpamManager
if (text.Contains("STart")) return true;
if (text.Contains("s t a r t")) return true;
if (text.Contains("begin")) return true;
if (text.Contains("commence")) return true;
if (text.Contains('了')) return false;
if (text.Contains('没')) return false;
if (text.Contains('吗')) return false;
+5 -5
View File
@@ -180,6 +180,11 @@ public static class Utils
}
}
CheckInvalidMovementPatch.LastPosition[pc.PlayerId] = location;
CheckInvalidMovementPatch.ExemptedPlayers.Add(pc.PlayerId);
AFKDetector.TempIgnoredPlayers.Add(pc.PlayerId);
LateTask.New(() => AFKDetector.TempIgnoredPlayers.Remove(pc.PlayerId), 0.2f + CalculatePingDelay(), log: false);
nt.SnapTo(location, (ushort)(nt.lastSequenceId + 328));
nt.SetDirtyBit(uint.MaxValue);
@@ -200,11 +205,6 @@ public static class Utils
if (log) Logger.Info($"{pc.GetNameWithRole().RemoveHtmlTags()} => {location}", "TP");
CheckInvalidMovementPatch.LastPosition[pc.PlayerId] = location;
CheckInvalidMovementPatch.ExemptedPlayers.Add(pc.PlayerId);
AFKDetector.TempIgnoredPlayers.Add(pc.PlayerId);
LateTask.New(() => AFKDetector.TempIgnoredPlayers.Remove(pc.PlayerId), 0.2f + CalculatePingDelay(), log: false);
if (submerged)
{
SubmergedCompatibility.ChangeFloor(pc.PlayerId, pc.transform.position.y > -7);
+5 -1
View File
@@ -2976,7 +2976,11 @@ internal static class ChatCommands
{
text = text.Replace("着", "者").Trim().ToLower();
return text switch { _ => text };
return text switch
{
"Schrödinger's Cat" or "cat" => "SchrodingersCat",
_ => text
};
}
public static bool GetRoleByName(string name, out CustomRoles role)
@@ -36,12 +36,6 @@ public class Imitator : RoleBase
PlayerIdList.Add(playerId);
}
public override void Remove(byte playerId)
{
PlayerIdList.Remove(playerId);
ImitatingRole.Remove(playerId);
}
public static void SetRoles()
{
foreach (byte id in PlayerIdList)
+39 -6
View File
@@ -22,6 +22,7 @@ internal class Ninja : RoleBase
private bool IsUndertaker;
private float MarkCooldown;
public byte MarkedPlayer;
public byte NinjaId;
public override bool IsEnable => PlayerIdList.Count > 0;
@@ -54,6 +55,7 @@ internal class Ninja : RoleBase
public override void Add(byte playerId)
{
NinjaId = playerId;
PlayerIdList.Add(playerId);
MarkedPlayer = byte.MaxValue;
IsUndertaker = Main.PlayerStates[playerId].MainRole == CustomRoles.Undertaker;
@@ -109,7 +111,6 @@ internal class Ninja : RoleBase
else
{
if (UsePets.GetBool()) return;
AURoleOptions.ShapeshifterCooldown = AssassinateCooldown;
}
}
@@ -120,6 +121,15 @@ internal class Ninja : RoleBase
return CanKillAfterAssassinate || (!pc.IsShifted() && (pc.Data.Role as PhantomRole) is null or { IsInvisible: false });
}
public override void AfterMeetingTasks()
{
if (MarkedPlayer != byte.MaxValue && MarkedPlayer.GetPlayer() == null)
{
MarkedPlayer = byte.MaxValue;
SendRPC(NinjaId);
}
}
public override bool OnCheckMurder(PlayerControl killer, PlayerControl target)
{
if (killer.IsShifted())
@@ -180,16 +190,41 @@ internal class Ninja : RoleBase
if (!IsUndertaker)
{
float time = InvisibilityTimeAfterAssassinateOpt.GetFloat();
PlayerControl target = Utils.GetPlayerById(MarkedPlayer);
if (time >= 1f)
if (time >= 1f && target != null && target.IsAlive() && !Pelican.IsEaten(target.PlayerId) && !target.inVent && pc.RpcCheckAndMurder(target, check: true))
{
pc.RpcMakeInvisible();
pc.RpcMakeInvisible(phantom: true);
Vector2 targetPosition = target.Pos();
CheckInvalidMovementPatch.LastPosition[pc.PlayerId] = targetPosition;
CheckInvalidMovementPatch.ExemptedPlayers.Add(pc.PlayerId);
AFKDetector.TempIgnoredPlayers.Add(pc.PlayerId);
LateTask.New(() => AFKDetector.TempIgnoredPlayers.Remove(pc.PlayerId), 0.2f + Utils.CalculatePingDelay(), log: false);
pc.NetTransform.SnapTo(targetPosition, (ushort)(pc.NetTransform.lastSequenceId + 328));
pc.NetTransform.SetDirtyBit(uint.MaxValue);
MessageWriter messageWriter = AmongUsClient.Instance.StartRpcImmediately(pc.NetTransform.NetId, (byte)RpcCalls.SnapTo, SendOption.Reliable, pc.OwnerId);
NetHelpers.WriteVector2(targetPosition, messageWriter);
messageWriter.Write((ushort)(pc.NetTransform.lastSequenceId + 8));
AmongUsClient.Instance.FinishRpcImmediately(messageWriter);
target.Suicide(PlayerState.DeathReason.Kill, pc);
RPC.PlaySoundRPC(pc.PlayerId, Sounds.KillSound);
MarkedPlayer = byte.MaxValue;
SendRPC(pc.PlayerId);
pc.SetKillCooldown(AdjustedDefaultKillCooldown);
LateTask.New(() =>
{
if (!GameStates.IsInTask || ExileController.Instance || AntiBlackout.SkipTasks) return;
pc.RpcMakeVisible();
pc.RpcMakeVisible(phantom: true);
}, time, log: false);
return false;
}
}
@@ -208,8 +243,6 @@ internal class Ninja : RoleBase
{
MarkedPlayer = byte.MaxValue;
SendRPC(pc.PlayerId);
pc.ResetKillCooldown();
pc.SyncSettings();
pc.SetKillCooldown(AdjustedDefaultKillCooldown);
}
else if (!tpSuccess) pc.Notify(GetString("TargetCannotBeTeleported"));
+1 -5
View File
@@ -174,10 +174,9 @@ public class Werewolf : RoleBase
}
}
if (LastFixedTime != now && RampageTime != -10)
if (LastFixedTime != now && RampageTime != -10 && !player.inVent)
{
LastFixedTime = now;
var refresh = false;
long remainTime = RampageTime + (long)RampageDur.GetFloat() - now;
switch (remainTime)
@@ -188,14 +187,11 @@ public class Werewolf : RoleBase
if (!player.IsModdedClient()) player.RpcChangeRoleBasis(CustomRoles.CrewmateEHR);
RampageTime = -10;
SendRPC();
refresh = true;
break;
case <= 10 when !player.IsModdedClient():
player.Notify(string.Format(GetString("WWRampageCountdown"), remainTime + 1), overrideAll: true);
break;
}
if (refresh) SendRPC();
}
}
+14 -4
View File
@@ -81,11 +81,16 @@ public class Curser : RoleBase
{
KnownFactionPlayers.Add(target.PlayerId);
Utils.NotifyRoles(SpecifySeer: killer, SpecifyTarget: target);
killer.SetKillCooldown();
killer.RpcRemoveAbilityUse();
}))
{
Pick:
killer.SetKillCooldown();
killer.RpcRemoveAbilityUse();
int random = IRandom.Instance.Next(4);
Pick:
switch (random)
{
@@ -94,7 +99,14 @@ public class Curser : RoleBase
break;
case 1:
CustomRoles addon = Options.GroupedAddons[AddonTypes.Harmful].Where(x => !target.Is(x) && !x.IsNotAssignableMidGame() && CustomRolesHelper.CheckAddonConflict(x, target)).RandomElement();
if (addon == default(CustomRoles)) goto Pick;
if (addon == default(CustomRoles))
{
random = IRandom.Instance.Next(3);
if (random >= 1) random++;
goto Pick;
}
target.RpcSetCustomRole(addon);
break;
case 2:
@@ -108,8 +120,6 @@ public class Curser : RoleBase
}
killer.Notify(Translator.GetString($"Curser.Notify.{random}"));
killer.SetKillCooldown();
killer.RpcRemoveAbilityUse();
}
return false;