private static CustomButton portalmakerPlacePortalButton;
private static CustomButton usePortalButton;
private static CustomButton hackerButton;
- private static CustomButton hackerVitalsButton;
- private static CustomButton hackerAdminTableButton;
+ public static CustomButton hackerVitalsButton;
+ public static CustomButton hackerAdminTableButton;
private static CustomButton trackerTrackPlayerButton;
private static CustomButton trackerTrackCorpsesButton;
public static CustomButton vampireKillButton;
morphlingButton.actionButton.cooldownTimerText.transform.localPosition = new Vector3(0, 0, -1f); // Before the poolable player
morphTargetDisplay = UnityEngine.Object.Instantiate<PoolablePlayer>(Patches.IntroCutsceneOnDestroyPatch.playerPrefab, morphlingButton.actionButton.transform);
GameData.PlayerInfo data = Morphling.sampledTarget.Data;
- PlayerControl.SetPlayerMaterialColors(data.DefaultOutfit.ColorId, morphTargetDisplay.CurrentBodySprite.BodySprite);
+ Morphling.sampledTarget.SetPlayerMaterialColors(morphTargetDisplay.cosmetics.currentBodySprite.BodySprite);
morphTargetDisplay.SetSkin(data.DefaultOutfit.SkinId, data.DefaultOutfit.ColorId);
- morphTargetDisplay.HatSlot.SetHat(data.DefaultOutfit.HatId, data.DefaultOutfit.ColorId);
- PlayerControl.SetPetImage(data.DefaultOutfit.PetId, data.DefaultOutfit.ColorId, morphTargetDisplay.PetSlot);
- morphTargetDisplay.NameText.text = ""; // Hide the name!
+ morphTargetDisplay.SetHat(data.DefaultOutfit.HatId, data.DefaultOutfit.ColorId);
+ // PlayerControl.SetPetImage(data.DefaultOutfit.PetId, data.DefaultOutfit.ColorId, morphTargetDisplay.PetSlot);
+ morphTargetDisplay.cosmetics.nameText.text = ""; // Hide the name!
morphTargetDisplay.transform.localPosition = new Vector3(0f, 0.22f, -0.01f);
morphTargetDisplay.transform.localScale = Vector3.one * 0.33f;
morphTargetDisplay.setSemiTransparent(false);
// If blanked or killed
if(Warlock.rootTime > 0) {
+ AntiTeleport.position = CachedPlayer.LocalPlayer.transform.position;
CachedPlayer.LocalPlayer.PlayerControl.moveable = false;
CachedPlayer.LocalPlayer.NetTransform.Halt(); // Stop current movement so the warlock is not just running straight into the next object
FastDestroyableSingleton<HudManager>.Instance.StartCoroutine(Effects.Lerp(Warlock.rootTime, new Action<float>((p) => { // Delayed action
activateRoles = CustomOption.Create(1, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "Enable Mod Roles And Block Vanilla Roles"), true, null, true);
// Using new id's for the options to not break compatibilty with older versions
- crewmateRolesCountMin = CustomOption.Create(300, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "Minimum Crewmate Roles"), 0f, 0f, 15f, 1f, null, true);
- crewmateRolesCountMax = CustomOption.Create(301, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "Maximum Crewmate Roles"), 0f, 0f, 15f, 1f);
- neutralRolesCountMin = CustomOption.Create(302, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "Minimum Neutral Roles"), 0f, 0f, 15f, 1f);
- neutralRolesCountMax = CustomOption.Create(303, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "Maximum Neutral Roles"), 0f, 0f, 15f, 1f);
- impostorRolesCountMin = CustomOption.Create(304, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "Minimum Impostor Roles"), 0f, 0f, 3f, 1f);
- impostorRolesCountMax = CustomOption.Create(305, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "Maximum Impostor Roles"), 0f, 0f, 3f, 1f);
- modifiersCountMin = CustomOption.Create(306, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "Minimum Modifiers"), 0f, 0f, 15f, 1f);
- modifiersCountMax = CustomOption.Create(307, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "Maximum Modifiers"), 0f, 0f, 15f, 1f);
+ crewmateRolesCountMin = CustomOption.Create(300, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "Minimum Crewmate Roles"), 15f, 0f, 15f, 1f, null, true);
+ crewmateRolesCountMax = CustomOption.Create(301, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "Maximum Crewmate Roles"), 15f, 0f, 15f, 1f);
+ neutralRolesCountMin = CustomOption.Create(302, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "Minimum Neutral Roles"), 15f, 0f, 15f, 1f);
+ neutralRolesCountMax = CustomOption.Create(303, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "Maximum Neutral Roles"), 15f, 0f, 15f, 1f);
+ impostorRolesCountMin = CustomOption.Create(304, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "Minimum Impostor Roles"), 15f, 0f, 3f, 1f);
+ impostorRolesCountMax = CustomOption.Create(305, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "Maximum Impostor Roles"), 15f, 0f, 3f, 1f);
+ modifiersCountMin = CustomOption.Create(306, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "Minimum Modifiers"), 15f, 0f, 15f, 1f);
+ modifiersCountMax = CustomOption.Create(307, Types.General, cs(new Color(204f / 255f, 204f / 255f, 0, 1f), "Maximum Modifiers"), 15f, 0f, 15f, 1f);
mafiaSpawnRate = CustomOption.Create(10, Types.Impostor, cs(Janitor.color, "Mafia"), rates, null, true);
janitorCooldown = CustomOption.Create(11, Types.Impostor, "Janitor Cooldown", 30f, 10f, 60f, 2.5f, mafiaSpawnRate);
ninjaKnowsTargetLocation = CustomOption.Create(382, Types.Impostor, "Ninja Knows Location Of Target", true, ninjaSpawnRate);
ninjaTraceTime = CustomOption.Create(383, Types.Impostor, "Trace Duration", 5f, 1f, 20f, 0.5f, ninjaSpawnRate);
ninjaTraceColorTime = CustomOption.Create(384, Types.Impostor, "Time Till Trace Color Has Faded", 2f, 0f, 20f, 0.5f, ninjaSpawnRate);
- ninjaInvisibleDuration = CustomOption.Create(385, Types.Impostor, "Time The Ninja Is Invisble", 3f, 0f, 20f, 1f, ninjaSpawnRate);
+ ninjaInvisibleDuration = CustomOption.Create(385, Types.Impostor, "Time The Ninja Is Invisible", 3f, 0f, 20f, 1f, ninjaSpawnRate);
guesserSpawnRate = CustomOption.Create(310, Types.Neutral, cs(Guesser.color, "Guesser"), rates, null, true);
guesserIsImpGuesserRate = CustomOption.Create(311, Types.Neutral, "Chance That The Guesser Is An Impostor", rates, guesserSpawnRate);
float alpha = value ? 0.25f : 1f;
foreach (SpriteRenderer r in player.gameObject.GetComponentsInChildren<SpriteRenderer>())
r.color = new Color(r.color.r, r.color.g, r.color.b, alpha);
- player.NameText.color = new Color(player.NameText.color.r, player.NameText.color.g, player.NameText.color.b, alpha);
+ player.cosmetics.nameText.color = new Color(player.cosmetics.nameText.color.r, player.cosmetics.nameText.color.g, player.cosmetics.nameText.color.b, alpha);
}
public static string GetString(this TranslationController t, StringNames key, params Il2CppSystem.Object[] parts) {
SkinViewData nextSkin = FastDestroyableSingleton<HatManager>.Instance.GetSkinById(skinId).viewData.viewData;
PlayerPhysics playerPhysics = target.MyPhysics;
AnimationClip clip = null;
- var spriteAnim = playerPhysics.Skin.animator;
+ var spriteAnim = playerPhysics.myPlayer.cosmetics.skin.animator;
var currentPhysicsAnim = playerPhysics.Animator.GetCurrentAnimation();
if (currentPhysicsAnim == playerPhysics.CurrentAnimationGroup.RunAnim) clip = nextSkin.RunAnim;
else if (currentPhysicsAnim == playerPhysics.CurrentAnimationGroup.SpawnAnim) clip = nextSkin.SpawnAnim;
else if (currentPhysicsAnim == playerPhysics.CurrentAnimationGroup.IdleAnim) clip = nextSkin.IdleAnim;
else clip = nextSkin.IdleAnim;
float progress = playerPhysics.Animator.m_animator.GetCurrentAnimatorStateInfo(0).normalizedTime;
- playerPhysics.Skin.skin = nextSkin;
- if (playerPhysics.Skin.layer.material == FastDestroyableSingleton<HatManager>.Instance.PlayerMaterial)
- PlayerControl.SetPlayerMaterialColors(colorId, playerPhysics.Skin.layer);
+ playerPhysics.myPlayer.cosmetics.skin.skin = nextSkin;
+ if (playerPhysics.myPlayer.cosmetics.skin.layer.material == FastDestroyableSingleton<HatManager>.Instance.PlayerMaterial)
+ target.SetPlayerMaterialColors(playerPhysics.myPlayer.cosmetics.skin.layer);
spriteAnim.Play(clip, 1f);
spriteAnim.m_animator.Play("a", 0, progress % 1);
spriteAnim.m_animator.Update(0f);
- if (target.CurrentPet) UnityEngine.Object.Destroy(target.CurrentPet.gameObject);
- target.CurrentPet = UnityEngine.Object.Instantiate<PetBehaviour>(FastDestroyableSingleton<HatManager>.Instance.GetPetById(petId).viewData.viewData);
- target.CurrentPet.transform.position = target.transform.position;
- target.CurrentPet.Source = target;
- target.CurrentPet.Visible = target.Visible;
- PlayerControl.SetPlayerMaterialColors(colorId, target.CurrentPet.rend);
+ if (target.cosmetics.currentPet) UnityEngine.Object.Destroy(target.cosmetics.currentPet.gameObject);
+ target.cosmetics.currentPet = UnityEngine.Object.Instantiate<PetBehaviour>(FastDestroyableSingleton<HatManager>.Instance.GetPetById(petId).viewData.viewData);
+ target.cosmetics.currentPet.transform.position = target.transform.position;
+ target.cosmetics.currentPet.Source = target;
+ target.cosmetics.currentPet.Visible = target.Visible;
+ target.SetPlayerMaterialColors(target.cosmetics.currentPet.rend);
}
public static void showFlash(Color color, float duration=1f) {
public class TheOtherRolesPlugin : BasePlugin
{
public const string Id = "me.eisbison.theotherroles";
- public const string VersionString = "4.1.4";
+ public const string VersionString = "4.1.5";
public static Version Version = Version.Parse(VersionString);
internal static BepInEx.Logging.ManualLogSource Logger;
public static int optionsPage = 2;
public static ConfigEntry<bool> DebugMode { get; private set; }
- public static ConfigEntry<bool> StreamerMode { get; set; }
public static ConfigEntry<bool> GhostsSeeTasks { get; set; }
public static ConfigEntry<bool> GhostsSeeRoles { get; set; }
public static ConfigEntry<bool> GhostsSeeModifier { get; set; }
public static ConfigEntry<bool> ShowRoleSummary { get; set; }
public static ConfigEntry<bool> ShowLighterDarker { get; set; }
public static ConfigEntry<bool> EnableHorseMode { get; set; }
- public static ConfigEntry<string> StreamerModeReplacementText { get; set; }
- public static ConfigEntry<string> StreamerModeReplacementColor { get; set; }
public static ConfigEntry<string> Ip { get; set; }
public static ConfigEntry<ushort> Port { get; set; }
public static ConfigEntry<string> ShowPopUpVersion { get; set; }
public static Sprite ModStamp;
public static IRegionInfo[] defaultRegions;
+
+ // This is part of the Mini.RegionInstaller, Licensed under GPLv3
+ // file="RegionInstallPlugin.cs" company="miniduikboot">
public static void UpdateRegions() {
ServerManager serverManager = FastDestroyableSingleton<ServerManager>.Instance;
- IRegionInfo[] regions = defaultRegions;
+ var regions = new IRegionInfo[] {
+ new DnsRegionInfo(Ip.Value, "Custom", StringNames.NoTranslation, Ip.Value, Port.Value, false).CastFast<IRegionInfo>(),
+ new DnsRegionInfo("mods.hopto.org", "Modded NA (MNA)", StringNames.NoTranslation, "mods.hopto.org", 443, false).CastFast<IRegionInfo>(),
+ new DnsRegionInfo("au-eu.duikbo.at", "Modded EU (MEU)", StringNames.NoTranslation, "au-eu.duikbo.at", 22023, false).CastFast<IRegionInfo>()
+ };
+
+ IRegionInfo ? currentRegion = serverManager.CurrentRegion;
+ Logger.LogInfo($"Adding {regions.Length} regions");
+ foreach (IRegionInfo region in regions) {
+ if (region == null)
+ Logger.LogError("Could not add region");
+ else {
+ if (currentRegion != null && region.Name.Equals(currentRegion.Name, StringComparison.OrdinalIgnoreCase))
+ currentRegion = region;
+ serverManager.AddOrUpdateRegion(region);
+ }
+ }
- var CustomRegion = new DnsRegionInfo(Ip.Value, "Custom", StringNames.NoTranslation, Ip.Value, Port.Value, false);
- regions = regions.Concat(new IRegionInfo[] { CustomRegion.CastFast<IRegionInfo>() }).ToArray();
- ServerManager.DefaultRegions = regions;
- serverManager.AvailableRegions = regions;
+ // AU remembers the previous region that was set, so we need to restore it
+ if (currentRegion != null) {
+ Logger.LogDebug("Resetting previous region");
+ serverManager.SetRegion(currentRegion);
+ }
}
public override void Load() {
Instance = this;
DebugMode = Config.Bind("Custom", "Enable Debug Mode", false);
- StreamerMode = Config.Bind("Custom", "Enable Streamer Mode", false);
GhostsSeeTasks = Config.Bind("Custom", "Ghosts See Remaining Tasks", true);
GhostsSeeRoles = Config.Bind("Custom", "Ghosts See Roles", true);
GhostsSeeModifier = Config.Bind("Custom", "Ghosts See Modifier", true);
ShowLighterDarker = Config.Bind("Custom", "Show Lighter / Darker", true);
EnableHorseMode = Config.Bind("Custom", "Enable Horse Mode", false);
ShowPopUpVersion = Config.Bind("Custom", "Show PopUp", "0");
- StreamerModeReplacementText = Config.Bind("Custom", "Streamer Mode Replacement Text", "\n\nThe Other Roles");
- StreamerModeReplacementColor = Config.Bind("Custom", "Streamer Mode Replacement Text Hex Color", "#87AAF5FF");
Ip = Config.Bind("Custom", "Custom Server IP", "127.0.0.1");
[HarmonyPatch(typeof(ChatController), nameof(ChatController.Awake))]
public static class ChatControllerAwakePatch {
private static void Prefix() {
- if (!EOSManager.Instance.IsMinor()) {
+ if (!EOSManager.Instance.isKWSMinor) {
SaveManager.chatModeType = 1;
SaveManager.isGuest = false;
}
private static void Postfix(PlayerPhysics __instance) {
AnimationClip currentAnimation = __instance.Animator.GetCurrentAnimation();
if (currentAnimation == __instance.CurrentAnimationGroup.ClimbAnim || currentAnimation == __instance.CurrentAnimationGroup.ClimbDownAnim) return;
- HatParent hp = __instance.myPlayer.HatRenderer;
+ HatParent hp = __instance.myPlayer.cosmetics.hat;
if (hp.Hat == null) return;
HatExtension extend = hp.Hat.getHatExtension();
if (extend == null) return;
if (extend.FlipImage != null) {
- if (__instance.rend.flipX) {
+ if (__instance.FlipX) {
hp.FrontLayer.sprite = extend.FlipImage;
} else {
hp.FrontLayer.sprite = hp.hatView.MainImage;
}
}
if (extend.BackFlipImage != null) {
- if (__instance.rend.flipX) {
+ if (__instance.FlipX) {
hp.BackLayer.sprite = extend.BackFlipImage;
} else {
hp.BackLayer.sprite = hp.hatView.BackImage;
__instance.PopulateFromHatViewData();
- __instance.SetColor(color);
+ __instance.SpriteColor = Palette.PlayerColors[color];
return false;
}
}
spriteRenderer = blood.AddComponent<SpriteRenderer>();
spriteRenderer.sprite = sp[index];
spriteRenderer.material = FastDestroyableSingleton<HatManager>.Instance.PlayerMaterial;
- PlayerControl.SetPlayerMaterialColors(color, spriteRenderer);
+ player.SetPlayerMaterialColors(spriteRenderer);
// spriteRenderer.color = color;
blood.SetActive(true);
// Generate log info
PlayerControl playerControl = Helpers.playerById(playerId);
- bool flip = playerControl.MyRend.flipX; // use the original player control here, not the morhpTarget.
+ bool flip = playerControl.cosmetics.currentBodySprite.BodySprite.flipX; // use the original player control here, not the morhpTarget.
firstPortal.animationFgRenderer.flipX = flip;
secondPortal.animationFgRenderer.flipX = flip;
if (Morphling.morphling != null && Morphling.morphTimer > 0) playerControl = Morphling.morphTarget; // Will output info of morph-target instead
if (firstPortal != null && firstPortal.animationFgRenderer != null && secondPortal != null && secondPortal.animationFgRenderer != null) {
firstPortal.animationFgRenderer.sprite = getFgAnimationSprite((int)(p * portalFgAnimationSprites.Length));
secondPortal.animationFgRenderer.sprite = getFgAnimationSprite((int)(p * portalFgAnimationSprites.Length));
- PlayerControl.SetPlayerMaterialColors(colorId, firstPortal.animationFgRenderer);
- PlayerControl.SetPlayerMaterialColors(colorId, secondPortal.animationFgRenderer);
+ playerControl.SetPlayerMaterialColors(firstPortal.animationFgRenderer);
+ playerControl.SetPlayerMaterialColors(secondPortal.animationFgRenderer);
if (p == 1f) {
firstPortal.animationFgRenderer.sprite = null;
secondPortal.animationFgRenderer.sprite = null;
--- /dev/null
+using HarmonyLib;
+using System;
+
+namespace TheOtherRoles.Patches {
+ [HarmonyPatch]
+ public static class AirShipSetAntiTpPosition {
+
+ // Save the position of the player prior to starting the climb / gap platform
+ [HarmonyPrefix]
+ [HarmonyPatch(typeof(PlayerPhysics), nameof(PlayerPhysics.ClimbLadder))]
+ public static void prefix() {
+ AntiTeleport.position = Players.CachedPlayer.LocalPlayer.transform.position;
+ }
+
+ [HarmonyPrefix]
+ [HarmonyPatch(typeof(MovingPlatformBehaviour), nameof(MovingPlatformBehaviour.UsePlatform))]
+ public static void prefix2() {
+ AntiTeleport.position = Players.CachedPlayer.LocalPlayer.transform.position;
+ }
+ }
+}
public static class ClientOptionsPatch
{
private static SelectionBehaviour[] AllOptions = {
- new SelectionBehaviour("Streamer Mode", () => TheOtherRolesPlugin.StreamerMode.Value = !TheOtherRolesPlugin.StreamerMode.Value, TheOtherRolesPlugin.StreamerMode.Value),
new SelectionBehaviour("Ghosts See Remaining Tasks", () => MapOptions.ghostsSeeTasks = TheOtherRolesPlugin.GhostsSeeTasks.Value = !TheOtherRolesPlugin.GhostsSeeTasks.Value, TheOtherRolesPlugin.GhostsSeeTasks.Value),
new SelectionBehaviour("Ghosts Can See Votes", () => MapOptions.ghostsSeeVotes = TheOtherRolesPlugin.GhostsSeeVotes.Value = !TheOtherRolesPlugin.GhostsSeeVotes.Value, TheOtherRolesPlugin.GhostsSeeVotes.Value),
new SelectionBehaviour("Ghosts Can See Roles", () => MapOptions.ghostsSeeRoles = TheOtherRolesPlugin.GhostsSeeRoles.Value = !TheOtherRolesPlugin.GhostsSeeRoles.Value, TheOtherRolesPlugin.GhostsSeeRoles.Value),
}
}
}
-
- [HarmonyPatch(typeof(TextBoxTMP), nameof(TextBoxTMP.SetText))]
- public static class HiddenTextPatch
- {
- private static void Postfix(TextBoxTMP __instance)
- {
- bool flag = TheOtherRolesPlugin.StreamerMode.Value && (__instance.name == "GameIdText" || __instance.name == "IpTextBox" || __instance.name == "PortTextBox");
- if (flag) __instance.outputText.text = new string('*', __instance.text.Length);
- }
- }
}
public static string contributorsCredentials =
$@"<size=60%> <color=#FCCE03FF>Special thanks to K3ndo & Smeggy</color>
-GitHub Contributors: Gendelo, Alex2911, amsyarasyiq, MaximeGillot, Psynomit, probablyadnf</size>";
+GitHub Contributors: Gendelo, Alex2911, amsyarasyiq, MaximeGillot, Psynomit, probablyadnf, JustASysAdmin</size>";
[HarmonyPatch(typeof(VersionShower), nameof(VersionShower.Start))]
private static class VersionShowerPatch
float num7 = Mathf.Lerp(1f, 0.65f, num4) * 0.9f;
Vector3 vector = new Vector3(num7, num7, 1f);
poolablePlayer.transform.localScale = vector;
- poolablePlayer.UpdateFromPlayerOutfit(winningPlayerData2, winningPlayerData2.IsDead);
+ poolablePlayer.UpdateFromPlayerOutfit((GameData.PlayerOutfit) winningPlayerData2, PlayerMaterial.MaskType.ComplexUI, winningPlayerData2.IsDead, true);
if (winningPlayerData2.IsDead) {
- poolablePlayer.CurrentBodySprite.BodySprite.sprite = poolablePlayer.CurrentBodySprite.GhostSprite;
+ poolablePlayer.cosmetics.currentBodySprite.BodySprite.sprite = poolablePlayer.cosmetics.currentBodySprite.GhostSprite;
poolablePlayer.SetDeadFlipX(i % 2 == 0);
} else {
poolablePlayer.SetFlipX(i % 2 == 0);
}
- poolablePlayer.NameText.color = Color.white;
- poolablePlayer.NameText.transform.localScale = new Vector3(1f / vector.x, 1f / vector.y, 1f / vector.z);
- poolablePlayer.NameText.transform.localPosition = new Vector3(poolablePlayer.NameText.transform.localPosition.x, poolablePlayer.NameText.transform.localPosition.y, -15f);
- poolablePlayer.NameText.text = winningPlayerData2.PlayerName;
+ poolablePlayer.cosmetics.nameText.color = Color.white;
+ poolablePlayer.cosmetics.nameText.transform.localScale = new Vector3(1f / vector.x, 1f / vector.y, 1f / vector.z);
+ poolablePlayer.cosmetics.nameText.transform.localPosition = new Vector3(poolablePlayer.cosmetics.nameText.transform.localPosition.x, poolablePlayer.cosmetics.nameText.transform.localPosition.y, -15f);
+ poolablePlayer.cosmetics.nameText.text = winningPlayerData2.PlayerName;
foreach(var data in AdditionalTempData.playerRoles) {
if (data.PlayerName != winningPlayerData2.PlayerName) continue;
var roles =
- poolablePlayer.NameText.text += $"\n{string.Join("\n", data.Roles.Select(x => Helpers.cs(x.color, x.name)))}";
+ poolablePlayer.cosmetics.nameText.text += $"\n{string.Join("\n", data.Roles.Select(x => Helpers.cs(x.color, x.name)))}";
}
}
public static void Postfix(GameStartManager __instance) {
// Send version as soon as CachedPlayer.LocalPlayer.PlayerControl exists
- if (CachedPlayer.LocalPlayer != null && !versionSent) {
+ if (PlayerControl.LocalPlayer != null && !versionSent) {
versionSent = true;
Helpers.shareGameVersion();
}
- // Host update with version handshake infos
- if (AmongUsClient.Instance.AmHost) {
- bool blockStart = false;
- string message = "";
- foreach (InnerNet.ClientData client in AmongUsClient.Instance.allClients.ToArray()) {
- if (client.Character == null) continue;
- var dummyComponent = client.Character.GetComponent<DummyBehaviour>();
- if (dummyComponent != null && dummyComponent.enabled)
- continue;
- else if (!playerVersions.ContainsKey(client.Id)) {
- blockStart = true;
- message += $"<color=#FF0000FF>{client.Character.Data.PlayerName} has a different or no version of The Other Roles\n</color>";
- } else {
- PlayerVersion PV = playerVersions[client.Id];
- int diff = TheOtherRolesPlugin.Version.CompareTo(PV.version);
- if (diff > 0) {
- message += $"<color=#FF0000FF>{client.Character.Data.PlayerName} has an older version of The Other Roles (v{playerVersions[client.Id].version.ToString()})\n</color>";
- blockStart = true;
- } else if (diff < 0) {
- message += $"<color=#FF0000FF>{client.Character.Data.PlayerName} has a newer version of The Other Roles (v{playerVersions[client.Id].version.ToString()})\n</color>";
- blockStart = true;
- } else if (!PV.GuidMatches()) { // version presumably matches, check if Guid matches
- message += $"<color=#FF0000FF>{client.Character.Data.PlayerName} has a modified version of TOR v{playerVersions[client.Id].version.ToString()} <size=30%>({PV.guid.ToString()})</size>\n</color>";
- blockStart = true;
- }
+ // Check version handshake infos
+
+ bool versionMismatch = false;
+ string message = "";
+ foreach (InnerNet.ClientData client in AmongUsClient.Instance.allClients.ToArray()) {
+ if (client.Character == null) continue;
+ var dummyComponent = client.Character.GetComponent<DummyBehaviour>();
+ if (dummyComponent != null && dummyComponent.enabled)
+ continue;
+ else if (!playerVersions.ContainsKey(client.Id)) {
+ versionMismatch = true;
+ message += $"<color=#FF0000FF>{client.Character.Data.PlayerName} has a different or no version of The Other Roles\n</color>";
+ } else {
+ PlayerVersion PV = playerVersions[client.Id];
+ int diff = TheOtherRolesPlugin.Version.CompareTo(PV.version);
+ if (diff > 0) {
+ message += $"<color=#FF0000FF>{client.Character.Data.PlayerName} has an older version of The Other Roles (v{playerVersions[client.Id].version.ToString()})\n</color>";
+ versionMismatch = true;
+ } else if (diff < 0) {
+ message += $"<color=#FF0000FF>{client.Character.Data.PlayerName} has a newer version of The Other Roles (v{playerVersions[client.Id].version.ToString()})\n</color>";
+ versionMismatch = true;
+ } else if (!PV.GuidMatches()) { // version presumably matches, check if Guid matches
+ message += $"<color=#FF0000FF>{client.Character.Data.PlayerName} has a modified version of TOR v{playerVersions[client.Id].version.ToString()} <size=30%>({PV.guid.ToString()})</size>\n</color>";
+ versionMismatch = true;
}
}
- if (blockStart) {
+ }
+
+ // Display message to the host
+ if (AmongUsClient.Instance.AmHost) {
+ if (versionMismatch) {
__instance.StartButton.color = __instance.startLabelText.color = Palette.DisabledClear;
__instance.GameStartText.text = message;
__instance.GameStartText.transform.localPosition = __instance.StartButton.transform.localPosition + Vector3.up * 2;
}
// Client update with handshake infos
- if (!AmongUsClient.Instance.AmHost) {
+ else {
if (!playerVersions.ContainsKey(AmongUsClient.Instance.HostId) || TheOtherRolesPlugin.Version.CompareTo(playerVersions[AmongUsClient.Instance.HostId].version) != 0) {
kickingTimer += Time.deltaTime;
if (kickingTimer > 10) {
__instance.GameStartText.text = $"<color=#FF0000FF>The host has no or a different version of The Other Roles\nYou will be kicked in {Math.Round(10 - kickingTimer)}s</color>";
__instance.GameStartText.transform.localPosition = __instance.StartButton.transform.localPosition + Vector3.up * 2;
+ } else if (versionMismatch) {
+ __instance.GameStartText.text = $"<color=#FF0000FF>Players With Different Versions:\n</color>" + message;
+ __instance.GameStartText.transform.localPosition = __instance.StartButton.transform.localPosition + Vector3.up * 2;
} else {
__instance.GameStartText.transform.localPosition = __instance.StartButton.transform.localPosition;
if (__instance.startState != GameStartManager.StartingStates.Countdown) {
}
}
- // Lobby code replacement
- __instance.GameRoomName.text = TheOtherRolesPlugin.StreamerMode.Value ? $"<color={TheOtherRolesPlugin.StreamerModeReplacementColor.Value}>{TheOtherRolesPlugin.StreamerModeReplacementText.Value}</color>" : lobbyCodeText;
-
// Lobby timer
if (!AmongUsClient.Instance.AmHost || !GameData.Instance) return; // Not host or no instance
GameData.PlayerInfo data = p.Data;
PoolablePlayer player = UnityEngine.Object.Instantiate<PoolablePlayer>(__instance.PlayerPrefab, FastDestroyableSingleton<HudManager>.Instance.transform);
playerPrefab = __instance.PlayerPrefab;
- PlayerControl.SetPlayerMaterialColors(data.DefaultOutfit.ColorId, player.CurrentBodySprite.BodySprite);
+ p.SetPlayerMaterialColors(player.cosmetics.currentBodySprite.BodySprite);
player.SetSkin(data.DefaultOutfit.SkinId, data.DefaultOutfit.ColorId);
- player.HatSlot.SetHat(data.DefaultOutfit.HatId, data.DefaultOutfit.ColorId);
- PlayerControl.SetPetImage(data.DefaultOutfit.PetId, data.DefaultOutfit.ColorId, player.PetSlot);
- player.NameText.text = data.PlayerName;
+ player.cosmetics.SetHat(data.DefaultOutfit.HatId, data.DefaultOutfit.ColorId);
+ // PlayerControl.SetPetImage(data.DefaultOutfit.PetId, data.DefaultOutfit.ColorId, player.PetSlot);
+ player.cosmetics.nameText.text = data.PlayerName;
player.SetFlipX(true);
MapOptions.playerIcons[p.PlayerId] = player;
GameData.PlayerInfo exiled = GameData.Instance.AllPlayers.ToArray().FirstOrDefault(v => !tie && v.PlayerId == max.Key && !v.IsDead);
// TieBreaker
- Tiebreaker.isTiebreak = false;
- int maxVoteValue = self.Values.Max();
List<GameData.PlayerInfo> potentialExiled = new List<GameData.PlayerInfo>();
-
-
- PlayerVoteArea tb = null;
- if (Tiebreaker.tiebreaker != null)
- tb = __instance.playerStates.ToArray().FirstOrDefault(x => x.TargetPlayerId == Tiebreaker.tiebreaker.PlayerId);
- bool isTiebreakerSkip = tb == null || tb.VotedFor == 253;
- if (tb != null && tb.AmDead) isTiebreakerSkip = true;
-
- foreach (KeyValuePair<byte, int> pair in self)
- if (pair.Value == maxVoteValue && !isTiebreakerSkip && pair.Key != 253)
- potentialExiled.Add(GameData.Instance.AllPlayers.ToArray().FirstOrDefault(x => x.PlayerId == pair.Key));
+ if (self.Count > 0) {
+ Tiebreaker.isTiebreak = false;
+ int maxVoteValue = self.Values.Max();
+ PlayerVoteArea tb = null;
+ if (Tiebreaker.tiebreaker != null)
+ tb = __instance.playerStates.ToArray().FirstOrDefault(x => x.TargetPlayerId == Tiebreaker.tiebreaker.PlayerId);
+ bool isTiebreakerSkip = tb == null || tb.VotedFor == 253;
+ if (tb != null && tb.AmDead) isTiebreakerSkip = true;
+
+ foreach (KeyValuePair<byte, int> pair in self)
+ if (pair.Value == maxVoteValue && !isTiebreakerSkip && pair.Key != 253)
+ potentialExiled.Add(GameData.Instance.AllPlayers.ToArray().FirstOrDefault(x => x.PlayerId == pair.Key));
+ }
MeetingHud.VoterState[] array = new MeetingHud.VoterState[__instance.playerStates.Length];
for (int i = 0; i < __instance.playerStates.Length; i++)
class MeetingHudBloopAVoteIconPatch {
public static bool Prefix(MeetingHud __instance, [HarmonyArgument(0)]GameData.PlayerInfo voterPlayer, [HarmonyArgument(1)]int index, [HarmonyArgument(2)]Transform parent) {
SpriteRenderer spriteRenderer = UnityEngine.Object.Instantiate<SpriteRenderer>(__instance.PlayerVotePrefab);
- if (!PlayerControl.GameOptions.AnonymousVotes || (CachedPlayer.LocalPlayer.Data.IsDead && MapOptions.ghostsSeeVotes) || Mayor.mayor != null && CachedPlayer.LocalPlayer.PlayerControl == Mayor.mayor && Mayor.canSeeVoteColors && TasksHandler.taskInfo(CachedPlayer.LocalPlayer.Data).Item1 >= Mayor.tasksNeededToSeeVoteColors)
- PlayerControl.SetPlayerMaterialColors(voterPlayer.DefaultOutfit.ColorId, spriteRenderer);
- else
- PlayerControl.SetPlayerMaterialColors(Palette.DisabledGrey, spriteRenderer);
+ int cId = voterPlayer.DefaultOutfit.ColorId;
+ if (!(!PlayerControl.GameOptions.AnonymousVotes || (CachedPlayer.LocalPlayer.Data.IsDead && MapOptions.ghostsSeeVotes) || Mayor.mayor != null && CachedPlayer.LocalPlayer.PlayerControl == Mayor.mayor && Mayor.canSeeVoteColors && TasksHandler.taskInfo(CachedPlayer.LocalPlayer.Data).Item1 >= Mayor.tasksNeededToSeeVoteColors))
+ voterPlayer.Object.SetColor(6);
+ voterPlayer.Object.SetPlayerMaterialColors(spriteRenderer);
spriteRenderer.transform.SetParent(parent);
spriteRenderer.transform.localScale = Vector3.zero;
__instance.StartCoroutine(Effects.Bloop((float)index * 0.3f, spriteRenderer.transform, 1f, 0.5f));
parent.GetComponent<VoteSpreader>().AddVote(spriteRenderer);
+ voterPlayer.Object.SetColor(cId);
return false;
}
}
foreach (RoleInfo roleInfo in RoleInfo.allRoleInfos) {
RoleId guesserRole = (Guesser.niceGuesser != null && CachedPlayer.LocalPlayer.PlayerId == Guesser.niceGuesser.PlayerId) ? RoleId.NiceGuesser : RoleId.EvilGuesser;
if (roleInfo.isModifier || roleInfo.roleId == guesserRole || (!Guesser.evilGuesserCanGuessSpy && guesserRole == RoleId.EvilGuesser && roleInfo.roleId == RoleId.Spy)) continue; // Not guessable roles & modifier
-
+ // remove all roles that cannot spawn due to the settings from the ui.
+ RoleManagerSelectRolesPatch.RoleAssignmentData roleData = RoleManagerSelectRolesPatch.getRoleAssignmentData();
+ if (roleData.neutralSettings.ContainsKey((byte)roleInfo.roleId) && roleData.neutralSettings[(byte)roleInfo.roleId] == 0) continue;
+ else if (roleData.impSettings.ContainsKey((byte)roleInfo.roleId) && roleData.impSettings[(byte)roleInfo.roleId] == 0) continue;
+ else if (roleData.crewSettings.ContainsKey((byte)roleInfo.roleId) && roleData.crewSettings[(byte)roleInfo.roleId] == 0) continue;
+ else if (new List<RoleId>() { RoleId.Janitor, RoleId.Godfather, RoleId.Mafioso }.Contains(roleInfo.roleId) && CustomOptionHolder.mafiaSpawnRate.getSelection() == 0) continue;
+ else if (roleInfo.roleId == RoleId.Sidekick && (!CustomOptionHolder.jackalCanCreateSidekick.getBool() || CustomOptionHolder.jackalSpawnRate.getSelection() == 0)) continue;
+ if (roleInfo.roleId == RoleId.Deputy && (CustomOptionHolder.deputySpawnRate.getSelection() == 0 || CustomOptionHolder.sheriffSpawnRate.getSelection() == 0)) continue;
+ if (roleInfo.roleId == RoleId.Spy && roleData.impostors.Count <= 1) continue;
+
if (Guesser.guesserCantGuessSnitch && Snitch.snitch != null) {
var (playerCompleted, playerTotal) = TasksHandler.taskInfo(Snitch.snitch.Data);
int numberOfLeftTasks = playerTotal - playerCompleted;
}
//Fix visor in Meetings
+ /**
foreach (PlayerVoteArea pva in __instance.playerStates) {
if(pva.PlayerIcon != null && pva.PlayerIcon.VisorSlot != null){
pva.PlayerIcon.VisorSlot.transform.position += new Vector3(0, 0, -1f);
}
- }
+ } */
// Add overlay for spelled players
if (Witch.witch != null && Witch.futureSpelled != null) {
}
}
- [HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.CoStartMeeting))]
+ [HarmonyPatch(typeof(PlayerControl), nameof(PlayerControl.StartMeeting))]
class StartMeetingPatch {
public static void Prefix(PlayerControl __instance, [HarmonyArgument(0)]GameData.PlayerInfo meetingTarget) {
// Resett Bait list
Bait.active = new Dictionary<DeadPlayer, float>();
- // Safe AntiTeleport positions
- AntiTeleport.position = CachedPlayer.LocalPlayer.transform.position;
+ // Save AntiTeleport position, if the player is able to move (i.e. not on a ladder or a gap thingy)
+ if (CachedPlayer.LocalPlayer.PlayerPhysics.enabled && CachedPlayer.LocalPlayer.PlayerControl.moveable || CachedPlayer.LocalPlayer.PlayerControl.inVent
+ || HudManagerStartPatch.hackerVitalsButton.isEffectActive || HudManagerStartPatch.hackerAdminTableButton.isEffectActive || HudManagerStartPatch.securityGuardCamButton.isEffectActive
+ || Portal.isTeleporting && Portal.teleportedPlayers.Last().playerId == CachedPlayer.LocalPlayer.PlayerId) {
+ AntiTeleport.position = CachedPlayer.LocalPlayer.transform.position;
+ }
+
// Medium meeting start time
Medium.meetingStartTime = DateTime.UtcNow;
// Reset vampire bitten
}
static void setPlayerOutline(PlayerControl target, Color color) {
- if (target == null || target.MyRend == null) return;
+ if (target == null || target.cosmetics?.currentBodySprite?.BodySprite == null) return;
- target.MyRend.material.SetFloat("_Outline", 1f);
- target.MyRend.material.SetColor("_OutlineColor", color);
+ target.cosmetics.currentBodySprite.BodySprite.material.SetFloat("_Outline", 1f);
+ target.cosmetics.currentBodySprite.BodySprite.material.SetColor("_OutlineColor", color);
}
// Update functions
static void setBasePlayerOutlines() {
foreach (PlayerControl target in CachedPlayer.AllPlayers) {
- if (target == null || target.MyRend == null) continue;
+ if (target == null || target.cosmetics?.currentBodySprite?.BodySprite == null) continue;
bool isMorphedMorphling = target == Morphling.morphling && Morphling.morphTarget != null && Morphling.morphTimer > 0f;
bool hasVisibleShield = false;
}
if (hasVisibleShield) {
- target.MyRend.material.SetFloat("_Outline", 1f);
- target.MyRend.material.SetColor("_OutlineColor", color);
+ target.cosmetics.currentBodySprite.BodySprite.material.SetFloat("_Outline", 1f);
+ target.cosmetics.currentBodySprite.BodySprite.material.SetColor("_OutlineColor", color);
}
else {
- target.MyRend.material.SetFloat("_Outline", 0f);
+ target.cosmetics.currentBodySprite.BodySprite.material.SetFloat("_Outline", 0f);
}
}
}
public static void updatePlayerInfo() {
foreach (PlayerControl p in CachedPlayer.AllPlayers) {
if ((Lawyer.lawyerKnowsRole && CachedPlayer.LocalPlayer.PlayerControl == Lawyer.lawyer && p == Lawyer.target) || p == CachedPlayer.LocalPlayer.PlayerControl || CachedPlayer.LocalPlayer.Data.IsDead) {
- Transform playerInfoTransform = p.nameText.transform.parent.FindChild("Info");
+ Transform playerInfoTransform = p.cosmetics.nameText.transform.parent.FindChild("Info");
TMPro.TextMeshPro playerInfo = playerInfoTransform != null ? playerInfoTransform.GetComponent<TMPro.TextMeshPro>() : null;
if (playerInfo == null) {
- playerInfo = UnityEngine.Object.Instantiate(p.nameText, p.nameText.transform.parent);
+ playerInfo = UnityEngine.Object.Instantiate(p.cosmetics.nameText, p.cosmetics.nameText.transform.parent);
playerInfo.transform.localPosition += Vector3.up * 0.5f;
playerInfo.fontSize *= 0.75f;
playerInfo.gameObject.name = "Info";
if (Ninja.ninja == null || Ninja.ninja != CachedPlayer.LocalPlayer.PlayerControl) return;
List<PlayerControl> untargetables = new List<PlayerControl>();
if (Spy.spy != null && !Spy.impostorsCanKillAnyone) untargetables.Add(Spy.spy);
- if (Mini.mini != null) untargetables.Add(Mini.mini);
+ if (Mini.mini != null && !Mini.isGrownUp()) untargetables.Add(Mini.mini);
if (Sidekick.wasTeamRed && !Spy.impostorsCanKillAnyone) untargetables.Add(Sidekick.sidekick);
if (Jackal.wasTeamRed && !Spy.impostorsCanKillAnyone) untargetables.Add(Jackal.jackal);
Ninja.currentTarget = setTarget(onlyCrewmates: true, untargetablePlayers: untargetables);
Bait.active[entry.Key] = entry.Value - Time.fixedDeltaTime;
if (entry.Value <= 0) {
Bait.active.Remove(entry.Key);
- if (entry.Key.killerIfExisting != null) {
+ if (entry.Key.killerIfExisting != null && entry.Key.killerIfExisting.PlayerId == CachedPlayer.LocalPlayer.PlayerId) {
Helpers.handleVampireBiteOnBodyReport(); // Manually call Vampire handling, since the CmdReportDeadBody Prefix won't be called
RPCProcedure.uncheckedCmdReportDeadBody(entry.Key.killerIfExisting.PlayerId, entry.Key.player.PlayerId);
HudManagerStartPatch.warlockCurseButton.MaxTimer = Warlock.cooldown * multiplier;
HudManagerStartPatch.cleanerCleanButton.MaxTimer = Cleaner.cooldown * multiplier;
HudManagerStartPatch.witchSpellButton.MaxTimer = (Witch.cooldown + Witch.currentCooldownAddition) * multiplier;
+ HudManagerStartPatch.ninjaButton.MaxTimer = Ninja.cooldown * multiplier;
}
}
public static void Postfix(PlayerControl __instance) {
class KillAnimationSetMovementPatch {
private static int? colorId = null;
public static void Prefix(PlayerControl source, bool canMove) {
- Color color = source.MyRend.material.GetColor("_BodyColor");
+ Color color = source.cosmetics.currentBodySprite.BodySprite.material.GetColor("_BodyColor");
if (color != null && Morphling.morphling != null && source.Data.PlayerId == Morphling.morphling.PlayerId) {
var index = Palette.PlayerColors.IndexOf(color);
if (index != -1) colorId = index;
assignModifiers();
}
- private static RoleAssignmentData getRoleAssignmentData() {
+ public static RoleAssignmentData getRoleAssignmentData() {
// Get the players that we want to assign the roles to. Crewmate and Neutral roles are assigned to natural crewmates. Impostor roles to impostors.
List<PlayerControl> crewmates = PlayerControl.AllPlayerControls.ToArray().ToList().OrderBy(x => Guid.NewGuid()).ToList();
crewmates.RemoveAll(x => x.Data.Role.IsImpostor);
}
- private class RoleAssignmentData {
+ public class RoleAssignmentData {
public List<PlayerControl> crewmates {get;set;}
public List<PlayerControl> impostors {get;set;}
public Dictionary<byte, int> impSettings = new Dictionary<byte, int>();
// If player is Lighter with ability active
if (Lighter.lighter != null && Lighter.lighter.PlayerId == player.PlayerId && Lighter.lighterTimer > 0f) {
- float unlerped = Mathf.InverseLerp(__instance.MinLightRadius, __instance.MaxLightRadius, GetNeutralLightRadius(__instance, true));
+ float unlerped = Mathf.InverseLerp(__instance.MinLightRadius, __instance.MaxLightRadius, GetNeutralLightRadius(__instance, false));
__result = Mathf.Lerp(__instance.MaxLightRadius * Lighter.lighterModeLightsOffVision, __instance.MaxLightRadius * Lighter.lighterModeLightsOnVision, unlerped);
}
{
var playerName = text;
if (morphTimerNotUp && morphTargetNotNull && Morphling.morphling == player) playerName = Morphling.morphTarget.Data.PlayerName;
- var nameText = player.nameText;
+ var nameText = player.cosmetics.nameText;
nameText.text = Helpers.hidePlayerName(localPlayer, player) ? "" : playerName;
nameText.color = color = amImpostor && data.Role.IsImpostor ? Palette.ImpostorRed : Color.white;
}
static void setPlayerNameColor(PlayerControl p, Color color) {
- p.nameText.color = color;
+ p.cosmetics.nameText.color = color;
if (MeetingHud.Instance != null)
foreach (PlayerVoteArea player in MeetingHud.Instance.playerStates)
if (player.NameText != null && p.PlayerId == player.TargetPlayerId)
if (CachedPlayer.LocalPlayer != null && CachedPlayer.LocalPlayer.Data.Role.IsImpostor) {
foreach (PlayerControl player in CachedPlayer.AllPlayers)
if (Godfather.godfather != null && Godfather.godfather == player)
- player.nameText.text = player.Data.PlayerName + " (G)";
+ player.cosmetics.nameText.text = player.Data.PlayerName + " (G)";
else if (Mafioso.mafioso != null && Mafioso.mafioso == player)
- player.nameText.text = player.Data.PlayerName + " (M)";
+ player.cosmetics.nameText.text = player.Data.PlayerName + " (M)";
else if (Janitor.janitor != null && Janitor.janitor == player)
- player.nameText.text = player.Data.PlayerName + " (J)";
+ player.cosmetics.nameText.text = player.Data.PlayerName + " (J)";
if (MeetingHud.Instance != null)
foreach (PlayerVoteArea player in MeetingHud.Instance.playerStates)
if (Godfather.godfather != null && Godfather.godfather.PlayerId == player.TargetPlayerId)
// Lovers
if (Lovers.lover1 != null && Lovers.lover2 != null && (Lovers.lover1 == CachedPlayer.LocalPlayer.PlayerControl || Lovers.lover2 == CachedPlayer.LocalPlayer.PlayerControl)) {
string suffix = Helpers.cs(Lovers.color, " ♥");
- Lovers.lover1.nameText.text += suffix;
- Lovers.lover2.nameText.text += suffix;
+ Lovers.lover1.cosmetics.nameText.text += suffix;
+ Lovers.lover2.cosmetics.nameText.text += suffix;
if (MeetingHud.Instance != null)
foreach (PlayerVoteArea player in MeetingHud.Instance.playerStates)
// Lawyer
if (Lawyer.lawyer != null && Lawyer.target != null && Lawyer.lawyer == CachedPlayer.LocalPlayer.PlayerControl) {
string suffix = Helpers.cs(Lawyer.color, " §");
- Lawyer.target.nameText.text += suffix;
+ Lawyer.target.cosmetics.nameText.text += suffix;
if (MeetingHud.Instance != null)
foreach (PlayerVoteArea player in MeetingHud.Instance.playerStates)
}
public static void miniUpdate() {
- if (Mini.mini == null || Camouflager.camouflageTimer > 0f || Mini.mini == Morphling.morphling && Morphling.morphTimer > 0f) return;
+ if (Mini.mini == null || Camouflager.camouflageTimer > 0f || Mini.mini == Morphling.morphling && Morphling.morphTimer > 0f || Mini.mini == Ninja.ninja && Ninja.isInvisble) return;
float growingProgress = Mini.growingProgress();
float scale = growingProgress * 0.35f + 0.35f;
if (growingProgress != 1f)
suffix = " <color=#FAD934FF>(" + Mathf.FloorToInt(growingProgress * 18) + ")</color>";
- Mini.mini.nameText.text += suffix;
+ Mini.mini.cosmetics.nameText.text += suffix;
if (MeetingHud.Instance != null) {
foreach (PlayerVoteArea player in MeetingHud.Instance.playerStates)
if (player.NameText != null && Mini.mini.PlayerId == player.TargetPlayerId)
}
if (Morphling.morphling != null && Morphling.morphTarget == Mini.mini && Morphling.morphTimer > 0f)
- Morphling.morphling.nameText.text += suffix;
+ Morphling.morphling.cosmetics.nameText.text += suffix;
}
static void updateImpostorKillButton(HudManager __instance) {
//Fix Visor in Vitals
foreach (VitalsPanel panel in __instance.vitals) {
- if (panel.PlayerIcon != null && panel.PlayerIcon.Skin != null) {
- panel.PlayerIcon.Skin.transform.position = new Vector3(0, 0, 0f);
+ if (panel.PlayerIcon != null && panel.PlayerIcon.cosmetics.skin != null) {
+ panel.PlayerIcon.cosmetics.skin.transform.position = new Vector3(0, 0, 0f);
}
}
}
if (!component || component.Data == null || component.Data.Disconnected || component.Data.IsDead)
{
num2--;
- } else if (component?.MyRend?.material != null) {
- Color color = component.MyRend.material.GetColor("_BodyColor");
+ } else if (component?.cosmetics?.currentBodySprite?.BodySprite?.material != null) {
+ Color color = component.cosmetics.currentBodySprite.BodySprite.material.GetColor("_BodyColor");
if (Hacker.onlyColorType) {
var id = Mathf.Max(0, Palette.PlayerColors.IndexOf(color));
color = Helpers.isLighterColor((byte)id) ? Palette.PlayerColors[7] : Palette.PlayerColors[6];
FastDestroyableSingleton<RoleManager>.Instance.SetRole(player, RoleTypes.Crewmate);
if (player == Lawyer.lawyer && Lawyer.target != null)
{
- Transform playerInfoTransform = Lawyer.target.nameText.transform.parent.FindChild("Info");
+ Transform playerInfoTransform = Lawyer.target.cosmetics.nameText.transform.parent.FindChild("Info");
TMPro.TextMeshPro playerInfo = playerInfoTransform != null ? playerInfoTransform.GetComponent<TMPro.TextMeshPro>() : null;
if (playerInfo != null) playerInfo.text = "";
}
if (target == null) return;
if (flag == byte.MaxValue)
{
- target.MyRend.color = Color.white;
- target.setDefaultLook();
+ target.cosmetics.currentBodySprite.BodySprite.color = Color.white;
+ if (Camouflager.camouflageTimer <= 0) target.setDefaultLook();
Ninja.isInvisble = false;
return;
}
target.setLook("", 6, "", "", "", "");
Color color = Color.clear;
if (CachedPlayer.LocalPlayer.Data.Role.IsImpostor || CachedPlayer.LocalPlayer.Data.IsDead) color.a = 0.1f;
- target.MyRend.color = color;
+ target.cosmetics.currentBodySprite.BodySprite.color = color;
Ninja.invisibleTimer = Ninja.invisibleDuration;
Ninja.isInvisble = true;
}
Pursuer.pursuer = player;
if (player.PlayerId == CachedPlayer.LocalPlayer.PlayerId && client != null) {
- Transform playerInfoTransform = client.nameText.transform.parent.FindChild("Info");
+ Transform playerInfoTransform = client.cosmetics.nameText.transform.parent.FindChild("Info");
TMPro.TextMeshPro playerInfo = playerInfoTransform != null ? playerInfoTransform.GetComponent<TMPro.TextMeshPro>() : null;
if (playerInfo != null) playerInfo.text = "";
}
</ItemGroup>
<ItemGroup>
- <PackageReference Include="AmongUs.GameLibs.Steam" Version="2022.3.29" />
+ <PackageReference Include="AmongUs.GameLibs.Steam" Version="2022.6.21" />
<PackageReference Include="BepInEx.IL2CPP" Version="6.0.0-be.559" />
<PackageReference Include="BepInEx.IL2CPP.MSBuild" Version="1.1.1" />
</ItemGroup>
".NETStandard,Version=v2.1": {
"AmongUs.GameLibs.Steam": {
"type": "Direct",
- "requested": "[2022.3.29, )",
- "resolved": "2022.3.29",
- "contentHash": "EStKwHGq8MMvSRxIHjlh31VJmCZrGHZ/xoDDN33L5gh7XJLWBFufo6+5ueezndSRpanoCkqLwuTkG73KCS2J1A=="
+ "requested": "[2022.6.21, )",
+ "resolved": "2022.6.21",
+ "contentHash": "l5lB5cTEBRWW+WNOso11mT8csmoZK7CUEqTkACSTwQbxtMQyZN9YORNxkJmtOD7pZnNkbWJ3dLAvQ6pMUsFDsQ=="
},
"BepInEx.IL2CPP": {
"type": "Direct",