mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
KOTZ controlling team nerf + some fixes
This commit is contained in:
1 parent
e38c246e07
commit
2ac3a962cc
7 files changed
+12
-31
No files matched your search
@@ -441,12 +441,11 @@ public static class KingOfTheZones
|
||||
|
||||
public static void OnCheckMurder(PlayerControl killer, PlayerControl target)
|
||||
{
|
||||
if (!Main.IntroDestroyed || !GameGoing || PlayerTeams[killer.PlayerId] == PlayerTeams[target.PlayerId] || SpawnProtectionTimes.ContainsKey(target.PlayerId)) return;
|
||||
if (!Main.IntroDestroyed || !GameGoing || PlayerTeams[killer.PlayerId] == PlayerTeams[target.PlayerId] || SpawnProtectionTimes.ContainsKey(target.PlayerId) || new[] { killer, target }.Any(x => RespawnTimes.ContainsKey(x.PlayerId))) return;
|
||||
|
||||
PlayerControl[] pcs = [killer, target];
|
||||
if (pcs.Any(x => RespawnTimes.ContainsKey(x.PlayerId))) return;
|
||||
|
||||
pcs.Do(x => x.SetKillCooldown(TagCooldown.GetInt()));
|
||||
int cd = TagCooldown.GetInt();
|
||||
killer.SetKillCooldown(ZoneDomination.ContainsValue(PlayerTeams[killer.PlayerId]) ? cd * 1.5f : cd);
|
||||
target.SetKillCooldown(ZoneDomination.ContainsValue(PlayerTeams[target.PlayerId]) ? cd * 1.5f : cd);
|
||||
|
||||
RespawnTimes[target.PlayerId] = Utils.TimeStamp + RespawnTime.GetInt() + 1;
|
||||
Main.AllPlayerSpeed[target.PlayerId] = Main.MinSpeed;
|
||||
|
||||
@@ -225,24 +225,6 @@ internal static class CustomRoleSelector
|
||||
Logger.Info(string.Join(", ", Roles[RoleAssignType.Madmate].Select(x => x.Role.ToString())), "PreSelectedMadmateRoles");
|
||||
Logger.Info(string.Join(", ", Roles[RoleAssignType.Coven].Select(x => x.Role.ToString())), "PreSelectedCovenRoles");
|
||||
Logger.Msg("===================================================", "PreSelectedRoles");
|
||||
|
||||
try
|
||||
{
|
||||
int attempts = 0;
|
||||
const RoleAssignType type = RoleAssignType.NonKillingNeutral;
|
||||
|
||||
while (Roles[type].Count > nnkLimit)
|
||||
{
|
||||
if (attempts++ > 100) break;
|
||||
|
||||
if (Roles[type].Count == 0) break;
|
||||
var toRemove = Roles[type].RandomElement();
|
||||
Roles[type].Remove(toRemove);
|
||||
|
||||
Logger.Info($"Removed {toRemove.Role} from {type}", "CustomRoleSelector");
|
||||
}
|
||||
}
|
||||
catch (Exception e) { Utils.ThrowException(e); }
|
||||
|
||||
try
|
||||
{
|
||||
|
||||
@@ -1031,7 +1031,7 @@ internal static class CustomRolesHelper
|
||||
CustomRoles.Damocles when pc.GetCustomRole() is CustomRoles.Bomber or CustomRoles.Nuker or CustomRoles.SerialKiller or CustomRoles.Cantankerous => false,
|
||||
CustomRoles.Damocles when !pc.CanUseKillButton() => false,
|
||||
CustomRoles.Flashman when pc.Is(CustomRoles.Swiftclaw) || pc.Is(CustomRoles.Giant) || pc.Is(CustomRoles.Spurt) => false,
|
||||
CustomRoles.Giant when pc.Is(CustomRoles.Flashman) || pc.Is(CustomRoles.Spurt) => false,
|
||||
CustomRoles.Giant when pc.Is(CustomRoles.Flashman) || pc.Is(CustomRoles.Spurt) || pc.Is(CustomRoles.RoomRusher) => false,
|
||||
CustomRoles.Necroview when pc.Is(CustomRoles.Visionary) => false,
|
||||
CustomRoles.Mimic when pc.Is(CustomRoles.Mafia) => false,
|
||||
CustomRoles.Rascal when !pc.IsCrewmate() => false,
|
||||
|
||||
+1
-1
@@ -3059,7 +3059,7 @@ public static class Utils
|
||||
Scout.OnPlayerDeath(target);
|
||||
Dad.OnAnyoneDeath(target);
|
||||
Crewmate.Sentry.OnAnyoneMurder(target);
|
||||
Soothsayer.OnAnyoneDeath(target.GetRealKiller(), target);
|
||||
Soothsayer.OnAnyoneDeath(target.GetRealKiller());
|
||||
|
||||
TargetDies(target.GetRealKiller(), target);
|
||||
}
|
||||
|
||||
@@ -900,14 +900,15 @@ internal static class ChatCommands
|
||||
return;
|
||||
}
|
||||
|
||||
if (!player.IsHost() && (GameStates.InGame || MutedPlayers.ContainsKey(player.PlayerId))) return;
|
||||
if (!byte.TryParse(args[1], out byte id) || id.IsHost()) return;
|
||||
bool host = player.IsHost();
|
||||
if (!host && (GameStates.InGame || MutedPlayers.ContainsKey(player.PlayerId))) return;
|
||||
if (!byte.TryParse(args[1], out byte id) || id.IsHost() || (!host && IsPlayerModerator(id.GetPlayer()?.FriendCode))) return;
|
||||
|
||||
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));
|
||||
if (!player.IsHost()) Utils.SendMessage("\n", 0, string.Format(GetString("ModeratorMuted"), player.PlayerId.ColoredPlayerName(), id.ColoredPlayerName(), duration));
|
||||
if (!host) Utils.SendMessage("\n", 0, string.Format(GetString("ModeratorMuted"), player.PlayerId.ColoredPlayerName(), id.ColoredPlayerName(), duration));
|
||||
}
|
||||
|
||||
private static void UnmuteCommand(PlayerControl player, string text, string[] args)
|
||||
|
||||
@@ -5224,7 +5224,7 @@
|
||||
"TraineeNotify": "<#ffff00>As the <#4287f5>Trainee</color>, you can't vent, sabotage, shapeshift, or pet on the first round!</color>",
|
||||
"Soothsayer": "Soothsayer",
|
||||
"SoothsayerInfo": "Predict Who Kills You",
|
||||
"SoothsayerInfoLong": "(Crewmates):\\nAs the Soothsayer, you can predict who kills you. If you're correct, when you die, everyone will be notified of the killer's identity.",
|
||||
"SoothsayerInfoLong": "(Crewmates):\\nAs the Soothsayer, you can predict who kills you by voting them. If you're correct, when you die, everyone will be notified of the killer's identity.",
|
||||
"SoothsayerDiedNotify": "The Soothsayer predicted that {0} would kill them\\nand they were correct!",
|
||||
"Ventriloquist": "Ventriloquist",
|
||||
"VentriloquistInfo": "Make Others Say What You Want",
|
||||
|
||||
@@ -43,7 +43,6 @@ public class Soothsayer : RoleBase
|
||||
public override bool OnVote(PlayerControl player, PlayerControl target)
|
||||
{
|
||||
if (player == null || target == null || player.PlayerId == target.PlayerId) return false;
|
||||
|
||||
if (Target != byte.MaxValue || Main.DontCancelVoteList.Contains(player.PlayerId)) return false;
|
||||
|
||||
Target = target.PlayerId;
|
||||
@@ -52,7 +51,7 @@ public class Soothsayer : RoleBase
|
||||
return true;
|
||||
}
|
||||
|
||||
public static void OnAnyoneDeath(PlayerControl killer, PlayerControl target)
|
||||
public static void OnAnyoneDeath(PlayerControl killer)
|
||||
{
|
||||
Instances.DoIf(x => x.Target == killer.PlayerId, _ => Main.AllAlivePlayerControls.Do(p => p.Notify(string.Format(Translator.GetString("SoothsayerDiedNotify"), Utils.ColorString(Main.PlayerColors.GetValueOrDefault(killer.PlayerId), killer.GetRealName())), 10f)));
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user