Some mods may be broken due to the recent Alloyed Collective update.
Decompiled source of RedScrapCauldron v1.0.9
RedScrapCauldron.dll
Decompiled 4 days agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using Microsoft.CodeAnalysis; using On.RoR2; using On.RoR2.UI; using RiskOfOptions; using RiskOfOptions.Options; using RoR2; using RoR2.UI; using TMPro; using UnityEngine; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("RedScrapCauldron")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+3670e08feeff8928858aba5bffd061ed3154abe3")] [assembly: AssemblyProduct("RedScrapCauldron")] [assembly: AssemblyTitle("RedScrapCauldron")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] 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; } } } namespace RedScrapCauldron { internal static class Log { internal static ManualLogSource? _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void LogDebug(object data) { ManualLogSource? logSource = _logSource; if (logSource != null) { logSource.LogDebug(data); } } internal static void LogError(object data) { ManualLogSource? logSource = _logSource; if (logSource != null) { logSource.LogError(data); } } internal static void LogFatal(object data) { ManualLogSource? logSource = _logSource; if (logSource != null) { logSource.LogFatal(data); } } internal static void LogInfo(object data) { ManualLogSource? logSource = _logSource; if (logSource != null) { logSource.LogInfo(data); } } internal static void LogMessage(object data) { ManualLogSource? logSource = _logSource; if (logSource != null) { logSource.LogMessage(data); } } internal static void LogWarning(object data) { ManualLogSource? logSource = _logSource; if (logSource != null) { logSource.LogWarning(data); } } } [BepInPlugin("com.Pseudo.RedScrapInCauldron", "Red Scrap for Cauldrons", "1.0.9")] public class Main : BaseUnityPlugin { public const string PluginGUID = "com.Pseudo.RedScrapInCauldron"; public const string PluginName = "Red Scrap for Cauldrons"; public const string PluginVersion = "1.0.9"; private const string RedColor = "E7543A"; private const string GreenColor = "77FF17"; private const string WhiteColor = "FFFFFF"; public static ConfigEntry<bool> DisableUIChanges { get; set; } public void Awake() { Log.Init(((BaseUnityPlugin)this).Logger); ConfigSetup(); Hooks(); } private void ConfigSetup() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Expected O, but got Unknown //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown DisableUIChanges = ((BaseUnityPlugin)this).Config.Bind<bool>("General", "Disable UI changes", false, new ConfigDescription("Will make pings and UI elements not show up for the price changes but may fix compatibility issues with other mods.", (AcceptableValueBase)null, Array.Empty<object>())); ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(DisableUIChanges, false)); } public void Hooks() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown CostTypeDef.IsAffordable += new hook_IsAffordable(CostTypeDef_IsAffordable); PurchaseInteraction.OnInteractionBegin += new hook_OnInteractionBegin(PurchaseInteraction_OnInteractionBegin); PurchaseInteraction.GetContextString += new hook_GetContextString(PurchaseInteraction_GetContextString); CostHologramContent.FixedUpdate += new hook_FixedUpdate(CostHologramContent_FixedUpdate); PingIndicator.RebuildPing += new hook_RebuildPing(PingIndicator_RebuildPing); } private bool CostTypeDef_IsAffordable(orig_IsAffordable orig, CostTypeDef thisReference, int cost, Interactor activator) { //IL_0002: 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_003f: Invalid comparison between Unknown and I4 if ((int)thisReference.itemTier == 0 && cost == 3 && (CheckIfInteractorHasItem(activator, Items.ScrapGreen) || CheckIfInteractorHasItem(activator, Items.RegeneratingScrap))) { return true; } if ((int)thisReference.itemTier == 1 && cost == 5 && CheckIfInteractorHasItem(activator, Items.ScrapRed)) { return true; } return orig.Invoke(thisReference, cost, activator); } private void SetPriceTo(PurchaseInteraction purchaseInteraction, CostTypeIndex type, int cost) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) purchaseInteraction.costType = type; purchaseInteraction.cost = cost; } private bool CheckIfInteractorHasItem(Interactor interactor, ItemDef itemDef) { return CheckIfCharacterMasterHasItem(((Component)interactor).GetComponent<CharacterBody>(), itemDef); } private bool CheckIfCharacterMasterHasItem(CharacterBody characterBody, ItemDef itemDef) { return characterBody.inventory.GetItemCountPermanent(itemDef) > 0; } private void PurchaseInteraction_OnInteractionBegin(orig_OnInteractionBegin methodReference, PurchaseInteraction thisReference, Interactor interactor) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0008: Invalid comparison between Unknown and I4 //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Invalid comparison between Unknown and I4 if ((int)thisReference.costType == 4 && thisReference.cost == 3 && (CheckIfInteractorHasItem(interactor, Items.ScrapGreen) || CheckIfInteractorHasItem(interactor, Items.RegeneratingScrap))) { SetPriceTo(thisReference, (CostTypeIndex)5, 1); methodReference.Invoke(thisReference, interactor); SetPriceTo(thisReference, (CostTypeIndex)4, 3); } else if ((int)thisReference.costType == 5 && thisReference.cost == 5 && CheckIfInteractorHasItem(interactor, Items.ScrapRed)) { SetPriceTo(thisReference, (CostTypeIndex)6, 1); methodReference.Invoke(thisReference, interactor); SetPriceTo(thisReference, (CostTypeIndex)5, 5); } else { methodReference.Invoke(thisReference, interactor); } } private bool Costs3White(PurchaseInteraction purchaseInteraction) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Invalid comparison between Unknown and I4 return purchaseInteraction.cost == 3 && (int)purchaseInteraction.costType == 4; } private bool Costs3White(CostHologramContent costHologramContent) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Invalid comparison between Unknown and I4 return costHologramContent.displayValue == 3 && (int)costHologramContent.costType == 4; } private bool Costs5Green(PurchaseInteraction purchaseInteraction) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Invalid comparison between Unknown and I4 return purchaseInteraction.cost == 5 && (int)purchaseInteraction.costType == 5; } private bool Costs5Green(CostHologramContent costHologramContent) { //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Invalid comparison between Unknown and I4 return costHologramContent.displayValue == 5 && (int)costHologramContent.costType == 5; } private string PurchaseInteraction_GetContextString(orig_GetContextString methodReference, PurchaseInteraction thisReference, Interactor interactor) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Invalid comparison between Unknown and I4 //IL_009c: Unknown result type (might be due to invalid IL or missing references) if (!DisableUIChanges.Value && (Costs3White(thisReference) || Costs5Green(thisReference))) { PurchaseInteraction.sharedStringBuilder.Clear(); PurchaseInteraction.sharedStringBuilder.Append(Language.GetString(thisReference.contextToken)); if ((int)thisReference.costType > 0) { string text = ((thisReference.cost == 5) ? "E7543A" : "77FF17"); PurchaseInteraction.sharedStringBuilder.Append(" <nobr>(<color=#" + text + ">1 Scrap(s)</color>)</nobr> / "); PurchaseInteraction.sharedStringBuilder.Append(" <nobr>("); CostTypeCatalog.GetCostTypeDef(thisReference.costType).BuildCostStringStyled(thisReference.cost, PurchaseInteraction.sharedStringBuilder, false, true); PurchaseInteraction.sharedStringBuilder.Append(")</nobr>"); } return PurchaseInteraction.sharedStringBuilder.ToString(); } return methodReference.Invoke(thisReference, interactor); } private void CostHologramContent_FixedUpdate(orig_FixedUpdate methodReference, CostHologramContent thisReference) { //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Invalid comparison between Unknown and I4 //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Invalid comparison between Unknown and I4 if (!DisableUIChanges.Value && (Costs3White(thisReference) || Costs5Green(thisReference))) { CostHologramContent.sharedStringBuilder.Clear(); ((Graphic)thisReference.targetTextMesh).color = Color.white; string arg = (((int)thisReference.costType == 5) ? "E7543A" : "77FF17"); string arg2 = (((int)thisReference.costType == 5) ? "77FF17" : "FFFFFF"); ((TMP_Text)thisReference.targetTextMesh).SetText($"<nobr><color=#{arg}>1 Scrap(s)</color></nobr><br>OR<br><nobr><color=#{arg2}>{thisReference.displayValue} Item(s)</color></nobr>", true); } else { methodReference.Invoke(thisReference); } } public void PingIndicator_RebuildPing(orig_RebuildPing methodReference, PingIndicator thisReference) { //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_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) //IL_0075: 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_00a1: 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_00de: Unknown result type (might be due to invalid IL or missing references) //IL_0166: 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_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Expected O, but got Unknown //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_02ff: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_0303: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Expected I4, but got Unknown //IL_031f: Unknown result type (might be due to invalid IL or missing references) //IL_0324: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_038f: Unknown result type (might be due to invalid IL or missing references) //IL_04e8: Unknown result type (might be due to invalid IL or missing references) //IL_04ed: Unknown result type (might be due to invalid IL or missing references) //IL_0580: Unknown result type (might be due to invalid IL or missing references) //IL_0585: Unknown result type (might be due to invalid IL or missing references) //IL_08ec: Unknown result type (might be due to invalid IL or missing references) //IL_08f2: Unknown result type (might be due to invalid IL or missing references) //IL_08f7: Unknown result type (might be due to invalid IL or missing references) //IL_02aa: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_05a3: Unknown result type (might be due to invalid IL or missing references) //IL_05d3: Unknown result type (might be due to invalid IL or missing references) //IL_05d8: Unknown result type (might be due to invalid IL or missing references) //IL_061c: Unknown result type (might be due to invalid IL or missing references) //IL_0621: Unknown result type (might be due to invalid IL or missing references) //IL_0631: Unknown result type (might be due to invalid IL or missing references) //IL_0633: Unknown result type (might be due to invalid IL or missing references) //IL_05f6: Unknown result type (might be due to invalid IL or missing references) //IL_05f8: Unknown result type (might be due to invalid IL or missing references) //IL_0754: Unknown result type (might be due to invalid IL or missing references) //IL_0759: Unknown result type (might be due to invalid IL or missing references) //IL_075e: Unknown result type (might be due to invalid IL or missing references) //IL_0793: Unknown result type (might be due to invalid IL or missing references) //IL_0799: Invalid comparison between Unknown and I4 //IL_0434: Unknown result type (might be due to invalid IL or missing references) //IL_044a: Unknown result type (might be due to invalid IL or missing references) //IL_07b9: Unknown result type (might be due to invalid IL or missing references) //IL_07bf: Invalid comparison between Unknown and I4 //IL_0458: Unknown result type (might be due to invalid IL or missing references) //IL_07d5: Unknown result type (might be due to invalid IL or missing references) //IL_07db: Invalid comparison between Unknown and I4 //IL_047e: Unknown result type (might be due to invalid IL or missing references) //IL_0490: Unknown result type (might be due to invalid IL or missing references) //IL_0495: Unknown result type (might be due to invalid IL or missing references) //IL_049a: Unknown result type (might be due to invalid IL or missing references) //IL_083d: Unknown result type (might be due to invalid IL or missing references) //IL_07fe: Unknown result type (might be due to invalid IL or missing references) //IL_0804: Invalid comparison between Unknown and I4 if (DisableUIChanges.Value) { methodReference.Invoke(thisReference); return; } thisReference.pingTargetRenderers.Clear(); ((Component)thisReference).transform.rotation = Util.QuaternionSafeLookRotation(thisReference.pingNormal); ((Component)thisReference).transform.localScale = Vector3.one; if (Object.op_Implicit((Object)(object)thisReference.weakPointTarget)) { Vector3 position = thisReference.weakPointTarget.transform.position; ((Component)thisReference).transform.position = position; thisReference.positionIndicator.targetTransform = thisReference.weakPointTarget.transform; thisReference.positionIndicator.defaultPosition = position; } else { ((Component)thisReference).transform.position = ((Object.op_Implicit((Object)(object)thisReference.pingTarget) && !thisReference.forceUseHitOriginForPosition) ? thisReference.pingTarget.transform.position : thisReference.pingOrigin); thisReference.positionIndicator.targetTransform = ((Object.op_Implicit((Object)(object)thisReference.pingTarget) && !thisReference.forceUseHitOriginForPosition) ? thisReference.pingTarget.transform : null); thisReference.positionIndicator.defaultPosition = ((Component)thisReference).transform.position; } thisReference.positionIndicator.ReCalcHeadOffset(thisReference.positionIndicator.targetTransform); IDisplayNameProvider val = (Object.op_Implicit((Object)(object)thisReference.pingTarget) ? thisReference.pingTarget.GetComponentInParent<IDisplayNameProvider>() : null); ModelLocator val2 = null; thisReference.pingType = (PingType)0; ((Behaviour)thisReference.pingObjectScaleCurve).enabled = false; ((Behaviour)thisReference.pingObjectScaleCurve).enabled = true; GameObject[] defaultPingGameObjects = thisReference.defaultPingGameObjects; for (int i = 0; i < defaultPingGameObjects.Length; i++) { defaultPingGameObjects[i].SetActive(false); } defaultPingGameObjects = thisReference.enemyPingGameObjects; for (int j = 0; j < defaultPingGameObjects.Length; j++) { defaultPingGameObjects[j].SetActive(false); } defaultPingGameObjects = thisReference.interactablePingGameObjects; for (int k = 0; k < defaultPingGameObjects.Length; k++) { defaultPingGameObjects[k].SetActive(false); } if (Object.op_Implicit((Object)(object)thisReference.pingTarget)) { Debug.LogFormat("Ping target {0}", new object[1] { thisReference.pingTarget }); val2 = thisReference.pingTarget.GetComponent<ModelLocator>(); if (val != null) { CharacterBody component = thisReference.pingTarget.GetComponent<CharacterBody>(); if (!Object.op_Implicit((Object)(object)thisReference.pingTarget.GetComponent<PurchaseInteraction>()) && Object.op_Implicit((Object)(object)component)) { thisReference.pingType = (PingType)1; thisReference.targetTransformToFollow = component.coreTransform; } else { thisReference.targetTransformToFollow = thisReference.pingTarget.transform; thisReference.pingType = (PingType)2; } } } string ownerName = thisReference.GetOwnerName(); string text = (Object.op_Implicit((Object)(MonoBehaviour)val) ? Util.GetBestBodyName(((Component)(MonoBehaviour)val).gameObject) : ""); ((Behaviour)thisReference.pingText).enabled = true; ((TMP_Text)thisReference.pingText).text = ownerName; PingType pingType = thisReference.pingType; PingType val3 = pingType; switch ((int)val3) { case 0: { thisReference.pingColor = thisReference.defaultPingColor; thisReference.pingDuration = thisReference.defaultPingDuration; thisReference.pingTargetRenderers.Clear(); defaultPingGameObjects = thisReference.defaultPingGameObjects; for (int m = 0; m < defaultPingGameObjects.Length; m++) { defaultPingGameObjects[m].SetActive(true); } Chat.AddMessage(string.Format(Language.GetString("PLAYER_PING_DEFAULT"), ownerName)); break; } case 1: { thisReference.pingColor = thisReference.enemyPingColor; thisReference.pingDuration = thisReference.enemyPingDuration; defaultPingGameObjects = thisReference.enemyPingGameObjects; for (int n = 0; n < defaultPingGameObjects.Length; n++) { defaultPingGameObjects[n].SetActive(true); } if (!Object.op_Implicit((Object)(object)val2)) { break; } Transform val6 = ((val2 != null) ? val2.modelTransform : null); if (Object.op_Implicit((Object)(object)val6)) { CharacterModel val7 = ((val6 != null) ? ((Component)val6).GetComponent<CharacterModel>() : null); if (Object.op_Implicit((Object)(object)val7)) { RendererInfo[] baseRendererInfos = val7.baseRendererInfos; for (int num2 = 0; num2 < baseRendererInfos.Length; num2++) { RendererInfo? val8 = baseRendererInfos[num2]; if (val8.HasValue && !val8.Value.ignoreOverlays && ((Component)val8.Value.renderer).gameObject.activeInHierarchy) { thisReference.pingTargetRenderers.Add(val8.Value.renderer); thisReference.activeColor = Color32.op_Implicit(ColorCatalog.GetColor((ColorIndex)7)); if (!val7.fullBodyPing) { break; } } } } } Chat.AddMessage(string.Format(Language.GetString("PLAYER_PING_ENEMY"), ownerName, text)); break; } case 2: { thisReference.pingColor = thisReference.interactablePingColor; thisReference.pingDuration = thisReference.interactablePingDuration; thisReference.pingTargetPurchaseInteraction = thisReference.pingTarget.GetComponent<PurchaseInteraction>(); thisReference.halcyonShrine = thisReference.pingTarget.GetComponent<HalcyoniteShrineInteractable>(); Sprite interactableIcon = PingIndicator.GetInteractableIcon(thisReference.pingTarget); SpriteRenderer component2 = thisReference.interactablePingGameObjects[0].GetComponent<SpriteRenderer>(); DroneVendorTerminalBehavior component3 = thisReference.pingTarget.GetComponent<DroneVendorTerminalBehavior>(); ShopTerminalBehavior component4 = thisReference.pingTarget.GetComponent<ShopTerminalBehavior>(); PickupDistributorBehavior component5 = thisReference.pingTarget.GetComponent<PickupDistributorBehavior>(); TeleporterInteraction component6 = thisReference.pingTarget.GetComponent<TeleporterInteraction>(); if (Object.op_Implicit((Object)(object)component3)) { PickupIndex currentPickupIndex = component3.CurrentPickupIndex; bool flag = !component3.pickupIndexIsHidden && Object.op_Implicit((Object)(object)component3.pickupDisplay); text = PingIndicator.GetFormattedTargetString(text, currentPickupIndex, flag); } else if (Object.op_Implicit((Object)(object)component4) && !component4.ignorePingFormatting) { UniquePickup val4 = component4.CurrentPickup(); bool flag2 = !component4.pickupIndexIsHidden && Object.op_Implicit((Object)(object)component4.pickupDisplay); text = PingIndicator.GetFormattedTargetString(text, val4.pickupIndex, flag2); } else if (Object.op_Implicit((Object)(object)component5)) { UniquePickup pickup = component5.GetPickup(); bool flag3 = !component5.pickupIndexIsHidden; text = PingIndicator.GetFormattedTargetString(text, pickup.pickupIndex, flag3); } else if (Object.op_Implicit((Object)(object)component6)) { thisReference.pingDuration = 30f; ((Behaviour)thisReference.pingText).enabled = false; component6.PingTeleporter(ownerName, thisReference); } else if (!((Object)thisReference.pingTarget.gameObject).name.Contains("Shrine") && (Object.op_Implicit((Object)(object)thisReference.pingTarget.GetComponent<GenericPickupController>()) || Object.op_Implicit((Object)(object)thisReference.pingTarget.GetComponent<PickupPickerController>()))) { thisReference.pingDuration = 60f; } defaultPingGameObjects = thisReference.interactablePingGameObjects; for (int l = 0; l < defaultPingGameObjects.Length; l++) { defaultPingGameObjects[l].SetActive(true); } Renderer val5; if (Object.op_Implicit((Object)(object)val2)) { object obj; if (val2 == null) { obj = null; } else { Transform modelTransform = val2.modelTransform; obj = ((modelTransform != null) ? ((Component)modelTransform).GetComponentInChildren<Renderer>() : null); } val5 = (Renderer)obj; } else { val5 = thisReference.pingTarget.GetComponentInChildren<Renderer>(); } if (Object.op_Implicit((Object)(object)val5)) { thisReference.pingTargetRenderers.Add(val5); thisReference.activeColor = Color32.op_Implicit(ColorCatalog.GetColor((ColorIndex)6)); } component2.sprite = interactableIcon; ((Renderer)component2).enabled = !Object.op_Implicit((Object)(object)component6); if (Object.op_Implicit((Object)(object)thisReference.pingTargetPurchaseInteraction) && (int)thisReference.pingTargetPurchaseInteraction.costType > 0) { PingIndicator.sharedStringBuilder.Clear(); if (((int)thisReference.pingTargetPurchaseInteraction.costType == 4 && thisReference.pingTargetPurchaseInteraction.cost == 3) || ((int)thisReference.pingTargetPurchaseInteraction.costType == 5 && thisReference.pingTargetPurchaseInteraction.cost == 5)) { bool flag4 = (int)thisReference.pingTargetPurchaseInteraction.costType == 5; PingIndicator.sharedStringBuilder.Append("<nobr><color=#" + (flag4 ? "E7543A" : "77FF17") + ">1 Scrap(s)</color></nobr> / "); } CostTypeDef costTypeDef = CostTypeCatalog.GetCostTypeDef(thisReference.pingTargetPurchaseInteraction.costType); int num = thisReference.pingTargetPurchaseInteraction.cost; if (((object)(CostTypeIndex)(ref thisReference.pingTargetPurchaseInteraction.costType)).Equals((object)(CostTypeIndex)1) && TeamManager.LongstandingSolitudesInParty() > 0) { num = (int)((float)num * TeamManager.GetLongstandingSolitudeItemCostScale()); } costTypeDef.BuildCostStringStyled(num, PingIndicator.sharedStringBuilder, false, true); Chat.AddMessage(string.Format(Language.GetString("PLAYER_PING_INTERACTABLE_WITH_COST"), ownerName, text, PingIndicator.sharedStringBuilder.ToString())); } else { Chat.AddMessage(string.Format(Language.GetString("PLAYER_PING_INTERACTABLE"), ownerName, text)); } break; } } ((Graphic)thisReference.pingText).color = thisReference.textBaseColor * thisReference.pingColor; thisReference.fixedTimer = thisReference.pingDuration; } } }