Decompiled source of TrophyHuntMod v0.4.1

plugins/TrophyHuntMod.dll

Decompiled 20 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security.Permissions;
using System.Text;
using BepInEx;
using BepInEx.Bootstrap;
using HarmonyLib;
using Steamworks;
using TMPro;
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.Events;
using UnityEngine.Networking;
using UnityEngine.UI;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("TrophyHuntMod")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("TrophyHuntMod")]
[assembly: AssemblyCopyright("Copyright © oathorse 2024")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("e3243d22-4307-4008-ba36-9f326008cde5")]
[assembly: AssemblyFileVersion("0.4.1")]
[assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.4.1.0")]
namespace TrophyHuntMod;

[BepInPlugin("com.oathorse.TrophyHuntMod", "TrophyHuntMod", "0.4.1")]
internal class TrophyHuntMod : BaseUnityPlugin
{
	public enum Biome
	{
		Meadows,
		Forest,
		Ocean,
		Swamp,
		Mountains,
		Plains,
		Mistlands,
		Ashlands
	}

	public struct TrophyHuntData
	{
		public string m_name;

		public string m_prettyName;

		public Biome m_biome;

		public int m_value;

		public float m_dropPercent;

		public List<string> m_enemies;

		public TrophyHuntData(string name, string prettyName, Biome biome, int value, float dropPercent, List<string> enemies)
		{
			m_name = name;
			m_prettyName = prettyName;
			m_biome = biome;
			m_value = value;
			m_dropPercent = dropPercent;
			m_enemies = enemies;
		}
	}

	public struct DropInfo
	{
		public int m_numKilled;

		public int m_trophies;

		public DropInfo()
		{
			m_numKilled = 0;
			m_trophies = 0;
			m_numKilled = 0;
			m_trophies = 0;
		}
	}

	[HarmonyPatch(typeof(Player), "OnSpawned")]
	public class Player_OnSpawned_Patch
	{
		[HarmonyPatch(typeof(Player), "AddTrophy", new Type[] { typeof(ItemData) })]
		public static class Player_AddTrophy_Patch
		{
			public static void Postfix(Player __instance, ItemData item)
			{
				if ((Object)(object)__instance != (Object)null && item != null)
				{
					string name = ((Object)item.m_dropPrefab).name;
					if (__m_trophyCache.Find((string trophyName) => trophyName == name) != name)
					{
						FlashTrophy(name);
						__m_trophyCache = __instance.GetTrophies();
						UpdateTrophyHuntUI(__instance);
					}
				}
			}
		}

		[Serializable]
		public class LeaderboardData
		{
			public string player_name;

			public int current_score;

			public string session_id;

			public string player_location;

			public string trophies;

			public int deaths;

			public int logouts;
		}

		[HarmonyPatch(typeof(Game), "Logout", new Type[]
		{
			typeof(bool),
			typeof(bool)
		})]
		public static class Game_Logout_Patch
		{
			public static void Postfix(Game __instance, bool save, bool changeToStartScene)
			{
				float totalOnFootDistance = GetTotalOnFootDistance(__instance);
				Debug.LogError((object)$"Total on-foot distance moved: {totalOnFootDistance}");
				if ((__m_logoutCount >= 1 || !(totalOnFootDistance < 50f)) && !__m_ignoreLogouts)
				{
					__m_logoutCount++;
				}
			}
		}

		public struct LuckRating
		{
			public float m_percent;

			public string m_luckString;

			public string m_colorString;

			public LuckRating(float percent, string luckString, string colorStr)
			{
				m_percent = 0f;
				m_luckString = "<n/a>";
				m_colorString = "white";
				m_percent = percent;
				m_luckString = luckString;
				m_colorString = colorStr;
			}
		}

		[HarmonyPatch(typeof(CharacterDrop), "GenerateDropList")]
		private class CharacterDrop_GenerateDropList_Patch
		{
			private static void Postfix(CharacterDrop __instance, ref List<KeyValuePair<GameObject, int>> __result)
			{
				if (!((Object)(object)__instance != (Object)null))
				{
					return;
				}
				string name = ((Component)__instance).GetComponent<Character>().m_name;
				if (!CharacterCanDropTrophies(name))
				{
					return;
				}
				Debug.Log((object)("Trophy-capable character " + name + " has dropped items:"));
				RecordTrophyCapableKill(name, killedByPlayer: false);
				bool flag = false;
				if (__result != null)
				{
					foreach (KeyValuePair<GameObject, int> item2 in __result)
					{
						string name2 = ((Object)item2.Key).name;
						Debug.Log((object)$"Dropped item: {name2} count: {item2.Value}");
						if (name2.Contains("Trophy"))
						{
							Debug.Log((object)("Trophy " + name2 + " Dropped by " + name));
							RecordDroppedTrophy(name, name2);
							flag = true;
							break;
						}
					}
				}
				else
				{
					Debug.Log((object)("Trophy-capable character " + name + " had null drop list"));
				}
				if (!__m_trophyRushEnabled || flag)
				{
					return;
				}
				string trophyName = EnemyNameToTrophyName(name);
				Debug.Log((object)("Trophy Rush: No dropped " + trophyName + " for " + name));
				Drop val = __instance.m_drops.Find((Drop theDrop) => ((Object)theDrop.m_prefab).name == trophyName);
				if (val != null)
				{
					KeyValuePair<GameObject, int> item = new KeyValuePair<GameObject, int>(val.m_prefab, 1);
					Debug.Log((object)("Trophy Rush: Adding " + ((Object)item.Key).name + " for " + name));
					if (__result == null)
					{
						Debug.Log((object)("Trophy Rush: Empty drop list for " + name + ", adding " + ((Object)item.Key).name));
						__result = new List<KeyValuePair<GameObject, int>>();
					}
					__result.Add(item);
					RecordDroppedTrophy(name, trophyName);
				}
			}
		}

		[HarmonyPatch(typeof(Character), "OnDeath")]
		public class Character_OnDeath_Patch
		{
			private static void Postfix(Character __instance)
			{
				bool flag = false;
				if ((Object)(object)Player.m_localPlayer != (Object)null && __instance.m_lastHit != null && (Object)(object)__instance.m_lastHit.GetAttacker() == (Object)(object)Player.m_localPlayer)
				{
					flag = true;
				}
				if (flag)
				{
					Debug.Log((object)("Player killed " + ((Object)__instance).name));
					string name = __instance.m_name;
					if (CharacterCanDropTrophies(name))
					{
						Debug.Log((object)("Trophy-capable character " + name + " was killed by Player."));
						RecordTrophyCapableKill(name, killedByPlayer: true);
					}
				}
			}
		}

		[HarmonyPatch(typeof(Humanoid), "Pickup")]
		public class Humanoid_Pickup_Patch
		{
			private static void Postfix(GameObject go, bool autoequip, bool autoPickupDelay, bool __result)
			{
				ItemData itemData = go.GetComponent<ItemDrop>().m_itemData;
				if (__result && itemData != null && (Object)(object)itemData.m_dropPrefab != (Object)null)
				{
					RecordPlayerPickedUpTrophy(((Object)itemData.m_dropPrefab).name);
				}
			}
		}

		[HarmonyPatch(typeof(FejdStartup), "Start")]
		public class FejdStartup_Start_Patch
		{
			private static void Postfix()
			{
				//IL_0043: Unknown result type (might be due to invalid IL or missing references)
				//IL_0048: Unknown result type (might be due to invalid IL or missing references)
				//IL_0059: Unknown result type (might be due to invalid IL or missing references)
				//IL_0060: Unknown result type (might be due to invalid IL or missing references)
				//IL_0075: Unknown result type (might be due to invalid IL or missing references)
				//IL_008a: Unknown result type (might be due to invalid IL or missing references)
				//IL_009f: Unknown result type (might be due to invalid IL or missing references)
				//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
				//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
				//IL_00d2: Unknown result type (might be due to invalid IL or missing references)
				//IL_0123: Unknown result type (might be due to invalid IL or missing references)
				//IL_0128: Unknown result type (might be due to invalid IL or missing references)
				//IL_0141: Unknown result type (might be due to invalid IL or missing references)
				Debug.LogError((object)"Main Menu Start method called");
				GameObject val = GameObject.Find("Menu");
				if ((Object)(object)val != (Object)null)
				{
					Transform val2 = val.transform.Find("Logo");
					if ((Object)(object)val2 != (Object)null)
					{
						GameObject val3 = new GameObject("TrophyHuntModLogoText");
						val3.transform.SetParent(val2.parent);
						RectTransform obj = val3.AddComponent<RectTransform>();
						((Transform)obj).localScale = Vector3.one;
						obj.anchorMin = new Vector2(0.5f, 0.5f);
						obj.anchorMax = new Vector2(1f, 0.5f);
						obj.pivot = new Vector2(1f, 1f);
						obj.anchoredPosition = new Vector2(-20f, 0f);
						obj.sizeDelta = new Vector2(200f, 155f);
						__m_trophyHuntMainMenuText = val3.AddComponent<TextMeshProUGUI>();
						((TMP_Text)__m_trophyHuntMainMenuText).text = GetTrophyHuntMainMenuText();
						((TMP_Text)__m_trophyHuntMainMenuText).alignment = (TextAlignmentOptions)516;
						((TMP_Text)__m_trophyHuntMainMenuText).fontMaterial.EnableKeyword("OUTLINE_ON");
						((TMP_Text)__m_trophyHuntMainMenuText).lineSpacingAdjustment = -5f;
						((TMP_Text)__m_trophyHuntMainMenuText).outlineColor = Color32.op_Implicit(Color.black);
						((TMP_Text)__m_trophyHuntMainMenuText).outlineWidth = 0.05f;
						AddTrophyRushButton(val3.transform);
						AddShowAllEnemyDeathsButton(val3.transform);
					}
					else
					{
						Debug.LogWarning((object)"Valheim logo not found!");
					}
				}
				else
				{
					Debug.LogWarning((object)"Main menu not found!");
				}
			}
		}

		private static GameObject __m_luckTooltipObject = null;

		private static GameObject __m_luckTooltipBackground = null;

		private static TextMeshProUGUI __m_luckHoverText;

		private static Vector2 __m_luckTooltipWindowSize = new Vector2(230f, 135f);

		private static Vector2 __m_luckTooltipTextOffset = new Vector2(5f, 2f);

		public static LuckRating[] __m_luckRatingTable = new LuckRating[4]
		{
			new LuckRating(70f, "Bad", "#BF6000"),
			new LuckRating(100f, "Average", "#BFBF00"),
			new LuckRating(140f, "Good", "#00BF00"),
			new LuckRating(9999f, "Bonkers", "#6000BF")
		};

		private static GameObject __m_trophyTooltipObject = null;

		private static GameObject __m_trophyTooltipBackground = null;

		private static TextMeshProUGUI __m_trophyHoverText;

		private static Vector2 __m_trophyTooltipWindowSize = new Vector2(240f, 95f);

		private static Vector2 __m_trophyTooltipTextOffset = new Vector2(5f, 2f);

		private static Vector2 __m_trophyTooltipAllEnemyDeathsWindowSize = new Vector2(240f, 175f);

		private static void Postfix(Player __instance)
		{
			if (!((Object)(object)__instance != (Object)(object)Player.m_localPlayer))
			{
				Debug.LogWarning((object)"Local Player is Spawned!");
				Array.Sort(__m_trophyHuntData, (TrophyHuntData x, TrophyHuntData y) => x.m_biome.CompareTo(y.m_biome) * 100000 + x.m_value.CompareTo(y.m_value) * 10000 + x.m_name.CompareTo(y.m_name));
				__m_trophyCache = Player.m_localPlayer.GetTrophies();
				if (__m_showAllEnemyDeaths || __m_trophyRushEnabled || __m_ignoreLogouts)
				{
					__m_invalidForTournamentPlay = true;
				}
				BuildUIElements();
				if (GetTotalOnFootDistance(Game.instance) < 10f)
				{
					__m_logoutCount = 0;
				}
				if (__m_currentPlayerID != Player.m_localPlayer.GetPlayerID())
				{
					InitializeTrackedDataForNewPlayer();
				}
				Debug.LogWarning((object)$"Total Logouts: {__m_logoutCount}");
				string currentDirectory = Directory.GetCurrentDirectory();
				Debug.Log((object)("Working Directory for Trophy Hunt Mod: " + currentDirectory));
				Debug.Log((object)("Steam username: " + SteamFriends.GetPersonaName()));
				UpdateTrophyHuntUI(Player.m_localPlayer);
				ShowPlayerPath(showPlayerPath: false);
				StopCollectingPlayerPath();
				StartCollectingPlayerPath();
				__m_currentPlayerID = Player.m_localPlayer.GetPlayerID();
			}
		}

		public static void InitializeTrackedDataForNewPlayer()
		{
			__m_logoutCount = 0;
			__m_ignoreLogouts = false;
			__m_invalidForTournamentPlay = false;
			__m_playerPathData.Clear();
			InitTrophyDropInfo();
		}

		private static void BuildUIElements()
		{
			if ((Object)(object)Hud.instance == (Object)null || (Object)(object)Hud.instance.m_rootObject == (Object)null)
			{
				Debug.LogError((object)"TrophyHuntMod: Hud.instance.m_rootObject is NOT valid");
			}
			else
			{
				if (!((Object)(object)__m_deathsTextElement == (Object)null) || !((Object)(object)__m_scoreTextElement == (Object)null))
				{
					return;
				}
				Transform val = ((Component)Hud.instance).transform.Find("hudroot/healthpanel");
				if ((Object)(object)val == (Object)null)
				{
					Debug.LogError((object)"Health panel transform not found.");
					return;
				}
				if ((Object)(object)__m_scoreTextElement == (Object)null)
				{
					__m_scoreTextElement = CreateScoreTextElement(val);
				}
				if ((Object)(object)__m_deathsTextElement == (Object)null)
				{
					__m_deathsTextElement = CreateDeathsElement(val);
				}
				if ((Object)(object)__m_relogsTextElement == (Object)null)
				{
					__m_relogsTextElement = CreateRelogsElements(val);
				}
				__m_iconList = new List<GameObject>();
				CreateTrophyIconElements(val, __m_trophyHuntData, __m_iconList);
				CreateTrophyTooltip();
				CreateLuckTooltip();
				CreateLuckOMeterElements(val);
			}
		}

		private static GameObject CreateRelogsElements(Transform parentTransform)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_005c: Unknown result type (might be due to invalid IL or missing references)
			//IL_006b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_008d: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
			//IL_0105: Unknown result type (might be due to invalid IL or missing references)
			//IL_010a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0132: Expected O, but got Unknown
			//IL_0127: Unknown result type (might be due to invalid IL or missing references)
			Sprite trophySprite = GetTrophySprite("RoundLog");
			GameObject val = new GameObject("RelogsIcon");
			val.transform.SetParent(parentTransform);
			RectTransform obj = val.AddComponent<RectTransform>();
			obj.sizeDelta = new Vector2(40f, 40f);
			obj.anchoredPosition = new Vector2(-70f, -105f);
			Image obj2 = val.AddComponent<Image>();
			obj2.sprite = trophySprite;
			((Graphic)obj2).color = Color.white;
			GameObject val2 = new GameObject("RelogsElement");
			val2.transform.SetParent(parentTransform);
			RectTransform obj3 = val2.AddComponent<RectTransform>();
			obj3.sizeDelta = new Vector2(60f, 20f);
			obj3.anchoredPosition = new Vector2(-70f, -105f);
			TextMeshProUGUI val3 = val2.AddComponent<TextMeshProUGUI>();
			((TMP_Text)val3).text = $"{__m_logoutCount}";
			((TMP_Text)val3).fontSize = 22f;
			((Graphic)val3).color = Color.yellow;
			((TMP_Text)val3).alignment = (TextAlignmentOptions)514;
			((Graphic)val3).raycastTarget = false;
			((TMP_Text)val3).fontMaterial.EnableKeyword("OUTLINE_ON");
			((TMP_Text)val3).outlineColor = Color32.op_Implicit(Color.black);
			((TMP_Text)val3).outlineWidth = 0.06f;
			if (__m_ignoreLogouts)
			{
				((Graphic)val3).color = Color.gray;
			}
			return val2;
		}

		private static GameObject CreateLuckOMeterElements(Transform parentTransform)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0032: Unknown result type (might be due to invalid IL or missing references)
			//IL_0046: Unknown result type (might be due to invalid IL or missing references)
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_006e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Expected O, but got Unknown
			//IL_0075: Expected O, but got Unknown
			Sprite trophySprite = GetTrophySprite("HelmetMidsummerCrown");
			GameObject val = new GameObject("LuckImage");
			val.transform.SetParent(parentTransform);
			RectTransform obj = val.AddComponent<RectTransform>();
			obj.sizeDelta = new Vector2(40f, 40f);
			obj.anchoredPosition = new Vector2(-70f, -20f);
			Image obj2 = val.AddComponent<Image>();
			obj2.sprite = trophySprite;
			((Graphic)obj2).color = Color.white;
			((Graphic)obj2).raycastTarget = true;
			AddHoverTextTriggersToLuckObject(val);
			return val;
		}

		private static GameObject CreateDeathsElement(Transform parentTransform)
		{
			//IL_0010: Unknown result type (might be due to invalid IL or missing references)
			//IL_0015: Unknown result type (might be due to invalid IL or missing references)
			//IL_0021: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_005f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0074: Unknown result type (might be due to invalid IL or missing references)
			//IL_0079: Unknown result type (might be due to invalid IL or missing references)
			//IL_0085: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f3: Expected O, but got Unknown
			Sprite trophySprite = GetTrophySprite("Charredskull");
			GameObject val = new GameObject("DeathsIcon");
			val.transform.SetParent(parentTransform);
			RectTransform val2 = val.AddComponent<RectTransform>();
			val2.sizeDelta = new Vector2(50f, 50f);
			val2.anchoredPosition = new Vector2(-70f, -65f);
			Image obj = val.AddComponent<Image>();
			obj.sprite = trophySprite;
			((Graphic)obj).color = Color.white;
			((Graphic)obj).raycastTarget = false;
			GameObject val3 = new GameObject("DeathsText");
			val3.transform.SetParent(parentTransform);
			RectTransform obj2 = val3.AddComponent<RectTransform>();
			obj2.sizeDelta = new Vector2(40f, 40f);
			obj2.anchoredPosition = val2.anchoredPosition;
			TextMeshProUGUI obj3 = val3.AddComponent<TextMeshProUGUI>();
			((TMP_Text)obj3).text = $"{__m_deaths}";
			((TMP_Text)obj3).fontSize = 22f;
			((Graphic)obj3).color = Color.yellow;
			((TMP_Text)obj3).alignment = (TextAlignmentOptions)514;
			((Graphic)obj3).raycastTarget = false;
			return val3;
		}

		private static GameObject CreateScoreTextElement(Transform parentTransform)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_003c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0041: Unknown result type (might be due to invalid IL or missing references)
			//IL_004d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0054: Unknown result type (might be due to invalid IL or missing references)
			//IL_005a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			//IL_008f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bc: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
			//IL_00de: Unknown result type (might be due to invalid IL or missing references)
			//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Expected O, but got Unknown
			new GameObject("ScoreBG").transform.SetParent(parentTransform);
			Vector2 anchoredPosition = default(Vector2);
			((Vector2)(ref anchoredPosition))..ctor(-65f, -140f);
			Vector2 sizeDelta = default(Vector2);
			((Vector2)(ref sizeDelta))..ctor(70f, 42f);
			GameObject val = new GameObject("ScoreText");
			val.transform.SetParent(parentTransform);
			RectTransform obj = val.AddComponent<RectTransform>();
			obj.sizeDelta = sizeDelta;
			obj.anchoredPosition = anchoredPosition;
			int num = 9999;
			TextMeshProUGUI val2 = val.AddComponent<TextMeshProUGUI>();
			((TMP_Text)val2).text = $"{num}";
			((TMP_Text)val2).fontSize = 29f;
			((Graphic)val2).color = Color.yellow;
			((TMP_Text)val2).alignment = (TextAlignmentOptions)514;
			((Graphic)val2).raycastTarget = false;
			((TMP_Text)val2).fontMaterial.EnableKeyword("OUTLINE_ON");
			((TMP_Text)val2).outlineColor = Color32.op_Implicit(Color.black);
			((TMP_Text)val2).outlineWidth = 0.07f;
			if (!__m_onlyModRunning)
			{
				((Graphic)val2).color = Color.cyan;
			}
			if (__m_showAllEnemyDeaths || __m_invalidForTournamentPlay)
			{
				((Graphic)val2).color = Color.green;
			}
			return val;
		}

		private static GameObject CreateTrophyIconElement(Transform parentTransform, Sprite iconSprite, string iconName, Biome iconBiome, int index)
		{
			//IL_001f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Unknown result type (might be due to invalid IL or missing references)
			//IL_0030: Unknown result type (might be due to invalid IL or missing references)
			//IL_003b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0059: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_007c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e6: Expected O, but got Unknown
			//IL_00e7: Expected O, but got Unknown
			//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
			int num = 33;
			int num2 = -1;
			int num3 = -20;
			int num4 = -140;
			_ = ref __m_biomeColors[(int)iconBiome];
			GameObject val = new GameObject(iconName);
			val.transform.SetParent(parentTransform);
			RectTransform obj = val.AddComponent<RectTransform>();
			obj.sizeDelta = new Vector2((float)num, (float)num);
			obj.anchoredPosition = new Vector2((float)num3 + (float)index * ((float)(num + num2) + __m_userTrophySpacing), (float)num4);
			((Transform)obj).localScale = new Vector3(__m_baseTrophyScale, __m_baseTrophyScale, __m_baseTrophyScale) * __m_userTrophyScale;
			Image val2 = val.AddComponent<Image>();
			val2.sprite = iconSprite;
			((Graphic)val2).color = new Color(0f, 0.2f, 0.1f, 0.95f);
			((Graphic)val2).raycastTarget = true;
			if (__m_trophyRushEnabled)
			{
				((Graphic)val2).color = new Color(0.5f, 0f, 0f);
			}
			AddHoverTextTriggersToTrophyIcon(val);
			return val;
		}

		public static void DeleteTrophyIconElements(List<GameObject> iconList)
		{
			foreach (GameObject icon in iconList)
			{
				Object.Destroy((Object)(object)icon);
			}
			iconList.Clear();
		}

		public static void CreateTrophyIconElements(Transform parentTransform, TrophyHuntData[] trophies, List<GameObject> iconList)
		{
			for (int i = 0; i < trophies.Length; i++)
			{
				TrophyHuntData trophyHuntData = trophies[i];
				Sprite trophySprite = GetTrophySprite(trophyHuntData.m_name);
				if ((Object)(object)trophySprite == (Object)null)
				{
					Debug.LogError((object)("Unable to find trophy sprite for " + trophyHuntData.m_name));
					continue;
				}
				GameObject val = CreateTrophyIconElement(parentTransform, trophySprite, trophyHuntData.m_name, trophyHuntData.m_biome, iconList.Count);
				((Object)val).name = trophyHuntData.m_name;
				iconList.Add(val);
			}
		}

		private static Sprite GetTrophySprite(string trophyPrefabName)
		{
			if ((Object)(object)ObjectDB.instance == (Object)null)
			{
				Debug.LogError((object)"ObjectDB is not loaded.");
				return null;
			}
			GameObject itemPrefab = ObjectDB.instance.GetItemPrefab(trophyPrefabName);
			if ((Object)(object)itemPrefab == (Object)null)
			{
				Debug.LogError((object)("Trophy prefab '" + trophyPrefabName + "' not found."));
				return null;
			}
			ItemDrop component = itemPrefab.GetComponent<ItemDrop>();
			if ((Object)(object)component == (Object)null)
			{
				Debug.LogError((object)("ItemDrop component not found on prefab '" + trophyPrefabName + "'."));
				return null;
			}
			return component.m_itemData.m_shared.m_icons[0];
		}

		private static void EnableTrophyHuntIcon(string trophyName)
		{
			//IL_0050: Unknown result type (might be due to invalid IL or missing references)
			if (__m_iconList == null)
			{
				Debug.LogError((object)"__m_iconList is null in EnableTrophyHuntIcon()");
				return;
			}
			GameObject val = __m_iconList.Find((GameObject gameObject) => ((Object)gameObject).name == trophyName);
			if ((Object)(object)val != (Object)null)
			{
				Image component = val.GetComponent<Image>();
				if ((Object)(object)component != (Object)null)
				{
					((Graphic)component).color = Color.white;
				}
			}
			else
			{
				Debug.LogError((object)("Unable to find " + trophyName + " in __m_iconList"));
			}
		}

		private static int ComputeTrophyScore(Player player)
		{
			int num = 0;
			foreach (string trophyName in player.GetTrophies())
			{
				TrophyHuntData trophyHuntData = Array.Find(__m_trophyHuntData, (TrophyHuntData element) => element.m_name == trophyName);
				if (trophyHuntData.m_name == trophyName)
				{
					num += trophyHuntData.m_value;
				}
			}
			return num;
		}

		public static void EnableTrophyHuntIcons(Player player)
		{
			foreach (string trophy in player.GetTrophies())
			{
				EnableTrophyHuntIcon(trophy);
			}
		}

		private static void UpdateTrophyHuntUI(Player player)
		{
			if ((Object)(object)Hud.instance == (Object)null)
			{
				Debug.LogError((object)"Hud.instance is null");
				return;
			}
			if ((Object)(object)Hud.instance.m_rootObject == (Object)null)
			{
				Debug.LogError((object)"Hud.instance.m_rootObject is null");
				return;
			}
			if ((Object)(object)player == (Object)null)
			{
				Debug.LogError((object)"Player.m_localPlayer is null");
				return;
			}
			if (player.m_trophies == null)
			{
				Debug.LogError((object)"Player.m_localPlayer.m_trophies is null");
				return;
			}
			EnableTrophyHuntIcons(player);
			int num = ComputeTrophyScore(player);
			PlayerProfile playerProfile = Game.instance.GetPlayerProfile();
			if (playerProfile != null)
			{
				PlayerStats playerStats = playerProfile.m_playerStats;
				if (playerStats != null)
				{
					__m_deaths = (int)playerStats[(PlayerStatType)0];
					Debug.LogWarning((object)$"Subtracting score for {__m_deaths} deaths.");
					num -= __m_deaths * 20;
					TextMeshProUGUI component = __m_deathsTextElement.GetComponent<TextMeshProUGUI>();
					if ((Object)(object)component != (Object)null)
					{
						((TMP_Text)component).SetText(__m_deaths.ToString());
					}
				}
			}
			if (!__m_ignoreLogouts)
			{
				num -= __m_logoutCount * 10;
			}
			((TMP_Text)__m_scoreTextElement.GetComponent<TextMeshProUGUI>()).text = num.ToString();
			SendScoreToLeaderboard(num);
		}

		private static IEnumerator FlashImage(Image targetImage, RectTransform imageRect)
		{
			float flashDuration = 0.5f;
			int numFlashes = 8;
			Vector2 originalAnchoredPosition = imageRect.anchoredPosition;
			Vector3 originalScale = ((Transform)imageRect).localScale;
			for (int i = 0; i < numFlashes; i++)
			{
				for (float t = 0f; t < flashDuration; t += Time.deltaTime)
				{
					float num = Math.Min(1f, t / flashDuration);
					if ((int)(num * 5f) % 2 == 0)
					{
						((Graphic)targetImage).color = Color.white;
					}
					else
					{
						((Graphic)targetImage).color = Color.green;
					}
					float num2 = 1f + num;
					((Transform)imageRect).localScale = new Vector3(__m_baseTrophyScale, __m_baseTrophyScale, __m_baseTrophyScale) * num2 * __m_userTrophyScale;
					imageRect.anchoredPosition = originalAnchoredPosition + new Vector2(0f, 60f) * num;
					yield return null;
				}
				imageRect.anchoredPosition = originalAnchoredPosition;
			}
			((Graphic)targetImage).color = Color.white;
			((Transform)imageRect).localScale = originalScale;
			imageRect.anchoredPosition = originalAnchoredPosition;
		}

		private static void FlashTrophy(string trophyName)
		{
			GameObject val = __m_iconList.Find((GameObject gameObject) => ((Object)gameObject).name == trophyName);
			if ((Object)(object)val != (Object)null)
			{
				Image component = val.GetComponent<Image>();
				if ((Object)(object)component != (Object)null)
				{
					RectTransform component2 = val.GetComponent<RectTransform>();
					if ((Object)(object)component2 != (Object)null)
					{
						((MonoBehaviour)__m_trophyHuntMod).StartCoroutine(FlashImage(component, component2));
					}
				}
			}
			else
			{
				Debug.LogError((object)("Unable to find " + trophyName + " in __m_iconList"));
			}
		}

		public static void StartCollectingPlayerPath()
		{
			//IL_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0020: Unknown result type (might be due to invalid IL or missing references)
			if (!__m_collectingPlayerPath)
			{
				Debug.Log((object)"Starting Player Path collection");
				__m_previousPlayerPos = ((Component)Player.m_localPlayer).transform.position;
				__m_collectingPlayerPath = true;
				((MonoBehaviour)__m_trophyHuntMod).StartCoroutine(CollectPlayerPath());
			}
		}

		public static void StopCollectingPlayerPath()
		{
			Debug.Log((object)"Stopping Player Path collection");
			if (__m_collectingPlayerPath)
			{
				((MonoBehaviour)__m_trophyHuntMod).StopCoroutine(CollectPlayerPath());
				__m_collectingPlayerPath = false;
			}
		}

		public static IEnumerator CollectPlayerPath()
		{
			if (!((Object)(object)Player.m_localPlayer != (Object)null))
			{
				yield break;
			}
			while (__m_collectingPlayerPath && (Object)(object)Player.m_localPlayer != (Object)null)
			{
				Vector3 position = ((Component)Player.m_localPlayer).transform.position;
				if (Vector3.Distance(position, __m_previousPlayerPos) > __m_minPathPlayerMoveDistance)
				{
					__m_playerPathData.Add(position);
					__m_previousPlayerPos = position;
					Debug.Log((object)("Collected player position at " + ((object)(Vector3)(ref position)).ToString()));
				}
				yield return (object)new WaitForSeconds(__m_playerPathCollectionInterval);
			}
		}

		private static void SendScoreToLeaderboard(int score)
		{
			//IL_0025: Unknown result type (might be due to invalid IL or missing references)
			//IL_002a: Unknown result type (might be due to invalid IL or missing references)
			string personaName = SteamFriends.GetPersonaName();
			string session_id = WorldGenerator.instance.m_world.m_seedName.ToString();
			Vector3 position = ((Component)Player.m_localPlayer).transform.position;
			string player_location = ((object)(Vector3)(ref position)).ToString();
			string trophies = string.Join(", ", __m_trophyCache);
			LeaderboardData data = new LeaderboardData
			{
				player_name = personaName,
				current_score = score,
				session_id = session_id,
				player_location = player_location,
				trophies = trophies,
				deaths = __m_deaths,
				logouts = __m_logoutCount
			};
			((MonoBehaviour)__m_trophyHuntMod).StartCoroutine(PostLeaderboardDataCoroutine("https://valheim.help/api/trackhunt", data));
		}

		private static IEnumerator PostLeaderboardDataCoroutine(string url, LeaderboardData data)
		{
			string text = JsonUtility.ToJson((object)data);
			Debug.Log((object)text);
			UnityWebRequest request = new UnityWebRequest(url, "POST");
			byte[] bytes = Encoding.UTF8.GetBytes(text);
			request.uploadHandler = (UploadHandler)new UploadHandlerRaw(bytes);
			request.downloadHandler = (DownloadHandler)new DownloadHandlerBuffer();
			request.SetRequestHeader("Content-Type", "application/json");
			yield return request.SendWebRequest();
			if ((int)request.result == 1)
			{
				Debug.Log((object)("Leaderboard POST successful! Response: " + request.downloadHandler.text));
			}
			else
			{
				Debug.LogError((object)("Leaderboard POST failed: " + request.error));
			}
			Debug.Log((object)("Leaderboard Response: " + request.error));
			Debug.Log((object)request.downloadHandler.text);
		}

		private static float GetTotalOnFootDistance(Game game)
		{
			if ((Object)(object)game == (Object)null)
			{
				Debug.LogError((object)"No Game object found in GetTotalOnFootDistance");
				return 0f;
			}
			PlayerProfile playerProfile = game.GetPlayerProfile();
			if (playerProfile != null)
			{
				PlayerStats playerStats = playerProfile.m_playerStats;
				if (playerStats != null)
				{
					return playerStats[(PlayerStatType)17] + playerStats[(PlayerStatType)18];
				}
			}
			return 0f;
		}

		public static void CreateLuckTooltip()
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Expected O, but got Unknown
			//IL_0035: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0077: Unknown result type (might be due to invalid IL or missing references)
			//IL_0081: Expected O, but got Unknown
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_010b: Unknown result type (might be due to invalid IL or missing references)
			__m_luckTooltipBackground = new GameObject("Luck Tooltip Background");
			Transform transform = ((Component)Hud.instance).transform;
			__m_luckTooltipBackground.transform.SetParent(transform, false);
			__m_luckTooltipBackground.AddComponent<RectTransform>().sizeDelta = __m_luckTooltipWindowSize;
			((Graphic)__m_luckTooltipBackground.AddComponent<Image>()).color = new Color(0f, 0f, 0f, 0.75f);
			__m_luckTooltipBackground.SetActive(false);
			__m_luckTooltipObject = new GameObject("Luck Tooltip Text");
			__m_luckTooltipObject.transform.SetParent(__m_luckTooltipBackground.transform, false);
			__m_luckTooltipObject.AddComponent<RectTransform>().sizeDelta = new Vector2(__m_luckTooltipWindowSize.x - __m_luckTooltipTextOffset.x, __m_luckTooltipWindowSize.y - __m_luckTooltipTextOffset.y);
			__m_luckHoverText = __m_luckTooltipObject.AddComponent<TextMeshProUGUI>();
			((TMP_Text)__m_luckHoverText).fontSize = 14f;
			((TMP_Text)__m_luckHoverText).alignment = (TextAlignmentOptions)257;
			((Graphic)__m_luckHoverText).color = Color.yellow;
			__m_luckTooltipObject.SetActive(false);
		}

		public static void AddHoverTextTriggersToLuckObject(GameObject uiObject)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Expected O, but got Unknown
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			EventTrigger val = uiObject.GetComponent<EventTrigger>();
			if ((Object)(object)val == (Object)null)
			{
				val = uiObject.AddComponent<EventTrigger>();
			}
			Entry val2 = new Entry();
			val2.eventID = (EventTriggerType)0;
			((UnityEvent<BaseEventData>)(object)val2.callback).AddListener((UnityAction<BaseEventData>)delegate
			{
				ShowLuckTooltip(uiObject);
			});
			val.triggers.Add(val2);
			Entry val3 = new Entry();
			val3.eventID = (EventTriggerType)1;
			((UnityEvent<BaseEventData>)(object)val3.callback).AddListener((UnityAction<BaseEventData>)delegate
			{
				HideLuckTooltip();
			});
			val.triggers.Add(val3);
		}

		public static int GetLuckRatingIndex(float luckPercentage)
		{
			int num = 0;
			LuckRating[] _m_luckRatingTable = __m_luckRatingTable;
			for (int i = 0; i < _m_luckRatingTable.Length; i++)
			{
				LuckRating luckRating = _m_luckRatingTable[i];
				if (luckPercentage <= luckRating.m_percent)
				{
					return num;
				}
				num++;
			}
			return 0;
		}

		public static string GetLuckRatingUIString(float luckPercentage)
		{
			int luckRatingIndex = GetLuckRatingIndex(luckPercentage);
			LuckRating luckRating = __m_luckRatingTable[luckRatingIndex];
			return "<color=" + luckRating.m_colorString + ">" + luckRating.m_luckString + "</color>";
		}

		public static string BuildLuckTooltipText(GameObject uiObject)
		{
			if ((Object)(object)uiObject == (Object)null)
			{
				return "Invalid";
			}
			int num = 0;
			float num2 = 0f;
			float num3 = float.MinValue;
			string text = "<n/a>";
			float num4 = 0f;
			float num5 = 0f;
			float luckPercentage = 0f;
			float num6 = float.MaxValue;
			string text2 = "<n/a>";
			float num7 = 0f;
			float num8 = 0f;
			float luckPercentage2 = 0f;
			foreach (KeyValuePair<string, DropInfo> item in __m_playerTrophyDropInfo)
			{
				DropInfo value = item.Value;
				if (value.m_numKilled == 0)
				{
					continue;
				}
				string trophyName = item.Key;
				TrophyHuntData trophyHuntData = Array.Find(__m_trophyHuntData, (TrophyHuntData element) => element.m_name == trophyName);
				if (!(trophyHuntData.m_dropPercent >= 100f) && value.m_trophies != 0 && !((float)value.m_numKilled < 100f / trophyHuntData.m_dropPercent))
				{
					float num9 = 100f * (float)value.m_trophies / (float)value.m_numKilled;
					float dropPercent = trophyHuntData.m_dropPercent;
					float num10 = num9 / dropPercent;
					if (num10 > num3)
					{
						num3 = num10;
						text = trophyHuntData.m_prettyName;
						num4 = num9;
						num5 = trophyHuntData.m_dropPercent;
						luckPercentage = num4 / num5 * 100f;
					}
					if (num10 < num6)
					{
						num6 = num10;
						text2 = trophyHuntData.m_prettyName;
						num7 = num9;
						num8 = trophyHuntData.m_dropPercent;
						luckPercentage2 = num7 / num8 * 100f;
					}
					num2 += num10;
					num++;
				}
			}
			string text3 = "<n/a>";
			string text4 = "<n/a>";
			float num11 = 0f;
			if (num > 0)
			{
				num11 = 100f * (num2 / (float)num);
				text3 = num11.ToString("0.0");
				text4 = GetLuckRatingUIString(num11);
			}
			string text5 = "<size=16><b><color=#FFB75B>Luck-O-Meter</color><b></size>\n<color=white>  Player Luck Score: </color><color=orange>" + text3 + "</color>\n<color=white>  Player Luck Rating: </color>" + text4 + "\n";
			string colorString = __m_luckRatingTable[GetLuckRatingIndex(luckPercentage)].m_colorString;
			string colorString2 = __m_luckRatingTable[GetLuckRatingIndex(luckPercentage2)].m_colorString;
			return string.Concat(string.Concat(string.Concat(text5 + "<color=white>  Luckiest:</color>\n", $"    <color={colorString}>{text}</color> <color=orange>{num4}%</color> (<color=yellow>{num5}%)</color>\n"), "<color=white>  Unluckiest:</color>\n"), $"    <color={colorString2}>{text2}</color> <color=orange>{num7}%</color> (<color=yellow>{num8}%)</color>\n");
		}

		public static void ShowLuckTooltip(GameObject uiObject)
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)uiObject == (Object)null))
			{
				string text = BuildLuckTooltipText(uiObject);
				((TMP_Text)__m_luckHoverText).text = text;
				__m_luckTooltipBackground.SetActive(true);
				__m_luckTooltipObject.SetActive(true);
				Vector3 val = default(Vector3);
				((Vector3)(ref val))..ctor(__m_luckTooltipWindowSize.x / 2f, __m_luckTooltipWindowSize.y, 0f);
				Vector3 val2 = Input.mousePosition + val;
				if (val2.x < 128f)
				{
					val2.x = 128f;
				}
				if (val2.y < 128f)
				{
					val2.y = 128f;
				}
				if (val2.x > (float)Screen.width - __m_luckTooltipWindowSize.x)
				{
					val2.x = (float)Screen.width - __m_luckTooltipWindowSize.x;
				}
				if (val2.y > (float)Screen.height - __m_luckTooltipWindowSize.y)
				{
					val2.y = (float)Screen.height - __m_luckTooltipWindowSize.y;
				}
				__m_luckTooltipBackground.transform.position = val2;
				__m_luckTooltipObject.transform.position = new Vector3(val2.x + __m_luckTooltipTextOffset.x, val2.y - __m_luckTooltipTextOffset.y, 0f);
			}
		}

		public static void HideLuckTooltip()
		{
			__m_luckTooltipBackground.SetActive(false);
			__m_luckTooltipObject.SetActive(false);
		}

		public static void CreateTrophyTooltip()
		{
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Unknown result type (might be due to invalid IL or missing references)
			//IL_002c: Expected O, but got Unknown
			//IL_0052: Unknown result type (might be due to invalid IL or missing references)
			//IL_0076: Unknown result type (might be due to invalid IL or missing references)
			//IL_0090: Unknown result type (might be due to invalid IL or missing references)
			//IL_009a: Expected O, but got Unknown
			//IL_00be: Unknown result type (might be due to invalid IL or missing references)
			//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0017: Unknown result type (might be due to invalid IL or missing references)
			//IL_001c: Unknown result type (might be due to invalid IL or missing references)
			Debug.LogWarning((object)"Creating HoverText object");
			Vector2 val = __m_trophyTooltipWindowSize;
			if (__m_showAllEnemyDeaths)
			{
				val = __m_trophyTooltipAllEnemyDeathsWindowSize;
			}
			__m_trophyTooltipBackground = new GameObject("Tooltip Background");
			Transform transform = ((Component)Hud.instance).transform;
			__m_trophyTooltipBackground.transform.SetParent(transform, false);
			__m_trophyTooltipBackground.AddComponent<RectTransform>().sizeDelta = val;
			((Graphic)__m_trophyTooltipBackground.AddComponent<Image>()).color = new Color(0f, 0f, 0f, 0.75f);
			__m_trophyTooltipBackground.SetActive(false);
			__m_trophyTooltipObject = new GameObject("Tooltip Text");
			__m_trophyTooltipObject.transform.SetParent(__m_trophyTooltipBackground.transform, false);
			__m_trophyTooltipObject.AddComponent<RectTransform>().sizeDelta = new Vector2(val.x - __m_trophyTooltipTextOffset.x, val.y - __m_trophyTooltipTextOffset.y);
			__m_trophyHoverText = __m_trophyTooltipObject.AddComponent<TextMeshProUGUI>();
			((TMP_Text)__m_trophyHoverText).fontSize = 14f;
			((TMP_Text)__m_trophyHoverText).alignment = (TextAlignmentOptions)257;
			((Graphic)__m_trophyHoverText).color = Color.yellow;
			__m_trophyTooltipObject.SetActive(false);
		}

		public static void DeleteTrophyTooltip()
		{
			if ((Object)(object)__m_trophyTooltipObject != (Object)null)
			{
				Object.Destroy((Object)(object)__m_trophyTooltipObject);
				__m_trophyTooltipObject = null;
			}
			if (Object.op_Implicit((Object)(object)__m_trophyTooltipBackground))
			{
				Object.Destroy((Object)(object)__m_trophyTooltipBackground);
				__m_trophyTooltipBackground = null;
			}
		}

		public static void AddHoverTextTriggersToTrophyIcon(GameObject trophyIconObject)
		{
			//IL_002e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0034: Expected O, but got Unknown
			//IL_0036: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Expected O, but got Unknown
			//IL_0066: Unknown result type (might be due to invalid IL or missing references)
			EventTrigger val = trophyIconObject.GetComponent<EventTrigger>();
			if ((Object)(object)val == (Object)null)
			{
				val = trophyIconObject.AddComponent<EventTrigger>();
			}
			Entry val2 = new Entry();
			val2.eventID = (EventTriggerType)0;
			((UnityEvent<BaseEventData>)(object)val2.callback).AddListener((UnityAction<BaseEventData>)delegate
			{
				ShowTrophyTooltip(trophyIconObject);
			});
			val.triggers.Add(val2);
			Entry val3 = new Entry();
			val3.eventID = (EventTriggerType)1;
			((UnityEvent<BaseEventData>)(object)val3.callback).AddListener((UnityAction<BaseEventData>)delegate
			{
				HideTrophyTooltip();
			});
			val.triggers.Add(val3);
		}

		public static void CalculateDropPercentAndRating(TrophyHuntData trophyHuntData, DropInfo dropInfo, out string dropPercentStr, out string dropRatingStr)
		{
			dropPercentStr = "0";
			dropRatingStr = "<n/a>";
			if (dropInfo.m_numKilled > 0)
			{
				float num = 0f;
				float dropPercent = trophyHuntData.m_dropPercent;
				num = 100f * ((float)dropInfo.m_trophies / (float)dropInfo.m_numKilled);
				dropPercentStr = num.ToString("0.0");
				if (trophyHuntData.m_dropPercent < 100f && dropInfo.m_trophies > 0 && (float)dropInfo.m_numKilled >= 100f / dropPercent)
				{
					float luckPercentage = 100f * (num / dropPercent);
					dropRatingStr = GetLuckRatingUIString(luckPercentage);
				}
			}
		}

		public static string BuildTrophyTooltipText(GameObject uiObject)
		{
			if ((Object)(object)uiObject == (Object)null)
			{
				return "Invalid";
			}
			string trophyName = ((Object)uiObject).name;
			TrophyHuntData trophyHuntData = Array.Find(__m_trophyHuntData, (TrophyHuntData element) => element.m_name == trophyName);
			DropInfo dropInfo = __m_allTrophyDropInfo[trophyName];
			DropInfo dropInfo2 = __m_playerTrophyDropInfo[trophyName];
			string dropPercentStr = "0";
			string dropRatingStr = "<n/a>";
			CalculateDropPercentAndRating(trophyHuntData, dropInfo2, out dropPercentStr, out dropRatingStr);
			string dropPercentStr2 = "0";
			string dropRatingStr2 = "<n/a>";
			CalculateDropPercentAndRating(trophyHuntData, dropInfo, out dropPercentStr2, out dropRatingStr2);
			string text = trophyHuntData.m_dropPercent.ToString();
			string text2 = "<size=16><b><color=#FFB75B>" + trophyHuntData.m_prettyName + "</color><b></size>\n" + $"<color=white>Player Kills: </color><color=orange>{dropInfo2.m_numKilled}</color>\n" + $"<color=white>Trophies Picked Up: </color><color=orange>{dropInfo2.m_trophies}</color>\n" + "<color=white>Kill/Pickup Rate: </color><color=orange>" + dropPercentStr + "%</color> (<color=yellow>" + text + "%)</color>\n<color=white>Player Luck Rating: <color=yellow>" + dropRatingStr + "</color>\n";
			if (__m_showAllEnemyDeaths)
			{
				text2 = text2 + $"<color=white>All Kills: </color><color=orange>{dropInfo.m_numKilled}</color>\n" + $"<color=white>All Trophies: </color><color=orange>{dropInfo.m_trophies}</color>\n" + "<color=white>All Drop Rate: </color><color=orange>" + dropPercentStr2 + "%</color> (<color=yellow>" + text + "%)</color>\n<color=white>All Luck Rating: <color=yellow>" + dropRatingStr2 + "</color>\n";
			}
			return text2;
		}

		public static void ShowTrophyTooltip(GameObject uiObject)
		{
			//IL_0058: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_005e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0063: Unknown result type (might be due to invalid IL or missing references)
			//IL_0064: Unknown result type (might be due to invalid IL or missing references)
			//IL_007d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0096: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c7: Unknown result type (might be due to invalid IL or missing references)
			//IL_0102: Unknown result type (might be due to invalid IL or missing references)
			//IL_0112: Unknown result type (might be due to invalid IL or missing references)
			//IL_0123: Unknown result type (might be due to invalid IL or missing references)
			//IL_0139: Unknown result type (might be due to invalid IL or missing references)
			if (!((Object)(object)uiObject == (Object)null))
			{
				string text = BuildTrophyTooltipText(uiObject);
				((TMP_Text)__m_trophyHoverText).text = text;
				__m_trophyTooltipBackground.SetActive(true);
				__m_trophyTooltipObject.SetActive(true);
				Vector3 val = default(Vector3);
				((Vector3)(ref val))..ctor(__m_trophyTooltipWindowSize.x / 2f, __m_trophyTooltipWindowSize.y, 0f);
				Vector3 val2 = Input.mousePosition + val;
				if (val2.x < 0f)
				{
					val2.x = 0f;
				}
				if (val2.y < 0f)
				{
					val2.y = 0f;
				}
				if (val2.x > (float)Screen.width - __m_trophyTooltipWindowSize.x)
				{
					val2.x = (float)Screen.width - __m_trophyTooltipWindowSize.x;
				}
				if (val2.y > (float)Screen.height - __m_trophyTooltipWindowSize.y)
				{
					val2.y = (float)Screen.height - __m_trophyTooltipWindowSize.y;
				}
				__m_trophyTooltipBackground.transform.position = val2;
				__m_trophyTooltipObject.transform.position = new Vector3(val2.x + __m_trophyTooltipTextOffset.x, val2.y - __m_trophyTooltipTextOffset.y, 0f);
			}
		}

		public static void HideTrophyTooltip()
		{
			__m_trophyTooltipBackground.SetActive(false);
			__m_trophyTooltipObject.SetActive(false);
		}

		public static bool CharacterCanDropTrophies(string characterName)
		{
			if (Array.FindIndex(__m_trophyHuntData, (TrophyHuntData element) => element.m_enemies.Contains(characterName)) >= 0)
			{
				return true;
			}
			return false;
		}

		public static void RecordDroppedTrophy(string characterName, string trophyName)
		{
			DropInfo value = __m_allTrophyDropInfo[trophyName];
			value.m_trophies++;
			__m_allTrophyDropInfo[trophyName] = value;
		}

		public static string EnemyNameToTrophyName(string enemyName)
		{
			int num = Array.FindIndex(__m_trophyHuntData, (TrophyHuntData element) => element.m_enemies.Contains(enemyName));
			if (num < 0)
			{
				return "Not Found";
			}
			return __m_trophyHuntData[num].m_name;
		}

		public static void RecordPlayerPickedUpTrophy(string trophyName)
		{
			if (__m_playerTrophyDropInfo.ContainsKey(trophyName))
			{
				DropInfo value = __m_playerTrophyDropInfo[trophyName];
				value.m_trophies++;
				__m_playerTrophyDropInfo[trophyName] = value;
			}
		}

		public static void RecordTrophyCapableKill(string characterName, bool killedByPlayer)
		{
			string key = EnemyNameToTrophyName(characterName);
			if (killedByPlayer)
			{
				Debug.Log((object)(characterName + " killed by Player"));
				DropInfo value = __m_playerTrophyDropInfo[key];
				value.m_numKilled++;
				__m_playerTrophyDropInfo[key] = value;
			}
			else
			{
				Debug.Log((object)(characterName + " killed not by Player"));
				DropInfo value2 = __m_allTrophyDropInfo[key];
				value2.m_numKilled++;
				__m_allTrophyDropInfo[key] = value2;
			}
		}

		public static void AddShowAllEnemyDeathsButton(Transform parentTransform)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Expected O, but got Unknown
			GameObject val = new GameObject("TrophyRushButton");
			val.transform.SetParent(parentTransform);
			RectTransform obj = val.AddComponent<RectTransform>();
			((Transform)obj).localScale = Vector3.one;
			obj.anchorMin = new Vector2(1f, 0f);
			obj.anchorMax = new Vector2(1f, 0f);
			obj.pivot = new Vector2(1f, 0f);
			obj.anchoredPosition = new Vector2(0f, -50f);
			obj.sizeDelta = new Vector2(200f, 20f);
			Button obj2 = val.AddComponent<Button>();
			ColorBlock colors = ((Selectable)obj2).colors;
			((ColorBlock)(ref colors)).normalColor = Color.black;
			((ColorBlock)(ref colors)).highlightedColor = Color.yellow;
			((ColorBlock)(ref colors)).pressedColor = Color.red;
			((ColorBlock)(ref colors)).selectedColor = Color.white;
			((Selectable)obj2).colors = colors;
			((Graphic)val.AddComponent<Image>()).color = Color.white;
			GameObject val2 = new GameObject("ShowAllEnemiesButtonText");
			val2.transform.SetParent(val.transform);
			val2.AddComponent<RectTransform>().anchoredPosition = new Vector2(0f, 0f);
			TextMeshProUGUI obj3 = val2.AddComponent<TextMeshProUGUI>();
			((TMP_Text)obj3).text = "<b>Show All Enemy Deaths/Trophies<b>";
			((TMP_Text)obj3).fontSize = 12f;
			((Graphic)obj3).color = Color.black;
			((TMP_Text)obj3).alignment = (TextAlignmentOptions)514;
			((UnityEvent)obj2.onClick).AddListener(new UnityAction(ShowAllEnemyDeathsButtonClick));
		}

		public static void ShowAllEnemyDeathsButtonClick()
		{
			ToggleShowAllEnemyDeaths();
		}

		public static void AddTrophyRushButton(Transform parentTransform)
		{
			//IL_0005: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Expected O, but got Unknown
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0033: Unknown result type (might be due to invalid IL or missing references)
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_005d: Unknown result type (might be due to invalid IL or missing references)
			//IL_0072: Unknown result type (might be due to invalid IL or missing references)
			//IL_0086: Unknown result type (might be due to invalid IL or missing references)
			//IL_0097: Unknown result type (might be due to invalid IL or missing references)
			//IL_009c: Unknown result type (might be due to invalid IL or missing references)
			//IL_009f: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
			//IL_00b7: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c3: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ce: Unknown result type (might be due to invalid IL or missing references)
			//IL_00da: Unknown result type (might be due to invalid IL or missing references)
			//IL_00e9: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
			//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
			//IL_010f: Unknown result type (might be due to invalid IL or missing references)
			//IL_0135: Unknown result type (might be due to invalid IL or missing references)
			//IL_0155: Unknown result type (might be due to invalid IL or missing references)
			//IL_015f: Expected O, but got Unknown
			GameObject val = new GameObject("TrophyRushButton");
			val.transform.SetParent(parentTransform);
			RectTransform obj = val.AddComponent<RectTransform>();
			((Transform)obj).localScale = Vector3.one;
			obj.anchorMin = new Vector2(1f, 0f);
			obj.anchorMax = new Vector2(1f, 0f);
			obj.pivot = new Vector2(1f, 0f);
			obj.anchoredPosition = new Vector2(0f, -20f);
			obj.sizeDelta = new Vector2(130f, 20f);
			Button obj2 = val.AddComponent<Button>();
			ColorBlock colors = ((Selectable)obj2).colors;
			((ColorBlock)(ref colors)).normalColor = Color.black;
			((ColorBlock)(ref colors)).highlightedColor = Color.yellow;
			((ColorBlock)(ref colors)).pressedColor = Color.red;
			((ColorBlock)(ref colors)).selectedColor = Color.white;
			((Selectable)obj2).colors = colors;
			((Graphic)val.AddComponent<Image>()).color = Color.white;
			GameObject val2 = new GameObject("TrophyRushButtonText");
			val2.transform.SetParent(val.transform);
			val2.AddComponent<RectTransform>().anchoredPosition = new Vector2(0f, 0f);
			TextMeshProUGUI obj3 = val2.AddComponent<TextMeshProUGUI>();
			((TMP_Text)obj3).text = "<b>Toggle Trophy Rush<b>";
			((TMP_Text)obj3).fontSize = 12f;
			((Graphic)obj3).color = Color.black;
			((TMP_Text)obj3).alignment = (TextAlignmentOptions)514;
			((UnityEvent)obj2.onClick).AddListener(new UnityAction(TrophyRushButtonClick));
		}

		public static void TrophyRushButtonClick()
		{
			ToggleTrophyRush();
		}
	}

	[Serializable]
	[CompilerGenerated]
	private sealed class <>c
	{
		public static readonly <>c <>9 = new <>c();

		public static ConsoleEventFailable <>9__48_0;

		public static ConsoleEvent <>9__48_1;

		public static ConsoleEvent <>9__48_2;

		public static ConsoleEvent <>9__48_3;

		public static ConsoleEvent <>9__48_4;

		public static ConsoleEvent <>9__48_5;

		public static ConsoleEvent <>9__48_6;

		public static ConsoleEvent <>9__48_7;

		public static ConsoleEvent <>9__48_8;

		public static ConsoleEvent <>9__48_9;

		internal object <AddConsoleCommands>b__48_0(ConsoleEventArgs args)
		{
			if (!Object.op_Implicit((Object)(object)Game.instance))
			{
				PrintToConsole("'trophyhunt' console command can only be used in-game.");
				return true;
			}
			PrintToConsole("[Trophy Hunt Scoring]");
			int num = 0;
			PrintToConsole("Trophies:");
			TrophyHuntData[] _m_trophyHuntData = __m_trophyHuntData;
			for (int i = 0; i < _m_trophyHuntData.Length; i++)
			{
				TrophyHuntData trophyHuntData = _m_trophyHuntData[i];
				if (__m_trophyCache.Contains(trophyHuntData.m_name))
				{
					string name = trophyHuntData.m_name;
					object arg = trophyHuntData.m_value;
					Biome biome = trophyHuntData.m_biome;
					PrintToConsole($"  {name}: Score: {arg} Biome: {biome.ToString()}");
					num += trophyHuntData.m_value;
				}
			}
			PrintToConsole($"Trophy Score Total: {num}");
			int num2 = __m_deaths * 20 * -1;
			int num3 = __m_logoutCount * 10 * -1;
			PrintToConsole("Penalties:");
			PrintToConsole($"  Deaths: {__m_deaths} Score: {num2}");
			PrintToConsole($"  Logouts: {__m_logoutCount} Score: {num3}");
			num += num2;
			num += num3;
			PrintToConsole($"Total Score: {num}");
			return true;
		}

		internal void <AddConsoleCommands>b__48_1(ConsoleEventArgs args)
		{
			if (!Object.op_Implicit((Object)(object)Game.instance))
			{
				PrintToConsole("'showpath' console command can only be used in-game.");
			}
			ShowPlayerPath(!__m_pathAddedToMinimap);
		}

		internal void <AddConsoleCommands>b__48_2(ConsoleEventArgs args)
		{
			Debug.Log((object)"Dumping enemy names:");
			foreach (GameObject prefab in ZNetScene.instance.m_prefabs)
			{
				if ((Object)(object)prefab == (Object)null)
				{
					continue;
				}
				Character component = prefab.GetComponent<Character>();
				if (!((Object)(object)component != (Object)null))
				{
					continue;
				}
				CharacterDrop component2 = ((Component)component).GetComponent<CharacterDrop>();
				if (!((Object)(object)component2 != (Object)null))
				{
					continue;
				}
				foreach (Drop drop in component2.m_drops)
				{
					if (drop != null && !((Object)(object)drop.m_prefab == (Object)null))
					{
						string name = ((Object)drop.m_prefab).name;
						if (name.Contains("Trophy"))
						{
							Debug.Log((object)(name + "," + component.m_name));
						}
					}
				}
			}
		}

		internal void <AddConsoleCommands>b__48_3(ConsoleEventArgs args)
		{
			if (Object.op_Implicit((Object)(object)Game.instance))
			{
				PrintToConsole("'/trophyrush' console command can only be used at the main menu via the F5 console.");
			}
			else
			{
				ToggleTrophyRush();
			}
		}

		internal void <AddConsoleCommands>b__48_4(ConsoleEventArgs args)
		{
			//IL_0048: Unknown result type (might be due to invalid IL or missing references)
			//IL_0070: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)Game.instance))
			{
				PrintToConsole("'/ignorelogouts' can only be used in gameplay.");
				return;
			}
			__m_ignoreLogouts = !__m_ignoreLogouts;
			__m_invalidForTournamentPlay = true;
			if ((Object)(object)__m_scoreTextElement != (Object)null && __m_ignoreLogouts)
			{
				((Graphic)__m_scoreTextElement.GetComponent<TextMeshProUGUI>()).color = Color.green;
			}
			if ((Object)(object)__m_relogsTextElement != (Object)null && __m_ignoreLogouts)
			{
				((Graphic)__m_relogsTextElement.GetComponent<TextMeshProUGUI>()).color = Color.gray;
			}
		}

		internal void <AddConsoleCommands>b__48_5(ConsoleEventArgs args)
		{
			//IL_0040: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)Game.instance))
			{
				PrintToConsole("'/showallenemydeaths' can only be used in gameplay.");
				return;
			}
			ToggleShowAllEnemyDeaths();
			__m_invalidForTournamentPlay = true;
			if ((Object)(object)__m_scoreTextElement != (Object)null && __m_showAllEnemyDeaths)
			{
				((Graphic)__m_scoreTextElement.GetComponent<TextMeshProUGUI>()).color = Color.green;
			}
		}

		internal void <AddConsoleCommands>b__48_6(ConsoleEventArgs args)
		{
			if (!Object.op_Implicit((Object)(object)Game.instance))
			{
				PrintToConsole("'scorescale' console command can only be used in-game.");
			}
			if (args.Length > 1)
			{
				float num = float.Parse(args[1]);
				if (num == 0f)
				{
					num = 1f;
				}
				__m_userScoreScale = num;
			}
			else
			{
				__m_userScoreScale = 1f;
			}
			if ((Object)(object)Player.m_localPlayer != (Object)null)
			{
				TextMeshProUGUI component = __m_scoreTextElement.GetComponent<TextMeshProUGUI>();
				if ((Object)(object)component != (Object)null)
				{
					((TMP_Text)component).fontSize = 29f * __m_userScoreScale;
				}
			}
		}

		internal void <AddConsoleCommands>b__48_7(ConsoleEventArgs args)
		{
			//IL_011c: Unknown result type (might be due to invalid IL or missing references)
			//IL_0126: Unknown result type (might be due to invalid IL or missing references)
			if (!Object.op_Implicit((Object)(object)Game.instance))
			{
				PrintToConsole("'trophyscale' console command can only be used in-game.");
			}
			if (args.Length > 1)
			{
				float num = float.Parse(args[1]);
				if (num == 0f)
				{
					num = 1f;
				}
				__m_userTrophyScale = num;
				if (args.Length > 2)
				{
					float num2 = float.Parse(args[2]);
					if (num2 == 0f)
					{
						num2 = 1f;
					}
					__m_baseTrophyScale = num2;
				}
			}
			else
			{
				__m_userTrophyScale = 1f;
				__m_baseTrophyScale = 1f;
			}
			Player localPlayer = Player.m_localPlayer;
			if (!((Object)(object)localPlayer != (Object)null))
			{
				return;
			}
			localPlayer.GetTrophies();
			TrophyHuntData[] _m_trophyHuntData = __m_trophyHuntData;
			for (int i = 0; i < _m_trophyHuntData.Length; i++)
			{
				TrophyHuntData trophyHuntData = _m_trophyHuntData[i];
				<>c__DisplayClass48_0 CS$<>8__locals0 = new <>c__DisplayClass48_0
				{
					trophyName = trophyHuntData.m_name
				};
				GameObject val = __m_iconList.Find((GameObject gameObject) => ((Object)gameObject).name == CS$<>8__locals0.trophyName);
				if ((Object)(object)val != (Object)null && (Object)(object)val.GetComponent<Image>() != (Object)null)
				{
					RectTransform component = val.GetComponent<RectTransform>();
					if ((Object)(object)component != (Object)null)
					{
						((Transform)component).localScale = new Vector3(__m_baseTrophyScale, __m_baseTrophyScale, __m_baseTrophyScale) * __m_userTrophyScale;
					}
				}
			}
		}

		internal void <AddConsoleCommands>b__48_8(ConsoleEventArgs args)
		{
			if (!Object.op_Implicit((Object)(object)Game.instance))
			{
				PrintToConsole("'trophyspacing' console command can only be used in-game.");
			}
			else
			{
				if ((Object)(object)Player.m_localPlayer == (Object)null)
				{
					return;
				}
				Player localPlayer = Player.m_localPlayer;
				if (args.Length > 1)
				{
					float num = float.Parse(args[1]);
					if (num == 0f)
					{
						num = 1f;
					}
					__m_userTrophySpacing = num;
				}
				else
				{
					__m_userTrophySpacing = 0f;
				}
				Transform val = ((Component)Hud.instance).transform.Find("hudroot/healthpanel");
				if ((Object)(object)val == (Object)null)
				{
					Debug.LogError((object)"Health panel transform not found.");
					return;
				}
				Player_OnSpawned_Patch.DeleteTrophyIconElements(__m_iconList);
				Player_OnSpawned_Patch.CreateTrophyIconElements(val, __m_trophyHuntData, __m_iconList);
				Player_OnSpawned_Patch.EnableTrophyHuntIcons(localPlayer);
			}
		}

		internal void <AddConsoleCommands>b__48_9(ConsoleEventArgs args)
		{
			if (!Object.op_Implicit((Object)(object)Game.instance))
			{
				PrintToConsole("'/showtrophies' console command can only be used during gameplay.");
				return;
			}
			__m_showingTrophies = !__m_showingTrophies;
			ShowTrophies(__m_showingTrophies);
		}
	}

	[CompilerGenerated]
	private sealed class <>c__DisplayClass48_0
	{
		public string trophyName;

		internal bool <AddConsoleCommands>b__10(GameObject gameObject)
		{
			return ((Object)gameObject).name == trophyName;
		}
	}

	public const string PluginGUID = "com.oathorse.TrophyHuntMod";

	public const string PluginName = "TrophyHuntMod";

	public const string PluginVersion = "0.4.1";

	private readonly Harmony harmony = new Harmony("com.oathorse.TrophyHuntMod");

	private const bool DUMP_TROPHY_DATA = false;

	private const bool UPDATE_LEADERBOARD = true;

	private const bool COLLECT_PLAYER_PATH = true;

	private const bool COLLECT_DROP_RATES = true;

	private static TrophyHuntMod __m_trophyHuntMod;

	private const int DEATH_PENALTY = 20;

	private const int LOGOUT_PENALTY = 10;

	private const string LEADERBOARD_URL = "https://valheim.help/api/trackhunt";

	private const float LOGOUT_PENALTY_GRACE_DISTANCE = 50f;

	private const float DEFAULT_SCORE_FONT_SIZE = 29f;

	public static TrophyHuntData[] __m_trophyHuntData = new TrophyHuntData[54]
	{
		new TrophyHuntData("TrophyAbomination", "Abomination", Biome.Swamp, 20, 50f, new List<string> { "$enemy_abomination" }),
		new TrophyHuntData("TrophyAsksvin", "Asksvin", Biome.Ashlands, 50, 50f, new List<string> { "$enemy_asksvin" }),
		new TrophyHuntData("TrophyBlob", "Blob", Biome.Swamp, 20, 10f, new List<string> { "$enemy_blob", "$enemy_blobelite" }),
		new TrophyHuntData("TrophyBoar", "Boar", Biome.Meadows, 10, 15f, new List<string> { "$enemy_boar" }),
		new TrophyHuntData("TrophyBonemass", "Bonemass", Biome.Swamp, 80, 100f, new List<string> { "$enemy_bonemass" }),
		new TrophyHuntData("TrophyBonemawSerpent", "Bonemaw", Biome.Ashlands, 50, 33f, new List<string> { "$enemy_bonemawserpent" }),
		new TrophyHuntData("TrophyCharredArcher", "Charred Archer", Biome.Ashlands, 50, 5f, new List<string> { "$enemy_charred_archer" }),
		new TrophyHuntData("TrophyCharredMage", "Charred Warlock", Biome.Ashlands, 50, 5f, new List<string> { "$enemy_charred_mage" }),
		new TrophyHuntData("TrophyCharredMelee", "Charred Warrior", Biome.Ashlands, 50, 5f, new List<string> { "$enemy_charred_melee" }),
		new TrophyHuntData("TrophyCultist", "Cultist", Biome.Mountains, 30, 10f, new List<string> { "$enemy_fenringcultist" }),
		new TrophyHuntData("TrophyCultist_Hildir", "Geirrhafa", Biome.Mountains, 45, 100f, new List<string> { "$enemy_fenringcultist_hildir" }),
		new TrophyHuntData("TrophyDeathsquito", "Deathsquito", Biome.Plains, 30, 5f, new List<string> { "$enemy_deathsquito" }),
		new TrophyHuntData("TrophyDeer", "Deer", Biome.Meadows, 10, 50f, new List<string> { "$enemy_deer" }),
		new TrophyHuntData("TrophyDragonQueen", "Moder", Biome.Mountains, 100, 100f, new List<string> { "$enemy_dragon" }),
		new TrophyHuntData("TrophyDraugr", "Draugr", Biome.Swamp, 20, 10f, new List<string> { "$enemy_draugr" }),
		new TrophyHuntData("TrophyDraugrElite", "Draugr Elite", Biome.Swamp, 20, 10f, new List<string> { "$enemy_draugrelite" }),
		new TrophyHuntData("TrophyDvergr", "Dvergr", Biome.Mistlands, 40, 5f, new List<string> { "$enemy_dvergr", "$enemy_dvergr_mage" }),
		new TrophyHuntData("TrophyEikthyr", "Eikthyr", Biome.Meadows, 40, 100f, new List<string> { "$enemy_eikthyr" }),
		new TrophyHuntData("TrophyFader", "Fader", Biome.Ashlands, 1000, 100f, new List<string> { "$enemy_fader" }),
		new TrophyHuntData("TrophyFallenValkyrie", "Fallen Valkyrie", Biome.Ashlands, 50, 5f, new List<string> { "$enemy_fallenvalkyrie" }),
		new TrophyHuntData("TrophyFenring", "Fenring", Biome.Mountains, 30, 10f, new List<string> { "$enemy_fenring" }),
		new TrophyHuntData("TrophyFrostTroll", "Troll", Biome.Forest, 20, 50f, new List<string> { "$enemy_troll" }),
		new TrophyHuntData("TrophyGjall", "Gjall", Biome.Mistlands, 40, 30f, new List<string> { "$enemy_gjall" }),
		new TrophyHuntData("TrophyGoblin", "Fuling", Biome.Plains, 30, 10f, new List<string> { "$enemy_goblin" }),
		new TrophyHuntData("TrophyGoblinBrute", "Fuling Berserker", Biome.Plains, 30, 5f, new List<string> { "$enemy_goblinbrute" }),
		new TrophyHuntData("TrophyGoblinBruteBrosBrute", "Thungr", Biome.Plains, 65, 100f, new List<string> { "$enemy_goblinbrute_hildircombined" }),
		new TrophyHuntData("TrophyGoblinBruteBrosShaman", "Zil", Biome.Plains, 65, 100f, new List<string> { "$enemy_goblin_hildir" }),
		new TrophyHuntData("TrophyGoblinKing", "Yagluth", Biome.Plains, 120, 100f, new List<string> { "$enemy_goblinking" }),
		new TrophyHuntData("TrophyGoblinShaman", "Fuling Shaman", Biome.Plains, 30, 10f, new List<string> { "$enemy_goblinshaman" }),
		new TrophyHuntData("TrophyGreydwarf", "Greydwarf", Biome.Forest, 20, 5f, new List<string> { "$enemy_greydwarf" }),
		new TrophyHuntData("TrophyGreydwarfBrute", "Greydwarf Brute", Biome.Forest, 20, 10f, new List<string> { "$enemy_greydwarfbrute" }),
		new TrophyHuntData("TrophyGreydwarfShaman", "Greydwarf Shaman", Biome.Forest, 20, 10f, new List<string> { "$enemy_greydwarfshaman" }),
		new TrophyHuntData("TrophyGrowth", "Growth", Biome.Plains, 30, 10f, new List<string> { "$enemy_blobtar" }),
		new TrophyHuntData("TrophyHare", "Misthare", Biome.Mistlands, 40, 5f, new List<string> { "$enemy_hare" }),
		new TrophyHuntData("TrophyHatchling", "Drake", Biome.Mountains, 30, 10f, new List<string> { "$enemy_thehive", "$enemy_drake" }),
		new TrophyHuntData("TrophyLeech", "Leech", Biome.Swamp, 20, 10f, new List<string> { "$enemy_leech" }),
		new TrophyHuntData("TrophyLox", "Lox", Biome.Plains, 30, 10f, new List<string> { "$enemy_lox" }),
		new TrophyHuntData("TrophyMorgen", "Morgen", Biome.Ashlands, 50, 5f, new List<string> { "$enemy_morgen" }),
		new TrophyHuntData("TrophyNeck", "Neck", Biome.Meadows, 10, 5f, new List<string> { "$enemy_neck" }),
		new TrophyHuntData("TrophySeeker", "Seeker", Biome.Mistlands, 40, 10f, new List<string> { "$enemy_seeker" }),
		new TrophyHuntData("TrophySeekerBrute", "Seeker Soldier", Biome.Mistlands, 40, 5f, new List<string> { "$enemy_seekerbrute" }),
		new TrophyHuntData("TrophySeekerQueen", "The Queen", Biome.Mistlands, 1000, 100f, new List<string> { "$enemy_seekerqueen" }),
		new TrophyHuntData("TrophySerpent", "Serpent", Biome.Ocean, 25, 33f, new List<string> { "$enemy_serpent" }),
		new TrophyHuntData("TrophySGolem", "Stone Golem", Biome.Mountains, 30, 5f, new List<string> { "$enemy_stonegolem" }),
		new TrophyHuntData("TrophySkeleton", "Skeleton", Biome.Forest, 20, 10f, new List<string> { "$enemy_skeleton" }),
		new TrophyHuntData("TrophySkeletonHildir", "Brenna", Biome.Forest, 25, 100f, new List<string> { "$enemy_skeletonfire" }),
		new TrophyHuntData("TrophySkeletonPoison", "Rancid Remains", Biome.Forest, 20, 10f, new List<string> { "$enemy_skeletonpoison" }),
		new TrophyHuntData("TrophySurtling", "Surtling", Biome.Swamp, 20, 5f, new List<string> { "$enemy_surtling" }),
		new TrophyHuntData("TrophyTheElder", "The Elder", Biome.Forest, 60, 100f, new List<string> { "$enemy_gdking" }),
		new TrophyHuntData("TrophyTick", "Tick", Biome.Mistlands, 40, 5f, new List<string> { "$enemy_tick" }),
		new TrophyHuntData("TrophyUlv", "Ulv", Biome.Mountains, 30, 5f, new List<string> { "$enemy_ulv" }),
		new TrophyHuntData("TrophyVolture", "Volture", Biome.Ashlands, 50, 50f, new List<string> { "$enemy_volture" }),
		new TrophyHuntData("TrophyWolf", "Wolf", Biome.Mountains, 30, 10f, new List<string> { "$enemy_wolf" }),
		new TrophyHuntData("TrophyWraith", "Wraith", Biome.Swamp, 20, 5f, new List<string> { "$enemy_wraith" })
	};

	public static Color[] __m_biomeColors = (Color[])(object)new Color[8]
	{
		new Color(0.2f, 0.2f, 0.1f, 0.3f),
		new Color(0f, 0.2f, 0f, 0.3f),
		new Color(0.1f, 0.1f, 0.2f, 0.3f),
		new Color(0.2f, 0.1f, 0f, 0.3f),
		new Color(0.2f, 0.2f, 0.2f, 0.3f),
		new Color(0.2f, 0.2f, 0f, 0.3f),
		new Color(0.2f, 0.1f, 0.2f, 0.3f),
		new Color(0.2f, 0f, 0f, 0.3f)
	};

	private static GameObject __m_scoreTextElement = null;

	private static GameObject __m_deathsTextElement = null;

	private static GameObject __m_relogsTextElement = null;

	private static List<GameObject> __m_iconList = null;

	private static float __m_baseTrophyScale = 1.4f;

	private static float __m_userTrophyScale = 1f;

	private static float __m_userScoreScale = 1f;

	private static float __m_userTrophySpacing = 0f;

	private static List<string> __m_trophyCache = new List<string>();

	private static int __m_deaths = 0;

	private static int __m_logoutCount = 0;

	private static bool __m_pathAddedToMinimap = false;

	private static List<PinData> __m_pathPins = new List<PinData>();

	private static List<Vector3> __m_playerPathData = new List<Vector3>();

	private static bool __m_collectingPlayerPath = false;

	private static float __m_playerPathCollectionInterval = 8f;

	private static float __m_minPathPlayerMoveDistance = 50f;

	private static Vector3 __m_previousPlayerPos;

	private static bool __m_onlyModRunning = false;

	private static bool __m_trophyRushEnabled = false;

	private static bool __m_showAllEnemyDeaths = false;

	private static bool __m_invalidForTournamentPlay = false;

	private static bool __m_ignoreLogouts = false;

	private static long __m_currentPlayerID = 0L;

	private static Dictionary<string, DropInfo> __m_allTrophyDropInfo = new Dictionary<string, DropInfo>();

	private static Dictionary<string, DropInfo> __m_playerTrophyDropInfo = new Dictionary<string, DropInfo>();

	public static bool __m_showingTrophies = true;

	public static TextMeshProUGUI __m_trophyHuntMainMenuText = null;

	private void Awake()
	{
		Dictionary<string, PluginInfo> pluginInfos = Chainloader.PluginInfos;
		if (pluginInfos.Count == 1 && pluginInfos.ContainsKey(((BaseUnityPlugin)this).Info.Metadata.GUID))
		{
			Debug.LogWarning((object)"[TrophyHuntMod] v0.4.1 is loaded and is the ONLY mod running! Let's Hunt!");
			__m_onlyModRunning = true;
		}
		else
		{
			Debug.LogWarning((object)"[TrophyHuntMod] v0.4.1 detected other mods running. For official events, it must be the ONLY mod running.");
			__m_onlyModRunning = false;
		}
		__m_trophyHuntMod = this;
		harmony.PatchAll();
		AddConsoleCommands();
		InitTrophyDropInfo();
	}

	public static void InitTrophyDropInfo()
	{
		__m_allTrophyDropInfo.Clear();
		__m_playerTrophyDropInfo.Clear();
		TrophyHuntData[] _m_trophyHuntData = __m_trophyHuntData;
		for (int i = 0; i < _m_trophyHuntData.Length; i++)
		{
			TrophyHuntData trophyHuntData = _m_trophyHuntData[i];
			__m_allTrophyDropInfo.Add(trophyHuntData.m_name, new DropInfo());
			__m_playerTrophyDropInfo.Add(trophyHuntData.m_name, new DropInfo());
		}
	}

	public static void PrintToConsole(string message)
	{
		if (Object.op_Implicit((Object)(object)Console.m_instance))
		{
			((Terminal)Console.m_instance).AddString(message);
		}
		if (Object.op_Implicit((Object)(object)Chat.m_instance))
		{
			((Terminal)Chat.m_instance).AddString(message);
		}
		Debug.Log((object)message);
	}

	private void AddConsoleCommands()
	{
		//IL_0032: Unknown result type (might be due to invalid IL or missing references)
		//IL_001e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0023: Unknown result type (might be due to invalid IL or missing references)
		//IL_0029: Expected O, but got Unknown
		//IL_006a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0056: Unknown result type (might be due to invalid IL or missing references)
		//IL_005b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0061: Expected O, but got Unknown
		//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
		//IL_008e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0093: Unknown result type (might be due to invalid IL or missing references)
		//IL_0099: Expected O, but got Unknown
		//IL_00da: Unknown result type (might be due to invalid IL or missing references)
		//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
		//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
		//IL_00d1: Expected O, but got Unknown
		//IL_0112: Unknown result type (might be due to invalid IL or missing references)
		//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
		//IL_0103: Unknown result type (might be due to invalid IL or missing references)
		//IL_0109: Expected O, but got Unknown
		//IL_014a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0136: Unknown result type (might be due to invalid IL or missing references)
		//IL_013b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0141: Expected O, but got Unknown
		//IL_0182: Unknown result type (might be due to invalid IL or missing references)
		//IL_016e: Unknown result type (might be due to invalid IL or missing references)
		//IL_0173: Unknown result type (might be due to invalid IL or missing references)
		//IL_0179: Expected O, but got Unknown
		//IL_01ba: Unknown result type (might be due to invalid IL or missing references)
		//IL_01a6: Unknown result type (might be due to invalid IL or missing references)
		//IL_01ab: Unknown result type (might be due to invalid IL or missing references)
		//IL_01b1: Expected O, but got Unknown
		//IL_01f2: Unknown result type (might be due to invalid IL or missing references)
		//IL_01de: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e3: Unknown result type (might be due to invalid IL or missing references)
		//IL_01e9: Expected O, but got Unknown
		//IL_022a: Unknown result type (might be due to invalid IL or missing references)
		//IL_0216: Unknown result type (might be due to invalid IL or missing references)
		//IL_021b: Unknown result type (might be due to invalid IL or missing references)
		//IL_0221: Expected O, but got Unknown
		object obj = <>c.<>9__48_0;
		if (obj == null)
		{
			ConsoleEventFailable val = delegate
			{
				if (!Object.op_Implicit((Object)(object)Game.instance))
				{
					PrintToConsole("'trophyhunt' console command can only be used in-game.");
					return true;
				}
				PrintToConsole("[Trophy Hunt Scoring]");
				int num5 = 0;
				PrintToConsole("Trophies:");
				TrophyHuntData[] _m_trophyHuntData2 = __m_trophyHuntData;
				for (int j = 0; j < _m_trophyHuntData2.Length; j++)
				{
					TrophyHuntData trophyHuntData2 = _m_trophyHuntData2[j];
					if (__m_trophyCache.Contains(trophyHuntData2.m_name))
					{
						string name2 = trophyHuntData2.m_name;
						object arg = trophyHuntData2.m_value;
						Biome biome = trophyHuntData2.m_biome;
						PrintToConsole($"  {name2}: Score: {arg} Biome: {biome.ToString()}");
						num5 += trophyHuntData2.m_value;
					}
				}
				PrintToConsole($"Trophy Score Total: {num5}");
				int num6 = __m_deaths * 20 * -1;
				int num7 = __m_logoutCount * 10 * -1;
				PrintToConsole("Penalties:");
				PrintToConsole($"  Deaths: {__m_deaths} Score: {num6}");
				PrintToConsole($"  Logouts: {__m_logoutCount} Score: {num7}");
				num5 += num6;
				num5 += num7;
				PrintToConsole($"Total Score: {num5}");
				return true;
			};
			<>c.<>9__48_0 = val;
			obj = (object)val;
		}
		new ConsoleCommand("trophyhunt", "Prints trophy hunt data", (ConsoleEventFailable)obj, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
		object obj2 = <>c.<>9__48_1;
		if (obj2 == null)
		{
			ConsoleEvent val2 = delegate
			{
				if (!Object.op_Implicit((Object)(object)Game.instance))
				{
					PrintToConsole("'showpath' console command can only be used in-game.");
				}
				ShowPlayerPath(!__m_pathAddedToMinimap);
			};
			<>c.<>9__48_1 = val2;
			obj2 = (object)val2;
		}
		new ConsoleCommand("showpath", "Show the path the player took", (ConsoleEvent)obj2, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
		object obj3 = <>c.<>9__48_2;
		if (obj3 == null)
		{
			ConsoleEvent val3 = delegate
			{
				Debug.Log((object)"Dumping enemy names:");
				foreach (GameObject prefab in ZNetScene.instance.m_prefabs)
				{
					if (!((Object)(object)prefab == (Object)null))
					{
						Character component3 = prefab.GetComponent<Character>();
						if ((Object)(object)component3 != (Object)null)
						{
							CharacterDrop component4 = ((Component)component3).GetComponent<CharacterDrop>();
							if ((Object)(object)component4 != (Object)null)
							{
								foreach (Drop drop in component4.m_drops)
								{
									if (drop != null && !((Object)(object)drop.m_prefab == (Object)null))
									{
										string name = ((Object)drop.m_prefab).name;
										if (name.Contains("Trophy"))
										{
											Debug.Log((object)(name + "," + component3.m_name));
										}
									}
								}
							}
						}
					}
				}
			};
			<>c.<>9__48_2 = val3;
			obj3 = (object)val3;
		}
		new ConsoleCommand("dumpenemies", "Dump the names of enemies that can drop trophies and what trophies they drop", (ConsoleEvent)obj3, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
		object obj4 = <>c.<>9__48_3;
		if (obj4 == null)
		{
			ConsoleEvent val4 = delegate
			{
				if (Object.op_Implicit((Object)(object)Game.instance))
				{
					PrintToConsole("'/trophyrush' console command can only be used at the main menu via the F5 console.");
				}
				else
				{
					ToggleTrophyRush();
				}
			};
			<>c.<>9__48_3 = val4;
			obj4 = (object)val4;
		}
		new ConsoleCommand("trophyrush", "Toggle Trophy Rush Mode on and off", (ConsoleEvent)obj4, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
		object obj5 = <>c.<>9__48_4;
		if (obj5 == null)
		{
			ConsoleEvent val5 = delegate
			{
				//IL_0048: Unknown result type (might be due to invalid IL or missing references)
				//IL_0070: Unknown result type (might be due to invalid IL or missing references)
				if (!Object.op_Implicit((Object)(object)Game.instance))
				{
					PrintToConsole("'/ignorelogouts' can only be used in gameplay.");
				}
				else
				{
					__m_ignoreLogouts = !__m_ignoreLogouts;
					__m_invalidForTournamentPlay = true;
					if ((Object)(object)__m_scoreTextElement != (Object)null && __m_ignoreLogouts)
					{
						((Graphic)__m_scoreTextElement.GetComponent<TextMeshProUGUI>()).color = Color.green;
					}
					if ((Object)(object)__m_relogsTextElement != (Object)null && __m_ignoreLogouts)
					{
						((Graphic)__m_relogsTextElement.GetComponent<TextMeshProUGUI>()).color = Color.gray;
					}
				}
			};
			<>c.<>9__48_4 = val5;
			obj5 = (object)val5;
		}
		new ConsoleCommand("ignorelogouts", "Don't subtract points for logouts", (ConsoleEvent)obj5, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
		object obj6 = <>c.<>9__48_5;
		if (obj6 == null)
		{
			ConsoleEvent val6 = delegate
			{
				//IL_0040: Unknown result type (might be due to invalid IL or missing references)
				if (!Object.op_Implicit((Object)(object)Game.instance))
				{
					PrintToConsole("'/showallenemydeaths' can only be used in gameplay.");
				}
				else
				{
					ToggleShowAllEnemyDeaths();
					__m_invalidForTournamentPlay = true;
					if ((Object)(object)__m_scoreTextElement != (Object)null && __m_showAllEnemyDeaths)
					{
						((Graphic)__m_scoreTextElement.GetComponent<TextMeshProUGUI>()).color = Color.green;
					}
				}
			};
			<>c.<>9__48_5 = val6;
			obj6 = (object)val6;
		}
		new ConsoleCommand("showallenemydeaths", "Toggle tracking ALL enemy deaths and trophies with JUST tracking player kills and trophies", (ConsoleEvent)obj6, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
		object obj7 = <>c.<>9__48_6;
		if (obj7 == null)
		{
			ConsoleEvent val7 = delegate(ConsoleEventArgs args)
			{
				if (!Object.op_Implicit((Object)(object)Game.instance))
				{
					PrintToConsole("'scorescale' console command can only be used in-game.");
				}
				if (args.Length > 1)
				{
					float num4 = float.Parse(args[1]);
					if (num4 == 0f)
					{
						num4 = 1f;
					}
					__m_userScoreScale = num4;
				}
				else
				{
					__m_userScoreScale = 1f;
				}
				if ((Object)(object)Player.m_localPlayer != (Object)null)
				{
					TextMeshProUGUI component2 = __m_scoreTextElement.GetComponent<TextMeshProUGUI>();
					if ((Object)(object)component2 != (Object)null)
					{
						((TMP_Text)component2).fontSize = 29f * __m_userScoreScale;
					}
				}
			};
			<>c.<>9__48_6 = val7;
			obj7 = (object)val7;
		}
		new ConsoleCommand("scorescale", "Scale the score text sizes (1.0 is default)", (ConsoleEvent)obj7, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
		object obj8 = <>c.<>9__48_7;
		if (obj8 == null)
		{
			ConsoleEvent val8 = delegate(ConsoleEventArgs args)
			{
				//IL_011c: Unknown result type (might be due to invalid IL or missing references)
				//IL_0126: Unknown result type (might be due to invalid IL or missing references)
				if (!Object.op_Implicit((Object)(object)Game.instance))
				{
					PrintToConsole("'trophyscale' console command can only be used in-game.");
				}
				if (args.Length > 1)
				{
					float num2 = float.Parse(args[1]);
					if (num2 == 0f)
					{
						num2 = 1f;
					}
					__m_userTrophyScale = num2;
					if (args.Length > 2)
					{
						float num3 = float.Parse(args[2]);
						if (num3 == 0f)
						{
							num3 = 1f;
						}
						__m_baseTrophyScale = num3;
					}
				}
				else
				{
					__m_userTrophyScale = 1f;
					__m_baseTrophyScale = 1f;
				}
				Player localPlayer2 = Player.m_localPlayer;
				if ((Object)(object)localPlayer2 != (Object)null)
				{
					localPlayer2.GetTrophies();
					TrophyHuntData[] _m_trophyHuntData = __m_trophyHuntData;
					for (int i = 0; i < _m_trophyHuntData.Length; i++)
					{
						TrophyHuntData trophyHuntData = _m_trophyHuntData[i];
						string trophyName = trophyHuntData.m_name;
						GameObject val12 = __m_iconList.Find((GameObject gameObject) => ((Object)gameObject).name == trophyName);
						if ((Object)(object)val12 != (Object)null && (Object)(object)val12.GetComponent<Image>() != (Object)null)
						{
							RectTransform component = val12.GetComponent<RectTransform>();
							if ((Object)(object)component != (Object)null)
							{
								((Transform)component).localScale = new Vector3(__m_baseTrophyScale, __m_baseTrophyScale, __m_baseTrophyScale) * __m_userTrophyScale;
							}
						}
					}
				}
			};
			<>c.<>9__48_7 = val8;
			obj8 = (object)val8;
		}
		new ConsoleCommand("trophyscale", "Scale the trophy sizes (1.0 is default)", (ConsoleEvent)obj8, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
		object obj9 = <>c.<>9__48_8;
		if (obj9 == null)
		{
			ConsoleEvent val9 = delegate(ConsoleEventArgs args)
			{
				if (!Object.op_Implicit((Object)(object)Game.instance))
				{
					PrintToConsole("'trophyspacing' console command can only be used in-game.");
				}
				else if (!((Object)(object)Player.m_localPlayer == (Object)null))
				{
					Player localPlayer = Player.m_localPlayer;
					if (args.Length > 1)
					{
						float num = float.Parse(args[1]);
						if (num == 0f)
						{
							num = 1f;
						}
						__m_userTrophySpacing = num;
					}
					else
					{
						__m_userTrophySpacing = 0f;
					}
					Transform val11 = ((Component)Hud.instance).transform.Find("hudroot/healthpanel");
					if ((Object)(object)val11 == (Object)null)
					{
						Debug.LogError((object)"Health panel transform not found.");
					}
					else
					{
						Player_OnSpawned_Patch.DeleteTrophyIconElements(__m_iconList);
						Player_OnSpawned_Patch.CreateTrophyIconElements(val11, __m_trophyHuntData, __m_iconList);
						Player_OnSpawned_Patch.EnableTrophyHuntIcons(localPlayer);
					}
				}
			};
			<>c.<>9__48_8 = val9;
			obj9 = (object)val9;
		}
		new ConsoleCommand("trophyspacing", "Space the trophies out (negative and positive numbers work)", (ConsoleEvent)obj9, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
		object obj10 = <>c.<>9__48_9;
		if (obj10 == null)
		{
			ConsoleEvent val10 = delegate
			{
				if (!Object.op_Implicit((Object)(object)Game.instance))
				{
					PrintToConsole("'/showtrophies' console command can only be used during gameplay.");
				}
				else
				{
					__m_showingTrophies = !__m_showingTrophies;
					ShowTrophies(__m_showingTrophies);
				}
			};
			<>c.<>9__48_9 = val10;
			obj10 = (object)val10;
		}
		new ConsoleCommand("showtrophies", "Toggle Trophy Rush Mode on and off", (ConsoleEvent)obj10, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false);
	}

	public static void ShowTrophies(bool show)
	{
		foreach (GameObject _m_icon in __m_iconList)
		{
			_m_icon.SetActive(show);
		}
	}

	public static void ToggleTrophyRush()
	{
		__m_trophyRushEnabled = !__m_trophyRushEnabled;
		string text = "OFF";
		if (__m_trophyRushEnabled)
		{
			text = "ON";
		}
		PrintToConsole("Trophy Rush mode is set to " + text + "!");
		if ((Object)(object)__m_trophyHuntMainMenuText != (Object)null)
		{
			((TMP_Text)__m_trophyHuntMainMenuText).text = GetTrophyHuntMainMenuText();
		}
	}

	public static void ToggleShowAllEnemyDeaths()
	{
		__m_showAllEnemyDeaths = !__m_showAllEnemyDeaths;
		if (__m_showAllEnemyDeaths)
		{
			PrintToConsole("Displaying ALL enemy deaths for kills and trophies!");
			PrintToConsole("WARNING: Not legal for Tournament Play!");
		}
		else
		{
			PrintToConsole("Displaying ONLY Player enemy kills and picked up trophies!");
		}
		if (Object.op_Implicit((Object)(object)Game.instance))
		{
			Player_OnSpawned_Patch.DeleteTrophyTooltip();
			Player_OnSpawned_Patch.CreateTrophyTooltip();
		}
		if ((Object)(object)__m_trophyHuntMainMenuText != (Object)null)
		{
			((TMP_Text)__m_trophyHuntMainMenuText).text = GetTrophyHuntMainMenuText();
		}
	}

	public static string GetTrophyHuntMainMenuText()
	{
		string text = "<b><size=32><color=#FFB75B>TrophyHuntMod</color></size></b>\n<size=18>Version 0.4.1</size>";
		if (__m_showAllEnemyDeaths)
		{
			text += "\n<size=18><color=orange>Tracking ALL enemy deaths and trophies!</color>\n<color=red>NOT LEGAL FOR TOURNAMENT PLAY!</color></size>";
		}
		if (__m_trophyRushEnabled)
		{
			text += "\n<size=18><color=orange>Trophy Rush Enabled!</color>\n<color=red>NOT LEGAL FOR TOURNAMENT PLAY!</color></size>";
		}
		return text;
	}

	public static void ShowPlayerPath(bool showPlayerPath)
	{
		//IL_0066: Unknown result type (might be due to invalid IL or missing references)
		//IL_006b: Unknown result type (might be due to invalid IL or missing references)
		//IL_006d: Unknown result type (might be due to invalid IL or missing references)
		//IL_0074: Unknown result type (might be due to invalid IL or missing references)
		//IL_0075: Unknown result type (might be due to invalid IL or missing references)
		if (!showPlayerPath)
		{
			foreach (PinData _m_pathPin in __m_pathPins)
			{
				Minimap.instance.RemovePin(_m_pathPin);
			}
			__m_pathPins.Clear();
			__m_pathAddedToMinimap = false;
			return;
		}
		__m_pathPins.Clear();
		foreach (Vector3 _m_playerPathDatum in __m_playerPathData)
		{
			PinType val = (PinType)3;
			PinData item = Minimap.instance.AddPin(_m_playerPathDatum, val, "", false, false, 0L, "");
			__m_pathPins.Add(item);
		}
		__m_pathAddedToMinimap = true;
	}
}