diff --git a/OopsAllKillerRobots/OopsAllKillerRobots.csproj b/OopsAllKillerRobots/OopsAllKillerRobots.csproj new file mode 100644 index 0000000..4781631 --- /dev/null +++ b/OopsAllKillerRobots/OopsAllKillerRobots.csproj @@ -0,0 +1,71 @@ + + + + + + + + Sands_OopsAllKillerRobots + OopsAllKillerRobots + OopsAllKillerRobots + 1.0.0 + Abbysssal + $(Authors) + + + + S&S: Oops! All Killer Robots + + + + + + + + + + + + + + ..\..\.ref\static\0Harmony.dll + + + ..\..\.ref\Assembly-CSharp.dll + + + ..\..\.ref\static\BepInEx.dll + + + ..\..\.ref\static\com.unity.multiplayer-hlapi.Runtime.dll + + + ..\..\.ref\static\netstandard.dll + + + ..\..\.ref\static\UnityEngine.dll + + + ..\..\.ref\static\UnityEngine.AnimationModule.dll + + + ..\..\.ref\static\UnityEngine.AudioModule.dll + + + ..\..\.ref\static\UnityEngine.CoreModule.dll + + + ..\..\.ref\static\UnityEngine.InputLegacyModule.dll + + + ..\..\.ref\static\UnityEngine.Physics2DModule.dll + + + ..\..\.ref\static\UnityEngine.UI.dll + + + ..\..\.ref\static\UnityEngine.UIModule.dll + + + + diff --git a/OopsAllKillerRobots/OopsAllKillerRobotsPlugin.cs b/OopsAllKillerRobots/OopsAllKillerRobotsPlugin.cs new file mode 100644 index 0000000..d4e5d0f --- /dev/null +++ b/OopsAllKillerRobots/OopsAllKillerRobotsPlugin.cs @@ -0,0 +1,13 @@ +using System.Reflection; + +namespace OopsAllKillerRobots; +[BepInEx.BepInPlugin(@"abbysssal.streetsofrogue.oopsallkillerrobots", "Oops! All Killer Robots", "1.0.0")] +public class OopsAllKillerRobotsPlugin : BepInEx.BaseUnityPlugin +{ + public void Awake() + { + MethodInfo method = System.Array.Find(typeof(SpawnerMain).GetMethods(), static m => m.Name == "SpawnAgent" && m.GetParameters().Length == 14); + new HarmonyLib.Harmony(Info.Metadata.GUID).Patch(method, new HarmonyLib.HarmonyMethod(GetType().GetMethod("SpawnAgentPatch"))); + } + public static void SpawnAgentPatch(ref string agentType) => agentType = "Robot"; +} diff --git a/README.md b/README.md index 192aced..76f18a5 100644 --- a/README.md +++ b/README.md @@ -59,3 +59,15 @@ The speed is unbalanced, made primarily for one-hand mod debugging. Adjust the camera zoom with numpad `+`/`-`. `Enter` resets the zoom. `Print` creates a 4x-resolution snapshot of the screen (without the interface). + +## True Crepes + +Makes Crepes gib blue gibs. Blahds gib bloody gibs. + +## Super Outhouse + +Random idea from ML#5653: an outhouse with 12 Soldiers inside (video: https://youtu.be/TkOu-XOvMoI). + +## Oops! All Killer Robots + +All level dwellers (even ones at the Home Base) are Killer Robots! diff --git a/Sands.sln b/Sands.sln index dfb0b9c..1c5b5d8 100644 --- a/Sands.sln +++ b/Sands.sln @@ -33,6 +33,10 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "TrueCrepes", "TrueCrepes\TrueCrepes.csproj", "{85DA08E3-0557-4D2D-8748-5D7677F3B6E2}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SuperOuthouse", "SuperOuthouse\SuperOuthouse.csproj", "{39059F9A-62D5-47B8-A0D6-B1B3DC23E3FA}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "OopsAllKillerRobots", "OopsAllKillerRobots\OopsAllKillerRobots.csproj", "{708A4ECD-CDA0-4A69-84F8-097D552AC653}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -91,6 +95,14 @@ Global {85DA08E3-0557-4D2D-8748-5D7677F3B6E2}.Debug|Any CPU.Build.0 = Debug|Any CPU {85DA08E3-0557-4D2D-8748-5D7677F3B6E2}.Release|Any CPU.ActiveCfg = Release|Any CPU {85DA08E3-0557-4D2D-8748-5D7677F3B6E2}.Release|Any CPU.Build.0 = Release|Any CPU + {39059F9A-62D5-47B8-A0D6-B1B3DC23E3FA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {39059F9A-62D5-47B8-A0D6-B1B3DC23E3FA}.Debug|Any CPU.Build.0 = Debug|Any CPU + {39059F9A-62D5-47B8-A0D6-B1B3DC23E3FA}.Release|Any CPU.ActiveCfg = Release|Any CPU + {39059F9A-62D5-47B8-A0D6-B1B3DC23E3FA}.Release|Any CPU.Build.0 = Release|Any CPU + {708A4ECD-CDA0-4A69-84F8-097D552AC653}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {708A4ECD-CDA0-4A69-84F8-097D552AC653}.Debug|Any CPU.Build.0 = Debug|Any CPU + {708A4ECD-CDA0-4A69-84F8-097D552AC653}.Release|Any CPU.ActiveCfg = Release|Any CPU + {708A4ECD-CDA0-4A69-84F8-097D552AC653}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/SuperOuthouse/OuthousePlugin.cs b/SuperOuthouse/OuthousePlugin.cs new file mode 100644 index 0000000..538ac66 --- /dev/null +++ b/SuperOuthouse/OuthousePlugin.cs @@ -0,0 +1,56 @@ +using System; +using RogueLibsCore; +using UnityEngine; +using Random = UnityEngine.Random; + +namespace Outhouse; +[BepInEx.BepInPlugin(@"abbysssal.streetsofrogue.outhouse", "Outhouse", "1.0.0")] +[BepInEx.BepInDependency(RogueLibs.GUID, RogueLibs.CompiledVersion)] +public class OuthousePlugin : BepInEx.BaseUnityPlugin +{ + public void Awake() + { + RogueLibs.CreateCustomSprite("Outhouse", SpriteScope.Objects, Properties.Resources.Outhouse, 48f); + RoguePatcher patcher = new RoguePatcher(this); + patcher.Postfix(typeof(SpawnerMain), nameof(SpawnerMain.spawnObjectReal), + new Type[6] { typeof(Vector3), typeof(PlayfieldObject), typeof(string), typeof(string), typeof(WorldDataObject), typeof(int) }); + patcher.Postfix(typeof(PowerBox), "Start"); + patcher.Postfix(typeof(ObjectReal), "DestroyMe", new Type[1] { typeof(PlayfieldObject) }); + + RogueInteractions.CreateProvider(static h => + { + if (h.Object.HasHook()) + { + h.SetStopCallback(static m => m.Object.DestroyMe(m.Agent)); + h.Model.StopInteraction(); + } + }); + } + public static void SpawnerMain_spawnObjectReal(ObjectReal __result) + { + if (__result.objectName is VanillaObjects.PowerBox && __result.gc.percentChance(100)) + __result.AddHook(); + } + public static void PowerBox_Start(PowerBox __instance) + { + __instance.animateSpriteID = __instance.animateSpriteID2 = RogueFramework.ObjectSprites!.GetSpriteIdByName("Outhouse"); + } + public static void ObjectReal_DestroyMe(ObjectReal __instance) + { + if (__instance.HasHook()) + for (int i = 0; i < 12; i++) + { + Vector2 pos = __instance.tr.position; + Agent soldier = __instance.gc.spawnerMain.SpawnAgent(pos + Random.insideUnitCircle.normalized * 0.32f, __instance, VanillaAgents.Soldier); + soldier.relationships.SetSecretHate(__instance.gc.playerAgent, true); + soldier.relationships.SetRel(__instance.gc.playerAgent, "Hateful"); + soldier.relationships.SetRelHate(__instance.gc.playerAgent, 5); + soldier.warZoneAgent = true; + soldier.inventory.AddRandWeapon(); + } + } +} +public class Outhouse : HookBase +{ + protected override void Initialize() { } +} diff --git a/SuperOuthouse/Properties/Resources.Designer.cs b/SuperOuthouse/Properties/Resources.Designer.cs new file mode 100644 index 0000000..78360a3 --- /dev/null +++ b/SuperOuthouse/Properties/Resources.Designer.cs @@ -0,0 +1,73 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Outhouse.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "17.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Outhouse.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Byte[]. + /// + internal static byte[] Outhouse { + get { + object obj = ResourceManager.GetObject("Outhouse", resourceCulture); + return ((byte[])(obj)); + } + } + } +} diff --git a/SuperOuthouse/Properties/Resources.resx b/SuperOuthouse/Properties/Resources.resx new file mode 100644 index 0000000..235ebf7 --- /dev/null +++ b/SuperOuthouse/Properties/Resources.resx @@ -0,0 +1,11 @@ + + + text/microsoft-resx + 2.0 + System.Resources.ResXResourceReader, System.Windows.Forms + System.Resources.ResXResourceWriter, System.Windows.Forms + + + ..\Resources\Outhouse.png;System.Byte[], mscorlib + + diff --git a/SuperOuthouse/Resources/Outhouse.png b/SuperOuthouse/Resources/Outhouse.png new file mode 100644 index 0000000..28383d0 Binary files /dev/null and b/SuperOuthouse/Resources/Outhouse.png differ diff --git a/SuperOuthouse/SuperOuthouse.csproj b/SuperOuthouse/SuperOuthouse.csproj new file mode 100644 index 0000000..17ca9c5 --- /dev/null +++ b/SuperOuthouse/SuperOuthouse.csproj @@ -0,0 +1,86 @@ + + + + + + + + Sands_Outhouse + Outhouse + Outhouse + 1.0.0 + Abbysssal + $(Authors) + + + + S&S: Outhouse + + + + + + + + + + + + + + ..\..\.ref\static\0Harmony.dll + + + ..\..\.ref\Assembly-CSharp.dll + + + ..\..\.ref\static\BepInEx.dll + + + ..\..\.ref\static\com.unity.multiplayer-hlapi.Runtime.dll + + + ..\..\.ref\static\netstandard.dll + + + ..\..\.ref\RogueLibsCore.dll + + + ..\..\.ref\static\UnityEngine.dll + + + ..\..\.ref\static\UnityEngine.AnimationModule.dll + + + ..\..\.ref\static\UnityEngine.AudioModule.dll + + + ..\..\.ref\static\UnityEngine.CoreModule.dll + + + ..\..\.ref\static\UnityEngine.InputLegacyModule.dll + + + ..\..\.ref\static\UnityEngine.Physics2DModule.dll + + + ..\..\.ref\static\UnityEngine.UI.dll + + + ..\..\.ref\static\UnityEngine.UIModule.dll + + + + + + True + True + Resources.resx + + + ResXFileCodeGenerator + Resources.Designer.cs + + + +