Merge remote-tracking branch 'origin/main'

This commit is contained in:
Gurge44 committed 2025-01-21 09:47:08 +01:00
commit d1f635a012
11 files changed
+46 -28

No files matched your search

+2
View File
@@ -176,6 +176,7 @@ internal static class CustomRoleSelector
Logger.Info($"Number of Impostors: {optImpNum}", "FactionLimits");
Logger.Info($"Number of Neutrals: {neutralLimits.MinSetting.GetInt()} - {neutralLimits.MaxSetting.GetInt()} => {numNeutrals}", "FactionLimits");
Logger.Info($"Number of Coven members: {covenLimits.MinSetting.GetInt()} - {covenLimits.MaxSetting.GetInt()} => {numCovens}", "FactionLimits");
Logger.Msg("=====================================================", "AllActiveRoles");
Logger.Info(string.Join(", ", Roles[RoleAssignType.Impostor].Select(x => $"{x.Role}: {x.SpawnChance}% - {x.MaxCount}")), "ImpRoles");
@@ -894,6 +895,7 @@ internal static class CustomRoleSelector
switch (role)
{
case CustomRoles.Autopsy when Options.EveryoneSeesDeathReasons.GetBool():
case CustomRoles.Gravestone when Options.EveryoneSeesDeadPlayersRoles.GetBool():
case CustomRoles.Mare or CustomRoles.Glow or CustomRoles.Sleep when Main.CurrentMap == MapNames.Fungle:
case CustomRoles.Madmate when Options.MadmateSpawnMode.GetInt() != 0:
case CustomRoles.Lovers or CustomRoles.LastImpostor or CustomRoles.Workhorse or CustomRoles.Undead or CustomRoles.Insane:
+1 -3
View File
@@ -393,7 +393,7 @@ public class TaskState
public void Update(PlayerControl player)
{
Logger.Info($"{player.GetNameWithRole().RemoveHtmlTags().RemoveHtmlTags()}: UpdateTask", "TaskState.Update");
Logger.Info($"{player.GetNameWithRole().RemoveHtmlTags()}: UpdateTask", "TaskState.Update");
GameData.Instance.RecomputeTaskCounts();
Logger.Info($"TotalTaskCounts = {GameData.Instance.CompletedTasks}/{GameData.Instance.TotalTasks}", "TaskState.Update");
@@ -447,9 +447,7 @@ public class TaskState
List<CustomRoles> addons = Main.PlayerStates[player.PlayerId].SubRoles;
if (addons.Contains(CustomRoles.Deadlined)) Deadlined.SetDone(player);
if (addons.Contains(CustomRoles.Stressed)) Stressed.OnTaskComplete(player);
if (addons.Contains(CustomRoles.Unlucky) && alive && IRandom.Instance.Next(0, 100) < Options.UnluckyTaskSuicideChance.GetInt()) player.Suicide();
if (GhostRolesManager.AssignedGhostRoles.TryGetValue(player.PlayerId, out (CustomRoles Role, IGhostRole Instance) ghostRole))
+7 -1
View File
@@ -694,6 +694,7 @@ public static class Options
public static OptionItem UsePets;
public static OptionItem PetToAssignToEveryone;
public static OptionItem AnonymousBodies;
public static OptionItem EveryoneSeesDeadPlayersRoles;
public static OptionItem UseUnshiftTrigger;
public static OptionItem UseUnshiftTriggerForNKs;
public static OptionItem UsePhantomBasis;
@@ -1977,6 +1978,11 @@ public static class Options
.SetHeader(true)
.SetColor(new Color32(0, 165, 255, byte.MaxValue));
EveryoneSeesDeadPlayersRoles = new BooleanOptionItem(23861, "EveryoneSeesDeadPlayersRoles", false, TabGroup.TaskSettings)
.SetGameMode(CustomGameMode.Standard)
.SetHeader(true)
.SetColor(new Color32(0, 255, 165, byte.MaxValue));
UseUnshiftTrigger = new BooleanOptionItem(23871, "UseUnshiftTrigger", false, TabGroup.TaskSettings)
.SetGameMode(CustomGameMode.Standard)
.SetHeader(true)
@@ -2740,4 +2746,4 @@ public static class Options
public static OptionItem VeteranAbilityChargesWhenFinishedTasks;
// ReSharper restore NotAccessedField.Global
}
}
+4
View File
@@ -3191,6 +3191,10 @@ public static class Utils
else if (covenShow && pc.Is(Team.Coven)) covenNum++;
}
impShow &= impnum > 0;
nkShow &= neutralnum > 0;
covenShow &= covenNum > 0;
StringBuilder sb = new();
sb.Append(notify ? "<#777777>" : string.Empty);
+20 -20
View File
@@ -769,27 +769,27 @@ internal static class StartGameHostPatch
EndOfSelectRolePatch:
switch (Options.CurrentGameMode)
Enum.GetValues<CustomGameMode>().DoIf(x => x.IsActiveOrIntegrated(), x =>
{
case CustomGameMode.AllInOne:
case CustomGameMode.HotPotato:
HotPotato.OnGameStart();
if (Options.CurrentGameMode == CustomGameMode.AllInOne) goto case CustomGameMode.NaturalDisasters;
break;
case CustomGameMode.HideAndSeek:
CustomHnS.StartSeekerBlindTime();
break;
case CustomGameMode.CaptureTheFlag:
CaptureTheFlag.OnGameStart();
break;
case CustomGameMode.NaturalDisasters:
NaturalDisasters.OnGameStart();
if (Options.CurrentGameMode == CustomGameMode.AllInOne) goto case CustomGameMode.RoomRush;
break;
case CustomGameMode.RoomRush:
RoomRush.OnGameStart();
break;
}
switch (x)
{
case CustomGameMode.HotPotato:
HotPotato.OnGameStart();
break;
case CustomGameMode.HideAndSeek:
CustomHnS.StartSeekerBlindTime();
break;
case CustomGameMode.CaptureTheFlag:
CaptureTheFlag.OnGameStart();
break;
case CustomGameMode.NaturalDisasters:
NaturalDisasters.OnGameStart();
break;
case CustomGameMode.RoomRush:
RoomRush.OnGameStart();
break;
}
});
HudManager.Instance.SetHudActive(true);
+2
View File
@@ -1077,6 +1077,7 @@
"GameStateCommand.ShowTasks": "Show amount of completed tasks",
"MinPlayersForGameStateCommand": "Minimum alive players to use this command",
"EveryoneSeesDeathReasons": "Everyone Sees Death Reasons",
"EveryoneSeesDeadPlayersRoles": "Everyone Sees Dead Players' Roles",
"HostSeesCommandsEnteredByOthers": "Host Sees Commands Entered By Others",
"BlockVentMovement": "Block Movement Between Vents (while in a vent)",
"DoorsResetMode": "Mode",
@@ -1931,6 +1932,7 @@
"RomanticProtectCooldown": "Protect Cooldown",
"RomanticBetPlayer": "You picked your partner",
"RomanticBetOnYou": "The Romantic chose you as their Partner!",
"Romantic.PickPartnerText": "PICK PARTNER",
"VengefulKCD": "<color=#ba2749>Vengeful Romantic</color> Kill Cooldown",
"VengefulCanVent": "<color=#ba2749>Vengeful Romantic</color> Can Vent",
"VengefulHasImpVision": "<color=#ba2749>Vengeful Romantic</color> Has <#ff1919>Impostor</color> Vision",
+1
View File
@@ -107,6 +107,7 @@ internal class Sentinel : RoleBase
public override void SetupCustomOption()
{
SetupRoleOptions(Id, TabGroup.CrewmateRoles, CustomRoles.Sentinel);
PatrolCooldown = CreateCDSetting(Id + 2, TabGroup.CrewmateRoles, CustomRoles.Sentinel);
PatrolDuration = new IntegerOptionItem(Id + 3, "SentinelPatrolDuration", new(1, 90, 1), 5, TabGroup.CrewmateRoles)
+3 -1
View File
@@ -13,8 +13,8 @@ public class Assumer : RoleBase
private static OptionItem CanKill;
private static OptionItem KillCooldown;
private static OptionItem CanVent;
private byte AssumerId;
private byte AssumerId;
private (byte Id, int VoteNum) Assumption;
private bool HasAssumed => Assumption.Id != byte.MaxValue;
public override bool IsEnable => On;
@@ -75,6 +75,8 @@ public class Assumer : RoleBase
if (pva.VotedFor == instance.Assumption.Id || (VoteReceiverDies.GetBool() && pva.TargetPlayerId == instance.Assumption.Id))
CheckForEndVotingPatch.TryAddAfterMeetingDeathPlayers(PlayerState.DeathReason.Assumed, pva.TargetPlayerId);
}
instance.Assumption = (byte.MaxValue, 0);
}
}
+1
View File
@@ -88,6 +88,7 @@ public class Backstabber : RoleBase
public override bool KnowRole(PlayerControl seer, PlayerControl target)
{
if (base.KnowRole(seer, target)) return true;
return target.Is(CustomRoles.Backstabber) && RevealAfterKilling.GetBool() && target.GetAbilityUseLimit() == 0f;
}
+4 -3
View File
@@ -234,14 +234,14 @@ public class Romantic : RoleBase
public override string GetSuffix(PlayerControl seer, PlayerControl target, bool hud = false, bool meeting = false)
{
if (seer.PlayerId != target.PlayerId) return string.Empty;
if (seer.PlayerId != target.PlayerId || hud) return string.Empty;
if (seer.PlayerId == PartnerId && HasPickedPartner) return TargetArrow.GetArrows(seer, RomanticId);
if (seer.PlayerId != RomanticId || !seer.Is(CustomRoles.Romantic)) return string.Empty;
Color color = !HasPickedPartner ? Color.white : Utils.GetRoleColor(CustomRoles.Romantic);
string text = !HasPickedPartner ? "PICK PARTNER" : "♥";
string text = !HasPickedPartner ? GetString("Romantic.PickPartnerText") : "♥";
if (Arrows.GetBool()) text += TargetArrow.GetArrows(seer, PartnerId);
return Utils.ColorString(color, text);
@@ -295,11 +295,12 @@ public class Romantic : RoleBase
Logger.Info($"Impostor Romantic Partner Died => Changing {RomanticPC.GetNameWithRole()} to Refugee", "Romantic");
RomanticPC.RpcSetCustomRole(CustomRoles.Refugee);
}
else if (Partner.HasKillButton() || partnerRole.IsNK() || partnerRole.GetDYRole() == RoleTypes.Impostor) // If the Partner has a kill button (NK or CK), Romantic becomes the role they were
else if (Partner.HasKillButton() || partnerRole.IsNK() || partnerRole.GetDYRole() is RoleTypes.Impostor or RoleTypes.Shapeshifter or RoleTypes.Phantom) // If the Partner has a kill button (NK or CK), Romantic becomes the role they were
{
try
{
RomanticPC.RpcSetCustomRole(partnerRole);
RomanticPC.RpcChangeRoleBasis(partnerRole);
Main.PlayerStates[RomanticId].RemoveSubRole(CustomRoles.NotAssigned);
Logger.Info($"Romantic Partner With Kill Button Died => Changing {RomanticPC.GetNameWithRole()} to {Partner.GetAllRoleName().RemoveHtmlTags()}", "Romantic");
}
+1
View File
@@ -165,6 +165,7 @@ public abstract class RoleBase : IComparable<RoleBase>
public virtual bool KnowRole(PlayerControl seer, PlayerControl target)
{
if (Options.NeutralsKnowEachOther.GetBool() && seer.Is(Team.Neutral) && target.Is(Team.Neutral)) return true;
if (Options.EveryoneSeesDeadPlayersRoles.GetBool() && !target.IsAlive()) return true;
CustomRoles seerRole = seer.GetCustomRole();
return seerRole.IsNK() && seerRole == target.GetCustomRole() && seer.GetTeam() == target.GetTeam();