Compare commits

...
5 Commits
Author SHA1 Message Date
Gurge44 91e2748156 Fix FFA, Fix Moderator tags, New timer font for S&G 2024-04-05 19:04:05 +02:00
Gurge44 dbb5c39dea Minor fixes 2024-04-03 21:25:25 +02:00
Gurge44 a13cbd9f88 Merge branch 'main' of https://github.com/Gurge44/TOHE_PLUS 2024-04-03 20:24:12 +02:00
Gurge44 333dfbee6f Teamed FFA 2024-04-03 20:24:03 +02:00
PHGaming121 0431d18127 make adventurer things translatable + a little fix 💀 (#50)
* Update Adventurer.cs

* Update en_US.json

* also, heres a little fix lol
2024-04-03 12:06:55 +02:00
16 changed files with 258 additions and 146 deletions

No files matched your search

+142 -91
View File
@@ -22,6 +22,20 @@ internal static class FFAManager
public static string LatestChatMessage = string.Empty;
public static Dictionary<byte, int> PlayerTeams = [];
public static readonly Dictionary<int, string> TeamColors = new()
{
{ 0, "#00ffff" },
{ 1, "#ffff00" },
{ 2, "#ff00ff" },
{ 3, "#ff0000" },
{ 4, "#00ff00" },
{ 5, "#0000ff" },
{ 6, "#ffffff" },
{ 7, "#000000" }
};
public static OptionItem FFAGameTime;
public static OptionItem FFAKcd;
public static OptionItem FFALowerVision;
@@ -36,6 +50,8 @@ internal static class FFAManager
public static OptionItem FFAEnableRandomTwists;
public static OptionItem FFAShieldIsOneTimeUse;
public static OptionItem FFAChatDuringGame;
public static OptionItem FFATeamMode;
public static OptionItem FFATeamNumber;
public static void SetupCustomOption()
{
@@ -84,6 +100,14 @@ internal static class FFAManager
FFAChatDuringGame = BooleanOptionItem.Create(67_223_014, "FFA_ChatDuringGame", false, TabGroup.GameSettings, false)
.SetGameMode(CustomGameMode.FFA)
.SetColor(new Color32(0, 255, 165, byte.MaxValue));
FFATeamMode = BooleanOptionItem.Create(67_223_015, "FFA_TeamMode", false, TabGroup.GameSettings, false)
.SetGameMode(CustomGameMode.FFA)
.SetHeader(true)
.SetColor(new Color32(0, 255, 165, byte.MaxValue));
FFATeamNumber = IntegerOptionItem.Create(67_223_016, "FFA_TeamNumber", new(2, 7, 1), 2, TabGroup.GameSettings, false)
.SetParent(FFATeamMode)
.SetGameMode(CustomGameMode.FFA)
.SetColor(new Color32(0, 255, 165, byte.MaxValue));
}
public static void Init()
@@ -99,10 +123,32 @@ internal static class FFAManager
KillCount = [];
RoundTime = FFAGameTime.GetInt() + 8;
foreach (PlayerControl pc in Main.AllAlivePlayerControls)
PlayerTeams = [];
var allPlayers = Main.AllAlivePlayerControls;
foreach (PlayerControl pc in allPlayers)
{
KillCount[pc.PlayerId] = 0;
}
if (FFATeamMode.GetBool())
{
var teamNum = FFATeamNumber.GetInt();
var playerNum = allPlayers.Length;
int memberNum = (teamNum > 5 && playerNum == 15) || playerNum % teamNum == 0 ? playerNum / teamNum : playerNum / teamNum + 1;
var teamMembers = allPlayers.Select(x => x.PlayerId).Shuffle(IRandom.Instance).Chunk(memberNum).ToList();
for (int i = 0; i < teamMembers.Count; i++)
{
foreach (var id in teamMembers[i])
{
PlayerTeams.Add(id, i);
}
}
_ = new LateTask(() => { Utils.NotifyRoles(NoCache: true, ForceLoop: true); }, 10f, log: false);
}
}
private static void SendRPCSyncFFAPlayer(byte playerId)
@@ -146,15 +192,6 @@ internal static class FFAManager
}
}
public static string GetDisplayScore(byte playerId)
{
int rank = GetRankOfScore(playerId);
string score = KillCount.TryGetValue(playerId, out var s) ? $"{s}" : "Invalid";
string text = string.Format(GetString("KBDisplayScore"), rank.ToString(), score);
Color color = Utils.GetRoleColor(CustomRoles.Killer);
return Utils.ColorString(color, text);
}
public static int GetRankOfScore(byte playerId)
{
try
@@ -184,6 +221,12 @@ internal static class FFAManager
return;
}
if (FFATeamMode.GetBool() && PlayerTeams[killer.PlayerId] == PlayerTeams[target.PlayerId])
{
Logger.Info("Killer and Target are in the same team, attack blocked", "FFA");
return;
}
var totalalive = Main.AllAlivePlayerControls.Length;
if (FFAShieldedList.TryGetValue(target.PlayerId, out var dur))
{
@@ -206,7 +249,7 @@ internal static class FFAManager
if (totalalive == 3)
{
PlayerControl otherPC = null;
foreach (var pc in Main.AllAlivePlayerControls.Where(a => a.PlayerId != killer.PlayerId && a.PlayerId != target.PlayerId && a.IsAlive()).ToArray())
foreach (var pc in Main.AllAlivePlayerControls.Where(a => a.PlayerId != killer.PlayerId && a.PlayerId != target.PlayerId && a.IsAlive()))
{
TargetArrow.Add(killer.PlayerId, pc.PlayerId);
TargetArrow.Add(pc.PlayerId, killer.PlayerId);
@@ -222,90 +265,99 @@ internal static class FFAManager
bool mark = false;
var nowKCD = Main.AllPlayerKillCooldown[killer.PlayerId];
byte EffectType;
if (Main.NormalOptions.MapId != 4) EffectType = (byte)HashRandom.Next(0, 10);
else EffectType = (byte)HashRandom.Next(4, 10);
if (EffectType <= 7) // Buff
if (Main.NormalOptions.MapId != 4) EffectType = (byte)IRandom.Instance.Next(0, 10);
else EffectType = (byte)IRandom.Instance.Next(4, 10);
switch (EffectType)
{
byte EffectID = (byte)HashRandom.Next(0, 3);
if (Main.NormalOptions.MapId == 4) EffectID = 2;
switch (EffectID)
// Buff
case <= 7:
{
case 0:
FFAShieldedList.TryAdd(killer.PlayerId, Utils.TimeStamp);
killer.Notify(GetString("FFA-Event-GetShield"), FFAShieldDuration.GetFloat());
Main.AllPlayerKillCooldown[killer.PlayerId] = FFAKcd.GetFloat();
break;
case 1:
if (FFAIncreasedSpeedList.ContainsKey(killer.PlayerId))
{
FFAIncreasedSpeedList.Remove(killer.PlayerId);
FFAIncreasedSpeedList.Add(killer.PlayerId, Utils.TimeStamp);
}
else
{
FFAIncreasedSpeedList.TryAdd(killer.PlayerId, Utils.TimeStamp);
originalSpeed.TryAdd(killer.PlayerId, Main.AllPlayerSpeed[killer.PlayerId]);
Main.AllPlayerSpeed[killer.PlayerId] = FFAIncreasedSpeed.GetFloat();
}
byte EffectID = (byte)IRandom.Instance.Next(0, 3);
if (Main.NormalOptions.MapId == 4) EffectID = 2;
switch (EffectID)
{
case 0:
FFAShieldedList.TryAdd(killer.PlayerId, Utils.TimeStamp);
killer.Notify(GetString("FFA-Event-GetShield"), FFAShieldDuration.GetFloat());
Main.AllPlayerKillCooldown[killer.PlayerId] = FFAKcd.GetFloat();
break;
case 1:
if (FFAIncreasedSpeedList.ContainsKey(killer.PlayerId))
{
FFAIncreasedSpeedList.Remove(killer.PlayerId);
FFAIncreasedSpeedList.Add(killer.PlayerId, Utils.TimeStamp);
}
else
{
FFAIncreasedSpeedList.TryAdd(killer.PlayerId, Utils.TimeStamp);
originalSpeed.TryAdd(killer.PlayerId, Main.AllPlayerSpeed[killer.PlayerId]);
Main.AllPlayerSpeed[killer.PlayerId] = FFAIncreasedSpeed.GetFloat();
}
killer.Notify(GetString("FFA-Event-GetIncreasedSpeed"), FFAModifiedSpeedDuration.GetFloat());
Main.AllPlayerKillCooldown[killer.PlayerId] = FFAKcd.GetFloat();
mark = true;
break;
case 2:
Main.AllPlayerKillCooldown[killer.PlayerId] = Math.Clamp(FFAKcd.GetFloat() - 3f, 1f, 60f);
killer.Notify(GetString("FFA-Event-GetLowKCD"));
sync = true;
break;
default:
Main.AllPlayerKillCooldown[killer.PlayerId] = FFAKcd.GetFloat();
break;
killer.Notify(GetString("FFA-Event-GetIncreasedSpeed"), FFAModifiedSpeedDuration.GetFloat());
Main.AllPlayerKillCooldown[killer.PlayerId] = FFAKcd.GetFloat();
mark = true;
break;
case 2:
Main.AllPlayerKillCooldown[killer.PlayerId] = Math.Clamp(FFAKcd.GetFloat() - 3f, 1f, 60f);
killer.Notify(GetString("FFA-Event-GetLowKCD"));
sync = true;
break;
default:
Main.AllPlayerKillCooldown[killer.PlayerId] = FFAKcd.GetFloat();
break;
}
break;
}
}
else if (EffectType == 8) // De-Buff
{
byte EffectID = (byte)HashRandom.Next(0, 3);
if (Main.NormalOptions.MapId == 4) EffectID = 1;
switch (EffectID)
// De-Buff
case 8:
{
case 0:
if (FFADecreasedSpeedList.ContainsKey(killer.PlayerId))
{
FFADecreasedSpeedList.Remove(killer.PlayerId);
FFADecreasedSpeedList.Add(killer.PlayerId, Utils.TimeStamp);
}
else
{
FFADecreasedSpeedList.TryAdd(killer.PlayerId, Utils.TimeStamp);
originalSpeed.TryAdd(killer.PlayerId, Main.AllPlayerSpeed[killer.PlayerId]);
Main.AllPlayerSpeed[killer.PlayerId] = FFADecreasedSpeed.GetFloat();
}
byte EffectID = (byte)IRandom.Instance.Next(0, 3);
if (Main.NormalOptions.MapId == 4) EffectID = 1;
switch (EffectID)
{
case 0:
if (FFADecreasedSpeedList.ContainsKey(killer.PlayerId))
{
FFADecreasedSpeedList.Remove(killer.PlayerId);
FFADecreasedSpeedList.Add(killer.PlayerId, Utils.TimeStamp);
}
else
{
FFADecreasedSpeedList.TryAdd(killer.PlayerId, Utils.TimeStamp);
originalSpeed.TryAdd(killer.PlayerId, Main.AllPlayerSpeed[killer.PlayerId]);
Main.AllPlayerSpeed[killer.PlayerId] = FFADecreasedSpeed.GetFloat();
}
killer.Notify(GetString("FFA-Event-GetDecreasedSpeed"), FFAModifiedSpeedDuration.GetFloat());
Main.AllPlayerKillCooldown[killer.PlayerId] = FFAKcd.GetFloat();
mark = true;
break;
case 1:
Main.AllPlayerKillCooldown[killer.PlayerId] = Math.Clamp(FFAKcd.GetFloat() + 3f, 1f, 60f);
killer.Notify(GetString("FFA-Event-GetHighKCD"));
sync = true;
break;
case 2:
FFALowerVisionList.TryAdd(killer.PlayerId, Utils.TimeStamp);
Main.AllPlayerKillCooldown[killer.PlayerId] = FFAKcd.GetFloat();
killer.Notify(GetString("FFA-Event-GetLowVision"));
mark = true;
break;
default:
Main.AllPlayerKillCooldown[killer.PlayerId] = FFAKcd.GetFloat();
break;
killer.Notify(GetString("FFA-Event-GetDecreasedSpeed"), FFAModifiedSpeedDuration.GetFloat());
Main.AllPlayerKillCooldown[killer.PlayerId] = FFAKcd.GetFloat();
mark = true;
break;
case 1:
Main.AllPlayerKillCooldown[killer.PlayerId] = Math.Clamp(FFAKcd.GetFloat() + 3f, 1f, 60f);
killer.Notify(GetString("FFA-Event-GetHighKCD"));
sync = true;
break;
case 2:
FFALowerVisionList.TryAdd(killer.PlayerId, Utils.TimeStamp);
Main.AllPlayerKillCooldown[killer.PlayerId] = FFAKcd.GetFloat();
killer.Notify(GetString("FFA-Event-GetLowVision"));
mark = true;
break;
default:
Main.AllPlayerKillCooldown[killer.PlayerId] = FFAKcd.GetFloat();
break;
}
break;
}
}
else // Mixed
{
_ = new LateTask(() => { killer.TPtoRndVent(); }, 0.5f, "FFA-Event-TP");
killer.Notify(GetString("FFA-Event-GetTP"));
Main.AllPlayerKillCooldown[killer.PlayerId] = FFAKcd.GetFloat();
// Mixed
default:
_ = new LateTask(() => { killer.TPtoRndVent(); }, 0.5f, "FFA-Event-TP");
killer.Notify(GetString("FFA-Event-GetTP"));
Main.AllPlayerKillCooldown[killer.PlayerId] = FFAKcd.GetFloat();
break;
}
if (sync || Math.Abs(nowKCD - Main.AllPlayerKillCooldown[killer.PlayerId]) > 0.1f)
@@ -353,7 +405,7 @@ internal static class FFAManager
LatestChatMessage = string.Format(GetString("FFAChatMessageNotify"), playerName, message);
foreach (var pc in Main.AllAlivePlayerControls)
{
Utils.NotifyRoles(SpecifySeer: pc, SpecifyTarget: pc);
pc.Notify(LatestChatMessage);
}
}
@@ -384,8 +436,7 @@ internal static class FFAManager
var rd = IRandom.Instance;
byte FFAdoTPdecider = (byte)rd.Next(0, 100);
bool FFAdoTP = false;
if (FFAdoTPdecider == 0) FFAdoTP = true;
bool FFAdoTP = FFAdoTPdecider == 0;
if (FFAEnableRandomTwists.GetBool() && FFAdoTP)
{
+12 -4
View File
@@ -62,7 +62,15 @@ public class Counter(int totalGreenTime, int totalRedTime, long startTimeStamp,
public string ColoredTimerString
{
get => IsYellow ? Utils.ColorString(Color.clear, "00") : Utils.ColorString(IsRed ? Color.red : Color.green, Timer < 10 ? $"0{Timer}" : Timer.ToString());
get
{
string result = IsYellow || (Timer == TotalGreenTime && !IsRed && !IsYellow) || (Timer == TotalRedTime && IsRed) ? Utils.ColorString(Color.clear, "00") : Utils.ColorString(IsRed ? Color.red : Color.green, Timer < 10 ? $"0{Timer}" : Timer.ToString());
if (Timer is <= 19 and >= 10 && !IsYellow) result = $" {result}";
if (Timer % 10 == 1 && !IsYellow) result = result.Insert(result.Length - 9, " ");
return $"<font=\"DIGITAL-7 SDF\"><size=130%>{result}</size></font>";
}
}
public string ColoredArrow
@@ -139,10 +147,10 @@ class MoveAndStopPlayerData(Counter leftCounter, Counter middleCounter, Counter
var middleTimer = MiddleCounter.ColoredTimerString;
var rightTimer = RightCounter.ColoredTimerString;
var arrowRow = $"{LeftCounter.ColoredArrow.PadRightV2(4)} {MiddleCounter.ColoredArrow.PadRightV2(4)} {RightCounter.ColoredArrow.PadRightV2(4)}";
var counterRow = $"{leftTimer.PadRightV2(4)} {middleTimer.PadRightV2(4)} {rightTimer.PadRightV2(4)}";
var arrowRow = $"{LeftCounter.ColoredArrow} {MiddleCounter.ColoredArrow} {RightCounter.ColoredArrow}";
var counterRow = $"{leftTimer} {middleTimer} {rightTimer}";
return $"{arrowRow}\n{counterRow}";
return $"{counterRow}\n{arrowRow}";
}
public void UpdateCounters()
+8 -5
View File
@@ -86,14 +86,17 @@ namespace EHR.Modules
{
if (CustomTeams.Count == 0 || CustomTeamPlayerIds.Count == 0) return false;
CustomTeamPlayerIds.Values.Do(x => x.RemoveWhere(p =>
CustomTeamPlayerIds.Do(x => x.Value.RemoveWhere(p =>
{
var pc = Utils.GetPlayerById(p);
return pc == null || !pc.IsAlive() || pc.Data.Disconnected;
return pc == null || pc.Data.Disconnected;
}));
var team = CustomTeamPlayerIds.Keys.First();
if (CustomTeamPlayerIds.Count == 1 && Main.AllAlivePlayerControls.All(x =>
var aliveTeamPlayers = CustomTeamPlayerIds.ToDictionary(x => x.Key, x => x.Value);
aliveTeamPlayers.Do(x => x.Value.RemoveWhere(p => !Utils.GetPlayerById(p).IsAlive()));
var team = aliveTeamPlayers.Keys.First();
if (aliveTeamPlayers.Count == 1 && Main.AllAlivePlayerControls.All(x =>
{
var customTeam = GetCustomTeam(x.PlayerId);
return customTeam != null && customTeam.Equals(team);
@@ -101,7 +104,7 @@ namespace EHR.Modules
{
WinnerTeam = team;
CustomWinnerHolder.ResetAndSetWinner(CustomWinner.CustomTeam);
CustomWinnerHolder.WinnerIds = CustomTeamPlayerIds.Values.First();
CustomWinnerHolder.WinnerIds = aliveTeamPlayers.Values.First();
return true;
}
+1 -1
View File
@@ -25,7 +25,7 @@ public static class DevManager
public static void Init()
{
// Dev
DevUserList.Add(new(code: "actorour#0029", color: "#ffc0cb", tag: "EHR/TONX Developer", isUp: true, isDev: true, deBug: true, colorCmd: true, upName: "KARPED1EM"));
DevUserList.Add(new(code: "actorour#0029", color: "#ffc0cb", tag: "TOHE/TONX Developer", isUp: true, isDev: true, deBug: true, colorCmd: true, upName: "KARPED1EM"));
DevUserList.Add(new(code: "pinklaze#1776", color: "#30548e", tag: "#Dev", isUp: true, isDev: true, deBug: true, colorCmd: false, upName: "NCSIMON"));
DevUserList.Add(new(code: "keepchirpy#6354", color: "#1FF3C6", tag: "Переводчик", isUp: true, isDev: false, deBug: false, colorCmd: true, upName: "TommyXL")); //Tommy-XL
DevUserList.Add(new(code: "taskunsold#2701", color: "null", tag: "<color=#426798>Tem</color><color=#f6e509>mie</color>", isUp: false, isDev: true, deBug: false, colorCmd: false, upName: null)); //Tem
+4 -4
View File
@@ -631,13 +631,13 @@ static class ExtendedPlayerControl
return pc.GetCustomRole() switch
{
//SoloKombat
// SoloKombat
CustomRoles.KB_Normal => true,
//FFA
// FFA
CustomRoles.Killer => true,
//Move And Stop
// Move And Stop
CustomRoles.Tasker => false,
//Hot Potato
// Hot Potato
CustomRoles.Potato => false,
_ => Main.PlayerStates.TryGetValue(pc.PlayerId, out var state) && state.Role.CanUseImpostorVentButton(pc),
+3
View File
@@ -39,6 +39,9 @@ public static class NameColorManager
switch (Options.CurrentGameMode)
{
case CustomGameMode.FFA when FFAManager.FFATeamMode.GetBool():
color = FFAManager.TeamColors[FFAManager.PlayerTeams[target.PlayerId]];
return true;
case CustomGameMode.MoveAndStop:
color = "#ffffff";
return true;
+2 -3
View File
@@ -1587,7 +1587,7 @@ public static class Utils
public static void ApplySuffix(PlayerControl player)
{
if (!AmongUsClient.Instance.AmHost || player == null) return;
if (!(player.AmOwner || player.FriendCode.GetDevUser().HasTag())) return;
if (!player.AmOwner && !player.FriendCode.GetDevUser().HasTag() && !ChatCommands.IsPlayerModerator(player.FriendCode)) return;
string name = Main.AllPlayerNames.TryGetValue(player.PlayerId, out var n) ? n : string.Empty;
if (Main.NickName != string.Empty && player.AmOwner) name = Main.NickName;
if (name == string.Empty) return;
@@ -1915,7 +1915,6 @@ public static class Utils
{
case CustomGameMode.FFA:
SelfSuffix.Append(FFAManager.GetPlayerArrow(seer));
if (FFAManager.FFAChatDuringGame.GetBool()) SelfSuffix.Append(SelfSuffix.Length > 0 && FFAManager.LatestChatMessage != string.Empty ? "\n" : string.Empty).Append(FFAManager.LatestChatMessage);
break;
case CustomGameMode.SoloKombat:
SelfSuffix.Append(SoloKombatManager.GetDisplayHealth(seer));
@@ -2030,7 +2029,7 @@ public static class Utils
seer.RpcSetNamePrivate(SelfName, true, force: NoCache);
// Run the second loop only when necessary, such as when seer is dead
if (seer.Data.IsDead || !seer.IsAlive() || NoCache || CamouflageIsForMeeting || MushroomMixup || IsActive(SystemTypes.MushroomMixupSabotage) || ForceLoop || seerList.Length == 1 || targetList.Length == 1)
if (GameStates.IsLobby || seer.Data.IsDead || !seer.IsAlive() || NoCache || CamouflageIsForMeeting || MushroomMixup || IsActive(SystemTypes.MushroomMixupSabotage) || ForceLoop || seerList.Length == 1 || targetList.Length == 1)
{
foreach (PlayerControl target in targetList)
{
+26 -5
View File
@@ -515,21 +515,42 @@ class GameEndChecker
Logger.Warn($"Winner: {winner.GetRealName().RemoveHtmlTags()}", "FFA");
WinnerIds =
[
winnerId
];
WinnerIds = [winnerId];
Main.DoBlockNameChange = true;
return true;
}
if (FFAManager.FFATeamMode.GetBool())
{
var firstTeam = FFAManager.PlayerTeams.GroupBy(x => x.Value, x => x.Key).Select(x => x.Where(p =>
{
var pc = GetPlayerById(p);
return pc != null && !pc.Data.Disconnected;
}).ToHashSet()).FirstOrDefault(x => x.Count > 0);
if (firstTeam == null)
{
FFAManager.RoundTime = 0;
Logger.Warn("No players alive. Force ending the game", "FFA");
return false;
}
if (Main.AllAlivePlayerControls.All(x => firstTeam.Contains(x.PlayerId)))
{
WinnerIds = firstTeam;
Main.DoBlockNameChange = true;
return true;
}
}
switch (Main.AllAlivePlayerControls.Length)
{
case 1:
{
var winner = Main.AllAlivePlayerControls.First();
var winner = Main.AllAlivePlayerControls[0];
Logger.Info($"Winner: {winner.GetRealName().RemoveHtmlTags()}", "FFA");
+22 -1
View File
@@ -193,6 +193,18 @@ class BeginCrewmatePatch
}
}
if (Options.CurrentGameMode == CustomGameMode.FFA && FFAManager.FFATeamMode.GetBool() && FFAManager.PlayerTeams.TryGetValue(PlayerControl.LocalPlayer.PlayerId, out var ffaTeam))
{
teamToDisplay = new();
foreach (var pc in Main.AllPlayerControls)
{
if (FFAManager.PlayerTeams.TryGetValue(pc.PlayerId, out var team) && team == ffaTeam)
{
teamToDisplay.Add(pc);
}
}
}
return true;
}
@@ -442,33 +454,42 @@ class BeginCrewmatePatch
break;
}
case CustomGameMode.FFA:
{
__instance.TeamTitle.text = GetString("Killer");
__instance.TeamTitle.color = __instance.BackgroundBar.material.color = new Color32(0, 255, 255, byte.MaxValue);
var color = FFAManager.PlayerTeams.TryGetValue(PlayerControl.LocalPlayer.PlayerId, out var team) && ColorUtility.TryParseHtmlString(FFAManager.TeamColors[team], out var teamColor) ? teamColor : new(0, 255, 255, byte.MaxValue);
__instance.TeamTitle.color = __instance.BackgroundBar.material.color = color;
PlayerControl.LocalPlayer.Data.Role.IntroSound = GetIntroSound(RoleTypes.Shapeshifter);
__instance.ImpostorText.gameObject.SetActive(true);
__instance.ImpostorText.text = GetString("KillerInfo");
break;
}
case CustomGameMode.MoveAndStop:
{
__instance.TeamTitle.text = GetString("MoveAndStop");
__instance.TeamTitle.color = __instance.BackgroundBar.material.color = new Color32(0, 255, 160, byte.MaxValue);
PlayerControl.LocalPlayer.Data.Role.IntroSound = GetIntroSound(RoleTypes.Shapeshifter);
__instance.ImpostorText.gameObject.SetActive(true);
__instance.ImpostorText.text = GetString("TaskerInfo");
break;
}
case CustomGameMode.HotPotato:
{
__instance.TeamTitle.text = GetString("HotPotato");
__instance.TeamTitle.color = __instance.BackgroundBar.material.color = new Color32(232, 205, 70, byte.MaxValue);
PlayerControl.LocalPlayer.Data.Role.IntroSound = GetIntroSound(RoleTypes.Shapeshifter);
__instance.ImpostorText.gameObject.SetActive(true);
__instance.ImpostorText.text = GetString("PotatoInfo");
break;
}
case CustomGameMode.HideAndSeek:
{
__instance.TeamTitle.text = GetString("HideAndSeek");
__instance.TeamTitle.color = __instance.BackgroundBar.material.color = new Color32(52, 94, 235, byte.MaxValue);
PlayerControl.LocalPlayer.Data.Role.IntroSound = GetIntroSound(RoleTypes.Impostor);
__instance.ImpostorText.gameObject.SetActive(true);
__instance.ImpostorText.text = GetString("SubText.HideAndSeek");
break;
}
}
if (Input.GetKey(KeyCode.RightShift))
+3 -3
View File
@@ -317,13 +317,13 @@ class CheckForEndVotingPatch
exiledPlayer?.Object.SetRealKiller(null);
//RPC
// RPC
if (AntiBlackout.OverrideExiledPlayer)
{
__instance.RpcVotingComplete(states.ToArray(), null, true);
ExileControllerWrapUpPatch.AntiBlackout_LastExiled = exiledPlayer;
}
else __instance.RpcVotingComplete(states.ToArray(), exiledPlayer, tie); //通常処理
else __instance.RpcVotingComplete(states.ToArray(), exiledPlayer, tie);
CheckForDeathOnExile(PlayerState.DeathReason.Vote, exileId);
@@ -852,7 +852,7 @@ class MeetingHudStartPatch
if (AmongUsClient.Instance.AmHost)
{
_ = _ = new LateTask(() =>
_ = new LateTask(() =>
{
foreach (PlayerControl pc in Main.AllPlayerControls)
{
+1 -1
View File
@@ -231,7 +231,7 @@ class SetEverythingUpPatch
{
var winnerId = CustomWinnerHolder.WinnerIds.FirstOrDefault();
__instance.BackgroundBar.material.color = new Color32(0, 255, 255, 255);
WinnerText.text = Main.AllPlayerNames[winnerId] + " wins!";
WinnerText.text = FFAManager.FFATeamMode.GetBool() ? string.Empty : Main.AllPlayerNames[winnerId] + " wins!";
WinnerText.color = Main.PlayerColors[winnerId];
goto EndOfText;
}
+6 -10
View File
@@ -1268,6 +1268,8 @@ class FixedUpdatePatch
var seer = PlayerControl.LocalPlayer;
var target = __instance;
bool self = seer.PlayerId == target.PlayerId;
Mark.Clear();
Suffix.Clear();
@@ -1327,8 +1329,6 @@ class FixedUpdatePatch
break;
}
bool self = seer.PlayerId == target.PlayerId;
switch (seer.GetCustomRole())
{
case CustomRoles.Lookout:
@@ -1505,7 +1505,6 @@ class FixedUpdatePatch
{
case CustomGameMode.FFA:
Suffix.Append(FFAManager.GetPlayerArrow(seer, target));
if (self && FFAManager.FFAChatDuringGame.GetBool()) Suffix.Append((Suffix.Length > 0 && FFAManager.LatestChatMessage != string.Empty ? "\n" : string.Empty) + FFAManager.LatestChatMessage);
break;
case CustomGameMode.MoveAndStop when self:
Suffix.Append(MoveAndStopManager.GetSuffixText(seer));
@@ -1684,7 +1683,7 @@ class EnterVentPatch
{
Logger.Info($" {pc.GetNameWithRole()}, Vent ID: {__instance.Id} ({__instance.name})", "EnterVent");
if (pc.GetRoleTypes() != RoleTypes.Engineer && !Main.PlayerStates[pc.PlayerId].Role.CanUseImpostorVentButton(pc))
if (pc.GetRoleTypes() != RoleTypes.Engineer && !Main.PlayerStates[pc.PlayerId].Role.CanUseImpostorVentButton(pc) && Options.CurrentGameMode == CustomGameMode.Standard)
{
pc.MyPhysics?.RpcBootFromVent(__instance.Id);
return;
@@ -1799,10 +1798,7 @@ class CoEnterVentPatch
if (Ventguard.BlockedVents.Contains(id))
{
var pc = __instance.myPlayer;
if (Options.VentguardBlockDoesNotAffectCrew.GetBool() && pc.IsCrewmate())
{
}
else
if (!Options.VentguardBlockDoesNotAffectCrew.GetBool() || !pc.IsCrewmate())
{
_ = new LateTask(() =>
{
@@ -1823,7 +1819,7 @@ class CoEnterVentPatch
Circumvent.OnCoEnterVent(__instance, id);
}
if (__instance.myPlayer.GetCustomRole().GetDYRole() == RoleTypes.Impostor && !Main.PlayerStates[__instance.myPlayer.PlayerId].Role.CanUseImpostorVentButton(__instance.myPlayer))
if (__instance.myPlayer.GetCustomRole().GetDYRole() == RoleTypes.Impostor && !Main.PlayerStates[__instance.myPlayer.PlayerId].Role.CanUseImpostorVentButton(__instance.myPlayer) && Options.CurrentGameMode == CustomGameMode.Standard)
{
_ = new LateTask(() => { __instance.RpcBootFromVent(id); }, 0.5f);
}
@@ -1831,7 +1827,7 @@ class CoEnterVentPatch
if (((__instance.myPlayer.Data.Role.Role != RoleTypes.Engineer && !__instance.myPlayer.CanUseImpostorVentButton()) ||
(__instance.myPlayer.Is(CustomRoles.Mayor) && Mayor.MayorUsedButtonCount.TryGetValue(__instance.myPlayer.PlayerId, out var count) && count >= Mayor.MayorNumOfUseButton.GetInt()) ||
(__instance.myPlayer.Is(CustomRoles.Paranoia) && Paranoia.ParaUsedButtonCount.TryGetValue(__instance.myPlayer.PlayerId, out var count2) && count2 >= Options.ParanoiaNumOfUseButton.GetInt()))
&& !__instance.myPlayer.Is(CustomRoles.Nimble) && !__instance.myPlayer.Is(CustomRoles.Bloodlust))
&& !__instance.myPlayer.Is(CustomRoles.Nimble) && !__instance.myPlayer.Is(CustomRoles.Bloodlust) && Options.CurrentGameMode == CustomGameMode.Standard)
{
try
{
+22 -12
View File
@@ -240,7 +240,7 @@
"Infectious": "Infectious",
"Virus": "Virus",
"Pursuer": "Pursuer",
"Phantom": "Phantom",
"Phantom": "Specter",
"Pirate": "Pirate",
"Jinx": "Jinx",
"Maverick": "Maverick",
@@ -761,7 +761,7 @@
"InfectiousInfoLong": "(Neutrals):\\nAs the Infectious, your job is to infect as many players as you can.\\n\\nIf you infect all the killers, you then can simply outnumber the crew and win the game.",
"VirusInfoLong": "(Neutrals):\\nThe virus' goal is to eliminate other players. When a crewmate is killed, their corpse is infected, and the reporting crewmate joins the virus team or dies if the virus isn't voted out. The Virus team wins if they outnumber the Crewmate team.",
"PursuerInfoLong": "(Neutrals):\\nAs the Pursuer, you can use your ability on someone to make them shoot a blank when they try to kill (= reset their kill cooldown).\\n\\nTo win, just survive to the end of the game.",
"PhantomInfoLong": "(Neutrals):\\nAs the Phantom, your job is to get killed and finish your tasks.\\nYou can do your tasks while alive.\\nYou cannot win if you're alive.\\nIf you get killed, you win with the winning team if your tasks are completed.",
"PhantomInfoLong": "(Neutrals):\\nAs the Specter, your job is to get killed and finish your tasks.\\nYou can do your tasks while alive.\\nYou cannot win if you're alive.\\nIf you get killed, you win with the winning team if your tasks are completed.",
"PirateInfoLong": "(Neutrals):\\nAs the Pirate, use your kill button to select a target every round. You will duel with your target when in a meeting. If both the Pirate and the target choose the same number Pirate wins.\\nAdditionally, if Pirate wins the duel, or Target doesn't duel Target will suicide.\\n\\nDueling command:- /duel X (where X can be 0, 1 or 2)\\n\\nYou win after winning a certain number of duels set by the host.",
"JinxInfoLong": "(Neutrals):\\nAs the Jinx, whenever you are attacked, you jinx them, resulting in them dying to a jinx.\\nThis has limited uses.\\n\\nKill off everyone to win.",
"MaverickInfoLong": "(Neutrals):\\nAs the Maverick, you can kill much like a Serial Killer.\\n\\nHowever, you win with the winning team rather than alone.\\nIf you die, you lose.",
@@ -1946,7 +1946,7 @@
"InfectiousBittenPlayer": "You successfully infected a player",
"GuessNotAllowed": "Sorry, your role does not have access to guessing.",
"GuessOnbound": "This player has the Onbound add-on, so your guess on them was canceled.",
"GuessPhantom": "You can't guess a Phantom, that allows them to win!",
"GuessPhantom": "You can't guess a Specter, that allows them to win!",
"DovesOfNeaceOnGuard": "Ability used, {0} uses remain",
"DovesOfNeaceMaxUsage": "Ability use limit reached",
"DovesOfNeaceSkillNotify": "Pacifist reset your kill cooldown",
@@ -3132,6 +3132,14 @@
"AdventurerIngredientsDisplay": "{0}: {1}\\nVent to craft this weapon / Pet to cycle to next weapon",
"AdventurerWeaponCrafted": "Crafted Weapon: {0}",
"AdventurerFound": "Found Resource: {0}",
"AdventurerGun.Gun": "Gun",
"AdventurerGun.Shield": "Shield",
"AdventurerGun.Lantern": "Lantern",
"AdventurerGun.Portal": "Portal",
"AdventurerGun.Wrench": "Wrench",
"AdventurerGun.Proxy": "Proxy",
"AdventurerGun.Prediction": "Prediction",
"AdventurerGun.RNG": "RNG",
"Imitator": "Imitator",
"ImitatorInfo": "Your kill cooldown shifts",
"ImitatorInfoLong": "(Neutral):\\nAs the Imitator, your kill cooldown is different after every even numbered kill and every odd numbered kill of yours. You have a separate cooldown after meetings. Your first kill after every meeting will set your cooldown to the Even-Numbered Kill Cooldown, your second kill will set it to the Odd-Numbered Kill Cooldown, and the process repeats until a meeting is called again.",
@@ -3229,6 +3237,8 @@
"FFA_LowerVision": "Lowered Vision",
"FFA_ModifiedVisionDuration": "Lowered Vision Duration",
"FFA_EnableRandomTwists": "Enable Random Swaps from time to time",
"FFA_TeamMode": "Enable Team Mode",
"FFA_TeamNumber": "Number of Teams",
"FFA-Event-GetShield": "You have a temporary shield!",
"FFA-Event-GetIncreasedSpeed": "You have a temporary speed boost!",
"FFA-Event-GetLowKCD": "You got a lower kill cooldown!",
@@ -3327,8 +3337,8 @@
"CommanderInfo": "Command your team",
"CommanderInfoLong": "(Impostors):\\nAs the Commander, you can switch between 6 modes by venting/petting your pet. You can execute the selected action by shapeshifting.<size=70%>\\n\\n<b><u>Mark:</u></b> Marks your shapeshift target with a unique color visible to all impostors. Use this to command them to kill that player!\\n\\n<b><u>Whistle:</u></b> This tells all or 1 specific<sup>*</sup> impostor(s) to come to you and gives them (each) an arrow pointing towards you.\\n\\n<b><u>Kill Anyone:</u></b> Notifies all or 1 specific<sup>*</sup> impostor(s) to kill anyone.\\n\\n<b><u>Leave Player Alive:</u></b> Shapeshifting into a crewmate marks that player with a unique color and text telling other impostors to not kill that player. Shapeshifting into an impostor tells that impostor to not kill anyone.\\n\\n<b><u>Don't Sabotage:</u></b> Notifies all impostors to not call any sabotage.\\n\\n<b><u>Use Ability:</u></b> Notifies all or 1 specific<sup>*</sup> impostor(s) to use their ability.\\n\\n<size=60%><sup>*</sup> If you shapeshift into an impostor, the action executes specifically and only on them.</size></size>",
"CommanderNotify": "The Commander wants you to meet with them",
"CommanderTarget": "<size=1.7>Commander's target</color>",
"CommanderDontKill": "<size=1.7>Don't kill this player</color>",
"CommanderTarget": "<size=1.7>Commander's target</size>",
"CommanderDontKill": "<size=1.7>Don't kill this player</size>",
"CommanderWhistling": "Whistling",
"CommanderKillAnyoneNotify": "Commander wants you to kill anyone",
"CommanderDontSabotageNotify": "Commander wants you to not sabotage",
@@ -3447,11 +3457,11 @@
"WardenInfoLong": "(Crewmates):\\nAs the Warden, you can protect someone (optimally a crewmate) to notify them about being in danger and to give them a temporary speed boost.",
"WardenNotify": "The Warden warns you that you're in danger!",
"Prefix.Warden": "Warden",
"Specter": "Specter",
"Specter": "Phantom",
"SpecterInfo": "Finish Tasks to Win!",
"SpecterInfoLong": "(Crewmates):\\nAs the Specter, you must finish all of your tasks to win! Depending on a setting, you may also end the game and win alone if you do so!",
"SpecterInfoLong": "(Crewmates):\\nAs the Phantom, you must finish all of your tasks to win! Depending on a setting, you may also end the game and win alone if you do so!",
"SnatchWin": "Snatches Win (Win With Winning Team if Off)",
"Prefix.Specter": "Specter",
"Prefix.Specter": "Phantom",
"Haunter": "Haunter",
"HaunterInfo": "You're the Impostors' Worst Nightmare",
"HaunterInfoLong": "(Neutrals):\\nAs the Haunter, when you complete all of your tasks, a random living impostor's name will show in red to everyone in meetings. When you have 1 task left, all impostors will get an arrow pointing towards you, and if any of them come close to you, you lose this role.",
@@ -3828,7 +3838,7 @@
"WinnerRoleText.Infectious": "Infectious Wins!",
"WinnerRoleText.Rogue": "Mavericks Win!",
"WinnerRoleText.Virus": "Virus Wins!",
"WinnerRoleText.Phantom": "Phantom Wins!",
"WinnerRoleText.Phantom": "Specter Wins!",
"WinnerRoleText.Jinx": "Jinx Wins!",
"WinnerRoleText.CursedSoul": "Cursed Soul Wins!",
"WinnerRoleText.Ritualist": "Ritualist Wins!",
@@ -3860,7 +3870,7 @@
"WinnerRoleText.Sprayer": "Sprayer Wins!",
"WinnerRoleText.SoulHunter": "Soul Hunter Wins!",
"WinnerRoleText.Tiger": "Tiger Wins!",
"WinnerRoleText.Specter": "Specter Wins!",
"WinnerRoleText.Specter": "Phantom Wins!",
"WinnerRoleText.Default": "{0} Wins!",
"AdditionalWinnerRoleText.Sidekick": "along with Sidekicks",
"AdditionalWinnerRoleText.Opportunist": "The Opportunist survived",
@@ -3874,13 +3884,13 @@
"AdditionalWinnerRoleText.Jester": "The Jester wins along",
"AdditionalWinnerRoleText.Lovers": "Lovers win along",
"AdditionalWinnerRoleText.Executioner": "Executioner wins along",
"AdditionalWinnerRoleText.Phantom": "Phantom wins along",
"AdditionalWinnerRoleText.Phantom": "Specter wins along",
"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",
"AdditionalWinnerRoleText.SoulHunter": "Soul Hunter wins along",
"AdditionalWinnerRoleText.Specter": "Specter wins along",
"AdditionalWinnerRoleText.Specter": "Phantom wins along",
"AdditionalWinnerRoleText.Default": "{0} wins along",
"ErrorEndText": "An error occurred",
"ErrorEndTextDescription": "To avoid crashing, the game was forcibly ended.",
+3 -3
View File
@@ -136,7 +136,7 @@ namespace EHR.Roles.Crewmate
case false when Ingredients[SelectedWeaponToCraft].All(x => x.Count <= ResourceCounts[x.Resource]):
var weapon = SelectedWeaponToCraft == Weapon.RNG ? EnabledWeapons[IRandom.Instance.Next(EnabledWeapons.Count)] : SelectedWeaponToCraft;
ActiveWeapons.Add(weapon);
pc.Notify(string.Format(Translator.GetString("AdventurerWeaponCrafted"), $"{weapon}"));
pc.Notify(string.Format(Translator.GetString("AdventurerWeaponCrafted"), Translator.GetString($"AdventurerGun.{weapon}")));
foreach ((Resource resource, int count) in Ingredients[weapon])
{
ResourceCounts[resource] -= count;
@@ -353,7 +353,7 @@ namespace EHR.Roles.Crewmate
finalText += av.InCraftingMode
? string.Format(
Translator.GetString("AdventurerIngredientsDisplay"),
$"{av.SelectedWeaponToCraft}",
Translator.GetString($"AdventurerGun.{av.SelectedWeaponToCraft}"),
string.Join(' ', Ingredients[av.SelectedWeaponToCraft]
.Select(x => $"{Utils.ColorString(ResourceDisplayData[x.Resource].Color, $"{ResourceDisplayData[x.Resource].Icon}")}" +
$"{Utils.ColorString(x.Count > av.ResourceCounts[x.Resource] ? Color.red : Color.white, $"{x.Count}")}")))
@@ -363,4 +363,4 @@ namespace EHR.Roles.Crewmate
return finalText;
}
}
}
}
+1 -1
View File
@@ -221,7 +221,7 @@ public class Witch : RoleBase
{
if (Main.PlayerStates[id].Role is Witch { IsEnable: true } wc && wc.IsSpelled(target))
{
return Utils.ColorString(Palette.ImpostorRed, "†");
return Utils.ColorString(wc.IsHM ? Utils.GetRoleColor(CustomRoles.HexMaster) : Palette.ImpostorRed, "†");
}
}
+2 -2
View File
@@ -35,8 +35,8 @@ public class Main : BasePlugin
public const string DebugKeySalt = "59687b";
public static ConfigEntry<string> DebugKeyInput { get; private set; }
public const string PluginGuid = "com.gurge44.endlesshostroles";
public const string PluginVersion = "3.1.2";
public const string PluginDisplayVersion = "3.1.2";
public const string PluginVersion = "3.1.4";
public const string PluginDisplayVersion = "3.1.4";
public static readonly string SupportedAUVersion = "2024.3.5";
public Harmony Harmony { get; } = new(PluginGuid);