mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
xor list & combo list visible to every1
This commit is contained in:
1 parent
53cb868ffb
commit
ecc00f3be8
2 files changed
+17
-12
No files matched your search
+16
-12
@@ -148,7 +148,7 @@ internal static class ChatCommands
|
||||
new(["gamestate", "gstate", "gs", "kcount", "kc", "кубийц", "гс", "статигры", "对局状态", "estadojogo", "status"], "", GetString("CommandDescription.KCount"), Command.UsageLevels.Everyone, Command.UsageTimes.InGame, KCountCommand, true, false),
|
||||
new(["addmod", "добмодера", "指定协管", "moderador-add"], "{id}", GetString("CommandDescription.AddMod"), Command.UsageLevels.Host, Command.UsageTimes.Always, AddModCommand, true, false, [GetString("CommandArgs.AddMod.Id")]),
|
||||
new(["deletemod", "убрмодера", "удмодера", "убратьмодера", "удалитьмодера", "移除协管", "moderador-remover"], "{id}", GetString("CommandDescription.DeleteMod"), Command.UsageLevels.Host, Command.UsageTimes.Always, DeleteModCommand, true, false, [GetString("CommandArgs.DeleteMod.Id")]),
|
||||
new(["combo", "комбо", "设置不会同时出现的职业", "combinação", "combinar"], "{mode} {role} {addon} [all]", GetString("CommandDescription.Combo"), Command.UsageLevels.Host, Command.UsageTimes.Always, ComboCommand, true, false, [GetString("CommandArgs.Combo.Mode"), GetString("CommandArgs.Combo.Role"), GetString("CommandArgs.Combo.Addon"), GetString("CommandArgs.Combo.All")]),
|
||||
new(["combo", "комбо", "设置不会同时出现的职业", "combinação", "combinar"], "{mode} {role} {addon} [all]", GetString("CommandDescription.Combo"), Command.UsageLevels.Everyone, Command.UsageTimes.Always, ComboCommand, true, false, [GetString("CommandArgs.Combo.Mode"), GetString("CommandArgs.Combo.Role"), GetString("CommandArgs.Combo.Addon"), GetString("CommandArgs.Combo.All")]),
|
||||
new(["eff", "effect", "эффект", "效果", "efeito"], "{effect}", GetString("CommandDescription.Effect"), Command.UsageLevels.Host, Command.UsageTimes.InGame, EffectCommand, true, false, [GetString("CommandArgs.Effect.Effect")]),
|
||||
new(["afkexempt", "освафк", "афкосв", "挂机检测器不会检测", "afk-isentar"], "{id}", GetString("CommandDescription.AFKExempt"), Command.UsageLevels.HostOrAdmin, Command.UsageTimes.Always, AFKExemptCommand, true, false, [GetString("CommandArgs.AFKExempt.Id")]),
|
||||
new(["m", "myrole", "м", "мояроль", "我的职业", "minhafunção"], "", GetString("CommandDescription.MyRole"), Command.UsageLevels.Everyone, Command.UsageTimes.InGame, MyRoleCommand, true, false),
|
||||
@@ -212,7 +212,7 @@ internal static class ChatCommands
|
||||
new(["deletetag", "удалитьтег", "убратьтег", "удтег", "убртег", "删除标签"], "{id}", GetString("CommandDescription.DeleteTag"), Command.UsageLevels.Host, Command.UsageTimes.InLobby, DeleteTagCommand, true, false, [GetString("CommandArgs.DeleteTag.Id")]),
|
||||
new(["daybreak", "db", "дейбрейк", "破晓"], "", GetString("CommandDescription.DayBreak"), Command.UsageLevels.Everyone, Command.UsageTimes.InMeeting, DayBreakCommand, true, true),
|
||||
new(["fix", "blackscreenfix", "fixblackscreen", "фикс", "исправить", "修复"], "{id}", GetString("CommandDescription.Fix"), Command.UsageLevels.HostOrModerator, Command.UsageTimes.InGame, FixCommand, true, false, [GetString("CommandArgs.Fix.Id")]),
|
||||
new(["xor", "异或命令"], "{role} {role}", GetString("CommandDescription.XOR"), Command.UsageLevels.Host, Command.UsageTimes.InLobby, XORCommand, true, false, [GetString("CommandArgs.XOR.Role"), GetString("CommandArgs.XOR.Role")]),
|
||||
new(["xor", "异或命令"], "{role} {role}", GetString("CommandDescription.XOR"), Command.UsageLevels.Everyone, Command.UsageTimes.Always, XORCommand, true, false, [GetString("CommandArgs.XOR.Role"), GetString("CommandArgs.XOR.Role")]),
|
||||
new(["ci", "chemistinfo", "химик", "化学家"], "", GetString("CommandDescription.ChemistInfo"), Command.UsageLevels.Everyone, Command.UsageTimes.Always, ChemistInfoCommand, true, false),
|
||||
new(["forge"], "{id} {role}", GetString("CommandDescription.Forge"), Command.UsageLevels.Everyone, Command.UsageTimes.InMeeting, ForgeCommand, true, true, [GetString("CommandArgs.Forge.Id"), GetString("CommandArgs.Forge.Role")]),
|
||||
new(["choose", "pick", "выбрать", "选择", "escolher"], "{role}", GetString("CommandDescription.Choose"), Command.UsageLevels.Everyone, Command.UsageTimes.InMeeting, ChooseCommand, true, true, [GetString("CommandArgs.Choose.Role")]),
|
||||
@@ -852,7 +852,17 @@ internal static class ChatCommands
|
||||
|
||||
private static void XORCommand(PlayerControl player, string text, string[] args)
|
||||
{
|
||||
if (args.Length < 3 || !GetRoleByName(args[1], out CustomRoles role1) || !GetRoleByName(args[2], out CustomRoles role2)) return;
|
||||
if (!AmongUsClient.Instance.AmHost)
|
||||
{
|
||||
RequestCommandProcessingFromHost(nameof(XORCommand), text);
|
||||
return;
|
||||
}
|
||||
|
||||
if (!player.IsHost() || args.Length < 3 || !GetRoleByName(args[1], out CustomRoles role1) || !GetRoleByName(args[2], out CustomRoles role2))
|
||||
{
|
||||
Utils.SendMessage(string.Join('\n', Main.XORRoles.ConvertAll(x => $"{x.Item1.ToColoredString()} ⊕ {x.Item2.ToColoredString()}")), player.PlayerId, GetString("XORListTitle"));
|
||||
return;
|
||||
}
|
||||
|
||||
if (Main.XORRoles.Remove((role1, role2)) || Main.XORRoles.Remove((role2, role1)))
|
||||
{
|
||||
@@ -2550,7 +2560,7 @@ internal static class ChatCommands
|
||||
return;
|
||||
}
|
||||
|
||||
if (args.Length < 4)
|
||||
if (!player.IsHost() || args.Length < 4)
|
||||
{
|
||||
if (Main.AlwaysSpawnTogetherCombos.Count == 0 && Main.NeverSpawnTogetherCombos.Count == 0) return;
|
||||
|
||||
@@ -2937,10 +2947,10 @@ internal static class ChatCommands
|
||||
|
||||
if (args.Length < 2) return;
|
||||
|
||||
string name = string.Join(' ', args[1..]);
|
||||
string name = Regex.Replace(string.Join(' ', args[1..]), "<size=[^>]*>", string.Empty).Trim();
|
||||
|
||||
if (name.RemoveHtmlTags().Length is > 15 or < 1)
|
||||
Utils.SendMessage(GetString("Message.AllowNameLength"), player.PlayerId);
|
||||
Utils.SendMessage(GetString("Message.AllowNameLength"), player.PlayerId, sendOption: SendOption.None);
|
||||
else
|
||||
{
|
||||
if (player.AmOwner)
|
||||
@@ -2959,12 +2969,6 @@ internal static class ChatCommands
|
||||
return;
|
||||
}
|
||||
|
||||
if (name.Length is > 50 or < 1)
|
||||
{
|
||||
Utils.SendMessage(GetString("Message.AllowNameLength"), player.PlayerId, sendOption: SendOption.None);
|
||||
return;
|
||||
}
|
||||
|
||||
Main.AllPlayerNames[player.PlayerId] = name;
|
||||
player.RpcSetName(name);
|
||||
}
|
||||
|
||||
@@ -2676,6 +2676,7 @@
|
||||
"XORSameRole": "<#ff0000>X</color> XOR combinations must have 2 different roles.",
|
||||
"XORAdditionRole": "<#ff0000>X</color> XOR combinations don't support add-ons. Use <#ffff00>/combo</color> for that.",
|
||||
"XORAdded": "<#00ffa5>✓</color> XOR combination added successfully.",
|
||||
"XORListTitle": "<#00a5ff>➡ XOR Combinations ⬅</color>",
|
||||
"ForgeSuccess": "<#00ffa5>✓</color> Successfully forged {1} as {2}.\\n<size=80%>You have {0} ability uses left.</size>",
|
||||
"ThankYouForUsingEHR": "Thank you for using EHR!",
|
||||
"GMRoles": "<color=#ff5b70>【 ★ Roles ★ 】</color>",
|
||||
|
||||
Reference in new issue
Block a user