Skip to content

Commit

Permalink
Update v4.6.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gendelo3 committed Aug 1, 2024
1 parent 834b891 commit 8e63bff
Show file tree
Hide file tree
Showing 47 changed files with 1,022 additions and 887 deletions.
19 changes: 17 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,16 @@ The [Role Assignment](#role-assignment) section explains how the roles are being
# Releases
| Among Us - Version| Mod Version | Link |
|----------|-------------|-----------------|
| 2024.6.18s| v4.6.0| [Download](https://github.com/TheOtherRolesAU/TheOtherRoles/releases/download/v4.6.0/TheOtherRoles.zip)

This comment has been minimized.

Copy link
@noahbates08

noahbates08 Aug 4, 2024

k

This comment has been minimized.

Copy link
@noahbates08

noahbates08 Aug 4, 2024

s

| 2024.3.5s| v4.5.3| [Download](https://github.com/TheOtherRolesAU/TheOtherRoles/releases/download/v4.5.3/TheOtherRoles.zip)
| 2024.3.5s| v4.5.2| [Download](https://github.com/TheOtherRolesAU/TheOtherRoles/releases/download/v4.5.2/TheOtherRoles.zip)
| 2023.11.28s| v4.5.1| [Download](https://github.com/TheOtherRolesAU/TheOtherRoles/releases/download/v4.5.1/TheOtherRoles.zip)

<details>
<summary>Click to show older versions</summary>

| Among Us - Version| Mod Version | Link |
|----------|-------------|-----------------|
| 2024.3.5s| v4.5.2| [Download](https://github.com/TheOtherRolesAU/TheOtherRoles/releases/download/v4.5.2/TheOtherRoles.zip)
| 2023.11.28s| v4.5.1| [Download](https://github.com/TheOtherRolesAU/TheOtherRoles/releases/download/v4.5.1/TheOtherRoles.zip)
| 2023.11.28s| v4.5.0| [Download](https://github.com/TheOtherRolesAU/TheOtherRoles/releases/download/v4.5.0/TheOtherRoles.zip)
| 2023.07.12s| v4.4.2| [Download](https://github.com/TheOtherRolesAU/TheOtherRoles/releases/download/v4.4.2/TheOtherRoles.zip)
| 2023.07.12s| v4.4.1| [Download](https://github.com/TheOtherRolesAU/TheOtherRoles/releases/download/v4.4.1/TheOtherRoles.zip)
Expand Down Expand Up @@ -133,6 +134,20 @@ The [Role Assignment](#role-assignment) section explains how the roles are being
<details>
<summary>Click to show the Changelog</summary>


** Version 4.6.0**
- Updated to Among Us version 2024.6.18 (Vanilla Update with new UI elements and many Server Side Changes)
- Added a completely new UI for the Mod's Options, using the new Vanilla Design.
- Added a button to switch gamemodes in the lobby
- Added an option to enable the Chat-Notification in game (in Mod Options)
- Fixed a bug where the shielding the bomber would show a murder attempt on the bomber, when they plant a bomb (sorry Vlesk)
- Fixed a bug in PropHunt, where the background of the Prop-Display was visible in the cameras
- Fixed a bug where guessing a player would sometimes not return the votes to the voters
- Fixed a bug where the Lawyer would not properly die when guessing the client
- Removed: Disabled Vanilla Servers for now, as the mod is incompatible with them in its / their current state. Thanks to Miniduikboat for making custom servers great again!
- Experimental: Advanded users can try to install the mod on the Windows Store Version of Among Us. No Support Provided!


**Version 4.5.3**
- Added a new role: Yo-Yo (Impostor) - Mark and blink to a position, then blink back to the start of the blink!
- Added a new option to Jackal And Sidekick: Jackal / Sidekick can sabotage lights (cooldown syncs with Imp Sabotages)
Expand Down
11 changes: 10 additions & 1 deletion TheOtherRoles.sln
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@

Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TheOtherRoles", "TheOtherRoles\TheOtherRoles.csproj", "{11FBC798-BAF5-4EE5-9511-BE6DB0592F99}"
# Visual Studio Version 17
VisualStudioVersion = 17.9.34728.123
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TheOtherRoles", "TheOtherRoles\TheOtherRoles.csproj", "{11FBC798-BAF5-4EE5-9511-BE6DB0592F99}"
EndProject
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "TheOtherUpdater", "TheOtherUpdater\TheOtherUpdater.vcxproj", "{73A5662B-9C59-4C97-95C5-F5B2A8BBDDCA}"
EndProject
Expand All @@ -19,4 +22,10 @@ Global
{73A5662B-9C59-4C97-95C5-F5B2A8BBDDCA}.Release|Any CPU.ActiveCfg = Release|Win32
{73A5662B-9C59-4C97-95C5-F5B2A8BBDDCA}.Release|Any CPU.Build.0 = Release|Win32
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {0CC3F51E-CC66-4122-B4CB-3A0B59DE563C}
EndGlobalSection
EndGlobal
15 changes: 6 additions & 9 deletions TheOtherRoles/Buttons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,7 @@ private static void setButtonTargetDisplay(PlayerControl target, CustomButton bu
// Add poolable player to the button so that the target outfit is shown
button.actionButton.cooldownTimerText.transform.localPosition = new Vector3(0, 0, -1f); // Before the poolable player
targetDisplay = UnityEngine.Object.Instantiate<PoolablePlayer>(Patches.IntroCutsceneOnDestroyPatch.playerPrefab, button.actionButton.transform);
GameData.PlayerInfo data = target.Data;
NetworkedPlayerInfo data = target.Data;
target.SetPlayerMaterialColors(targetDisplay.cosmetics.currentBodySprite.BodySprite);
targetDisplay.SetSkin(data.DefaultOutfit.SkinId, data.DefaultOutfit.ColorId);
targetDisplay.SetHat(data.DefaultOutfit.HatId, data.DefaultOutfit.ColorId);
Expand Down Expand Up @@ -364,7 +364,7 @@ public static void createButtonsPostfix(HudManager __instance) {
Vector2 truePosition2 = component.TruePosition;
if (Vector2.Distance(truePosition2, truePosition) <= CachedPlayer.LocalPlayer.PlayerControl.MaxReportDistance && CachedPlayer.LocalPlayer.PlayerControl.CanMove && !PhysicsHelpers.AnythingBetween(truePosition, truePosition2, Constants.ShipAndObjectsMask, false))
{
GameData.PlayerInfo playerInfo = GameData.Instance.GetPlayerById(component.ParentId);
NetworkedPlayerInfo playerInfo = GameData.Instance.GetPlayerById(component.ParentId);
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.CleanBody, Hazel.SendOption.Reliable, -1);
writer.Write(playerInfo.PlayerId);
Expand Down Expand Up @@ -1177,7 +1177,7 @@ public static void createButtonsPostfix(HudManager __instance) {
Vector2 truePosition2 = component.TruePosition;
if (Vector2.Distance(truePosition2, truePosition) <= CachedPlayer.LocalPlayer.PlayerControl.MaxReportDistance && CachedPlayer.LocalPlayer.PlayerControl.CanMove && !PhysicsHelpers.AnythingBetween(truePosition, truePosition2, Constants.ShipAndObjectsMask, false))
{
GameData.PlayerInfo playerInfo = GameData.Instance.GetPlayerById(component.ParentId);
NetworkedPlayerInfo playerInfo = GameData.Instance.GetPlayerById(component.ParentId);
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.CleanBody, Hazel.SendOption.Reliable, -1);
writer.Write(playerInfo.PlayerId);
Expand Down Expand Up @@ -1448,7 +1448,7 @@ public static void createButtonsPostfix(HudManager __instance) {
Vector2 truePosition = CachedPlayer.LocalPlayer.PlayerControl.GetTruePosition();
Vector2 truePosition2 = component.TruePosition;
if (Vector2.Distance(truePosition2, truePosition) <= CachedPlayer.LocalPlayer.PlayerControl.MaxReportDistance && CachedPlayer.LocalPlayer.PlayerControl.CanMove && !PhysicsHelpers.AnythingBetween(truePosition, truePosition2, Constants.ShipAndObjectsMask, false)) {
GameData.PlayerInfo playerInfo = GameData.Instance.GetPlayerById(component.ParentId);
NetworkedPlayerInfo playerInfo = GameData.Instance.GetPlayerById(component.ParentId);
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.CleanBody, Hazel.SendOption.Reliable, -1);
writer.Write(playerInfo.PlayerId);
Expand Down Expand Up @@ -1796,7 +1796,7 @@ public static void createButtonsPostfix(HudManager __instance) {
// Bomber button
bomberButton = new CustomButton(
() => {
if (Helpers.checkMuderAttempt(Bomber.bomber, Bomber.bomber) != MurderAttemptResult.BlankKill) {
if (Helpers.checkMuderAttempt(Bomber.bomber, Bomber.bomber, ignoreMedic: true) != MurderAttemptResult.BlankKill) {
var pos = CachedPlayer.LocalPlayer.transform.position;
byte[] buff = new byte[sizeof(float) * 2];
Buffer.BlockCopy(BitConverter.GetBytes(pos.x), 0, buff, 0 * sizeof(float), sizeof(float));
Expand Down Expand Up @@ -1931,7 +1931,6 @@ public static void createButtonsPostfix(HudManager __instance) {
Buffer.BlockCopy(BitConverter.GetBytes(pos.y), 0, buff, 1 * sizeof(float), sizeof(float));
if (Yoyo.markedLocation == null) {
TheOtherRolesPlugin.Logger.LogMessage($"marked location is null in button press");
MessageWriter writer = AmongUsClient.Instance.StartRpc(CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.YoyoMarkLocation, Hazel.SendOption.Reliable);
writer.WriteBytesAndSize(buff);
writer.EndMessage();
Expand All @@ -1942,9 +1941,7 @@ public static void createButtonsPostfix(HudManager __instance) {
yoyoButton.HasEffect = false;
yoyoButton.buttonText = "Blink";
} else {
TheOtherRolesPlugin.Logger.LogMessage("in else for some reason");
// Jump to location
TheOtherRolesPlugin.Logger.LogMessage($"trying to blink!");
var exit = (Vector3)Yoyo.markedLocation;
if (SubmergedCompatibility.IsSubmerged) {
SubmergedCompatibility.ChangeFloor(exit.y > -7);
Expand Down Expand Up @@ -2061,7 +2058,7 @@ public static void createButtonsPostfix(HudManager __instance) {
},
() => { return true; },
() => { return; },
Helpers.loadSpriteFromResources("TheOtherRoles.Resources.MinusButton.png", 150f), // Invisible button!
null, // Invisible button!
new Vector3(0.4f, 2.8f, 0),
__instance,
KeyCode.KeypadPlus
Expand Down
66 changes: 66 additions & 0 deletions TheOtherRoles/CustomGameModes/GameModePatches.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Epic.OnlineServices.Presence;
using HarmonyLib;
using TheOtherRoles.Utilities;
using TMPro;
using UnityEngine;
using static UnityEngine.UI.Button;
using UnityEngine.Events;
using Hazel;
using TheOtherRoles.Players;

namespace TheOtherRoles.CustomGameModes {
[HarmonyPatch]
class GameModePatches {
/*
Creates a button in the info pane in the lobby to cycle through the game modes of TOR.
*/
[HarmonyPatch(typeof(LobbyInfoPane), nameof(LobbyInfoPane.Update))]
class LobbyInfoPanePatch {

private static GameObject gameModeButton = null;
public static void Postfix(LobbyInfoPane __instance) {
if (gameModeButton != null|| !AmongUsClient.Instance.AmHost) { return; }

var template = GameObject.Find("PRIVATE BUTTON");
var GameModeText = GameObject.Find("GameModeText");
if (template == null || GameModeText== null) { return; }
gameModeButton = GameObject.Instantiate(template, template.transform.parent); //, GameModeText.transform);
gameModeButton.transform.localPosition = template.transform.localPosition + new Vector3(0f, 0.65f, -2f);
gameModeButton.name = "TOR GameModeButton";

var pButton = gameModeButton.GetComponent<PassiveButton>();
pButton.buttonText.text = GameModeText.GetComponent<TextMeshPro>().text;
pButton.OnClick.RemoveAllListeners();
pButton.OnClick = new ButtonClickedEvent();
__instance.StartCoroutine(Effects.Lerp(0.1f, new Action<float>(p => { pButton.buttonText.text = Helpers.cs(Color.yellow, GameModeText.GetComponent<TextMeshPro>().text); })));
gameModeButton.transform.GetChild(1).GetComponent<SpriteRenderer>().color = new Color(0.1f, 0.1f, 0.1f);
gameModeButton.transform.GetChild(2).GetComponent<SpriteRenderer>().color = new Color(0f, 0f, 0f);
pButton.OnClick.AddListener((Action)(() =>
{
TORMapOptions.gameMode = (CustomGamemodes)((int)(TORMapOptions.gameMode + 1) % Enum.GetNames(typeof(CustomGamemodes)).Length);
__instance.StartCoroutine(Effects.Lerp(0.1f, new Action<float>(p => { pButton.buttonText.text = Helpers.cs(Color.yellow, GameModeText.GetComponent<TextMeshPro>().text); })));
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.ShareGamemode, Hazel.SendOption.Reliable, -1);
writer.Write((byte)TORMapOptions.gameMode);
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.shareGamemode((byte)TORMapOptions.gameMode);
}));
pButton.OnMouseOut = new UnityEvent();
pButton.OnMouseOver = new UnityEvent();
pButton.OnMouseOver.AddListener((Action)(() => {
gameModeButton.transform.GetChild(1).gameObject.SetActive(true);
gameModeButton.transform.GetChild(2).gameObject.SetActive(false);
}));
pButton.OnMouseOut.AddListener((Action)(() => {
gameModeButton.transform.GetChild(1).gameObject.SetActive(false);
gameModeButton.transform.GetChild(2).gameObject.SetActive(true);
}));

}
}
}
}
Loading

0 comments on commit 8e63bff

Please sign in to comment.