Decompiled source of TwoStarTrophies v1.0.0

2StarTrophies.dll

Decompiled 2 weeks ago
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using HarmonyLib;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("2StarTrophies")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("2StarTrophies")]
[assembly: AssemblyCopyright("Copyright ©  2026")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("de3984c2-323d-45a8-9047-ac4e5d32ed8b")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
[BepInPlugin("rdkll.twostartrophies", "TwoStarTrophies", "1.0.0")]
public class TwoStarTrophies : BaseUnityPlugin
{
	private void Awake()
	{
		//IL_0005: Unknown result type (might be due to invalid IL or missing references)
		new Harmony("rdkll.twostartrophies").PatchAll();
	}
}
[HarmonyPatch(typeof(CharacterDrop), "GenerateDropList")]
internal static class GuaranteedTrophy
{
	private static void Postfix(CharacterDrop __instance, ref List<KeyValuePair<GameObject, int>> __result)
	{
		Character value = Traverse.Create((object)__instance).Field("m_character").GetValue<Character>();
		if ((Object)(object)value == (Object)null || value.IsTamed() || value.GetLevel() < 3)
		{
			return;
		}
		foreach (Drop drop in __instance.m_drops)
		{
			if (!((Object)(object)drop.m_prefab == (Object)null) && ((Object)drop.m_prefab).name.StartsWith("Trophy") && !__result.Exists((KeyValuePair<GameObject, int> kv) => (Object)(object)kv.Key == (Object)(object)drop.m_prefab))
			{
				__result.Add(new KeyValuePair<GameObject, int>(drop.m_prefab, 1));
			}
		}
	}
}