Decompiled source of Steward Clan v0.6.1

plugins/StewardClan.Plugin.dll

Decompiled 3 hours ago
using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using Conductor.StatusEffects;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.Configuration;
using TrainworksReloaded.Core;
using TrainworksReloaded.Core.Extensions;
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("StewardClan.Plugin")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.6.1.0")]
[assembly: AssemblyInformationalVersion("0.6.1+6c909406063f484336e83557eb29bd1c0fa10b52")]
[assembly: AssemblyProduct("StewardClan.Plugin")]
[assembly: AssemblyTitle("StewardClan.Plugin")]
[assembly: AssemblyVersion("0.6.1.0")]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
	[CompilerGenerated]
	[Embedded]
	internal sealed class EmbeddedAttribute : Attribute
	{
	}
}
namespace System.Runtime.CompilerServices
{
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableAttribute : Attribute
	{
		public readonly byte[] NullableFlags;

		public NullableAttribute(byte P_0)
		{
			NullableFlags = new byte[1] { P_0 };
		}

		public NullableAttribute(byte[] P_0)
		{
			NullableFlags = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
	internal sealed class NullableContextAttribute : Attribute
	{
		public readonly byte Flag;

		public NullableContextAttribute(byte P_0)
		{
			Flag = P_0;
		}
	}
	[CompilerGenerated]
	[Embedded]
	[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
	internal sealed class RefSafetyRulesAttribute : Attribute
	{
		public readonly int Version;

		public RefSafetyRulesAttribute(int P_0)
		{
			Version = P_0;
		}
	}
}
namespace StewardClan.Plugin
{
	public sealed class RelicEffectAddStatusEffectOnPyreDamage : RelicEffectBase, IStatusEffectRelicEffect, ITowerDamageTakenModifiedRelicEffect, IRelicEffect
	{
		private StatusEffectStackData[] statusEffects = Array.Empty<StatusEffectStackData>();

		private List<CharacterState> damageTargets = new List<CharacterState>();

		private CollectTargetsData targetsData;

		private Type sourceTeam;

		private AddStatusEffectParams addStatusEffectParams = new AddStatusEffectParams();

		public override bool CanApplyInPreviewMode => true;

		public Currency Currency { get; private set; }

		public override PropDescriptions CreateEditorInspectorDescriptions()
		{
			//IL_0000: 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_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			//IL_0025: Expected O, but got Unknown
			//IL_002c: 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_0044: Expected O, but got Unknown
			//IL_0044: Expected O, but got Unknown
			//IL_004c: 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_0064: Expected O, but got Unknown
			//IL_0065: Expected O, but got Unknown
			PropDescriptions val = new PropDescriptions { };
			string fieldName;
			((Dictionary<string, PropDescription>)val)[fieldName] = new PropDescription("Target Mode", "", (Type)null, false);
			string fieldName2 = RelicEffectFieldNamesHelper.GetFieldName((RelicEffectFieldNames)0);
			((Dictionary<string, PropDescription>)val)[fieldName2] = new PropDescription("Target Team", "", (Type)null, false);
			string fieldName3 = RelicEffectFieldNamesHelper.GetFieldName((RelicEffectFieldNames)30);
			((Dictionary<string, PropDescription>)val)[fieldName3] = new PropDescription("Status Effects To Apply", "", (Type)null, false);
			return val;
		}

		public override void Initialize(RelicState relicState, RelicData srcRelicData, RelicEffectData relicEffectData)
		{
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: 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_0069: Unknown result type (might be due to invalid IL or missing references)
			((RelicEffectBase)this).Initialize(relicState, srcRelicData, relicEffectData);
			sourceTeam = relicEffectData.GetParamSourceTeam();
			Currency = (Currency)0;
			addStatusEffectParams.sourceRelicState = ((RelicEffectBase)this).SourceRelicState;
			statusEffects = relicEffectData.GetParamStatusEffects();
			targetsData.targetTeamType = sourceTeam;
			targetsData.ignorePyre = true;
			targetsData.inCombat = false;
			((CollectTargetsData)(ref targetsData)).Reset(relicEffectData.GetTargetMode());
		}

		public int ApplyModifiedDamage(int previousDamage, RelicEffectParams relicEffectParams, ICoreGameManagers coreGameManagers)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			if (previousDamage <= 0)
			{
				return previousDamage;
			}
			TargetHelper.CollectTargets(targetsData, coreGameManagers, ref damageTargets);
			foreach (CharacterState damageTarget in damageTargets)
			{
				StatusEffectStackData[] array = statusEffects;
				foreach (StatusEffectStackData val in array)
				{
					int count = val.count;
					damageTarget.AddStatusEffect(val.statusId, count, addStatusEffectParams, (CharacterState)null, true, false, true, false, false);
				}
			}
			return previousDamage;
		}

		public StatusEffectStackData[]? GetStatusEffects()
		{
			return statusEffects;
		}
	}
	public sealed class RelicEffectArmorOnCore : RelicEffectBase, IStatusEffectRelicEffect, IConstructStatusArmorModifier, IRelicEffect
	{
		private StatusEffectStackData[] statusEffects = Array.Empty<StatusEffectStackData>();

		public override bool CanApplyInPreviewMode => true;

		RelicState IConstructStatusArmorModifier.SourceRelicState => ((RelicEffectBase)this).SourceRelicState;

		public override PropDescriptions CreateEditorInspectorDescriptions()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			return new PropDescriptions();
		}

		public override void Initialize(RelicState relicState, RelicData srcRelicData, RelicEffectData relicEffectData)
		{
			((RelicEffectBase)this).Initialize(relicState, srcRelicData, relicEffectData);
			statusEffects = relicEffectData.GetParamStatusEffects();
		}

		public StatusEffectStackData[]? GetStatusEffects()
		{
			return statusEffects;
		}
	}
}
namespace Steward_Clan.Plugin
{
	public class CardEffectAddChampionCopy : CardEffectBase
	{
		public override bool CanPlayAfterBossDead => false;

		public override bool CanApplyInPreviewMode => false;

		public override PropDescriptions CreateEditorInspectorDescriptions()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			return new PropDescriptions();
		}

		public override bool TestEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams, ICoreGameManagers coreGameManagers)
		{
			return ((CardEffectBase)this).TestEffect(cardEffectState, cardEffectParams, coreGameManagers);
		}

		public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams, ICoreGameManagers coreGameManagers, ISystemManagers sysManagers)
		{
			SaveManager saveManager = coreGameManagers.GetSaveManager();
			CardManager cardManager = coreGameManagers.GetCardManager();
			List<CardState> list = new List<CardState>();
			list = cardManager.GetAllCards(list);
			foreach (CardState item in list)
			{
				if (item.GetCardDataID() == ((GameData)saveManager.GetMainChampionData().championCardData).GetID())
				{
					AddCardUpgradingInfo val = new AddCardUpgradingInfo
					{
						copyModifiersFromCard = item
					};
					CardState val2 = coreGameManagers.GetCardManager().AddNewCard(saveManager.GetMainChampionData().championCardData, (CardPile)3, false, false, val, true);
					if (val2 != null)
					{
						val2.UpdateDamageText();
						val2.UpdateCardBodyText((SaveManager)null);
					}
					break;
				}
			}
			yield break;
		}
	}
	public class CardEffectAddTempCardUpgradeToUnitsPerPlayedCost : CardEffectBase
	{
		public override bool TestEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams, ICoreGameManagers coreGameManagers)
		{
			if (cardEffectParams.targets.Count > 0)
			{
				return FetchPlayedCostStat(GetAffectedCard(cardEffectParams), coreGameManagers.GetCardStatistics(), coreGameManagers.GetMonsterManager(), coreGameManagers.GetRelicManager()) > 0;
			}
			return false;
		}

		private static CardState? GetAffectedCard(CardEffectParams cardEffectParams)
		{
			object obj = cardEffectParams.playedCard;
			if (obj == null)
			{
				CharacterState selfTarget = cardEffectParams.selfTarget;
				obj = ((selfTarget != null) ? selfTarget.GetSpawnerCard() : null);
				if (obj == null)
				{
					CharacterState cardTriggeredCharacter = cardEffectParams.cardTriggeredCharacter;
					if (cardTriggeredCharacter == null)
					{
						return null;
					}
					obj = cardTriggeredCharacter.GetSpawnerCard();
				}
			}
			return (CardState?)obj;
		}

		private int FetchPlayedCostStat(CardState? playedCard, CardStatistics cardStatistics, MonsterManager monsterManager, RelicManager relicManager)
		{
			if (playedCard == null)
			{
				return 0;
			}
			if (playedCard.IsConsumeRemainingEnergyCostType())
			{
				return playedCard.GetLastPlayedCost();
			}
			return playedCard.GetCost(cardStatistics, monsterManager, relicManager, (RoomState)null);
		}

		public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams, ICoreGameManagers coreGameManagers, ISystemManagers sysManagers)
		{
			SaveManager saveManager = coreGameManagers.GetSaveManager();
			CardManager cardManager = coreGameManagers.GetCardManager();
			int playedCost = FetchPlayedCostStat(GetAffectedCard(cardEffectParams), coreGameManagers.GetCardStatistics(), coreGameManagers.GetMonsterManager(), coreGameManagers.GetRelicManager());
			foreach (CharacterState target in cardEffectParams.targets)
			{
				CardUpgradeData paramCardUpgradeData = cardEffectState.GetParamCardUpgradeData();
				if (target.GetIsClone() && (Object)(object)paramCardUpgradeData != (Object)null && paramCardUpgradeData.GetExcludeFromClones())
				{
					continue;
				}
				CardUpgradeState upgradeState = new CardUpgradeState();
				upgradeState.Setup(cardEffectState.GetParamCardUpgradeData(), false, cardEffectParams.isFromHiddenTrigger);
				upgradeState.SetAttackDamage(upgradeState.GetAttackDamage() + playedCost * cardEffectState.GetParamInt());
				upgradeState.SetAdditionalHP(upgradeState.GetAdditionalHP() + playedCost * cardEffectState.GetAdditionalParamInt());
				yield return target.ApplyCardUpgrade(upgradeState, false, upgradeState.GetCardUpgradeDataId(), true, false, (CardState)null, (Action<UpgradeApplicationResult>)delegate
				{
					if (!saveManager.PreviewMode)
					{
						CardEffectAddCardUpgradeToUnits.ShowNotificationForUpgrade(upgradeState, target, coreGameManagers, sysManagers);
					}
				}, (TrainRoomAttachmentState)null, false);
				CardState spawnerCard = target.GetSpawnerCard();
				if (spawnerCard != null && !saveManager.PreviewMode && ((Object)(object)target.GetSourceCharacterData() == (Object)(object)spawnerCard.GetSpawnCharacterData() || (Object)(object)spawnerCard.GetSpawnCharacterData() == (Object)null))
				{
					CardUpgradeAnimationInfo val = new CardUpgradeAnimationInfo(spawnerCard, upgradeState, (CardPile)6, (CardPile)5, 1, 1);
					CardAnimator.DoAddRecentCardUpgrade.Dispatch(val);
					spawnerCard.GetTemporaryCardStateModifiers().AddUpgrade(upgradeState, (CardStateModifiers)null);
					spawnerCard.UpdateCardBodyText((SaveManager)null);
					cardManager.RefreshCardInHand(spawnerCard, true, false, false);
				}
			}
		}

		public override PropDescriptions CreateEditorInspectorDescriptions()
		{
			//IL_0000: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Expected O, but got Unknown
			return new PropDescriptions();
		}
	}
	public sealed class CardEffectCopyEquipment : CardEffectBase
	{
		public override PropDescriptions CreateEditorInspectorDescriptions()
		{
			//IL_0000: 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_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			//IL_0025: Expected O, but got Unknown
			//IL_002c: 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_0044: Expected O, but got Unknown
			//IL_0044: Expected O, but got Unknown
			//IL_0045: Expected O, but got Unknown
			PropDescriptions val = new PropDescriptions { };
			string fieldName;
			((Dictionary<string, PropDescription>)val)[fieldName] = new PropDescription("Duplication Filter", "", (Type)null, false);
			string fieldName2 = CardEffectFieldNamesHelper.GetFieldName((CardEffectFieldNames)0);
			((Dictionary<string, PropDescription>)val)[fieldName2] = new PropDescription("Num Copies", "If -1, copy all equipment", (Type)null, false);
			return val;
		}

		private bool CardFilterFunc(CardState checkCard, CardUpgradeMaskData? mask, RelicManager relicManager)
		{
			if ((Object)(object)mask != (Object)null)
			{
				if (mask.FilterCard<CardState>(checkCard, relicManager) && !checkCard.IsChampionCard())
				{
					return !checkCard.CanBeCopied();
				}
				return true;
			}
			if (!checkCard.IsChampionCard())
			{
				return !checkCard.CanBeCopied();
			}
			return true;
		}

		public override bool TestEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams, ICoreGameManagers coreGameManagers)
		{
			if (cardEffectParams.targets.Count == 0)
			{
				return false;
			}
			CharacterState val = cardEffectParams.targets[0];
			if ((Object)(object)val == (Object)null)
			{
				return false;
			}
			CardState val2 = val.GetEquipment().LastOrDefault();
			if (val2 == null)
			{
				return false;
			}
			return !CardFilterFunc(val2, cardEffectState.GetParamCardFilter(), coreGameManagers.GetRelicManager());
		}

		public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams, ICoreGameManagers coreGameManagers, ISystemManagers sysManagers)
		{
			if (cardEffectParams.targets.Count == 0 || coreGameManagers.GetSaveManager().PreviewMode)
			{
				yield break;
			}
			CharacterState val = cardEffectParams.targets[0];
			if ((Object)(object)val == (Object)null)
			{
				yield break;
			}
			CardState val2 = val.GetEquipment().LastOrDefault();
			if (val2 == null)
			{
				yield break;
			}
			string cardDataID = val2.GetCardDataID();
			CardData val3 = coreGameManagers.GetAllGameData().FindCardData(cardDataID);
			if (!((Object)(object)val3 == (Object)null))
			{
				AddCardUpgradingInfo val4 = new AddCardUpgradingInfo
				{
					copyModifiersFromCard = val2
				};
				CardState val5 = coreGameManagers.GetCardManager().AddNewCard(val3, (CardPile)0, false, false, val4, true);
				if (val5 != null)
				{
					val5.UpdateDamageText();
					val5.UpdateCardBodyText((SaveManager)null);
				}
			}
		}
	}
	public class CardEffectDamagePyre : CardEffectBase
	{
		private bool canApplyInPreviewMode;

		public override bool CanApplyInPreviewMode => canApplyInPreviewMode;

		public override PropDescriptions CreateEditorInspectorDescriptions()
		{
			//IL_0000: 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_001a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0024: Expected O, but got Unknown
			//IL_0024: Expected O, but got Unknown
			//IL_002c: 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_0044: Expected O, but got Unknown
			//IL_0044: Expected O, but got Unknown
			//IL_004b: 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_0063: Expected O, but got Unknown
			//IL_0063: Expected O, but got Unknown
			//IL_006a: Unknown result type (might be due to invalid IL or missing references)
			//IL_0078: Unknown result type (might be due to invalid IL or missing references)
			//IL_0082: Expected O, but got Unknown
			//IL_0082: Expected O, but got Unknown
			//IL_008a: 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_00a3: Expected O, but got Unknown
			//IL_00a3: Expected O, but got Unknown
			//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
			//IL_00bb: Unknown result type (might be due to invalid IL or missing references)
			//IL_00c5: Expected O, but got Unknown
			//IL_00c5: Expected O, but got Unknown
			//IL_00c6: Expected O, but got Unknown
			PropDescriptions val = new PropDescriptions { };
			string fieldName;
			((Dictionary<string, PropDescription>)val)[fieldName] = new PropDescription("Damage Amount", "", (Type)null, false);
			string fieldName2 = CardEffectFieldNamesHelper.GetFieldName((CardEffectFieldNames)25);
			((Dictionary<string, PropDescription>)val)[fieldName2] = new PropDescription("Use Range For Damage Amount", "", (Type)null, false);
			string fieldName3 = CardEffectFieldNamesHelper.GetFieldName((CardEffectFieldNames)3);
			((Dictionary<string, PropDescription>)val)[fieldName3] = new PropDescription("Min Damage Amount", "", (Type)null, false);
			string fieldName4 = CardEffectFieldNamesHelper.GetFieldName((CardEffectFieldNames)4);
			((Dictionary<string, PropDescription>)val)[fieldName4] = new PropDescription("Max Damage Amount", "", (Type)null, false);
			string fieldName5 = CardEffectFieldNamesHelper.GetFieldName((CardEffectFieldNames)5);
			((Dictionary<string, PropDescription>)val)[fieldName5] = new PropDescription("Range Multiplier", "", (Type)null, false);
			string fieldName6 = CardEffectFieldNamesHelper.GetFieldName((CardEffectFieldNames)27);
			((Dictionary<string, PropDescription>)val)[fieldName6] = new PropDescription("Use Status Effect Stack Multiplier", "Multiply the damage amount by the number of this type of status effect the target has.", (Type)null, false);
			return val;
		}

		public override void Setup(CardEffectState cardEffectState)
		{
			//IL_0009: Unknown result type (might be due to invalid IL or missing references)
			//IL_0010: Invalid comparison between Unknown and I4
			((CardEffectBase)this).Setup(cardEffectState);
			canApplyInPreviewMode = (int)cardEffectState.GetTargetMode() != 21;
		}

		public override bool TestEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams, ICoreGameManagers coreGameManagers)
		{
			//IL_001e: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Invalid comparison between Unknown and I4
			int intInRange = cardEffectState.GetIntInRange();
			bool flag = !cardEffectState.GetUseIntRange() || cardEffectState.GetParamMaxInt() > 0;
			bool flag2 = true;
			if ((int)cardEffectState.GetTargetMode() == 12)
			{
				flag2 = cardEffectParams.targets.Count > 0;
			}
			return intInRange >= 0 && flag2 && flag;
		}

		protected int GetDamageAmount(CardEffectState cardEffectState, CharacterState? selfTarget)
		{
			return cardEffectState.GetIntInRange();
		}

		public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams, ICoreGameManagers coreGameManagers, ISystemManagers sysManagers)
		{
			CombatManager combatManager = coreGameManagers.GetCombatManager();
			RandomManager.GetState((RngId)6);
			int damageAmount = GetDamageAmount(cardEffectState, cardEffectParams.selfTarget);
			int soundGateId = SoundManager.INVALID_SOUND_GATE;
			if ((int)cardEffectState.GetTargetMode() == 0)
			{
				soundGateId = combatManager.IgnoreDuplicateSounds(true);
			}
			for (int i = 0; i < cardEffectParams.targets.Count; i++)
			{
				CharacterState val = cardEffectParams.targets[i];
				yield return combatManager.ApplyDamageToTarget(damageAmount, val, new ApplyDamageToTargetParameters
				{
					playedCard = cardEffectParams.playedCard,
					finalEffectInSequence = cardEffectParams.finalEffectInSequence,
					relicState = cardEffectParams.sourceRelic,
					selfTarget = cardEffectParams.selfTarget,
					appliedVfx = cardEffectState.GetAppliedVFX(),
					appliedVfxId = cardEffectParams.appliedVfxId
				});
			}
			combatManager.ReleaseIgnoreDuplicateCuesHandle(soundGateId);
		}

		public override int GetEffectApplicationCount(CardEffectState cardEffectState, CardEffectParams _unused1, ICoreGameManagers coreGameManagers, ISystemManagers _unused2)
		{
			return GameEffectHelper.GetDamageEffectApplicationCount(cardEffectState, coreGameManagers);
		}

		public bool WillEffectKillTarget(CharacterState target, CardState card, CardEffectState cardEffectState, out int resultantDamage)
		{
			int damageAmount = GetDamageAmount(cardEffectState, null);
			int num = default(int);
			resultantDamage = target.GetDamageToTarget(damageAmount, (CharacterState)null, card, ref num, (Type)0);
			return resultantDamage >= target.GetHP();
		}

		public override string GetHintText(CardEffectState cardEffectState, CharacterState selfTarget)
		{
			//IL_0018: Unknown result type (might be due to invalid IL or missing references)
			//IL_0022: Expected O, but got Unknown
			int damageAmount = GetDamageAmount(cardEffectState, selfTarget);
			return LocalizationExtensions.Localize("CardTraitScalingAddDamage_CurrentScaling_CardText", (ILocalizationParameterContext)new LocalizedIntegers(new int[1] { damageAmount }));
		}
	}
	public sealed class CardEffectReplayLastTrigger : CardEffectBase
	{
		public override PropDescriptions CreateEditorInspectorDescriptions()
		{
			//IL_0000: 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_001b: Unknown result type (might be due to invalid IL or missing references)
			//IL_0025: Expected O, but got Unknown
			//IL_0025: Expected O, but got Unknown
			//IL_0026: Expected O, but got Unknown
			PropDescriptions val = new PropDescriptions { };
			string fieldName;
			((Dictionary<string, PropDescription>)val)[fieldName] = new PropDescription("Trigger", "", (Type)null, false);
			return val;
		}

		public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams, ICoreGameManagers coreGameManagers, ISystemManagers sysManagers)
		{
			if (cardEffectState == null || cardEffectParams == null || !((Object)(object)cardEffectParams.selfTarget != (Object)null))
			{
				yield break;
			}
			Type val = (Type)2;
			Trigger paramTrigger = cardEffectState.GetParamTrigger();
			CombatManager combatManager = coreGameManagers.GetCombatManager();
			BattleTriggers val2 = (BattleTriggers)typeof(CombatManager).GetMethod("GetBattleTriggerEffects", BindingFlags.Instance | BindingFlags.NonPublic).Invoke(combatManager, new object[2] { val, paramTrigger });
			if (val2 != null)
			{
				BattleTriggeredCardEffects val3 = val2.battleTriggeredCardEffects.LastOrDefault();
				if (val3 != null)
				{
					yield return combatManager.ApplyEffects(val3.cardEffects, cardEffectParams.selectedRoom, cardEffectParams.playedCard, false, (RelicState)null, cardEffectParams.selfTarget, cardEffectParams.dropLocation, true, (ApplyPreEffectsVfxAction)null, (ApplyPreEffectsAction)null, (ApplyEffectsAction)null, false, (CharacterState)null, (CharacterState)null, 1, (CharacterState)null, false, (CardTriggerType)2, (CharacterTriggerState)null, cardEffectParams.selfTarget, (RoomState)null, false, false, (CharacterState)null);
				}
			}
		}

		public override bool HasRandomTarget(CardEffectState cardEffectState, CombatManager combatManager)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0003: Unknown result type (might be due to invalid IL or missing references)
			//IL_0008: Unknown result type (might be due to invalid IL or missing references)
			//IL_000a: Unknown result type (might be due to invalid IL or missing references)
			//IL_000b: Unknown result type (might be due to invalid IL or missing references)
			Type val = (Type)2;
			Trigger paramTrigger = cardEffectState.GetParamTrigger();
			return combatManager.GetAnyBattleTriggerEffectsRandom(val, paramTrigger);
		}
	}
	[BepInPlugin("StewardClan.Plugin", "StewardClan.Plugin", "0.6.1")]
	public class Plugin : BaseUnityPlugin
	{
		internal static ManualLogSource Logger = new ManualLogSource("StewardClan.Plugin");

		public void Awake()
		{
			Logger = ((BaseUnityPlugin)this).Logger;
			Railhead.GetBuilder().Configure("StewardClan.Plugin", (Action<IConfigurationBuilder>)delegate(IConfigurationBuilder c)
			{
				ConfigurationExtensions.AddMergedJsonFile(c, new List<string>(41)
				{
					"json/plugin.json", "json/champions/champion_albert.json", "json/relics/relic_backup_generator.json", "json/relics/relic_construct_core.json", "json/relics/relic_emergency_protocol.json", "json/relics/relic_maintenance_manual.json", "json/relics/relic_storage_locker.json", "json/characters/character_bigger_steward.json", "json/characters/character_dependabot.json", "json/characters/character_fabricator.json",
					"json/characters/character_imptern.json", "json/characters/character_ludo_developer.json", "json/characters/character_mod_forger.json", "json/characters/character_overheating_computer.json", "json/characters/character_rusted_steward.json", "json/characters/character_unit_tester.json", "json/characters/character_winged_air_conditioner.json", "json/characters/character_wrench_head.json", "json/cards/card_back_to_basic.json", "json/cards/card_breaking_point.json",
					"json/cards/card_bypass.json", "json/cards/card_cache.json", "json/cards/card_ctrl_v.json", "json/cards/card_decompile.json", "json/cards/card_disarm.json", "json/cards/card_galvanize.json", "json/cards/card_gravitas.json", "json/cards/card_mechanical_outrage.json", "json/cards/card_memory_leak.json", "json/cards/card_overclock.json",
					"json/cards/card_process_data.json", "json/cards/card_pyre_refactor.json", "json/cards/card_sanity.json", "json/cards/card_scrap.json", "json/cards/card_steamburst.json", "json/cards/card_steward_spike.json", "json/cards/card_steward_tome.json", "json/cards/card_synthesize.json", "json/cards/card_try_catch.json", "json/cards/card_writeline.json",
					"json/enhancers/constructstone.json"
				});
			});
			Logger.LogInfo((object)"Plugin StewardClan.Plugin is loaded!");
		}
	}
	public static class MyPluginInfo
	{
		public const string PLUGIN_GUID = "StewardClan.Plugin";

		public const string PLUGIN_NAME = "StewardClan.Plugin";

		public const string PLUGIN_VERSION = "0.6.1";
	}
}