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

Everything in PR#1303 #1318

Closed
wants to merge 233 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
233 commits
Select commit Hold shift + click to select a range
2665ec7
Update main.cs
impostor4291 Dec 5, 2024
efb7cf7
Update CustomRolesHelper.cs
impostor4291 Dec 5, 2024
0bde7b2
Update CustomWinnerHolder.cs
impostor4291 Dec 5, 2024
930e939
Update ExtendedPlayerControl.cs
impostor4291 Dec 5, 2024
62250f7
Update GameState.cs
impostor4291 Dec 5, 2024
aef2d61
Update NameColorManager.cs
impostor4291 Dec 5, 2024
9d74b8c
Update Utils.cs
impostor4291 Dec 5, 2024
c03cfc7
Update ChatCommandPatch.cs
impostor4291 Dec 5, 2024
9040f0d
Update CheckGameEndPatch.cs
impostor4291 Dec 5, 2024
887bcc1
Update IntroPatch.cs
impostor4291 Dec 5, 2024
c389fc6
Update MeetingHudPatch.cs
impostor4291 Dec 5, 2024
807cc22
Update roleColor.json
impostor4291 Dec 5, 2024
a6ac2d6
Update en_US.json
impostor4291 Dec 5, 2024
0115778
Update Necroview.cs
impostor4291 Dec 5, 2024
88c748c
Add files via upload
impostor4291 Dec 5, 2024
b1f2089
Update Narc.cs
impostor4291 Dec 5, 2024
459387e
Update CustomRoleManager.cs
impostor4291 Dec 5, 2024
ccfea79
Update Admirer.cs
impostor4291 Dec 5, 2024
4c30212
Update Bodyguard.cs
impostor4291 Dec 5, 2024
e2ff5b4
Update Captain.cs
impostor4291 Dec 5, 2024
a0f9586
Update Celebrity.cs
impostor4291 Dec 5, 2024
b5c821c
Update CopyCat.cs
impostor4291 Dec 5, 2024
fa80869
Update ChiefOfPolice.cs
impostor4291 Dec 5, 2024
4248923
Update Enigma.cs
impostor4291 Dec 5, 2024
5dce6cf
Update Grenadier.cs
impostor4291 Dec 5, 2024
b5fcedd
Update Inspector.cs
impostor4291 Dec 5, 2024
0a11015
Update Judge.cs
impostor4291 Dec 5, 2024
9d7bafe
Update Jailer.cs
impostor4291 Dec 5, 2024
7bc0fd7
Update Marshall.cs
impostor4291 Dec 5, 2024
66d6d7f
Update President.cs
impostor4291 Dec 5, 2024
d450647
Update Psychic.cs
impostor4291 Dec 5, 2024
ab6f8c7
Update Reverie.cs
impostor4291 Dec 5, 2024
20330e5
Update Sheriff.cs
impostor4291 Dec 5, 2024
fb4906b
Update Snitch.cs
impostor4291 Dec 5, 2024
0d1a480
Update Crewpostor.cs
impostor4291 Dec 5, 2024
7ace0dd
Update Gangster.cs
impostor4291 Dec 5, 2024
118338c
Update Imitator.cs
impostor4291 Dec 5, 2024
611720d
Update Lawyer.cs
impostor4291 Dec 5, 2024
ea04775
Update CopyCat.cs
impostor4291 Dec 5, 2024
54d9a82
Update CustomRolesHelper.cs
impostor4291 Dec 5, 2024
6907341
Update ExtendedPlayerControl.cs
impostor4291 Dec 5, 2024
2f81c5d
Update Crewpostor.cs
impostor4291 Dec 5, 2024
ab6bfbb
Update Jailer.cs
impostor4291 Dec 5, 2024
d46ddd4
Update CustomRolesHelper.cs
impostor4291 Dec 7, 2024
6f85304
Update ExtendedPlayerControl.cs
impostor4291 Dec 7, 2024
5ffd452
Update GameState.cs
impostor4291 Dec 7, 2024
df61021
Update GuessManager.cs
impostor4291 Dec 7, 2024
be0e674
Update MeetingHudPatch.cs
impostor4291 Dec 7, 2024
96dc01c
Update PlayerControlPatch.cs
impostor4291 Dec 7, 2024
21247e8
Update en_US.json
impostor4291 Dec 7, 2024
b1e1383
Update Necroview.cs
impostor4291 Dec 7, 2024
5b158bd
Update Narc.cs
impostor4291 Dec 7, 2024
22912f5
Update Captain.cs
impostor4291 Dec 7, 2024
5300f82
Update Celebrity.cs
impostor4291 Dec 7, 2024
de84c39
Update CopyCat.cs
impostor4291 Dec 7, 2024
25521d2
Update Enigma.cs
impostor4291 Dec 7, 2024
41f3afc
Update Grenadier.cs
impostor4291 Dec 7, 2024
f586e25
Update Jailer.cs
impostor4291 Dec 7, 2024
20ff19d
Update Judge.cs
impostor4291 Dec 7, 2024
27d2afb
Update President.cs
impostor4291 Dec 7, 2024
6ba4ce2
Update Reverie.cs
impostor4291 Dec 7, 2024
653cbf2
Update Amnesiac.cs
impostor4291 Dec 7, 2024
d3c6898
Update Imitator.cs
impostor4291 Dec 7, 2024
239daa1
Update Revenant.cs
impostor4291 Dec 7, 2024
41c0518
Update Romantic.cs
impostor4291 Dec 7, 2024
6b0f925
Update MeetingHudPatch.cs
impostor4291 Dec 7, 2024
37e89ad
Update President.cs
impostor4291 Dec 7, 2024
93c8c0e
Add files via upload
impostor4291 Dec 7, 2024
5a22759
Update ChatCommandPatch.cs
impostor4291 Dec 7, 2024
681d369
Update ChatCommandPatch.cs
impostor4291 Dec 7, 2024
7057cdf
Update ChatCommandPatch.cs
impostor4291 Dec 7, 2024
793c72f
Update Amnesiac.cs
impostor4291 Dec 8, 2024
1ce54dc
Update Revenant.cs
impostor4291 Dec 8, 2024
2e11bb9
Update CustomRolesHelper.cs
impostor4291 Dec 9, 2024
66720e8
Update MeetingHudPatch.cs
impostor4291 Dec 9, 2024
6636139
Update Necroview.cs
impostor4291 Dec 9, 2024
ad2f59c
Update Captain.cs
impostor4291 Dec 9, 2024
082c9c8
Update Celebrity.cs
impostor4291 Dec 9, 2024
0e76fd7
Update Enigma.cs
impostor4291 Dec 9, 2024
7a807c3
Update Grenadier.cs
impostor4291 Dec 9, 2024
3afdd99
Update Jailer.cs
impostor4291 Dec 9, 2024
8e07f93
Update Judge.cs
impostor4291 Dec 9, 2024
23e3bfc
Update President.cs
impostor4291 Dec 9, 2024
ffaad6b
Update Reverie.cs
impostor4291 Dec 9, 2024
5304d81
Update Amnesiac.cs
impostor4291 Dec 9, 2024
75937d6
Update Amnesiac.cs
impostor4291 Dec 9, 2024
c82fbf0
Update Romantic.cs
impostor4291 Dec 9, 2024
1d2a256
Merge pull request #6 from impostor4291/revert-changes
impostor4291 Dec 9, 2024
ed96271
how did i not see the missing "&&"
impostor4291 Dec 9, 2024
e7a8da8
Update Celebrity.cs
impostor4291 Dec 9, 2024
e8201cf
Update Narc.cs
impostor4291 Dec 9, 2024
865f9a6
new setting for Narc
impostor4291 Dec 9, 2024
b889555
Update NameColorManager.cs
impostor4291 Dec 9, 2024
52745b2
Update PlayerControlPatch.cs
impostor4291 Dec 9, 2024
14ec515
Update en_US.json
impostor4291 Dec 9, 2024
dc3ea6d
Update Imitator.cs
impostor4291 Dec 9, 2024
22935bf
Update CustomRolesHelper.cs
impostor4291 Dec 13, 2024
82259a2
Update MeetingHudPatch.cs
impostor4291 Dec 13, 2024
2265e14
Update Captain.cs
impostor4291 Dec 13, 2024
2bd21ee
Update Celebrity.cs
impostor4291 Dec 13, 2024
cc02362
Update Enigma.cs
impostor4291 Dec 13, 2024
4e6b01b
Update Grenadier.cs
impostor4291 Dec 13, 2024
f239987
Update Judge.cs
impostor4291 Dec 13, 2024
e3a9b88
Update Reverie.cs
impostor4291 Dec 13, 2024
e50fd4b
Update Vigilante.cs
impostor4291 Dec 13, 2024
880a60d
Update Imitator.cs
impostor4291 Dec 13, 2024
3b7e51e
Update ExtendedPlayerControl.cs
impostor4291 Dec 13, 2024
2fc1ffc
Update Celebrity.cs
impostor4291 Dec 13, 2024
511b61d
Narc Crewpostor should not kill Sheriff
impostor4291 Dec 13, 2024
fa8e2a4
Merge pull request #7 from impostor4291/customroleshelper
impostor4291 Dec 13, 2024
940574f
Update ExtendedPlayerControl.cs
impostor4291 Dec 13, 2024
741c7b7
Update ExtendedPlayerControl.cs
impostor4291 Dec 13, 2024
89306ac
Update ExtendedPlayerControl.cs
impostor4291 Dec 13, 2024
dd644bf
Update ExtendedPlayerControl.cs
impostor4291 Dec 13, 2024
9453de3
Update main.cs
impostor4291 Dec 21, 2024
7f1b7e4
Update Utils.cs
impostor4291 Dec 21, 2024
8a7de57
Update CheckGameEndPatch.cs
impostor4291 Dec 21, 2024
74d160e
Update OutroPatch.cs
impostor4291 Dec 21, 2024
d813933
Update PlayerControlPatch.cs
impostor4291 Dec 21, 2024
13c6257
Update Narc.cs
impostor4291 Dec 21, 2024
ccf455a
Update CustomRoleManager.cs
impostor4291 Dec 21, 2024
c313c08
Update Narc.cs
impostor4291 Dec 21, 2024
d21fb01
Update en_US.json
impostor4291 Dec 21, 2024
13bbf6b
Update en_US.json
impostor4291 Dec 21, 2024
8bffdd6
Update en_US.json
impostor4291 Dec 21, 2024
dd24f6e
Merge pull request #9 from impostor4291/some-changes
impostor4291 Dec 21, 2024
976db91
Update LastImpostor.cs
impostor4291 Dec 21, 2024
6b9a282
Merge pull request #10 from impostor4291/Forgot-to-change-Last-Impost…
impostor4291 Dec 21, 2024
32a623e
Update Utils.cs
impostor4291 Dec 21, 2024
dbf7a21
Update MeetingHudPatch.cs
impostor4291 Dec 21, 2024
28bc6f5
Update PlayerControlPatch.cs
impostor4291 Dec 21, 2024
ae515b2
taskinator should not win if narc wins
impostor4291 Dec 22, 2024
4efc5e5
changed strings
impostor4291 Dec 22, 2024
f8da1da
Update Utils.cs
impostor4291 Dec 23, 2024
4a47f8d
Update PlayerControlPatch.cs
impostor4291 Dec 23, 2024
7361cca
Update en_US.json
impostor4291 Dec 23, 2024
e71f651
Update Narc.cs
impostor4291 Dec 23, 2024
47fdf47
Update PlayerControlPatch.cs
impostor4291 Dec 23, 2024
fe87143
Update ExilePatch.cs
impostor4291 Dec 23, 2024
d69d3c2
Merge pull request #13 from impostor4291/revert-some-changes-and-add-…
impostor4291 Dec 23, 2024
23b0d0c
Update ChatCommandPatch.cs
impostor4291 Dec 23, 2024
64c593e
Merge pull request #14 from impostor4291/main
impostor4291 Dec 23, 2024
8160cc2
Update CustomRolesHelper.cs
impostor4291 Dec 23, 2024
b4c651e
Update en_US.json
impostor4291 Dec 23, 2024
85391d9
Update Narc.cs
impostor4291 Dec 23, 2024
b90c072
move narc to experimental
impostor4291 Dec 23, 2024
a6a688f
Update Narc.cs
impostor4291 Dec 23, 2024
1b82b85
Update CheckGameEndPatch.cs
impostor4291 Dec 23, 2024
047bbd2
logger for the testing feature for narc
impostor4291 Dec 24, 2024
14ab2b2
Update en_US.json
impostor4291 Dec 24, 2024
2dde8ec
Update Narc.cs
impostor4291 Dec 24, 2024
efddb9e
Update Oracle.cs
impostor4291 Dec 24, 2024
4b48ce6
Update DoubleAgent.cs
impostor4291 Dec 24, 2024
dd378a5
Update Visionary.cs
impostor4291 Dec 24, 2024
3c1480c
Update CustomRolesHelper.cs
impostor4291 Dec 24, 2024
a1d1561
Update Traitor.cs
impostor4291 Dec 24, 2024
744f068
Merge pull request #15 from impostor4291/narc-3
impostor4291 Dec 24, 2024
bd09c2b
overseer-narc-trickster pt1
impostor4291 Dec 25, 2024
51d88db
overseer-narc-trickster pt2
impostor4291 Dec 25, 2024
9cb0db8
overseer-narc-trickster pt3
impostor4291 Dec 25, 2024
6b34aaf
overseer-narc-trickster pt4
impostor4291 Dec 25, 2024
8f3c481
added some stuff
impostor4291 Dec 25, 2024
cd4a679
Update DoubleAgent.cs
impostor4291 Dec 25, 2024
447d8e5
Merge pull request #16 from impostor4291/final-changes
impostor4291 Dec 25, 2024
5094854
Update Narc.cs
impostor4291 Dec 26, 2024
9fa7427
Update ExilePatch.cs
impostor4291 Dec 26, 2024
ef31ae5
Update PlayerControlPatch.cs
impostor4291 Dec 26, 2024
977baaf
I promise this is the real final change
impostor4291 Dec 26, 2024
d738593
Update CopyCat.cs
impostor4291 Dec 26, 2024
377862b
Update Godfather.cs
impostor4291 Dec 26, 2024
134a4cc
Update CopyCat.cs
impostor4291 Dec 27, 2024
46ef0e2
Update TimeThief.cs
impostor4291 Dec 27, 2024
9d0f58b
Update MeetingTimeManager.cs
impostor4291 Dec 27, 2024
cd4f74d
Update Admirer.cs
impostor4291 Dec 27, 2024
8576582
Update Gangster.cs
impostor4291 Dec 27, 2024
f6b9e55
Update Godfather.cs
impostor4291 Dec 27, 2024
9faf611
Update en_US.json
impostor4291 Dec 27, 2024
efa9116
Update Oiiai.cs
impostor4291 Dec 27, 2024
e527e14
Update Utils.cs
impostor4291 Dec 27, 2024
c057a33
Merge pull request #19 from impostor4291/narc-compatibilities
impostor4291 Dec 27, 2024
d024d55
Update Visionary.cs
impostor4291 Dec 27, 2024
75ce741
Update Visionary.cs
impostor4291 Dec 27, 2024
e5ead55
Update AddonAssign.cs
impostor4291 Dec 28, 2024
e929f8e
Update CheckGameEndPatch.cs
impostor4291 Dec 28, 2024
785f46f
Merge pull request #20 from impostor4291/main
impostor4291 Dec 28, 2024
e60fc81
Update en_US.json
impostor4291 Dec 28, 2024
9181ed4
Update Bandit.cs
impostor4291 Dec 28, 2024
b190a10
Update MeetingHudPatch.cs
impostor4291 Dec 29, 2024
35ce9e0
Update MeetingHudPatch.cs
impostor4291 Dec 29, 2024
5384eb3
Update MeetingHudPatch.cs
impostor4291 Dec 29, 2024
d317da2
Update MeetingHudPatch.cs
impostor4291 Dec 29, 2024
dacbc71
Update CopyCat.cs
impostor4291 Dec 29, 2024
99d73db
Update TimeThief.cs
impostor4291 Dec 29, 2024
3896c09
Update CopyCat.cs
impostor4291 Dec 29, 2024
a10e202
Update CopyCat.cs
impostor4291 Dec 29, 2024
88bfa62
Update CopyCat.cs
impostor4291 Dec 29, 2024
109df52
Update Gangster.cs
impostor4291 Dec 29, 2024
1fb0df0
Update Gangster.cs
impostor4291 Dec 29, 2024
5db11e2
Update Gangster.cs
impostor4291 Dec 29, 2024
1c45988
Update Gangster.cs
impostor4291 Dec 29, 2024
abee742
Update Gangster.cs
impostor4291 Dec 29, 2024
1d76128
Update Godfather.cs
impostor4291 Dec 29, 2024
13fa83c
Update TimeThief.cs
impostor4291 Dec 29, 2024
669d9ef
Merge pull request #22 from EnhancedNetwork/dev_2.2.0
impostor4291 Dec 29, 2024
6839a35
Update Gangster.cs
impostor4291 Dec 29, 2024
cd996e9
Update Godfather.cs
impostor4291 Dec 29, 2024
37321d6
Update Godfather.cs
impostor4291 Dec 29, 2024
8ab5427
Update TimeThief.cs
impostor4291 Dec 29, 2024
0c5d670
Update CopyCat.cs
impostor4291 Dec 29, 2024
bb96aa5
Merge pull request #24 from impostor4291/main
impostor4291 Dec 29, 2024
deb644a
Merge pull request #26 from impostor4291/main
impostor4291 Dec 30, 2024
ad4e32f
Update Narc.cs
impostor4291 Dec 30, 2024
7b58ce9
Update CustomRoleManager.cs
impostor4291 Dec 30, 2024
2fab824
Update en_US.json
impostor4291 Dec 30, 2024
11039f3
Merge pull request #27 from impostor4291/new-setting
impostor4291 Dec 30, 2024
218e9c0
Merge pull request #28 from impostor4291/fix-stuff
impostor4291 Dec 30, 2024
ca9c5e9
Update CopyCat.cs
impostor4291 Dec 30, 2024
fc24728
Update Narc.cs
impostor4291 Dec 31, 2024
2370035
Update RoleAssign.cs
impostor4291 Dec 31, 2024
2b4ddef
Update en_US.json
impostor4291 Dec 31, 2024
d929711
Merge pull request #29 from impostor4291/new-setting
impostor4291 Dec 31, 2024
75e5a28
Merge pull request #31 from EnhancedNetwork/dev_2.2.0
impostor4291 Dec 31, 2024
5c4aacb
Update en_US.json
impostor4291 Dec 31, 2024
8ce2acd
Update Narc.cs
impostor4291 Dec 31, 2024
9d6866b
Merge pull request #32 from impostor4291/change-role-types
impostor4291 Jan 1, 2025
2a1c714
Merge pull request #33 from impostor4291/this-is-a-patch
impostor4291 Jan 1, 2025
8a16a66
Merge pull request #34 from EnhancedNetwork/dev_2.2.0
impostor4291 Jan 2, 2025
2b00e37
Merge pull request #35 from impostor4291/main
impostor4291 Jan 2, 2025
5d0054e
Merge pull request #36 from EnhancedNetwork/dev_2.2.0
impostor4291 Jan 2, 2025
1783359
Merge pull request #37 from impostor4291/main
impostor4291 Jan 2, 2025
f7b028f
Merge pull request #38 from EnhancedNetwork/dev_2.2.0
impostor4291 Jan 2, 2025
0793e7e
Merge pull request #39 from impostor4291/main
impostor4291 Jan 2, 2025
3175624
Update Crewpostor.cs
impostor4291 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
90 changes: 83 additions & 7 deletions Modules/CustomRolesHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -233,6 +233,9 @@ CustomRoles.Benefactor or
}
public static bool IsCrewKiller(this CustomRoles role)
{
{
if (role is CustomRoles.Narc) return true;
}
return role.GetStaticRoleClass().ThisRoleType is Custom_RoleType.CrewmateKilling;
}
public static bool IsCrewVenter(this PlayerControl target)
Expand Down Expand Up @@ -318,6 +321,18 @@ public static bool IsMadmate(this CustomRoles role)
{
return role.GetStaticRoleClass().ThisRoleType is Custom_RoleType.Madmate;
}
public static bool IsBad(PlayerControl pc) //gets all players that keep the game going
{
var pc_role = pc.GetCustomRole();
return (!pc.Is(CustomRoles.Admired) &&
(IsNarcImpV3(pc) || pc_role.IsNK() || pc_role.IsNA())) ||
pc.Is(CustomRoles.Infected) ||
(pc.Is(CustomRoles.Madmate) && Madmate.MadmateCountMode.GetInt() == 1) ||
(pc.Is(CustomRoles.Charmed) && Cultist.CharmedCountMode.GetInt() == 1) ||
(pc.Is(CustomRoles.Recruit) && Jackal.SidekickCountMode.GetInt() == 1) ||
(pc.Is(CustomRoles.Contagious) && Virus.ContagiousCountMode.GetInt() == 1) ||
(pc.Is(CustomRoles.Egoist) && Egoist.EgoistCountAsConverted.GetBool());
}
/// <summary>
/// Role Changes the Crewmates Team, Including changing to Impostor.
/// </summary>
Expand All @@ -330,7 +345,15 @@ CustomRoles.Infected or
CustomRoles.Contagious or
CustomRoles.Soulless or
CustomRoles.Madmate;

public static bool IsConvertedV2(PlayerControl pc) //add-ons that make players counted as a converted neutral
{
return pc.Is(CustomRoles.Charmed) ||
pc.Is(CustomRoles.Infected) ||
pc.Is(CustomRoles.Contagious) ||
pc.Is(CustomRoles.Recruit) ||
(pc.Is(CustomRoles.Egoist) && Egoist.EgoistCountAsConverted.GetBool());
}

public static bool IsNotKnightable(this CustomRoles role)
{
return role is
Expand Down Expand Up @@ -373,7 +396,13 @@ or CustomRoles.Recruit
or CustomRoles.Infected
or CustomRoles.Contagious
or CustomRoles.Rascal
or CustomRoles.Soulless;
or CustomRoles.Soulless
or CustomRoles.Narc;
}
public static bool IsBetrayalAddonV2(this CustomRoles role)
{
return (role.IsBetrayalAddon() && role is not CustomRoles.Rascal)
|| role is CustomRoles.Admired;
}

public static bool IsImpOnlyAddon(this CustomRoles role)
Expand Down Expand Up @@ -785,7 +814,9 @@ public static bool CheckAddonConfilct(CustomRoles role, PlayerControl pc, bool c
|| pc.Is(CustomRoles.Hurried)
|| pc.Is(CustomRoles.Gangster)
|| pc.Is(CustomRoles.Admirer)
|| pc.Is(CustomRoles.GuardianAngelTOHE))
|| pc.Is(CustomRoles.GuardianAngelTOHE)
|| pc.Is(CustomRoles.Narc)
|| (pc.Is(CustomRoles.Sheriff) && CustomRoles.Narc.RoleExist()))
return false;
if (pc.GetCustomRole().IsNeutral() || pc.GetCustomRole().IsMadmate() || pc.IsAnySubRole(sub => sub.IsConverted()))
return false;
Expand All @@ -794,7 +825,7 @@ public static bool CheckAddonConfilct(CustomRoles role, PlayerControl pc, bool c
break;

case CustomRoles.Mimic:
if (pc.Is(CustomRoles.Nemesis))
if (pc.Is(CustomRoles.Nemesis) || pc.Is(CustomRoles.Narc))
return false;
if (!pc.GetCustomRole().IsImpostor())
return false;
Expand Down Expand Up @@ -827,7 +858,8 @@ public static bool CheckAddonConfilct(CustomRoles role, PlayerControl pc, bool c
|| pc.Is(CustomRoles.Lightning)
|| pc.Is(CustomRoles.Swift)
|| pc.Is(CustomRoles.Swooper)
|| pc.Is(CustomRoles.DoubleAgent))
|| pc.Is(CustomRoles.DoubleAgent)
|| pc.Is(CustomRoles.Narc))
return false;
if (!pc.GetCustomRole().IsImpostor())
return false;
Expand All @@ -850,7 +882,8 @@ public static bool CheckAddonConfilct(CustomRoles role, PlayerControl pc, bool c
|| pc.Is(CustomRoles.Trapster)
|| pc.Is(CustomRoles.Onbound)
|| pc.Is(CustomRoles.Rebound)
|| pc.Is(CustomRoles.Tired))
|| pc.Is(CustomRoles.Tired)
|| pc.Is(CustomRoles.Narc))
return false;
if (!pc.GetCustomRole().IsImpostor())
return false;
Expand Down Expand Up @@ -882,7 +915,8 @@ public static bool CheckAddonConfilct(CustomRoles role, PlayerControl pc, bool c
|| pc.Is(CustomRoles.Stealer)
|| pc.Is(CustomRoles.Tricky)
|| pc.Is(CustomRoles.DoubleAgent)
|| pc.Is(CustomRoles.YinYanger))
|| pc.Is(CustomRoles.YinYanger)
|| pc.Is(CustomRoles.Narc))
return false;
if (!pc.GetCustomRole().IsImpostor())
return false;
Expand Down Expand Up @@ -1103,6 +1137,22 @@ public static bool CheckAddonConfilct(CustomRoles role, PlayerControl pc, bool c
if (pc.IsNeutralApocalypse())
return false;
break;
case CustomRoles.Narc:
if (!pc.GetCustomRole().IsImpostorTeamV3())
return false;
if (pc.Is(CustomRoles.Egoist)
|| pc.Is(CustomRoles.Mare)
|| pc.Is(CustomRoles.Mimic)
|| pc.Is(CustomRoles.Tricky)
|| pc.Is(CustomRoles.Swift))
return false;
if (
(pc.Is(CustomRoles.Visionary) && !Narc.VisionaryCanBeNarc.GetBool())
|| (pc.Is(CustomRoles.DoubleAgent) && !Narc.DoubleAgentCanBeNarc.GetBool())
|| ((pc.Is(CustomRoles.Zombie) || pc.Is(CustomRoles.KillingMachine)) && ! Narc.ZombieAndKMCanBeNarc.GetBool())
)
return false;
break;
}

return true;
Expand Down Expand Up @@ -1146,6 +1196,31 @@ public static RoleTypes GetRoleTypes(this CustomRoles role)
public static bool IsNeutralKillerTeam(this CustomRoles role) => role.IsNK() && !role.IsMadmate();
public static bool IsPassiveNeutralTeam(this CustomRoles role) => role.IsNonNK() && !role.IsMadmate();
public static bool IsNNK(this CustomRoles role) => role.IsNeutral() && !role.IsNK();
/// <summary>
/// A lot of team type features did not function properly when I used "CustomRoles role",
/// so I used "PlayerControl pc" and the features worked again.
/// </summary>
public static bool IsNarcCrew(PlayerControl pc)// gets Crewmate or Narc
{
return pc.GetCustomRole().IsCrewmate() || pc.Is(CustomRoles.Narc);
}
public static bool IsNarcImp(PlayerControl pc)//gets non-Narc Impostors
{
return pc.GetCustomRole().IsImpostor() && !pc.Is(CustomRoles.Narc);
}
public static bool IsNarcMM(PlayerControl pc)//gets non-Narc Madmates
{
return pc.GetCustomRole().IsMadmate() && !pc.Is(CustomRoles.Narc);
}
public static bool IsNarcImpV3(PlayerControl pc)// gets non-Narc Impostors/Madmates
{
return IsNarcImp(pc) || IsNarcMM(pc);
}
public static bool IsNarcNeutral(PlayerControl pc)// gets non-Madmate,non-Narc Neutrals
{
return pc.GetCustomRole().IsNeutral() && !pc.GetCustomRole().IsMadmate() && !pc.Is(CustomRoles.Narc);
}

public static bool IsVanilla(this CustomRoles role)
{
return role is
Expand Down Expand Up @@ -1333,6 +1408,7 @@ var r when r.IsNA() => CountTypes.Apocalypse,
CustomRoles.Mini => CustomWinner.NiceMini,
CustomRoles.Doppelganger => CustomWinner.Doppelganger,
CustomRoles.Shocker => CustomWinner.Shocker,
CustomRoles.Narc => CustomWinner.Narc,
_ => throw new NotImplementedException()

};
Expand Down
7 changes: 5 additions & 2 deletions Modules/CustomWinnerHolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -53,12 +53,15 @@ public static bool CheckForConvertedWinner(byte playerId)
{
foreach (var role in playerId.GetPlayer()?.GetCustomSubRoles().ToArray())
{
if (!(role == CustomRoles.Madmate || role == CustomRoles.Admired || role.IsConverted())) continue;
if (!(role == CustomRoles.Madmate || role == CustomRoles.Admired || role == CustomRoles.Narc || role.IsConverted())) continue;
switch (role)
{
case CustomRoles.Admired:
ResetAndSetWinner(CustomWinner.Crewmate);
return true;
case CustomRoles.Narc:
ResetAndSetWinner(CustomWinner.Crewmate);
return true;
case CustomRoles.Madmate:
ResetAndSetWinner(CustomWinner.Impostor);
return true;
Expand Down Expand Up @@ -116,4 +119,4 @@ public static void ReadFrom(MessageReader reader)
for (int i = 0; i < WinnerIdsCount; i++)
WinnerIds.Add(reader.ReadByte());
}
}
}
21 changes: 13 additions & 8 deletions Modules/ExtendedPlayerControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1109,7 +1109,8 @@ public static bool CanUseImpostorVentButton(this PlayerControl pc)
public static bool CanUseSabotage(this PlayerControl pc)
{
if (pc.Is(Custom_Team.Impostor) && !pc.IsAlive() && Options.DeadImpCantSabotage.GetBool()) return false;

if (Narc.CantUseSabotage(pc)) return false;

var playerRoleClass = pc.GetRoleClass();
if (playerRoleClass != null && playerRoleClass.CanUseSabotage(pc)) return true;

Expand Down Expand Up @@ -1185,7 +1186,8 @@ CustomRoles.Admired and not
CustomRoles.Soulless and not
CustomRoles.Lovers and not
CustomRoles.Infected and not
CustomRoles.Contagious;
CustomRoles.Contagious and not
CustomRoles.Narc;
}

public static void AddInSwitchAddons(this PlayerControl Killed, PlayerControl target, CustomRoles Addon = CustomRoles.NotAssigned, CustomRoles? IsAddon = CustomRoles.NotAssigned)
Expand Down Expand Up @@ -1284,14 +1286,14 @@ public static bool KnowRoleTarget(PlayerControl seer, PlayerControl target)
else if (Altruist.HasEnabled && seer.IsMurderedThisRound()) return false;
else if (seer.GetCustomRole() == target.GetCustomRole() && seer.GetCustomRole().IsNK()) return true;
else if (Options.LoverKnowRoles.GetBool() && seer.Is(CustomRoles.Lovers) && target.Is(CustomRoles.Lovers)) return true;
else if (Options.ImpsCanSeeEachOthersRoles.GetBool() && seer.Is(Custom_Team.Impostor) && target.Is(Custom_Team.Impostor)) return true;
else if (Options.ImpsCanSeeEachOthersRoles.GetBool() && (seer.Is(Custom_Team.Impostor) && !seer.Is(CustomRoles.Narc)) && target.Is(Custom_Team.Impostor)) return true;
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 (Madmate.ImpKnowWhosMadmate.GetBool() && target.Is(CustomRoles.Madmate) && (seer.Is(Custom_Team.Impostor) && !seer.Is(CustomRoles.Narc))) return true;
else if (seer.Is(Custom_Team.Impostor) && target.GetCustomRole().IsGhostRole() && target.GetCustomRole().IsImpostor()) 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;
else if (Overseer.IsRevealedPlayer(seer, target) && !target.Is(CustomRoles.Trickster)) return true;
else if (Overseer.IsRevealedPlayer(seer, target) && !(target.Is(CustomRoles.Trickster) && !target.Is(CustomRoles.Narc))) return true;
else if (Gravestone.EveryoneKnowRole(target)) return true;
else if (Mimic.CanSeeDeadRoles(seer, target)) return true;
else if (Workaholic.OthersKnowWorka(target)) return true;
Expand Down Expand Up @@ -1322,15 +1324,18 @@ 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 (Options.ImpsCanSeeEachOthersAddOns.GetBool() && seer.Is(Custom_Team.Impostor) && target.Is(Custom_Team.Impostor) && !subRole.IsBetrayalAddon()) return true;
else if (Options.ApocCanSeeEachOthersAddOns.GetBool() && seer.IsNeutralApocalypse() && target.IsNeutralApocalypse() && !subRole.IsBetrayalAddon()) return true;

else if (Options.SeeEjectedRolesInMeeting.GetBool() && Main.PlayerStates[target.PlayerId].deathReason == PlayerState.DeathReason.Vote && subRole.IsBetrayalAddonV2()) return true;
else if (Overseer.IsRevealedPlayer(seer, target) && subRole == CustomRoles.Narc) return true;

else if ((subRole is CustomRoles.Madmate
or CustomRoles.Sidekick
or CustomRoles.Recruit
or CustomRoles.Admired
or CustomRoles.Charmed
or CustomRoles.Infected
or CustomRoles.Contagious
or CustomRoles.Egoist)
or CustomRoles.Egoist
or CustomRoles.Narc)
&& KnowSubRoleTarget(seer, target))
return true;
else if (Main.VisibleTasksCount && !seer.IsAlive())
Expand All @@ -1351,7 +1356,7 @@ public static bool KnowSubRoleTarget(PlayerControl seer, PlayerControl target)
{
//if (seer.GetRoleClass().KnowRoleTarget(seer, target)) return true;

if (seer.Is(Custom_Team.Impostor))
if (seer.Is(Custom_Team.Impostor) && !seer.Is(CustomRoles.Narc))
{
// Imp know Madmate
if (target.Is(CustomRoles.Madmate) && Madmate.ImpKnowWhosMadmate.GetBool())
Expand Down
9 changes: 9 additions & 0 deletions Modules/GameState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,10 @@ public void SetMainRole(CustomRoles role)
{
countTypes = CountTypes.Crew;
}
if (pc.Is(CustomRoles.Narc))
{
countTypes = CountTypes.Crew;
}
if (pc.Is(CustomRoles.Soulless))
{
countTypes = CountTypes.OutOfGame;
Expand Down Expand Up @@ -132,6 +136,7 @@ public void SetSubRole(CustomRoles role, PlayerControl pc = null)

foreach (var subRole in SubRoles.ToArray())
{
if (subRole != CustomRoles.Narc)//Narc cannot be cleansed
RemoveSubRole(subRole);
}
}
Expand Down Expand Up @@ -219,6 +224,10 @@ public void SetSubRole(CustomRoles role, PlayerControl pc = null)
SubRoles.Remove(CustomRoles.Loyal);
break;

case CustomRoles.Narc:
countTypes = CountTypes.Crew;
break;

case CustomRoles.Soulless:
countTypes = CountTypes.OutOfGame;
break;
Expand Down
14 changes: 13 additions & 1 deletion Modules/GuessManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,18 @@ public static bool GuesserMsg(PlayerControl pc, string msg, bool isUI = false)
return true;
}

if (pc.Is(CustomRoles.Narc) && target.Is(CustomRoles.Sheriff))
{
pc.ShowInfoMessage(isUI,GetString("GuessSheriffOrNarc"));
return true;
}

if (pc.Is(CustomRoles.Sheriff) && target.Is(CustomRoles.Narc))
{
pc.ShowInfoMessage(isUI,GetString("GuessSheriffOrNarc"));
return true;
}

if (role == CustomRoles.Bait && target.Is(CustomRoles.Bait) && Bait.BaitNotification.GetBool())
{
pc.ShowInfoMessage(isUI, GetString("GuessNotifiedBait"));
Expand Down Expand Up @@ -1098,4 +1110,4 @@ public static void ReceiveRPC(MessageReader reader, PlayerControl pc)

GuesserMsg(pc, $"/bt {PlayerId} {GetString(role.ToString())}", true);
}
}
}
11 changes: 10 additions & 1 deletion Modules/NameColorManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,19 @@ private static bool KnowTargetRoleColor(PlayerControl seer, PlayerControl target
// Impostor & Madmate
if (seer.Is(Custom_Team.Impostor) && target.Is(Custom_Team.Impostor)) color = (seer.Is(CustomRoles.Egoist) && target.Is(CustomRoles.Egoist) && Egoist.ImpEgoistVisibalToAllies.GetBool() && seer != target) ? Main.roleColors[CustomRoles.Egoist] : Main.roleColors[CustomRoles.Impostor];
if (seer.Is(CustomRoles.Madmate) && target.Is(Custom_Team.Impostor) && Madmate.MadmateKnowWhosImp.GetBool()) color = Main.roleColors[CustomRoles.Impostor];
if (seer.Is(Custom_Team.Impostor) && target.Is(CustomRoles.Madmate) && Madmate.ImpKnowWhosMadmate.GetBool()) color = Main.roleColors[CustomRoles.Madmate];
if (seer.Is(Custom_Team.Impostor) && !seer.Is(CustomRoles.Narc) && target.Is(CustomRoles.Madmate) && Madmate.ImpKnowWhosMadmate.GetBool()) color = Main.roleColors[CustomRoles.Madmate];
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];

// Narc,Impostors and Madmates
if (seer.Is(CustomRoles.Narc) && seer.Is(Custom_Team.Impostor) && target.Is(CustomRoles.Crewpostor) && Crewpostor.AlliesKnowCrewpostor.GetBool() && Narc.NarcCanSeeTeammates.GetBool()) color = Main.roleColors[CustomRoles.Traitor];
if (seer.Is(CustomRoles.Narc) && seer.Is(Custom_Team.Impostor) && target.Is(CustomRoles.Madmate) && Madmate.ImpKnowWhosMadmate.GetBool() && Narc.NarcCanSeeTeammates.GetBool()) color = Main.roleColors[CustomRoles.Traitor];
if (seer.Is(CustomRoles.Narc) && seer.Is(Custom_Team.Impostor) && target.Is(CustomRoles.Refugee) && Narc.NarcCanSeeTeammates.GetBool()) color = Main.roleColors[CustomRoles.Traitor];
if (seer.Is(CustomRoles.Narc) && seer.Is(CustomRoles.Crewpostor) && target.Is(Custom_Team.Impostor) && Crewpostor.KnowsAllies.GetBool() && Narc.NarcCanSeeTeammates.GetBool()) color = Main.roleColors[CustomRoles.Impostor];
// to prevent Narc Impostor from seeing Madmates when ImpKnowWhosMadmate is on while NarcCanSeeMadmates is off
if (seer.Is(CustomRoles.Narc) && seer.Is(Custom_Team.Impostor) && target.Is(CustomRoles.Madmate) && Madmate.ImpKnowWhosMadmate.GetBool() && !Narc.NarcCanSeeTeammates.GetBool()) color = "ffffff";
if (seer.Is(CustomRoles.Narc) && seer.Is(Custom_Team.Impostor) && target.Is(CustomRoles.Refugee) && !Narc.NarcCanSeeTeammates.GetBool()) color = "ffffff";

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

Expand Down
Loading