This commit is contained in:
Gurge44 committed 2024-05-13 20:26:23 +02:00
1 parent db37189e2a
commit 7b7076e51e
10 files changed
+41 -34

No files matched your search

+10 -1
View File
@@ -55,8 +55,17 @@ namespace EHR.Modules
{
if (AssignedGhostRoles.Count >= GhostRoles.Count) return false;
if (pc.IsAlive() || pc.GetCountTypes() is CountTypes.None or CountTypes.OutOfGame || pc.Is(CustomRoles.EvilSpirit)) return false;
var suitableRole = GetSuitableGhostRole(pc);
if (suitableRole == CustomRoles.Specter && IsPartnerPickedRole()) return false;
switch (suitableRole)
{
case CustomRoles.Specter when IsPartnerPickedRole():
return false;
case CustomRoles.Haunter:
GhostRoles.Remove(CustomRoles.Haunter);
break;
}
return suitableRole.IsGhostRole() && !AssignedGhostRoles.Any(x => x.Key == pc.PlayerId || x.Value.Role == suitableRole);
bool IsPartnerPickedRole() => Main.PlayerStates[pc.PlayerId].Role switch