vision while in vent

This commit is contained in:
Gurge44 committed 2026-01-26 09:31:32 +01:00
1 parent d2702c4e06
commit 841a2254e9
6 files changed
+33 -4

No files matched your search

@@ -146,6 +146,13 @@ public sealed class PlayerGameOptionsSender(PlayerControl player) : GameOptionsS
CustomRoles role = player.GetCustomRole();
RoleTypes roleTypes = player.GetRoleTypes();
if (player.inVent && Options.OverrideVisionInVents.GetBool() && Options.InVentVision.TryGetValue(player.GetTeam(), out var option))
{
var value = option.GetFloat();
opt.SetFloat(FloatOptionNames.CrewLightMod, value);
opt.SetFloat(FloatOptionNames.ImpostorLightMod, value);
}
switch (Options.CurrentGameMode)
{
case CustomGameMode.FFA:
+11
View File
@@ -386,6 +386,9 @@ public static class Options
public static OptionItem OverrideSpeedForEachMap;
public static Dictionary<MapNames, OptionItem> MapSpeeds = [];
public static OptionItem OverrideVisionInVents;
public static Dictionary<Team, OptionItem> InVentVision = [];
public static OptionItem GodfatherCancelVote;
public static OptionItem GuardSpellTimes;
@@ -1943,6 +1946,7 @@ public static class Options
OverrideSpeedForEachMap = new BooleanOptionItem(20782, "OverrideSpeedForEachMap", false, TabGroup.GameSettings);
MapSpeeds = Enum.GetValues<MapNames>().ToDictionary(x => x, x => new FloatOptionItem(20783 + (int)x, "SpeedForMap", new(0.05f, 3f, 0.05f), 1.25f, TabGroup.GameSettings)
.SetParent(OverrideSpeedForEachMap)
.SetValueFormat(OptionFormat.Multiplier)
.AddReplacement(("{map}", Translator.GetString(x.ToString()))));
@@ -3056,6 +3060,13 @@ public static class Options
.SetParent(EnableGameTimeLimit)
.SetValueFormat(OptionFormat.Seconds);
OverrideVisionInVents = new BooleanOptionItem(19436, "OverrideVisionInVents", false, TabGroup.GameSettings);
InVentVision = Enum.GetValues<Team>()[1..].ToDictionary(x => x, x => new FloatOptionItem(19437 + (int)x, "InVentVisionForTeam", new(0f, 1.3f, 0.05f), x == Team.Crewmate ? 0f : 0.5f, TabGroup.GameSettings)
.SetParent(OverrideVisionInVents)
.SetValueFormat(OptionFormat.Multiplier)
.AddReplacement(("{team}", Utils.ColorString(x.GetColor(), Translator.GetString($"Type{x}")))));
new TextOptionItem(100029, "MenuTitle.Ghost", TabGroup.GameSettings)
.SetGameMode(CustomGameMode.Standard)
+10 -1
View File
@@ -2093,8 +2093,14 @@ internal static class ExitVentPatch
Drainer.OnAnyoneExitVent(pc);
Main.PlayerStates[pc.PlayerId].Role.OnExitVent(pc, __instance);
LateTask.New(() =>
{
if (Options.OverrideVisionInVents.GetBool() && Options.InVentVision.ContainsKey(pc.GetTeam()))
pc.MarkDirtySettings();
}, 0.6f);
if (Options.WhackAMole.GetBool()) LateTask.New(() => pc.TPToRandomVent(), 0.5f, "Whack-A-Mole TP");
if (Options.WhackAMole.GetBool()) LateTask.New(() => pc.TPToRandomVent(), 0.6f, "Whack-A-Mole TP");
if (!pc.IsModdedClient() && pc.Is(CustomRoles.Haste)) pc.SetKillCooldown(Math.Max(Main.KillTimers[pc.PlayerId], 0.1f));
}
@@ -2219,6 +2225,9 @@ internal static class EnterVentPatch
Chef.SpitOutFood(pc);
Main.PlayerStates[pc.PlayerId].Role.OnEnterVent(pc, __instance);
if (Options.OverrideVisionInVents.GetBool() && Options.InVentVision.ContainsKey(pc.GetTeam()))
pc.MarkDirtySettings();
if (pc.AmOwner)
Statistics.VentTimes++;
+2
View File
@@ -1271,6 +1271,8 @@
"MenuTitle.Guessers": "★ Guesser Mode ★",
"MenuTitle.CTA": "★ Custom Team Assignment ★",
"MenuTitle.AFKDetection": "★ AFK Detection ★",
"OverrideVisionInVents": "Override Vision While In Vent",
"InVentVisionForTeam": "Vision While In Vent For {team}",
"ReadyCheckMessage": "The Host/a Staff is checking how many players are ready to start the game.\\nPlease type <b>/ready</b> to let the Host/Staff know you're not AFK.",
"ReadyCheckTitle": "<#ffff00>★ Ready Check ★</color>",
"EveryoneReadyTitle": "<#00ff00>Everyone is ready!</color>",
+1 -1
View File
@@ -273,7 +273,7 @@ public class Alchemist : RoleBase
ventedId = ventId;
instance.RpcExitVentDesync(ventId, pc);
LateTask.New(() => instance.RpcExitVentDesync(ventId, pc), 0.5f);
InvisTime = Utils.TimeStamp;
SendRPC();
@@ -243,7 +243,7 @@ public class Swooper : RoleBase
if (CanGoInvis && (wraith || limit >= 1))
{
__instance.RpcExitVentDesync(ventId, pc);
LateTask.New(() => __instance.RpcExitVentDesync(ventId, pc), 0.5f);
ventedId = ventId;
InvisTime = Utils.TimeStamp;
@@ -256,7 +256,7 @@ public class Swooper : RoleBase
if (!VentNormallyOnCooldown)
{
__instance.RpcExitVent(ventId);
LateTask.New(() => __instance.RpcExitVent(ventId), 0.5f);
pc.Notify(GetString("SwooperInvisInCooldown"));
return true;
}