Skip to content

Commit

Permalink
Update v2.0.2
Browse files Browse the repository at this point in the history
  • Loading branch information
mxyx0412 committed Nov 19, 2024
1 parent 6133c07 commit e31964c
Show file tree
Hide file tree
Showing 14 changed files with 316 additions and 242 deletions.
80 changes: 58 additions & 22 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ jobs:
runs-on: ubuntu-latest

steps:
- uses: actions/cache@v2
- uses: actions/cache@v3
with:
path: |
~/.nuget/packages
Expand All @@ -20,7 +20,7 @@ jobs:
restore-keys: |
${{ runner.os }}-nuget-
- uses: actions/checkout@v2
- uses: actions/checkout@v3
with:
submodules: true

Expand All @@ -29,41 +29,77 @@ jobs:
with:
dotnet-version: 6.x

- name: install wget
run: sudo apt install wget
- name: Install dependencies
run: |
sudo apt update
sudo apt install wget unzip -y
- name: download BepInEx
run: wget https://builds.bepinex.dev/projects/bepinex_be/688/BepInEx-Unity.IL2CPP-win-x86-6.0.0-be.688%2B4901521.zip
- name: Download and Unzip BepInEx
run: |
wget https://builds.bepinex.dev/projects/bepinex_be/725/BepInEx-Unity.IL2CPP-win-x86-6.0.0-be.725%2Be1974e2.zip -O BepInEx.zip
unzip BepInEx.zip -d ./Release/
sudo chmod -R 777 ./Release
- name: unzip BepInEx
run: unzip BepInEx-Unity.IL2CPP-win-x86-6.0.0-be.688+4901521.zip -d ./Release/
- name: Download and Unzip ExtraData
run: |
wget https://raw.githubusercontent.com/mxyx-club/ExtraData/main/ExtraData.zip -O ExtraData.zip
unzip ExtraData.zip -d ./Release/
- name: path
run: sudo chmod -R 777 ./Release

- name: download ExtraData
run: wget https://raw.githubusercontent.com/mxyx-club/ExtraData/main/ExtraData.zip

- name: unzip ExtraData
run: unzip ExtraData.zip -d ./Release/

- name: download Reactor
- name: Download Reactor
run: wget https://github.com/NuclearPowered/Reactor/releases/download/2.3.1/Reactor.dll -P ./Release/BepInEx/plugins

- name: Build
run: dotnet build TheOtherRoles/TheOtherRoles.csproj --configuration Release --output ./Release/BepInEx/plugins

- name: Cleanup
run: |
rm -rf ./Release/BepInEx/plugins/TheOtherUs.deps.json
rm -rf ./Release/BepInEx/plugins/TheOtherUs.pdb
rm -rf ./Release/changelog.txt
- name: Upload TheOtherUsDll
uses: actions/[email protected]
with:
name: TheOtherUs.dll
path: ./Release/BepInEx/plugins/TheOtherUs.dll

- name: Del Other Files
run: rm -rf ./Release/BepInEx/plugins/TheOtherUs.deps.json ./Release/BepInEx/plugins/TheOtherUs.pdb ./Release/changelog.txt

- name: Upload TheOtherUs
uses: actions/[email protected]
with:
name: TheOtherUs
path: ./Release/
path: ./Release/

release:
needs: build
runs-on: ubuntu-latest
if: startsWith(github.ref, 'refs/tags/')

steps:
- name: Download Build Artifacts
uses: actions/download-artifact@v4
with:
name: TheOtherUs
- name: Compress subdirectories
run: |
ls -R
zip -q -r TheOtherUs.zip *
mv ./BepInEx/plugins/TheOtherUs.dll ./
- name: Extract version from tag
run: echo "VERSION=${GITHUB_REF#refs/tags/v}" >> $GITHUB_ENV

- name: Clone Changes Log
run: |
wget https://raw.githubusercontent.com/SpexGH/TheOtherUs/v${{ env.VERSION }}/CHANGELOG.md -O CHANGELOG.md
- name: Create GitHub Release
uses: softprops/action-gh-release@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
name: "TheOtherUs ${{ env.VERSION }}"
body_path: CHANGELOG.md
files: |
TheOtherUs.dll
./TheOtherUs.zip
draft: false
prerelease: false
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
## Credit to [The Other Roles](https://github.com/TheOtherRolesAU/TheOtherRoles) for everything here from them and everything else.

## What's New

* Updated BepInEx dependency to be.725
* Updated to Among Us version 2024.10.29
* Fixed ModUpdater
* Fix other errors
4 changes: 4 additions & 0 deletions TheOtherRoles.sln
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "OtherFiles", "OtherFiles",
ProjectSection(SolutionItems) = preProject
.editorconfig = .editorconfig
.github\workflows\build.yml = .github\workflows\build.yml
CHANGELOG.md = CHANGELOG.md
README.md = README.md
EndProjectSection
EndProject
Expand All @@ -32,4 +33,7 @@ Global
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {651725BA-A776-4C92-9518-63CC0401438A}
EndGlobalSection
EndGlobal
6 changes: 6 additions & 0 deletions TheOtherRoles/CustomOptionHolder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -494,6 +494,9 @@ public class CustomOptionHolder
public static CustomOption dynamicMapEnableSubmerged;
public static CustomOption dynamicMapSeparateSettings;

public static CustomOption debugMode;
public static CustomOption disableGameEnd;

public static CustomOption movePolusVents;
public static CustomOption swapNavWifi;
public static CustomOption movePolusVitals;
Expand Down Expand Up @@ -669,6 +672,9 @@ public static void Load()
dynamicMapEnableSubmerged = Create(126, Types.General, "Submerged", rates, dynamicMap, false);
dynamicMapSeparateSettings = Create(127, Types.General, "Use Random Map Setting Presets", false, dynamicMap, false);

debugMode = Create(200, Types.General, "Enable", false, null, true, heading: "Debug Mode");
disableGameEnd = Create(201, Types.General, "Disable Game End", false, debugMode);

//-------------------------- Impostor Options 10000-19999 -------------------------- //

modifierAssassin = Create(10000, Types.Impostor, cs(Color.red, "Assassin"), rates, null, true);
Expand Down
30 changes: 5 additions & 25 deletions TheOtherRoles/Helper/Helpers.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
using System.Threading.Tasks;
using AmongUs.GameOptions;
using Hazel;
using InnerNet;
using Reactor.Utilities.Extensions;
using TheOtherRoles.CustomGameModes;
using TheOtherRoles.Modules;
Expand Down Expand Up @@ -58,6 +59,9 @@ public enum LogLevel
}
public static class Helpers
{
public static bool InGame => AmongUsClient.Instance != null && AmongUsClient.Instance.GameState == InnerNetClient.GameStates.Started;
public static bool IsCountDown => GameStartManager.InstanceExists && GameStartManager.Instance.startState == GameStartManager.StartingStates.Countdown;
public static bool InMeeting => InGame && MeetingHud.Instance;

public static Dictionary<string, Sprite> CachedSprites = new();
public static Sprite teamCultistChat;
Expand All @@ -70,30 +74,6 @@ public static bool canAlwaysBeGuessed(RoleId roleId)
return guessable;
}

/*
public static Sprite getTeamCultistChatButtonSprite()
{
if (teamCultistChat != null)
{
return teamCultistChat;
}
teamCultistChat = loadSpriteFromResources("TheOtherRoles.Resources.TeamJackalChat.png", 115f);
return teamCultistChat;
}
public static Sprite getLoversChatButtonSprite() {
if (teamLoverChat != null)
{
return teamLoverChat;
}
teamLoverChat = loadSpriteFromResources("TheOtherRoles.Resources.LoversChat.png", 150f);
return teamLoverChat;
}
*/

public static bool gameStarted //new
=> AmongUsClient.Instance != null && AmongUsClient.Instance.GameState == InnerNet.InnerNetClient.GameStates.Started;

public static bool flipBitwise(bool bit)
{
if (!bit)
Expand Down Expand Up @@ -768,7 +748,7 @@ public static bool hidePlayerName(PlayerControl source, PlayerControl target)
if (SurveillanceMinigamePatch.nightVisionIsActive) return true;
else if (Ninja.isInvisble && Ninja.ninja == target) return true;
else if (Jackal.isInvisable && Jackal.jackal == target) return true;
else if (TORMapOptions.hideOutOfSightNametags && gameStarted && !source.Data.IsDead && PhysicsHelpers.AnythingBetween(localPlayer.GetTruePosition(), target.GetTruePosition(), Constants.ShadowMask, false)) return true;
else if (TORMapOptions.hideOutOfSightNametags && InGame && !source.Data.IsDead && PhysicsHelpers.AnythingBetween(localPlayer.GetTruePosition(), target.GetTruePosition(), Constants.ShadowMask, false)) return true;
/*
{
float num = (isLightsActive() ? 2f : 1.25f);
Expand Down
54 changes: 0 additions & 54 deletions TheOtherRoles/Main.cs
Original file line number Diff line number Diff line change
Expand Up @@ -164,57 +164,3 @@ private static void Prefix()
}
}
}

// Debugging tools
[HarmonyPatch(typeof(KeyboardJoystick), nameof(KeyboardJoystick.Update))]
public static class DebugManager
{
//private static readonly string passwordHash = "d1f51dfdfd8d38027fd2ca9dfeb299399b5bdee58e6c0b3b5e9a45cd4e502848";
private static readonly System.Random random = new((int)DateTime.Now.Ticks);
private static List<PlayerControl> bots = new();

public static void Postfix(KeyboardJoystick __instance)
{
// Spawn dummys
/*if (AmongUsClient.Instance.AmHost && Input.GetKeyDown(KeyCode.F) && Input.GetKey(KeyCode.RightShift))
{
var playerControl = UnityEngine.Object.Instantiate(AmongUsClient.Instance.PlayerPrefab);
var i = playerControl.PlayerId = (byte)GameData.Instance.GetAvailableId();
bots.Add(playerControl);
GameData.Instance.AddPlayer(playerControl);
AmongUsClient.Instance.Spawn(playerControl, -2, InnerNet.SpawnFlags.None);
playerControl.transform.position = CachedPlayer.LocalPlayer.transform.position;
playerControl.GetComponent<DummyBehaviour>().enabled = true;
playerControl.NetTransform.enabled = false;
playerControl.SetName(RandomString(10));
playerControl.SetColor((byte)random.Next(Palette.PlayerColors.Length));
GameData.Instance.RpcSetTasks(playerControl.PlayerId, new byte[0]);
}*/

// Terminate round
if (AmongUsClient.Instance.AmHost && gameStarted && Input.GetKeyDown(KeyCode.Return) && Input.GetKey(KeyCode.L) && Input.GetKey(KeyCode.LeftShift))
{
MessageWriter writer = AmongUsClient.Instance.StartRpcImmediately(CachedPlayer.LocalPlayer.PlayerControl.NetId, (byte)CustomRPC.ForceEnd, SendOption.Reliable, -1);
AmongUsClient.Instance.FinishRpcImmediately(writer);
RPCProcedure.forceEnd();
}

if (Input.GetKeyDown(KeyCode.Return) && Input.GetKey(KeyCode.M) && Input.GetKey(KeyCode.LeftShift) && MeetingHud.Instance)
{
MeetingHud.Instance.RpcClose();
foreach (var pc in PlayerControl.AllPlayerControls)
{
if (pc == null || pc.Data.IsDead || pc.Data.Disconnected) continue;
}
}
}

public static string RandomString(int length)
{
const string chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
return new string(Enumerable.Repeat(chars, length)
.Select(s => s[random.Next(s.Length)]).ToArray());
}
}
10 changes: 7 additions & 3 deletions TheOtherRoles/MapOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ static class TORMapOptions
public static bool ShowVentsOnMeetingMap = true;
public static bool ShowChatNotifications = true;
public static bool muteLobbyBGM = true;
public static bool DisableGameEnd;
public static bool DebugMode;
public static bool showFPS;
public static bool disableMedscanWalking;
public static int restrictDevices;
Expand Down Expand Up @@ -63,9 +65,9 @@ static class TORMapOptions
public static void clearAndReloadMapOptions()
{
meetingsCount = 0;
camerasToAdd = new List<SurvCamera>();
ventsToSeal = new List<Vent>();
playerIcons = new Dictionary<byte, PoolablePlayer>(); ;
camerasToAdd.Clear();
ventsToSeal.Clear();
playerIcons.Clear();

maxNumberOfMeetings = Mathf.RoundToInt(CustomOptionHolder.maxNumberOfMeetings.getSelection());
blockSkippingInEmergencyMeetings = CustomOptionHolder.blockSkippingInEmergencyMeetings.getBool();
Expand All @@ -88,6 +90,8 @@ public static void clearAndReloadMapOptions()
ShowVentsOnMap = CustomOptionHolder.ShowVentsOnMap.getBool();
ShowVentsOnMeetingMap = CustomOptionHolder.ShowVentsOnMeetingMap.getBool();
preventTaskEnd = CustomOptionHolder.preventTaskEnd.getBool();
DebugMode = CustomOptionHolder.debugMode.getBool();
DisableGameEnd = CustomOptionHolder.disableGameEnd.getBool();
//allowModGuess = false;
allowModGuess = CustomOptionHolder.allowModGuess.getBool();
firstKillPlayer = null;
Expand Down
4 changes: 2 additions & 2 deletions TheOtherRoles/Modules/BepInExUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ namespace TheOtherRoles.Modules;

public class BepInExUpdater : MonoBehaviour
{
public const string RequiredBepInExVersion = "6.0.0-be.688+49015217f3becf052d33fa4658ac19229f5daa3a";
public const string BepInExDownloadURL = "https://builds.bepinex.dev/projects/bepinex_be/688/BepInEx-Unity.IL2CPP-win-x86-6.0.0-be.688%2B4901521.zip";
public const string RequiredBepInExVersion = "6.0.0-be.725+e1974e26fd7702c66b54c0d6879c90b988cc4920";
public const string BepInExDownloadURL = "https://builds.bepinex.dev/projects/bepinex_be/725/BepInEx-Unity.IL2CPP-win-x86-6.0.0-be.725%2Be1974e2.zip";
public static bool UpdateRequired => Paths.BepInExVersion.ToString() != RequiredBepInExVersion;

public void Awake()
Expand Down
Loading

0 comments on commit e31964c

Please sign in to comment.