The BepInEx console will not appear when launching like it does for other games on Thunderstore (you can turn it back on in your BepInEx.cfg file). If your PEAK crashes on startup, add -dx12 to your launch parameters.
Decompiled source of ItemInfoDisplayForkedCN v1.0.2
com.github.chuxiaaaa.ItemInfoDisplayForkedCN.dll
Decompiled 11 hours agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HarmonyLib; using Microsoft.CodeAnalysis; using Peak.Afflictions; using TMPro; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("com.github.chuxiaaaa.ItemInfoDisplayForkedCN")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.2.0")] [assembly: AssemblyInformationalVersion("1.0.2")] [assembly: AssemblyProduct("com.github.chuxiaaaa.ItemInfoDisplayForkedCN")] [assembly: AssemblyTitle("ItemInfoDisplayForkedCN")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.2.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace BepInEx { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class BepInAutoPluginAttribute : Attribute { public BepInAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace BepInEx.Preloader.Core.Patching { [AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)] [Conditional("CodeGeneration")] internal sealed class PatcherAutoPluginAttribute : Attribute { public PatcherAutoPluginAttribute(string? id = null, string? name = null, string? version = null) { } } } namespace ItemInfoDisplay { [BepInPlugin("com.github.chuxiaaaa.ItemInfoDisplayForkedCN", "ItemInfoDisplayForkedCN", "1.0.2")] public class Plugin : BaseUnityPlugin { private static class ItemInfoDisplayUpdatePatch { public static float total { get; set; } [HarmonyPatch(typeof(AOE), "Explode")] [HarmonyPostfix] public static void Explode(AOE __instance) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) Log.LogInfo((object)string.Format("Explode:{0},{1},{2},{3}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ff"), ((Object)__instance).GetInstanceID(), __instance.statusType, __instance.statusAmount)); } [HarmonyPatch(typeof(AOE), "GetFactor")] [HarmonyPostfix] public static void GetFactor(AOE __instance, float dist, float __result) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) Log.LogInfo((object)string.Format("GetFactor:{0},{1},{2},{3},{4},{5}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ff"), ((Object)__instance).GetInstanceID(), __instance.statusType, __instance.statusAmount, dist, __result)); } [HarmonyPatch(typeof(CharacterAfflictions), "AdjustStatus")] [HarmonyPostfix] public static void AdjustStatus(CharacterAfflictions __instance, STATUSTYPE statusType, float amount) { total += amount; Log.LogInfo((object)string.Format("AdjustStatus:{0},{1},{2},{3}", DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss:ff"), ((object)(STATUSTYPE)(ref statusType)).ToString(), amount, total)); } [HarmonyPatch(typeof(CharacterItems), "Update")] [HarmonyPostfix] private static void ItemInfoDisplayUpdate(CharacterItems __instance) { try { if ((Object)(object)guiManager == (Object)null) { AddDisplayObject(); } else if ((Object)(object)Character.observedCharacter.data.currentItem != (Object)null) { if (hasChanged) { hasChanged = false; ProcessItemGameObject(); } else if (Mathf.Abs(Character.observedCharacter.data.sinceItemAttach - lastKnownSinceItemAttach) >= configForceUpdateTime.Value) { hasChanged = true; lastKnownSinceItemAttach = Character.observedCharacter.data.sinceItemAttach; } if (!((Component)itemInfoDisplayTextMesh).gameObject.activeSelf) { ((Component)itemInfoDisplayTextMesh).gameObject.SetActive(true); } } else if (((Component)itemInfoDisplayTextMesh).gameObject.activeSelf) { ((Component)itemInfoDisplayTextMesh).gameObject.SetActive(false); } } catch (Exception ex) { Log.LogError((object)(ex.Message + ex.StackTrace)); } } } private static class ItemInfoDisplayEquipPatch { [HarmonyPatch(typeof(CharacterItems), "Equip")] [HarmonyPostfix] private static void ItemInfoDisplayEquip(CharacterItems __instance) { try { if (Character.observedCharacter == __instance.character) { hasChanged = true; } } catch (Exception ex) { Log.LogError((object)(ex.Message + ex.StackTrace)); } } } private static class ItemInfoDisplayFinishCookingPatch { [HarmonyPatch(typeof(ItemCooking), "FinishCooking")] [HarmonyPostfix] private static void ItemInfoDisplayFinishCooking(ItemCooking __instance) { try { if (Character.observedCharacter == ((ItemComponent)__instance).item.holderCharacter) { hasChanged = true; } } catch (Exception ex) { Log.LogError((object)(ex.Message + ex.StackTrace)); } } } private static class ItemInfoDisplayReduceUsesRPCPatch { [HarmonyPatch(typeof(Action_ReduceUses), "ReduceUsesRPC")] [HarmonyPostfix] private static void ItemInfoDisplayReduceUsesRPC(Action_ReduceUses __instance) { try { if (Character.observedCharacter == ((ItemActionBase)__instance).character) { hasChanged = true; } } catch (Exception ex) { Log.LogError((object)(ex.Message + ex.StackTrace)); } } } private class ComponentEffectInfo { public Component Component { get; set; } public float Value { get; set; } public string EffectKey { get; set; } } private static GUIManager guiManager; private static TextMeshProUGUI itemInfoDisplayTextMesh; private static Dictionary<string, string> effectColors = new Dictionary<string, string>(); private static float lastKnownSinceItemAttach; private static bool hasChanged; private static ConfigEntry<float> configFontSize; private static ConfigEntry<float> configOutlineWidth; private static ConfigEntry<float> configLineSpacing; private static ConfigEntry<float> configSizeDeltaX; private static ConfigEntry<float> configForceUpdateTime; public const string Id = "com.github.chuxiaaaa.ItemInfoDisplayForkedCN"; internal static ManualLogSource Log { get; private set; } = null; public static bool EasyBackpack { get; set; } public static string Name => "ItemInfoDisplayForkedCN"; public static string Version => "1.0.2"; private void Awake() { Log = ((BaseUnityPlugin)this).Logger; InitEffectColors(effectColors); lastKnownSinceItemAttach = 0f; hasChanged = true; configFontSize = ((BaseUnityPlugin)this).Config.Bind<float>("ItemInfoDisplay", "Font Size", 20f, "Customize the Font Size for description text."); configOutlineWidth = ((BaseUnityPlugin)this).Config.Bind<float>("ItemInfoDisplay", "Outline Width", 0.08f, "Customize the Outline Width for item description text."); configLineSpacing = ((BaseUnityPlugin)this).Config.Bind<float>("ItemInfoDisplay", "Line Spacing", -35f, "Customize the Line Spacing for item description text."); configSizeDeltaX = ((BaseUnityPlugin)this).Config.Bind<float>("ItemInfoDisplay", "Size Delta X", 550f, "Customize the horizontal length of the container for the mod. Increasing moves text left, decreasing moves text right."); configForceUpdateTime = ((BaseUnityPlugin)this).Config.Bind<float>("ItemInfoDisplay", "Force Update Time", 1f, "Customize the time in seconds until the mod forces an update for the item."); Harmony.CreateAndPatchAll(typeof(ItemInfoDisplayUpdatePatch), (string)null); Harmony.CreateAndPatchAll(typeof(ItemInfoDisplayEquipPatch), (string)null); Harmony.CreateAndPatchAll(typeof(ItemInfoDisplayFinishCookingPatch), (string)null); Harmony.CreateAndPatchAll(typeof(ItemInfoDisplayReduceUsesRPCPatch), (string)null); Log.LogInfo((object)("Plugin " + Name + " is loaded!")); } private static string GetEffectChineseName(string effect) { return effect switch { "Hunger" => "饥饿值", "Extra Stamina" => "额外体力", "Spores" => "真菌感染", "Injury" => "伤害", "Poison" => "中毒", "Cold" => "寒冷", "Heat" => "烧伤", "Hot" => "烧伤", "Drowsy" => "困倦", "Curse" => "诅咒", "Thorns" => "刺伤", "Shield" => "护盾", _ => effect.ToUpper(), }; } private static ComponentEffectInfo GetComponentEffectInfo(Component component) { //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Expected O, but got Unknown //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Expected O, but got Unknown //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Expected O, but got Unknown //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Expected O, but got Unknown //IL_015d: Unknown result type (might be due to invalid IL or missing references) Type type = ((object)component).GetType(); ComponentEffectInfo componentEffectInfo = new ComponentEffectInfo { Component = component }; if (type == typeof(Action_RestoreHunger)) { Action_RestoreHunger val = (Action_RestoreHunger)component; componentEffectInfo.Value = Mathf.Abs(val.restorationAmount); componentEffectInfo.EffectKey = "Action_RestoreHunger_Hunger"; } else if (type == typeof(Action_GiveExtraStamina)) { Action_GiveExtraStamina val2 = (Action_GiveExtraStamina)component; componentEffectInfo.Value = Mathf.Abs(val2.amount); componentEffectInfo.EffectKey = "Action_GiveExtraStamina_ExtraStamina"; } else if (type == typeof(Action_InflictPoison)) { Action_InflictPoison val3 = (Action_InflictPoison)component; componentEffectInfo.Value = Mathf.Abs(val3.poisonPerSecond * val3.inflictionTime); componentEffectInfo.EffectKey = "Action_InflictPoison_Poison"; } else if (type == typeof(Action_AddOrRemoveThorns)) { Action_AddOrRemoveThorns val4 = (Action_AddOrRemoveThorns)component; componentEffectInfo.Value = val4.thornCount; componentEffectInfo.EffectKey = "Action_AddOrRemoveThorns_Thorns"; } else if (type == typeof(Action_ModifyStatus)) { Action_ModifyStatus val5 = (Action_ModifyStatus)component; componentEffectInfo.Value = Mathf.Abs(val5.changeAmount); componentEffectInfo.EffectKey = $"Action_ModifyStatus_{val5.statusType}"; } else { componentEffectInfo.Value = 0f; componentEffectInfo.EffectKey = type.Name; } return componentEffectInfo; } private static void ProcessItemGameObject() { //IL_02bd: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Expected O, but got Unknown //IL_035d: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Expected O, but got Unknown //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Expected O, but got Unknown //IL_03e7: Unknown result type (might be due to invalid IL or missing references) //IL_03ee: Expected O, but got Unknown //IL_0446: Unknown result type (might be due to invalid IL or missing references) //IL_044d: Expected O, but got Unknown //IL_0565: Unknown result type (might be due to invalid IL or missing references) //IL_056c: Expected O, but got Unknown //IL_04b4: Unknown result type (might be due to invalid IL or missing references) //IL_04bb: Expected O, but got Unknown //IL_0622: Unknown result type (might be due to invalid IL or missing references) //IL_0629: Expected O, but got Unknown //IL_0661: Unknown result type (might be due to invalid IL or missing references) //IL_0668: Expected O, but got Unknown //IL_0717: Unknown result type (might be due to invalid IL or missing references) //IL_071e: Expected O, but got Unknown //IL_07dc: Unknown result type (might be due to invalid IL or missing references) //IL_07e3: Expected O, but got Unknown //IL_094c: Unknown result type (might be due to invalid IL or missing references) //IL_0953: Expected O, but got Unknown //IL_0a53: Unknown result type (might be due to invalid IL or missing references) //IL_0a5a: Expected O, but got Unknown //IL_09d6: Unknown result type (might be due to invalid IL or missing references) //IL_09dd: Expected O, but got Unknown //IL_0c53: Unknown result type (might be due to invalid IL or missing references) //IL_0c5a: Expected O, but got Unknown //IL_0877: Unknown result type (might be due to invalid IL or missing references) //IL_087c: Unknown result type (might be due to invalid IL or missing references) //IL_0e32: Unknown result type (might be due to invalid IL or missing references) //IL_0e39: Expected O, but got Unknown //IL_0f00: Unknown result type (might be due to invalid IL or missing references) //IL_0f07: Expected O, but got Unknown //IL_1061: Unknown result type (might be due to invalid IL or missing references) //IL_1068: Expected O, but got Unknown //IL_1140: Unknown result type (might be due to invalid IL or missing references) //IL_1147: Expected O, but got Unknown //IL_11c9: Unknown result type (might be due to invalid IL or missing references) //IL_11d0: Expected O, but got Unknown //IL_1296: Unknown result type (might be due to invalid IL or missing references) //IL_129d: Expected O, but got Unknown //IL_14d1: Unknown result type (might be due to invalid IL or missing references) //IL_14d8: Expected O, but got Unknown //IL_1702: Unknown result type (might be due to invalid IL or missing references) //IL_1709: Expected O, but got Unknown //IL_18c1: Unknown result type (might be due to invalid IL or missing references) //IL_18c8: Expected O, but got Unknown //IL_196f: Unknown result type (might be due to invalid IL or missing references) //IL_1976: Expected O, but got Unknown //IL_1ac8: Unknown result type (might be due to invalid IL or missing references) //IL_1acf: Expected O, but got Unknown //IL_1f58: Unknown result type (might be due to invalid IL or missing references) //IL_1f5f: Expected O, but got Unknown //IL_2011: Unknown result type (might be due to invalid IL or missing references) //IL_2018: Expected O, but got Unknown //IL_201a: Unknown result type (might be due to invalid IL or missing references) //IL_2020: Invalid comparison between Unknown and I4 //IL_22da: Unknown result type (might be due to invalid IL or missing references) //IL_22e1: Expected O, but got Unknown //IL_23c5: Unknown result type (might be due to invalid IL or missing references) //IL_23cc: Expected O, but got Unknown //IL_251d: Unknown result type (might be due to invalid IL or missing references) //IL_2524: Expected O, but got Unknown Item currentItem = Character.observedCharacter.data.currentItem; GameObject gameObject = ((Component)currentItem).gameObject; Component[] components = gameObject.GetComponents(typeof(Component)); Dictionary<Type, List<ComponentEffectInfo>> dictionary = new Dictionary<Type, List<ComponentEffectInfo>>(); bool flag = false; string text = ""; string text2 = ""; string text3 = ""; string text4 = ""; string text5 = ""; ((TMP_Text)itemInfoDisplayTextMesh).text = ""; text2 = ((((Object)currentItem).name == "Backpack(Clone)") ? (text2 + effectColors["Weight"] + "0 重量</color>") : ((Ascents.itemWeightModifier <= 0) ? (text2 + effectColors["Weight"] + ((float)currentItem.carryWeight * 2.5f).ToString("F1").Replace(".0", "") + " 重量</color>") : (text2 + effectColors["Weight"] + ((float)(currentItem.carryWeight + Ascents.itemWeightModifier) * 2.5f).ToString("F1").Replace(".0", "") + " 重量</color>"))); if (((Object)gameObject).name.Equals("Bugle(Clone)")) { TextMeshProUGUI obj = itemInfoDisplayTextMesh; ((TMP_Text)obj).text = ((TMP_Text)obj).text + "使用 " + effectColors["Hunger"] + "喇叭</color> 发出一些美妙的声音\n"; } else if (((Object)gameObject).name.Equals("Pirate Compass(Clone)")) { TextMeshProUGUI obj2 = itemInfoDisplayTextMesh; ((TMP_Text)obj2).text = ((TMP_Text)obj2).text + effectColors["Injury"] + "指向</color>最近的行李\n"; } else if (((Object)gameObject).name.Equals("Compass(Clone)")) { TextMeshProUGUI obj3 = itemInfoDisplayTextMesh; ((TMP_Text)obj3).text = ((TMP_Text)obj3).text + effectColors["Injury"] + "指向</color>北方的山峰\n"; } else if (((Object)gameObject).name.Equals("Shell Big(Clone)")) { TextMeshProUGUI obj4 = itemInfoDisplayTextMesh; ((TMP_Text)obj4).text = ((TMP_Text)obj4).text + effectColors["Hunger"] + "开</color>椰子的好工具\n"; } bool flag2 = false; TextMeshProUGUI val15; for (int i = 0; i < components.Length; i++) { Type type = ((object)components[i]).GetType(); Component val = components[i]; Behaviour val2 = (Behaviour)(object)((val is Behaviour) ? val : null); if (val2 != null && !val2.enabled) { continue; } if (type == typeof(ItemUseFeedback)) { ItemUseFeedback val3 = (ItemUseFeedback)val; if (val3.useAnimation.Equals("Eat") || ((Component)val3).tag == "BookOfBones" || val3.useAnimation.Equals("Drink") || val3.useAnimation.Equals("Heal")) { flag = true; } } else if (type == typeof(Action_Consume)) { flag = true; } else if (type == typeof(Action_RestoreHunger)) { Action_RestoreHunger val4 = (Action_RestoreHunger)val; text += ProcessEffect(val4.restorationAmount * -1f, "Hunger"); } else if (type == typeof(Action_GiveExtraStamina)) { Action_GiveExtraStamina val5 = (Action_GiveExtraStamina)val; text += ProcessEffect(val5.amount, "Extra Stamina"); } else if (type == typeof(Action_InflictPoison)) { Action_InflictPoison val6 = (Action_InflictPoison)val; text = text + val6.delay + "秒后, " + ProcessEffectOverTime(val6.poisonPerSecond, 1f, val6.inflictionTime, "Poison"); } else if (type == typeof(Action_AddOrRemoveThorns)) { Action_AddOrRemoveThorns val7 = (Action_AddOrRemoveThorns)val; text += ProcessEffect((float)val7.thornCount * 0.05f, "Thorns"); } else if (type == typeof(Action_ModifyStatus)) { Character val8 = Character.localCharacter; if (val8.data.fullyPassedOut) { val8 = MainCameraMovement.specCharacter; } Action_ModifyStatus val9 = (Action_ModifyStatus)val; if ((val9.ifSkeleton && val8.data.isSkeleton) || flag2) { text += ProcessEffect(val9.changeAmount, ((object)(STATUSTYPE)(ref val9.statusType)).ToString()); } else if (!val9.ifSkeleton) { text += ProcessEffect(val9.changeAmount, ((object)(STATUSTYPE)(ref val9.statusType)).ToString()); } } else if (type == typeof(Action_ApplyMassAffliction)) { Action_ApplyMassAffliction val10 = (Action_ApplyMassAffliction)val; text5 += "<#CCCCCC>附近玩家将获得:</color>\n"; text5 += ProcessAffliction(((Action_ApplyAffliction)val10).affliction); if (((Action_ApplyAffliction)val10).extraAfflictions.Length == 0) { continue; } for (int j = 0; j < ((Action_ApplyAffliction)val10).extraAfflictions.Length; j++) { if (text5.EndsWith('\n')) { text5 = text5.Remove(text5.Length - 1); } text5 = text5 + ",\n" + ProcessAffliction(((Action_ApplyAffliction)val10).extraAfflictions[j]); } } else if (type == typeof(Action_ApplyAffliction)) { Action_ApplyAffliction val11 = (Action_ApplyAffliction)val; text5 += ProcessAffliction(val11.affliction); } else if (type == typeof(Mandrake)) { Mandrake val12 = (Mandrake)val; TextMeshProUGUI obj5 = itemInfoDisplayTextMesh; ((TMP_Text)obj5).text = ((TMP_Text)obj5).text + string.Format("当你唤醒 {0} 曼德拉草</color> 后,它会给你唱晚安曲\n\n对附近 {1} 米内的玩家施加 {2}{3}</color> 效果\n\n", effectColors["ItemInfoDisplayNegative"], val12.aoe.range, effectColors[((object)(STATUSTYPE)(ref val12.aoe.statusType)).ToString()], GetEffectChineseName(((object)(STATUSTYPE)(ref val12.aoe.statusType)).ToString())); } else if (type == typeof(Action_Numb)) { Action_Numb val13 = (Action_Numb)val; text = text + "获得 " + effectColors["ItemInfoDisplayNegative"] + "麻木</color> 效果,持续 " + val13.numbAmount.ToString("F1").Replace(".0", "") + " 秒</color>\n\n"; } else if (type == typeof(Action_BecomeSkeleton)) { TextMeshProUGUI obj6 = itemInfoDisplayTextMesh; ((TMP_Text)obj6).text = ((TMP_Text)obj6).text + "使用后你将会变成 骷髅人\n\n"; flag2 = true; } else if (type == typeof(Action_ClearAllStatus)) { Action_ClearAllStatus val14 = (Action_ClearAllStatus)val; TextMeshProUGUI obj7 = itemInfoDisplayTextMesh; ((TMP_Text)obj7).text = ((TMP_Text)obj7).text + effectColors["ItemInfoDisplayPositive"] + "清除所有状态</color>"; if (val14.excludeCurse) { TextMeshProUGUI obj8 = itemInfoDisplayTextMesh; ((TMP_Text)obj8).text = ((TMP_Text)obj8).text + " 除了 " + effectColors["Curse"] + "诅咒</color>"; } if (val14.otherExclusions.Count > 0) { foreach (STATUSTYPE otherExclusion in val14.otherExclusions) { STATUSTYPE current = otherExclusion; val15 = itemInfoDisplayTextMesh; ((TMP_Text)val15).text = ((TMP_Text)val15).text + ", " + effectColors[((object)(STATUSTYPE)(ref current)).ToString()] + ((object)(STATUSTYPE)(ref current)).ToString().ToUpper() + "</color>"; } } ((TMP_Text)itemInfoDisplayTextMesh).text = ((TMP_Text)itemInfoDisplayTextMesh).text.Replace(", <#E13542>CRAB</color>", "") + "\n"; } else if (type == typeof(Action_ConsumeAndSpawn)) { Action_ConsumeAndSpawn val16 = (Action_ConsumeAndSpawn)val; if (((object)val16.itemToSpawn).ToString().Contains("Peel")) { TextMeshProUGUI obj9 = itemInfoDisplayTextMesh; ((TMP_Text)obj9).text = ((TMP_Text)obj9).text + "<#CCCCCC>食用后获得果皮</color>\n"; } } else if (type == typeof(Action_ReduceUses)) { if (currentItem.data.data.ContainsKey((DataEntryKey)2)) { OptionableIntItemData val17 = (OptionableIntItemData)currentItem.data.data[(DataEntryKey)2]; if (val17.HasData) { text3 = ((val17.Value <= 1) ? (text3 + " 只能使用 1 次") : (text3 + " 还可以使用" + val17.Value + " 次")); } } } else if (type == typeof(Lantern)) { Lantern val18 = (Lantern)val; if (((Object)gameObject).name.Equals("Torch(Clone)")) { TextMeshProUGUI obj10 = itemInfoDisplayTextMesh; ((TMP_Text)obj10).text = ((TMP_Text)obj10).text + "可以点燃\n"; } else { text5 += "<#CCCCCC>点燃时,附近玩家获得:</color>\n\n"; } if (((Object)gameObject).name.Equals("Lantern_Faerie(Clone)")) { StatusField component = ((Component)gameObject.transform.Find("FaerieLantern/Light/Heat")).GetComponent<StatusField>(); text5 = text5 + "<#CCCCCC>还可以使用 " + val18.fuel.ToString("F1").Replace(".0", "") + "秒</color>\n\n"; text5 += ProcessEffectPerSecond(component.statusAmountPerSecond, ((object)(STATUSTYPE)(ref component.statusType)).ToString()); foreach (StatusFieldStatus additionalStatus in component.additionalStatuses) { text5 += ProcessEffectPerSecond(additionalStatus.statusAmountPerSecond, ((object)(STATUSTYPE)(ref additionalStatus.statusType)).ToString()); } } else if (((Object)gameObject).name.Equals("Lantern(Clone)")) { Transform obj11 = gameObject.transform.Find("GasLantern/Light/Heat"); StatusField val19 = ((obj11 != null) ? ((Component)obj11).GetComponent<StatusField>() : null); text5 = text5 + "<#CCCCCC>还可以使用 " + val18.fuel.ToString("F1").Replace(".0", "") + "秒</color>\n\n"; if ((Object)(object)val19 != (Object)null) { text5 += ProcessEffectPerSecond(val19.statusAmountPerSecond, ((object)(STATUSTYPE)(ref val19.statusType)).ToString()); } } } else if (type == typeof(Action_RaycastDart)) { Action_RaycastDart val20 = (Action_RaycastDart)val; flag = true; text5 += "<#CCCCCC>发射飞镖,将对被命中的玩家施加以下效果:</color>\n\n"; for (int k = 0; k < val20.afflictionsOnHit.Length; k++) { text5 += ProcessAffliction(val20.afflictionsOnHit[k]); } } else if (type == typeof(MagicBugle)) { TextMeshProUGUI obj12 = itemInfoDisplayTextMesh; ((TMP_Text)obj12).text = ((TMP_Text)obj12).text + "当你吹奏喇叭时,"; } else if (type == typeof(ClimbingSpikeComponent)) { TextMeshProUGUI obj13 = itemInfoDisplayTextMesh; ((TMP_Text)obj13).text = ((TMP_Text)obj13).text + "放置一个可抓住的岩钉,可以在岩钉上" + effectColors["Extra Stamina"] + "恢复体力</color>\n"; } else if (type == typeof(Action_Flare)) { TextMeshProUGUI obj14 = itemInfoDisplayTextMesh; ((TMP_Text)obj14).text = ((TMP_Text)obj14).text + "可以点燃\n"; } else if (type == typeof(Backpack)) { if (EasyBackpack) { TextMeshProUGUI obj15 = itemInfoDisplayTextMesh; ((TMP_Text)obj15).text = ((TMP_Text)obj15).text + "按下 B 键可以打开背包,并存入物品\n"; } else { TextMeshProUGUI obj16 = itemInfoDisplayTextMesh; ((TMP_Text)obj16).text = ((TMP_Text)obj16).text + "放下背包才可以存入物品\n"; } } else if (type == typeof(BananaPeel)) { TextMeshProUGUI obj17 = itemInfoDisplayTextMesh; ((TMP_Text)obj17).text = ((TMP_Text)obj17).text + effectColors["Hunger"] + "踩上去会滑倒</color>\n"; } else if (type == typeof(Constructable)) { Constructable val21 = (Constructable)val; if (((Object)val21.constructedPrefab).name.Equals("PortableStovetop_Placed")) { val15 = itemInfoDisplayTextMesh; ((TMP_Text)val15).text = ((TMP_Text)val15).text + "放置一个 便携火炉 可以提供 " + effectColors["Injury"] + "烹饪</color> 功能 ,持续 " + val21.constructedPrefab.GetComponent<Campfire>().burnsFor + "秒\n"; } else { TextMeshProUGUI obj18 = itemInfoDisplayTextMesh; ((TMP_Text)obj18).text = ((TMP_Text)obj18).text + "可以放置\n"; } } else if (type == typeof(RopeSpool)) { RopeSpool val22 = (RopeSpool)val; if (val22.isAntiRope) { TextMeshProUGUI obj19 = itemInfoDisplayTextMesh; ((TMP_Text)obj19).text = ((TMP_Text)obj19).text + "放置一条向上的反重力绳子\n\n"; } else { TextMeshProUGUI obj20 = itemInfoDisplayTextMesh; ((TMP_Text)obj20).text = ((TMP_Text)obj20).text + "放一条绳子\n\n"; } val15 = itemInfoDisplayTextMesh; ((TMP_Text)val15).text = ((TMP_Text)val15).text + "长度从 " + (val22.minSegments / 4f).ToString("F2").Replace(".0", "") + " 米到 " + ((float)Rope.MaxSegments / 4f).ToString("F1").Replace(".0", "") + " 米\n"; if (configForceUpdateTime.Value <= 1f) { text3 = text3 + " 剩余 " + (val22.RopeFuel / 4f).ToString("F2").Replace(".00", "") + " 米"; } } else if (type == typeof(RopeShooter)) { RopeShooter val23 = (RopeShooter)val; TextMeshProUGUI obj21 = itemInfoDisplayTextMesh; ((TMP_Text)obj21).text = ((TMP_Text)obj21).text + "发射一个绳索锚点,可生成\n\n一条"; if (((Object)val23.ropeAnchorWithRopePref).name.Equals("RopeAnchorForRopeShooterAnti")) { TextMeshProUGUI obj22 = itemInfoDisplayTextMesh; ((TMP_Text)obj22).text = ((TMP_Text)obj22).text + "向上漂浮 "; } else { TextMeshProUGUI obj23 = itemInfoDisplayTextMesh; ((TMP_Text)obj23).text = ((TMP_Text)obj23).text + "向下垂落 "; } TextMeshProUGUI obj24 = itemInfoDisplayTextMesh; ((TMP_Text)obj24).text = ((TMP_Text)obj24).text + (val23.maxLength / 4f).ToString("F1").Replace(".0", "") + "米的绳子\n"; } else if (type == typeof(Antigrav)) { Antigrav val24 = (Antigrav)val; if (val24.intensity != 0f) { text5 = text5 + effectColors["Injury"] + "警告:</color> <#CCCCCC>丢弃时会飞走</color>\n\n"; } } else if (type == typeof(Action_Balloon)) { text5 += "可以绑在玩家身上\n"; } else if (type == typeof(VineShooter)) { VineShooter val25 = (VineShooter)val; TextMeshProUGUI obj25 = itemInfoDisplayTextMesh; ((TMP_Text)obj25).text = ((TMP_Text)obj25).text + "从你的位置发射一条锁链\n\n连接到射击点,最远可达\n\n" + (val25.maxLength / 1.6666666f).ToString("F1").Replace(".0", "") + " 米距离\n"; } else if (type == typeof(CloudFungus)) { text5 = text5 + effectColors["Hunger"] + "丢下</color>以部署一个云朵(可在空中生成)\n"; } else { if (type == typeof(Action_Numb)) { continue; } if (type == typeof(ShelfShroom)) { ShelfShroom val26 = (ShelfShroom)val; if (((Object)val26.instantiateOnBreak).name.Equals("HealingPuffShroomSpawn")) { GameObject instantiateOnBreak = val26.instantiateOnBreak; GameObject gameObject2 = ((Component)instantiateOnBreak.transform.Find("VFX_SporeHealingExplo")).gameObject; if ((Object)(object)gameObject2 != (Object)null) { TextMeshProUGUI obj26 = itemInfoDisplayTextMesh; ((TMP_Text)obj26).text = ((TMP_Text)obj26).text + effectColors["Hunger"] + "丢下</color>以释放范围效果\n\n"; RemoveAfterSeconds component2 = gameObject2.GetComponent<RemoveAfterSeconds>(); float globalDuration = (((Object)(object)component2 != (Object)null) ? component2.seconds : 0f); TextMeshProUGUI obj27 = itemInfoDisplayTextMesh; ((TMP_Text)obj27).text = ((TMP_Text)obj27).text + ProcessGameObjectAndChildrenAOE(gameObject2, globalDuration, addTips: false); } } } else if (type == typeof(ScoutEffigy)) { TextMeshProUGUI obj28 = itemInfoDisplayTextMesh; ((TMP_Text)obj28).text = ((TMP_Text)obj28).text + effectColors["Extra Stamina"] + "复活</color>死去的玩家\n"; } else if (type == typeof(Action_Die)) { TextMeshProUGUI obj29 = itemInfoDisplayTextMesh; ((TMP_Text)obj29).text = ((TMP_Text)obj29).text + "使用时你会" + effectColors["Curse"] + "死亡</color>\n"; } else if (type == typeof(Action_SpawnGuidebookPage)) { flag = true; TextMeshProUGUI obj30 = itemInfoDisplayTextMesh; ((TMP_Text)obj30).text = ((TMP_Text)obj30).text + "可以打开\n"; } else if (type == typeof(Action_Guidebook)) { TextMeshProUGUI obj31 = itemInfoDisplayTextMesh; ((TMP_Text)obj31).text = ((TMP_Text)obj31).text + "可以阅读\n"; } else if (type == typeof(Action_CallScoutmaster)) { TextMeshProUGUI obj32 = itemInfoDisplayTextMesh; ((TMP_Text)obj32).text = ((TMP_Text)obj32).text + effectColors["Injury"] + "使用时违反规则0</color>\n"; } else if (type == typeof(Action_MoraleBoost)) { Action_MoraleBoost val27 = (Action_MoraleBoost)val; if (val27.boostRadius < 0f) { val15 = itemInfoDisplayTextMesh; ((TMP_Text)val15).text = ((TMP_Text)val15).text + effectColors["ItemInfoDisplayPositive"] + "获得</color> " + effectColors["Extra Stamina"] + (val27.baselineStaminaBoost * 100f).ToString("F1").Replace(".0", "") + " 额外体力</color>\n"; } else if (val27.boostRadius > 0f) { val15 = itemInfoDisplayTextMesh; ((TMP_Text)val15).text = ((TMP_Text)val15).text + "<#CCCCCC>附近玩家</color>" + effectColors["ItemInfoDisplayPositive"] + " 获得</color> " + effectColors["Extra Stamina"] + (val27.baselineStaminaBoost * 100f).ToString("F1").Replace(".0", "") + " 额外体力</color>\n"; } } else if (type == typeof(Breakable)) { TextMeshProUGUI obj33 = itemInfoDisplayTextMesh; ((TMP_Text)obj33).text = ((TMP_Text)obj33).text + effectColors["Hunger"] + " 丢出去</color>将它砸开\n"; } else if (type == typeof(Bonkable)) { val15 = itemInfoDisplayTextMesh; ((TMP_Text)val15).text = ((TMP_Text)val15).text + effectColors["Hunger"] + " 瞄准队友的脑瓜</color> " + effectColors["Injury"] + "将他砸晕\n"; } else if (type == typeof(MagicBean)) { MagicBean val28 = (MagicBean)val; val15 = itemInfoDisplayTextMesh; ((TMP_Text)val15).text = ((TMP_Text)val15).text + effectColors["Hunger"] + "丢下</color>会种下藤蔓,\n藤蔓会垂直于地形生长,最长可达 " + (val28.plantPrefab.maxLength / 2f).ToString("F1").Replace(".0", "") + " 米,或直到碰到障碍物\n"; } else if (type == typeof(BingBong)) { TextMeshProUGUI obj34 = itemInfoDisplayTextMesh; ((TMP_Text)obj34).text = ((TMP_Text)obj34).text + "航空公司的吉祥物:" + effectColors["Extra Stamina"] + "BingBong</color>\n"; } else if (type == typeof(Action_Passport)) { TextMeshProUGUI obj35 = itemInfoDisplayTextMesh; ((TMP_Text)obj35).text = ((TMP_Text)obj35).text + "使用 " + effectColors["Hunger"] + "护照</color> 可以自定义外观\n"; } else if (type == typeof(Actions_Binoculars)) { TextMeshProUGUI obj36 = itemInfoDisplayTextMesh; ((TMP_Text)obj36).text = ((TMP_Text)obj36).text + "使用 " + effectColors["Hunger"] + "望远镜</color> 观察远处的物体\n"; } else if (type == typeof(Action_WarpToRandomPlayer)) { TextMeshProUGUI obj37 = itemInfoDisplayTextMesh; ((TMP_Text)obj37).text = ((TMP_Text)obj37).text + "传送到随机玩家\n"; } else if (type == typeof(Action_WarpToBiome)) { Action_WarpToBiome val29 = (Action_WarpToBiome)val; TextMeshProUGUI obj38 = itemInfoDisplayTextMesh; ((TMP_Text)obj38).text = ((TMP_Text)obj38).text + "传送到" + ((object)(Segment)(ref val29.segmentToWarpTo)).ToString().ToUpper() + "\n"; } else if (type == typeof(Parasol)) { TextMeshProUGUI obj39 = itemInfoDisplayTextMesh; ((TMP_Text)obj39).text = ((TMP_Text)obj39).text + "使用 " + effectColors["Hunger"] + "太阳伞</color> 防止你自由落体\n"; } else if (type == typeof(RescueHook)) { RescueHook val30 = (RescueHook)val; TextMeshProUGUI obj40 = itemInfoDisplayTextMesh; ((TMP_Text)obj40).text = ((TMP_Text)obj40).text + "<#CCCCCC>发射一条钩爪来:</color>\n\n"; TextMeshProUGUI obj41 = itemInfoDisplayTextMesh; ((TMP_Text)obj41).text = ((TMP_Text)obj41).text + effectColors["ItemInfoDisplayPositive"] + "救援其他玩家</color>\n\n"; TextMeshProUGUI obj42 = itemInfoDisplayTextMesh; ((TMP_Text)obj42).text = ((TMP_Text)obj42).text + effectColors["ItemInfoDisplayPositive"] + "拉动自己到墙壁</color>\n\n"; val15 = itemInfoDisplayTextMesh; ((TMP_Text)val15).text = ((TMP_Text)val15).text + effectColors["Extra Stamina"] + "距离 " + val30.range.ToString("F1").Replace(".0", "") + "米</color>\n"; } else { if (type == typeof(Frisbee)) { continue; } if (type == typeof(Action_ConstructableScoutCannonScroll)) { TextMeshProUGUI obj43 = itemInfoDisplayTextMesh; ((TMP_Text)obj43).text = ((TMP_Text)obj43).text + "\n<#CCCCCC>放置后点燃引线:</color>\n\n将桶内童兵发射出去\n"; } else if (type == typeof(Action_RandomMushroomEffect)) { Action_RandomMushroomEffect val31 = (Action_RandomMushroomEffect)val; int num = -1; if (val31.useDebugEffect) { num = val31.debugEffect; } else if ((Object)(object)MushroomManager.instance != (Object)null) { int num2 = val31.mushroomTypeIndex % MushroomManager.instance.mushroomEffects.Length; num = MushroomManager.instance.mushroomEffects[num2]; } int num3 = 0; if (!val31.useDebugEffect && (Object)(object)MushroomManager.instance != (Object)null) { int num4 = val31.mushroomTypeIndex % MushroomManager.instance.mushroomStamAmt.Length; num3 = MushroomManager.instance.mushroomStamAmt[num4]; } TextMeshProUGUI obj44 = itemInfoDisplayTextMesh; ((TMP_Text)obj44).text = ((TMP_Text)obj44).text + effectColors["ItemInfoDisplayPositive"] + "食用后获得随机效果:</color>\n\n"; if (num3 > 0) { val15 = itemInfoDisplayTextMesh; ((TMP_Text)val15).text = ((TMP_Text)val15).text + effectColors["Extra Stamina"] + "+" + ((float)num3 * 0.05f * 100f).ToString("F1").Replace(".0", "") + " 额外体力</color>\n"; } if (num >= 0) { TextMeshProUGUI obj45 = itemInfoDisplayTextMesh; ((TMP_Text)obj45).text = ((TMP_Text)obj45).text + "\n<#CCCCCC>本次效果: "; switch (num) { case 0: { TextMeshProUGUI obj56 = itemInfoDisplayTextMesh; ((TMP_Text)obj56).text = ((TMP_Text)obj56).text + effectColors["Extra Stamina"] + "无限体力 4 秒</color>"; break; } case 1: { TextMeshProUGUI obj55 = itemInfoDisplayTextMesh; ((TMP_Text)obj55).text = ((TMP_Text)obj55).text + effectColors["Extra Stamina"] + "加速效果: +50% 奔跑速度, +150% 攀爬速度, 持续 5 秒</color>"; break; } case 2: { TextMeshProUGUI obj54 = itemInfoDisplayTextMesh; ((TMP_Text)obj54).text = ((TMP_Text)obj54).text + effectColors["ItemInfoDisplayPositive"] + "低重力效果, 持续 15 秒</color>"; break; } case 3: { TextMeshProUGUI obj53 = itemInfoDisplayTextMesh; ((TMP_Text)obj53).text = ((TMP_Text)obj53).text + effectColors["Shield"] + "无敌效果, 持续10秒</color>"; break; } case 4: { TextMeshProUGUI obj52 = itemInfoDisplayTextMesh; ((TMP_Text)obj52).text = ((TMP_Text)obj52).text + effectColors["ItemInfoDisplayPositive"] + "治疗: -15 饥饿值, -15 伤害, -15 中毒, 清除中毒效果</color>"; break; } case 5: { TextMeshProUGUI obj51 = itemInfoDisplayTextMesh; ((TMP_Text)obj51).text = ((TMP_Text)obj51).text + effectColors["Injury"] + "产生爆炸并击飞附近队友</color>"; break; } case 6: { TextMeshProUGUI obj50 = itemInfoDisplayTextMesh; ((TMP_Text)obj50).text = ((TMP_Text)obj50).text + effectColors["ItemInfoDisplayNegative"] + "失明效果, 持续 60 秒</color>"; break; } case 7: { TextMeshProUGUI obj49 = itemInfoDisplayTextMesh; ((TMP_Text)obj49).text = ((TMP_Text)obj49).text + effectColors["Injury"] + "强制晕倒 8 秒</color>"; break; } case 8: { TextMeshProUGUI obj48 = itemInfoDisplayTextMesh; ((TMP_Text)obj48).text = ((TMP_Text)obj48).text + effectColors["Poison"] + "+25 真菌感染</color>"; break; } case 9: { TextMeshProUGUI obj47 = itemInfoDisplayTextMesh; ((TMP_Text)obj47).text = ((TMP_Text)obj47).text + effectColors["ItemInfoDisplayNegative"] + "麻木效果, 持续 60 秒</color>"; break; } default: { TextMeshProUGUI obj46 = itemInfoDisplayTextMesh; ((TMP_Text)obj46).text = ((TMP_Text)obj46).text + effectColors["ItemInfoDisplayNegative"] + "未知效果</color>"; break; } } TextMeshProUGUI obj57 = itemInfoDisplayTextMesh; ((TMP_Text)obj57).text = ((TMP_Text)obj57).text + "</color>\n\n"; } else { TextMeshProUGUI obj58 = itemInfoDisplayTextMesh; ((TMP_Text)obj58).text = ((TMP_Text)obj58).text + "<#CCCCCC>可能效果:</color>\n"; TextMeshProUGUI obj59 = itemInfoDisplayTextMesh; ((TMP_Text)obj59).text = ((TMP_Text)obj59).text + effectColors["ItemInfoDisplayPositive"] + "正面: 无限体力, 加速, 低重力, 无敌, 治疗</color>\n"; TextMeshProUGUI obj60 = itemInfoDisplayTextMesh; ((TMP_Text)obj60).text = ((TMP_Text)obj60).text + effectColors["ItemInfoDisplayNegative"] + "负面: 爆炸, 失明, 坠落, 真菌感染, 麻木</color>\n"; } TextMeshProUGUI obj61 = itemInfoDisplayTextMesh; ((TMP_Text)obj61).text = ((TMP_Text)obj61).text + effectColors["Hunger"] + "3秒后生效</color>\n"; } else if (type == typeof(Dynamite)) { Dynamite val32 = (Dynamite)val; val15 = itemInfoDisplayTextMesh; ((TMP_Text)val15).text = ((TMP_Text)val15).text + effectColors["Injury"] + "爆炸</color>造成最多" + effectColors["Injury"] + (val32.explosionPrefab.GetComponent<AOE>().statusAmount * 100f).ToString("F1").Replace(".0", "") + " 伤害</color>\n\n<#CCCCCC>持有时受到额外伤害</color>\n"; } else if (type == typeof(Scorpion)) { Scorpion val33 = (Scorpion)val; if ((int)((Mob)val33).mobState != 3) { TextMeshProUGUI obj62 = itemInfoDisplayTextMesh; ((TMP_Text)obj62).text = ((TMP_Text)obj62).text + "持有时会对你造成" + effectColors["Poison"] + "伤害</color>:\n\n"; val15 = itemInfoDisplayTextMesh; ((TMP_Text)val15).text = ((TMP_Text)val15).text + effectColors["Heat"] + "烹饪</color>会让其" + effectColors["Curse"] + "死亡</color>\n\n"; if (configForceUpdateTime.Value <= 1f) { float num5 = Mathf.Max(0.5f, 1f - currentItem.holderCharacter.refs.afflictions.statusSum + 0.05f) * 100f; val15 = itemInfoDisplayTextMesh; ((TMP_Text)val15).text = ((TMP_Text)val15).text + "<#CCCCCC>下一次蜇伤将造成:</color> " + effectColors["Poison"] + num5.ToString("F1").Replace(".0", "") + " </color>中毒</color>持续 " + val33.totalPoisonTime.ToString("F1").Replace(".0", "") + " 秒\n\n"; TextMeshProUGUI obj63 = itemInfoDisplayTextMesh; ((TMP_Text)obj63).text = ((TMP_Text)obj63).text + "<#CCCCCC>(健康时伤害更高)</color>\n\n"; } else { val15 = itemInfoDisplayTextMesh; ((TMP_Text)val15).text = ((TMP_Text)val15).text + "<#CCCCCC>下一次蜇伤将造成:</color>至少 " + effectColors["Poison"] + "50 </color>中毒</color>持续 " + val33.totalPoisonTime.ToString("F1").Replace(".0", "") + " 秒\n\n"; val15 = itemInfoDisplayTextMesh; ((TMP_Text)val15).text = ((TMP_Text)val15).text + "最多 " + effectColors["Poison"] + "105 中毒</color>持续 " + val33.totalPoisonTime.ToString("F1").Replace(".0", "") + " 秒\n\n"; TextMeshProUGUI obj64 = itemInfoDisplayTextMesh; ((TMP_Text)obj64).text = ((TMP_Text)obj64).text + "<#CCCCCC>(健康时伤害更高)</color>\n\n"; } } } else if (type == typeof(Action_Spawn)) { Action_Spawn val34 = (Action_Spawn)val; if (((Object)val34.objectToSpawn).name.Equals("VFX_Sunscreen")) { AOE component3 = ((Component)val34.objectToSpawn.transform.Find("AOE")).GetComponent<AOE>(); RemoveAfterSeconds component4 = ((Component)val34.objectToSpawn.transform.Find("AOE")).GetComponent<RemoveAfterSeconds>(); val15 = itemInfoDisplayTextMesh; ((TMP_Text)val15).text = ((TMP_Text)val15).text + "<#CCCCCC>喷洒持续" + component4.seconds.ToString("F1").Replace(".0", "") + "秒的雾气,施加:</color>\n" + ProcessAffliction(component3.affliction); } } else if (type == typeof(CactusBall)) { CactusBall val35 = (CactusBall)val; val15 = itemInfoDisplayTextMesh; ((TMP_Text)val15).text = ((TMP_Text)val15).text + effectColors["Thorns"] + "尖刺</color> 会附在身体上\n\n可以通过 " + effectColors["Hunger"] + "投掷</color> 扔出\n\n至少需要蓄力 " + (((StickyItemComponent)val35).throwChargeRequirement * 100f).ToString("F1").Replace(".0", "") + "%\n"; } else if (type == typeof(BingBongShieldWhileHolding)) { TextMeshProUGUI obj65 = itemInfoDisplayTextMesh; ((TMP_Text)obj65).text = ((TMP_Text)obj65).text + "<#CCCCCC>持有时获得:</color>\n\n" + effectColors["Shield"] + "无敌状态</color>\n"; } else if (type == typeof(CheckpointConstructable)) { TextMeshProUGUI obj66 = itemInfoDisplayTextMesh; ((TMP_Text)obj66).text = ((TMP_Text)obj66).text + "选择一处地方进行放置,为你提供一次" + effectColors["Extra Stamina"] + "复活</color>效果\n"; } else if (type == typeof(ItemCooking)) { text4 = ""; ItemCooking val36 = (ItemCooking)val; if (val36.wreckWhenCooked && val36.timesCookedLocal >= 1) { text4 = text4 + "\n\n" + effectColors["Curse"] + "因烹饪而损坏</color>"; } else if (val36.wreckWhenCooked) { text4 = text4 + "\n\n" + effectColors["Curse"] + "烹饪时会损坏</color>"; } else if (val36.timesCookedLocal >= 12) { text4 = text4 + " " + effectColors["Curse"] + val36.timesCookedLocal + "次烹饪\n\n无法再烹饪</color>"; } else if (val36.timesCookedLocal == 0 && val36.canBeCooked) { text4 = text4 + "\n\n" + effectColors["Extra Stamina"] + "可以烹饪</color>"; } else if (val36.timesCookedLocal == 1) { text4 = text4 + " " + effectColors["Extra Stamina"] + val36.timesCookedLocal + "次烹饪</color>\n\n" + effectColors["Hunger"] + "可以烹饪</color>"; } else if (val36.timesCookedLocal == 2) { text4 = text4 + " " + effectColors["Hunger"] + val36.timesCookedLocal + "次烹饪</color>\n\n" + effectColors["Injury"] + "可以烹饪</color>"; } else if (val36.timesCookedLocal == 3) { text4 = text4 + " " + effectColors["Injury"] + val36.timesCookedLocal + "次烹饪</color>\n\n" + effectColors["Poison"] + "可以烹饪</color>"; } else if (val36.timesCookedLocal >= 4) { text4 = text4 + " " + effectColors["Poison"] + val36.timesCookedLocal + "次烹饪\n\n可以烹饪</color>"; } if (val36.hasExplosion) { text4 = text4 + "\n\n烹饪后会" + effectColors["Injury"] + "爆炸</color>"; } } } } } if (text.Length > 0 && flag) { ((TMP_Text)itemInfoDisplayTextMesh).text = text + "\n" + ((TMP_Text)itemInfoDisplayTextMesh).text; } if (text5.Length > 0) { TextMeshProUGUI obj67 = itemInfoDisplayTextMesh; ((TMP_Text)obj67).text = ((TMP_Text)obj67).text + "\n" + text5; } val15 = itemInfoDisplayTextMesh; ((TMP_Text)val15).text = ((TMP_Text)val15).text + "\n" + text2 + text3 + text4; ((TMP_Text)itemInfoDisplayTextMesh).text = ((TMP_Text)itemInfoDisplayTextMesh).text.Replace("\n\n\n", "\n\n"); } private static string ProcessSingleGameObjectAOE(GameObject targetObject, float globalDuration = 0f, bool addTips = true) { //IL_0233: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) string text = ""; float x = 0.025f; if ((Object)(object)targetObject == (Object)null) { return text; } AOE component = targetObject.GetComponent<AOE>(); if ((Object)(object)component == (Object)null || Mathf.Abs(component.statusAmount) == 0f) { return text; } if (!addTips) { addTips = true; text = text + "<#CCCCCC>范围: " + component.range.ToString("F1").Replace(".0", "") + "米</color>,持续 " + globalDuration + " 秒\n\n"; text = text + "<#CCCCCC>效果随距离衰减 (最小 " + (component.minFactor * 100f).ToString("F0") + "%)</color>\n\n"; } TimeEvent component2 = targetObject.GetComponent<TimeEvent>(); if ((Object)(object)component2 != (Object)null && globalDuration > 0f) { x = ((!(component.statusAmount < 0f)) ? MathF.Abs(x) : (MathF.Abs(x) * -1f)); float amountPerSecond = Mathf.Floor(component.statusAmount * (1f / component2.rate) / x) * x; text += ProcessEffectPerSecond(amountPerSecond, ((object)(STATUSTYPE)(ref component.statusType)).ToString()); if (component.addtlStatus != null && component.addtlStatus.Length != 0) { STATUSTYPE[] addtlStatus = component.addtlStatus; for (int i = 0; i < addtlStatus.Length; i++) { STATUSTYPE val = addtlStatus[i]; text += ProcessEffectPerSecond(amountPerSecond, ((object)(STATUSTYPE)(ref val)).ToString()); } } } else { text = text + "立刻" + ProcessEffect(component.statusAmount, ((object)(STATUSTYPE)(ref component.statusType)).ToString()); if (component.addtlStatus != null && component.addtlStatus.Length != 0) { STATUSTYPE[] addtlStatus2 = component.addtlStatus; for (int j = 0; j < addtlStatus2.Length; j++) { STATUSTYPE val2 = addtlStatus2[j]; text += ProcessEffect(component.statusAmount, ((object)(STATUSTYPE)(ref val2)).ToString()); } } } if (component.hasAffliction && component.affliction != null) { text += ProcessAffliction(component.affliction); } if (!text.EndsWith("\n\n")) { text += "\n\n"; } return text; } private static string ProcessGameObjectAndChildrenAOE(GameObject targetObject, float globalDuration = 0f, bool addTips = true) { string text = ""; if ((Object)(object)targetObject == (Object)null) { return text; } string text2 = ProcessSingleGameObjectAOE(targetObject, globalDuration, addTips); if (!string.IsNullOrEmpty(text2)) { text += text2; } for (int i = 0; i < targetObject.transform.childCount; i++) { Transform child = targetObject.transform.GetChild(i); string text3 = ProcessGameObjectAndChildrenAOE(((Component)child).gameObject, globalDuration); if (!string.IsNullOrEmpty(text3)) { text += text3; } } return text; } private static string ProcessEffect(float amount, string effect, bool newLine = true) { string text = ""; if (amount < 0f && effect == "Poison") { text += ProcessEffect(amount, "Spores"); } if (amount == 0f) { return text; } if (amount > 0f) { text = ((!effect.Equals("Extra Stamina")) ? (text + effectColors["ItemInfoDisplayNegative"]) : (text + effectColors["ItemInfoDisplayPositive"])); text += "获得</color> "; } else if (amount < 0f) { text = ((!effect.Equals("Extra Stamina")) ? (text + effectColors["ItemInfoDisplayPositive"]) : (text + effectColors["ItemInfoDisplayNegative"])); text += "移除</color> "; } return text + effectColors[effect] + (Mathf.Abs(amount) * 100f).ToString("F1").Replace(".0", "") + " " + GetEffectChineseName(effect) + "</color>" + (newLine ? "\n\n" : ""); } private static string ProcessEffectPerSecond(float amountPerSecond, string effect, bool newLine = true) { string text = ""; if (amountPerSecond < 0f && effect == "Poison") { text += ProcessEffectPerSecond(amountPerSecond, "Spores"); } if (amountPerSecond == 0f) { return text; } if (amountPerSecond > 0f) { text = ((!effect.Equals("Extra Stamina")) ? (text + effectColors["ItemInfoDisplayNegative"]) : (text + effectColors["ItemInfoDisplayPositive"])); text += "每秒获得</color> "; } else if (amountPerSecond < 0f) { text = ((!effect.Equals("Extra Stamina")) ? (text + effectColors["ItemInfoDisplayPositive"]) : (text + effectColors["ItemInfoDisplayNegative"])); text += "每秒移除</color> "; } return text + effectColors[effect] + (Mathf.Abs(amountPerSecond) * 100f).ToString("F1").Replace(".0", "") + " " + GetEffectChineseName(effect) + "</color>" + (newLine ? "\n\n" : ((object)newLine)); } private static string ProcessEffectOverTime(float amountPerSecond, float rate, float time, string effect, bool newLine = true) { string text = ""; if (amountPerSecond < 0f && effect == "Poison") { text += ProcessEffectOverTime(amountPerSecond, rate, time, "Spores"); } if (amountPerSecond == 0f || time == 0f) { return text; } if (amountPerSecond > 0f) { text = ((!effect.Equals("Extra Stamina")) ? (text + effectColors["ItemInfoDisplayNegative"]) : (text + effectColors["ItemInfoDisplayPositive"])); text += "获得</color> "; } else if (amountPerSecond < 0f) { text = ((!effect.Equals("Extra Stamina")) ? (text + effectColors["ItemInfoDisplayPositive"]) : (text + effectColors["ItemInfoDisplayNegative"])); text += "移除</color> "; } return text + effectColors[effect] + (Mathf.Abs(amountPerSecond) * time * (1f / rate) * 100f).ToString("F1").Replace(".0", "") + " " + GetEffectChineseName(effect) + "</color> 持续 " + time.ToString("F1").Replace(".0", "") + "秒" + (newLine ? "\n" : ""); } private static string ProcessAffliction(Affliction affliction) { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Invalid comparison between Unknown and I4 //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Invalid comparison between Unknown and I4 //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_024d: Unknown result type (might be due to invalid IL or missing references) //IL_0254: Invalid comparison between Unknown and I4 //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Expected O, but got Unknown //IL_02dc: Unknown result type (might be due to invalid IL or missing references) //IL_02e2: Invalid comparison between Unknown and I4 //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Expected O, but got Unknown //IL_04a6: Unknown result type (might be due to invalid IL or missing references) //IL_04ac: Invalid comparison between Unknown and I4 //IL_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Expected O, but got Unknown //IL_062b: Unknown result type (might be due to invalid IL or missing references) //IL_0632: Invalid comparison between Unknown and I4 //IL_04b9: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Expected O, but got Unknown //IL_073c: Unknown result type (might be due to invalid IL or missing references) //IL_0742: Invalid comparison between Unknown and I4 //IL_063f: Unknown result type (might be due to invalid IL or missing references) //IL_0646: Expected O, but got Unknown //IL_083b: Unknown result type (might be due to invalid IL or missing references) //IL_0841: Invalid comparison between Unknown and I4 //IL_074f: Unknown result type (might be due to invalid IL or missing references) //IL_0756: Expected O, but got Unknown //IL_08ae: Unknown result type (might be due to invalid IL or missing references) //IL_08b5: Invalid comparison between Unknown and I4 //IL_092a: Unknown result type (might be due to invalid IL or missing references) //IL_0931: Invalid comparison between Unknown and I4 //IL_08bf: Unknown result type (might be due to invalid IL or missing references) //IL_08c6: Expected O, but got Unknown //IL_093e: Unknown result type (might be due to invalid IL or missing references) //IL_0945: Expected O, but got Unknown string text = ""; if ((int)affliction.GetAfflictionType() == 2) { Affliction_FasterBoi val = (Affliction_FasterBoi)affliction; text = text + effectColors["ItemInfoDisplayPositive"] + "获得</color> " + (((Affliction)val).totalTime + val.climbDelay).ToString("F1").Replace(".0", "") + " 秒的" + effectColors["Extra Stamina"] + " " + Mathf.Round(val.moveSpeedMod * 100f).ToString("F1").Replace(".0", "") + "% 额外奔跑速度</color> 或\n" + effectColors["ItemInfoDisplayPositive"] + "获得</color> " + ((Affliction)val).totalTime.ToString("F1").Replace(".0", "") + " 秒的" + effectColors["Extra Stamina"] + " " + Mathf.Round(val.climbSpeedMod * 100f).ToString("F1").Replace(".0", "") + "% 额外攀爬速度</color>\n之后," + effectColors["ItemInfoDisplayNegative"] + "获得</color> " + effectColors["Drowsy"] + (val.drowsyOnEnd * 100f).ToString("F1").Replace(".0", "") + " 困倦</color>\n"; } else if ((int)affliction.GetAfflictionType() == 8) { Affliction_ClearAllStatus val2 = (Affliction_ClearAllStatus)affliction; text = text + effectColors["ItemInfoDisplayPositive"] + "清除所有状态</color>"; if (val2.excludeCurse) { text = text + " 除了 " + effectColors["Curse"] + "诅咒</color>"; } text += "\n\n"; } else if ((int)affliction.GetAfflictionType() == 10) { Affliction_AddBonusStamina val3 = (Affliction_AddBonusStamina)affliction; text = text + effectColors["ItemInfoDisplayPositive"] + "获得</color> " + effectColors["Extra Stamina"] + (val3.staminaAmount * 100f).ToString("F1").Replace(".0", "") + " 额外体力</color>\n"; } else if ((int)affliction.GetAfflictionType() == 1) { Affliction_InfiniteStamina val4 = (Affliction_InfiniteStamina)affliction; text = ((!(val4.climbDelay > 0f)) ? (text + effectColors["ItemInfoDisplayPositive"] + "获得</color> " + ((Affliction)val4).totalTime.ToString("F1").Replace(".0", "") + "秒的" + effectColors["Extra Stamina"] + "无限体力</color>\n") : (text + effectColors["ItemInfoDisplayPositive"] + "获得</color> " + (((Affliction)val4).totalTime + val4.climbDelay).ToString("F1").Replace(".0", "") + "秒的" + effectColors["Extra Stamina"] + " 无限奔跑</color> 或\n" + effectColors["ItemInfoDisplayPositive"] + "获得</color> " + ((Affliction)val4).totalTime.ToString("F1").Replace(".0", "") + "秒的" + effectColors["Extra Stamina"] + " 无限攀爬</color>\n")); if (val4.drowsyAffliction != null && val4.drowsyAffliction.totalTime > 0f) { text = text + "之后," + ProcessAffliction(val4.drowsyAffliction); } } else if ((int)affliction.GetAfflictionType() == 7) { Affliction_AdjustStatus val5 = (Affliction_AdjustStatus)affliction; if (val5.statusAmount > 0f) { text = ((!((object)(STATUSTYPE)(ref val5.statusType)).ToString().Equals("Extra Stamina")) ? (text + effectColors["ItemInfoDisplayNegative"]) : (text + effectColors["ItemInfoDisplayPositive"])); text += "获得</color> "; } else { text = ((!((object)(STATUSTYPE)(ref val5.statusType)).ToString().Equals("Extra Stamina")) ? (text + effectColors["ItemInfoDisplayPositive"]) : (text + effectColors["ItemInfoDisplayNegative"])); text += "移除</color> "; } text = text + effectColors[((object)(STATUSTYPE)(ref val5.statusType)).ToString()] + (Mathf.Abs(val5.statusAmount) * 100f).ToString("F1").Replace(".0", "") + " " + GetEffectChineseName(((object)(STATUSTYPE)(ref val5.statusType)).ToString()) + "</color>\n"; } else if ((int)affliction.GetAfflictionType() == 11) { Affliction_AdjustDrowsyOverTime val6 = (Affliction_AdjustDrowsyOverTime)affliction; text = ((!(val6.statusPerSecond > 0f)) ? (text + effectColors["ItemInfoDisplayPositive"] + "移除</color> ") : (text + effectColors["ItemInfoDisplayNegative"] + "获得</color> ")); text = text + effectColors["Drowsy"] + (Mathf.Round(Mathf.Abs(val6.statusPerSecond) * ((Affliction)val6).totalTime * 100f * 0.4f) / 0.4f).ToString("F1").Replace(".0", "") + " 困倦</color> 持续 " + ((Affliction)val6).totalTime.ToString("F1").Replace(".0", "") + "秒\n"; } else if ((int)affliction.GetAfflictionType() == 5) { Affliction_AdjustColdOverTime val7 = (Affliction_AdjustColdOverTime)affliction; text = ((!(val7.statusPerSecond > 0f)) ? (text + effectColors["ItemInfoDisplayPositive"] + "移除</color> ") : (text + effectColors["ItemInfoDisplayNegative"] + "获得</color> ")); text = text + effectColors["Cold"] + (Mathf.Abs(val7.statusPerSecond) * ((Affliction)val7).totalTime * 100f).ToString("F1").Replace(".0", "") + " 寒冷</color> 持续 " + ((Affliction)val7).totalTime.ToString("F1").Replace(".0", "") + "秒\n"; } else if ((int)affliction.GetAfflictionType() == 6) { text = text + effectColors["ItemInfoDisplayPositive"] + "清除所有状态</color>\n\n"; text = text + effectColors["ItemInfoDisplayNegative"] + "随机获得负面状态组合</color>\n\n"; text = text + effectColors["ItemInfoDisplayPositive"] + "随机获得额外耐力</color>\n\n"; text += "<#CCCCCC>效果完全随机</color>\n\n"; } else if ((int)affliction.GetAfflictionType() == 13) { Affliction_Sunscreen val8 = (Affliction_Sunscreen)affliction; text = text + "在 方山 的阳光下防止" + effectColors["Heat"] + "烧伤</color> " + ((Affliction)val8).totalTime.ToString("F1").Replace(".0", "") + "秒\n"; } else if ((int)affliction.GetAfflictionType() == 16) { Affliction_Invincibility val9 = (Affliction_Invincibility)affliction; text = text + effectColors["ItemInfoDisplayPositive"] + "获得</color> 持续 " + effectColors["Shield"] + ((Affliction)val9).totalTime.ToString("F1").Replace(".0", "") + "</color> 秒的" + effectColors["Shield"] + "无敌</color>\n"; } return text; } private static void AddDisplayObject() { //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_0093: Unknown result type (might be due to invalid IL or missing references) EasyBackpack = Chainloader.PluginInfos.ContainsKey("nickklmao.easybackpack"); GameObject val = GameObject.Find("GAME/GUIManager"); guiManager = val.GetComponent<GUIManager>(); TMP_FontAsset font = ((TMP_Text)guiManager.heroDayText).font; GameObject gameObject = ((Component)val.transform.Find("Canvas_HUD/Prompts/ItemPromptLayout")).gameObject; GameObject val2 = new GameObject("ItemInfoDisplay"); val2.transform.SetParent(gameObject.transform); itemInfoDisplayTextMesh = val2.AddComponent<TextMeshProUGUI>(); RectTransform component = val2.GetComponent<RectTransform>(); component.sizeDelta = new Vector2(configSizeDeltaX.Value, 0f); ((TMP_Text)itemInfoDisplayTextMesh).font = font; ((TMP_Text)itemInfoDisplayTextMesh).fontSize = configFontSize.Value; ((TMP_Text)itemInfoDisplayTextMesh).alignment = (TextAlignmentOptions)1025; ((TMP_Text)itemInfoDisplayTextMesh).lineSpacing = configLineSpacing.Value; ((TMP_Text)itemInfoDisplayTextMesh).text = ""; ((TMP_Text)itemInfoDisplayTextMesh).outlineWidth = configOutlineWidth.Value; } private static void InitEffectColors(Dictionary<string, string> dict) { dict.Add("Spores", "<#A45B62>"); dict.Add("Hunger", "<#FFBD16>"); dict.Add("Extra Stamina", "<#BFEC1B>"); dict.Add("Injury", "<#FF5300>"); dict.Add("Crab", "<#E13542>"); dict.Add("Poison", "<#A139FF>"); dict.Add("Cold", "<#00BCFF>"); dict.Add("Heat", "<#C80918>"); dict.Add("Hot", "<#C80918>"); dict.Add("Sleepy", "<#FF5CA4>"); dict.Add("Drowsy", "<#FF5CA4>"); dict.Add("Curse", "<#1B0043>"); dict.Add("Weight", "<#A65A1C>"); dict.Add("Thorns", "<#768E00>"); dict.Add("Shield", "<#D48E00>"); dict.Add("ItemInfoDisplayPositive", "<#DDFFDD>"); dict.Add("ItemInfoDisplayNegative", "<#FFCCCC>"); } } } namespace System.Runtime.CompilerServices { [AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)] internal sealed class IgnoresAccessChecksToAttribute : Attribute { public IgnoresAccessChecksToAttribute(string assemblyName) { } } }