using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Net; using System.Net.Http; using System.Net.Http.Headers; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Text; using System.Threading.Tasks; using System.Xml.Serialization; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using HarmonyLib; using Newtonsoft.Json; using Splatform; using TMPro; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.Events; using UnityEngine.Networking; using UnityEngine.U2D; 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 © 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("93c3a5ae-6334-4635-88ba-d61d730b4124")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.8", FrameworkDisplayName = ".NET Framework 4.8")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] public class DiscordOAuthFlow { public delegate void StatusCallback(); private const string TokenEndpoint = "https://discord.com/api/oauth2/token"; private const string UserEndpoint = "https://discord.com/api/users/@me"; private HttpListener httpListener; private string m_clientId = string.Empty; private string m_redirectUri = string.Empty; private string m_code = string.Empty; private DiscordUserResponse m_userInfo; private bool VERBOSE; private StatusCallback m_statusCallback; public DiscordUserResponse GetUserResponse() { return m_userInfo; } public void ClearUserResponse() { m_userInfo = null; } public void StartOAuthFlow(string clientId, string redirectUri, StatusCallback callback) { m_clientId = clientId; m_redirectUri = redirectUri; m_statusCallback = callback; _ = VERBOSE; StartServer(redirectUri); OpenDiscordAuthorization(clientId, redirectUri); } private void OpenDiscordAuthorization(string clientId, string redirectUri) { _ = VERBOSE; string text = "identify"; _ = VERBOSE; string fileName = "https://discord.com/oauth2/authorize?client_id=" + clientId + "&redirect_uri=" + Uri.EscapeDataString(redirectUri) + "&response_type=token&scope=" + text; Process.Start(new ProcessStartInfo { FileName = fileName, UseShellExecute = true }); } private void StartServer(string redirectUri) { _ = VERBOSE; if (httpListener != null) { httpListener.Stop(); } else { httpListener = new HttpListener(); httpListener.Prefixes.Add("http://localhost:5000/"); } httpListener.Start(); Task.Run(() => ImplicitGrantWaitForCallback()); } private void StopServer() { _ = VERBOSE; httpListener.Stop(); } private async Task ImplicitGrantWaitForCallback() { _ = VERBOSE; HttpListenerRequest request; HttpListenerResponse response; while (true) { HttpListenerContext httpListenerContext = await httpListener.GetContextAsync(); request = httpListenerContext.Request; response = httpListenerContext.Response; if (request.Url.AbsolutePath == "/callback" && string.IsNullOrEmpty(request.QueryString["token"])) { string callbackHtml = GetCallbackHtml(); byte[] bytes = Encoding.UTF8.GetBytes(callbackHtml); response.ContentLength64 = bytes.Length; response.ContentType = "text/html"; await response.OutputStream.WriteAsync(bytes, 0, bytes.Length); response.OutputStream.Close(); } else if (request.QueryString["token"] != null) { break; } } string accessToken = request.QueryString["token"]; _ = VERBOSE; string s = "\r\n\r\n\r\n
\r\n
\r\n

 

\r\n

Congratulations! You've connected Discord to the TrophyHuntMod and have enabled online reporting!

\r\n \r\n

Data reported by the mod can now be used in official Trophy Hunt Tournaments.

\r\n

 

\r\n

Only your Discord id and username are used, and not for anything but Trophy Hunt event leaderboards.

\r\n

They will not be shared with anyone else.

\r\n

 

\r\n

 

\r\n

You can now close this window.

\r\n
\r\n\r\n\r\n"; byte[] bytes2 = Encoding.UTF8.GetBytes(s); response.ContentLength64 = bytes2.Length; response.ContentType = "text/html"; await response.OutputStream.WriteAsync(bytes2, 0, bytes2.Length); response.OutputStream.Close(); StopServer(); await ImplicitGrantGetDiscordUserInfo(accessToken); m_statusCallback(); } private async Task ImplicitGrantGetDiscordUserInfo(string accessToken) { HttpClient client = new HttpClient(); try { ((HttpHeaders)client.DefaultRequestHeaders).Add("Authorization", "Bearer " + accessToken); HttpResponseMessage response = await client.GetAsync("https://discord.com/api/users/@me"); string text = await response.Content.ReadAsStringAsync(); _ = VERBOSE; if (response.IsSuccessStatusCode) { m_userInfo = JsonConvert.DeserializeObject(text); } else { _ = VERBOSE; } } finally { ((IDisposable)client)?.Dispose(); } } private string GetCallbackHtml() { return "\r\n\r\n\r\n Discord Auth\r\n \r\n\r\n\r\n

Authenticating...

\r\n\r\n"; } } public class DiscordUserResponse { public Sprite avatarSprite; public string id { get; set; } public string username { get; set; } public string discriminator { get; set; } public string avatar { get; set; } public string global_name { get; set; } } public class MainThreadDispatcher : MonoBehaviour { private static MainThreadDispatcher _instance; private readonly Queue _actions = new Queue(); public static MainThreadDispatcher Instance { get { //IL_0012: 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_0027: Expected O, but got Unknown if ((Object)(object)_instance == (Object)null) { GameObject val = new GameObject("MainThreadDispatcher"); _instance = val.AddComponent(); Object.DontDestroyOnLoad((Object)val); } return _instance; } } private void Update() { lock (_actions) { while (_actions.Count > 0) { _actions.Dequeue()?.Invoke(); } } } public void Enqueue(Action action) { if (action == null) { return; } lock (_actions) { _actions.Enqueue(action); } } } namespace TrophyHuntMod; [BepInPlugin("com.oathorse.TrophyHuntMod", "TrophyHuntMod", "0.11.5")] public class TrophyHuntMod : BaseUnityPlugin { public class GandrArrowData { public string m_arrowName = ""; public string m_ingredient = ""; public string m_name = ""; public string m_description = ""; public Type m_statusEffectType; public GandrTypeIndex m_spriteIndex; public GandrArrowData(string arrowName, string ingredient, string name, string description, Type statusEffectType, GandrTypeIndex spriteIndex) { m_arrowName = arrowName; m_ingredient = ingredient; m_name = name; m_description = description; m_statusEffectType = statusEffectType; m_spriteIndex = spriteIndex; } } [HarmonyPatch(typeof(Character), "GetJogSpeedFactor")] public static class Character_GetJogSpeedFactor_Patch { public static void Postfix(Character __instance, ref float __result) { if (IsPacifist()) { Guid cGUID = GetGUIDFromCharacter(__instance); if (__m_allCharmedCharacters.Find((CharmedCharacter c) => c.m_charmGUID == cGUID) != null) { __result = 3.5f; } } } } [HarmonyPatch(typeof(Character), "GetRunSpeedFactor")] public static class Character_GetRunSpeedFactor_Patch { public static void Postfix(Character __instance, ref float __result) { if (IsPacifist()) { Guid cGUID = GetGUIDFromCharacter(__instance); if (__m_allCharmedCharacters.Find((CharmedCharacter c) => c.m_charmGUID == cGUID) != null) { __result = 3.5f; } } } } [HarmonyPatch(typeof(MonsterAI), "UpdateAI")] public static class MonsterAI_UpdateAI_Patch { public static void Postfix(MonsterAI __instance, float dt) { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0065: 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_0095: Unknown result type (might be due to invalid IL or missing references) if (IsPacifist() && !((Object)(object)__instance == (Object)null) && !((Object)(object)((BaseAI)__instance).m_character == (Object)null) && IsCharmed(((BaseAI)__instance).m_character) && !((Object)(object)((BaseAI)__instance).m_character == (Object)null) && !((Object)(object)Player.m_localPlayer == (Object)null)) { Vector3.Distance(((Component)Player.m_localPlayer).transform.position, ((Component)((BaseAI)__instance).m_character).transform.position); Character targetCreature = ((BaseAI)__instance).GetTargetCreature(); if (Object.op_Implicit((Object)(object)targetCreature)) { Vector3.Distance(((Component)targetCreature).transform.position, ((Component)((BaseAI)__instance).m_character).transform.position); __instance.SetFollowTarget(((Component)Player.m_localPlayer).gameObject); } } } } [HarmonyPatch(typeof(BaseAI), "Follow")] public static class BaseAI_Follow_Patch { public static bool Prefix(BaseAI __instance, GameObject go, float dt) { //IL_000c: 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) //IL_005a: Unknown result type (might be due to invalid IL or missing references) float num = 0f; float num2 = Vector3.Distance(go.transform.position, ((Component)__instance.m_character).transform.position); bool flag = num2 > 10f; if (num2 < 3f + __instance.m_character.GetRadius() * 2f - num) { __instance.StopMoving(); } else { __instance.MoveTo(dt, go.transform.position, 0f, flag); } return false; } } [HarmonyPatch(typeof(BaseAI), "FindEnemy")] public static class BaseAI_FindEnemy_Patch { public static bool Prefix(BaseAI __instance, ref Character __result) { //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: 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_00da: Unknown result type (might be due to invalid IL or missing references) if (!IsPacifist()) { return true; } if (!IsCharmed(__instance.m_character)) { return true; } Character localPlayer = (Character)(object)Player.m_localPlayer; if ((Object)(object)localPlayer == (Object)null) { return true; } List allCharacters = Character.GetAllCharacters(); Character val = null; float num = 99999f; float hearRange = __instance.m_hearRange; float viewRange = __instance.m_viewRange; __instance.m_hearRange *= 1.25f; __instance.m_viewRange *= 1.25f; foreach (Character item in allCharacters) { if (!BaseAI.IsEnemy(__instance.m_character, item) || item.IsDead() || item.m_aiSkipTarget) { continue; } BaseAI baseAI = item.GetBaseAI(); if (((Object)(object)baseAI == (Object)null || !baseAI.IsSleeping()) && __instance.CanSenseTarget(item)) { float num2 = Vector3.Distance(((Component)item).transform.position, ((Component)localPlayer).transform.position); if (num2 < num || (Object)(object)val == (Object)null) { val = item; num = num2; } } } __instance.m_hearRange = hearRange; __instance.m_viewRange = viewRange; if ((Object)(object)val == (Object)null && __instance.HuntPlayer()) { Player closestPlayer = Player.GetClosestPlayer(((Component)__instance).transform.position, 200f); if ((Object)(object)closestPlayer != (Object)null && (closestPlayer.InDebugFlyMode() || ((Character)closestPlayer).InGhostMode())) { __result = null; return false; } __result = (Character)(object)closestPlayer; return false; } if (num > 50f) { MonsterAI val2 = (MonsterAI)(object)((__instance is MonsterAI) ? __instance : null); if (Object.op_Implicit((Object)(object)val2)) { val2.m_timeSinceSensedTargetCreature = 0f; val2.m_targetCreature = null; val2.m_targetStatic = null; ((BaseAI)val2).SetTargetInfo(ZDOID.None); } __result = null; return false; } if ((Object)(object)val == (Object)null) { MonsterAI val3 = (MonsterAI)(object)((__instance is MonsterAI) ? __instance : null); if (Object.op_Implicit((Object)(object)val3)) { val3.m_targetStatic = ((BaseAI)val3).FindClosestStaticPriorityTarget(); if ((Object)(object)val3.m_targetStatic == (Object)null) { val3.m_targetStatic = ((BaseAI)val3).FindRandomStaticTarget(50f); } } } __result = val; return false; } } [HarmonyPatch(typeof(Humanoid), "GiveDefaultItems")] public static class Humanoid_GiveDefaultItems_Patch { public static void Postfix(Humanoid __instance) { if (!IsPacifist() || (Object)(object)__instance == (Object)null || !(((object)__instance).GetType() == typeof(Player))) { return; } Inventory inventory = __instance.GetInventory(); if (inventory != null && !inventory.HaveItem("$item_bow", true)) { GameObject itemPrefab = ObjectDB.instance.GetItemPrefab("Bow"); if ((Object)(object)itemPrefab != (Object)null) { __instance.GiveDefaultItem(itemPrefab); } else { Debug.LogWarning((object)"Could not find Bow prefab in ObjectDB"); } } } } [HarmonyPatch(typeof(Character), "RPC_Damage")] public static class Character_RPC_Damage_Patch { public static bool Prefix(Character __instance, long sender, HitData hit) { if (!IsPacifist()) { return true; } if ((Object)(object)hit.GetAttacker() == (Object)(object)Player.m_localPlayer) { return false; } Character attacker = hit.GetAttacker(); if ((Object)(object)attacker == (Object)null) { return true; } CharmedCharacter charmedCharacter = GetCharmedCharacter(attacker); if (charmedCharacter == null) { return true; } LogDamage($"{hit.GetAttacker().GetHoverName()}, {charmedCharacter.m_charmLevel}, {__instance.GetHoverName()}, {hit.GetTotalDamage()}, {hit.GetTotalBlockableDamage()}, {hit.GetTotalElementalDamage()}, {hit.GetTotalPhysicalDamage()}, {((object)(DamageTypes)(ref hit.m_damage)).ToString()}"); return true; } } [HarmonyPatch(typeof(Humanoid), "StartAttack")] public static class Humanoid_StartAttack_Patch { public static bool Prefix(Humanoid __instance, Character target, bool secondaryAttack, bool __result) { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Invalid comparison between Unknown and I4 //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Invalid comparison between Unknown and I4 //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Invalid comparison between Unknown and I4 //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Invalid comparison between Unknown and I4 if (!IsPacifist()) { return true; } if ((Object)(object)__instance != (Object)null && (Object)(object)__instance == (Object)(object)Player.m_localPlayer) { ItemData currentWeapon = __instance.GetCurrentWeapon(); if (currentWeapon != null && (int)currentWeapon.m_shared.m_itemType == 4) { ItemData ammoItem = __instance.GetAmmoItem(); if (ammoItem != null && IsThrallArrow(ammoItem.m_shared.m_name)) { return true; } } else if ((int)currentWeapon.m_shared.m_skillType == 7 || (int)currentWeapon.m_shared.m_skillType == 12 || (int)currentWeapon.m_shared.m_skillType == 13) { return true; } __result = false; return false; } return true; } } public class CharmedCharacter { public Guid m_charmGUID = Guid.Empty; public PinData m_pin; public long m_charmExpireTime; public Faction m_originalFaction = (Faction)12; public float m_swimSpeed = 2f; public int m_charmLevel = 1; } [HarmonyPatch(typeof(MonsterAI), "Awake")] public static class MonsterAI_Awake_Patch { public static void Postfix(MonsterAI __instance) { if (IsPacifist() && !((Object)(object)__instance == (Object)null) && !((Object)(object)((BaseAI)__instance).m_character == (Object)null)) { Guid cGUID = GetGUIDFromCharacter(((BaseAI)__instance).m_character); CharmedCharacter charmedCharacter = __m_allCharmedCharacters.Find((CharmedCharacter c) => c.m_charmGUID == cGUID); if (charmedCharacter != null) { SetCharmedState(charmedCharacter); } } } } [HarmonyPatch(typeof(Character), "OnDestroy")] public static class Character_OnDestroy_Patch { public static void Prefix(Character __instance) { IsPacifist(); } } [HarmonyPatch(typeof(Projectile), "OnHit")] public static class Projectile_OnHit_Patch { public static bool Prefix(Projectile __instance, Collider collider) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) if (!IsPacifist()) { return true; } if ((Object)(object)__instance == (Object)null) { return true; } ItemData ammo = __instance.m_ammo; if (ammo == null || ammo.m_shared == null) { return true; } if (!IsThrallArrow(ammo.m_shared.m_name)) { return true; } __instance.m_damage = default(DamageTypes); return false; } public static void Postfix(Projectile __instance, Collider collider) { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Invalid comparison between Unknown and I4 //IL_0118: Unknown result type (might be due to invalid IL or missing references) if (!IsPacifist()) { return; } try { if ((Object)(object)__instance == (Object)null || (Object)(object)__instance.m_owner == (Object)null) { return; } ItemData ammo = __instance.m_ammo; if (ammo == null || ammo.m_shared == null) { return; } string name = ammo.m_shared.m_name; if (!IsThrallArrow(name)) { return; } GameObject val = Projectile.FindHitObject(collider); if ((Object)(object)val == (Object)null) { Debug.LogWarning((object)("Unable find hit object for Projectile with collilder " + ((Object)collider).name)); return; } Character component = val.GetComponent(); if ((Object)(object)component == (Object)null || component.IsPlayer() || component.IsDead()) { return; } if ((int)component.m_faction == 8) { ((Character)Player.m_localPlayer).Message((MessageType)2, "Bosses cannot be charmed.", 0, (Sprite)null); return; } if (!IsCharmed(component) && __m_allCharmedCharacters.Count >= 5) { ((Character)Player.m_localPlayer).Message((MessageType)2, $"You already have {5} thralls.", 0, (Sprite)null); return; } if ((Object)(object)__instance.m_owner != (Object)null && Object.op_Implicit((Object)(object)component)) { __instance.m_owner.RaiseSkill(__instance.m_skill, __instance.m_raiseSkillAmount); __instance.m_owner.AddAdrenaline(__instance.m_adrenaline); } bool wasCharmed = false; if (IsCharmed(component)) { CharmedCharacter charmedCharacter = GetCharmedCharacter(component); if (charmedCharacter != null) { if (name.Contains("Wood")) { ((Character)Player.m_localPlayer).Message((MessageType)2, "Thrall " + component.GetHoverName() + " released from bondage.", 0, (Sprite)null); SetUncharmedState(charmedCharacter); RemoveGUIDFromCharmedList(charmedCharacter.m_charmGUID); ZNetScene.instance.Destroy(((Component)__instance).gameObject); return; } charmedCharacter.m_charmExpireTime = __m_charmTimerSeconds + (long)GetCharmDuration(); wasCharmed = true; } } else { AddToCharmedList(component, (long)GetCharmDuration()); } ApplyGandrEffect(name, component, wasCharmed); ZNetScene.instance.Destroy(((Component)__instance).gameObject); } catch (Exception arg) { Debug.LogError((object)$"[WoodArrowCharm] Error: {arg}"); } } } public class SavedItemData { public string m_name; public string m_description; } [HarmonyPatch(typeof(ObjectDB), "Awake")] public static class ObjectDB_Awake_Patch { private static void Postfix(ObjectDB __instance) { if (IsPacifist() && (Object)(object)ObjectDB.instance != (Object)null && ObjectDB.instance.m_items.Count != 0 && (Object)(object)ObjectDB.instance.GetItemPrefab("Amber") != (Object)null) { ChangeArrowsAndRecipes(__instance); } } } [HarmonyPatch(typeof(Player), "AddAdrenaline")] public static class Player_AddAdrenaline_Patch { public static bool Prefix(Player __instance, ref float v) { if (!IsPacifist()) { return true; } if (HasThrall()) { if (v > 0f) { v *= 2f; } else { v *= 0.5f; } } return true; } } [HarmonyPatch(typeof(SEMan), "ModifyAdrenaline")] public static class SEMan_ModifyAdrenaline_Patch { public static bool Prefix(SEMan __instance, float baseValue, ref float use) { //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) if (!IsPacifist()) { return true; } if ((Object)(object)__instance.m_character != (Object)(object)Player.m_localPlayer) { return true; } Player localPlayer = Player.m_localPlayer; if (use > 0f) { use *= 2f; if (localPlayer.m_adrenaline + use > localPlayer.m_maxAdrenaline) { bool flag = false; StatusEffect val = null; foreach (ItemData allItem in ((Humanoid)localPlayer).GetInventory().GetAllItems()) { if (allItem.m_equipped && (Object)(object)allItem.m_shared.m_fullAdrenalineSE != (Object)null) { flag = true; val = allItem.m_shared.m_fullAdrenalineSE; break; } } foreach (CharmedCharacter _m_allCharmedCharacter in __m_allCharmedCharacters) { Character characterFromGUID = GetCharacterFromGUID(_m_allCharmedCharacter.m_charmGUID); if (!Object.op_Implicit((Object)(object)characterFromGUID)) { continue; } characterFromGUID.Heal(characterFromGUID.GetMaxHealth() - characterFromGUID.GetHealth(), true); if (flag) { localPlayer.m_adrenalinePopEffects.Create(((Component)characterFromGUID).transform.position, Quaternion.identity, (Transform)null, 1f, -1); StatusEffect statusEffect = characterFromGUID.m_seman.GetStatusEffect(val.m_nameHash); if (Object.op_Implicit((Object)(object)statusEffect)) { statusEffect.ResetTime(); } else { characterFromGUID.m_seman.AddStatusEffect(val, false, 0, 0f); } } else { localPlayer.m_adrenaline = 0f; } _m_allCharmedCharacter.m_charmLevel++; Hud.instance.AdrenalineBarFlash(); ((Character)Player.m_localPlayer).Message((MessageType)1, $"Thrall {characterFromGUID.GetHoverName()} reached Charm Level {_m_allCharmedCharacter.m_charmLevel}!", 0, (Sprite)null); } ((Character)Player.m_localPlayer).Message((MessageType)2, "Your thralls grow stronger!", 0, (Sprite)null); } } return true; } } [HarmonyPatch(typeof(Attack), "ModifyDamage")] public class Attack_ModifyDamage_Patch { public static bool Prefix(Attack __instance, HitData hitData, float damageFactor) { Character character = (Character)(object)__instance.m_character; if (IsPacifist() && IsCharmed(character) && character != null && character.m_seman.GetStatusEffects().Count == 0) { CharmedCharacter charmedCharacter = GetCharmedCharacter(character); if (charmedCharacter != null) { float adrenalineScalar = Player.m_localPlayer.GetAdrenaline() / ((Character)Player.m_localPlayer).GetMaxAdrenaline(); ScaleThrallOutgoingDamage(ref hitData, charmedCharacter.m_charmLevel, adrenalineScalar, 1.1f); } } return true; } } [HarmonyPatch(typeof(Character), "Damage")] public class Character_Damage_Patch { public static bool Prefix(Character __instance, HitData hit) { if (IsPacifist() && IsCharmed(__instance) && __instance != null && __instance.m_seman.GetStatusEffects().Count == 0) { CharmedCharacter charmedCharacter = GetCharmedCharacter(__instance); if (charmedCharacter != null) { float adrenalineScalar = Player.m_localPlayer.GetAdrenaline() / ((Character)Player.m_localPlayer).GetMaxAdrenaline(); ScaleThrallIncomingDamage(__instance, ref hit, charmedCharacter.m_charmLevel, adrenalineScalar, 0.7f); } } return true; } } public class GandrSEData { public Type m_type; public float m_inflicted; public float m_received; public float m_typedDamage; public string m_name; public GandrSEData(Type type, float inflited, float received, float typedDamage, string name) { m_type = type; m_inflicted = inflited; m_received = received; m_typedDamage = typedDamage; m_name = name; } } public class SE_GandrEffect : SE_Stats { public float m_adrenalineScalar; public float m_baseDamageInflictedModifier = 1f; public float m_baseDamageReceivedModifier = 1.2f; public float m_baseTypedDamageModifier = 0.5f; public float m_charmLevel = 1f; public GandrSEData m_seData; public override void Setup(Character character) { ((SE_Stats)this).Setup(character); ((StatusEffect)this).m_ttl = 120f; ((StatusEffect)this).m_name = "Base Gandr Effect"; GandrArrowData gandrArrowData = __m_gandrArrowData.First((GandrArrowData a) => a.m_statusEffectType == ((object)this).GetType()); if (gandrArrowData != null) { ((StatusEffect)this).m_icon = __m_cachedPacifistSprites[(int)gandrArrowData.m_spriteIndex].m_sprite; } GandrSEData gandrSEData = __m_gandrSEData.First((GandrSEData s) => s.m_type == ((object)this).GetType()); if (gandrSEData != null) { m_baseDamageInflictedModifier = gandrSEData.m_inflicted; m_baseDamageReceivedModifier = gandrSEData.m_received; m_baseTypedDamageModifier = gandrSEData.m_typedDamage; ((StatusEffect)this).m_name = gandrSEData.m_name; ((StatusEffect)this).m_nameHash = StringExtensionMethods.GetStableHashCode(((StatusEffect)this).m_name); m_seData = gandrSEData; } } public override void UpdateStatusEffect(float dt) { ((SE_Stats)this).UpdateStatusEffect(dt); CharmedCharacter charmedCharacter = GetCharmedCharacter(((StatusEffect)this).m_character); if (charmedCharacter != null) { m_charmLevel = charmedCharacter.m_charmLevel; } Player localPlayer = Player.m_localPlayer; if (localPlayer != null && ((Character)localPlayer).GetMaxAdrenaline() > 0f) { m_adrenalineScalar = Player.m_localPlayer.GetAdrenaline() / ((Character)Player.m_localPlayer).GetMaxAdrenaline(); } else { m_adrenalineScalar = 0f; } } public override void ModifyAttack(SkillType skill, ref HitData hitData) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_0052: Unknown result type (might be due to invalid IL or missing references) DamageTypes percentigeDamageModifiers = base.m_percentigeDamageModifiers; float num = 0f; ((DamageTypes)(ref hitData.m_damage)).GetMajorityDamageType(ref num); ((DamageTypes)(ref percentigeDamageModifiers)).Modify(num * m_baseTypedDamageModifier); ((DamageTypes)(ref hitData.m_damage)).Add(percentigeDamageModifiers, 1); ScaleThrallOutgoingDamage(ref hitData, m_charmLevel, base.m_adrenalineModifier, m_baseDamageInflictedModifier); ((SE_Stats)this).ModifyAttack(skill, ref hitData); } public override void OnDamaged(HitData hit, Character attacker) { ((StatusEffect)this).OnDamaged(hit, attacker); ScaleThrallIncomingDamage(((StatusEffect)this).m_character, ref hit, m_charmLevel, m_adrenalineScalar, m_baseDamageReceivedModifier); } public override void Stop() { ((StatusEffect)this).Stop(); } } public class SE_GandrFlint : SE_GandrEffect { public override void Setup(Character character) { base.Setup(character); ((SE_Stats)this).m_percentigeDamageModifiers.m_pierce = m_seData.m_typedDamage; } } public class SE_GandrFire : SE_GandrEffect { public override void Setup(Character character) { base.Setup(character); ((SE_Stats)this).m_percentigeDamageModifiers.m_fire = m_seData.m_typedDamage; } } public class SE_GandrBronze : SE_GandrEffect { public override void Setup(Character character) { base.Setup(character); ((SE_Stats)this).m_percentigeDamageModifiers.m_blunt = m_seData.m_typedDamage; } } public class SE_GandrPoison : SE_GandrEffect { public override void Setup(Character character) { base.Setup(character); ((SE_Stats)this).m_percentigeDamageModifiers.m_poison = m_seData.m_typedDamage; } } public class SE_GandrIron : SE_GandrEffect { public override void Setup(Character character) { base.Setup(character); ((SE_Stats)this).m_percentigeDamageModifiers.m_slash = m_seData.m_typedDamage; } } public class SE_GandrFrost : SE_GandrEffect { public override void Setup(Character character) { base.Setup(character); ((SE_Stats)this).m_percentigeDamageModifiers.m_frost = m_seData.m_typedDamage; } } public class SE_GandrObsidian : SE_GandrEffect { public override void Setup(Character character) { base.Setup(character); ((SE_Stats)this).m_percentigeDamageModifiers.m_slash = m_seData.m_typedDamage; } } public class SE_GandrSilver : SE_GandrEffect { public override void Setup(Character character) { base.Setup(character); ((SE_Stats)this).m_percentigeDamageModifiers.m_spirit = m_seData.m_typedDamage; } } public class SE_GandrNeedle : SE_GandrEffect { public override void Setup(Character character) { base.Setup(character); ((SE_Stats)this).m_percentigeDamageModifiers.m_pierce = m_seData.m_typedDamage; } } public class SE_GandrCarapace : SE_GandrEffect { public override void Setup(Character character) { base.Setup(character); ((SE_Stats)this).m_percentigeDamageModifiers.m_blunt = m_seData.m_typedDamage; } } public class SE_GandrCharred : SE_GandrEffect { public override void Setup(Character character) { base.Setup(character); ((SE_Stats)this).m_percentigeDamageModifiers.m_lightning = m_seData.m_typedDamage; } } [HarmonyPatch(typeof(EnemyHud), "UpdateHuds")] public class EnemyHud_UpdateHud_Patch { public static void Postfix(EnemyHud __instance, Player player, Sadle sadle, float dt) { //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) //IL_025d: Unknown result type (might be due to invalid IL or missing references) if (!IsPacifist()) { return; } foreach (KeyValuePair hud in __instance.m_huds) { Character key = hud.Key; if ((Object)(object)key == (Object)null) { continue; } HudData value = hud.Value; Transform val = value.m_gui.transform.Find("Charm"); List list = new List(); for (int i = 0; i < MAX_NUM_CHARM_ICONS; i++) { object obj; if (value == null) { obj = null; } else { GameObject gui = value.m_gui; if (gui == null) { obj = null; } else { Transform obj2 = gui.transform.Find($"Charm/CharmIcon{i}"); obj = ((obj2 != null) ? ((Component)obj2).gameObject : null); } } GameObject val2 = (GameObject)obj; if (Object.op_Implicit((Object)(object)val2)) { val2.SetActive(false); list.Add(val2); } } CharmedCharacter charmedCharacter = GetCharmedCharacter(key); if (charmedCharacter == null) { if (Object.op_Implicit((Object)(object)val) && ((Component)val).gameObject.activeSelf) { ((Component)val).gameObject.SetActive(false); } } else { if (!IsCharmed(key)) { continue; } if (Object.op_Implicit((Object)(object)val) && !((Component)val).gameObject.activeSelf) { ((Component)val).gameObject.SetActive(true); } int num = 0; List statusEffects = key.m_seman.m_statusEffects; foreach (StatusEffect item in statusEffects) { if (!((Object)(object)item.m_icon == (Object)null)) { GameObject obj3 = list[num]; obj3.gameObject.SetActive(true); obj3.GetComponent().sprite = item.m_icon; RectTransform component = obj3.GetComponent(); int num2 = 28; component.sizeDelta = new Vector2((float)num2, (float)num2); ((Transform)component).localScale = Vector3.one; float num3 = 1f; float num4 = ((float)num2 + num3) * (float)(statusEffects.Count - 1) / 2f; float num5 = ((float)num2 + num3) * (float)num; component.anchoredPosition = new Vector2(0f - num4 + num5, (float)(-num2 / 2 - 1)); num++; } } GuiBar component2 = ((Component)value.m_gui.transform.Find("Charm/CharmBar")).GetComponent(); float num6 = charmedCharacter.m_charmExpireTime - __m_charmTimerSeconds; component2.SetWidth(100f); component2.SetValue(num6 / GetCharmDuration()); component2.SetColor(__m_pinkColor); ((TMP_Text)((Component)value.m_gui.transform.Find("Charm/CharmLevelText")).gameObject.GetComponent()).text = $"{charmedCharacter.m_charmLevel}"; } } } } [HarmonyPatch(typeof(EnemyHud), "Awake")] public class EnemyHud_Awake_Patch { public static void Postfix(EnemyHud __instance) { //IL_0042: 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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: 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_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Expected O, but got Unknown //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) Transform val = __instance.m_baseHud.transform.Find("Health"); GameObject val2 = Object.Instantiate(((Component)val).gameObject, val.parent); ((Object)val2).name = "Charm"; val2.SetActive(false); Transform transform = val2.transform; transform.localPosition += new Vector3(0f, -10f, 0f); Transform val3 = transform.Find("health_fast"); if ((Object)(object)val3 != (Object)null) { Object.Destroy((Object)(object)((Component)val3).gameObject); } Transform val4 = transform.Find("health_slow"); if ((Object)(object)val4 != (Object)null) { Object.Destroy((Object)(object)((Component)val4).gameObject); } Transform obj = transform.Find("health_fast_friendly"); ((Object)obj).name = "CharmBar"; if (obj != null) { GameObject gameObject = ((Component)obj).gameObject; if (gameObject != null) { gameObject.GetComponent(); } } CreateCharmIconsInMasterHud(val2.transform); GameObject val5 = new GameObject("CharmLevelText"); val5.transform.SetParent(val2.transform); RectTransform obj2 = val5.AddComponent(); obj2.sizeDelta = new Vector2(20f, 20f); ((Transform)obj2).localScale = Vector3.one; ((Transform)obj2).localPosition = Vector2.op_Implicit(Vector2.zero); TextMeshProUGUI obj3 = AddTextMeshProComponent(val5); ((TMP_Text)obj3).text = "X"; ((TMP_Text)obj3).fontSize = 13f; ((TMP_Text)obj3).fontStyle = (FontStyles)1; ((Graphic)obj3).color = Color.white; ((Graphic)obj3).raycastTarget = false; ((TMP_Text)obj3).fontMaterial.EnableKeyword("OUTLINE_ON"); ((TMP_Text)obj3).outlineColor = Color32.op_Implicit(Color.black); ((TMP_Text)obj3).outlineWidth = 0.125f; ((TMP_Text)obj3).verticalAlignment = (VerticalAlignmentOptions)512; ((TMP_Text)obj3).horizontalAlignment = (HorizontalAlignmentOptions)2; } } public class CachedSprite { public GandrTypeIndex m_index; public string m_name; public Sprite m_sprite; public CachedSprite(GandrTypeIndex index, string name, Sprite sprite) { m_index = index; m_name = name; m_sprite = sprite; } } public enum GandrTypeIndex { Wood, Flint, Fire, Bronze, Poison, Iron, Frost, Obsidian, Silver, Needle, Carapace, Charred } [HarmonyPatch(typeof(ZoneSystem), "SetupLocations")] public static class ZoneSystem_SetupLocations_Patch { public static void Postfix(ZoneSystem __instance) { //IL_004c: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) if (!IsPacifist()) { return; } if ((Object)(object)ZNetScene.instance == (Object)null) { Debug.LogWarning((object)"[MyMod] ZNetScene not loaded when SetupLocations patched."); return; } List locations = __instance.m_locations; if (locations == null) { return; } foreach (ZoneLocation item in locations) { if (item != null) { float num = 1.5f; if (((Enum)item.m_biome).HasFlag((Enum)(object)(Biome)1) && item.m_prefabName.Contains("Runestone_Boars")) { num = 10f; } ((Enum)item.m_biome).HasFlag((Enum)(object)(Biome)8); ((Enum)item.m_biome).HasFlag((Enum)(object)(Biome)2); ((Enum)item.m_biome).HasFlag((Enum)(object)(Biome)4); ((Enum)item.m_biome).HasFlag((Enum)(object)(Biome)16); ((Enum)item.m_biome).HasFlag((Enum)(object)(Biome)512); ((Enum)item.m_biome).HasFlag((Enum)(object)(Biome)32); ((Enum)item.m_biome).HasFlag((Enum)(object)(Biome)64); if (item.m_quantity > 1) { item.m_quantity = Mathf.RoundToInt((float)item.m_quantity * num); } if (item.m_minDistance > 0f && item.m_maxDistance > 0f) { item.m_minDistance = Mathf.Max(10f, item.m_minDistance * (1f / num)); item.m_maxDistance = Mathf.Max(10f, item.m_maxDistance * (1f / num)); } if (item.m_minDistanceFromSimilar > 0f) { item.m_minDistanceFromSimilar /= num; } } } } } public class BackupSpawnData { public float m_spawnChance; public int m_maxSpawned; public float m_spawnInterval; public float m_spawnRadiusMin; public float m_spawnRadiusMax; public float m_spawnDistance; } public class SpawnModifierData { public float m_chance = 1.1f; public float m_max = 2f; public float m_interval = 0.9f; public float m_minRadius; public float m_maxRadius; public float m_distance = 0.85f; } [HarmonyPatch(typeof(SpawnSystem), "OnDestroy")] public static class SpawnSystem_OnDestroy_Patch { public static void Postfix(SpawnSystem __instance) { if (IsPacifist() && --__m_spawnListsPatched < 1) { DoRestoreSpawnData(__m_originalSpawnData, ref __instance.m_spawnLists); } } } [HarmonyPatch(typeof(SpawnSystem), "Awake")] public static class SpawnSystem_Awake_Patch { public static void Postfix(SpawnSystem __instance) { if (!IsPacifist() || (Object)(object)__instance == (Object)null || __m_spawnListsPatched++ != 0) { return; } DoBackupSpawnData(__instance.m_spawnLists, ref __m_originalSpawnData); foreach (SpawnSystemList spawnList in __instance.m_spawnLists) { foreach (SpawnData spawner in spawnList.m_spawners) { if (spawner != null) { if (__m_spawnMultipliers.TryGetValue(((Object)spawner.m_prefab).name, out var value)) { spawner.m_spawnChance = Math.Min(spawner.m_spawnChance * value.m_chance, 100f); spawner.m_maxSpawned = (int)Math.Max((float)spawner.m_maxSpawned * value.m_max, 1f); spawner.m_spawnInterval = Math.Max(1f, spawner.m_spawnInterval * value.m_interval); spawner.m_spawnRadiusMin = value.m_minRadius; spawner.m_spawnRadiusMax = value.m_maxRadius; spawner.m_spawnDistance = Math.Max(1f, spawner.m_spawnDistance * value.m_distance); } else { Debug.LogWarning((object)("Did not find spawn modifier for " + ((Object)spawner.m_prefab).name)); } } } } } } [HarmonyPatch(typeof(SpawnSystem), "UpdateSpawning")] public static class SpawnSystem_UpdateSpawning_Patch { public static bool Prefix(SpawnSystem __instance) { //IL_0060: 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) if (!IsPacifist()) { return true; } if ((Object)(object)__instance == (Object)null) { return true; } if ((Object)(object)Player.m_localPlayer == (Object)null) { return true; } foreach (SpawnSystemList spawnList in __instance.m_spawnLists) { if ((Object)(object)spawnList == (Object)null) { continue; } foreach (SpawnData spawner in spawnList.m_spawners) { if (spawner != null && Player.m_localPlayer.GetCurrentBiome() == spawner.m_biome) { spawner.m_maxSpawned = Math.Max(2, __m_allCharmedCharacters.Count + 1); } } } return true; } } public enum Biome { Meadows, Forest, Swamp, Mountains, Plains, Mistlands, Ashlands, Ocean, Hildir, Bogwitch } public struct TrophyHuntDataScoreOverride { public TrophyGameMode m_gameMode; public string m_trophyName; public int m_score; public TrophyHuntDataScoreOverride(TrophyGameMode gameMode, string trophyName, int score) { m_gameMode = gameMode; m_trophyName = trophyName; m_score = score; } } public struct TrophyHuntData { public string m_name; public string m_prettyName; public Biome m_biome; private int m_value; public float m_dropPercent; public List m_enemies; public TrophyHuntData(string name, string prettyName, Biome biome, int value, float dropPercent, List enemies) { m_name = name; m_prettyName = prettyName; m_biome = biome; m_value = value; m_dropPercent = dropPercent; m_enemies = enemies; } public int GetCurGameModeTrophyScoreValue() { int result = m_value; TrophyHuntDataScoreOverride[] _m_trophyHuntScoreOverrides = __m_trophyHuntScoreOverrides; for (int i = 0; i < _m_trophyHuntScoreOverrides.Length; i++) { TrophyHuntDataScoreOverride trophyHuntDataScoreOverride = _m_trophyHuntScoreOverrides[i]; if (trophyHuntDataScoreOverride.m_gameMode == GetGameMode() && trophyHuntDataScoreOverride.m_trophyName == m_name) { result = trophyHuntDataScoreOverride.m_score; break; } } return result; } } public struct BiomeBonus { public Biome m_biome; public string m_biomeName; public int m_bonus; public List m_trophies; public BiomeBonus(Biome biome, string biomeName, int bonus, List trophies) { m_biome = biome; m_biomeName = biomeName; m_bonus = bonus; m_trophies = trophies; } } public class TrophyPin { public Vector3 m_pos; public string m_trophyName; } public enum TrophyGameMode { TrophyHunt, TrophyRush, TrophySaga, TrophyBlitz, TrophyTrailblazer, TrophyFarmer, TrophyPacifist, CulinarySaga, CasualSaga, TrophyFiesta, Max } 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(Game), "SavePlayerProfile")] public class Game_SavePlayerProfile_Patch { private static void Prefix(PlayerProfile __instance, bool setLogoutPoint) { SavePersistentData(); } } public class THMSaveData { public class THMSaveDataDropInfo { public string m_name; public DropInfo m_dropInfo; } public class THMSaveDataSpecialSagaDropCount { public string m_name; public int m_dropCount; public int m_numPickedUp; } public class THMSaveDataCharmedCharacter { public Vector3 m_pos; public PinType m_pinType; public long m_charmTimeRemaining; public Guid m_charmGUID; public Faction m_originalFaction; public float m_swimSpeed; public int m_charmLevel; } public class THMTrophyCount { public string m_name; public int m_count; } public List m_playerTrophyDropInfos; public List m_allTrophyDropInfos; public List m_pendingEvents; public List m_trophyPins; public long m_gameTimerElapsedSeconds; public long m_internalTimerElapsedSeconds; public bool m_gameTimerActive; public bool m_gameTimerVisible; public bool m_gameTimerCountdown; public long m_charmTimerSeconds; public List m_charmedCharacters; public int m_slashDieCount; public int m_logoutCount; public List m_specialSagaDropCounts; public long m_storedPlayerID; public TrophyGameMode m_storedGameMode; public string m_storedWorldSeed; public List m_cookedFoods; public List m_playerEventLog; public List m_trophyCounts; } [Serializable] public class TrackEvent { public string tag; public int secs; public int x; public int y; public int z; public string extra; } [HarmonyPatch(typeof(Player), "OnSpawned")] public class Player_OnSpawned_Patch { private static void Postfix(Player __instance) { //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance != (Object)(object)Player.m_localPlayer) { return; } __m_instaSmelt = false; if (IsSagaMode() || GetGameMode() == TrophyGameMode.TrophyFarmer) { __m_instaSmelt = true; } Array.Sort(__m_trophyHuntData, (TrophyHuntData x, TrophyHuntData y) => x.m_biome.CompareTo(y.m_biome) * 100000 + x.GetCurGameModeTrophyScoreValue().CompareTo(y.GetCurGameModeTrophyScoreValue()) * 10000 + x.m_name.CompareTo(y.m_name)); __m_trophyCache = Player.m_localPlayer.GetTrophies(); if (__m_storedPlayerID != Player.m_localPlayer.GetPlayerID() || __m_storedGameMode != __m_trophyGameMode || __m_storedWorldSeed != WorldGenerator.instance.m_world.m_seedName) { InitializeTrackedDataForNewPlayer(); } if (__m_showAllTrophyStats || __m_ignoreLogouts || GetGameMode() == TrophyGameMode.TrophyFiesta || GetGameMode() == TrophyGameMode.CulinarySaga || GetGameMode() == TrophyGameMode.CasualSaga || Game.instance.GetPlayerProfile().m_usedCheats || Game.instance.GetPlayerProfile().m_playerStats[(PlayerStatType)4] > 0f) { __m_invalidForTournamentPlay = true; } __m_fiestaFlashing = false; BuildUIElements(); if (GetTotalOnFootDistance(Game.instance) < 10f) { __m_logoutCount = 0; } Directory.GetCurrentDirectory(); __m_storedPlayerID = Player.m_localPlayer.GetPlayerID(); __m_storedGameMode = __m_trophyGameMode; __m_storedWorldSeed = WorldGenerator.instance.m_world.m_seedName; LoadPersistentData(); UpdateModUI(Player.m_localPlayer); ShowPlayerPath(showPlayerPath: false); if (__m_pendingDeathRegistration) { __m_pendingDeathRegistration = false; CalculateCurrentScore(Player.m_localPlayer); AddPlayerEvent(PlayerEventType.Misc, "PenaltyDeath", __m_pendingDeathPosition); } if (__m_firstInputDetected) { AddTrackEvent("J", ((Component)Player.m_localPlayer).transform.position, "Respawn"); } if (GetGameMode() != TrophyGameMode.TrophyFiesta) { if (GetGameMode() == TrophyGameMode.TrophyBlitz) { UnlockEverythingBlitz(Player.m_localPlayer); } else if (GetGameMode() == TrophyGameMode.TrophyTrailblazer) { UnlockEverythingTrailblazer(Player.m_localPlayer); } } __m_refreshLogsAndStandings = true; PostStandingsRequest(); StartPeriodicTimer(); StartCollectingPlayerPath(); if (IsPacifist()) { StartCharmTimer(); } foreach (PinData pin in Minimap.instance.m_pins) { if (pin.m_name.StartsWith("Trophy")) { pin.m_icon = GetTrophySprite(pin.m_name); } } FixTrophyPins(); Debug.LogWarning((object)("Loading into Game Mode: " + GetGameModeString(GetGameMode()))); if (IsPacifist()) { CacheSprites(); if (!__m_introMessageDisplayed) { ((Character)Player.m_localPlayer).Message((MessageType)2, "Trophy Pacifist\nUse Wood Arrows to charm enemies!", 0, (Sprite)null); __m_introMessageDisplayed = true; } DoPacifistPostPlayerSpawnTasks(); } Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null) { localPlayer.UpdateKnownRecipesList(); } if (!__m_firstInputDetected) { ((MonoBehaviour)__m_trophyHuntMod).StartCoroutine(WaitForFirstInput()); } } } [HarmonyPatch(typeof(Skills), "GetSkill")] public class Skills_Learn_Patch { private static void Postfix(Skill __instance, SkillType skillType, ref Skill __result) { if (IsSagaMode()) { if (__result.m_level < 20f) { __result.m_level = 20f; __result.m_accumulator = 0f; } } else if (GetGameMode() == TrophyGameMode.TrophyBlitz) { if (__result.m_level < 100f) { __result.m_level = 100f; __result.m_accumulator = 0f; } } else if (GetGameMode() == TrophyGameMode.TrophyTrailblazer && __result.m_level < 1f) { __result.m_level = 1f; __result.m_accumulator = 0f; } } } [HarmonyPatch(typeof(Skill), "Raise")] public class Skills_RaiseSkill_Patch { private static bool Prefix(Skill __instance, ref float factor, bool __result) { if (GetGameMode() == TrophyGameMode.TrophyTrailblazer) { factor *= 6f; } return true; } } [HarmonyPatch(typeof(Player), "AddTrophy", new Type[] { typeof(ItemData) })] public static class Player_AddTrophy_Patch { public static void Postfix(Player __instance, ItemData item) { //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)__instance != (Object)null) || item == null) { return; } string name = ((Object)item.m_dropPrefab).name; if (!(__m_trophyCache.Find((string trophyName) => trophyName == name) != name)) { return; } FlashTrophy(name); __m_trophyCache = __instance.GetTrophies(); UpdateModUI(__instance); string text = null; if (GetGameMode() == TrophyGameMode.TrophyRush || GetGameMode() == TrophyGameMode.TrophyBlitz || GetGameMode() == TrophyGameMode.TrophyTrailblazer || GetGameMode() == TrophyGameMode.TrophyPacifist) { Biome biome = Biome.Meadows; if (UpdateBiomeBonusTrophies(name, ref biome)) { MessageHud.instance.ShowBiomeFoundMsg("Biome Bonus", true); UpdateModUI(Player.m_localPlayer); Debug.LogError((object)("BIOME BONUS: Bonus" + biome)); ((Character)__instance).Message((MessageType)1, "Biome Bonus: " + biome, 0, (Sprite)null); FlashBiomeTrophies(name); text = "Bonus" + biome; } } if ((IsSagaMode() || GetGameMode() == TrophyGameMode.TrophyRush || GetGameMode() == TrophyGameMode.TrophyBlitz || GetGameMode() == TrophyGameMode.TrophyTrailblazer) && __m_trophyCache.Count == __m_trophyHuntData.Length && !__m_completedAllBiomeBonuses) { MessageHud.instance.ShowBiomeFoundMsg("Odin is Pleased", true); if (GetGameMode() == TrophyGameMode.TrophyBlitz || GetGameMode() == TrophyGameMode.TrophyTrailblazer) { CalculateExtraTimeScore(); } __m_completedAllBiomeBonuses = true; UpdateModUI(Player.m_localPlayer); string text2 = "BonusAll"; if (GetGameMode() == TrophyGameMode.TrophyBlitz || GetGameMode() == TrophyGameMode.TrophyTrailblazer) { text2 = text2 + "|BonusTime:" + __m_extraTimeScore; } text = ((text != null) ? (text + "|" + text2) : text2); } AddPlayerEvent(PlayerEventType.Trophy, name, ((Component)__instance).transform.position, text); AddTrophyPin(((Component)__instance).transform.position, name); } } [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) { //IL_004f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Player.m_localPlayer == (Object)null) { return; } float totalOnFootDistance = GetTotalOnFootDistance(__instance); __m_pendingDeathRegistration = false; if (__m_logoutCount < 1 && totalOnFootDistance < 50f) { return; } if (!__m_ignoreLogouts) { __m_logoutCount++; AddPlayerEvent(PlayerEventType.Misc, "PenaltyLogout", ((Component)Player.m_localPlayer).transform.position); if ((Object)(object)Game.instance != (Object)null) { Game.instance.SavePlayerProfile(GetGameMode() != TrophyGameMode.TrophyHunt); } } StopPeriodicTimer(); if (IsPacifist()) { StopCharmTimer(); RestoreArrowsAndRecipes(ObjectDB.instance); } } } 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 = ""; m_colorString = "white"; m_percent = percent; m_luckString = luckString; m_colorString = colorStr; } } public struct SpecialSagaDrop { public string m_itemName; public float m_dropPercent; public int m_dropAmountMin; public int m_dropAmountMax; public bool m_dropOnlyOne; public bool m_stopDroppingOnPickup; public TrophyGameMode m_onlyInMode; public int m_numDropped; public int m_numPickedUp; public SpecialSagaDrop(string itemName, float dropPercent, int dropAmountMin, int dropAmountMax, bool dropOnlyOne = false, bool stopDroppingOnPickup = false, TrophyGameMode onlyInMode = TrophyGameMode.Max) { m_itemName = itemName; m_dropPercent = dropPercent; m_dropAmountMin = dropAmountMin; m_dropAmountMax = dropAmountMax; m_dropOnlyOne = dropOnlyOne; m_stopDroppingOnPickup = stopDroppingOnPickup; m_numDropped = 0; m_numPickedUp = 0; m_onlyInMode = onlyInMode; } } [HarmonyPatch(typeof(CharacterDrop), "GenerateDropList")] private class CharacterDrop_GenerateDropList_Patch { private static void Postfix(CharacterDrop __instance, ref List> __result) { if (!((Object)(object)__instance != (Object)null)) { return; } string name = ((Component)__instance).GetComponent().m_name; if (CharacterCanDropTrophies(name)) { RecordTrophyCapableKill(name, killedByPlayer: false); bool flag = false; if (__result != null) { foreach (KeyValuePair item3 in __result) { string name2 = ((Object)item3.Key).name; if (name2.Contains("Trophy")) { RecordDroppedTrophy(name, name2); flag = true; break; } } } else { Debug.Log((object)("Trophy-capable character " + name + " had null drop list")); } if (!flag) { float num = 0f; if (GetGameMode() == TrophyGameMode.TrophyRush || GetGameMode() == TrophyGameMode.TrophyBlitz || GetGameMode() == TrophyGameMode.TrophyTrailblazer || GetGameMode() == TrophyGameMode.TrophyPacifist || (IsSagaMode() && GetGameMode() != TrophyGameMode.CasualSaga)) { string text = EnemyNameToTrophyName(name); if (!__m_trophyCache.Contains(text) || text == "TrophyDeer") { num = 100f; } } if ((float)new Random().NextDouble() * 100f < num) { string trophyName = EnemyNameToTrophyName(name); Drop val = __instance.m_drops.Find((Drop theDrop) => ((Object)theDrop.m_prefab).name == trophyName); if (val != null) { KeyValuePair item = new KeyValuePair(val.m_prefab, 1); if (__result == null) { __result = new List>(); } __result.Add(item); RecordDroppedTrophy(name, trophyName); } } } } if (!IsSagaMode() || !__m_specialSagaDrops.ContainsKey(name)) { return; } List list = __m_specialSagaDrops[name]; Random random = new Random(Guid.NewGuid().GetHashCode()); for (int i = 0; i < list.Count; i++) { SpecialSagaDrop value = list[i]; if (value.m_onlyInMode != TrophyGameMode.Max && GetGameMode() != value.m_onlyInMode) { continue; } bool flag2 = false; if (value.m_dropOnlyOne) { flag2 = HasAnyoneDropped(value.m_itemName); } if (value.m_stopDroppingOnPickup) { flag2 = HasBeenPickedUp(value.m_itemName); } if (flag2 || !((float)random.NextDouble() * 100f < value.m_dropPercent)) { continue; } GameObject itemPrefab = ObjectDB.instance.GetItemPrefab(value.m_itemName); if ((Object)(object)itemPrefab != (Object)null) { int num2 = random.Next(value.m_dropAmountMin, value.m_dropAmountMax); KeyValuePair item2 = new KeyValuePair(itemPrefab, num2); if (__result != null) { __result.Add(item2); value.m_numDropped += num2; list[i] = value; } } } } } [HarmonyPatch(typeof(Character), "OnDeath")] public class Character_OnDeath_Patch { private static bool Prefix(Character __instance) { if (IsPacifist() && IsCharmed(__instance)) { if ((Object)(object)Player.m_localPlayer != (Object)null) { ((Character)Player.m_localPlayer).Message((MessageType)2, "Your thrall " + __instance.m_name + " has fallen!", 0, (Sprite)null); } RemoveFromCharmedList(__instance); } return true; } private static void Postfix(Character __instance) { if (GetGameMode() == TrophyGameMode.CulinarySaga) { return; } 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) { string name = __instance.m_name; if (CharacterCanDropTrophies(name)) { RecordTrophyCapableKill(name, killedByPlayer: true); } } if (GetGameMode() == TrophyGameMode.TrophyBlitz || GetGameMode() == TrophyGameMode.TrophyTrailblazer) { RevealNextBoss(__instance.m_name); } } } [HarmonyPatch(typeof(ItemData), "GetWeight")] public class Humanoid_ItemDrop_ItemData_GetWeight_Patch { private static bool Prefix(ItemData __instance, ref float __result) { if (!IsSagaMode() && !__m_instaSmelt) { return true; } if (__instance == null) { return true; } if ((Object)(object)__instance.m_dropPrefab == (Object)null) { return true; } if (__m_oreNameToBarPrefabName.TryGetValue(((Object)__instance.m_dropPrefab).name, out var value)) { ItemData itemData = ZNetScene.instance.GetPrefab(value).GetComponent().m_itemData; if (itemData != null) { __result = itemData.m_shared.m_weight * (float)__instance.m_stack; } return false; } return true; } } [HarmonyPatch(typeof(ItemData), "GetNonStackedWeight")] public class Humanoid_ItemDrop_ItemData_GetNonStackedWeight_Patch { private static bool Prefix(ItemData __instance, ref float __result) { if (!IsSagaMode() && !__m_instaSmelt) { return true; } if (__instance == null) { return true; } if ((Object)(object)__instance.m_dropPrefab == (Object)null) { return true; } if (__m_oreNameToBarPrefabName.TryGetValue(((Object)__instance.m_dropPrefab).name, out var value)) { ItemData itemData = ZNetScene.instance.GetPrefab(value).GetComponent().m_itemData; if (itemData != null) { __result = itemData.m_shared.m_weight; } return false; } return true; } } [HarmonyPatch(typeof(Inventory), "AddItem", new Type[] { typeof(ItemData) })] public static class Inventory_AddItem_Patch { private static void Prefix(Inventory __instance, ref ItemData item, bool __result) { if ((IsSagaMode() || __m_instaSmelt) && __instance != null && (Object)(object)Player.m_localPlayer != (Object)null && __instance == ((Humanoid)Player.m_localPlayer).GetInventory()) { ConvertMetalOresIfNecessary(ref item); } } } [HarmonyPatch(typeof(Inventory), "AddItem", new Type[] { typeof(ItemData), typeof(int), typeof(int), typeof(int) })] public class Inventory_AddItem_4_Patch { private static void Postfix(Inventory __instance, ItemData item, int amount, int x, int y, bool __result) { if (__instance != null && (Object)(object)Player.m_localPlayer != (Object)null && __instance == ((Humanoid)Player.m_localPlayer).GetInventory() && item != null && (Object)(object)item.m_dropPrefab != (Object)null) { string name = ((Object)item.m_dropPrefab).name; if (item.m_quality > 1) { name += item.m_quality; } } } private static bool Prefix(Inventory __instance, ItemData item, int amount, int x, int y, ref bool __result) { //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) if (!IsSagaMode() && !__m_instaSmelt) { return true; } if ((Object)(object)Player.m_localPlayer == (Object)null) { return true; } if (__instance != ((Humanoid)Player.m_localPlayer).GetInventory()) { return true; } amount = Mathf.Min(amount, item.m_stack); if (x < 0 || y < 0 || x >= __instance.m_width || y >= __instance.m_height) { __result = false; return false; } bool flag = false; ItemData itemAt = __instance.GetItemAt(x, y); if (itemAt != null) { if (itemAt.m_shared.m_name != item.m_shared.m_name || itemAt.m_worldLevel != item.m_worldLevel || (itemAt.m_shared.m_maxQuality > 1 && itemAt.m_quality != item.m_quality)) { __result = false; return false; } int num = itemAt.m_shared.m_maxStackSize - itemAt.m_stack; if (num <= 0) { __result = false; return false; } int num2 = Mathf.Min(num, amount); itemAt.m_stack += num2; item.m_stack -= num2; flag = num2 == amount; ZLog.Log((object)("Added to stack" + itemAt.m_stack + " " + item.m_stack)); } else { ItemData item2 = item.Clone(); ConvertMetalOresIfNecessary(ref item2); item2.m_stack = amount; item2.m_gridPos = new Vector2i(x, y); __instance.m_inventory.Add(item2); item.m_stack -= amount; flag = true; } __instance.Changed(); __result = flag; return false; } } [HarmonyPatch(typeof(Inventory), "AddItem", new Type[] { typeof(string), typeof(int), typeof(int), typeof(int), typeof(long), typeof(string), typeof(Vector2i), typeof(bool) })] public class Inventory_AddItem_2_Patch { private static void Postfix(Inventory __instance, string name, int stack, int quality, int variant, long crafterID, string crafterName, Vector2i position, bool pickedUp) { if (__instance != null) { string text = name; if (quality > 1) { text += quality; } } } } [HarmonyPatch(typeof(Inventory), "CanAddItem", new Type[] { typeof(ItemData), typeof(int) })] public static class Inventory_CanAddItem_Patch { private static bool Prefix(Inventory __instance, ref ItemData item, int stack, ref bool __result) { if (__instance != null && (Object)(object)Player.m_localPlayer != (Object)null && __instance == ((Humanoid)Player.m_localPlayer).GetInventory() && (IsSagaMode() || __m_instaSmelt) && item != null && (Object)(object)item.m_dropPrefab != (Object)null) { string name = ((Object)item.m_dropPrefab).name; if (__m_oreNameToBarItemName.TryGetValue(name, out var value)) { if (stack <= 0) { stack = item.m_stack; } __result = __instance.FindFreeStackSpace(value, 0f) + (__instance.m_width * __instance.m_height - __instance.m_inventory.Count) * item.m_shared.m_maxStackSize >= stack; return false; } } return true; } } [HarmonyPatch(typeof(Humanoid), "Pickup")] public class Humanoid_Pickup_Patch { private static void Prefix(Humanoid __instance, GameObject go, bool autoequip, bool autoPickupDelay, bool __result) { //IL_0196: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)__instance == (Object)null || (Object)(object)__instance != (Object)(object)Player.m_localPlayer) { return; } ItemDrop component = go.GetComponent(); if (!((Object)(object)component != (Object)null) || (!IsSagaMode() && !__m_instaSmelt)) { return; } ConvertMetal(ref component.m_itemData); if (GetGameMode() != TrophyGameMode.TrophyFarmer) { if (component.m_itemData == null || !((Object)(object)component.m_itemData.m_dropPrefab != (Object)null)) { return; } string name = ((Object)component.m_itemData.m_dropPrefab).name; { foreach (KeyValuePair> _m_specialSagaDrop in __m_specialSagaDrops) { string key = _m_specialSagaDrop.Key; List list = __m_specialSagaDrops[key]; for (int i = 0; i < list.Count; i++) { SpecialSagaDrop value = list[i]; if (value.m_itemName == name && value.m_stopDroppingOnPickup) { value.m_numPickedUp++; } list[i] = value; } foreach (SpecialSagaDrop item in __m_specialSagaDrops[key]) { if (item.m_itemName == name) { _ = item.m_stopDroppingOnPickup; } } } return; } } if (GetGameMode() != TrophyGameMode.TrophyFarmer) { return; } Debug.LogError((object)$"Picked up GO {((Object)go).name} itemDrop {((Object)component).name} itemDropZDO UID {component.m_nview.m_zdo.m_uid}"); if (component.m_itemData.m_customData.ContainsKey("Farmed")) { return; } object obj; if (component == null) { obj = null; } else { ItemData itemData = component.m_itemData; if (itemData == null) { obj = null; } else { GameObject dropPrefab = itemData.m_dropPrefab; obj = ((dropPrefab != null) ? ((Object)dropPrefab).name : null); } } string itemName = (string)obj; if (!Array.Exists(__m_trophyHuntData, (TrophyHuntData element) => element.m_name == itemName)) { return; } TrophyHuntData trophyHuntData = Array.Find(__m_trophyHuntData, (TrophyHuntData element) => element.m_name == itemName); __m_farmerTrophyCounts[itemName] += 1; if (Object.op_Implicit((Object)(object)MessageHud.instance) && __m_farmerTrophyCounts[itemName] > 1) { Sprite trophySprite = GetTrophySprite(itemName); if ((Object)(object)trophySprite != (Object)null) { MessageHud.instance.QueueUnlockMsg(trophySprite, "Farmer Get!", trophyHuntData.m_prettyName + " Trophy #" + __m_farmerTrophyCounts[itemName]); FlashTrophy(itemName); } } UpdateModUI(Player.m_localPlayer); component.m_itemData.m_customData.Add("Farmed", "true"); } private static void Postfix(Humanoid __instance, GameObject go, bool autoequip, bool autoPickupDelay, bool __result) { if (!((Object)(object)__instance == (Object)null) && !((Object)(object)go == (Object)null) && GetGameMode() != TrophyGameMode.CulinarySaga) { ItemData itemData = go.GetComponent().m_itemData; if (__result && itemData != null && (Object)(object)itemData.m_dropPrefab != (Object)null) { RecordPlayerPickedUpTrophy(((Object)itemData.m_dropPrefab).name); } } } } [HarmonyPatch(typeof(Player), "PlacePiece")] public class PlacePiecePatch { private static bool Prefix(Player __instance, Piece piece) { if ((Object)(object)__instance == (Object)null || (Object)(object)piece == (Object)null) { return true; } if (GetGameMode() == TrophyGameMode.TrophyBlitz && piece.m_name.ToLower().Contains("bed")) { ((Character)__instance).Message((MessageType)2, "Beds are not allowed in Trophy Blitz!", 0, (Sprite)null); return false; } return true; } private static void Postfix(Player __instance, Piece piece) { if (!((Object)(object)__instance == (Object)null)) { _ = (Object)(object)piece != (Object)null; } } } public class BossDetails { public string m_bossCharacterId; public string m_bossLocationName; public string m_bossName; public BossDetails(string bossCharacterId, string bossLocationName, string bossName) { m_bossCharacterId = bossCharacterId; m_bossLocationName = bossLocationName; m_bossName = bossName; } } [HarmonyPatch(typeof(Player), "HaveRequirements", new Type[] { typeof(Recipe), typeof(bool), typeof(int), typeof(int) })] public static class Player_HaveRequirements_Patch { private static bool Prefix(Player __instance, Recipe recipe, bool discover, int qualityLevel, int amount, ref bool __result) { if (GetGameMode() == TrophyGameMode.TrophyBlitz) { __result = true; return false; } return true; } } [HarmonyPatch(typeof(InventoryGui), "CanRepair", new Type[] { typeof(ItemData) })] public static class InventoryGui_CanRepair_Patch { private static bool Prefix(InventoryGui __instance, ItemData item, ref bool __result) { if (GetGameMode() == TrophyGameMode.TrophyBlitz) { CraftingStation currentCraftingStation = Player.m_localPlayer.GetCurrentCraftingStation(); if ((Object)(object)currentCraftingStation == (Object)null) { return true; } Recipe recipe = ObjectDB.instance.GetRecipe(item); if (((Object)(object)recipe.m_repairStation != (Object)null && recipe.m_repairStation.m_name == currentCraftingStation.m_name) || ((Object)(object)recipe.m_craftingStation != (Object)null && recipe.m_craftingStation.m_name == currentCraftingStation.m_name) || item.m_worldLevel < Game.m_worldLevel) { __result = true; return false; } } return true; } } [HarmonyPatch(typeof(ItemDrop), "SetQuality", new Type[] { typeof(int) })] public static class ItemDrop_SetQuality_Patch { private static void Postfix(ItemDrop __instance, int quality) { //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: 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_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Expected I4, but got Unknown if (GetGameMode() == TrophyGameMode.TrophyBlitz) { bool flag = false; ItemType itemType = __instance.m_itemData.m_shared.m_itemType; switch (itemType - 1) { case 0: case 1: case 8: case 9: case 12: case 14: case 15: case 17: case 19: case 20: case 22: case 23: flag = false; break; case 2: case 3: case 4: case 5: case 6: case 10: case 11: case 13: case 16: case 18: case 21: flag = true; break; } if (flag) { __instance.m_itemData.m_quality = __instance.m_itemData.m_shared.m_maxQuality; } } } } [HarmonyPatch(typeof(SE_Cozy), "Setup", new Type[] { typeof(Character) })] public static class SE_Cozy_Setup_Patch { private static void Postfix(SE_Cozy __instance, Character character) { if (GetGameMode() == TrophyGameMode.TrophyTrailblazer && (Object)(object)__instance != (Object)null) { __instance.m_delay = 9f; } } } [HarmonyPatch(typeof(SE_Puke), "Setup", new Type[] { typeof(Character) })] public static class SE_Puke_Setup_Patch { private static void Postfix(SE_Puke __instance, Character character) { if (GetGameMode() == TrophyGameMode.TrophyTrailblazer && (Object)(object)__instance != (Object)null && (Object)(object)character != (Object)null) { int stableHashCode = StringExtensionMethods.GetStableHashCode("Rested"); character.GetSEMan().AddStatusEffect(stableHashCode, true, 0, 0f); } } } [HarmonyPatch(typeof(Piece), "FreeBuildKey")] public static class Piece_FreeBuildKey_Patch { private static bool Prefix(ref GlobalKeys __result) { if (GetGameMode() == TrophyGameMode.TrophyTrailblazer && __m_overrideGlobalKeysForPieceDrops) { __result = (GlobalKeys)27; return false; } return true; } } public enum PlayerEventType { None, Trophy, Build, Item, Misc, Max } [Serializable] public class PlayerEventLog { public PlayerEventType eventType; public string eventName = ""; public Vector3 eventPos = Vector3.zero; public DateTime eventTime = DateTime.MinValue; public PlayerEventLog() { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) eventType = PlayerEventType.None; eventName = ""; eventPos = Vector3.zero; eventTime = DateTime.MinValue; } public PlayerEventLog(PlayerEventType _eventType, string _eventName, Vector3 _eventPos, DateTime _eventTime) { //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) eventType = _eventType; eventName = _eventName; eventPos = _eventPos; eventTime = _eventTime; } } public struct EventDescription { public PlayerEventType eventType; public List legalEvents; public EventDescription(PlayerEventType _eventType, List _legalEvents) { eventType = _eventType; legalEvents = _legalEvents; } } [Serializable] public class TrackLogEntry { public string id; public string seed; public int score; public string code; } public enum TournamentStatus { NotRunning = 0, Live = 20, Over = 30 } public class TournamentPlayerInfo { public string name; public int score; public string id; public TournamentPlayerInfo(string _name, int _score, string _id) { name = _name; score = _score; id = _id; } } [Serializable] public class TrackStandingsPlayer { public string name = ""; public string id = ""; public string avatarUrl = ""; public int score; } [Serializable] public class TrackStandings { public string name = ""; public string mode = ""; public string startAt = ""; public string endAt = ""; public int status; public bool mapLoaded = true; public List players = new List(); } [HarmonyPatch(typeof(FejdStartup), "Start")] public class FejdStartup_Start_Patch { private static void Postfix() { //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_008c: 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_00b6: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_016a: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_0191: 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_01b0: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) GameObject val = GameObject.Find("Menu"); if ((Object)(object)val != (Object)null) { GameObject obj = GameObject.Find("Topic"); __m_globalFontObject = ((TMP_Text)((obj != null) ? obj.GetComponent() : null)).font; Transform val2 = val.transform.Find("Logo"); if ((Object)(object)val2 != (Object)null) { GameObject val3 = new GameObject("TrophyHuntModLogoText"); val3.transform.SetParent(val2.parent); RectTransform obj2 = val3.AddComponent(); ((Transform)obj2).localScale = Vector3.one; obj2.anchorMin = new Vector2(0.5f, 0.6f); obj2.anchorMax = new Vector2(1f, 0.6f); obj2.pivot = new Vector2(1f, 1f); obj2.anchoredPosition = new Vector2(-20f, 20f); obj2.sizeDelta = new Vector2(-650f, 185f); __m_trophyHuntMainMenuText = AddTextMeshProComponent(val3); ((TMP_Text)__m_trophyHuntMainMenuText).font = __m_globalFontObject; ((TMP_Text)__m_trophyHuntMainMenuText).fontMaterial = ((TMP_Asset)__m_globalFontObject).material; ((TMP_Text)__m_trophyHuntMainMenuText).fontStyle = (FontStyles)1; ((TMP_Text)__m_trophyHuntMainMenuText).text = GetTrophyHuntMainMenuText(); ((TMP_Text)__m_trophyHuntMainMenuText).alignment = (TextAlignmentOptions)513; ((TMP_Text)__m_trophyHuntMainMenuText).lineSpacingAdjustment = -5f; AddToggleGameModeButton(val3.transform); AddTogglePacifistButton(val3.transform); GameObject val4 = new GameObject("AvatarObject"); val4.transform.SetParent(val3.transform); RectTransform obj3 = val4.AddComponent(); obj3.sizeDelta = new Vector2(320f, 78f); obj3.anchoredPosition = new Vector2(30f, -335f); ((Transform)obj3).localScale = Vector3.one; __m_discordBackgroundImage = val4.AddComponent(); ((Graphic)__m_discordBackgroundImage).raycastTarget = false; ((Graphic)__m_discordBackgroundImage).color = Color.black; ((Graphic)__m_discordBackgroundImage).CrossFadeAlpha(1f, 20f, false); AddLoginWithDiscordButton(val3.transform); } else { Debug.LogWarning((object)"Valheim logo not found!"); } } else { Debug.LogWarning((object)"Main menu not found!"); } } } [HarmonyPatch(typeof(FejdStartup), "OnNewWorldDone", new Type[] { typeof(bool) })] public class FejdStartup_OnNewWorldDone_Patch { private static void Postfix(FejdStartup __instance, bool forceLocal) { if (FejdStartup.m_instance.m_world != null) { if (GetGameMode() == TrophyGameMode.TrophyRush) { FejdStartup.m_instance.m_world.m_startingGlobalKeys.Clear(); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("playerdamage 70"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("enemydamage 200"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("enemyspeedsize 120"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("enemyleveluprate 140"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("resourcerate 200"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("preset combat_veryhard:deathpenalty_default: resources_muchmore: raids_default: portals_default"); FejdStartup.m_instance.m_world.SaveWorldMetaData(DateTime.Now); __instance.UpdateWorldList(true); } else if (IsSagaMode()) { FejdStartup.m_instance.m_world.m_startingGlobalKeys.Clear(); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("resourcerate 200"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("eventrate 0"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("teleportall"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("preset combat_default:deathpenalty_default:resources_muchmore:raids_none:portals_casual"); FejdStartup.m_instance.m_world.SaveWorldMetaData(DateTime.Now); __instance.UpdateWorldList(true); } else if (GetGameMode() == TrophyGameMode.TrophyFiesta) { FejdStartup.m_instance.m_world.m_startingGlobalKeys.Clear(); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("enemyspeedsize 200"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("enemyleveluprate 300"); FejdStartup.m_instance.m_world.SaveWorldMetaData(DateTime.Now); __instance.UpdateWorldList(true); } else if (GetGameMode() == TrophyGameMode.TrophyBlitz) { FejdStartup.m_instance.m_world.m_startingGlobalKeys.Clear(); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("deathkeepequip"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("skillreductionrate 15"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("resourcerate 200"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("eventrate 0"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("teleportall"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("nobuildcost"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("preset combat_default:deathpenalty_casual: resources_muchmore: raids_none: portals_casual"); FejdStartup.m_instance.m_world.SaveWorldMetaData(DateTime.Now); __instance.UpdateWorldList(true); } else if (GetGameMode() == TrophyGameMode.TrophyTrailblazer) { FejdStartup.m_instance.m_world.m_startingGlobalKeys.Clear(); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("deathkeepequip"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("skillreductionrate 15"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("resourcerate 200"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("eventrate 0"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("teleportall"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("nobuildcost"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("preset combat_default:deathpenalty_casual: resources_muchmore: raids_none: portals_casual"); FejdStartup.m_instance.m_world.SaveWorldMetaData(DateTime.Now); __instance.UpdateWorldList(true); } else if (GetGameMode() == TrophyGameMode.TrophyFarmer) { FejdStartup.m_instance.m_world.m_startingGlobalKeys.Clear(); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("resourcerate 200"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("preset combat_default:deathpenalty_casual: resources_muchmore: raids_none: portals_casual"); FejdStartup.m_instance.m_world.SaveWorldMetaData(DateTime.Now); __instance.UpdateWorldList(true); } else if (GetGameMode() == TrophyGameMode.TrophyPacifist) { FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("resourcerate 200"); FejdStartup.m_instance.m_world.m_startingGlobalKeys.Add("preset combat_default:deathpenalty_default:resources_muchmore:raids_default:portals_default"); FejdStartup.m_instance.m_world.SaveWorldMetaData(DateTime.Now); __instance.UpdateWorldList(true); } } } } [HarmonyPatch(typeof(ConsoleCommand), "RunAction", new Type[] { typeof(ConsoleEventArgs) })] public static class ConsoleCommand_RunAction_Patch { private static void Postfix(ConsoleEventArgs args) { //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Player.m_localPlayer != (Object)null) { if (args.Length > 0 && args[0] == "die") { __m_slashDieCount++; AddPlayerEvent(PlayerEventType.Misc, "PenaltySlashDie", ((Component)Player.m_localPlayer).transform.position); } if (args.Length > 0 && args[0] == "devcommands") { Debug.LogError((object)"INVALID FOR TOURNAMENT PLAY!: devcommands USED"); __m_invalidForTournamentPlay = true; SetScoreTextElementColor(Color.green); UpdateModUI(Player.m_localPlayer); } if (Game.instance.GetPlayerProfile().m_usedCheats || Game.instance.GetPlayerProfile().m_playerStats[(PlayerStatType)4] > 0f) { Debug.LogError((object)"INVALID FOR TOURNAMENT PLAY!: cheats USED"); __m_invalidForTournamentPlay = true; SetScoreTextElementColor(Color.green); UpdateModUI(Player.m_localPlayer); } } } } [HarmonyPatch(typeof(Player), "OnDeath")] public static class Patch_Player_OnDeath { private static void Prefix(Player __instance) { //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) if (!((Object)(object)__instance == (Object)null)) { __m_pendingDeathPosition = ((Component)__instance).transform.position; __m_pendingDeathRegistration = true; } } } [HarmonyPatch(typeof(Ship), "GetSailForce")] public class Ship_GetSailForce_Patch { private static void Postfix(ref Vector3 __result) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0028: 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_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0051: 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_0066: 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_0075: Unknown result type (might be due to invalid IL or missing references) if (IsSagaMode()) { __result *= __m_sagaSailingSpeedMultiplier; } else if (GetGameMode() == TrophyGameMode.TrophyBlitz) { __result *= __m_blitzSailingSpeedMultiplier; } else if (GetGameMode() == TrophyGameMode.TrophyTrailblazer) { __result *= __m_trailblazerSailingSpeedMultiplier; } else if (GetGameMode() == TrophyGameMode.TrophyFarmer) { __result *= __m_farmerSailingSpeedMultiplier; } } } [HarmonyPatch(typeof(Ship), "Awake")] public class Ship_Awake_Patch { private static void Postfix(Ship __instance) { if (IsSagaMode()) { __instance.m_backwardForce *= __m_sagaPaddlingSpeedMultiplier; } else if (GetGameMode() == TrophyGameMode.TrophyBlitz) { __instance.m_backwardForce *= __m_blitzPaddlingSpeedMultiplier; } else if (GetGameMode() == TrophyGameMode.TrophyTrailblazer) { __instance.m_backwardForce *= __m_trailblazerPaddlingSpeedMultiplier; } else if (GetGameMode() == TrophyGameMode.TrophyFarmer) { __instance.m_backwardForce *= __m_farmerPaddlingSpeedMultiplier; } } } [HarmonyPatch(typeof(TreeBase), "Damage")] public static class TreeBase_Damage_Patch { private static void Prefix(TreeBase __instance, ref HitData hit) { if (__m_elderPowerCutsAllTrees) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null && localPlayer.GetGuardianPowerName() == "GP_TheElder" && localPlayer.m_guardianPowerCooldown > 0f) { hit.m_toolTier = (short)__instance.m_minToolTier; } } } } [HarmonyPatch(typeof(TreeLog), "Damage")] public static class TreeLog_Damage_Patch { private static void Prefix(TreeLog __instance, ref HitData hit) { if (__m_elderPowerCutsAllTrees) { Player localPlayer = Player.m_localPlayer; if ((Object)(object)localPlayer != (Object)null && localPlayer.GetGuardianPowerName() == "GP_TheElder" && localPlayer.m_guardianPowerCooldown > 0f) { hit.m_toolTier = (short)__instance.m_minToolTier; } } } } [HarmonyPatch(typeof(Fermenter), "Awake")] public static class Fermenter_AddItem_Patch { private static void Postfix(Fermenter __instance) { if (((Object)(object)__instance != (Object)null && (IsSagaMode() || GetGameMode() == TrophyGameMode.TrophyBlitz)) || GetGameMode() == TrophyGameMode.TrophyTrailblazer || GetGameMode() == TrophyGameMode.TrophyFarmer) { __instance.m_fermentationDuration = 10f; } } } [HarmonyPatch(typeof(Fermenter), "DelayedTap")] public static class Fermenter_DelayedTap_Patch { private static void Prefix(Fermenter __instance) { if (((Object)(object)__instance != (Object)null && (IsSagaMode() || GetGameMode() == TrophyGameMode.TrophyBlitz)) || GetGameMode() == TrophyGameMode.TrophyTrailblazer || GetGameMode() == TrophyGameMode.TrophyFarmer) { ItemConversion itemConversion = __instance.GetItemConversion(__instance.m_delayedTapItem); if (itemConversion != null) { itemConversion.m_producedItems = 9; } } } } [HarmonyPatch(typeof(Plant), "TimeSincePlanted")] public static class Plant_GetGrowTime_Patch { private static void Postfix(Plant __instance, ref double __result) { if ((Object)(object)__instance != (Object)null) { if (IsSagaMode()) { __result = (double)__instance.m_growTimeMax + 1.0; } else if (GetGameMode() == TrophyGameMode.TrophyTrailblazer || GetGameMode() == TrophyGameMode.TrophyFarmer) { __result = (double)__instance.m_growTimeMax + 1.0; } } } } [HarmonyPatch(typeof(Smelter), "Awake")] public static class Smelter_Awake_Patch { private static void Postfix(Smelter __instance) { if ((Object)(object)__instance != (Object)null && IsSagaMode()) { if (__instance.m_name.Contains("eitr")) { __instance.m_secPerProduct = 1f; } else if (!__instance.m_name.Contains("bathtub") && !__instance.m_name.Contains("batteringram")) { __instance.m_secPerProduct = 0.03f; } } } } [HarmonyPatch(typeof(Smelter), "OnAddFuel")] public static class Smelter_OnAddFuel_Patch { private static void Postfix(Smelter __instance, Switch sw, Humanoid user, ItemData item, bool __result) { if ((Object)(object)__instance != (Object)null && IsSagaMode() && __instance.m_name.Contains("eitr") && __instance.GetQueueSize() < __instance.m_maxOre) { __instance.m_nview.InvokeRPC("RPC_AddOre", new object[1] { "Softtissue" }); } } } [HarmonyPatch(typeof(SapCollector), "Awake")] public static class SapCollector_Awake_Patch { private static void Postfix(SapCollector __instance) { if ((Object)(object)__instance != (Object)null && IsSagaMode()) { __instance.m_secPerUnit = 0.1f; } } } [HarmonyPatch(typeof(Beehive), "Awake")] public static class Beehive_Awake_Patch { private static void Postfix(Beehive __instance) { if ((Object)(object)__instance != (Object)null && IsSagaMode()) { __instance.m_secPerUnit = 5f; __instance.m_maxHoney = 4; } } } [HarmonyPatch(typeof(MineRock5), "Awake")] public static class MineRock5_Awake_Patch { private static void Postfix(MineRock5 __instance) { if ((Object)(object)__instance != (Object)null && IsSagaMode()) { DropTable dropItems = __instance.m_dropItems; dropItems.m_dropMin *= 2; DropTable dropItems2 = __instance.m_dropItems; dropItems2.m_dropMax *= 3; } } } [HarmonyPatch(typeof(LoadingIndicator), "Awake")] public static class LoadingIndicator_Awake_Patch { private static void Postfix(LoadingIndicator __instance) { //IL_0061: 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_00a3: 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_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)__instance != (Object)null)) { return; } foreach (AssetBundle allLoadedAssetBundle in AssetBundle.GetAllLoadedAssetBundles()) { string text = "Assets/UI/textures/small/trophies.png"; if (allLoadedAssetBundle.Contains(text)) { Object obj = allLoadedAssetBundle.LoadAsset(text); Texture2D val = (Texture2D)(object)((obj is Texture2D) ? obj : null); if (val != null) { Sprite val2 = Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)); __instance.m_spinner.sprite = val2; ((Graphic)__instance.m_spinner).color = new Color(1f, 43f / 51f, 0f, 1f); __instance.m_spinnerOriginalColor = ((Graphic)__instance.m_spinner).color; __m_trophySprite = val2; } break; } text = "Assets/UI/textures/small/health.png"; if (allLoadedAssetBundle.Contains(text)) { Debug.LogError((object)"Found Health Sprite"); Object obj2 = allLoadedAssetBundle.LoadAsset(text); Texture2D val3 = (Texture2D)(object)((obj2 is Texture2D) ? obj2 : null); if (val3 != null) { __m_healthSprite = Sprite.Create(val3, new Rect(0f, 0f, (float)((Texture)val3).width, (float)((Texture)val3).height), new Vector2(0.5f, 0.5f)); } break; } } } } [HarmonyPatch(typeof(EggGrow), "Start")] public static class EggGrow_Start_Patch { private static void Postfix(EggGrow __instance) { if ((Object)(object)__instance != (Object)null && IsSagaMode()) { __instance.m_growTime = 2f; } } } [HarmonyPatch(typeof(Growup), "Start")] public static class Growup_Start_Patch { private static void Postfix(Growup __instance) { if ((Object)(object)__instance != (Object)null && IsSagaMode()) { __instance.m_growTime = 1f; } } } [HarmonyPatch(typeof(Procreation), "Awake")] public static class Procreation_Awake_Patch { private static void Postfix(Procreation __instance) { if ((Object)(object)__instance != (Object)null && IsSagaMode() && ((Object)__instance).name.Contains("Hen")) { __instance.m_pregnancyDuration = 0.1f; __instance.m_pregnancyChance = 0f; __instance.m_updateInterval = 1f; } } } public class ConsumableData { public string m_prefabName; public string m_itemName; public string m_displayName; public Biome m_biome; public int m_points; public float m_health; public float m_stamina; public float m_eitr; public float m_regen; public ConsumableData(string prefab, string item, string display, Biome biome, int points, float health, float stamina, float eitr, float regen) { m_prefabName = prefab; m_itemName = item; m_displayName = display; m_biome = biome; m_points = points; m_health = health; m_stamina = stamina; m_eitr = eitr; m_regen = regen; } } [HarmonyPatch(typeof(Player), "PlacePiece", new Type[] { typeof(Piece), typeof(Vector3), typeof(Quaternion), typeof(bool) })] public static class Player_PlacePiece_Patch { public static void Postfix(Player __instance, Piece piece, Vector3 pos, Quaternion rot, bool doAttack) { //IL_003e: Unknown result type (might be due to invalid IL or missing references) if ((GetGameMode() == TrophyGameMode.TrophyBlitz || GetGameMode() == TrophyGameMode.TrophyTrailblazer) && (Object)(object)piece != (Object)null && (((Object)piece).name == "portal_wood" || ((Object)piece).name == "portal_stone")) { AddPortalPin(pos); } } } [HarmonyPatch(typeof(Piece), "DropResources")] public static class Piece_DropResources_Patch { public static bool Prefix(Piece __instance, HitData hitData) { if (GetGameMode() == TrophyGameMode.TrophyTrailblazer && !__instance.IsPlacedByPlayer()) { __m_overrideGlobalKeysForPieceDrops = true; } return true; } public static void Postfix(Piece __instance) { //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) //IL_0039: Unknown result type (might be due to invalid IL or missing references) if (GetGameMode() == TrophyGameMode.TrophyBlitz || GetGameMode() == TrophyGameMode.TrophyTrailblazer) { if (GetGameMode() == TrophyGameMode.TrophyTrailblazer) { __m_overrideGlobalKeysForPieceDrops = false; } Vector3 position = ((Component)__instance).transform.position; if ((Object)(object)((Component)__instance).GetComponent() != (Object)null) { RemovePortalPin(position); } } } } [HarmonyPatch(typeof(TeleportWorld), "Teleport")] public static class TeleportWorld_Teleport_Patch { public static void Prefix(TeleportWorld __instance, Player player) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)player != (Object)(object)Player.m_localPlayer) && CanPostToTracker()) { string text = __instance.GetText(); string eventName = (string.IsNullOrWhiteSpace(text) ? "Portal" : ("Portal:" + text)); AddPlayerEvent(PlayerEventType.Misc, eventName, ((Component)player).transform.position); } } } [HarmonyPatch(typeof(TeleportWorld), "SetText")] public static class TeleportWorld_SetText_Patch { public static void Postfix(TeleportWorld __instance, string text) { //IL_0020: Unknown result type (might be due to invalid IL or missing references) if ((GetGameMode() == TrophyGameMode.TrophyBlitz || GetGameMode() == TrophyGameMode.TrophyTrailblazer) && (Object)(object)__instance != (Object)null) { RenamePortalPin(((Component)__instance).transform.position, text); } } } [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static ConsoleEventFailable <>9__113_0; public static ConsoleEvent <>9__113_1; public static ConsoleEvent <>9__113_2; public static ConsoleEvent <>9__113_3; public static ConsoleEvent <>9__113_4; public static ConsoleEvent <>9__113_5; public static ConsoleEvent <>9__113_6; public static ConsoleEvent <>9__113_7; public static ConsoleEvent <>9__113_8; public static ConsoleEvent <>9__113_9; public static ConsoleEvent <>9__113_10; public static ConsoleEvent <>9__113_11; public static ConsoleEvent <>9__113_12; public static ConsoleEvent <>9__113_13; public static ConsoleEvent <>9__113_14; public static ConsoleEvent <>9__113_15; public static ConsoleEvent <>9__113_16; public static ConsoleEvent <>9__113_17; public static UnityAction <>9__358_1; public static UnityAction <>9__368_1; public static UnityAction <>9__382_1; public static Comparison <>9__383_0; public static UnityAction <>9__394_1; public static Action <>9__428_0; internal object b__113_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]"); PrintToConsole("Trophies:"); int num = CalculateTrophyPoints(displayToLog: true); PrintToConsole($"Trophy Score Total: {num}"); int num2 = CalculateDeathPenalty(); int num3 = CalculateLogoutPenalty(); PrintToConsole("Penalties:"); PrintToConsole($" Deaths: {__m_deaths} Score: {num2}"); PrintToConsole($" Logouts: {__m_logoutCount} Score: {num3}"); int num4 = 0; if (GetGameMode() == TrophyGameMode.TrophyRush) { CalculateBiomeBonusScore(Player.m_localPlayer); PrintToConsole($"Biome Bonus Total: {num4}"); } num += num2; num += num3; num += num4; PrintToConsole($"Total Score: {num}"); if (args.Length > 1) { _ = args[1]; } return true; } internal void b__113_1(ConsoleEventArgs args) { //IL_009c: Unknown result type (might be due to invalid IL or missing references) ObjectDB instance = ObjectDB.instance; if ((Object)(object)instance == (Object)null) { Debug.LogError((object)"ObjectDB is not initialized yet."); return; } foreach (Recipe recipe in instance.m_recipes) { if (!((Object)(object)recipe == (Object)null) && (Object)(object)recipe.m_item != (Object)null) { CraftingStation craftingStation = recipe.m_craftingStation; string text = "n/a"; if (Object.op_Implicit((Object)(object)craftingStation)) { text = ((Object)craftingStation).name; } int minStationLevel = recipe.m_minStationLevel; Debug.LogWarning((object)$"{((Object)recipe).name} {recipe.m_item.m_itemData.m_shared.m_itemType}: {text} {minStationLevel}"); Requirement[] resources = recipe.m_resources; foreach (Requirement val in resources) { Debug.LogWarning((object)$" req: {((Object)val.m_resItem).name} {val.m_amount}"); } } } } internal void b__113_2(ConsoleEventArgs args) { if (!Object.op_Implicit((Object)(object)Game.instance)) { PrintToConsole("'showpath' console command can only be used in-game."); } ShowPlayerPath(showPlayerPath: true); } internal void b__113_3(ConsoleEventArgs args) { if (!Object.op_Implicit((Object)(object)Game.instance)) { PrintToConsole("'showbosses' console command can only be used in-game."); } RevealAllBosses(Player.m_localPlayer); } internal void b__113_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()).color = Color.green; } if ((Object)(object)__m_relogsTextElement != (Object)null && __m_ignoreLogouts) { ((Graphic)__m_relogsTextElement.GetComponent()).color = Color.gray; } } internal void b__113_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("'/showalltrophystats' can only be used in gameplay."); return; } ToggleShowAllTrophyStats(); __m_invalidForTournamentPlay = true; if ((Object)(object)__m_scoreTextElement != (Object)null && __m_showAllTrophyStats) { ((Graphic)__m_scoreTextElement.GetComponent()).color = Color.green; } InitializeSagaDrops(); } internal void b__113_6(ConsoleEventArgs args) { if (!Object.op_Implicit((Object)(object)Game.instance)) { PrintToConsole("'togglescorebackground' console command can only be used in-game."); } __m_scoreBGElement.GetComponent(); __m_scoreBGElement.SetActive(!__m_scoreBGElement.activeSelf); } internal void b__113_7(ConsoleEventArgs args) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) 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_userTextScale = num; } else { __m_userTextScale = 1f; } ((Transform)__m_scoreTextElement.GetComponent()).localScale = new Vector3(__m_userTextScale, __m_userTextScale, __m_userTextScale); } internal void b__113_8(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_userIconScale = num; if (args.Length > 2) { float num2 = float.Parse(args[2]); if (num2 == 0f) { num2 = 1f; } __m_baseTrophyScale = num2; } } else { __m_userIconScale = 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__DisplayClass113_0 CS$<>8__locals0 = new <>c__DisplayClass113_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() != (Object)null) { RectTransform component = val.GetComponent(); if ((Object)(object)component != (Object)null) { ((Transform)component).localScale = new Vector3(__m_baseTrophyScale, __m_baseTrophyScale, __m_baseTrophyScale) * __m_userIconScale; } } } } internal void b__113_9(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; } DeleteTrophyIconElements(__m_iconList); __m_trophyCountList.Clear(); CreateTrophyIconElements(val, __m_trophyHuntData, __m_iconList, __m_trophyCountList); EnableTrophyHuntIcons(localPlayer); } } internal void b__113_10(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); } internal void b__113_11(ConsoleEventArgs args) { if (!Object.op_Implicit((Object)(object)Game.instance)) { PrintToConsole("'/showonlydeaths' console command can only be used during gameplay."); return; } __m_showOnlyDeaths = !__m_showOnlyDeaths; ShowOnlyDeaths(__m_showOnlyDeaths); } internal void b__113_12(ConsoleEventArgs args) { //IL_004a: Unknown result type (might be due to invalid IL or missing references) __m_elderPowerCutsAllTrees = !__m_elderPowerCutsAllTrees; PrintToConsole($"elder power cuts all trees: {__m_elderPowerCutsAllTrees}"); if (__m_elderPowerCutsAllTrees) { __m_invalidForTournamentPlay = true; if ((Object)(object)__m_scoreTextElement != (Object)null) { ((Graphic)__m_scoreTextElement.GetComponent()).color = Color.green; } } } internal void b__113_13(ConsoleEventArgs args) { if (!Object.op_Implicit((Object)(object)Game.instance)) { PrintToConsole("'timer' console command can only be used in-game."); } if ((Object)(object)__m_gameTimerTextElement == (Object)null || args.Length <= 1) { return; } string text = args[1].Trim(); if (text == null) { return; } switch (text.Length) { case 5: switch (text[0]) { case 's': if (text == "start") { TimerStart(); } break; case 'r': if (text == "reset") { TimerReset(); } break; } break; case 4: switch (text[1]) { case 't': if (text == "stop") { TimerStop(); } break; case 'h': if (text == "show") { __m_gameTimerVisible = true; } break; case 'i': if (text == "hide") { __m_gameTimerVisible = false; } break; } break; case 3: if (text == "set") { TimerSet(args[2]); } break; case 6: if (text == "toggle") { TimerToggle(); } break; } } internal void b__113_14(ConsoleEventArgs args) { if (!Object.op_Implicit((Object)(object)Game.instance)) { PrintToConsole("'boatspeedmultiplier' console command can only be used in-game."); } __m_sagaSailingSpeedMultiplier = int.Parse(args[1]); UpdateModUI(Player.m_localPlayer); } internal void b__113_15(ConsoleEventArgs args) { if (!Object.op_Implicit((Object)(object)Game.instance)) { PrintToConsole("'showcharmlist' console command can only be used in-game."); } __m_showCharmList = !__m_showCharmList; } internal void b__113_16(ConsoleEventArgs args) { if (!Object.op_Implicit((Object)(object)Game.instance)) { PrintToConsole("'releasethralls' console command can only be used in-game."); } ReleaseAllThralls(); } internal void b__113_17(ConsoleEventArgs args) { if (!Object.op_Implicit((Object)(object)Game.instance)) { PrintToConsole("'charmLevel' console command can only be used in-game."); } int charmLevel = 0; if (args.Length > 1) { charmLevel = int.Parse(args[1]); } SetCharmLevel(charmLevel); } internal void b__358_1(BaseEventData eventData) { HideScoreTooltip(); } internal void b__368_1(BaseEventData eventData) { HideLuckTooltip(); } internal void b__382_1(BaseEventData eventData) { HideStandingsTooltip(); } internal int b__383_0(TournamentPlayerInfo p1, TournamentPlayerInfo p2) { return p2.score.CompareTo(p1.score); } internal void b__394_1(BaseEventData eventData) { HideTrophyTooltip(); } internal void b__428_0() { //IL_0004: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Expected O, but got Unknown //IL_0023: 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) Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f)); } } [CompilerGenerated] private sealed class <>c__DisplayClass113_0 { public string trophyName; internal bool b__18(GameObject gameObject) { return ((Object)gameObject).name == trophyName; } } public static bool __m_charmTimerStarted = false; private static List __m_allCharmedCharacters = new List(); private const float TROPHY_PACIFIST_CHARM_DURATION = 300f; public const float cFollowDistance = 3f; public const float cRadiusScale = 2f; public const float PACIFIST_THRALL_PLAYER_TARGET_DISTANCE = 50f; public static bool __m_showCharmList = false; public static Color __m_pinkColor = new Color(0.95f, 0.53f, 0.77f); public const int MAX_NUM_THRALLS = 5; public const bool LOG_DAMAGE = false; public static GandrArrowData[] __m_gandrArrowData = new GandrArrowData[12] { new GandrArrowData("ArrowWood", "Wood", "Wooden Gandr", " is under your thrall.", null, GandrTypeIndex.Wood), new GandrArrowData("ArrowFlint", "Flint", "Flint Gandr", " thrall is piercing.", typeof(SE_GandrFlint), GandrTypeIndex.Flint), new GandrArrowData("ArrowFire", "Resin", "Fire Gandr", " thrall channels fire.", typeof(SE_GandrFire), GandrTypeIndex.Fire), new GandrArrowData("ArrowBronze", "Bronze", "Bronze Gandr", " thrall is blunt.", typeof(SE_GandrBronze), GandrTypeIndex.Bronze), new GandrArrowData("ArrowPoison", "Ooze", "Poison Gandr", " thrall channels poison.", typeof(SE_GandrPoison), GandrTypeIndex.Poison), new GandrArrowData("ArrowIron", "Iron", "Iron Gandr", " thrall is sharp.", typeof(SE_GandrIron), GandrTypeIndex.Iron), new GandrArrowData("ArrowFrost", "FreezeGland", "Frost Gandr", " thrall channels frost.", typeof(SE_GandrFrost), GandrTypeIndex.Frost), new GandrArrowData("ArrowObsidian", "Obsidian", "Glass Gandr", " thrall is very sharp.", typeof(SE_GandrObsidian), GandrTypeIndex.Obsidian), new GandrArrowData("ArrowSilver", "Silver", "Silver Gandr", " thrall channels spirit.", typeof(SE_GandrSilver), GandrTypeIndex.Silver), new GandrArrowData("ArrowNeedle", "Needle", "Needle Gandr", " thrall is very piercing.", typeof(SE_GandrNeedle), GandrTypeIndex.Needle), new GandrArrowData("ArrowCarapace", "Carapace", "Bug Gandr", " thrall is very blunt.", typeof(SE_GandrCarapace), GandrTypeIndex.Carapace), new GandrArrowData("ArrowCharred", "Blackwood", "Charred Gandr", " thrall channels lightning.", typeof(SE_GandrCharred), GandrTypeIndex.Charred) }; public static long __m_charmTimerSeconds = 0L; public static Dictionary __m_originalArrows = new Dictionary(); public static Dictionary __m_originalArrowRecipes = new Dictionary(); public const float DEFAULT_THRALL_INCOMING_DAMAGE_SCALAR = 0.7f; public const float DEFAULT_THRALL_OUTGOING_DAMAGE_SCALAR = 1.1f; public static GandrSEData[] __m_gandrSEData = new GandrSEData[11] { new GandrSEData(typeof(SE_GandrFlint), 1.1f, 0.7f, 0.5f, "Flint Gandr"), new GandrSEData(typeof(SE_GandrFire), 1.2f, 0.65f, 0.6f, "Fire Gandr"), new GandrSEData(typeof(SE_GandrBronze), 1.3f, 0.6f, 0.7f, "Bronze Gandr"), new GandrSEData(typeof(SE_GandrPoison), 1.4f, 0.55f, 0.8f, "Poison Gandr"), new GandrSEData(typeof(SE_GandrIron), 1.5f, 0.5f, 0.9f, "Iron Gandr"), new GandrSEData(typeof(SE_GandrFrost), 1.6f, 0.45f, 1f, "Frost Gandr"), new GandrSEData(typeof(SE_GandrObsidian), 1.7f, 0.4f, 1.1f, "Glass Gandr"), new GandrSEData(typeof(SE_GandrSilver), 1.8f, 0.35f, 1.2f, "Silver Gandr"), new GandrSEData(typeof(SE_GandrNeedle), 1.9f, 0.3f, 1.3f, "Needle Gandr"), new GandrSEData(typeof(SE_GandrCarapace), 2f, 0.25f, 1.4f, "Bug Gandr"), new GandrSEData(typeof(SE_GandrCharred), 2.5f, 0.2f, 1.5f, "Charred Gandr") }; public static int MAX_NUM_CHARM_ICONS = 16; private static CachedSprite[] __m_cachedPacifistSprites = new CachedSprite[12] { new CachedSprite(GandrTypeIndex.Wood, "T_emote_flex", null), new CachedSprite(GandrTypeIndex.Flint, "SpearFlint", null), new CachedSprite(GandrTypeIndex.Fire, "Burning", null), new CachedSprite(GandrTypeIndex.Bronze, "MaceBronze", null), new CachedSprite(GandrTypeIndex.Poison, "Poison", null), new CachedSprite(GandrTypeIndex.Iron, "SwordIron", null), new CachedSprite(GandrTypeIndex.Frost, "Frost", null), new CachedSprite(GandrTypeIndex.Obsidian, "ArrowObsidian", null), new CachedSprite(GandrTypeIndex.Silver, "SwordMistwalker", null), new CachedSprite(GandrTypeIndex.Needle, "needle", null), new CachedSprite(GandrTypeIndex.Carapace, "MaceIron", null), new CachedSprite(GandrTypeIndex.Charred, "Lightning", null) }; public static Dictionary __m_spawnMultipliers = new Dictionary { { "Abomination", new SpawnModifierData() }, { "Asksvin", new SpawnModifierData() }, { "Bjorn", new SpawnModifierData() }, { "Blob", new SpawnModifierData() }, { "BlobElite", new SpawnModifierData() }, { "BlobLava", new SpawnModifierData() }, { "Boar", new SpawnModifierData { m_chance = 4f, m_max = 8f, m_interval = 0.25f, m_distance = 0.1f } }, { "BonemawSerpent", new SpawnModifierData() }, { "Charred_Archer", new SpawnModifierData() }, { "Charred_Melee", new SpawnModifierData() }, { "Charred_Twitcher", new SpawnModifierData() }, { "CinderSky", new SpawnModifierData { m_chance = 1f, m_max = 1f, m_interval = 1f, m_distance = 1f } }, { "CinderStorm", new SpawnModifierData { m_chance = 1f, m_max = 1f, m_interval = 1f, m_distance = 1f } }, { "Deathsquito", new SpawnModifierData() }, { "Deer", new SpawnModifierData { m_chance = 1.2f, m_max = 3f, m_interval = 1f, m_distance = 0.75f } }, { "Draugr", new SpawnModifierData() }, { "Draugr_Elite", new SpawnModifierData() }, { "Dverger", new SpawnModifierData() }, { "DvergerAshlands", new SpawnModifierData() }, { "FallenValkyrie", new SpawnModifierData() }, { "Fenring", new SpawnModifierData() }, { "FireFlies", new SpawnModifierData() }, { "Fish1", new SpawnModifierData { m_chance = 1f, m_max = 1f, m_interval = 1f, m_distance = 1f } }, { "Fish10", new SpawnModifierData { m_chance = 1f, m_max = 1f, m_interval = 1f, m_distance = 1f } }, { "Fish11", new SpawnModifierData { m_chance = 1f, m_max = 1f, m_interval = 1f, m_distance = 1f } }, { "Fish12", new SpawnModifierData { m_chance = 1f, m_max = 1f, m_interval = 1f, m_distance = 1f } }, { "Fish2", new SpawnModifierData { m_chance = 1f, m_max = 1f, m_interval = 1f, m_distance = 1f } }, { "Fish3", new SpawnModifierData { m_chance = 1f, m_max = 1f, m_interval = 1f, m_distance = 1f } }, { "Fish5", new SpawnModifierData { m_chance = 1f, m_max = 1f, m_interval = 1f, m_distance = 1f } }, { "Fish6", new SpawnModifierData { m_chance = 1f, m_max = 1f, m_interval = 1f, m_distance = 1f } }, { "Fish7", new SpawnModifierData { m_chance = 1f, m_max = 1f, m_interval = 1f, m_distance = 1f } }, { "Fish8", new SpawnModifierData { m_chance = 1f, m_max = 1f, m_interval = 1f, m_distance = 1f } }, { "Fish9", new SpawnModifierData { m_chance = 1f, m_max = 1f, m_interval = 1f, m_distance = 1f } }, { "Gjall", new SpawnModifierData() }, { "Goblin", new SpawnModifierData() }, { "GoblinBrute", new SpawnModifierData() }, { "Greydwarf", new SpawnModifierData() }, { "Greydwarf_Elite", new SpawnModifierData() }, { "Greydwarf_Shaman", new SpawnModifierData() }, { "Greyling", new SpawnModifierData { m_chance = 3f, m_max = 4f, m_interval = 0.5f, m_distance = 0.3f } }, { "Hare", new SpawnModifierData() }, { "Hatchling", new SpawnModifierData() }, { "LavaRock", new SpawnModifierData { m_chance = 1f, m_max = 1f, m_interval = 1f, m_distance = 1f } }, { "Leech", new SpawnModifierData() }, { "Lox", new SpawnModifierData() }, { "Morgen_NonSleeping", new SpawnModifierData() }, { "Neck", new SpawnModifierData { m_chance = 2f, m_max = 4f, m_interval = 0.5f, m_distance = 0.5f } }, { "Seagal", new SpawnModifierData { m_chance = 1f, m_max = 1f, m_interval = 1f, m_distance = 1f } }, { "Seeker", new SpawnModifierData() }, { "SeekerBrood", new SpawnModifierData() }, { "SeekerBrute", new SpawnModifierData() }, { "Serpent", new SpawnModifierData() }, { "Skeleton", new SpawnModifierData() }, { "StoneGolem", new SpawnModifierData() }, { "Surtling", new SpawnModifierData() }, { "Tick", new SpawnModifierData() }, { "Troll", new SpawnModifierData() }, { "Unbjorn", new SpawnModifierData() }, { "Volture", new SpawnModifierData() }, { "Wolf", new SpawnModifierData() }, { "Wraith", new SpawnModifierData() }, { "odin", new SpawnModifierData { m_chance = 1f, m_max = 1f, m_interval = 1f, m_distance = 1f } }, { "projectile_ashlandmeteor", new SpawnModifierData { m_chance = 1f, m_max = 1f, m_interval = 1f, m_distance = 1f } } }; public static int __m_spawnListsPatched = 0; public static Dictionary> __m_originalSpawnData = new Dictionary>(); private static GameObject __m_thrallsWindowObject = null; private static GameObject __m_thrallsWindowBackground = null; private static TextMeshProUGUI __m_thrallsWindowText = null; private static Vector2 __m_thrallsTooltipWindowSize = new Vector2(410f, 170f); private static Vector2 __m_thrallsTooltipTextOffset = new Vector2(5f, 2f); public const string PluginGUID = "com.oathorse.TrophyHuntMod"; public const string PluginName = "TrophyHuntMod"; public const string PluginVersion = "0.11.5"; private readonly Harmony harmony = new Harmony("com.oathorse.TrophyHuntMod"); private const bool DUMP_TROPHY_DATA = false; public static TrophyHuntMod __m_trophyHuntMod; public static TrophyHuntDataScoreOverride[] __m_trophyHuntScoreOverrides = new TrophyHuntDataScoreOverride[10] { new TrophyHuntDataScoreOverride(TrophyGameMode.TrophySaga, "TrophyFader", 400), new TrophyHuntDataScoreOverride(TrophyGameMode.TrophySaga, "TrophySeekerQueen", 400), new TrophyHuntDataScoreOverride(TrophyGameMode.TrophyBlitz, "TrophyFader", 260), new TrophyHuntDataScoreOverride(TrophyGameMode.TrophyBlitz, "TrophySeekerQueen", 200), new TrophyHuntDataScoreOverride(TrophyGameMode.TrophyTrailblazer, "TrophyFader", 400), new TrophyHuntDataScoreOverride(TrophyGameMode.TrophyTrailblazer, "TrophySeekerQueen", 400), new TrophyHuntDataScoreOverride(TrophyGameMode.CasualSaga, "TrophyFader", 400), new TrophyHuntDataScoreOverride(TrophyGameMode.CasualSaga, "TrophySeekerQueen", 400), new TrophyHuntDataScoreOverride(TrophyGameMode.CulinarySaga, "TrophyFader", 400), new TrophyHuntDataScoreOverride(TrophyGameMode.CulinarySaga, "TrophySeekerQueen", 400) }; private const int TROPHY_HUNT_DEATH_PENALTY = -20; private const int TROPHY_HUNT_LOGOUT_PENALTY = -10; private const int TROPHY_RUSH_DEATH_PENALTY = -10; private const int TROPHY_RUSH_SLASHDIE_PENALTY = -10; private const int TROPHY_RUSH_LOGOUT_PENALTY = -5; private const int TROPHY_SAGA_DEATH_PENALTY = -30; private const int TROPHY_SAGA_LOGOUT_PENALTY = -10; private const int TROPHY_BLITZ_DEATH_PENALTY = -40; private const int TROPHY_BLITZ_LOGOUT_PENALTY = -20; private const int TROPHY_TRAILBLAZER_DEATH_PENALTY = -20; private const int TROPHY_TRAILBLAZER_LOGOUT_PENALTY = -10; private const int TROPHY_FARMER_DEATH_PENALTY = -20; private const int TROPHY_FARMER_LOGOUT_PENALTY = -10; private const int TROPHY_PACIFIST_DEATH_PENALTY = -20; private const int TROPHY_PACIFIST_LOGOUT_PENALTY = -10; private const float CHARMED_ENEMY_SPEED_MULTIPLIER = 3.5f; private const int CULINARY_SAGA_DEATH_PENALTY = -30; private const int CULINARY_SAGA_LOGOUT_PENALTY = -10; private static float __m_sagaSailingSpeedMultiplier = 2.5f; private static float __m_sagaPaddlingSpeedMultiplier = 2f; private static float __m_blitzSailingSpeedMultiplier = 10f; private static float __m_blitzPaddlingSpeedMultiplier = 8f; private static float __m_trailblazerSailingSpeedMultiplier = 10f; private static float __m_trailblazerPaddlingSpeedMultiplier = 8f; private static float __m_farmerSailingSpeedMultiplier = 3.5f; private static float __m_farmerPaddlingSpeedMultiplier = 3f; private const float TROPHY_SAGA_TROPHY_DROP_MULTIPLIER = 2f; private const float TROPHY_SAGA_BASE_SKILL_LEVEL = 20f; private const int TROPHY_SAGA_MINING_MULTIPLIER = 2; private const float TROPHY_BLITZ_BASE_SKILL_LEVEL = 100f; private const float TROPHY_TRAILBLAZER_BASE_SKILL_LEVEL = 1f; private const float TROPHY_TRAILBLAZER_SKILL_GAIN_RATE = 6f; private const int EXTRA_MINUTE_SCORE_VALUE = 5; private const string TROPHY_SAGA_INTRO_TEXT = "You were once a great warrior, though your memory of deeds past has long grown dim, shrouded by eons slumbering in the lands beyond death…\n\n\n\nRagnarok looms and the tenth world remains only for a few scant hours. You are reborn with one purpose: collect the heads of Odin's enemies before this cycle ends…\n\n\n\nOdin will cast these heads into the well of Mimir where his lost eye still resides. With knowledge of the Forsaken he can finally banish them forever…\n\n\nBring Odin what he desires or be forced to repeat the cycle for eternity…\n\n\n…in VALHEIM!"; private const string CULINARY_SAGA_INTRO_TEXT = "You were once a great warrior, though your memory of deeds past has long grown dim, shrouded by eons slumbering in the lands beyond death…\n\n\n\nRagnarok looms and the tenth world remains only for a few scant hours. You are reborn with one purpose: cook a whole bunch of delicious meals to appease Odin's insatiable hunger?\n\n\n\nYes. Somehow. Bring Odin what he desires or be forced to repeat the cycle for eternity…\n\n\n\n…in VALHEIM!"; private const string TROPHY_BLITZ_INTRO_TEXT = "Onglay agoyay, ethay allfatheryay odinyay unitedyay ethay orldsway. Ehay ewthray down\n\nhis oesfay andyay astcay emthay intoyay ethay enthtay orldway, enthay itsplay the\n\nboughs atthay eldhay eirthay isonpray otay ethay orld-treeway, andyay eftlay ityay to\n\ndrift unanchoredyay, ayay aceplay ofyay exileyay...\n\nFor enturiescay, isthay orldway umberedslay uneasilyyay, utbay ityay idday not\n\ndie... Asyay acialglay agesyay assedpay, ingdomskay oseray andyay ellfay outyay ofyay sight\n\nof ethay odsgay.\n\nWhen odinyay eardhay ishay enemiesyay ereway owinggray onceyay againyay in\n\nstrength, ehay ookedlay otay idgardmay andyay entsay ishay alkyriesvay otay scour\n\nthe attlefieldsbay orfay ethay eatestgray ofyay eirthay arriorsway. Eadday to\n\nthe orldway, eythay ouldway ebay ornbay againyay...\n\n... inyay Alheimvay."; private const float LOGOUT_PENALTY_GRACE_DISTANCE = 50f; private const float DEFAULT_SCORE_FONT_SIZE = 25f; private const long NUM_SECONDS_IN_FOUR_HOURS = 14400L; private const long NUM_SECONDS_IN_THREE_HOURS = 10800L; private const long NUM_SECONDS_IN_TWO_HOURS = 7200L; public static TrophyHuntData[] __m_trophyHuntData = new TrophyHuntData[58] { new TrophyHuntData("TrophyAbomination", "Abomination", Biome.Swamp, 20, 50f, new List { "$enemy_abomination" }), new TrophyHuntData("TrophyAsksvin", "Asksvin", Biome.Ashlands, 50, 50f, new List { "$enemy_asksvin" }), new TrophyHuntData("TrophyBlob", "Blob", Biome.Swamp, 20, 10f, new List { "$enemy_blob", "$enemy_blobelite" }), new TrophyHuntData("TrophyBoar", "Boar", Biome.Meadows, 10, 15f, new List { "$enemy_boar" }), new TrophyHuntData("TrophyBjorn", "Bear", Biome.Forest, 20, 10f, new List { "$enemy_bjorn" }), new TrophyHuntData("TrophyBjornUndead", "Vile", Biome.Plains, 30, 15f, new List { "$enemy_unbjorn" }), new TrophyHuntData("TrophyBonemass", "Bonemass", Biome.Swamp, 100, 100f, new List { "$enemy_bonemass" }), new TrophyHuntData("TrophyBonemawSerpent", "Bonemaw", Biome.Ashlands, 50, 33f, new List { "$enemy_bonemawserpent" }), new TrophyHuntData("TrophyCharredArcher", "Charred Archer", Biome.Ashlands, 50, 5f, new List { "$enemy_charred_archer" }), new TrophyHuntData("TrophyCharredMage", "Charred Warlock", Biome.Ashlands, 50, 5f, new List { "$enemy_charred_mage" }), new TrophyHuntData("TrophyCharredMelee", "Charred Warrior", Biome.Ashlands, 50, 5f, new List { "$enemy_charred_melee" }), new TrophyHuntData("TrophyCultist", "Cultist", Biome.Mountains, 30, 10f, new List { "$enemy_fenringcultist" }), new TrophyHuntData("TrophyCultist_Hildir", "Geirrhafa", Biome.Hildir, 55, 100f, new List { "$enemy_fenringcultist_hildir" }), new TrophyHuntData("TrophyDeathsquito", "Deathsquito", Biome.Plains, 30, 5f, new List { "$enemy_deathsquito" }), new TrophyHuntData("TrophyDeer", "Deer", Biome.Meadows, 10, 50f, new List { "$enemy_deer" }), new TrophyHuntData("TrophyDragonQueen", "Moder", Biome.Mountains, 100, 100f, new List { "$enemy_dragon" }), new TrophyHuntData("TrophyDraugr", "Draugr", Biome.Swamp, 20, 10f, new List { "$enemy_draugr" }), new TrophyHuntData("TrophyDraugrElite", "Draugr Elite", Biome.Swamp, 20, 10f, new List { "$enemy_draugrelite" }), new TrophyHuntData("TrophyDvergr", "Dvergr", Biome.Mistlands, 40, 5f, new List { "$enemy_dvergr", "$enemy_dvergr_mage" }), new TrophyHuntData("TrophyEikthyr", "Eikthyr", Biome.Meadows, 40, 100f, new List { "$enemy_eikthyr" }), new TrophyHuntData("TrophyFader", "Fader", Biome.Ashlands, 1000, 100f, new List { "$enemy_fader" }), new TrophyHuntData("TrophyFallenValkyrie", "Fallen Valkyrie", Biome.Ashlands, 50, 5f, new List { "$enemy_fallenvalkyrie" }), new TrophyHuntData("TrophyFenring", "Fenring", Biome.Mountains, 30, 10f, new List { "$enemy_fenring" }), new TrophyHuntData("TrophyFrostTroll", "Troll", Biome.Forest, 20, 50f, new List { "$enemy_troll" }), new TrophyHuntData("TrophyGhost", "Ghost", Biome.Forest, 20, 10f, new List { "$enemy_ghost" }), new TrophyHuntData("TrophyGjall", "Gjall", Biome.Mistlands, 40, 30f, new List { "$enemy_gjall" }), new TrophyHuntData("TrophyGoblin", "Fuling", Biome.Plains, 30, 10f, new List { "$enemy_goblin" }), new TrophyHuntData("TrophyGoblinBrute", "Fuling Berserker", Biome.Plains, 30, 5f, new List { "$enemy_goblinbrute" }), new TrophyHuntData("TrophyGoblinBruteBrosBrute", "Thungr", Biome.Hildir, 65, 100f, new List { "$enemy_goblinbrute_hildircombined" }), new TrophyHuntData("TrophyGoblinBruteBrosShaman", "Zil", Biome.Hildir, 65, 100f, new List { "$enemy_goblin_hildir" }), new TrophyHuntData("TrophyGoblinKing", "Yagluth", Biome.Plains, 160, 100f, new List { "$enemy_goblinking" }), new TrophyHuntData("TrophyGoblinShaman", "Fuling Shaman", Biome.Plains, 30, 10f, new List { "$enemy_goblinshaman" }), new TrophyHuntData("TrophyGreydwarf", "Greydwarf", Biome.Forest, 20, 5f, new List { "$enemy_greydwarf" }), new TrophyHuntData("TrophyGreydwarfBrute", "Greydwarf Brute", Biome.Forest, 20, 10f, new List { "$enemy_greydwarfbrute" }), new TrophyHuntData("TrophyGreydwarfShaman", "Greydwarf Shaman", Biome.Forest, 20, 10f, new List { "$enemy_greydwarfshaman" }), new TrophyHuntData("TrophyGrowth", "Growth", Biome.Plains, 30, 10f, new List { "$enemy_blobtar" }), new TrophyHuntData("TrophyHare", "Misthare", Biome.Mistlands, 40, 5f, new List { "$enemy_hare" }), new TrophyHuntData("TrophyHatchling", "Drake", Biome.Mountains, 30, 10f, new List { "$enemy_thehive", "$enemy_drake" }), new TrophyHuntData("TrophyLeech", "Leech", Biome.Swamp, 20, 10f, new List { "$enemy_leech" }), new TrophyHuntData("TrophyLox", "Lox", Biome.Plains, 30, 10f, new List { "$enemy_lox" }), new TrophyHuntData("TrophyMorgen", "Morgen", Biome.Ashlands, 50, 5f, new List { "$enemy_morgen" }), new TrophyHuntData("TrophyNeck", "Neck", Biome.Meadows, 10, 5f, new List { "$enemy_neck" }), new TrophyHuntData("TrophySeeker", "Seeker", Biome.Mistlands, 40, 10f, new List { "$enemy_seeker" }), new TrophyHuntData("TrophySeekerBrute", "Seeker Soldier", Biome.Mistlands, 40, 5f, new List { "$enemy_seekerbrute" }), new TrophyHuntData("TrophySeekerQueen", "The Queen", Biome.Mistlands, 1000, 100f, new List { "$enemy_seekerqueen" }), new TrophyHuntData("TrophySerpent", "Serpent", Biome.Ocean, 45, 33f, new List { "$enemy_serpent" }), new TrophyHuntData("TrophySGolem", "Stone Golem", Biome.Mountains, 30, 5f, new List { "$enemy_stonegolem" }), new TrophyHuntData("TrophySkeleton", "Skeleton", Biome.Forest, 20, 10f, new List { "$enemy_skeleton" }), new TrophyHuntData("TrophySkeletonHildir", "Brenna", Biome.Hildir, 25, 100f, new List { "$enemy_skeletonfire" }), new TrophyHuntData("TrophySkeletonPoison", "Rancid Remains", Biome.Forest, 20, 10f, new List { "$enemy_skeletonpoison" }), new TrophyHuntData("TrophySurtling", "Surtling", Biome.Swamp, 20, 5f, new List { "$enemy_surtling" }), new TrophyHuntData("TrophyTheElder", "The Elder", Biome.Forest, 60, 100f, new List { "$enemy_gdking" }), new TrophyHuntData("TrophyTick", "Tick", Biome.Mistlands, 40, 5f, new List { "$enemy_tick" }), new TrophyHuntData("TrophyUlv", "Ulv", Biome.Mountains, 30, 5f, new List { "$enemy_ulv" }), new TrophyHuntData("TrophyVolture", "Volture", Biome.Ashlands, 50, 50f, new List { "$enemy_volture" }), new TrophyHuntData("TrophyWolf", "Wolf", Biome.Mountains, 30, 10f, new List { "$enemy_wolf" }), new TrophyHuntData("TrophyWraith", "Wraith", Biome.Swamp, 20, 5f, new List { "$enemy_wraith" }), new TrophyHuntData("TrophyKvastur", "Kvastur", Biome.Bogwitch, 25, 100f, new List { "$enemy_kvastur" }) }; public static Color[] __m_biomeColors = (Color[])(object)new Color[10] { new Color(0.2f, 0.2f, 0.1f, 0.3f), new Color(0f, 0.2f, 0f, 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), new Color(0.1f, 0.1f, 0.2f, 0.3f), new Color(0.2f, 0.1f, 0f, 0.3f), new Color(0.2f, 0.1f, 0f, 0.3f) }; public static BiomeBonus[] __m_biomeBonuses = new BiomeBonus[7] { new BiomeBonus(Biome.Meadows, "Meadows", 20, new List { "TrophyBoar", "TrophyDeer", "TrophyNeck" }), new BiomeBonus(Biome.Forest, "Black Forest", 40, new List { "TrophyBjorn", "TrophyFrostTroll", "TrophyGhost", "TrophyGreydwarf", "TrophyGreydwarfBrute", "TrophyGreydwarfShaman", "TrophySkeleton", "TrophySkeletonPoison" }), new BiomeBonus(Biome.Swamp, "Swamp", 40, new List { "TrophyAbomination", "TrophyBlob", "TrophyDraugr", "TrophyDraugrElite", "TrophyLeech", "TrophySurtling", "TrophyWraith" }), new BiomeBonus(Biome.Mountains, "Mountains", 60, new List { "TrophyCultist", "TrophyFenring", "TrophyHatchling", "TrophySGolem", "TrophyUlv", "TrophyWolf" }), new BiomeBonus(Biome.Plains, "Plains", 60, new List { "TrophyBjornUndead", "TrophyDeathsquito", "TrophyGoblin", "TrophyGoblinBrute", "TrophyGoblinShaman", "TrophyGrowth", "TrophyLox" }), new BiomeBonus(Biome.Mistlands, "Mistlands", 80, new List { "TrophyDvergr", "TrophyGjall", "TrophyHare", "TrophySeeker", "TrophySeekerBrute", "TrophyTick" }), new BiomeBonus(Biome.Ashlands, "Ashlands", 100, new List { "TrophyAsksvin", "TrophyBonemawSerpent", "TrophyCharredArcher", "TrophyCharredMage", "TrophyCharredMelee", "TrophyFallenValkyrie", "TrophyMorgen", "TrophyVolture" }) }; private static GameObject __m_scoreTextElement = null; private static GameObject __m_scoreBGElement = null; private static GameObject __m_deathsTextElement = null; private static GameObject __m_relogsTextElement = null; private static GameObject __m_relogsIconElement = null; private static GameObject __m_gameTimerTextElement = null; private static GameObject __m_luckOMeterElement = null; private static GameObject __m_standingsElement = null; private static TMP_FontAsset __m_globalFontObject = null; private static List __m_iconList = null; private static List __m_trophyCountList = null; private static Sprite __m_trophySprite = null; private static DiscordOAuthFlow __m_discordAuthentication = new DiscordOAuthFlow(); private static bool __m_loggedInWithDiscord = false; private static TextMeshProUGUI __m_discordLoginButtonText = null; private static TextMeshProUGUI __m_onlineUsernameText = null; private static TextMeshProUGUI __m_onlineStatusText = null; private static Image __m_discordBackgroundImage = null; private static long __m_gameTimerElapsedSeconds = 0L; private static bool __m_gameTimerActive = false; private static bool __m_gameTimerVisible = false; private static bool __m_gameTimerCountdown = true; private static long __m_internalTimerElapsedSeconds = 0L; private const long UPDATE_STANDINGS_INTERVAL = 30L; private const long SNAPSHOT_INTERVAL = 300L; private static bool __m_mapFilesPosted = false; private static bool __m_sentFinalData = false; private static bool __m_firstInputDetected = false; private static float __m_baseTrophyScale = 1.4f; private static float __m_userIconScale = 1f; private static float __m_userTextScale = 1f; private static float __m_userTrophySpacing = 0f; private static List __m_trophyCache = new List(); private static int __m_deaths = 0; private static int __m_slashDieCount = 0; private static int __m_logoutCount = 0; private static bool __m_pathAddedToMinimap = false; private static List __m_pathPins = new List(); private static List __m_pendingEvents = new List(); private static int __m_lastSentEventIndex = 0; private static bool __m_collectingPlayerPath = false; private static float __m_playerPathCollectionInterval = 5f; private static float __m_minPathPlayerMoveDistance = 10f; private static bool __m_pendingDeathRegistration = false; private static Vector3 __m_pendingDeathPosition = Vector3.zero; private static List __m_trophyPins = new List(); private static bool __m_onlyModRunning = false; private static TrophyGameMode __m_trophyGameMode = TrophyGameMode.TrophyHunt; public static bool __m_pacifistEnabled = false; private static bool __m_fiestaFlashing = false; private static Color[] __m_fiestaColors = (Color[])(object)new Color[6] { Color.red, Color.green, Color.blue, Color.cyan, Color.magenta, Color.yellow }; private static bool __m_blitzFlashing = false; private static bool __m_showAllTrophyStats = false; private static bool __m_invalidForTournamentPlay = false; private static bool __m_ignoreLogouts = false; private static bool __m_ignoreInvalidateUIChanges = false; private static bool __m_introMessageDisplayed = false; private static bool __m_instaSmelt = false; private static bool __m_elderPowerCutsAllTrees = false; private static bool __m_everythingUnlocked = false; private static long __m_storedPlayerID = 0L; private static TrophyGameMode __m_storedGameMode = TrophyGameMode.Max; private static string __m_storedWorldSeed = ""; private static int __m_playerCurrentScore = 0; private static int __m_extraTimeScore = 0; public static List __m_playerEventLog = new List(); public static bool __m_refreshLogsAndStandings = false; private static Dictionary __m_allTrophyDropInfo = new Dictionary(); private static Dictionary __m_playerTrophyDropInfo = new Dictionary(); private static Dictionary __m_farmerTrophyCounts = new Dictionary(); private static List __m_completedBiomeBonuses = new List(); private static bool __m_completedAllBiomeBonuses = false; private static int ALL_BIOME_BONUS_SCORE = 50; private static ConfigEntry __m_configDiscordId; private static ConfigEntry __m_configDiscordUser; private static ConfigEntry __m_configDiscordGlobalUser; private static ConfigEntry __m_configDiscordAvatar; private static ConfigEntry __m_configDiscordDiscriminator; public static string __m_saveDataVersionNumber = "8"; private string[] __m_modWhiteList = new string[5] { "org.bepinex.valheim.displayinfo", "com.oathorse.TrophyHuntMod", "com.oathorse.Tuba", "com.oathorse.Yakkity", "wearable_trophies" }; public static bool __m_showingTrophies = true; public static bool __m_showOnlyDeaths = false; public static TextMeshProUGUI __m_trophyHuntMainMenuText = null; private static List __m_flashingTrophies = new List(); private static float blitzFlashTimer = 0f; public static bool __m_isFlashingScore = false; private static GameObject __m_scoreTooltipObject = null; private static GameObject __m_scoreTooltipBackground = null; private static TextMeshProUGUI __m_scoreTooltipText; private static Vector2 __m_trophyHuntScoreTooltipWindowSize = new Vector2(240f, 215f); private static Vector2 __m_scoreTooltipTextOffset = new Vector2(5f, 2f); private static Dictionary __toolTipSizes = new Dictionary { { TrophyGameMode.TrophyHunt, new Vector2(240f, 215f) }, { TrophyGameMode.TrophyRush, new Vector2(290f, 400f) }, { TrophyGameMode.TrophyBlitz, new Vector2(290f, 400f) }, { TrophyGameMode.TrophyTrailblazer, new Vector2(290f, 400f) }, { TrophyGameMode.TrophyFarmer, new Vector2(240f, 215f) }, { TrophyGameMode.TrophyPacifist, new Vector2(290f, 400f) }, { TrophyGameMode.CasualSaga, new Vector2(300f, 170f) }, { TrophyGameMode.TrophySaga, new Vector2(290f, 215f) }, { TrophyGameMode.CulinarySaga, new Vector2(240f, 215f) }, { TrophyGameMode.TrophyFiesta, new Vector2(240f, 215f) } }; private static GameObject __m_luckTooltipObject = null; private static GameObject __m_luckTooltipBackground = null; private static TextMeshProUGUI __m_luckTooltip; private static Vector2 __m_luckTooltipWindowSize = new Vector2(220f, 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_standingsTooltipObject = null; private static GameObject __m_standingsTooltipBackground = null; private static TextMeshProUGUI __m_standingsTooltip; private static Vector2 __m_standingsTooltipWindowSize = new Vector2(250f, 300f); private static Vector2 __m_standingsTooltipTextOffset = new Vector2(5f, 2f); private static GameObject __m_trophyTooltipObject = null; private static GameObject __m_trophyTooltipBackground = null; private static TextMeshProUGUI __m_trophyTooltip; private static Vector2 __m_trophyTooltipWindowSize = new Vector2(240f, 125f); private static Vector2 __m_trophyTooltipTextOffset = new Vector2(5f, 2f); private static Vector2 __m_trophyTooltipAllTrophyStatsWindowSize = new Vector2(240f, 195f); public static Dictionary> __m_specialSagaDrops = new Dictionary> { { "$enemy_greyling", new List { new SpecialSagaDrop("FineWood", 50f, 3, 10), new SpecialSagaDrop("Coal", 5f, 4, 4), new SpecialSagaDrop("TrophyDeer", 5f, 1, 1), new SpecialSagaDrop("RoundLog", 10f, 2, 7), new SpecialSagaDrop("BoneFragments", 8f, 1, 3), new SpecialSagaDrop("Flint", 8f, 1, 3), new SpecialSagaDrop("LeatherScraps", 10f, 2, 3), new SpecialSagaDrop("DeerHide", 4f, 1, 3), new SpecialSagaDrop("Feathers", 20f, 4, 8), new SpecialSagaDrop("Acorn", 3f, 1, 2), new SpecialSagaDrop("CarrotSeeds", 8f, 1, 3), new SpecialSagaDrop("TurnipSeeds", 4f, 1, 3), new SpecialSagaDrop("QueenBee", 6f, 1, 1), new SpecialSagaDrop("Honey", 8f, 2, 3), new SpecialSagaDrop("Blueberries", 7f, 2, 4), new SpecialSagaDrop("BeltStrength", 15f, 1, 1, dropOnlyOne: false, stopDroppingOnPickup: true) } }, { "$enemy_neck", new List { new SpecialSagaDrop("FishingBait", 25f, 1, 5, dropOnlyOne: false, stopDroppingOnPickup: false, TrophyGameMode.CulinarySaga) } }, { "$enemy_greydwarfbrute", new List { new SpecialSagaDrop("CryptKey", 100f, 1, 1, dropOnlyOne: false, stopDroppingOnPickup: true), new SpecialSagaDrop("FishingRod", 100f, 1, 1, dropOnlyOne: true, stopDroppingOnPickup: false, TrophyGameMode.CulinarySaga) } }, { "$enemy_troll", new List { new SpecialSagaDrop("BeltStrength", 100f, 1, 1, dropOnlyOne: false, stopDroppingOnPickup: true), new SpecialSagaDrop("TrollHide", 100f, 5, 5), new SpecialSagaDrop("FishingBaitForest", 50f, 1, 5, dropOnlyOne: true, stopDroppingOnPickup: false, TrophyGameMode.CulinarySaga) } }, { "$enemy_skeletonfire", new List { new SpecialSagaDrop("CryptKey", 100f, 1, 1, dropOnlyOne: true) } }, { "$enemy_skeletonpoison", new List { new SpecialSagaDrop("MaceIron", 100f, 1, 1, dropOnlyOne: true) } }, { "$enemy_blobelite", new List { new SpecialSagaDrop("Wishbone", 100f, 1, 1, dropOnlyOne: false, stopDroppingOnPickup: true), new SpecialSagaDrop("Ooze", 100f, 2, 5), new SpecialSagaDrop("FishingRod", 100f, 1, 1, dropOnlyOne: true, stopDroppingOnPickup: false, TrophyGameMode.CulinarySaga) } }, { "$enemy_blob", new List { new SpecialSagaDrop("Ooze", 100f, 2, 5) } }, { "$enemy_abomination", new List { new SpecialSagaDrop("FishingBaitSwamp", 25f, 1, 5, dropOnlyOne: false, stopDroppingOnPickup: false, TrophyGameMode.CulinarySaga) } }, { "$enemy_drake", new List { new SpecialSagaDrop("DragonTear", 100f, 1, 2), new SpecialSagaDrop("FishingRod", 100f, 1, 1, dropOnlyOne: true, stopDroppingOnPickup: false, TrophyGameMode.CulinarySaga), new SpecialSagaDrop("FishingBaitDeepNorth", 15f, 1, 5, dropOnlyOne: false, stopDroppingOnPickup: false, TrophyGameMode.CulinarySaga) } }, { "$enemy_fenringcultist_hildir", new List { new SpecialSagaDrop("DragonTear", 100f, 2, 3, dropOnlyOne: true) } }, { "$enemy_fenring", new List { new SpecialSagaDrop("FishingBaitCave", 25f, 1, 10, dropOnlyOne: false, stopDroppingOnPickup: false, TrophyGameMode.CulinarySaga) } }, { "$enemy_goblin", new List { new SpecialSagaDrop("FishingBaitPlains", 15f, 1, 5, dropOnlyOne: false, stopDroppingOnPickup: false, TrophyGameMode.CulinarySaga) } }, { "$enemy_goblinshaman", new List { new SpecialSagaDrop("YagluthDrop", 100f, 1, 1, dropOnlyOne: false, stopDroppingOnPickup: true), new SpecialSagaDrop("FishingRod", 100f, 1, 1, dropOnlyOne: true, stopDroppingOnPickup: false, TrophyGameMode.CulinarySaga) } }, { "$enemy_goblinbrute", new List { new SpecialSagaDrop("YagluthDrop", 100f, 1, 1, dropOnlyOne: false, stopDroppingOnPickup: true), new SpecialSagaDrop("FishingRod", 100f, 1, 1, dropOnlyOne: true, stopDroppingOnPickup: false, TrophyGameMode.CulinarySaga) } }, { "$enemy_goblin_hildir", new List { new SpecialSagaDrop("YagluthDrop", 100f, 1, 1, dropOnlyOne: true) } }, { "$enemy_goblinbrute_hildircombined", new List { new SpecialSagaDrop("YagluthDrop", 100f, 1, 1, dropOnlyOne: true) } }, { "$enemy_lox", new List { new SpecialSagaDrop("FishingBaitMistlands", 45f, 1, 5, dropOnlyOne: false, stopDroppingOnPickup: false, TrophyGameMode.CulinarySaga) } }, { "$enemy_seekerbrute", new List { new SpecialSagaDrop("QueenDrop", 100f, 1, 1, dropOnlyOne: false, stopDroppingOnPickup: true), new SpecialSagaDrop("FishingRod", 100f, 1, 1, dropOnlyOne: true, stopDroppingOnPickup: false, TrophyGameMode.CulinarySaga) } }, { "$enemy_dvergr", new List { new SpecialSagaDrop("YggdrasilWood", 100f, 10, 20) } }, { "$enemy_dvergr_mage", new List { new SpecialSagaDrop("YggdrasilWood", 100f, 10, 20) } }, { "$enemy_serpent", new List { new SpecialSagaDrop("FishingBaitOcean", 100f, 20, 20, dropOnlyOne: false, stopDroppingOnPickup: false, TrophyGameMode.CulinarySaga) } }, { "$enemy_charred_melee", new List { new SpecialSagaDrop("FishingBaitAshlands", 25f, 1, 5, dropOnlyOne: false, stopDroppingOnPickup: false, TrophyGameMode.CulinarySaga) } }, { "$enemy_gdking", new List { new SpecialSagaDrop("YmirRemains", 100f, 10, 10, dropOnlyOne: true) } }, { "$enemy_bonemass", new List { new SpecialSagaDrop("YmirRemains", 100f, 10, 10, dropOnlyOne: true) } }, { "$enemy_dragon", new List { new SpecialSagaDrop("YmirRemains", 100f, 10, 10, dropOnlyOne: true) } }, { "$enemy_seekerqueen", new List { new SpecialSagaDrop("YmirRemains", 100f, 10, 10, dropOnlyOne: true) } }, { "$enemy_fader", new List { new SpecialSagaDrop("YmirRemains", 100f, 10, 10, dropOnlyOne: true) } } }; public static Dictionary __m_oreNameToBarPrefabName = new Dictionary { { "CopperOre", "Copper" }, { "TinOre", "Tin" }, { "IronScrap", "Iron" }, { "SilverOre", "Silver" }, { "BlackMetalScrap", "BlackMetal" }, { "FlametalOreNew", "FlametalNew" }, { "BronzeScrap", "Bronze" }, { "CopperScrap", "Copper" } }; public static Dictionary __m_oreNameToBarItemName = new Dictionary { { "CopperOre", "$item_copper" }, { "TinOre", "$item_tin" }, { "IronScrap", "$item_iron" }, { "SilverOre", "$item_silver" }, { "BlackMetalScrap", "$item_blackmetal" }, { "FlametalOreNew", "$item_flametal" }, { "BronzeScrap", "$item_bronze" }, { "CopperScrap", "$item_copper" } }; public static TextMeshProUGUI __m_pacifistButtonText = null; public static BossDetails[] __m_bossNames = new BossDetails[7] { new BossDetails("$enemy_eikthyr", "Eikthyrnir", "Eikthyr"), new BossDetails("$enemy_gdking", "GDKing", "Elder"), new BossDetails("$enemy_bonemass", "Bonemass", "Bonemass"), new BossDetails("$enemy_dragon", "Dragonqueen", "Moder"), new BossDetails("$enemy_goblinking", "GoblinKing", "Yagluth"), new BossDetails("$enemy_seekerqueen", "Mistlands_DvergrBossEntrance1", "The Queen"), new BossDetails("$enemy_fader", "FaderLocation", "Fader") }; private static bool __m_overrideGlobalKeysForPieceDrops = false; public static readonly Dictionary> __m_eventDescriptions = new Dictionary> { { PlayerEventType.Trophy, null }, { PlayerEventType.Misc, null } }; public static TournamentStatus __m_tournamentStatus = TournamentStatus.NotRunning; public static string __m_tournamentName = ""; public static string __m_tournamentMode = ""; public static DateTime __m_tournamentStartTime; public static DateTime __m_tournamentEndTime; public static List __m_tournamentPlayerInfo = new List(); public static Sprite __m_healthSprite = null; public static List __m_cookedFoods = new List(); public static ConsumableData[] __m_rawFoodData = new ConsumableData[18] { new ConsumableData("Blueberries", "$item_blueberries", "Blueberries", Biome.Meadows, 0, 8f, 25f, 0f, 1f), new ConsumableData("Carrot", "$item_carrot", "Carrot", Biome.Meadows, 0, 10f, 32f, 0f, 1f), new ConsumableData("Cloudberry", "$item_cloudberries", "Cloudberries", Biome.Meadows, 0, 13f, 40f, 0f, 1f), new ConsumableData("Fiddleheadfern", "$item_fiddleheadfern", "Fiddlehead", Biome.Meadows, 0, 30f, 30f, 0f, 1f), new ConsumableData("Mushroom", "$item_mushroomcommon", "Mushroom", Biome.Meadows, 0, 15f, 15f, 0f, 1f), new ConsumableData("MushroomBlue", "$item_mushroomblue", "Blue Mushroom", Biome.Meadows, 0, 20f, 20f, 0f, 1f), new ConsumableData("MushroomBzerker", "$item_mushroom_bzerker", "Toadstool", Biome.Meadows, 0, 0f, 0f, 0f, 1f), new ConsumableData("MushroomJotunPuffs", "$item_jotunpuffs", "Jotun Puffs", Biome.Meadows, 0, 25f, 25f, 0f, 1f), new ConsumableData("MushroomMagecap", "$item_magecap", "Magecap", Biome.Meadows, 0, 25f, 25f, 25f, 1f), new ConsumableData("MushroomSmokePuff", "$item_smokepuff", "Smoke Puff", Biome.Meadows, 0, 15f, 15f, 0f, 1f), new ConsumableData("MushroomYellow", "$item_mushroomyellow", "Yellow Mushroom", Biome.Meadows, 0, 10f, 30f, 0f, 1f), new ConsumableData("Honey", "$item_honey", "Honey", Biome.Meadows, 0, 8f, 35f, 0f, 1f), new ConsumableData("Onion", "$item_onion", "Onion", Biome.Meadows, 0, 13f, 40f, 0f, 1f), new ConsumableData("Pukeberries", "$item_pukeberries", "Bukeperries", Biome.Meadows, 0, 0f, 0f, 0f, 1f), new ConsumableData("Raspberry", "$item_raspberries", "Raspberries", Biome.Meadows, 0, 7f, 20f, 0f, 1f), new ConsumableData("RottenMeat", "$item_meat_rotten", "Rotten Meat", Biome.Meadows, 0, 0f, 0f, 0f, 1f), new ConsumableData("RoyalJelly", "$item_royaljelly", "Royal Jelly", Biome.Meadows, 0, 15f, 15f, 0f, 1f), new ConsumableData("Vineberry", "$item_vineberry", "Vineberry Cluster", Biome.Meadows, 0, 30f, 30f, 30f, 1f) }; public static ConsumableData[] __m_drinkData = new ConsumableData[21] { new ConsumableData("BarleyWine", "$item_barleywine", "Fire Resistance Barley Wine", Biome.Meadows, 0, 0f, 0f, 0f, 0f), new ConsumableData("MeadBugRepellent", "$item_mead_bugrepellent", "Anti-Sting Concoction", Biome.Meadows, 0, 0f, 0f, 0f, 0f), new ConsumableData("MeadBzerker", "$item_mead_bzerker", "Berserkir Mead", Biome.Meadows, 0, 0f, 0f, 0f, 0f), new ConsumableData("MeadEitrLingering", "$item_mead_eitr_lingering", "Lingering Eitr Mead", Biome.Meadows, 0, 0f, 0f, 0f, 0f), new ConsumableData("MeadEitrMinor", "$item_mead_eitr_minor", "Minor Eitr Mead", Biome.Meadows, 0, 0f, 0f, 0f, 0f), new ConsumableData("MeadFrostResist", "$item_mead_frostres", "Frost Resistance Mead", Biome.Meadows, 0, 0f, 0f, 0f, 0f), new ConsumableData("MeadHasty", "$item_mead_hasty", "Tonic of Ratatosk", Biome.Meadows, 0, 0f, 0f, 0f, 0f), new ConsumableData("MeadHealthLingering", "$item_mead_hp_lingering", "Lingering Healing Mead", Biome.Meadows, 0, 0f, 0f, 0f, 0f), new ConsumableData("MeadHealthMajor", "$item_mead_hp_major", "Major Healing Mead", Biome.Meadows, 0, 0f, 0f, 0f, 0f), new ConsumableData("MeadHealthMedium", "$item_mead_hp_medium", "Medium Healing Mead", Biome.Meadows, 0, 0f, 0f, 0f, 0f), new ConsumableData("MeadHealthMinor", "$item_mead_hp_minor", "Minor Healing Mead", Biome.Meadows, 0, 0f, 0f, 0f, 0f), new ConsumableData("MeadLightfoot", "$item_mead_lightfoot", "Lightfoot Mead", Biome.Meadows, 0, 0f, 0f, 0f, 0f), new ConsumableData("MeadPoisonResist", "$item_mead_poisonres", "Poison Resistance Mead", Biome.Meadows, 0, 0f, 0f, 0f, 0f), new ConsumableData("MeadStaminaLingering", "$item_mead_stamina_lingering", "Lingering Stamina Mead", Biome.Meadows, 0, 0f, 0f, 0f, 0f), new ConsumableData("MeadStaminaMedium", "$item_mead_stamina_medium", "Medium Stamina Mead", Biome.Meadows, 0, 0f, 0f, 0f, 0f), new ConsumableData("MeadStaminaMinor", "$item_mead_stamina_minor", "Minor Stamina Mead", Biome.Meadows, 0, 0f, 0f, 0f, 0f), new ConsumableData("MeadStrength", "$item_mead_strength", "Mead of Troll Endurance", Biome.Meadows, 0, 0f, 0f, 0f, 0f), new ConsumableData("MeadSwimmer", "$item_mead_swimmer", "Draught of Vananidir", Biome.Meadows, 0, 0f, 0f, 0f, 0f), new ConsumableData("MeadTamer", "$item_mead_tamer", "Brew of Animal Whispers", Biome.Meadows, 0, 0f, 0f, 0f, 0f), new ConsumableData("MeadTasty", "$item_mead_tasty", "Tasty Mead", Biome.Meadows, 0, 0f, 0f, 0f, 0f), new ConsumableData("MeadTrollPheromones", "$item_mead_trollpheromones", "Love Potion", Biome.Meadows, 0, 0f, 0f, 0f, 0f) }; public static ConsumableData[] __m_feastData = new ConsumableData[8] { new ConsumableData("FeastAshlands", "$item_feastashlands", "Ashlands Gourmet Bowl", Biome.Meadows, 0, 75f, 75f, 38f, 6f), new ConsumableData("FeastBlackforest", "$item_feastblackforest", "Black Forest Buffet Platter", Biome.Meadows, 0, 35f, 35f, 0f, 3f), new ConsumableData("FeastMeadows", "$item_feastmeadows", "Whole Roasted Meadow Boar", Biome.Meadows, 0, 35f, 35f, 0f, 2f), new ConsumableData("FeastMistlands", "$item_feastmistlands", "Mushrooms Galore á la Mistlands", Biome.Meadows, 0, 65f, 65f, 33f, 5f), new ConsumableData("FeastMountains", "$item_feastmountains", "Hearty Mountain Logger's Stew", Biome.Meadows, 0, 45f, 45f, 0f, 3f), new ConsumableData("FeastOceans", "$item_feastoceans", "Sailor's Bounty", Biome.Meadows, 0, 45f, 45f, 0f, 3f), new ConsumableData("FeastPlains", "$item_feastplains", "Plains Pie Picnic", Biome.Meadows, 0, 55f, 55f, 0f, 4f), new ConsumableData("FeastSwamps", "$item_feastswamps", "Swamp Dweller's Delight", Biome.Meadows, 0, 35f, 35f, 0f, 3f) }; public static ConsumableData[] __m_cookedFoodData = new ConsumableData[51] { new ConsumableData("NeckTailGrilled", "$item_necktailgrilled", "Grilled Neck Tail", Biome.Meadows, 10, 25f, 8f, 0f, 2f), new ConsumableData("CookedMeat", "$item_boar_meat_cooked", "Cooked Boar Meat", Biome.Meadows, 10, 30f, 10f, 0f, 2f), new ConsumableData("CookedDeerMeat", "$item_deer_meat_cooked", "Cooked Deer Meat", Biome.Meadows, 10, 35f, 12f, 0f, 2f), new ConsumableData("QueensJam", "$item_queensjam", "Queen's Jam", Biome.Meadows, 10, 14f, 40f, 0f, 2f), new ConsumableData("BoarJerky", "$item_boarjerky", "Boar Jerky", Biome.Forest, 20, 23f, 23f, 0f, 2f), new ConsumableData("DeerStew", "$item_deerstew", "Deer Stew", Biome.Forest, 20, 45f, 15f, 0f, 3f), new ConsumableData("CarrotSoup", "$item_carrotsoup", "Carrot Soup", Biome.Forest, 20, 15f, 45f, 0f, 2f), new ConsumableData("MinceMeatSauce", "$item_mincemeatsauce", "Minced Meat Sauce", Biome.Forest, 20, 40f, 13f, 0f, 3f), new ConsumableData("CookedBjornMeat", "$item_bjorn_meat_cooked", "Cooked Bear Meat", Biome.Forest, 20, 40f, 13f, 0f, 2f), new ConsumableData("Sausages", "$item_sausages", "Sausages", Biome.Swamp, 30, 55f, 18f, 0f, 3f), new ConsumableData("ShocklateSmoothie", "$item_shocklatesmoothie", "Muckshake", Biome.Swamp, 30, 16f, 50f, 0f, 1f), new ConsumableData("TurnipStew", "$item_turnipstew", "Turnip Stew", Biome.Swamp, 30, 18f, 55f, 0f, 2f), new ConsumableData("BlackSoup", "$item_blacksoup", "Black Soup", Biome.Swamp, 30, 50f, 17f, 0f, 3f), new ConsumableData("OnionSoup", "$item_onionsoup", "Onion Soup", Biome.Mountains, 30, 20f, 60f, 0f, 1f), new ConsumableData("CookedWolfMeat", "$item_wolf_meat_cooked", "Cooked Wolf Meat", Biome.Mountains, 30, 45f, 15f, 0f, 3f), new ConsumableData("WolfJerky", "$item_wolfjerky", "Wolf Jerky", Biome.Mountains, 30, 33f, 33f, 0f, 3f), new ConsumableData("WolfMeatSkewer", "$item_wolf_skewer", "Wolf Skewer", Biome.Mountains, 30, 65f, 21f, 0f, 3f), new ConsumableData("Eyescream", "$item_eyescream", "Eyescream", Biome.Mountains, 30, 21f, 65f, 0f, 1f), new ConsumableData("FishCooked", "$item_fish_cooked", "Cooked Fish", Biome.Ocean, 40, 45f, 15f, 0f, 2f), new ConsumableData("SerpentMeatCooked", "$item_serpentmeatcooked", "Cooked Serpent Meat", Biome.Ocean, 40, 70f, 23f, 0f, 3f), new ConsumableData("SerpentStew", "$item_serpentstew", "Serpent Stew", Biome.Ocean, 40, 80f, 26f, 0f, 4f), new ConsumableData("CookedLoxMeat", "$item_loxmeat_cooked", "Cooked Lox Meat", Biome.Plains, 40, 50f, 16f, 0f, 4f), new ConsumableData("FishWraps", "$item_fishwraps", "Fish Wraps", Biome.Plains, 40, 70f, 23f, 0f, 4f), new ConsumableData("LoxPie", "$item_loxpie", "Lox Meat Pie", Biome.Plains, 40, 75f, 24f, 0f, 4f), new ConsumableData("BloodPudding", "$item_bloodpudding", "Blood Pudding", Biome.Plains, 40, 25f, 75f, 0f, 2f), new ConsumableData("Bread", "$item_bread", "Bread", Biome.Plains, 40, 23f, 70f, 0f, 2f), new ConsumableData("CookedEgg", "$item_egg_cooked", "Cooked Egg", Biome.Plains, 40, 35f, 12f, 0f, 2f), new ConsumableData("CookedChickenMeat", "$item_chicken_meat_cooked", "Cooked Chicken Meat", Biome.Plains, 40, 60f, 20f, 0f, 5f), new ConsumableData("CookedHareMeat", "$item_hare_meat_cooked", "Cooked Hare Meat", Biome.Mistlands, 50, 60f, 20f, 0f, 5f), new ConsumableData("CookedBugMeat", "$item_bug_meat_cooked", "Cooked Seeker Meat", Biome.Mistlands, 50, 60f, 20f, 0f, 5f), new ConsumableData("MeatPlatter", "$item_meatplatter", "Meat Platter", Biome.Mistlands, 50, 80f, 26f, 0f, 5f), new ConsumableData("HoneyGlazedChicken", "$item_honeyglazedchicken", "Honey Glazed Chicken", Biome.Mistlands, 50, 80f, 26f, 0f, 5f), new ConsumableData("MisthareSupreme", "$item_mistharesupreme", "Misthare Supreme", Biome.Mistlands, 50, 85f, 28f, 0f, 5f), new ConsumableData("Salad", "$item_salad", "Salad", Biome.Mistlands, 50, 26f, 80f, 0f, 3f), new ConsumableData("MushroomOmelette", "$item_mushroomomelette", "Mushroom Omelette", Biome.Mistlands, 50, 28f, 85f, 0f, 3f), new ConsumableData("FishAndBread", "$item_fishandbread", "Fish 'n' Bread", Biome.Mistlands, 50, 30f, 90f, 0f, 3f), new ConsumableData("MagicallyStuffedShroom", "$item_magicallystuffedmushroom", "Stuffed Mushroom", Biome.Mistlands, 50, 25f, 12f, 75f, 3f), new ConsumableData("YggdrasilPorridge", "$item_yggdrasilporridge", "Yggdrasil Porridge", Biome.Mistlands, 50, 27f, 13f, 80f, 3f), new ConsumableData("SeekerAspic", "$item_seekeraspic", "Seeker Aspic", Biome.Mistlands, 50, 28f, 14f, 85f, 3f), new ConsumableData("CookedAsksvinMeat", "$item_asksvin_meat_cooked", "Cooked Asksvin Tail", Biome.Ashlands, 60, 70f, 24f, 0f, 6f), new ConsumableData("CookedVoltureMeat", "$item_volture_meat_cooked", "Cooked Volture Meat", Biome.Ashlands, 60, 70f, 24f, 0f, 6f), new ConsumableData("CookedBoneMawSerpentMeat", "$item_bonemawmeat_cooked", "Cooked Bonemaw Meat", Biome.Ashlands, 60, 90f, 30f, 0f, 6f), new ConsumableData("FierySvinstew", "$item_fierysvinstew", "Fiery Svinstew", Biome.Ashlands, 60, 95f, 32f, 0f, 6f), new ConsumableData("MashedMeat", "$item_mashedmeat", "Mashed Meat", Biome.Ashlands, 60, 100f, 34f, 0f, 6f), new ConsumableData("PiquantPie", "$item_piquantpie", "Piquant Pie", Biome.Ashlands, 60, 105f, 35f, 0f, 6f), new ConsumableData("SpicyMarmalade", "$item_spicymarmalade", "Spicy Marmalade", Biome.Ashlands, 60, 30f, 90f, 0f, 4f), new ConsumableData("ScorchingMedley", "$item_scorchingmedley", "Scorching Medley", Biome.Ashlands, 60, 32f, 95f, 0f, 4f), new ConsumableData("RoastedCrustPie", "$item_roastedcrustpie", "Roasted Crust Pie", Biome.Ashlands, 60, 34f, 100f, 0f, 4f), new ConsumableData("SizzlingBerryBroth", "$item_sizzlingberrybroth", "Sizzling Berry Broth", Biome.Ashlands, 60, 28f, 14f, 85f, 4f), new ConsumableData("SparklingShroomshake", "$item_sparklingshroomshake", "Sparkling Shroomshake", Biome.Ashlands, 60, 30f, 15f, 90f, 4f), new ConsumableData("MarinatedGreens", "$item_marinatedgreens", "Marinated Greens", Biome.Ashlands, 60, 32f, 16f, 95f, 4f) }; public static void LogDamage(string logEntry) { File.AppendAllText(Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "DamageLog.csv"), logEntry + "\n"); } public static bool IsThrallArrow(string ammoName) { if (ammoName.ToLower().Contains("Gandr".ToLower())) { return true; } return false; } public static bool HasThrall() { if (!IsPacifist()) { return false; } return __m_allCharmedCharacters.Count > 0; } public static float GetCharmDuration() { new Random(); return 300f; } public static Guid GetGUIDFromCharacter(Character character) { if ((Object)(object)character == (Object)null) { return Guid.Empty; } ZNetView component = ((Component)character).GetComponent(); ZDO val = ((component != null) ? component.GetZDO() : null); if (val == null) { return Guid.Empty; } string @string = val.GetString("CharmGUID", ""); Guid result = Guid.Empty; Guid.TryParse(@string, out result); return result; } public static Character GetCharacterFromGUID(Guid guid) { foreach (Character allCharacter in Character.GetAllCharacters()) { ZNetView component = ((Component)allCharacter).GetComponent(); ZDO val = ((component != null) ? component.GetZDO() : null); if (val != null) { string @string = val.GetString("CharmGUID", ""); Guid result = Guid.Empty; Guid.TryParse(@string, out result); if (result == guid) { return allCharacter; } } } return null; } public static void SetNonTrinketAdrenaline() { if (((Humanoid)(Player.m_localPlayer?)).m_trinketItem == null && __m_allCharmedCharacters != null && __m_allCharmedCharacters.Count > 0 && Player.m_localPlayer.m_maxAdrenaline == 0f) { Player.m_localPlayer.m_maxAdrenaline = 30f; Player.m_localPlayer.m_adrenaline = 0f; } } public static void DoPacifistPostPlayerSpawnTasks() { if (!IsPacifist() || !Object.op_Implicit((Object)(object)Player.m_localPlayer)) { return; } foreach (CharmedCharacter _m_allCharmedCharacter in __m_allCharmedCharacters) { if (_m_allCharmedCharacter != null) { SetCharmedState(_m_allCharmedCharacter, playParticleEffect: false); } } SetNonTrinketAdrenaline(); } public static bool IsCharmed(Character character) { Guid cGUID = GetGUIDFromCharacter(character); return __m_allCharmedCharacters.Find((CharmedCharacter c) => c.m_charmGUID == cGUID) != null; } public static CharmedCharacter GetCharmedCharacter(Character character) { Guid cGUID = GetGUIDFromCharacter(character); return __m_allCharmedCharacters.Find((CharmedCharacter c) => c.m_charmGUID == cGUID); } public static void AddToCharmedList(Character enemy, long duration) { //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_005f: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) CharmedCharacter charmedCharacter = new CharmedCharacter(); ZDO zDO = ((Component)enemy).GetComponent().GetZDO(); Guid charmGUID = Guid.NewGuid(); zDO.Set("CharmGUID", charmGUID.ToString()); zDO.Persistent = true; charmedCharacter.m_charmGUID = charmGUID; charmedCharacter.m_pin = Minimap.instance.AddPin(((Component)enemy).transform.position, (PinType)3, "", false, false, 0L, default(PlatformUserID)); charmedCharacter.m_originalFaction = enemy.m_faction; charmedCharacter.m_charmExpireTime = __m_charmTimerSeconds + duration; charmedCharacter.m_swimSpeed = enemy.m_swimSpeed; __m_allCharmedCharacters.Add(charmedCharacter); SetCharmedState(charmedCharacter); UpdateModUI(Player.m_localPlayer); } public static void RemoveFromCharmedList(CharmedCharacter cc) { if (cc != null) { RemoveGUIDFromCharmedList(cc.m_charmGUID); } } public static void RemoveFromCharmedList(Character enemy) { if (!((Object)(object)enemy == (Object)null)) { RemoveGUIDFromCharmedList(Guid.Parse(((Component)enemy).GetComponent().GetZDO().GetString("CharmGUID", ""))); } } public static void RemoveGUIDFromCharmedList(Guid guid) { CharmedCharacter charmedCharacter = __m_allCharmedCharacters.Find((CharmedCharacter c) => c.m_charmGUID == guid); if (charmedCharacter != null) { Minimap.instance.RemovePin(charmedCharacter.m_pin); __m_allCharmedCharacters.Remove(charmedCharacter); } if (__m_allCharmedCharacters.Count < 1 && (Object)(object)Player.m_localPlayer != (Object)null) { Player.m_localPlayer.m_maxAdrenaline = 0f; Player.m_localPlayer.m_adrenaline = 0f; } UpdateModUI(Player.m_localPlayer); } public static bool SetCharmedState(CharmedCharacter cc, bool playParticleEffect = true) { //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) CharmedCharacter charmedCharacter = __m_allCharmedCharacters.Find((CharmedCharacter c) => c.m_charmGUID == cc.m_charmGUID); if (charmedCharacter != null) { Character characterFromGUID = GetCharacterFromGUID(charmedCharacter.m_charmGUID); if ((Object)(object)characterFromGUID == (Object)null) { Debug.LogWarning((object)("Unable to SetCharmedState for GUID " + charmedCharacter.m_charmGUID.ToString() + " - character not found!")); return false; } characterFromGUID.m_faction = (Faction)0; characterFromGUID.m_swimSpeed *= 10f; AddCharmEffect(characterFromGUID, playParticleEffect); MonsterAI component = ((Component)characterFromGUID).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { if ((Object)(object)Player.m_localPlayer != (Object)null && (Object)(object)((Component)Player.m_localPlayer).gameObject != (Object)null) { component.SetFollowTarget(((Component)Player.m_localPlayer).gameObject); } component.m_attackPlayerObjects = false; component.m_fleeIfNotAlerted = false; component.m_fleeIfLowHealth = 0f; component.m_fleeIfHurtWhenTargetCantBeReached = false; ((BaseAI)component).m_afraidOfFire = false; ((BaseAI)component).m_avoidFire = false; component.m_avoidLand = false; ((BaseAI)component).m_avoidWater = true; component.m_circulateWhileCharging = false; component.m_circleTargetInterval = 0f; ((BaseAI)component).m_passiveAggresive = true; ((BaseAI)component).m_character.m_group = ""; ((BaseAI)component).SetHuntPlayer(false); component.SetTarget(((BaseAI)component).FindEnemy()); ((BaseAI)component).SetTargetInfo(ZDOID.None); ((BaseAI)component).SetAlerted(true); component.SetDespawnInDay(false); } } SetNonTrinketAdrenaline(); return true; } public static void SetUncharmedState(CharmedCharacter cc) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) Character characterFromGUID = GetCharacterFromGUID(cc.m_charmGUID); if (!Object.op_Implicit((Object)(object)characterFromGUID)) { Debug.LogError((object)("Unable to SetUncharmedState for GUID " + cc.m_charmGUID.ToString() + " - character not found!")); return; } RemoveCharmEffect(characterFromGUID); characterFromGUID.m_faction = cc.m_originalFaction; characterFromGUID.m_swimSpeed = cc.m_swimSpeed; MonsterAI component = ((Component)characterFromGUID).GetComponent(); if (Object.op_Implicit((Object)(object)component)) { component.SetFollowTarget((GameObject)null); component.SetTarget((Character)null); } } public static void StartCharmTimer() { if (!__m_charmTimerStarted) { __m_charmTimerStarted = true; ((MonoBehaviour)__m_trophyHuntMod).StartCoroutine(CharmTimerUpdate()); } } public static void StopCharmTimer() { __m_charmTimerStarted = false; } private static IEnumerator CharmTimerUpdate() { while (__m_charmTimerStarted) { __m_charmTimerSeconds++; if (__m_showCharmList) { Debug.LogWarning((object)$"Charm List: {__m_allCharmedCharacters.Count} Timer: {__m_charmTimerSeconds}"); for (int i = 0; i < __m_allCharmedCharacters.Count; i++) { CharmedCharacter charmedCharacter = __m_allCharmedCharacters[i]; Debug.LogWarning((object)$" Charm {i}: GUID {charmedCharacter.m_charmGUID.ToString()} ExpireTime: {charmedCharacter.m_charmExpireTime} Orig Faction: {charmedCharacter.m_originalFaction}"); Character characterFromGUID = GetCharacterFromGUID(charmedCharacter.m_charmGUID); if (!((Object)(object)characterFromGUID != (Object)null)) { continue; } foreach (StatusEffect statusEffect in characterFromGUID.m_seman.GetStatusEffects()) { Debug.LogWarning((object)$" Status Effect: {statusEffect.m_name} TTL: {statusEffect.m_ttl}"); } } } if (__m_allCharmedCharacters.Count > 0) { ShowThrallsWindow(__m_thrallsWindowObject); } else { HideThrallsWindow(); } CharmedCharacter charmedCharacter2 = null; foreach (CharmedCharacter _m_allCharmedCharacter in __m_allCharmedCharacters) { if ((Object)(object)Minimap.instance != (Object)null) { Minimap.instance.RemovePin(_m_allCharmedCharacter.m_pin); } if (__m_charmTimerSeconds >= _m_allCharmedCharacter.m_charmExpireTime) { charmedCharacter2 = _m_allCharmedCharacter; break; } Character characterFromGUID2 = GetCharacterFromGUID(_m_allCharmedCharacter.m_charmGUID); if (Object.op_Implicit((Object)(object)characterFromGUID2)) { _m_allCharmedCharacter.m_pin = Minimap.instance.AddPin(((Component)characterFromGUID2).transform.position, (PinType)3, "", false, false, 0L, default(PlatformUserID)); DarkenThrall(characterFromGUID2); } } if (charmedCharacter2 != null) { SetUncharmedState(charmedCharacter2); if ((Object)(object)Minimap.instance != (Object)null) { Minimap.instance.RemovePin(charmedCharacter2.m_pin); } Character characterFromGUID3 = GetCharacterFromGUID(charmedCharacter2.m_charmGUID); if (Object.op_Implicit((Object)(object)characterFromGUID3)) { ((Character)Player.m_localPlayer).Message((MessageType)2, ((characterFromGUID3 != null) ? characterFromGUID3.GetHoverName() : null) + " is no longer yours.", 0, (Sprite)null); } else { Debug.LogWarning((object)("Target to uncharm not found for Guid " + charmedCharacter2.m_charmGUID)); } RemoveFromCharmedList(charmedCharacter2); } yield return (object)new WaitForSeconds(1f); } } public static void DarkenThrall(Character target) { //IL_0041: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = ((Component)target).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { Material[] materials = componentsInChildren[i].materials; foreach (Material val in materials) { if (val.HasProperty("_Color")) { val.color = new Color(0f, 0f, 0f, 1f); } } } } public static void LightenThrall(Character target) { //IL_002d: Unknown result type (might be due to invalid IL or missing references) Renderer[] componentsInChildren = ((Component)target).GetComponentsInChildren(); for (int i = 0; i < componentsInChildren.Length; i++) { Material[] materials = componentsInChildren[i].materials; foreach (Material val in materials) { if (val.HasProperty("_Color")) { val.color = Color.white; } } } } public static void AddCharmEffect(Character target, bool particleEffect = true) { //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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) DarkenThrall(target); if (!particleEffect) { return; } GameObject prefab = ZNetScene.instance.GetPrefab("fx_hen_love"); if ((Object)(object)prefab != (Object)null) { ParticleSystem componentInChildren = Object.Instantiate(prefab, ((Component)target).transform.position, Quaternion.identity).GetComponentInChildren(); if ((Object)(object)componentInChildren != (Object)null) { componentInChildren.Stop(); MainModule main = componentInChildren.main; ((MainModule)(ref main)).startColor = new MinMaxGradient(__m_pinkColor); componentInChildren.Play(); } } else { Debug.LogWarning((object)"[heartVFX] not found."); } } private static void RemoveCharmEffect(Character target) { LightenThrall(target); } public static void ChangeArrow(ObjectDB db, string prefabName, string ingredient, string newName, string newDescription) { //IL_017d: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Expected O, but got Unknown GameObject itemPrefab = db.GetItemPrefab(prefabName); if (!Object.op_Implicit((Object)(object)itemPrefab)) { Debug.LogError((object)("Could not find " + prefabName)); return; } ItemDrop component = itemPrefab.GetComponent(); if (!Object.op_Implicit((Object)(object)component)) { Debug.LogError((object)("Could not find ItemDrop on " + prefabName)); return; } SavedItemData savedItemData = new SavedItemData(); savedItemData.m_name = component.m_itemData.m_shared.m_name; savedItemData.m_description = component.m_itemData.m_shared.m_description; if (!__m_originalArrows.ContainsKey(prefabName)) { __m_originalArrows[prefabName] = savedItemData; } component.m_itemData.m_shared.m_description = newDescription; component.m_itemData.m_shared.m_name = newName; Recipe val = db.m_recipes.Find((Recipe r) => ((Object)r).name == "Recipe_" + prefabName); if (Object.op_Implicit((Object)(object)val)) { __m_originalArrowRecipes[prefabName] = val; db.m_recipes.Remove(val); Recipe val2 = Object.Instantiate(val); val2.m_item = component; val2.m_amount = 20; val2.m_enabled = true; if (prefabName == "ArrowWood") { val2.m_craftingStation = null; val2.m_minStationLevel = 0; } val2.m_resources = (Requirement[])(object)new Requirement[1] { new Requirement { m_resItem = db.GetItemPrefab(ingredient).GetComponent(), m_amount = 1, m_amountPerLevel = 0 } }; db.m_recipes.Add(val2); } else { Debug.LogError((object)("Could not find Recipe_" + prefabName)); } } public static void RestoreArrow(ObjectDB db, string prefabName) { if (__m_originalArrows.ContainsKey(prefabName)) { GameObject itemPrefab = db.GetItemPrefab(prefabName); if (Object.op_Implicit((Object)(object)itemPrefab)) { ItemDrop component = itemPrefab.GetComponent(); component.m_itemData.m_shared.m_name = __m_originalArrows[prefabName].m_name; component.m_itemData.m_shared.m_description = __m_originalArrows[prefabName].m_description; } } if (!__m_originalArrowRecipes.ContainsKey(prefabName)) { return; } Recipe val = __m_originalArrowRecipes[prefabName]; if (Object.op_Implicit((Object)(object)val)) { Recipe val2 = db.m_recipes.Find((Recipe r) => ((Object)r).name == "Recipe_" + prefabName); if (Object.op_Implicit((Object)(object)val2)) { db.m_recipes.Remove(val2); } db.m_recipes.Add(val); } } public static void ChangeArrowsAndRecipes(ObjectDB db) { __m_originalArrows.Clear(); __m_originalArrowRecipes.Clear(); GandrArrowData[] _m_gandrArrowData = __m_gandrArrowData; foreach (GandrArrowData gandrArrowData in _m_gandrArrowData) { ChangeArrow(db, gandrArrowData.m_arrowName, gandrArrowData.m_ingredient, gandrArrowData.m_name, gandrArrowData.m_description); } db.UpdateRegisters(); } public static void RestoreArrowsAndRecipes(ObjectDB db) { GandrArrowData[] _m_gandrArrowData = __m_gandrArrowData; foreach (GandrArrowData gandrArrowData in _m_gandrArrowData) { RestoreArrow(db, gandrArrowData.m_arrowName); } __m_originalArrows.Clear(); __m_originalArrowRecipes.Clear(); db.UpdateRegisters(); } public static void ApplyGandrEffect(string arrowName, Character hitChar, bool wasCharmed = false) { if ((Object)(object)hitChar == (Object)null) { return; } GandrArrowData gandrArrowData = __m_gandrArrowData.First((GandrArrowData a) => arrowName.ToLower() == a.m_name.ToLower()); if (gandrArrowData == null) { Debug.LogError((object)("No GandrArrowData found for arrow " + arrowName)); } else if (gandrArrowData.m_statusEffectType != null) { List statusEffects = hitChar.m_seman.GetStatusEffects(); foreach (StatusEffect item in statusEffects) { if (((object)item).GetType() == gandrArrowData.m_statusEffectType) { statusEffects.Remove(item); break; } } ScriptableObject obj = ScriptableObject.CreateInstance(gandrArrowData.m_statusEffectType); StatusEffect val = (StatusEffect)(object)((obj is StatusEffect) ? obj : null); val = hitChar.m_seman.AddStatusEffect(val, true, 0, 0f); if ((Object)(object)val != (Object)null) { ((Character)Player.m_localPlayer).Message((MessageType)2, hitChar.GetHoverName() + gandrArrowData.m_description, 0, (Sprite)null); } else { Debug.LogError((object)$"ApplyGandrEffect: Failed to add status effect {gandrArrowData.m_statusEffectType} to {((Object)hitChar).name}"); } } else if (wasCharmed) { ((Character)Player.m_localPlayer).Message((MessageType)2, hitChar.GetHoverName() + " continues to serve you!", 0, (Sprite)null); } else { ((Character)Player.m_localPlayer).Message((MessageType)2, hitChar.GetHoverName() + " is under your thrall!", 0, (Sprite)null); } } public static void ScaleThrallIncomingDamage(Character me, ref HitData hit, float charmLevel = 1f, float adrenalineScalar = 0.5f, float damageReceivedModifier = 1f) { ((DamageTypes)(ref hit.m_damage)).Modify(1f / Math.Max(1f, charmLevel / 2f + adrenalineScalar) * damageReceivedModifier); } public static void ScaleThrallOutgoingDamage(ref HitData hit, float charmLevel = 1f, float adrenalineScalar = 0.5f, float damageInflictedModifier = 1f) { ((DamageTypes)(ref hit.m_damage)).Modify(Math.Max(1f, charmLevel / 2f + adrenalineScalar) * damageInflictedModifier); } public static void CreateCharmIconsInMasterHud(Transform parentTransform) { //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) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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) for (int i = 0; i < MAX_NUM_CHARM_ICONS; i++) { GameObject val = new GameObject($"CharmIcon{i}"); val.transform.SetParent(parentTransform); RectTransform obj = val.AddComponent(); obj.sizeDelta = new Vector2(32f, 32f); obj.anchoredPosition = new Vector2(0f, 0f); ((Transform)obj).localScale = new Vector3(1f, 1f, 1f); Image obj2 = val.AddComponent(); ((Graphic)obj2).color = Color.white; ((Graphic)obj2).raycastTarget = false; } } public static void CacheSprites() { CachedSprite[] _m_cachedPacifistSprites = __m_cachedPacifistSprites; foreach (CachedSprite cachedSprite in _m_cachedPacifistSprites) { if ((Object)(object)cachedSprite.m_sprite == (Object)null) { cachedSprite.m_sprite = GetSpriteFromAtlas(cachedSprite.m_name, "IconAtlas"); } } } public static Sprite LoadSpriteByName(string spriteName) { return ((IEnumerable)Resources.FindObjectsOfTypeAll()).FirstOrDefault((Func)((Sprite s) => ((Object)s).name == spriteName)); } public static Sprite GetSpriteFromAtlas(string spriteName, string atlasName) { SpriteAtlas[] array = Resources.FindObjectsOfTypeAll(); foreach (SpriteAtlas val in array) { if (!(((Object)val).name != atlasName)) { Sprite sprite = val.GetSprite(spriteName); if (sprite != null) { return sprite; } } } return null; } public static void ReleaseAllThralls() { for (int num = __m_allCharmedCharacters.Count - 1; num >= 0; num--) { CharmedCharacter charmedCharacter = __m_allCharmedCharacters[num]; SetUncharmedState(charmedCharacter); RemoveGUIDFromCharmedList(charmedCharacter.m_charmGUID); } } public static void SetCharmLevel(int charmLevel) { for (int num = __m_allCharmedCharacters.Count - 1; num >= 0; num--) { __m_allCharmedCharacters[num].m_charmLevel = charmLevel; } } public static void PrintSpawnSystem(List ssls, string name) { Debug.Log((object)$" SpawnLists '{name}' Count: {ssls.Count} {ssls.GetHashCode()}"); using StreamWriter streamWriter = new StreamWriter("SpawnDataDump2" + name + ".txt", append: false); foreach (SpawnSystemList ssl in ssls) { streamWriter.WriteLine($"SpawnList: {((ssl != null) ? ((Object)ssl).name : null)} {((object)ssl)?.GetHashCode().ToString()} {ssl.m_spawners?.Count}"); foreach (SpawnData item in ssl?.m_spawners) { streamWriter.WriteLine($" {item.m_name} {item.m_spawnChance}% Max: {item.m_maxSpawned} Interval:{item.m_spawnInterval} RadiusMin:{item.m_spawnRadiusMin} RadiusMax:{item.m_spawnRadiusMax} SpawnDistance: {item.m_spawnDistance}"); } } } public static void DoBackupSpawnData(List spawnLists, ref Dictionary> outDict) { outDict = new Dictionary>(); foreach (SpawnSystemList spawnList in spawnLists) { int hashCode = ((object)spawnList).GetHashCode(); Dictionary dictionary = new Dictionary(); outDict.Add(hashCode, dictionary); foreach (SpawnData spawner in spawnList.m_spawners) { int hashCode2 = ((object)spawner).GetHashCode(); BackupSpawnData backupSpawnData = new BackupSpawnData(); backupSpawnData.m_spawnInterval = spawner.m_spawnInterval; backupSpawnData.m_spawnChance = spawner.m_spawnChance; backupSpawnData.m_maxSpawned = spawner.m_maxSpawned; backupSpawnData.m_spawnRadiusMin = spawner.m_spawnRadiusMin; backupSpawnData.m_spawnRadiusMax = spawner.m_spawnRadiusMax; backupSpawnData.m_spawnDistance = spawner.m_spawnDistance; dictionary.Add(hashCode2, backupSpawnData); } } } public static void DoRestoreSpawnData(Dictionary> backupData, ref List spawnLists) { foreach (SpawnSystemList spawnList in spawnLists) { Dictionary dictionary = backupData[((object)spawnList).GetHashCode()]; foreach (SpawnData spawner in spawnList.m_spawners) { BackupSpawnData backupSpawnData = dictionary[((object)spawner).GetHashCode()]; spawner.m_spawnInterval = backupSpawnData.m_spawnInterval; spawner.m_spawnChance = backupSpawnData.m_spawnChance; spawner.m_maxSpawned = backupSpawnData.m_maxSpawned; spawner.m_spawnRadiusMin = backupSpawnData.m_spawnRadiusMin; spawner.m_spawnRadiusMax = backupSpawnData.m_spawnRadiusMax; spawner.m_spawnDistance = backupSpawnData.m_spawnDistance; } } } public static void CreateThrallsWindow(Transform parentTransform) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Expected O, but got Unknown //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00a3: Expected O, but got Unknown //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: 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_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) __m_thrallsWindowBackground = new GameObject("Thrall Window Background"); __m_thrallsWindowBackground.transform.SetParent(parentTransform, false); Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(-90f, 360f); RectTransform obj = __m_thrallsWindowBackground.AddComponent(); obj.sizeDelta = __m_thrallsTooltipWindowSize; obj.anchoredPosition = val; obj.pivot = new Vector2(0f, 0f); ((Graphic)__m_thrallsWindowBackground.AddComponent()).color = new Color(0f, 0f, 0f, 0.9f); __m_thrallsWindowBackground.SetActive(false); __m_thrallsWindowObject = new GameObject("Thrall Window Text"); __m_thrallsWindowObject.transform.SetParent(parentTransform, false); RectTransform obj2 = __m_thrallsWindowObject.AddComponent(); obj2.sizeDelta = new Vector2(__m_thrallsTooltipWindowSize.x - __m_thrallsTooltipTextOffset.x, __m_thrallsTooltipWindowSize.y - __m_thrallsTooltipTextOffset.y); obj2.anchoredPosition = val + new Vector2(5f, 0f); obj2.pivot = new Vector2(0f, 0f); __m_thrallsWindowText = AddTextMeshProComponent(__m_thrallsWindowObject); ((TMP_Text)__m_thrallsWindowText).fontSize = 14f; ((TMP_Text)__m_thrallsWindowText).alignment = (TextAlignmentOptions)257; ((Graphic)__m_thrallsWindowText).color = Color.yellow; __m_thrallsWindowObject.SetActive(true); } public static string BuildThrallsWindowText(ref int lines) { string text = "Thralls\n"; text += "\nFriend(Level)HealthRemain\n"; int num = 0; foreach (CharmedCharacter _m_allCharmedCharacter in __m_allCharmedCharacters) { Character characterFromGUID = GetCharacterFromGUID(_m_allCharmedCharacter.m_charmGUID); if (!((Object)(object)characterFromGUID == (Object)null)) { float num2 = _m_allCharmedCharacter.m_charmExpireTime - __m_charmTimerSeconds; DateTime minValue = DateTime.MinValue; string text2 = minValue.AddSeconds(num2).ToString("m'm 's's'"); text += $"{num + 1}: {characterFromGUID.GetHoverName()}({_m_allCharmedCharacter.m_charmLevel}){(int)(characterFromGUID.GetHealthPercentage() * 100f)}%{text2}\n"; num++; } } for (int num3 = 5 - num; num3 > 0; num3--) { text += $"{num + 1}: -- Unused -- --------\n"; num++; } lines = num; return text; } public static void ShowThrallsWindow(GameObject uiObject) { if ((Object)(object)uiObject == (Object)null) { Debug.LogError((object)"ShowThrallsWindow: uiObject is null!"); return; } int lines = 0; string text = BuildThrallsWindowText(ref lines); ((TMP_Text)__m_thrallsWindowText).text = text; ((TMP_Text)__m_thrallsWindowText).ForceMeshUpdate(true, true); __m_thrallsWindowBackground.SetActive(true); __m_thrallsWindowObject.SetActive(true); ((TMP_Text)__m_thrallsWindowText).ForceMeshUpdate(true, true); } public static void HideThrallsWindow() { __m_thrallsWindowBackground.SetActive(false); __m_thrallsWindowObject.SetActive(false); } 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 //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Expected O, but got Unknown //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_0286: Unknown result type (might be due to invalid IL or missing references) //IL_028b: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Expected O, but got Unknown //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02be: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02c9: Expected O, but got Unknown //IL_030a: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Expected O, but got Unknown //IL_0342: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0339: Expected O, but got Unknown //IL_037a: Unknown result type (might be due to invalid IL or missing references) //IL_0366: Unknown result type (might be due to invalid IL or missing references) //IL_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0371: Expected O, but got Unknown //IL_03b2: Unknown result type (might be due to invalid IL or missing references) //IL_039e: Unknown result type (might be due to invalid IL or missing references) //IL_03a3: Unknown result type (might be due to invalid IL or missing references) //IL_03a9: Expected O, but got Unknown //IL_03ea: Unknown result type (might be due to invalid IL or missing references) //IL_03d6: Unknown result type (might be due to invalid IL or missing references) //IL_03db: Unknown result type (might be due to invalid IL or missing references) //IL_03e1: Expected O, but got Unknown object obj = <>c.<>9__113_0; if (obj == null) { ConsoleEventFailable val = delegate(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]"); PrintToConsole("Trophies:"); int num5 = CalculateTrophyPoints(displayToLog: true); PrintToConsole($"Trophy Score Total: {num5}"); int num6 = CalculateDeathPenalty(); int num7 = CalculateLogoutPenalty(); PrintToConsole("Penalties:"); PrintToConsole($" Deaths: {__m_deaths} Score: {num6}"); PrintToConsole($" Logouts: {__m_logoutCount} Score: {num7}"); int num8 = 0; if (GetGameMode() == TrophyGameMode.TrophyRush) { CalculateBiomeBonusScore(Player.m_localPlayer); PrintToConsole($"Biome Bonus Total: {num8}"); } num5 += num6; num5 += num7; num5 += num8; PrintToConsole($"Total Score: {num5}"); if (args.Length > 1) { _ = args[1]; } return true; }; <>c.<>9__113_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__113_1; if (obj2 == null) { ConsoleEvent val2 = delegate { //IL_009c: Unknown result type (might be due to invalid IL or missing references) ObjectDB instance = ObjectDB.instance; if ((Object)(object)instance == (Object)null) { Debug.LogError((object)"ObjectDB is not initialized yet."); return; } foreach (Recipe recipe in instance.m_recipes) { if (!((Object)(object)recipe == (Object)null) && (Object)(object)recipe.m_item != (Object)null) { CraftingStation craftingStation = recipe.m_craftingStation; string text2 = "n/a"; if (Object.op_Implicit((Object)(object)craftingStation)) { text2 = ((Object)craftingStation).name; } int minStationLevel = recipe.m_minStationLevel; Debug.LogWarning((object)$"{((Object)recipe).name} {recipe.m_item.m_itemData.m_shared.m_itemType}: {text2} {minStationLevel}"); Requirement[] resources = recipe.m_resources; foreach (Requirement val21 in resources) { Debug.LogWarning((object)$" req: {((Object)val21.m_resItem).name} {val21.m_amount}"); } } } }; <>c.<>9__113_1 = val2; obj2 = (object)val2; } new ConsoleCommand("dumprecipes", "Dump all recipes", (ConsoleEvent)obj2, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj3 = <>c.<>9__113_2; if (obj3 == null) { ConsoleEvent val3 = delegate { if (!Object.op_Implicit((Object)(object)Game.instance)) { PrintToConsole("'showpath' console command can only be used in-game."); } ShowPlayerPath(showPlayerPath: true); }; <>c.<>9__113_2 = val3; obj3 = (object)val3; } new ConsoleCommand("showpath", "Show the player's path", (ConsoleEvent)obj3, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj4 = <>c.<>9__113_3; if (obj4 == null) { ConsoleEvent val4 = delegate { if (!Object.op_Implicit((Object)(object)Game.instance)) { PrintToConsole("'showbosses' console command can only be used in-game."); } RevealAllBosses(Player.m_localPlayer); }; <>c.<>9__113_3 = val4; obj4 = (object)val4; } new ConsoleCommand("showbosses", "Show all potential boss locations", (ConsoleEvent)obj4, true, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj5 = <>c.<>9__113_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()).color = Color.green; } if ((Object)(object)__m_relogsTextElement != (Object)null && __m_ignoreLogouts) { ((Graphic)__m_relogsTextElement.GetComponent()).color = Color.gray; } } }; <>c.<>9__113_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__113_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("'/showalltrophystats' can only be used in gameplay."); } else { ToggleShowAllTrophyStats(); __m_invalidForTournamentPlay = true; if ((Object)(object)__m_scoreTextElement != (Object)null && __m_showAllTrophyStats) { ((Graphic)__m_scoreTextElement.GetComponent()).color = Color.green; } InitializeSagaDrops(); } }; <>c.<>9__113_5 = val6; obj6 = (object)val6; } new ConsoleCommand("showalltrophystats", "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__113_6; if (obj7 == null) { ConsoleEvent val7 = delegate { if (!Object.op_Implicit((Object)(object)Game.instance)) { PrintToConsole("'togglescorebackground' console command can only be used in-game."); } __m_scoreBGElement.GetComponent(); __m_scoreBGElement.SetActive(!__m_scoreBGElement.activeSelf); }; <>c.<>9__113_6 = val7; obj7 = (object)val7; } new ConsoleCommand("togglescorebackground", "Toggle black background underneath the score", (ConsoleEvent)obj7, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj8 = <>c.<>9__113_7; if (obj8 == null) { ConsoleEvent val8 = delegate(ConsoleEventArgs args) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) 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_userTextScale = num4; } else { __m_userTextScale = 1f; } ((Transform)__m_scoreTextElement.GetComponent()).localScale = new Vector3(__m_userTextScale, __m_userTextScale, __m_userTextScale); }; <>c.<>9__113_7 = val8; obj8 = (object)val8; } new ConsoleCommand("scorescale", "Scale the score text sizes (1.0 is default)", (ConsoleEvent)obj8, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj9 = <>c.<>9__113_8; if (obj9 == null) { ConsoleEvent val9 = 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_userIconScale = num2; if (args.Length > 2) { float num3 = float.Parse(args[2]); if (num3 == 0f) { num3 = 1f; } __m_baseTrophyScale = num3; } } else { __m_userIconScale = 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 val20 = __m_iconList.Find((GameObject gameObject) => ((Object)gameObject).name == trophyName); if ((Object)(object)val20 != (Object)null && (Object)(object)val20.GetComponent() != (Object)null) { RectTransform component = val20.GetComponent(); if ((Object)(object)component != (Object)null) { ((Transform)component).localScale = new Vector3(__m_baseTrophyScale, __m_baseTrophyScale, __m_baseTrophyScale) * __m_userIconScale; } } } } }; <>c.<>9__113_8 = val9; obj9 = (object)val9; } new ConsoleCommand("trophyscale", "Scale the trophy sizes (1.0 is default)", (ConsoleEvent)obj9, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj10 = <>c.<>9__113_9; if (obj10 == null) { ConsoleEvent val10 = 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 val19 = ((Component)Hud.instance).transform.Find("hudroot/healthpanel"); if ((Object)(object)val19 == (Object)null) { Debug.LogError((object)"Health panel transform not found."); } else { DeleteTrophyIconElements(__m_iconList); __m_trophyCountList.Clear(); CreateTrophyIconElements(val19, __m_trophyHuntData, __m_iconList, __m_trophyCountList); EnableTrophyHuntIcons(localPlayer); } } }; <>c.<>9__113_9 = val10; obj10 = (object)val10; } new ConsoleCommand("trophyspacing", "Space the trophies out (negative and positive numbers work)", (ConsoleEvent)obj10, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj11 = <>c.<>9__113_10; if (obj11 == null) { ConsoleEvent val11 = 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__113_10 = val11; obj11 = (object)val11; } new ConsoleCommand("showtrophies", "Toggle Trophy Rush Mode on and off", (ConsoleEvent)obj11, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj12 = <>c.<>9__113_11; if (obj12 == null) { ConsoleEvent val12 = delegate { if (!Object.op_Implicit((Object)(object)Game.instance)) { PrintToConsole("'/showonlydeaths' console command can only be used during gameplay."); } else { __m_showOnlyDeaths = !__m_showOnlyDeaths; ShowOnlyDeaths(__m_showOnlyDeaths); } }; <>c.<>9__113_11 = val12; obj12 = (object)val12; } new ConsoleCommand("showonlydeaths", "Hide all of the UI except for the death counter", (ConsoleEvent)obj12, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj13 = <>c.<>9__113_12; if (obj13 == null) { ConsoleEvent val13 = delegate { //IL_004a: Unknown result type (might be due to invalid IL or missing references) __m_elderPowerCutsAllTrees = !__m_elderPowerCutsAllTrees; PrintToConsole($"elder power cuts all trees: {__m_elderPowerCutsAllTrees}"); if (__m_elderPowerCutsAllTrees) { __m_invalidForTournamentPlay = true; if ((Object)(object)__m_scoreTextElement != (Object)null) { ((Graphic)__m_scoreTextElement.GetComponent()).color = Color.green; } } }; <>c.<>9__113_12 = val13; obj13 = (object)val13; } new ConsoleCommand("elderpowercutsalltrees", "All trees are choppable while elder power active", (ConsoleEvent)obj13, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj14 = <>c.<>9__113_13; if (obj14 == null) { ConsoleEvent val14 = delegate(ConsoleEventArgs args) { if (!Object.op_Implicit((Object)(object)Game.instance)) { PrintToConsole("'timer' console command can only be used in-game."); } if (!((Object)(object)__m_gameTimerTextElement == (Object)null) && args.Length > 1) { string text = args[1].Trim(); if (text != null) { switch (text.Length) { case 5: switch (text[0]) { case 's': if (text == "start") { TimerStart(); } break; case 'r': if (text == "reset") { TimerReset(); } break; } break; case 4: switch (text[1]) { case 't': if (text == "stop") { TimerStop(); } break; case 'h': if (text == "show") { __m_gameTimerVisible = true; } break; case 'i': if (text == "hide") { __m_gameTimerVisible = false; } break; } break; case 3: if (text == "set") { TimerSet(args[2]); } break; case 6: if (text == "toggle") { TimerToggle(); } break; } } } }; <>c.<>9__113_13 = val14; obj14 = (object)val14; } new ConsoleCommand("timer", "Control the Trophy Hunt Timer display (start/stop/reset/show/hide)", (ConsoleEvent)obj14, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj15 = <>c.<>9__113_14; if (obj15 == null) { ConsoleEvent val15 = delegate(ConsoleEventArgs args) { if (!Object.op_Implicit((Object)(object)Game.instance)) { PrintToConsole("'boatspeedmultiplier' console command can only be used in-game."); } __m_sagaSailingSpeedMultiplier = int.Parse(args[1]); UpdateModUI(Player.m_localPlayer); }; <>c.<>9__113_14 = val15; obj15 = (object)val15; } new ConsoleCommand("boatspeedmultiplier", "How fast do you want to go?", (ConsoleEvent)obj15, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj16 = <>c.<>9__113_15; if (obj16 == null) { ConsoleEvent val16 = delegate { if (!Object.op_Implicit((Object)(object)Game.instance)) { PrintToConsole("'showcharmlist' console command can only be used in-game."); } __m_showCharmList = !__m_showCharmList; }; <>c.<>9__113_15 = val16; obj16 = (object)val16; } new ConsoleCommand("showcharmlist", "Show the list of charmed enemies in the debug log", (ConsoleEvent)obj16, false, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj17 = <>c.<>9__113_16; if (obj17 == null) { ConsoleEvent val17 = delegate { if (!Object.op_Implicit((Object)(object)Game.instance)) { PrintToConsole("'releasethralls' console command can only be used in-game."); } ReleaseAllThralls(); }; <>c.<>9__113_16 = val17; obj17 = (object)val17; } new ConsoleCommand("releasethralls", "On-charm all current Thralls", (ConsoleEvent)obj17, true, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); object obj18 = <>c.<>9__113_17; if (obj18 == null) { ConsoleEvent val18 = delegate(ConsoleEventArgs args) { if (!Object.op_Implicit((Object)(object)Game.instance)) { PrintToConsole("'charmLevel' console command can only be used in-game."); } int charmLevel = 0; if (args.Length > 1) { charmLevel = int.Parse(args[1]); } SetCharmLevel(charmLevel); }; <>c.<>9__113_17 = val18; obj18 = (object)val18; } new ConsoleCommand("charmLevel", "Set charm level of all thralls", (ConsoleEvent)obj18, true, false, false, false, false, (ConsoleOptionsFetcher)null, false, false, false); } private static TextMeshProUGUI AddTextMeshProComponent(GameObject toThisObject) { TextMeshProUGUI obj = toThisObject.AddComponent(); ((TMP_Text)obj).font = __m_globalFontObject; ((Graphic)obj).material = ((TMP_Asset)__m_globalFontObject).material; return obj; } public static TrophyGameMode GetGameMode() { return __m_trophyGameMode; } public static string GetGameModeString(TrophyGameMode mode) { string text = "Unknown"; switch (mode) { case TrophyGameMode.TrophyHunt: text = "Trophy Hunt"; break; case TrophyGameMode.TrophyRush: text = "Trophy Rush"; break; case TrophyGameMode.TrophySaga: text = "Trophy Saga"; break; case TrophyGameMode.TrophyBlitz: text = "Trophy Blitz"; break; case TrophyGameMode.TrophyTrailblazer: text = "Trailblazer!"; break; case TrophyGameMode.TrophyFarmer: text = "Trophy Farmer!"; break; case TrophyGameMode.TrophyPacifist: text = "Trophy Pacifist"; break; case TrophyGameMode.CulinarySaga: text = "Culinary Saga"; break; case TrophyGameMode.CasualSaga: text = "Casual Saga"; break; case TrophyGameMode.TrophyFiesta: text = "Trophy Fiesta"; break; default: return "Unknown"; } if (IsPacifist() && mode != TrophyGameMode.TrophyPacifist) { text += " Pacifist"; } return text; } public static bool IsSagaMode() { if (__m_trophyGameMode != TrophyGameMode.CasualSaga && __m_trophyGameMode != TrophyGameMode.CulinarySaga) { return __m_trophyGameMode == TrophyGameMode.TrophySaga; } return true; } public static bool IsPacifist() { if (!__m_pacifistEnabled) { return GetGameMode() == TrophyGameMode.TrophyPacifist; } return true; } private void DoStackCrawl() { StackFrame[] frames = new StackTrace(fNeedFileInfo: true).GetFrames(); foreach (StackFrame stackFrame in frames) { Debug.LogWarning((object)$" Method: {stackFrame.GetMethod().Name}, File: {stackFrame.GetFileName()}, Line: {stackFrame.GetFileLineNumber()}"); } } private static string GetPersistentDataKey() { return __m_saveDataVersionNumber + __m_storedGameMode.ToString() + __m_storedWorldSeed + (IsPacifist() ? "P" : "_"); } private static void SavePersistentData() { //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0297: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Player.m_localPlayer == (Object)null || Player.m_localPlayer.m_customData == null) { return; } string persistentDataKey = GetPersistentDataKey(); THMSaveData tHMSaveData = new THMSaveData(); tHMSaveData.m_playerTrophyDropInfos = new List(); foreach (KeyValuePair item in __m_playerTrophyDropInfo) { THMSaveData.THMSaveDataDropInfo tHMSaveDataDropInfo = new THMSaveData.THMSaveDataDropInfo(); tHMSaveDataDropInfo.m_name = item.Key; tHMSaveDataDropInfo.m_dropInfo = item.Value; tHMSaveData.m_playerTrophyDropInfos.Add(tHMSaveDataDropInfo); } tHMSaveData.m_allTrophyDropInfos = new List(); foreach (KeyValuePair item2 in __m_allTrophyDropInfo) { THMSaveData.THMSaveDataDropInfo tHMSaveDataDropInfo2 = new THMSaveData.THMSaveDataDropInfo(); tHMSaveDataDropInfo2.m_name = item2.Key; tHMSaveDataDropInfo2.m_dropInfo = item2.Value; tHMSaveData.m_allTrophyDropInfos.Add(tHMSaveDataDropInfo2); } tHMSaveData.m_specialSagaDropCounts = new List(); foreach (KeyValuePair> _m_specialSagaDrop in __m_specialSagaDrops) { foreach (SpecialSagaDrop item3 in _m_specialSagaDrop.Value) { string name = _m_specialSagaDrop.Key + "," + item3.m_itemName; THMSaveData.THMSaveDataSpecialSagaDropCount tHMSaveDataSpecialSagaDropCount = new THMSaveData.THMSaveDataSpecialSagaDropCount(); tHMSaveDataSpecialSagaDropCount.m_name = name; tHMSaveDataSpecialSagaDropCount.m_dropCount = item3.m_numDropped; tHMSaveDataSpecialSagaDropCount.m_numPickedUp = item3.m_numPickedUp; tHMSaveData.m_specialSagaDropCounts.Add(tHMSaveDataSpecialSagaDropCount); } } tHMSaveData.m_pendingEvents = __m_pendingEvents; tHMSaveData.m_trophyPins = __m_trophyPins; tHMSaveData.m_gameTimerElapsedSeconds = __m_gameTimerElapsedSeconds; tHMSaveData.m_internalTimerElapsedSeconds = __m_internalTimerElapsedSeconds; tHMSaveData.m_gameTimerActive = __m_gameTimerActive; tHMSaveData.m_gameTimerVisible = __m_gameTimerVisible; tHMSaveData.m_gameTimerCountdown = __m_gameTimerCountdown; tHMSaveData.m_charmTimerSeconds = __m_charmTimerSeconds; tHMSaveData.m_charmedCharacters = new List(); foreach (CharmedCharacter _m_allCharmedCharacter in __m_allCharmedCharacters) { THMSaveData.THMSaveDataCharmedCharacter tHMSaveDataCharmedCharacter = new THMSaveData.THMSaveDataCharmedCharacter(); tHMSaveDataCharmedCharacter.m_pos = _m_allCharmedCharacter.m_pin.m_pos; tHMSaveDataCharmedCharacter.m_pinType = _m_allCharmedCharacter.m_pin.m_type; tHMSaveDataCharmedCharacter.m_charmGUID = _m_allCharmedCharacter.m_charmGUID; tHMSaveDataCharmedCharacter.m_charmTimeRemaining = _m_allCharmedCharacter.m_charmExpireTime - __m_charmTimerSeconds; tHMSaveDataCharmedCharacter.m_originalFaction = _m_allCharmedCharacter.m_originalFaction; tHMSaveDataCharmedCharacter.m_swimSpeed = _m_allCharmedCharacter.m_swimSpeed; tHMSaveDataCharmedCharacter.m_charmLevel = _m_allCharmedCharacter.m_charmLevel; tHMSaveData.m_charmedCharacters.Add(tHMSaveDataCharmedCharacter); } tHMSaveData.m_slashDieCount = __m_slashDieCount; tHMSaveData.m_logoutCount = __m_logoutCount; tHMSaveData.m_storedPlayerID = __m_storedPlayerID; tHMSaveData.m_storedGameMode = __m_storedGameMode; tHMSaveData.m_storedWorldSeed = __m_storedWorldSeed; tHMSaveData.m_cookedFoods = __m_cookedFoods; tHMSaveData.m_playerEventLog = __m_playerEventLog; tHMSaveData.m_trophyCounts = new List(); foreach (KeyValuePair _m_farmerTrophyCount in __m_farmerTrophyCounts) { THMSaveData.THMTrophyCount tHMTrophyCount = new THMSaveData.THMTrophyCount(); tHMTrophyCount.m_name = _m_farmerTrophyCount.Key; tHMTrophyCount.m_count = _m_farmerTrophyCount.Value; tHMSaveData.m_trophyCounts.Add(tHMTrophyCount); } XmlSerializer xmlSerializer = new XmlSerializer(typeof(THMSaveData)); StringWriter stringWriter = new StringWriter(); xmlSerializer.Serialize(stringWriter, tHMSaveData); string value = stringWriter.ToString(); Player.m_localPlayer.m_customData[persistentDataKey] = value; } private static void LoadPersistentData() { //IL_0150: 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_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Expected O, but got Unknown //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) string persistentDataKey = GetPersistentDataKey(); if ((Object)(object)Player.m_localPlayer == (Object)null || !Player.m_localPlayer.m_customData.ContainsKey(persistentDataKey)) { return; } string s = Player.m_localPlayer.m_customData[persistentDataKey]; XmlSerializer xmlSerializer = new XmlSerializer(typeof(THMSaveData)); StringReader textReader = new StringReader(s); THMSaveData tHMSaveData = xmlSerializer.Deserialize(textReader) as THMSaveData; if (tHMSaveData.m_pendingEvents != null && tHMSaveData.m_pendingEvents.Count > __m_pendingEvents.Count) { __m_pendingEvents = tHMSaveData.m_pendingEvents; } if (__m_trophyPins != null) { __m_trophyPins = tHMSaveData.m_trophyPins; } if (__m_gameTimerElapsedSeconds < tHMSaveData.m_gameTimerElapsedSeconds) { __m_gameTimerElapsedSeconds = tHMSaveData.m_gameTimerElapsedSeconds; } if (__m_internalTimerElapsedSeconds < tHMSaveData.m_internalTimerElapsedSeconds) { __m_internalTimerElapsedSeconds = tHMSaveData.m_internalTimerElapsedSeconds; } __m_gameTimerActive = tHMSaveData.m_gameTimerActive; __m_gameTimerVisible = tHMSaveData.m_gameTimerVisible; __m_gameTimerCountdown = tHMSaveData.m_gameTimerCountdown; if (__m_charmTimerSeconds < tHMSaveData.m_charmTimerSeconds) { __m_charmTimerSeconds = tHMSaveData.m_charmTimerSeconds; } __m_allCharmedCharacters.Clear(); foreach (THMSaveData.THMSaveDataCharmedCharacter charmedCharacter2 in tHMSaveData.m_charmedCharacters) { CharmedCharacter charmedCharacter = new CharmedCharacter(); charmedCharacter.m_charmGUID = charmedCharacter2.m_charmGUID; charmedCharacter.m_charmExpireTime = __m_charmTimerSeconds + charmedCharacter2.m_charmTimeRemaining; charmedCharacter.m_originalFaction = charmedCharacter2.m_originalFaction; charmedCharacter.m_pin = new PinData(); charmedCharacter.m_pin.m_type = charmedCharacter2.m_pinType; charmedCharacter.m_pin.m_pos = charmedCharacter2.m_pos; charmedCharacter.m_swimSpeed = charmedCharacter2.m_swimSpeed; charmedCharacter.m_charmLevel = charmedCharacter2.m_charmLevel; __m_allCharmedCharacters.Add(charmedCharacter); } __m_slashDieCount = tHMSaveData.m_slashDieCount; __m_logoutCount = tHMSaveData.m_logoutCount; __m_storedPlayerID = tHMSaveData.m_storedPlayerID; __m_storedGameMode = tHMSaveData.m_storedGameMode; __m_storedWorldSeed = tHMSaveData.m_storedWorldSeed; __m_cookedFoods = tHMSaveData.m_cookedFoods; __m_playerEventLog = tHMSaveData.m_playerEventLog; __m_farmerTrophyCounts.Clear(); foreach (THMSaveData.THMTrophyCount trophyCount in tHMSaveData.m_trophyCounts) { __m_farmerTrophyCounts[trophyCount.m_name] = trophyCount.m_count; } foreach (THMSaveData.THMSaveDataDropInfo playerTrophyDropInfo in tHMSaveData.m_playerTrophyDropInfos) { if (__m_playerTrophyDropInfo.ContainsKey(playerTrophyDropInfo.m_name)) { DropInfo dropInfo = playerTrophyDropInfo.m_dropInfo; __m_playerTrophyDropInfo[playerTrophyDropInfo.m_name] = dropInfo; } } foreach (THMSaveData.THMSaveDataDropInfo allTrophyDropInfo in tHMSaveData.m_allTrophyDropInfos) { if (__m_allTrophyDropInfo.ContainsKey(allTrophyDropInfo.m_name)) { DropInfo dropInfo2 = allTrophyDropInfo.m_dropInfo; __m_allTrophyDropInfo[allTrophyDropInfo.m_name] = dropInfo2; } } foreach (THMSaveData.THMSaveDataSpecialSagaDropCount specialSagaDropCount in tHMSaveData.m_specialSagaDropCounts) { string[] array = specialSagaDropCount.m_name.Split(new char[1] { ',' }); string key = array[0]; string text = array[1]; List list = __m_specialSagaDrops[key]; for (int i = 0; i < list.Count; i++) { SpecialSagaDrop value = list[i]; if (value.m_itemName == text) { value.m_numDropped = specialSagaDropCount.m_dropCount; value.m_numPickedUp = specialSagaDropCount.m_numPickedUp; list[i] = value; break; } } } } private void Awake() { __m_trophyHuntMod = this; harmony.PatchAll(); AddConsoleCommands(); InitializeTrophyDropInfo(); __m_configDiscordId = ((BaseUnityPlugin)this).Config.Bind("General", "DiscordUserId", "", "When signed in with Discord, the UserID of the Discord user"); __m_configDiscordUser = ((BaseUnityPlugin)this).Config.Bind("General", "DiscordUserName", "", "When signed in with Discord, the User Name of the Discord user"); __m_configDiscordGlobalUser = ((BaseUnityPlugin)this).Config.Bind("General", "DiscordGlobalUserName", "", "When signed in with Discord, the Global User Name of the Discord user"); __m_configDiscordAvatar = ((BaseUnityPlugin)this).Config.Bind("General", "DiscordAvatar", "", "When signed in with Discord, the Avatar id of the Discord user"); __m_configDiscordDiscriminator = ((BaseUnityPlugin)this).Config.Bind("General", "DiscordDiscriminator", "", "When signed in with Discord, the User Discriminator of the Discord user"); Debug.Log((object)("Config __m_configDiscordId:" + __m_configDiscordId.Value)); Debug.Log((object)("Config __m_configDiscordUser:" + __m_configDiscordUser.Value)); Debug.Log((object)("Config __m_configDiscordGlobalUser:" + __m_configDiscordGlobalUser.Value)); __m_loggedInWithDiscord = false; if (__m_configDiscordUser.Value != "") { __m_loggedInWithDiscord = true; } } private void Start() { Dictionary pluginInfos = Chainloader.PluginInfos; Debug.LogError((object)$"[TrophyHut Mod] Found Plugins: {pluginInfos.Count}"); __m_onlyModRunning = true; foreach (KeyValuePair item in pluginInfos) { if (!__m_modWhiteList.Contains(item.Value.Metadata.GUID)) { __m_onlyModRunning = false; Debug.LogError((object)("[TrophyHuntMod] v0.11.5 detected unauthorized mod '" + item.Value.Metadata.Name + "'! Score will not be accepted with this mod enabled!")); } } if (__m_onlyModRunning) { Debug.LogWarning((object)"[TrophyHuntMod] v0.11.5 is loaded and Valheim is running only authorized mods! Let's Hunt!"); } else { Debug.LogError((object)"[TrophyHuntMod] v0.11.5 found unauthorized mods. Score will be cyan colored, indicating invalid entry."); } } public static void InitializeTrophyDropInfo() { __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()); } __m_completedBiomeBonuses.Clear(); } public static void InitializeTrophyCountInfo() { __m_farmerTrophyCounts.Clear(); TrophyHuntData[] _m_trophyHuntData = __m_trophyHuntData; for (int i = 0; i < _m_trophyHuntData.Length; i++) { TrophyHuntData trophyHuntData = _m_trophyHuntData[i]; __m_farmerTrophyCounts[trophyHuntData.m_name] = 0; } } public static void ShowTrophies(bool show) { foreach (GameObject _m_icon in __m_iconList) { _m_icon.SetActive(show); } } public static void ShowOnlyDeaths(bool show) { foreach (GameObject _m_icon in __m_iconList) { _m_icon.SetActive(!show); } if ((Object)(object)__m_luckOMeterElement != (Object)null) { __m_luckOMeterElement.SetActive(!show); } if ((Object)(object)__m_standingsElement != (Object)null) { __m_standingsElement.SetActive(!show); } if ((Object)(object)__m_relogsTextElement != (Object)null) { __m_relogsTextElement.SetActive(!show); } if ((Object)(object)__m_relogsIconElement != (Object)null) { __m_relogsIconElement.SetActive(!show); } if ((Object)(object)__m_scoreTextElement != (Object)null) { __m_scoreTextElement.SetActive(!show); } } public static void ToggleGameMode() { __m_trophyGameMode++; if (__m_trophyGameMode >= TrophyGameMode.TrophyFiesta) { __m_trophyGameMode = TrophyGameMode.TrophyHunt; } if ((Object)(object)__m_trophyHuntMainMenuText != (Object)null) { ((TMP_Text)__m_trophyHuntMainMenuText).text = GetTrophyHuntMainMenuText(); } } public static void TogglePacifist() { __m_pacifistEnabled = !__m_pacifistEnabled; if ((Object)(object)__m_trophyHuntMainMenuText != (Object)null) { ((TMP_Text)__m_trophyHuntMainMenuText).text = GetTrophyHuntMainMenuText(); } } public static void ToggleShowAllTrophyStats() { __m_showAllTrophyStats = !__m_showAllTrophyStats; if (__m_showAllTrophyStats) { 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)) { DeleteTrophyTooltip(); CreateTrophyTooltip(); } if ((Object)(object)__m_trophyHuntMainMenuText != (Object)null) { ((TMP_Text)__m_trophyHuntMainMenuText).text = GetTrophyHuntMainMenuText(); } } public static string GetSagaRulesText() { return string.Concat(string.Concat(string.Concat(string.Concat(string.Concat(string.Concat(string.Concat(string.Concat("" + " * Portals allow all items\n", " * Raids are disabled\n"), " * Boat Speed is increased\n"), " * Ores Insta-smelt on pickup\n"), " * Speedy Production and crops\n"), " * Biome minions can drop Boss Items\n"), " * Greylings/Trolls/Dvergr drop gifts\n"), " * Mining is more productive\n"), " * CheatDeath(tm) within 3 sec.\n"); } public static string GetGameModeNameText() { string result = "???"; switch (GetGameMode()) { case TrophyGameMode.TrophyHunt: result = "Trophy Hunt"; break; case TrophyGameMode.TrophyRush: result = "Trophy Rush"; break; case TrophyGameMode.CasualSaga: result = "Casual Saga"; break; case TrophyGameMode.TrophySaga: result = "Trophy Saga"; break; case TrophyGameMode.TrophyBlitz: result = "Trophy Blitz"; break; case TrophyGameMode.TrophyTrailblazer: result = "Trailblazer"; break; case TrophyGameMode.TrophyFarmer: result = "Trophy Farmer"; break; case TrophyGameMode.TrophyPacifist: result = "Pacifist"; break; case TrophyGameMode.CulinarySaga: result = "Culinary Saga"; break; case TrophyGameMode.TrophyFiesta: result = "Trophy Fiesta"; break; } return result; } public static string GetGameModeText() { string text = ""; float num = 1f; string text2 = "Normal"; string text3 = "Normal"; bool flag = false; bool flag2 = false; string text4 = "None"; text = text + "\nGame Mode: " + GetGameModeString(GetGameMode()) + "\n"; switch (GetGameMode()) { case TrophyGameMode.TrophyRush: text += "\n NOTE: To use existing world, change World Modifiers manually!\n"; num = 2f; text2 = "Very Hard"; text3 = "100%"; flag = true; flag2 = true; text4 = "4 Hours"; break; case TrophyGameMode.CasualSaga: text += "\n NOTE: To use existing world, change World Modifiers manually!\n"; num = 2f; text2 = "Normal"; text3 = "100%"; flag = false; text4 = "None"; break; case TrophyGameMode.TrophySaga: text += "\n NOTE: To use existing world, change World Modifiers manually!\n"; num = 2f; text2 = "Normal"; text3 = "100%"; flag = false; text4 = "4 Hours"; break; case TrophyGameMode.TrophyBlitz: text += "\n NOTE: To use existing world, change World Modifiers manually!\n"; num = 2f; text2 = "Normal"; text3 = "100%"; flag = true; text4 = "2 Hours"; break; case TrophyGameMode.TrophyTrailblazer: text += "\n NOTE: To use existing world, change World Modifiers manually!\n"; num = 2f; text2 = "Normal"; text3 = "100%"; flag = true; text4 = "3 Hours"; break; case TrophyGameMode.TrophyFarmer: text += " EXPERIMENTAL!"; text += "\n NOTE: To use existing world, change World Modifiers manually!\n"; num = 2f; text2 = "Normal"; text3 = "Normal"; flag = false; text4 = "4 Hours"; break; case TrophyGameMode.TrophyPacifist: text += " EXPERIMENTAL!"; text += "\n NOTE: To use existing world, change World Modifiers manually!\n"; num = 2f; text2 = "Normal"; text3 = "100%"; flag = true; text4 = "4 Hours"; break; case TrophyGameMode.CulinarySaga: text += " EXPERIMENTAL!"; text += "\n NOTE: To use existing world, change World Modifiers manually!\n"; num = 2f; text2 = "Normal"; text3 = "100%"; flag = false; text4 = "4 Hours"; break; case TrophyGameMode.TrophyFiesta: text += "\n Nothing to see here.\n"; text4 = "None"; break; } if (GetGameMode() != TrophyGameMode.TrophyFiesta) { text += " Rules:\n"; text = text + " * Time Limit: " + text4 + "\n"; text = text + " * Resources: " + num.ToString("0.0") + "x\n"; text = text + " * Combat Difficulty: " + text2 + "\n"; if (GetGameMode() != TrophyGameMode.CasualSaga) { text = text + " * Trophy Drop Rate: " + text3 + "\n"; } if (flag) { text += " * Biome Bonuses for trophy sets!\n"; } if (GetGameMode() != TrophyGameMode.CasualSaga) { text += $" * Logout Penalty: {GetLogoutPointCost()}\n"; text += $" * Death Penalty: {GetDeathPointCost()}\n"; if (flag2) { text += $" * '/die' Penalty: {GetDeathPointCost() + GetSlashDiePointCost()}\n"; } } if (GetGameMode() == TrophyGameMode.CulinarySaga) { text += "\n * You have four hours to cook food.\n"; text += " * Cook one of each food to score big!\n"; text += " * Feasts are not (yet) included.\n"; } if (GetGameMode() == TrophyGameMode.TrophyRush) { text += " * CheatDeath(tm) within 3 sec.\n"; } if (GetGameMode() == TrophyGameMode.TrophyBlitz) { text += " * NO BEDS ALLOWED!\n"; text += " * Fast Fermenters\n"; text += " * No Craft or Build Cost\n"; text += " * Sequential Boss Reveals\n"; text += " * Dangerously fast boats\n"; text += " * Keep Equipment on death\n"; text += " * Portal Everything\n"; text += " * Skills at 100\n"; text += " * Automatic Portal map pins\n"; text += " * CheatDeath(tm) within 3 sec.\n"; } if (GetGameMode() == TrophyGameMode.TrophyTrailblazer) { text += " * Fast Fermenters and Plantings\n"; text += " * No Craft or Build Cost for known recipes\n"; text += " * Sequential Boss Reveals\n"; text += " * Dangerously fast boats\n"; text += " * Keep Equipment on death\n"; text += " * Portal Everything\n"; text += " * Skills increase very rapidly\n"; text += " * Automatic Portal map pins\n"; text += " * CheatDeath(tm) within 3 sec.\n"; } if (GetGameMode() == TrophyGameMode.TrophyFarmer) { text += " * Additional trophies count for points!\n"; text += " * Fast Fermenters and Plantings\n"; text += " * Fast boats\n"; text += " * Ores Insta-smelt on pickup\n"; } if (IsPacifist()) { text += " * You can't attack enemies!\n"; text += " * Wood Arrows charm enemies!\n"; text += " * Bosses cannot be charmed!\n"; text += " * Charmed enemies move super fast!\n"; } if (GetGameMode() == TrophyGameMode.CasualSaga) { text += GetSagaRulesText(); } else if (IsSagaMode()) { text += GetSagaRulesText(); } text += ""; } return text; } public static string GetTrophyHuntMainMenuText() { return "TrophyHuntMod\n (Version: 0.11.5)" + GetGameModeText(); } public static void ShowPlayerPath(bool showPlayerPath) { //IL_0057: 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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0094: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: 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_00bd: 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(); Vector3 val = Vector3.positiveInfinity; Vector3 val2 = default(Vector3); foreach (TrackEvent _m_pendingEvent in __m_pendingEvents) { ((Vector3)(ref val2))..ctor((float)_m_pendingEvent.x, (float)_m_pendingEvent.y, (float)_m_pendingEvent.z); if (!(Vector3.Distance(val2, val) < 50f)) { val = val2; PinData item = Minimap.instance.AddPin(val2, (PinType)3, "", false, false, 0L, default(PlatformUserID)); __m_pathPins.Add(item); } } __m_pathAddedToMinimap = true; } public static IEnumerator WaitForFirstInput() { Player player = Player.m_localPlayer; if (!((Object)(object)player == (Object)null)) { while (player.m_intro) { yield return null; } while (!Input.anyKeyDown && ((Character)player).GetMoveDir() == Vector3.zero) { yield return null; } if (!__m_firstInputDetected) { __m_firstInputDetected = true; AddPlayerEvent(PlayerEventType.Misc, "FirstInput", ((Component)player).transform.position); } } } public static void RaiseAllPlayerSkills(float skillLevel) { if (!Object.op_Implicit((Object)(object)Player.m_localPlayer)) { return; } foreach (KeyValuePair skillDatum in ((Character)Player.m_localPlayer).GetSkills().m_skillData) { if (skillDatum.Value.m_level < skillLevel) { skillDatum.Value.m_level = skillLevel; } } } public static void InitializeTrackedDataForNewPlayer() { if (IsSagaMode()) { InitializeSagaDrops(); RaiseAllPlayerSkills(20f); if (GetGameMode() == TrophyGameMode.CulinarySaga) { __m_cookedFoods.Clear(); } } if (GetGameMode() == TrophyGameMode.TrophyBlitz) { RaiseAllPlayerSkills(100f); } if (GetGameMode() == TrophyGameMode.TrophyTrailblazer) { RaiseAllPlayerSkills(1f); } __m_gameTimerElapsedSeconds = 0L; __m_internalTimerElapsedSeconds = 0L; TimerStart(); __m_logoutCount = 0; __m_ignoreLogouts = false; __m_slashDieCount = 0; __m_showAllTrophyStats = false; __m_invalidForTournamentPlay = false; __m_pendingEvents.Clear(); __m_lastSentEventIndex = 0; __m_collectingPlayerPath = false; __m_pendingDeathRegistration = false; __m_mapFilesPosted = false; __m_sentFinalData = false; __m_firstInputDetected = false; InitializeTrophyDropInfo(); InitializeTrophyCountInfo(); __m_completedAllBiomeBonuses = false; __m_completedBiomeBonuses.Clear(); __m_extraTimeScore = 0; if (__m_playerEventLog != null) { __m_playerEventLog.Clear(); } else { __m_playerEventLog = new List(); } __m_trophyPins.Clear(); __m_introMessageDisplayed = false; } public static int GetGameModeTimeLength() { int result = 0; switch (GetGameMode()) { case TrophyGameMode.TrophyHunt: result = 240; break; case TrophyGameMode.TrophyRush: result = 240; break; case TrophyGameMode.TrophySaga: result = 240; break; case TrophyGameMode.TrophyBlitz: result = 120; break; case TrophyGameMode.TrophyTrailblazer: result = 180; break; case TrophyGameMode.TrophyFarmer: result = 240; break; case TrophyGameMode.TrophyPacifist: result = 240; break; case TrophyGameMode.CasualSaga: result = 0; break; case TrophyGameMode.CulinarySaga: result = 240; break; } return result; } public static int CalculateCookingPoints(bool displayToLog = false) { int num = 0; ConsumableData[] _m_cookedFoodData = __m_cookedFoodData; foreach (ConsumableData consumableData in _m_cookedFoodData) { if (__m_cookedFoods.Contains(consumableData.m_prefabName)) { if (displayToLog) { PrintToConsole($" {consumableData.m_prefabName}: Score: {consumableData.m_points} Biome: {consumableData.m_biome.ToString()}"); } num += consumableData.m_points; } } return num; } public static int CalculateTrophyPoints(bool displayToLog = false) { int num = 0; 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)) { num += trophyHuntData.GetCurGameModeTrophyScoreValue(); } } return num; } public static int GetDeathPointCost() { int result = -20; if (GetGameMode() == TrophyGameMode.TrophyRush) { result = -10; } else if (GetGameMode() == TrophyGameMode.TrophySaga) { result = -30; } else if (GetGameMode() == TrophyGameMode.CulinarySaga) { result = -30; } else if (GetGameMode() == TrophyGameMode.TrophyBlitz) { result = -40; } else if (GetGameMode() == TrophyGameMode.TrophyTrailblazer) { result = -20; } else if (GetGameMode() == TrophyGameMode.TrophyTrailblazer) { result = -20; } else if (GetGameMode() == TrophyGameMode.TrophyPacifist) { result = -20; } return result; } public static int GetSlashDiePointCost() { int result = 0; if (GetGameMode() == TrophyGameMode.TrophyRush) { result = -10; } return result; } public static int CalculateDeathPenalty() { return __m_deaths * GetDeathPointCost() + __m_slashDieCount * GetSlashDiePointCost(); } public static int GetLogoutPointCost() { int result = -10; if (GetGameMode() == TrophyGameMode.TrophyRush) { result = -5; } else if (GetGameMode() == TrophyGameMode.TrophySaga) { result = -10; } else if (GetGameMode() == TrophyGameMode.CulinarySaga) { result = -10; } else if (GetGameMode() == TrophyGameMode.TrophyBlitz) { result = -20; } else if (GetGameMode() == TrophyGameMode.TrophyTrailblazer) { result = -10; } else if (GetGameMode() == TrophyGameMode.TrophyFarmer) { result = -10; } else if (GetGameMode() == TrophyGameMode.TrophyPacifist) { result = -10; } return result; } public static int CalculateLogoutPenalty() { return __m_logoutCount * GetLogoutPointCost(); } public static void CalculateExtraTimeScore() { if (__m_tournamentStatus == TournamentStatus.Live) { int num = (int)(__m_tournamentEndTime - DateTime.Now).TotalMinutes; __m_extraTimeScore = ((num > 0) ? (5 * num) : 0); } else { int num2 = GetGameModeTimeLength() - (int)__m_internalTimerElapsedSeconds / 60; __m_extraTimeScore = 5 * num2; } } private static void BuildUIElements() { //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) 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); } __m_iconList = new List(); __m_trophyCountList = new List(); if (GetGameMode() != TrophyGameMode.CasualSaga) { if ((Object)(object)__m_deathsTextElement == (Object)null) { __m_deathsTextElement = CreateDeathsElement(val); } if ((Object)(object)__m_relogsTextElement == (Object)null) { __m_relogsTextElement = CreateRelogsElements(val); } if ((Object)(object)__m_gameTimerTextElement == (Object)null) { __m_gameTimerTextElement = CreateTimerElements(val); } if (GetGameMode() == TrophyGameMode.CulinarySaga) { CreateCookingIconElements(val, __m_cookedFoodData, __m_iconList); CreateTrophyTooltip(); } else { CreateTrophyIconElements(val, __m_trophyHuntData, __m_iconList, __m_trophyCountList); CreateTrophyTooltip(); CreateLuckTooltip(); CreateStandingsTooltip(); CreateThrallsWindow(val); __m_luckOMeterElement = CreateLuckOMeterElements(val); __m_standingsElement = CreateStandingsElements(val); __m_standingsElement.SetActive(false); } } CreateGameModeElements(); SetScoreTextElementColor(Color.yellow); if (!__m_onlyModRunning) { SetScoreTextElementColor(Color.cyan); } if (__m_showAllTrophyStats || __m_invalidForTournamentPlay) { SetScoreTextElementColor(Color.green); } CreateScoreTooltip(); } } public static void CreateGameModeElements() { //IL_002e: 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_003f: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Expected O, but got Unknown //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) Transform val = ((Component)Hud.instance).transform.Find("hudroot/healthpanel"); if ((Object)(object)val == (Object)null) { Debug.LogError((object)"Minimap transform not found."); return; } GameObject val2 = new GameObject("GameModeText"); val2.transform.SetParent(val); RectTransform obj = val2.AddComponent(); obj.sizeDelta = new Vector2(300f, 100f); obj.anchoredPosition = new Vector2(-40f, 260f); ((Transform)obj).localScale = new Vector3(1f, 1f, 1f); ((Transform)obj).rotation = Quaternion.Euler(0f, 0f, 90f); TextMeshProUGUI obj2 = AddTextMeshProComponent(val2); ((TMP_Text)obj2).text = GetGameModeString(GetGameMode()) + "\nv0.11.5"; ((TMP_Text)obj2).fontSize = 22f; ((TMP_Text)obj2).fontStyle = (FontStyles)1; ((Graphic)obj2).color = Color.yellow; ((Graphic)obj2).raycastTarget = false; ((TMP_Text)obj2).fontMaterial.EnableKeyword("OUTLINE_ON"); ((TMP_Text)obj2).outlineColor = Color32.op_Implicit(Color.black); ((TMP_Text)obj2).outlineWidth = 0.125f; ((TMP_Text)obj2).verticalAlignment = (VerticalAlignmentOptions)256; ((TMP_Text)obj2).horizontalAlignment = (HorizontalAlignmentOptions)1; } private static IEnumerator TimerUpdate() { while (__m_gameTimerActive) { if (Object.op_Implicit((Object)(object)Game.instance)) { if ((Object)(object)__m_gameTimerTextElement != (Object)null) { TextMeshProUGUI component = __m_gameTimerTextElement.GetComponent(); long num = __m_gameTimerElapsedSeconds; if (__m_gameTimerCountdown) { num = ((GetGameMode() == TrophyGameMode.TrophyBlitz) ? (7200 - num) : ((GetGameMode() != TrophyGameMode.TrophyTrailblazer) ? (14400 - num) : (10800 - num))); } TimeSpan timeSpan = TimeSpan.FromSeconds(num); if (__m_gameTimerVisible) { ((TMP_Text)component).text = "" + timeSpan.ToString() + ""; if (!__m_gameTimerCountdown) { ((Graphic)component).color = Color.yellow; ((TMP_Text)component).outlineColor = Color32.op_Implicit(Color.black); } else { ((Graphic)component).color = Color.green; ((TMP_Text)component).outlineColor = Color32.op_Implicit(Color.black); } } else { ((TMP_Text)component).text = ""; } } if (__m_internalTimerElapsedSeconds % 30 == 0L) { PostStandingsRequest(); FlushEventBatch(); } if (__m_internalTimerElapsedSeconds % 300 == 0L && __m_internalTimerElapsedSeconds > 0) { AddSnapshotEvent(); } if (!__m_sentFinalData && __m_tournamentEndTime != default(DateTime) && DateTime.Now >= __m_tournamentEndTime && CanPostToTracker(force: true)) { __m_sentFinalData = true; AddSnapshotEvent(force: true); FlushEventBatch(force: true); } __m_gameTimerElapsedSeconds++; __m_internalTimerElapsedSeconds++; } yield return (object)new WaitForSeconds(1f); } } public static void TimerStart() { if (!__m_gameTimerActive) { __m_gameTimerActive = true; ((MonoBehaviour)__m_trophyHuntMod).StartCoroutine(TimerUpdate()); } } public static void TimerStop() { __m_gameTimerActive = false; } public static void TimerReset() { __m_gameTimerElapsedSeconds = 0L; } public static void TimerSet(string timeStr) { __m_gameTimerElapsedSeconds = (long)TimeSpan.Parse(timeStr).TotalSeconds; } public static void TimerToggle() { __m_gameTimerCountdown = !__m_gameTimerCountdown; } private static GameObject CreateTimerElements(Transform parentTransform) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0027: 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_0055: 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_0065: Expected O, but got Unknown //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Expected O, but got Unknown GameObject val = new GameObject("Timer"); val.transform.SetParent(parentTransform); RectTransform obj = val.AddComponent(); obj.sizeDelta = new Vector2(120f, 25f); obj.anchoredPosition = new Vector2(-43f, 85f); ((Transform)obj).localScale = new Vector3(__m_userTextScale, __m_userTextScale, __m_userTextScale); TextMeshProUGUI obj2 = AddTextMeshProComponent(val); ((TMP_Text)obj2).text = "00:00:00"; ((TMP_Text)obj2).fontSize = 24f; ((Graphic)obj2).color = Color.yellow; ((TMP_Text)obj2).alignment = (TextAlignmentOptions)514; ((Graphic)obj2).raycastTarget = false; ((TMP_Text)obj2).fontMaterial.EnableKeyword("OUTLINE_ON"); ((TMP_Text)obj2).outlineColor = Color32.op_Implicit(Color.black); ((TMP_Text)obj2).fontStyle = (FontStyles)1; ((TMP_Text)obj2).outlineWidth = 0.125f; return val; } private static GameObject CreateRelogsElements(Transform parentTransform) { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_003f: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0088: 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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: 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_00e7: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Expected O, but got Unknown //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Expected O, but got Unknown //IL_016d: Unknown result type (might be due to invalid IL or missing references) Sprite trophySprite = GetTrophySprite("RoundLog"); __m_relogsIconElement = new GameObject("RelogsIcon"); __m_relogsIconElement.transform.SetParent(parentTransform); RectTransform obj = __m_relogsIconElement.AddComponent(); obj.sizeDelta = new Vector2(40f, 40f); obj.anchoredPosition = new Vector2(-70f, -105f); ((Transform)obj).localScale = new Vector3(__m_userIconScale, __m_userIconScale, __m_userIconScale); Image obj2 = __m_relogsIconElement.AddComponent(); obj2.sprite = trophySprite; ((Graphic)obj2).color = Color.white; GameObject val = new GameObject("RelogsElement"); val.transform.SetParent(parentTransform); RectTransform obj3 = val.AddComponent(); obj3.sizeDelta = new Vector2(60f, 20f); obj3.anchoredPosition = new Vector2(-70f, -105f); ((Transform)obj3).localScale = new Vector3(__m_userTextScale, __m_userTextScale, __m_userTextScale); TextMeshProUGUI val2 = AddTextMeshProComponent(val); ((TMP_Text)val2).text = $"{__m_logoutCount}"; ((TMP_Text)val2).fontSize = 24f; ((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.1f; if (__m_ignoreLogouts) { ((Graphic)val2).color = Color.gray; } return val; } 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_0047: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Expected O, but got Unknown //IL_008f: Expected O, but got Unknown Sprite trophySprite = GetTrophySprite("HelmetMidsummerCrown"); GameObject val = new GameObject("LuckImage"); val.transform.SetParent(parentTransform); RectTransform obj = val.AddComponent(); obj.sizeDelta = new Vector2(40f, 40f); obj.anchoredPosition = new Vector2(-70f, -20f); ((Transform)obj).localScale = new Vector3(__m_userIconScale, __m_userIconScale, __m_userIconScale); Image obj2 = val.AddComponent(); obj2.sprite = trophySprite; ((Graphic)obj2).color = Color.white; ((Graphic)obj2).raycastTarget = true; AddTooltipTriggersToLuckObject(val); return val; } private static GameObject CreateStandingsElements(Transform parentTransform) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Expected O, but got Unknown //IL_008a: Expected O, but got Unknown Sprite _m_trophySprite = __m_trophySprite; GameObject val = new GameObject("StandingsImage"); val.transform.SetParent(parentTransform); RectTransform obj = val.AddComponent(); obj.sizeDelta = new Vector2(40f, 40f); obj.anchoredPosition = new Vector2(-70f, 40f); ((Transform)obj).localScale = new Vector3(__m_userIconScale, __m_userIconScale, __m_userIconScale); Image obj2 = val.AddComponent(); obj2.sprite = _m_trophySprite; ((Graphic)obj2).color = Color.yellow; ((Graphic)obj2).raycastTarget = true; AddTooltipTriggersToStandingsObject(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_0062: 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_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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: 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_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Expected O, but got Unknown //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0138: Unknown result type (might be due to invalid IL or missing references) //IL_013d: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Expected O, but got Unknown Sprite trophySprite = GetTrophySprite("Charredskull"); GameObject val = new GameObject("DeathsIcon"); val.transform.SetParent(parentTransform); RectTransform val2 = val.AddComponent(); val2.sizeDelta = new Vector2(50f, 50f); val2.anchoredPosition = new Vector2(-70f, -65f); ((Transform)val2).localScale = new Vector3(__m_userIconScale, __m_userIconScale, __m_userIconScale); Image obj = val.AddComponent(); 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(); obj2.sizeDelta = new Vector2(40f, 40f); obj2.anchoredPosition = val2.anchoredPosition; ((Transform)obj2).localScale = new Vector3(__m_userTextScale, __m_userTextScale, __m_userTextScale); TextMeshProUGUI obj3 = AddTextMeshProComponent(val3); ((TMP_Text)obj3).text = $"{__m_deaths}"; ((TMP_Text)obj3).fontSize = 24f; ((Graphic)obj3).color = Color.yellow; ((TMP_Text)obj3).alignment = (TextAlignmentOptions)514; ((Graphic)obj3).raycastTarget = false; ((TMP_Text)obj3).fontMaterial.EnableKeyword("OUTLINE_ON"); ((TMP_Text)obj3).outlineColor = Color32.op_Implicit(Color.black); ((TMP_Text)obj3).outlineWidth = 0.1f; return val3; } private static GameObject CreateScoreTextElement(Transform parentTransform) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Expected O, but got Unknown //IL_006e: 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_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Expected O, but got Unknown //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_019d: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Expected O, but got Unknown //IL_01a4: Expected O, but got Unknown __m_scoreBGElement = new GameObject("ScoreBG"); __m_scoreBGElement.transform.SetParent(parentTransform); Vector2 anchoredPosition = default(Vector2); ((Vector2)(ref anchoredPosition))..ctor(-65f, -140f); Vector2 sizeDelta = default(Vector2); ((Vector2)(ref sizeDelta))..ctor(70f, 42f); RectTransform obj = __m_scoreBGElement.AddComponent(); Vector2 anchoredPosition2 = default(Vector2); ((Vector2)(ref anchoredPosition2))..ctor(-70f, -143f); Vector2 sizeDelta2 = default(Vector2); ((Vector2)(ref sizeDelta2))..ctor(70f, 42f); obj.sizeDelta = sizeDelta2; obj.anchoredPosition = anchoredPosition2; ((Transform)obj).localScale = new Vector3(__m_userTextScale, __m_userTextScale, __m_userTextScale); __m_scoreBGElement.SetActive(false); ((Graphic)__m_scoreBGElement.AddComponent()).color = new Color(0f, 0f, 0f, 1f); GameObject val = new GameObject("ScoreText"); val.transform.SetParent(parentTransform); RectTransform obj2 = val.AddComponent(); obj2.sizeDelta = sizeDelta; obj2.anchoredPosition = anchoredPosition; ((Transform)obj2).localScale = new Vector3(__m_userTextScale, __m_userTextScale, __m_userTextScale); int num = 9999; TextMeshProUGUI obj3 = AddTextMeshProComponent(val); ((TMP_Text)obj3).text = $"{num}"; ((TMP_Text)obj3).fontSize = 25f; ((Graphic)obj3).color = Color.yellow; ((TMP_Text)obj3).alignment = (TextAlignmentOptions)514; ((Graphic)obj3).raycastTarget = true; ((TMP_Text)obj3).fontMaterial.EnableKeyword("OUTLINE_ON"); ((TMP_Text)obj3).outlineColor = Color32.op_Implicit(Color.black); ((TMP_Text)obj3).outlineWidth = 0.125f; ((TMP_Text)obj3).enableAutoSizing = true; ((TMP_Text)obj3).fontSizeMin = 18.75f; ((TMP_Text)obj3).fontSizeMax = 27f; AddTooltipTriggersToScoreObject(val); return val; } public static void SetScoreTextElementColor(Color color) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) if (!__m_ignoreInvalidateUIChanges && (Object)(object)__m_scoreTextElement != (Object)null) { ((Graphic)__m_scoreTextElement.GetComponent()).color = color; } } private static GameObject CreateTrophyIconElement(Transform parentTransform, Sprite iconSprite, string iconName, Biome iconBiome, int index, out GameObject countObject) { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Expected O, but got Unknown //IL_003f: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Expected O, but got Unknown //IL_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_014e: 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) 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(); 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_userIconScale; Image val2 = val.AddComponent(); val2.sprite = iconSprite; ((Graphic)val2).color = new Color(0f, 0.2f, 0.1f, 0.95f); ((Graphic)val2).raycastTarget = true; if (GetGameMode() == TrophyGameMode.TrophyRush) { ((Graphic)val2).color = new Color(0.5f, 0f, 0f); } else if (GetGameMode() == TrophyGameMode.TrophySaga) { ((Graphic)val2).color = new Color(0f, 0f, 0.5f); } else if (GetGameMode() == TrophyGameMode.TrophyBlitz) { ((Graphic)val2).color = new Color(0.2f, 0.2f, 0f); } else if (GetGameMode() == TrophyGameMode.TrophyTrailblazer) { ((Graphic)val2).color = new Color(0f, 0.2f, 0.2f); } else if (GetGameMode() == TrophyGameMode.TrophyPacifist) { ((Graphic)val2).color = new Color(0.3f, 0.1f, 0.2f); } AddTooltipTriggersToTrophyIcon(val); countObject = new GameObject(iconName); countObject.transform.SetParent(val.transform); RectTransform obj2 = countObject.AddComponent(); obj2.sizeDelta = new Vector2((float)num, (float)num); obj2.anchoredPosition = new Vector2(0f, 0f); ((Transform)obj2).localScale = new Vector3(1f, 1f, 1f); ((Transform)obj2).SetAsLastSibling(); TextMeshProUGUI obj3 = AddTextMeshProComponent(countObject); ((TMP_Text)obj3).text = ""; ((TMP_Text)obj3).fontSize = 14f; ((Graphic)obj3).color = Color.yellow; ((TMP_Text)obj3).alignment = (TextAlignmentOptions)1032; ((TMP_Text)obj3).horizontalAlignment = (HorizontalAlignmentOptions)2; ((Graphic)obj3).raycastTarget = false; ((TMP_Text)obj3).fontMaterial.EnableKeyword("OUTLINE_ON"); ((TMP_Text)obj3).outlineColor = Color32.op_Implicit(Color.black); ((TMP_Text)obj3).fontStyle = (FontStyles)1; ((TMP_Text)obj3).outlineWidth = 0.125f; return val; } public static void DeleteTrophyIconElements(List iconList) { foreach (GameObject icon in iconList) { Object.Destroy((Object)(object)icon); } iconList.Clear(); } public static void CreateTrophyIconElements(Transform parentTransform, TrophyHuntData[] trophies, List iconList, List countList) { 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 countObject; GameObject val = CreateTrophyIconElement(parentTransform, trophySprite, trophyHuntData.m_name, trophyHuntData.m_biome, iconList.Count, out countObject); ((Object)val).name = trophyHuntData.m_name; iconList.Add(val); countList.Add(countObject); } if (GetGameMode() == TrophyGameMode.TrophyFiesta) { __m_fiestaFlashing = true; ((MonoBehaviour)__m_trophyHuntMod).StartCoroutine(FlashTrophyFiesta()); } else { GetGameMode(); _ = 3; } } 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(); 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(); if ((Object)(object)component != (Object)null) { ((Graphic)component).color = Color.white; } } else { Debug.LogError((object)("Unable to find " + trophyName + " in __m_iconList")); } } private static GameObject CreateCookingIconElement(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_00a8: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Expected O, but got Unknown //IL_00bf: Expected O, but got Unknown 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(); 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_userIconScale; Image obj2 = val.AddComponent(); obj2.sprite = iconSprite; ((Graphic)obj2).color = new Color(0.2f, 0.2f, 0.7f, 0.7f); ((Graphic)obj2).raycastTarget = true; AddTooltipTriggersToTrophyIcon(val); return val; } private static void CreateCookingIconElements(Transform parentTransform, ConsumableData[] cookedFoodData, List iconList) { foreach (ConsumableData consumableData in cookedFoodData) { string prefabName = consumableData.m_prefabName; Sprite trophySprite = GetTrophySprite(prefabName); if ((Object)(object)trophySprite == (Object)null) { Debug.LogError((object)("Unable to find cooked food sprite for " + prefabName)); continue; } GameObject val = CreateCookingIconElement(parentTransform, trophySprite, prefabName, consumableData.m_biome, iconList.Count); ((Object)val).name = prefabName; iconList.Add(val); } } private static int CalculateCookingScore(Player player) { int num = 0; foreach (string foodName in __m_cookedFoods) { ConsumableData consumableData = Array.Find(__m_cookedFoodData, (ConsumableData element) => element.m_prefabName == foodName); if (consumableData != null && consumableData.m_prefabName == foodName) { num += consumableData.m_points; } } return num; } private static int CalculateTrophyScore(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) { int num2 = trophyHuntData.GetCurGameModeTrophyScoreValue(); if (GetGameMode() == TrophyGameMode.TrophyFarmer) { num2 *= __m_farmerTrophyCounts[trophyHuntData.m_name]; } num += num2; } } return num; } private static bool CalculateBiomeBonusStats(Biome biome, out int numCollected, out int numTotal, out int biomeScore) { BiomeBonus biomeBonus = Array.Find(__m_biomeBonuses, (BiomeBonus element) => element.m_biome == biome); try { numCollected = 0; numTotal = biomeBonus.m_trophies.Count; biomeScore = biomeBonus.m_bonus; foreach (string trophy in biomeBonus.m_trophies) { if (__m_trophyCache.Contains(trophy)) { numCollected++; } } } catch (Exception) { numCollected = 0; numTotal = 0; biomeScore = 0; return false; } return true; } public static int CalculateBiomeBonusScore(Player player) { int num = 0; BiomeBonus[] _m_biomeBonuses = __m_biomeBonuses; for (int i = 0; i < _m_biomeBonuses.Length; i++) { BiomeBonus biomeBonus = _m_biomeBonuses[i]; int numCollected = 0; int numTotal = 0; int biomeScore = 0; CalculateBiomeBonusStats(biomeBonus.m_biome, out numCollected, out numTotal, out biomeScore); if (numCollected == numTotal) { num += biomeScore; } } if (__m_completedAllBiomeBonuses) { num += ALL_BIOME_BONUS_SCORE; } return num; } public static bool UpdateBiomeBonusTrophies(string trophyName, ref Biome biome) { TrophyHuntData trophyHuntData = Array.Find(__m_trophyHuntData, (TrophyHuntData element) => element.m_name == trophyName); int numCollected = 0; int numTotal = 0; int biomeScore = 0; if (!CalculateBiomeBonusStats(trophyHuntData.m_biome, out numCollected, out numTotal, out biomeScore)) { return false; } if (numCollected == numTotal && !__m_completedBiomeBonuses.Contains(trophyHuntData.m_biome)) { biome = trophyHuntData.m_biome; PrintToConsole("Biome Completed! " + trophyHuntData.m_biome); __m_completedBiomeBonuses.Add(trophyHuntData.m_biome); return true; } return false; } public static void EnableTrophyHuntIcons(Player player) { foreach (string trophy in player.GetTrophies()) { EnableTrophyHuntIcon(trophy); } } public static void EnableBiomes(Player player) { foreach (string trophy in player.GetTrophies()) { EnableTrophyHuntIcon(trophy); } } public static void EnableCookingIcons(Player player) { foreach (string _m_cookedFood in __m_cookedFoods) { EnableTrophyHuntIcon(_m_cookedFood); } } public static int CalculateCurrentScore(Player player) { if ((Object)(object)player == (Object)null) { return __m_playerCurrentScore; } int num = 0; if (GetGameMode() == TrophyGameMode.CulinarySaga) { num = CalculateCookingScore(player); } else if (GetGameMode() != TrophyGameMode.CasualSaga) { num = CalculateTrophyScore(player); } Game instance = Game.instance; PlayerProfile val = ((instance != null) ? instance.GetPlayerProfile() : null); if (val?.m_playerStats != null) { __m_deaths = (int)val.m_playerStats[(PlayerStatType)0]; num += CalculateDeathPenalty(); } if (!__m_ignoreLogouts) { num += CalculateLogoutPenalty(); } if (GetGameMode() == TrophyGameMode.TrophyRush || GetGameMode() == TrophyGameMode.TrophyBlitz || GetGameMode() == TrophyGameMode.TrophyTrailblazer || GetGameMode() == TrophyGameMode.TrophyPacifist) { num += CalculateBiomeBonusScore(player); } return __m_playerCurrentScore = num + __m_extraTimeScore; } public static void UpdateModUI(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; } if (GetGameMode() == TrophyGameMode.CulinarySaga) { EnableCookingIcons(player); } else if (GetGameMode() != TrophyGameMode.CasualSaga) { EnableTrophyHuntIcons(player); EnableBiomes(player); } int num = CalculateCurrentScore(player); if (Object.op_Implicit((Object)(object)__m_deathsTextElement)) { TextMeshProUGUI component = __m_deathsTextElement.GetComponent(); if ((Object)(object)component != (Object)null) { ((TMP_Text)component).SetText(__m_deaths.ToString()); } } if (Object.op_Implicit((Object)(object)__m_scoreTextElement)) { if (GetGameMode() == TrophyGameMode.CasualSaga) { ((TMP_Text)__m_scoreTextElement.GetComponent()).text = "Saga"; } else { ((TMP_Text)__m_scoreTextElement.GetComponent()).text = num.ToString(); } } if (Object.op_Implicit((Object)(object)__m_relogsTextElement)) { ((TMP_Text)__m_relogsTextElement.GetComponent()).text = __m_logoutCount.ToString(); } if (IsPacifist()) { if (__m_allCharmedCharacters != null && __m_allCharmedCharacters.Count > 0) { ShowThrallsWindow(__m_thrallsWindowObject); } else { HideThrallsWindow(); } } if (GetGameMode() != TrophyGameMode.TrophyFarmer) { return; } foreach (GameObject _m_trophyCount in __m_trophyCountList) { int num2 = __m_farmerTrophyCounts[((Object)_m_trophyCount).name]; TextMeshProUGUI component2 = _m_trophyCount.GetComponent(); if (num2 > 0) { ((TMP_Text)component2).text = $"{num2}"; } else { ((TMP_Text)component2).text = ""; } } } private static IEnumerator FlashImage(string trophyName, Image targetImage, RectTransform imageRect) { __m_flashingTrophies.Add(trophyName); float flashDuration = 0.809f; int numFlashes = 6; 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 + 1.5f * num; ((Transform)imageRect).localScale = new Vector3(__m_baseTrophyScale, __m_baseTrophyScale, __m_baseTrophyScale) * num2 * __m_userIconScale; imageRect.anchoredPosition = originalAnchoredPosition + new Vector2(0f, 150f) * (float)Math.Sin(num / 2f); yield return null; } imageRect.anchoredPosition = originalAnchoredPosition; } ((Graphic)targetImage).color = Color.white; ((Transform)imageRect).localScale = originalScale; imageRect.anchoredPosition = originalAnchoredPosition; __m_flashingTrophies.Remove(trophyName); } private static IEnumerator FlashImage2(Image targetImage, RectTransform imageRect) { float flashDuration = 0.5f; int numFlashes = 4; Vector2 originalAnchoredPosition = imageRect.anchoredPosition; Vector3 originalScale = ((Transform)imageRect).localScale; for (int i = 0; i < numFlashes; i++) { float curAccel = 10f; float curVelocity = 0f; float curPosition = 0f; float timeElapsed = 0f; while (curVelocity > 0.1f) { float deltaTime = Time.deltaTime; curAccel += -10f * deltaTime; curVelocity += curAccel * deltaTime; curPosition += curVelocity * deltaTime; float num = 1f + timeElapsed / flashDuration; ((Transform)imageRect).localScale = new Vector3(__m_baseTrophyScale, __m_baseTrophyScale, __m_baseTrophyScale) * num * __m_userIconScale; imageRect.anchoredPosition = originalAnchoredPosition + new Vector2(0f, 200f) * curPosition; yield return null; } } ((Graphic)targetImage).color = Color.white; ((Transform)imageRect).localScale = originalScale; imageRect.anchoredPosition = originalAnchoredPosition; } private static IEnumerator FlashBiomeImage(Image targetImage, RectTransform imageRect) { float flashDuration = 6f; Quaternion originalRotation = ((Transform)imageRect).rotation; for (float t = 0f; t < flashDuration; t += Time.deltaTime) { ((Transform)imageRect).localEulerAngles = ((Transform)imageRect).localEulerAngles + new Vector3(0f, 0f, t); yield return null; } ((Transform)imageRect).rotation = originalRotation; } private static IEnumerator FlashTrophyBlitz() { blitzFlashTimer += 0.16f; Color color = default(Color); while (__m_blitzFlashing) { int num = 0; foreach (GameObject go in __m_iconList) { if (__m_trophyCache.Find((string trophyName) => trophyName == ((Object)go).name) == ((Object)go).name) { continue; } if ((Object)(object)go != (Object)null) { Image component = go.GetComponent(); if ((Object)(object)component != (Object)null) { float num2 = (float)Math.Sin(blitzFlashTimer) + 1f; ((Color)(ref color))..ctor(num2, num2, 0f); ((Graphic)component).color = color; } } num++; } yield return (object)new WaitForSeconds(0.16f); } } private static IEnumerator FlashTrophyFiesta() { int startingColorIndex = 0; float elapsedTime = 0f; float flashInterval = 0.6f; while (__m_fiestaFlashing) { elapsedTime += Time.deltaTime; if (elapsedTime > flashInterval) { elapsedTime = 0f; int num = 0; foreach (GameObject _m_icon in __m_iconList) { if ((Object)(object)_m_icon != (Object)null) { Image component = _m_icon.GetComponent(); if ((Object)(object)component != (Object)null) { int num2 = (startingColorIndex + num) % __m_fiestaColors.Length; if (((Graphic)component).color != Color.white) { Color color = __m_fiestaColors[num2]; color.a = 0.5f; ((Graphic)component).color = color; } } } num++; } int num3 = startingColorIndex + 1; startingColorIndex = num3; if (num3 >= __m_fiestaColors.Length) { startingColorIndex = 0; } } yield return null; } } private static void FlashTrophy(string trophyName) { if (__m_flashingTrophies.Contains(trophyName)) { return; } GameObject val = __m_iconList.Find((GameObject gameObject) => ((Object)gameObject).name == trophyName); if ((Object)(object)val != (Object)null) { Image component = val.GetComponent(); if ((Object)(object)component != (Object)null) { RectTransform component2 = val.GetComponent(); if ((Object)(object)component2 != (Object)null) { ((MonoBehaviour)__m_trophyHuntMod).StartCoroutine(FlashImage(trophyName, component, component2)); } } } else { Debug.LogError((object)("Unable to find " + trophyName + " in __m_iconList")); } } private static IEnumerator DoFlashScore() { if (__m_isFlashingScore) { yield return null; } if (!((Object)(object)__m_scoreTextElement != (Object)null)) { yield break; } __m_isFlashingScore = true; TextMeshProUGUI tmText = __m_scoreTextElement.GetComponent(); Color oldTextColor = ((Graphic)tmText).color; float oldFontSize = ((TMP_Text)tmText).fontSize; for (int count = 0; count < 8; count++) { for (float x = 0f; (double)x < Math.PI * 2.0; x += (float)Math.PI / 6f) { float num = (1f + (float)Math.Sin(x)) * 0.5f; ((Graphic)tmText).color = Color.Lerp(Color.black, Color.white, num); ((TMP_Text)tmText).fontSize = oldFontSize + num * 1.25f; yield return (object)new WaitForSeconds(0.033f); } } ((Graphic)tmText).color = oldTextColor; ((TMP_Text)tmText).fontSize = oldFontSize; __m_isFlashingScore = false; } private static void FlashBiomeTrophies(string trophyName) { TrophyHuntData trophyHuntData = Array.Find(__m_trophyHuntData, (TrophyHuntData element) => element.m_name == trophyName); foreach (string biomeTrophyName in Array.Find(__m_biomeBonuses, (BiomeBonus element) => element.m_biome == trophyHuntData.m_biome).m_trophies) { GameObject val = __m_iconList.Find((GameObject gameObject) => ((Object)gameObject).name == biomeTrophyName); if (!((Object)(object)val != (Object)null)) { continue; } Image component = val.GetComponent(); if ((Object)(object)component != (Object)null) { RectTransform component2 = val.GetComponent(); if ((Object)(object)component2 != (Object)null) { ((MonoBehaviour)__m_trophyHuntMod).StartCoroutine(FlashBiomeImage(component, component2)); } } } } public static void AddTrackEvent(string tag, Vector3 pos, string extra = null) { //IL_0030: 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_0052: Unknown result type (might be due to invalid IL or missing references) __m_pendingEvents.Add(new TrackEvent { tag = tag, secs = (int)(DateTime.UtcNow - __m_tournamentStartTime).TotalSeconds, x = Mathf.RoundToInt(pos.x), y = Mathf.RoundToInt(pos.y), z = Mathf.RoundToInt(pos.z), extra = extra }); } public static void StartCollectingPlayerPath() { StopCollectingPlayerPath(); __m_collectingPlayerPath = true; ((MonoBehaviour)__m_trophyHuntMod).StartCoroutine(CollectPlayerPath()); } public static void StopCollectingPlayerPath() { __m_collectingPlayerPath = false; } public static IEnumerator CollectPlayerPath() { Vector3 lastPos = Vector3.positiveInfinity; while (__m_collectingPlayerPath) { yield return (object)new WaitForSeconds(__m_playerPathCollectionInterval); if (!__m_collectingPlayerPath) { break; } Player localPlayer = Player.m_localPlayer; if (!((Object)(object)localPlayer == (Object)null) && __m_firstInputDetected && CanPostToTracker()) { Vector3 position = ((Component)localPlayer).transform.position; Vector3 val = lastPos; if (__m_pendingEvents.Count > 0) { TrackEvent trackEvent = __m_pendingEvents[__m_pendingEvents.Count - 1]; ((Vector3)(ref val))..ctor((float)trackEvent.x, (float)trackEvent.y, (float)trackEvent.z); } if (Vector3.Distance(position, val) >= __m_minPathPlayerMoveDistance) { AddTrackEvent("W", position); lastPos = position; } } } } public static void AddTrophyPin(Vector3 position, string trophyName, bool big = false) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0019: 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_0034: Unknown result type (might be due to invalid IL or missing references) PinData val = Minimap.instance.AddPin(position, (PinType)9, "", true, false, 0L, default(PlatformUserID)); val.m_icon = GetTrophySprite(trophyName); TrophyPin trophyPin = new TrophyPin(); trophyPin.m_pos = position; trophyPin.m_trophyName = trophyName; if (big) { val.m_doubleSize = true; } __m_trophyPins.Add(trophyPin); } public static void FixTrophyPins() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_00c9: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)Minimap.instance == (Object)null) { return; } foreach (TrophyPin _m_trophyPin in __m_trophyPins) { foreach (PinData pin in Minimap.instance.m_pins) { if (Vector3.Distance(pin.m_pos, _m_trophyPin.m_pos) < 1f) { Minimap.instance.RemovePin(pin); break; } } } foreach (TrophyPin _m_trophyPin2 in __m_trophyPins) { Minimap.instance.AddPin(_m_trophyPin2.m_pos, (PinType)9, "", true, false, 0L, default(PlatformUserID)).m_icon = GetTrophySprite(_m_trophyPin2.m_trophyName); } } public static void StartPeriodicTimer() { StopPeriodicTimer(); ((MonoBehaviour)__m_trophyHuntMod).StartCoroutine(PeriodicTimer()); } public static void StopPeriodicTimer() { ((MonoBehaviour)__m_trophyHuntMod).StopCoroutine(PeriodicTimer()); StopCollectingPlayerPath(); } public static IEnumerator PeriodicTimer() { if ((Object)(object)Player.m_localPlayer != (Object)null) { yield return (object)new WaitForSeconds(30f); } } 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 CreateScoreTooltip() { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_000f: Expected O, but got Unknown //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: 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_0080: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Expected O, but got Unknown //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: 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) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) __m_scoreTooltipBackground = new GameObject("Score Tooltip Background"); Vector2 val = __m_trophyHuntScoreTooltipWindowSize; if (__toolTipSizes.ContainsKey(GetGameMode())) { val = __toolTipSizes[GetGameMode()]; } Transform transform = ((Component)Hud.instance).transform; __m_scoreTooltipBackground.transform.SetParent(transform, false); __m_scoreTooltipBackground.AddComponent().sizeDelta = val; ((Graphic)__m_scoreTooltipBackground.AddComponent()).color = new Color(0f, 0f, 0f, 0.95f); __m_scoreTooltipBackground.SetActive(false); __m_scoreTooltipObject = new GameObject("Score Tooltip Text"); __m_scoreTooltipObject.transform.SetParent(__m_scoreTooltipBackground.transform, false); __m_scoreTooltipObject.AddComponent().sizeDelta = new Vector2(val.x - __m_scoreTooltipTextOffset.x, val.y - __m_scoreTooltipTextOffset.y); __m_scoreTooltipText = AddTextMeshProComponent(__m_scoreTooltipObject); ((TMP_Text)__m_scoreTooltipText).fontSize = 14f; ((TMP_Text)__m_scoreTooltipText).alignment = (TextAlignmentOptions)257; ((Graphic)__m_scoreTooltipText).color = Color.yellow; __m_scoreTooltipObject.SetActive(false); } public static void AddTooltipTriggersToScoreObject(GameObject uiObject) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0034: 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_0062: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)uiObject.GetComponent() != (Object)null)) { EventTrigger obj = uiObject.AddComponent(); Entry val = new Entry(); val.eventID = (EventTriggerType)0; ((UnityEvent)(object)val.callback).AddListener((UnityAction)delegate { ShowScoreTooltip(uiObject); }); obj.triggers.Add(val); Entry val2 = new Entry(); val2.eventID = (EventTriggerType)1; ((UnityEvent)(object)val2.callback).AddListener((UnityAction)delegate { HideScoreTooltip(); }); obj.triggers.Add(val2); } } public static string BuildScoreTooltipText(GameObject uiObject) { string text = ""; string gameModeNameText = GetGameModeNameText(); text = "" + gameModeNameText + "\n"; if (GetGameMode() == TrophyGameMode.CasualSaga) { text = text + "" + GetSagaRulesText() + ""; } else { int count = __m_trophyCache.Count; int num = 0; num = ((GetGameMode() != TrophyGameMode.CulinarySaga) ? CalculateTrophyPoints() : CalculateCookingPoints()); int num2 = CalculateLogoutPenalty() + CalculateDeathPenalty(); text += "\n"; text = ((GetGameMode() != TrophyGameMode.CulinarySaga) ? (text + $" Trophies:\n Num: {count} ({CalculateTrophyPoints().ToString()} Points)\n") : (text + $" Dishes Prepared:\n Num: {__m_cookedFoods.Count} ({num} Points)\n")); text += $" Logouts: (Penalty: {GetLogoutPointCost()})\n Num: {__m_logoutCount} ({CalculateLogoutPenalty().ToString()} Points)\n"; text += $" Deaths: (Penalty: {GetDeathPointCost()})\n Num: {__m_deaths} ({CalculateDeathPenalty().ToString()} Points)\n"; if (GetGameMode() == TrophyGameMode.TrophyRush || GetGameMode() == TrophyGameMode.TrophyBlitz || GetGameMode() == TrophyGameMode.TrophyTrailblazer || GetGameMode() == TrophyGameMode.TrophyPacifist) { if (GetGameMode() == TrophyGameMode.TrophyRush) { text += $" /die's: (Penalty: {-10})\n Num: {__m_slashDieCount} ({__m_slashDieCount * -10} Points)\n"; num2 += __m_slashDieCount * -10; } text += " Biome Bonuses:\n"; BiomeBonus[] _m_biomeBonuses = __m_biomeBonuses; for (int i = 0; i < _m_biomeBonuses.Length; i++) { BiomeBonus biomeBonus = _m_biomeBonuses[i]; CalculateBiomeBonusStats(biomeBonus.m_biome, out var numCollected, out var numTotal, out var biomeScore); int num3 = 0; if (numCollected == numTotal) { num3 = biomeScore; } text += $" {biomeBonus.m_biomeName} (+{biomeBonus.m_bonus}): {numCollected}/{numTotal} (+{num3} Points)\n"; num += num3; } if (__m_completedAllBiomeBonuses) { text += $" All Biomes: {ALL_BIOME_BONUS_SCORE}\n"; num += ALL_BIOME_BONUS_SCORE; } if (__m_extraTimeScore > 0) { text += $" Extra Time: {__m_extraTimeScore / 5} min (+{__m_extraTimeScore} Points)\n"; num += __m_extraTimeScore; } } text += $" Earned Points: {num}\n Penalties: {num2}\n"; } return text + ""; } public static void ShowScoreTooltip(GameObject uiObject) { //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0067: 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_007c: 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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: 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_00b5: 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_00ea: 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_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0148: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)uiObject == (Object)null)) { string text = BuildScoreTooltipText(uiObject); ((TMP_Text)__m_scoreTooltipText).text = text; __m_scoreTooltipBackground.SetActive(true); __m_scoreTooltipObject.SetActive(true); Vector2 val = __m_trophyHuntScoreTooltipWindowSize; if (__toolTipSizes.ContainsKey(GetGameMode())) { val = __toolTipSizes[GetGameMode()]; } Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(val.x / 2f, val.y, 0f); Vector3 val3 = Input.mousePosition + val2; if (val3.x < 200f) { val3.x = 200f; } if (val3.y < 200f) { val3.y = 200f; } if (val3.x > (float)Screen.width - val.x) { val3.x = (float)Screen.width - val.x; } if (val3.y > (float)Screen.height - val.y) { val3.y = (float)Screen.height - val.y; } __m_scoreTooltipBackground.transform.position = val3; __m_scoreTooltipObject.transform.position = new Vector3(val3.x + __m_scoreTooltipTextOffset.x, val3.y - __m_scoreTooltipTextOffset.y, 0f); } } public static void HideScoreTooltip() { __m_scoreTooltipBackground.SetActive(false); __m_scoreTooltipObject.SetActive(false); } 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().sizeDelta = __m_luckTooltipWindowSize; ((Graphic)__m_luckTooltipBackground.AddComponent()).color = new Color(0f, 0f, 0f, 0.85f); __m_luckTooltipBackground.SetActive(false); __m_luckTooltipObject = new GameObject("Luck Tooltip Text"); __m_luckTooltipObject.transform.SetParent(__m_luckTooltipBackground.transform, false); __m_luckTooltipObject.AddComponent().sizeDelta = new Vector2(__m_luckTooltipWindowSize.x - __m_luckTooltipTextOffset.x, __m_luckTooltipWindowSize.y - __m_luckTooltipTextOffset.y); __m_luckTooltip = AddTextMeshProComponent(__m_luckTooltipObject); ((TMP_Text)__m_luckTooltip).fontSize = 14f; ((TMP_Text)__m_luckTooltip).alignment = (TextAlignmentOptions)257; ((Graphic)__m_luckTooltip).color = Color.yellow; __m_luckTooltipObject.SetActive(false); } public static void AddTooltipTriggersToLuckObject(GameObject uiObject) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0034: 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_0062: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)uiObject.GetComponent() != (Object)null)) { EventTrigger obj = uiObject.AddComponent(); Entry val = new Entry(); val.eventID = (EventTriggerType)0; ((UnityEvent)(object)val.callback).AddListener((UnityAction)delegate { ShowLuckTooltip(uiObject); }); obj.triggers.Add(val); Entry val2 = new Entry(); val2.eventID = (EventTriggerType)1; ((UnityEvent)(object)val2.callback).AddListener((UnityAction)delegate { HideLuckTooltip(); }); obj.triggers.Add(val2); } } 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 "" + luckRating.m_luckString + ""; } 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 = ""; float num4 = 0f; float num5 = 0f; float luckPercentage = 0f; float num6 = float.MaxValue; string text2 = ""; float num7 = 0f; float num8 = 0f; float luckPercentage2 = 0f; foreach (KeyValuePair item in __m_allTrophyDropInfo) { 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 = ""; string text4 = ""; float num11 = 0f; if (num > 0) { num11 = 100f * (num2 / (float)num); text3 = num11.ToString("0.0"); text4 = GetLuckRatingUIString(num11); } string text5 = "Luck-O-Meter\n Player Luck Score: " + text3 + "\n Player Luck Rating: " + 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 + " Luckiest:\n", string.Format(" {1} {2}% ({3}%)\n", colorString, text, num4.ToString("0.0"), num5)), " Unluckiest:\n"), string.Format(" {1} {2}% ({3}%)\n", colorString2, text2, num7.ToString("0.0"), num8)); } 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_luckTooltip).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 < 150f) { val2.x = 150f; } if (val2.y < 150f) { val2.y = 150f; } 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 CreateStandingsTooltip() { //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_standingsTooltipBackground = new GameObject("Standings Tooltip Background"); Transform transform = ((Component)Hud.instance).transform; __m_standingsTooltipBackground.transform.SetParent(transform, false); __m_standingsTooltipBackground.AddComponent().sizeDelta = __m_standingsTooltipWindowSize; ((Graphic)__m_standingsTooltipBackground.AddComponent()).color = new Color(0f, 0f, 0f, 0.9f); __m_standingsTooltipBackground.SetActive(false); __m_standingsTooltipObject = new GameObject("Standings Tooltip Text"); __m_standingsTooltipObject.transform.SetParent(__m_standingsTooltipBackground.transform, false); __m_standingsTooltipObject.AddComponent().sizeDelta = new Vector2(__m_standingsTooltipWindowSize.x - __m_standingsTooltipTextOffset.x, __m_standingsTooltipWindowSize.y - __m_standingsTooltipTextOffset.y); __m_standingsTooltip = AddTextMeshProComponent(__m_standingsTooltipObject); ((TMP_Text)__m_standingsTooltip).fontSize = 14f; ((TMP_Text)__m_standingsTooltip).alignment = (TextAlignmentOptions)257; ((Graphic)__m_standingsTooltip).color = Color.yellow; __m_standingsTooltipObject.SetActive(false); } public static void AddTooltipTriggersToStandingsObject(GameObject uiObject) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0034: 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_0062: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)uiObject.GetComponent() != (Object)null)) { EventTrigger obj = uiObject.AddComponent(); Entry val = new Entry(); val.eventID = (EventTriggerType)0; ((UnityEvent)(object)val.callback).AddListener((UnityAction)delegate { ShowStandingsTooltip(uiObject); }); obj.triggers.Add(val); Entry val2 = new Entry(); val2.eventID = (EventTriggerType)1; ((UnityEvent)(object)val2.callback).AddListener((UnityAction)delegate { HideStandingsTooltip(); }); obj.triggers.Add(val2); } } public static string BuildStandingsTooltipText(GameObject uiObject) { string text = "No Tournament Active"; string text2 = ""; if (__m_tournamentStatus != 0) { text = __m_tournamentName; text2 = __m_tournamentMode; if (text2 == "") { text2 = GetGameMode().ToString(); } } string text3 = "Not Running"; if (__m_tournamentStatus == TournamentStatus.Live) { text3 = "Live"; } else if (__m_tournamentStatus == TournamentStatus.Over) { text3 = "Ended"; } string text4 = " Leaderboard"; text4 = text4 + "\n Name: '" + text + "'"; text4 = text4 + "\n Game: " + text2 + " [" + text3 + "]\n"; int num = 20; __m_tournamentPlayerInfo.Sort((TournamentPlayerInfo p1, TournamentPlayerInfo p2) => p2.score.CompareTo(p1.score)); foreach (TournamentPlayerInfo item in __m_tournamentPlayerInfo) { int num2 = item.score; if (item.id == __m_configDiscordId.Value) { num2 = __m_playerCurrentScore; } text4 += $"{item.name}{num2}\n"; } return text4; } public static void ShowStandingsTooltip(GameObject uiObject) { //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_0062: 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_0089: 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_0090: 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_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)uiObject == (Object)null)) { string text = BuildStandingsTooltipText(uiObject); ((TMP_Text)__m_standingsTooltip).text = text; __m_standingsTooltipBackground.SetActive(true); __m_standingsTooltipObject.SetActive(true); ((TMP_Text)__m_standingsTooltip).ForceMeshUpdate(true, true); Bounds textBounds = ((TMP_Text)__m_standingsTooltip).textBounds; RectTransform component = __m_standingsTooltipObject.GetComponent(); RectTransform component2 = __m_standingsTooltipBackground.GetComponent(); Vector2 val = default(Vector2); ((Vector2)(ref val))..ctor(((Bounds)(ref textBounds)).size.x + 20f, ((Bounds)(ref textBounds)).size.y + 10f); __m_standingsTooltipWindowSize = val; component.sizeDelta = val; component2.sizeDelta = val; ((TMP_Text)__m_standingsTooltip).ForceMeshUpdate(true, true); Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(__m_standingsTooltipWindowSize.x / 2f, __m_standingsTooltipWindowSize.y, 0f); Vector3 val3 = Input.mousePosition + val2; if (val3.x < 150f) { val3.x = 150f; } if (val3.y < 150f) { val3.y = 150f; } if (val3.x > (float)Screen.width - __m_standingsTooltipWindowSize.x) { val3.x = (float)Screen.width - __m_standingsTooltipWindowSize.x; } if (val3.y > (float)Screen.height - __m_standingsTooltipWindowSize.y) { val3.y = (float)Screen.height - __m_standingsTooltipWindowSize.y; } __m_standingsTooltipBackground.transform.position = val3; __m_standingsTooltipObject.transform.position = new Vector3(val3.x + __m_standingsTooltipTextOffset.x, val3.y - __m_standingsTooltipTextOffset.y, 0f); } } public static void HideStandingsTooltip() { __m_standingsTooltipBackground.SetActive(false); __m_standingsTooltipObject.SetActive(false); } public static void CreateTrophyTooltip() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Expected O, but got Unknown //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_0090: Expected O, but got Unknown //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00d6: 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_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) Vector2 val = __m_trophyTooltipWindowSize; if (__m_showAllTrophyStats) { val = __m_trophyTooltipAllTrophyStatsWindowSize; } __m_trophyTooltipBackground = new GameObject("Tooltip Background"); Transform transform = ((Component)Hud.instance).transform; __m_trophyTooltipBackground.transform.SetParent(transform, false); __m_trophyTooltipBackground.AddComponent().sizeDelta = val; ((Graphic)__m_trophyTooltipBackground.AddComponent()).color = new Color(0f, 0f, 0f, 0.85f); __m_trophyTooltipBackground.SetActive(false); __m_trophyTooltipObject = new GameObject("Tooltip Text"); __m_trophyTooltipObject.transform.SetParent(__m_trophyTooltipBackground.transform, false); __m_trophyTooltipObject.AddComponent().sizeDelta = new Vector2(val.x - __m_trophyTooltipTextOffset.x, val.y - __m_trophyTooltipTextOffset.y); __m_trophyTooltip = AddTextMeshProComponent(__m_trophyTooltipObject); ((TMP_Text)__m_trophyTooltip).fontSize = 14f; ((TMP_Text)__m_trophyTooltip).alignment = (TextAlignmentOptions)257; ((Graphic)__m_trophyTooltip).color = Color.yellow; __m_trophyTooltipObject.SetActive(false); } public static void DeleteTrophyTooltip() { if ((Object)(object)__m_trophyTooltipObject != (Object)null) { Object.DestroyImmediate((Object)(object)__m_trophyTooltipObject); __m_trophyTooltipObject = null; } if (Object.op_Implicit((Object)(object)__m_trophyTooltipBackground)) { Object.DestroyImmediate((Object)(object)__m_trophyTooltipBackground); __m_trophyTooltipBackground = null; } } public static void AddTooltipTriggersToTrophyIcon(GameObject trophyIconObject) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0034: 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_0062: Expected O, but got Unknown //IL_0064: Unknown result type (might be due to invalid IL or missing references) if (!((Object)(object)trophyIconObject.GetComponent() != (Object)null)) { EventTrigger obj = trophyIconObject.AddComponent(); Entry val = new Entry(); val.eventID = (EventTriggerType)0; ((UnityEvent)(object)val.callback).AddListener((UnityAction)delegate { ShowTrophyTooltip(trophyIconObject); }); obj.triggers.Add(val); Entry val2 = new Entry(); val2.eventID = (EventTriggerType)1; ((UnityEvent)(object)val2.callback).AddListener((UnityAction)delegate { HideTrophyTooltip(); }); obj.triggers.Add(val2); } } public static void CalculateDropPercentAndRating(TrophyHuntData trophyHuntData, DropInfo dropInfo, out string dropPercentStr, out string dropRatingStr) { dropPercentStr = "0"; dropRatingStr = ""; 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 BuildCookingTooltipText(GameObject uiObject) { if ((Object)(object)uiObject == (Object)null) { return "ERROR"; } ConsumableData consumableData = Array.Find(__m_cookedFoodData, (ConsumableData element) => element.m_prefabName == ((Object)uiObject).name); return "" + consumableData.m_displayName + "\n" + $"Point Value: {consumableData.m_points}\n" + $" Health: {consumableData.m_health}\n" + $" Stamina: {consumableData.m_stamina}\n" + $" Regen: {consumableData.m_regen}/sec\n" + $" Eitr: {consumableData.m_eitr}\n" + " Biome: " + consumableData.m_biome.ToString() + "\n"; } 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 = ""; CalculateDropPercentAndRating(trophyHuntData, dropInfo2, out dropPercentStr, out dropRatingStr); string dropPercentStr2 = "0"; string dropRatingStr2 = ""; CalculateDropPercentAndRating(trophyHuntData, dropInfo, out dropPercentStr2, out dropRatingStr2); string text = trophyHuntData.m_dropPercent.ToString(); string text2 = "" + trophyHuntData.m_prettyName + "\n" + $"Point Value: {trophyHuntData.GetCurGameModeTrophyScoreValue()}\n" + $"Player Kills: {dropInfo2.m_numKilled}\n" + $"Trophies Picked Up: {dropInfo2.m_trophies}\n" + "Kill/Pickup Rate: " + dropPercentStr + "%\nWiki Trophy Drop Rate: (" + text + "%)\nPlayer Luck Rating: " + dropRatingStr + "\n"; if (__m_showAllTrophyStats) { text2 = text2 + $"Actual Kills: {dropInfo.m_numKilled}\n" + $"Actual Trophies: {dropInfo.m_trophies}\n" + "Actual Drop Rate: " + dropPercentStr2 + "% (" + text + "%)\nActual Luck Rating: " + dropRatingStr2 + "\n"; } return text2; } public static void ShowTrophyTooltip(GameObject uiObject) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0080: 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_0086: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0124: 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_014b: 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) if (!((Object)(object)uiObject == (Object)null)) { string text = ""; text = ((GetGameMode() != TrophyGameMode.CulinarySaga) ? BuildTrophyTooltipText(uiObject) : BuildCookingTooltipText(uiObject)); ((TMP_Text)__m_trophyTooltip).text = text; __m_trophyTooltipBackground.SetActive(true); __m_trophyTooltipObject.SetActive(true); Vector2 val = __m_trophyTooltipWindowSize; if (__m_showAllTrophyStats) { val = __m_trophyTooltipAllTrophyStatsWindowSize; } Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(val.x / 2f, val.y, 0f); Vector3 val3 = Input.mousePosition + val2; if (val3.x < 0f) { val3.x = 0f; } if (val3.y < 0f) { val3.y = 0f; } if (val3.x > (float)Screen.width - val.x) { val3.x = (float)Screen.width - val.x; } if (val3.y > (float)Screen.height - val.y) { val3.y = (float)Screen.height - val.y; } __m_trophyTooltipBackground.transform.position = val3; __m_trophyTooltipObject.transform.position = new Vector3(val3.x + __m_trophyTooltipTextOffset.x, val3.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 bool RecordPlayerPickedUpTrophy(string trophyName) { if (__m_playerTrophyDropInfo.ContainsKey(trophyName)) { DropInfo value = __m_playerTrophyDropInfo[trophyName]; value.m_trophies++; __m_playerTrophyDropInfo[trophyName] = value; return true; } return false; } public static void RecordTrophyCapableKill(string characterName, bool killedByPlayer) { string key = EnemyNameToTrophyName(characterName); if (killedByPlayer) { DropInfo value = __m_playerTrophyDropInfo[key]; value.m_numKilled++; __m_playerTrophyDropInfo[key] = value; } else { DropInfo value2 = __m_allTrophyDropInfo[key]; value2.m_numKilled++; __m_allTrophyDropInfo[key] = value2; } } public static void InitializeSagaDrops() { foreach (string item in new List(__m_specialSagaDrops.Keys)) { List list = __m_specialSagaDrops[item]; for (int i = 0; i < list.Count; i++) { SpecialSagaDrop value = list[i]; value.m_numDropped = 0; value.m_numPickedUp = 0; list[i] = value; } __m_specialSagaDrops[item] = list; } } public static bool HasAnyoneDropped(string itemName) { bool result = false; foreach (KeyValuePair> _m_specialSagaDrop in __m_specialSagaDrops) { foreach (SpecialSagaDrop item in _m_specialSagaDrop.Value) { if (item.m_itemName == itemName && item.m_numDropped > 0) { return true; } } } return result; } public static bool HasBeenPickedUp(string itemName) { bool result = false; foreach (KeyValuePair> _m_specialSagaDrop in __m_specialSagaDrops) { foreach (SpecialSagaDrop item in _m_specialSagaDrop.Value) { if (item.m_itemName == itemName && item.m_numPickedUp > 0) { return true; } } } return result; } public static void ConvertMetal(ref ItemData itemData) { if ((!IsSagaMode() && !__m_instaSmelt) || itemData == null) { return; } ZNetScene instance = ZNetScene.instance; if ((Object)(object)instance == (Object)null || !__m_oreNameToBarPrefabName.TryGetValue(((Object)itemData.m_dropPrefab).name, out var value)) { return; } GameObject prefab = instance.GetPrefab(value); if (!((Object)(object)prefab == (Object)null)) { ItemDrop component = prefab.GetComponent(); if ((Object)(object)component != (Object)null) { int stack = itemData.m_stack; ItemData itemData2 = component.m_itemData; itemData = itemData2.Clone(); itemData.m_stack = stack; itemData.m_dropPrefab = prefab; } } } public static void ConvertMetalOresIfNecessary(ref ItemData item) { if (!IsSagaMode() && !__m_instaSmelt) { return; } ConvertMetal(ref item); if (GetGameMode() != TrophyGameMode.CulinarySaga) { return; } bool flag = false; ConsumableData[] _m_cookedFoodData = __m_cookedFoodData; for (int i = 0; i < _m_cookedFoodData.Length; i++) { if (_m_cookedFoodData[i].m_prefabName == ((Object)item.m_dropPrefab).name) { flag = true; break; } } if (flag && !__m_cookedFoods.Contains(((Object)item.m_dropPrefab).name)) { FlashTrophy(((Object)item.m_dropPrefab).name); __m_cookedFoods.Add(((Object)item.m_dropPrefab).name); if (__m_cookedFoods.Count == __m_cookedFoodData.Length) { MessageHud.instance.ShowBiomeFoundMsg("Odin is Sated", true); } } UpdateModUI(Player.m_localPlayer); } public static void AddToggleGameModeButton(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_009c: 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_00b0: 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_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Expected O, but got Unknown //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Expected O, but got Unknown GameObject val = new GameObject("ToggleGameModeButton"); val.transform.SetParent(parentTransform); RectTransform obj = val.AddComponent(); ((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(-170f, -200f); obj.sizeDelta = new Vector2(200f, 25f); Button obj2 = val.AddComponent