Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
48 changes: 48 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: CI

on: ["workflow_dispatch", "push", "pull_request"]

jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
submodules: true

- uses: actions/cache@v4
with:
path: |
~/.nuget/packages
~/.cache/bepinex
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
restore-keys: |
${{ runner.os }}-nuget-

- name: Setup .NET
uses: actions/setup-dotnet@v4
with:
dotnet-version: 8.0.x

- name: Run the Cake script
uses: cake-build/cake-action@v3
with:
verbosity: Diagnostic

- uses: actions/upload-artifact@v4
with:
name: TownOfUsReactivated.dll
path: source/bin/Release/net6.0/TownOfUsReactivated.dll
retention-days: 7

- uses: actions/upload-artifact@v4
with:
name: TownOfUsReactivated.nupkg
path: source/bin/Release/net6.0/TownOfUsReactivated.*.nupkg
retention-days: 7

- uses: softprops/action-gh-release@v2
if: github.ref_type == 'tag'
with:
draft: true
files: source/bin/Release/net6.0/TownOfUsReactivated.dll
Binary file modified Images/TOU-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
151 changes: 80 additions & 71 deletions README.md

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion TownOfUs.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.10.35122.118
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TownOfUs", "source\TownOfUs.csproj", "{7B91EF68-B9BB-4138-9DEF-79C91FA554D6}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "TownOfUsReactivated", "source\TownOfUsReactivated.csproj", "{7B91EF68-B9BB-4138-9DEF-79C91FA554D6}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Expand Down
28 changes: 28 additions & 0 deletions build.cake
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
var target = Argument("target", "Build");

var workflow = BuildSystem.GitHubActions.Environment.Workflow;
var buildId = workflow.RunNumber;
var tag = workflow.RefType == GitHubActionsRefType.Tag ? workflow.RefName : null;

Task("Build")
.Does(() =>
{
var settings = new DotNetBuildSettings
{
Configuration = "Release",
MSBuildSettings = new DotNetMSBuildSettings()
};

if (tag != null)
{
settings.MSBuildSettings.Version = tag;
}
else if (buildId != 0)
{
settings.MSBuildSettings.VersionSuffix = "ci." + buildId;
}

DotNetBuild(".", settings);
});

RunTarget(target);
4 changes: 2 additions & 2 deletions source/Extensions/AmongUsExtensions.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;
using TownOfUs.Roles;
using TownOfUs.Roles.Modifiers;
using TownOfUs.Modifiers;
using UnityEngine;
using System;
using Il2CppInterop.Runtime.InteropTypes;
Expand Down Expand Up @@ -104,7 +104,7 @@ public static bool IsNullOrDestroyed(this System.Object obj)
}
public static Texture2D CreateEmptyTexture(int width = 0, int height = 0)
{
return new Texture2D(width, height, TextureFormat.RGBA32, Texture.GenerateAllMips, false, IntPtr.Zero);
return new Texture2D(width, height, TextureFormat.RGBA32, Texture.GenerateAllMips, false, false);
}

private static class CastExtension<T> where T : Il2CppObjectBase
Expand Down
1 change: 1 addition & 0 deletions source/GlobalUsings.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
global using TownOfUs.Interfaces;
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using UnityEngine;
using TMPro;

namespace TownOfUs.Roles
namespace TownOfUs.Interfaces
{
public interface IGuesser
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TownOfUs.Roles
namespace TownOfUs.Interfaces
{
public interface IVisualAlteration
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,9 @@
using Hazel;
using TownOfUs.Patches;
using System.Linq;
using TownOfUs.Roles;

namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class Aftermath : Modifier
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
using TownOfUs.NeutralRoles.ExecutionerMod;
using TownOfUs.NeutralRoles.GuardianAngelMod;

namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class Assassin : Ability, IGuesser
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class Bait : Modifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class ButtonBarry : Modifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
using Hazel.Dtls;
using System;
using TownOfUs.Extensions;
using TownOfUs.Roles;

namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class Celebrity : Modifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class Diseased : Modifier
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
using TownOfUs.Modifiers.ShyMod;
using TownOfUs.Extensions;

namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class Disperser : Modifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class DoubleShot : Modifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using TownOfUs.Extensions;

namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class Flash : Modifier, IVisualAlteration
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class Frosty : Modifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using TownOfUs.Extensions;
using UnityEngine;

namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class Giant : Modifier, IVisualAlteration
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using UnityEngine;

namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class Immovable : Modifier
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,9 @@
using TownOfUs.Patches;
using UnityEngine;
using TownOfUs.Extensions;
using TownOfUs.Roles;

namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class Lover : Modifier
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using TownOfUs.Extensions;
using UnityEngine;

namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class Mini : Modifier, IVisualAlteration
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using TownOfUs.Extensions;
using UnityEngine;

namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public abstract class Modifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class Multitasker : Modifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;

namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class Radar : Modifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class Saboteur : Modifier
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using UnityEngine;
using Reactor.Utilities;

namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class Satellite : Modifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class Shy : Modifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class SixthSense : Modifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.Collections.Generic;

namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class Sleuth : Modifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class Taskmaster : Modifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class Tiebreaker : Modifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class Torch : Modifier
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using TownOfUs.Modifiers.UnderdogMod;

namespace TownOfUs.Roles.Modifiers
namespace TownOfUs.Modifiers
{
public class Underdog : Modifier
{
Expand Down
2 changes: 1 addition & 1 deletion source/Patches/AmongUsClient_OnGameEnd.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Il2CppSystem.Collections.Generic;
using System.Linq;
using TownOfUs.Roles;
using TownOfUs.Roles.Modifiers;
using TownOfUs.Modifiers;
using TownOfUs.Extensions;

namespace TownOfUs
Expand Down
15 changes: 7 additions & 8 deletions source/Patches/AssetLoader.cs
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,17 @@ namespace TownOfUs.Patches
{
public class AssetLoader
{
public static string[] AssetBundles = { "trappershader", "soundvision" };

public AssetLoader() { Initialize(); }

public void Initialize()
{
Array.ForEach(AssetBundles, x => {
var b = loadBundle(x);
bundles.Add(b.name, b);
b.GetAllAssetNames().ToList().ForEach(y => {
objectname_to_bundle.Add(ConvertToBaseName(y), x);
});
var arch = OperatingSystem.IsAndroid() ? "android" : "win";
var bundle = $"tour-assets-{arch}.bundle";
var b = loadBundle(bundle);
bundles.Add(b.name, b);
b.GetAllAssetNames().ToList().ForEach(y => {
objectname_to_bundle.Add(ConvertToBaseName(y), bundle);
});
}

Expand All @@ -39,7 +38,7 @@ private string ConvertToBaseName(string name)
return name.Split('/').Last().Split('.').First();
}

private T? LoadAsset<T>(AssetBundle assetBundle, string name) where T : UnityObject
private T LoadAsset<T>(AssetBundle assetBundle, string name) where T : UnityObject
{
var asset = assetBundle.LoadAsset(name, Il2CppType.Of<T>())?.Cast<T>().DontUnload();
loadedObjects.Add(name, asset);
Expand Down
1 change: 1 addition & 0 deletions source/Patches/CancelCountdownStart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@ public static void PrefixStart(GameStartManager __instance)
if (__instance.countDownTimer < 4f) __instance.ResetStartState();
}));
CancelStartButton.gameObject.SetActive(false);
__instance.MinPlayers = 2;
}

[HarmonyPatch(typeof(GameStartManager), nameof(GameStartManager.Update))]
Expand Down
2 changes: 1 addition & 1 deletion source/Patches/ChatCommands.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using HarmonyLib;
using TownOfUs.Roles;
using TownOfUs.Roles.Modifiers;
using TownOfUs.Modifiers;

namespace TownOfUs.Patches
{
Expand Down
2 changes: 1 addition & 1 deletion source/Patches/CrewmateRoles/AltruistMod/Coroutine.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
using Reactor.Networking.Extensions;
using TownOfUs.CrewmateRoles.HaunterMod;
using TownOfUs.NeutralRoles.PhantomMod;
using TownOfUs.Roles.Modifiers;
using TownOfUs.Modifiers;

namespace TownOfUs.CrewmateRoles.AltruistMod
{
Expand Down
Loading
Loading