Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coven (New Faction... again....) #1245

Merged
merged 125 commits into from
Jan 6, 2025
Merged
Show file tree
Hide file tree
Changes from 82 commits
Commits
Show all changes
125 commits
Select commit Hold shift + click to select a range
095f94b
work from the past 3 days
MargaretTheFool Sep 10, 2024
9b54799
more stuff
MargaretTheFool Sep 11, 2024
85cf456
rit and role classes
MargaretTheFool Sep 12, 2024
897a1d8
h
MargaretTheFool Sep 13, 2024
9382b93
Merge branch 'DevBuild_2.1.0' into coven
MargaretTheFool Sep 13, 2024
f2c5e72
i am really good at commit names
MargaretTheFool Sep 17, 2024
03169fa
Merge branch 'DevBuild_2.1.0' into coven
MargaretTheFool Sep 17, 2024
79af27e
conj fix
MargaretTheFool Sep 19, 2024
71b5590
push so i can merge and bug fix
MargaretTheFool Sep 24, 2024
b7ce6a5
merge
MargaretTheFool Sep 24, 2024
fbbead2
a
MargaretTheFool Sep 24, 2024
6b541bf
push then merge because alpha 15 is bugged as hell
MargaretTheFool Sep 29, 2024
bcce5a8
merge
MargaretTheFool Sep 29, 2024
94b2aee
update strings
MargaretTheFool Sep 29, 2024
752a4d0
medusa fix
MargaretTheFool Oct 5, 2024
696b0ef
moon dancer
MargaretTheFool Oct 6, 2024
24d6bcd
merge
MargaretTheFool Oct 14, 2024
76f8c95
yada yada
MargaretTheFool Oct 27, 2024
ef2bc48
Voodoo Master and Coven interactions with other roles
MargaretTheFool Nov 3, 2024
e38b06b
get rid of spellcaster, fix oiiai, make enchanted count as coven
MargaretTheFool Nov 5, 2024
bc8a36b
update illusionist cases
MargaretTheFool Nov 5, 2024
f2a5098
potionmaster rework
MargaretTheFool Nov 7, 2024
e4bc933
merge
MargaretTheFool Nov 7, 2024
99d64ab
poisoner rework
MargaretTheFool Nov 9, 2024
93b4680
change vent abilities to unshapeshift
MargaretTheFool Nov 9, 2024
8ce837a
revert amnesiac changes
MargaretTheFool Nov 9, 2024
a78aaea
change some stuff for HM
MargaretTheFool Nov 9, 2024
204de4d
necromancer rework
MargaretTheFool Nov 10, 2024
e779cdc
jinx rework
MargaretTheFool Nov 10, 2024
29c277a
vm kill change
MargaretTheFool Nov 10, 2024
f6bb580
add enchanted to admirer and gangster
MargaretTheFool Nov 10, 2024
a5463a2
some changes, attempt to fix necronomicon (it didnt work)
MargaretTheFool Nov 11, 2024
a7f4dd1
FINALLY FIXED NECRONOMICON
MargaretTheFool Nov 11, 2024
a94faaa
remove random freezing on sacrifist
MargaretTheFool Nov 11, 2024
ca7c0f6
finish hexmaster rework + change some ids around
MargaretTheFool Nov 11, 2024
8b2d861
update hex master string and add /coveninfo
MargaretTheFool Nov 11, 2024
3ebcb40
/covinfo clarification
MargaretTheFool Nov 11, 2024
9b9de02
my dumbass forgot to do /r
MargaretTheFool Nov 11, 2024
2466990
enchanted and amnesiac interactions
MargaretTheFool Nov 15, 2024
77b1df2
fix voting
MargaretTheFool Nov 16, 2024
feff29d
add necro passing + kill checks for all roles
MargaretTheFool Nov 16, 2024
494608e
edit coveninfo
MargaretTheFool Nov 16, 2024
105a197
merge mod settings and game modifiers
MargaretTheFool Nov 16, 2024
1a80f86
finally fix guess menu holy shit that took forever
MargaretTheFool Nov 16, 2024
fd9abb9
fix necro voting + fix bugs
MargaretTheFool Nov 18, 2024
e36b713
removed original role colors for consistency
MargaretTheFool Nov 19, 2024
c51e925
coveninfolong
MargaretTheFool Nov 19, 2024
257e913
bug fixes?
MargaretTheFool Nov 20, 2024
12c2f65
clean up code a tiny bit
MargaretTheFool Nov 20, 2024
1b1bff2
bug fixes and roleblock immunity
MargaretTheFool Nov 21, 2024
2257cc0
merge
MargaretTheFool Nov 22, 2024
371e9de
recruitment stuff
MargaretTheFool Nov 22, 2024
5cfe80e
bug fixes
MargaretTheFool Nov 23, 2024
efad80f
fallback incase originalSpeed doesnt contain player somehow
MargaretTheFool Nov 24, 2024
abd52b0
fix ritualist tryhidemsg, fix necro and sacrifist cooldowns not reset…
MargaretTheFool Nov 26, 2024
1b2c92d
Revert unnecessary changes
NikoCat233 Nov 26, 2024
4541b6c
Ritualist never uses an RPC, get rid of it
MargaretTheFool Nov 26, 2024
d51bd09
some changes from review
MargaretTheFool Nov 26, 2024
bc793fa
merge
MargaretTheFool Nov 26, 2024
d62e304
fix some incorrect merges
MargaretTheFool Nov 26, 2024
b025ef5
stuff i forgot to do
MargaretTheFool Nov 28, 2024
baf031d
im stupid
MargaretTheFool Nov 28, 2024
5e7f0c2
remove dreamweaver and sorceress for now
MargaretTheFool Nov 29, 2024
2cca6d8
merge
MargaretTheFool Nov 29, 2024
4d78f55
remove unused usings
MargaretTheFool Nov 29, 2024
23fdbdf
attempt to fix sacrifist vision
MargaretTheFool Nov 29, 2024
04884ee
add some intro sounds
MargaretTheFool Nov 30, 2024
56f439b
i forgot to make roleblocks clear after meeting
MargaretTheFool Nov 30, 2024
0b1c5a1
fix IsJinxed
MargaretTheFool Nov 30, 2024
0b55def
coven cant be hexed initially
MargaretTheFool Nov 30, 2024
05d3b01
replace most instances of IsPlayerCoven with IsCovenTeam
MargaretTheFool Dec 1, 2024
e582969
add new illusionist setting
MargaretTheFool Dec 1, 2024
9315718
another attempt to fix ritualist tryhidemsg
MargaretTheFool Dec 1, 2024
a62d9fd
new illusionist settings
MargaretTheFool Dec 1, 2024
342d8c7
Update en_US.json
MargaretTheFool Dec 1, 2024
84521a6
the most nothingburger merge conflicts ive ever seen in my life
MargaretTheFool Dec 2, 2024
6200f16
run code cleanup, only affected these two roles
MargaretTheFool Dec 2, 2024
67489fc
更新 main.cs
NikoCat233 Dec 3, 2024
8eaa81a
Merge branch 'dev_2.2.0' into pr/1245
NikoCat233 Dec 3, 2024
af46676
220 Alpha5 Coven
NikoCat233 Dec 3, 2024
b2008ac
Resolve build issue
NikoCat233 Dec 3, 2024
13d58c8
Force use utf8 encoding
NikoCat233 Dec 3, 2024
83b41b8
Merge branch 'dev_2.2.0' into pr/1245
NikoCat233 Dec 4, 2024
2ae8659
merge
MargaretTheFool Dec 4, 2024
8942101
where did the neutral HM spawn from wtf
MargaretTheFool Dec 4, 2024
2d38dd5
remove hasenabled and playeridlist
MargaretTheFool Dec 4, 2024
19d986d
remove Dreamweaver and Sorceress from CustomRoles
MargaretTheFool Dec 5, 2024
0623cdc
Update Necromancer.cs
MargaretTheFool Dec 5, 2024
ee41c7d
im stupid
MargaretTheFool Dec 5, 2024
75fa8e9
Merge remote-tracking branch 'upstream/dev_2.2.0' into coven
MargaretTheFool Dec 5, 2024
2e75d05
prevent moondancer and ritualist null errors
MargaretTheFool Dec 5, 2024
aba43e7
update addon conflicts
MargaretTheFool Dec 7, 2024
4994b8f
Necromancer enhancements
MargaretTheFool Dec 7, 2024
93320a5
merge and update version
MargaretTheFool Dec 7, 2024
8a849e6
bug fixes
MargaretTheFool Dec 9, 2024
ead1fc3
and statements not or statements im smart
MargaretTheFool Dec 9, 2024
ed828f1
add Enchanted- string
MargaretTheFool Dec 9, 2024
0e5b5b9
merge
MargaretTheFool Dec 10, 2024
83340b6
merge with obfuscator changes
MargaretTheFool Dec 13, 2024
1c70b15
merge
MargaretTheFool Dec 16, 2024
0e103f6
fix mod not starting
MargaretTheFool Dec 17, 2024
34adb94
merge
MargaretTheFool Dec 20, 2024
bec84f4
fix poisoner and illusionist cant do second action
MargaretTheFool Dec 20, 2024
5826120
ritualist command fix attempt #3
MargaretTheFool Dec 20, 2024
bb3fbcb
oops
MargaretTheFool Dec 20, 2024
a0de012
coven can know celebrity
MargaretTheFool Dec 21, 2024
c113d70
Code cleaning 2024.12.22
NikoCat233 Dec 22, 2024
d2dbccb
Fix win condition check
NikoCat233 Dec 22, 2024
4a41ea4
fix /rt showing for host for real this time i swear
MargaretTheFool Dec 23, 2024
9c93923
Merge branch 'coven' of https://github.com/MargaretTheFool/TownofHost…
MargaretTheFool Dec 23, 2024
a15eff7
merge
MargaretTheFool Dec 26, 2024
54a5b08
update /icon and all coven can see coven icons
MargaretTheFool Dec 26, 2024
6276161
a bunch of quizmaster things
MargaretTheFool Dec 26, 2024
0908386
fix issues with getmarkothers
MargaretTheFool Dec 26, 2024
bf4e2f8
conj and sacrif cant kill coven
MargaretTheFool Dec 27, 2024
044b4a1
questions
MargaretTheFool Dec 28, 2024
adef584
strings
MargaretTheFool Dec 28, 2024
eba66d1
WhoOwns was supposed to be a stage 3
MargaretTheFool Dec 30, 2024
8836c2f
merge and ritualist change to current team
MargaretTheFool Dec 30, 2024
931ca8e
necromancer no longer dies if target dies during revenge
MargaretTheFool Dec 30, 2024
818dd9d
fix quizmaster cant set to level 5 and add shapeshift ability text fo…
MargaretTheFool Jan 1, 2025
27f9bc1
conj cant kill TNA
MargaretTheFool Jan 2, 2025
05a0083
cough cough
MargaretTheFool Jan 2, 2025
6722285
merge
MargaretTheFool Jan 6, 2025
82439ec
again again!
MargaretTheFool Jan 6, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 17 additions & 2 deletions Modules/AntiBlackout.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ namespace TOHE;
public static class AntiBlackout
{
///<summary>
/// Check num alive Impostors & Crewmates & NeutralKillers
/// Check num alive Impostors & Crewmates & NeutralKillers & Coven
///</summary>
public static bool BlackOutIsActive => false; /*!Options.DisableAntiBlackoutProtects.GetBool() && CheckBlackOut();*/

Expand All @@ -26,6 +26,7 @@ public static bool CheckBlackOut()
HashSet<byte> Impostors = [];
HashSet<byte> Crewmates = [];
HashSet<byte> NeutralKillers = [];
HashSet<byte> Coven = [];

var lastExiled = ExileControllerWrapUpPatch.AntiBlackout_LastExiled;
foreach (var pc in Main.AllAlivePlayerControls)
Expand All @@ -41,17 +42,23 @@ public static bool CheckBlackOut()
else if (pc.IsNeutralKiller() || pc.IsNeutralApocalypse())
NeutralKillers.Add(pc.PlayerId);

//Coven
if (pc.Is(Custom_Team.Coven))
Coven.Add(pc.PlayerId);

// Crewmate
else Crewmates.Add(pc.PlayerId);
}

var numAliveImpostors = Impostors.Count;
var numAliveCrewmates = Crewmates.Count;
var numAliveNeutralKillers = NeutralKillers.Count;
var numAliveCoven = Coven.Count;

Logger.Info($" {numAliveImpostors}", "AntiBlackout Num Alive Impostors");
Logger.Info($" {numAliveCrewmates}", "AntiBlackout Num Alive Crewmates");
Logger.Info($" {numAliveNeutralKillers}", "AntiBlackout Num Alive Neutral Killers");
Logger.Info($" {numAliveCoven}", "AntiBlackout Num Alive Coven");

var BlackOutIsActive = false;

Expand All @@ -61,12 +68,20 @@ public static bool CheckBlackOut()

// Alive Impostors > or = others team count
if (!BlackOutIsActive)
BlackOutIsActive = (numAliveNeutralKillers + numAliveCrewmates) <= numAliveImpostors;
BlackOutIsActive = (numAliveNeutralKillers + numAliveCrewmates + numAliveCoven) <= numAliveImpostors;

// One Impostor and one Neutral Killer is alive, and living Crewmates very few
if (!BlackOutIsActive)
BlackOutIsActive = numAliveNeutralKillers == 1 && numAliveImpostors == 1 && numAliveCrewmates <= 2;

// One Neutral Killer and one Coven is alive, and living Crewmates very few
if (!BlackOutIsActive)
BlackOutIsActive = numAliveNeutralKillers == 1 && numAliveCoven == 1 && numAliveCrewmates <= 2;

// One Coven and one Impostor is alive, and living Crewmates very few
if (!BlackOutIsActive)
BlackOutIsActive = numAliveCoven == 1 && numAliveImpostors == 1 && numAliveCrewmates <= 2;

Logger.Info($" {BlackOutIsActive}", "BlackOut Is Active");
return BlackOutIsActive;
}
Expand Down
86 changes: 45 additions & 41 deletions Modules/CustomRolesHelper.cs

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions Modules/CustomWinnerHolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,9 @@ public static bool CheckForConvertedWinner(byte playerId)
case CustomRoles.Contagious:
ResetAndSetWinner(CustomWinner.Virus);
return true;
case CustomRoles.Enchanted:
ResetAndSetWinner(CustomWinner.Coven);
return true;
}
}
return false;
Expand Down
2 changes: 2 additions & 0 deletions Modules/DisableDevice.cs
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ public static void FixedUpdate()
bool ignore = (Options.DisableDevicesIgnoreImpostors.GetBool() && pc.Is(Custom_Team.Impostor)) ||
(Options.DisableDevicesIgnoreNeutrals.GetBool() && pc.Is(Custom_Team.Neutral)) ||
(Options.DisableDevicesIgnoreCrewmates.GetBool() && pc.Is(Custom_Team.Crewmate)) ||
(Options.DisableDevicesIgnoreCoven.GetBool() && pc.Is(Custom_Team.Coven)) ||
(Options.DisableDevicesIgnoreAfterAnyoneDied.GetBool() && GameStates.AlreadyDied);

var mapId = Utils.GetActiveMapId();
Expand Down Expand Up @@ -157,6 +158,7 @@ public static void UpdateDisableDevices()
(Options.DisableDevicesIgnoreImpostors.GetBool() && player.Is(Custom_Team.Impostor)) ||
(Options.DisableDevicesIgnoreNeutrals.GetBool() && player.Is(Custom_Team.Neutral)) ||
(Options.DisableDevicesIgnoreCrewmates.GetBool() && player.Is(Custom_Team.Crewmate)) ||
(Options.DisableDevicesIgnoreCoven.GetBool() && player.Is(Custom_Team.Coven)) ||
(Options.DisableDevicesIgnoreAfterAnyoneDied.GetBool() && GameStates.AlreadyDied);

var admins = UnityEngine.Object.FindObjectsOfType<MapConsole>(true);
Expand Down
18 changes: 16 additions & 2 deletions Modules/ExtendedPlayerControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using TOHE.Roles.AddOns.Common;
using TOHE.Roles.AddOns.Impostor;
using TOHE.Roles.Core;
using TOHE.Roles.Coven;
using TOHE.Roles.Crewmate;
using TOHE.Roles.Impostor;
using TOHE.Roles.Neutral;
Expand Down Expand Up @@ -1162,7 +1163,8 @@ public static bool IsNonCrewSheriff(this PlayerControl sheriff)
|| sheriff.Is(CustomRoles.Charmed)
|| sheriff.Is(CustomRoles.Infected)
|| sheriff.Is(CustomRoles.Contagious)
|| sheriff.Is(CustomRoles.Egoist);
|| sheriff.Is(CustomRoles.Egoist)
|| sheriff.Is(CustomRoles.Enchanted);
}
public static bool ShouldBeDisplayed(this CustomRoles subRole)
{
Expand All @@ -1175,6 +1177,7 @@ CustomRoles.Admired and not
CustomRoles.Soulless and not
CustomRoles.Lovers and not
CustomRoles.Infected and not
CustomRoles.Enchanted and not
CustomRoles.Contagious;
}

Expand Down Expand Up @@ -1248,9 +1251,11 @@ public static List<PlayerControl> GetPlayersInAbilityRangeSorted(this PlayerCont
public static bool IsTransformedNeutralApocalypse(this PlayerControl player) => player.GetCustomRole().IsTNA();
public static bool IsNonNeutralKiller(this PlayerControl player) => player.GetCustomRole().IsNonNK();

public static bool IsPlayerCoven(this PlayerControl player) => player.GetCustomRole().IsCoven();
public static bool IsMurderedThisRound(this PlayerControl player) => player.PlayerId.IsMurderedThisRound();
public static bool IsMurderedThisRound(this byte playerId) => Main.MurderedThisRound.Contains(playerId);


public static bool KnowDeathReason(this PlayerControl seer, PlayerControl target)
=> (Options.EveryoneCanSeeDeathReason.GetBool()
|| seer.Is(CustomRoles.Doctor) || seer.Is(CustomRoles.Autopsy)
Expand Down Expand Up @@ -1279,6 +1284,9 @@ public static bool KnowRoleTarget(PlayerControl seer, PlayerControl target)
else if (Madmate.MadmateKnowWhosImp.GetBool() && seer.Is(CustomRoles.Madmate) && target.Is(Custom_Team.Impostor)) return true;
else if (Madmate.ImpKnowWhosMadmate.GetBool() && target.Is(CustomRoles.Madmate) && seer.Is(Custom_Team.Impostor)) return true;
else if (seer.Is(Custom_Team.Impostor) && target.GetCustomRole().IsGhostRole() && target.GetCustomRole().IsImpostor()) return true;
else if (Ritualist.EnchantedKnowsCoven.GetBool() && seer.Is(CustomRoles.Enchanted) && target.Is(Custom_Team.Coven)) return true;
else if (target.Is(CustomRoles.Enchanted) && seer.Is(Custom_Team.Coven)) return true;
else if (target.Is(Custom_Team.Coven) && seer.Is(Custom_Team.Coven)) return true;
else if (target.GetRoleClass().KnowRoleTarget(seer, target)) return true;
else if (seer.GetRoleClass().KnowRoleTarget(seer, target)) return true;
else if (Solsticer.OtherKnowSolsticer(target)) return true;
Expand All @@ -1303,6 +1311,7 @@ public static bool ShowSubRoleTarget(this PlayerControl seer, PlayerControl targ
else if (seer.Is(CustomRoles.GM) || target.Is(CustomRoles.GM) || seer.Is(CustomRoles.God) || (seer.IsHost() && Main.GodMode.Value)) return true;
else if (Main.VisibleTasksCount && !seer.IsAlive() && Options.GhostCanSeeOtherRoles.GetBool()) return true;
else if (Options.ImpsCanSeeEachOthersAddOns.GetBool() && seer.Is(Custom_Team.Impostor) && target.Is(Custom_Team.Impostor) && !subRole.IsBetrayalAddon()) return true;
else if (Options.CovenCanSeeEachOthersAddOns.GetBool() && seer.Is(Custom_Team.Coven) && target.Is(Custom_Team.Coven) && !subRole.IsBetrayalAddon()) return true;
else if (Options.ApocCanSeeEachOthersAddOns.GetBool() && seer.IsNeutralApocalypse() && target.IsNeutralApocalypse() && !subRole.IsBetrayalAddon()) return true;

else if ((subRole is CustomRoles.Madmate
Expand All @@ -1312,7 +1321,8 @@ or CustomRoles.Admired
or CustomRoles.Charmed
or CustomRoles.Infected
or CustomRoles.Contagious
or CustomRoles.Egoist)
or CustomRoles.Egoist
or CustomRoles.Enchanted)
&& KnowSubRoleTarget(seer, target))
return true;

Expand All @@ -1333,6 +1343,10 @@ public static bool KnowSubRoleTarget(PlayerControl seer, PlayerControl target)
else if (seer.Is(CustomRoles.Egoist) && target.Is(CustomRoles.Egoist) && Egoist.ImpEgoistVisibalToAllies.GetBool())
return true;
}
if (seer.Is(Custom_Team.Coven))
{
if (target.Is(CustomRoles.Enchanted) && Ritualist.EnchantedKnowsCoven.GetBool()) return true;
}
else if (Admirer.HasEnabled && Admirer.CheckKnowRoleTarget(seer, target)) return true;
else if (Cultist.HasEnabled && Cultist.KnowRole(seer, target)) return true;
else if (Infectious.HasEnabled && Infectious.KnowRole(seer, target)) return true;
Expand Down
9 changes: 9 additions & 0 deletions Modules/GameState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,10 @@ public void SetMainRole(CustomRoles role)
{
countTypes = CountTypes.OutOfGame;
}
if (pc.Is(CustomRoles.Enchanted))
{
countTypes = CountTypes.Coven;
}

if (GameStates.IsInGame && preMainRole != CustomRoles.NotAssigned)
{
Expand Down Expand Up @@ -213,6 +217,10 @@ public void SetSubRole(CustomRoles role, PlayerControl pc = null)
case CustomRoles.Soulless:
countTypes = CountTypes.OutOfGame;
break;

case CustomRoles.Enchanted:
countTypes = CountTypes.Coven;
break;
}
}
public void RemoveSubRole(CustomRoles addOn)
Expand Down Expand Up @@ -310,6 +318,7 @@ public enum DeathReason
Sacrificed,
Electrocuted,
Scavenged,
BlastedOff,

//Please add all new roles with deathreason & new deathreason in Utils.DeathReasonIsEnable();
etc = -1,
Expand Down
52 changes: 47 additions & 5 deletions Modules/GuessManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
using TOHE.Modules.ChatManager;
using TOHE.Roles.AddOns.Common;
using TOHE.Roles.Core;
using TOHE.Roles.Coven;
using TOHE.Roles.Crewmate;
using TOHE.Roles.Double;
using TOHE.Roles.Impostor;
Expand Down Expand Up @@ -150,6 +151,11 @@ public static bool GuesserMsg(PlayerControl pc, string msg, bool isUI = false)
pc.ShowInfoMessage(isUI, GetString("GuessNotAllowed"));
return true;
}
if (pc.GetCustomRole().IsCoven() && !Options.CovenCanGuess.GetBool() && !pc.Is(CustomRoles.Guesser))
{
pc.ShowInfoMessage(isUI, GetString("GuessNotAllowed"));
return true;
}

if (operate == 1)
{
Expand Down Expand Up @@ -187,6 +193,15 @@ public static bool GuesserMsg(PlayerControl pc, string msg, bool isUI = false)

if (target != null)
{

if (target.Is(CustomRoles.VoodooMaster) && VoodooMaster.Dolls[target.PlayerId].Count > 0)
{
target = Utils.GetPlayerById(VoodooMaster.Dolls[target.PlayerId].Where(x => Utils.GetPlayerById(x).IsAlive()).ToList().RandomElement());
_ = new LateTask(() =>
{
Utils.SendMessage(string.Format(GetString("VoodooMasterTargetInMeeting"), target.GetRealName()), Utils.GetPlayerListByRole(CustomRoles.VoodooMaster).First().PlayerId);
}, 2f, "Voodoo Master Notify");
}
GuessMaster.OnGuess(role);
bool guesserSuicide = false;

Expand Down Expand Up @@ -284,6 +299,13 @@ public static bool GuesserMsg(PlayerControl pc, string msg, bool isUI = false)
return true;
}

// Coven Cant Guess Addons
if (Options.CovenCanGuess.GetBool() && pc.Is(Custom_Team.Coven) && !pc.Is(CustomRoles.Guesser))
{
pc.ShowInfoMessage(isUI, GetString("GuessAdtRole"));
return true;
}

// Neutrals Cant Guess Addons
if ((Options.NeutralKillersCanGuess.GetBool() || Options.PassiveNeutralsCanGuess.GetBool()) && pc.Is(Custom_Team.Neutral) && !(pc.Is(CustomRoles.Doomsayer) || pc.Is(CustomRoles.Guesser)))
{
Expand All @@ -299,6 +321,14 @@ public static bool GuesserMsg(PlayerControl pc, string msg, bool isUI = false)
return true;
}
}
if (role.IsCoven() && !Options.CovenCanGuessCoven.GetBool())
{
if (Options.CovenCanGuess.GetBool() && (pc.Is(Custom_Team.Coven) || pc.Is(CustomRoles.Enchanted)) && !pc.Is(CustomRoles.Guesser))
{
pc.ShowInfoMessage(isUI, GetString("GuessCovenRole"));
return true;
}
}
if (role.IsCrewmate() && !Options.CrewCanGuessCrew.GetBool())
{
if (Options.CrewmatesCanGuess.GetBool() && pc.Is(Custom_Team.Crewmate) && !(pc.Is(CustomRoles.NiceGuesser) || pc.Is(CustomRoles.Guesser)))
Expand Down Expand Up @@ -614,6 +644,8 @@ public static void Postfix(MeetingHud __instance)
CreateGuesserButton(__instance);
if (PlayerControl.LocalPlayer.IsAlive() && PlayerControl.LocalPlayer.GetCustomRole().IsNonNK() && Options.PassiveNeutralsCanGuess.GetBool())
CreateGuesserButton(__instance);
if (PlayerControl.LocalPlayer.IsAlive() && PlayerControl.LocalPlayer.GetCustomRole().IsCoven() && Options.CovenCanGuess.GetBool())
CreateGuesserButton(__instance);
else if (PlayerControl.LocalPlayer.GetCustomRole() is CustomRoles.Doomsayer && !Options.PassiveNeutralsCanGuess.GetBool() && !Doomsayer.CheckCantGuess)
CreateGuesserButton(__instance);
}
Expand Down Expand Up @@ -703,7 +735,7 @@ static void GuesserOnClick(byte playerId, MeetingHud __instance)
container.transform.localPosition = new Vector3(0, 0, -200f);
guesserUI = container.gameObject;

List<int> info = [0, 0, 0, 0];
List<int> info = [0, 0, 0, 0, 0];
var buttonTemplate = __instance.playerStates[0].transform.FindChild("votePlayerBase");
var maskTemplate = __instance.playerStates[0].transform.FindChild("MaskArea");
var smallButtonTemplate = __instance.playerStates[0].Buttons.transform.Find("CancelButton");
Expand Down Expand Up @@ -743,11 +775,12 @@ static void GuesserOnClick(byte playerId, MeetingHud __instance)
Crewmate = 0
Impostor = 1
Neutral = 2
Add-ons = 3
Coven = 3
Add-ons = 4
*/

int tabCount = 0;
for (int TabId = 0; TabId < 4; TabId++)
for (int TabId = 0; TabId < 5; TabId++)
{
if (PlayerControl.LocalPlayer.Is(CustomRoles.EvilGuesser))
{
Expand All @@ -765,7 +798,7 @@ static void GuesserOnClick(byte playerId, MeetingHud __instance)
{
//if (!Options.GCanGuessCrew.GetBool() && TabId == 0) continue;
//if (!Options.GCanGuessImp.GetBool() && TabId == 1) continue;
if (!Guesser.GCanGuessAdt.GetBool() && TabId == 3) continue;
if (!Guesser.GCanGuessAdt.GetBool() && TabId == 4) continue;
}
else if (Options.GuesserMode.GetBool() &&
!(PlayerControl.LocalPlayer.Is(CustomRoles.EvilGuesser) ||
Expand All @@ -775,7 +808,8 @@ static void GuesserOnClick(byte playerId, MeetingHud __instance)
{
if (!Options.CrewCanGuessCrew.GetBool() && PlayerControl.LocalPlayer.Is(Custom_Team.Crewmate) && TabId == 0) continue;
if (!Options.ImpCanGuessImp.GetBool() && PlayerControl.LocalPlayer.Is(Custom_Team.Impostor) && TabId == 1) continue;
if (!Options.CanGuessAddons.GetBool() && TabId == 3) continue;
if (!Options.CovenCanGuessCoven.GetBool() && PlayerControl.LocalPlayer.Is(Custom_Team.Coven) && TabId == 3) continue;
if (!Options.CanGuessAddons.GetBool() && TabId == 4) continue;
}

Transform TeambuttonParent = new GameObject().transform;
Expand All @@ -793,6 +827,7 @@ static void GuesserOnClick(byte playerId, MeetingHud __instance)
Custom_Team.Crewmate => new Color32(140, 255, 255, byte.MaxValue),
Custom_Team.Impostor => new Color32(255, 25, 25, byte.MaxValue),
Custom_Team.Neutral => new Color32(127, 140, 141, byte.MaxValue),
Custom_Team.Coven => new Color32(172, 66, 242, byte.MaxValue),
Custom_Team.Addon => new Color32(255, 154, 206, byte.MaxValue),
_ => throw new NotImplementedException(),
};
Expand Down Expand Up @@ -951,6 +986,12 @@ void ClickEvent()
listOfRoles.Add(CustomRoles.War);
}

if (CustomRoles.Ritualist.IsEnable())
{
if (!listOfRoles.Contains(CustomRoles.Enchanted))
listOfRoles.Add(CustomRoles.Enchanted);
}

arrayOfRoles = [.. listOfRoles];
}
else
Expand Down Expand Up @@ -984,6 +1025,7 @@ or CustomRoles.Mare
or CustomRoles.Cyber
or CustomRoles.Sloth
or CustomRoles.Apocalypse
or CustomRoles.Coven
|| (role.IsTNA() && !Options.TransformedNeutralApocalypseCanBeGuessed.GetBool())) continue;

if (role is CustomRoles.NiceMini && Mini.Age < 18) continue;
Expand Down
7 changes: 7 additions & 0 deletions Modules/NameColorManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using TOHE.Roles.AddOns.Common;
using TOHE.Roles.AddOns.Impostor;
using TOHE.Roles.Core;
using TOHE.Roles.Coven;
using TOHE.Roles.Crewmate;
using TOHE.Roles.Impostor;
using TOHE.Roles.Neutral;
Expand Down Expand Up @@ -49,6 +50,12 @@ private static bool KnowTargetRoleColor(PlayerControl seer, PlayerControl target
if (seer.Is(Custom_Team.Impostor) && target.GetCustomRole().IsGhostRole() && target.GetCustomRole().IsImpostor()) color = Main.roleColors[CustomRoles.Madmate];
if (seer.Is(CustomRoles.Madmate) && target.Is(CustomRoles.Madmate) && Madmate.MadmateKnowWhosMadmate.GetBool()) color = Main.roleColors[CustomRoles.Madmate];

// Coven
if (seer.Is(Custom_Team.Coven) && target.Is(Custom_Team.Coven)) color = Main.roleColors[CustomRoles.Coven];
if (seer.Is(CustomRoles.Enchanted) && target.Is(Custom_Team.Coven) && Ritualist.EnchantedKnowsCoven.GetBool()) color = Main.roleColors[CustomRoles.Coven];
if (seer.Is(Custom_Team.Coven) && target.Is(CustomRoles.Enchanted)) color = Main.roleColors[CustomRoles.Enchanted];
if (seer.Is(CustomRoles.Enchanted) && target.Is(CustomRoles.Enchanted) && Ritualist.EnchantedKnowsEnchanted.GetBool()) color = Main.roleColors[CustomRoles.Enchanted];

// Cultist
if (Cultist.NameRoleColor(seer, target)) color = Main.roleColors[CustomRoles.Cultist];

Expand Down
Loading