Details

Last Updated
3 months ago
First Uploaded
3 months ago
Downloads
38
Likes
0
Size
89KB
Dependency string
LordVGames-NoShardsFromEmpyreans-1.0.0
Dependants

Categories

NoShardsFromEmpyreans

Really small mod to make empyrean elites not drop shard(s) on death in the beta version of Starstorm 2. They still drop a random item, it's just the shard drops that were removed.

This mod's so small that I didn't bother making a github repository for it, since this is all the relevant code for the harmony IL patch:

IL patch code
[HarmonyPatch(typeof(SS2.Components.Empyrean), nameof(SS2.Components.Empyrean.MakeElite))]
[HarmonyILManipulator]
public static void DoPatch(ILContext il)
{
    ILCursor c = new(il);
    ILLabel skipSettingShardDrops = il.DefineLabel();


    if (!c.TryGotoNext(MoveType.AfterLabel,
        x => x.MatchLdarg(1),
        x => x.MatchCallvirt<Component>("get_gameObject"),
        x => x.MatchCallvirt<GameObject>("AddComponent")
    ))
    {
        Log.Error("COULD NOT IL HOOK SS2.Components.Empyrean.MakeElite PART 1");
        Log.Warning($"il is {il}");
    }
    c.Emit(OpCodes.Br, skipSettingShardDrops);


    if (!c.TryGotoNext(MoveType.AfterLabel,
        x => x.MatchLdarg(1),
        x => x.MatchLdloca(4),
        x => x.MatchCallvirt<Component>("TryGetComponent")
    ))
    {
        Log.Error("COULD NOT IL HOOK SS2.Components.Empyrean.MakeElite PART 2");
        Log.Warning($"il is {il}");
    }
    c.MarkLabel(skipSettingShardDrops);
}
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.
Thunderstore development is made possible with ads. Please consider making an exception to your adblock.