more fixes

This commit is contained in:
Gurge44 committed 2025-05-22 18:48:27 +02:00
1 parent f0b541bf11
commit 4a91f1731a
6 files changed
+354 -348

No files matched your search

+8
View File
@@ -84,6 +84,7 @@ public static class TheMindGame
.SetGameMode(gameMode);
TimeForEachPickInRound1Option = new IntegerOptionItem(id++, "TMG.Setting.TimeForEachPickInRound1", new IntegerValueRule(1, 60, 1), 12, tab)
.SetValueFormat(OptionFormat.Seconds)
.SetColor(color)
.SetGameMode(gameMode);
@@ -92,18 +93,22 @@ public static class TheMindGame
.SetGameMode(gameMode);
MinPlayersInRound2Option = new IntegerOptionItem(id++, "TMG.Setting.MinPlayersInRound2", new IntegerValueRule(1, 15, 1), 10, tab)
.SetValueFormat(OptionFormat.Players)
.SetColor(color)
.SetGameMode(gameMode);
SuperPointsToNormalPointsMultiplierOption = new IntegerOptionItem(id++, "TMG.Setting.SuperPointsToNormalPointsMultiplier", new IntegerValueRule(1, 10, 1), 3, tab)
.SetValueFormat(OptionFormat.Multiplier)
.SetColor(color)
.SetGameMode(gameMode);
TimeForEachPickInRound2Option = new IntegerOptionItem(id++, "TMG.Setting.TimeForEachPickInRound2", new IntegerValueRule(1, 60, 1), 25, tab)
.SetValueFormat(OptionFormat.Seconds)
.SetColor(color)
.SetGameMode(gameMode);
TimeForItemPurchasingInRound2Option = new IntegerOptionItem(id++, "TMG.Setting.TimeForItemPurchasingInRound2", new IntegerValueRule(1, 60, 1), 40, tab)
.SetValueFormat(OptionFormat.Seconds)
.SetColor(color)
.SetGameMode(gameMode);
@@ -112,14 +117,17 @@ public static class TheMindGame
.SetGameMode(gameMode);
TimeForEachPickInRound3Option = new IntegerOptionItem(id++, "TMG.Setting.TimeForEachPickInRound3", new IntegerValueRule(1, 60, 1), 20, tab)
.SetValueFormat(OptionFormat.Seconds)
.SetColor(color)
.SetGameMode(gameMode);
MaxPlayersForRound4Option = new IntegerOptionItem(id++, "TMG.Setting.MaxPlayersForRound4", new IntegerValueRule(1, 15, 1), 5, tab)
.SetValueFormat(OptionFormat.Players)
.SetColor(color)
.SetGameMode(gameMode);
MindDetectiveFailChanceOption = new IntegerOptionItem(id++, "TMG.Setting.MindDetectiveFailChance", new IntegerValueRule(0, 100, 1), 5, tab)
.SetValueFormat(OptionFormat.Percent)
.SetColor(color)
.SetGameMode(gameMode);
+1 -8
View File
@@ -1545,14 +1545,7 @@ internal static class ExtendedPlayerControl
Vector2 pos = target.Pos();
Main.PlayerStates.Values.DoIf(x => !x.IsDead && x.Role.SeesArrowsToDeadBodies && !x.SubRoles.Contains(CustomRoles.Blind) && x.Player != null, x => LocateArrow.Add(x.Player.PlayerId, pos));
var sender = CustomRpcSender.Create("Kill", SendOption.Reliable);
if (AmongUsClient.Instance.AmClient) killer.MurderPlayer(target, MurderResultFlags.Succeeded);
sender.AutoStartRpc(killer.NetId, 12);
sender.WriteNetObject(target);
sender.Write((int)MurderResultFlags.Succeeded);
sender.EndRpc();
sender.SendMessage();
killer.RpcMurderPlayer(target, true);
if (Main.PlayerStates.TryGetValue(target.PlayerId, out var state) && !state.IsDead)
state.SetDead();
-1
View File
@@ -655,7 +655,6 @@ internal static class MurderPlayerPatch
if (target.AmOwner) RemoveDisableDevicesPatch.UpdateDisableDevices();
if (!target.Data.IsDead || !AmongUsClient.Instance.AmHost) return;
if (OverKiller.OverDeadPlayerList.Contains(target.PlayerId)) return;
PlayerControl killer = __instance; // Alternative variable
+326 -326
View File
File diff suppressed because it is too large. Load diff
+6
View File
@@ -103,6 +103,12 @@ internal class Asthmatic : IAddon
Vector2 currentPosition = pc.transform.position;
if (CheckInvalidMovementPatch.ExemptedPlayers.Contains(pc.PlayerId) && CheckInvalidMovementPatch.LastPosition.TryGetValue(pc.PlayerId, out Vector2 position))
{
LastPosition[pc.PlayerId] = position;
return;
}
if (!LastPosition.TryGetValue(pc.PlayerId, out Vector2 previousPosition))
{
LastPosition[pc.PlayerId] = currentPosition;
+13 -13
View File
@@ -1,5 +1,7 @@
using System.Collections;
using System.Collections.Generic;
using Hazel;
using InnerNet;
namespace EHR.Impostor;
@@ -44,7 +46,7 @@ internal class OverKiller : RoleBase
{
if (!killer.RpcCheckAndMurder(target, true)) return false;
if (killer.PlayerId != target.PlayerId && !target.Is(CustomRoles.Unreportable))
if (killer.PlayerId != target.PlayerId && !target.Is(CustomRoles.Unreportable) && GameStates.IsInTask)
{
Main.PlayerStates[target.PlayerId].deathReason = PlayerState.DeathReason.Dismembered;
@@ -64,6 +66,7 @@ internal class OverKiller : RoleBase
return;
}
Vector2 ops = target.Pos();
Vector2 originPos = killer.Pos();
var rd = IRandom.Instance;
@@ -73,32 +76,29 @@ internal class OverKiller : RoleBase
IEnumerator SpawnFakeDeadBodies()
{
var sender = CustomRpcSender.Create("Butcher kill");
for (var i = 0; i < 26; i++)
{
Vector2 location = new(ops.x + ((float)(rd.Next(0, 201) - 100) / 100), ops.y + ((float)(rd.Next(0, 201) - 100) / 100));
location += new Vector2(0, 0.3636f);
sender.AutoStartRpc(target.NetTransform.NetId, (byte)RpcCalls.SnapTo);
sender.WriteVector2(location);
sender.Write(target.NetTransform.lastSequenceId);
sender.EndRpc();
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(target.NetTransform.NetId, (byte)RpcCalls.SnapTo, SendOption.None);
NetHelpers.WriteVector2(location, writer);
writer.Write(target.NetTransform.lastSequenceId);
AmongUsClient.Instance.FinishRpcImmediately(writer);
target.NetTransform.SnapTo(location);
killer.MurderPlayer(target, ExtendedPlayerControl.ResultFlags);
sender.AutoStartRpc(killer.NetId, (byte)RpcCalls.MurderPlayer);
sender.WriteNetObject(target);
sender.Write((byte)ExtendedPlayerControl.ResultFlags);
sender.EndRpc();
MessageWriter messageWriter = AmongUsClient.Instance.StartRpcImmediately(killer.NetId, (byte)RpcCalls.MurderPlayer, SendOption.None);
messageWriter.WriteNetObject(target);
messageWriter.Write((byte)ExtendedPlayerControl.ResultFlags);
AmongUsClient.Instance.FinishRpcImmediately(messageWriter);
if (i % 6 == 0) yield return null;
}
yield return null;
sender.TP(killer, originPos);
sender.SendMessage();
killer.TP(originPos);
}
}, 0.05f, "OverKiller Murder");
}