
Hollow Knight: Silksong
You are viewing a potentially older version of this package. View Latest Version

A lightweight framework for creating custom gamemodes in HK: Silksong
SkongGamemodes.dll.SkongGamemodes.dll to your BepInEx plugins folder alongside your main plugin DLL.using SkongGamemodes;).manifest.json, the custom modes won't load without it being in plugins folderusing UnityEngine;
using SkongGamemodes;
[BepInDependency("dervorce.hkss.gamemodemanager", BepInDependency.DependencyFlags.HardDependency)] // Add this to make sure it loads before your plugin
[BepInPlugin("dervorce.hkss.mypluh", "My Plugin", "1.0.0")]
public class MyPlugin : BaseUnityPlugin
{
private GameModeManager.GameModeData myMode;
private void Awake()
{
myMode = GameModeManagerPlugin.Instance.Manager.Init(
this,
"Bound Soul", // Mode Name
"Enable The Binder by Pressing H", // Description
new Color(0.941f, 0.780f, 0.255f, 0.8f) // UI Color (Nullable, if you put in null, it will not modify the color)
);
}
}
[HarmonyPatch(typeof(PlayerData), "TakeHealth")]
public static class Patch_GlassyBoy
{
[HarmonyPrefix]
public static void glAss(PlayerData __instance, ref int amount)
{
if (BoundSilkPlugin.glassBoundMode.Enabled) // if GlassBoundMode is enabled
{
amount = __instance.CurrentMaxHealth; // Die in one hit
}
}
}
var steelBoundMode = GameModeManagerPlugin.Instance.Manager.Init(
this,
"SteelBound Soul",
"Bound by Pantheon, Chained by Steel",
null, // color but nulled
steel: true // if steel is enabled, this will make it based off steel soul mode instead of normal mode, which means steel soul exclusive stuff and permadeath being part of your gamemode
sprite // you can add in a UnityEngine.Sprite which will override the regular image
);
using SkongGamemodes;.GameModeManager—it’s a singleton.MIT License – feel free to use, modify, or integrate into other mods.