Risk of Rain 2
This package has been deprecated and may no longer be maintained. We recommend looking for an alternative.
Install with App

Details

Latest version
1.0.0
Last Updated
First Uploaded
Downloads
164
Likes
0
Size
89KB
Dependants

Categories

Tags

Deprecated

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.