mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
Some fixes
This commit is contained in:
1 parent
b2013dc25f
commit
9a944d9fd3
12 files changed
+170
-164
No files matched your search
@@ -215,7 +215,7 @@ static class ExtendedPlayerControl
|
||||
if (realKiller != null) pc.SetRealKiller(realKiller);
|
||||
|
||||
Medic.IsDead(pc);
|
||||
if (realKiller != null && realKiller.Is(CustomRoles.Damocles)) Damocles.OnMurder();
|
||||
if (realKiller != null && realKiller.Is(CustomRoles.Damocles)) Damocles.OnMurder(realKiller.PlayerId);
|
||||
|
||||
pc.Kill(pc);
|
||||
}
|
||||
@@ -1404,7 +1404,7 @@ static class ExtendedPlayerControl
|
||||
|
||||
if (target.GetTeam() is Team.Impostor or Team.Neutral) Stressed.OnNonCrewmateDead();
|
||||
|
||||
if (killer.Is(CustomRoles.Damocles)) Damocles.OnMurder();
|
||||
if (killer.Is(CustomRoles.Damocles)) Damocles.OnMurder(killer.PlayerId);
|
||||
else if (killer.Is(Team.Impostor)) Damocles.OnOtherImpostorMurder();
|
||||
if (target.Is(Team.Impostor)) Damocles.OnImpostorDeath();
|
||||
|
||||
|
||||
@@ -1124,7 +1124,7 @@ public static class Options
|
||||
NameDisplayAddons = BooleanOptionItem.Create(210, "NameDisplayAddons", true, TabGroup.Addons, false)
|
||||
.SetGameMode(CustomGameMode.Standard)
|
||||
.SetHeader(true);
|
||||
NoLimitAddonsNumMax = IntegerOptionItem.Create(211, "NoLimitAddonsNumMax", new(1, 15, 1), 1, TabGroup.Addons, false)
|
||||
NoLimitAddonsNumMax = IntegerOptionItem.Create(211, "NoLimitAddonsNumMax", new(1, 90, 1), 1, TabGroup.Addons, false)
|
||||
.SetGameMode(CustomGameMode.Standard);
|
||||
|
||||
//==================================================================================================================================//
|
||||
@@ -3705,7 +3705,7 @@ public static class Options
|
||||
.SetHeader(true)
|
||||
.SetGameMode(customGameMode) as StringOptionItem;
|
||||
|
||||
var countOption = IntegerOptionItem.Create(id + 1, "Maximum", new(1, canSetNum ? 10 : 1, 1), 1, tab, false)
|
||||
var countOption = IntegerOptionItem.Create(id + 1, "Maximum", new(1, canSetNum ? 15 : 1, 1), 1, tab, false)
|
||||
.SetParent(spawnOption)
|
||||
.SetValueFormat(OptionFormat.Players)
|
||||
.SetHidden(!canSetNum)
|
||||
|
||||
+20
-12
@@ -230,24 +230,32 @@ public static class Translator
|
||||
if (File.Exists(path))
|
||||
{
|
||||
Logger.Info($"Loading Custom Translation File:{filename}", "LoadCustomTranslation");
|
||||
using StreamReader sr = new(path, Encoding.GetEncoding("UTF-8"));
|
||||
string text;
|
||||
string[] tmp = [];
|
||||
while ((text = sr.ReadLine()) != null)
|
||||
try
|
||||
{
|
||||
tmp = text.Split(":");
|
||||
if (tmp.Length > 1 && tmp[1] != "")
|
||||
using StreamReader sr = new(path, Encoding.GetEncoding("UTF-8"));
|
||||
string text;
|
||||
string[] tmp = [];
|
||||
while ((text = sr.ReadLine()) != null)
|
||||
{
|
||||
try
|
||||
tmp = text.Split(":");
|
||||
if (tmp.Length > 1 && tmp[1] != "")
|
||||
{
|
||||
translateMaps[tmp[0]][(int)lang] = tmp.Skip(1).Join(delimiter: ":").Replace("\\n", "\n").Replace("\\r", "\r");
|
||||
}
|
||||
catch (KeyNotFoundException)
|
||||
{
|
||||
Logger.Warn($"Invalid Key:{tmp[0]}", "LoadCustomTranslation");
|
||||
try
|
||||
{
|
||||
translateMaps[tmp[0]][(int)lang] = tmp.Skip(1).Join(delimiter: ":").Replace("\\n", "\n").Replace("\\r", "\r");
|
||||
}
|
||||
catch (KeyNotFoundException)
|
||||
{
|
||||
Logger.Warn($"Invalid Key:{tmp[0]}", "LoadCustomTranslation");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (ObjectDisposedException) { }
|
||||
catch (Exception e)
|
||||
{
|
||||
Logger.Error(e.ToString(), "Translator.LoadCustomTranslation");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
+2
-1
@@ -384,7 +384,7 @@ public static class Utils
|
||||
if (Options.NameDisplayAddons.GetBool() && !pure && self)
|
||||
{
|
||||
foreach (var subRole in targetSubRoles.Where(x => x is not CustomRoles.LastImpostor and not CustomRoles.Madmate and not CustomRoles.Charmed and not CustomRoles.Recruit and not CustomRoles.Admired and not CustomRoles.Soulless and not CustomRoles.Lovers and not CustomRoles.Infected and not CustomRoles.Contagious))
|
||||
RoleText = ColorString(GetRoleColor(subRole), (Options.AddBracketsToAddons.GetBool() ? "<#ffffff>(</color>" : string.Empty) + GetString("Prefix." + subRole.ToString())) + (Options.AddBracketsToAddons.GetBool() ? "<#ffffff>)</color>" : string.Empty) + RoleText;
|
||||
RoleText = ColorString(GetRoleColor(subRole), (Options.AddBracketsToAddons.GetBool() ? "<#ffffff>(</color>" : string.Empty) + GetString("Prefix." + subRole.ToString()) + " " + (Options.AddBracketsToAddons.GetBool() ? "<#ffffff>)</color>" : string.Empty)) + RoleText;
|
||||
}
|
||||
|
||||
if (targetSubRoles.Contains(CustomRoles.Madmate))
|
||||
@@ -3037,4 +3037,5 @@ public static class Utils
|
||||
public static int PlayersCount(CountTypes countTypes) => Main.PlayerStates.Values.Count(state => state.countTypes == countTypes);
|
||||
public static int AlivePlayersCount(CountTypes countTypes) => Main.AllAlivePlayerControls.Count(pc => pc.Is(countTypes));
|
||||
public static int IsOneAlive(CountTypes countTypes) => Main.AllAlivePlayerControls.Any(pc => pc.Is(countTypes)) ? 1 : 0;
|
||||
public static bool IsNonHostModClient(this byte id) => id != 0 && Main.playerVersion.ContainsKey(id);
|
||||
}
|
||||
+20
-4
@@ -594,14 +594,22 @@ class HudManagerPatch
|
||||
bool CanUseVent = (player.CanUseImpostorVentButton() || player.inVent || player.MyPhysics.Animations.IsPlayingEnterVentAnimation()) && GameStates.IsInTask;
|
||||
__instance.ImpostorVentButton?.ToggleVisible(CanUseVent);
|
||||
player.Data.Role.CanVent = CanUseVent;
|
||||
if (player.PlayerId == 0 && player.inVent && GameStates.IsInTask)
|
||||
|
||||
var vents = Object.FindObjectsOfType<Vent>().ToArray();
|
||||
if (player.PlayerId == 0 && player.inVent && GameStates.IsInTask) SetVentButtonEnabled(TryMoveToVentPatch.HostVentTarget);
|
||||
else if (CanUseVent && vents.Any(vent => Vector2.Distance(new Vector2(vent.transform.position.x, vent.transform.position.y + 0.3636f), player.Pos()) < 0.4f))
|
||||
{
|
||||
Vent vent = vents.FirstOrDefault(vent => Vector2.Distance(new Vector2(vent.transform.position.x, vent.transform.position.y + 0.3636f), player.Pos()) < 0.4f);
|
||||
SetVentButtonEnabled(vent);
|
||||
}
|
||||
void SetVentButtonEnabled(Vent target)
|
||||
{
|
||||
__instance.ImpostorVentButton.canInteract = true;
|
||||
__instance.ImpostorVentButton.enabled = true;
|
||||
__instance.ImpostorVentButton.isCoolingDown = false;
|
||||
__instance.ImpostorVentButton.SetEnabled();
|
||||
__instance.ImpostorVentButton.currentTarget = TryMoveToVentPatch.HostVentTarget;
|
||||
__instance.ImpostorVentButton.SetTarget(TryMoveToVentPatch.HostVentTarget);
|
||||
__instance.ImpostorVentButton.currentTarget = target;
|
||||
__instance.ImpostorVentButton.SetTarget(target);
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -788,7 +796,15 @@ class VentButtonDoClickPatch
|
||||
TryMoveToVentPatch.HostVentTarget.SetButtons(false);
|
||||
return true;
|
||||
}
|
||||
if (!pc.Is(CustomRoles.Swooper) || !pc.Is(CustomRoles.Wraith) || !pc.Is(CustomRoles.Chameleon) || pc.inVent || __instance.currentTarget == null || !pc.CanMove || !__instance.isActiveAndEnabled) return true;
|
||||
if (pc.inVent || !pc.CanMove) return true;
|
||||
var vents = Object.FindObjectsOfType<Vent>().ToArray();
|
||||
if (vents.Any(vent => Vector2.Distance(new Vector2(vent.transform.position.x, vent.transform.position.y + 0.3636f), pc.Pos()) < 0.4f))
|
||||
{
|
||||
Vent vent = vents.FirstOrDefault(vent => Vector2.Distance(new Vector2(vent.transform.position.x, vent.transform.position.y + 0.3636f), pc.Pos()) < 0.4f);
|
||||
pc.MyPhysics.RpcEnterVent(vent.Id);
|
||||
vent.SetButtons(true);
|
||||
return false;
|
||||
}
|
||||
pc?.MyPhysics?.RpcEnterVent(__instance.currentTarget.Id);
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -157,7 +157,7 @@ class SetEverythingUpPatch
|
||||
var color = Main.roleColors[role];
|
||||
var rolename = Utils.GetRoleName(role);
|
||||
poolablePlayer.cosmetics.nameText.text += $"\n<color={color}>{rolename}</color>";
|
||||
poolablePlayer.cosmetics.nameText.transform.localPosition = new Vector3(defaultPos.x, !lowered || role.IsImpostor() || role.IsNK() ? defaultPos.y - 0.6f : defaultPos.y - 1.4f, -15f);
|
||||
poolablePlayer.cosmetics.nameText.transform.localPosition = new Vector3(defaultPos.x, !lowered || role.IsImpostorTeamV3() || role.IsNK() ? defaultPos.y - 0.6f : defaultPos.y - 1.4f, -15f);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1938,7 +1938,7 @@ class ReportDeadBodyPatch
|
||||
|
||||
if (player.Is(CustomRoles.Damocles))
|
||||
{
|
||||
Damocles.OnReport();
|
||||
Damocles.OnReport(player.PlayerId);
|
||||
}
|
||||
Damocles.OnMeetingStart();
|
||||
|
||||
@@ -3034,7 +3034,7 @@ class FixedUpdatePatch
|
||||
target.cosmetics.nameText.text = changeTo;
|
||||
|
||||
float offset = 0.2f;
|
||||
if (NameNotifyManager.Notice.TryGetValue(target.PlayerId, out var notify) && notify.TEXT.Contains('\n'))
|
||||
if (NameNotifyManager.Notice.TryGetValue(seer.PlayerId, out var notify) && notify.TEXT.Contains('\n'))
|
||||
{
|
||||
offset += 0.1f;
|
||||
}
|
||||
@@ -3075,14 +3075,12 @@ class FixedUpdatePatch
|
||||
{
|
||||
foreach (PlayerControl loversPlayer in Main.LoversPlayers.ToArray())
|
||||
{
|
||||
if (!loversPlayer.Data.IsDead && loversPlayer.PlayerId != deathId)
|
||||
continue;
|
||||
if (!loversPlayer.Data.IsDead && loversPlayer.PlayerId != deathId) continue;
|
||||
Main.isLoversDead = true;
|
||||
for (int i1 = 0; i1 < Main.LoversPlayers.Count; i1++)
|
||||
{
|
||||
PlayerControl partnerPlayer = Main.LoversPlayers[i1];
|
||||
if (loversPlayer.PlayerId == partnerPlayer.PlayerId)
|
||||
continue;
|
||||
if (loversPlayer.PlayerId == partnerPlayer.PlayerId) continue;
|
||||
if (partnerPlayer.PlayerId != deathId && !partnerPlayer.Data.IsDead)
|
||||
{
|
||||
if (partnerPlayer.Is(CustomRoles.Lovers))
|
||||
@@ -3234,7 +3232,7 @@ class EnterVentPatch
|
||||
|
||||
if (pc.Is(CustomRoles.Damocles))
|
||||
{
|
||||
Damocles.OnEnterVent(__instance.Id);
|
||||
Damocles.OnEnterVent(pc.PlayerId, __instance.Id);
|
||||
}
|
||||
|
||||
switch (pc.GetCustomRole())
|
||||
|
||||
@@ -187,7 +187,7 @@ class RepairSystemPatch
|
||||
Utils.NotifyRoles(SpecifySeer: player, SpecifyTarget: player);
|
||||
break;
|
||||
}
|
||||
if (player.Is(CustomRoles.Damocles) && Damocles.countRepairSabotage) Damocles.OnRepairSabotage();
|
||||
if (player.Is(CustomRoles.Damocles) && Damocles.countRepairSabotage) Damocles.OnRepairSabotage(player.PlayerId);
|
||||
if (player.Is(CustomRoles.Stressed) && Stressed.countRepairSabotage) Stressed.OnRepairSabotage(player);
|
||||
}
|
||||
break;
|
||||
@@ -199,7 +199,7 @@ class RepairSystemPatch
|
||||
case SystemTypes.Laboratory:
|
||||
case SystemTypes.HeliSabotage:
|
||||
case SystemTypes.Electrical:
|
||||
if (player.Is(CustomRoles.Damocles) && Damocles.countRepairSabotage) Damocles.OnRepairSabotage();
|
||||
if (player.Is(CustomRoles.Damocles) && Damocles.countRepairSabotage) Damocles.OnRepairSabotage(player.PlayerId);
|
||||
if (player.Is(CustomRoles.Stressed) && Stressed.countRepairSabotage) Stressed.OnRepairSabotage(player);
|
||||
break;
|
||||
}
|
||||
|
||||
+48
-96
@@ -291,90 +291,48 @@
|
||||
"Antidote": "Antidote",
|
||||
"Swift": "Swift",
|
||||
"Ghoul": "Ghoul",
|
||||
"Prefix.Ntr": "Neptune ",
|
||||
"Prefix.Watcher": "Watcher ",
|
||||
"Prefix.Flashman": "Flash ",
|
||||
"Prefix.Torch": "Torch ",
|
||||
"Prefix.Seer": "Seer ",
|
||||
"Prefix.Brakar": "Tiebreaker ",
|
||||
"Prefix.Oblivious": "Oblivious ",
|
||||
"Prefix.Bewilder": "Bewilder ",
|
||||
"Prefix.Workhorse": "Workhorse ",
|
||||
"Prefix.Fool": "Fool ",
|
||||
"Prefix.Avanger": "Avenger ",
|
||||
"Prefix.Youtuber": "YouTuber ",
|
||||
"Prefix.Egoist": "Egoist ",
|
||||
"Prefix.TicketsStealer": "Stealer ",
|
||||
"Prefix.DualPersonality": "Schizophrenic ",
|
||||
"Prefix.Mimic": "Mimic ",
|
||||
"Prefix.Bait": "Bait ",
|
||||
"Prefix.Trapper": "Beartrap ",
|
||||
"Prefix.Guesser": "Guesser ",
|
||||
"Prefix.Necroview": "Necroview ",
|
||||
"Prefix.Recruit": "Recruit ",
|
||||
"Prefix.Reach": "Reach ",
|
||||
"Prefix.Onbound": "Onbound ",
|
||||
"Prefix.Knighted": "Knighted ",
|
||||
"Prefix.Unreportable": "Disregarded ",
|
||||
"Prefix.Rogue": "Rogue ",
|
||||
"Prefix.Lucky": "Lucky ",
|
||||
"Prefix.DoubleShot": "Double Shot ",
|
||||
"Prefix.Rascal": "Rascal ",
|
||||
"Prefix.Gravestone": "Gravestone ",
|
||||
"Prefix.Lazy": "Lazy ",
|
||||
"Prefix.Autopsy": "Autopsy ",
|
||||
"Prefix.Loyal": "Loyal ",
|
||||
"Prefix.EvilSpirit": "Evil Spirit ",
|
||||
"Prefix.Glow": "Glow ",
|
||||
"Prefix.Diseased": "Diseased ",
|
||||
"Prefix.Antidote": "Antidote ",
|
||||
"Prefix.Swift": "Swift ",
|
||||
"Prefix.Unlucky": "Unlucky ",
|
||||
"Prefix.Ghoul": "Ghoul ",
|
||||
"Prefix.Sunglasses": "Sunglasses ",
|
||||
"Prefix.Mare": "Mare ",
|
||||
"PrefixB.Ntr": "<color=#ffffff>(</color>Neptune<color=#ffffff>)</color> ",
|
||||
"PrefixB.Watcher": "<color=#ffffff>(</color>Watcher<color=#ffffff>)</color> ",
|
||||
"PrefixB.Flashman": "<color=#ffffff>(</color>Flash<color=#ffffff>)</color> ",
|
||||
"PrefixB.Torch": "<color=#ffffff>(</color>Torch<color=#ffffff>)</color> ",
|
||||
"PrefixB.Seer": "<color=#ffffff>(</color>Seer<color=#ffffff>)</color> ",
|
||||
"PrefixB.Brakar": "<color=#ffffff>(</color>Tiebreaker<color=#ffffff>)</color> ",
|
||||
"PrefixB.Oblivious": "<color=#ffffff>(</color>Oblivious<color=#ffffff>)</color> ",
|
||||
"PrefixB.Bewilder": "<color=#ffffff>(</color>Bewilder<color=#ffffff>)</color> ",
|
||||
"PrefixB.Workhorse": "<color=#ffffff>(</color>Workhorse<color=#ffffff>)</color> ",
|
||||
"PrefixB.Fool": "<color=#ffffff>(</color>Fool<color=#ffffff>)</color> ",
|
||||
"PrefixB.Avanger": "<color=#ffffff>(</color>Avenger<color=#ffffff>)</color> ",
|
||||
"PrefixB.Youtuber": "<color=#ffffff>(</color>YouTuber<color=#ffffff>)</color> ",
|
||||
"PrefixB.Egoist": "<color=#ffffff>(</color>Egoist<color=#ffffff>)</color> ",
|
||||
"PrefixB.TicketsStealer": "<color=#ffffff>(</color>Stealer<color=#ffffff>)</color> ",
|
||||
"PrefixB.DualPersonality": "<color=#ffffff>(</color>Schizophrenic<color=#ffffff>)</color> ",
|
||||
"PrefixB.Mimic": "<color=#ffffff>(</color>Mimic<color=#ffffff>)</color> ",
|
||||
"PrefixB.Bait": "<color=#ffffff>(</color>Bait<color=#ffffff>)</color> ",
|
||||
"PrefixB.Trapper": "<color=#ffffff>(</color>Beartrap<color=#ffffff>)</color> ",
|
||||
"PrefixB.Guesser": "<color=#ffffff>(</color>Guesser<color=#ffffff>)</color> ",
|
||||
"PrefixB.Necroview": "<color=#ffffff>(</color>Necroview<color=#ffffff>)</color> ",
|
||||
"PrefixB.Recruit": "<color=#ffffff>(</color>Recruit<color=#ffffff>)</color> ",
|
||||
"PrefixB.Reach": "<color=#ffffff>(</color>Reach<color=#ffffff>)</color> ",
|
||||
"PrefixB.Onbound": "<color=#ffffff>(</color>Onbound<color=#ffffff>)</color> ",
|
||||
"PrefixB.Knighted": "<color=#ffffff>(</color>Knighted<color=#ffffff>)</color> ",
|
||||
"PrefixB.Unreportable": "<color=#ffffff>(</color>Disregarded<color=#ffffff>)</color> ",
|
||||
"PrefixB.Rogue": "<color=#ffffff>(</color>Rogue<color=#ffffff>)</color> ",
|
||||
"PrefixB.Lucky": "<color=#ffffff>(</color>Lucky<color=#ffffff>)</color> ",
|
||||
"PrefixB.DoubleShot": "<color=#ffffff>(</color>Double Shot<color=#ffffff>)</color> ",
|
||||
"PrefixB.Rascal": "<color=#ffffff>(</color>Rascal<color=#ffffff>)</color> ",
|
||||
"PrefixB.Gravestone": "<color=#ffffff>(</color>Gravestone<color=#ffffff>)</color> ",
|
||||
"PrefixB.Lazy": "<color=#ffffff>(</color>Lazy<color=#ffffff>)</color> ",
|
||||
"PrefixB.Autopsy": "<color=#ffffff>(</color>Autopsy<color=#ffffff>)</color> ",
|
||||
"PrefixB.Loyal": "<color=#ffffff>(</color>Loyal<color=#ffffff>)</color> ",
|
||||
"PrefixB.EvilSpirit": "<color=#ffffff>(</color>Evil Spirit<color=#ffffff>)</color> ",
|
||||
"PrefixB.Glow": "<color=#ffffff>(</color>Glow<color=#ffffff>)</color> ",
|
||||
"PrefixB.Diseased": "<color=#ffffff>(</color>Diseased<color=#ffffff>)</color> ",
|
||||
"PrefixB.Antidote": "<color=#ffffff>(</color>Antidote<color=#ffffff>)</color> ",
|
||||
"PrefixB.Swift": "<color=#ffffff>(</color>Swift<color=#ffffff>)</color> ",
|
||||
"PrefixB.Unlucky": "<color=#ffffff>(</color>Unlucky<color=#ffffff>)</color> ",
|
||||
"PrefixB.Ghoul": "<color=#ffffff>(</color>Ghoul<color=#ffffff>)</color> ",
|
||||
"PrefixB.Sunglasses": "<color=#ffffff>(</color>Sunglasses<color=#ffffff>)</color> ",
|
||||
"PrefixB.Mare": "<color=#ffffff>(</color>Mare<color=#ffffff>)</color> ",
|
||||
"Prefix.Ntr": "Neptune",
|
||||
"Prefix.Watcher": "Watcher",
|
||||
"Prefix.Flashman": "Flash",
|
||||
"Prefix.Torch": "Torch",
|
||||
"Prefix.Seer": "Seer",
|
||||
"Prefix.Brakar": "Tiebreaker",
|
||||
"Prefix.Oblivious": "Oblivious",
|
||||
"Prefix.Bewilder": "Bewilder",
|
||||
"Prefix.Workhorse": "Workhorse",
|
||||
"Prefix.Fool": "Fool",
|
||||
"Prefix.Avanger": "Avenger",
|
||||
"Prefix.Youtuber": "YouTuber",
|
||||
"Prefix.Egoist": "Egoist",
|
||||
"Prefix.TicketsStealer": "Stealer",
|
||||
"Prefix.DualPersonality": "Schizophrenic",
|
||||
"Prefix.Mimic": "Mimic",
|
||||
"Prefix.Bait": "Bait",
|
||||
"Prefix.Trapper": "Beartrap",
|
||||
"Prefix.Guesser": "Guesser",
|
||||
"Prefix.Necroview": "Necroview",
|
||||
"Prefix.Recruit": "Recruit",
|
||||
"Prefix.Reach": "Reach",
|
||||
"Prefix.Onbound": "Onbound",
|
||||
"Prefix.Knighted": "Knighted",
|
||||
"Prefix.Unreportable": "Disregarded",
|
||||
"Prefix.Rogue": "Rogue",
|
||||
"Prefix.Lucky": "Lucky",
|
||||
"Prefix.DoubleShot": "Double Shot",
|
||||
"Prefix.Rascal": "Rascal",
|
||||
"Prefix.Gravestone": "Gravestone",
|
||||
"Prefix.Lazy": "Lazy",
|
||||
"Prefix.Autopsy": "Autopsy",
|
||||
"Prefix.Loyal": "Loyal",
|
||||
"Prefix.EvilSpirit": "Evil Spirit",
|
||||
"Prefix.Glow": "Glow",
|
||||
"Prefix.Diseased": "Diseased",
|
||||
"Prefix.Antidote": "Antidote",
|
||||
"Prefix.Swift": "Swift",
|
||||
"Prefix.Unlucky": "Unlucky",
|
||||
"Prefix.Ghoul": "Ghoul",
|
||||
"Prefix.Sunglasses": "Sunglasses",
|
||||
"Prefix.Mare": "Mare",
|
||||
"BracketAddons": "Add Brackets To Add-ons",
|
||||
"EngineerTOHEInfo": "Use the vents to catch the <color=#ff1919>Impostors</color>",
|
||||
"ScientistTOHEInfo": "Access portable vitals from anywhere",
|
||||
@@ -1701,13 +1659,11 @@
|
||||
"DeadlyQuotaInfo": "You don't win if you didn't kill enough",
|
||||
"DeadlyQuotaInfoLong": "(Add-ons):\\nDeadly Quota is an add-on that only impostors can get. The holder of this add-on will need to get a specified amount of kills (or more) to be able to win. If their win condition triggers before getting a required amount of kills, the player loses even if they were supposed to win.",
|
||||
"DQNumOfKillsNeeded": "Minimum number of Kills required",
|
||||
"Prefix.DeadlyQuota": "Deadly Quota ",
|
||||
"PrefixB.DeadlyQuota": "<color=#ffffff>(</color>Deadly Quota<color=#ffffff>)</color> ",
|
||||
"Prefix.DeadlyQuota": "Deadly Quota",
|
||||
"Damocles": "Damocles",
|
||||
"DamoclesInfo": "Everything changes your lifespan",
|
||||
"DamoclesInfoLong": "(Add-ons):\\nDamocles is an add-on that only impostors can get. The holder of this add-on will constantly have a timer displayed next to their role name. If the timer expires, the holder dies. The timer stops during meetings. Below is a list of what increases your time and what lowers your suicide timer:\\n\\n<size=80%>[<color=#00ff00><b>+</b></color>] You, or another impostor or madmate kills\\n[<color=#00ff00><b>+</b></color>] Entering a vent you didn't enter this round yet\\n[<color=#00ff00><b>+</b></color>] Surviving a meeting\\n[<color=#00ff00><b>+</b></color>] A player not on your team gets ejected\\n[<color=#ff0000><b>-</b></color>] Fixing a sabotage\\n[<color=#ff0000><b>-</b></color>] An impostor or a madmate dies\\n[<color=#ff0000><b>-</b></color>] Reporting a dead body or calling a meeting\\n[<color=#ff0000><b>-</b></color>] A player on your team gets ejected</size>",
|
||||
"Prefix.Damocles": "Damocles ",
|
||||
"PrefixB.Damocles": "<color=#ffffff>(</color>Damocles<color=#ffffff>)</color> ",
|
||||
"Prefix.Damocles": "Damocles",
|
||||
"DamoclesTimeLeft": "<color=#00ffa5>Time:</color> <color=#ffffff><b>{0}</b>s</color>",
|
||||
"DamoclesExtraTimeAfterKill": "Time Gained For Killing",
|
||||
"DamoclesExtraTimeAfterMeeting": "Time Gained After Each Meeting",
|
||||
@@ -1715,8 +1671,7 @@
|
||||
"Stressed": "Stressed",
|
||||
"StressedInfo": "Everything changes your lifespan",
|
||||
"StressedInfoLong": "(Add-ons):\\nStressed is an add-on that only crewmates with tasks can get. The holder of this add-on will constantly have a timer displayed next to their role name. If the timer expires, the holder dies. The timer stops during meetings. Below is a list of what increases your time and what lowers your suicide timer:\\n\\n<size=80%>[<color=#00ff00><b>+</b></color>] Completing a task\\n[<color=#00ff00><b>+</b></color>] A non-crewmate player dies\\n[<color=#00ff00><b>+</b></color>] Surviving a meeting\\n[<color=#00ff00><b>+</b></color>] A non-crewmate player gets ejected\\n[<color=#00ff00><b>+</b></color>] Fixing a sabotage\\n[<color=#00ff00><b>+</b></color>] Reporting a dead body or calling a meeting\\n[<color=#ff0000><b>-</b></color>] A crewmate gets ejected</size>",
|
||||
"Prefix.Stressed": "Stressed ",
|
||||
"PrefixB.Stressed": "<color=#ffffff>(</color>Stressed<color=#ffffff>)</color> ",
|
||||
"Prefix.Stressed": "Stressed",
|
||||
"StressedExtraTimeAfterTask": "Time Gained After Completing a Task",
|
||||
"StressedExtraTimeAfterImpostorDeath": "Time Gained When a Non-Crewmate Player Dies",
|
||||
"StressedExtraTimeAfterImpostorEjected": "Time Gained When a Non-Crewmate Players Gets Ejected",
|
||||
@@ -3050,13 +3005,11 @@
|
||||
"Nimble": "Nimble",
|
||||
"NimbleInfo": "Grants Vent Access",
|
||||
"NimbleInfoLong": "\\nGrants vent access for crewmate roles.",
|
||||
"Prefix.Nimble": "Nimble ",
|
||||
"PrefixB.Nimble": "<color=#ffffff>(</color>Nimble<color=#ffffff>)</color> ",
|
||||
"Prefix.Nimble": "Nimble",
|
||||
"Physicist": "Physicist",
|
||||
"PhysicistInfo": "Grants Portable Vitals Access",
|
||||
"PhysicistInfoLong": "\\nGrants portable vitals access for crewmate roles",
|
||||
"Prefix.Physicist": "Physicist ",
|
||||
"PrefixB.Physicist": "<color=#ffffff>(</color>Physicist<color=#ffffff>)</color> ",
|
||||
"Prefix.Physicist": "Physicist",
|
||||
"Agitater": "Agitator",
|
||||
"AgitaterInfo": "Pass a Bomb onto others",
|
||||
"AgitaterInfoLong": "(Neutrals):\\nAs the Agitater, 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 Agitater cannot receive the bomb.",
|
||||
@@ -3068,8 +3021,7 @@
|
||||
"AgitaterCanGetBombed": "<color=#F4A460>Agitater</color> can get bomb",
|
||||
"AgitaterAutoReportBait": "<color=#F4A460>Agitater</color> Auto Report Bait",
|
||||
"Cleansed": "Cleansed",
|
||||
"Prefix.Cleansed": "Cleansed ",
|
||||
"PrefixB.Cleansed": "(Cleansed) ",
|
||||
"Prefix.Cleansed": "Cleansed",
|
||||
"Cleansed-": "Cleansed ",
|
||||
"MaxCleanserUses": "Max cleanses",
|
||||
"CleansedCanGetAddon": "Cleansed player can get Add-on",
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using Hazel;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using static TOHE.Options;
|
||||
using static TOHE.Translator;
|
||||
using static TOHE.Utils;
|
||||
@@ -19,16 +20,16 @@ namespace TOHE.Roles.AddOns.Impostor
|
||||
private static int TimeAfterMeeting;
|
||||
private static int StartingTime;
|
||||
|
||||
public static int Timer;
|
||||
public static Dictionary<byte, int> Timer;
|
||||
|
||||
public static long lastUpdate;
|
||||
public static List<int> PreviouslyEnteredVents;
|
||||
public static Dictionary<byte, long> lastUpdate;
|
||||
public static Dictionary<byte, List<int>> PreviouslyEnteredVents;
|
||||
|
||||
public static bool countRepairSabotage;
|
||||
|
||||
public static void SetupCustomOption()
|
||||
{
|
||||
SetupAdtRoleOptions(Id, CustomRoles.Damocles, canSetNum: false);
|
||||
SetupAdtRoleOptions(Id, CustomRoles.Damocles, canSetNum: true);
|
||||
DamoclesExtraTimeAfterKill = IntegerOptionItem.Create(Id + 10, "DamoclesExtraTimeAfterKill", new(0, 60, 1), 30, TabGroup.Addons, false)
|
||||
.SetParent(CustomRoleSpawnChances[CustomRoles.Damocles])
|
||||
.SetValueFormat(OptionFormat.Seconds);
|
||||
@@ -46,107 +47,128 @@ namespace TOHE.Roles.AddOns.Impostor
|
||||
TimeAfterMeeting = DamoclesExtraTimeAfterMeeting.GetInt();
|
||||
StartingTime = DamoclesStartingTime.GetInt();
|
||||
|
||||
Timer = StartingTime;
|
||||
lastUpdate = GetTimeStamp() + 10;
|
||||
Timer = [];
|
||||
lastUpdate = [];
|
||||
PreviouslyEnteredVents = [];
|
||||
countRepairSabotage = true;
|
||||
}
|
||||
|
||||
public static void Update(PlayerControl pc)
|
||||
{
|
||||
if (lastUpdate >= GetTimeStamp() || !GameStates.IsInTask || pc == null) return;
|
||||
byte id = pc.PlayerId;
|
||||
if (lastUpdate.TryGetValue(id, out var ts) && ts >= GetTimeStamp() || !GameStates.IsInTask || pc == null) return;
|
||||
if (!pc.IsAlive())
|
||||
{
|
||||
Main.PlayerStates[pc.PlayerId].RemoveSubRole(CustomRoles.Damocles);
|
||||
Main.PlayerStates[id].RemoveSubRole(CustomRoles.Damocles);
|
||||
return;
|
||||
}
|
||||
lastUpdate = GetTimeStamp();
|
||||
lastUpdate[id] = GetTimeStamp();
|
||||
if (!Timer.ContainsKey(id)) Timer[id] = StartingTime + 1;
|
||||
|
||||
Timer--;
|
||||
Timer[id]--;
|
||||
|
||||
if (Timer < 0)
|
||||
if (Timer[id] < 0)
|
||||
{
|
||||
Timer = 0;
|
||||
Timer[id] = 0;
|
||||
pc.Suicide();
|
||||
}
|
||||
|
||||
if (pc.IsNonHostModClient()) SendRPC();
|
||||
if (pc.IsNonHostModClient()) SendRPC(id);
|
||||
NotifyRoles(SpecifySeer: pc, SpecifyTarget: pc);
|
||||
}
|
||||
|
||||
public static void SendRPC()
|
||||
public static void SendRPC(byte playerId)
|
||||
{
|
||||
if (!DoRPC) return;
|
||||
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(PlayerControl.LocalPlayer.NetId, (byte)CustomRPC.SyncDamoclesTimer, SendOption.Reliable, -1);
|
||||
writer.Write(Timer);
|
||||
writer.Write(lastUpdate.ToString());
|
||||
writer.Write(PreviouslyEnteredVents.Count);
|
||||
if (PreviouslyEnteredVents.Count > 0) foreach (var vent in PreviouslyEnteredVents.ToArray()) writer.Write(vent);
|
||||
writer.Write(playerId);
|
||||
writer.Write(Timer[playerId]);
|
||||
writer.Write(lastUpdate[playerId].ToString());
|
||||
writer.Write(PreviouslyEnteredVents[playerId].Count);
|
||||
if (PreviouslyEnteredVents[playerId].Count > 0) foreach (var vent in PreviouslyEnteredVents[playerId].ToArray()) writer.Write(vent);
|
||||
AmongUsClient.Instance.FinishRpcImmediately(writer);
|
||||
}
|
||||
|
||||
public static void ReceiveRPC(MessageReader reader)
|
||||
{
|
||||
Timer = reader.ReadInt32();
|
||||
lastUpdate = long.Parse(reader.ReadString());
|
||||
byte playerId = reader.ReadByte();
|
||||
Timer[playerId] = reader.ReadInt32();
|
||||
lastUpdate[playerId] = long.Parse(reader.ReadString());
|
||||
var elements = reader.ReadInt32();
|
||||
if (elements > 0) for (int i = 0; i < elements; i++) PreviouslyEnteredVents.Add(reader.ReadInt32());
|
||||
if (elements > 0) for (int i = 0; i < elements; i++) PreviouslyEnteredVents[playerId].Add(reader.ReadInt32());
|
||||
}
|
||||
|
||||
public static void OnMurder()
|
||||
public static void OnMurder(byte id)
|
||||
{
|
||||
Timer += TimeAfterKill;
|
||||
Timer[id] += TimeAfterKill;
|
||||
}
|
||||
|
||||
public static void OnOtherImpostorMurder()
|
||||
{
|
||||
Timer += 10;
|
||||
AdjustTime(10);
|
||||
}
|
||||
|
||||
public static void OnEnterVent(int ventId)
|
||||
public static void OnEnterVent(byte id, int ventId)
|
||||
{
|
||||
if (PreviouslyEnteredVents.Contains(ventId)) return;
|
||||
if (!PreviouslyEnteredVents.ContainsKey(id)) PreviouslyEnteredVents[id] = [];
|
||||
if (PreviouslyEnteredVents[id].Contains(ventId)) return;
|
||||
|
||||
PreviouslyEnteredVents.Add(ventId);
|
||||
Timer += 10;
|
||||
PreviouslyEnteredVents[id].Add(ventId);
|
||||
Timer[id] += 10;
|
||||
}
|
||||
|
||||
public static void AfterMeetingTasks()
|
||||
{
|
||||
PreviouslyEnteredVents.Clear();
|
||||
|
||||
Timer += TimeAfterMeeting;
|
||||
AdjustTime(TimeAfterMeeting);
|
||||
countRepairSabotage = true;
|
||||
}
|
||||
|
||||
public static void OnMeetingStart()
|
||||
{
|
||||
Timer += 9;
|
||||
AdjustTime(9);
|
||||
}
|
||||
|
||||
public static void OnCrewmateEjected()
|
||||
{
|
||||
Timer = (int)Math.Round(Timer * 1.3);
|
||||
AdjustTimeByPercent(1.3);
|
||||
}
|
||||
|
||||
public static void OnRepairSabotage()
|
||||
public static void OnRepairSabotage(byte id)
|
||||
{
|
||||
Timer -= 15;
|
||||
Timer[id] -= 15;
|
||||
}
|
||||
|
||||
public static void OnImpostorDeath()
|
||||
{
|
||||
Timer -= 20;
|
||||
AdjustTime(-20);
|
||||
}
|
||||
|
||||
public static void OnReport()
|
||||
public static void OnReport(byte id)
|
||||
{
|
||||
Timer = (int)Math.Round(Timer * 0.9);
|
||||
Timer[id] = (int)Math.Round(Timer[id] * 0.9);
|
||||
}
|
||||
|
||||
public static void OnImpostorEjected()
|
||||
{
|
||||
Timer = (int)Math.Round(Timer * 0.8);
|
||||
AdjustTimeByPercent(0.8);
|
||||
}
|
||||
|
||||
private static void AdjustTime(int change)
|
||||
{
|
||||
foreach (var item in Timer.Keys.ToArray())
|
||||
{
|
||||
Timer[item] += change;
|
||||
}
|
||||
}
|
||||
|
||||
private static void AdjustTimeByPercent(double percent)
|
||||
{
|
||||
foreach (var item in Timer.Keys.ToArray())
|
||||
{
|
||||
Timer[item] = (int)Math.Round(Timer[item] * percent);
|
||||
}
|
||||
}
|
||||
|
||||
public static string GetProgressText() => string.Format(GetString("DamoclesTimeLeft"), Timer);
|
||||
|
||||
@@ -53,6 +53,12 @@ namespace TOHE.Roles.Crewmate
|
||||
|
||||
public void OnCheckPlayerPosition(PlayerControl pc)
|
||||
{
|
||||
if (!IsPatrolling) return;
|
||||
|
||||
long now = GetTimeStamp();
|
||||
if (LastUpdate >= now) return;
|
||||
LastUpdate = now;
|
||||
|
||||
var killers = NearbyKillers;
|
||||
|
||||
bool nowInRange = killers.Any(x => x.PlayerId == pc.PlayerId);
|
||||
@@ -61,10 +67,12 @@ namespace TOHE.Roles.Crewmate
|
||||
if (wasInRange && !nowInRange)
|
||||
{
|
||||
pc.Notify(GetString("KillerEscapedFromSentinel"));
|
||||
LastNearbyKillers.Remove(pc.PlayerId);
|
||||
}
|
||||
if (nowInRange)
|
||||
{
|
||||
pc.Notify(string.Format(GetString("KillerNotifyPatrol"), PatrolDuration - (GetTimeStamp() - PatrolStartTimeStamp)));
|
||||
LastNearbyKillers.Add(pc.PlayerId);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Remove="Modules\zqihthf4.eqf~" />
|
||||
<None Remove="resources\modnews\english\TOHE+.v1.2.0.txt" />
|
||||
<None Remove="resources\modnews\english\TOHE+.v1.3.0.txt" />
|
||||
<None Remove="resources\modnews\english\TOHE+.v1.4.0.txt" />
|
||||
|
||||
Reference in new issue
Block a user