Decompiled source of BazaarIsMyHomeFixed v1.3.2
plugins/BazaarIsMyHome/BazaarIsMyHome.dll
Decompiled a day 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.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 EntityStates; using EntityStates.NewtMonster; using On.EntityStates.NewtMonster; using On.RoR2; using R2API.Utils; using RoR2; using UnityEngine; using UnityEngine.Networking; using UnityEngine.SceneManagement; [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.0", FrameworkDisplayName = "")] [assembly: AssemblyCompany("BazaarIsMyHome")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("BazaarIsMyHome")] [assembly: AssemblyTitle("BazaarIsMyHome")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] namespace BazaarIsMyHome; [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.Lunzir.BazaarIsMyHome", "BazaarIsMyHome", "1.3.0")] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [R2APISubmoduleDependency(new string[] { "CommandHelper" })] public class BazaarIsMyHome : BaseUnityPlugin { internal class SpawnCardStruct { public Vector3 Position { get; set; } public Vector3 Rotation { get; set; } public Vector3? Scale { get; set; } public SpawnCardStruct(Vector3 position, Vector3 rotation, Vector3? scale = null) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) Position = position; Rotation = rotation; Scale = (Vector3)(((??)scale) ?? new Vector3(1f, 1f, 1f)); } } internal class PlayerStruct { public NetworkUser NetworkUser { get; set; } public int DonateCount { get; set; } public int RewardCount { get; set; } public PlayerStruct(NetworkUser networkUser, int donateCount, int rewardCount = 0) { NetworkUser = networkUser; DonateCount = donateCount; RewardCount = rewardCount; } } internal class SpecialItemStruct { public string Name { get; set; } public int Count { get; set; } public bool IsUse { get; set; } public SpecialItemStruct(string name, int count, bool isUse = false) { Name = name; Count = count; IsUse = isUse; } } internal class CauldronHackedStruct { public string Name { get; set; } public int Cost { get; set; } public CostTypeIndex CostTypeIndex { get; set; } public CauldronHackedStruct(string name, int cost, CostTypeIndex costTypeIndex) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) Name = name; Cost = cost; CostTypeIndex = costTypeIndex; } } public static PluginInfo PluginInfo; public static ItemHandler ItemHandler; private Random Random = new Random(); private readonly DirectorPlacementRule DirectorPlacementRule = new DirectorPlacementRule { placementMode = (PlacementMode)0 }; private Dictionary<int, SpawnCardStruct> DicPrinters = new Dictionary<int, SpawnCardStruct>(); private Dictionary<int, SpawnCardStruct> DicEquipments = new Dictionary<int, SpawnCardStruct>(); private Dictionary<int, SpawnCardStruct> DicScrapers = new Dictionary<int, SpawnCardStruct>(); private Dictionary<int, SpawnCardStruct> DicLunarPools = new Dictionary<int, SpawnCardStruct>(); private Dictionary<int, SpawnCardStruct> DicCauldrons = new Dictionary<int, SpawnCardStruct>(); private Dictionary<int, SpawnCardStruct> DicLunarShopTerminals = new Dictionary<int, SpawnCardStruct>(); private Dictionary<int, SpawnCardStruct> DicGlodChests = new Dictionary<int, SpawnCardStruct>(); private Dictionary<int, SpawnCardStruct> DicBigChests = new Dictionary<int, SpawnCardStruct>(); private Dictionary<int, SpawnCardStruct> DicSmallChests = new Dictionary<int, SpawnCardStruct>(); private int LunarShopTerminalTotalCount = 0; private List<PurchaseInteraction> ObjectLunarShopTerminals = new List<PurchaseInteraction>(); private List<PurchaseInteraction> ObjectLunarShopTerminals_Spawn = new List<PurchaseInteraction>(); private Dictionary<NetworkUserId, PlayerStruct> PlayerStructs = new Dictionary<NetworkUserId, PlayerStruct>(); private List<string> EquipmentCodes = new List<string> { "EliteEarthEquipment", "EliteFireEquipment", "EliteHauntedEquipment", "EliteIceEquipment", "EliteLightningEquipment", "ElitePoisonEquipment", "EliteVoidEquipment", "EliteLunarEquipment", "LunarPortalOnUse" }; private List<SpecialItemStruct> SpecialCodes = new List<SpecialItemStruct> { new SpecialItemStruct("BoostAttackSpeed", 10), new SpecialItemStruct("BoostDamage", 10), new SpecialItemStruct("BoostEquipmentRecharge", 10), new SpecialItemStruct("BoostHp", 10), new SpecialItemStruct("BurnNearby", 1), new SpecialItemStruct("CrippleWardOnLevel", 10), new SpecialItemStruct("CooldownOnCrit", 1), new SpecialItemStruct("EmpowerAlways", 1), new SpecialItemStruct("Ghost", 1), new SpecialItemStruct("Incubator", 3), new SpecialItemStruct("InvadingDoppelganger", 1), new SpecialItemStruct("LevelBonus", 10), new SpecialItemStruct("WarCryOnCombat", 10), new SpecialItemStruct("TempestOnKill", 10) }; private List<CauldronHackedStruct> CauldronHackedStructs = new List<CauldronHackedStruct>(); private static readonly string[] PrintersCode = new string[4] { "iscDuplicator", "iscDuplicatorLarge", "iscDuplicatorMilitary", "iscDuplicatorWild" }; private static readonly string[] LunarCauldronsCode = new string[3] { "LunarCauldron, WhiteToGreen", "LunarCauldron, GreenToRed Variant", "LunarCauldron, RedToWhite Variant" }; public void Awake() { //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Expected O, but got Unknown //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0081: Expected O, but got Unknown //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Expected O, but got Unknown //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Expected O, but got Unknown //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Expected O, but got Unknown //IL_00d1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Expected O, but got Unknown //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Expected O, but got Unknown //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00ff: Expected O, but got Unknown //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Expected O, but got Unknown //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Expected O, but got Unknown //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Expected O, but got Unknown //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Expected O, but got Unknown ModConfig.InitConfig(((BaseUnityPlugin)this).Config); PluginInfo = ((BaseUnityPlugin)this).Info; Tokens.RegisterLanguageTokens(); ItemHandler = new ItemHandler(); Run.Start += new hook_Start(Run_Start); PurchaseInteraction.OnInteractionBegin += new hook_OnInteractionBegin(PurchaseInteraction_OnInteractionBegin); PurchaseInteraction.Awake += new hook_Awake(PurchaseInteraction_Awake); ShopTerminalBehavior.SetPickupIndex += new hook_SetPickupIndex(ShopTerminalBehavior_SetPickupIndex); PurchaseInteraction.ScaleCost += new hook_ScaleCost(PurchaseInteraction_ScaleCost); PurchaseInteraction.SetAvailable += new hook_SetAvailable(PurchaseInteraction_SetAvailable); BazaarController.SetUpSeerStations += new hook_SetUpSeerStations(BazaarController_SetUpSeerStations); BazaarController.Awake += new hook_Awake(BazaarController_Awake); SceneDirector.Start += new hook_Start(SceneDirector_Start); TeleporterInteraction.Start += new hook_Start(TeleporterInteraction_Start); KickFromShop.FixedUpdate += new hook_FixedUpdate(KickFromShop_FixedUpdate); GlobalEventManager.OnHitAll += new hook_OnHitAll(GlobalEventManager_OnHitAll); CharacterMaster.OnBodyDeath += new hook_OnBodyDeath(CharacterMaster_OnBodyDeath); SpawnState.OnEnter += new hook_OnEnter(SpawnState_OnEnter); GlobalEventManager.OnCrit += new hook_OnCrit(ItemHandler.GlobalEventManager_OnCrit); CharacterBody.RecalculateStats += new hook_RecalculateStats(ItemHandler.CharacterBody_RecalculateStats); CommandHelper.AddToConsoleWhenReady(); } public void Start() { if (!ModConfig.EnableMod.Value) { return; } ShopKeep.IsDeath = false; ShopKeep.Body = null; foreach (KeyValuePair<string, PluginInfo> pluginInfo in Chainloader.PluginInfos) { if (pluginInfo.Key == "com.funkfrog_sipondo.sharesuite") { ModConfig.ShareSuite = pluginInfo.Value.Instance; } if (pluginInfo.Key == "com.MagnusMagnuson.BiggerBazaar") { ModConfig.BiggerBazaar = pluginInfo.Value.Instance; } } } public void OnDestroy() { } private void Run_Start(orig_Start orig, Run self) { if (ModConfig.EnableMod.Value) { ShopKeep.IsDeath = false; ShopKeep.Body = null; ItemHandler = new ItemHandler(); } orig.Invoke(self); } private void PurchaseInteraction_OnInteractionBegin(orig_OnInteractionBegin orig, PurchaseInteraction self, Interactor activator) { //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) if (ModConfig.EnableMod.Value && IsCurrentMapInBazaar()) { if (((Object)self).name.StartsWith("ShrineHealing")) { NetworkUser val = Util.LookUpBodyNetworkUser(((Component)activator).gameObject); CharacterMaster master = ((Component)activator).GetComponent<CharacterBody>().master; CharacterBody component = ((Component)activator).GetComponent<CharacterBody>(); Inventory inventory = component.inventory; PlayerStructs.TryGetValue(val.id, out var value); if (value == null) { value = new PlayerStruct(val, 1); PlayerStructs.Add(val.id, value); ChatHelper.ThanksTip(val, component); } else { value.DonateCount++; if (value.DonateCount % 10 == 0) { value.RewardCount++; if (value.RewardCount <= ModConfig.RewardCount.Value) { GiftReward(self, val, component, inventory); } } } if (value.DonateCount <= ModConfig.RewardCount.Value * 10) { SpawnEffect("Prefabs/Effects/ShrineUseEffect", ((Component)self).transform.position, new Color32((byte)64, (byte)127, byte.MaxValue, byte.MaxValue), 5f); val.DeductLunarCoins((uint)self.Networkcost); } return; } if (((Object)self).name.StartsWith("LunarCauldron, RedToWhite Variant") && IsMultiplayer() && ModConfig.IsShareSuite_PrinterCauldronFixEnabled()) { Inventory inventory2 = ((Component)activator).GetComponent<CharacterBody>().inventory; ShopTerminalBehavior component2 = ((Component)self).GetComponent<ShopTerminalBehavior>(); inventory2.GiveItem(PickupCatalog.GetPickupDef(component2.CurrentPickupIndex()).itemIndex, 2); } if (((Object)self).name.StartsWith("LunarRecycler")) { float num = 1f; foreach (PurchaseInteraction item in ObjectLunarShopTerminals_Spawn) { ((MonoBehaviour)this).StartCoroutine(DelayEffect(self, item, num)); num += 0.1f; } } } orig.Invoke(self, activator); } private void GiftReward(PurchaseInteraction self, NetworkUser networkUser, CharacterBody characterBody, Inventory inventory) { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_0208: Unknown result type (might be due to invalid IL or missing references) //IL_020a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_023a: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Invalid comparison between Unknown and I4 //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0278: Unknown result type (might be due to invalid IL or missing references) //IL_0293: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02c7: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_018d: Unknown result type (might be due to invalid IL or missing references) //IL_0192: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00cd->IL00cd: Incompatible stack types: O vs I4 //IL_00c6->IL00cd: Incompatible stack types: I4 vs O //IL_00c6->IL00cd: Incompatible stack types: O vs I4 float value = ModConfig.PrayNormalWeight.Value; float value2 = ModConfig.PrayEliteWeight.Value; float value3 = ModConfig.PrayPeculiarWeight.Value; double num = Random.NextDouble() * (double)(value + value2 + value3); if (num <= (double)value) { WeightedSelection<List<PickupIndex>> val = new WeightedSelection<List<PickupIndex>>(8); val.AddChoice(Run.instance.availableTier1DropList, 100f); val.AddChoice(Run.instance.availableTier2DropList, 60f); val.AddChoice(Run.instance.availableTier3DropList, 10f); List<PickupIndex> list = val.Evaluate(Random.value); PickupDef pickupDef = PickupCatalog.GetPickupDef(list[Random.Range(0, list.Count)]); object obj = inventory; int num2; if (pickupDef != null) { obj = pickupDef.itemIndex; num2 = (int)obj; } else { num2 = -1; obj = num2; num2 = (int)obj; } ((Inventory)num2).GiveItem((ItemIndex)obj, 1); PurchaseInteraction.CreateItemTakenOrb(((Component)self).gameObject.transform.position, ((Component)characterBody).gameObject, pickupDef.itemIndex); ChatHelper.ThanksTip(networkUser, characterBody, pickupDef); } else if (num <= (double)(value + value2)) { string text = EquipmentCodes[Random.Next(EquipmentCodes.Count)]; EquipmentIndex val2 = EquipmentCatalog.FindEquipmentIndex(text); EquipmentIndex equipmentIndex = inventory.GetEquipmentIndex(); EquipmentDef equipmentDef = EquipmentCatalog.GetEquipmentDef(val2); if ((int)equipmentIndex != -1) { PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(equipmentIndex), ((Component)characterBody).gameObject.transform.position + Vector3.up * 1.5f, Vector3.up * 20f + ((Component)self).transform.forward * 2f); } inventory.SetEquipmentIndex(val2); ChatHelper.ThanksTip(networkUser, characterBody, equipmentDef); } else { SpecialItemStruct specialItemStruct = SpecialCodes[Random.Next(SpecialCodes.Count)]; ItemIndex val3 = ItemCatalog.FindItemIndex(specialItemStruct.Name); ItemDef itemDef = ItemCatalog.GetItemDef(val3); inventory.GiveItem(itemDef, specialItemStruct.Count); PurchaseInteraction.CreateItemTakenOrb(((Component)self).gameObject.transform.position, ((Component)characterBody).gameObject, val3); ChatHelper.ThanksTip(networkUser, characterBody, itemDef, specialItemStruct.Count); } SpawnEffect("prefabs/effects/levelupeffect", ((Component)self).transform.position, new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), 3f); SpawnEffect("prefabs/effects/moneypackpickupeffect", ((Component)self).transform.position, new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), 3f); SpawnEffect("prefabs/effects/teamwarcryactivation", ((Component)self).transform.position, new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), 3f); } private IEnumerator DelayEffect(PurchaseInteraction self, PurchaseInteraction interaction, float time) { yield return (object)new WaitForSeconds(time); RerollLunarShopTerminal(self, interaction); } private static void RerollLunarShopTerminal(PurchaseInteraction self, PurchaseInteraction interaction) { //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) WeightedSelection<List<PickupIndex>> val = new WeightedSelection<List<PickupIndex>>(8); val.AddChoice(Run.instance.availableLunarItemDropList, 50f); val.AddChoice(Run.instance.availableLunarEquipmentDropList, 50f); List<PickupIndex> list = val.Evaluate(Random.value); PickupDef pickupDef = PickupCatalog.GetPickupDef(list[Random.Range(0, list.Count)]); ShopTerminalBehavior component = ((Component)interaction).gameObject.GetComponent<ShopTerminalBehavior>(); component.SetPickupIndex(pickupDef.pickupIndex, false); SpawnEffect("prefabs/effects/lunarrerolleffect", ((Component)interaction).gameObject.transform.position + Vector3.up * 1f, new Color32(byte.MaxValue, byte.MaxValue, byte.MaxValue, byte.MaxValue), 2f); } private void PurchaseInteraction_ScaleCost(orig_ScaleCost orig, PurchaseInteraction self, float scalar) { if (ModConfig.EnableMod.Value) { if (((Object)self).name.StartsWith("LunarRecycler") && ModConfig.EnableLunarRecyclerInjection.Value && ModConfig.LunarRecyclerAvailable.Value) { scalar = ModConfig.LunarRecyclerRerollScalar.Value; } if (((Object)self).name.StartsWith("ShrineRestack") && ModConfig.EnableShrineRestack.Value) { scalar = ModConfig.ShrineRestackScalar.Value; } } orig.Invoke(self, scalar); } private void PurchaseInteraction_SetAvailable(orig_SetAvailable orig, PurchaseInteraction self, bool newAvailable) { if (ModConfig.EnableMod.Value && ((Object)self).name.StartsWith("LunarRecycler") && ModConfig.EnableLunarRecyclerInjection.Value && ModConfig.LunarRecyclerAvailable.Value) { if (ModConfig.RerolledCount < ModConfig.LunarRecyclerRerollCount.Value) { orig.Invoke(self, true); } else { orig.Invoke(self, false); } ModConfig.RerolledCount++; } else { orig.Invoke(self, newAvailable); } } private void BazaarController_SetUpSeerStations(orig_SetUpSeerStations orig, BazaarController self) { if (ModConfig.EnableMod.Value) { if (ModConfig.EnableSeerStationsInjection.Value || ModConfig.PenaltyCoefficient_Temp != 1) { SeerStationController[] seerStations = self.seerStations; foreach (SeerStationController val in seerStations) { ((Component)val).GetComponent<PurchaseInteraction>().available = ModConfig.SeerStationAvailable.Value; if (ModConfig.SeerStationAvailable.Value) { ((Component)val).GetComponent<PurchaseInteraction>().cost = ModConfig.SeerStationsCost.Value * ModConfig.PenaltyCoefficient_Temp; ((Component)val).GetComponent<PurchaseInteraction>().Networkcost = ModConfig.SeerStationsCost.Value * ModConfig.PenaltyCoefficient_Temp; } } } else if (ModConfig.PenaltyCoefficient_Temp != 1) { SeerStationController[] seerStations2 = self.seerStations; foreach (SeerStationController val2 in seerStations2) { PurchaseInteraction component = ((Component)val2).GetComponent<PurchaseInteraction>(); component.cost *= ModConfig.PenaltyCoefficient_Temp; PurchaseInteraction component2 = ((Component)val2).GetComponent<PurchaseInteraction>(); component2.Networkcost *= ModConfig.PenaltyCoefficient_Temp; } } } orig.Invoke(self); } private void BazaarController_Awake(orig_Awake orig, BazaarController self) { if (ModConfig.EnableMod.Value) { ((BaseUnityPlugin)this).Config.Reload(); ModConfig.InitConfig(((BaseUnityPlugin)this).Config); SetCaudronList_Hacked(); ShopKeep.SpawnTime_Record = 0; ModConfig.RerolledCount = 0; if (ModConfig.EnableShrineHealing.Value) { InitPrayData(); } if (NetworkServer.active) { ArtifactDef val = ArtifactCatalog.FindArtifactDef("Sacrifice"); bool flag = false; if (RunArtifactManager.instance.IsArtifactEnabled(val)) { flag = true; RunArtifactManager.instance.SetArtifactEnabledServer(val, false); } PlayerStructs.Clear(); SpawnPrinters(); SpawnLunarCauldron(); SpawnScrapper(); SpawnEquipment(); SpawnLunarShopTerminal(); SpawnShrineCleanse(); SpawnShrineRestack(); SpawnShrineHealing(); SpawnDecorate(); if (flag) { RunArtifactManager.instance.SetArtifactEnabledServer(val, true); } } } orig.Invoke(self); } private void InitPrayData() { SpecialCodes.ForEach(delegate(SpecialItemStruct x) { x.IsUse = false; }); string[] array = ModConfig.PrayPeculiarList.Value.Split(new char[1] { ',' }); for (int i = 0; i < array.Length; i++) { string code = array[i].Trim().ToLower(); SpecialItemStruct specialItemStruct = SpecialCodes.FirstOrDefault((SpecialItemStruct x) => x.Name.ToLower() == code); specialItemStruct.IsUse = true; } } private void PurchaseInteraction_Awake(orig_Awake orig, PurchaseInteraction self) { //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_040a: Unknown result type (might be due to invalid IL or missing references) //IL_03f3: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (!ModConfig.EnableMod.Value || !IsCurrentMapInBazaar()) { return; } if (ModConfig.CauldronCount.Value > 0) { if (ModConfig.EnableCauldronHacking.Value || ModConfig.PenaltyCoefficient_Temp != 1) { double num = Random.NextDouble(); if (((Object)self).name.StartsWith("LunarCauldron, WhiteToGreen")) { self.cost = ModConfig.CauldronWhiteToGreenCost.Value * ModConfig.PenaltyCoefficient_Temp; self.Networkcost = ModConfig.CauldronWhiteToGreenCost.Value * ModConfig.PenaltyCoefficient_Temp; if (num <= (double)ModConfig.CauldronGreenHackedChance.Value && ModConfig.EnableCauldronHacking.Value) { CauldronHacked_Start(self, LunarCauldronsCode[0], "LunarCauldronGreen"); } } if (((Object)self).name.StartsWith("LunarCauldron, GreenToRed")) { self.cost = ModConfig.CauldronGreenToRedCost.Value * ModConfig.PenaltyCoefficient_Temp; self.Networkcost = ModConfig.CauldronGreenToRedCost.Value * ModConfig.PenaltyCoefficient_Temp; if (num <= (double)ModConfig.CauldronRedHackedChance.Value && ModConfig.EnableCauldronHacking.Value) { CauldronHacked_Start(self, LunarCauldronsCode[1], "LunarCauldronRed"); } } if (((Object)self).name.StartsWith("LunarCauldron, RedToWhite")) { self.cost = ModConfig.CauldronRedToWhiteCost.Value * ModConfig.PenaltyCoefficient_Temp; self.Networkcost = ModConfig.CauldronRedToWhiteCost.Value * ModConfig.PenaltyCoefficient_Temp; if (ModConfig.CauldronWhiteCostTypeChange.Value) { self.costType = (CostTypeIndex)5; } if (num <= (double)ModConfig.CauldronWhiteHackedChance.Value && ModConfig.EnableCauldronHacking.Value) { CauldronHacked_Start(self, LunarCauldronsCode[2], "LunarCauldronWhite"); } } } } else if (ModConfig.PenaltyCoefficient_Temp != 1 && (((Object)self).name.StartsWith("LunarCauldron, WhiteToGreen") || ((Object)self).name.StartsWith("LunarCauldron, GreenToRed") || ((Object)self).name.StartsWith("LunarCauldron, RedToWhite"))) { self.cost *= ModConfig.PenaltyCoefficient_Temp; self.Networkcost = self.cost * ModConfig.PenaltyCoefficient_Temp; } if (ModConfig.PrinterCount.Value > 0 && (((Object)self).name.StartsWith("Duplicator") || ((Object)self).name.StartsWith("DuplicatorLarge") || ((Object)self).name.StartsWith("DuplicatorMilitary") || ((Object)self).name.StartsWith("DuplicatorWild"))) { float value = ModConfig.PrinterTier1Weight.Value; float value2 = ModConfig.PrinterTier2Weight.Value; float value3 = ModConfig.PrinterTier3Weight.Value; float value4 = ModConfig.PrinterTierBossWeight.Value; float value5 = ModConfig.PrinterTierLunarWeight.Value; float value6 = ModConfig.PrinterTierVoidWeight.Value; float num2 = value + value2 + value3 + value4 + value5 + value6; if (num2 != 0f) { double num3 = Random.NextDouble() * (double)num2; if (!(num3 <= (double)value) && !(num3 <= (double)(value + value2)) && !(num3 <= (double)(value + value2 + value3)) && !(num3 <= (double)(value + value2 + value3 + value4))) { if (num3 <= (double)(value + value2 + value3 + value4 + value5)) { ((Object)self).name = "DuplicatorBlue"; self.costType = (CostTypeIndex)9; } else { ((Object)self).name = "DuplicatorPurple"; self.costType = (CostTypeIndex)6; } } } } if (ModConfig.EquipmentCount.Value > 0 && ((Object)self).name.StartsWith("MultiShopEquipmentTerminal")) { self.cost = 0; self.Networkcost = 0; } if (ModConfig.LunarShopTerminalCount.Value > 0) { if ((ModConfig.EnableLunarShopTerminalInjection.Value || ModConfig.PenaltyCoefficient_Temp != 1) && (((Object)self).name.StartsWith("LunarShopTerminal") || ((Object)self).name.StartsWith("MyLunarBud"))) { self.cost = ModConfig.LunarShopTerminalCost.Value * ModConfig.PenaltyCoefficient_Temp; self.Networkcost = ModConfig.LunarShopTerminalCost.Value * ModConfig.PenaltyCoefficient_Temp; } } else if (ModConfig.PenaltyCoefficient_Temp != 1 && (((Object)self).name.StartsWith("LunarShopTerminal") || ((Object)self).name.StartsWith("MyLunarBud"))) { self.cost *= ModConfig.PenaltyCoefficient_Temp; self.Networkcost = self.cost * ModConfig.PenaltyCoefficient_Temp; } if (((Object)self).name.StartsWith("LunarShopTerminal") && LunarShopTerminalTotalCount < 5) { ObjectLunarShopTerminals.Add(self); } if (ModConfig.EnableLunarRecyclerInjection.Value || ModConfig.PenaltyCoefficient_Temp != 1) { if (((Object)self).name.StartsWith("LunarRecycler")) { self.available = ModConfig.LunarRecyclerAvailable.Value; self.Networkavailable = ModConfig.LunarRecyclerAvailable.Value; if (ModConfig.LunarRecyclerAvailable.Value) { self.cost = ModConfig.LunarRecyclerRerollCost.Value * ModConfig.PenaltyCoefficient_Temp; self.Networkcost = ModConfig.LunarRecyclerRerollCost.Value * ModConfig.PenaltyCoefficient_Temp; } } } else if (ModConfig.PenaltyCoefficient_Temp != 1 && ((Object)self).name.StartsWith("LunarRecycler")) { self.cost *= ModConfig.PenaltyCoefficient_Temp; self.Networkcost = self.cost * ModConfig.PenaltyCoefficient_Temp; } } private void CauldronHacked_Start(PurchaseInteraction self, string oldName, string newName) { //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) float value = ModConfig.CauldronYellowWeight.Value; float value2 = ModConfig.CauldronBlueWeight.Value; float value3 = ModConfig.CauldronPurpleWeight.Value; float num = value + value2 + value3; double num2 = Random.NextDouble() * (double)num; CauldronHackedStruct cauldronHackedStruct = null; if (num2 <= (double)value) { cauldronHackedStruct = CauldronHackedStructs.FirstOrDefault((CauldronHackedStruct x) => x.Name.StartsWith(newName) && x.Name.EndsWith("Yellow")); ((Object)self).name = cauldronHackedStruct.Name; self.cost = cauldronHackedStruct.Cost; self.Networkcost = cauldronHackedStruct.Cost; self.costType = cauldronHackedStruct.CostTypeIndex; } else if (num2 <= (double)(value + value2)) { cauldronHackedStruct = CauldronHackedStructs.FirstOrDefault((CauldronHackedStruct x) => x.Name.StartsWith(newName) && x.Name.EndsWith("Blue")); ((Object)self).name = cauldronHackedStruct.Name; self.cost = cauldronHackedStruct.Cost; self.Networkcost = cauldronHackedStruct.Cost; self.costType = cauldronHackedStruct.CostTypeIndex; } else { cauldronHackedStruct = CauldronHackedStructs.FirstOrDefault((CauldronHackedStruct x) => x.Name.StartsWith(newName) && x.Name.EndsWith("Purple")); ((Object)self).name = cauldronHackedStruct.Name; self.cost = cauldronHackedStruct.Cost; self.Networkcost = cauldronHackedStruct.Cost; self.costType = cauldronHackedStruct.CostTypeIndex; } } private void ShopTerminalBehavior_SetPickupIndex(orig_SetPickupIndex orig, ShopTerminalBehavior self, PickupIndex newPickupIndex, bool newHidden) { //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01dc: Unknown result type (might be due to invalid IL or missing references) if (ModConfig.EnableMod.Value && IsCurrentMapInBazaar()) { if (((Object)self).name.StartsWith("LunarCauldronGreen")) { CauldronHacked_SetPickupIndex(self, out var listLunarItem); newPickupIndex = listLunarItem[Random.Next(0, listLunarItem.Count)]; orig.Invoke(self, newPickupIndex, newHidden); } if (((Object)self).name.StartsWith("LunarCauldronRed")) { CauldronHacked_SetPickupIndex(self, out var listLunarItem2); newPickupIndex = listLunarItem2[Random.Next(0, listLunarItem2.Count)]; orig.Invoke(self, newPickupIndex, newHidden); } if (((Object)self).name.StartsWith("LunarCauldronWhite")) { CauldronHacked_SetPickupIndex(self, out var listLunarItem3); newPickupIndex = listLunarItem3[Random.Next(0, listLunarItem3.Count)]; orig.Invoke(self, newPickupIndex, newHidden); } if (((Object)self).name.StartsWith("DuplicatorBlue")) { List<PickupIndex> availableLunarItemDropList = Run.instance.availableLunarItemDropList; newPickupIndex = availableLunarItemDropList[Random.Range(0, availableLunarItemDropList.Count)]; orig.Invoke(self, newPickupIndex, newHidden); } if (((Object)self).name.StartsWith("DuplicatorPurple")) { WeightedSelection<List<PickupIndex>> val = new WeightedSelection<List<PickupIndex>>(8); val.AddChoice(Run.instance.availableVoidTier1DropList, 25f); val.AddChoice(Run.instance.availableVoidTier2DropList, 25f); val.AddChoice(Run.instance.availableVoidTier3DropList, 25f); val.AddChoice(Run.instance.availableVoidBossDropList, 25f); List<PickupIndex> list = val.Evaluate(Random.value); newPickupIndex = list[Random.Range(0, list.Count)]; orig.Invoke(self, newPickupIndex, newHidden); } } orig.Invoke(self, newPickupIndex, newHidden); } private void CauldronHacked_SetPickupIndex(ShopTerminalBehavior self, out List<PickupIndex> listLunarItem) { listLunarItem = new List<PickupIndex>(); if (((Object)self).name.EndsWith("Yellow")) { listLunarItem.AddRange(Run.instance.availableBossDropList); } if (((Object)self).name.EndsWith("Blue")) { listLunarItem.AddRange(Run.instance.availableLunarItemDropList); } if (((Object)self).name.EndsWith("Purple")) { listLunarItem.AddRange(Run.instance.availableVoidTier1DropList); listLunarItem.AddRange(Run.instance.availableVoidTier2DropList); listLunarItem.AddRange(Run.instance.availableVoidTier3DropList); listLunarItem.AddRange(Run.instance.availableVoidBossDropList); } } private void SceneDirector_Start(orig_Start orig, SceneDirector self) { if (ModConfig.EnableMod.Value && IsCurrentMapInBazaar() && NetworkServer.active) { ShopKeep.Body = null; } orig.Invoke(self); } private void TeleporterInteraction_Start(orig_Start orig, TeleporterInteraction self) { if (ModConfig.EnableMod.Value && ModConfig.EnableAutoOpenShop.Value) { orig.Invoke(self); self.shouldAttemptToSpawnShopPortal = true; } else { orig.Invoke(self); } } private void KickFromShop_FixedUpdate(orig_FixedUpdate orig, KickFromShop self) { if (ModConfig.EnableMod.Value && ModConfig.EnableNoKickFromShop.Value) { ((EntityState)self).outer.SetNextStateToMain(); } } private void GlobalEventManager_OnHitAll(orig_OnHitAll orig, GlobalEventManager self, DamageInfo damageInfo, GameObject hitObject) { if (ModConfig.EnableMod.Value && ModConfig.EnableLines.Value && IsCurrentMapInBazaar()) { try { if (((Object)hitObject).name.StartsWith("ShopkeeperBody") && Object.op_Implicit((Object)(object)damageInfo.attacker)) { ChatHelper.HitWord(); orig.Invoke(self, damageInfo, hitObject); } return; } catch (Exception) { return; } finally { } } orig.Invoke(self, damageInfo, hitObject); } private void CharacterMaster_OnBodyDeath(orig_OnBodyDeath orig, CharacterMaster self, CharacterBody body) { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, body); if (!ModConfig.EnableMod.Value || !IsCurrentMapInBazaar()) { return; } string name = ((Object)body).name; if (name.Contains("ShopkeeperBody")) { ShopKeep.IsDeath = true; ShopKeep.SpawnTime_Record++; if (ModConfig.EnableNewtNoDie.Value) { body.master.Respawn(body.footPosition, Quaternion.identity, false); AddItemToShopKeeper(body); } else { ChatHelper.ShowNewtDeath(); } } } private void AddItemToShopKeeper(CharacterBody body) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0246: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_029a: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) //IL_032e: Unknown result type (might be due to invalid IL or missing references) //IL_034b: Unknown result type (might be due to invalid IL or missing references) //IL_0368: Unknown result type (might be due to invalid IL or missing references) //IL_0385: Unknown result type (might be due to invalid IL or missing references) if (ModConfig.NewtSecondLifeMode.Value == ShopKeep.DeathState.Tank) { body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("HealingPotion")), 1000); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("Clover")), 20); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("Medkit")), 100); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("ParentEgg")), 10000); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("IncreaseHealing")), 100); } if (ModConfig.NewtSecondLifeMode.Value == ShopKeep.DeathState.Evil) { body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("HealingPotion")), 1000); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("Thorns")), 100); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("Clover")), 100); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("Medkit")), 100); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("NearbyDamageBonus")), 100); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("StickyBomb")), 50); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("StunChanceOnHit")), 50); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("CaptainDefenseMatrix")), 1); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("ExplodeOnDeath")), 100); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("SlowOnHit")), 10); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("StrengthenBurn")), 1); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("ImmuneToDebuff")), 1); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("BearVoid")), 1); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("BurnNearby")), 1); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("InvadingDoppelganger")), 1); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("AutoCastEquipment")), 5); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("EquipmentMagazine")), 10); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("CritGlasses")), 20); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("Syringe")), 100); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("Phasing")), 100); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("ParentEgg")), 10000); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("BarrierOnOverHeal")), 100); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("IncreaseHealing")), 100); body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("Crowbar")), 10); body.inventory.SetEquipmentIndex(EquipmentCatalog.FindEquipmentIndex("EliteVoidEquipment")); } } private void SpawnState_OnEnter(orig_OnEnter orig, SpawnState self) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) try { if (ModConfig.EnableMod.Value) { if (ModConfig.EnableDecorate.Value) { SpawnBluePortal(); } if (ModConfig.EnableDecorate.Value) { SpawnEffect("prefabs/effects/teleporterbeaconeffect", new Vector3(-73.5143f, -22.2897f, 9.1621f), Color32.op_Implicit(Color.blue)); SpawnEffect("prefabs/effects/teleporterbeaconeffect", new Vector3(-57.0645f, -22.2698f, -0.5218f), Color32.op_Implicit(Color.blue)); SpawnEffect("prefabs/effects/teleporterbeaconeffect", new Vector3(15.7063f, -2.1074f, 2.5406f), Color32.op_Implicit(Color.blue)); SpawnEffect("prefabs/effects/teleporterbeaconeffect", new Vector3(2.5543f, -2.7093f, -8.7185f), Color32.op_Implicit(Color.blue)); } ((MonoBehaviour)this).StartCoroutine(ShopWelcomeWord()); if (ShopKeep.SpawnTime_Record == 0) { if (ShopKeep.Body == null) { FindShopkeeper(); } ShopKeep.Body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("ParentEgg")), 34000); ShopKeep.Body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("Medkit")), 10000); if (ShopKeep.IsDeath && ModConfig.EnableNewtNoDie.Value) { switch (ModConfig.NewtSecondLifeMode.Value) { case ShopKeep.DeathState.Ghost: ShopKeep.Body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("Ghost")), 1); break; case ShopKeep.DeathState.Tank: ShopKeep.Body.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("BoostHp")), 100000000); break; case ShopKeep.DeathState.Evil: AddItemToShopKeeper(ShopKeep.Body); break; } } } if (LunarShopTerminalTotalCount < 5) { ObjectLunarShopTerminals.ForEach(delegate(PurchaseInteraction x) { x.SetAvailable(false); }); ObjectLunarShopTerminals = DisorderList(ObjectLunarShopTerminals); for (int i = 0; i < LunarShopTerminalTotalCount; i++) { ObjectLunarShopTerminals[i].SetAvailable(true); } foreach (PurchaseInteraction objectLunarShopTerminal in ObjectLunarShopTerminals) { if (!objectLunarShopTerminal.Networkavailable) { Object.Destroy((Object)(object)((Component)objectLunarShopTerminal).gameObject); } } } } } catch (Exception ex) { ((BaseUnityPlugin)this).Logger.LogError((object)ex); } finally { } orig.Invoke(self); } private IEnumerator ShopWelcomeWord() { yield return (object)new WaitForSeconds(0.5f); if (ModConfig.EnableWelcomeWord.Value) { ChatHelper.WelcomeWord(); } } private void FindShopkeeper() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0019: Unknown result type (might be due to invalid IL or missing references) TeamIndex val = (TeamIndex)0; CharacterMaster[] array = Object.FindObjectsOfType<CharacterMaster>(); foreach (CharacterMaster val2 in array) { if (val2.teamIndex == val) { CharacterBody body = val2.GetBody(); if (Object.op_Implicit((Object)(object)body) && ((Object)body).name.StartsWith("ShopkeeperBody")) { ShopKeep.Body = body; break; } } } } private List<t> DisorderList<t>(List<t> TList) { List<t> list = new List<t>(); Random random = new Random(); foreach (t T in TList) { list.Insert(random.Next(list.Count()), T); } return list; } private void SetPrinter() { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0188: Unknown result type (might be due to invalid IL or missing references) //IL_019c: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_0230: Unknown result type (might be due to invalid IL or missing references) //IL_0266: 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_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_030e: Unknown result type (might be due to invalid IL or missing references) List<int> list = new List<int> { 0, 1, 2, 3, 4, 5, 6, 7, 8 }; List<int> list2 = new List<int>(); while (list.Count > 0) { int index = Random.Next(list.Count); list2.Add(list[index]); list.RemoveAt(index); } DicPrinters.Add(list2[0], new SpawnCardStruct(new Vector3(-112f, -26.8f, -46f), new Vector3(0f, 32.2f, 0f))); DicPrinters.Add(list2[1], new SpawnCardStruct(new Vector3(-108f, -26.8f, -48.5f), new Vector3(0f, 32.2f, 0f))); DicPrinters.Add(list2[2], new SpawnCardStruct(new Vector3(-104f, -26.7f, -51f), new Vector3(0f, 32.2f, 0f))); DicPrinters.Add(list2[3], new SpawnCardStruct(new Vector3(-127f, -26f, -34.5f), new Vector3(0f, 32.2f, 0f))); DicPrinters.Add(list2[4], new SpawnCardStruct(new Vector3(-131f, -26f, -31.8f), new Vector3(0f, 32.2f, 0f))); DicPrinters.Add(list2[5], new SpawnCardStruct(new Vector3(-135f, -26f, -29f), new Vector3(0f, 32.2f, 0f))); DicPrinters.Add(list2[6], new SpawnCardStruct(new Vector3(-144f, -24.7f, -24f), new Vector3(0f, 60.2f, 0f))); DicPrinters.Add(list2[7], new SpawnCardStruct(new Vector3(-145f, -25f, -20f), new Vector3(0f, 80f, 0f))); DicPrinters.Add(list2[8], new SpawnCardStruct(new Vector3(-146f, -25.3f, -16f), new Vector3(0f, 100f, 0f))); } private void SetScraper() { //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0096: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) List<int> list = new List<int> { 0, 1, 2, 3 }; List<int> list2 = new List<int>(); while (list.Count > 0) { int index = Random.Next(list.Count); list2.Add(list[index]); list.RemoveAt(index); } DicScrapers.Add(list2[0], new SpawnCardStruct(new Vector3(-95f, -25.5f, -45f), new Vector3(0f, 72f, 0f))); DicScrapers.Add(list2[1], new SpawnCardStruct(new Vector3(-100f, -25f, -40f), new Vector3(0f, 72f, 0f))); DicScrapers.Add(list2[2], new SpawnCardStruct(new Vector3(-90f, -25.5f, -40f), new Vector3(0f, 72f, 0f))); DicScrapers.Add(list2[3], new SpawnCardStruct(new Vector3(-95f, -25.5f, -35f), new Vector3(0f, 72f, 0f))); } private void SetCauldron() { //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00e4: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0178: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) List<int> list = new List<int> { 0, 1, 2, 3, 4, 5, 6 }; List<int> list2 = new List<int>(); while (list.Count > 0) { int index = Random.Next(list.Count); list2.Add(list[index]); list.RemoveAt(index); } DicCauldrons.Add(list2[0], new SpawnCardStruct(new Vector3(-115.9816f, -24.1175f, -6.2091f), new Vector3(0f, 120f, 0f))); DicCauldrons.Add(list2[1], new SpawnCardStruct(new Vector3(-119.928f, -24.1238f, -7.0865f), new Vector3(0f, 140f, 0f))); DicCauldrons.Add(list2[2], new SpawnCardStruct(new Vector3(-123.4725f, -23.7951f, -5.469f), new Vector3(0f, 160f, 0f))); DicCauldrons.Add(list2[3], new SpawnCardStruct(new Vector3(-107.8159f, -23.8448f, -4.517f), new Vector3(0f, 130f, 0f))); DicCauldrons.Add(list2[4], new SpawnCardStruct(new Vector3(-101.2425f, -24.8612f, -9.1464f), new Vector3(0f, 160f, 0f))); DicCauldrons.Add(list2[5], new SpawnCardStruct(new Vector3(-98.5219f, -25.6548f, -12.3659f), new Vector3(0f, 155f, 0f))); DicCauldrons.Add(list2[6], new SpawnCardStruct(new Vector3(-94.6071f, -25.8717f, -13.6159f), new Vector3(0f, 135f, 0f))); } private void SetEquipment() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0184: Unknown result type (might be due to invalid IL or missing references) //IL_01ba: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_0204: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) List<int> list = new List<int> { 0, 1, 2, 3, 4, 5 }; List<int> list2 = new List<int>(); while (list.Count > 0) { int index = Random.Next(list.Count); list2.Add(list[index]); list.RemoveAt(index); } DicEquipments.Add(list2[0], new SpawnCardStruct(new Vector3(-128.9115f, -23.1756f, -24.6339f), new Vector3(350f, 90f, 0f))); DicEquipments.Add(list2[1], new SpawnCardStruct(new Vector3(-131.3281f, -23.0673f, -21.9982f), new Vector3(353f, 0f, 0f))); DicEquipments.Add(list2[2], new SpawnCardStruct(new Vector3(-132.8414f, -22.6963f, -26.6293f), new Vector3(353f, 220f, 0f))); DicEquipments.Add(list2[3], new SpawnCardStruct(new Vector3(-141.3541f, -21.2761f, -10.9f), new Vector3(358f, 180f, 0f))); DicEquipments.Add(list2[4], new SpawnCardStruct(new Vector3(-138.9401f, -20.9378f, -8.8781f), new Vector3(355f, 100f, 0f))); DicEquipments.Add(list2[5], new SpawnCardStruct(new Vector3(-139.9517f, -20.8648f, -5.7996f), new Vector3(353f, 30f, 0f))); } private void SetLunarShopTerminal() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01f1: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) List<int> list = new List<int> { 0, 1, 2, 3, 4, 5 }; List<int> list2 = new List<int>(); while (list.Count > 0) { int index = Random.Next(list.Count); list2.Add(list[index]); list.RemoveAt(index); } DicLunarShopTerminals.Add(list2[0], new SpawnCardStruct(new Vector3(-90.8748f, -22.321f, -49.7166f), new Vector3(0f, 250f, 0f))); DicLunarShopTerminals.Add(list2[1], new SpawnCardStruct(new Vector3(-90.7317f, -22.1151f, -53.4639f), new Vector3(0f, 240f, 0f), (Vector3?)new Vector3(1.2f, 1.2f, 1.2f))); DicLunarShopTerminals.Add(list2[2], new SpawnCardStruct(new Vector3(-87.8854f, -22.1132f, -53.319f), new Vector3(0f, 180f, 0f))); DicLunarShopTerminals.Add(list2[3], new SpawnCardStruct(new Vector3(-86.6861f, -22.9508f, -50.5742f), new Vector3(0f, 100f, 0f))); DicLunarShopTerminals.Add(list2[4], new SpawnCardStruct(new Vector3(-70.2474f, -24.1325f, -51.1947f), new Vector3(0f, 230f, 0f), (Vector3?)new Vector3(1.8f, 1.8f, 1.8f))); DicLunarShopTerminals.Add(list2[5], new SpawnCardStruct(new Vector3(-76.9623f, -25.894f, -41.4813f), new Vector3(0f, 120f, 0f), (Vector3?)new Vector3(3f, 3f, 3f))); } private void SetLunarPool() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) DicLunarPools.Add(0, new SpawnCardStruct(new Vector3(-115.42f, -9.55f, -50.36f), new Vector3(90f, 30f, 0f))); DicLunarPools.Add(1, new SpawnCardStruct(new Vector3(-129.891f, -9.55f, -42.6537f), new Vector3(90f, 30f, 0f))); } private void SetDecorate() { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0256: Unknown result type (might be due to invalid IL or missing references) //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_0364: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_03ae: Unknown result type (might be due to invalid IL or missing references) //IL_03c2: Unknown result type (might be due to invalid IL or missing references) //IL_03f8: Unknown result type (might be due to invalid IL or missing references) //IL_040c: Unknown result type (might be due to invalid IL or missing references) //IL_0442: Unknown result type (might be due to invalid IL or missing references) //IL_0456: Unknown result type (might be due to invalid IL or missing references) //IL_048c: Unknown result type (might be due to invalid IL or missing references) //IL_04a0: Unknown result type (might be due to invalid IL or missing references) //IL_04d6: Unknown result type (might be due to invalid IL or missing references) //IL_04ea: Unknown result type (might be due to invalid IL or missing references) List<int> list = new List<int> { 0, 1, 2 }; List<int> list2 = new List<int>(); while (list.Count > 0) { int index = Random.Next(list.Count); list2.Add(list[index]); list.RemoveAt(index); } DicGlodChests.Add(list2[0], new SpawnCardStruct(new Vector3(-127.7178f, -23.5346f, -60.0732f), new Vector3(350f, 0f, 0f))); DicGlodChests.Add(list2[1], new SpawnCardStruct(new Vector3(-129.2f, -22.7723f, -63.2481f), new Vector3(350f, 150f, 350f))); DicGlodChests.Add(list2[2], new SpawnCardStruct(new Vector3(-126.5934f, -22.815f, -62.1658f), new Vector3(357.8401f, 341.0997f, 330f))); list = new List<int> { 0, 1, 2, 3 }; list2 = new List<int>(); while (list.Count > 0) { int index2 = Random.Next(list.Count); list2.Add(list[index2]); list.RemoveAt(index2); } DicBigChests.Add(list2[0], new SpawnCardStruct(new Vector3(-134.5802f, -25.3546f, -68.1701f), new Vector3(333.3292f, 136.2832f, 335.803f))); DicBigChests.Add(list2[1], new SpawnCardStruct(new Vector3(-134.7337f, -26.2325f, -67.6419f), new Vector3(333.3292f, 136.2832f, 335.803f))); DicBigChests.Add(list2[2], new SpawnCardStruct(new Vector3(-132.4877f, -25.2405f, -66.5167f), new Vector3(22.3718f, 143.4671f, 327.6613f))); DicBigChests.Add(list2[3], new SpawnCardStruct(new Vector3(-132.7968f, -25.409f, -65.5423f), new Vector3(22.3718f, 143.4671f, 327.6613f))); list = new List<int> { 0, 1, 2, 3, 4, 5 }; list2 = new List<int>(); while (list.Count > 0) { int index3 = Random.Next(list.Count); list2.Add(list[index3]); list.RemoveAt(index3); } DicSmallChests.Add(list2[0], new SpawnCardStruct(new Vector3(-133.4579f, -25.3303f, -68.7228f), new Vector3(9.6318f, 138.4325f, 358.917f))); DicSmallChests.Add(list2[1], new SpawnCardStruct(new Vector3(-135.1821f, -25.4367f, -70.568f), new Vector3(18.5215f, 90.3934f, 352.1391f))); DicSmallChests.Add(list2[2], new SpawnCardStruct(new Vector3(-136.5309f, -25.5333f, -70.1181f), new Vector3(2.2523f, 116.0182f, 18.9676f))); DicSmallChests.Add(list2[3], new SpawnCardStruct(new Vector3(-137.627f, -25.5271f, -69.0357f), new Vector3(15.987f, 225.1928f, 1.5787f))); DicSmallChests.Add(list2[4], new SpawnCardStruct(new Vector3(-137.2342f, -25.4021f, -66.4729f), new Vector3(28.129f, 313.1049f, 21.9359f))); DicSmallChests.Add(list2[5], new SpawnCardStruct(new Vector3(-140.2227f, -25.6923f, -67.7525f), new Vector3(9.4325f, 192.0851f, 17.5428f))); } private void SpawnPrinters() { //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Expected O, but got Unknown //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00cf: Unknown result type (might be due to invalid IL or missing references) if (ModConfig.PrinterCount.Value > 0) { DicPrinters.Clear(); SetPrinter(); int num = 0; num = ((!ModConfig.SpawnCountByStage.Value) ? ModConfig.PrinterCount.Value : SetCountbyGameStage(ModConfig.PrinterCount.Value, ModConfig.SpawnCountOffset.Value)); for (int i = 0; i < num; i++) { string randomPrinter = GetRandomPrinter(); SpawnCard val = LegacyResourcesAPI.Load<SpawnCard>("SpawnCards/InteractableSpawnCard/" + randomPrinter); GameObject spawnedInstance = val.DoSpawn(DicPrinters[i].Position, Quaternion.identity, new DirectorSpawnRequest(val, DirectorPlacementRule, Run.instance.runRNG)).spawnedInstance; spawnedInstance.transform.eulerAngles = DicPrinters[i].Rotation; } } } private void SpawnLunarCauldron() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) if (ModConfig.CauldronCount.Value > 0) { DicCauldrons.Clear(); SetCauldron(); int num = 0; num = ((!ModConfig.SpawnCountByStage.Value) ? ModConfig.CauldronCount.Value : SetCountbyGameStage(ModConfig.CauldronCount.Value, ModConfig.SpawnCountOffset.Value)); for (int i = 0; i < num; i++) { string randomLunarCauldron = GetRandomLunarCauldron(); GameObject val = null; val = Object.Instantiate<GameObject>(LegacyResourcesAPI.Load<GameObject>("prefabs/networkedobjects/" + randomLunarCauldron), DicCauldrons[i].Position, Quaternion.identity); val.transform.eulerAngles = DicCauldrons[i].Rotation; NetworkServer.Spawn(val); } } } private void SpawnScrapper() { if (ModConfig.ScrapperCount.Value > 0) { DicScrapers.Clear(); SetScraper(); DoSpawnCard(DicScrapers, "SpawnCards/InteractableSpawnCard/iscscrapper", ModConfig.ScrapperCount.Value); } } private void SpawnEquipment() { if (ModConfig.EquipmentCount.Value > 0) { DicEquipments.Clear(); SetEquipment(); DoSpawnGameObject(DicEquipments, "prefabs/networkedobjects/chest/multishopequipmentterminal", ModConfig.EquipmentCount.Value); } } private void SpawnLunarShopTerminal() { ObjectLunarShopTerminals.Clear(); ObjectLunarShopTerminals_Spawn.Clear(); LunarShopTerminalTotalCount = 0; if (ModConfig.LunarShopTerminalCount.Value > 0) { DicLunarShopTerminals.Clear(); SetLunarShopTerminal(); DoSpawnGameObject(DicLunarShopTerminals, "prefabs/networkedobjects/chest/lunarshopterminal", ModConfig.LunarShopTerminalCount.Value); } } private void SpawnShrineRestack() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) if (ModConfig.EnableShrineRestack.Value) { string text = "SpawnCards/InteractableSpawnCard/iscshrinerestack"; SpawnCard val = LegacyResourcesAPI.Load<SpawnCard>(text); GameObject spawnedInstance = val.DoSpawn(new Vector3(-130f, -24f, -40f), Quaternion.identity, new DirectorSpawnRequest(val, DirectorPlacementRule, Run.instance.runRNG)).spawnedInstance; spawnedInstance.transform.eulerAngles = new Vector3(0f, 220f, 0f); spawnedInstance.GetComponent<ShrineRestackBehavior>().maxPurchaseCount = ModConfig.ShrineRestackMaxCount.Value; spawnedInstance.GetComponent<PurchaseInteraction>().cost = ModConfig.ShrineRestackCost.Value; spawnedInstance.GetComponent<PurchaseInteraction>().Networkcost = ModConfig.ShrineRestackCost.Value; if (ModConfig.PenaltyCoefficient_Temp != 1) { PurchaseInteraction component = spawnedInstance.GetComponent<PurchaseInteraction>(); component.cost *= ModConfig.PenaltyCoefficient_Temp; spawnedInstance.GetComponent<ShrineRestackBehavior>().costMultiplierPerPurchase = ModConfig.PenaltyCoefficient_Temp; } } } private void SpawnShrineCleanse() { if (ModConfig.EnableShrineCleanse.Value) { DicLunarPools.Clear(); SetLunarPool(); DoSpawnCard(DicLunarPools, "SpawnCards/InteractableSpawnCard/iscshrinecleanse", DicLunarPools.Count); } } private void SpawnShrineHealing() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) if (ModConfig.EnableShrineHealing.Value) { string text = "SpawnCards/InteractableSpawnCard/iscshrinehealing"; SpawnCard val = LegacyResourcesAPI.Load<SpawnCard>(text); GameObject spawnedInstance = val.DoSpawn(new Vector3(-119f, -23f, -52f), Quaternion.identity, new DirectorSpawnRequest(val, DirectorPlacementRule, Run.instance.runRNG)).spawnedInstance; spawnedInstance.transform.eulerAngles = new Vector3(0f, 210f, 0f); spawnedInstance.GetComponent<PurchaseInteraction>().costType = (CostTypeIndex)3; spawnedInstance.GetComponent<PurchaseInteraction>().cost = ModConfig.PrayCost.Value * ModConfig.PenaltyCoefficient_Temp; spawnedInstance.GetComponent<PurchaseInteraction>().Networkcost = ModConfig.PrayCost.Value * ModConfig.PenaltyCoefficient_Temp; spawnedInstance.GetComponent<ShrineHealingBehavior>().costMultiplierPerPurchase = 1f; spawnedInstance.GetComponent<ShrineHealingBehavior>().maxPurchaseCount = int.MaxValue; } } private void SpawnDecorate() { if (ModConfig.EnableDecorate.Value) { DicGlodChests.Clear(); DicBigChests.Clear(); DicSmallChests.Clear(); SetDecorate(); string card = "spawncards/interactablespawncard/iscGoldChest"; DoSpawnCard(DicGlodChests, card, DicGlodChests.Count); card = "spawncards/interactablespawncard/iscChest2"; DoSpawnCard(DicBigChests, card, DicBigChests.Count); card = "spawncards/interactablespawncard/iscChest1"; DoSpawnCard(DicSmallChests, card, DicSmallChests.Count); } } private void SpawnBluePortal() { //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Expected O, but got Unknown //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) if (ModConfig.EnableDecorate.Value) { string text = "SpawnCards/InteractableSpawnCard/iscshopportal"; SpawnCard val = LegacyResourcesAPI.Load<SpawnCard>(text); GameObject spawnedInstance = val.DoSpawn(new Vector3(-135f, -23f, -60f), Quaternion.identity, new DirectorSpawnRequest(val, DirectorPlacementRule, Run.instance.runRNG)).spawnedInstance; spawnedInstance.transform.eulerAngles = new Vector3(0f, 220f, 0f); } } private void DoSpawnCard(Dictionary<int, SpawnCardStruct> keyValuePairs, string card, int max) { //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Expected O, but got Unknown //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) int num = 0; num = ((!ModConfig.SpawnCountByStage.Value) ? max : SetCountbyGameStage(max, ModConfig.SpawnCountOffset.Value)); for (int i = 0; i < num; i++) { try { SpawnCard val = LegacyResourcesAPI.Load<SpawnCard>(card); GameObject spawnedInstance = val.DoSpawn(keyValuePairs[i].Position, Quaternion.identity, new DirectorSpawnRequest(val, DirectorPlacementRule, Run.instance.runRNG)).spawnedInstance; spawnedInstance.transform.eulerAngles = keyValuePairs[i].Rotation; spawnedInstance.transform.localScale = keyValuePairs[i].Scale.Value; if (card.EndsWith("Chest") || card.EndsWith("Chest1") || card.EndsWith("Chest2")) { spawnedInstance.GetComponent<PurchaseInteraction>().SetAvailable(false); } } catch (Exception) { ((BaseUnityPlugin)this).Logger.LogWarning((object)(card + " 出现问题了")); } } } private void DoSpawnCard(string card, Vector3 vector) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) SpawnCard val = LegacyResourcesAPI.Load<SpawnCard>(((Object)this).name); DirectorPlacementRule val2 = new DirectorPlacementRule { placementMode = (PlacementMode)4 }; GameObject spawnedInstance = val.DoSpawn(vector, Quaternion.identity, new DirectorSpawnRequest(val, val2, Run.instance.runRNG)).spawnedInstance; spawnedInstance.transform.eulerAngles = default(Vector3); } private void DoSpawnGameObject(Dictionary<int, SpawnCardStruct> keyValuePairs, string card, int max) { //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: Unknown result type (might be due to invalid IL or missing references) int num = 0; if (ModConfig.SpawnCountByStage.Value) { num = SetCountbyGameStage(max, ModConfig.SpawnCountOffset.Value); if (card.EndsWith("lunarshopterminal")) { LunarShopTerminalTotalCount = num; if (num <= 5) { return; } num = LunarShopTerminalTotalCount - 5; } } else { num = max; if (card.EndsWith("lunarshopterminal")) { LunarShopTerminalTotalCount = max; num -= 5; } } for (int i = 0; i < num; i++) { GameObject val = Object.Instantiate<GameObject>(LegacyResourcesAPI.Load<GameObject>(card), keyValuePairs[i].Position, Quaternion.identity); val.transform.eulerAngles = keyValuePairs[i].Rotation; val.transform.localScale = keyValuePairs[i].Scale.Value; if (card.EndsWith("lunarshopterminal")) { ObjectLunarShopTerminals_Spawn.Add(val.GetComponent<PurchaseInteraction>()); if (ModConfig.EnableLunarShopTerminalInjection.Value || ModConfig.PenaltyCoefficient_Temp != 1) { int num2 = 2; int num3 = num2 * ModConfig.PenaltyCoefficient_Temp; if (ModConfig.EnableLunarShopTerminalInjection.Value) { num3 = ModConfig.LunarShopTerminalCost.Value * ModConfig.PenaltyCoefficient_Temp; } val.GetComponent<PurchaseInteraction>().cost = num3; val.GetComponent<PurchaseInteraction>().Networkcost = num3; } } NetworkServer.Spawn(val); } } [ConCommand(/*Could not decode attribute arguments.*/)] private static void Command_SpawnCard(ConCommandArgs args) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Expected O, but got Unknown //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Expected O, but got Unknown //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) string argString = ((ConCommandArgs)(ref args)).GetArgString(0); NetworkUser networkUser = PlayerCharacterMasterController.instances[0].networkUser; ChatHelper.Send("name = " + argString + ", DisplayName = " + networkUser.masterController.GetDisplayName()); Vector3 footPosition = networkUser.GetCurrentBody().footPosition; SpawnCard val = LegacyResourcesAPI.Load<SpawnCard>(argString); DirectorPlacementRule val2 = new DirectorPlacementRule { placementMode = (PlacementMode)0 }; GameObject spawnedInstance = val.DoSpawn(footPosition, Quaternion.identity, new DirectorSpawnRequest(val, val2, Run.instance.runRNG)).spawnedInstance; spawnedInstance.transform.eulerAngles = new Vector3(0f, 220f, 0f); } [ConCommand(/*Could not decode attribute arguments.*/)] private static void Command_GameObject(ConCommandArgs args) { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) string argString = ((ConCommandArgs)(ref args)).GetArgString(0); NetworkUser networkUser = PlayerCharacterMasterController.instances[0].networkUser; ChatHelper.Send("name = " + argString + ", DisplayName = " + networkUser.masterController.GetDisplayName()); Vector3 footPosition = networkUser.GetCurrentBody().footPosition; GameObject val = Object.Instantiate<GameObject>(LegacyResourcesAPI.Load<GameObject>(argString), footPosition, Quaternion.identity); val.transform.eulerAngles = new Vector3(0f, 220f, 0f); NetworkServer.Spawn(val); } [ConCommand(/*Could not decode attribute arguments.*/)] private static void Command_PlayEffect(ConCommandArgs args) { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Expected O, but got Unknown string argString = ((ConCommandArgs)(ref args)).GetArgString(0); NetworkUser networkUser = PlayerCharacterMasterController.instances[0].networkUser; Vector3 corePosition = networkUser.GetCurrentBody().corePosition; EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>(argString), new EffectData { origin = corePosition, rotation = Quaternion.identity, scale = 1f, color = Color32.op_Implicit(Color.yellow) }, true); } private bool IsMultiplayer() { return PlayerCharacterMasterController.instances.Count > 1; } private bool IsCurrentMapInBazaar() { //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) Scene activeScene = SceneManager.GetActiveScene(); return ((Scene)(ref activeScene)).name == "bazaar"; } private string GetRandomPrinter() { float value = ModConfig.PrinterTier1Weight.Value; float value2 = ModConfig.PrinterTier2Weight.Value; float value3 = ModConfig.PrinterTier3Weight.Value; float value4 = ModConfig.PrinterTierBossWeight.Value; float num = value + value2 + value3 + value4; double num2 = Random.NextDouble() * (double)num; if (num2 <= (double)value) { return PrintersCode[0]; } if (num2 <= (double)(value + value2)) { return PrintersCode[1]; } if (num2 <= (double)(value + value2 + value3)) { return PrintersCode[2]; } return PrintersCode[3]; } private string GetRandomLunarCauldron() { float value = ModConfig.CauldronGreenWeight.Value; float value2 = ModConfig.CauldronRedWeight.Value; float value3 = ModConfig.CauldronWhiteWeight.Value; float num = value + value2 + value3; double num2 = Random.NextDouble() * (double)num; if (num2 <= (double)value) { return LunarCauldronsCode[0]; } if (num2 <= (double)(value + value2)) { return LunarCauldronsCode[1]; } return LunarCauldronsCode[2]; } private void GetRandomLunarCauldron_DLC1() { int num = 0; if (ModConfig.CauldronGreenWeight.Value != 0f) { num++; } if (ModConfig.CauldronRedWeight.Value != 0f) { num++; } if (ModConfig.CauldronWhiteWeight.Value != 0f) { num++; } if (ModConfig.CauldronYellowWeight.Value != 0f) { num++; } if (ModConfig.CauldronBlueWeight.Value != 0f) { num++; } if (ModConfig.CauldronPurpleWeight.Value != 0f) { num++; } } private int SetCountbyGameStage(int max, int offset = 0) { int num = Run.instance.stageClearCount + 1; int num2 = num + offset; if (num2 > max) { num2 = max; } return num2; } private void SetCaudronList_Hacked() { if (ModConfig.CauldronCount.Value > 0 && (ModConfig.EnableCauldronHacking.Value || ModConfig.PenaltyCoefficient_Temp != 1)) { CauldronHackedStructs.Clear(); CauldronHackedStructs.Add(new CauldronHackedStruct("LunarCauldronGreen-Yellow", ModConfig.CauldronWhiteToGreenCost_Hacked.Value * ModConfig.PenaltyCoefficient_Temp, (CostTypeIndex)4)); CauldronHackedStructs.Add(new CauldronHackedStruct("LunarCauldronGreen-Blue", ModConfig.CauldronWhiteToGreenCost_Hacked.Value * ModConfig.PenaltyCoefficient_Temp, (CostTypeIndex)4)); CauldronHackedStructs.Add(new CauldronHackedStruct("LunarCauldronGreen-Purple", ModConfig.CauldronWhiteToGreenCost_Hacked.Value * ModConfig.PenaltyCoefficient_Temp, (CostTypeIndex)4)); CauldronHackedStructs.Add(new CauldronHackedStruct("LunarCauldronRed-Yellow", ModConfig.CauldronGreenToRedCost_Hacked.Value * ModConfig.PenaltyCoefficient_Temp, (CostTypeIndex)5)); CauldronHackedStructs.Add(new CauldronHackedStruct("LunarCauldronRed-Blue", ModConfig.CauldronGreenToRedCost_Hacked.Value * ModConfig.PenaltyCoefficient_Temp, (CostTypeIndex)5)); CauldronHackedStructs.Add(new CauldronHackedStruct("LunarCauldronRed-Purple", ModConfig.CauldronGreenToRedCost_Hacked.Value * ModConfig.PenaltyCoefficient_Temp, (CostTypeIndex)5)); CauldronHackedStructs.Add(new CauldronHackedStruct("LunarCauldronWhite-Yellow", ModConfig.CauldronRedToWhiteCost_Hacked.Value * ModConfig.PenaltyCoefficient_Temp, (CostTypeIndex)10)); CauldronHackedStructs.Add(new CauldronHackedStruct("LunarCauldronWhite-Blue", ModConfig.CauldronRedToWhiteCost_Hacked.Value * ModConfig.PenaltyCoefficient_Temp, (CostTypeIndex)9)); CauldronHackedStructs.Add(new CauldronHackedStruct("LunarCauldronWhite-Purple", ModConfig.CauldronRedToWhiteCost_Hacked.Value * ModConfig.PenaltyCoefficient_Temp, (CostTypeIndex)6)); } } private static void SpawnEffect(string effectName, Vector3 position, Color32 color, float scale = 1f) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Expected O, but got Unknown EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>(effectName), new EffectData { origin = position, rotation = Quaternion.identity, scale = scale, color = color }, true); } } internal class ModConfig { public static ConfigEntry<bool> EnableMod; public static ConfigEntry<bool> EnableAutoOpenShop; public static ConfigEntry<bool> EnableNoKickFromShop; public static ConfigEntry<bool> EnableNewtNoDie; public static ConfigEntry<ShopKeep.DeathState> NewtSecondLifeMode; public static ConfigEntry<bool> EnableWelcomeWord; public static ConfigEntry<bool> SpawnCountByStage; public static ConfigEntry<int> SpawnCountOffset; public static ConfigEntry<int> PenaltyCoefficient; public static int PenaltyCoefficient_Temp; public static ConfigEntry<int> PrinterCount; public static ConfigEntry<int> CauldronCount; public static ConfigEntry<int> ScrapperCount; public static ConfigEntry<int> EquipmentCount; public static ConfigEntry<int> LunarShopTerminalCount; public static ConfigEntry<int> RewardCount; public static ConfigEntry<float> PrinterTier1Weight; public static ConfigEntry<float> PrinterTier2Weight; public static ConfigEntry<float> PrinterTier3Weight; public static ConfigEntry<float> PrinterTierBossWeight; public static ConfigEntry<float> PrinterTierLunarWeight; public static ConfigEntry<float> PrinterTierVoidWeight; public static ConfigEntry<float> CauldronWhiteWeight; public static ConfigEntry<float> CauldronGreenWeight; public static ConfigEntry<float> CauldronRedWeight; public static ConfigEntry<bool> EnableCauldronHacking; public static ConfigEntry<int> CauldronWhiteToGreenCost; public static ConfigEntry<int> CauldronGreenToRedCost; public static ConfigEntry<int> CauldronRedToWhiteCost; public static ConfigEntry<int> CauldronWhiteToGreenCost_Hacked; public static ConfigEntry<int> CauldronGreenToRedCost_Hacked; public static ConfigEntry<int> CauldronRedToWhiteCost_Hacked; public static ConfigEntry<bool> CauldronWhiteCostTypeChange; public static ConfigEntry<float> CauldronWhiteHackedChance; public static ConfigEntry<float> CauldronGreenHackedChance; public static ConfigEntry<float> CauldronRedHackedChance; public static ConfigEntry<float> CauldronYellowWeight; public static ConfigEntry<float> CauldronBlueWeight; public static ConfigEntry<float> CauldronPurpleWeight; public static ConfigEntry<bool> EnableShrineCleanse; public static ConfigEntry<bool> EnableShrineHealing; public static ConfigEntry<bool> EnableShrineRestack; public static ConfigEntry<int> ShrineRestackMaxCount; public static ConfigEntry<int> ShrineRestackCost; public static ConfigEntry<int> ShrineRestackScalar; public static ConfigEntry<int> PrayCost; public static ConfigEntry<float> PrayNormalWeight; public static ConfigEntry<float> PrayEliteWeight; public static ConfigEntry<float> PrayPeculiarWeight; public static ConfigEntry<string> PrayPeculiarList; public static ConfigEntry<bool> EnableDecorate; public static ConfigEntry<bool> EnableLunarRecyclerInjection; public static ConfigEntry<bool> LunarRecyclerAvailable; public static ConfigEntry<int> LunarRecyclerRerollCost; public static ConfigEntry<int> LunarRecyclerRerollScalar; public static ConfigEntry<int> LunarRecyclerRerollCount; public static int RerolledCount; public static ConfigEntry<bool> EnableLunarShopTerminalInjection; public static ConfigEntry<int> LunarShopTerminalCost; public static ConfigEntry<bool> EnableSeerStationsInjection; public static ConfigEntry<bool> SeerStationAvailable; public static ConfigEntry<int> SeerStationsCost; public static ConfigEntry<bool> EnableLines; public static BaseUnityPlugin ShareSuite; public static BaseUnityPlugin BiggerBazaar; public static void InitConfig(ConfigFile config) { EnableMod = config.Bind<bool>("00 Setting设置", "EnableMod", true, "Enable Mod\n启用模组"); if (!EnableMod.Value) { return; } EnableAutoOpenShop = config.Bind<bool>("00 Setting设置", "EnableAutoOpenShop", true, "Enable auto open shop portal. \n启用自动开商店传送门"); EnableNoKickFromShop = config.Bind<bool>("00 Setting设置", "EnableNoKickFromShop", true, "Enable no shoper kick out.\n启用商店防踢"); EnableNewtNoDie = config.Bind<bool>("00 Setting设置", "EnableShoperWontDie", false, "Enable Newt will no longer die, maybe...you will die instead.\n启用商人没那么容易死,如果开了注意安全"); if (EnableNewtNoDie.Value) { NewtSecondLifeMode = config.Bind<ShopKeep.DeathState>("00 Setting设置", "NewtSecondLifeMode", ShopKeep.DeathState.Evil, "Enable Newt will no longer die, maybe...you will die instead.\n商人死亡复活后的形态, Tank = 纯肉, Eveil = 恶魔"); } EnableWelcomeWord = config.Bind<bool>("00 Setting设置", "EnableWelcomeWord", true, "Enable welcome words.\n启用商人欢迎语"); PenaltyCoefficient = config.Bind<int>("00 Setting设置", "PenaltyCoefficient", 10, "If Newt is die, there is a price penalty.\n商人死亡后所有价格、兑换惩罚系数"); PenaltyCoefficient.Value = Math.Abs(PenaltyCoefficient.Value); if (ShopKeep.IsDeath) { PenaltyCoefficient_Temp = PenaltyCoefficient.Value; } else { PenaltyCoefficient_Temp = 1; } SpawnCountByStage = config.Bind<bool>("00 Setting设置", "SpawnCountByStage", true, "Increase the number of devices based on stage. true = Yes\n是否随关卡数增加所有设备数量? true = 是\nFormula公式:Total Qty = stage + offset"); if (SpawnCountByStage.Value) { SpawnCountOffset = config.Bind<int>("00 Setting设置", "SpawnCountOffset", 0, "Associate the above parameters, value of offset.\n关联上面参数,增加设备数量的位移数"); } PrinterCount = config.Bind<int>("01 Printer打印机", "PrinterCount", 9, "Total generated value of printers, max is 9, below zero is not enabled.\n月店3D打印机的数量,最多9台,小于0不启用"); if (PrinterCount.Value > 9) { PrinterCount.Value = 9; } if (PrinterCount.Value > 0) { PrinterTier1Weight = config.Bind<float>("01 Printer打印机", "PrinterTier1Weight", 0.8f, "Weight of white items. \n打印机出现白色物品的比重"); PrinterTier1Weight.Value = Math.Abs(PrinterTier1Weight.Value); PrinterTier2Weight = config.Bind<float>("01 Printer打印机", "PrinterTier2Weight", 0.2f, "Weight of green items. \n打印机出现绿色物品的比重"); PrinterTier2Weight.Value = Math.Abs(PrinterTier2Weight.Value); PrinterTier3Weight = config.Bind<float>("01 Printer打印机", "PrinterTier3Weight", 0.01f, "Weight of red items. \n打印机出现红色物品的比重"); PrinterTier3Weight.Value = Math.Abs(PrinterTier3Weight.Value); PrinterTierBossWeight = config.Bind<float>("01 Printer打印机", "PrinterBossWeight", 0.01f, "Weight of boss items. \n打印机出现黄色物品的比重"); PrinterTierBossWeight.Value = Math.Abs(PrinterTierBossWeight.Value); PrinterTierLunarWeight = config.Bind<float>("01 Printer打印机", "PrinterTierLunarHackChance", 0.05f, "Weight of blue items, exchange blue for blue.\n打印机出现蓝色物品的比重"); PrinterTierLunarWeight.Value = Math.Abs(PrinterTierLunarWeight.Value); PrinterTierVoidWeight = config.Bind<float>("01 Printer打印机", "PrinterTierVoidHackChance", 0.05f, "Weight of purple items, exchange red for purple. \n打印机出现紫色物品的比重,用红色物品打印"); PrinterTierVoidWeight.Value = Math.Abs(PrinterTierVoidWeight.Value); } CauldronCount = config.Bind<int>("02 Cauldron大锅", "CauldronCount", 7, "Total generated value of cauldrons, max is 7, below zero is not enabled. \n月店大锅的数量,最多7锅,小于0不启用"); if (CauldronCount.Value > 7) { CauldronCount.Value = 7; } if (CauldronCount.Value > 0) { CauldronWhiteWeight = config.Bind<float>("02 Cauldron大锅", "CauldronWhiteWeight", 0.3f, "Weight of white cauldron. \n大锅出现白色物品的比重"); CauldronWhiteWeight.Value = Math.Abs(CauldronWhiteWeight.Value); CauldronGreenWeight = config.Bind<float>("02 Cauldron大锅", "CauldronGreenWeight", 0.6f, "Weight of green cauldron. \n大锅出现绿色物品的比重"); CauldronGreenWeight.Value = Math.Abs(CauldronGreenWeight.Value); CauldronRedWeight = config.Bind<float>("02 Cauldron大锅", "CauldronRedWeight", 0.1f, "Weight of red cauldron. \n大锅出现红色物品的比重"); CauldronRedWeight.Value = Math.Abs(CauldronRedWeight.Value); EnableCauldronHacking = config.Bind<bool>("02.1 Cauldron Hack大锅数据修改", "EnableCauldronHacking", true, "Enable cauldron data hacking.\n启用大锅数据修改"); if (EnableCauldronHacking.Value) { CauldronWhiteToGreenCost = config.Bind<int>("02.1 Cauldron Hack大锅数据修改", "CauldronWhiteToGreenCost", 3, "Green cauldron requires the number of white items.\n绿锅需要白色物品的数量"); CauldronWhiteToGreenCost.Value = Math.Abs(CauldronWhiteToGreenCost.Value); CauldronGreenToRedCost = config.Bind<int>("02.1 Cauldron Hack大锅数据修改", "CauldronGreenToRedCost", 5, "Red cauldron requires the number of green items.\n红锅需要绿色物品的数量"); CauldronGreenToRedCost.Value = Math.Abs(CauldronGreenToRedCost.Value); CauldronRedToWhiteCost = config.Bind<int>("02.1 Cauldron Hack大锅数据修改", "CauldronRedToWhiteCost", 1, "White cauldron requires the number of red items.\n白锅需要红色物品的数量"); CauldronRedToWhiteCost.Value = Math.Abs(CauldronRedToWhiteCost.Value); CauldronWhiteCostTypeChange = config.Bind<bool>("02.1 Cauldron Hack大锅数据修改", "CauldronWhiteCostTypeChange", true, "Enable white cauldron change the cost type demand for red to green.\n白锅把需求红色物品改成绿色物品,默认1红3白太亏了"); CauldronWhiteHackedChance = config.Bind<float>("02.1 Cauldron Hack大锅数据修改", "CauldronWhiteHackedChance", 0.2f, "Probability of a white cauldron being hacked. After being hacked, exchange with the same color, yellow to yellow, blue to blue. Except for purple exchange with red. \n白色大锅被黑的机率,被黑后用同等颜色兑换,黄换黄,蓝换蓝,而紫色用红色兑换"); CauldronWhiteHackedChance.Value = Math.Abs(CauldronWhiteHackedChance.Value); CauldronGreenHackedChance = config.Bind<float>("02.1 Cauldron Hack大锅数据修改", "CauldronGreenHackedChance", 0.2f, "Probability of a green cauldron being hacked. After being hacked, still use white items.\n绿色大锅被黑的机率,被黑后仍然使用白色物品兑换。"); CauldronGreenHackedChance.Value = Math.Abs(CauldronGreenHackedChance.Value); CauldronRedHackedChance = config.Bind<float>("02.1 Cauldron Hack大锅数据修改", "CauldronRedHackedChance", 0.2f, "Probability of a red cauldron being hacked. After being hacked, still use green items.\n红色大锅被黑的机率,被黑后仍然使用绿色物品交换"); CauldronRedHackedChance.Value = Math.Abs(CauldronRedHackedChance.Value); CauldronYellowWeight = config.Bind<float>("02.1 Cauldron Hack大锅数据修改", "CauldronYellowWeight", 0.33f, "(After being hacked)Weight of yellow items. \n(被黑后)大锅出现黄色物品的比重"); CauldronYellowWeight.Value = Math.Abs(CauldronYellowWeight.Value); CauldronBlueWeight = config.Bind<float>("02.1 Cauldron Hack大锅数据修改", "CauldronBlueWeight", 0.33f, "(After being hacked)Weight of blue items.\n(被黑后)大锅出现蓝色物品的比重"); CauldronBlueWeight.Value = Math.Abs(CauldronBlueWeight.Value); CauldronPurpleWeight = config.Bind<float>("02.1 Cauldron Hack大锅数据修改", "CauldronPurpleWeight", 0.33f, "(After being hacked)Weight of purple items, yep, that's right, still use the red item exchange.\n(被黑后)大锅出现紫色物品的比重,用红色兑换"); CauldronPurpleWeight.Value = Math.Abs(CauldronPurpleWeight.Value); CauldronWhiteToGreenCost_Hacked = config.Bind<int>("02.1 Cauldron Hack大锅数据修改", "CauldronWhiteToGreenCost_Hacked", 3, "(After being hacked)Green cauldron requires the number of white items.\n(被黑后)绿锅需要物品数量"); CauldronWhiteToGreenCost_Hacked.Value = Math.Abs(CauldronWhiteToGreenCost_Hacked.Value); CauldronGreenToRedCost_Hacked = config.Bind<int>("02.1 Cauldron Hack大锅数据修改", "CauldronGreenToRedCost_Hacked", 5, "(After being hacked)Red cauldron requires the number of green items.\n(被黑后)红锅需要物品数量"); CauldronGreenToRedCost_Hacked.Value = Math.Abs(CauldronGreenToRedCost_Hacked.Value); CauldronRedToWhiteCost_Hacked = config.Bind<int>("02.1 Cauldron Hack大锅数据修改", "CauldronRedToWhiteCost_Hacked", 4, "(After being hacked)White cauldron requires the number of red items.\n(被黑后)白锅需要物品数量,为什么是4,因为白色大锅原本掉3件物品,为了平衡,被黑后会改成使用相同颜色装备兑换,紫色除外用红色兑换"); CauldronRedToWhiteCost_Hacked.Value = Math.Abs(CauldronRedToWhiteCost_Hacked.Value); } } ScrapperCount = config.Bind<int>("03 Scrapper收割机", "ScrapperCount", 4, "Total generated value of scrappers, max is 4, below zero is not enabled. \n月店收割机的数量,最多4台,小于0不启用"); if (ScrapperCount.Value > 4) { ScrapperCount.Value = 4; } EquipmentCount = config.Bind<int>("04 Equipment主动装备", "EquipmentCount", 6, "Total generated value of equipments, max is 6, below zero is not enabled. \n月店主动装备的数量,最多6台,小于0不启用"); if (EquipmentCount.Value > 6) { EquipmentCount.Value = 6; } LunarShopTerminalCount = config.Bind<int>("05 Lunar月球装备", "LunarShopTerminalCount", 11, "Total generated value of LunarShopTerminal, max is 11, below zero is not enabled. \n月店月球装备的数量,最多11个,包括原有的5个,小于0不启用"); if (LunarShopTerminalCount.Value > 11) { LunarShopTerminalCount.Value = 11; } EnableLunarShopTerminalInjection = config.Bind<bool>("05 Lunar月球装备", "EnableLunarShopTerminalInjection", true, "Enable LunarShopTerminal data modification.\n启用月球装备修改"); if (EnableLunarShopTerminalInjection.Value) { LunarShopTerminalCost = config.Bind<int>("05 Lunar月球装备", "LunarShopTerminalCost", 2, "Price of Lunar\n月球装备价格"); LunarShopTerminalCost.Value = Math.Abs(LunarShopTerminalCost.Value); } EnableShrineRestack = config.Bind<bool>("06 ShrineRestack跌序", "EnableShrineRestack", true, "Enable shrinerestack.\n启用跌序"); if (EnableShrineRestack.Value) { ShrineRestackMaxCount = config.Bind<int>("06 ShrineRestack跌序", "ShrineRestackMaxCount", 99, "The value of total restack times. Download this mod [BazaarLunarForEveryOne] can be limited to once per person.\n