mirror of
https://github.com/Gurge44/EndlessHostRoles.git
synced 2026-10-20 01:46:25 +00:00
bruh
This commit is contained in:
1 parent
02c034de07
commit
a07601a5fc
8 files changed
+21
-21
No files matched your search
+2
-2
@@ -8,8 +8,8 @@
|
||||
<Description>EHR</Description>
|
||||
<Authors>Gurge44</Authors>
|
||||
<langVersion>preview</langVersion>
|
||||
<AmongUs>D:\SteamLibrary\steamapps\common\Among Us</AmongUs>
|
||||
<!--<AmongUs>C:\Program Files\Epic Games\AmongUs</AmongUs>-->
|
||||
<!--<AmongUs>D:\SteamLibrary\steamapps\common\Among Us</AmongUs>-->
|
||||
<AmongUs>C:\Program Files\Epic Games\AmongUs</AmongUs>
|
||||
<AllowUnsafeBlocks>true</AllowUnsafeBlocks>
|
||||
<Optimize>True</Optimize>
|
||||
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
|
||||
|
||||
+1
-1
@@ -263,7 +263,7 @@ public static class Mingle
|
||||
{
|
||||
var room = AllRooms.Except(RequiredPlayerCount.Keys).RandomElement();
|
||||
var count = last2 ? 1 : IRandom.Instance.Next(1, Math.Min(playerCount, MaxRequiredPlayersPerRoom) + 1);
|
||||
if (count >= playerCount) count = playerCount - 1;
|
||||
if (count >= playerCount) count = Math.Max(1, playerCount - 1);
|
||||
RequiredPlayerCount[room] = count;
|
||||
playerCount -= count;
|
||||
}
|
||||
|
||||
@@ -175,7 +175,6 @@ public class ErrorText : MonoBehaviour
|
||||
if (!HudManager.InstanceExists)
|
||||
{
|
||||
_camera = Camera.main;
|
||||
Logger.Error("Hudmanager instance not found", "ErrorText");
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using BepInEx.Unity.IL2CPP.Utils.Collections;
|
||||
using EHR.AddOns.GhostRoles;
|
||||
@@ -11,6 +10,12 @@ using TMPro;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
|
||||
#if ANDROID
|
||||
using System.Collections.Generic;
|
||||
#else
|
||||
using Il2CppSystem.Collections.Generic;
|
||||
#endif
|
||||
|
||||
// ReSharper disable PossibleLossOfFraction
|
||||
|
||||
namespace EHR;
|
||||
@@ -937,7 +942,7 @@ public static class StringOptionPatch
|
||||
[HarmonyPatch(typeof(GameSettingMenu))]
|
||||
public static class GameSettingMenuPatch
|
||||
{
|
||||
public static List<GameObject> GMButtons = [];
|
||||
public static System.Collections.Generic.List<GameObject> GMButtons = [];
|
||||
|
||||
private static readonly Vector3 ButtonPositionLeft = new(-3.9f, -0.55f, 0f);
|
||||
private static readonly Vector3 ButtonPositionRight = new(-2.4f, -0.55f, 0f);
|
||||
@@ -948,15 +953,15 @@ public static class GameSettingMenuPatch
|
||||
private static GameOptionsMenu TemplateGameOptionsMenu;
|
||||
private static PassiveButton TemplateGameSettingsButton;
|
||||
|
||||
private static Dictionary<TabGroup, PassiveButton> ModSettingsButtons = [];
|
||||
private static Dictionary<TabGroup, GameOptionsMenu> ModSettingsTabs = [];
|
||||
private static System.Collections.Generic.Dictionary<TabGroup, PassiveButton> ModSettingsButtons = [];
|
||||
private static System.Collections.Generic.Dictionary<TabGroup, GameOptionsMenu> ModSettingsTabs = [];
|
||||
|
||||
public static NumberOption PresetBehaviour;
|
||||
|
||||
public static long LastPresetChange;
|
||||
|
||||
public static FreeChatInputField InputField;
|
||||
private static List<OptionItem> HiddenBySearch = [];
|
||||
private static System.Collections.Generic.List<OptionItem> HiddenBySearch = [];
|
||||
public static Action SearchForOptionsAction;
|
||||
|
||||
private static int NumImpsOnOpen = 1;
|
||||
@@ -1255,9 +1260,9 @@ public static class GameSettingMenuPatch
|
||||
string text = textField.textArea.text.Trim().ToLower();
|
||||
var modTab = (TabGroup)(ModGameOptionsMenu.TabIndex - 3);
|
||||
OptionItem[] optionItems = Options.GroupedOptions[modTab];
|
||||
List<OptionItem> result = optionItems.Where(x => x.Parent == null && !x.IsCurrentlyHidden() && !Translator.GetString($"{x.Name}").Contains(text, StringComparison.OrdinalIgnoreCase)).ToList();
|
||||
System.Collections.Generic.List<OptionItem> result = optionItems.Where(x => x.Parent == null && !x.IsCurrentlyHidden() && !Translator.GetString($"{x.Name}").Contains(text, StringComparison.OrdinalIgnoreCase)).ToList();
|
||||
HiddenBySearch = result;
|
||||
List<OptionItem> searchWinners = optionItems.Where(x => x.Parent == null && !x.IsCurrentlyHidden() && !result.Contains(x)).ToList();
|
||||
System.Collections.Generic.List<OptionItem> searchWinners = optionItems.Where(x => x.Parent == null && !x.IsCurrentlyHidden() && !result.Contains(x)).ToList();
|
||||
|
||||
if (searchWinners.Count == 0 || !ModSettingsTabs.TryGetValue(modTab, out GameOptionsMenu gameSettings) || gameSettings == null)
|
||||
{
|
||||
|
||||
@@ -516,7 +516,7 @@ internal static class CheckForEndVotingPatch
|
||||
|
||||
pc.TP(pos);
|
||||
}
|
||||
}, 10f, "Teleport Lazy Players");
|
||||
}, 12f, "Teleport Lazy Players");
|
||||
}
|
||||
|
||||
public static bool CheckRole(byte id, CustomRoles role)
|
||||
|
||||
@@ -180,7 +180,7 @@ internal class TimeMaster : RoleBase
|
||||
long now = Utils.TimeStamp;
|
||||
if (BackTrack.ContainsKey(now)) return;
|
||||
|
||||
BackTrack[now] = Main.AllAlivePlayerControls.ToDictionary(x => x.PlayerId, x => x.Pos());
|
||||
BackTrack[now] = Main.AllAlivePlayerControls.Where(x => !x.inVent && !x.onLadder && !x.inMovingPlat).ToDictionary(x => x.PlayerId, x => x.Pos());
|
||||
|
||||
if (TimeMasterCanUseVitals.GetBool()) return;
|
||||
|
||||
|
||||
@@ -349,7 +349,7 @@ public class Penguin : RoleBase
|
||||
LastNotify = Utils.TimeStamp;
|
||||
}
|
||||
|
||||
if (AbductTimer <= 0f && !Penguin_.MyPhysics.Animations.IsPlayingAnyLadderAnimation())
|
||||
if (AbductTimer <= 0f && !Penguin_.MyPhysics.Animations.IsPlayingAnyLadderAnimation() && !Penguin_.inMovingPlat && !Penguin_.onLadder)
|
||||
{
|
||||
// Set IsDead to true first (prevents ladder chase)
|
||||
if (!IsGoose)
|
||||
@@ -359,7 +359,7 @@ public class Penguin : RoleBase
|
||||
}
|
||||
|
||||
// If the penguin himself is on a ladder, kill him after getting off the ladder.
|
||||
if (!AbductVictim.MyPhysics.Animations.IsPlayingAnyLadderAnimation())
|
||||
if (!AbductVictim.MyPhysics.Animations.IsPlayingAnyLadderAnimation() && !AbductVictim.inMovingPlat && !AbductVictim.onLadder)
|
||||
{
|
||||
PlayerControl abductVictim = AbductVictim;
|
||||
|
||||
@@ -393,7 +393,7 @@ public class Penguin : RoleBase
|
||||
}
|
||||
}
|
||||
// SnapToRPC does not work for players on top of the ladder, and only the host behaves differently, so teleporting is not done uniformly.
|
||||
else if (!AbductVictim.MyPhysics.Animations.IsPlayingAnyLadderAnimation())
|
||||
else if (!AbductVictim.MyPhysics.Animations.IsPlayingAnyLadderAnimation() && !AbductVictim.inMovingPlat && !AbductVictim.onLadder)
|
||||
{
|
||||
Vector3 position = Penguin_.Pos();
|
||||
|
||||
@@ -413,10 +413,7 @@ public class Penguin : RoleBase
|
||||
|
||||
public override string GetSuffix(PlayerControl seer, PlayerControl target, bool hud = false, bool meeting = false)
|
||||
{
|
||||
if (seer == null || seer.PlayerId != target.PlayerId || (seer.IsModdedClient() && !hud)) return string.Empty;
|
||||
|
||||
if (!Main.PlayerStates.TryGetValue(seer.PlayerId, out PlayerState state) || state.Role is not Penguin pg || pg.AbductVictim == null) return string.Empty;
|
||||
|
||||
if (seer == null || seer.PlayerId != target.PlayerId || (seer.IsModdedClient() && !hud) || !Main.PlayerStates.TryGetValue(seer.PlayerId, out PlayerState state) || state.Role is not Penguin pg || pg.AbductVictim == null) return string.Empty;
|
||||
return $"\u21b9 {(int)(pg.AbductTimer + 1f)}s";
|
||||
}
|
||||
}
|
||||
@@ -148,7 +148,6 @@ internal class Arsonist : RoleBase
|
||||
foreach (PlayerControl pc in Main.AllAlivePlayerControls)
|
||||
{
|
||||
if (!physics.myPlayer.IsDousedPlayer(pc)) continue;
|
||||
|
||||
pc.Suicide(PlayerState.DeathReason.Torched, physics.myPlayer);
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user