mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
Added some suggestions
This commit is contained in:
1 parent
941dd80a6d
commit
bcf088f4e7
17 files changed
+164
-78
No files matched your search
+1
-1
@@ -7,7 +7,7 @@
|
||||
<Description>EHR</Description>
|
||||
<Authors>Gurge44</Authors>
|
||||
<langVersion>preview</langVersion>
|
||||
<AmongUs>C:\Program Files\Epic Games\AmongUs</AmongUs>
|
||||
<AmongUs>E:\Program Files\AmongUs</AmongUs>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Optimize>True</Optimize>
|
||||
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
|
||||
|
||||
@@ -166,7 +166,7 @@ internal static class CustomRolesHelper
|
||||
CustomRoles.SuperStar => CustomRoles.Crewmate,
|
||||
CustomRoles.Hacker => CustomRoles.Shapeshifter,
|
||||
CustomRoles.Visionary => CustomRoles.Shapeshifter,
|
||||
CustomRoles.Assassin => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
|
||||
CustomRoles.Assassin => CustomRoles.Phantom,
|
||||
CustomRoles.Undertaker => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
|
||||
CustomRoles.Luckey => CustomRoles.Crewmate,
|
||||
CustomRoles.CyberStar => CustomRoles.Crewmate,
|
||||
@@ -197,7 +197,7 @@ internal static class CustomRolesHelper
|
||||
CustomRoles.GuessManagerRole => CustomRoles.Crewmate,
|
||||
CustomRoles.Bane => CustomRoles.Crewmate,
|
||||
CustomRoles.Transmitter => CustomRoles.Crewmate,
|
||||
CustomRoles.Altruist => CustomRoles.Engineer,
|
||||
CustomRoles.Altruist => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
|
||||
CustomRoles.Negotiator => CustomRoles.Crewmate,
|
||||
CustomRoles.Grappler => CustomRoles.Crewmate,
|
||||
CustomRoles.Journalist => CustomRoles.Crewmate,
|
||||
|
||||
+46
-1
@@ -1,8 +1,11 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using AmongUs.GameOptions;
|
||||
using HarmonyLib;
|
||||
using Hazel;
|
||||
using InnerNet;
|
||||
using UnityEngine;
|
||||
using static EHR.Translator;
|
||||
|
||||
namespace EHR;
|
||||
@@ -392,7 +395,7 @@ internal static class EAC
|
||||
bool HasVent(int ventId) => ShipStatus.Instance.AllVents.Any(v => v.Id == ventId);
|
||||
}
|
||||
|
||||
private static void Report(PlayerControl pc, string reason)
|
||||
internal static void Report(PlayerControl pc, string reason)
|
||||
{
|
||||
string msg = $"{pc.GetClientId()}|{pc.FriendCode}|{pc.Data.PlayerName}|{pc.GetClient().GetHashedPuid()}|{reason}";
|
||||
//Cloud.SendData(msg);
|
||||
@@ -692,4 +695,46 @@ internal static class StartGameHostPatchEAC
|
||||
if (ShipStatus.Instance != null)
|
||||
IsStartingAsHost = false;
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.FixedUpdate))]
|
||||
static class CheckInvalidMovementPatch
|
||||
{
|
||||
private static readonly Dictionary<byte, long> LastCheck = [];
|
||||
public static readonly Dictionary<byte, Vector2> LastPosition = [];
|
||||
public static readonly HashSet<byte> ExemptedPlayers = [];
|
||||
|
||||
public static void Postfix(PlayerControl __instance)
|
||||
{
|
||||
if (!GameStates.IsInTask || !Options.EnableMovementChecking.GetBool() || Main.RealOptionsData.GetFloat(FloatOptionNames.PlayerSpeedMod) >= 1.9f || AmongUsClient.Instance.Ping >= 300 || Utils.GetRegionName() is not ("EU" or "NA" or "AS")) return;
|
||||
|
||||
var pos = __instance.Pos();
|
||||
var now = Utils.TimeStamp;
|
||||
|
||||
if (!LastPosition.TryGetValue(__instance.PlayerId, out var lastPosition))
|
||||
{
|
||||
SetCurrentData();
|
||||
return;
|
||||
}
|
||||
|
||||
if (LastCheck[__instance.PlayerId] == now) return;
|
||||
|
||||
SetCurrentData();
|
||||
|
||||
if (ExemptedPlayers.Remove(__instance.PlayerId)) return;
|
||||
|
||||
if (Vector2.Distance(lastPosition, pos) > 10f && PhysicsHelpers.AnythingBetween(__instance.Collider, lastPosition, pos, Constants.ShipOnlyMask, false))
|
||||
{
|
||||
EAC.WarnHost();
|
||||
EAC.Report(__instance, "This player is moving too fast, possibly using a speed hack.");
|
||||
}
|
||||
|
||||
return;
|
||||
|
||||
void SetCurrentData()
|
||||
{
|
||||
LastPosition[__instance.PlayerId] = pos;
|
||||
LastCheck[__instance.PlayerId] = now;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,10 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using EHR.AddOns;
|
||||
using EHR.AddOns.GhostRoles;
|
||||
using EHR.Modules;
|
||||
@@ -191,6 +193,7 @@ public static class Options
|
||||
public static OptionItem ShowNKRemainOnEject;
|
||||
public static OptionItem ShowTeamNextToRoleNameOnEject;
|
||||
public static OptionItem CheatResponses;
|
||||
public static OptionItem EnableMovementChecking;
|
||||
public static OptionItem LowLoadMode;
|
||||
public static OptionItem DeepLowLoad;
|
||||
public static OptionItem DisableVoteBan;
|
||||
@@ -1210,6 +1213,9 @@ public static class Options
|
||||
CheatResponses = new StringOptionItem(19319, "CheatResponses", CheatResponsesName, 2, TabGroup.SystemSettings)
|
||||
.SetHeader(true);
|
||||
|
||||
EnableMovementChecking = new BooleanOptionItem(19329, "EnableMovementChecking", true, TabGroup.SystemSettings)
|
||||
.SetHeader(true);
|
||||
|
||||
|
||||
DisableVoteBan = new BooleanOptionItem(19320, "DisableVoteBan", true, TabGroup.SystemSettings, true);
|
||||
|
||||
@@ -1353,11 +1359,9 @@ public static class Options
|
||||
|
||||
// Random Spawn
|
||||
RandomSpawn = new BooleanOptionItem(22000, "RandomSpawn", false, TabGroup.GameSettings)
|
||||
.SetGameMode(CustomGameMode.Standard)
|
||||
.SetColor(new Color32(19, 188, 233, byte.MaxValue));
|
||||
AirshipAdditionalSpawn = new BooleanOptionItem(22010, "AirshipAdditionalSpawn", false, TabGroup.GameSettings)
|
||||
.SetParent(RandomSpawn)
|
||||
.SetGameMode(CustomGameMode.Standard);
|
||||
.SetParent(RandomSpawn);
|
||||
|
||||
// Airship Variable Electrical
|
||||
AirshipVariableElectrical = new BooleanOptionItem(22100, "AirshipVariableElectrical", false, TabGroup.GameSettings)
|
||||
|
||||
+7
-4
@@ -143,6 +143,10 @@ public static class Utils
|
||||
AmongUsClient.Instance.FinishRpcImmediately(messageWriter);
|
||||
|
||||
if (log) Logger.Info($"{pc.GetNameWithRole().RemoveHtmlTags()} => {location}", "TP");
|
||||
|
||||
CheckInvalidMovementPatch.LastPosition[pc.PlayerId] = location;
|
||||
CheckInvalidMovementPatch.ExemptedPlayers.Add(pc.PlayerId);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -896,7 +900,6 @@ public static class Utils
|
||||
pc.Is(CustomRoles.NiceSwapper) ||
|
||||
pc.Is(CustomRoles.Speedrunner) ||
|
||||
pc.Is(CustomRoles.Needy) ||
|
||||
pc.Is(CustomRoles.Lazy) ||
|
||||
pc.Is(CustomRoles.Loyal) ||
|
||||
pc.Is(CustomRoles.SuperStar) ||
|
||||
pc.Is(CustomRoles.CyberStar) ||
|
||||
@@ -2070,10 +2073,10 @@ public static class Utils
|
||||
? SeerRealName
|
||||
: seerTeam switch
|
||||
{
|
||||
Team.Impostor when seer.IsMadmate() => $"<size=200%><color=#ff1919>{GetString("YouAreMadmate")}</size></color>\n<size=90%>{(showLongInfo ? longInfo : seer.GetRoleInfo()) + mHelp}</size>",
|
||||
Team.Impostor when seer.IsMadmate() => $"<size=150%><color=#ff1919>{GetString("YouAreMadmate")}</size></color>\n<size=90%>{(showLongInfo ? longInfo : seer.GetRoleInfo()) + mHelp}</size>",
|
||||
Team.Impostor => $"\n<size=90%>{(showLongInfo ? longInfo : seer.GetRoleInfo()) + mHelp}</size>",
|
||||
Team.Crewmate => $"<size=200%><color=#8cffff>{GetString("YouAreCrewmate")}</size></color>\n<size=90%>{(showLongInfo ? longInfo : seer.GetRoleInfo()) + mHelp}</size>",
|
||||
Team.Neutral => $"<size=200%><color=#ffab1b>{GetString("YouAreNeutral")}</size></color>\n<size=90%>{(showLongInfo ? longInfo : seer.GetRoleInfo()) + mHelp}</size>",
|
||||
Team.Crewmate => $"<size=150%><color=#8cffff>{GetString("YouAreCrewmate")}</size></color>\n<size=90%>{(showLongInfo ? longInfo : seer.GetRoleInfo()) + mHelp}</size>",
|
||||
Team.Neutral => $"<size=150%><color=#ffab1b>{GetString("YouAreNeutral")}</size></color>\n<size=90%>{(showLongInfo ? longInfo : seer.GetRoleInfo()) + mHelp}</size>",
|
||||
_ => SeerRealName
|
||||
};
|
||||
}
|
||||
|
||||
@@ -309,7 +309,7 @@ internal static class ChatCommands
|
||||
Main.Instance.StartCoroutine(Countdown());
|
||||
return;
|
||||
|
||||
System.Collections.IEnumerator Countdown()
|
||||
IEnumerator Countdown()
|
||||
{
|
||||
var timer = 30f;
|
||||
while (timer > 0f)
|
||||
@@ -330,7 +330,7 @@ internal static class ChatCommands
|
||||
{
|
||||
ReadyPlayers.Add(player.PlayerId);
|
||||
}
|
||||
|
||||
|
||||
private static void DraftStartCommand(ChatController __instance, PlayerControl player, string text, string[] args)
|
||||
{
|
||||
DraftResult = [];
|
||||
@@ -344,7 +344,7 @@ internal static class ChatCommands
|
||||
return;
|
||||
}
|
||||
|
||||
DraftRoles = allRoles.Shuffle().Partition(allPlayerIds.Length).Zip(allPlayerIds).ToDictionary(x => x.Second, x => x.First.ToList());
|
||||
DraftRoles = allRoles.Shuffle().Partition(allPlayerIds.Length).Zip(allPlayerIds).ToDictionary(x => x.Second, x => x.First.Take(5).ToList());
|
||||
|
||||
foreach ((byte id, List<CustomRoles> roles) in DraftRoles)
|
||||
{
|
||||
@@ -2187,4 +2187,4 @@ internal class RpcSendChatPatch
|
||||
__result = true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -108,7 +108,7 @@ static class ExileControllerWrapUpPatch
|
||||
PetsPatch.RpcRemovePet(pc);
|
||||
}
|
||||
|
||||
if (Options.RandomSpawn.GetBool() || Options.CurrentGameMode != CustomGameMode.Standard)
|
||||
if (Options.RandomSpawn.GetBool())
|
||||
{
|
||||
RandomSpawn.SpawnMap map = Main.NormalOptions.MapId switch
|
||||
{
|
||||
|
||||
@@ -830,7 +830,7 @@ static class IntroCutsceneDestroyPatch
|
||||
Main.PlayerStates[lp.PlayerId].SetDead();
|
||||
}
|
||||
|
||||
if (Options.RandomSpawn.GetBool() || Options.CurrentGameMode != CustomGameMode.Standard)
|
||||
if (Options.RandomSpawn.GetBool())
|
||||
{
|
||||
RandomSpawn.SpawnMap map = Main.NormalOptions.MapId switch
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ class RandomSpawn
|
||||
player.RpcResetAbilityCooldown();
|
||||
if (Options.FixFirstKillCooldown.GetBool() && !MeetingStates.MeetingCalled) player.SetKillCooldown(Main.AllPlayerKillCooldown[player.PlayerId]);
|
||||
else if (Options.StartingKillCooldown.GetInt() != 10) player.SetKillCooldown(Options.StartingKillCooldown.GetInt());
|
||||
if (!Options.RandomSpawn.GetBool() && Options.CurrentGameMode == CustomGameMode.Standard) return;
|
||||
if (!Options.RandomSpawn.GetBool()) return;
|
||||
new AirshipSpawnMap().RandomTeleport(player);
|
||||
Penguin.OnSpawnAirship();
|
||||
}
|
||||
|
||||
@@ -375,6 +375,9 @@ static class ShipStatusSpawnPlayerPatch
|
||||
{
|
||||
if (!AmongUsClient.Instance.AmHost || initialSpawn || !player.IsAlive()) return true;
|
||||
|
||||
// Lazy doesn't teleport to the meeting table
|
||||
if (player.Is(CustomRoles.Lazy)) return false;
|
||||
|
||||
Vector2 direction = Vector2.up.Rotate((player.PlayerId - 1) * (360f / numPlayers));
|
||||
Vector2 position = __instance.MeetingSpawnCenter + direction * __instance.SpawnRadius + new Vector2(0.0f, 0.3636f);
|
||||
|
||||
@@ -394,6 +397,9 @@ static class PolusShipStatusSpawnPlayerPatch
|
||||
{
|
||||
if (!AmongUsClient.Instance.AmHost || initialSpawn || !player.IsAlive()) return true;
|
||||
|
||||
// Lazy doesn't teleport to the meeting table
|
||||
if (player.Is(CustomRoles.Lazy)) return false;
|
||||
|
||||
int num1 = Mathf.FloorToInt(numPlayers / 2f);
|
||||
int num2 = player.PlayerId % 15;
|
||||
|
||||
@@ -455,6 +461,7 @@ static class VentilationSystemDeterioratePatch
|
||||
{
|
||||
public static Dictionary<byte, int> LastClosestVent = [];
|
||||
private static readonly Dictionary<byte, bool> LastCanUseVent = [];
|
||||
private static readonly Dictionary<byte, int> LastClosestVentForUpdate = [];
|
||||
|
||||
public static void Postfix(VentilationSystem __instance)
|
||||
{
|
||||
@@ -598,7 +605,14 @@ static class VentilationSystemDeterioratePatch
|
||||
|
||||
public static void CheckVentInteraction(PlayerControl pc)
|
||||
{
|
||||
if (!GameStates.IsInTask) return;
|
||||
if (!GameStates.IsInTask || ExileController.Instance) return;
|
||||
|
||||
int closestVent = pc.GetClosestVent().Id;
|
||||
if (!LastClosestVentForUpdate.TryGetValue(pc.PlayerId, out int lastClosestVent))
|
||||
{
|
||||
LastClosestVentForUpdate[pc.PlayerId] = closestVent;
|
||||
return;
|
||||
}
|
||||
|
||||
bool canUse = pc.CanUseVent();
|
||||
|
||||
@@ -608,7 +622,7 @@ static class VentilationSystemDeterioratePatch
|
||||
return;
|
||||
}
|
||||
|
||||
if (couldUse != canUse)
|
||||
if (couldUse != canUse || lastClosestVent != closestVent)
|
||||
{
|
||||
LastCanUseVent[pc.PlayerId] = canUse;
|
||||
SerializeV2(ShipStatus.Instance.Systems[SystemTypes.Ventilation].Cast<VentilationSystem>(), pc);
|
||||
|
||||
@@ -5,6 +5,7 @@ using EHR.Impostor;
|
||||
using EHR.Modules;
|
||||
using HarmonyLib;
|
||||
using Il2CppInterop.Runtime.InteropTypes.Arrays;
|
||||
using Il2CppSystem.Collections.Generic;
|
||||
using Random = UnityEngine.Random;
|
||||
|
||||
namespace EHR;
|
||||
@@ -13,7 +14,7 @@ namespace EHR;
|
||||
class AddTasksFromListPatch
|
||||
{
|
||||
public static void Prefix( /*ShipStatus __instance,*/
|
||||
[HarmonyArgument(4)] Il2CppSystem.Collections.Generic.List<NormalPlayerTask> unusedTasks)
|
||||
[HarmonyArgument(4)] List<NormalPlayerTask> unusedTasks)
|
||||
{
|
||||
if (!AmongUsClient.Instance.AmHost) return;
|
||||
|
||||
@@ -157,8 +158,8 @@ class RpcSetTasksPatch
|
||||
NumShortTasks = Options.MadSnitchTasks.GetInt();
|
||||
}
|
||||
|
||||
// GM and Lazy have no tasks
|
||||
if (pc.Is(CustomRoles.GM) || pc.Is(CustomRoles.Needy) || Options.CurrentGameMode is CustomGameMode.SoloKombat or CustomGameMode.FFA || pc.Is(CustomRoles.Lazy))
|
||||
// GM and Lazy Guy have no tasks
|
||||
if (pc.Is(CustomRoles.GM) || pc.Is(CustomRoles.Needy) || Options.CurrentGameMode is CustomGameMode.SoloKombat or CustomGameMode.FFA or CustomGameMode.HotPotato or CustomGameMode.NaturalDisasters)
|
||||
{
|
||||
hasCommonTasks = false;
|
||||
NumShortTasks = 0;
|
||||
@@ -188,7 +189,7 @@ class RpcSetTasksPatch
|
||||
|
||||
// List containing IDs of assignable tasks
|
||||
// Clone of the second argument of the original RpcSetTasks
|
||||
Il2CppSystem.Collections.Generic.List<byte> TasksList = new();
|
||||
List<byte> TasksList = new();
|
||||
foreach (var num in taskTypeIds)
|
||||
{
|
||||
TasksList.Add(num);
|
||||
@@ -204,18 +205,18 @@ class RpcSetTasksPatch
|
||||
|
||||
// HashSet where assigned tasks will be placed
|
||||
// Prevent multiple assignments of the same task
|
||||
Il2CppSystem.Collections.Generic.HashSet<TaskTypes> usedTaskTypes = new();
|
||||
HashSet<TaskTypes> usedTaskTypes = new();
|
||||
int start2 = 0;
|
||||
int start3 = 0;
|
||||
|
||||
// List of assignable long tasks
|
||||
Il2CppSystem.Collections.Generic.List<NormalPlayerTask> LongTasks = new();
|
||||
List<NormalPlayerTask> LongTasks = new();
|
||||
foreach (var task in ShipStatus.Instance.LongTasks)
|
||||
LongTasks.Add(task);
|
||||
Shuffle(LongTasks);
|
||||
|
||||
// List of assignable short tasks
|
||||
Il2CppSystem.Collections.Generic.List<NormalPlayerTask> ShortTasks = new();
|
||||
List<NormalPlayerTask> ShortTasks = new();
|
||||
foreach (var task in ShipStatus.Instance.ShortTasks)
|
||||
ShortTasks.Add(task);
|
||||
Shuffle(ShortTasks);
|
||||
@@ -244,7 +245,7 @@ class RpcSetTasksPatch
|
||||
}
|
||||
}
|
||||
|
||||
private static void Shuffle<T>(Il2CppSystem.Collections.Generic.List<T> list)
|
||||
private static void Shuffle<T>(List<T> list)
|
||||
{
|
||||
for (int i = 0; i < list.Count - 1; i++)
|
||||
{
|
||||
|
||||
@@ -25,10 +25,10 @@
|
||||
"ShortTeamName.Impostor": "Imp",
|
||||
"ShortTeamName.Crewmate": "Crew",
|
||||
"ShortTeamName.Neutral": "Neut",
|
||||
"YouAreCrewmate": "<size=1.7><color=#ffffff>You are</color> Crewmate</size>",
|
||||
"YouAreImpostor": "<size=1.7><color=#ffffff>You are</color> Impostor</size>",
|
||||
"YouAreNeutral": "<size=1.7><color=#ffffff>You are</color> Neutral</size>",
|
||||
"YouAreMadmate": "<size=1.7><color=#ffffff>You are in</color> Impostors <color=#ffffff>team</color></size>",
|
||||
"YouAreCrewmate": "<size=1.7><color=#ffffff>You are a</color> Crewmate</size>",
|
||||
"YouAreImpostor": "<size=1.7><color=#ffffff>You are an</color> Impostor</size>",
|
||||
"YouAreNeutral": "<size=1.7><color=#ffffff>You are a</color> Neutral</size>",
|
||||
"YouAreMadmate": "<size=1.7><color=#ffffff>You are in the</color> Impostor <color=#ffffff>team</color></size>",
|
||||
"CrewmateSub": "Find and exile the <color=#ff1919>Impostors</color>",
|
||||
"ImpostorSub": "Sabotage and kill everyone",
|
||||
"NeutralSub": "Work alone to achieve your victory",
|
||||
@@ -810,7 +810,7 @@
|
||||
"RascalInfoLong": "(Add-ons):\\nAs the Rascal, you can die to the Sheriff, and Snitch can find you if Snitch can find madmates.\\n\\nOnly assigned to Crewmates, cannot be assigned by the Merchant.",
|
||||
"SoullessInfoLong": "(Add-ons):\\nWhen a Cursed Soul snatches your soul, you get this add-on.\\n\\nYou are not counted as alive.",
|
||||
"GravestoneInfoLong": "(Add-ons):\\nAs the Gravestone, your role is revealed to everyone when you die.",
|
||||
"LazyInfoLong": "(Add-ons):\\nAs the Lazy, you are assigned a single short task and are immune to Warlocks, Puppeteers, and Gangsters.",
|
||||
"LazyInfoLong": "(Add-ons):\\nAs the Lazy, you are too lazy to walk to the meeting table when meetings are called, so you start the next round exactly where you ended the previous one, and you're also immune to Warlocks, Puppeteers, and Gangsters.",
|
||||
"AutopsyInfoLong": "(Add-ons):\\nAs the Autopsy, you can see how people died.\\n\\nCannot be assigned to Doctor, Tracefinder, Scientist, or Sunnyboy.",
|
||||
"LoyalInfoLong": "(Add-ons):\\nAs the Loyal, you cannot be recruited by roles such as Jackal or Cultist.\\n\\nCannot be assigned to neutrals.",
|
||||
"EvilSpiritInfoLong": "(Add-ons):\\nAs Evil Spirit, it's your job to help the Spiritcaller to victory. You can use your Haunt button to freeze players and reduce their vision. Alternatively, you can use your Haunt button to give the Spiritcaller a shield against a kill attempt temporarily.",
|
||||
@@ -1006,6 +1006,7 @@
|
||||
"GameStateCommand.ShowTasks": "Show amount of completed tasks",
|
||||
"MinPlayersForGameStateCommand": "Minimum alive players to use this command",
|
||||
"EveryoneSeesDeathReasons": "Everyone Sees Death Reasons",
|
||||
"BlockVentMovement": "Block Movement Between Vents (while in a vent)",
|
||||
"DoorsResetMode": "Mode",
|
||||
"AllClosed": "Close All",
|
||||
"AllOpen": "Open All",
|
||||
@@ -2734,6 +2735,7 @@
|
||||
"CountdownText": "<color=#00ffa5>Re-Entering Lobby in</color> <b>{0}</b>s",
|
||||
"EAC.CheatDetected.HighLevel": "Warning: EAC detected High Level of cheats.",
|
||||
"EAC.CheatDetected.LowLevel": "Warning: EAC detected Low Level of cheats. One of the players is hacking.",
|
||||
"EnableMovementChecking": "Enable EAC Checks for Invalid Movement (against speed hacks) (may cause false positives)",
|
||||
"DisableVoteBan": "Disable Vote-Kick (prevent hackers from banning everyone)",
|
||||
"PlayerIsRole": "{0} was {1}.",
|
||||
"PlayerExiled": "{0} was ejected...",
|
||||
|
||||
+25
-23
@@ -7,29 +7,28 @@ namespace EHR.Crewmate;
|
||||
public class Sheriff : RoleBase
|
||||
{
|
||||
private const int Id = 8800;
|
||||
public static List<byte> playerIdList = [];
|
||||
private static List<byte> PlayerIdList = [];
|
||||
|
||||
public static OptionItem KillCooldown;
|
||||
private static OptionItem KillCooldown;
|
||||
private static OptionItem MisfireKillsTarget;
|
||||
public static OptionItem ShotLimitOpt;
|
||||
public static OptionItem ShowShotLimit;
|
||||
private static OptionItem ShotLimitOpt;
|
||||
private static OptionItem ShowShotLimit;
|
||||
private static OptionItem CanKillAllAlive;
|
||||
public static OptionItem CanKillNeutrals;
|
||||
public static OptionItem CanKillNeutralsMode;
|
||||
public static OptionItem CanKillMadmate;
|
||||
public static OptionItem CanKillCharmed;
|
||||
public static OptionItem CanKillLovers;
|
||||
public static OptionItem CanKillSidekicks;
|
||||
public static OptionItem CanKillEgoists;
|
||||
public static OptionItem CanKillContagious;
|
||||
public static OptionItem SidekickSheriffCanGoBerserk;
|
||||
public static OptionItem SetNonCrewCanKill;
|
||||
public static OptionItem NonCrewCanKillCrew;
|
||||
public static OptionItem NonCrewCanKillImp;
|
||||
public static OptionItem NonCrewCanKillNeutral;
|
||||
private static OptionItem CanKillNeutrals;
|
||||
private static OptionItem CanKillNeutralsMode;
|
||||
private static OptionItem CanKillMadmate;
|
||||
private static OptionItem CanKillCharmed;
|
||||
private static OptionItem CanKillLovers;
|
||||
private static OptionItem CanKillSidekicks;
|
||||
private static OptionItem CanKillContagious;
|
||||
private static OptionItem SidekickSheriffCanGoBerserk;
|
||||
private static OptionItem SetNonCrewCanKill;
|
||||
private static OptionItem NonCrewCanKillCrew;
|
||||
private static OptionItem NonCrewCanKillImp;
|
||||
private static OptionItem NonCrewCanKillNeutral;
|
||||
public static OptionItem KeepsGameGoing;
|
||||
public static OptionItem UsePet;
|
||||
public static Dictionary<CustomRoles, OptionItem> KillTargetOptions = [];
|
||||
private static readonly Dictionary<CustomRoles, OptionItem> KillTargetOptions = [];
|
||||
|
||||
public static readonly string[] KillOption =
|
||||
[
|
||||
@@ -37,7 +36,7 @@ public class Sheriff : RoleBase
|
||||
"SheriffCanKillSeparately"
|
||||
];
|
||||
|
||||
public override bool IsEnable => playerIdList.Count > 0;
|
||||
public override bool IsEnable => PlayerIdList.Count > 0;
|
||||
|
||||
public override void SetupCustomOption()
|
||||
{
|
||||
@@ -53,7 +52,6 @@ public class Sheriff : RoleBase
|
||||
CanKillCharmed = new BooleanOptionItem(Id + 22, "SheriffCanKillCharmed", true, TabGroup.CrewmateRoles).SetParent(Options.CustomRoleSpawnChances[CustomRoles.Sheriff]);
|
||||
CanKillLovers = new BooleanOptionItem(Id + 24, "SheriffCanKillLovers", true, TabGroup.CrewmateRoles).SetParent(Options.CustomRoleSpawnChances[CustomRoles.Sheriff]);
|
||||
CanKillSidekicks = new BooleanOptionItem(Id + 23, "SheriffCanKillSidekick", true, TabGroup.CrewmateRoles).SetParent(Options.CustomRoleSpawnChances[CustomRoles.Sheriff]);
|
||||
CanKillEgoists = new BooleanOptionItem(Id + 25, "SheriffCanKillEgoist", true, TabGroup.CrewmateRoles).SetParent(Options.CustomRoleSpawnChances[CustomRoles.Sheriff]);
|
||||
CanKillContagious = new BooleanOptionItem(Id + 27, "SheriffCanKillContagious", true, TabGroup.CrewmateRoles).SetParent(Options.CustomRoleSpawnChances[CustomRoles.Sheriff]);
|
||||
CanKillNeutrals = new BooleanOptionItem(Id + 16, "SheriffCanKillNeutrals", true, TabGroup.CrewmateRoles).SetParent(Options.CustomRoleSpawnChances[CustomRoles.Sheriff]);
|
||||
CanKillNeutralsMode = new StringOptionItem(Id + 14, "SheriffCanKillNeutralsMode", KillOption, 0, TabGroup.CrewmateRoles).SetParent(CanKillNeutrals);
|
||||
@@ -90,12 +88,12 @@ public class Sheriff : RoleBase
|
||||
|
||||
public override void Init()
|
||||
{
|
||||
playerIdList = [];
|
||||
PlayerIdList = [];
|
||||
}
|
||||
|
||||
public override void Add(byte playerId)
|
||||
{
|
||||
playerIdList.Add(playerId);
|
||||
PlayerIdList.Add(playerId);
|
||||
playerId.SetAbilityUseLimit(ShotLimitOpt.GetInt());
|
||||
|
||||
Logger.Info($"{Utils.GetPlayerById(playerId)?.GetNameWithRole().RemoveHtmlTags()} : Shot Limit - {playerId.GetAbilityUseLimit()}", "Sheriff");
|
||||
@@ -153,7 +151,6 @@ public class Sheriff : RoleBase
|
||||
CustomRoles.Charmed => CanKillCharmed.GetBool(),
|
||||
CustomRoles.Lovers => CanKillLovers.GetBool(),
|
||||
CustomRoles.Recruit => CanKillSidekicks.GetBool(),
|
||||
CustomRoles.Egoist => CanKillEgoists.GetBool(),
|
||||
CustomRoles.Contagious => CanKillContagious.GetBool(),
|
||||
CustomRoles.Rascal => true,
|
||||
_ => false
|
||||
@@ -172,4 +169,9 @@ public class Sheriff : RoleBase
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public override string GetProgressText(byte playerId, bool comms)
|
||||
{
|
||||
return ShowShotLimit.GetBool() ? base.GetProgressText(playerId, comms) : Utils.GetTaskCount(playerId, comms);
|
||||
}
|
||||
}
|
||||
@@ -139,6 +139,13 @@ internal class Assassin : RoleBase
|
||||
public override bool OnVanish(PlayerControl pc)
|
||||
{
|
||||
if (pc == null || !pc.IsAlive() || Pelican.IsEaten(pc.PlayerId)) return false;
|
||||
|
||||
if (!IsUndertaker)
|
||||
{
|
||||
LateTask.New(() => Take(pc), 1.5f, "Ninja Vanish");
|
||||
return true;
|
||||
}
|
||||
|
||||
Take(pc);
|
||||
return false;
|
||||
}
|
||||
@@ -148,10 +155,9 @@ internal class Assassin : RoleBase
|
||||
if (MarkedPlayer != byte.MaxValue)
|
||||
{
|
||||
var target = Utils.GetPlayerById(MarkedPlayer);
|
||||
if (IsUndertaker) target.TP(pc);
|
||||
else pc.TP(target);
|
||||
var tpSuccess = IsUndertaker ? target.TP(pc) : pc.TP(target);
|
||||
|
||||
if (!(target == null || !target.IsAlive() || Pelican.IsEaten(target.PlayerId) || target.inVent || !GameStates.IsInTask) && pc.RpcCheckAndMurder(target))
|
||||
if (!(target == null || !target.IsAlive() || Pelican.IsEaten(target.PlayerId) || target.inVent || !GameStates.IsInTask) && tpSuccess && pc.RpcCheckAndMurder(target))
|
||||
{
|
||||
MarkedPlayer = byte.MaxValue;
|
||||
SendRPC(pc.PlayerId);
|
||||
@@ -159,6 +165,7 @@ internal class Assassin : RoleBase
|
||||
pc.SyncSettings();
|
||||
pc.SetKillCooldown(DefaultKillCooldown);
|
||||
}
|
||||
else if (!tpSuccess) pc.Notify(GetString("TargetCannotBeTeleported"));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -15,11 +15,10 @@ public class Amnesiac : RoleBase
|
||||
private static OptionItem RememberCooldown;
|
||||
private static OptionItem CanRememberCrewPower;
|
||||
private static OptionItem IncompatibleNeutralMode;
|
||||
private static OptionItem CanVent;
|
||||
public static OptionItem RememberMode;
|
||||
public static OptionItem RoleBasis;
|
||||
|
||||
public static readonly CustomRoles[] AmnesiacIncompatibleNeutralMode =
|
||||
private static readonly CustomRoles[] AmnesiacIncompatibleNeutralMode =
|
||||
[
|
||||
CustomRoles.Amnesiac,
|
||||
CustomRoles.Pursuer,
|
||||
@@ -29,8 +28,8 @@ public class Amnesiac : RoleBase
|
||||
|
||||
private static readonly string[] RememberModes =
|
||||
[
|
||||
"AmnesiacRM.ByKillButton",
|
||||
"AmnesiacRM.ByReportingBody"
|
||||
"AmnesiacRM.ByReportingBody",
|
||||
"AmnesiacRM.ByKillButton"
|
||||
];
|
||||
|
||||
private byte AmnesiacId;
|
||||
@@ -43,14 +42,12 @@ public class Amnesiac : RoleBase
|
||||
RememberMode = new StringOptionItem(Id + 9, "RememberMode", RememberModes, 0, TabGroup.NeutralRoles)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Amnesiac]);
|
||||
RememberCooldown = new FloatOptionItem(Id + 10, "RememberCooldown", new(0f, 180f, 0.5f), 5f, TabGroup.NeutralRoles)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Amnesiac])
|
||||
.SetParent(RememberMode)
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
CanRememberCrewPower = new BooleanOptionItem(Id + 11, "CanRememberCrewPower", false, TabGroup.NeutralRoles)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Amnesiac]);
|
||||
IncompatibleNeutralMode = new StringOptionItem(Id + 12, "IncompatibleNeutralMode", AmnesiacIncompatibleNeutralMode.Select(x => x.ToColoredString()).ToArray(), 0, TabGroup.NeutralRoles, noTranslation: true)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Amnesiac]);
|
||||
CanVent = new BooleanOptionItem(Id + 13, "CanVent", false, TabGroup.NeutralRoles)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Amnesiac]);
|
||||
RoleBasis = new StringOptionItem(Id + 14, "AmnesiacRoleBasis", [CustomRoles.Engineer.ToColoredString(), CustomRoles.Crewmate.ToColoredString()], 1, TabGroup.NeutralRoles, noTranslation: true)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Amnesiac]);
|
||||
}
|
||||
@@ -69,7 +66,6 @@ public class Amnesiac : RoleBase
|
||||
|
||||
public override void SetKillCooldown(byte id) => Main.AllPlayerKillCooldown[id] = RememberCooldown.GetFloat();
|
||||
public override bool CanUseKillButton(PlayerControl player) => !player.Data.IsDead && RememberMode.GetValue() == 0;
|
||||
public override bool CanUseImpostorVentButton(PlayerControl pc) => CanVent.GetBool();
|
||||
public override void ApplyGameOptions(IGameOptions opt, byte playerId) => opt.SetVision(false);
|
||||
|
||||
public static void OnAnyoneDeath(PlayerControl target)
|
||||
|
||||
+12
-5
@@ -87,11 +87,7 @@ public class Bandit : RoleBase
|
||||
for (int i = 0; i < AllSubRoles.Count; i++)
|
||||
{
|
||||
var role = AllSubRoles[i];
|
||||
if (role == CustomRoles.Cleansed || // making Bandit unable to steal Cleansed for obvious reasons. Although it can still be cleansed by cleanser.
|
||||
role == CustomRoles.LastImpostor ||
|
||||
role == CustomRoles.Lovers || // Causes issues involving Lovers Suicide
|
||||
(role.IsImpOnlyAddon() && !CanStealImpOnlyAddon.GetBool()) ||
|
||||
(role.IsBetrayalAddon() && !CanStealBetrayalAddon.GetBool()))
|
||||
if (IsBlacklistedAddon(role))
|
||||
{
|
||||
Logger.Info($"Removed {role} from stealable addons", "Bandit");
|
||||
AllSubRoles.Remove(role);
|
||||
@@ -108,6 +104,17 @@ public class Bandit : RoleBase
|
||||
return addon;
|
||||
}
|
||||
|
||||
private static bool IsBlacklistedAddon(CustomRoles role) => (role.IsImpOnlyAddon() && !CanStealImpOnlyAddon.GetBool()) || (role.IsBetrayalAddon() && !CanStealBetrayalAddon.GetBool()) || StartGameHostPatch.BasisChangingAddons.ContainsKey(role) || role is
|
||||
CustomRoles.Egoist or
|
||||
CustomRoles.Workhorse or
|
||||
CustomRoles.Cleansed or
|
||||
CustomRoles.Busy or
|
||||
CustomRoles.Lovers or
|
||||
CustomRoles.Stressed or
|
||||
CustomRoles.Lazy or
|
||||
CustomRoles.Rascal or
|
||||
CustomRoles.LastImpostor;
|
||||
|
||||
public override bool OnCheckMurder(PlayerControl killer, PlayerControl target)
|
||||
{
|
||||
if (!On) return true;
|
||||
|
||||
+11
-6
@@ -13,6 +13,7 @@ namespace EHR.Neutral
|
||||
public static OptionItem SunnyboyChance;
|
||||
public static OptionItem VentCooldown;
|
||||
public static OptionItem MaxInVentTime;
|
||||
public static OptionItem BlockVentMovement;
|
||||
public override bool IsEnable => On;
|
||||
|
||||
public override void SetupCustomOption()
|
||||
@@ -22,14 +23,16 @@ namespace EHR.Neutral
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Jester]);
|
||||
JesterCanVent = new BooleanOptionItem(10911, "CanVent", false, TabGroup.NeutralRoles)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Jester]);
|
||||
VentCooldown = new FloatOptionItem(10913, "VentCooldown", new(0f, 60f, 0.5f), 0f, TabGroup.NeutralRoles)
|
||||
.SetParent(JesterCanVent)
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
MaxInVentTime = new FloatOptionItem(10914, "MaxInVentTime", new(0f, 60f, 0.5f), 30f, TabGroup.NeutralRoles)
|
||||
.SetParent(JesterCanVent)
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
BlockVentMovement = new BooleanOptionItem(10916, "BlockVentMovement", false, TabGroup.NeutralRoles)
|
||||
.SetParent(JesterCanVent);
|
||||
JesterHasImpostorVision = new BooleanOptionItem(10912, "ImpostorVision", false, TabGroup.NeutralRoles)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Jester]);
|
||||
VentCooldown = new FloatOptionItem(10913, "VentCooldown", new(0f, 60f, 0.5f), 0f, TabGroup.NeutralRoles)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Jester])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
MaxInVentTime = new FloatOptionItem(10914, "MaxInVentTime", new(0f, 900f, 0.5f), 900f, TabGroup.NeutralRoles)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Jester])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
SunnyboyChance = new IntegerOptionItem(10915, "SunnyboyChance", new(0, 100, 5), 0, TabGroup.NeutralRoles)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Jester])
|
||||
.SetValueFormat(OptionFormat.Percent);
|
||||
@@ -51,5 +54,7 @@ namespace EHR.Neutral
|
||||
AURoleOptions.EngineerInVentMaxTime = MaxInVentTime.GetFloat();
|
||||
opt.SetVision(JesterHasImpostorVision.GetBool());
|
||||
}
|
||||
|
||||
public override bool CanUseVent(PlayerControl pc, int ventId) => !BlockVentMovement.GetBool() || pc.GetClosestVent()?.Id == ventId;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user