Decompiled source of UnnamedProducts v2.3.3
plugins/com.github.MiiMii1205.UnnamedProducts.dll
Decompiled 6 days ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Globalization; using System.IO; using System.Linq; 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 DG.Tweening; using HarmonyLib; using Microsoft.CodeAnalysis; using PEAKLib.Core; using PEAKLib.Core.Extensions; using PEAKLib.Items; using PEAKLib.Items.UnityEditor; using Peak; using Peak.Afflictions; using Photon.Pun; using Photon.Realtime; using PiggyBank.Behaviours; using PiggyBank.Behaviours.GUI; using Sirenix.Utilities; using TMPro; using Unity.Mathematics; using UnityEngine; using UnityEngine.Audio; using UnityEngine.EventSystems; using UnityEngine.Rendering; using UnityEngine.SceneManagement; using UnityEngine.TextCore; using UnityEngine.UI; using UnityEngine.UI.Extensions; using UnnamedProducts.Behaviours; using UnnamedProducts.Behaviours.Item; using UnnamedProducts.Behaviours.Item.GarbageBag; using UnnamedProducts.Behaviours.Item.GarbageBag.GUI; using UnnamedProducts.Compatibility; using UnnamedProducts.Extensions; using UnnamedProducts.Patchers; using Zorro.Core; using Zorro.Core.CLI; using Zorro.Core.Serizalization; using Zorro.Settings; using pworld.Scripts.Extensions; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: IgnoresAccessChecksTo("Assembly-CSharp")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("com.github.MiiMii1205.UnnamedProducts")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("2.3.3.0")] [assembly: AssemblyInformationalVersion("2.3.3+5f452a601114406213c9a72e60669663510d598a")] [assembly: AssemblyProduct("com.github.MiiMii1205.UnnamedProducts")] [assembly: AssemblyTitle("UnnamedProducts")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("2.3.3.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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] [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] [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 UnnamedProducts { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.github.MiiMii1205.UnnamedProducts", "UnnamedProducts", "2.3.3")] public class UnnamedPlugin : BaseUnityPlugin { public const float UnnamedModifier = 0.5f; public const float UnnamedChance = 0.25f; public const float UnnamedLuggageChance = 0.125f; public const byte UnnamedTotalBaseDataEntryKey = 16; private static readonly Dictionary<string, GameObject> UnnamedDatabase = new Dictionary<string, GameObject>(); public static readonly Dictionary<int, UnnamedBackItemReferences> UnnamedBackItemRefs = new Dictionary<int, UnnamedBackItemReferences>(); private static TMP_FontAsset? _darumaFontAsset; private static Material? _darumaShadowMaterial; private static readonly string[] GlobalZombieSpawnModList = new string[5] { "com.EMOKaMi.Zombie", "com.emokami.mimic", "Heroes", "sinik.zombiespawner", "legocool.LuckyBlocks" }; public static GameObject UnnamedGarbageBagPrefab = null; public static Texture2D GarbageBagIcon = null; private static readonly HashSet<string> UnnamedUniques = new HashSet<string>(); private static readonly Dictionary<BiomeType, State> BiomeSeeds = new Dictionary<BiomeType, State>(); private static readonly int UnderlayDilate = Shader.PropertyToID("_UnderlayDilate"); private static readonly int UnderlayOffsetY = Shader.PropertyToID("_UnderlayOffsetY"); private static readonly int UnderlaySoftness = Shader.PropertyToID("_UnderlaySoftness"); private static readonly int UnderlayColor = Shader.PropertyToID("_UnderlayColor"); private static bool _hasAnyGlobalSpawningZombies; private static string _unnamedPrefix = null; private static string _modInfoPrefix = null; public const string Id = "com.github.MiiMii1205.UnnamedProducts"; internal static ManualLogSource Log { get; private set; } = null; internal static PluginInfo UnnamedInfo { get; private set; } = null; public static Material SmallLuggageMaterial { get; private set; } = null; public static Material SmallLuggageInteriorMaterial { get; private set; } = null; public static Material LargeLuggageMaterial { get; private set; } = null; public static Material EpicLuggageMaterial { get; private set; } = null; public static Material ClownLuggageMaterial { get; private set; } = null; public static Material ClownLuggageInteriorMaterial { get; private set; } = null; public static Material LargeLuggageInteriorMaterial { get; private set; } = null; public static Material AncientLuggageMaterial { get; private set; } = null; public static Material AncientLuggageMetalMaterial { get; private set; } = null; public static Material AncientLuggageCrystalMaterial { get; private set; } = null; public static Material RespawnStatueCalderaMaterial { get; private set; } = null; public static Material RespawnStatueAlpineMaterial { get; private set; } = null; public static Material RespawnStatueMesaMaterial { get; private set; } = null; public static Material RespawnStatueRockVFXMaterial { get; private set; } = null; public static Material UnnamedJetpackMetalicMaterial { get; private set; } = null; public static Material UnnamedJetpackShellMaterial { get; private set; } = null; public static Material UnnamedJetpackDecalsMaterial { get; private set; } = null; public static Material UnnamedRocketpackMaterial { get; private set; } = null; public static Material UnnamedRopeScoutCannonMaterial { get; private set; } = null; public static Material UnnamedRocketpackRopeMaterial { get; private set; } = null; public static Material RespawnStatueRootsMaterial { get; private set; } = null; public static Material RespawnStatueTropicsMaterial { get; private set; } = null; public static Material RespawnStatueShoreMaterial { get; private set; } = null; public static Material RespawnStatueGloomMaterial { get; private set; } = null; public static Material AmuletStatueStoneMaterial { get; private set; } = null; public static Material UnnamedPetrifiedScoutMaterial { get; private set; } = null; public static Material TarnishGoldAmuletMaterial { get; private set; } = null; public static Material UnnamedArrowTrapMetalMaterial { get; private set; } = null; public static Material UnnamedArrowTrapDustLineMaterial { get; private set; } = null; public static Material UnnamedArrowTrapMaterial { get; private set; } = null; public static Material UnnamedSawbladeSpinMaterial { get; private set; } = null; public static Material UnnamedSawbladeSpin1Material { get; private set; } = null; public static Material UnnamedSawbladeFXMaterial { get; private set; } = null; public static Material UnnamedNotRenderedMaterial { get; private set; } = null; public static Material UnnamedBelltowerFireMaterial { get; private set; } = null; public static Material BingBongCrystalMaterial { get; private set; } = null; public static Material UnnamedGloomGraveStoneMaterial { get; private set; } = null; public static Material UnnamedGloomDriftwoodMaterial { get; private set; } = null; public static Material GoatCrystalMaterial { get; private set; } = null; public static Material SeagullCrystalMaterial { get; private set; } = null; public static Material TurtleCrystalMaterial { get; private set; } = null; public static Material UnnamedRocketpackLogoMaterial { get; private set; } = null; public static SpawnPool UnnamedSpawnPool { get; private set; } = (SpawnPool)0; public static GameObject BigUnnamedLuggagePrefab { get; private set; } = null; public static GameObject NoodleifiedScoutPrefab { get; private set; } = null; public static GameObject ClownUnnamedLuggagePrefab { get; private set; } = null; public static GameObject TrickUnnamedLuggagePrefab { get; private set; } = null; public static GameObject SmallUnnamedLuggagePrefab { get; private set; } = null; public static GameObject EpicUnnamedLuggagePrefab { get; private set; } = null; public static GameObject UnnamedRocketExplosionPrefab { get; private set; } = null; public static GameObject ExplosionPrefab { get; private set; } = null; public static Mesh UnnamedJetpackWorn { get; private set; } = null; public static Mesh UnnamedJetpackGround { get; private set; } = null; public static Mesh UnanmedRocketPackWornMesh { get; private set; } = null; public static Mesh UnanmedRocketPackGroundMesh { get; private set; } = null; public static TurtleShell UnnamedTurtleShell { get; private set; } = null; public static GameObject UnnamedBingBongAmuletPackaging { get; private set; } = null; public static GameObject UnnamedGoatAmuletPackaging { get; private set; } = null; public static GameObject UnnamedSeagullAmuletPackaging { get; private set; } = null; public static GameObject UnnamedTurtleAmuletPackaging { get; private set; } = null; public static GameObject AncientUnnamedLuggagePrefab { get; private set; } = null; public static TMP_FontAsset DarumaDropOne { get { if ((Object)(object)_darumaFontAsset == (Object)null) { TMP_FontAsset[] source = Resources.FindObjectsOfTypeAll<TMP_FontAsset>(); _darumaFontAsset = ((IEnumerable<TMP_FontAsset>)source).FirstOrDefault((Func<TMP_FontAsset, bool>)delegate(TMP_FontAsset fontAsset) { //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) FaceInfo faceInfo = ((TMP_Asset)fontAsset).faceInfo; return ((FaceInfo)(ref faceInfo)).familyName == "Daruma Drop One"; }); Log.LogInfo((object)"Daruma Drop One font found!"); } return _darumaFontAsset; } } public static Material DarumaDropOneShadowMaterial { get { //IL_0097: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)_darumaShadowMaterial == (Object)null) { _darumaShadowMaterial = ThrowHelper.ThrowIfArgumentNull<Material>(Object.Instantiate<Material>(((TMP_Asset)DarumaDropOne).material), "GameObject.Instantiate(DarumaDropOne.material)"); _darumaShadowMaterial.EnableKeyword("UNDERLAY_ON"); _darumaShadowMaterial.SetFloat(UnderlayDilate, 1f); _darumaShadowMaterial.SetFloat(UnderlayOffsetY, -0.7f); _darumaShadowMaterial.SetFloat(UnderlaySoftness, 1f); _darumaShadowMaterial.SetColor(UnderlayColor, new Color(0f, 0f, 0f, 0.1960784f)); Log.LogInfo((object)"Shadow material for Critial Hit indicator was successfully generated!"); } return _darumaShadowMaterial; } } public GameObject UnnamedKioskSetup { get; private set; } public GameObject UnnamedBrokenStandeeSetup { get; private set; } public Dictionary<string, Material> PlaneMaterials { get; set; } public Dictionary<string, Material> MirageMaterials { get; set; } public static GameObject UnnamedInertRocketPrefab { get; private set; } = null; public static Gradient UnnamedClownLuggageConfettiGradient { get; private set; } = null; public static Gradient UnnamedBelltowerBlueFlameGradient { get; private set; } = null; public static Gradient UnnamedCandleBlueFlameGradient { get; private set; } = null; public static Gradient UnnamedBelltowerFireGradient { get; private set; } = null; public static Gradient UnnamedBelltowerAOEGradient { get; private set; } = null; public static Gradient UnnamedJetpackFireFuelGradient { get; private set; } = null; public static Gradient UnnamedJetpackFireGradient { get; private set; } = null; public static Gradient UnnamedRocketpackFireGradient { get; private set; } = null; public static bool ShouldBeUnnamed => Random.value <= 0.25f; public static bool LuggageShouldBeUnnamed => Random.value <= 0.125f; public static float RandomUnnamedModifier => RandomModifier(); public static bool RandomUnnamedBool => IsUnnamedLucky(); public static string Name => "UnnamedProducts"; public static string Version => "2.3.3"; private void Awake() { //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Expected O, but got Unknown Log = ((BaseUnityPlugin)this).Logger; UnnamedInfo = ((BaseUnityPlugin)this).Info; _modInfoPrefix = ModDefinition.GetOrCreate(UnnamedInfo).Id + ":"; _unnamedPrefix = _modInfoPrefix + "Unnamed"; AddLocalizedTextCsv(); int num = 0; foreach (int value in Enum.GetValues(typeof(SpawnPool))) { if (value > num) { num = value; } } UnnamedSpawnPool = (SpawnPool)(num * 2); Log.LogInfo((object)$"Highest spawn pool: {num}. Using {num * 2} as the unnamed pool"); Log.LogInfo((object)("Plugin " + Name + " is loading...")); _hasAnyGlobalSpawningZombies = GlobalZombieSpawnModList.Any(Chainloader.PluginInfos.ContainsKey); GlobalEvents.OnItemRequested = (Action<Item, Character>)Delegate.Combine(GlobalEvents.OnItemRequested, new Action<Item, Character>(CheckForStickyFireballs)); BundleLoader.LoadBundleWithName((BaseUnityPlugin)(object)this, "unnamed.peakbundle", (Action<PeakBundle>)delegate(PeakBundle peakBundle) { //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_027a: Unknown result type (might be due to invalid IL or missing references) //IL_027f: Unknown result type (might be due to invalid IL or missing references) //IL_02a4: Unknown result type (might be due to invalid IL or missing references) //IL_02a9: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0351: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_037b: Unknown result type (might be due to invalid IL or missing references) //IL_03a0: Unknown result type (might be due to invalid IL or missing references) //IL_03a5: Unknown result type (might be due to invalid IL or missing references) //IL_03ca: Unknown result type (might be due to invalid IL or missing references) //IL_03cf: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_03ff: Unknown result type (might be due to invalid IL or missing references) //IL_0409: Expected O, but got Unknown //IL_0432: Unknown result type (might be due to invalid IL or missing references) //IL_0437: Unknown result type (might be due to invalid IL or missing references) //IL_043c: Unknown result type (might be due to invalid IL or missing references) //IL_0446: Expected O, but got Unknown //IL_046f: Unknown result type (might be due to invalid IL or missing references) //IL_0474: Unknown result type (might be due to invalid IL or missing references) //IL_0479: Unknown result type (might be due to invalid IL or missing references) //IL_0483: Expected O, but got Unknown //IL_04ac: Unknown result type (might be due to invalid IL or missing references) //IL_04b1: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04c0: Expected O, but got Unknown //IL_06d3: Unknown result type (might be due to invalid IL or missing references) //IL_06d8: 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_0842: Unknown result type (might be due to invalid IL or missing references) //IL_0858: Unknown result type (might be due to invalid IL or missing references) //IL_085d: Unknown result type (might be due to invalid IL or missing references) //IL_0873: Unknown result type (might be due to invalid IL or missing references) //IL_0878: Unknown result type (might be due to invalid IL or missing references) //IL_088e: Unknown result type (might be due to invalid IL or missing references) //IL_0893: Unknown result type (might be due to invalid IL or missing references) //IL_08cf: Unknown result type (might be due to invalid IL or missing references) //IL_08d4: Unknown result type (might be due to invalid IL or missing references) //IL_08ea: Unknown result type (might be due to invalid IL or missing references) //IL_08ef: Unknown result type (might be due to invalid IL or missing references) //IL_0905: Unknown result type (might be due to invalid IL or missing references) //IL_090a: Unknown result type (might be due to invalid IL or missing references) //IL_0920: Unknown result type (might be due to invalid IL or missing references) //IL_0925: Unknown result type (might be due to invalid IL or missing references) //IL_09a6: Unknown result type (might be due to invalid IL or missing references) //IL_09ab: Unknown result type (might be due to invalid IL or missing references) //IL_09b6: Unknown result type (might be due to invalid IL or missing references) //IL_09c1: Unknown result type (might be due to invalid IL or missing references) //IL_09c8: Unknown result type (might be due to invalid IL or missing references) //IL_09cf: Unknown result type (might be due to invalid IL or missing references) //IL_09d6: Unknown result type (might be due to invalid IL or missing references) //IL_09dd: Unknown result type (might be due to invalid IL or missing references) //IL_09e8: Unknown result type (might be due to invalid IL or missing references) //IL_09ef: Unknown result type (might be due to invalid IL or missing references) //IL_09fa: Unknown result type (might be due to invalid IL or missing references) //IL_0a01: Unknown result type (might be due to invalid IL or missing references) //IL_0a08: Unknown result type (might be due to invalid IL or missing references) //IL_0a0f: Unknown result type (might be due to invalid IL or missing references) //IL_0a16: Unknown result type (might be due to invalid IL or missing references) //IL_0a1d: Unknown result type (might be due to invalid IL or missing references) //IL_0a24: Unknown result type (might be due to invalid IL or missing references) //IL_0a2b: Unknown result type (might be due to invalid IL or missing references) //IL_0a32: Unknown result type (might be due to invalid IL or missing references) //IL_0a38: Unknown result type (might be due to invalid IL or missing references) //IL_0a3e: Unknown result type (might be due to invalid IL or missing references) //IL_0a44: Unknown result type (might be due to invalid IL or missing references) //IL_0a4a: Unknown result type (might be due to invalid IL or missing references) //IL_0a5a: Expected O, but got Unknown //IL_0ad5: Unknown result type (might be due to invalid IL or missing references) //IL_0ada: Unknown result type (might be due to invalid IL or missing references) //IL_2152: Unknown result type (might be due to invalid IL or missing references) //IL_1ffa: Unknown result type (might be due to invalid IL or missing references) GameObject val2 = peakBundle.LoadAsset<GameObject>("Antifreeze.prefab"); ItemOptimizer orAddComponent = ExtGameObject.GetOrAddComponent<ItemOptimizer>(val2.gameObject); Item val3 = (orAddComponent.item = val2.GetComponent<Item>()); val3.overrideJetpackFuel = true; val3.overrideJetpackFuelAmount = 100; val3.overrideJetpackFuelPerUse = 25; val3.overrideJetpackFuelPerFuelMult = 1f; Log.LogInfo((object)"Loading Antifreeze..."); MeshRenderer[] componentsInChildren = val2.GetComponentsInChildren<MeshRenderer>(); foreach (MeshRenderer val4 in componentsInChildren) { ((Renderer)val4).sortingOrder = 1; if (((Object)((Renderer)val4).sharedMaterial.shader).name == "Shader Graphs/LiquidEffect" || ((Object)((Renderer)val4).material.shader).name == "Shader Graphs/LiquidEffect") { GameObject gameObject = ((Component)val4).gameObject; LiquidController orAddComponent2 = ExtGameObject.GetOrAddComponent<LiquidController>(gameObject); Log.LogInfo((object)"Initializing Liquid Controller..."); orAddComponent2.mesh = gameObject.GetComponent<MeshFilter>().sharedMesh; orAddComponent2.rend = (Renderer)(object)val4; orAddComponent2.compensateShapeAmount = 0.132f; orAddComponent2.Thickness = 0.5f; orAddComponent2.fillAmount = 0.4f; orAddComponent2.Recovery = 1f; orAddComponent2.MaxWobble = 0.03f; orAddComponent2.WobbleSpeedMove = 0.5f; } } ExplodeOnBurningAction explodeOnBurningAction = val2.AddComponent<ExplodeOnBurningAction>(); explodeOnBurningAction.dontRunIfOutOfFuel = false; ((ItemAction)explodeOnBurningAction).OnCastFinished = true; UnnamedSpawnRestriction orAddComponent3 = ExtGameObject.GetOrAddComponent<UnnamedSpawnRestriction>(val2); orAddComponent3.biomeType = CollectionExtensions.AddToArray<BiomeType>(orAddComponent3.biomeType, (BiomeType)2); orAddComponent3.whenNightIsCold = true; orAddComponent3.hasColdNightRestrictions = true; LootData orAddComponent4 = ExtGameObject.GetOrAddComponent<LootData>(val2); orAddComponent4.spawnLocations = UnnamedSpawnPool; Log.LogInfo((object)"Loading sticky fireball..."); GameObject val5 = peakBundle.LoadAsset<GameObject>("StickyFireball.prefab"); StickyFireballController orAddComponent5 = ExtGameObject.GetOrAddComponent<StickyFireballController>(val5); orAddComponent5.destroyAfterTime = val5.GetComponent<DestroyAfterTime>(); orAddComponent5.rb = val5.GetComponent<Rigidbody>(); AudioSource component = ((Component)orAddComponent5).GetComponent<AudioSource>(); Item val6 = default(Item); if (ItemDatabase.TryGetItem((ushort)62, ref val6)) { AudioClip clip = ((Component)val6).GetComponent<Constructable>().constructedPrefab.gameObject.GetComponent<AudioSource>().clip; component.clip = clip; Campfire componentInChildren = ((Component)val6).GetComponent<Constructable>().constructedPrefab.GetComponentInChildren<Campfire>(); SFX_Instance[] fireStart = componentInChildren.fireStart; SFX_Instance[] extinguish = componentInChildren.extinguish; orAddComponent5.extinguish = extinguish; orAddComponent5.fireStart = fireStart; } component.SetCustomCurve((AudioSourceCurveType)0, new AnimationCurve((Keyframe[])(object)new Keyframe[10] { new Keyframe(0.002f, 1f, -500.2007f, -500.2007f, 0f, 0f), new Keyframe(0.004f, 0.5f, -125.0502f, -125.0502f, 0f, 0f), new Keyframe(0.008f, 0.25f, -31.2625f, -31.2625f, 0f, 0f), new Keyframe(0.016f, 0.125f, -7.8156f, -7.8156f, 0f, 0f), new Keyframe(0.032f, 0.0625f, -1.9539f, -1.9539f, 0f, 0f), new Keyframe(0.064f, 1f / 32f, -0.4885f, -0.4885f, 0f, 0f), new Keyframe(0.128f, 1f / 64f, -0.1221f, -0.1221f, 0f, 0f), new Keyframe(0.256f, 1f / 128f, -0.0305f, -0.0305f, 0f, 0f), new Keyframe(0.512f, 0.00390625f, -0.00076f, -0.00076f, 0f, 0f), new Keyframe(1f, 0f, -0.002f, -0.002f, 0f, 0f) })); component.SetCustomCurve((AudioSourceCurveType)1, new AnimationCurve((Keyframe[])(object)new Keyframe[1] { new Keyframe(0f, 1f, 0f, 0f, 0.3333f, 0.3333f) })); component.SetCustomCurve((AudioSourceCurveType)2, new AnimationCurve((Keyframe[])(object)new Keyframe[1] { new Keyframe(0f, 1f, 0f, 0f, 0.3333f, 0.3333f) })); component.SetCustomCurve((AudioSourceCurveType)3, new AnimationCurve((Keyframe[])(object)new Keyframe[1] { new Keyframe(0f, 1f, 0f, 0f, 0.3333f, 0.3333f) })); Renderer[] componentsInChildren2 = ((Component)orAddComponent5).GetComponentsInChildren<Renderer>(true); Material item; foreach (Renderer val7 in componentsInChildren2) { Material[] materials = val7.materials; int k = 0; for (int num3 = materials.Length; k < num3; k++) { Material val8 = materials[k]; val8.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)val8.shader).name), "Shader.Find(mat.shader.name)"); } Renderer val9 = val7; Material[] array = materials; List<Material> list = new List<Material>(array.Length); Material[] array2 = array; for (int l = 0; l < array2.Length; l++) { item = array2[l]; list.Add(item); } val9.SetMaterials(list); } Item val10 = default(Item); if (ItemDatabase.TryGetItem((ushort)35, ref val10)) { ItemCooking orAddComponent6 = ExtGameObject.GetOrAddComponent<ItemCooking>(val2); GameObject val11 = peakBundle.LoadAsset<GameObject>("AntifreezeExplosion.prefab"); AntifreezeExplosionController antifreezeExplosionController = val11.AddComponent<AntifreezeExplosionController>(); antifreezeExplosionController.stickyFireball = ((Component)orAddComponent5).gameObject; antifreezeExplosionController.m_amountOfFireballs = 20; GameObject val12 = Object.Instantiate<GameObject>(((Component)val10).GetComponent<ItemCooking>().explosionPrefab); val12.SetActive(false); Object.DontDestroyOnLoad((Object)(object)val12); antifreezeExplosionController.explosionPrefab = val12; orAddComponent6.explosionPrefab = ((Component)antifreezeExplosionController).gameObject; NetworkPrefabManager.RegisterNetworkPrefab(ModDefinition.GetOrCreate(((BaseUnityPlugin)this).Info), ((Component)antifreezeExplosionController).gameObject); NetworkPrefabManager.RegisterNetworkPrefab(ModDefinition.GetOrCreate(((BaseUnityPlugin)this).Info), val12); } StickyFireballController.FireballPrefab = ((Component)orAddComponent5).gameObject; NetworkPrefabManager.RegisterNetworkPrefab(ModDefinition.GetOrCreate(((BaseUnityPlugin)this).Info), ((Component)orAddComponent5).gameObject); UnnamedUniques.Add(((Object)val2).name.Trim()); GameObject val13 = peakBundle.LoadAsset<GameObject>("LaundryDetergent.prefab"); Action_Detergent orAddComponent7 = ExtGameObject.GetOrAddComponent<Action_Detergent>(val13); ((ItemAction)orAddComponent7).OnCastFinished = true; ItemOptimizer orAddComponent8 = ExtGameObject.GetOrAddComponent<ItemOptimizer>(val13); orAddComponent8.item = val13.GetComponent<Item>(); UnnamedSpawnRestriction orAddComponent9 = ExtGameObject.GetOrAddComponent<UnnamedSpawnRestriction>(val13); orAddComponent9.biomeType = CollectionExtensions.AddToArray<BiomeType>(CollectionExtensions.AddToArray<BiomeType>(CollectionExtensions.AddToArray<BiomeType>(CollectionExtensions.AddToArray<BiomeType>(orAddComponent9.biomeType, (BiomeType)7), (BiomeType)6), (BiomeType)2), (BiomeType)8); orAddComponent9.hasZombieRestrictions = true; orAddComponent9.whenZombieSpawnGlobally = true; LootData orAddComponent10 = ExtGameObject.GetOrAddComponent<LootData>(val13); orAddComponent10.spawnLocations = UnnamedSpawnPool; UnnamedUniques.Add(((Object)val13).name.Trim()); GameObject val14 = peakBundle.LoadAsset<GameObject>("GarbageBag.prefab"); ItemOptimizer orAddComponent11 = ExtGameObject.GetOrAddComponent<ItemOptimizer>(val14); Item val15 = default(Item); ItemDatabase.TryGetItem((ushort)91, ref val15); BananaPeel component2 = ((Component)val15).GetComponent<BananaPeel>(); UnnamedGarbageBagController orAddComponent12 = ExtGameObject.GetOrAddComponent<UnnamedGarbageBagController>(val14); UnnamedGarbageBagSlips orAddComponent13 = ExtGameObject.GetOrAddComponent<UnnamedGarbageBagSlips>(val14); UnnamedGarbageBagAudio orAddComponent14 = ExtGameObject.GetOrAddComponent<UnnamedGarbageBagAudio>(val14); ItemCooking orAddComponent15 = ExtGameObject.GetOrAddComponent<ItemCooking>(val14); BackPackAudio val16 = default(BackPackAudio); if (val14.TryGetComponent<BackPackAudio>(ref val16)) { orAddComponent14.holdSFX = val16.holdSFX; orAddComponent14.dropSFX = val16.dropSFX; Object.Destroy((Object)(object)val16); } orAddComponent12.slipSDSfxInstances = (SFX_Instance[])(object)new SFX_Instance[1] { component2.slipSFX[0] }; orAddComponent15.additionalCookingBehaviors = CollectionExtensions.AddToArray<AdditionalCookingBehavior>(orAddComponent15.additionalCookingBehaviors, (AdditionalCookingBehavior)(object)new CookingBehavior_DestroyAndReleaseGarbageBagItems { cookedAmountToTrigger = 1 }); orAddComponent13.garbageBag = orAddComponent12; orAddComponent13.rig = val14.GetComponent<Rigidbody>(); orAddComponent13.slipOnCollision = true; orAddComponent13.minSlipVelocity = 15f; orAddComponent13.ragdollCharacterOnSlip = false; orAddComponent13.pushForce = 2f; orAddComponent13.wholeBodyPushForce = 1f; orAddComponent12.fullBagGameObject = ((Component)val14.transform.Find("GarbageBag/filled")).gameObject; orAddComponent12.emptyBagGameObject = ((Component)val14.transform.Find("GarbageBag/empty")).gameObject; orAddComponent12.rightHandEmptyPosition = new Vector3(0.1941f, 0.179f, -0.3009f); orAddComponent12.leftHandEmptyPosition = new Vector3(-0.187f, 0.179f, -0.292f); orAddComponent12.rightHandFullPosition = new Vector3(0.407f, 0.17900696f, -0.429f); orAddComponent12.leftHandFullPosition = new Vector3(-0.377f, 0.179f, -0.42899966f); orAddComponent12.fullBagGameObject.SetActive(true); ShaderExtensions.ReplaceShaders(orAddComponent12.fullBagGameObject); orAddComponent12.fullBagGameObject.SetActive(false); ((Item)orAddComponent12).defaultPos = new Vector3(0f, -0.3f, 1.3166288f); orAddComponent12.defaultPosFilled = new Vector3(0f, -0.3f, 1.3166288f); orAddComponent12.defaultPosEmpty = new Vector3(0f, -0.3f, 0.81002724f); ((Item)orAddComponent12).defaultForward = new Vector3(0f, 0f, 1f); ((Item)orAddComponent12).mainRenderer = orAddComponent12.fullBagGameObject.GetComponent<Renderer>(); ((Item)orAddComponent12).addtlRenderers = (Renderer[])(object)new Renderer[1] { orAddComponent12.emptyBagGameObject.GetComponent<Renderer>() }; UnnamedGarbageBagVisuals orAddComponent16 = ExtGameObject.GetOrAddComponent<UnnamedGarbageBagVisuals>(val14); orAddComponent16.item = (Item)(object)orAddComponent12; orAddComponent12.m_unnamedGarbageBagVisuals = orAddComponent16; orAddComponent12.openRadialMenuTime = 0f; GarbageBagIcon = peakBundle.LoadAsset<Texture2D>("GarbageBag Icon.png"); ((Item)orAddComponent12).carryWeight = 1; ((Item)orAddComponent12).mass = 50f; ((Item)orAddComponent12).UIData = new ItemUIData { itemName = "Garbage Bag", icon = GarbageBagIcon, hasAltIcon = false, hasColorBlindIcon = false, altIcon = null, hasMainInteract = false, mainInteractPrompt = "OPEN", hasSecondInteract = false, secondaryInteractPrompt = "", hasScrollingInteract = false, scrollInteractPrompt = null, canDrop = true, canPocket = true, canBackpack = true, canThrow = true, isShootable = false, hideFuel = true, iconPositionOffset = default(Vector3), iconRotationOffset = default(Vector3), iconScaleOffset = 1.49f }; ((Item)orAddComponent12).totalUses = -1; orAddComponent11.item = val14.GetComponent<Item>(); UnnamedUniques.Add(((Object)val14).name.Trim()); GameObject val17 = peakBundle.LoadAsset<GameObject>("GarbageBagBox.prefab"); ItemOptimizer orAddComponent17 = ExtGameObject.GetOrAddComponent<ItemOptimizer>(val17); orAddComponent17.item = val17.GetComponent<Item>(); Action_SpawnAndGrab orAddComponent18 = ExtGameObject.GetOrAddComponent<Action_SpawnAndGrab>(val17); orAddComponent18.itemToSpawn = val14.GetComponent<Item>(); ((ItemAction)orAddComponent18).OnCastFinished = true; LootData orAddComponent19 = ExtGameObject.GetOrAddComponent<LootData>(val17); orAddComponent19.spawnLocations = UnnamedSpawnPool; UnnamedUniques.Add(((Object)val17).name.Trim()); SmallLuggageMaterial = peakBundle.LoadAsset<Material>("M_UnnamedLuggage.mat"); SmallLuggageInteriorMaterial = peakBundle.LoadAsset<Material>("M_UnnamedLuggage_interior.mat"); EpicLuggageMaterial = peakBundle.LoadAsset<Material>("M_UnnamedLuggage_epic.mat"); LargeLuggageMaterial = peakBundle.LoadAsset<Material>("M_UnnamedLuggage_large.mat"); LargeLuggageInteriorMaterial = peakBundle.LoadAsset<Material>("M_UnnamedLuggage_interior_large.mat"); ClownLuggageMaterial = peakBundle.LoadAsset<Material>("M_UnnamedLuggage_Clown.mat"); ClownLuggageInteriorMaterial = peakBundle.LoadAsset<Material>("M_UnnamedLuggage_Clown_interior.mat"); AncientLuggageMaterial = peakBundle.LoadAsset<Material>("M_UnnamedLuggage_ancient.mat"); AncientLuggageMetalMaterial = peakBundle.LoadAsset<Material>("M_UnnamedMetal.mat"); AncientLuggageCrystalMaterial = peakBundle.LoadAsset<Material>("M_UnnamedRock_Crystal.mat"); RespawnStatueCalderaMaterial = peakBundle.LoadAsset<Material>("M_UnnamedRock_Volcano.mat"); RespawnStatueAlpineMaterial = peakBundle.LoadAsset<Material>("M_UnnamedRock_peak Snow.mat"); RespawnStatueMesaMaterial = peakBundle.LoadAsset<Material>("M_UnnamedDesertSand.mat"); RespawnStatueRootsMaterial = peakBundle.LoadAsset<Material>("M_UnnamedForest_rock.mat"); RespawnStatueTropicsMaterial = peakBundle.LoadAsset<Material>("M_UnnamedRock 1.mat"); RespawnStatueShoreMaterial = peakBundle.LoadAsset<Material>("M_UnnamedSaltRock.mat"); RespawnStatueGloomMaterial = peakBundle.LoadAsset<Material>("M_Unnamedtemple_stone_Dagger.mat"); AmuletStatueStoneMaterial = peakBundle.LoadAsset<Material>("M_UnnamedAmuletStatueStone.mat"); UnnamedPetrifiedScoutMaterial = peakBundle.LoadAsset<Material>("M_UnnamedPetrifiedScout.mat"); TarnishGoldAmuletMaterial = peakBundle.LoadAsset<Material>("M_UnnamedTarnishedGoldAmulet.mat"); BingBongCrystalMaterial = peakBundle.LoadAsset<Material>("M_UnnamedCrystal_BingBong.mat"); GoatCrystalMaterial = peakBundle.LoadAsset<Material>("M_UnnamedCrystal_Goat.mat"); SeagullCrystalMaterial = peakBundle.LoadAsset<Material>("M_UnnamedCrystal_Seagull.mat"); TurtleCrystalMaterial = peakBundle.LoadAsset<Material>("M_UnnamedCrystal_Turtle.mat"); UnnamedArrowTrapMaterial = peakBundle.LoadAsset<Material>("M_UnnamedStovePaint.mat"); UnnamedArrowTrapMetalMaterial = peakBundle.LoadAsset<Material>("M_UnnamedMetal.mat"); UnnamedGloomGraveStoneMaterial = peakBundle.LoadAsset<Material>("M_UnnamedGrave Stone.mat"); UnnamedGloomDriftwoodMaterial = peakBundle.LoadAsset<Material>("M_UnnamedGloomDriftwood.mat"); UnnamedSawbladeSpinMaterial = peakBundle.LoadAsset<Material>("M_UnnamedMetalSpin.mat"); UnnamedSawbladeSpin1Material = peakBundle.LoadAsset<Material>("M_UnnamedMetalSpin 1.mat"); UnnamedSawbladeFXMaterial = peakBundle.LoadAsset<Material>("M_UnnamedSawFx.mat"); UnnamedBelltowerFireMaterial = peakBundle.LoadAsset<Material>("M_UnnamedFireSmall_Belltower.mat"); UnnamedArrowTrapDustLineMaterial = peakBundle.LoadAsset<Material>("M_UnnamedArrowShooterWarningLine.mat"); RespawnStatueRockVFXMaterial = peakBundle.LoadAsset<Material>("M_UnnamedRock_staticTopColour.mat"); UnnamedJetpackMetalicMaterial = peakBundle.LoadAsset<Material>("M_UnnamedJetPackMetallic.mat"); UnnamedJetpackShellMaterial = peakBundle.LoadAsset<Material>("M_UnnamedJetPackShell.mat"); UnnamedJetpackDecalsMaterial = peakBundle.LoadAsset<Material>("M_UnnamedJetPackDecals.mat"); UnnamedRocketpackMaterial = peakBundle.LoadAsset<Material>("M_UnnamedRocketpack.mat"); UnnamedRopeScoutCannonMaterial = peakBundle.LoadAsset<Material>("M_UnnamedRope_ScoutCannon.mat"); UnnamedRocketpackRopeMaterial = peakBundle.LoadAsset<Material>("M_UnnamedRope_Rocket.mat"); UnnamedClownLuggageConfettiGradient = peakBundle.LoadAsset<GameObject>("UnnamedConfettiGradient.prefab").GetComponent<Gradient2>().EffectGradient; UnnamedBelltowerBlueFlameGradient = peakBundle.LoadAsset<GameObject>("UnnamedBelltowerBlueFlameGradient.prefab").GetComponent<Gradient2>().EffectGradient; UnnamedCandleBlueFlameGradient = peakBundle.LoadAsset<GameObject>("UnnamedCandleBlueFlameGradient.prefab").GetComponent<Gradient2>().EffectGradient; UnnamedBelltowerFireGradient = peakBundle.LoadAsset<GameObject>("UnnamedBelltowerFireGradient.prefab").GetComponent<Gradient2>().EffectGradient; UnnamedBelltowerAOEGradient = peakBundle.LoadAsset<GameObject>("UnnamedBelltowerAOEGradient.prefab").GetComponent<Gradient2>().EffectGradient; UnnamedJetpackFireFuelGradient = peakBundle.LoadAsset<GameObject>("UnnamedJetpackFireFuelGradient.prefab").GetComponent<Gradient2>().EffectGradient; UnnamedJetpackFireGradient = peakBundle.LoadAsset<GameObject>("UnnamedJetpackFireGradient.prefab").GetComponent<Gradient2>().EffectGradient; UnnamedRocketpackFireGradient = peakBundle.LoadAsset<GameObject>("UnnamedRocketpackFireGradient.prefab").GetComponent<Gradient2>().EffectGradient; UnnamedJetpackWorn = peakBundle.LoadAsset<Mesh>("UnnamedJetpack_Worn.fbx"); UnnamedJetpackGround = peakBundle.LoadAsset<Mesh>("UnnamedJetpack_Ground.fbx"); UnnamedRocketpackLogoMaterial = peakBundle.LoadAsset<Material>("M_UnnamedRocketpackLogo.mat"); UnanmedRocketPackWornMesh = peakBundle.LoadAsset<Mesh>("UnnamedRocketpack_Worn.fbx"); UnanmedRocketPackGroundMesh = peakBundle.LoadAsset<Mesh>("UnnamedRocketpack_Ground.fbx"); TurtleShell turtleShell = Resources.Load<GameObject>("Character").GetComponent<Character>().refs.turtleShell; GameObject val18 = Object.Instantiate<GameObject>(((Component)turtleShell).gameObject); ((Object)val18).name = CleanedName(((Object)val18).name); RenameToUnnamed(val18); Animator component3 = val18.GetComponent<Animator>(); component3.runtimeAnimatorController = (RuntimeAnimatorController)(object)peakBundle.LoadAsset<AnimatorOverrideController>("VFX_UnnamedTurtleShell.overrideController"); ((Object)val18.gameObject).hideFlags = (HideFlags)61; Object.DontDestroyOnLoad((Object)(object)val18); val18.SetActive(false); UnnamedTurtleShell = val18.GetComponent<TurtleShell>(); Item val19 = default(Item); if (ItemDatabase.TryGetItem((ushort)106, ref val19)) { ExplosionPrefab = ((Component)val19).GetComponent<ItemCooking>().explosionPrefab; } else { Log.LogWarning((object)"No dynamite found!"); } PlaneMaterials = new Dictionary<string, Material>(); PlaneMaterials = new Dictionary<string, Material>(); string[] array3 = new string[10] { "Plane", "Plane 1", "Plane 3", "Plane 4", "Plane cleaner", "Plane Glass", "Plane seat", "Plane-snow", "PlaneWings", "PlaneWings-snow" }; string[] array4 = array3; foreach (string text in array4) { Material val20 = peakBundle.LoadAsset<Material>("M_Unnamed" + text + ".mat"); val20.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)val20.shader).name), "Shader.Find(planeMaterial.shader.name)"); Log.LogInfo((object)("Added plane material named " + ((Object)val20).name + ".")); PlaneMaterials[text] = val20; } MirageMaterials = new Dictionary<string, Material>(); string[] array5 = new string[6] { "Luggage_Large_Mirage", "Luggage_Ancient_Mirage", "Luggage_AncientChain_Mirage", "Luggage_AncientCrystal_Mirage", "Luggage-mirage", "Luggage_Epic_Mirage" }; string[] array6 = array5; foreach (string text2 in array6) { Material val21 = peakBundle.LoadAsset<Material>("M_Unnamed" + text2 + ".mat"); val21.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)val21.shader).name), "Shader.Find(mirageMaterial.shader.name)"); Log.LogInfo((object)("Added mirage material named " + ((Object)val21).name + ".")); MirageMaterials[text2] = val21; } SmallLuggageMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)SmallLuggageMaterial.shader).name), "Shader.Find(SmallLuggageMaterial.shader.name)"); SmallLuggageInteriorMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)SmallLuggageInteriorMaterial.shader).name), "Shader.Find(SmallLuggageInteriorMaterial.shader.name)"); EpicLuggageMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)EpicLuggageMaterial.shader).name), "Shader.Find(EpicLuggageMaterial.shader.name)"); LargeLuggageMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)LargeLuggageMaterial.shader).name), "Shader.Find(LargeLuggageMaterial.shader.name)"); LargeLuggageInteriorMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)LargeLuggageInteriorMaterial.shader).name), "Shader.Find(LargeLuggageInteriorMaterial.shader.name)"); ClownLuggageMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)ClownLuggageMaterial.shader).name), "Shader.Find(ClownLuggageMaterial.shader.name)"); ClownLuggageInteriorMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)ClownLuggageInteriorMaterial.shader).name), "Shader.Find(ClownLuggageInteriorMaterial.shader.name)"); AncientLuggageMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)AncientLuggageMaterial.shader).name), "Shader.Find(AncientLuggageMaterial.shader.name)"); AncientLuggageMetalMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)AncientLuggageMetalMaterial.shader).name), "Shader.Find(AncientLuggageMetalMaterial.shader.name)"); AncientLuggageCrystalMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)AncientLuggageCrystalMaterial.shader).name), "Shader.Find(AncientLuggageCrystalMaterial.shader.name)"); RespawnStatueRockVFXMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)RespawnStatueRockVFXMaterial.shader).name), "Shader.Find(RespawnStatueRockVFXMaterial.shader.name)"); RespawnStatueCalderaMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)RespawnStatueCalderaMaterial.shader).name), "Shader.Find(RespawnStatueCalderaMaterial.shader.name)"); RespawnStatueAlpineMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)RespawnStatueAlpineMaterial.shader).name), "Shader.Find(RespawnStatueAlpineMaterial.shader.name)"); RespawnStatueMesaMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)RespawnStatueMesaMaterial.shader).name), "Shader.Find(RespawnStatueMesaMaterial.shader.name)"); RespawnStatueRootsMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)RespawnStatueRootsMaterial.shader).name), "Shader.Find(RespawnStatueRootsMaterial.shader.name)"); RespawnStatueTropicsMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)RespawnStatueTropicsMaterial.shader).name), "Shader.Find(RespawnStatueTropicsMaterial.shader.name)"); RespawnStatueShoreMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)RespawnStatueShoreMaterial.shader).name), "Shader.Find(RespawnStatueShoreMaterial.shader.name)"); RespawnStatueGloomMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)RespawnStatueGloomMaterial.shader).name), "Shader.Find(RespawnStatueGloomMaterial.shader.name)"); AmuletStatueStoneMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)AmuletStatueStoneMaterial.shader).name), "Shader.Find(AmuletStatueStoneMaterial.shader.name)"); UnnamedPetrifiedScoutMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)UnnamedPetrifiedScoutMaterial.shader).name), "Shader.Find(UnnamedPetrifiedScoutMaterial.shader.name)"); TarnishGoldAmuletMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)TarnishGoldAmuletMaterial.shader).name), "Shader.Find(TarnishGoldAmuletMaterial.shader.name)"); BingBongCrystalMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)BingBongCrystalMaterial.shader).name), "Shader.Find(BingBongCrystalMaterial.shader.name)"); GoatCrystalMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)GoatCrystalMaterial.shader).name), "Shader.Find(GoatCrystalMaterial.shader.name)"); SeagullCrystalMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)SeagullCrystalMaterial.shader).name), "Shader.Find(SeagullCrystalMaterial.shader.name)"); TurtleCrystalMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)TurtleCrystalMaterial.shader).name), "Shader.Find(TurtleCrystalMaterial.shader.name)"); UnnamedArrowTrapMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)UnnamedArrowTrapMaterial.shader).name), "Shader.Find(UnnamedArrowTrapMaterial.shader.name)"); UnnamedArrowTrapMetalMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)UnnamedArrowTrapMetalMaterial.shader).name), "Shader.Find(UnnamedArrowTrapMetalMaterial.shader.name)"); UnnamedArrowTrapDustLineMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)UnnamedArrowTrapDustLineMaterial.shader).name), "Shader.Find(UnnamedArrowTrapDustLineMaterial.shader.name)"); UnnamedGloomGraveStoneMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)UnnamedGloomGraveStoneMaterial.shader).name), "Shader.Find(UnnamedGloomGraveStoneMaterial.shader.name)"); UnnamedGloomDriftwoodMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)UnnamedGloomDriftwoodMaterial.shader).name), "Shader.Find(UnnamedGloomDriftwoodMaterial.shader.name)"); UnnamedSawbladeSpinMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)UnnamedSawbladeSpinMaterial.shader).name), "Shader.Find(UnnamedSawbladeSpinMaterial.shader.name)"); UnnamedSawbladeSpin1Material.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)UnnamedSawbladeSpin1Material.shader).name), "Shader.Find(UnnamedSawbladeSpin1Material.shader.name)"); UnnamedSawbladeFXMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)UnnamedSawbladeFXMaterial.shader).name), "Shader.Find(UnnamedSawbladeFXMaterial.shader.name)"); UnnamedSawbladeFXMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)UnnamedSawbladeFXMaterial.shader).name), "Shader.Find(UnnamedSawbladeFXMaterial.shader.name)"); UnnamedNotRenderedMaterial = peakBundle.LoadAsset<Material>("M_UnnamedNotRendered.mat"); UnnamedJetpackMetalicMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)UnnamedJetpackMetalicMaterial.shader).name), "Shader.Find(\r\n UnnamedJetpackMetalicMaterial.shader.name)"); UnnamedJetpackShellMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)UnnamedJetpackShellMaterial.shader).name), "Shader.Find(UnnamedJetpackShellMaterial.shader.name)"); UnnamedJetpackDecalsMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)UnnamedJetpackDecalsMaterial.shader).name), "Shader.Find(UnnamedJetpackDecalsMaterial.shader.name)"); UnnamedRocketpackMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)UnnamedRocketpackMaterial.shader).name), "Shader.Find(UnnamedRocketpackMaterial.shader.name)"); UnnamedRopeScoutCannonMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)UnnamedRopeScoutCannonMaterial.shader).name), "Shader.Find(UnnamedRopeScoutCannonMaterial.shader.name)"); UnnamedRocketpackRopeMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)UnnamedRocketpackRopeMaterial.shader).name), "Shader.Find(UnnamedRocketpackRopeMaterial.shader.name)"); UnnamedRocketpackLogoMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)UnnamedRocketpackLogoMaterial.shader).name), "Shader.Find(UnnamedRocketpackLogoMaterial.shader.name)"); UnnamedBelltowerFireMaterial.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)UnnamedBelltowerFireMaterial.shader).name), "Shader.Find(\r\n UnnamedBelltowerFireMaterial.shader.name)"); Log.LogInfo((object)("Added material named " + ((Object)SmallLuggageMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)SmallLuggageInteriorMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)EpicLuggageMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)LargeLuggageMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)ClownLuggageMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)LargeLuggageInteriorMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)ClownLuggageInteriorMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)AncientLuggageMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)AncientLuggageMetalMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)AncientLuggageCrystalMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)RespawnStatueRockVFXMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)RespawnStatueCalderaMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)RespawnStatueAlpineMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)RespawnStatueMesaMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)RespawnStatueRootsMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)RespawnStatueTropicsMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)RespawnStatueShoreMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)AmuletStatueStoneMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)UnnamedPetrifiedScoutMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)TarnishGoldAmuletMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)BingBongCrystalMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)GoatCrystalMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)SeagullCrystalMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)TurtleCrystalMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)UnnamedArrowTrapMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)UnnamedArrowTrapMetalMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)UnnamedArrowTrapDustLineMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)UnnamedGloomGraveStoneMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)UnnamedGloomDriftwoodMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)UnnamedSawbladeSpinMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)UnnamedSawbladeSpin1Material).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)UnnamedSawbladeFXMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)UnnamedNotRenderedMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)UnnamedJetpackMetalicMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)UnnamedJetpackShellMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)UnnamedRocketpackMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)UnnamedRopeScoutCannonMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)UnnamedRocketpackRopeMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)UnnamedBelltowerFireMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)UnnamedJetpackDecalsMaterial).name + ".")); Log.LogInfo((object)("Added material named " + ((Object)UnnamedRocketpackLogoMaterial).name + ".")); List<ushort> list2 = new List<ushort>(46) { 0, 1, 2, 7, 115, 17, 18, 24, 106, 27, 29, 32, 152, 99, 33, 70, 35, 42, 43, 44, 58, 98, 61, 62, 100, 63, 64, 65, 107, 66, 67, 71, 104, 73, 168, 192, 171, 174, 173, 169, 176, 157, 180, 182, 179, 170 }; int num4 = 0; Item val22 = default(Item); for (int count = list2.Count; num4 < count; num4++) { ushort num5 = list2[num4]; if (ItemDatabase.TryGetItem(num5, ref val22)) { string text3 = val22.UIData.itemName; GameObject go = GenerateInstancedVariant(((Component)val22).gameObject, CleanItemName(((Object)((Component)val22).gameObject).name)); Item it = go.gameObject.GetComponent<Item>(); CopyUnnamedMaterials(ref go, peakBundle); CopyUnnamedIcons(ref it, peakBundle); PopulateUnnamedData(ref it, peakBundle); CopyExplosionData(ref it, peakBundle); SetAmuletGlowToUnnamed(ref it); LootData component4 = go.gameObject.GetComponent<LootData>(); Object.Destroy((Object)(object)component4); if (num5 == 157) { text3 += "_Vanilla"; GameObject gameObject2 = ((Component)it).gameObject; ((Object)gameObject2).name = ((Object)gameObject2).name + "_vanilla"; } AddItemToDatabase(text3, go.gameObject); if (text3 == "Lantern") { GameObject gameObject3 = ((Component)it).gameObject; ((Object)gameObject3).name = ((Object)gameObject3).name + "_lant"; } new ItemContent(it).Register(ModDefinition.GetOrCreate(((BaseUnityPlugin)this).Info)); } } BigUnnamedLuggagePrefab = GenerateUnnamedLuggagePrefab("0_Items/LuggageBig"); SmallUnnamedLuggagePrefab = GenerateUnnamedLuggagePrefab("0_Items/LuggageSmall"); EpicUnnamedLuggagePrefab = GenerateUnnamedLuggagePrefab("0_Items/LuggageEpic"); AncientUnnamedLuggagePrefab = GenerateUnnamedLuggagePrefab("0_Items/LuggageAncient"); ClownUnnamedLuggagePrefab = GenerateUnnamedLuggagePrefab("0_Items/LuggageClown"); TrickUnnamedLuggagePrefab = GenerateUnnamedLuggagePrefab("0_Items/LuggageTrick"); UnnamedBingBongAmuletPackaging = peakBundle.LoadAsset<GameObject>("UnnamedBingBongAmuletPackaging.prefab"); UnnamedGoatAmuletPackaging = peakBundle.LoadAsset<GameObject>("UnnamedGoatAmuletPackaging.prefab"); UnnamedSeagullAmuletPackaging = peakBundle.LoadAsset<GameObject>("UnnamedSeagullAmuletPackaging.prefab"); UnnamedTurtleAmuletPackaging = peakBundle.LoadAsset<GameObject>("UnnamedTurtleAmuletPackaging.prefab"); ShaderExtensions.ReplaceShaders(UnnamedBingBongAmuletPackaging); ShaderExtensions.ReplaceShaders(UnnamedGoatAmuletPackaging); ShaderExtensions.ReplaceShaders(UnnamedSeagullAmuletPackaging); ShaderExtensions.ReplaceShaders(UnnamedTurtleAmuletPackaging); GameObject val23 = peakBundle.LoadAsset<GameObject>("UnnamedAirportSetup.prefab"); ShaderExtensions.ReplaceShaders(val23); TextMeshProUGUI componentInChildren2 = val23.GetComponentInChildren<TextMeshProUGUI>(true); ((TMP_Text)componentInChildren2).font = DarumaDropOne; ((TMP_Text)componentInChildren2).lineSpacing = -50f; Material val24 = (((Graphic)componentInChildren2).material = DarumaDropOneShadowMaterial); item = (((TMP_Text)componentInChildren2).fontMaterial = val24); ((TMP_Text)componentInChildren2).fontSharedMaterial = item; LocalizedText orAddComponent20 = ExtGameObject.GetOrAddComponent<LocalizedText>(((Component)componentInChildren2).gameObject); orAddComponent20.fontStyle = (FontStyle)1; orAddComponent20.index = "KIOSK_READY_TEXT"; orAddComponent20.tmp = (TMP_Text)(object)componentInChildren2; orAddComponent20.autoSet = true; UnnamedKioskSetup = val23; GameObject val26 = peakBundle.LoadAsset<GameObject>("UnnamedBrokenStandee.prefab"); ShaderExtensions.ReplaceShaders(val26); UnnamedBrokenStandeeSetup = val26; NoodleifiedScoutPrefab = GenerateNoodleifiedScoutPrefab("PetrifiedScout", peakBundle); peakBundle.Mod.RegisterContent(); Log.LogInfo((object)"Unnamed items are loaded!"); }); BundleLoader.LoadBundleWithName((BaseUnityPlugin)(object)this, "unnamedui.peakbundle", (Action<PeakBundle>)delegate(PeakBundle bundle) { GameObject val2 = bundle.LoadAsset<GameObject>("UnnamedGarbageBagWheel.prefab"); UnnamedGarbageBagScreen unnamedGarbageBagScreen = val2.AddComponent<UnnamedGarbageBagScreen>(); ((UIWheel)unnamedGarbageBagScreen).maxCursorDistance = 190f; unnamedGarbageBagScreen.chosenItemText = ((Component)((Component)unnamedGarbageBagScreen).transform.Find("SelectedItemName")).GetComponent<TextMeshProUGUI>(); unnamedGarbageBagScreen.currentlyHeldItem = ((Component)((Component)unnamedGarbageBagScreen).transform.Find("HeldItem")).GetComponent<RawImage>(); ShaderExtensions.ReplaceShaders(val2); int i = 0; BackpackWheelSlice val3 = default(BackpackWheelSlice); BackpackWheelSlice val4 = default(BackpackWheelSlice); for (int childCount = val2.transform.Find("Wheel").childCount; i < childCount; i++) { Transform child = val2.transform.Find("Wheel").GetChild(i); if (((Object)child).name == "UI_PickupZone") { UnnamedGarbageBagZone orAddComponent = ExtGameObject.GetOrAddComponent<UnnamedGarbageBagZone>(((Component)child).gameObject); orAddComponent.image = ((Component)((Component)orAddComponent).transform.Find("Segment")).GetComponentInChildren<RawImage>(); ((UIWheelSlice)orAddComponent).button = ((Component)orAddComponent).GetComponent<Button>(); unnamedGarbageBagScreen.pickupZone = orAddComponent; if (((Component)child).gameObject.TryGetComponent<BackpackWheelSlice>(ref val3)) { Object.Destroy((Object)(object)val3); } } else { UnnamedGarbageBagZone orAddComponent2 = ExtGameObject.GetOrAddComponent<UnnamedGarbageBagZone>(((Component)child).gameObject); orAddComponent2.image = ((Component)((Component)orAddComponent2).transform.Find("Segment")).GetComponentInChildren<RawImage>(); ((UIWheelSlice)orAddComponent2).button = ((Component)orAddComponent2).GetComponent<Button>(); unnamedGarbageBagScreen.garbageBagZones = CollectionExtensions.AddToArray<UnnamedGarbageBagZone>(unnamedGarbageBagScreen.garbageBagZones, orAddComponent2); if (((Component)child).gameObject.TryGetComponent<BackpackWheelSlice>(ref val4)) { Object.Destroy((Object)(object)val4); } } } UnnamedGarbageBagPrefab = ((Component)unnamedGarbageBagScreen).gameObject; bundle.Mod.RegisterContent(); Log.LogInfo((object)"Garbage Bag UI is loaded!"); }); Harmony val = new Harmony("com.github.MiiMii1205.UnnamedProducts"); if (Unnamed4FoodCompatibility.enabled) { Unnamed4FoodCompatibility.LoadCompatibilityBundle(this); } if (UnnamedCanadianCompatibility.enabled) { UnnamedCanadianCompatibility.LoadCompatibilityBundle(this); } if (UnnamedLuckyBlocksCompatibility.enabled) { UnnamedLuckyBlocksCompatibility.LoadCompatibilityBundle(this, val); } val.PatchAll(typeof(UnnamedItemPatcher)); val.PatchAll(typeof(UnnamedPatcher)); val.PatchAll(typeof(UnnamedSpawnerPatcher)); Log.LogInfo((object)("Plugin " + Name + " is loaded!")); } private static string CleanItemName(string dirtyName) { return dirtyName.Replace(_modInfoPrefix, "").Replace("(Clone)", "").Replace("(Instanced)", ""); } private GameObject GenerateUnnamedLuggagePrefab(string normalPrefabName) { GameObject val = Object.Instantiate<GameObject>(Resources.Load<GameObject>(normalPrefabName)); LuggageBrandHandler luggageBrandHandler = val.AddComponent<LuggageBrandHandler>(); luggageBrandHandler.shouldBeUnnamed = true; luggageBrandHandler.luggage = val.GetComponent<Luggage>(); val.SetActive(false); Object.DontDestroyOnLoad((Object)(object)val); return RegisterOrGetNetworkPrefab(val); } private GameObject GenerateNoodleifiedScoutPrefab(string normalPrefabName, PeakBundle peakBundle) { //IL_0106: 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) GameObject val = Object.Instantiate<GameObject>(Resources.Load<GameObject>(normalPrefabName)); Material val2 = peakBundle.LoadAsset<Material>("M_UnnamedDaggerPoolNoodle.mat"); val2.shader = Shader.Find(((Object)val2.shader).name); Material val3 = peakBundle.LoadAsset<Material>("M_UnnamedDaggerHandle.mat"); val3.shader = Shader.Find(((Object)val2.shader).name); Material val4 = peakBundle.LoadAsset<Material>("M_UnnamedDaggerPlastic.mat"); val4.shader = Shader.Find(((Object)val2.shader).name); MeshFilter[] componentsInChildren = val.GetComponentsInChildren<MeshFilter>(true); MeshCollider val7 = default(MeshCollider); foreach (MeshFilter val5 in componentsInChildren) { if (((Object)((Component)val5).gameObject).name == "Blade") { Mesh sharedMesh = (val5.mesh = peakBundle.LoadAsset<Mesh>("UnnamedDagger.fbx")); Renderer component = ((Component)val5).gameObject.GetComponent<Renderer>(); component.SetMaterials(new List<Material>(3) { val3, val4, val2 }); ((Component)val5).transform.localRotation = new Quaternion(0.61237246f, 0.3535534f, -0.3535534f, 0.61237246f); ((Component)val5).transform.localScale = new Vector3(16.62455f, 16.62455f, 16.62455f); if (((Component)val5).gameObject.TryGetComponent<MeshCollider>(ref val7)) { val7.sharedMesh = sharedMesh; } } } Renderer[] componentsInChildren2 = val.GetComponentsInChildren<Renderer>(true); foreach (Renderer val8 in componentsInChildren2) { Material[] materials = val8.materials; int k = 0; for (int num = materials.Length; k < num; k++) { Material[] array = materials; int num2 = k; string text = CleanedName(((Object)materials[k]).name); Material val9 = ((!(text == "M_Petrified_Stone_Char")) ? materials[k] : val2); array[num2] = val9; } Renderer val10 = val8; Material[] array2 = materials; List<Material> list = new List<Material>(array2.Length); Material[] array3 = array2; foreach (Material val9 in array3) { list.Add(val9); } val10.SetMaterials(list); } val.SetActive(false); Object.DontDestroyOnLoad((Object)(object)val); return RegisterOrGetNetworkPrefab(val); } public GameObject RegisterOrGetNetworkPrefab(GameObject prefab, string folder = "") { string text = ((Object)prefab).name.Split(":").Last(); string text2 = folder + ModDefinition.GetOrCreate(((BaseUnityPlugin)this).Info).Id + ":" + text; if (NetworkPrefabManager.TryRegisterNetworkPrefab(text2, prefab)) { ((Object)prefab).name = text2; return prefab; } GameObject val = default(GameObject); if (NetworkPrefabManager.TryGetNetworkPrefab(text2, ref val) && (Object)(object)val != (Object)null) { return val; } throw new Exception("Failed to get network prefab!"); } public GameObject RegisterOrGetItemPrefab(GameObject prefab) { RegisterOrGetNetworkPrefab(prefab, "0_Items/"); ((Object)prefab).name = ((Object)prefab).name.Replace("0_Items/", ""); return prefab; } public static void RenameToUnnamed(GameObject ob, bool withPrefix = true) { ((Object)ob).name = NameToUnnamed(((Object)ob).name, withPrefix); } public static string NameToUnnamed(string name, bool withPrefix = true) { return ModDefinition.GetOrCreate(UnnamedInfo).Id + ":" + (withPrefix ? "Unnamed" : "") + name.Replace("Unnamed", ""); } public void CopyExplosionData(ref Item newIt, PeakBundle peakBundle) { ItemCooking val = default(ItemCooking); if (((Component)newIt).gameObject.TryGetComponent<ItemCooking>(ref val) && Object.op_Implicit((Object)(object)val.explosionPrefab)) { GameObject val2 = Object.Instantiate<GameObject>(val.explosionPrefab); ((Object)val2).name = "Unnamed" + ((Object)val.explosionPrefab).name.Replace("Unnamed", ""); AOE componentInChildren = val2.GetComponentInChildren<AOE>(); if (componentInChildren != null && !IsUnnamed(((Component)componentInChildren).gameObject)) { RenameToUnnamed(((Component)componentInChildren).gameObject); } val.explosionPrefab = RegisterOrGetNetworkPrefab(val2); Object.DontDestroyOnLoad((Object)(object)val2); val2.SetActive(false); } Breakable val3 = default(Breakable); if (!((Component)newIt).gameObject.TryGetComponent<Breakable>(ref val3)) { return; } for (int i = 0; i < val3.instantiateNonItemOnBreak.Count; i++) { GameObject val4 = Object.Instantiate<GameObject>(val3.instantiateNonItemOnBreak[i]); ((Object)val4).name = "Unnamed" + ((Object)val3.instantiateNonItemOnBreak[i]).name.Replace("Unnamed", ""); AOE componentInChildren2 = val4.GetComponentInChildren<AOE>(); if (componentInChildren2 != null && !IsUnnamed(((Component)componentInChildren2).gameObject)) { RenameToUnnamed(((Component)componentInChildren2).gameObject); } val3.instantiateNonItemOnBreak[i] = RegisterOrGetNetworkPrefab(val4); Object.DontDestroyOnLoad((Object)(object)val4); val4.SetActive(false); } } private static void CheckForStickyFireballs(Item item, Character chara) { if (Object.op_Implicit((Object)(object)item)) { StickyFireballController componentInChildren = ((Component)item).GetComponentInChildren<StickyFireballController>(); if (componentInChildren != null && componentInChildren.m_isBurning) { StickyFireballController.Burn(chara.GetBodypart((BodypartType)(((double)Random.value > 0.5) ? 7 : 10))); } } } public void PopulateUnnamedData(ref Item it, PeakBundle peakBundle) { //IL_11a4: Unknown result type (might be due to invalid IL or missing references) //IL_11ba: Unknown result type (might be due to invalid IL or missing references) //IL_11df: Unknown result type (might be due to invalid IL or missing references) //IL_19c9: Unknown result type (might be due to invalid IL or missing references) //IL_19ee: Unknown result type (might be due to invalid IL or missing references) //IL_1a0e: Unknown result type (might be due to invalid IL or missing references) //IL_1053: Unknown result type (might be due to invalid IL or missing references) //IL_1069: Unknown result type (might be due to invalid IL or missing references) //IL_108e: Unknown result type (might be due to invalid IL or missing references) //IL_1328: Unknown result type (might be due to invalid IL or missing references) //IL_133e: Unknown result type (might be due to invalid IL or missing references) //IL_1363: Unknown result type (might be due to invalid IL or missing references) //IL_1bf2: Unknown result type (might be due to invalid IL or missing references) //IL_1bf7: Unknown result type (might be due to invalid IL or missing references) //IL_1c1c: Unknown result type (might be due to invalid IL or missing references) //IL_1c21: Unknown result type (might be due to invalid IL or missing references) //IL_1c26: Unknown result type (might be due to invalid IL or missing references) //IL_1c30: Expected O, but got Unknown //IL_1c59: Unknown result type (might be due to invalid IL or missing references) //IL_1c5e: Unknown result type (might be due to invalid IL or missing references) //IL_1c63: Unknown result type (might be due to invalid IL or missing references) //IL_1c6d: Expected O, but got Unknown //IL_1c96: Unknown result type (might be due to invalid IL or missing references) //IL_1c9b: Unknown result type (might be due to invalid IL or missing references) //IL_1ca0: Unknown result type (might be due to invalid IL or missing references) //IL_1caa: Expected O, but got Unknown //IL_1cd3: Unknown result type (might be due to invalid IL or missing references) //IL_1cd8: Unknown result type (might be due to invalid IL or missing references) //IL_1cdd: Unknown result type (might be due to invalid IL or missing references) //IL_1ce7: Expected O, but got Unknown //IL_1d10: Unknown result type (might be due to invalid IL or missing references) //IL_1d15: Unknown result type (might be due to invalid IL or missing references) //IL_1d1a: Unknown result type (might be due to invalid IL or missing references) //IL_1d24: Expected O, but got Unknown //IL_1dbb: Unknown result type (might be due to invalid IL or missing references) //IL_1dc0: Unknown result type (might be due to invalid IL or missing references) //IL_0b96: Unknown result type (might be due to invalid IL or missing references) //IL_0bac: Unknown result type (might be due to invalid IL or missing references) //IL_0bd1: Unknown result type (might be due to invalid IL or missing references) //IL_21f3: Unknown result type (might be due to invalid IL or missing references) //IL_21f8: Unknown result type (might be due to invalid IL or missing references) //IL_1ecd: Unknown result type (might be due to invalid IL or missing references) //IL_1ee3: Unknown result type (might be due to invalid IL or missing references) //IL_1f08: Unknown result type (might be due to invalid IL or missing references) //IL_1f6e: Unknown result type (might be due to invalid IL or missing references) //IL_16d5: Unknown result type (might be due to invalid IL or missing references) //IL_16da: Unknown result type (might be due to invalid IL or missing references) //IL_16ff: Unknown result type (might be due to invalid IL or missing references) //IL_1704: Unknown result type (might be due to invalid IL or missing references) //IL_1709: Unknown result type (might be due to invalid IL or missing references) //IL_1713: Expected O, but got Unknown //IL_173c: Unknown result type (might be due to invalid IL or missing references) //IL_1741: Unknown result type (might be due to invalid IL or missing references) //IL_1746: Unknown result type (might be due to invalid IL or missing references) //IL_1750: Expected O, but got Unknown //IL_1779: Unknown result type (might be due to invalid IL or missing references) //IL_177e: Unknown result type (might be due to invalid IL or missing references) //IL_1783: Unknown result type (might be due to invalid IL or missing references) //IL_178d: Expected O, but got Unknown //IL_17b6: Unknown result type (might be due to invalid IL or missing references) //IL_17bb: Unknown result type (might be due to invalid IL or missing references) //IL_17c0: Unknown result type (might be due to invalid IL or missing references) //IL_17ca: Expected O, but got Unknown //IL_17f3: Unknown result type (might be due to invalid IL or missing references) //IL_17f8: Unknown result type (might be due to invalid IL or missing references) //IL_17fd: Unknown result type (might be due to invalid IL or missing references) //IL_1807: Expected O, but got Unknown //IL_18a6: Unknown result type (might be due to invalid IL or missing references) //IL_18ab: Unknown result type (might be due to invalid IL or missing references) //IL_206d: Unknown result type (might be due to invalid IL or missing references) //IL_2098: Unknown result type (might be due to invalid IL or missing references) //IL_20c3: Unknown result type (might be due to invalid IL or missing references) //IL_2ab3: Unknown result type (might be due to invalid IL or missing references) //IL_2ab8: Unknown result type (might be due to invalid IL or missing references) //IL_2add: Unknown result type (might be due to invalid IL or missing references) //IL_2ae2: Unknown result type (might be due to invalid IL or missing references) //IL_2ae7: Unknown result type (might be due to invalid IL or missing references) //IL_2af1: Expected O, but got Unknown //IL_2b1a: Unknown result type (might be due to invalid IL or missing references) //IL_2b1f: Unknown result type (might be due to invalid IL or missing references) //IL_2b24: Unknown result type (might be due to invalid IL or missing references) //IL_2b2e: Expected O, but got Unknown //IL_2b57: Unknown result type (might be due to invalid IL or missing references) //IL_2b5c: Unknown result type (might be due to invalid IL or missing references) //IL_2b61: Unknown result type (might be due to invalid IL or missing references) //IL_2b6b: Expected O, but got Unknown //IL_2b94: Unknown result type (might be due to invalid IL or missing references) //IL_2b99: Unknown result type (might be due to invalid IL or missing references) //IL_2b9e: Unknown result type (might be due to invalid IL or missing references) //IL_2ba8: Expected O, but got Unknown //IL_2bd1: Unknown result type (might be due to invalid IL or missing references) //IL_2bd6: Unknown result type (might be due to invalid IL or missing references) //IL_2bdb: Unknown result type (might be due to invalid IL or missing references) //IL_2be5: Expected O, but got Unknown //IL_2c39: Unknown result type (might be due to invalid IL or missing references) //IL_2c3e: Unknown result type (might be due to invalid IL or missing references) //IL_2cbc: Unknown result type (might be due to invalid IL or missing references) //IL_2ccd: Unknown result type (might be due to invalid IL or missing references) //IL_2cde: Unknown result type (might be due to invalid IL or missing references) //IL_20f4: Unknown result type (might be due to invalid IL or missing references) //IL_20fb: Expected O, but got Unknown //IL_214d: Unknown result type (might be due to invalid IL or missing references) //IL_2172: Unknown result type (might be due to invalid IL or missing references) //IL_2702: Unknown result type (might be due to invalid IL or missing references) //IL_2707: Unknown result type (might be due to invalid IL or missing references) //IL_14b1: Unknown result type (might be due to invalid IL or missing references) //IL_14b6: Unknown result type (might be due to invalid IL or missing references) //IL_14bf: Unknown result type (might be due to invalid IL or missing references) //IL_14c4: Unknown result type (might be due to invalid IL or missing references) //IL_14cd: Unknown result type (might be due to invalid IL or missing references) //IL_14d2: Unknown result type (might be due to invalid IL or missing references) //IL_14f7: Unknown result type (might be due to invalid IL or missing references) //IL_14fc: Unknown result type (might be due to invalid IL or missing references) //IL_10f1: Unknown result type (might be due to invalid IL or missing references) //IL_1107: Unknown result type (might be due to invalid IL or missing references) //IL_112c: Unknown result type (might be due to invalid IL or missing references) //IL_2751: Unknown result type (might be due to invalid IL or missing references) //IL_2756: Unknown result type (might be due to invalid IL or missing references) //IL_22eb: Unknown result type (might be due to invalid IL or missing references) //IL_230b: Unknown result type (might be due to invalid IL or missing references) //IL_2806: Unknown result type (might be due to invalid IL or missing references) //IL_280b: Unknown result type (might be due to invalid IL or missing references) //IL_2823: Unknown result type (might be due to invalid IL or missing references) //IL_2843: Unknown result type (might be due to invalid IL or missing references) //IL_284d: Unknown result type (might be due to invalid IL or missing references) //IL_073c: Unknown result type (might be due to invalid IL or missing references) //IL_0752: Unknown result type (might be due to invalid IL or missing references) //IL_0777: Unknown result type (might be due to invalid IL or missing references) //IL_0eff: Unknown result type (might be due to invalid IL or missing references) //IL_0f15: Unknown result type (might be due to invalid IL or missing references) //IL_0f3a: Unknown result type (might be due to invalid IL or missing references) //IL_09fe: Unknown result type (might be due to invalid IL or missing references) //IL_04d8: Unknown result type (might be due to invalid IL or missing references) //IL_04ee: Unknown result type (might be due to invalid IL or missing references) //IL_0513: Unknown result type (might be due to invalid IL or missing references) //IL_062d: Unknown result type (might be due to invalid IL or missing references) //IL_0632: Unknown result type (might be due to invalid IL or missing references) //IL_063b: Unknown result type (might be due to invalid IL or missing references) //IL_0640: Unknown result type (might be due to invalid IL or missing references) //IL_0673: Unknown result type (might be due to invalid IL or missing references) //IL_0678: Unknown result type (might be due to invalid IL or missing references) //IL_0fcb: Unknown result type (might be due to invalid IL or missing references) //IL_0fe1: Unknown result type (might be due to invalid IL or missing references) //IL_1006: Unknown result type (might be due to invalid IL or missing references) //IL_27db: Unknown result type (might be due to invalid IL or missing references) //IL_27e0: Unknown result type (might be due to invalid IL or missing references) //IL_27e6: Unknown result type (might be due to invalid IL or missing references) //IL_27eb: Unknown result type (might be due to invalid IL or missing references) //IL_27f9: Unknown result type (might be due to invalid IL or missing references) //IL_05a0: Unknown result type (might be due to invalid IL or missing references) //IL_05b6: Unknown result type (might be due to invalid IL or missing references) //IL_05db: Unknown result type (might be due to invalid IL or missing references) string itemName = it.UIData.itemName; if (itemName == null) { return; } RopeShooter component12; UnnamedRopeShooter orAddComponent16; GameObject go4; RopeAnchorWithRope component13; GameObject go5; RopeBoneVisualizer component14; AudioSource orAddComponent17; UnnamedRopeBreaker orAddComponent18; RopeSpool orAddComponent19; UnnamedRopeSpool orAddComponent20; GameObject val30; GameObject val31; RopeTier orAddComponent21; GameObject val32; GameObject val33; RopeBoneVisualizer component15; AudioSource orAddComponent22; UnnamedRopeBreaker orAddComponent23; RopeAudio componentInChildren3; StatusField componentInChildren5; switch (itemName.Length) { case 7: switch (itemName[0]) { default: return; case 'F': if (itemName == "Frisbee") { Frisbee component5 = ((Component)it).GetComponent<Frisbee>(); UnnamedFrisbeeItem orAddComponent11 = ExtGameObject.GetOrAddComponent<UnnamedFrisbeeItem>(((Component)it).gameObject); orAddComponent11.frisbee = component5; orAddComponent11.originalLiftForce = component5.liftForce; orAddComponent11.originalVelocityForLift = component5.velocityForLift; } return; case 'P': { if (!(itemName == "Parasol")) { return; } Parasol component6 = ((Component)it).gameObject.GetComponent<Parasol>(); UnnamedParasol orAddComponent12 = ExtGameObject.GetOrAddComponent<UnnamedParasol>(((Component)it).gameObject); ((MonoBehaviour)(object)component6).CopyTo((MonoBehaviour)(object)orAddComponent12); Action_Parasol orAddComponent13 = ExtGameObject.GetOrAddComponent<Action_Parasol>(((Component)it).gameObject); orAddComponent13.parasol = (Parasol)(object)orAddComponent12; MeshFilter[] componentsInChildren7 = ((Component)it).GetComponentsInChildren<MeshFilter>(true); foreach (MeshFilter val24 in componentsInChildren7) { string name = ((Object)((Component)val24).gameObject).name; if (name == "Parasol Open") { GameObject gameObject = ((Component)val24).gameObject; Object.DestroyImmediate((Object)(object)val24); Object.DestroyImmediate((Object)(object)gameObject.GetComponent<Collider>()); GameObject val25 = peakBundle.LoadAsset<GameObject>("UnnamedParasolOpened.prefab"); GameObject val26 = Object.Instantiate<GameObject>(val25, gameObject.transform, false); Renderer component7 = gameObject.GetComponent<Renderer>(); Renderer component8 = val26.GetComponent<Renderer>(); component8.materials = component7.materials; component8.sharedMaterials = component7.sharedMaterials; Object.DestroyImmediate((Object)(object)component7); val26.transform.localPosition = Vector3.zero; val26.transform.localScale = ExtDataTypes.ToVec(1f); val26.transform.localRotation = new Quaternion(0.7071068f, -3.7252903E-09f, -1.0104486E-09f, 0.7071068f); } if (name == "Parasol Closed") { GameObject gameObject2 = ((Component)val24).gameObject; Object.DestroyImmediate((Object)(object)val24); Object.DestroyImmediate((Object)(object)gameObject2.GetComponent<Collider>()); GameObject val27 = peakBundle.LoadAsset<GameObject>("UnnamedParasolClosed.prefab"); GameObject val28 = Object.Instantiate<GameObject>(val27, gameObject2.transform, false); Renderer component9 = gameObject2.GetComponent<Renderer>(); Renderer component10 = val28.GetComponent<Renderer>(); component10.materials = component9.materials; component10.sharedMaterials = component9.sharedMaterials; Object.DestroyImmediate((Object)(object)component9); val28.transform.localPosition = Vector3.zero; val28.transform.localScale = ExtDataTypes.ToVec(1f); val28.transform.localRotation = new Quaternion(0.7071068f, -3.7252903E-09f, -1.0104486E-09f, 0.7071068f); } } Object.Destroy((Object)(object)component6); return; } case 'B': { if (!(itemName == "Blowgun")) { return; } MeshFilter[] componentsInChildren6 = ((Component)it).GetComponentsInChildren<MeshFilter>(true); foreach (MeshFilter val22 in componentsInChildren6) { if (((Object)((Component)val22).gameObject).name == "Blowgun") { Mesh mesh = (val22.sharedMesh = peakBundle.LoadAsset<Mesh>("UnnamedBlowgun.fbx")); val22.mesh = mesh; } } return; } case 'L': break; case 'J': if (itemName == "Jetpack") { JetpackItem orAddComponent9 = ExtGameObject.GetOrAddComponent<JetpackItem>(((Component)it).gameObject); UnnamedJetpackItem orAddComponent10 = ExtGameObject.GetOrAddComponent<UnnamedJetpackItem>(((Component)it).gameObject); ((MonoBehaviour)(object)orAddComponent9).CopyTo((MonoBehaviour)(object)orAddComponent10); SetupJetpackModels(((Component)it).gameObject); orAddComponent10.originalStartingFuel = orAddComponent9.startingFuel; ((JetpackItem)orAddComponent10).fuel = orAddComponent9.fuel; Object.Destroy((Object)(object)orAddComponent9); } return; } if (!(itemName == "Lantern")) { break; } goto IL_12ba; case 14: switch (itemName[5]) { case 'b': { if (!(itemName == "Portable Stove")) { return; } Constructable component16 = ((Component)it).GetComponent<Constructable>(); GameObject go8 = Object.Instantiate<GameObject>(component16.constructedPrefab); ((Object)go8).name = "Unnamed" + ((Object)component16.constructedPrefab).name; Object.DontDestroyOnLoad((Object)(object)go8); GameObject val39 = peakBundle.LoadAsset<GameObject>("UnnamedStovePaint.prefab"); MeshFilter[] componentsInChildren9 = go8.GetComponentsInChildren<MeshFilter>(true); MeshCollider val41 = default(MeshCollider); foreach (MeshFilter val40 in componentsInChildren9) { if (((Object)((Component)val40).gameObject).name == "Cube" && ((Component)val40).TryGetComponent<MeshCollider>(ref val41)) { GameObject val42 = Object.Instantiate<GameObject>(val39, ((Component)val40).transform.parent, false); val42.transform.localPosition = Vector3.zero; val42.transform.localScale = ExtDataTypes.ToVec(3.827086f); val42.transform.localRotation = new Quaternion(0f, 0f, 0f, 1f); ShaderExtensions.ReplaceShaders(val42); } } MeshFilter[] componentsInChildren10 = ((Component)it).GetComponentsInChildren<MeshFilter>(true); foreach (MeshFilter val43 in componentsInChildren10) { if (((Object)((Component)val43).gameObject).name == "Cube" && ((Component)val43).TryGetComponent<MeshCollider>(ref val41)) { GameObject val44 = Object.Instantiate<GameObject>(val39, ((Component)val43).transform.parent, false); val44.transform.localPosition = new Vector3(0f, 0f, -4.950033E-05f); val44.transform.localScale = ExtDataTypes.ToVec(3.827086f); val44.transform.localRotation = new Quaternion(0f, 0f, 0f, 1f); ShaderExtensions.ReplaceShaders(val44); } } go8.SetActive(false); CopyUnnamedMaterials(ref go8, peakBundle); Campfire component17 = go8.GetComponent<Campfire>(); UnnamedCampfire orAddComponent28 = ExtGameObject.GetOrAddComponent<UnnamedCampfire>(go8); ((MonoBehaviour)(object)component17).CopyTo((MonoBehaviour)(object)orAddComponent28); ((Campfire)orAddComponent28).advanceToSegment = component17.advanceToSegment; ((Campfire)orAddComponent28)._state = component17._state; ((Campfire)orAddComponent28).currentlyCookingItem = component17.currentlyCookingItem; ((Campfire)orAddComponent28).mainRenderer = component17.mainRenderer; ((Campfire)orAddComponent28).startRot = component17.startRot; ((Campfire)orAddComponent28).startSize = component17.startSize; ((Campfire)orAddComponent28).fireHasStarted = component17.fireHasStarted; ((Campfire)orAddComponent28).view = component17.view; ((Campfire)orAddComponent28)._timebuffLastApplied = component17._timebuffLastApplied; ((Campfire)orAddComponent28).safeZone = component17.safeZone; ((Campfire)orAddComponent28)._charactersInRadius = component17._charactersInRadius; Object.Destroy((Object)(object)component17); go8 = RegisterOrGetNetworkPrefab(go8); component16.constructedPrefab = go8; return; } case 'f': { if (!(itemName == "Fortified Milk")) { return; } MeshFilter[] componentsInChildren11 = ((Component)it).GetComponentsInChildren<MeshFilter>(true); foreach (MeshFilter val45 in componentsInChildren11) { if (((Object)((Component)val45).gameObject).name == "Milk") { Mesh mesh = (val45.sharedMesh = peakBundle.LoadAsset<Mesh>("UnnamedMilk.fbx")); val45.mesh = mesh; } } return; } case 'e': break; case 'T': if (itemName == "AMULET_HEALING") { Action_HealingGem component18 = ((Component)it).gameObject.GetComponent<Action_HealingGem>(); ((Affliction_Invincibility)component18.invincibilityAffliction).gold.a = -2f; } return; case ' ': { if (!(itemName == "Chain Launcher")) { return; } VineShooter orAddComponent24 = ExtGameObject.GetOrAddComponent<VineShooter>(((Component)it).gameObject); UnnamedVineShooter orAddComponent25 = ExtGameObject.GetOrAddComponent<UnnamedVineShooter>(((Component)it).gameObject); orAddComponent25.baseReach = orAddComponent24.maxLength; ((MonoBehaviour)(object)orAddComponent24).CopyTo((MonoBehaviour)(object)orAddComponent25); ((VineShooter)orAddComponent25).actionReduceUses = orAddComponent24.actionReduceUses; GameObject go6 = Object.Instantiate<GameObject>(orAddComponent24.vinePrefab); ((Object)go6).name = "Unnamed" + ((Object)orAddComponent24.vinePrefab).name.Replace("Unnamed", ""); Object.DontDestroyOnLoad((Object)(object)go6); CopyUnnamedMaterials(ref go6, peakBundle); Renderer[] componentsInChildren8 = ((Component)it).gameObject.GetComponentsInChildren<Renderer>(true); foreach (Renderer val34 in componentsInChildren8) { if (!(((Object)((Component)val34).gameObject).name == "Rope")) { continue; } Material[] materials3 = val34.materials; int num5 = 0; for (int num6 = materials3.Length; num5 < num6; num5++) { string text = ((Object)materials3[num5]).name.Replace("(Instance)", "").Replace("(Clone)", "").Trim(); if (text == "M_RopeSpike") { Material val35 = peakBundle.LoadAsset<Material>("M_UnnamedChainShooterChains.mat"); val35.shader = ThrowHelper.ThrowIfArgumentNull<Shader>(Shader.Find(((Object)val35.shader).name), "Shader.Find(unnamedMaterial.shader.name)"); materials3[num5] = val35; } } Renderer val36 = val34; Material[] array = materials3; List<Material> list = new List<Material>(array.Length); Material[] array2 = array; foreach (Material item in array2) { list.Add(item); } val36.SetMaterials(list); } go6.SetActive(false); AudioSource orAddComponent26 = ExtGameObject.GetOrAddComponent<AudioSource>(go6); orAddComponent26.priority = 128; orAddComponent26.volume = 0.125f; orAddComponent26.pitch = 1f; orAddComponent26.reverbZoneMix = 1f; orAddComponent26.rolloffMode = (AudioRolloffMode)2; orAddComponent26.spatialBlend = 1f; orAddComponent26.dopplerLevel = 0.25f; orAddComponent26.maxDistance = 120f; orAddComponent26.minDistance = 39.1865f; orAddComponent26.SetCustomCurve((AudioSourceCurveType)0, new AnimationCurve((Keyframe[])(object)new Keyframe[2] { new Keyframe(0.0067737103f, 1f, -3.1092653f, -3.1092653f, 0f, 0.04103275f), new Keyframe(1f, 0f, 0.020448748f, 0.020448748f, 0.13781565f, 0f) })); orAddComponent26.SetCustomCurve((AudioSourceCurveType)1, new AnimationCurve((Keyframe[])(object)new Keyframe[1] { new Keyframe(0f, 1f, 0f, 0f, 1f / 3f, 1f / 3f) })); orAddComponent26.SetCustomCurve((AudioSourceCurveType)1, new AnimationCurve((Keyframe[])(object)new Keyframe[1] { new Keyframe(0f, 1f, 0f, 0f, 1f / 3f, 1f / 3f) })); orAddComponent26.SetCustomCurve((AudioSourceCurveType)3, new AnimationCurve((Keyframe[])(object)new Keyframe[1] { new Keyframe(0f, 0f, 0f, 0f, 1f / 3f, 1f / 3f) })); orAddComponent26.SetCustomCurve((AudioSourceCurveType)2, new AnimationCurve((Keyframe[])(object)new Keyframe[1] { new Keyframe(0f, 1f, 0f, 0f, 1f / 3f, 1f / 3f) })); orAddComponent26.loop = true; orAddComponent26.resource = peakBundle.LoadAsset<AudioResource>("Au_ChainLoop.ogg"); orAddComponent26.playOnAwake = false; UnnamedVine orAddComponent27 = ExtGameObject.GetOrAddComponent<UnnamedVine>(go6); orAddComponent27.breakPoint = 0.4f; orAddComponent27.breakChance = 0.25f; orAddComponent27.axisMul = new Vector3(2f, 1f, 0f); orAddComponent27.shakeScale = 33f; orAddComponent27.fallTime = 3f; orAddComponent27.amount = 0.1f; orAddComponent27.startShakeDistance = 30.87f; orAddComponent27.startShakeAmount = 10f; orAddComponent27.climbingScreenShake = 5f; orAddComponent27.screenShakeTickTime = 0.2f; GameObject val37 = peakBundle.LoadAsset<GameObject>("VFX_ChainBreak.prefab"); GameObject go7 = Object.Instantiate<GameObject>(val37, ((Component)orAddComponent27).transform, false); go7.transform.localPosition = Vector3.zero; go7.transform.localRotation = Quaternion.identity; go7.transform.localScale = Vector3.one; ShaderExtensions.ReplaceShaders(go7); CopyUnnamedMaterials(ref go7, peakBundle); orAddComponent27.breakParticles = ((Component)go7.transform.GetChild(0)).GetComponent<ParticleSystem>(); orAddComponent27.breakSfx = (SFX_Instance[])(object)new SFX_Instance[2] { peakBundle.LoadAsset<SFX_Instance>("SFXI Break Coconut 1.asset"), peakBundle.LoadAsset<SFX_Instance>("SFXI Bridge Break 4.asset") }; orAddComponent27.fullMesh = ((Component)orAddComponent27).transform.GetChild(0).GetChild(0); SFX_Instance[] sfxs = go6.GetComponent<SFX_PlayOneShot>().sfxs; foreach (SFX_Instance val38 in sfxs) { if (((Object)val38).name == "SFXI ChainLauncher 4") { orAddComponent27.breakSfx = CollectionExtensions.AddToArray<SFX_Instance>(orAddComponent27.breakSfx, val38); } } Object.Destroy((Object)(object)orAddComponent24); go6 = RegisterOrGetNetworkPrefab(go6); ((VineShooter)orAddComponent25).vinePrefab = go6; return; } default: return; } if (!(itemName == "Faerie Lantern")) { break; } goto IL_12ba; case 12: switch (itemName[6]) { case 'e': { if (!(itemName == "Airline Food")) { break; } MeshFilter[] componentsInChildren15 = ((Component)it).GetComponentsInChildren<MeshFilter>(true); foreach (MeshFilter val58 in componentsInChildren15) { if (((Object)val58.mesh).name == "plastic") { val58.mesh = peakBundle.LoadAsset<Mesh>("UnnamedAirplaneFoodPackaging.fbx"); ((Component)val58).transform.localPosition = new Vector3(0f, 0f, 0.27986586f); ((Component)val58).transform.localScale = ExtDataTypes.ToVec(3.436053f); ((Component)val58).transform.localRotation = new Quaternion(-0.7071067f, 2.0861626E-07f, -1.1920929E-07f, -0.70710695f); } } break; } case 'C': { if (!(itemName == "Scout Cannon")) { break; } Constructable component20 = ((Component)it).GetComponent<Constructable>(); MeshFilter[] componentsInChildren12 = ((Component)it).GetComponentsInChildren<MeshFilter>(true); foreach (MeshFilter val47 in componentsInChildren12) { if (((Object)((Component)val47).gameObject).name == "Rend") { Mesh mesh = (val47.sharedMesh = peakBundle.LoadAsset<Mesh>("UnnamedCannon.fbx")); val47.mesh = mesh; } } GameObject go10 = Object.Instantiate<GameObject>(component20.constructedPrefab); ((Object)go10).name = "Unnamed" + ((Object)component20.constructedPrefab).name; MeshFilter[] componentsInChildren13 = go10.GetComponentsInChildren<MeshFilter>(true); foreach (MeshFilter val49 in componentsInChildren13) { if (((Object)((Component)val49).gameObject).name == "CannonFeet") { Mesh mesh = (val49.sharedMesh = peakBundle.LoadAsset<Mesh>("UnnamedCannonFeets.fbx")); val49.mesh = mesh; ((Component)val49).transform.localRotation = Quaternion.identity; } if (((Object)((Component)val49).gameObject).name == "Rend") { Mesh mesh = (val49.sharedMesh = peakBundle.LoadAsset<Mesh>("UnnamedCannonBody.fbx")); val49.mesh = mesh; } if (((Object)((Component)val49).gameObject).name == "Rend2") { Mesh mesh = (val49.sharedMesh = peakBundle.LoadAsset<Mesh>("UnnamedCannonInnerWall.fbx")); val49.mesh = mesh; } } Object.DontDestroyOnLoad((Object)(object)go10); go10.SetActive(false); CopyUnnamedMaterials(ref go10, peakBundle); ScoutCannon component21 = go10.GetComponent<ScoutCannon>(); UnnamedScoutCannon orAddComponent30 = ExtGameObject.GetOrAddComponent<UnnamedScoutCannon>(go10); ((MonoBehaviour)(object)component21).CopyTo((MonoBehaviour)(object)orAddComponent30); ((ScoutCannon)orAddComponent30).mpb = component21.mpb; ((ScoutCannon)orAddComponent30).view = component21.view; ((ScoutCannon)orAddComponent30).tube = component21.tube; ((ScoutCannon)orAddComponent30).entry = component21.entry; ((ScoutCannon)orAddComponent30).target = component21.target; ((ScoutCannon)orAddComponent30).targetID = component21.targetID; ((ScoutCannon)orAddComponent30).characters = component21.characters; ((ScoutCannon)orAddComponent30)._mr = component21._mr; ScoutCannonFuse componentInChildren4 = go10.GetComponentInChildren<ScoutCannonFuse>(); GameObject go11 = ((Component)componentInChildren4).gameObject; CopyUnnamedMaterials(ref go11, peakBundle); componentInChildren4.scoutCannon = (ScoutCannon)(object)orAddComponent30; Object.Destroy((Object)(object)component21); go10 = RegisterOrGetNetworkPrefab(go10); component20.constructedPrefab = go10; break; } case 'l': if (itemName == "Big Lollipop") { GameObject val59 = peakBundle.LoadAsset<GameObject>("UnnamedPitonPackaging.prefab"); GameObject val60 = Object.Instantiate<GameObject>(val59, ((Component)it.mainRenderer).transform.parent, false); val60.transform.localPosition = new Vector3(0f, 10.51f, -0.06f); val60.transform.localScale = ExtDataTypes.ToVec(18.1f); val60.transform.localRotation = new Quaternion(0f, 0.7071068f, 0f, 0.7071068f); Renderer val61 = default(Renderer); if (val60.TryGetComponent<Renderer>(ref val61)) { val61.SetMaterials(new List<Material>(1) { peakBundle.LoadAsset<Material>("M_UnnamedLollypopWrapper.mat") }); } it.addtlRenderers = CollectionExtensions.AddToArray<Renderer>(it.addtlRenderers, val60.GetComponent<Renderer>()); } break; case 'E': if (itemName == "Scout Effigy") { ScoutEffigy orAddComponent33 = ExtGameObject.GetOrAddComponent<ScoutEffigy>(((Component)it).gameObject); UnnamedScoutEffigy orAddComponent34 = ExtGameObject.GetOrAddComponent<UnnamedScoutEffigy>(((Component)it).gameObject); GameO