diff --git a/CustomRoles.cs b/CustomRoles.cs index 020959411..36741de9d 100644 --- a/CustomRoles.cs +++ b/CustomRoles.cs @@ -97,7 +97,7 @@ public enum CustomRoles Psychopath, Puppeteer, QuickShooter, - Refugee, + Renegade, RiftMaker, Saboteur, Sapper, @@ -226,7 +226,7 @@ public enum CustomRoles Mayor, Mechanic, Medic, - Mediumshiper, + Medium, Merchant, Telecommunication, Mole, @@ -288,7 +288,7 @@ public enum CustomRoles // Neutrals - Agitater, + Agitator, Amnesiac, Amogus, Arsonist, @@ -498,7 +498,7 @@ public enum CustomRoles Avanger, Bait, BananaMan, - Trapper, // Beartrap + Beartrap, Bewilder, Blind, Blocked, diff --git a/Main.cs b/Main.cs index 78d72d947..e0b4fd8fc 100644 --- a/Main.cs +++ b/Main.cs @@ -489,7 +489,7 @@ public class Main : BasePlugin { CustomRoles.Glitch, "#39FF14" }, { CustomRoles.Judge, "#f8d85a" }, { CustomRoles.Mortician, "#333c49" }, - { CustomRoles.Mediumshiper, "#a200ff" }, + { CustomRoles.Medium, "#a200ff" }, { CustomRoles.Observer, "#a8e0fa" }, { CustomRoles.DovesOfNeace, "#ffffff" }, { CustomRoles.Jailor, "#aa900d" }, @@ -610,7 +610,7 @@ public class Main : BasePlugin { CustomRoles.Pulse, "#ff00a5" }, { CustomRoles.Werewolf, "#964B00" }, { CustomRoles.Bandit, "#8B008B" }, - { CustomRoles.Agitater, "#F4A460" }, + { CustomRoles.Agitator, "#F4A460" }, { CustomRoles.BloodKnight, "#630000" }, { CustomRoles.Juggernaut, "#A41342" }, { CustomRoles.Cherokious, "#de4b9e" }, @@ -618,7 +618,7 @@ public class Main : BasePlugin { CustomRoles.Parasite, "#ff1919" }, { CustomRoles.Crewpostor, "#ff1919" }, { CustomRoles.Hypocrite, "#ff1919" }, - { CustomRoles.Refugee, "#ff1919" }, + { CustomRoles.Renegade, "#ff1919" }, { CustomRoles.Virus, "#2E8B57" }, { CustomRoles.Investigator, "#BA55D3" }, { CustomRoles.Pursuer, "#617218" }, @@ -726,7 +726,7 @@ public class Main : BasePlugin { CustomRoles.Stressed, "#9403fc" }, { CustomRoles.Charmed, "#cf6acd" }, { CustomRoles.Bait, "#00f7ff" }, - { CustomRoles.Trapper, "#5a8fd0" }, + { CustomRoles.Beartrap, "#5a8fd0" }, { CustomRoles.Onbound, "#BAAAE9" }, { CustomRoles.Knighted, "#FFA500" }, { CustomRoles.Contagious, "#2E8B57" }, @@ -1091,7 +1091,7 @@ public enum CustomWinner Pyromaniac = CustomRoles.Pyromaniac, Eclipse = CustomRoles.Eclipse, HeadHunter = CustomRoles.HeadHunter, - Agitater = CustomRoles.Agitater, + Agitator = CustomRoles.Agitator, Vengeance = CustomRoles.Vengeance, Werewolf = CustomRoles.Werewolf, Juggernaut = CustomRoles.Juggernaut, diff --git a/Modules/CustomRoleSelector.cs b/Modules/CustomRoleSelector.cs index 560066fba..012d35a72 100644 --- a/Modules/CustomRoleSelector.cs +++ b/Modules/CustomRoleSelector.cs @@ -116,7 +116,7 @@ internal static class CustomRoleSelector case CustomRoles.RuthlessRomantic: case CustomRoles.Deathknight: case CustomRoles.Convict: - case CustomRoles.Refugee: + case CustomRoles.Renegade: case CustomRoles.CovenMember: case CustomRoles.CovenLeader: case CustomRoles.Death: diff --git a/Modules/CustomRolesHelper.cs b/Modules/CustomRolesHelper.cs index 058cb7ca0..201dcdea1 100644 --- a/Modules/CustomRolesHelper.cs +++ b/Modules/CustomRolesHelper.cs @@ -138,7 +138,7 @@ internal static class CustomRolesHelper CustomRoles.BountyHunter => CustomRoles.Impostor, CustomRoles.Trickster => CustomRoles.Impostor, CustomRoles.Witch => (Witch.SwitchTrigger)Witch.ModeSwitchAction.GetValue() == Witch.SwitchTrigger.Vanish ? CustomRoles.Phantom : CustomRoles.Impostor, - CustomRoles.Agitater => CustomRoles.Impostor, + CustomRoles.Agitator => CustomRoles.Impostor, CustomRoles.Consigliere => CustomRoles.Impostor, CustomRoles.Wildling => Wildling.CanShapeshiftOpt.GetBool() ? CustomRoles.Shapeshifter : CustomRoles.Impostor, CustomRoles.Morphling => CustomRoles.Shapeshifter, @@ -339,7 +339,7 @@ internal static class CustomRolesHelper CustomRoles.Judge => CustomRoles.Crewmate, CustomRoles.Councillor => CustomRoles.Impostor, CustomRoles.Mortician => CustomRoles.Crewmate, - CustomRoles.Mediumshiper => CustomRoles.Crewmate, + CustomRoles.Medium => CustomRoles.Crewmate, CustomRoles.Bard => CustomRoles.Impostor, CustomRoles.Swooper => CustomRoles.Impostor, CustomRoles.Crewpostor => CustomRoles.Engineer, @@ -474,8 +474,8 @@ internal static class CustomRolesHelper CustomRoles.Sheriff => UsePets && Sheriff.UsePet.GetBool() ? RoleTypes.GuardianAngel : RoleTypes.Impostor, CustomRoles.Crusader => UsePets && Crusader.UsePet.GetBool() ? RoleTypes.GuardianAngel : RoleTypes.Impostor, CustomRoles.CopyCat => UsePets && CopyCat.UsePet.GetBool() ? RoleTypes.GuardianAngel : RoleTypes.Impostor, - CustomRoles.Refugee => RoleTypes.Impostor, - CustomRoles.Agitater => RoleTypes.Impostor, + CustomRoles.Renegade => RoleTypes.Impostor, + CustomRoles.Agitator => RoleTypes.Impostor, CustomRoles.Monarch => UsePets && Monarch.UsePet.GetBool() ? RoleTypes.GuardianAngel : RoleTypes.Impostor, CustomRoles.Deputy => UsePets && Deputy.UsePet.GetBool() ? RoleTypes.GuardianAngel : RoleTypes.Impostor, CustomRoles.Retributionist => UsePets && Retributionist.UsePet.GetBool() ? RoleTypes.GuardianAngel : RoleTypes.Impostor, @@ -629,7 +629,7 @@ internal static class CustomRolesHelper CustomRoles.Hypocrite or CustomRoles.Cherokious or CustomRoles.Necromancer or - CustomRoles.Agitater or + CustomRoles.Agitator or CustomRoles.Wraith or CustomRoles.Bandit or CustomRoles.Medusa or @@ -639,7 +639,7 @@ internal static class CustomRolesHelper CustomRoles.Juggernaut or CustomRoles.Jinx or CustomRoles.Poisoner or - CustomRoles.Refugee or + CustomRoles.Renegade or CustomRoles.Gaslighter or CustomRoles.Simon or CustomRoles.Patroller or @@ -853,7 +853,7 @@ internal static class CustomRolesHelper CustomRoles.Hypocrite or CustomRoles.Crewpostor or CustomRoles.Convict or - CustomRoles.Refugee or + CustomRoles.Renegade or CustomRoles.Parasite; } @@ -1149,7 +1149,7 @@ internal static class CustomRolesHelper CustomRoles.Sunglasses when pc.Is(CustomRoles.Torch) || pc.Is(CustomRoles.GuardianAngelEHR) || pc.Is(CustomRoles.Bewilder) => false, CustomRoles.Guesser when pc.GetCustomRole() is CustomRoles.EvilGuesser or CustomRoles.NiceGuesser or CustomRoles.Doomsayer or CustomRoles.CopyCat => false, CustomRoles.Madmate when !pc.CanBeMadmate() || pc.Is(CustomRoles.Egoist) || pc.Is(CustomRoles.Rascal) => false, - CustomRoles.Oblivious when pc.Is(CustomRoles.Forensic) || pc.Is(CustomRoles.Cleaner) || pc.Is(CustomRoles.Medusa) || pc.Is(CustomRoles.Mortician) || pc.Is(CustomRoles.Mediumshiper) || pc.Is(CustomRoles.GuardianAngelEHR) => false, + CustomRoles.Oblivious when pc.Is(CustomRoles.Forensic) || pc.Is(CustomRoles.Cleaner) || pc.Is(CustomRoles.Medusa) || pc.Is(CustomRoles.Mortician) || pc.Is(CustomRoles.Medium) || pc.Is(CustomRoles.GuardianAngelEHR) => false, CustomRoles.Youtuber when !pc.IsCrewmate() || pc.Is(CustomRoles.Madmate) || pc.Is(CustomRoles.Sheriff) || pc.Is(CustomRoles.GuardianAngelEHR) => false, CustomRoles.Egoist when !pc.IsImpostor() => false, CustomRoles.Damocles when pc.GetCustomRole() is CustomRoles.Bomber or CustomRoles.Nuker or CustomRoles.Mercenary or CustomRoles.Cantankerous => false, @@ -1174,7 +1174,7 @@ internal static class CustomRolesHelper CustomRoles.Bewilder when pc.GetCustomRole() is CustomRoles.Lighter or CustomRoles.Ignitor or CustomRoles.Investigator or CustomRoles.Eclipse or CustomRoles.Decryptor => false, CustomRoles.Sunglasses when pc.GetCustomRole() is CustomRoles.Lighter or CustomRoles.Ignitor or CustomRoles.Investigator or CustomRoles.Eclipse or CustomRoles.Decryptor => false, CustomRoles.Bait when pc.Is(CustomRoles.Demolitionist) => false, - CustomRoles.Trapper when pc.Is(CustomRoles.Demolitionist) => false, + CustomRoles.Beartrap when pc.Is(CustomRoles.Demolitionist) => false, CustomRoles.Lovers when pc.Is(CustomRoles.Romantic) => false, CustomRoles.Mare when pc.Is(CustomRoles.LastImpostor) => false, CustomRoles.Swift when pc.Is(CustomRoles.Mare) => false, @@ -1188,8 +1188,8 @@ internal static class CustomRolesHelper CustomRoles.Gravestone when pc.GetCustomRole() is CustomRoles.SuperStar or CustomRoles.Innocent => false, CustomRoles.Lucky when pc.Is(CustomRoles.Guardian) => false, CustomRoles.Bait when pc.Is(CustomRoles.GuardianAngelEHR) => false, - CustomRoles.Bait when pc.Is(CustomRoles.Trapper) => false, - CustomRoles.Trapper when pc.Is(CustomRoles.Bait) => false, + CustomRoles.Bait when pc.Is(CustomRoles.Beartrap) => false, + CustomRoles.Beartrap when pc.Is(CustomRoles.Bait) => false, CustomRoles.Schizophrenic when pc.Is(CustomRoles.Dictator) => false, CustomRoles.Swift when pc.Is(CustomRoles.Swooper) => false, CustomRoles.Swift when pc.Is(CustomRoles.Vampire) => false, @@ -1200,7 +1200,7 @@ internal static class CustomRolesHelper CustomRoles.Swift when pc.Is(CustomRoles.Witch) => false, CustomRoles.Swift when pc.Is(CustomRoles.Nemesis) => false, CustomRoles.Reach when pc.GetCustomRole() is CustomRoles.Mafioso or CustomRoles.Evolver or CustomRoles.Berserker => false, - CustomRoles.Trapper when pc.Is(CustomRoles.GuardianAngelEHR) => false, + CustomRoles.Beartrap when pc.Is(CustomRoles.GuardianAngelEHR) => false, CustomRoles.Reach when pc.GetRoleTypes() is not (RoleTypes.Impostor or RoleTypes.Phantom or RoleTypes.Shapeshifter or RoleTypes.Viper) => false, CustomRoles.Magnet when pc.GetRoleTypes() is not (RoleTypes.Impostor or RoleTypes.Phantom or RoleTypes.Shapeshifter or RoleTypes.Viper) => false, CustomRoles.Haste when pc.GetRoleTypes() is not (RoleTypes.Impostor or RoleTypes.Phantom or RoleTypes.Shapeshifter or RoleTypes.Viper) || !pc.CanUseImpostorVentButton() => false, @@ -1442,7 +1442,7 @@ internal static class CustomRolesHelper CustomRoles.Parasite => CountTypes.Impostor, CustomRoles.Hypocrite => CountTypes.Impostor, CustomRoles.Crewpostor => CountTypes.Impostor, - CustomRoles.Refugee => CountTypes.Impostor, + CustomRoles.Renegade => CountTypes.Impostor, CustomRoles.Gaslighter => Gaslighter.WinCondition.GetValue() == 2 ? CountTypes.Gaslighter : CountTypes.Crew, CustomRoles.Stalker when Stalker.SnatchesWin.GetBool() => CountTypes.Crew, CustomRoles.SchrodingersCat => SchrodingersCat.WinsWithCrewIfNotAttacked.GetBool() ? CountTypes.Crew : CountTypes.OutOfGame, @@ -1799,7 +1799,7 @@ internal static class CustomRolesHelper CustomRoles.Lighter => RoleOptionType.Crewmate_Investigate, CustomRoles.Lookout => RoleOptionType.Crewmate_Investigate, CustomRoles.Markseeker => RoleOptionType.Crewmate_Investigate, - CustomRoles.Mediumshiper => RoleOptionType.Crewmate_Investigate, + CustomRoles.Medium => RoleOptionType.Crewmate_Investigate, CustomRoles.Telecommunication => RoleOptionType.Crewmate_Investigate, CustomRoles.Mortician => RoleOptionType.Crewmate_Investigate, CustomRoles.Hacker => RoleOptionType.Crewmate_Investigate, @@ -1996,7 +1996,7 @@ public enum CountTypes Pulse, Werewolf, Juggernaut, - Agitater, + Agitator, Virus, Stalker, Jinx, diff --git a/Modules/CustomRpcSender.cs b/Modules/CustomRpcSender.cs index 94c37f224..45e82f1b1 100644 --- a/Modules/CustomRpcSender.cs +++ b/Modules/CustomRpcSender.cs @@ -514,7 +514,7 @@ public static class CustomRpcSenderExtensions else player.AddAbilityCD((int)Math.Round(time)); - if (player.GetCustomRole() is not CustomRoles.Necromancer and not CustomRoles.Deathknight and not CustomRoles.Refugee and not CustomRoles.Sidekick) return false; + if (player.GetCustomRole() is not CustomRoles.Necromancer and not CustomRoles.Deathknight and not CustomRoles.Renegade and not CustomRoles.Sidekick) return false; } if (!player.CanUseKillButton() && !AntiBlackout.SkipTasks && !IntroCutsceneDestroyPatch.PreventKill) return false; diff --git a/Modules/ExtendedPlayerControl.cs b/Modules/ExtendedPlayerControl.cs index 9479b9d42..ef447f804 100644 --- a/Modules/ExtendedPlayerControl.cs +++ b/Modules/ExtendedPlayerControl.cs @@ -931,7 +931,7 @@ internal static class ExtendedPlayerControl else player.AddAbilityCD((int)Math.Round(time)); - if (player.GetCustomRole() is not CustomRoles.Necromancer and not CustomRoles.Deathknight and not CustomRoles.Refugee and not CustomRoles.Sidekick) return; + if (player.GetCustomRole() is not CustomRoles.Necromancer and not CustomRoles.Deathknight and not CustomRoles.Renegade and not CustomRoles.Sidekick) return; } if (!player.CanUseKillButton() && !AntiBlackout.SkipTasks && !IntroCutsceneDestroyPatch.PreventKill) return; @@ -1426,7 +1426,7 @@ internal static class ExtendedPlayerControl CustomGameMode.Standard when CopyCat.Instances.Any(x => x.CopyCatPC.PlayerId == pc.PlayerId) => true, CustomGameMode.Standard when pc.Is(CustomRoles.Nimble) || Options.EveryoneCanVent.GetBool() => true, - CustomGameMode.Standard when pc.Is(CustomRoles.Bloodlust) || pc.Is(CustomRoles.Refugee) => true, + CustomGameMode.Standard when pc.Is(CustomRoles.Bloodlust) || pc.Is(CustomRoles.Renegade) => true, _ => Main.PlayerStates.TryGetValue(pc.PlayerId, out PlayerState state) && state.Role.CanUseImpostorVentButton(pc) }; @@ -1769,9 +1769,9 @@ internal static class ExtendedPlayerControl if (sync) player.SyncSettings(); } - public static void TrapperKilled(this PlayerControl killer, PlayerControl target) + public static void BeartrapKilled(this PlayerControl killer, PlayerControl target) { - Logger.Info($"{target?.Data?.PlayerName} was Trapper", "Trapper"); + Logger.Info($"{target?.Data?.PlayerName} was Beartrap", "Beartrap"); float tmpSpeed = Main.AllPlayerSpeed[killer.PlayerId]; Main.AllPlayerSpeed[killer.PlayerId] = Main.MinSpeed; ReportDeadBodyPatch.CanReport[killer.PlayerId] = false; @@ -1783,7 +1783,7 @@ internal static class ExtendedPlayerControl ReportDeadBodyPatch.CanReport[killer.PlayerId] = true; killer.MarkDirtySettings(); RPC.PlaySoundRPC(killer.PlayerId, Sounds.TaskComplete); - }, Options.TrapperBlockMoveTime.GetFloat(), "Trapper BlockMove"); + }, Options.BeartrapBlockMoveTime.GetFloat(), "Beartrap BlockMove"); if (killer.AmOwner) Achievements.Type.TooCold.CompleteAfterGameEnd(); @@ -1873,7 +1873,7 @@ internal static class ExtendedPlayerControl if (target == null) target = killer; - CheckAndSpawnAdditionalRefugee(target.Data); + CheckAndSpawnAdditionalRenegade(target.Data); if (target.GetTeam() is Team.Impostor or Team.Neutral) Stressed.OnNonCrewmateDead(); @@ -1894,7 +1894,7 @@ internal static class ExtendedPlayerControl if (realKiller == null) realKiller = killer; if (target.PlayerId == Godfather.GodfatherTarget) - realKiller.RpcSetCustomRole(CustomRoles.Refugee); + realKiller.RpcSetCustomRole(CustomRoles.Renegade); if (target.Is(CustomRoles.Jackal)) Jackal.Instances.Do(x => x.PromoteSidekick()); diff --git a/Modules/GameState.cs b/Modules/GameState.cs index 54b7e28af..a6b70c133 100644 --- a/Modules/GameState.cs +++ b/Modules/GameState.cs @@ -139,8 +139,8 @@ public class PlayerState(byte playerId) SubRoles.ForEach(SetAddonCountTypes); - if (!Player.HasKillButton() && role == CustomRoles.Refugee) - Player.RpcChangeRoleBasis(CustomRoles.Refugee); + if (!Player.HasKillButton() && role == CustomRoles.Renegade) + Player.RpcChangeRoleBasis(CustomRoles.Renegade); Role = role.GetRoleClass(); @@ -182,7 +182,7 @@ public class PlayerState(byte playerId) if (!role.Is(Team.Impostor) && !(role == CustomRoles.Traitor && Traitor.CanGetImpostorOnlyAddons.GetBool())) SubRoles.ToArray().DoIf(x => x.IsImpOnlyAddon(), RemoveSubRole); - if (role is CustomRoles.Sidekick or CustomRoles.Necromancer or CustomRoles.Deathknight or CustomRoles.Refugee) + if (role is CustomRoles.Sidekick or CustomRoles.Necromancer or CustomRoles.Deathknight or CustomRoles.Renegade) SubRoles.ToArray().DoIf(StartGameHostPatch.BasisChangingAddons.ContainsKey, RemoveSubRole); if (role == CustomRoles.Sidekick && Jackal.Instances.FindFirst(x => x.SidekickId == byte.MaxValue || x.SidekickId.GetPlayer() == null, out Jackal jackal)) @@ -389,7 +389,7 @@ public class PlayerState(byte playerId) deathReason = Enum.GetValues()[..^8].RandomElement(); RPC.SendDeathReason(PlayerId, deathReason); - Utils.CheckAndSpawnAdditionalRefugee(Utils.GetPlayerInfoById(PlayerId)); + Utils.CheckAndSpawnAdditionalRenegade(Utils.GetPlayerInfoById(PlayerId)); } } diff --git a/Modules/NameColorManager.cs b/Modules/NameColorManager.cs index e404a9cfe..3ecfe36ad 100644 --- a/Modules/NameColorManager.cs +++ b/Modules/NameColorManager.cs @@ -159,7 +159,7 @@ public static class NameColorManager CustomRoles.Monarch when target.Is(CustomRoles.Knighted) => Main.RoleColors[CustomRoles.Knighted], CustomRoles.Spiritcaller when target.Is(CustomRoles.EvilSpirit) => Main.RoleColors[CustomRoles.EvilSpirit], CustomRoles.Jackal when target.Is(CustomRoles.Recruit) => Main.RoleColors[CustomRoles.Jackal], - CustomRoles.Refugee when target.Is(CustomRoleTypes.Impostor) => Main.RoleColors[CustomRoles.ImpostorEHR], + CustomRoles.Renegade when target.Is(CustomRoleTypes.Impostor) => Main.RoleColors[CustomRoles.ImpostorEHR], CustomRoles.HeadHunter when ((HeadHunter)seerRoleClass).Targets.Contains(target.PlayerId) => "000000", CustomRoles.BountyHunter when (seerRoleClass as BountyHunter)?.GetTarget(seer) == target.PlayerId => "000000", CustomRoles.Pyromaniac when ((Pyromaniac)seerRoleClass).DousedList.Contains(target.PlayerId) => "#BA4A00", @@ -205,7 +205,7 @@ public static class NameColorManager { CustomRoles.Jackal when seer.Is(CustomRoles.Recruit) => Main.RoleColors[CustomRoles.Jackal], CustomRoles.Virus when seer.Is(CustomRoles.Contagious) => Main.RoleColors[CustomRoles.Virus], - CustomRoles.Refugee when seer.Is(CustomRoleTypes.Impostor) => Main.RoleColors[CustomRoles.Refugee], + CustomRoles.Renegade when seer.Is(CustomRoleTypes.Impostor) => Main.RoleColors[CustomRoles.Renegade], CustomRoles.Speedrunner when !seer.Is(Team.Crewmate) && target.GetTaskState().CompletedTasksCount >= Speedrunner.SpeedrunnerNotifyAtXTasksLeft.GetInt() && Speedrunner.SpeedrunnerNotifyKillers.GetBool() => Main.RoleColors[CustomRoles.Speedrunner], CustomRoles.SoulHunter when SoulHunter.IsSoulHunterTarget(seer.PlayerId) => Main.RoleColors[CustomRoles.SoulHunter], CustomRoles.Necromancer or CustomRoles.Deathknight when seer.Is(CustomRoles.Undead) => Main.RoleColors[targetRole], diff --git a/Modules/OptionHolder.cs b/Modules/OptionHolder.cs index fdad41bc6..05a9a526b 100644 --- a/Modules/OptionHolder.cs +++ b/Modules/OptionHolder.cs @@ -335,7 +335,7 @@ public static class Options public static OptionItem VindicatorAdditionalVote; public static OptionItem VindicatorHideVote; public static OptionItem DoctorTaskCompletedBatteryCharge; - public static OptionItem TrapperBlockMoveTime; + public static OptionItem BeartrapBlockMoveTime; public static OptionItem InnocentCanWinByImp; public static OptionItem BaitNotification; public static OptionItem DoctorVisibleToEveryone; @@ -376,7 +376,7 @@ public static class Options public static OptionItem GuesserNumRestrictions; public static Dictionary NumGuessersOnEachTeam = []; - public static OptionItem RefugeeKillCD; + public static OptionItem RenegadeKillCD; public static OptionItem SkeldChance; public static OptionItem MiraChance; @@ -652,9 +652,9 @@ public static class Options public static OptionItem OverrideOtherCrewBasedRoles; public static OptionItem WhackAMole; - public static OptionItem SpawnAdditionalRefugeeOnImpsDead; - public static OptionItem SpawnAdditionalRefugeeWhenNKAlive; - public static OptionItem SpawnAdditionalRefugeeMinAlivePlayers; + public static OptionItem SpawnAdditionalRenegadeOnImpsDead; + public static OptionItem SpawnAdditionalRenegadeWhenNKAlive; + public static OptionItem SpawnAdditionalRenegadeMinAlivePlayers; public static OptionItem AprilFoolsMode; @@ -1410,7 +1410,7 @@ public static class Options MadmateHasImpostorVision = new BooleanOptionItem(156, "MadmateHasImpostorVision", true, TabGroup.ImpostorRoles) .SetGameMode(CustomGameMode.Standard); - RefugeeKillCD = new FloatOptionItem(157, "RefugeeKillCD", new(0f, 180f, 0.5f), 25f, TabGroup.ImpostorRoles) + RenegadeKillCD = new FloatOptionItem(157, "RenegadeKillCD", new(0f, 180f, 0.5f), 25f, TabGroup.ImpostorRoles) .SetGameMode(CustomGameMode.Standard) .SetValueFormat(OptionFormat.Seconds); @@ -2456,20 +2456,20 @@ public static class Options .SetGameMode(CustomGameMode.Standard) .SetParent(EveryoneCanVent); - SpawnAdditionalRefugeeOnImpsDead = new BooleanOptionItem(23857, "SpawnAdditionalRefugeeOnImpsDead", false, TabGroup.TaskSettings) + SpawnAdditionalRenegadeOnImpsDead = new BooleanOptionItem(23857, "SpawnAdditionalRenegadeOnImpsDead", false, TabGroup.TaskSettings) .SetGameMode(CustomGameMode.Standard) .SetColor(Color.magenta) .SetHeader(true); - SpawnAdditionalRefugeeWhenNKAlive = new BooleanOptionItem(23858, "SpawnAdditionalRefugeeWhenNKAlive", false, TabGroup.TaskSettings) + SpawnAdditionalRenegadeWhenNKAlive = new BooleanOptionItem(23858, "SpawnAdditionalRenegadeWhenNKAlive", false, TabGroup.TaskSettings) .SetGameMode(CustomGameMode.Standard) .SetColor(Color.magenta) - .SetParent(SpawnAdditionalRefugeeOnImpsDead); + .SetParent(SpawnAdditionalRenegadeOnImpsDead); - SpawnAdditionalRefugeeMinAlivePlayers = new IntegerOptionItem(23859, "SpawnAdditionalRefugeeMinAlivePlayers", new(1, 14, 1), 7, TabGroup.TaskSettings) + SpawnAdditionalRenegadeMinAlivePlayers = new IntegerOptionItem(23859, "SpawnAdditionalRenegadeMinAlivePlayers", new(1, 14, 1), 7, TabGroup.TaskSettings) .SetGameMode(CustomGameMode.Standard) .SetColor(Color.magenta) - .SetParent(SpawnAdditionalRefugeeOnImpsDead); + .SetParent(SpawnAdditionalRenegadeOnImpsDead); AprilFoolsMode = new BooleanOptionItem(23860, "AprilFoolsMode", Main.IsAprilFools, TabGroup.TaskSettings) .SetGameMode(CustomGameMode.Standard) diff --git a/Modules/RPC.cs b/Modules/RPC.cs index 654795747..69018f124 100644 --- a/Modules/RPC.cs +++ b/Modules/RPC.cs @@ -799,7 +799,7 @@ internal static class RPCHandlerPatch } case CustomRPC.RpcPassBomb: { - Agitater.ReceiveRPC(reader); + Agitator.ReceiveRPC(reader); break; } case CustomRPC.DoSpell: diff --git a/Modules/Statistics.cs b/Modules/Statistics.cs index b9ab31b1c..5a223902f 100644 --- a/Modules/Statistics.cs +++ b/Modules/Statistics.cs @@ -334,7 +334,7 @@ public static class Statistics switch (killerState.MainRole) { - case CustomRoles.Traitor when targetState.MainRole == CustomRoles.Refugee: + case CustomRoles.Traitor when targetState.MainRole == CustomRoles.Renegade: Achievements.Type.TheRealTraitor.CompleteAfterGameEnd(); break; case CustomRoles.Bargainer when targetState.MainRole == CustomRoles.Merchant: diff --git a/Modules/Utils.cs b/Modules/Utils.cs index fb1740236..6a7f41e9e 100644 --- a/Modules/Utils.cs +++ b/Modules/Utils.cs @@ -909,9 +909,9 @@ public static class Utils case CustomRoles.Maverick: case CustomRoles.Jinx: case CustomRoles.Parasite: - case CustomRoles.Agitater: + case CustomRoles.Agitator: case CustomRoles.Crusader when !Options.UsePets.GetBool() || !Crusader.UsePet.GetBool(): - case CustomRoles.Refugee: + case CustomRoles.Renegade: case CustomRoles.Jester: case CustomRoles.Mario: case CustomRoles.Vulture: @@ -991,7 +991,7 @@ public static class Utils } hasTasks &= !(CopyCat.Instances.Any(x => x.CopyCatPC.PlayerId == p.PlayerId) && forRecompute && (!Options.UsePets.GetBool() || CopyCat.UsePet.GetBool())); - hasTasks |= p.Object.UsesPetInsteadOfKill() && role is not (CustomRoles.Refugee or CustomRoles.Necromancer or CustomRoles.Deathknight or CustomRoles.Sidekick); + hasTasks |= p.Object.UsesPetInsteadOfKill() && role is not (CustomRoles.Renegade or CustomRoles.Necromancer or CustomRoles.Deathknight or CustomRoles.Sidekick); foreach (CustomRoles subRole in state.SubRoles) { @@ -1784,22 +1784,22 @@ public static class Utils } } - public static void CheckAndSpawnAdditionalRefugee(NetworkedPlayerInfo deadPlayer, bool ejection = false) + public static void CheckAndSpawnAdditionalRenegade(NetworkedPlayerInfo deadPlayer, bool ejection = false) { try { - if (Options.CurrentGameMode != CustomGameMode.Standard || deadPlayer == null || deadPlayer.Object.Is(CustomRoles.Refugee) || Main.HasJustStarted || !GameStates.InGame || !Options.SpawnAdditionalRefugeeOnImpsDead.GetBool() || Main.AllAlivePlayerControls.Length < Options.SpawnAdditionalRefugeeMinAlivePlayers.GetInt() || CustomRoles.Refugee.RoleExist(true) || Main.AllAlivePlayerControls == null || Main.AllAlivePlayerControls.Length == 0 || Main.AllAlivePlayerControls.Any(x => x.PlayerId != deadPlayer.PlayerId && (x.Is(CustomRoleTypes.Impostor) || (x.IsNeutralKiller() && !Options.SpawnAdditionalRefugeeWhenNKAlive.GetBool())))) return; + if (Options.CurrentGameMode != CustomGameMode.Standard || deadPlayer == null || deadPlayer.Object.Is(CustomRoles.Renegade) || Main.HasJustStarted || !GameStates.InGame || !Options.SpawnAdditionalRenegadeOnImpsDead.GetBool() || Main.AllAlivePlayerControls.Length < Options.SpawnAdditionalRenegadeMinAlivePlayers.GetInt() || CustomRoles.Renegade.RoleExist(true) || Main.AllAlivePlayerControls == null || Main.AllAlivePlayerControls.Length == 0 || Main.AllAlivePlayerControls.Any(x => x.PlayerId != deadPlayer.PlayerId && (x.Is(CustomRoleTypes.Impostor) || (x.IsNeutralKiller() && !Options.SpawnAdditionalRenegadeWhenNKAlive.GetBool())))) return; PlayerControl[] listToChooseFrom = Main.AllAlivePlayerControls.Where(x => x.PlayerId != deadPlayer.PlayerId && x.Is(CustomRoleTypes.Crewmate) && !x.Is(CustomRoles.Loyal)).ToArray(); if (listToChooseFrom.Length > 0) { PlayerControl pc = listToChooseFrom.RandomElement(); - pc.RpcSetCustomRole(CustomRoles.Refugee); + pc.RpcSetCustomRole(CustomRoles.Renegade); if (!ejection && !AntiBlackout.SkipTasks) { - pc.RpcChangeRoleBasis(CustomRoles.Refugee); + pc.RpcChangeRoleBasis(CustomRoles.Renegade); pc.SetKillCooldown(); } else @@ -1811,17 +1811,17 @@ public static class Utils { while (AntiBlackout.SkipTasks || GameStates.IsMeeting || ExileController.Instance) yield return null; if (GameStates.IsEnded || GameStates.IsLobby) yield break; - pc.RpcChangeRoleBasis(CustomRoles.Refugee); + pc.RpcChangeRoleBasis(CustomRoles.Renegade); pc.ResetKillCooldown(); pc.SetKillCooldown(); } } Main.PlayerStates[pc.PlayerId].RemoveSubRole(CustomRoles.Madmate); - Logger.Warn($"{pc.GetRealName()} is now a Refugee since all Impostors are dead", "Add Refugee"); + Logger.Warn($"{pc.GetRealName()} is now a Renegade since all Impostors are dead", "Add Renegade"); } else - Logger.Msg("No Player to change to Refugee.", "Add Refugee"); + Logger.Msg("No Player to change to Renegade.", "Add Renegade"); } catch (Exception e) { ThrowException(e); } } diff --git a/Patches/ChatCommandPatch.cs b/Patches/ChatCommandPatch.cs index 72dae59ab..8680b810c 100644 --- a/Patches/ChatCommandPatch.cs +++ b/Patches/ChatCommandPatch.cs @@ -394,7 +394,7 @@ internal static class ChatCommands if (NiceSwapper.SwapMsg(PlayerControl.LocalPlayer, text)) goto Canceled; if (Inspector.InspectorCheckMsg(PlayerControl.LocalPlayer, text)) goto Canceled; if (Councillor.MurderMsg(PlayerControl.LocalPlayer, text)) goto Canceled; - if (Mediumshiper.MsMsg(PlayerControl.LocalPlayer, text)) goto Canceled; + if (Medium.MsMsg(PlayerControl.LocalPlayer, text)) goto Canceled; if (Nemesis.NemesisMsgCheck(PlayerControl.LocalPlayer, text)) goto Canceled; } @@ -3604,7 +3604,7 @@ internal static class ChatCommands return; } - if (Mediumshiper.MsMsg(player, text) || Nemesis.NemesisMsgCheck(player, text)) + if (Medium.MsMsg(player, text) || Nemesis.NemesisMsgCheck(player, text)) { LastSentCommand[player.PlayerId] = now; return; diff --git a/Patches/HudPatch.cs b/Patches/HudPatch.cs index 9be8e171f..dd05026b7 100644 --- a/Patches/HudPatch.cs +++ b/Patches/HudPatch.cs @@ -321,7 +321,7 @@ internal static class HudManagerPatch if ((!AmongUsClient.Instance.IsGameStarted && AmongUsClient.Instance.NetworkMode != NetworkModes.FreePlay) || GameStates.IsMeeting) LowerInfoText.enabled = false; - bool allowedRole = role is CustomRoles.Necromancer or CustomRoles.Deathknight or CustomRoles.Refugee or CustomRoles.Sidekick; + bool allowedRole = role is CustomRoles.Necromancer or CustomRoles.Deathknight or CustomRoles.Renegade or CustomRoles.Sidekick; if (player.CanUseKillButton() && (allowedRole || !usesPetInsteadOfKill)) { @@ -352,7 +352,7 @@ internal static class HudManagerPatch ActionButton button; Type type = state.Role.GetType(); - if (type.GetMethod("OnVote").DeclaringType == type || role is CustomRoles.Adrenaline or CustomRoles.Battery or CustomRoles.Dad or CustomRoles.Grappler or CustomRoles.Inquirer or CustomRoles.Judge or CustomRoles.Mechanic or CustomRoles.Mediumshiper or CustomRoles.NiceSwapper or CustomRoles.Inspector or CustomRoles.Spy or CustomRoles.Councillor or CustomRoles.CursedWolf or CustomRoles.Forger or CustomRoles.Generator or CustomRoles.Ventriloquist or CustomRoles.Bargainer or CustomRoles.Technician or CustomRoles.Virus) + if (type.GetMethod("OnVote").DeclaringType == type || role is CustomRoles.Adrenaline or CustomRoles.Battery or CustomRoles.Dad or CustomRoles.Grappler or CustomRoles.Inquirer or CustomRoles.Judge or CustomRoles.Mechanic or CustomRoles.Medium or CustomRoles.NiceSwapper or CustomRoles.Inspector or CustomRoles.Spy or CustomRoles.Councillor or CustomRoles.CursedWolf or CustomRoles.Forger or CustomRoles.Generator or CustomRoles.Ventriloquist or CustomRoles.Bargainer or CustomRoles.Technician or CustomRoles.Virus) button = null; else if (role is CustomRoles.Coroner or CustomRoles.Occultist or CustomRoles.Vulture) button = __instance.ReportButton; @@ -656,7 +656,7 @@ internal static class SetHudActivePatch __instance.AbilityButton?.ToggleVisible(true); break; case CustomRoles.Parasite: - case CustomRoles.Refugee: + case CustomRoles.Renegade: case CustomRoles.Magician: __instance.SabotageButton?.ToggleVisible(true); break; @@ -773,7 +773,7 @@ internal static class MapBehaviourShowPatch } else if (opts.Mode is MapOptions.Modes.Normal or MapOptions.Modes.Sabotage) { - if (player.Is(CustomRoleTypes.Impostor) || player.CanUseSabotage() || player.Is(CustomRoles.Glitch) || player.Is(CustomRoles.WeaponMaster) || player.Is(CustomRoles.Magician) || player.Is(CustomRoles.Parasite) || player.Is(CustomRoles.Refugee) || (player.Is(CustomRoles.Jackal) && Jackal.CanSabotage.GetBool()) || (player.Is(CustomRoles.Traitor) && Traitor.CanSabotage.GetBool())) + if (player.Is(CustomRoleTypes.Impostor) || player.CanUseSabotage() || player.Is(CustomRoles.Glitch) || player.Is(CustomRoles.WeaponMaster) || player.Is(CustomRoles.Magician) || player.Is(CustomRoles.Parasite) || player.Is(CustomRoles.Renegade) || (player.Is(CustomRoles.Jackal) && Jackal.CanSabotage.GetBool()) || (player.Is(CustomRoles.Traitor) && Traitor.CanSabotage.GetBool())) opts.Mode = MapOptions.Modes.Sabotage; else opts.Mode = MapOptions.Modes.Normal; diff --git a/Patches/HudSpritePatch.cs b/Patches/HudSpritePatch.cs index 2f594f7f1..85ae4d31d 100644 --- a/Patches/HudSpritePatch.cs +++ b/Patches/HudSpritePatch.cs @@ -244,7 +244,7 @@ public static class HudSpritePatch newAbilityButton = CustomButton.Get("Camo"); break; } - case CustomRoles.Agitater: + case CustomRoles.Agitator: case CustomRoles.Potato: { newKillButton = CustomButton.Get("bombshell"); diff --git a/Patches/IntroPatch.cs b/Patches/IntroPatch.cs index 3570471d2..76d455677 100644 --- a/Patches/IntroPatch.cs +++ b/Patches/IntroPatch.cs @@ -710,7 +710,7 @@ internal static class BeginCrewmatePatch CustomRoles.Astral or CustomRoles.Beacon or CustomRoles.DovesOfNeace or - CustomRoles.Mediumshiper or + CustomRoles.Medium or CustomRoles.Observer or CustomRoles.Spiritcaller or CustomRoles.Spiritualist or diff --git a/Patches/MeetingHudPatch.cs b/Patches/MeetingHudPatch.cs index 03e3df8fb..a8a3be76d 100644 --- a/Patches/MeetingHudPatch.cs +++ b/Patches/MeetingHudPatch.cs @@ -333,7 +333,7 @@ internal static class CheckForEndVotingPatch Statistics.OnVotingComplete(states.ToArray(), exiledPlayer, tie, false); CheckForDeathOnExile(PlayerState.DeathReason.Vote, exileId); - Utils.CheckAndSpawnAdditionalRefugee(exiledPlayer, ejection: true); + Utils.CheckAndSpawnAdditionalRenegade(exiledPlayer, ejection: true); if (QuizMaster.On) QuizMaster.Data.NumPlayersVotedLastMeeting = __instance.playerStates.Count(x => x.DidVote); @@ -794,8 +794,8 @@ internal static class MeetingHudStartPatch } if (Mortician.MsgToSend.TryGetValue(pc.PlayerId, out string value2)) AddMsg(value2, pc.PlayerId, Utils.ColorString(Utils.GetRoleColor(CustomRoles.Mortician), GetString("MorticianCheckTitle"))); - if (Mediumshiper.ContactPlayer.ContainsValue(pc.PlayerId)) AddMsg(string.Format(GetString("MediumshipNotifySelf"), Main.AllPlayerNames[Mediumshiper.ContactPlayer.FirstOrDefault(x => x.Value == pc.PlayerId).Key], pc.GetAbilityUseLimit()), pc.PlayerId, Utils.ColorString(Utils.GetRoleColor(CustomRoles.Mediumshiper), GetString("MediumshipTitle"))); - if (Mediumshiper.ContactPlayer.ContainsKey(pc.PlayerId) && (!Mediumshiper.OnlyReceiveMsgFromCrew.GetBool() || pc.IsCrewmate())) AddMsg(string.Format(GetString("MediumshipNotifyTarget"), Main.AllPlayerNames[Mediumshiper.ContactPlayer[pc.PlayerId]]), pc.PlayerId, Utils.ColorString(Utils.GetRoleColor(CustomRoles.Mediumshiper), GetString("MediumshipTitle"))); + if (Medium.ContactPlayer.ContainsValue(pc.PlayerId)) AddMsg(string.Format(GetString("MediumshipNotifySelf"), Main.AllPlayerNames[Medium.ContactPlayer.FirstOrDefault(x => x.Value == pc.PlayerId).Key], pc.GetAbilityUseLimit()), pc.PlayerId, Utils.ColorString(Utils.GetRoleColor(CustomRoles.Medium), GetString("MediumshipTitle"))); + if (Medium.ContactPlayer.ContainsKey(pc.PlayerId) && (!Medium.OnlyReceiveMsgFromCrew.GetBool() || pc.IsCrewmate())) AddMsg(string.Format(GetString("MediumshipNotifyTarget"), Main.AllPlayerNames[Medium.ContactPlayer[pc.PlayerId]]), pc.PlayerId, Utils.ColorString(Utils.GetRoleColor(CustomRoles.Medium), GetString("MediumshipTitle"))); if (Virus.VirusNotify.TryGetValue(pc.PlayerId, out string value3)) AddMsg(value3, pc.PlayerId, Utils.ColorString(Utils.GetRoleColor(CustomRoles.Virus), GetString("VirusNoticeTitle"))); if (Enigma.MsgToSend.TryGetValue(pc.PlayerId, out string value4)) AddMsg(value4, pc.PlayerId, Utils.ColorString(Utils.GetRoleColor(CustomRoles.Enigma), Enigma.MsgToSendTitle[pc.PlayerId])); diff --git a/Patches/PetActionsPatch.cs b/Patches/PetActionsPatch.cs index 76ebe8a91..2f91adc0a 100644 --- a/Patches/PetActionsPatch.cs +++ b/Patches/PetActionsPatch.cs @@ -155,7 +155,7 @@ internal static class ExternalRpcPetPatch if (Options.CurrentGameMode == CustomGameMode.Standard && Options.UsePhantomBasis.GetBool() && (!role.IsNK() || Options.UsePhantomBasisForNKs.GetBool()) && role.SimpleAbilityTrigger()) return; - bool alwaysPetRole = role is CustomRoles.Necromancer or CustomRoles.Deathknight or CustomRoles.Refugee or CustomRoles.Sidekick; + bool alwaysPetRole = role is CustomRoles.Necromancer or CustomRoles.Deathknight or CustomRoles.Renegade or CustomRoles.Sidekick; if (!pc.CanUseKillButton() && !alwaysPetRole) hasKillTarget = false; diff --git a/Patches/PlayerControlPatch.cs b/Patches/PlayerControlPatch.cs index fc9206b7f..c04bb4abf 100644 --- a/Patches/PlayerControlPatch.cs +++ b/Patches/PlayerControlPatch.cs @@ -467,9 +467,9 @@ internal static class CheckMurderPatch return false; } - if (killer.Is(CustomRoles.Refugee) && target.Is(CustomRoleTypes.Impostor)) + if (killer.Is(CustomRoles.Renegade) && target.Is(CustomRoleTypes.Impostor)) { - Notify("RefugeeKillImpostor"); + Notify("RenegadeKillImpostor"); return false; } @@ -695,7 +695,7 @@ internal static class MurderPlayerPatch { Postman.CheckAndResetTargets(target, true); - if (target.Is(CustomRoles.Trapper) && killer != target) killer.TrapperKilled(target); + if (target.Is(CustomRoles.Beartrap) && killer != target) killer.BeartrapKilled(target); if (target.Is(CustomRoles.Stained)) Stained.OnDeath(target, killer); @@ -1308,7 +1308,7 @@ internal static class ReportDeadBodyPatch try { Enigma.OnReportDeadBody(player, target); - Mediumshiper.OnReportDeadBody(target); + Medium.OnReportDeadBody(target); Mortician.OnReportDeadBody(player, target); Spiritualist.OnReportDeadBody(target); @@ -1592,7 +1592,7 @@ internal static class FixedUpdatePatch var state = Main.PlayerStates[player.PlayerId]; state.SubRoles - .FindAll(x => x is CustomRoles.Fragile or CustomRoles.Unbound or CustomRoles.Diseased or CustomRoles.Antidote or CustomRoles.Trapper or CustomRoles.Youtuber or CustomRoles.Lucky or CustomRoles.Onbound or CustomRoles.Allergic or CustomRoles.Asthmatic or CustomRoles.Bewilder or CustomRoles.Compelled or CustomRoles.Unlucky or CustomRoles.Bait) + .FindAll(x => x is CustomRoles.Fragile or CustomRoles.Unbound or CustomRoles.Diseased or CustomRoles.Antidote or CustomRoles.Beartrap or CustomRoles.Youtuber or CustomRoles.Lucky or CustomRoles.Onbound or CustomRoles.Allergic or CustomRoles.Asthmatic or CustomRoles.Bewilder or CustomRoles.Compelled or CustomRoles.Unlucky or CustomRoles.Bait) .ForEach(x => state.RemoveSubRole(x)); if (!PlagueBearer.PestilenceList.Contains(playerId)) diff --git a/Patches/SabotageSystemPatch.cs b/Patches/SabotageSystemPatch.cs index 7855ca310..1a385cbf8 100644 --- a/Patches/SabotageSystemPatch.cs +++ b/Patches/SabotageSystemPatch.cs @@ -492,7 +492,7 @@ public static class SabotageSystemTypeRepairDamagePatch CustomRoles.Jackal when Jackal.CanSabotage.GetBool() => true, CustomRoles.Sidekick when Jackal.CanSabotageSK.GetBool() => true, CustomRoles.Traitor when Traitor.CanSabotage.GetBool() => true, - CustomRoles.Parasite or CustomRoles.Refugee when player.IsAlive() => true, + CustomRoles.Parasite or CustomRoles.Renegade when player.IsAlive() => true, _ => Main.PlayerStates[player.PlayerId].Role.CanUseSabotage(player) && Main.PlayerStates[player.PlayerId].Role.OnSabotage(player) }; diff --git a/Resources/Lang/en_US.json b/Resources/Lang/en_US.json index ce4aeeafa..c1b79a6ab 100644 --- a/Resources/Lang/en_US.json +++ b/Resources/Lang/en_US.json @@ -241,7 +241,7 @@ "Lurker": "Lurker", "Convict": "Convict", "Visionary": "Visionary", - "Refugee": "Renegade", + "Renegade": "Renegade", "Luckey": "Luckey", "LazyGuy": "Lazy Guy", "SuperStar": "Super Star", @@ -274,7 +274,7 @@ "Glitch": "The Glitch", "Judge": "Judge", "Mortician": "Mortician", - "Mediumshiper": "Medium", + "Medium": "Medium", "DovesOfNeace": "Pacifist", "Observer": "Observer", "Monarch": "Monarch", @@ -376,7 +376,7 @@ "Magnet": "Magnet", "Charmed": "Charmed", "Bait": "Bait", - "Trapper": "Beartrap", + "Beartrap": "Beartrap", "Infected": "Infected", "Onbound": "Onbound", "Knighted": "Knighted", @@ -428,7 +428,7 @@ "Prefix.Schizophrenic": "Schizophrenic", "Prefix.Mimic": "Mimic", "Prefix.Bait": "Bait", - "Prefix.Trapper": "Beartrap", + "Prefix.Beartrap": "Beartrap", "Prefix.Guesser": "Guesser", "Prefix.Necroview": "Necroview", "Prefix.Recruit": "Recruit", @@ -520,7 +520,7 @@ "LurkerInfo": "Reduce your kill cooldown by venting", "ConvictInfo": "Your target died. Now help the Impostors", "VisionaryInfo": "You see the alignments of the living", - "RefugeeInfo": "Help the Impostors kill off the crew", + "RenegadeInfo": "Help the Impostors kill off the crew", "UnderdogInfo": "Start killing on a low player count", "LuckeyInfo": "Dodge attacks", "LazyGuyInfo": "You're too lazy", @@ -555,7 +555,7 @@ "GlitchInfo": "Hack and kill everyone", "JudgeInfo": "Silence in the courtroom!", "MorticianInfo": "Report a body to know who interacted with them last", - "MediumshiperInfo": "Talk with ghosts", + "MediumInfo": "Talk with ghosts", "ObserverInfo": "You can see all shield-animations", "DovesOfNeaceInfo": "Vent to reset kill cooldowns", "MonarchInfo": "Give your crew extra voting power!", @@ -648,7 +648,7 @@ "CharmedInfo": "You've been Charmed by the Cultist", "ContagiousInfo": " You've been Infected by the Virus", "BaitInfo": "Your killer self-reports your body", - "TrapperInfo": "Freeze your killer for a few seconds", + "BeartrapInfo": "Freeze your killer for a few seconds", "OnboundInfo": "You can't be guessed", "AsthmaticInfo": "You're Playing Stop And Go", "KnightedInfo": "You have an extra vote (from the Monarch)", @@ -708,7 +708,7 @@ "EscapistInfoLong": "(Impostors):\\nEscapist can mark a location by vanishing/petting, and they will be teleported to the marked location when they vanish/pet again (not when unshifting).", "WitchInfoLong": "(Impostors):\\nThe Witch can kill players directly or cast spells by tapping the kill button once or twice, respectively. Spelled players will have a 「†」 mark next to their name in the next meeting. If the Witch survives until the meeting's end, all spelled players die.", "NemesisInfoLong": "(Impostors):\\nNemesis can't kill while there are other Impostors alive in the game, but can use /rv [player id] after death to kill the specified player.", - "GodfatherInfoLong": "(Impostors):\\nAs a Godfather, you vote for someone to make them your target. In the next round if someone kills the target, the killer will turn into a refugee", + "GodfatherInfoLong": "(Impostors):\\nAs a Godfather, you vote for someone to make them your target. In the next round if someone kills the target, the killer will turn into a Renegade", "PuppeteerInfoLong": "(Impostors):\\nAs the Puppeteer, use your kill button to manipulate someone. After a certain time, they will kill the next player that approaches them.\\n\\nThere are a lot of settings for this role, which further varies its mechanics:\\n- You may be able to kill normally using double click.\\n- The manipulation may end after a certain time, even if the manipulated player didn't kill anyone.\\n- Lazy Guy and/or Lazy players may not be able to get manipulated.\\n- The manipulated player may even kill other impostors or the Puppeteer itself.\\n- The maximum times you can manipulate someone may be limited.\\n- You may die after using up all your puppets.\\n- Manipulated players may die along with their victim.", "TimeThiefInfoLong": "(Impostors):\\nEvery time the Time Thief kills a player, the meeting time will be reduced by a certain amount of time. If the Time Thief dies, the meeting time will return to normal.", "SniperInfoLong": "(Impostors):\\nIf you want to shoot players from a distance, you'll need to follow these steps. First, you must shapeshift or pet twice to make a successful snipe. Once you've done that, imagine an arrow pointing from your first shapeshift or petting location to your unshift or second petting location. That arrow will show you the direction in which the snipe will be made. Remember that the snipe only kills the first person in its path. Also, you won't be able to kill anyone normally until you use up all of your ammo.", @@ -749,7 +749,7 @@ "LurkerInfoLong": "(Impostors):\\nAs the Lurker, you can jump into a vent to reduce your cooldown by a certain number of seconds. After you kill, your cooldown is reset to its original value.", "ConvictInfoLong": "(Madmates):\\nAs the Convict, you now work for the Impostors.", "VisionaryInfoLong": "(Impostors):\\nAs the Visionary, you see the teams of players you revealed. You can reveal a player's alignment by selecting them as your shapeshifting target; if you have at least one ability, use left. You gain one ability to use after each kill you make.\\nThe name color of a revealed player will indicate their team (<#8cffff>Crewmate/<#ff1919>Impostor/<#ffab1b>Neutral/<#7b3fbb>Coven).", - "RefugeeInfoLong": "(Madmates):\\nAs the Renegade, help the Impostors win.", + "RenegadeInfoLong": "(Madmates):\\nAs the Renegade, help the Impostors win.", "UnderdogInfoLong": "(Add-ons):\\nAs the Underdog, your kill cooldown is longer until there's a certain amount of players alive. After that, your cooldown is shorter.", "ConsigliereInfoLong": "(Impostors):\\nAs the Consigliere, you can reveal the roles of other players using your kill button.\\n\\nSingle click: Reveal role\\nDouble click: Kill\\n\\nIf you run out of reveal uses, your kill button functions normally.", "LuckeyInfoLong": "(Crewmates):\\nThe Luckey has a probability of evading a player's kill attempt, set by the host. The killer sees a shield animation, but Luckey is unaware.", @@ -785,7 +785,7 @@ "GlitchInfoLong": "(Neutrals):\\nAs the Glitch, your goal is to kill everyone on the ship. You can hack players to prevent them from killing, venting, sabotaging, and reporting dead bodies for a limited time. You can also disguise as a random player for a limited time. Additionally, your cooldowns go down while in vents.", "JudgeInfoLong": "(Crewmates):\\nThe Judge can judge a player during the meeting. If the target is evil, it's killed; if it's wrong, the Judge dies. Use the /tl [player id] command to judge and /id to view player IDs. Judges can judge all players when they're Madmate.", "MorticianInfoLong": "(Crewmates):\\nWhen the Mortician reports a body, they will know the last player the victim had contact with. Note: Mortician won't be Oblivious or Seer.", - "MediumshiperInfoLong": "(Crewmates):\\nThe Medium can contact a dead player after they are reported. The dead player can answer once with a YES or NO to the Medium's question (using /ms yes or /ms no). The Medium won't be Oblivious.", + "MediumInfoLong": "(Crewmates):\\nThe Medium can contact a dead player after they are reported. The dead player can answer once with a YES or NO to the Medium's question (using /ms yes or /ms no). The Medium won't be Oblivious.", "ObserverInfoLong": "(Crewmates):\\nThe Observer can see all shield animations caused by other players after the first meeting.", "MonarchInfoLong": "(Crewmates):\\nAs the Monarch, you can knight players to give them an extra vote.\\n\\nYou cannot knight someone who already has extra votes.\\nKnighted players appear with a golden name.", "DovesOfNeaceInfoLong": "(Crewmates):\\nPacifist resets kill cooldown for all players with kill button on vent/pet. Madmate only works on Crewmates.", @@ -880,7 +880,7 @@ "NecroviewInfoLong": "(Add-ons):\\nThe Necroview can see the teams of dead players. The following info will be displayed on the dead player's name while in a meeting:\\n- The Red name indicates the Impostors.\\n- The Cyan name indicates the Crewmates.\\n- The Orange name indicates the Neutrals.", "ReachInfoLong": "(Add-on)\\nOnly roles with a kill button can get this add-on. You have the longest kill range possible in the game, unlike everyone else.", "BaitInfoLong": "(Add-ons):\\nThe Bait's murderer is required to self-report the body except when killed by a Scavenger or Cleaner. The report could be delayed based on the Host's settings.", - "TrapperInfoLong": "(Add-ons):\\nWhen Beartrap is killed, Beartrap immobilizes killer for a configurable amount of time.", + "BeartrapInfoLong": "(Add-ons):\\nWhen Beartrap is killed, Beartrap immobilizes killer for a configurable amount of time.", "CharmedInfoLong": "(Betrayal Add-ons):\\nThe Charmed add-on is obtained by being charmed by the Cultist. Once charmed, you are now on the Cultist's team and no longer on your original team.", "OnboundInfoLong": "(Add-ons):\\nWith the Onbound add-on, you cannot be guessed in meetings.", "KnightedInfoLong": "(Add-ons):\\nWhen a Monarch knights someone, they get an extra vote.", @@ -1518,7 +1518,7 @@ "GuessLovers": "Sorry, host's settings do not allow to guess Lovers.", "VanillaCrewmateCannotBeGuessed": "Crewmate role cannot be guessed", "GuessVanillaCrewmate": "Host settings don't allow to guess someone as the vanilla Crewmate", - "TrapperBlockMoveTime": "Freeze time", + "BeartrapBlockMoveTime": "Freeze time", "RogueKnowEachOtherRoles": "Rogues know the roles of each other", "RogueKnowEachOther": "Rogues know each other", "RoleChangedNotify": "<#ffff00>⚠ Your role was changed to {0} <#ffff00>⚠", @@ -1863,7 +1863,7 @@ "ImpostorKillMadmate": "Impostors cannot kill Madmates", "PenguinVictimKill": "As the victim of the Penguin/Goose, you cannot interact with others", "MathematicianProtected": "This player was the first to answer the Mathematician's question correctly,\\ntherefore they're shielded", - "RefugeeKillImpostor": "Renegades cannot kill Impostors", + "RenegadeKillImpostor": "Renegades cannot kill Impostors", "GAGuarded": "This player is shielded by the Guardian Angel", "TraitorKillImpostor": "As the Traitor, you cannot kill Impostors", "RookieKillRoundOne": "As a Rookie, you cannot kill in the first round", @@ -1878,8 +1878,8 @@ "HexButtonText": "Hex", "EscapistAbilityButtonText": "TP", "ObliviousBaitImmune": "Immune to Bait", - "MediumshiperContactLimit": "(Initial) Max number of contacts (ability uses)", - "MediumshiperOnlyReceiveMsgFromCrew": "Receive messages only from Crewmates (including Madmates and Charmed Players)", + "MediumContactLimit": "(Initial) Max number of contacts (ability uses)", + "MediumOnlyReceiveMsgFromCrew": "Receive messages only from Crewmates (including Madmates and Charmed Players)", "DovesOfNeaceCooldown": "Ability Cooldown", "DovesOfNeaceMaxOfUseage": "Max Number of Ability Uses", "CoronerArrowsPointingToDeadBody": "Arrows pointing to dead bodies", @@ -2235,7 +2235,7 @@ "GrenadierSkillStop": "Ability expired, {0} uses remain", "LighterSkillInUse": "Ability in use", "LighterSkillStop": "Ability expired", - "MediumshiperKnowPlayerDead": "Someone died somewhere", + "MediumKnowPlayerDead": "Someone died somewhere", "StealerGetTicket": "You've got +{0} votes", "BecomeMadmateCuzMadmateMode": "You became a Madmate because you died", "ExecutionerRoleChanged": "Your target died", @@ -3611,6 +3611,7 @@ "Thanos.ActiveStone": "<#00ffa5>Active Stone: {0}", "Thanos.MindStoneUsed": "<#00ff00>Mind Stone Active", "Thanos.StoneWaitingForUse": "<#00a5ff>{0} to activate/switch to the <#00ffff>{1} Stone", + "AbilityButtonText.Thanos": "Switch", "Swapster": "Swapster", "SwapsterInfo": "Swap Players", "SwapsterInfoLong": "(Impostors):\\nAs the Swapster, you can select 2 players using your shapeshift menu to swap them.", @@ -4348,9 +4349,9 @@ "EveryoneCanVent": "Everyone Can Vent", "OverrideOtherCrewBasedRoles": "Override Other Crew Based Roles to Engineer (not just regular Crewmate)", "WhackAMole": "Whack-A-Mole", - "SpawnAdditionalRefugeeOnImpsDead": "Random <#8cffff>Crewmate Turns To <#ff1919>Renegade When All <#ff1919>Impostors Die", - "SpawnAdditionalRefugeeWhenNKAlive": "Spawn Even If a <#ffab1b>Neutral Killer is Alive", - "SpawnAdditionalRefugeeMinAlivePlayers": "Minimum Number of Alive Players to Spawn", + "SpawnAdditionalRenegadeOnImpsDead": "Random <#8cffff>Crewmate Turns To <#ff1919>Renegade When All <#ff1919>Impostors Die", + "SpawnAdditionalRenegadeWhenNKAlive": "Spawn Even If a <#ffab1b>Neutral Killer is Alive", + "SpawnAdditionalRenegadeMinAlivePlayers": "Minimum Number of Alive Players to Spawn", "LobbyCloseTimer": "Lobby Closing Timer: {0}", "HorseMode": "Horse Mode", "LongMode": "Long Mode", @@ -9316,16 +9317,16 @@ "RG.Hit": "<#ffff00>The hit landed on one of your bullets!\\nBetter luck next time!", "RG.NoHit": "<#00ffa5>You survived, despite putting in <#8cffff>{0} bullets.\\nYour kill cooldown was reduced by <#8cffff>{1}s!", "RG.Suffix": "<#00ffa5>Bullets: {0}", - "Agitater": "Agitator", - "AgitaterInfo": "Pass a Bomb onto others", - "AgitaterInfoLong": "(Neutrals):\\nAs the Agitator, your premise is essentially Hot Potato.\\n\\nUse your kill button on a player to pass the bomb.\\nThis can only be done once per round.\\n\\nThe player who receives the bomb will be notified when receiving said bomb, in which they need to pass it to another player by getting near a player.\\n\\nWhen a meeting is called, the player with the bomb dies.\\n\\nIf trying to pass to Pestilence or a Veteran on alert, the bombed player dies instead.\\nOptionally, the Agitator cannot receive the bomb.", - "AgitaterBombCooldown": "Agitator bomb cooldown", - "AgitaterPassCooldown": "Bomb pass cooldown", + "Agitator": "Agitator", + "AgitatorInfo": "Pass a Bomb onto others", + "AgitatorInfoLong": "(Neutrals):\\nAs the Agitator, your premise is essentially Hot Potato.\\n\\nUse your kill button on a player to pass the bomb.\\nThis can only be done once per round.\\n\\nThe player who receives the bomb will be notified when receiving said bomb, in which they need to pass it to another player by getting near a player.\\n\\nWhen a meeting is called, the player with the bomb dies.\\n\\nIf trying to pass to Pestilence or a Veteran on alert, the bombed player dies instead.\\nOptionally, the Agitator cannot receive the bomb.", + "AgitatorBombCooldown": "Agitator bomb cooldown", + "AgitatorPassCooldown": "Bomb pass cooldown", "BombExplodeCooldown": "Bomb explode cooldown", - "AgitaterPassNotify": "Bomb successfully passed", - "AgitaterTargetNotify": "<#ffff00>YOU HAVE THE BOMB!!\\n<#ffa500>Pass it to someone else or die!", - "AgitaterCanGetBombed": "Agitator can get the bomb", - "AgitaterAutoReportBait": "Agitator Auto Report Bait", + "AgitatorPassNotify": "Bomb successfully passed", + "AgitatorTargetNotify": "<#ffff00>YOU HAVE THE BOMB!!\\n<#ffa500>Pass it to someone else or die!", + "AgitatorCanGetBombed": "Agitator can get the bomb", + "AgitatorAutoReportBait": "Agitator Auto Report Bait", "Exclusionary": "Exclusionary", "ExclusionaryInfo": "Exclude Players From The World", "ExclusionaryInfoLong": "(Impostors):\\nAs the Exclusionary, single click with your kill button on someone to exclude them (after a short delay). This will hide all players from them in their POV. Double click to kill normally.", @@ -9472,7 +9473,7 @@ "NumOfTasks": "Number of Tasks to Finish", "AmnesiacRoleBasis": "Role Basis", "RememberCooldown": "Remember Cooldown", - "RefugeeKillCD": "Renegade's Kill Cooldown", + "RenegadeKillCD": "Renegade's Kill Cooldown", "AmnesiacRemembered": "An Amnesiac remembered your role!", "AmnesiacInvalidTarget": "Remember failed", "RememberedCoven": "You remembered you were a Coven member!", @@ -10088,7 +10089,7 @@ "WinnerRoleText.Demon": "Demon Wins!", "WinnerRoleText.Stalker": "Stalker Wins!", "WinnerRoleText.Workaholic": "Workaholic Wins!", - "WinnerRoleText.Agitater": "Agitator Wins!", + "WinnerRoleText.Agitator": "Agitator Wins!", "WinnerRoleText.Collector": "Collector Wins!", "WinnerRoleText.BloodKnight": "Blood Knight Wins!", "WinnerRoleText.Poisoner": "Poisoner Wins!", diff --git a/Roles/AddOns/Common/Beartrap.cs b/Roles/AddOns/Common/Beartrap.cs new file mode 100644 index 000000000..8b492d99c --- /dev/null +++ b/Roles/AddOns/Common/Beartrap.cs @@ -0,0 +1,17 @@ +using static EHR.Options; + +namespace EHR.AddOns.Common; + +internal class Beartrap : IAddon +{ + public AddonTypes Type => AddonTypes.Mixed; + + public void SetupCustomOption() + { + SetupAdtRoleOptions(13800, CustomRoles.Beartrap, canSetNum: true, teamSpawnOptions: true); + + BeartrapBlockMoveTime = new FloatOptionItem(13813, "BeartrapBlockMoveTime", new(0f, 180f, 1f), 5f, TabGroup.Addons) + .SetParent(CustomRoleSpawnChances[CustomRoles.Beartrap]) + .SetValueFormat(OptionFormat.Seconds); + } +} \ No newline at end of file diff --git a/Roles/AddOns/Common/Trapper.cs b/Roles/AddOns/Common/Trapper.cs deleted file mode 100644 index 9a5342ae5..000000000 --- a/Roles/AddOns/Common/Trapper.cs +++ /dev/null @@ -1,17 +0,0 @@ -using static EHR.Options; - -namespace EHR.AddOns.Common; - -internal class Trapper : IAddon -{ - public AddonTypes Type => AddonTypes.Mixed; - - public void SetupCustomOption() - { - SetupAdtRoleOptions(13800, CustomRoles.Trapper, canSetNum: true, teamSpawnOptions: true); - - TrapperBlockMoveTime = new FloatOptionItem(13813, "TrapperBlockMoveTime", new(0f, 180f, 1f), 5f, TabGroup.Addons) - .SetParent(CustomRoleSpawnChances[CustomRoles.Trapper]) - .SetValueFormat(OptionFormat.Seconds); - } -} \ No newline at end of file diff --git a/Roles/Crewmate/Mediumshiper.cs b/Roles/Crewmate/Medium.cs similarity index 86% rename from Roles/Crewmate/Mediumshiper.cs rename to Roles/Crewmate/Medium.cs index 87854a2bd..f5eac4726 100644 --- a/Roles/Crewmate/Mediumshiper.cs +++ b/Roles/Crewmate/Medium.cs @@ -1,125 +1,125 @@ -using System.Collections.Generic; -using System.Linq; -using static EHR.Translator; - -namespace EHR.Crewmate; - -public class Mediumshiper : RoleBase -{ - private const int Id = 7200; - public static List PlayerIdList = []; - - private static OptionItem ContactLimitOpt; - public static OptionItem OnlyReceiveMsgFromCrew; - public static OptionItem MediumAbilityUseGainWithEachTaskCompleted; - public static OptionItem AbilityChargesWhenFinishedTasks; - - public static Dictionary ContactPlayer = []; - - public override bool IsEnable => PlayerIdList.Count > 0; - - public override void SetupCustomOption() - { - Options.SetupRoleOptions(Id, TabGroup.CrewmateRoles, CustomRoles.Mediumshiper); - - ContactLimitOpt = new IntegerOptionItem(Id + 10, "MediumshiperContactLimit", new(0, 15, 1), 1, TabGroup.CrewmateRoles) - .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Mediumshiper]) - .SetValueFormat(OptionFormat.Times); - - OnlyReceiveMsgFromCrew = new BooleanOptionItem(Id + 11, "MediumshiperOnlyReceiveMsgFromCrew", true, TabGroup.CrewmateRoles) - .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Mediumshiper]); - - MediumAbilityUseGainWithEachTaskCompleted = new FloatOptionItem(Id + 12, "AbilityUseGainWithEachTaskCompleted", new(0f, 5f, 0.05f), 1f, TabGroup.CrewmateRoles) - .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Mediumshiper]) - .SetValueFormat(OptionFormat.Times); - - AbilityChargesWhenFinishedTasks = new FloatOptionItem(Id + 13, "AbilityChargesWhenFinishedTasks", new(0f, 5f, 0.05f), 0.2f, TabGroup.CrewmateRoles) - .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Mediumshiper]) - .SetValueFormat(OptionFormat.Times); - } - - public override void Init() - { - PlayerIdList = []; - ContactPlayer = []; - } - - public override void Add(byte playerId) - { - PlayerIdList.Add(playerId); - playerId.SetAbilityUseLimit(ContactLimitOpt.GetFloat()); - } - - public override void Remove(byte playerId) - { - PlayerIdList.Remove(playerId); - } - - public static void OnReportDeadBody(NetworkedPlayerInfo target) - { - ContactPlayer = []; - if (target == null || target.Object == null) return; - - foreach (PlayerControl pc in Main.AllAlivePlayerControls.Where(x => PlayerIdList.Contains(x.PlayerId) && x.PlayerId != target.PlayerId).ToArray()) - { - if (pc.GetAbilityUseLimit() < 1) continue; - - pc.RpcRemoveAbilityUse(); - ContactPlayer.TryAdd(target.PlayerId, pc.PlayerId); - Logger.Info($"Medium Connection: {pc.GetNameWithRole().RemoveHtmlTags()} => {target.PlayerName}", "Mediumshiper"); - } - } - - public static bool MsMsg(PlayerControl pc, string msg) - { - if (!AmongUsClient.Instance.AmHost) return false; - - if (!GameStates.IsMeeting || pc == null) return false; - - if (!ContactPlayer.ContainsKey(pc.PlayerId)) return false; - - if (OnlyReceiveMsgFromCrew.GetBool() && !pc.IsCrewmate()) return false; - - if (pc.IsAlive()) return false; - - msg = msg.ToLower().Trim(); - if (!CheckCommand(ref msg, "通灵|ms|mediumship|medium", false)) return false; - - bool ans; - - if (msg.Contains('n') || msg.Contains(GetString("No")) || msg.Contains('错') || msg.Contains("不是")) - ans = false; - else if (msg.Contains('y') || msg.Contains(GetString("Yes")) || msg.Contains('对')) - ans = true; - else - { - Utils.SendMessage(GetString("MediumshipHelp"), pc.PlayerId); - return true; - } - - Utils.SendMessage(GetString("Mediumship" + (ans ? "Yes" : "No")), ContactPlayer[pc.PlayerId], Utils.ColorString(Utils.GetRoleColor(CustomRoles.Mediumshiper), GetString("MediumshipTitle"))); - Utils.SendMessage(GetString("MediumshipDone"), pc.PlayerId, Utils.ColorString(Utils.GetRoleColor(CustomRoles.Mediumshiper), GetString("MediumshipTitle"))); - - ContactPlayer.Remove(pc.PlayerId); - - return true; - } - - private static bool CheckCommand(ref string msg, string command, bool exact = true) - { - string[] comList = command.Split('|'); - - foreach (string str in comList) - { - if (exact && msg == "/" + str) return true; - - if (msg.StartsWith("/" + str)) - { - msg = msg.Replace("/" + str, string.Empty); - return true; - } - } - - return false; - } +using System.Collections.Generic; +using System.Linq; +using static EHR.Translator; + +namespace EHR.Crewmate; + +public class Medium : RoleBase +{ + private const int Id = 7200; + public static List PlayerIdList = []; + + private static OptionItem ContactLimitOpt; + public static OptionItem OnlyReceiveMsgFromCrew; + public static OptionItem MediumAbilityUseGainWithEachTaskCompleted; + public static OptionItem AbilityChargesWhenFinishedTasks; + + public static Dictionary ContactPlayer = []; + + public override bool IsEnable => PlayerIdList.Count > 0; + + public override void SetupCustomOption() + { + Options.SetupRoleOptions(Id, TabGroup.CrewmateRoles, CustomRoles.Medium); + + ContactLimitOpt = new IntegerOptionItem(Id + 10, "MediumContactLimit", new(0, 15, 1), 1, TabGroup.CrewmateRoles) + .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Medium]) + .SetValueFormat(OptionFormat.Times); + + OnlyReceiveMsgFromCrew = new BooleanOptionItem(Id + 11, "MediumOnlyReceiveMsgFromCrew", true, TabGroup.CrewmateRoles) + .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Medium]); + + MediumAbilityUseGainWithEachTaskCompleted = new FloatOptionItem(Id + 12, "AbilityUseGainWithEachTaskCompleted", new(0f, 5f, 0.05f), 1f, TabGroup.CrewmateRoles) + .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Medium]) + .SetValueFormat(OptionFormat.Times); + + AbilityChargesWhenFinishedTasks = new FloatOptionItem(Id + 13, "AbilityChargesWhenFinishedTasks", new(0f, 5f, 0.05f), 0.2f, TabGroup.CrewmateRoles) + .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Medium]) + .SetValueFormat(OptionFormat.Times); + } + + public override void Init() + { + PlayerIdList = []; + ContactPlayer = []; + } + + public override void Add(byte playerId) + { + PlayerIdList.Add(playerId); + playerId.SetAbilityUseLimit(ContactLimitOpt.GetFloat()); + } + + public override void Remove(byte playerId) + { + PlayerIdList.Remove(playerId); + } + + public static void OnReportDeadBody(NetworkedPlayerInfo target) + { + ContactPlayer = []; + if (target == null || target.Object == null) return; + + foreach (PlayerControl pc in Main.AllAlivePlayerControls.Where(x => PlayerIdList.Contains(x.PlayerId) && x.PlayerId != target.PlayerId).ToArray()) + { + if (pc.GetAbilityUseLimit() < 1) continue; + + pc.RpcRemoveAbilityUse(); + ContactPlayer.TryAdd(target.PlayerId, pc.PlayerId); + Logger.Info($"Medium Connection: {pc.GetNameWithRole().RemoveHtmlTags()} => {target.PlayerName}", "Medium"); + } + } + + public static bool MsMsg(PlayerControl pc, string msg) + { + if (!AmongUsClient.Instance.AmHost) return false; + + if (!GameStates.IsMeeting || pc == null) return false; + + if (!ContactPlayer.ContainsKey(pc.PlayerId)) return false; + + if (OnlyReceiveMsgFromCrew.GetBool() && !pc.IsCrewmate()) return false; + + if (pc.IsAlive()) return false; + + msg = msg.ToLower().Trim(); + if (!CheckCommand(ref msg, "通灵|ms|mediumship|medium", false)) return false; + + bool ans; + + if (msg.Contains('n') || msg.Contains(GetString("No")) || msg.Contains('错') || msg.Contains("不是")) + ans = false; + else if (msg.Contains('y') || msg.Contains(GetString("Yes")) || msg.Contains('对')) + ans = true; + else + { + Utils.SendMessage(GetString("MediumshipHelp"), pc.PlayerId); + return true; + } + + Utils.SendMessage(GetString("Mediumship" + (ans ? "Yes" : "No")), ContactPlayer[pc.PlayerId], Utils.ColorString(Utils.GetRoleColor(CustomRoles.Medium), GetString("MediumshipTitle"))); + Utils.SendMessage(GetString("MediumshipDone"), pc.PlayerId, Utils.ColorString(Utils.GetRoleColor(CustomRoles.Medium), GetString("MediumshipTitle"))); + + ContactPlayer.Remove(pc.PlayerId); + + return true; + } + + private static bool CheckCommand(ref string msg, string command, bool exact = true) + { + string[] comList = command.Split('|'); + + foreach (string str in comList) + { + if (exact && msg == "/" + str) return true; + + if (msg.StartsWith("/" + str)) + { + msg = msg.Replace("/" + str, string.Empty); + return true; + } + } + + return false; + } } \ No newline at end of file diff --git a/Roles/Impostor/Occultist.cs b/Roles/Impostor/Occultist.cs index 0b2981614..eb7315259 100644 --- a/Roles/Impostor/Occultist.cs +++ b/Roles/Impostor/Occultist.cs @@ -129,7 +129,7 @@ public class Occultist : RoleBase switch (player.GetCustomSubRoles().FindFirst(x => x.IsConverted(), out CustomRoles convertedAddon)) { case false when !player.Is(Team.Impostor): - player.RpcSetCustomRole(RevivedPlayers.GetValue() == 0 ? CustomRoles.Refugee : CustomRoles.Madmate); + player.RpcSetCustomRole(RevivedPlayers.GetValue() == 0 ? CustomRoles.Renegade : CustomRoles.Madmate); break; case true: player.RpcSetCustomRole(convertedAddon); diff --git a/Roles/Impostor/Refugee.cs b/Roles/Impostor/Renegade.cs similarity index 84% rename from Roles/Impostor/Refugee.cs rename to Roles/Impostor/Renegade.cs index 3c3941916..3134b53a6 100644 --- a/Roles/Impostor/Refugee.cs +++ b/Roles/Impostor/Renegade.cs @@ -2,7 +2,7 @@ namespace EHR.Impostor; -internal class Refugee : RoleBase +internal class Renegade : RoleBase { public static bool On; public override bool IsEnable => On; @@ -21,7 +21,7 @@ internal class Refugee : RoleBase public override void SetKillCooldown(byte id) { - Main.AllPlayerKillCooldown[id] = Options.RefugeeKillCD.GetFloat(); + Main.AllPlayerKillCooldown[id] = Options.RenegadeKillCD.GetFloat(); } public override void ApplyGameOptions(IGameOptions opt, byte playerId) diff --git a/Roles/Impostor/Vampire.cs b/Roles/Impostor/Vampire.cs index 5fdbea116..630646d3f 100644 --- a/Roles/Impostor/Vampire.cs +++ b/Roles/Impostor/Vampire.cs @@ -152,7 +152,7 @@ public class Vampire : RoleBase if (!meeting && vampire.IsAlive()) { - if (target.Is(CustomRoles.Trapper)) vampire.TrapperKilled(target); + if (target.Is(CustomRoles.Beartrap)) vampire.BeartrapKilled(target); vampire.Notify(GetString("VampireTargetDead")); } } diff --git a/Roles/Neutral/Agitater.cs b/Roles/Neutral/Agitator.cs similarity index 77% rename from Roles/Neutral/Agitater.cs rename to Roles/Neutral/Agitator.cs index 318744a1a..f33be5065 100644 --- a/Roles/Neutral/Agitater.cs +++ b/Roles/Neutral/Agitator.cs @@ -1,262 +1,262 @@ -using System.Collections.Generic; -using System.Linq; -using AmongUs.GameOptions; -using EHR.Crewmate; -using EHR.Modules; -using Hazel; -using UnityEngine; -using static EHR.Translator; - -namespace EHR.Neutral; - -public class Agitater : RoleBase -{ - private const int Id = 12420; - private static List PlayerIdList = []; - - private static OptionItem BombExplodeCooldown; - private static OptionItem PassCooldown; - private static OptionItem AgitaterCanGetBombed; - private static OptionItem AgiTaterBombCooldown; - private static OptionItem AgitaterAutoReportBait; - private static OptionItem HasImpostorVision; - private bool AgitaterHasBombed; - private byte AgitaterId; - - private byte CurrentBombedPlayer = byte.MaxValue; - private long CurrentBombedPlayerTime; - private byte LastBombedPlayer = byte.MaxValue; - - public override bool IsEnable => PlayerIdList.Count > 0 || Randomizer.Exists; - - public override void SetupCustomOption() - { - Options.SetupRoleOptions(Id, TabGroup.NeutralRoles, CustomRoles.Agitater); - - AgiTaterBombCooldown = new FloatOptionItem(Id + 10, "AgitaterBombCooldown", new(10f, 180f, 0.5f), 20f, TabGroup.NeutralRoles) - .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Agitater]) - .SetValueFormat(OptionFormat.Seconds); - - PassCooldown = new FloatOptionItem(Id + 11, "AgitaterPassCooldown", new(0f, 5f, 0.25f), 2f, TabGroup.NeutralRoles) - .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Agitater]) - .SetValueFormat(OptionFormat.Seconds); - - BombExplodeCooldown = new FloatOptionItem(Id + 12, "BombExplodeCooldown", new(1f, 60f, 1f), 15f, TabGroup.NeutralRoles) - .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Agitater]) - .SetValueFormat(OptionFormat.Seconds); - - AgitaterCanGetBombed = new BooleanOptionItem(Id + 13, "AgitaterCanGetBombed", false, TabGroup.NeutralRoles) - .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Agitater]); - - AgitaterAutoReportBait = new BooleanOptionItem(Id + 14, "AgitaterAutoReportBait", true, TabGroup.NeutralRoles) - .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Agitater]); - - HasImpostorVision = new BooleanOptionItem(Id + 15, "ImpostorVision", true, TabGroup.NeutralRoles) - .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Agitater]); - } - - public override void Init() - { - PlayerIdList = []; - CurrentBombedPlayer = byte.MaxValue; - LastBombedPlayer = byte.MaxValue; - AgitaterHasBombed = false; - CurrentBombedPlayerTime = 0; - AgitaterId = byte.MaxValue; - } - - public override void Add(byte playerId) - { - PlayerIdList.Add(playerId); - AgitaterId = playerId; - - CurrentBombedPlayer = byte.MaxValue; - LastBombedPlayer = byte.MaxValue; - AgitaterHasBombed = false; - CurrentBombedPlayerTime = 0; - } - - public override void Remove(byte playerId) - { - PlayerIdList.Remove(playerId); - } - - private void ResetBomb() - { - CurrentBombedPlayer = byte.MaxValue; - CurrentBombedPlayerTime = 0; - LastBombedPlayer = byte.MaxValue; - AgitaterHasBombed = false; - SendRPC(CurrentBombedPlayer, LastBombedPlayer); - } - - public override void SetKillCooldown(byte id) - { - Main.AllPlayerKillCooldown[id] = AgiTaterBombCooldown.GetFloat(); - } - - public override void ApplyGameOptions(IGameOptions opt, byte id) - { - opt.SetVision(HasImpostorVision.GetBool()); - } - - public override bool OnCheckMurder(PlayerControl killer, PlayerControl target) - { - if (!IsEnable) return false; - - if (AgitaterAutoReportBait.GetBool() && target.Is(CustomRoles.Bait)) return true; - - if (target.Is(CustomRoles.Pestilence) || (target.Is(CustomRoles.Veteran) && Veteran.VeteranInProtect.ContainsKey(target.PlayerId))) - { - target.Kill(killer); - ResetBomb(); - - if (target.AmOwner) - Achievements.Type.YoureTooLate.Complete(); - - return false; - } - - CurrentBombedPlayer = target.PlayerId; - LastBombedPlayer = killer.PlayerId; - CurrentBombedPlayerTime = Utils.TimeStamp; - var sender = CustomRpcSender.Create("Agitater.OnCheckMurder", SendOption.Reliable); - var hasValue = false; - hasValue |= sender.RpcGuardAndKill(killer, killer); - hasValue |= sender.Notify(killer, GetString("AgitaterPassNotify")); - killer.ResetKillCooldown(); - hasValue |= sender.SetKillCooldown(killer); - hasValue |= sender.Notify(target, GetString("AgitaterTargetNotify")); - AgitaterHasBombed = true; - sender.SendMessage(!hasValue); - - LateTask.New(() => - { - if (CurrentBombedPlayer != byte.MaxValue && GameStates.IsInTask) - { - PlayerControl pc = Utils.GetPlayerById(CurrentBombedPlayer); - - // ReSharper disable once ConditionIsAlwaysTrueOrFalse - if (pc != null && pc.IsAlive() && killer != null) // Can be null since it's a late task - { - pc.Suicide(PlayerState.DeathReason.Bombed, Utils.GetPlayerById(PlayerIdList[0])); - Logger.Info($"{killer.GetNameWithRole().RemoveHtmlTags()} bombed {pc.GetNameWithRole().RemoveHtmlTags()}, bomb cd complete", "Agitater"); - ResetBomb(); - - if (pc.AmOwner) - Achievements.Type.OutOfTime.Complete(); - } - } - }, BombExplodeCooldown.GetFloat(), "AgitaterBombKill"); - - return false; - } - - public override void OnReportDeadBody() - { - if (!IsEnable) return; - - if (CurrentBombedPlayer == byte.MaxValue) return; - - PlayerControl target = Utils.GetPlayerById(CurrentBombedPlayer); - PlayerControl killer = Utils.GetPlayerById(PlayerIdList[0]); - if (target == null || killer == null || target.Is(CustomRoles.Pestilence)) return; - - target.RpcExileV2(); - target.SetRealKiller(killer); - Main.PlayerStates[CurrentBombedPlayer].deathReason = PlayerState.DeathReason.Bombed; - Main.PlayerStates[CurrentBombedPlayer].SetDead(); - Utils.AfterPlayerDeathTasks(target, true); - ResetBomb(); - Logger.Info($"{killer.GetRealName()} bombed {target.GetRealName()} on report", "Agitater"); - } - - public override void OnGlobalFixedUpdate(PlayerControl player, bool lowLoad) - { - byte playerId = player.PlayerId; - - if (!lowLoad && GameStates.IsInTask && IsEnable && AgitaterHasBombed && CurrentBombedPlayer == playerId) - { - if (!player.IsAlive()) - ResetBomb(); - else - { - Vector2 agitaterPos = player.Pos(); - Dictionary targetDistance = []; - - foreach (PlayerControl target in PlayerControl.AllPlayerControls) - { - if (!target.IsAlive()) continue; - - if (target.PlayerId != playerId && target.PlayerId != LastBombedPlayer && target.IsAlive()) - { - float dis = Vector2.Distance(agitaterPos, player.Pos()); - targetDistance[target.PlayerId] = dis; - } - } - - if (targetDistance.Count > 0) - { - KeyValuePair min = targetDistance.OrderBy(c => c.Value).FirstOrDefault(); - PlayerControl target = Utils.GetPlayerById(min.Key); - float KillRange = NormalGameOptionsV10.KillDistances[Mathf.Clamp(GameOptionsManager.Instance.currentNormalGameOptions.KillDistance, 0, 2)]; - if (min.Value <= KillRange && player.CanMove && target.CanMove) PassBomb(player, target); - } - } - } - } - - private void PassBomb(PlayerControl player, PlayerControl target /*, bool IsAgitater = false*/) - { - if (!IsEnable) return; - if (!AgitaterHasBombed) return; - if (!target.IsAlive()) return; - - long now = Utils.TimeStamp; - if (now - CurrentBombedPlayerTime < PassCooldown.GetFloat()) return; - if (target.PlayerId == LastBombedPlayer) return; - if (!AgitaterCanGetBombed.GetBool() && target.Is(CustomRoles.Agitater)) return; - - if (target.Is(CustomRoles.Pestilence) || (target.Is(CustomRoles.Veteran) && Veteran.VeteranInProtect.ContainsKey(target.PlayerId))) - { - target.Kill(player); - ResetBomb(); - - if (target.AmOwner) - Achievements.Type.YoureTooLate.Complete(); - - return; - } - - LastBombedPlayer = CurrentBombedPlayer; - CurrentBombedPlayer = target.PlayerId; - CurrentBombedPlayerTime = now; - - player.MarkDirtySettings(); - target.MarkDirtySettings(); - - player.Notify(GetString("AgitaterPassNotify")); - target.Notify(GetString("AgitaterTargetNotify")); - - SendRPC(CurrentBombedPlayer, LastBombedPlayer); - Logger.Msg($"{player.GetNameWithRole().RemoveHtmlTags()} passed bomb to {target.GetNameWithRole().RemoveHtmlTags()}", "Agitater Pass"); - } - - private void SendRPC(byte newbomb, byte oldbomb) - { - MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.RpcPassBomb, SendOption.Reliable); - writer.Write(AgitaterId); - writer.Write(newbomb); - writer.Write(oldbomb); - AmongUsClient.Instance.FinishRpcImmediately(writer); - } - - public static void ReceiveRPC(MessageReader reader) - { - byte agitaterId = reader.ReadByte(); - if (Main.PlayerStates[agitaterId].Role is not Agitater at) return; - - at.CurrentBombedPlayer = reader.ReadByte(); - at.LastBombedPlayer = reader.ReadByte(); - } +using System.Collections.Generic; +using System.Linq; +using AmongUs.GameOptions; +using EHR.Crewmate; +using EHR.Modules; +using Hazel; +using UnityEngine; +using static EHR.Translator; + +namespace EHR.Neutral; + +public class Agitator : RoleBase +{ + private const int Id = 12420; + private static List PlayerIdList = []; + + private static OptionItem BombExplodeCooldown; + private static OptionItem PassCooldown; + private static OptionItem AgitatorCanGetBombed; + private static OptionItem AgitatorBombCooldown; + private static OptionItem AgitatorAutoReportBait; + private static OptionItem HasImpostorVision; + private bool AgitatorHasBombed; + private byte AgitatorId; + + private byte CurrentBombedPlayer = byte.MaxValue; + private long CurrentBombedPlayerTime; + private byte LastBombedPlayer = byte.MaxValue; + + public override bool IsEnable => PlayerIdList.Count > 0 || Randomizer.Exists; + + public override void SetupCustomOption() + { + Options.SetupRoleOptions(Id, TabGroup.NeutralRoles, CustomRoles.Agitator); + + AgitatorBombCooldown = new FloatOptionItem(Id + 10, "AgitatorBombCooldown", new(10f, 180f, 0.5f), 20f, TabGroup.NeutralRoles) + .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Agitator]) + .SetValueFormat(OptionFormat.Seconds); + + PassCooldown = new FloatOptionItem(Id + 11, "AgitatorPassCooldown", new(0f, 5f, 0.25f), 2f, TabGroup.NeutralRoles) + .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Agitator]) + .SetValueFormat(OptionFormat.Seconds); + + BombExplodeCooldown = new FloatOptionItem(Id + 12, "BombExplodeCooldown", new(1f, 60f, 1f), 15f, TabGroup.NeutralRoles) + .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Agitator]) + .SetValueFormat(OptionFormat.Seconds); + + AgitatorCanGetBombed = new BooleanOptionItem(Id + 13, "AgitatorCanGetBombed", false, TabGroup.NeutralRoles) + .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Agitator]); + + AgitatorAutoReportBait = new BooleanOptionItem(Id + 14, "AgitatorAutoReportBait", true, TabGroup.NeutralRoles) + .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Agitator]); + + HasImpostorVision = new BooleanOptionItem(Id + 15, "ImpostorVision", true, TabGroup.NeutralRoles) + .SetParent(Options.CustomRoleSpawnChances[CustomRoles.Agitator]); + } + + public override void Init() + { + PlayerIdList = []; + CurrentBombedPlayer = byte.MaxValue; + LastBombedPlayer = byte.MaxValue; + AgitatorHasBombed = false; + CurrentBombedPlayerTime = 0; + AgitatorId = byte.MaxValue; + } + + public override void Add(byte playerId) + { + PlayerIdList.Add(playerId); + AgitatorId = playerId; + + CurrentBombedPlayer = byte.MaxValue; + LastBombedPlayer = byte.MaxValue; + AgitatorHasBombed = false; + CurrentBombedPlayerTime = 0; + } + + public override void Remove(byte playerId) + { + PlayerIdList.Remove(playerId); + } + + private void ResetBomb() + { + CurrentBombedPlayer = byte.MaxValue; + CurrentBombedPlayerTime = 0; + LastBombedPlayer = byte.MaxValue; + AgitatorHasBombed = false; + SendRPC(CurrentBombedPlayer, LastBombedPlayer); + } + + public override void SetKillCooldown(byte id) + { + Main.AllPlayerKillCooldown[id] = AgitatorBombCooldown.GetFloat(); + } + + public override void ApplyGameOptions(IGameOptions opt, byte id) + { + opt.SetVision(HasImpostorVision.GetBool()); + } + + public override bool OnCheckMurder(PlayerControl killer, PlayerControl target) + { + if (!IsEnable) return false; + + if (AgitatorAutoReportBait.GetBool() && target.Is(CustomRoles.Bait)) return true; + + if (target.Is(CustomRoles.Pestilence) || (target.Is(CustomRoles.Veteran) && Veteran.VeteranInProtect.ContainsKey(target.PlayerId))) + { + target.Kill(killer); + ResetBomb(); + + if (target.AmOwner) + Achievements.Type.YoureTooLate.Complete(); + + return false; + } + + CurrentBombedPlayer = target.PlayerId; + LastBombedPlayer = killer.PlayerId; + CurrentBombedPlayerTime = Utils.TimeStamp; + var sender = CustomRpcSender.Create("Agitator.OnCheckMurder", SendOption.Reliable); + var hasValue = false; + hasValue |= sender.RpcGuardAndKill(killer, killer); + hasValue |= sender.Notify(killer, GetString("AgitatorPassNotify")); + killer.ResetKillCooldown(); + hasValue |= sender.SetKillCooldown(killer); + hasValue |= sender.Notify(target, GetString("AgitatorTargetNotify")); + AgitatorHasBombed = true; + sender.SendMessage(!hasValue); + + LateTask.New(() => + { + if (CurrentBombedPlayer != byte.MaxValue && GameStates.IsInTask) + { + PlayerControl pc = Utils.GetPlayerById(CurrentBombedPlayer); + + // ReSharper disable once ConditionIsAlwaysTrueOrFalse + if (pc != null && pc.IsAlive() && killer != null) // Can be null since it's a late task + { + pc.Suicide(PlayerState.DeathReason.Bombed, Utils.GetPlayerById(PlayerIdList[0])); + Logger.Info($"{killer.GetNameWithRole().RemoveHtmlTags()} bombed {pc.GetNameWithRole().RemoveHtmlTags()}, bomb cd complete", "Agitator"); + ResetBomb(); + + if (pc.AmOwner) + Achievements.Type.OutOfTime.Complete(); + } + } + }, BombExplodeCooldown.GetFloat(), "AgitatorBombKill"); + + return false; + } + + public override void OnReportDeadBody() + { + if (!IsEnable) return; + + if (CurrentBombedPlayer == byte.MaxValue) return; + + PlayerControl target = Utils.GetPlayerById(CurrentBombedPlayer); + PlayerControl killer = Utils.GetPlayerById(PlayerIdList[0]); + if (target == null || killer == null || target.Is(CustomRoles.Pestilence)) return; + + target.RpcExileV2(); + target.SetRealKiller(killer); + Main.PlayerStates[CurrentBombedPlayer].deathReason = PlayerState.DeathReason.Bombed; + Main.PlayerStates[CurrentBombedPlayer].SetDead(); + Utils.AfterPlayerDeathTasks(target, true); + ResetBomb(); + Logger.Info($"{killer.GetRealName()} bombed {target.GetRealName()} on report", "Agitator"); + } + + public override void OnGlobalFixedUpdate(PlayerControl player, bool lowLoad) + { + byte playerId = player.PlayerId; + + if (!lowLoad && GameStates.IsInTask && IsEnable && AgitatorHasBombed && CurrentBombedPlayer == playerId) + { + if (!player.IsAlive()) + ResetBomb(); + else + { + Vector2 agitatorPos = player.Pos(); + Dictionary targetDistance = []; + + foreach (PlayerControl target in PlayerControl.AllPlayerControls) + { + if (!target.IsAlive()) continue; + + if (target.PlayerId != playerId && target.PlayerId != LastBombedPlayer && target.IsAlive()) + { + float dis = Vector2.Distance(agitatorPos, player.Pos()); + targetDistance[target.PlayerId] = dis; + } + } + + if (targetDistance.Count > 0) + { + KeyValuePair min = targetDistance.OrderBy(c => c.Value).FirstOrDefault(); + PlayerControl target = Utils.GetPlayerById(min.Key); + float KillRange = NormalGameOptionsV10.KillDistances[Mathf.Clamp(GameOptionsManager.Instance.currentNormalGameOptions.KillDistance, 0, 2)]; + if (min.Value <= KillRange && player.CanMove && target.CanMove) PassBomb(player, target); + } + } + } + } + + private void PassBomb(PlayerControl player, PlayerControl target /*, bool IsAgitator = false*/) + { + if (!IsEnable) return; + if (!AgitatorHasBombed) return; + if (!target.IsAlive()) return; + + long now = Utils.TimeStamp; + if (now - CurrentBombedPlayerTime < PassCooldown.GetFloat()) return; + if (target.PlayerId == LastBombedPlayer) return; + if (!AgitatorCanGetBombed.GetBool() && target.Is(CustomRoles.Agitator)) return; + + if (target.Is(CustomRoles.Pestilence) || (target.Is(CustomRoles.Veteran) && Veteran.VeteranInProtect.ContainsKey(target.PlayerId))) + { + target.Kill(player); + ResetBomb(); + + if (target.AmOwner) + Achievements.Type.YoureTooLate.Complete(); + + return; + } + + LastBombedPlayer = CurrentBombedPlayer; + CurrentBombedPlayer = target.PlayerId; + CurrentBombedPlayerTime = now; + + player.MarkDirtySettings(); + target.MarkDirtySettings(); + + player.Notify(GetString("AgitatorPassNotify")); + target.Notify(GetString("AgitatorTargetNotify")); + + SendRPC(CurrentBombedPlayer, LastBombedPlayer); + Logger.Msg($"{player.GetNameWithRole().RemoveHtmlTags()} passed bomb to {target.GetNameWithRole().RemoveHtmlTags()}", "Agitator Pass"); + } + + private void SendRPC(byte newbomb, byte oldbomb) + { + MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.RpcPassBomb, SendOption.Reliable); + writer.Write(AgitatorId); + writer.Write(newbomb); + writer.Write(oldbomb); + AmongUsClient.Instance.FinishRpcImmediately(writer); + } + + public static void ReceiveRPC(MessageReader reader) + { + byte agitatorId = reader.ReadByte(); + if (Main.PlayerStates[agitatorId].Role is not Agitator at) return; + + at.CurrentBombedPlayer = reader.ReadByte(); + at.LastBombedPlayer = reader.ReadByte(); + } } \ No newline at end of file diff --git a/Roles/Neutral/Amnesiac.cs b/Roles/Neutral/Amnesiac.cs index 64938e640..547ca6ccd 100644 --- a/Roles/Neutral/Amnesiac.cs +++ b/Roles/Neutral/Amnesiac.cs @@ -186,14 +186,14 @@ public class Amnesiac : RoleBase amneNotifyString = Utils.ColorString(Utils.GetRoleColor(CustomRoles.Amnesiac), GetString("RememberedCrewmate")); break; case CustomRoles.LovingImpostor: - RememberedRole = CustomRoles.Refugee; + RememberedRole = CustomRoles.Renegade; amneNotifyString = Utils.ColorString(Utils.GetRoleColor(CustomRoles.Amnesiac), GetString("RememberedImpostor")); break; default: switch (target.GetTeam()) { case Team.Impostor: - RememberedRole = SingleRoles.Contains(targetRole) ? CustomRoles.Refugee : targetRole; + RememberedRole = SingleRoles.Contains(targetRole) ? CustomRoles.Renegade : targetRole; amneNotifyString = Utils.ColorString(Utils.GetRoleColor(CustomRoles.Amnesiac), GetString("RememberedImpostor")); break; case Team.Crewmate: diff --git a/Roles/Neutral/Hater.cs b/Roles/Neutral/Hater.cs index 7c897b3e0..a8fa64228 100644 --- a/Roles/Neutral/Hater.cs +++ b/Roles/Neutral/Hater.cs @@ -138,7 +138,7 @@ public class Hater : RoleBase CustomRoles.Cultist or CustomRoles.Deathknight or CustomRoles.Necromancer or - CustomRoles.Refugee or + CustomRoles.Renegade or CustomRoles.Romantic or CustomRoles.RuthlessRomantic or CustomRoles.VengefulRomantic or diff --git a/Roles/Neutral/Mycologist.cs b/Roles/Neutral/Mycologist.cs index bbefd7042..82736a407 100644 --- a/Roles/Neutral/Mycologist.cs +++ b/Roles/Neutral/Mycologist.cs @@ -16,7 +16,7 @@ internal class Mycologist : RoleBase "VentButtonText", // 0 "SabotageButtonText", // 1 "PetButtonText", // 2 - "AbilityButtonText.Specter", // 3 + "Vanish", // 3 "AbilityButtonText.Shapeshifter" // 4 ]; diff --git a/Roles/Neutral/Romantic.cs b/Roles/Neutral/Romantic.cs index 88c18eb73..327631cb0 100644 --- a/Roles/Neutral/Romantic.cs +++ b/Roles/Neutral/Romantic.cs @@ -297,10 +297,10 @@ public class Romantic : RoleBase Logger.Info($"Converting Romantic Partner Died ({Partner.GetNameWithRole()}) => Romantic becomes their ally ({RomanticPC.GetNameWithRole()})", "Romantic"); } - else if (Partner.Is(Team.Impostor)) // If Partner is Imp, Romantic joins the imp team as Refugee + else if (Partner.Is(Team.Impostor)) // If Partner is Imp, Romantic joins the imp team as Renegade { - Logger.Info($"Impostor Romantic Partner Died => Changing {RomanticPC.GetNameWithRole()} to Refugee", "Romantic"); - RomanticPC.RpcSetCustomRole(CustomRoles.Refugee); + Logger.Info($"Impostor Romantic Partner Died => Changing {RomanticPC.GetNameWithRole()} to Renegade", "Romantic"); + RomanticPC.RpcSetCustomRole(CustomRoles.Renegade); } else if (Partner.HasKillButton() || partnerRole.IsNK() || partnerRole.GetDYRole() is RoleTypes.Impostor or RoleTypes.Shapeshifter or RoleTypes.Phantom) // If the Partner has a kill button (NK or CK), Romantic becomes the role they were { diff --git a/Roles/Neutral/SchrodingersCat.cs b/Roles/Neutral/SchrodingersCat.cs index eb138cf13..1b8d55ffe 100644 --- a/Roles/Neutral/SchrodingersCat.cs +++ b/Roles/Neutral/SchrodingersCat.cs @@ -36,7 +36,7 @@ internal class SchrodingersCat : RoleBase { CustomRoles killerRole = killer.GetCustomRole(); - if (!StealsExactImpostorRole.GetBool() && (killerRole.IsImpostor() || killerRole.IsMadmate())) killerRole = CustomRoles.Refugee; + if (!StealsExactImpostorRole.GetBool() && (killerRole.IsImpostor() || killerRole.IsMadmate())) killerRole = CustomRoles.Renegade; if (killerRole == CustomRoles.Jackal) killerRole = CustomRoles.Sidekick; if (Options.SingleRoles.Contains(killerRole)) killerRole = CustomRoles.Amnesiac; diff --git a/Roles/Neutral/Thanos.cs b/Roles/Neutral/Thanos.cs index 23e713604..07c82388b 100644 --- a/Roles/Neutral/Thanos.cs +++ b/Roles/Neutral/Thanos.cs @@ -289,7 +289,7 @@ public class Thanos : RoleBase if (StonesWaitingForUse.Count > 0) { - string action = Translator.GetString(Options.UsePhantomBasis.GetBool() && Options.UsePhantomBasisForNKs.GetBool() ? "AbilityButtonText.Specter" : Options.UsePets.GetBool() ? "PetButtonText" : "Shapeshift"); + string action = Translator.GetString(Options.UsePhantomBasis.GetBool() && Options.UsePhantomBasisForNKs.GetBool() ? "AbilityButtonText.Thanks" : Options.UsePets.GetBool() ? "PetButtonText" : "Shapeshift"); sb.AppendLine(string.Format(Translator.GetString("Thanos.StoneWaitingForUse"), action, Translator.GetString($"Thanos.Stone.{StonesWaitingForUse[0]}"))); } diff --git a/Roles/Neutral/Thief.cs b/Roles/Neutral/Thief.cs index 5e6c10ee0..40f4295d2 100644 --- a/Roles/Neutral/Thief.cs +++ b/Roles/Neutral/Thief.cs @@ -60,7 +60,7 @@ public class Thief : RoleBase if (target.Is(CustomRoles.Trickster)) role = CustomRoles.DoubleAgent; else if (target.Is(CustomRoles.Maverick)) role = CustomRoles.SerialKiller; - else if (target.IsMadmate()) role = CustomRoles.Refugee; + else if (target.IsMadmate()) role = CustomRoles.Renegade; else if (target.IsImpostor() || target.IsNeutralKiller()) role = target.GetCustomRole(); else if (CanStealCovenRoles.GetBool() && target.Is(CustomRoleTypes.Coven)) role = CustomRoles.CovenMember;