using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text;
using BepInEx;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using Malee;
using Microsoft.CodeAnalysis;
using ShinyShoe;
using SimpleInjector;
using TrainworksReloaded.Base;
using TrainworksReloaded.Core;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("BalanceConfigurator.Plugin")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("2.1.0.0")]
[assembly: AssemblyInformationalVersion("2.1.0+990afa6404e8c1700144467bf7bfd1ac2850e786")]
[assembly: AssemblyProduct("BalanceConfigurator.Plugin")]
[assembly: AssemblyTitle("BalanceConfigurator.Plugin")]
[assembly: AssemblyVersion("2.1.0.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace BalanceConfigurator.Plugin
{
internal class ConfigDescriptionBuilder
{
public string English { get; set; } = "";
public string French { get; set; } = "";
public string German { get; set; } = "";
public string Russian { get; set; } = "";
public string Portuguese { get; set; } = "";
public string Chinese { get; set; } = "";
public string Spanish { get; set; } = "";
public string ChineseTraditional { get; set; } = "";
public string Korean { get; set; } = "";
public string Japanese { get; set; } = "";
public override string ToString()
{
StringBuilder stringBuilder = new StringBuilder();
if (!string.IsNullOrEmpty(English))
{
stringBuilder.AppendLine(English);
}
if (!string.IsNullOrEmpty(French))
{
stringBuilder.AppendLine(French);
}
if (!string.IsNullOrEmpty(German))
{
stringBuilder.AppendLine(German);
}
if (!string.IsNullOrEmpty(Russian))
{
stringBuilder.AppendLine(Russian);
}
if (!string.IsNullOrEmpty(Portuguese))
{
stringBuilder.AppendLine(Portuguese);
}
if (!string.IsNullOrEmpty(Chinese))
{
stringBuilder.AppendLine(Chinese);
}
if (!string.IsNullOrEmpty(Spanish))
{
stringBuilder.AppendLine(Spanish);
}
if (!string.IsNullOrEmpty(ChineseTraditional))
{
stringBuilder.AppendLine(ChineseTraditional);
}
if (!string.IsNullOrEmpty(Korean))
{
stringBuilder.AppendLine(Korean);
}
if (!string.IsNullOrEmpty(Japanese))
{
stringBuilder.AppendLine(Japanese);
}
return stringBuilder.ToString().TrimEnd();
}
}
[BepInPlugin("BalanceConfigurator.Plugin", "BalanceConfigurator.Plugin", "2.1.0")]
public class Plugin : BaseUnityPlugin
{
internal static ManualLogSource Logger = new ManualLogSource("BalanceConfigurator.Plugin");
private ConfigEntry<int>? startingGold;
private ConfigEntry<int>? maxHandSize;
private ConfigEntry<int>? startOfTurnEnergy;
private ConfigEntry<int>? startOfDeploymentPhaseEnergy;
private ConfigEntry<int>? maxEnergy;
private ConfigEntry<int>? initialDragonsHoardCap;
private ConfigEntry<int>? maxDragonsHoard;
private ConfigEntry<int>? startOfTurnCards;
private ConfigEntry<int>? unitUpgradeSlots;
private ConfigEntry<int>? spellUpgradeSlots;
private ConfigEntry<int>? equipmentUpgradeSlots;
private ConfigEntry<int>? numSpawnPointsPerFloor;
private ConfigEntry<int>? characterCapacityPerFloor;
private ConfigEntry<int>? maxMutatorCount;
private ConfigEntry<int>? championUpgradesShown;
private ConfigEntry<float>? mainClanXpFactor;
private ConfigEntry<float>? subClanXpFactor;
private ConfigEntry<int>? alternateChampionUnlockLevel;
private ConfigEntry<int>? cardRarityTicketCommon;
private ConfigEntry<int>? cardRarityTicketUncommon;
private ConfigEntry<int>? cardRarityTicketRare;
private ConfigEntry<int>? cardRarityTicketChampion;
private ConfigEntry<int>? enhancerRarityTicketCommon;
private ConfigEntry<int>? enhancerRarityTicketUncommon;
private ConfigEntry<int>? enhancerRarityTicketRare;
private ConfigEntry<int>? enhancerRarityTicketChampion;
private ConfigEntry<int>? relicRarityTicketCommon;
private ConfigEntry<int>? relicRarityTicketUncommon;
private ConfigEntry<int>? relicRarityTicketRare;
private ConfigEntry<int>? relicRarityTicketChampion;
private ConfigEntry<int>? goldSkipCardDraft;
private ConfigEntry<int>? goldSkipRelicDraft;
private ConfigEntry<int>? goldSkipChampionUpgrade;
private ConfigEntry<int>? goldSkipIndividualRelic;
private ConfigEntry<int>? goldSkipIndividualCard;
private ConfigEntry<int>? goldSkipPurge;
private ConfigEntry<int>? goldSkipLevelUpUnit;
private ConfigEntry<int>? chanceOfOptionalOutpostDialogue;
private ConfigEntry<float>? fastDialogueMultiplier;
private ConfigEntry<int>? draftCostCommonCardMin;
private ConfigEntry<int>? draftCostCommonCardMax;
private ConfigEntry<int>? draftCostUncommonCardMin;
private ConfigEntry<int>? draftCostUncommonCardMax;
private ConfigEntry<int>? draftCostRareCardMin;
private ConfigEntry<int>? draftCostRareCardMax;
private ConfigEntry<int>? draftCostCommonRelicMin;
private ConfigEntry<int>? draftCostCommonRelicMax;
private ConfigEntry<int>? draftCostUncommonRelicMin;
private ConfigEntry<int>? draftCostUncommonRelicMax;
private ConfigEntry<int>? draftCostRareRelicMin;
private ConfigEntry<int>? draftCostRareRelicMax;
private ConfigEntry<int>? draftCostCommonEnhancerMin;
private ConfigEntry<int>? draftCostCommonEnhancerMax;
private ConfigEntry<int>? draftCostUncommonEnhancerMin;
private ConfigEntry<int>? draftCostUncommonEnhancerMax;
private ConfigEntry<int>? draftCostRareEnhancerMin;
private ConfigEntry<int>? draftCostRareEnhancerMax;
private ConfigEntry<int>? balatroEvent;
private ConfigEntry<int>? boneDogTitan;
private ConfigEntry<int>? classPotionsTitan;
private ConfigEntry<int>? classSpikes;
private ConfigEntry<int>? classTomes;
private ConfigEntry<int>? clippedWings;
private ConfigEntry<int>? copier;
private ConfigEntry<int>? corruptedAngels;
private ConfigEntry<int>? cultOfTheLambEvent;
private ConfigEntry<int>? danteReturns;
private ConfigEntry<int>? garfieldBoxes;
private ConfigEntry<int>? inkboundEvent;
private ConfigEntry<int>? inscryptionEvent;
private ConfigEntry<int>? lazarusLeagueLab;
private ConfigEntry<int>? mothersRemnant;
private ConfigEntry<int>? moreOrLessArtifacts;
private ConfigEntry<int>? nonclassCards;
private ConfigEntry<int>? pathOfTheAngel;
private ConfigEntry<int>? penanceFields;
private ConfigEntry<int>? purifyingFlame;
private ConfigEntry<int>? pyreHeartUpgrade;
private ConfigEntry<int>? theOldOrder;
private ConfigEntry<int>? titanDominion;
private ConfigEntry<int>? titanEntropy;
private ConfigEntry<int>? titanSavagery;
private ConfigEntry<int>? trainRoomInstall;
private ConfigEntry<bool>? shatteredHaloAffectsBanners;
private ConfigEntry<uint>? numberOfBannerDraftCards;
private ConfigEntry<bool>? eliminateRunRarityFloor;
private ConfigEntry<bool>? eliminateRarityFloorArmsShop;
private ConfigEntry<bool>? allowCardMasteryForAllRunTypes;
private ConfigEntry<int>? runHistoryMaxEntries;
public void Awake()
{
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
Logger = ((BaseUnityPlugin)this).Logger;
FormConfiguration();
Railend.ConfigurePostAction((Action<Container>)delegate(Container c)
{
SaveManager val = default(SaveManager);
if (!c.GetInstance<GameDataClient>().TryGetProvider<SaveManager>(ref val))
{
Logger.LogError((object)"Failed to get SaveManager instance please report this https://github.com/Monster-Train-2-Modding-Group/Balance-Configurator/issues");
}
else
{
AllGameData allGameData = val.GetAllGameData();
ReconfigureBalance(allGameData);
}
});
new Harmony("BalanceConfigurator.Plugin").PatchAll();
Logger.LogInfo((object)"Plugin BalanceConfigurator.Plugin is loaded!");
}
private void FormConfiguration()
{
//IL_0447: Unknown result type (might be due to invalid IL or missing references)
//IL_0451: Expected O, but got Unknown
//IL_0917: Unknown result type (might be due to invalid IL or missing references)
//IL_0921: Expected O, but got Unknown
//IL_0e36: Unknown result type (might be due to invalid IL or missing references)
//IL_0e3c: Expected O, but got Unknown
//IL_11c1: Unknown result type (might be due to invalid IL or missing references)
//IL_11cb: Expected O, but got Unknown
startingGold = ((BaseUnityPlugin)this).Config.Bind<int>("Gold", "Starting Gold", 50, new ConfigDescriptionBuilder
{
English = "Starting Gold in a run.",
Chinese = "修改一轮游戏的初始金钱。"
}.ToString());
startOfTurnCards = ((BaseUnityPlugin)this).Config.Bind<int>("Hand Size", "Initial Hand Size", 5, new ConfigDescriptionBuilder
{
English = "Starting hand size.",
Chinese = "修改每回合的初始抽牌数量。"
}.ToString());
maxHandSize = ((BaseUnityPlugin)this).Config.Bind<int>("Hand Size", "Max Hand Size", 10, new ConfigDescriptionBuilder
{
English = "Maximum hand size possible.",
Chinese = "修改手牌数量上限。"
}.ToString());
startOfTurnEnergy = ((BaseUnityPlugin)this).Config.Bind<int>("Ember", "Starting Ember", 3, new ConfigDescriptionBuilder
{
English = "Starting ember gained per turn in a run.",
Chinese = "修改每回合获得的初始余烬数量。"
}.ToString());
startOfDeploymentPhaseEnergy = ((BaseUnityPlugin)this).Config.Bind<int>("Ember", "Deployment Phase Ember", 1, new ConfigDescriptionBuilder
{
English = "Extra ember given during the Deployment Phase.",
Chinese = "修改初始部署余烬数量。"
}.ToString());
maxEnergy = ((BaseUnityPlugin)this).Config.Bind<int>("Ember", "Maximum Ember", 99, new ConfigDescriptionBuilder
{
English = "Maximum ember that is possible during a turn.",
Chinese = "修改余烬数量上限。"
}.ToString());
initialDragonsHoardCap = ((BaseUnityPlugin)this).Config.Bind<int>("Dragons Hoard", "Initial Dragons Hoard Cap", 8, new ConfigDescriptionBuilder
{
English = "Initial cap on Dragons Hoard.",
Chinese = "修改龙族宝藏的初始数量上限。"
}.ToString());
maxDragonsHoard = ((BaseUnityPlugin)this).Config.Bind<int>("Dragons Hoard", "Maximum Dragons Hoard Cap", 13, new ConfigDescriptionBuilder
{
English = "Maximum cap on Dragons Hoard that's possible in given run.",
Chinese = "修改龙族宝藏的最大数量上限。"
}.ToString());
unitUpgradeSlots = ((BaseUnityPlugin)this).Config.Bind<int>("Upgrades and Slots", "Unit Upgrade Slots", 2, new ConfigDescriptionBuilder
{
English = "Initial amount of unit upgrade slots available.",
Chinese = "修改单位的初始升级栏位数量。"
}.ToString());
spellUpgradeSlots = ((BaseUnityPlugin)this).Config.Bind<int>("Upgrades and Slots", "Spell Upgrade Slots", 2, new ConfigDescriptionBuilder
{
English = "Initial amount of spell upgrade slots available.",
Chinese = "修改法术的初始升级栏位数量。"
}.ToString());
equipmentUpgradeSlots = ((BaseUnityPlugin)this).Config.Bind<int>("Upgrades and Slots", "Equipment Upgrade Slots", 0, new ConfigDescriptionBuilder
{
English = "Initial amount of equipment upgrade slots available (Currently equipment can't be upgraded).",
Chinese = "修改装备的初始升级栏位数量(目前装备无法升级)。"
}.ToString());
championUpgradesShown = ((BaseUnityPlugin)this).Config.Bind<int>("Upgrades and Slots", "Champion Upgrades Shown", 2, new ConfigDescriptionBuilder
{
English = "Number of champion upgrades shown in the Light Forge.",
Chinese = "修改光之锻炉出现的勇者升级数量。"
}.ToString());
numSpawnPointsPerFloor = ((BaseUnityPlugin)this).Config.Bind<int>("Floor Balance", "Num Spawn Points Per Floor", 7, new ConfigDescriptionBuilder
{
English = "Maximum number of spawn points (characters) that can be present on a side of the floor.",
Chinese = "修改每层每方势力的单位数量上限。"
}.ToString());
characterCapacityPerFloor = ((BaseUnityPlugin)this).Config.Bind<int>("Floor Balance", "Character Capacity Per Floor", 5, new ConfigDescriptionBuilder
{
English = "Initial amount of capacity per floor.",
Chinese = "修改每层的初始容量值。"
}.ToString());
maxMutatorCount = ((BaseUnityPlugin)this).Config.Bind<int>("Mutators", "Max Mutator Count", 3, new ConfigDescriptionBuilder
{
English = "Maximum amount of mutators that can be applied to a run.",
Chinese = "修改一轮游戏的转变器数量上限。"
}.ToString());
mainClanXpFactor = ((BaseUnityPlugin)this).Config.Bind<float>("XP and Unlocks", "Main Clan Xp Factor", 1f, new ConfigDescriptionBuilder
{
English = "Scales the base amount of XP amount given to the primary clan at the end of a run.",
Chinese = "修改在一轮游戏结束之后,主氏族获得经验的倍率。"
}.ToString());
subClanXpFactor = ((BaseUnityPlugin)this).Config.Bind<float>("XP and Unlocks", "Sub Clan Xp Factor", 0.5f, new ConfigDescriptionBuilder
{
English = "Scales the base amount of XP amount given to the allied clan at the end of a run.",
Chinese = "修改在一轮游戏结束之后,盟友氏族获得经验的倍率。"
}.ToString());
alternateChampionUnlockLevel = ((BaseUnityPlugin)this).Config.Bind<int>("XP and Unlocks", "Alternate Champion Unlock Level", 5, new ConfigDescription(new ConfigDescriptionBuilder
{
English = "The level at which the alternate champion is available.",
Chinese = "修改备选勇者的解锁等级。"
}.ToString(), (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 10), Array.Empty<object>()));
cardRarityTicketCommon = ((BaseUnityPlugin)this).Config.Bind<int>("Card Rarity Ticket Counts", "Common", 940, new ConfigDescriptionBuilder
{
English = "Number of tickets that will produce a common card when drafting a card. (Rings 1 & 2 only, non banner drafts)",
Chinese = "修改自选卡牌时,普通卡牌出现的权重。出现的几率为该权重占权重总和中的比例。(仅前2层区域的除战旗以外的自选卡牌)"
}.ToString());
cardRarityTicketUncommon = ((BaseUnityPlugin)this).Config.Bind<int>("Card Rarity Ticket Counts", "Uncommon", 55, new ConfigDescriptionBuilder
{
English = "Number of tickets that will produce a uncommon card when drafting a card.",
Chinese = "修改自选卡牌时,高级卡牌出现的权重。出现的几率为该权重占权重总和中的比例。"
}.ToString());
cardRarityTicketRare = ((BaseUnityPlugin)this).Config.Bind<int>("Card Rarity Ticket Counts", "Rare", 5, new ConfigDescriptionBuilder
{
English = "Number of tickets that will produce a rare card when drafting a card.",
Chinese = "修改自选卡牌时,稀有卡牌出现的权重。出现的几率为该权重占权重总和中的比例。"
}.ToString());
cardRarityTicketChampion = ((BaseUnityPlugin)this).Config.Bind<int>("Card Rarity Ticket Counts", "Champion", 0, new ConfigDescriptionBuilder
{
English = "(Unused) number of tickets that will produce a champion card in a card draft.",
Chinese = "(未使用)修改自选卡牌时,勇者卡牌出现的权重。出现的几率为该权重占权重总和中的比例。"
}.ToString());
enhancerRarityTicketCommon = ((BaseUnityPlugin)this).Config.Bind<int>("Enhancer (Shop Upgrade) Rarity Ticket Counts", "Common", 70, new ConfigDescriptionBuilder
{
English = "Number of tickets that will produce a common enhancer when finding an enhancer.",
Chinese = "修改商店升级时,普通升级石出现的权重。出现的几率为该权重占权重总和中的比例。"
}.ToString());
enhancerRarityTicketUncommon = ((BaseUnityPlugin)this).Config.Bind<int>("Enhancer (Shop Upgrade) Rarity Ticket Counts", "Uncommon", 30, new ConfigDescriptionBuilder
{
English = "Number of tickets that will produce a uncommon enhancer when finding an enhancer.",
Chinese = "修改商店升级时,高级升级石出现的权重。出现的几率为该权重占权重总和中的比例。"
}.ToString());
enhancerRarityTicketRare = ((BaseUnityPlugin)this).Config.Bind<int>("Enhancer (Shop Upgrade) Rarity Ticket Counts", "Rare", 0, new ConfigDescriptionBuilder
{
English = "Number of tickets that will produce a rare enhancer when finding an enhancer.",
Chinese = "修改商店升级时,稀有升级石出现的权重。出现的几率为该权重占权重总和中的比例。"
}.ToString());
enhancerRarityTicketChampion = ((BaseUnityPlugin)this).Config.Bind<int>("Enhancer (Shop Upgrade) Rarity Ticket Counts", "Champion", 0, new ConfigDescriptionBuilder
{
English = "(Unused) number of tickets that will produce a champion enhancer when finding an enhancer.",
Chinese = "(未使用)修改商店升级时,勇者升级石出现的权重。出现的几率为该权重占权重总和中的比例。"
}.ToString());
relicRarityTicketCommon = ((BaseUnityPlugin)this).Config.Bind<int>("Relic Rarity Ticket Counts", "Common", 80, new ConfigDescriptionBuilder
{
English = "Number of tickets that will produce a common relic when drafting a relic.",
Chinese = "修改自选神器时,普通神器出现的权重。出现的几率为该权重占权重总和中的比例。"
}.ToString());
relicRarityTicketUncommon = ((BaseUnityPlugin)this).Config.Bind<int>("Relic Rarity Ticket Counts", "Uncommon", 20, new ConfigDescriptionBuilder
{
English = "Number of tickets that will produce a uncommon relic when drafting a relic.",
Chinese = "修改自选神器时,高级神器出现的权重。出现的几率为该权重占权重总和中的比例。"
}.ToString());
relicRarityTicketRare = ((BaseUnityPlugin)this).Config.Bind<int>("Relic Rarity Ticket Counts", "Rare", 0, new ConfigDescriptionBuilder
{
English = "Number of tickets that will produce a rare relic when drafting a relic.",
Chinese = "修改自选神器时,稀有神器出现的权重。出现的几率为该权重占权重总和中的比例。"
}.ToString());
relicRarityTicketChampion = ((BaseUnityPlugin)this).Config.Bind<int>("Relic Rarity Ticket Counts", "Champion", 0, new ConfigDescriptionBuilder
{
English = "Unused no chance of finding a champion relic in a relic draft.",
Chinese = "(未使用)修改自选神器时,勇者神器出现的权重。出现的几率为该权重占权重总和中的比例。"
}.ToString());
goldSkipCardDraft = ((BaseUnityPlugin)this).Config.Bind<int>("Gold For Skipping Rewards", "Card Draft", 10, new ConfigDescriptionBuilder
{
English = "Gold for skipping a Card Draft.",
Chinese = "修改跳过自选卡牌时获得的金钱。"
}.ToString());
goldSkipRelicDraft = ((BaseUnityPlugin)this).Config.Bind<int>("Gold For Skipping Rewards", "Relic Draft", 25, new ConfigDescriptionBuilder
{
English = "Gold for skipping a Relic Draft.",
Chinese = "修改跳过自选神器时获得的金钱。"
}.ToString());
goldSkipChampionUpgrade = ((BaseUnityPlugin)this).Config.Bind<int>("Gold For Skipping Rewards", "Champion Upgrade Draft", 0, new ConfigDescriptionBuilder
{
English = "Gold for skipping a Champion Upgrade.",
Chinese = "修改跳过勇者升级时获得的金钱。"
}.ToString());
goldSkipIndividualRelic = ((BaseUnityPlugin)this).Config.Bind<int>("Gold For Skipping Rewards", "Individual Relic", 25, new ConfigDescriptionBuilder
{
English = "Gold for skipping a singular Relic Draft.",
Chinese = "修改跳过单件神器时获得的金钱。"
}.ToString());
goldSkipIndividualCard = ((BaseUnityPlugin)this).Config.Bind<int>("Gold For Skipping Rewards", "Individual Card", 10, new ConfigDescriptionBuilder
{
English = "Gold for skipping a singular Card Draft.",
Chinese = "修改跳过单张卡牌时获得的金钱。"
}.ToString());
goldSkipPurge = ((BaseUnityPlugin)this).Config.Bind<int>("Gold For Skipping Rewards", "Purge", 0, new ConfigDescriptionBuilder
{
English = "Gold for skipping a Purge.",
Chinese = "修改跳过移除卡牌时获得的金钱。"
}.ToString());
goldSkipLevelUpUnit = ((BaseUnityPlugin)this).Config.Bind<int>("Gold For Skipping Rewards", "Level Up Unit", 0, new ConfigDescriptionBuilder
{
English = "(Unused) Gold for skipping a Level Up Unit.",
Chinese = "(未使用)修改跳过升级单位时获得的金钱。"
}.ToString());
chanceOfOptionalOutpostDialogue = ((BaseUnityPlugin)this).Config.Bind<int>("Dialogues", "Chance of Optional Output Dialogue", 30, new ConfigDescription(new ConfigDescriptionBuilder
{
English = "Percentage chance of getting an optional outpost dialogue after a run.",
Chinese = "修改在一轮游戏结束之后,契约前哨站可选对话的出现概率百分比。"
}.ToString(), (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>()));
fastDialogueMultiplier = ((BaseUnityPlugin)this).Config.Bind<float>("Dialogues", "Fast Dialog Multiplier", 2f, new ConfigDescriptionBuilder
{
English = "Multiplier for fast dialogues.",
Chinese = "修改对话的速度倍率。"
}.ToString());
draftCostCommonCardMin = ((BaseUnityPlugin)this).Config.Bind<int>("Card Draft Costs", "Minimum Cost Common Card", 20, new ConfigDescriptionBuilder
{
English = "Minimum cost of a common card.",
Chinese = "修改普通卡牌的最低价格。"
}.ToString());
draftCostCommonCardMax = ((BaseUnityPlugin)this).Config.Bind<int>("Card Draft Costs", "Maximum Cost Common Card", 20, new ConfigDescriptionBuilder
{
English = "Maximum cost of an common card.",
Chinese = "修改普通卡牌的最高价格。"
}.ToString());
draftCostUncommonCardMin = ((BaseUnityPlugin)this).Config.Bind<int>("Card Draft Costs", "Minimum Cost Uncommon Card", 40, new ConfigDescriptionBuilder
{
English = "Minimum cost of a uncommon card.",
Chinese = "修改高级卡牌的最低价格。"
}.ToString());
draftCostUncommonCardMax = ((BaseUnityPlugin)this).Config.Bind<int>("Card Draft Costs", "Maximum Cost Uncommon Card", 40, new ConfigDescriptionBuilder
{
English = "Maximum cost of an uncommon card.",
Chinese = "修改高级卡牌的最高价格。"
}.ToString());
draftCostRareCardMin = ((BaseUnityPlugin)this).Config.Bind<int>("Card Draft Costs", "Minimum Cost Rare Card", 90, new ConfigDescriptionBuilder
{
English = "Minimum cost of a rare card.",
Chinese = "修改稀有卡牌的最低价格。"
}.ToString());
draftCostRareCardMax = ((BaseUnityPlugin)this).Config.Bind<int>("Card Draft Costs", "Maximum Cost Rare Card", 90, new ConfigDescriptionBuilder
{
English = "Maximum cost of a rare card.",
Chinese = "修改稀有卡牌的最高价格。"
}.ToString());
draftCostCommonRelicMin = ((BaseUnityPlugin)this).Config.Bind<int>("Relic Draft Costs", "Minimum Cost Common Relic", 125, new ConfigDescriptionBuilder
{
English = "Minimum cost of a common artifact.",
Chinese = "修改普通神器的最低价格。"
}.ToString());
draftCostCommonRelicMax = ((BaseUnityPlugin)this).Config.Bind<int>("Relic Draft Costs", "Maximum Cost Common Relic", 175, new ConfigDescriptionBuilder
{
English = "Maximum cost of an common artifact.",
Chinese = "修改普通神器的最高价格。"
}.ToString());
draftCostUncommonRelicMin = ((BaseUnityPlugin)this).Config.Bind<int>("Relic Draft Costs", "Minimum Cost Uncommon Relic", 125, new ConfigDescriptionBuilder
{
English = "Minimum cost of a uncommon artifact.",
Chinese = "修改高级神器的最低价格。"
}.ToString());
draftCostUncommonRelicMax = ((BaseUnityPlugin)this).Config.Bind<int>("Relic Draft Costs", "Maximum Cost Uncommon Relic", 175, new ConfigDescriptionBuilder
{
English = "Maximum cost of an uncommon artifact.",
Chinese = "修改高级神器的最高价格。"
}.ToString());
draftCostRareRelicMin = ((BaseUnityPlugin)this).Config.Bind<int>("Relic Draft Costs", "Minimum Cost Rare Relic", 999, new ConfigDescriptionBuilder
{
English = "(Unused) Minimum cost of a rare shop artifact.",
Chinese = "(未使用)修改稀有神器的最低价格。"
}.ToString());
draftCostRareRelicMax = ((BaseUnityPlugin)this).Config.Bind<int>("Relic Draft Costs", "Maximum Cost Rare Relic", 999, new ConfigDescriptionBuilder
{
English = "(Unused) Maximum cost of a rare artifact.",
Chinese = "(未使用)修改稀有神器的最高价格。"
}.ToString());
draftCostCommonEnhancerMin = ((BaseUnityPlugin)this).Config.Bind<int>("Enhancer (Shop Upgrade) Draft Costs", "Minimum Cost Common Enhancer", 15, new ConfigDescriptionBuilder
{
English = "Minimum cost of a common shop upgrade.",
Chinese = "修改普通升级石的最低价格。"
}.ToString());
draftCostCommonEnhancerMax = ((BaseUnityPlugin)this).Config.Bind<int>("Enhancer (Shop Upgrade) Draft Costs", "Maximum Cost Common Enhancer", 25, new ConfigDescriptionBuilder
{
English = "Maximum cost of an common shop upgrade.",
Chinese = "修改普通升级石的最高价格。"
}.ToString());
draftCostUncommonEnhancerMin = ((BaseUnityPlugin)this).Config.Bind<int>("Enhancer (Shop Upgrade) Draft Costs", "Minimum Cost Uncommon Enhancer", 35, new ConfigDescriptionBuilder
{
English = "Minimum cost of a uncommon shop upgrade.",
Chinese = "修改高级升级石的最低价格。"
}.ToString());
draftCostUncommonEnhancerMax = ((BaseUnityPlugin)this).Config.Bind<int>("Enhancer (Shop Upgrade) Draft Costs", "Maximum Cost Uncommon Enhancer", 35, new ConfigDescriptionBuilder
{
English = "Maximum cost of an uncommon shop upgrade.",
Chinese = "修改高级升级石的最高价格。"
}.ToString());
draftCostRareEnhancerMin = ((BaseUnityPlugin)this).Config.Bind<int>("Enhancer (Shop Upgrade) Draft Costs", "Minimum Cost Rare Enhancer", 80, new ConfigDescriptionBuilder
{
English = "Minimum cost of a rare shop upgrade.",
Chinese = "修改稀有升级石的最低价格。"
}.ToString());
draftCostRareEnhancerMax = ((BaseUnityPlugin)this).Config.Bind<int>("Enhancer (Shop Upgrade) Draft Costs", "Maximum Cost Rare Enhancer", 110, new ConfigDescriptionBuilder
{
English = "Maximum cost of a rare shop upgrade.",
Chinese = "修改稀有升级石的最高价格。"
}.ToString());
runHistoryMaxEntries = ((BaseUnityPlugin)this).Config.Bind<int>("Run History Max Entries", "Run History", 100, new ConfigDescriptionBuilder
{
English = "Maximum number of entries allowed in Run History.",
Chinese = "修改历史记录的条目数量上限。"
}.ToString());
PatchRunHistory1.RunHistoryMaxEntries = runHistoryMaxEntries.Value;
ConfigDescription val = new ConfigDescription(new ConfigDescriptionBuilder
{
English = "Number of tickets that will produce this event.",
Chinese = "修改这个事件出现的权重。"
}.ToString(), (AcceptableValueBase)(object)new AcceptableValueRange<int>(0, 100), Array.Empty<object>());
cultOfTheLambEvent = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Cult of the Lamb", 7, val);
pathOfTheAngel = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Path of the Angel", 10, val);
penanceFields = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Penitent Suits", 10, val);
boneDogTitan = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Bone Dog", 10, val);
moreOrLessArtifacts = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Historian Records", 10, val);
pyreHeartUpgrade = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Divine Shards", 10, val);
trainRoomInstall = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Heph Blueprints", 10, val);
clippedWings = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Clipped Wings", 10, val);
danteReturns = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Dante Returns", 10, val);
classPotionsTitan = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Gremlin Looter", 10, val);
lazarusLeagueLab = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Plague Doctor", 10, val);
corruptedAngels = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Archus", 10, val);
classTomes = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Library", 15, val);
inscryptionEvent = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Inscryption", 15, val);
classSpikes = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Railspikes", 15, val);
titanDominion = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Fountain of Dominion", 15, val);
titanSavagery = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Savagery Statue", 15, val);
titanEntropy = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Entropy Crystals", 15, val);
inkboundEvent = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Inkbound", 15, val);
nonclassCards = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Wreckage Remains", 20, val);
copier = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Mysterious Mirror", 25, val);
garfieldBoxes = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Wondrous Boxes", 25, val);
balatroEvent = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Balatro", 25, val);
mothersRemnant = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Mothers Remnant", 10, val);
theOldOrder = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "The Old Order", 10, val);
purifyingFlame = ((BaseUnityPlugin)this).Config.Bind<int>("Story Ticket Counts", "Purifying Flame", 10, val);
shatteredHaloAffectsBanners = ((BaseUnityPlugin)this).Config.Bind<bool>("Unit Banner Drafts", "Shattered Halo Applies To Banner Drafts", false, new ConfigDescriptionBuilder
{
English = "Force Shattered Halo to apply to Banner Drafts as well as Card Drafts.",
Chinese = "修改破碎光环是否也对自选战旗生效。"
}.ToString());
numberOfBannerDraftCards = ((BaseUnityPlugin)this).Config.Bind<uint>("Unit Banner Drafts", "Number of Cards Offered For Unit Banner Drafts", 2u, new ConfigDescription(new ConfigDescriptionBuilder
{
English = "Number of unit cards offered for a clan banner map node.",
Chinese = "修改自选战旗出现的单位数量。"
}.ToString(), (AcceptableValueBase)(object)new AcceptableValueRange<uint>(1u, 3u), Array.Empty<object>()));
eliminateRunRarityFloor = ((BaseUnityPlugin)this).Config.Bind<bool>("Card Drafts", "Allow Common Cards After Ring 2", false, new ConfigDescriptionBuilder
{
English = "Eliminates the rarity floor for card drafts for battle rewards after ring 2. Highly recommended to adjust the Card Rarity Ticket Counts and lower the common rarity ticket count if you enable this.",
Chinese = "修改从3层开始是否会出现普通卡牌。如果启用,强烈建议修改各稀有度卡牌的出现权重,尤其是普通卡牌的出现权重。"
}.ToString());
eliminateRarityFloorArmsShop = ((BaseUnityPlugin)this).Config.Bind<bool>("Arms shop", "Allow Sale of Common Cards", false, new ConfigDescriptionBuilder
{
English = "Allows common rarity equipment and room cards to be sold at the arms shop.",
Chinese = "修改武器商人是否会售卖普通稀有度的装备或房间卡。"
}.ToString());
allowCardMasteryForAllRunTypes = ((BaseUnityPlugin)this).Config.Bind<bool>("Card Mastery", "Allow Cards to be Mastered From Any Run Type", false, new ConfigDescriptionBuilder
{
English = "Allows cards to be mastered in Dimensional Challenges, Custom Runs, and Community Challenges.",
Chinese = "修改位面挑战、自定义游戏和社区挑战是否也会精通卡牌。"
}.ToString());
PatchCardMastery.OverrideCardMasteryRuns = allowCardMasteryForAllRunTypes.Value;
}
private void ReconfigureBalance(AllGameData allGameData)
{
//IL_0310: Unknown result type (might be due to invalid IL or missing references)
//IL_033f: Unknown result type (might be due to invalid IL or missing references)
//IL_036e: Unknown result type (might be due to invalid IL or missing references)
//IL_039d: Unknown result type (might be due to invalid IL or missing references)
//IL_03cc: Unknown result type (might be due to invalid IL or missing references)
//IL_03fb: Unknown result type (might be due to invalid IL or missing references)
//IL_042a: Unknown result type (might be due to invalid IL or missing references)
//IL_0459: Unknown result type (might be due to invalid IL or missing references)
//IL_0488: Unknown result type (might be due to invalid IL or missing references)
BalanceData balanceData = allGameData.GetBalanceData();
List<RarityTicket> rarityTicket = GetRarityTicket(cardRarityTicketCommon, cardRarityTicketUncommon, cardRarityTicketRare, cardRarityTicketChampion);
List<RarityTicket> rarityTicket2 = GetRarityTicket(enhancerRarityTicketCommon, enhancerRarityTicketUncommon, enhancerRarityTicketRare, enhancerRarityTicketChampion);
List<RarityTicket> rarityTicket3 = GetRarityTicket(relicRarityTicketCommon, relicRarityTicketUncommon, relicRarityTicketRare, relicRarityTicketChampion);
GoldForSkippingRewardsData? goldForSkippingRewards = GetGoldForSkippingRewards();
SafeSetField<BalanceData>(balanceData, "cardRarityTicketValues", rarityTicket);
SafeSetField<BalanceData>(balanceData, "enhancerRarityTicketValues", rarityTicket2);
SafeSetField<BalanceData>(balanceData, "relicRarityTicketValues", rarityTicket3);
SafeSetField<BalanceData>(balanceData, "goldForSkippingRewards", goldForSkippingRewards);
SafeSetField<BalanceData>(balanceData, "startingGold", startingGold.Value);
SafeSetField<BalanceData>(balanceData, "maxHandSize", maxHandSize.Value);
SafeSetField<BalanceData>(balanceData, "startOfTurnEnergy", startOfTurnEnergy.Value);
SafeSetField<BalanceData>(balanceData, "startOfDeploymentPhaseEnergy", startOfDeploymentPhaseEnergy.Value);
SafeSetField<BalanceData>(balanceData, "maxEnergy", maxEnergy.Value);
SafeSetField<BalanceData>(balanceData, "initialDragonsHoardCap", initialDragonsHoardCap.Value);
SafeSetField<BalanceData>(balanceData, "maxDragonsHoard", maxDragonsHoard.Value);
SafeSetField<BalanceData>(balanceData, "startOfTurnCards", startOfTurnCards.Value);
SafeSetField<BalanceData>(balanceData, "unitUpgradeSlots", unitUpgradeSlots.Value);
SafeSetField<BalanceData>(balanceData, "spellUpgradeSlots", spellUpgradeSlots.Value);
SafeSetField<BalanceData>(balanceData, "equipmentUpgradeSlots", equipmentUpgradeSlots.Value);
SafeSetField<BalanceData>(balanceData, "numSpawnPointsPerFloor", numSpawnPointsPerFloor.Value);
SafeSetField<BalanceData>(balanceData, "characterCapacityPerFloor", characterCapacityPerFloor.Value);
SafeSetField<BalanceData>(balanceData, "maxMutatorCount", maxMutatorCount.Value);
SafeSetField<BalanceData>(balanceData, "championUpgradesShown", championUpgradesShown.Value);
SafeSetField<BalanceData>(balanceData, "mainClanXpFactor", mainClanXpFactor.Value);
SafeSetField<BalanceData>(balanceData, "subClanXpFactor", subClanXpFactor.Value);
SafeSetField<BalanceData>(balanceData, "alternateChampionUnlockLevel", alternateChampionUnlockLevel.Value);
SafeSetField<BalanceData>(balanceData, "chanceOfOptionalOutpostDialogue", chanceOfOptionalOutpostDialogue.Value);
SafeSetField<BalanceData>(balanceData, "fastDialogueMultiplier", fastDialogueMultiplier.Value);
if (SafeGetField<BalanceData>(balanceData, "draftCosts") is DraftCost[] array)
{
SafeSetField<DraftCost>(array[0], "costRange", (object)new Vector2Int(draftCostCommonCardMin.Value, draftCostCommonCardMax.Value));
SafeSetField<DraftCost>(array[1], "costRange", (object)new Vector2Int(draftCostUncommonCardMin.Value, draftCostUncommonCardMax.Value));
SafeSetField<DraftCost>(array[2], "costRange", (object)new Vector2Int(draftCostRareCardMin.Value, draftCostRareCardMax.Value));
SafeSetField<DraftCost>(array[3], "costRange", (object)new Vector2Int(draftCostCommonRelicMin.Value, draftCostCommonRelicMax.Value));
SafeSetField<DraftCost>(array[4], "costRange", (object)new Vector2Int(draftCostUncommonRelicMin.Value, draftCostUncommonRelicMax.Value));
SafeSetField<DraftCost>(array[5], "costRange", (object)new Vector2Int(draftCostRareRelicMin.Value, draftCostRareRelicMax.Value));
SafeSetField<DraftCost>(array[6], "costRange", (object)new Vector2Int(draftCostCommonEnhancerMin.Value, draftCostCommonEnhancerMax.Value));
SafeSetField<DraftCost>(array[7], "costRange", (object)new Vector2Int(draftCostUncommonEnhancerMin.Value, draftCostUncommonEnhancerMax.Value));
SafeSetField<DraftCost>(array[8], "costRange", (object)new Vector2Int(draftCostRareEnhancerMin.Value, draftCostRareEnhancerMax.Value));
}
foreach (KeyValuePair<string, ConfigEntry<int>> item in (IEnumerable<KeyValuePair<string, ConfigEntry<int>>>)new Dictionary<string, ConfigEntry<int>>
{
["CultOfTheLambEvent"] = cultOfTheLambEvent,
["PenanceFields"] = penanceFields,
["PathOfTheAngel"] = pathOfTheAngel,
["BoneDogTitan"] = boneDogTitan,
["MoreOrLessArtifacts"] = moreOrLessArtifacts,
["PyreHeartUpgrade"] = pyreHeartUpgrade,
["TrainRoomInstall"] = trainRoomInstall,
["ClippedWings"] = clippedWings,
["DanteReturns"] = danteReturns,
["ClassPotionsTitan"] = classPotionsTitan,
["LazarusLeagueLab"] = lazarusLeagueLab,
["CorruptedAngels"] = corruptedAngels,
["ClassTomes"] = classTomes,
["InscryptionEvent"] = inscryptionEvent,
["ClassSpikes"] = classSpikes,
["TitanDominion"] = titanDominion,
["TitanSavagery"] = titanSavagery,
["TitanEntropy"] = titanEntropy,
["InkboundEvent"] = inkboundEvent,
["NonclassCards"] = nonclassCards,
["Copier"] = copier,
["GarfieldBoxes"] = garfieldBoxes,
["BalatroEvent"] = balatroEvent,
["PurifyingFlame"] = purifyingFlame,
["TheOldOrder"] = theOldOrder,
["MothersRemnant1"] = mothersRemnant
})
{
StoryEventData val = allGameData.FindStoryEventDataByName(item.Key);
if (!((Object)(object)val == (Object)null))
{
SafeSetField<StoryEventData>(val, "priorityTicketCount", item.Value.Value);
}
}
MapNodeData obj = allGameData.FindMapNodeData("79d643b3-08e5-4114-8d04-feb8723bd49f");
RandomMapDataContainer val2 = (RandomMapDataContainer)(object)((obj is RandomMapDataContainer) ? obj : null);
if ((Object)(object)val2 != (Object)null && SafeGetField<RandomMapDataContainer>(val2, "mapNodeDataList") is ReorderableArray<MapNodeData> val3)
{
foreach (MapNodeData item2 in val3)
{
RewardNodeData val4 = (RewardNodeData)(object)((item2 is RewardNodeData) ? item2 : null);
if ((Object)(object)val4 == (Object)null || !((MapNodeData)val4).GetIsBannerNode() || !(SafeGetField<RewardNodeData>(val4, "rewards") is List<RewardData> list))
{
continue;
}
foreach (RewardData item3 in list)
{
DraftRewardData val5 = (DraftRewardData)(object)((item3 is DraftRewardData) ? item3 : null);
if (val5 != null)
{
SafeSetField<DraftRewardData>(val5, "ignoreRelicRarityOverride", !shatteredHaloAffectsBanners.Value);
SafeSetField<DraftRewardData>(val5, "draftOptionsCount", numberOfBannerDraftCards.Value);
}
}
}
}
GrantableRewardData obj2 = allGameData.FindRewardDataByName("CardDraftLevelUpUnitMainOrAllied");
DraftRewardData data = (DraftRewardData)(object)((obj2 is DraftRewardData) ? obj2 : null);
SafeSetField<DraftRewardData>(data, "ignoreRelicRarityOverride", !shatteredHaloAffectsBanners.Value);
GrantableRewardData obj3 = allGameData.FindRewardDataByName("CardDraftMainClassReward");
DraftRewardData data2 = (DraftRewardData)(object)((obj3 is DraftRewardData) ? obj3 : null);
SafeSetField<DraftRewardData>(data2, "useRunRarityFloors", !eliminateRunRarityFloor.Value);
GrantableRewardData obj4 = allGameData.FindRewardDataByName("CardDraftSubClassReward");
DraftRewardData data3 = (DraftRewardData)(object)((obj4 is DraftRewardData) ? obj4 : null);
SafeSetField<DraftRewardData>(data3, "useRunRarityFloors", !eliminateRunRarityFloor.Value);
MapNodeData obj5 = allGameData.FindMapNodeData("e2c67b52-4d52-48b5-b20a-c6f4c12e44fa");
MapNodeData obj6 = ((obj5 is MerchantData) ? obj5 : null);
RewardData obj7 = ((obj6 != null) ? ((MerchantData)obj6).GetReward(0).RewardData : null);
CardPoolRewardData data4 = (CardPoolRewardData)(object)((obj7 is CardPoolRewardData) ? obj7 : null);
RewardData obj8 = ((obj6 != null) ? ((MerchantData)obj6).GetReward(1).RewardData : null);
CardPoolRewardData data5 = (CardPoolRewardData)(object)((obj8 is CardPoolRewardData) ? obj8 : null);
if (eliminateRarityFloorArmsShop.Value)
{
SafeSetField<CardPoolRewardData>(data4, "rarityFilter", (object)(GrantableRarity)7);
SafeSetField<CardPoolRewardData>(data5, "rarityFilter", (object)(GrantableRarity)7);
}
}
private void SafeSetField<T>(T? data, string field, object? obj)
{
if (data == null)
{
Logger.LogError((object)"Internal Error data is null");
throw new ArgumentNullException("data");
}
if (obj == null)
{
Logger.LogWarning((object)("Not setting " + typeof(T).Name + " field " + field + " because the value to set is null (value specified may be invalid or field not present)"));
return;
}
try
{
Logger.LogDebug((object)$"Setting {typeof(T).Name} field {field} to {obj}");
AccessTools.Field(data.GetType(), field).SetValue(data, obj);
}
catch (Exception ex)
{
Logger.LogError((object)("Could not set " + typeof(T).Name + " field " + field + " because of an exception " + ex.Message));
}
}
private object? SafeGetField<T>(T? data, string field)
{
if (data == null)
{
Logger.LogError((object)"Internal Error data is null");
throw new ArgumentNullException("data");
}
try
{
Logger.LogDebug((object)("Getting " + typeof(T).Name + " field " + field));
return AccessTools.Field(data.GetType(), field).GetValue(data);
}
catch (Exception ex)
{
Logger.LogError((object)("Could not get " + typeof(T).Name + " field " + field + " because of an exception " + ex.Message));
}
return null;
}
private List<RarityTicket>? GetRarityTicket(ConfigEntry<int> common, ConfigEntry<int> uncommon, ConfigEntry<int> rare, ConfigEntry<int> champion)
{
//IL_0009: 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_0024: 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_0036: 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_0051: 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_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: 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)
return new List<RarityTicket>(4)
{
new RarityTicket
{
rarityType = (CollectableRarity)0,
ticketValue = common.Value
},
new RarityTicket
{
rarityType = (CollectableRarity)1,
ticketValue = uncommon.Value
},
new RarityTicket
{
rarityType = (CollectableRarity)2,
ticketValue = rare.Value
},
new RarityTicket
{
rarityType = (CollectableRarity)3,
ticketValue = champion.Value
}
};
}
private GoldForSkippingRewardsData? GetGoldForSkippingRewards()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
GoldForSkippingRewardsData value = default(GoldForSkippingRewardsData);
value.cardDraft = goldSkipCardDraft.Value;
value.blessingDraft = goldSkipRelicDraft.Value;
value.championUpgradeDraft = goldSkipChampionUpgrade.Value;
value.individualBlessing = goldSkipIndividualRelic.Value;
value.individualCard = goldSkipIndividualCard.Value;
value.purge = goldSkipPurge.Value;
value.levelUpUnit = goldSkipLevelUpUnit.Value;
return value;
}
}
[HarmonyPatch(typeof(SteamPlatformServices), "CreateEmptyRunHistory")]
internal class PatchRunHistory1
{
public static int RunHistoryMaxEntries;
public static void Postfix(ref IRunHistoryData __result)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
__result = (IRunHistoryData)new RunHistoryDataJson(RunHistoryMaxEntries);
}
}
[HarmonyPatch(typeof(StandalonePlatformServices), "CreateEmptyRunHistory")]
internal class PatchRunHistory2
{
public static void Postfix(ref IRunHistoryData __result)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
__result = (IRunHistoryData)new RunHistoryDataJson(PatchRunHistory1.RunHistoryMaxEntries);
}
}
[HarmonyPatch(typeof(RunTypeUtil), "AllowCardMastery")]
internal class PatchCardMastery
{
public static bool OverrideCardMasteryRuns;
public static bool Prefix(ref bool __result)
{
if (OverrideCardMasteryRuns)
{
__result = true;
return false;
}
return true;
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "BalanceConfigurator.Plugin";
public const string PLUGIN_NAME = "BalanceConfigurator.Plugin";
public const string PLUGIN_VERSION = "2.1.0";
}
}