diff --git a/Plugin.cs b/Plugin.cs new file mode 100644 index 0000000..6ba4e05 --- /dev/null +++ b/Plugin.cs @@ -0,0 +1,43 @@ +using BepInEx; +using BepInEx.Logging; +using BepInEx.Unity.IL2CPP; +using HarmonyLib; +using RecRoom.Activities.Quest; +using RecRoom.Core.AI; +using System.Runtime.InteropServices; +using UnityEngine; + +namespace Sk0liosis +{ + [BepInPlugin("com.splootybean.sk0liosis", "Sk0liosis", "1.0.2")] + public class Plugin : BasePlugin + { + internal static new ManualLogSource Log; + private readonly Harmony _harmony = new("Sk0liosis"); + public static string[] videos = ["cnpuEwJZCJQ", "nwUfjW81GIE", "k32KJVBs_XE", "eQnZyEq8dKE", "oLjM6udnPoc", "7tFtyEsZSVs", "k7-rrqzw08U", "tjvCfojSEBk", "aymF58wwXDY", "Q6Wxm9Smf5c", "MpV62vSs12I", "s6ZZPA2DUnI", "xbGzExJ0F1Y", "a2zXsyDtNds", "MD-nhXyNFXg", "2zRJxT6Zfu0", "avfte4fbvJ4"]; + + public override void Load() + { + Log = base.Log; + Log.LogInfo("Did you know about THIS ureleased feature in Rec Room?"); + _harmony.PatchAll(); + } + + [HarmonyPatch(typeof(QuestManager))] + internal class QuestManagerPatch + { + [HarmonyPatch("OnPlayerHealthChanged"), HarmonyPrefix] + private static void OnPlayerHealthChanged(QuestManager __instance, PhotonPlayer player, QuestManager.HealthChangeType healthChangeType, [Optional] Enemy enemyDeathAttacker, [Optional] PhotonPlayer friendlyFireDeathAttacker) + { + string randomVideo = videos[Random.Range(0, videos.Length)]; + bool isDown = __instance.IsQuestRunning && player.IsLocal && (healthChangeType != QuestManager.HealthChangeType.Initialize || healthChangeType > QuestManager.HealthChangeType.Revive); + if (isDown) + { + { + Application.OpenURL($"https://youtube.com/watch/{randomVideo}"); + } + } + } + } + } +} \ No newline at end of file diff --git a/Sk0liosis.csproj b/Sk0liosis.csproj new file mode 100644 index 0000000..7ccc2de --- /dev/null +++ b/Sk0liosis.csproj @@ -0,0 +1,44 @@ + + + + net6.0 + com.splootybean.sk0liosis + Sk0liosis + 1.0.2 + true + latest + + https://api.nuget.org/v3/index.json; + https://nuget.bepinex.dev/v3/index.json; + https://nuget.samboy.dev/v3/index.json + + Sk0liosis + + + + + + + + + + AssemblyReferences\Assembly-CSharp.dll + + + AssemblyReferences\Il2Cppmscorlib.dll + + + AssemblyReferences\Photon3Unity3D.dll + + + AssemblyReferences\RecRoom.Datastructures.Runtime.dll + + + AssemblyReferences\UnityEngine.CoreModule.dll + + + + + + + \ No newline at end of file diff --git a/Sk0liosis.sln b/Sk0liosis.sln new file mode 100644 index 0000000..ee5b693 --- /dev/null +++ b/Sk0liosis.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio Version 17 +VisualStudioVersion = 17.12.35506.116 d17.12 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Sk0liosis", "Sk0liosis.csproj", "{E74FD2B1-3327-438E-8B6B-ADE7F4867916}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {E74FD2B1-3327-438E-8B6B-ADE7F4867916}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {E74FD2B1-3327-438E-8B6B-ADE7F4867916}.Debug|Any CPU.Build.0 = Debug|Any CPU + {E74FD2B1-3327-438E-8B6B-ADE7F4867916}.Release|Any CPU.ActiveCfg = Release|Any CPU + {E74FD2B1-3327-438E-8B6B-ADE7F4867916}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal