This repository has been archived by the owner on Feb 3, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎉 Add OopsAllKillerRobots and SuperOuthouse
- Loading branch information
Showing
9 changed files
with
334 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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&S: Oops! All Killer Robots</Title> | ||
<Description> | ||
|
||
</Description> | ||
<PackageTags></PackageTags> | ||
|
||
</PropertyGroup> | ||
|
||
<Target Name="PostBuild" AfterTargets="PostBuildEvent"> | ||
<Exec Command=""$(SolutionDir)\..\.events\PluginBuildEvents.exe" "$(TargetPath)" "Streets of Rogue"" /> | ||
</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> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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() { } | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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&S: Outhouse</Title> | ||
<Description> | ||
|
||
</Description> | ||
<PackageTags></PackageTags> | ||
|
||
</PropertyGroup> | ||
|
||
<Target Name="PostBuild" AfterTargets="PostBuildEvent"> | ||
<Exec Command=""$(SolutionDir)\..\.events\PluginBuildEvents.exe" "$(TargetPath)" "Streets of Rogue"" /> | ||
</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> |