Start Weapon Master

This commit is contained in:
Gurge44 committed 2023-10-17 22:19:33 +02:00
1 parent 259bbd88ac
commit f5074f21b4
21 files changed
+188 -91

No files matched your search

+1 -1
View File
@@ -23,7 +23,7 @@ public static class AntiBlackout
///</summary>
public static bool IsRequired => Options.NoGameEnd.GetBool()
|| Jackal.IsEnable || Pelican.IsEnable || Magician.IsEnable
|| Gamer.IsEnable || BloodKnight.IsEnable || Mafioso.IsEnable
|| Gamer.IsEnable || BloodKnight.IsEnable || WeaponMaster.IsEnable
|| Succubus.IsEnable || Poisoner.IsEnable || Reckless.IsEnable
|| Infectious.IsEnable || Juggernaut.IsEnable || HeadHunter.IsEnable
|| Ritualist.IsEnable || Virus.IsEnable || Vengeance.IsEnable
+10 -10
View File
@@ -278,7 +278,7 @@ internal static class CustomRolesHelper
CustomRoles.Postman => RoleTypes.Impostor,
CustomRoles.Reckless => RoleTypes.Impostor,
CustomRoles.Magician => RoleTypes.Impostor,
CustomRoles.Mafioso => RoleTypes.Impostor,
CustomRoles.WeaponMaster => RoleTypes.Impostor,
CustomRoles.Pyromaniac => RoleTypes.Impostor,
CustomRoles.Eclipse => RoleTypes.Impostor,
CustomRoles.Vengeance => RoleTypes.Impostor,
@@ -458,7 +458,7 @@ internal static class CustomRolesHelper
CustomRoles.Parasite or
CustomRoles.NSerialKiller or
CustomRoles.Magician or
CustomRoles.Mafioso or
CustomRoles.WeaponMaster or
CustomRoles.Reckless or
CustomRoles.Pyromaniac or
CustomRoles.Eclipse or
@@ -495,7 +495,7 @@ internal static class CustomRolesHelper
CustomRoles.Parasite or
CustomRoles.NSerialKiller or
CustomRoles.Magician or
CustomRoles.Mafioso or
CustomRoles.WeaponMaster or
CustomRoles.Reckless or
CustomRoles.Eclipse or
CustomRoles.Pyromaniac or
@@ -623,7 +623,7 @@ internal static class CustomRolesHelper
CustomRoles.Poisoner or
CustomRoles.NSerialKiller or
CustomRoles.Magician or
CustomRoles.Mafioso or
CustomRoles.WeaponMaster or
CustomRoles.Reckless or
CustomRoles.Eclipse or
CustomRoles.Pyromaniac or
@@ -774,7 +774,7 @@ internal static class CustomRolesHelper
CustomRoles.Poisoner or
CustomRoles.NSerialKiller or
CustomRoles.Magician or
CustomRoles.Mafioso or
CustomRoles.WeaponMaster or
CustomRoles.Reckless or
CustomRoles.Postman or
CustomRoles.Eclipse or
@@ -820,7 +820,7 @@ internal static class CustomRolesHelper
CustomRoles.NSerialKiller or
CustomRoles.Eclipse or
CustomRoles.Magician or
CustomRoles.Mafioso or
CustomRoles.WeaponMaster or
CustomRoles.Reckless or
CustomRoles.Postman or
CustomRoles.Pyromaniac or
@@ -906,7 +906,7 @@ internal static class CustomRolesHelper
CustomRoles.Poisoner or
CustomRoles.NSerialKiller or
CustomRoles.Magician or
CustomRoles.Mafioso or
CustomRoles.WeaponMaster or
CustomRoles.Reckless or
CustomRoles.Postman or
CustomRoles.Eclipse or
@@ -1032,7 +1032,7 @@ internal static class CustomRolesHelper
CustomRoles.Poisoner or
CustomRoles.NSerialKiller or
CustomRoles.Magician or
CustomRoles.Mafioso or
CustomRoles.WeaponMaster or
CustomRoles.Reckless or
CustomRoles.Postman or
CustomRoles.Eclipse or
@@ -1395,7 +1395,7 @@ internal static class CustomRolesHelper
CustomRoles.Parasite => CountTypes.Impostor,
CustomRoles.NSerialKiller => CountTypes.NSerialKiller,
CustomRoles.Magician => CountTypes.Magician,
CustomRoles.Mafioso => CountTypes.Mafioso,
CustomRoles.WeaponMaster => CountTypes.WeaponMaster,
CustomRoles.Reckless => CountTypes.Reckless,
CustomRoles.Eclipse => CountTypes.Eclipse,
CustomRoles.Pyromaniac => CountTypes.Pyromaniac,
@@ -1450,7 +1450,7 @@ public enum CountTypes
Wraith,
NSerialKiller,
Magician,
Mafioso,
WeaponMaster,
Reckless,
Pyromaniac,
Eclipse,
+7 -6
View File
@@ -481,7 +481,7 @@ static class ExtendedPlayerControl
CustomRoles.Eclipse => true,
CustomRoles.NSerialKiller => true,
CustomRoles.Magician => true,
CustomRoles.Mafioso => true,
CustomRoles.WeaponMaster => true,
CustomRoles.Postman => true,
CustomRoles.Reckless => true,
CustomRoles.Vengeance => true,
@@ -582,7 +582,7 @@ static class ExtendedPlayerControl
CustomRoles.NSerialKiller => pc.IsAlive(),
CustomRoles.Postman => pc.IsAlive() && !Postman.IsFinished,
CustomRoles.Magician => pc.IsAlive(),
CustomRoles.Mafioso => pc.IsAlive() && Mafioso.CanKill,
CustomRoles.WeaponMaster => pc.IsAlive() && WeaponMaster.CanKill(pc),
CustomRoles.Reckless => pc.IsAlive(),
CustomRoles.Vengeance => pc.IsAlive(),
CustomRoles.HeadHunter => pc.IsAlive(),
@@ -673,7 +673,7 @@ static class ExtendedPlayerControl
CustomRoles.NSerialKiller => NSerialKiller.CanVent.GetBool(),
CustomRoles.Magician => Magician.CanVent.GetBool(),
CustomRoles.Reckless => Reckless.CanVent.GetBool(),
CustomRoles.Mafioso => Mafioso.CanVent.GetBool(),
CustomRoles.WeaponMaster => WeaponMaster.CanVent.GetBool(),
CustomRoles.Postman => Postman.CanVent.GetBool(),
CustomRoles.Pyromaniac => Pyromaniac.CanVent.GetBool(),
CustomRoles.Eclipse => Eclipse.CanVent.GetBool(),
@@ -785,7 +785,7 @@ static class ExtendedPlayerControl
CustomRoles.Glitch => true,
CustomRoles.Refugee => true,
CustomRoles.Magician => true,
CustomRoles.Mafioso => true,
CustomRoles.WeaponMaster => true,
_ => pc.Is(CustomRoleTypes.Impostor),
@@ -873,6 +873,7 @@ static class ExtendedPlayerControl
break;
case CustomRoles.Sapper:
Main.AllPlayerKillCooldown[player.PlayerId] = 300f;
break;
case CustomRoles.Hitman:
Main.AllPlayerKillCooldown[player.PlayerId] = Hitman.KillCooldown.GetFloat();
break;
@@ -926,8 +927,8 @@ static class ExtendedPlayerControl
case CustomRoles.NSerialKiller:
NSerialKiller.SetKillCooldown(player.PlayerId);
break;
case CustomRoles.Mafioso:
Mafioso.SetKillCooldown(player.PlayerId);
case CustomRoles.WeaponMaster:
WeaponMaster.SetKillCooldown(player.PlayerId);
break;
case CustomRoles.Magician:
Magician.SetKillCooldown(player.PlayerId);
@@ -373,8 +373,8 @@ public class PlayerGameOptionsSender : GameOptionsSender
case CustomRoles.Reckless:
Reckless.ApplyGameOptions(opt);
break;
case CustomRoles.Mafioso:
Mafioso.ApplyGameOptions(opt);
case CustomRoles.WeaponMaster:
WeaponMaster.ApplyGameOptions(opt);
break;
case CustomRoles.Postman:
Postman.ApplyGameOptions(opt);
+1 -1
View File
@@ -61,7 +61,7 @@ public static class NameColorManager
if (seer.Is(CustomRoles.Juggernaut) && target.Is(CustomRoles.Juggernaut)) color = Main.roleColors[CustomRoles.Juggernaut];
if (seer.Is(CustomRoles.NSerialKiller) && target.Is(CustomRoles.NSerialKiller)) color = Main.roleColors[CustomRoles.NSerialKiller];
if (seer.Is(CustomRoles.Postman) && target.Is(CustomRoles.Postman)) color = Main.roleColors[CustomRoles.Postman];
if (seer.Is(CustomRoles.Mafioso) && target.Is(CustomRoles.Mafioso)) color = Main.roleColors[CustomRoles.Mafioso];
if (seer.Is(CustomRoles.WeaponMaster) && target.Is(CustomRoles.WeaponMaster)) color = Main.roleColors[CustomRoles.WeaponMaster];
if (seer.Is(CustomRoles.Magician) && target.Is(CustomRoles.Magician)) color = Main.roleColors[CustomRoles.Magician];
if (seer.Is(CustomRoles.Reckless) && target.Is(CustomRoles.Reckless)) color = Main.roleColors[CustomRoles.Reckless];
if (seer.Is(CustomRoles.Pyromaniac) && target.Is(CustomRoles.Pyromaniac)) color = Main.roleColors[CustomRoles.Pyromaniac];
+4 -4
View File
@@ -1807,13 +1807,13 @@ public static class Options
NSerialKiller.SetupCustomOption();
RoleLoadingText = "Neutral roles\nPostman";
//Postman.SetupCustomOption();
Postman.SetupCustomOption();
RoleLoadingText = "Neutral roles\nReckless";
//Reckless.SetupCustomOption();
Reckless.SetupCustomOption();
RoleLoadingText = "Neutral roles\nMagician";
Magician.SetupCustomOption();
RoleLoadingText = "Neutral roles\nMafioso";
//Mafioso.SetupCustomOption();
RoleLoadingText = "Neutral roles\nWeaponMaster";
WeaponMaster.SetupCustomOption();
RoleLoadingText = "Neutral roles\nPyromaniac";
Pyromaniac.SetupCustomOption();
RoleLoadingText = "Neutral roles\nEclipse";
+2 -2
View File
@@ -1138,8 +1138,8 @@ internal static class RPC
case CustomRoles.Postman:
Postman.Add(targetId);
break;
case CustomRoles.Mafioso:
Mafioso.Add(targetId);
case CustomRoles.WeaponMaster:
WeaponMaster.Add(targetId);
break;
case CustomRoles.Reckless:
Reckless.Add(targetId);
+1 -1
View File
@@ -456,7 +456,7 @@ public static class Utils
case CustomRoles.NSerialKiller:
case CustomRoles.Postman:
case CustomRoles.Reckless:
case CustomRoles.Mafioso:
case CustomRoles.WeaponMaster:
case CustomRoles.Magician:
case CustomRoles.Vengeance:
case CustomRoles.HeadHunter:
+5 -5
View File
@@ -400,7 +400,7 @@ class GameEndChecker
byte Pestilence = (byte)Utils.AlivePlayersCount(CountTypes.Pestilence);
byte PB = (byte)Utils.AlivePlayersCount(CountTypes.PlagueBearer);
byte SK = (byte)Utils.AlivePlayersCount(CountTypes.NSerialKiller);
byte MO = (byte)Utils.AlivePlayersCount(CountTypes.Mafioso);
byte WM = (byte)Utils.AlivePlayersCount(CountTypes.WeaponMaster);
byte MG = (byte)Utils.AlivePlayersCount(CountTypes.Magician);
byte RL = (byte)Utils.AlivePlayersCount(CountTypes.Reckless);
byte EC = (byte)Utils.AlivePlayersCount(CountTypes.Eclipse);
@@ -454,7 +454,7 @@ class GameEndChecker
//Virus += (byte)Main.AllAlivePlayerControls.Count(x => x.Is(CustomRoles.Contagious) && x.Is(CustomRoles.DualPersonality));
//Imp += (byte)Main.AllAlivePlayerControls.Count(x => x.Is(CustomRoles.Madmate) && x.Is(CustomRoles.DualPersonality));
int totalNKAlive = new int[] { Jackal, Pel, Gam, BK, Pois, CM, Hex, Wraith, Pestilence, PB, SK, EC, PM, HH, VG, IM, WW, RR, Juggy, Vamp, Virus, Rogue, DH, Jinx, Rit, PP, Traitor, Med, SC, Glitch, Arso, Bandit, Agi, MO, MG, RL }.Sum();
int totalNKAlive = new int[] { Jackal, Pel, Gam, BK, Pois, CM, Hex, Wraith, Pestilence, PB, SK, EC, PM, HH, VG, IM, WW, RR, Juggy, Vamp, Virus, Rogue, DH, Jinx, Rit, PP, Traitor, Med, SC, Glitch, Arso, Bandit, Agi, WM, MG, RL }.Sum();
CustomWinner? winner = null;
CustomRoles? rl = null;
@@ -598,11 +598,11 @@ class GameEndChecker
winner = CustomWinner.Magician;
rl = CustomRoles.Magician;
}
else if (MO == totalNKAlive)
else if (WM == totalNKAlive)
{
reason = GameOverReason.ImpostorByKill;
winner = CustomWinner.Mafioso;
rl = CustomRoles.Mafioso;
winner = CustomWinner.WeaponMaster;
rl = CustomRoles.WeaponMaster;
}
else if (RL == totalNKAlive)
{
+1 -1
View File
@@ -159,7 +159,7 @@ class HudManagerPatch
break;
case CustomRoles.NSerialKiller:
case CustomRoles.Magician:
case CustomRoles.Mafioso:
case CustomRoles.WeaponMaster:
case CustomRoles.Reckless:
case CustomRoles.Pyromaniac:
case CustomRoles.Eclipse:
+1 -1
View File
@@ -474,7 +474,7 @@ class BeginImpostorPatch
__instance.overlayHandle.color = Palette.CrewmateBlue;
return false;
}
else if (role is CustomRoles.Romantic or CustomRoles.RuthlessRomantic or CustomRoles.VengefulRomantic or CustomRoles.Agitater or CustomRoles.NSerialKiller or CustomRoles.Postman or CustomRoles.Magician or CustomRoles.Mafioso or CustomRoles.Reckless or CustomRoles.Eclipse or CustomRoles.Pyromaniac or CustomRoles.HeadHunter or CustomRoles.Vengeance or CustomRoles.Imitator or CustomRoles.Werewolf or CustomRoles.Jackal or CustomRoles.CursedSoul or CustomRoles.Amnesiac or CustomRoles.Arsonist or CustomRoles.Sidekick or CustomRoles.Innocent or CustomRoles.Pelican or CustomRoles.Pursuer or CustomRoles.Revolutionist or CustomRoles.FFF or CustomRoles.Gamer or CustomRoles.Glitch or CustomRoles.Juggernaut or CustomRoles.DarkHide or CustomRoles.Provocateur or CustomRoles.BloodKnight or CustomRoles.NSerialKiller or CustomRoles.Maverick/* or CustomRoles.NWitch*/ or CustomRoles.Totocalcio or CustomRoles.Succubus or CustomRoles.Pelican or CustomRoles.Infectious or CustomRoles.Virus or CustomRoles.Pickpocket or CustomRoles.Traitor or CustomRoles.PlagueBearer or CustomRoles.Pestilence or CustomRoles.Spiritcaller)
else if (role is CustomRoles.Romantic or CustomRoles.RuthlessRomantic or CustomRoles.VengefulRomantic or CustomRoles.Agitater or CustomRoles.NSerialKiller or CustomRoles.Postman or CustomRoles.Magician or CustomRoles.WeaponMaster or CustomRoles.Reckless or CustomRoles.Eclipse or CustomRoles.Pyromaniac or CustomRoles.HeadHunter or CustomRoles.Vengeance or CustomRoles.Imitator or CustomRoles.Werewolf or CustomRoles.Jackal or CustomRoles.CursedSoul or CustomRoles.Amnesiac or CustomRoles.Arsonist or CustomRoles.Sidekick or CustomRoles.Innocent or CustomRoles.Pelican or CustomRoles.Pursuer or CustomRoles.Revolutionist or CustomRoles.FFF or CustomRoles.Gamer or CustomRoles.Glitch or CustomRoles.Juggernaut or CustomRoles.DarkHide or CustomRoles.Provocateur or CustomRoles.BloodKnight or CustomRoles.NSerialKiller or CustomRoles.Maverick/* or CustomRoles.NWitch*/ or CustomRoles.Totocalcio or CustomRoles.Succubus or CustomRoles.Pelican or CustomRoles.Infectious or CustomRoles.Virus or CustomRoles.Pickpocket or CustomRoles.Traitor or CustomRoles.PlagueBearer or CustomRoles.Pestilence or CustomRoles.Spiritcaller)
{
yourTeam = new Il2CppSystem.Collections.Generic.List<PlayerControl>();
yourTeam.Add(PlayerControl.LocalPlayer);
+1 -1
View File
@@ -1013,7 +1013,7 @@ class MeetingHudStartPatch
case CustomRoles.NSerialKiller:
case CustomRoles.Reckless:
case CustomRoles.Magician:
case CustomRoles.Mafioso:
case CustomRoles.WeaponMaster:
case CustomRoles.Pyromaniac:
case CustomRoles.Eclipse:
case CustomRoles.Vengeance:
+3 -3
View File
@@ -277,7 +277,7 @@ internal class ChangeRoleSettings
NSerialKiller.Init();
Postman.Init();
Magician.Init();
Mafioso.Init();
WeaponMaster.Init();
Reckless.Init();
Pyromaniac.Init();
Eclipse.Init();
@@ -848,8 +848,8 @@ internal class SelectRolesPatch
case CustomRoles.Magician:
Magician.Add(pc.PlayerId);
break;
case CustomRoles.Mafioso:
Mafioso.Add(pc.PlayerId);
case CustomRoles.WeaponMaster:
WeaponMaster.Add(pc.PlayerId);
break;
case CustomRoles.Reckless:
Reckless.Add(pc.PlayerId);
+9 -2
View File
@@ -2426,7 +2426,7 @@
"DivinatorCheck.Result17","<b>{0}</b>是医生、马里奥、小丑、潜伏者还是阳光开朗大男孩其中之一","<b>{0}</b> is either Medic, Vector, RiftMaker, Jester, The Glitch, Lurker, or Sunnyboy","","",""
"DivinatorCheck.Result18","<b>{0}</b>是黑手党、惩罚者、教父、缺点者、幸运儿或失败者其中之一","<b>{0}</b> is either Nemesis, Hitman, Retributionist, Gangster, Glitch, Luckey, or Underdog","","",""
"DivinatorCheck.Result19","<b>{0}</b>是邪恶赌怪、正义赌怪、潜藏者、梦魇、隐蔽者或变色龙其中之一","<b>{0}</b> is either Evil Guesser, Nice Guesser, Eclipse, Reckless, Stalker, Camouflager, or Chameleon","","",""
"DivinatorCheck.Result20","<b>{0}</b>是豺狼、跟班、独行者、投机者、追击者或自爆卡车其中之一","<b>{0}</b> is either Jackal, Sidekick, Mafioso, Maverick, Opportunist, Pursuer, or Provocateur","","",""
"DivinatorCheck.Result20","<b>{0}</b>是豺狼、跟班、独行者、投机者、追击者或自爆卡车其中之一","<b>{0}</b> is either Jackal, Sidekick, WeaponMaster, Maverick, Opportunist, Pursuer, or Provocateur","","",""
"DivinatorCheck.Result21","<b>{0}</b>是投毒者、吸血鬼、和平之鸽、灵魂论者或背叛者其中之一","<b>{0}</b> is either Poisoner, Magician, Vampire, Pacifist, Head Hunter, Soul Catcher, or Traitor","","",""
"DivinatorCheck.Result22","<b>{0}</b>是诡雷、快枪手、连环杀手、警长、仰慕者或术士其中之一","<b>{0}</b> is either Trapster, Quick Shooter, Serial Killer, Sheriff, Werewolf, Admirer, or Warlock","","",""
"DivinatorCheck.Result23","<b>{0}</b>是调查员、军师、祭祀者、巫师或女巫其中之一","<b>{0}</b> is either Fortune Teller, Postman, Consigliere, Ritualist, Imitator, Hex Master, or Witch","","",""
@@ -2604,6 +2604,12 @@
"PyroDouseCooldown","","Douse Cooldown","","",""
"PyroBurnCooldown","","Kill Cooldown after killing a Doused Player","","",""
"## Weapon Master"
"WeaponMaster","","Weapon Master","","",""
"WeaponMasterInfo","","Select your weapons and kill everyone","","",""
"WeaponMasterInfoLong","","(Neutral):\nAs the Weapon Master, you can cycle between your weapons by petting your pet/calling a sabotage.\n\nThe Sword weapon is a normal kill method.\n\nThe Axe weapon kills everyone in a certain radius when you make a kill. You have a higher kill cooldown while using this weapon.\n\nThe Lance weapon sets your kill range to the maximum, and you don't lunge toward your kills. You can't vent while using this weapon.\n\nWhile using your Shield, you can survive an attack once. You can't kill while using your shield.","","",""
"WMRadius","","Axe Mode Death Radius","","",""
"## Eclipse"
"Eclipse","","Eclipse","","",""
"EclipseInfo","","Your vision increases with each kill you get","","",""
@@ -3403,7 +3409,7 @@
"WinnerRoleText.Pyromaniac","","Pyromaniac Wins!","","",""
"WinnerRoleText.Magician","","Magician Wins!","","",""
"WinnerRoleText.Reckless","","Reckless Wins!","","",""
"WinnerRoleText.Mafioso","","Mafioso Wins!","","",""
"WinnerRoleText.WeaponMaster","","Weapon Master Wins!","","",""
"## Additional Winner Text"
@@ -3423,6 +3429,7 @@
"AdditionalWinnerRoleText.Maverick","独行者","The Maverick survived","Бродяга","",""
"AdditionalWinnerRoleText.Romantic","","The Romantic wins along","","",""
"AdditionalWinnerRoleText.VengefulRomantic","","The Vengeful Romantic avenged their lover","","",""
"AdditionalWinnerRoleText.Postman","","The Postman delivered mail to everyone","","",""
"## Misc End Screen Text"
Can't render this file because it is too large.
+1 -1
View File
@@ -253,7 +253,7 @@ public static class Divinator
CustomRoles.Jackal or
CustomRoles.Sidekick or
CustomRoles.Maverick or
CustomRoles.Mafioso or
CustomRoles.WeaponMaster or
CustomRoles.Opportunist or
CustomRoles.Pursuer or
CustomRoles.Provocateur
+1 -1
View File
@@ -161,7 +161,7 @@ public static class Oracle
CustomRoles.NSerialKiller or
CustomRoles.Postman or
CustomRoles.Magician or
CustomRoles.Mafioso or
CustomRoles.WeaponMaster or
CustomRoles.Reckless or
CustomRoles.Pyromaniac or
CustomRoles.Eclipse or
-3
View File
@@ -15,7 +15,6 @@ namespace TOHE.Roles.Impostor
private static readonly int Id = 643000;
public static List<byte> playerIdList = new();
private static OptionItem KillCooldown;
public static OptionItem ShapeshiftCooldown;
private static OptionItem Delay;
private static OptionItem Radius;
@@ -25,8 +24,6 @@ namespace TOHE.Roles.Impostor
public static void SetupCustomOption()
{
SetupRoleOptions(Id, TabGroup.ImpostorRoles, CustomRoles.Sapper);
KillCooldown = FloatOptionItem.Create(Id + 10, "KillCooldown", new(0f, 180f, 2.5f), 25f, TabGroup.ImpostorRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Sapper])
.SetValueFormat(OptionFormat.Seconds);
ShapeshiftCooldown = FloatOptionItem.Create(Id + 11, "SapperCD", new(0f, 180f, 2.5f), 30f, TabGroup.ImpostorRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Sapper])
.SetValueFormat(OptionFormat.Seconds);
Delay = IntegerOptionItem.Create(Id + 12, "SapperDelay", new(1, 15, 1), 5, TabGroup.ImpostorRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Sapper])
+1 -1
View File
@@ -389,7 +389,7 @@ public static class Amnesiac
if (player.Is(CustomRoles.Parasite) && target.Is(CustomRoles.Parasite)) return true;
if (player.Is(CustomRoles.NSerialKiller) && target.Is(CustomRoles.NSerialKiller)) return true;
if (player.Is(CustomRoles.Magician) && target.Is(CustomRoles.Magician)) return true;
if (player.Is(CustomRoles.Mafioso) && target.Is(CustomRoles.Mafioso)) return true;
if (player.Is(CustomRoles.WeaponMaster) && target.Is(CustomRoles.WeaponMaster)) return true;
if (player.Is(CustomRoles.Reckless) && target.Is(CustomRoles.Reckless)) return true;
if (player.Is(CustomRoles.Eclipse) && target.Is(CustomRoles.Eclipse)) return true;
if (player.Is(CustomRoles.Pyromaniac) && target.Is(CustomRoles.Pyromaniac)) return true;
-42
View File
@@ -1,42 +0,0 @@
using AmongUs.GameOptions;
using System.Collections.Generic;
using System.Linq;
using static TOHE.Options;
namespace TOHE.Roles.Neutral;
public static class Mafioso
{
private static readonly int Id = 641200;
public static List<byte> playerIdList = new();
private static OptionItem KillCooldown;
public static OptionItem CanVent;
private static OptionItem HasImpostorVision;
public static bool CanKill;
public static void SetupCustomOption()
{
SetupSingleRoleOptions(Id, TabGroup.NeutralRoles, CustomRoles.Mafioso, 1, zeroOne: false);
KillCooldown = FloatOptionItem.Create(Id + 10, "KillCooldown", new(0f, 180f, 2.5f), 22.5f, TabGroup.NeutralRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Mafioso])
.SetValueFormat(OptionFormat.Seconds);
CanVent = BooleanOptionItem.Create(Id + 11, "CanVent", true, TabGroup.NeutralRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Mafioso]);
HasImpostorVision = BooleanOptionItem.Create(Id + 13, "ImpostorVision", true, TabGroup.NeutralRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Mafioso]);
}
public static void Init()
{
playerIdList = new();
}
public static void Add(byte playerId)
{
playerIdList.Add(playerId);
if (!AmongUsClient.Instance.AmHost) return;
if (!Main.ResetCamPlayerList.Contains(playerId))
Main.ResetCamPlayerList.Add(playerId);
}
public static bool IsEnable => playerIdList.Any();
public static void SetKillCooldown(byte id) => Main.AllPlayerKillCooldown[id] = KillCooldown.GetFloat();
public static void ApplyGameOptions(IGameOptions opt) => opt.SetVision(HasImpostorVision.GetBool());
}
+134
View File
@@ -0,0 +1,134 @@
using AmongUs.GameOptions;
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using static TOHE.Options;
namespace TOHE.Roles.Neutral;
public static class WeaponMaster
{
private static readonly int Id = 641200;
public static List<byte> playerIdList = new();
private static OptionItem KillCooldown;
public static OptionItem CanVent;
private static OptionItem HasImpostorVision;
private static OptionItem Radius;
private static OptionItem HighKCD;
private static byte Mode;
private static bool shieldUsed;
/*
* 0 = Kill (Sword) ~ Normal Kill
* 1 = TOHEN Werewolf Kill / Higher KCD (Axe)
* 2 = Reach + Swift / Can't Vent (Lance)
* 3 = 1-Time Shield / Can't Kill (Shield)
*/
public static void SetupCustomOption()
{
SetupSingleRoleOptions(Id, TabGroup.NeutralRoles, CustomRoles.WeaponMaster, 1, zeroOne: false);
KillCooldown = FloatOptionItem.Create(Id + 10, "KillCooldown", new(0f, 180f, 2.5f), 22.5f, TabGroup.NeutralRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.WeaponMaster])
.SetValueFormat(OptionFormat.Seconds);
CanVent = BooleanOptionItem.Create(Id + 11, "CanVent", true, TabGroup.NeutralRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.WeaponMaster]);
HasImpostorVision = BooleanOptionItem.Create(Id + 13, "ImpostorVision", true, TabGroup.NeutralRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.WeaponMaster]);
Radius = FloatOptionItem.Create(Id + 12, "WMRadius", new(0f, 10f, 0.25f), 3f, TabGroup.ImpostorRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.Sapper])
.SetValueFormat(OptionFormat.Multiplier);
KillCooldown = FloatOptionItem.Create(Id + 14, "GamblerHighKCD", new(0f, 180f, 2.5f), 22.5f, TabGroup.NeutralRoles, false).SetParent(CustomRoleSpawnChances[CustomRoles.WeaponMaster])
.SetValueFormat(OptionFormat.Seconds);
}
public static void Init()
{
playerIdList = new();
Mode = 0;
shieldUsed = false;
}
public static void Add(byte playerId)
{
playerIdList.Add(playerId);
if (!AmongUsClient.Instance.AmHost) return;
if (!Main.ResetCamPlayerList.Contains(playerId))
Main.ResetCamPlayerList.Add(playerId);
}
public static bool IsEnable => playerIdList.Any();
public static void SetKillCooldown(byte id) => Main.AllPlayerKillCooldown[id] = KillCooldown.GetFloat();
public static void ApplyGameOptions(IGameOptions opt)
{
if (Mode == 2) opt.SetInt(Int32OptionNames.KillDistance, 2);
else opt.SetInt(Int32OptionNames.KillDistance, (int)(NormalGameOptionsV07.KillDistances[Mathf.Clamp(Utils.GetPlayerById(playerIdList[0]).Is(CustomRoles.Reach) ? 2 : Main.NormalOptions.KillDistance, 0, 2)] + 0.5f));
opt.SetVision(HasImpostorVision.GetBool());
}
public static bool CanKill(PlayerControl pc) => Mode != 3;
public static void SwitchMode()
{
if (Mode == 3) Mode = 0;
else Mode++;
if (Mode == 1) Main.AllPlayerKillCooldown[playerIdList[0]] = HighKCD.GetFloat();
Utils.GetPlayerById(playerIdList[0]).MarkDirtySettings();
}
public static bool OnCheckMurder(PlayerControl killer, PlayerControl target)
{
if (killer == null) return false;
if (target == null) return false;
switch (Mode)
{
case 0:
return true;
case 1:
_ = new LateTask(() =>
{
foreach (var player in Main.AllPlayerControls)
{
if (!player.IsAlive() || Pelican.IsEaten(player.PlayerId)) continue;
if (player == killer) continue;
if (player.Is(CustomRoles.Pestilence) || Main.VeteranInProtect.ContainsKey(target.PlayerId)) continue;
if (Vector2.Distance(killer.transform.position, player.transform.position) <= Radius.GetFloat())
{
player.SetRealKiller(killer);
player.RpcMurderPlayerV3(player);
}
}
}, 0.1f, "Weapon Master Axe Kill");
return true;
case 2:
if (killer.RpcCheckAndMurder(target, true)) target.RpcMurderPlayerV3(target);
return false;
case 3:
return false;
default:
Logger.Error("Invalid Mode", "WeaponMaster");
return true;
}
}
public static bool OnAttack(PlayerControl killer, PlayerControl target)
{
if (Mode == 3 && !shieldUsed) return false;
else return true;
}
public static void OnEnterVent(PlayerControl pc, int ventId)
{
if (pc == null) return;
if (Mode == 2) pc.MyPhysics?.RpcBootFromVent(ventId);
}
public static string GetHudAndProgressText()
{
return $"Mode: {ModeToText(Mode)}";
}
public static string ModeToText(byte mode)
{
return mode switch
{
0 => "Sword",
1 => "Axe",
2 => "Lance",
3 => "Shield",
_ => string.Empty,
};
}
}
+3 -3
View File
@@ -445,7 +445,7 @@ public class Main : BasePlugin
{CustomRoles.Postman, "#00b893"},
{CustomRoles.Reckless, "#6e000d"},
{CustomRoles.Magician, "#BF5FFF"},
{CustomRoles.Mafioso, "#6f02bd"},
{CustomRoles.WeaponMaster, "#6f02bd"},
{CustomRoles.Eclipse, "#0E6655"},
{CustomRoles.Vengeance, "#33cccc"},
{CustomRoles.HeadHunter, "#ffcc66"},
@@ -780,7 +780,7 @@ public enum CustomRoles
Postman,
Reckless,
Magician,
Mafioso,
WeaponMaster,
Eclipse,
Pyromaniac,
Vengeance,
@@ -932,7 +932,7 @@ public enum CustomWinner
SerialKiller = CustomRoles.NSerialKiller,
Reckless = CustomRoles.Reckless,
Magician = CustomRoles.Magician,
Mafioso = CustomRoles.Mafioso,
WeaponMaster = CustomRoles.WeaponMaster,
Pyromaniac = CustomRoles.Pyromaniac,
Eclipse = CustomRoles.Eclipse,
HeadHunter = CustomRoles.HeadHunter,