using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Reflection.Emit;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Text.Json;
using BepInEx;
using BepInEx.Logging;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Microsoft.Extensions.Configuration;
using Silk_Song_Song_Clan.Plugin;
using SimpleInjector;
using TrainworksReloaded.Base.Extensions;
using TrainworksReloaded.Core;
using TrainworksReloaded.Core.Enum;
using TrainworksReloaded.Core.Extensions;
using TrainworksReloaded.Core.Interfaces;
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("Silk_Song_Clan.Plugin")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("0.2.4.0")]
[assembly: AssemblyInformationalVersion("0.2.4+8c671cfd8200ca3e0296da2a67aa2925c4e2419d")]
[assembly: AssemblyProduct("Silk_Song_Clan.Plugin")]
[assembly: AssemblyTitle("Silk_Song_Clan.Plugin")]
[assembly: AssemblyVersion("0.2.4.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 Silk_Song_Song_Clan.Plugin
{
public class RelicEffectComboActive : RelicEffectBase
{
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();
}
}
}
namespace Silk_Song_Clan.Plugin
{
public class CardEffectAddCardUpgradeToUnitsFilter : CardEffectAddCardUpgradeToUnits
{
public override void Setup(CardEffectState cardEffectState)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
base.upgradeLifetime = (UnitUpgradeLifetime)cardEffectState.GetAdditionalParamInt1();
}
protected override void CollectTargetsForUpgrade(CardEffectState cardEffectState, CardEffectParams cardEffectParams, List<CharacterState> upgradeTargets, ICoreGameManagers coreGameManagers)
{
CardEffectState cardEffectState2 = cardEffectState;
ICoreGameManagers coreGameManagers2 = coreGameManagers;
((CardEffectAddCardUpgradeToUnits)this).CollectTargetsForUpgrade(cardEffectState2, cardEffectParams, upgradeTargets, coreGameManagers2);
upgradeTargets.RemoveAll((CharacterState unit) => !ShouldUpgrade(cardEffectState2, coreGameManagers2, unit));
}
public bool ShouldUpgrade(CardEffectState cardEffectState, ICoreGameManagers coreGameManagers, CharacterState unit)
{
CardUpgradeMaskData paramCardFilter = cardEffectState.GetParamCardFilter();
if ((Object)(object)paramCardFilter == (Object)null)
{
return true;
}
return paramCardFilter.FilterCharacter(unit, coreGameManagers.GetRelicManager());
}
}
public class CardEffectAddRelic : CardEffectBase
{
[CompilerGenerated]
private sealed class <ApplyEffect>d__1 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public ICoreGameManagers coreGameManagers;
public CardEffectState cardEffectState;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ApplyEffect>d__1(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
if (<>1__state != 0)
{
return false;
}
<>1__state = -1;
if (coreGameManagers.GetSaveManager().PreviewMode)
{
return false;
}
string text = StringExtensions.ToId(cardEffectState.GetParamStr(), "Silk_Song_Clan.Plugin", "RelicData");
RelicData val = default(RelicData);
bool? flag = default(bool?);
if (!Railend.GetContainer().GetInstance<IRegister<RelicData>>().TryLookupIdentifier(text, (RegisterIdentifierType)0, ref val, ref flag))
{
return false;
}
coreGameManagers.GetSaveManager().AddRelic(val);
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
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_0025: Expected O, but got Unknown
PropDescriptions val = new PropDescriptions { };
string fieldName;
((Dictionary<string, PropDescription>)val)[fieldName] = new PropDescription("Relic", "", (Type)null, false);
return val;
}
[IteratorStateMachine(typeof(<ApplyEffect>d__1))]
public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams, ICoreGameManagers coreGameManagers, ISystemManagers sysManagers)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ApplyEffect>d__1(0)
{
cardEffectState = cardEffectState,
coreGameManagers = coreGameManagers
};
}
}
public class CardEffectBind : CardEffectBase
{
[CompilerGenerated]
private sealed class <ApplyEffect>d__1 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public CardEffectParams cardEffectParams;
public ICoreGameManagers coreGameManagers;
private List<CharacterState>.Enumerator <>7__wrap1;
private CharacterState <target>5__3;
private List<StatusEffectStack>.Enumerator <>7__wrap3;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ApplyEffect>d__1(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
int num = <>1__state;
if ((uint)(num - -4) <= 1u || num == 1)
{
try
{
if (num == -4 || num == 1)
{
try
{
}
finally
{
<>m__Finally2();
}
}
}
finally
{
<>m__Finally1();
}
}
<>7__wrap1 = default(List<CharacterState>.Enumerator);
<target>5__3 = null;
<>7__wrap3 = default(List<StatusEffectStack>.Enumerator);
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0096: 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_00a9: Expected O, but got Unknown
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Expected O, but got Unknown
try
{
int num = <>1__state;
if (num != 0)
{
if (num != 1)
{
return false;
}
<>1__state = -4;
goto IL_00d9;
}
<>1__state = -1;
<>7__wrap1 = cardEffectParams.targets.GetEnumerator();
<>1__state = -3;
goto IL_00ff;
IL_00d9:
while (<>7__wrap3.MoveNext())
{
if (<>7__wrap3.Current.State is StatusEffectAcrobaticState statusEffectAcrobaticState)
{
InputTriggerParams val = new InputTriggerParams
{
associatedCharacter = <target>5__3
};
OutputTriggerParams val2 = new OutputTriggerParams();
<>2__current = ((StatusEffectState)statusEffectAcrobaticState).Trigger(val, val2, coreGameManagers);
<>1__state = 1;
return true;
}
}
<>m__Finally2();
<>7__wrap3 = default(List<StatusEffectStack>.Enumerator);
<target>5__3 = null;
goto IL_00ff;
IL_00ff:
if (<>7__wrap1.MoveNext())
{
<target>5__3 = <>7__wrap1.Current;
List<StatusEffectStack> list = new List<StatusEffectStack>();
<target>5__3.GetStatusEffects(ref list, false);
<>7__wrap3 = list.GetEnumerator();
<>1__state = -4;
goto IL_00d9;
}
<>m__Finally1();
<>7__wrap1 = default(List<CharacterState>.Enumerator);
return false;
}
catch
{
//try-fault
((IDisposable)this).Dispose();
throw;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
private void <>m__Finally1()
{
<>1__state = -1;
((IDisposable)<>7__wrap1).Dispose();
}
private void <>m__Finally2()
{
<>1__state = -3;
((IDisposable)<>7__wrap3).Dispose();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
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();
}
[IteratorStateMachine(typeof(<ApplyEffect>d__1))]
public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams, ICoreGameManagers coreGameManagers, ISystemManagers sysManagers)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ApplyEffect>d__1(0)
{
cardEffectParams = cardEffectParams,
coreGameManagers = coreGameManagers
};
}
}
public class CardEffectRewardSilk : CardEffectBase
{
[CompilerGenerated]
private sealed class <ApplyEffect>d__4 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public ICoreGameManagers coreGameManagers;
public CardEffectState cardEffectState;
public CardEffectRewardSilk <>4__this;
private int <silkAmount>5__2;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ApplyEffect>d__4(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
int num = <>1__state;
CardEffectRewardSilk cardEffectRewardSilk = <>4__this;
switch (num)
{
default:
return false;
case 0:
{
<>1__state = -1;
if (coreGameManagers.GetSaveManager().PreviewMode)
{
return false;
}
<silkAmount>5__2 = cardEffectState.GetParamInt();
SilkManager instance = Railend.GetContainer().GetInstance<SilkManager>();
if (instance != null)
{
<>2__current = instance.RewardSilk(<silkAmount>5__2);
<>1__state = 1;
return true;
}
break;
}
case 1:
<>1__state = -1;
if (<silkAmount>5__2 < 0)
{
<>2__current = cardEffectRewardSilk.HandleSilksongTrigger(coreGameManagers.GetHeroManager(), coreGameManagers.GetMonsterManager(), coreGameManagers.GetCombatManager());
<>1__state = 2;
return true;
}
break;
case 2:
<>1__state = -1;
break;
}
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <HandleSilksongTrigger>d__5 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public HeroManager heroManager;
public CardEffectRewardSilk <>4__this;
public CombatManager combatManager;
public MonsterManager monsterManager;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <HandleSilksongTrigger>d__5(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
int num = <>1__state;
CardEffectRewardSilk cardEffectRewardSilk = <>4__this;
switch (num)
{
default:
return false;
case 0:
{
<>1__state = -1;
Plugin.Logger.LogInfo((object)"Handling Silksong Trigger");
if ((Object)(object)heroManager != (Object)null)
{
cardEffectRewardSilk.HandleSilksongTrigger((ICharacterManager)(object)heroManager, combatManager);
}
if ((Object)(object)monsterManager != (Object)null)
{
cardEffectRewardSilk.HandleSilksongTrigger((ICharacterManager)(object)monsterManager, combatManager);
}
CombatManager obj = combatManager;
<>2__current = ((obj != null) ? obj.RunTriggerQueue() : null);
<>1__state = 1;
return true;
}
case 1:
<>1__state = -1;
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
public override bool CanApplyInPreviewMode => true;
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_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Expected O, but got Unknown
//IL_002d: Expected O, but got Unknown
//IL_002e: Expected O, but got Unknown
PropDescriptions val = new PropDescriptions { };
string fieldName;
((Dictionary<string, PropDescription>)val)[fieldName] = new PropDescription("Silk Amount", "", typeof(int), false);
return val;
}
public override bool TestEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams, ICoreGameManagers coreGameManagers)
{
SilkManager instance = Railend.GetContainer().GetInstance<SilkManager>();
if (instance == null)
{
return false;
}
int paramInt = cardEffectState.GetParamInt();
return instance.GetCurrentSilk() + paramInt >= 0;
}
[IteratorStateMachine(typeof(<ApplyEffect>d__4))]
public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams, ICoreGameManagers coreGameManagers, ISystemManagers sysManagers)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ApplyEffect>d__4(0)
{
<>4__this = this,
cardEffectState = cardEffectState,
coreGameManagers = coreGameManagers
};
}
[IteratorStateMachine(typeof(<HandleSilksongTrigger>d__5))]
public IEnumerator HandleSilksongTrigger(HeroManager heroManager, MonsterManager monsterManager, CombatManager combatManager)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <HandleSilksongTrigger>d__5(0)
{
<>4__this = this,
heroManager = heroManager,
monsterManager = monsterManager,
combatManager = combatManager
};
}
public void HandleSilksongTrigger(ICharacterManager characterManager, CombatManager combatManager)
{
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
for (int i = 0; i < characterManager.GetNumCharacters(); i++)
{
CharacterState character = characterManager.GetCharacter(i);
if (!((Object)(object)character == (Object)null) && !character.IsDestroyed && character.IsAlive)
{
QueueCustomTrigger(character, CharacterTriggers.Silksong, combatManager);
}
}
}
private void QueueCustomTrigger(CharacterState character, Trigger trigger, CombatManager combatManager)
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
if (combatManager != null)
{
combatManager.QueueTrigger(character, trigger, (CharacterState)null, true, true, (FireTriggersData)null, 1, (CharacterTriggerState)null);
}
}
}
public class CardEffectTestDyingSubtype : CardEffectBase
{
[CompilerGenerated]
private sealed class <ApplyEffect>d__2 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ApplyEffect>d__2(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
if (<>1__state != 0)
{
return false;
}
<>1__state = -1;
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
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)
{
if ((Object)(object)cardEffectParams.dyingCharacter == (Object)null)
{
return false;
}
if (!cardEffectParams.dyingCharacter.GetHasSubtype(cardEffectState.GetParamSubtype()))
{
return false;
}
return true;
}
[IteratorStateMachine(typeof(<ApplyEffect>d__2))]
public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams, ICoreGameManagers coreGameManagers, ISystemManagers sysManagers)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ApplyEffect>d__2(0);
}
}
public class CardEffectTestLastCard : CardEffectBase
{
[CompilerGenerated]
private sealed class <ApplyEffect>d__2 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ApplyEffect>d__2(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
if (<>1__state != 0)
{
return false;
}
<>1__state = -1;
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
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)
{
if (coreGameManagers.GetRelicManager().GetRelicEffect<RelicEffectComboActive>() != null)
{
Plugin.Logger.LogInfo((object)"Combo active");
return true;
}
CardManager cardManager = coreGameManagers.GetCardManager();
List<CardState> list = (List<CardState>)AccessTools.Field(typeof(CardManager), "cardsPlayedThisTurn").GetValue(cardManager);
int count = list.Count;
if (count < 2)
{
Plugin.Logger.LogInfo((object)"Not enough cards played this turn");
return false;
}
CardState val = list[count - 2];
CardUpgradeMaskData paramCardFilter = cardEffectState.GetParamCardFilter();
if ((Object)(object)paramCardFilter == (Object)null)
{
Plugin.Logger.LogInfo((object)"No card filter provided");
return false;
}
Plugin.Logger.LogInfo((object)("Testing last card: " + val.GetAssetName()));
Plugin.Logger.LogInfo((object)("Card filter: " + paramCardFilter.GetName()));
bool result = paramCardFilter.FilterCard<CardState>(val, coreGameManagers.GetRelicManager());
Plugin.Logger.LogInfo((object)("Result: " + result));
return result;
}
[IteratorStateMachine(typeof(<ApplyEffect>d__2))]
public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams, ICoreGameManagers coreGameManagers, ISystemManagers sysManagers)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ApplyEffect>d__2(0);
}
}
public class CardEffectTestLastCardName : CardEffectTestLastCard
{
[CompilerGenerated]
private sealed class <ApplyEffect>d__2 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ApplyEffect>d__2(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
if (<>1__state != 0)
{
return false;
}
<>1__state = -1;
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
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)
{
if (coreGameManagers.GetRelicManager().GetRelicEffect<RelicEffectComboActive>() != null)
{
Plugin.Logger.LogInfo((object)"Combo active");
return true;
}
CardManager cardManager = coreGameManagers.GetCardManager();
List<CardState> list = (List<CardState>)AccessTools.Field(typeof(CardManager), "cardsPlayedThisTurn").GetValue(cardManager);
int count = list.Count;
if (count < 2)
{
Plugin.Logger.LogInfo((object)"Not enough cards played this turn");
return false;
}
CardState obj = list[count - 2];
CardData paramCardData = cardEffectState.GetParamCardData();
Plugin.Logger.LogInfo((object)("Testing last card name: " + ((GameData)paramCardData).GetID()));
Plugin.Logger.LogInfo((object)("Card name: " + paramCardData.GetName()));
bool result = obj.GetCardDataID() == ((GameData)paramCardData).GetID();
Plugin.Logger.LogInfo((object)("Result: " + result));
return result;
}
[IteratorStateMachine(typeof(<ApplyEffect>d__2))]
public override IEnumerator ApplyEffect(CardEffectState cardEffectState, CardEffectParams cardEffectParams, ICoreGameManagers coreGameManagers, ISystemManagers sysManagers)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ApplyEffect>d__2(0);
}
}
public class CardTraitScaleDamageFullSilk : CardTraitState
{
private string tooltipDescription = string.Empty;
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
PropDescriptions val = new PropDescriptions { };
string fieldName;
((Dictionary<string, PropDescription>)val)[fieldName] = new PropDescription("Damage Multiplier", "", (Type)null, false);
return val.Add(((CardTraitState)this).CreateStatValueDataInspectorDescriptions());
}
private SilkManager GetSilkManager()
{
return Railend.GetContainer().GetInstance<SilkManager>();
}
public override int OnApplyingDamage(ApplyingDamageParameters damageParams, ICoreGameManagers coreGameManagers)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
int num = damageParams.damage;
SilkManager silkManager = GetSilkManager();
if (silkManager != null && silkManager.GetCurrentSilk() == silkManager.GetMaxSilk())
{
num = (int)((float)num * ((CardTraitState)this).GetParamFloat());
}
return num;
}
public override string GetCardTooltipText()
{
SilkManager silkManager = GetSilkManager();
if (silkManager != null && silkManager.GetCurrentSilk() == silkManager.GetMaxSilk())
{
return string.Format(LocalizationExtensions.Localize(StringExtensions.ToId("@FullSilkDamageTooltipMax", "Silk_Song_Clan.Plugin", "AdditionalTooltip"), (ILocalizationParameterContext)null), ((CardTraitState)this).GetParamFloat());
}
return string.Format(LocalizationExtensions.Localize(StringExtensions.ToId("@FullSilkDamageTooltip", "Silk_Song_Clan.Plugin", "AdditionalTooltip"), (ILocalizationParameterContext)null), ((CardTraitState)this).GetParamFloat());
}
}
public static class CharacterTriggers
{
public static Trigger Combo;
public static Trigger Silksong;
}
public static class StatusEffectTriggers
{
public static TriggerStage OnFullSilk;
public static TriggerStage OnFullSilkLost;
}
public static class TrackedValues
{
public static TrackedValueType Silk;
}
[HarmonyPatch]
public static class CardEffectAttachEquipmentPatches
{
private static MethodBase TargetMethod()
{
IteratorStateMachineAttribute? customAttribute = AccessTools.Method(typeof(CardEffectAttachEquipment), "ApplyEffect", (Type[])null, (Type[])null).GetCustomAttribute<IteratorStateMachineAttribute>();
if (customAttribute?.StateMachineType == null)
{
throw new Exception("No iterator type found for ApplyEffect");
}
return AccessTools.Method(customAttribute.StateMachineType, "MoveNext", (Type[])null, (Type[])null);
}
private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> instructions)
{
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Expected O, but got Unknown
List<CodeInstruction> list = new List<CodeInstruction>(instructions);
MethodInfo methodInfo = AccessTools.Method(typeof(CharacterState), "GetHasEquipment", (Type[])null, (Type[])null);
for (int i = 0; i < list.Count; i++)
{
CodeInstruction val = list[i];
if (val.opcode == OpCodes.Callvirt && val.operand as MethodInfo == methodInfo)
{
list[i] = new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(CardEffectAttachEquipmentPatches), "CheckEquipmentLimit", (Type[])null, (Type[])null));
}
}
return list;
}
public static bool CheckEquipmentLimit(CharacterState dropTarget)
{
if ((Object)(object)dropTarget == (Object)null)
{
Plugin.Logger.LogError((object)"dropTarget is null");
return false;
}
object obj = AccessTools.Property(typeof(CharacterState), "PrimaryStateInformation")?.GetValue(dropTarget);
if (obj == null)
{
Plugin.Logger.LogError((object)"PrimaryStateInformation is null");
return false;
}
Type type = obj.GetType();
FieldInfo fieldInfo = AccessTools.Field(type, "equipment");
PropertyInfo propertyInfo = AccessTools.Property(type, "EquipmentLimit");
ICollection collection = fieldInfo?.GetValue(obj) as ICollection;
int num = (int)(propertyInfo?.GetValue(obj) ?? ((object)0));
Plugin.Logger.LogInfo((object)("equipment: " + collection?.Count + " limit: " + num));
if (collection != null)
{
return collection.Count >= num;
}
return false;
}
}
[HarmonyPatch(typeof(CardStatistics), "GetStatValue")]
public static class CardStatisticsGetStatValuePatch
{
private static void Postfix(StatValueData statValueData, ref int __result)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//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)
if (statValueData.trackedValue == TrackedValues.Silk)
{
SilkManager instance = Railend.GetContainer().GetInstance<SilkManager>();
if (instance != null)
{
__result = instance.GetCurrentSilk();
}
}
}
}
[BepInPlugin("Silk_Song_Clan.Plugin", "Silk_Song_Clan.Plugin", "0.2.4")]
public class Plugin : BaseUnityPlugin
{
internal static ManualLogSource Logger = new ManualLogSource("Silk_Song_Clan.Plugin");
internal static Lazy<SilkManager> Client = new Lazy<SilkManager>(() => new SilkManager());
public void Awake()
{
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
Logger = ((BaseUnityPlugin)this).Logger;
SilkManager client = Client.Value;
DepInjector.AddProvider((IProvider)(object)client);
Railhead.GetBuilder().Configure("Silk_Song_Clan.Plugin", (Action<IConfigurationBuilder>)delegate(IConfigurationBuilder c)
{
ConfigurationExtensions.AddMergedJsonFile(c, new List<string>(98)
{
"json/class/silksong.json", "json/champion/hornet_base.json", "json/champion/hornet_architect.json", "json/champion/hornet_beast.json", "json/champion/hornet_cursed.json", "json/champion/hornet_hunter.json", "json/champion/hornet_reaper.json", "json/champion/hornet_shaman.json", "json/champion/hornet_wanderer.json", "json/champion/hornet_witch.json",
"json/relics/architect_key.json", "json/relics/wormway_key.json", "json/relics/conjoined_heart.json", "json/relics/craw_memento.json", "json/relics/festival_pinata.json", "json/relics/grey_memento.json", "json/relics/guardian_memento.json", "json/relics/hunter_memento.json", "json/relics/hero_memento.json", "json/relics/sprintmaster_memento.json",
"json/relics/surface_memento.json", "json/relics/encrusted_heart.json", "json/relics/hunters_heart.json", "json/relics/pollen_heart.json", "json/triggers/silksong.json", "json/subtypes/snail.json", "json/subtypes/bug.json", "json/subtypes/pinstress.json", "json/subtypes/flea.json", "json/cardpool/flea_pool.json",
"json/cardpool/banner_pool.json", "json/cardpool/morsel_pool.json", "json/map_nodes/banner.json", "json/enhancers/acrobat_stone.json", "json/enhancers/warrior_stone.json", "json/enhancers/flea_stone.json", "json/enhancers/snail_stone.json", "json/tokens/flea.json", "json/tokens/bell_flea.json", "json/tokens/huge_flea.json",
"json/tokens/brew_flea.json", "json/units/alchemist_zylotol.json", "json/units/ballow.json", "json/units/bell_hermit.json", "json/units/caretaker.json", "json/units/chapel_maid.json", "json/units/crull_and_benjin.json", "json/units/fleamaster_mooshka.json", "json/units/flick_the_fixer.json", "json/units/garamond.json",
"json/units/gilly.json", "json/units/green_prince.json", "json/units/grindle.json", "json/units/grishkin.json", "json/units/kratt.json", "json/units/lumble_the_lucky.json", "json/units/nuu.json", "json/units/pavo.json", "json/units/pebb.json", "json/units/pinmaster_plinney.json",
"json/units/pinstress.json", "json/units/relic_seeker_scrounge.json", "json/units/seamstress.json", "json/units/shakra.json", "json/units/sherma.json", "json/units/sprintmaster_swift.json", "json/units/twelfth_architect.json", "json/units/varga.json", "json/units/vog.json", "json/units/yarnaby.json",
"json/units/zaza.json", "json/spells/nail_strike.json", "json/spells/clawline.json", "json/spells/cling_grip.json", "json/spells/cross_stitch.json", "json/spells/elegy_of_the_deep.json", "json/spells/needle_strike.json", "json/spells/needolin.json", "json/spells/pale_nale.json", "json/spells/pale_nales.json",
"json/spells/rune_rage.json", "json/spells/sharp_dart.json", "json/spells/silk_soar.json", "json/spells/silkspear.json", "json/spells/swift_step.json", "json/spells/sylphsong.json", "json/spells/thread_storm.json", "json/status_effects/warrior.json", "json/status_effects/imbue.json", "json/status_effects/protection.json",
"json/status_effects/permanent_imbue.json", "json/status_effects/permanent_protection.json", "json/status_effects/full_silk_attack_buff.json", "json/tracked_values/silk.json", "json/status_effect_types/full_silk.json", "json/text/silk.json", "json/text/bind.json", "json/text/combo.json"
});
});
Railend.ConfigurePreAction((Action<Container>)delegate(Container builder)
{
builder.RegisterInstance<SilkManager>(client);
});
Railend.ConfigurePostAction((Action<Container>)delegate(Container c)
{
//IL_0035: 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_0046: 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_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: 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)
//IL_0079: 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)
IRegister<Trigger> manager = c.GetInstance<IRegister<Trigger>>();
c.GetInstance<IRegister<CardTriggerType>>();
IRegister<TrackedValueType> trackedValueManager = c.GetInstance<IRegister<TrackedValueType>>();
IRegister<TriggerStage> statusEffectTriggerStageManager = c.GetInstance<IRegister<TriggerStage>>();
CharacterTriggers.Combo = GetTrigger("Combo");
CharacterTriggers.Silksong = GetTrigger("Silksong");
TrackedValues.Silk = GetTrackedValueType("Silk");
StatusEffectTriggers.OnFullSilk = GetStatusEffectTriggerStage("OnFullSilk");
StatusEffectTriggers.OnFullSilkLost = GetStatusEffectTriggerStage("OnFullSilkLost");
TriggerStage GetStatusEffectTriggerStage(string id)
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
return IEnumerableUtility.GetValueOrDefault<string, TriggerStage>((IDictionary<string, TriggerStage>)statusEffectTriggerStageManager, StringExtensions.GetId("Silk_Song_Clan.Plugin", "StatusEffectTriggerStage", id), (TriggerStage)0);
}
TrackedValueType GetTrackedValueType(string id)
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
return IEnumerableUtility.GetValueOrDefault<string, TrackedValueType>((IDictionary<string, TrackedValueType>)trackedValueManager, StringExtensions.GetId("Silk_Song_Clan.Plugin", "TrackedValueTypeEnum", id), (TrackedValueType)0);
}
Trigger GetTrigger(string id)
{
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
return IEnumerableUtility.GetValueOrDefault<string, Trigger>((IDictionary<string, Trigger>)manager, StringExtensions.GetId("Silk_Song_Clan.Plugin", "CTriggerEnum", id), (Trigger)0);
}
});
Logger.LogInfo((object)"Plugin Silk_Song_Clan.Plugin is loaded!");
new Harmony("Silk_Song_Clan.Plugin").PatchAll();
}
}
public interface IModifyMaxSilkRelicEffect : IRelicEffect
{
int GetMaxSilkAmount();
}
public interface IModifyWarriorSilkGainEffect : IRelicEffect
{
int ApplyOrder { get; }
int GetSilkGainAmount();
int GetSilkGainMultiplier();
}
public class RelicEffectAcrobatNotRemoved : RelicEffectBase
{
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_0025: Expected O, but got Unknown
PropDescriptions val = new PropDescriptions { };
string fieldName;
((Dictionary<string, PropDescription>)val)[fieldName] = new PropDescription("Acrobat Not Removed on Hit", "", (Type)null, false);
return val;
}
}
public class RelicEffectAdditionalWarriorSilk : RelicEffectBase, IModifyWarriorSilkGainEffect, IRelicEffect
{
private int silkGainAmount;
private int silkGainMultiplier = 1;
public int ApplyOrder => 1;
public override void Initialize(RelicState relicState, RelicData relicData, RelicEffectData relicEffectData)
{
((RelicEffectBase)this).Initialize(relicState, relicData, relicEffectData);
silkGainAmount = relicEffectData.GetParamInt();
silkGainMultiplier = relicEffectData.GetParamInt2();
}
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_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Expected O, but got Unknown
//IL_002d: Expected O, but got Unknown
//IL_0034: 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_0055: Expected O, but got Unknown
//IL_0056: Expected O, but got Unknown
PropDescriptions val = new PropDescriptions { };
string fieldName;
((Dictionary<string, PropDescription>)val)[fieldName] = new PropDescription("Silk Gain Amount", "", typeof(int), false);
fieldName = RelicEffectFieldNamesHelper.GetFieldName((RelicEffectFieldNames)3);
((Dictionary<string, PropDescription>)val)[fieldName] = new PropDescription("Silk Gain Multiplier", "", typeof(int), false);
return val;
}
public int GetSilkGainAmount()
{
return silkGainAmount;
}
public int GetSilkGainMultiplier()
{
return silkGainMultiplier;
}
}
public class RelicEffectAddMaxSilk : RelicEffectBase, IModifyMaxSilkRelicEffect, IRelicEffect
{
private int maxSilkAmount;
public override void Initialize(RelicState relicState, RelicData relicData, RelicEffectData relicEffectData)
{
((RelicEffectBase)this).Initialize(relicState, relicData, relicEffectData);
maxSilkAmount = relicEffectData.GetParamInt();
}
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_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Expected O, but got Unknown
//IL_002d: Expected O, but got Unknown
//IL_002e: Expected O, but got Unknown
PropDescriptions val = new PropDescriptions { };
string fieldName;
((Dictionary<string, PropDescription>)val)[fieldName] = new PropDescription("Max Silk Amount", "", typeof(int), false);
return val;
}
public int GetMaxSilkAmount()
{
return maxSilkAmount;
}
}
public sealed class RelicEffectAddStatusEffectOnOtherStatusAdded : RelicEffectBase, IOnStatusEffectAddedRelicEffect, IRelicEffect, IStatusEffectRelicEffect
{
private Type team;
private string otherStatusId = string.Empty;
private string statusId = string.Empty;
private int additionalStacks;
public override bool CanApplyInPreviewMode => true;
public override bool CanShowNotifications => false;
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_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Expected O, but got Unknown
//IL_0043: 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_0064: Expected O, but got Unknown
PropDescriptions val = new PropDescriptions { };
string fieldName;
((Dictionary<string, PropDescription>)val)[fieldName] = new PropDescription("Other Status ID", "", (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)26);
((Dictionary<string, PropDescription>)val)[fieldName3] = new PropDescription("Status Effects", "", (Type)null, false);
return val;
}
public override void Initialize(RelicState relicState, RelicData relicData, 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)
((RelicEffectBase)this).Initialize(relicState, relicData, relicEffectData);
team = relicEffectData.GetParamSourceTeam();
string paramString = relicEffectData.GetParamString();
otherStatusId = StringExtensions.ToId(paramString, "Silk_Song_Clan.Plugin", "StatusEffect");
StatusEffectStackData[] paramStatusEffects = relicEffectData.GetParamStatusEffects();
if (paramStatusEffects.Length != 0)
{
statusId = paramStatusEffects[0].statusId;
additionalStacks = paramStatusEffects[0].count;
}
}
public void OnStatusEffectAddedApplyMultiplier(OnStatusEffectAddedRelicEffectParams relicEffectParams)
{
}
public void OnStatusEffectAddedApplyAdder(OnStatusEffectAddedRelicEffectParams relicEffectParams)
{
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: 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)
if (!(relicEffectParams.statusId != otherStatusId) && ((int)team == 0 || ((CharacterRelicEffectParams)relicEffectParams).characterState.GetTeamType() == team) && !(relicEffectParams.fromEffectType == typeof(CardEffectTransferAllStatusEffects)) && !(relicEffectParams.fromEffectType == typeof(CardEffectMultiplyStatusEffect)) && !(relicEffectParams.fromEffectType == typeof(CardEffectTransferAllStatusEffectsFromUnit)))
{
((CharacterRelicEffectParams)relicEffectParams).characterState.AddStatusEffect(statusId, additionalStacks * relicEffectParams.stacksAdded, (CharacterState)null, true, false);
((RelicEffectBase)this).NotifyRelicTriggered(((RelicEffectParams)relicEffectParams).relicManager, ((CharacterRelicEffectParams)relicEffectParams).characterState);
}
}
public void OnStatusEffectRemoved(OnStatusEffectAddedRelicEffectParams relicEffectParams)
{
}
public int GetModifiedStatusEffectStacksFromMultiplier(StatusEffectStackData statusEffectStackData, CharacterState? onCharacter)
{
return additionalStacks;
}
public int GetStatusEffectStacksToAdd(StatusEffectStackData statusEffectStackData, CharacterState? onCharacter)
{
return 0;
}
public StatusEffectStackData[] GetStatusEffects()
{
//IL_0008: 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_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Expected O, but got Unknown
return (StatusEffectStackData[])(object)new StatusEffectStackData[1]
{
new StatusEffectStackData
{
statusId = statusId,
count = additionalStacks
}
};
}
public int GetStatusEffectStacksToAddDeferred(StatusEffectStackData statusEffectStackData, CharacterState? onCharacter)
{
return 0;
}
}
public class RelicEffectDrawAdditionalNextTurnOnTrigger : RelicEffectBase, ICharacterActionRelicEffect, IRelicEffect
{
[CompilerGenerated]
private sealed class <ApplyCharacterTriggerEffect>d__6 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public CharacterTriggerRelicEffectParams relicEffectParams;
public RelicEffectDrawAdditionalNextTurnOnTrigger <>4__this;
public ICoreGameManagers coreGameManagers;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ApplyCharacterTriggerEffect>d__6(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
int num = <>1__state;
RelicEffectDrawAdditionalNextTurnOnTrigger relicEffectDrawAdditionalNextTurnOnTrigger = <>4__this;
if (num != 0)
{
return false;
}
<>1__state = -1;
CharacterState characterState = ((CharacterRelicEffectParams)relicEffectParams).characterState;
if (characterState != null)
{
characterState.GetCharacterUI().ShowEffectVFX(characterState, ((RelicEffectBase)relicEffectDrawAdditionalNextTurnOnTrigger)._srcRelicEffectData.GetAppliedVfx(), 0, (EffectVfxReason)0);
}
CardManager cardManager = coreGameManagers.GetCardManager();
if ((Object)(object)cardManager != (Object)null)
{
cardManager.AdjustDrawCountModifier(relicEffectDrawAdditionalNextTurnOnTrigger.cardCount, (CardState)null, (Action<CardState>)null);
}
((RelicEffectBase)relicEffectDrawAdditionalNextTurnOnTrigger).NotifyRelicTriggered(coreGameManagers.GetRelicManager(), ((CharacterRelicEffectParams)relicEffectParams).characterState);
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
private int cardCount;
private Trigger trigger;
private Type sourceTeam;
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_0064: Expected O, but got Unknown
PropDescriptions val = new PropDescriptions { };
string fieldName;
((Dictionary<string, PropDescription>)val)[fieldName] = new PropDescription("Card Count", "", (Type)null, false);
string fieldName2 = RelicEffectFieldNamesHelper.GetFieldName((RelicEffectFieldNames)14);
((Dictionary<string, PropDescription>)val)[fieldName2] = new PropDescription("Trigger", "", (Type)null, false);
string fieldName3 = RelicEffectFieldNamesHelper.GetFieldName((RelicEffectFieldNames)0);
((Dictionary<string, PropDescription>)val)[fieldName3] = new PropDescription("Source Team", "", (Type)null, false);
return val;
}
public override void Initialize(RelicState relicState, RelicData srcRelicData, RelicEffectData relicEffectData)
{
//IL_0017: 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_0023: 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)
((RelicEffectBase)this).Initialize(relicState, srcRelicData, relicEffectData);
cardCount = relicEffectData.GetParamInt();
trigger = relicEffectData.GetParamTrigger();
sourceTeam = relicEffectData.GetParamSourceTeam();
}
public bool TestCharacterTriggerEffect(CharacterTriggerRelicEffectParams relicEffectParams, ICoreGameManagers coreGameManagers)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: 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: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
if (relicEffectParams.trigger == trigger && ((CharacterRelicEffectParams)relicEffectParams).characterState.GetTeamType() == sourceTeam)
{
if ((int)trigger == 0 && ((CharacterRelicEffectParams)relicEffectParams).characterState.IsAlive && relicEffectParams.paramInt != 1)
{
return false;
}
return true;
}
return false;
}
[IteratorStateMachine(typeof(<ApplyCharacterTriggerEffect>d__6))]
public IEnumerator ApplyCharacterTriggerEffect(CharacterTriggerRelicEffectParams relicEffectParams, ICoreGameManagers coreGameManagers)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ApplyCharacterTriggerEffect>d__6(0)
{
<>4__this = this,
relicEffectParams = relicEffectParams,
coreGameManagers = coreGameManagers
};
}
}
public class SilkData
{
public int Silk { get; set; }
}
public class SilkManager : IProvider, IClient
{
[CompilerGenerated]
private sealed class <RewardSilk>d__12 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public SilkManager <>4__this;
public int amount;
private SilkSaveData <silkSaveData>5__2;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <RewardSilk>d__12(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<silkSaveData>5__2 = null;
<>1__state = -2;
}
private bool MoveNext()
{
int num = <>1__state;
SilkManager silkManager = <>4__this;
switch (num)
{
default:
return false;
case 0:
{
<>1__state = -1;
<silkSaveData>5__2 = silkManager.GetSilkSaveData() ?? new SilkSaveData
{
Silk = 0
};
int num2 = Mathf.Clamp(<silkSaveData>5__2.Silk + amount, 0, silkManager.GetMaxSilk());
<silkSaveData>5__2.Silk = num2;
bool flag = num2 == silkManager.GetMaxSilk();
if (!<silkSaveData>5__2.IsFullSilk && flag)
{
<silkSaveData>5__2.IsFullSilk = true;
Plugin.Logger.LogInfo((object)"Triggering Full Silk");
<>2__current = silkManager.TriggerFullSilk();
<>1__state = 1;
return true;
}
if (<silkSaveData>5__2.IsFullSilk && !flag)
{
<silkSaveData>5__2.IsFullSilk = false;
Plugin.Logger.LogInfo((object)"Triggering Full Silk Lost");
<>2__current = silkManager.TriggerFullSilkLost();
<>1__state = 2;
return true;
}
break;
}
case 1:
<>1__state = -1;
break;
case 2:
<>1__state = -1;
break;
}
silkManager.SaveSilkSaveData(<silkSaveData>5__2);
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <TriggerFullSilk>d__13 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public SilkManager <>4__this;
private InputTriggerParams <inputParams>5__2;
private OutputTriggerParams <outputParams>5__3;
private int <i>5__4;
private List<CharacterState>.Enumerator <>7__wrap4;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <TriggerFullSilk>d__13(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
int num = <>1__state;
if (num == -3 || num == 1)
{
try
{
}
finally
{
<>m__Finally1();
}
}
<inputParams>5__2 = null;
<outputParams>5__3 = null;
<>7__wrap4 = default(List<CharacterState>.Enumerator);
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Expected O, but got Unknown
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Expected O, but got Unknown
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
try
{
int num = <>1__state;
SilkManager silkManager = <>4__this;
if (num != 0)
{
if (num != 1)
{
return false;
}
<>1__state = -3;
goto IL_010e;
}
<>1__state = -1;
if ((Object)(object)silkManager.statusEffectManager != (Object)null && (Object)(object)silkManager.roomManager != (Object)null)
{
<inputParams>5__2 = new InputTriggerParams();
<outputParams>5__3 = new OutputTriggerParams();
<i>5__4 = 0;
goto IL_013f;
}
goto IL_0163;
IL_012d:
<i>5__4++;
goto IL_013f;
IL_013f:
if (<i>5__4 < silkManager.roomManager.GetNumRooms())
{
RoomState room = silkManager.roomManager.GetRoom(<i>5__4);
if ((Object)(object)room != (Object)null)
{
List<CharacterState> list = new List<CharacterState>();
room.AddCharactersToList(list, (Type)2, false, true);
room.AddCharactersToList(list, (Type)1, false, true);
<>7__wrap4 = list.GetEnumerator();
<>1__state = -3;
goto IL_010e;
}
goto IL_012d;
}
<inputParams>5__2 = null;
<outputParams>5__3 = null;
goto IL_0163;
IL_010e:
if (<>7__wrap4.MoveNext())
{
CharacterState current = <>7__wrap4.Current;
<inputParams>5__2.associatedCharacter = current;
<>2__current = silkManager.statusEffectManager.TriggerStatusEffectOnUnit(StatusEffectTriggers.OnFullSilk, current, <inputParams>5__2, <outputParams>5__3, true);
<>1__state = 1;
return true;
}
<>m__Finally1();
<>7__wrap4 = default(List<CharacterState>.Enumerator);
goto IL_012d;
IL_0163:
return false;
}
catch
{
//try-fault
((IDisposable)this).Dispose();
throw;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
private void <>m__Finally1()
{
<>1__state = -1;
((IDisposable)<>7__wrap4).Dispose();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <TriggerFullSilkLost>d__14 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public SilkManager <>4__this;
private InputTriggerParams <inputParams>5__2;
private OutputTriggerParams <outputParams>5__3;
private int <i>5__4;
private List<CharacterState>.Enumerator <>7__wrap4;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <TriggerFullSilkLost>d__14(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
int num = <>1__state;
if (num == -3 || num == 1)
{
try
{
}
finally
{
<>m__Finally1();
}
}
<inputParams>5__2 = null;
<outputParams>5__3 = null;
<>7__wrap4 = default(List<CharacterState>.Enumerator);
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Expected O, but got Unknown
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Expected O, but got Unknown
//IL_00dd: Unknown result type (might be due to invalid IL or missing references)
try
{
int num = <>1__state;
SilkManager silkManager = <>4__this;
if (num != 0)
{
if (num != 1)
{
return false;
}
<>1__state = -3;
goto IL_010e;
}
<>1__state = -1;
if ((Object)(object)silkManager.statusEffectManager != (Object)null && (Object)(object)silkManager.roomManager != (Object)null)
{
<inputParams>5__2 = new InputTriggerParams();
<outputParams>5__3 = new OutputTriggerParams();
<i>5__4 = 0;
goto IL_013f;
}
goto IL_0163;
IL_012d:
<i>5__4++;
goto IL_013f;
IL_013f:
if (<i>5__4 < silkManager.roomManager.GetNumRooms())
{
RoomState room = silkManager.roomManager.GetRoom(<i>5__4);
if ((Object)(object)room != (Object)null)
{
List<CharacterState> list = new List<CharacterState>();
room.AddCharactersToList(list, (Type)2, false, true);
room.AddCharactersToList(list, (Type)1, false, true);
<>7__wrap4 = list.GetEnumerator();
<>1__state = -3;
goto IL_010e;
}
goto IL_012d;
}
<inputParams>5__2 = null;
<outputParams>5__3 = null;
goto IL_0163;
IL_010e:
if (<>7__wrap4.MoveNext())
{
CharacterState current = <>7__wrap4.Current;
<inputParams>5__2.associatedCharacter = current;
<>2__current = silkManager.statusEffectManager.TriggerStatusEffectOnUnit(StatusEffectTriggers.OnFullSilkLost, current, <inputParams>5__2, <outputParams>5__3, true);
<>1__state = 1;
return true;
}
<>m__Finally1();
<>7__wrap4 = default(List<CharacterState>.Enumerator);
goto IL_012d;
IL_0163:
return false;
}
catch
{
//try-fault
((IDisposable)this).Dispose();
throw;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
private void <>m__Finally1()
{
<>1__state = -1;
((IDisposable)<>7__wrap4).Dispose();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
public const string SilkSaveDataKeyMagic = "__silk";
public const int BaseMaxSilk = 12;
private SaveManager? saveManager;
private RelicManager? relicManager;
private CardManager? cardManager;
private StatusEffectManager? statusEffectManager;
private RoomManager? roomManager;
public int GetMaxSilk()
{
return 12 + GetAdditionalMaxSilkFromRelics();
}
public IRegister<SilkData> GetSilkDataRegister()
{
return Railend.GetContainer().GetInstance<IRegister<SilkData>>();
}
public int GetAdditionalMaxSilkFromRelics()
{
if ((Object)(object)relicManager == (Object)null)
{
return 0;
}
int num = 0;
List<IModifyMaxSilkRelicEffect> list = new List<IModifyMaxSilkRelicEffect>();
list = relicManager.GetRelicEffects<IModifyMaxSilkRelicEffect>(list);
foreach (IModifyMaxSilkRelicEffect item in list)
{
num += item.GetMaxSilkAmount();
}
return num;
}
public int GetCurrentSilk()
{
return GetSilkSaveData()?.Silk ?? 0;
}
[IteratorStateMachine(typeof(<RewardSilk>d__12))]
public IEnumerator RewardSilk(int amount)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <RewardSilk>d__12(0)
{
<>4__this = this,
amount = amount
};
}
[IteratorStateMachine(typeof(<TriggerFullSilk>d__13))]
public IEnumerator TriggerFullSilk()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <TriggerFullSilk>d__13(0)
{
<>4__this = this
};
}
[IteratorStateMachine(typeof(<TriggerFullSilkLost>d__14))]
public IEnumerator TriggerFullSilkLost()
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <TriggerFullSilkLost>d__14(0)
{
<>4__this = this
};
}
public SilkSaveData? GetSilkSaveData()
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
if ((Object)(object)saveManager != (Object)null)
{
SaveData obj = (SaveData)AccessTools.Property(typeof(SaveManager), "ActiveSaveData").GetValue(saveManager);
string text = ((List<string>)AccessTools.Field(typeof(SaveData), "permanentlyDisabledAbilities").GetValue(obj)).FirstOrDefault((string s) => s.StartsWith("__silk"));
if (text != null)
{
text = text.Replace("__silk", "");
return JsonSerializer.Deserialize<SilkSaveData>(text);
}
}
return null;
}
public void SaveSilkSaveData(SilkSaveData silkSaveData)
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Expected O, but got Unknown
if ((Object)(object)saveManager != (Object)null)
{
SaveData obj = (SaveData)AccessTools.Property(typeof(SaveManager), "ActiveSaveData").GetValue(saveManager);
List<string> obj2 = (List<string>)AccessTools.Field(typeof(SaveData), "permanentlyDisabledAbilities").GetValue(obj);
obj2.RemoveAll((string s) => s.StartsWith("__silk"));
string text = JsonSerializer.Serialize(silkSaveData);
obj2.Add("__silk" + text);
}
}
public void NewProviderAvailable(IProvider provider)
{
SaveManager val = (SaveManager)(object)((provider is SaveManager) ? provider : null);
if (val != null)
{
saveManager = val;
}
RelicManager val2 = (RelicManager)(object)((provider is RelicManager) ? provider : null);
if (val2 != null)
{
relicManager = val2;
}
CardManager val3 = (CardManager)(object)((provider is CardManager) ? provider : null);
if (val3 != null)
{
cardManager = val3;
}
StatusEffectManager val4 = (StatusEffectManager)(object)((provider is StatusEffectManager) ? provider : null);
if (val4 != null)
{
statusEffectManager = val4;
}
RoomManager val5 = (RoomManager)(object)((provider is RoomManager) ? provider : null);
if (val5 != null)
{
roomManager = val5;
}
}
public void ProviderRemoved(IProvider provider)
{
if (provider is SaveManager)
{
saveManager = null;
}
if (provider is RelicManager)
{
relicManager = null;
}
if (provider is CardManager && (Object)(object)cardManager != (Object)null)
{
cardManager = null;
}
if (provider is StatusEffectManager)
{
statusEffectManager = null;
}
if (provider is RoomManager)
{
roomManager = null;
}
}
public void NewProviderFullyInstalled(IProvider newProvider)
{
}
}
[Serializable]
public class SilkSaveData
{
public int Silk { get; set; }
public bool IsFullSilk { get; set; }
}
public class StatusEffectAcrobaticState : StatusEffectState
{
public enum PermanentEffectType
{
StatBuff,
Upgrade
}
public enum StatBuffType
{
Damage,
MaxHP
}
[CompilerGenerated]
private sealed class <ApplyPermanentEffect>d__17 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public CharacterState character;
public StatusEffectAcrobaticState <>4__this;
public int stacks;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ApplyPermanentEffect>d__17(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
int num = <>1__state;
StatusEffectAcrobaticState statusEffectAcrobaticState = <>4__this;
switch (num)
{
default:
return false;
case 0:
{
<>1__state = -1;
CardState spawnerCard = character.GetSpawnerCard();
if (spawnerCard == null)
{
return false;
}
CardStateModifiers cardStateModifiers = spawnerCard.GetCardStateModifiers();
switch (statusEffectAcrobaticState.PermanentEffect)
{
case PermanentEffectType.StatBuff:
<>2__current = statusEffectAcrobaticState.ApplyPermanentStatBuff(character, cardStateModifiers, stacks);
<>1__state = 1;
return true;
case PermanentEffectType.Upgrade:
<>2__current = statusEffectAcrobaticState.ApplyPermanentUpgrade(cardStateModifiers, stacks);
<>1__state = 2;
return true;
}
break;
}
case 1:
<>1__state = -1;
break;
case 2:
<>1__state = -1;
break;
}
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <ApplyPermanentStatBuff>d__18 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public StatusEffectAcrobaticState <>4__this;
public CharacterState character;
public CardStateModifiers modifiers;
public int stacks;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ApplyPermanentStatBuff>d__18(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
int num = <>1__state;
StatusEffectAcrobaticState statusEffectAcrobaticState = <>4__this;
switch (num)
{
default:
return false;
case 0:
{
<>1__state = -1;
StatBuffType? statBuffType = statusEffectAcrobaticState.GetStatBuffType();
if (!statBuffType.HasValue)
{
return false;
}
<>2__current = statusEffectAcrobaticState.ApplyStatBuffWithModifiers(character, modifiers, statBuffType.Value, stacks);
<>1__state = 1;
return true;
}
case 1:
<>1__state = -1;
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <ApplyPermanentUpgrade>d__19 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public StatusEffectAcrobaticState <>4__this;
public CardStateModifiers modifiers;
public int stacks;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ApplyPermanentUpgrade>d__19(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Expected O, but got Unknown
int num = <>1__state;
StatusEffectAcrobaticState statusEffectAcrobaticState = <>4__this;
if (num != 0)
{
return false;
}
<>1__state = -1;
CardUpgradeData value = statusEffectAcrobaticState.UpgradeData.Value;
if ((Object)(object)value == (Object)null)
{
return false;
}
CardUpgradeState val = new CardUpgradeState();
val.Setup(value, false, false);
if (!statusEffectAcrobaticState.inPreviewMode)
{
return false;
}
for (int i = 0; i < stacks; i++)
{
modifiers.AddUpgrade(val, (CardStateModifiers)null);
}
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <ApplyStatBuffWithModifiers>d__21 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public StatBuffType statBuffType;
public CharacterState character;
public int stacks;
public StatusEffectAcrobaticState <>4__this;
public CardStateModifiers modifiers;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ApplyStatBuffWithModifiers>d__21(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
int num = <>1__state;
StatusEffectAcrobaticState statusEffectAcrobaticState = <>4__this;
switch (num)
{
default:
return false;
case 0:
<>1__state = -1;
switch (statBuffType)
{
case StatBuffType.Damage:
character.BuffDamage(stacks, (RelicState)null, false);
if (!statusEffectAcrobaticState.inPreviewMode)
{
modifiers.IncrementAdditionalDamage(stacks);
}
break;
case StatBuffType.MaxHP:
<>2__current = character.BuffMaxHP(stacks, false, (RelicState)null, true);
<>1__state = 1;
return true;
}
break;
case 1:
<>1__state = -1;
if (!statusEffectAcrobaticState.inPreviewMode)
{
modifiers.IncrementAdditionalHP(stacks);
}
break;
}
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <ApplyTemporaryEffect>d__20 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public StatusEffectAcrobaticState <>4__this;
public CharacterState character;
public int stacks;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ApplyTemporaryEffect>d__20(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
int num = <>1__state;
StatusEffectAcrobaticState statusEffectAcrobaticState = <>4__this;
switch (num)
{
default:
return false;
case 0:
{
<>1__state = -1;
StatBuffType? statBuffType = statusEffectAcrobaticState.GetStatBuffType();
if (!statBuffType.HasValue)
{
return false;
}
CardState spawnerCard = character.GetSpawnerCard();
if (spawnerCard == null)
{
return false;
}
<>2__current = statusEffectAcrobaticState.ApplyStatBuffWithModifiers(character, spawnerCard.GetTemporaryCardStateModifiers(), statBuffType.Value, stacks);
<>1__state = 1;
return true;
}
case 1:
<>1__state = -1;
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <OnTriggered>d__14 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public StatusEffectAcrobaticState <>4__this;
public InputTriggerParams inputTriggerParams;
public ICoreGameManagers coreGameManagers;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <OnTriggered>d__14(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
//IL_01bb: 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_01c2: Unknown result type (might be due to invalid IL or missing references)
//IL_01c5: Invalid comparison between Unknown and I4
//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
//IL_01ca: Invalid comparison between Unknown and I4
int num = <>1__state;
StatusEffectAcrobaticState statusEffectAcrobaticState = <>4__this;
switch (num)
{
default:
return false;
case 0:
{
<>1__state = -1;
string statusId = ((StatusEffectState)statusEffectAcrobaticState).GetStatusId();
CharacterState val = inputTriggerParams.associatedCharacter ?? inputTriggerParams.attacked;
if ((Object)(object)val == (Object)null)
{
Plugin.Logger.LogInfo((object)((statusEffectAcrobaticState.inPreviewMode ? "Preview" : "Game") + " AcrobaticState: Character is null"));
return false;
}
if ((Object)(object)inputTriggerParams.attacked != (Object)null && inputTriggerParams.damage == 0)
{
Plugin.Logger.LogInfo((object)((statusEffectAcrobaticState.inPreviewMode ? "Preview" : "Game") + " AcrobaticState: 0 damage doesn't trigger removal"));
return false;
}
coreGameManagers.GetRelicManager();
if (((StatusEffectState)statusEffectAcrobaticState).relicManager.GetRelicEffect<RelicEffectAcrobatNotRemoved>() != null && (inputTriggerParams.damage > 0 || (Object)(object)inputTriggerParams.attacked != (Object)null))
{
Plugin.Logger.LogInfo((object)((statusEffectAcrobaticState.inPreviewMode ? "Preview" : "Game") + " AcrobaticState: Acrobat not removed on hit"));
return false;
}
int statusEffectStacks = val.GetStatusEffectStacks(statusId);
Plugin.Logger.LogInfo((object)string.Format("{0} AcrobaticState: Removing {1} stacks of {2}", statusEffectAcrobaticState.inPreviewMode ? "Preview" : "Game", statusEffectStacks, statusId));
val.RemoveStatusEffect(statusId, statusEffectStacks, true);
if (inputTriggerParams.damage > 0 || (Object)(object)inputTriggerParams.attacked != (Object)null)
{
Plugin.Logger.LogInfo((object)((statusEffectAcrobaticState.inPreviewMode ? "Preview" : "Game") + " AcrobaticState: effect triggered from taking damage or being attacked"));
return false;
}
UnitUpgradeLifetime upgradeLifetime = statusEffectAcrobaticState.UpgradeLifetime;
if ((int)upgradeLifetime > 1)
{
if ((int)upgradeLifetime == 2)
{
Plugin.Logger.LogInfo((object)((statusEffectAcrobaticState.inPreviewMode ? "Preview" : "Game") + " AcrobaticState: Permanent effect triggered"));
<>2__current = statusEffectAcrobaticState.ApplyPermanentEffect(val, statusEffectStacks);
<>1__state = 1;
return true;
}
break;
}
Plugin.Logger.LogInfo((object)((statusEffectAcrobaticState.inPreviewMode ? "Preview" : "Game") + " AcrobaticState: Temporary effect triggered"));
<>2__current = statusEffectAcrobaticState.ApplyTemporaryEffect(val, statusEffectStacks);
<>1__state = 2;
return true;
}
case 1:
<>1__state = -1;
break;
case 2:
<>1__state = -1;
break;
}
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
private bool inPreviewMode;
public Lazy<CardUpgradeData?> UpgradeData { get; set; }
public UnitUpgradeLifetime UpgradeLifetime => (UnitUpgradeLifetime)((StatusEffectState)this).GetParamInt();
public PermanentEffectType PermanentEffect => (PermanentEffectType)((StatusEffectState)this).GetParamSecondaryInt();
public override int GetTriggerOrder()
{
return 4;
}
public StatusEffectAcrobaticState()
{
UpgradeData = new Lazy<CardUpgradeData>((Func<CardUpgradeData>)(() => LoadUpgradeData()));
}
protected override void CopyStateForPreviewInternal(StatusEffectState dest, List<IRoomStateModifier> characterRoomStateModifiers)
{
if (dest is StatusEffectAcrobaticState statusEffectAcrobaticState)
{
statusEffectAcrobaticState.inPreviewMode = true;
}
((StatusEffectState)this).CopyStateForPreviewInternal(dest, characterRoomStateModifiers);
}
[IteratorStateMachine(typeof(<OnTriggered>d__14))]
protected override IEnumerator OnTriggered(InputTriggerParams inputTriggerParams, OutputTriggerParams outputTriggerParams, ICoreGameManagers coreGameManagers)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <OnTriggered>d__14(0)
{
<>4__this = this,
inputTriggerParams = inputTriggerParams,
coreGameManagers = coreGameManagers
};
}
private StatBuffType? GetStatBuffType()
{
if (PermanentEffect != 0)
{
return null;
}
string paramStr = ((StatusEffectState)this).GetParamStr();
if (!(paramStr == "damage"))
{
if (paramStr == "max_hp")
{
return StatBuffType.MaxHP;
}
return null;
}
return StatBuffType.Damage;
}
private CardUpgradeData? LoadUpgradeData()
{
if (PermanentEffect != PermanentEffectType.Upgrade)
{
return null;
}
Container container = Railend.GetContainer();
string text = StringExtensions.ToId(((StatusEffectState)this).GetParamStr(), "Silk_Song_Clan.Plugin", "Upgrade");
CardUpgradeData result = default(CardUpgradeData);
bool? flag = default(bool?);
if (!RegisterExtensions.TryLookupId<CardUpgradeData>(container.GetInstance<IRegister<CardUpgradeData>>(), text, ref result, ref flag, (IConfigurationSection)null))
{
return null;
}
return result;
}
[IteratorStateMachine(typeof(<ApplyPermanentEffect>d__17))]
private IEnumerator ApplyPermanentEffect(CharacterState character, int stacks)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ApplyPermanentEffect>d__17(0)
{
<>4__this = this,
character = character,
stacks = stacks
};
}
[IteratorStateMachine(typeof(<ApplyPermanentStatBuff>d__18))]
private IEnumerator ApplyPermanentStatBuff(CharacterState character, CardStateModifiers modifiers, int stacks)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ApplyPermanentStatBuff>d__18(0)
{
<>4__this = this,
character = character,
modifiers = modifiers,
stacks = stacks
};
}
[IteratorStateMachine(typeof(<ApplyPermanentUpgrade>d__19))]
private IEnumerator ApplyPermanentUpgrade(CardStateModifiers modifiers, int stacks)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ApplyPermanentUpgrade>d__19(0)
{
<>4__this = this,
modifiers = modifiers,
stacks = stacks
};
}
[IteratorStateMachine(typeof(<ApplyTemporaryEffect>d__20))]
private IEnumerator ApplyTemporaryEffect(CharacterState character, int stacks)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ApplyTemporaryEffect>d__20(0)
{
<>4__this = this,
character = character,
stacks = stacks
};
}
[IteratorStateMachine(typeof(<ApplyStatBuffWithModifiers>d__21))]
private IEnumerator ApplyStatBuffWithModifiers(CharacterState character, CardStateModifiers modifiers, StatBuffType statBuffType, int stacks)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <ApplyStatBuffWithModifiers>d__21(0)
{
<>4__this = this,
character = character,
modifiers = modifiers,
statBuffType = statBuffType,
stacks = stacks
};
}
}
public class StatusEffectExtraAttackFullSilk : StatusEffectState
{
[CompilerGenerated]
private sealed class <OnTriggered>d__9 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public StatusEffectExtraAttackFullSilk <>4__this;
public InputTriggerParams inputTriggerParams;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <OnTriggered>d__9(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
int num = <>1__state;
StatusEffectExtraAttackFullSilk statusEffectExtraAttackFullSilk = <>4__this;
if (num != 0)
{
return false;
}
<>1__state = -1;
SilkManager instance = Railend.GetContainer().GetInstance<SilkManager>();
bool flag = instance.GetCurrentSilk() == instance.GetMaxSilk();
if (flag && !statusEffectExtraAttackFullSilk.ApplyingBuffToAttacker)
{
Plugin.Logger.LogInfo((object)("Applying buff to attacker: " + statusEffectExtraAttackFullSilk.ExtraAttackAmount));
inputTriggerParams.associatedCharacter.BuffDamage(statusEffectExtraAttackFullSilk.ExtraAttackAmount, (RelicState)null, true);
statusEffectExtraAttackFullSilk.ApplyingBuffToAttacker = true;
}
else if (!flag && statusEffectExtraAttackFullSilk.ApplyingBuffToAttacker)
{
Plugin.Logger.LogInfo((object)("Removing buff from attacker: " + statusEffectExtraAttackFullSilk.ExtraAttackAmount));
inputTriggerParams.associatedCharacter.DebuffDamage(statusEffectExtraAttackFullSilk.ExtraAttackAmount, (RelicState)null, true);
statusEffectExtraAttackFullSilk.ApplyingBuffToAttacker = false;
}
return false;
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
public bool ApplyingBuffToAttacker { get; set; }
public int ExtraAttackAmount { get; set; }
public override bool TestTrigger(InputTriggerParams inputTriggerParams, OutputTriggerParams outputTriggerParams, ICoreGameManagers coreGameManagers)
{
//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)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Invalid comparison between Unknown and I4
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Invalid comparison between Unknown and I4
Trigger triggerType = inputTriggerParams.triggerType;
if ((int)triggerType != 67)
{
return (int)triggerType == 68;
}
return true;
}
[IteratorStateMachine(typeof(<OnTriggered>d__9))]
protected override IEnumerator OnTriggered(InputTriggerParams inputTriggerParams, OutputTriggerParams outputTriggerParams, ICoreGameManagers coreGameManagers)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <OnTriggered>d__9(0)
{
<>4__this = this,
inputTriggerParams = inputTriggerParams
};
}
}
public class StatusEffectWarriorState : StatusEffectState
{
[CompilerGenerated]
private sealed class <OnTriggered>d__1 : IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public StatusEffectWarriorState <>4__this;
public ICoreGameManagers coreGameManagers;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <OnTriggered>d__1(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
int num = <>1__state;
StatusEffectWarriorState statusEffectWarriorState = <>4__this;
switch (num)
{
default:
return false;
case 0:
{
<>1__state = -1;
SilkManager instance = Railend.GetContainer().GetInstance<SilkManager>();
if (((StatusEffectState)statusEffectWarriorState).IsPreviewModeCopy())
{
return false;
}
int num2 = 1;
RelicManager relicManager = coreGameManagers.GetRelicManager();
if ((Object)(object)relicManager != (Object)null)
{
List<IModifyWarriorSilkGainEffect> list = new List<IModifyWarriorSilkGainEffect>();
list = (from a in relicManager.GetRelicEffects<IModifyWarriorSilkGainEffect>(list)
orderby a.ApplyOrder
select a).ToList();
foreach (IModifyWarriorSilkGainEffect item in list)
{
num2 += item.GetSilkGainAmount();
num2 *= item.GetSilkGainMultiplier();
}
}
<>2__current = instance.RewardSilk(num2);
<>1__state = 1;
return true;
}
case 1:
<>1__state = -1;
return false;
}
}
bool IEnumerator.MoveNext()
{
//ILSpy generated this explicit interface implementation from .override directive in MoveNext
return this.MoveNext();
}
[DebuggerHidden]
void IEnumerator.Reset()
{
throw new NotSupportedException();
}
}
public override int GetTriggerOrder()
{
return 4;
}
[IteratorStateMachine(typeof(<OnTriggered>d__1))]
protected override IEnumerator OnTriggered(InputTriggerParams inputTriggerParams, OutputTriggerParams outputTriggerParams, ICoreGameManagers coreGameManagers)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return new <OnTriggered>d__1(0)
{
<>4__this = this,
coreGameManagers = coreGameManagers
};
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "Silk_Song_Clan.Plugin";
public const string PLUGIN_NAME = "Silk_Song_Clan.Plugin";
public const string PLUGIN_VERSION = "0.2.4";
}
}