Ghost Roles

This commit is contained in:
Gurge44 committed 2024-03-18 19:57:21 +01:00
1 parent 9e8048972a
commit 18fcb9e17a
29 files changed
+486 -246

No files matched your search

+1 -1
View File
@@ -649,7 +649,7 @@ internal static class CustomRoleSelector
AddonRolesList = [];
foreach (var role in EnumHelper.GetAllValues<CustomRoles>())
{
if (!role.IsAdditionRole()) continue;
if (!role.IsAdditionRole() || role.IsGhostRole()) continue;
switch (role)
{
case CustomRoles.Mare when Main.CurrentMap == MapNames.Fungle:
+196 -192
View File
@@ -35,200 +35,199 @@ internal static class CustomRolesHelper
public static CustomRoles GetVNRole(this CustomRoles role)
{
if (role.IsGhostRole()) return CustomRoles.GuardianAngel;
if (role.IsVanilla()) return role;
bool UsePets = Options.UsePets.GetBool();
return role.IsVanilla()
? role
: role switch
{
CustomRoles.Sniper => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.Jester => Options.JesterCanVent.GetBool() ? CustomRoles.Engineer : CustomRoles.Crewmate,
CustomRoles.Mayor => Options.MayorHasPortableButton.GetBool() ? CustomRoles.Engineer : CustomRoles.Crewmate,
CustomRoles.Monitor => Monitor.CanVent.GetBool() ? CustomRoles.Engineer : CustomRoles.Crewmate,
CustomRoles.Vulture => Vulture.CanVent.GetBool() ? CustomRoles.Engineer : CustomRoles.Crewmate,
CustomRoles.Opportunist => CustomRoles.Engineer,
CustomRoles.Vindicator => CustomRoles.Impostor,
CustomRoles.Snitch => CustomRoles.Crewmate,
CustomRoles.ParityCop => CustomRoles.Crewmate,
CustomRoles.Marshall => CustomRoles.Crewmate,
CustomRoles.SabotageMaster => CustomRoles.Engineer,
CustomRoles.Mafia => Options.LegacyMafia.GetBool() ? CustomRoles.Shapeshifter : CustomRoles.Impostor,
CustomRoles.Terrorist => CustomRoles.Engineer,
CustomRoles.Executioner => CustomRoles.Crewmate,
CustomRoles.Lawyer => CustomRoles.Crewmate,
CustomRoles.NiceSwapper => CustomRoles.Crewmate,
CustomRoles.Ignitor => CustomRoles.Crewmate,
CustomRoles.Jailor => CustomRoles.Impostor,
CustomRoles.Vampire => CustomRoles.Impostor,
CustomRoles.BountyHunter => CustomRoles.Impostor,
CustomRoles.Trickster => CustomRoles.Impostor,
CustomRoles.Witch => CustomRoles.Impostor,
CustomRoles.ShapeshifterTOHE => CustomRoles.Shapeshifter,
CustomRoles.Agitater => CustomRoles.Impostor,
CustomRoles.ImpostorTOHE => CustomRoles.Impostor,
CustomRoles.EvilDiviner => CustomRoles.Impostor,
CustomRoles.Wildling => Wildling.CanShapeshiftOpt.GetBool() ? CustomRoles.Shapeshifter : CustomRoles.Impostor,
CustomRoles.Morphling => CustomRoles.Shapeshifter,
CustomRoles.Warlock => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.SerialKiller => CustomRoles.Impostor,
CustomRoles.FireWorks => CustomRoles.Shapeshifter,
CustomRoles.SpeedBooster => CustomRoles.Crewmate,
CustomRoles.Dictator => CustomRoles.Crewmate,
CustomRoles.Inhibitor => CustomRoles.Impostor,
CustomRoles.Kidnapper => CustomRoles.Shapeshifter,
CustomRoles.Commander => CustomRoles.Shapeshifter,
CustomRoles.Freezer => CustomRoles.Shapeshifter,
CustomRoles.Changeling => CustomRoles.Shapeshifter,
CustomRoles.Swapster => CustomRoles.Shapeshifter,
CustomRoles.Kamikaze => CustomRoles.Impostor,
CustomRoles.Librarian => CustomRoles.Shapeshifter,
CustomRoles.Cantankerous => CustomRoles.Impostor,
CustomRoles.Swiftclaw => CustomRoles.Impostor,
CustomRoles.YinYanger => CustomRoles.Impostor,
CustomRoles.Duellist => CustomRoles.Shapeshifter,
CustomRoles.Consort => CustomRoles.Impostor,
CustomRoles.Mafioso => CustomRoles.Impostor,
CustomRoles.Chronomancer => CustomRoles.Impostor,
CustomRoles.Nullifier => CustomRoles.Impostor,
CustomRoles.Stealth => CustomRoles.Impostor,
CustomRoles.Penguin => CustomRoles.Impostor,
CustomRoles.Sapper => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.Mastermind => CustomRoles.Impostor,
CustomRoles.RiftMaker => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.Gambler => CustomRoles.Impostor,
CustomRoles.Hitman => CustomRoles.Shapeshifter,
CustomRoles.Saboteur => CustomRoles.Impostor,
CustomRoles.Doctor => CustomRoles.Scientist,
CustomRoles.ScientistTOHE => CustomRoles.Scientist,
CustomRoles.Tracefinder => CustomRoles.Scientist,
CustomRoles.Puppeteer => CustomRoles.Impostor,
CustomRoles.TimeThief => CustomRoles.Impostor,
CustomRoles.EvilTracker => CustomRoles.Shapeshifter,
CustomRoles.Paranoia => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.EngineerTOHE => CustomRoles.Engineer,
CustomRoles.TimeMaster => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.CrewmateTOHE => CustomRoles.Crewmate,
CustomRoles.Cleanser => CustomRoles.Crewmate,
CustomRoles.Miner => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.Psychic => CustomRoles.Crewmate,
CustomRoles.Needy => CustomRoles.Crewmate,
CustomRoles.Twister => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.SuperStar => CustomRoles.Crewmate,
CustomRoles.Hacker => CustomRoles.Shapeshifter,
CustomRoles.Visionary => CustomRoles.Shapeshifter,
CustomRoles.Assassin => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.Undertaker => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.Luckey => CustomRoles.Crewmate,
CustomRoles.CyberStar => CustomRoles.Crewmate,
CustomRoles.Demolitionist => CustomRoles.Crewmate,
CustomRoles.Ventguard => CustomRoles.Engineer,
CustomRoles.Express => CustomRoles.Crewmate,
CustomRoles.NiceEraser => CustomRoles.Crewmate,
CustomRoles.TaskManager => CustomRoles.Crewmate,
CustomRoles.Randomizer => CustomRoles.Crewmate,
CustomRoles.Beacon => CustomRoles.Crewmate,
CustomRoles.Rabbit => CustomRoles.Crewmate,
CustomRoles.Shiftguard => CustomRoles.Crewmate,
CustomRoles.Mole => CustomRoles.Engineer,
CustomRoles.Markseeker => CustomRoles.Crewmate,
CustomRoles.Sentinel => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Electric => CustomRoles.Crewmate,
CustomRoles.Philantropist => CustomRoles.Crewmate,
CustomRoles.Tornado => CustomRoles.Crewmate,
CustomRoles.Druid => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Insight => CustomRoles.Crewmate,
CustomRoles.Tunneler => CustomRoles.Crewmate,
CustomRoles.Detour => CustomRoles.Crewmate,
CustomRoles.Drainer => CustomRoles.Engineer,
CustomRoles.Benefactor => CustomRoles.Crewmate,
CustomRoles.GuessManagerRole => CustomRoles.Crewmate,
CustomRoles.Altruist => CustomRoles.Crewmate,
CustomRoles.Transmitter => CustomRoles.Crewmate,
CustomRoles.Autocrat => CustomRoles.Crewmate,
CustomRoles.Perceiver => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Convener => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Mathematician => CustomRoles.Crewmate,
CustomRoles.Nightmare => CustomRoles.Crewmate,
CustomRoles.CameraMan => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Spy => CustomRoles.Crewmate,
CustomRoles.Ricochet => CustomRoles.Crewmate,
CustomRoles.Tether => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Doormaster => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Aid => UsePets && Aid.UsePet.GetBool() ? CustomRoles.Crewmate : CustomRoles.Impostor,
CustomRoles.Escort => UsePets && Escort.UsePet.GetBool() ? CustomRoles.Crewmate : CustomRoles.Impostor,
CustomRoles.DonutDelivery => UsePets && DonutDelivery.UsePet.GetBool() ? CustomRoles.Crewmate : CustomRoles.Impostor,
CustomRoles.Gaulois => UsePets && Gaulois.UsePet.GetBool() ? CustomRoles.Crewmate : CustomRoles.Impostor,
CustomRoles.Analyzer => UsePets && Analyzer.UsePet.GetBool() ? CustomRoles.Crewmate : CustomRoles.Impostor,
CustomRoles.Escapee => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.NiceGuesser => CustomRoles.Crewmate,
CustomRoles.EvilGuesser => CustomRoles.Impostor,
CustomRoles.Detective => CustomRoles.Crewmate,
CustomRoles.God => CustomRoles.Crewmate,
CustomRoles.GuardianAngelTOHE => CustomRoles.GuardianAngel,
CustomRoles.Zombie => CustomRoles.Impostor,
CustomRoles.Mario => CustomRoles.Engineer,
CustomRoles.AntiAdminer => AntiAdminer.EnableExtraAbility.GetBool() ? CustomRoles.Shapeshifter : CustomRoles.Impostor,
CustomRoles.Sans => CustomRoles.Impostor,
CustomRoles.Bomber => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.Nuker => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.BoobyTrap => CustomRoles.Impostor,
CustomRoles.Scavenger => CustomRoles.Impostor,
CustomRoles.Transporter => CustomRoles.Crewmate,
CustomRoles.Veteran => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Capitalism => CustomRoles.Impostor,
CustomRoles.Bodyguard => CustomRoles.Crewmate,
CustomRoles.Grenadier => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Lighter => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.SecurityGuard => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Gangster => CustomRoles.Impostor,
CustomRoles.Cleaner => CustomRoles.Impostor,
CustomRoles.Konan => CustomRoles.Crewmate,
CustomRoles.Divinator => CustomRoles.Crewmate,
CustomRoles.Oracle => CustomRoles.Crewmate,
CustomRoles.BallLightning => CustomRoles.Impostor,
CustomRoles.Greedier => CustomRoles.Impostor,
CustomRoles.Workaholic => CustomRoles.Engineer,
CustomRoles.Speedrunner => CustomRoles.Crewmate,
CustomRoles.CursedWolf => CustomRoles.Impostor,
CustomRoles.Collector => CustomRoles.Crewmate,
CustomRoles.ImperiusCurse => CustomRoles.Shapeshifter,
CustomRoles.QuickShooter => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.Eraser => CustomRoles.Impostor,
CustomRoles.OverKiller => CustomRoles.Impostor,
CustomRoles.Hangman => CustomRoles.Shapeshifter,
CustomRoles.Sunnyboy => CustomRoles.Scientist,
CustomRoles.Phantom => Options.PhantomCanVent.GetBool() ? CustomRoles.Engineer : CustomRoles.Crewmate,
CustomRoles.Judge => CustomRoles.Crewmate,
CustomRoles.Councillor => CustomRoles.Impostor,
CustomRoles.Mortician => CustomRoles.Crewmate,
CustomRoles.Mediumshiper => CustomRoles.Crewmate,
CustomRoles.Bard => CustomRoles.Impostor,
CustomRoles.Swooper => CustomRoles.Impostor,
CustomRoles.Crewpostor => CustomRoles.Engineer,
CustomRoles.Observer => CustomRoles.Crewmate,
CustomRoles.DovesOfNeace => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Disperser => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.Camouflager => CustomRoles.Shapeshifter,
CustomRoles.Dazzler => CustomRoles.Shapeshifter,
CustomRoles.Devourer => CustomRoles.Shapeshifter,
CustomRoles.Deathpact => CustomRoles.Shapeshifter,
CustomRoles.Bloodhound => CustomRoles.Crewmate,
CustomRoles.Tracker => CustomRoles.Crewmate,
CustomRoles.Deathknight => CustomRoles.Crewmate,
CustomRoles.Merchant => CustomRoles.Crewmate,
CustomRoles.Lookout => CustomRoles.Crewmate,
CustomRoles.Guardian => CustomRoles.Crewmate,
CustomRoles.Enigma => CustomRoles.Crewmate,
CustomRoles.Addict => CustomRoles.Engineer,
CustomRoles.Alchemist => CustomRoles.Engineer, // Needs to vent to use invisibility potion
CustomRoles.Chameleon => CustomRoles.Engineer,
CustomRoles.EvilSpirit => CustomRoles.GuardianAngel,
CustomRoles.Lurker => CustomRoles.Impostor,
CustomRoles.Doomsayer => CustomRoles.Crewmate,
CustomRoles.Godfather => CustomRoles.Impostor,
CustomRoles.Blackmailer => CustomRoles.Shapeshifter,
return role switch
{
CustomRoles.Sniper => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.Jester => Options.JesterCanVent.GetBool() ? CustomRoles.Engineer : CustomRoles.Crewmate,
CustomRoles.Mayor => Options.MayorHasPortableButton.GetBool() ? CustomRoles.Engineer : CustomRoles.Crewmate,
CustomRoles.Monitor => Monitor.CanVent.GetBool() ? CustomRoles.Engineer : CustomRoles.Crewmate,
CustomRoles.Vulture => Vulture.CanVent.GetBool() ? CustomRoles.Engineer : CustomRoles.Crewmate,
CustomRoles.Opportunist => CustomRoles.Engineer,
CustomRoles.Vindicator => CustomRoles.Impostor,
CustomRoles.Snitch => CustomRoles.Crewmate,
CustomRoles.ParityCop => CustomRoles.Crewmate,
CustomRoles.Marshall => CustomRoles.Crewmate,
CustomRoles.SabotageMaster => CustomRoles.Engineer,
CustomRoles.Mafia => Options.LegacyMafia.GetBool() ? CustomRoles.Shapeshifter : CustomRoles.Impostor,
CustomRoles.Terrorist => CustomRoles.Engineer,
CustomRoles.Executioner => CustomRoles.Crewmate,
CustomRoles.Lawyer => CustomRoles.Crewmate,
CustomRoles.NiceSwapper => CustomRoles.Crewmate,
CustomRoles.Ignitor => CustomRoles.Crewmate,
CustomRoles.Jailor => CustomRoles.Impostor,
CustomRoles.Vampire => CustomRoles.Impostor,
CustomRoles.BountyHunter => CustomRoles.Impostor,
CustomRoles.Trickster => CustomRoles.Impostor,
CustomRoles.Witch => CustomRoles.Impostor,
CustomRoles.ShapeshifterTOHE => CustomRoles.Shapeshifter,
CustomRoles.Agitater => CustomRoles.Impostor,
CustomRoles.ImpostorTOHE => CustomRoles.Impostor,
CustomRoles.EvilDiviner => CustomRoles.Impostor,
CustomRoles.Wildling => Wildling.CanShapeshiftOpt.GetBool() ? CustomRoles.Shapeshifter : CustomRoles.Impostor,
CustomRoles.Morphling => CustomRoles.Shapeshifter,
CustomRoles.Warlock => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.SerialKiller => CustomRoles.Impostor,
CustomRoles.FireWorks => CustomRoles.Shapeshifter,
CustomRoles.SpeedBooster => CustomRoles.Crewmate,
CustomRoles.Dictator => CustomRoles.Crewmate,
CustomRoles.Inhibitor => CustomRoles.Impostor,
CustomRoles.Kidnapper => CustomRoles.Shapeshifter,
CustomRoles.Commander => CustomRoles.Shapeshifter,
CustomRoles.Freezer => CustomRoles.Shapeshifter,
CustomRoles.Changeling => CustomRoles.Shapeshifter,
CustomRoles.Swapster => CustomRoles.Shapeshifter,
CustomRoles.Kamikaze => CustomRoles.Impostor,
CustomRoles.Librarian => CustomRoles.Shapeshifter,
CustomRoles.Cantankerous => CustomRoles.Impostor,
CustomRoles.Swiftclaw => CustomRoles.Impostor,
CustomRoles.YinYanger => CustomRoles.Impostor,
CustomRoles.Duellist => CustomRoles.Shapeshifter,
CustomRoles.Consort => CustomRoles.Impostor,
CustomRoles.Mafioso => CustomRoles.Impostor,
CustomRoles.Chronomancer => CustomRoles.Impostor,
CustomRoles.Nullifier => CustomRoles.Impostor,
CustomRoles.Stealth => CustomRoles.Impostor,
CustomRoles.Penguin => CustomRoles.Impostor,
CustomRoles.Sapper => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.Mastermind => CustomRoles.Impostor,
CustomRoles.RiftMaker => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.Gambler => CustomRoles.Impostor,
CustomRoles.Hitman => CustomRoles.Shapeshifter,
CustomRoles.Saboteur => CustomRoles.Impostor,
CustomRoles.Doctor => CustomRoles.Scientist,
CustomRoles.ScientistTOHE => CustomRoles.Scientist,
CustomRoles.Tracefinder => CustomRoles.Scientist,
CustomRoles.Puppeteer => CustomRoles.Impostor,
CustomRoles.TimeThief => CustomRoles.Impostor,
CustomRoles.EvilTracker => CustomRoles.Shapeshifter,
CustomRoles.Paranoia => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.EngineerTOHE => CustomRoles.Engineer,
CustomRoles.TimeMaster => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.CrewmateTOHE => CustomRoles.Crewmate,
CustomRoles.Cleanser => CustomRoles.Crewmate,
CustomRoles.Miner => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.Psychic => CustomRoles.Crewmate,
CustomRoles.Needy => CustomRoles.Crewmate,
CustomRoles.Twister => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.SuperStar => CustomRoles.Crewmate,
CustomRoles.Hacker => CustomRoles.Shapeshifter,
CustomRoles.Visionary => CustomRoles.Shapeshifter,
CustomRoles.Assassin => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.Undertaker => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.Luckey => CustomRoles.Crewmate,
CustomRoles.CyberStar => CustomRoles.Crewmate,
CustomRoles.Demolitionist => CustomRoles.Crewmate,
CustomRoles.Ventguard => CustomRoles.Engineer,
CustomRoles.Express => CustomRoles.Crewmate,
CustomRoles.NiceEraser => CustomRoles.Crewmate,
CustomRoles.TaskManager => CustomRoles.Crewmate,
CustomRoles.Randomizer => CustomRoles.Crewmate,
CustomRoles.Beacon => CustomRoles.Crewmate,
CustomRoles.Rabbit => CustomRoles.Crewmate,
CustomRoles.Shiftguard => CustomRoles.Crewmate,
CustomRoles.Mole => CustomRoles.Engineer,
CustomRoles.Markseeker => CustomRoles.Crewmate,
CustomRoles.Sentinel => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Electric => CustomRoles.Crewmate,
CustomRoles.Philantropist => CustomRoles.Crewmate,
CustomRoles.Tornado => CustomRoles.Crewmate,
CustomRoles.Druid => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Insight => CustomRoles.Crewmate,
CustomRoles.Tunneler => CustomRoles.Crewmate,
CustomRoles.Detour => CustomRoles.Crewmate,
CustomRoles.Drainer => CustomRoles.Engineer,
CustomRoles.Benefactor => CustomRoles.Crewmate,
CustomRoles.GuessManagerRole => CustomRoles.Crewmate,
CustomRoles.Altruist => CustomRoles.Crewmate,
CustomRoles.Transmitter => CustomRoles.Crewmate,
CustomRoles.Autocrat => CustomRoles.Crewmate,
CustomRoles.Perceiver => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Convener => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Mathematician => CustomRoles.Crewmate,
CustomRoles.Nightmare => CustomRoles.Crewmate,
CustomRoles.CameraMan => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Spy => CustomRoles.Crewmate,
CustomRoles.Ricochet => CustomRoles.Crewmate,
CustomRoles.Tether => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Doormaster => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Aid => UsePets && Aid.UsePet.GetBool() ? CustomRoles.Crewmate : CustomRoles.Impostor,
CustomRoles.Escort => UsePets && Escort.UsePet.GetBool() ? CustomRoles.Crewmate : CustomRoles.Impostor,
CustomRoles.DonutDelivery => UsePets && DonutDelivery.UsePet.GetBool() ? CustomRoles.Crewmate : CustomRoles.Impostor,
CustomRoles.Gaulois => UsePets && Gaulois.UsePet.GetBool() ? CustomRoles.Crewmate : CustomRoles.Impostor,
CustomRoles.Analyzer => UsePets && Analyzer.UsePet.GetBool() ? CustomRoles.Crewmate : CustomRoles.Impostor,
CustomRoles.Escapee => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.NiceGuesser => CustomRoles.Crewmate,
CustomRoles.EvilGuesser => CustomRoles.Impostor,
CustomRoles.Detective => CustomRoles.Crewmate,
CustomRoles.God => CustomRoles.Crewmate,
CustomRoles.GuardianAngelTOHE => CustomRoles.GuardianAngel,
CustomRoles.Zombie => CustomRoles.Impostor,
CustomRoles.Mario => CustomRoles.Engineer,
CustomRoles.AntiAdminer => AntiAdminer.EnableExtraAbility.GetBool() ? CustomRoles.Shapeshifter : CustomRoles.Impostor,
CustomRoles.Sans => CustomRoles.Impostor,
CustomRoles.Bomber => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.Nuker => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.BoobyTrap => CustomRoles.Impostor,
CustomRoles.Scavenger => CustomRoles.Impostor,
CustomRoles.Transporter => CustomRoles.Crewmate,
CustomRoles.Veteran => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Capitalism => CustomRoles.Impostor,
CustomRoles.Bodyguard => CustomRoles.Crewmate,
CustomRoles.Grenadier => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Lighter => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.SecurityGuard => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Gangster => CustomRoles.Impostor,
CustomRoles.Cleaner => CustomRoles.Impostor,
CustomRoles.Konan => CustomRoles.Crewmate,
CustomRoles.Divinator => CustomRoles.Crewmate,
CustomRoles.Oracle => CustomRoles.Crewmate,
CustomRoles.BallLightning => CustomRoles.Impostor,
CustomRoles.Greedier => CustomRoles.Impostor,
CustomRoles.Workaholic => CustomRoles.Engineer,
CustomRoles.Speedrunner => CustomRoles.Crewmate,
CustomRoles.CursedWolf => CustomRoles.Impostor,
CustomRoles.Collector => CustomRoles.Crewmate,
CustomRoles.ImperiusCurse => CustomRoles.Shapeshifter,
CustomRoles.QuickShooter => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.Eraser => CustomRoles.Impostor,
CustomRoles.OverKiller => CustomRoles.Impostor,
CustomRoles.Hangman => CustomRoles.Shapeshifter,
CustomRoles.Sunnyboy => CustomRoles.Scientist,
CustomRoles.Phantom => Options.PhantomCanVent.GetBool() ? CustomRoles.Engineer : CustomRoles.Crewmate,
CustomRoles.Judge => CustomRoles.Crewmate,
CustomRoles.Councillor => CustomRoles.Impostor,
CustomRoles.Mortician => CustomRoles.Crewmate,
CustomRoles.Mediumshiper => CustomRoles.Crewmate,
CustomRoles.Bard => CustomRoles.Impostor,
CustomRoles.Swooper => CustomRoles.Impostor,
CustomRoles.Crewpostor => CustomRoles.Engineer,
CustomRoles.Observer => CustomRoles.Crewmate,
CustomRoles.DovesOfNeace => UsePets ? CustomRoles.Crewmate : CustomRoles.Engineer,
CustomRoles.Disperser => UsePets ? CustomRoles.Impostor : CustomRoles.Shapeshifter,
CustomRoles.Camouflager => CustomRoles.Shapeshifter,
CustomRoles.Dazzler => CustomRoles.Shapeshifter,
CustomRoles.Devourer => CustomRoles.Shapeshifter,
CustomRoles.Deathpact => CustomRoles.Shapeshifter,
CustomRoles.Bloodhound => CustomRoles.Crewmate,
CustomRoles.Tracker => CustomRoles.Crewmate,
CustomRoles.Deathknight => CustomRoles.Crewmate,
CustomRoles.Merchant => CustomRoles.Crewmate,
CustomRoles.Lookout => CustomRoles.Crewmate,
CustomRoles.Guardian => CustomRoles.Crewmate,
CustomRoles.Enigma => CustomRoles.Crewmate,
CustomRoles.Addict => CustomRoles.Engineer,
CustomRoles.Alchemist => CustomRoles.Engineer, // Needs to vent to use invisibility potion
CustomRoles.Chameleon => CustomRoles.Engineer,
CustomRoles.Lurker => CustomRoles.Impostor,
CustomRoles.Doomsayer => CustomRoles.Crewmate,
CustomRoles.Godfather => CustomRoles.Impostor,
CustomRoles.Blackmailer => CustomRoles.Shapeshifter,
_ => role.IsImpostor() ? CustomRoles.Impostor : CustomRoles.Crewmate,
};
_ => role.IsImpostor() ? CustomRoles.Impostor : CustomRoles.Crewmate,
};
}
public static CustomRoles GetErasedRole(this CustomRoles role)
@@ -425,6 +424,11 @@ internal static class CustomRolesHelper
public static bool IsSnitchTarget(this CustomRoles role) => role.IsNK() || role.Is(Team.Impostor);
public static bool IsGhostRole(this CustomRoles role) => role is
CustomRoles.Warden or
CustomRoles.Minion or
CustomRoles.EvilSpirit;
public static bool IsNE(this CustomRoles role) => role is
CustomRoles.Jester or
CustomRoles.Gamer or
+2
View File
@@ -835,6 +835,8 @@ static class ExtendedPlayerControl
public static bool IsNeutralChaos(this PlayerControl player) => player.GetCustomRole().IsNC();
public static bool IsSnitchTarget(this PlayerControl player) => player.Is(CustomRoles.Bloodlust) || player.GetCustomRole().IsSnitchTarget();
public static bool HasGhostRole(this PlayerControl player) => Main.PlayerStates.TryGetValue(player.PlayerId, out var state) && state.SubRoles.Any(x => x.IsGhostRole());
public static bool KnowDeathReason(this PlayerControl seer, PlayerControl target)
=> ((seer.Is(CustomRoles.Doctor) || seer.Is(CustomRoles.Autopsy)
|| (seer.Data.IsDead && Options.GhostCanSeeDeathReason.GetBool()))
@@ -4,6 +4,7 @@ using Il2CppInterop.Runtime.InteropTypes.Arrays;
using InnerNet;
using System;
using System.Linq;
using TOHE.Roles.AddOns.GhostRoles;
using TOHE.Roles.Crewmate;
using TOHE.Roles.Impostor;
using TOHE.Roles.Neutral;
@@ -215,6 +216,13 @@ public class PlayerGameOptionsSender(PlayerControl player) : GameOptionsSender
opt.SetFloat(FloatOptionNames.ImpostorLightMod, Sprayer.LoweredVision.GetFloat());
}
if (Minion.BlindPlayers.Contains(player.PlayerId))
{
opt.SetVision(false);
opt.SetFloat(FloatOptionNames.CrewLightMod, 0.01f);
opt.SetFloat(FloatOptionNames.ImpostorLightMod, 0.01f);
}
if (Sentinel.IsPatrolling(player.PlayerId))
{
opt.SetVision(false);
+51
View File
@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TOHE.Modules
{
internal static class GhostRolesManager
{
public static Dictionary<CustomRoles, byte> AssignedGhostRoles = [];
public static List<CustomRoles> GhostRoles = [];
public static void Initialize()
{
AssignedGhostRoles = [];
GhostRoles = EnumHelper.GetAllValues<CustomRoles>().Where(x => x.IsGhostRole() && x.IsEnable()).ToList();
}
public static void AssignGhostRole(PlayerControl pc)
{
GhostRoles.RemoveAll(AssignedGhostRoles.ContainsKey);
if (GhostRoles.Count == 0) return;
var suitableRole = GetSuitableGhostRole(pc);
pc.RpcSetCustomRole(suitableRole);
AssignedGhostRoles[suitableRole] = pc.PlayerId;
}
public static void SpecificAssignGhostRole(byte id, CustomRoles role, bool set)
{
if (AssignedGhostRoles.ContainsKey(role) || AssignedGhostRoles.ContainsValue(id)) return;
if (set) Utils.GetPlayerById(id).RpcSetCustomRole(role);
AssignedGhostRoles[role] = id;
}
public static bool ShouldHaveGhostRole(PlayerControl pc)
{
if (pc.IsAlive() || pc.GetCountTypes() is CountTypes.Crew or CountTypes.OutOfGame) return false;
if (AssignedGhostRoles.ContainsValue(pc.PlayerId)) return false;
return !AssignedGhostRoles.ContainsKey(GetSuitableGhostRole(pc));
}
public static CustomRoles GetSuitableGhostRole(PlayerControl pc)
{
return GhostRoles.FirstOrDefault(x => Utils.CreateGhostRoleInstance(x).Team == pc.GetTeam());
}
}
}
+2 -1
View File
@@ -1046,7 +1046,8 @@ public static class GuessManager
CreatePage(true, __instance, container);
}
foreach (var role in EnumHelper.GetAllValues<CustomRoles>())
var sortedRoles = EnumHelper.GetAllValues<CustomRoles>().OrderBy(x => GetString($"{x}")).ToArray();
foreach (var role in sortedRoles)
{
if (role is CustomRoles.GM
or CustomRoles.SpeedBooster
+24
View File
@@ -1,7 +1,10 @@
using System;
using Hazel;
using System.Linq;
using System.Reflection;
using TOHE.Modules;
using TOHE.Roles.AddOns.Common;
using TOHE.Roles.AddOns.GhostRoles;
using TOHE.Roles.Crewmate;
using TOHE.Roles.Impostor;
using TOHE.Roles.Neutral;
@@ -69,6 +72,27 @@ public static class NameColorManager
if (seer.Is(CustomRoles.Contagious) && target.Is(CustomRoles.Contagious) && Virus.TargetKnowOtherTarget.GetBool()) color = Main.roleColors[CustomRoles.Virus];
if (seer.Is(CustomRoles.Charmed) && target.Is(CustomRoles.Charmed) && Succubus.TargetKnowOtherTarget.GetBool()) color = Main.roleColors[CustomRoles.Charmed];
if (seer.Is(CustomRoles.Undead) && target.Is(CustomRoles.Undead)) color = Main.roleColors[CustomRoles.Undead];
if (target.HasGhostRole())
{
try
{
IGhostRole ghostRoleInstance = Utils.CreateGhostRoleInstance(target);
if (seer.GetTeam() == ghostRoleInstance.Team)
{
color = ghostRoleInstance.Team switch
{
Team.Impostor => Main.ImpostorColor,
Team.Crewmate => Main.CrewmateColor,
Team.Neutral => Main.NeutralColor,
_ => color
};
}
}
catch (Exception e)
{
Utils.ThrowException(e);
}
}
var seerRole = seer.GetCustomRole();
var targetRole = target.GetCustomRole();
+24 -1
View File
@@ -24,6 +24,7 @@ using TOHE.Roles.Neutral;
using UnityEngine;
using static TOHE.Translator;
using Object = UnityEngine.Object;
using TOHE.Roles.AddOns.GhostRoles;
namespace TOHE;
@@ -669,13 +670,18 @@ public static class Utils
foreach (CustomRoles subRole in States.SubRoles)
{
if (subRole.IsGhostRole())
{
hasTasks &= !ForRecompute;
continue;
}
switch (subRole)
{
case CustomRoles.Madmate:
case CustomRoles.Charmed:
case CustomRoles.Recruit:
case CustomRoles.Egoist:
case CustomRoles.EvilSpirit:
case CustomRoles.Contagious:
case CustomRoles.Rascal:
hasTasks &= !ForRecompute;
@@ -693,6 +699,23 @@ public static class Utils
return hasTasks;
}
public static IGhostRole CreateGhostRoleInstance(PlayerControl target)
{
if (!target.HasGhostRole()) return null;
var ghostRole = target.GetCustomSubRoles().First(x => x.IsGhostRole());
var ghostRoleClass = Assembly.GetExecutingAssembly().GetTypes().First(x => x.IsAssignableFrom(typeof(IGhostRole)) && !x.IsInterface && x.Name.Equals($"{ghostRole}", StringComparison.OrdinalIgnoreCase));
var ghostRoleInstance = (IGhostRole)Activator.CreateInstance(ghostRoleClass);
return ghostRoleInstance;
}
// Create an overload for the above method that takes the ghost role as a parameter
public static IGhostRole CreateGhostRoleInstance(CustomRoles ghostRole)
{
var ghostRoleClass = Assembly.GetExecutingAssembly().GetTypes().First(x => x.IsAssignableFrom(typeof(IGhostRole)) && !x.IsInterface && x.Name.Equals($"{ghostRole}", StringComparison.OrdinalIgnoreCase));
var ghostRoleInstance = (IGhostRole)Activator.CreateInstance(ghostRoleClass);
return ghostRoleInstance;
}
public static bool CanBeMadmate(this PlayerControl pc)
{
return pc != null && pc.IsCrewmate() && !pc.Is(CustomRoles.Madmate)
+2 -2
View File
@@ -62,12 +62,12 @@ class GameEndChecker
{
case CustomWinner.Crewmate:
Main.AllPlayerControls
.Where(pc => pc.Is(CustomRoleTypes.Crewmate) && !pc.Is(CustomRoles.Lovers) && !pc.Is(CustomRoles.Madmate) && !pc.Is(CustomRoles.Rogue) && !pc.Is(CustomRoles.Charmed) && !pc.Is(CustomRoles.Recruit) && !pc.Is(CustomRoles.Contagious) && !pc.Is(CustomRoles.EvilSpirit) && !pc.Is(CustomRoles.Recruit))
.Where(pc => pc.Is(CustomRoleTypes.Crewmate) && !pc.Is(CustomRoles.Lovers) && !pc.Is(CustomRoles.Madmate) && !pc.Is(CustomRoles.Rogue) && !pc.Is(CustomRoles.Charmed) && !pc.Is(CustomRoles.Recruit) && !pc.Is(CustomRoles.Contagious) && !pc.HasGhostRole())
.Do(pc => WinnerIds.Add(pc.PlayerId));
break;
case CustomWinner.Impostor:
Main.AllPlayerControls
.Where(pc => ((pc.Is(CustomRoleTypes.Impostor) && (!pc.Is(CustomRoles.DeadlyQuota) || Main.PlayerStates.Count(x => x.Value.GetRealKiller() == pc.PlayerId) >= Options.DQNumOfKillsNeeded.GetInt())) || pc.Is(CustomRoles.Madmate) || pc.Is(CustomRoles.Crewpostor) || pc.Is(CustomRoles.Refugee)) && !pc.Is(CustomRoles.Lovers) && !pc.Is(CustomRoles.Rogue) && !pc.Is(CustomRoles.Charmed) && !pc.Is(CustomRoles.Recruit) && !pc.Is(CustomRoles.Contagious) && !pc.Is(CustomRoles.EvilSpirit) && !pc.Is(CustomRoles.Recruit))
.Where(pc => ((pc.Is(CustomRoleTypes.Impostor) && (!pc.Is(CustomRoles.DeadlyQuota) || Main.PlayerStates.Count(x => x.Value.GetRealKiller() == pc.PlayerId) >= Options.DQNumOfKillsNeeded.GetInt())) || pc.Is(CustomRoles.Madmate) || pc.Is(CustomRoles.Crewpostor) || pc.Is(CustomRoles.Refugee)) && !pc.Is(CustomRoles.Lovers) && !pc.Is(CustomRoles.Rogue) && !pc.Is(CustomRoles.Charmed) && !pc.Is(CustomRoles.Recruit) && !pc.Is(CustomRoles.Contagious) && !pc.HasGhostRole())
.Do(pc => WinnerIds.Add(pc.PlayerId));
break;
case CustomWinner.Succubus:
+18 -2
View File
@@ -46,6 +46,13 @@ class CheckProtectPatch
return true;
}
if (__instance.HasGhostRole())
{
CreateGhostRoleInstance(__instance).OnProtect(__instance, target);
__instance.RpcResetAbilityCooldown();
return true;
}
if (__instance.Is(CustomRoles.Sheriff))
{
if (__instance.Data.IsDead)
@@ -1171,6 +1178,15 @@ class FixedUpdatePatch
ApplySuffix(__instance);
}
// Assign ghost roles to first dead players
if (!lowLoad)
{
if (GhostRolesManager.ShouldHaveGhostRole(player))
{
GhostRolesManager.AssignGhostRole(player);
}
}
if (__instance.AmOwner)
{
if ((Main.ChangedRole && __instance == PlayerControl.LocalPlayer && AmongUsClient.Instance.AmHost) || (GameStates.IsInTask && !__instance.Is(CustomRoleTypes.Impostor) && __instance.CanUseKillButton() && !__instance.Data.IsDead))
@@ -2010,7 +2026,7 @@ class PlayerControlSetRolePatch
{
var self = seer.PlayerId == target.PlayerId;
var seerIsKiller = seer.Is(CustomRoleTypes.Impostor) || Main.ResetCamPlayerList.Contains(seer.PlayerId);
if (target.Is(CustomRoles.EvilSpirit))
if (target.HasGhostRole())
{
ghostRoles[seer] = RoleTypes.GuardianAngel;
}
@@ -2024,7 +2040,7 @@ class PlayerControlSetRolePatch
}
}
if (target.Is(CustomRoles.EvilSpirit))
if (target.HasGhostRole())
{
roleType = RoleTypes.GuardianAngel;
}
+6
View File
@@ -3,6 +3,7 @@ using AmongUs.GameOptions;
using HarmonyLib;
using InnerNet;
using System;
using System.Linq;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using TOHE.Modules;
@@ -167,6 +168,11 @@ class OnPlayerLeftPatch
Spiritualist.RemoveTarget();
Postman.CheckAndResetTargets(data.Character);
if (GhostRolesManager.AssignedGhostRoles.ContainsValue(data.Character.PlayerId))
{
GhostRolesManager.AssignedGhostRoles.Remove(GhostRolesManager.AssignedGhostRoles.FirstOrDefault(x => x.Value == data.Character.PlayerId).Key);
}
Utils.AfterPlayerDeathTasks(data.Character, GameStates.IsMeeting);
PlayerState state = Main.PlayerStates[data.Character.PlayerId];
+2 -1
View File
@@ -210,6 +210,7 @@ internal class ChangeRoleSettings
NameNotifyManager.Reset();
SabotageSystemTypeRepairDamagePatch.Initialize();
DoorsReset.Initialize();
GhostRolesManager.Initialize();
IRandom.SetInstanceById(Options.RoleAssigningAlgorithm.GetValue());
@@ -476,6 +477,7 @@ internal class SelectRolesPatch
{
if (role is CustomRoles.Nimble or CustomRoles.Physicist or CustomRoles.Bloodlust) continue;
state.SetSubRole(role);
if (role.IsGhostRole()) GhostRolesManager.SpecificAssignGhostRole(item.Key, role, false);
}
}
}
@@ -502,7 +504,6 @@ internal class SelectRolesPatch
}
}
//RPCによる同期
foreach (var pair in Main.PlayerStates)
{
ExtendedPlayerControl.RpcSetCustomRole(pair.Key, pair.Value.MainRole);
+2 -1
View File
@@ -2088,7 +2088,7 @@
"TabGroup.NeutralRoles": "Neutral Roles",
"TabGroup.ImpostorRoles": "Impostor Roles",
"TabGroup.Addons": "Add-Ons",
"TabGroup.OtherRoles": "Experimental Roles (Not recommended)",
"TabGroup.OtherRoles": "Ghost Roles",
"TabGroup.TaskSettings": "Game Modifiers",
"TabGroup.CovenRoles": "Coven Roles",
"OtherRoles.CrewmateRoles": "★ Crewmate Roles",
@@ -3086,6 +3086,7 @@
"ExpressInfoLong": "(Crewmates):\\nAs the Express, you gain a small temporary speed boost after each task you complete.",
"ExpressSpeed": "Increased Speed",
"ExpressSpeedDur": "Increased Speed Duration",
"MinionBlindDuration": "Blind Duration",
"NiceSwapper": "Swapper",
"NiceSwapperInfo": "Swap players' votes",
"NiceSwapperInfoLong": "(Crewmates):\\nAs the Swapper, you can use the command <b>/sw <color=#0000ff>[ID]</color></b> twice to choose 2 players. Those votes received by those 2 players will be swapped.\\nYou can see everyone's <color=#0000ff>ID</color>s next to their name.\\n\\nFor example, if 3 players voted red, and 5 players voted yellow, and you swap red and yellows' IDs, then red will receive 5 votes, and yellow will receive 3 votes.\\n\\nDue to technical difficulties, the Host's original vote will seem unchanged, but it's only visual, their vote will still get swapped.",
+4 -4
View File
@@ -8,12 +8,12 @@ namespace TOHE.Roles.AddOns.Common
public void SetupCustomOption()
{
SetupAdtRoleOptions(19200, CustomRoles.Fool, canSetNum: true, tab: TabGroup.OtherRoles);
ImpCanBeFool = BooleanOptionItem.Create(19210, "ImpCanBeFool", true, TabGroup.OtherRoles, false)
SetupAdtRoleOptions(19200, CustomRoles.Fool, canSetNum: true, tab: TabGroup.Addons);
ImpCanBeFool = BooleanOptionItem.Create(19210, "ImpCanBeFool", true, TabGroup.Addons, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Fool]);
CrewCanBeFool = BooleanOptionItem.Create(19211, "CrewCanBeFool", true, TabGroup.OtherRoles, false)
CrewCanBeFool = BooleanOptionItem.Create(19211, "CrewCanBeFool", true, TabGroup.Addons, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Fool]);
NeutralCanBeFool = BooleanOptionItem.Create(19212, "NeutralCanBeFool", true, TabGroup.OtherRoles, false)
NeutralCanBeFool = BooleanOptionItem.Create(19212, "NeutralCanBeFool", true, TabGroup.Addons, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Fool]);
}
}
+3 -3
View File
@@ -16,11 +16,11 @@ namespace TOHE.Roles.AddOns.Common
.SetParent(CustomRoleSpawnChances[CustomRoles.Guesser]);
NeutralCanBeGuesser = BooleanOptionItem.Create(19112, "NeutralCanBeGuesser", true, TabGroup.Addons, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Guesser]);
GCanGuessAdt = BooleanOptionItem.Create(19115, "GCanGuessAdt", false, TabGroup.OtherRoles, false)
GCanGuessAdt = BooleanOptionItem.Create(19115, "GCanGuessAdt", false, TabGroup.Addons, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Guesser]);
GCanGuessTaskDoneSnitch = BooleanOptionItem.Create(19116, "GCanGuessTaskDoneSnitch", true, TabGroup.OtherRoles, false)
GCanGuessTaskDoneSnitch = BooleanOptionItem.Create(19116, "GCanGuessTaskDoneSnitch", true, TabGroup.Addons, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Guesser]);
GTryHideMsg = BooleanOptionItem.Create(19117, "GuesserTryHideMsg", true, TabGroup.OtherRoles, false)
GTryHideMsg = BooleanOptionItem.Create(19117, "GuesserTryHideMsg", true, TabGroup.Addons, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Guesser])
.SetColor(Color.green);
}
+14
View File
@@ -0,0 +1,14 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TOHE.Roles.AddOns.GhostRoles
{
public interface IGhostRole
{
public Team Team { get; }
public void OnProtect(PlayerControl pc, PlayerControl target);
}
}
+39
View File
@@ -0,0 +1,39 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TOHE.Roles.AddOns.GhostRoles
{
internal class Minion : IGhostRole, ISettingHolder
{
public Team Team => Team.Impostor;
public static HashSet<byte> BlindPlayers = [];
private static OptionItem BlindDuration;
public void OnProtect(PlayerControl pc, PlayerControl target)
{
if (!BlindPlayers.Add(target.PlayerId)) return;
target.MarkDirtySettings();
_ = new LateTask(() =>
{
if (BlindPlayers.Remove(target.PlayerId))
{
target.MarkDirtySettings();
}
}, BlindDuration.GetFloat(), "Remove Minion Blindness");
}
public void SetupCustomOption()
{
Options.SetupRoleOptions(649000, TabGroup.OtherRoles, CustomRoles.Minion);
BlindDuration = IntegerOptionItem.Create(649002, "MinionBlindDuration", new(1, 90, 1), 5, TabGroup.OtherRoles, false)
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.Minion])
.SetValueFormat(OptionFormat.Seconds);
}
}
}
+40
View File
@@ -0,0 +1,40 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace TOHE.Roles.AddOns.GhostRoles
{
internal class Warden : IGhostRole, ISettingHolder
{
public Team Team => Team.Crewmate;
private static OptionItem ExtraSpeed;
private static OptionItem ExtraSpeedDuration;
public void OnProtect(PlayerControl pc, PlayerControl target)
{
float speed = Main.AllPlayerSpeed[target.PlayerId];
Main.AllPlayerSpeed[target.PlayerId] += ExtraSpeed.GetFloat();
target.MarkDirtySettings();
_ = new LateTask(() =>
{
Main.AllPlayerSpeed[target.PlayerId] = speed;
target.MarkDirtySettings();
}, ExtraSpeedDuration.GetFloat(), "Remove Warden Speed Boost");
}
public void SetupCustomOption()
{
Options.SetupRoleOptions(649000, TabGroup.OtherRoles, CustomRoles.Warden);
ExtraSpeedDuration = IntegerOptionItem.Create(649002, "ExpressSpeedDur", new(1, 90, 1), 5, TabGroup.OtherRoles, false)
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.Warden])
.SetValueFormat(OptionFormat.Seconds);
ExtraSpeed = FloatOptionItem.Create(649001, "ExpressSpeed", new(0.5f, 3f, 0.1f), 1.5f, TabGroup.OtherRoles, false)
.SetParent(Options.CustomRoleSpawnChances[CustomRoles.Warden])
.SetValueFormat(OptionFormat.Multiplier);
}
}
}
+5 -5
View File
@@ -21,12 +21,12 @@ public class CopyCat : RoleBase
public static void SetupCustomOption()
{
SetupRoleOptions(Id, TabGroup.OtherRoles, CustomRoles.CopyCat);
KillCooldown = FloatOptionItem.Create(Id + 10, "CopyCatCopyCooldown", new(0f, 60f, 1f), 15f, TabGroup.OtherRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.CopyCat])
SetupRoleOptions(Id, TabGroup.CrewmateRoles, CustomRoles.CopyCat);
KillCooldown = FloatOptionItem.Create(Id + 10, "CopyCatCopyCooldown", new(0f, 60f, 1f), 15f, TabGroup.CrewmateRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.CopyCat])
.SetValueFormat(OptionFormat.Seconds);
CanKill = BooleanOptionItem.Create(Id + 11, "CopyCatCanKill", false, TabGroup.OtherRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.CopyCat]);
CopyCrewVar = BooleanOptionItem.Create(Id + 13, "CopyCrewVar", true, TabGroup.OtherRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.CopyCat]);
MiscopyLimitOpt = IntegerOptionItem.Create(Id + 12, "CopyCatMiscopyLimit", new(0, 14, 1), 2, TabGroup.OtherRoles, false).SetParent(CanKill)
CanKill = BooleanOptionItem.Create(Id + 11, "CopyCatCanKill", false, TabGroup.CrewmateRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.CopyCat]);
CopyCrewVar = BooleanOptionItem.Create(Id + 13, "CopyCrewVar", true, TabGroup.CrewmateRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.CopyCat]);
MiscopyLimitOpt = IntegerOptionItem.Create(Id + 12, "CopyCatMiscopyLimit", new(0, 14, 1), 2, TabGroup.CrewmateRoles, false).SetParent(CanKill)
.SetValueFormat(OptionFormat.Times);
UsePet = CreatePetUseSetting(Id + 14, CustomRoles.CopyCat);
}
+2 -2
View File
@@ -14,8 +14,8 @@ public class Blackmailer : RoleBase
public static void SetupCustomOption()
{
SetupRoleOptions(Id, TabGroup.OtherRoles, CustomRoles.Blackmailer);
SkillCooldown = FloatOptionItem.Create(Id + 5, "BlackmailerSkillCooldown", new(2.5f, 60f, 2.5f), 30f, TabGroup.OtherRoles, false)
SetupRoleOptions(Id, TabGroup.ImpostorRoles, CustomRoles.Blackmailer);
SkillCooldown = FloatOptionItem.Create(Id + 5, "BlackmailerSkillCooldown", new(2.5f, 60f, 2.5f), 30f, TabGroup.ImpostorRoles, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Blackmailer])
.SetValueFormat(OptionFormat.Seconds);
}
+3 -3
View File
@@ -14,11 +14,11 @@ namespace TOHE.Roles.Impostor
public static void SetupCustomOption()
{
SetupRoleOptions(16500, TabGroup.OtherRoles, CustomRoles.BoobyTrap);
BTKillCooldown = FloatOptionItem.Create(16510, "KillCooldown", new(2.5f, 180f, 2.5f), 20f, TabGroup.OtherRoles, false)
SetupRoleOptions(16500, TabGroup.ImpostorRoles, CustomRoles.BoobyTrap);
BTKillCooldown = FloatOptionItem.Create(16510, "KillCooldown", new(2.5f, 180f, 2.5f), 20f, TabGroup.ImpostorRoles, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.BoobyTrap])
.SetValueFormat(OptionFormat.Seconds);
TrapOnlyWorksOnTheBodyBoobyTrap = BooleanOptionItem.Create(16511, "TrapOnlyWorksOnTheBodyBoobyTrap", true, TabGroup.OtherRoles, false)
TrapOnlyWorksOnTheBodyBoobyTrap = BooleanOptionItem.Create(16511, "TrapOnlyWorksOnTheBodyBoobyTrap", true, TabGroup.ImpostorRoles, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.BoobyTrap]);
}
+3 -3
View File
@@ -13,11 +13,11 @@ namespace TOHE.Roles.Impostor
public static void SetupCustomOption()
{
SetupRoleOptions(16600, TabGroup.OtherRoles, CustomRoles.Capitalism);
CapitalismSkillCooldown = FloatOptionItem.Create(16610, "CapitalismSkillCooldown", new(0f, 60f, 1f), 10f, TabGroup.OtherRoles, false)
SetupRoleOptions(16600, TabGroup.ImpostorRoles, CustomRoles.Capitalism);
CapitalismSkillCooldown = FloatOptionItem.Create(16610, "CapitalismSkillCooldown", new(0f, 60f, 1f), 10f, TabGroup.ImpostorRoles, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Capitalism])
.SetValueFormat(OptionFormat.Seconds);
CapitalismKillCooldown = FloatOptionItem.Create(16611, "KillCooldown", new(2.5f, 60f, 2.5f), 25f, TabGroup.OtherRoles, false)
CapitalismKillCooldown = FloatOptionItem.Create(16611, "KillCooldown", new(2.5f, 60f, 2.5f), 25f, TabGroup.ImpostorRoles, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Capitalism])
.SetValueFormat(OptionFormat.Seconds);
}
+1 -1
View File
@@ -15,7 +15,7 @@ namespace TOHE.Roles.Impostor
public static void SetupCustomOption()
{
Options.SetupRoleOptions(16900, TabGroup.OtherRoles, CustomRoles.OverKiller);
Options.SetupRoleOptions(16900, TabGroup.ImpostorRoles, CustomRoles.OverKiller);
}
public static List<byte> OverDeadPlayerList = [];
+3 -3
View File
@@ -11,11 +11,11 @@ namespace TOHE.Roles.Impostor
public static void SetupCustomOption()
{
SetupRoleOptions(16400, TabGroup.OtherRoles, CustomRoles.Zombie);
ZombieKillCooldown = FloatOptionItem.Create(16410, "KillCooldown", new(0f, 180f, 2.5f), 5f, TabGroup.OtherRoles, false)
SetupRoleOptions(16400, TabGroup.ImpostorRoles, CustomRoles.Zombie);
ZombieKillCooldown = FloatOptionItem.Create(16410, "KillCooldown", new(0f, 180f, 2.5f), 5f, TabGroup.ImpostorRoles, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Zombie])
.SetValueFormat(OptionFormat.Seconds);
ZombieSpeedReduce = FloatOptionItem.Create(16411, "ZombieSpeedReduce", new(0.0f, 1.0f, 0.1f), 0.1f, TabGroup.OtherRoles, false)
ZombieSpeedReduce = FloatOptionItem.Create(16411, "ZombieSpeedReduce", new(0.0f, 1.0f, 0.1f), 0.1f, TabGroup.ImpostorRoles, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Zombie])
.SetValueFormat(OptionFormat.Multiplier);
}
+3 -3
View File
@@ -6,10 +6,10 @@ namespace TOHE.Roles.Neutral
{
public void SetupCustomOption()
{
SetupRoleOptions(18200, TabGroup.OtherRoles, CustomRoles.God);
NotifyGodAlive = BooleanOptionItem.Create(18210, "NotifyGodAlive", true, TabGroup.OtherRoles, false)
SetupRoleOptions(18200, TabGroup.NeutralRoles, CustomRoles.God);
NotifyGodAlive = BooleanOptionItem.Create(18210, "NotifyGodAlive", true, TabGroup.NeutralRoles, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.God]);
GodCanGuess = BooleanOptionItem.Create(18211, "CanGuess", false, TabGroup.OtherRoles, false)
GodCanGuess = BooleanOptionItem.Create(18211, "CanGuess", false, TabGroup.NeutralRoles, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.God]);
}
}
+3 -3
View File
@@ -14,11 +14,11 @@ namespace TOHE.Roles.Neutral
public static void SetupCustomOption()
{
SetupRoleOptions(18300, TabGroup.OtherRoles, CustomRoles.Mario);
MarioVentNumWin = IntegerOptionItem.Create(18310, "MarioVentNumWin", new(0, 900, 5), 40, TabGroup.OtherRoles, false)
SetupRoleOptions(18300, TabGroup.NeutralRoles, CustomRoles.Mario);
MarioVentNumWin = IntegerOptionItem.Create(18310, "MarioVentNumWin", new(0, 900, 5), 40, TabGroup.NeutralRoles, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Mario])
.SetValueFormat(OptionFormat.Times);
MarioVentCD = FloatOptionItem.Create(18311, "VentCooldown", new(0f, 180f, 1f), 15f, TabGroup.OtherRoles, false)
MarioVentCD = FloatOptionItem.Create(18311, "VentCooldown", new(0f, 180f, 1f), 15f, TabGroup.NeutralRoles, false)
.SetParent(CustomRoleSpawnChances[CustomRoles.Mario])
.SetValueFormat(OptionFormat.Seconds);
}
+10 -10
View File
@@ -27,22 +27,22 @@ namespace TOHE.Roles.Neutral
public static void SetupCustomOption()
{
SetupSingleRoleOptions(Id, TabGroup.OtherRoles, CustomRoles.Spiritcaller);
KillCooldown = FloatOptionItem.Create(Id + 10, "KillCooldown", new(0f, 60f, 2.5f), 22.5f, TabGroup.OtherRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Spiritcaller])
SetupSingleRoleOptions(Id, TabGroup.NeutralRoles, CustomRoles.Spiritcaller);
KillCooldown = FloatOptionItem.Create(Id + 10, "KillCooldown", new(0f, 60f, 2.5f), 22.5f, TabGroup.NeutralRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Spiritcaller])
.SetValueFormat(OptionFormat.Seconds);
CanVent = BooleanOptionItem.Create(Id + 11, "CanVent", true, TabGroup.OtherRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Spiritcaller]);
ImpostorVision = BooleanOptionItem.Create(Id + 12, "ImpostorVision", true, TabGroup.OtherRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Spiritcaller]);
SpiritMax = IntegerOptionItem.Create(Id + 13, "SpiritcallerSpiritMax", new(1, 15, 1), 2, TabGroup.OtherRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Spiritcaller])
CanVent = BooleanOptionItem.Create(Id + 11, "CanVent", true, TabGroup.NeutralRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Spiritcaller]);
ImpostorVision = BooleanOptionItem.Create(Id + 12, "ImpostorVision", true, TabGroup.NeutralRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Spiritcaller]);
SpiritMax = IntegerOptionItem.Create(Id + 13, "SpiritcallerSpiritMax", new(1, 15, 1), 2, TabGroup.NeutralRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Spiritcaller])
.SetValueFormat(OptionFormat.Times);
SpiritAbilityCooldown = FloatOptionItem.Create(Id + 14, "SpiritcallerSpiritAbilityCooldown", new(5f, 90f, 1f), 30f, TabGroup.OtherRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Spiritcaller])
SpiritAbilityCooldown = FloatOptionItem.Create(Id + 14, "SpiritcallerSpiritAbilityCooldown", new(5f, 90f, 1f), 30f, TabGroup.NeutralRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Spiritcaller])
.SetValueFormat(OptionFormat.Seconds);
SpiritFreezeTime = FloatOptionItem.Create(Id + 15, "SpiritcallerFreezeTime", new(0f, 30f, 1f), 3f, TabGroup.OtherRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Spiritcaller])
SpiritFreezeTime = FloatOptionItem.Create(Id + 15, "SpiritcallerFreezeTime", new(0f, 30f, 1f), 3f, TabGroup.NeutralRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Spiritcaller])
.SetValueFormat(OptionFormat.Seconds);
SpiritProtectTime = FloatOptionItem.Create(Id + 16, "SpiritcallerProtectTime", new(0f, 30f, 1f), 5f, TabGroup.OtherRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Spiritcaller])
SpiritProtectTime = FloatOptionItem.Create(Id + 16, "SpiritcallerProtectTime", new(0f, 30f, 1f), 5f, TabGroup.NeutralRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Spiritcaller])
.SetValueFormat(OptionFormat.Seconds);
SpiritCauseVision = FloatOptionItem.Create(Id + 17, "SpiritcallerCauseVision", new(0f, 5f, 0.05f), 0.4f, TabGroup.OtherRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Spiritcaller])
SpiritCauseVision = FloatOptionItem.Create(Id + 17, "SpiritcallerCauseVision", new(0f, 5f, 0.05f), 0.4f, TabGroup.NeutralRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Spiritcaller])
.SetValueFormat(OptionFormat.Multiplier);
SpiritCauseVisionTime = FloatOptionItem.Create(Id + 18, "SpiritcallerCauseVisionTime", new(0f, 45f, 1f), 10f, TabGroup.OtherRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Spiritcaller])
SpiritCauseVisionTime = FloatOptionItem.Create(Id + 18, "SpiritcallerCauseVisionTime", new(0f, 45f, 1f), 10f, TabGroup.NeutralRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Spiritcaller])
.SetValueFormat(OptionFormat.Seconds);
}
+2 -1
View File
@@ -1,2 +1,3 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TMP/@EntryIndexedValue">TMP</s:String></wpf:ResourceDictionary>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=TMP/@EntryIndexedValue">TMP</s:String>
<s:String x:Key="/Default/CodeStyle/Naming/CSharpNaming/Abbreviations/=VN/@EntryIndexedValue">VN</s:String></wpf:ResourceDictionary>
+13 -4
View File
@@ -272,7 +272,7 @@ public class Main : BasePlugin
{
roleColors = new()
{
//Vanilla
// Vanilla
{ CustomRoles.Crewmate, "#8cffff" },
{ CustomRoles.Engineer, "#8cffff" },
{ CustomRoles.Scientist, "#8cffff" },
@@ -282,7 +282,7 @@ public class Main : BasePlugin
{ CustomRoles.EngineerTOHE, "#FF6A00" },
{ CustomRoles.ScientistTOHE, "#8ee98e" },
{ CustomRoles.GuardianAngelTOHE, "#77e6d1" },
//Crewmates
// Crewmates
{ CustomRoles.Luckey, "#b8d7a3" },
{ CustomRoles.Needy, "#a4dffe" },
{ CustomRoles.SabotageMaster, "#3333ff" },
@@ -380,7 +380,7 @@ public class Main : BasePlugin
{ CustomRoles.ParityCop, "#0D57AF" },
{ CustomRoles.TimeMaster, "#44baff" },
{ CustomRoles.Crusader, "#C65C39" },
//Neutrals
// Neutrals
{ CustomRoles.Arsonist, "#ff6633" },
{ CustomRoles.Pyromaniac, "#ff6633" },
{ CustomRoles.PlagueBearer, "#e5f6b4" },
@@ -459,9 +459,14 @@ public class Main : BasePlugin
{ CustomRoles.Convict, "#ff1919" },
{ CustomRoles.Amnesiac, "#7FBFFF" },
{ CustomRoles.Doomsayer, "#14f786" },
// Ghost roles
{ CustomRoles.Warden, "#32a852" },
{ CustomRoles.Minion, "#ff1919" },
{ CustomRoles.Specter, "#b446e3" },
{ CustomRoles.Haunter, "#d1b1de" },
// GM
{ CustomRoles.GM, "#ff5b70" },
//Add-ons
// Add-ons
{ CustomRoles.NotAssigned, "#ffffff" },
{ CustomRoles.LastImpostor, "#ff1919" },
{ CustomRoles.Lovers, "#ff9ace" },
@@ -958,6 +963,7 @@ public enum CustomRoles
Gravestone,
Guesser,
Haste,
Haunter, // Ghost role
Knighted,
LastImpostor,
Lazy,
@@ -968,12 +974,14 @@ public enum CustomRoles
Magnet,
Mare,
Mimic,
Minion, // Ghost role
Mischievous,
Necroview,
Ntr, // Neptune
Nimble,
Oblivious,
Onbound,
Specter, // Ghost role
Physicist,
Rascal,
Reach,
@@ -993,6 +1001,7 @@ public enum CustomRoles
Truant,
Undead,
Unlucky,
Warden, // Ghost role
Watcher,
Workhorse,
Youtuber