Skip to content

Commit

Permalink
tb16
Browse files Browse the repository at this point in the history
  • Loading branch information
ZsFabTest committed Nov 5, 2023
1 parent 54a6c83 commit 5c6af64
Show file tree
Hide file tree
Showing 21 changed files with 1,148 additions and 31 deletions.
Binary file not shown.
Binary file not shown.
Binary file added Nebula.dll
Binary file not shown.
14 changes: 0 additions & 14 deletions Nebula.sln
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.4.33110.190
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NebulaPlugin", "Nebula\NebulaPlugin.csproj", "{A700F889-7DDD-40BD-8375-1145CA84AA78}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CPUAffinityEditor", "CPUAffinityEditor\CPUAffinityEditor.csproj", "{BAB59E0C-F39B-4DC5-8C3F-0519DE5BB418}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NebulaPluginNova", "NebulaPluginNova\NebulaPluginNova.csproj", "{2412DC6B-C621-45B1-AB38-DDD784712818}"
Expand All @@ -18,18 +16,6 @@ Global
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A700F889-7DDD-40BD-8375-1145CA84AA78}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A700F889-7DDD-40BD-8375-1145CA84AA78}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A700F889-7DDD-40BD-8375-1145CA84AA78}.Debug|x64.ActiveCfg = Debug|x64
{A700F889-7DDD-40BD-8375-1145CA84AA78}.Debug|x64.Build.0 = Debug|x64
{A700F889-7DDD-40BD-8375-1145CA84AA78}.Debug|x86.ActiveCfg = Debug|x86
{A700F889-7DDD-40BD-8375-1145CA84AA78}.Debug|x86.Build.0 = Debug|x86
{A700F889-7DDD-40BD-8375-1145CA84AA78}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A700F889-7DDD-40BD-8375-1145CA84AA78}.Release|Any CPU.Build.0 = Release|Any CPU
{A700F889-7DDD-40BD-8375-1145CA84AA78}.Release|x64.ActiveCfg = Release|x64
{A700F889-7DDD-40BD-8375-1145CA84AA78}.Release|x64.Build.0 = Release|x64
{A700F889-7DDD-40BD-8375-1145CA84AA78}.Release|x86.ActiveCfg = Release|x86
{A700F889-7DDD-40BD-8375-1145CA84AA78}.Release|x86.Build.0 = Release|x86
{BAB59E0C-F39B-4DC5-8C3F-0519DE5BB418}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BAB59E0C-F39B-4DC5-8C3F-0519DE5BB418}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BAB59E0C-F39B-4DC5-8C3F-0519DE5BB418}.Debug|x64.ActiveCfg = Debug|x64
Expand Down
5 changes: 3 additions & 2 deletions NebulaPluginNova/Modules/ModUpdater.cs
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,8 @@ public ReleasedInfo(string tag)

private async Task UpdateAsync()
{
string url = $"https://github.com/Dolly1016/Nebula/releases/download/{rawTag}/Nebula.dll";
string url = $"https://gh-proxy.com/https://github.com/ZsFabTest/Nebula-Public/releases/download/{rawTag}/Nebula.dll";
//https://gh-proxy.com/https://github.com/Dolly1016/Nebula/releases/download/s%2CSnapshot_23.11.02a%2C101%2C1043/Nebula.dll
var response = await NebulaPlugin.HttpClient.GetAsync(url);
if (response.StatusCode != HttpStatusCode.OK) return;
var dllStream = await response.Content.ReadAsStreamAsync();
Expand Down Expand Up @@ -122,7 +123,7 @@ public IEnumerator CoUpdateAndShowDialog()
}
}

static string GetTagsUrl(int page) => "https://api.github.com/repos/Dolly1016/Nebula/tags?per_page=100&page=" + (page);
static string GetTagsUrl(int page) => "https://api.github.com/repos/ZsFabTest/Nebula-public/tags?per_page=100&page=" + (page);
private static async Task FetchAsync()
{
List<ReleasedInfo> releases = new();
Expand Down
14 changes: 7 additions & 7 deletions NebulaPluginNova/Nebula.cs
Original file line number Diff line number Diff line change
Expand Up @@ -56,16 +56,16 @@ public class NebulaPlugin : BasePlugin
{
public const string AmongUsVersion = "2023.7.12";
public const string PluginGuid = "jp.dreamingpig.amongus.nebula";
public const string PluginName = "NebulaOnTheShip";
public const string PluginVersion = "2.0.0";
public const string PluginName = "NebulaOnTheShip-Remake";
public const string PluginVersion = "1.1.0.0";

public const bool IsSnapshot = false;
//public const string VisualVersion = "v2.0";
public const string VisualVersion = "Snapshot 23.11.02a";
public const string VisualVersion = "Test Build 16";
//public const string VisualVersion = "Mayor Debug";

public const int PluginEpoch = 101;
public const int PluginBuildNum = 1043;
public const int PluginEpoch = 100;
public const int PluginBuildNum = 1006;

static public HttpClient HttpClient
{
Expand All @@ -87,7 +87,7 @@ static public HttpClient HttpClient

public static string GetNebulaVersionString()
{
return "NoS " + VisualVersion;
return "NoS-R " + VisualVersion;
}

public Harmony Harmony = new Harmony(PluginGuid);
Expand Down Expand Up @@ -192,7 +192,7 @@ override public void Load()

Harmony.PatchAll();

SetWindowText(FindWindow(null!, Application.productName),"Among Us w/ " + GetNebulaVersionString());
SetWindowText(FindWindow(null!, Application.productName),"Among Us " + GetNebulaVersionString());

SceneManager.sceneLoaded += (UnityEngine.Events.UnityAction<Scene, LoadSceneMode>)((scene, loadMode) =>
{
Expand Down
11 changes: 6 additions & 5 deletions NebulaPluginNova/NebulaPluginNova.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,20 +56,21 @@
</ItemGroup>

<ItemGroup>
<Reference Include="..\..\Among Us\BepInEx\core\*.dll" />
<Reference Include="..\..\Among Us\BepInEx\interop\*.dll" />
<Reference Include="D:\SteamLibrary\steamapps\common\Among Us Nebula on the Ship\BepInEx\core\*.dll" />
<Reference Include="D:\SteamLibrary\steamapps\common\Among Us Nebula on the Ship\BepInEx\interop\*.dll" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="NAudio" Version="2.2.1" />
<PackageReference Include="NAudio.Core" Version="2.2.1" />
<PackageReference Include="NAudio.Wasapi" Version="2.2.1" />
<PackageReference Include="OpusDotNet" Version="1.0.3" />
</ItemGroup>

<Target Name="CopyCustomContent" AfterTargets="AfterBuild">
<Message Text="Second occurrence" />
<Copy SourceFiles="bin\x86\Release\net6.0\Nebula.dll" DestinationFolder="$(AmongUsRelease)\" />
<Copy SourceFiles="bin\x86\Release\net6.0\Nebula.dll" DestinationFolder="$(AmongUsRelease)\Nebula\BepInEx\plugins\" />
<Copy SourceFiles="bin\x86\Release\net6.0\Nebula.dll" DestinationFolder="$(AmongUsPlugins)\" />
<Copy SourceFiles="bin\x86\Release\net6.0\Nebula.dll" DestinationFolder="D:\NebulaOnTheShip-Remake-Nova\" />
<Copy SourceFiles="bin\x86\Release\net6.0\Nebula.dll" DestinationFolder="D:\SteamLibrary\steamapps\common\Among Us Nebula on the Ship\BepInEx\plugins\" />
<Copy SourceFiles="bin\x86\Release\net6.0\Nebula.dll" DestinationFolder="D:\" />
</Target>
</Project>
13 changes: 13 additions & 0 deletions NebulaPluginNova/Patches/ExilePatch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,16 @@ static bool Prefix(AirshipExileController __instance,ref Il2CppSystem.Collection
return false;
}
}

[HarmonyPatch(typeof(ExileController), nameof(ExileController.Begin))]
class ExileControllerBeginPatch
{

public static void Postfix(ExileController __instance, [HarmonyArgument(0)] ref GameData.PlayerInfo exiled, [HarmonyArgument(1)] bool tie)
{
try{
var role = NebulaGameManager.Instance?.GetModPlayerInfo(exiled.PlayerId)?.Role;
if (role != null) __instance.completeString = Language.Translate("game.exile.roleText").Replace("%NAME%", exiled.PlayerName).Replace("%ROLE%", Language.Translate("role." + role.Role.LocalizedName + ".name"));
}catch(Exception e){ Debug.LogError(e.StackTrace); }
}
}
9 changes: 8 additions & 1 deletion NebulaPluginNova/Player/PlayerModInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -297,11 +297,17 @@ private void SetRole(AbstractRole role, int[] arguments)
{
myRole?.Inactivate();

bool state = MyControl.Data.IsDead;

//*
if (role.RoleCategory == Roles.RoleCategory.ImpostorRole)
DestroyableSingleton<RoleManager>.Instance.SetRole(MyControl, RoleTypes.Impostor);
else
DestroyableSingleton<RoleManager>.Instance.SetRole(MyControl, RoleTypes.Crewmate);

//*/

if (state) MyControl.Die(DeathReason.Kill,false);

myRole = role.CreateInstance(this, arguments);

if(NebulaGameManager.Instance?.GameState == NebulaGameStates.Initialized)myRole.OnActivated();
Expand Down Expand Up @@ -407,6 +413,7 @@ public IEnumerator CoGetLeftGuess(Action<int> callback)
(message, isCalledByMe) =>
{
var player = NebulaGameManager.Instance!.RegisterPlayer(PlayerControl.AllPlayerControls.Find((Il2CppSystem.Predicate<PlayerControl>)(p => p.PlayerId == message.playerId)));
//var player = NebulaGameManager.Instance!.GetModPlayerInfo(message.playerId)!;
if (message.isRole)
player.SetRole(Roles.Roles.AllRoles[message.assignableId], message.arguments);
else
Expand Down
Binary file not shown.
Loading

0 comments on commit 5c6af64

Please sign in to comment.