Skip to content
This repository has been archived by the owner on Feb 3, 2024. It is now read-only.

Commit

Permalink
🎉 Add OopsAllKillerRobots and SuperOuthouse
Browse files Browse the repository at this point in the history
  • Loading branch information
Chasmical committed Dec 6, 2022
1 parent d7d8544 commit 746702b
Show file tree
Hide file tree
Showing 9 changed files with 334 additions and 0 deletions.
71 changes: 71 additions & 0 deletions OopsAllKillerRobots/OopsAllKillerRobots.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>

<!-- Project Properties -->

<!-- Header -->
<AssemblyName>Sands_OopsAllKillerRobots</AssemblyName>
<RootNamespace>OopsAllKillerRobots</RootNamespace>
<PackageId>OopsAllKillerRobots</PackageId>
<Version>1.0.0</Version>
<Authors>Abbysssal</Authors>
<Company>$(Authors)</Company>
<Copyright></Copyright>

<!-- Title, Description, Tags -->
<Title>S&amp;S: Oops! All Killer Robots</Title>
<Description>

</Description>
<PackageTags></PackageTags>

</PropertyGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="&quot;$(SolutionDir)\..\.events\PluginBuildEvents.exe&quot; &quot;$(TargetPath)&quot; &quot;Streets of Rogue&quot;" />
</Target>

<ItemGroup>
<Reference Include="0Harmony">
<HintPath>..\..\.ref\static\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\.ref\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="BepInEx">
<HintPath>..\..\.ref\static\BepInEx.dll</HintPath>
</Reference>
<Reference Include="com.unity.multiplayer-hlapi.Runtime">
<HintPath>..\..\.ref\static\com.unity.multiplayer-hlapi.Runtime.dll</HintPath>
</Reference>
<Reference Include="netstandard">
<HintPath>..\..\.ref\static\netstandard.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>..\..\.ref\static\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AnimationModule">
<HintPath>..\..\.ref\static\UnityEngine.AnimationModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AudioModule">
<HintPath>..\..\.ref\static\UnityEngine.AudioModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\.ref\static\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>..\..\.ref\static\UnityEngine.InputLegacyModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Physics2DModule">
<HintPath>..\..\.ref\static\UnityEngine.Physics2DModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\.ref\static\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UIModule">
<HintPath>..\..\.ref\static\UnityEngine.UIModule.dll</HintPath>
</Reference>
</ItemGroup>

</Project>
13 changes: 13 additions & 0 deletions OopsAllKillerRobots/OopsAllKillerRobotsPlugin.cs
Original file line number Diff line number Diff line change
@@ -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";
}
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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!
12 changes: 12 additions & 0 deletions Sands.sln
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
56 changes: 56 additions & 0 deletions SuperOuthouse/OuthousePlugin.cs
Original file line number Diff line number Diff line change
@@ -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<PowerBox>(static h =>
{
if (h.Object.HasHook<Outhouse>())
{
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<Outhouse>();
}
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<Outhouse>())
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<PlayfieldObject>
{
protected override void Initialize() { }
}
73 changes: 73 additions & 0 deletions SuperOuthouse/Properties/Resources.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

11 changes: 11 additions & 0 deletions SuperOuthouse/Properties/Resources.resx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms</resheader>

<data name="Outhouse" type="System.Resources.ResXFileRef, System.Windows.Forms">
<value>..\Resources\Outhouse.png;System.Byte[], mscorlib</value>
</data>
</root>
Binary file added SuperOuthouse/Resources/Outhouse.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
86 changes: 86 additions & 0 deletions SuperOuthouse/SuperOuthouse.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>

<!-- Project Properties -->

<!-- Header -->
<AssemblyName>Sands_Outhouse</AssemblyName>
<RootNamespace>Outhouse</RootNamespace>
<PackageId>Outhouse</PackageId>
<Version>1.0.0</Version>
<Authors>Abbysssal</Authors>
<Company>$(Authors)</Company>
<Copyright></Copyright>

<!-- Title, Description, Tags -->
<Title>S&amp;S: Outhouse</Title>
<Description>

</Description>
<PackageTags></PackageTags>

</PropertyGroup>

<Target Name="PostBuild" AfterTargets="PostBuildEvent">
<Exec Command="&quot;$(SolutionDir)\..\.events\PluginBuildEvents.exe&quot; &quot;$(TargetPath)&quot; &quot;Streets of Rogue&quot;" />
</Target>

<ItemGroup>
<Reference Include="0Harmony">
<HintPath>..\..\.ref\static\0Harmony.dll</HintPath>
</Reference>
<Reference Include="Assembly-CSharp">
<HintPath>..\..\.ref\Assembly-CSharp.dll</HintPath>
</Reference>
<Reference Include="BepInEx">
<HintPath>..\..\.ref\static\BepInEx.dll</HintPath>
</Reference>
<Reference Include="com.unity.multiplayer-hlapi.Runtime">
<HintPath>..\..\.ref\static\com.unity.multiplayer-hlapi.Runtime.dll</HintPath>
</Reference>
<Reference Include="netstandard">
<HintPath>..\..\.ref\static\netstandard.dll</HintPath>
</Reference>
<Reference Include="RogueLibsCore">
<HintPath>..\..\.ref\RogueLibsCore.dll</HintPath>
</Reference>
<Reference Include="UnityEngine">
<HintPath>..\..\.ref\static\UnityEngine.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AnimationModule">
<HintPath>..\..\.ref\static\UnityEngine.AnimationModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.AudioModule">
<HintPath>..\..\.ref\static\UnityEngine.AudioModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.CoreModule">
<HintPath>..\..\.ref\static\UnityEngine.CoreModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.InputLegacyModule">
<HintPath>..\..\.ref\static\UnityEngine.InputLegacyModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.Physics2DModule">
<HintPath>..\..\.ref\static\UnityEngine.Physics2DModule.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UI">
<HintPath>..\..\.ref\static\UnityEngine.UI.dll</HintPath>
</Reference>
<Reference Include="UnityEngine.UIModule">
<HintPath>..\..\.ref\static\UnityEngine.UIModule.dll</HintPath>
</Reference>
</ItemGroup>

<ItemGroup>
<Compile Update="Properties\Resources.Designer.cs">
<DesignTime>True</DesignTime>
<AutoGen>True</AutoGen>
<DependentUpon>Resources.resx</DependentUpon>
</Compile>
<EmbeddedResource Update="Properties\Resources.resx">
<Generator>ResXFileCodeGenerator</Generator>
<LastGenOutput>Resources.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>

</Project>

0 comments on commit 746702b

Please sign in to comment.