using System; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using BepInEx; using BepInEx.Configuration; using CSync.Extensions; using CSync.Lib; using LethalLib.Modules; using Microsoft.CodeAnalysis; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("hsrcardboardcutouts")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("hsrcardboardcutouts")] [assembly: AssemblyTitle("hsrcardboardcutouts")] [assembly: AssemblyVersion("1.0.0.0")] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte P_0) { NullableFlags = new byte[1] { P_0 }; } public NullableAttribute(byte[] P_0) { NullableFlags = P_0; } } [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte P_0) { Flag = P_0; } } } namespace HSRCardboardCutouts { [BepInPlugin("CraftyGlitches.HSRCardboardcutouts", "HSR Cardboard Cutouts", "1.2.1")] public class Plugin : BaseUnityPlugin { private const string GUID = "CraftyGlitches.HSRCardboardcutouts"; private const string NAME = "HSR Cardboard Cutouts"; private const string VERSION = "1.2.1"; public static Plugin Instance; public static CardboardCutoutConfig config; public static List ItemAssets = new List { "Assets/Scrap/blade/blade cutout.asset", "Assets/Scrap/aventurine/aventurine cutout.asset", "Assets/Scrap/sunday/sunday cutout.asset", "Assets/Scrap/permansor/permansor cutout.asset", "Assets/Scrap/castorice/castorice cutout.asset", "Assets/Scrap/cyrene/cyrene cutout.asset", "Assets/Scrap/firefly/firefly cutout.asset", "Assets/Scrap/jingliu/jingliu cutout.asset", "Assets/Scrap/phainon/phainon cutout.asset", "Assets/Scrap/robin/robin cutout.asset", "Assets/Scrap/welt/welt cutout.asset", "Assets/Scrap/jing yuan/jingyuan cutout.asset", "Assets/Scrap/evanescia/evanescia cutout.asset", "Assets/Scrap/ashveil/ashveil cutout.asset", "Assets/Scrap/imbibitor/imbibitor cutout.asset", "Assets/Scrap/fugue/fugue cutout.asset", "Assets/Scrap/serval/serval cutout.asset", "Assets/Scrap/shane/shane cutout.asset", "Assets/Scrap/blade base/bladebase cutout.asset", "Assets/Scrap/acheron/acheron cutout.asset", "Assets/Scrap/anaxa/anaxa cutout.asset", "Assets/Scrap/mydei/mydei cutout.asset", "Assets/Scrap/cyrenestand/cyrenetpose cutout.asset", "Assets/Scrap/phainon collab/phainoncollab cutout.asset", "Assets/Scrap/ratio/ratio cutout.asset", "Assets/Scrap/seele/seele cutout.asset", "Assets/Scrap/hysilens/hysilens cutout.asset", "Assets/Scrap/cerydra/cerydra cutout.asset", "Assets/Scrap/kafka/kafka cutout.asset", "Assets/Scrap/yaoguang/yaoguang cutout.asset", "Assets/Scrap/jiaoqiu/jiaoqiu cutout.asset", "Assets/Scrap/mina/mina cutout.asset", "Assets/Scrap/argenti/argenti cutout.asset", "Assets/Scrap/aglaea/aglaea cutout.asset", "Assets/Scrap/sparkle/sparkle cutout.asset", "Assets/Scrap/rappa/rappa cutout.asset" }; public static List ItemList; private void Awake() { Instance = this; ItemList = new List(); string text = Path.Combine(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "hsrcardboardcutouts"); AssetBundle val = AssetBundle.LoadFromFile(text); foreach (string itemAsset in ItemAssets) { Item val2 = val.LoadAsset(itemAsset); if ((Object)(object)val2 == (Object)null) { Debug.LogError((object)(itemAsset + " is not accessible, please check your asset path again")); } else { ItemList.Add(val2); } } config = new CardboardCutoutConfig(((BaseUnityPlugin)this).Config); foreach (KeyValuePair> item in CardboardCutoutConfig.ItemRarity) { RegisterCardboardCutouts(item.Key, SyncedEntry.op_Implicit(item.Value)); ValidateShopItem(item.Key); } ((BaseUnityPlugin)this).Logger.LogInfo((object)"CraftyGlitches.HSRCardboardcutouts is loaded ! Lets go find some cardboard!"); } public static void RemovePostProcessing(GameObject spawnPrefab) { if (!((Object)(object)spawnPrefab != (Object)null)) { return; } MeshRenderer[] componentsInChildren = spawnPrefab.GetComponentsInChildren(); MeshRenderer[] array = componentsInChildren; MeshRenderer[] array2 = array; foreach (MeshRenderer val in array2) { Material[] materials = ((Renderer)val).materials; foreach (Material val2 in materials) { if (val2.renderQueue < 3000) { val2.renderQueue = 2900; } } } } private void RegisterCardboardCutouts(Item item, int value) { GameObject spawnPrefab = item.spawnPrefab; RemovePostProcessing(spawnPrefab); NetworkPrefabs.RegisterNetworkPrefab(spawnPrefab); Utilities.FixMixerGroups(spawnPrefab); if (item.itemName == "nonetest") { Items.RegisterScrap(item, value, (LevelTypes)12288); } else { Items.RegisterScrap(item, value, (LevelTypes)(-1)); } } private void ValidateShopItem(Item item) { List list = new List { "Blade Cutout", "Aventurine Cutout" }; if (!list.Contains(item.itemName)) { return; } TerminalNode val = ScriptableObject.CreateInstance(); val.clearPreviousText = true; string text = "Budget has been too low lately for ACTUAL models so we got very high quality cardboard replacements for your viewing pleasure!"; string itemName = item.itemName; string text2 = itemName; if (!(text2 == "Blade Cutout")) { if (text2 == "Aventurine Cutout") { val.displayText = text + "Ran out of budget for the real aventurine, gamble to your hearts content with the totally real aventurine watching you!"; } } else { val.displayText = text + "Of five people three will drink tea!"; } Items.RegisterShopItem(item, (TerminalNode)null, (TerminalNode)null, val, Mathf.FloorToInt((float)Random.Range(100, 150))); } } public class CardboardCutoutConfig : SyncedConfig2 { [field: SyncedEntryField] public static Dictionary> ItemRarity { get; private set; } public CardboardCutoutConfig(ConfigFile config) : base("CraftyGlitches.HSRCardboardCutouts") { ItemRarity = new Dictionary>(); List list = new List { "Blade Cutout" }; foreach (Item item in Plugin.ItemList) { if (list.Contains(item.itemName)) { string itemName = item.itemName; string text = itemName; if (text == "Blade Cutout") { ItemRarity[item] = SyncedBindingExtensions.BindSyncedEntry(config, "Cardboard Cutout Rarity", item.itemName ?? "", 21, "Changing rarity value for: " + item.itemName + ".\n\nEnter your desired value.\n\nDefault is 20."); } } else { ItemRarity[item] = SyncedBindingExtensions.BindSyncedEntry(config, "Cardboard Cutout Rarity", item.itemName ?? "", 20, "Changing rarity value for: " + item.itemName + ".\n\nEnter your desired value.\n\nDefault is 20."); } } ConfigManager.Register((SyncedConfig2)(object)this); } public static void AssetLoader(List list) { } } }