mirror of
https://github.com/ApeMV/AmongUsRevamped.git
synced 2026-10-19 15:51:59 +00:00
Better options, String fix, HnS fix
This commit is contained in:
1 parent
5570d6f4ea
commit
15d6f54982
7 files changed
+75
-39
No files matched your search
@@ -8,6 +8,11 @@
|
||||
<Authors>apemv</Authors>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Configurations>Release;Android</Configurations>
|
||||
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
|
||||
<Configuration>Release</Configuration>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
@@ -9,6 +9,7 @@ namespace AmongUsRevamped;
|
||||
[HarmonyPatch(typeof(ControllerManager), nameof(ControllerManager.Update))]
|
||||
internal class Hotkeys
|
||||
{
|
||||
public static int IncrementMultiplier;
|
||||
public static void Postfix()
|
||||
{
|
||||
bool Shift = Input.GetKey(KeyCode.LeftShift) || Input.GetKey(KeyCode.RightShift);
|
||||
@@ -52,6 +53,10 @@ internal class Hotkeys
|
||||
GameStartManager.Instance.ResetStartState();
|
||||
Logger.SendInGame("Starting countdown canceled");
|
||||
}
|
||||
|
||||
if (Shift) IncrementMultiplier = 5;
|
||||
else if (Ctrl) IncrementMultiplier = 10;
|
||||
else IncrementMultiplier = 1;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -16,7 +16,7 @@ public class DiscordRPC
|
||||
{
|
||||
if (activity == null) return;
|
||||
|
||||
var details = $"AmongUsRevamped {Main.ModVersion}";
|
||||
var details = $"Revamped {Main.ModVersion}";
|
||||
activity.Details = details;
|
||||
|
||||
try
|
||||
@@ -31,10 +31,10 @@ public class DiscordRPC
|
||||
Region = Utils.GetRegionName();
|
||||
}
|
||||
|
||||
if (Lobbycode != "" && Region != "") details = $"AmongUsRevamped - {Lobbycode} ({Region})";
|
||||
if (Lobbycode != "" && Region != "") details = $"Revamped - {Lobbycode} ({Region})";
|
||||
}
|
||||
else
|
||||
details = $"AmongUsRevamped {Main.ModVersion}";
|
||||
details = $"Revamped {Main.ModVersion}";
|
||||
|
||||
activity.Details = details;
|
||||
}
|
||||
@@ -43,7 +43,7 @@ public class DiscordRPC
|
||||
{
|
||||
Logger.Error("Error in updating discord rpc", "DiscordPatch");
|
||||
Logger.Exception(ex, "DiscordPatch");
|
||||
details = $"AmongUsRevamped v{Main.ModVersion}";
|
||||
details = $"Revamped v{Main.ModVersion}";
|
||||
activity.Details = details;
|
||||
}
|
||||
}
|
||||
|
||||
+11
-1
@@ -10,7 +10,7 @@ internal static class CoShowIntroPatch
|
||||
{
|
||||
public static void Postfix(IntroCutscene __instance)
|
||||
{
|
||||
Logger.Info("Intro initiated", "d");
|
||||
Logger.Info("Intro initiated", "CoShowIntro");
|
||||
|
||||
if (!AmongUsClient.Instance.AmHost) return;
|
||||
|
||||
@@ -24,5 +24,15 @@ internal static class CoShowIntroPatch
|
||||
{ "Jester", $"{String.Jester}"},
|
||||
{ "Mayor", $"{String.Mayor}"}
|
||||
});
|
||||
|
||||
if (!Utils.isHideNSeek) return;
|
||||
|
||||
foreach (var p in PlayerControl.AllPlayerControls)
|
||||
{
|
||||
if (p.Data.Role.TeamType == RoleTeamTypes.Impostor)
|
||||
{
|
||||
p.RpcSetRole(AmongUs.GameOptions.RoleTypes.Impostor, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,25 +1,32 @@
|
||||
using AmongUs.GameOptions;
|
||||
using UnityEngine;
|
||||
|
||||
namespace AmongUsRevamped;
|
||||
|
||||
// https://github.com/astra1dev/AUnlocker/blob/main/src/OptionsPatches.cs
|
||||
|
||||
[HarmonyPatch(typeof(NumberOption), nameof(NumberOption.Increase))]
|
||||
public static class NumberOption_Increase
|
||||
{
|
||||
public static bool Prefix(NumberOption __instance)
|
||||
{
|
||||
if (ModGameOptionsMenu.TabIndex >= 3) return true;
|
||||
float increment = Hotkeys.IncrementMultiplier * __instance.Increment;
|
||||
|
||||
if (Utils.isHideNSeek || Utils.IsLobby && !Utils.isHideNSeek && __instance.Title != StringNames.GameNumImpostors && __instance.Title != StringNames.GamePlayerSpeed)
|
||||
{
|
||||
__instance.Value += __instance.Increment;
|
||||
__instance.UpdateValue();
|
||||
__instance.OnValueChanged.Invoke(__instance);
|
||||
__instance.AdjustButtonsActiveState();
|
||||
return false;
|
||||
|
||||
if (__instance.Value + increment > __instance.ValidRange.max)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
__instance.Value += increment;
|
||||
__instance.UpdateValue();
|
||||
__instance.OnValueChanged.Invoke(__instance);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else return true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,17 +35,23 @@ public static class NumberOption_Decrease
|
||||
{
|
||||
public static bool Prefix(NumberOption __instance)
|
||||
{
|
||||
if (ModGameOptionsMenu.TabIndex >= 3) return true;
|
||||
float increment = Hotkeys.IncrementMultiplier * __instance.Increment;
|
||||
|
||||
if (Utils.isHideNSeek || Utils.IsLobby && !Utils.isHideNSeek && __instance.Title != StringNames.GameNumImpostors && __instance.Title != StringNames.GamePlayerSpeed)
|
||||
{
|
||||
__instance.Value -= __instance.Increment;
|
||||
__instance.UpdateValue();
|
||||
__instance.OnValueChanged.Invoke(__instance);
|
||||
__instance.AdjustButtonsActiveState();
|
||||
return false;
|
||||
if (__instance.Value - increment < __instance.ValidRange.min)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
__instance.Value -= increment;
|
||||
__instance.UpdateValue();
|
||||
__instance.OnValueChanged.Invoke(__instance);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
else return true;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -51,7 +64,27 @@ public static class NumberOption_Initialize
|
||||
|
||||
if (Utils.isHideNSeek || Utils.IsLobby && !Utils.isHideNSeek && __instance.Title != StringNames.GameNumImpostors && __instance.Title != StringNames.GamePlayerSpeed)
|
||||
{
|
||||
__instance.ValidRange = new FloatRange(-900f, 900f);
|
||||
__instance.ValidRange = new FloatRange(0f, 900f);
|
||||
}
|
||||
|
||||
switch (__instance.Title)
|
||||
{
|
||||
case StringNames.GameVotingTime:
|
||||
case StringNames.GameDiscussTime:
|
||||
__instance.Increment = 5f;
|
||||
break;
|
||||
case StringNames.GameKillCooldown:
|
||||
__instance.Increment = 0.5f;
|
||||
break;
|
||||
case StringNames.GamePlayerSpeed:
|
||||
case StringNames.GameCrewLight:
|
||||
case StringNames.GameImpostorLight:
|
||||
__instance.Increment = 0.05f;
|
||||
break;
|
||||
|
||||
default:
|
||||
__instance.Increment = 1f;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -67,28 +67,11 @@ internal class CoStartGamePatch
|
||||
(candidates[i], candidates[j]) = (candidates[j], candidates[i]);
|
||||
}
|
||||
|
||||
// 1st RpcSetRole forces the role on that user. 2nd is needed to allow them to kill.
|
||||
for (int i = 0; i < toAdd; i++)
|
||||
{
|
||||
var player = candidates[i];
|
||||
|
||||
player.RpcSetRole(AmongUs.GameOptions.RoleTypes.Impostor, false);
|
||||
|
||||
foreach (var p in PlayerControl.AllPlayerControls)
|
||||
{
|
||||
if (p.Data.Role.TeamType == RoleTeamTypes.Impostor)
|
||||
{
|
||||
new LateTask(() =>
|
||||
{
|
||||
p.RpcSetRole(AmongUs.GameOptions.RoleTypes.Impostor, false);
|
||||
}, 5f, "HNS Secondary RPCSetRole");
|
||||
|
||||
new LateTask(() =>
|
||||
{
|
||||
p.RpcSetRole(AmongUs.GameOptions.RoleTypes.Impostor, false);
|
||||
}, 9f, "HNS Tertiary RPCSetRole");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,7 +18,7 @@ public static class String
|
||||
return $"Shift and Seek:\n\nImpostors can only kill someone while shapeshifted as them\nSabotages & Meetings = Off";}}
|
||||
|
||||
public static string SnSModeTwo{get{
|
||||
return $"Crew wins by tasks/surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\nImp wins by killing\nOne wrong kill = Can't kill for {Options.CantKillTime.GetInt()}s\n{Utils.BasicIntToWord(Options.MisfiresToSuicide.GetInt())} wrong kills = suicide";}}
|
||||
return $"Crew wins by tasks/surviving {Options.CrewAutoWinsGameAfter.GetInt()}s\n" + "Imp wins by killing\n" + (Options.MisfiresToSuicide.GetInt() == 1 ? "" : $"One wrong kill = Can't kill for {Options.CantKillTime.GetInt()}s\n") + $"{Utils.BasicIntToWord(Options.MisfiresToSuicide.GetInt())} wrong kill{(Options.MisfiresToSuicide.GetInt() == 1 ? "" : "s")} = suicide";}}
|
||||
|
||||
public static string speedrunMode{get{
|
||||
return $"Speedrun:\n\nEveryone is a crewmate. The 1st player to finish tasks wins the game. Game auto ends after {Options.GameAutoEndsAfter.GetInt()}s";}}
|
||||
|
||||
Reference in new issue
Block a user