This commit is contained in:
Gurge44 committed 2025-01-21 09:46:52 +01:00
1 parent ba82c28221
commit e4c562dc8f
7 files changed
+34 -19

No files matched your search

+1
View File
@@ -104,6 +104,7 @@ internal static class CustomRoleSelector
case CustomRoles.Changeling when Changeling.GetAvailableRoles(true).Count == 0:
case CustomRoles.Camouflager when Camouflager.DoesntSpawnOnFungle.GetBool() && Main.CurrentMap == MapNames.Fungle:
case CustomRoles.DarkHide when Main.CurrentMap == MapNames.Fungle:
case CustomRoles.Doormaster when Main.CurrentMap == MapNames.Mira:
case CustomRoles.Pelican when Roles[RoleAssignType.Impostor].Any(x => x.Role == CustomRoles.Duellist):
case CustomRoles.Duellist when Roles[RoleAssignType.NeutralKilling].Any(x => x.Role == CustomRoles.Pelican):
case CustomRoles.VengefulRomantic:
+5 -4
View File
@@ -661,14 +661,16 @@ internal static class ChatCommands
IEnumerable<CustomRoles> impRoles = allRoles.Where(x => x.IsImpostor()).Shuffle().Take(Options.FactionMinMaxSettings[Team.Impostor].MaxSetting.GetInt());
IEnumerable<CustomRoles> nkRoles = allRoles.Where(x => x.IsNK()).Shuffle().Take(Options.RoleSubCategoryLimits[RoleOptionType.Neutral_Killing][2].GetInt());
IEnumerable<CustomRoles> nnkRoles = allRoles.Where(x => x.IsNonNK()).Shuffle().Take(Options.RoleSubCategoryLimits[RoleOptionType.Neutral_Evil][2].GetInt() + Options.RoleSubCategoryLimits[RoleOptionType.Neutral_Benign][2].GetInt());
IEnumerable<CustomRoles> covenRoles = allRoles.Where(x => x.IsCoven()).Shuffle().Take(Options.FactionMinMaxSettings[Team.Coven].MaxSetting.GetInt());
allRoles.RemoveAll(x => x.IsImpostor());
allRoles.RemoveAll(x => x.IsNK());
allRoles.RemoveAll(x => x.IsNonNK());
allRoles.RemoveAll(x => x.IsCoven());
DraftRoles = allRoles
.Take(allPlayerIds.Length * 5)
.CombineWith(impRoles, nkRoles, nnkRoles)
.CombineWith(impRoles, nkRoles, nnkRoles, covenRoles)
.Shuffle()
.Partition(allPlayerIds.Length)
.Zip(allPlayerIds)
@@ -694,10 +696,9 @@ internal static class ChatCommands
private static void MuteCommand(PlayerControl player, string text, string[] args)
{
if (!player.IsHost() && (GameStates.InGame || MutedPlayers.ContainsKey(player.PlayerId))) return;
if (!byte.TryParse(args[1], out byte id) || id.IsHost()) return;
if (args.Length < 3 || !byte.TryParse(args[1], out byte id) || id.IsHost()) return;
int duration = !int.TryParse(args[2], out int dur) ? 60 : dur;
int duration = args.Length < 3 || !int.TryParse(args[2], out int dur) ? 60 : dur;
MutedPlayers[id] = (Utils.TimeStamp, duration);
Utils.SendMessage("\n", player.PlayerId, string.Format(GetString("PlayerMuted"), id.ColoredPlayerName(), duration));
Utils.SendMessage("\n", id, string.Format(GetString("YouMuted"), player.PlayerId.ColoredPlayerName(), duration));
+1 -1
View File
@@ -76,7 +76,7 @@ internal static class OnGameJoinedPatch
{
JoiningGame = false;
if (GameStates.IsOnlineGame && GameStates.CurrentServerType == GameStates.ServerType.Vanilla)
if (GameStates.IsOnlineGame && GameStates.CurrentServerType != GameStates.ServerType.Custom)
{
try
{
+2
View File
@@ -5500,6 +5500,8 @@
"DoomsayerGuessSameRoleAgainMsg": "You tried to guess the same role or add-on that you guessed before",
"DoYourTasksPlease": "Please do your tasks!",
"OnlyShowPart": "Shown only part",
"YouReceivedTheNecronomicon": "You have received the <{0}>Necronomicon</color>! This grants you the ability to kill normally, and other abilities based on your role.",
"PlayerReceivedTheNecronomicon": "<b>{0}</b> has received the <{1}>Necronomicon</color>!",
"CovenLeader": "Coven Leader",
"CovenLeaderInfo": "Lead the Coven & Kill",
"CovenLeaderInfoLong": "(Coven):\\nYou will always spawn if the Coven is enabled. You are the only Coven member who can directly kill. You gain the Necronomicon first. When your powers are enhanced by the Necronomicon, your kill cooldown is halved, and you gain a long kill distance.",
+1
View File
@@ -64,6 +64,7 @@ public class Banshee : Coven
w.WritePacked(1);
w.WritePacked(ScreechedPlayers.Count);
ScreechedPlayers.Do(x => w.Write(x));
Utils.EndRPC(w);
Utils.NotifyRoles(SpecifySeer: pc);
}
+14 -8
View File
@@ -17,17 +17,23 @@ public abstract class Coven : RoleBase
protected bool HasNecronomicon { get; private set; }
protected virtual void OnReceiveNecronomicon() { }
private static void GiveNecronomicon()
{
var covenPlayers = Main.PlayerStates.Values.Select(x => x.Role as Coven).Where(x => x != null).ToList();
covenPlayers.RemoveAll(x => x.HasNecronomicon || x.NecronomiconReceivePriority == NecronomiconReceivePriorities.Never);
if (covenPlayers.Count == 0) return;
var psDict = Main.PlayerStates.Where(x => x.Value.Role is Coven { HasNecronomicon: false } coven && coven.NecronomiconReceivePriority != NecronomiconReceivePriorities.Never).ToDictionary(x => x.Key, x => x.Value);
if (psDict.Count == 0) return;
var receiver = covenPlayers.Find(x => x.NecronomiconReceivePriority == NecronomiconReceivePriorities.First) ?? covenPlayers.RandomElement();
receiver.HasNecronomicon = true;
receiver.OnReceiveNecronomicon();
var receiver = psDict.Shuffle().OrderBy(x => ((Coven)x.Value.Role).NecronomiconReceivePriority).First();
var covenRole = (Coven)receiver.Value.Role;
covenRole.HasNecronomicon = true;
covenRole.OnReceiveNecronomicon();
LateTask.New(() =>
{
Utils.SendMessage("\n", receiver.Key, string.Format(Translator.GetString("YouReceivedTheNecronomicon"), Main.CovenColor));
Main.AllPlayerControls.Where(x => x.Is(Team.Coven)).Select(x => x.PlayerId).Do(x => Utils.SendMessage("\n", x, string.Format(Translator.GetString("PlayerReceivedTheNecronomicon"), receiver.Key.ColoredPlayerName(), Main.CovenColor)));
}, 12f, log: false);
}
[HarmonyPatch(typeof(MeetingHud), nameof(MeetingHud.Start))]
+10 -6
View File
@@ -61,14 +61,14 @@ public class Werewolf : RoleBase
WWId = playerId;
RampageTime = -10;
lastTime = -10;
CD = StartingKillCooldown.GetInt();
lastTime = Utils.TimeStamp + 12;
CD = 0;
LateTask.New(() =>
{
if (UseUnshiftTrigger.GetBool() && UseUnshiftTriggerForNKs.GetBool())
Utils.GetPlayerById(playerId).RpcResetAbilityCooldown();
}, 9f, log: false);
}, 12f, log: false);
}
public override void Remove(byte playerId)
@@ -146,9 +146,13 @@ public class Werewolf : RoleBase
{
lastTime = -10;
bool unshift = UseUnshiftTrigger.GetBool() && UseUnshiftTriggerForNKs.GetBool();
if (!player.IsModClient()) player.Notify(GetString(unshift ? "WWCanRampageUnshift" : "WWCanRampage"));
if (!player.IsModClient()) player.RpcChangeRoleBasis(unshift ? CustomRoles.Werewolf : CustomRoles.EngineerEHR);
if (!player.IsModClient())
{
player.Notify(GetString(unshift ? "WWCanRampageUnshift" : "WWCanRampage"));
player.RpcChangeRoleBasis(unshift ? CustomRoles.Werewolf : CustomRoles.EngineerEHR);
}
SendRPC();
CD = 0;
}