using System;
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.Security;
using System.Security.Permissions;
using AddWatermark;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using LBoL.Base;
using LBoL.Base.Extensions;
using LBoL.ConfigData;
using LBoL.Core;
using LBoL.Core.Battle;
using LBoL.Core.Battle.BattleActions;
using LBoL.Core.Battle.Interactions;
using LBoL.Core.Cards;
using LBoL.Core.StatusEffects;
using LBoL.Core.Units;
using LBoL.EntityLib.Cards.Character.Sakuya;
using LBoL.EntityLib.Cards.Enemy;
using LBoL.EntityLib.Exhibits;
using LBoL.Presentation;
using LBoLEntitySideloader;
using LBoLEntitySideloader.Attributes;
using LBoLEntitySideloader.Entities;
using LBoLEntitySideloader.ReflectionHelpers;
using LBoLEntitySideloader.Resource;
using LBoLEntitySideloader.Utils;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: IgnoresAccessChecksTo("LBoL.Base")]
[assembly: IgnoresAccessChecksTo("LBoL.ConfigData")]
[assembly: IgnoresAccessChecksTo("LBoL.Core")]
[assembly: IgnoresAccessChecksTo("LBoL.EntityLib")]
[assembly: IgnoresAccessChecksTo("LBoL.Presentation")]
[assembly: IgnoresAccessChecksTo("Untitled.ConfigDataBuilder.Base")]
[assembly: AssemblyCompany("VariantsC")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("VariantsC")]
[assembly: AssemblyTitle("VariantsC")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace VariantsC
{
public static class CustomLoadouts
{
public static void AddLoadouts()
{
List<string> second = new List<string> { "Shoot", "Shoot", "Boundary", "Boundary" };
PlayerUnitTemplate.AddLoadout("Reimu", "JabReimuCUlt", "ChocolateCoinEx", new List<string> { "ReimuAttackR", "ReimuAttackW", "ReimuBlockR", "ReimuBlockW", "BalancedBasicCard", "RollingPebbleCard" }.Concat(second).ToList(), 2, (Assembly)null);
PlayerUnitTemplate.AddLoadout("Sakuya", "BatFormUlt", "BloodyRipperEx", new List<string> { "SakuyaAttackU", "SakuyaAttackW", "SakuyaBlockU", "SakuyaBlockW", "ConsequenceOfHickeysCard", "ChaoticBloodMagicCard", "Shoot", "Shoot", "Shoot", "Boundary" }.ToList(), 3, (Assembly)null);
}
}
[BepInPlugin("neo.lbol.gameplay.VariantsC", "Variants C", "0.0.4200")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInProcess("LBoL.exe")]
public class BepinexPlugin : BaseUnityPlugin
{
private static readonly Harmony harmony = PInfo.harmony;
internal static ManualLogSource log;
internal static TemplateSequenceTable sequenceTable = new TemplateSequenceTable(0);
internal static IResourceSource embeddedSource = (IResourceSource)new EmbeddedSource(Assembly.GetExecutingAssembly());
internal static DirectorySource directorySource = new DirectorySource("neo.lbol.gameplay.VariantsC", "");
internal static ConfigEntry<bool> poolNewCards;
internal static BatchLocalization CardBatchLoc = new BatchLocalization((IResourceSource)(object)directorySource, typeof(CardTemplate), "Card", (Locale)0, false);
internal static BatchLocalization StatusEffectBatchLoc = new BatchLocalization((IResourceSource)(object)directorySource, typeof(StatusEffectTemplate), "StatusEffect", (Locale)0, false);
internal static BatchLocalization ExhibitBatchLoc = new BatchLocalization((IResourceSource)(object)directorySource, typeof(ExhibitTemplate), "Exhibit", (Locale)0, false);
internal static BatchLocalization UltimateSkillBatchLoc = new BatchLocalization((IResourceSource)(object)directorySource, typeof(UltimateSkillTemplate), "UltimateSkill", (Locale)0, false);
private void Awake()
{
log = ((BaseUnityPlugin)this).Logger;
Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
poolNewCards = ((BaseUnityPlugin)this).Config.Bind<bool>("Pools", "poolNewCards", true, "Makes new non-basic starting cards discoverable/undiscoverable during game run.");
EntityManager.RegisterSelf();
harmony.PatchAll();
if (Chainloader.PluginInfos.ContainsKey("neo.lbol.tools.watermark"))
{
WatermarkWrapper.ActivateWatermark();
}
CustomLoadouts.AddLoadouts();
}
private void OnDestroy()
{
if (harmony != null)
{
harmony.UnpatchSelf();
}
}
}
public static class PInfo
{
public const string GUID = "neo.lbol.gameplay.VariantsC";
public const string Name = "Variants C";
public const string version = "0.0.4200";
public static readonly Harmony harmony = new Harmony("neo.lbol.gameplay.VariantsC");
}
internal class WatermarkWrapper
{
[MethodImpl(MethodImplOptions.NoInlining)]
internal static void ActivateWatermark()
{
API.ActivateWatermark();
}
}
}
namespace VariantsC.Shared
{
public sealed class BalancedBasicCardDef : CardTemplate
{
public override IdContainer GetId()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return IdContainer.op_Implicit("BalancedBasicCard");
}
public override CardImages LoadCardImages()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
CardImages val = new CardImages(BepinexPlugin.embeddedSource);
val.AutoLoad((CardTemplate)(object)this, ".png", "", false);
return val;
}
public override LocalizationOption LoadLocalization()
{
return (LocalizationOption)(object)BepinexPlugin.CardBatchLoc.AddEntity((EntityDefinition)(object)this);
}
public override CardConfig MakeConfig()
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0148: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: Expected O, but got Unknown
string[][] array = new string[0][];
TargetType? val = (TargetType)1;
List<ManaColor> list = new List<ManaColor>();
ManaGroup val2 = default(ManaGroup);
((ManaGroup)(ref val2)).Any = 2;
return new CardConfig(0, "", 10, true, array, "ShootC", "ShootC1", 0, false, false, true, false, true, (Rarity)0, (CardType)1, val, (IReadOnlyList<ManaColor>)list, false, val2, (ManaGroup?)null, (int?)null, (int?)4, (int?)7, (int?)4, (int?)7, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (ManaGroup?)null, (ManaGroup?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (Keyword)2, (Keyword)2, false, (Keyword)0, (Keyword)0, (IReadOnlyList<string>)new List<string>(), (IReadOnlyList<string>)new List<string>(), (IReadOnlyList<string>)new List<string>(), (IReadOnlyList<string>)new List<string>(), (string)null, "", "", false, "白Shiro@", (IReadOnlyList<string>)new List<string>());
}
}
[EntityLogic(typeof(BalancedBasicCardDef))]
public sealed class BalancedBasicCard : Card
{
protected override IEnumerable<BattleAction> Actions(UnitSelector selector, ManaGroup consumingMana, Interaction precondition)
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
yield return ((Card)this).DefenseAction(true);
yield return ((Card)this).AttackAction(selector, (GunPair)null);
}
}
}
namespace VariantsC.Sakuya.C
{
public sealed class BatFormUltDef : UltimateSkillTemplate
{
public override IdContainer GetId()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return IdContainer.op_Implicit("BatFormUlt");
}
public override LocalizationOption LoadLocalization()
{
return (LocalizationOption)(object)BepinexPlugin.UltimateSkillBatchLoc.AddEntity((EntityDefinition)(object)this);
}
public override Sprite LoadSprite()
{
return ResourceLoader.LoadSprite("BatFormUlt.png", BepinexPlugin.embeddedSource, (Rect?)null, 1, (Vector2?)null);
}
public override UltimateSkillConfig MakeConfig()
{
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Expected O, but got Unknown
return new UltimateSkillConfig("", 10, 100, 100, 2, (UsRepeatableType)1, 0, 2, 2, (Keyword)0, (IReadOnlyList<string>)new List<string> { "BloodDrainSe" }, (IReadOnlyList<string>)new List<string> { "Knife" });
}
}
[EntityLogic(typeof(BatFormUltDef))]
public sealed class BatFormUlt : UltimateSkill
{
public BatFormUlt()
{
((UltimateSkill)this).TargetType = (TargetType)4;
}
protected override IEnumerable<BattleAction> Actions(UnitSelector selector)
{
yield return (BattleAction)(object)PerformAction.Spell((Unit)(object)((UltimateSkill)this).Owner, ((GameEntity)this).Id);
yield return (BattleAction)(object)PerformAction.Effect((Unit)(object)((UltimateSkill)this).Owner, "MoonR", 0f, "Wolf", 0f, (EffectBehavior)0, 0f);
yield return (BattleAction)(object)new ApplyStatusEffectAction<BloodDrainSe>((Unit)(object)((UltimateSkill)this).Owner, (int?)((UltimateSkill)this).Value1, (int?)1, (int?)null, (int?)null, 0f, true);
yield return (BattleAction)new AddCardsToHandAction((IEnumerable<Card>)Library.CreateCards<Knife>(((UltimateSkill)this).Value2, false), (AddCardsType)0);
}
}
public sealed class BloodDrainSeDef : StatusEffectTemplate
{
public override IdContainer GetId()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return IdContainer.op_Implicit("BloodDrainSe");
}
public override LocalizationOption LoadLocalization()
{
return (LocalizationOption)(object)BepinexPlugin.StatusEffectBatchLoc.AddEntity((EntityDefinition)(object)this);
}
public override Sprite LoadSprite()
{
return ResourcesHelper.TryGetSprite<StatusEffect>("Vampire");
}
public override StatusEffectConfig MakeConfig()
{
StatusEffectConfig val = ObjectExtensions.Copy<StatusEffectConfig>(StatusEffectConfig.FromId("Vampire"));
val.HasLevel = true;
val.LevelStackType = (StackType)0;
val.HasDuration = true;
val.DurationStackType = (StackType)3;
val.Keywords = (Keyword)0;
val.DurationDecreaseTiming = (DurationDecreaseTiming)3;
return val;
}
}
[EntityLogic(typeof(BloodDrainSeDef))]
public sealed class BloodDrainSe : StatusEffect
{
private Stack<GameEntity> dmgSources = new Stack<GameEntity>();
protected override void OnAdded(Unit unit)
{
((StatusEffect)this).ReactOwnerEvent<StatisticalDamageEventArgs>(((StatusEffect)this).Owner.StatisticalTotalDamageDealt, (EventSequencedReactor<StatisticalDamageEventArgs>)OnStatisticalDamageDealt);
((StatusEffect)this).HandleOwnerEvent<DamageEventArgs>(((StatusEffect)this).Owner.DamageDealt, (GameEventHandler<DamageEventArgs>)OnDamageDealt);
}
private bool CouldActivate(DamageInfo damageInfo)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Invalid comparison between Unknown and I4
return (int)((DamageInfo)(ref damageInfo)).DamageType == 2 && ((DamageInfo)(ref damageInfo)).Amount > 0f;
}
private void OnDamageDealt(DamageEventArgs args)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Invalid comparison between Unknown and I4
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
if ((int)((GameEventArgs)args).Cause != 20 && CouldActivate(args.DamageInfo) && dmgSources.Count < ((StatusEffect)this).Level && !dmgSources.Contains(((GameEventArgs)args).ActionSource))
{
dmgSources.Push(((GameEventArgs)args).ActionSource);
}
}
private IEnumerable<BattleAction> OnStatisticalDamageDealt(StatisticalDamageEventArgs args)
{
bool activated = false;
if (dmgSources.Count <= 0 || dmgSources.Peek() != ((GameEventArgs)args).ActionSource)
{
yield break;
}
foreach (KeyValuePair<Unit, IReadOnlyList<DamageEventArgs>> unitDmgs in args.ArgsTable)
{
int totalHeal = 0;
unitDmgs.Deconstruct(out var unit, out var damageEvents);
foreach (DamageEventArgs dmg in damageEvents)
{
if (CouldActivate(dmg.DamageInfo))
{
activated = true;
int num = totalHeal;
DamageInfo damageInfo = dmg.DamageInfo;
totalHeal = num + MathExtensions.ToInt(((DamageInfo)(ref damageInfo)).Damage);
}
}
if (totalHeal > 0)
{
<>n__0();
yield return (BattleAction)new HealAction(unit, ((StatusEffect)this).Owner, totalHeal, (HealType)1, 0f);
}
unit = null;
damageEvents = null;
}
if (activated)
{
int level = ((StatusEffect)this).Level;
((StatusEffect)this).Level = level - 1;
if (((StatusEffect)this).Level <= 0)
{
yield return (BattleAction)new RemoveStatusEffectAction((StatusEffect)(object)this, true, 0.1f);
}
}
dmgSources.Pop();
}
[CompilerGenerated]
[DebuggerHidden]
private void <>n__0()
{
((StatusEffect)this).NotifyActivating();
}
}
public sealed class BloodyRipperExDef : ExhibitTemplate
{
public override IdContainer GetId()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return IdContainer.op_Implicit("BloodyRipperEx");
}
public override LocalizationOption LoadLocalization()
{
return (LocalizationOption)(object)BepinexPlugin.ExhibitBatchLoc.AddEntity((EntityDefinition)(object)this);
}
public override ExhibitSprites LoadSprite()
{
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Expected O, but got Unknown
return new ExhibitSprites(ResourceLoader.LoadSprite("BloodyRipperEx.png", BepinexPlugin.embeddedSource, (Rect?)null, 1, (Vector2?)null));
}
public override ExhibitConfig MakeConfig()
{
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0078: Expected O, but got Unknown
return new ExhibitConfig(0, "", 25, false, false, false, false, (AppearanceType)0, "Sakuya", (ExhibitLosableType)1, (Rarity)3, (int?)13, (int?)3, (int?)null, (ManaGroup?)null, (ManaColor?)null, (ManaColor?)(ManaColor)4, 1, true, (int?)null, (Keyword)0, (IReadOnlyList<string>)new List<string> { "BloodDrainSe" }, (IReadOnlyList<string>)new List<string> { "Knife" });
}
}
[EntityLogic(typeof(BloodyRipperExDef))]
public sealed class BloodyRipperEx : ShiningExhibit
{
private int TrackCounter
{
get
{
return ((Exhibit)this).Counter;
}
set
{
((Exhibit)this).Counter = Math.Max(0, value);
BloodyRipperSe bloodyRipperSe = default(BloodyRipperSe);
if (((Unit)((Exhibit)this).Owner).TryGetStatusEffect<BloodyRipperSe>(ref bloodyRipperSe))
{
((StatusEffect)bloodyRipperSe).Count = ((Exhibit)this).Counter;
}
}
}
public override void OnGain(PlayerUnit player)
{
((ShiningExhibit)this).OnGain(player);
((GameEntity)this).GameRun.GainMaxHp(((Exhibit)this).Value1, true, false);
}
public override void OnLose(PlayerUnit player)
{
((ShiningExhibit)this).OnLose(player);
((GameEntity)this).GameRun.LoseMaxHp(((Exhibit)this).Value1, true);
}
protected override void OnEnterBattle()
{
((Exhibit)this).ReactBattleEvent<CardUsingEventArgs>(((Exhibit)this).Battle.CardUsed, (EventSequencedReactor<CardUsingEventArgs>)OnCardUsed);
((Exhibit)this).HandleBattleEvent<UnitEventArgs>(((Unit)((Exhibit)this).Owner).TurnEnding, (GameEventHandler<UnitEventArgs>)delegate
{
TrackCounter--;
});
((Exhibit)this).HandleBattleEvent<GameEventArgs>(((Exhibit)this).Battle.BattleStarting, (GameEventHandler<GameEventArgs>)delegate
{
PlayerUnit owner = ((Exhibit)this).Owner;
int? num = ((Exhibit)this).Value2;
int? num2 = 0;
((GameEntity)this).React(Reactor.op_Implicit((BattleAction)(object)new ApplyStatusEffectAction<BloodyRipperSe>((Unit)(object)owner, num, (int?)null, num2, (int?)null, 0f, true)));
}, (GameEventPriority)(-50));
TrackCounter = 0;
}
protected override void OnLeaveBattle()
{
TrackCounter = 0;
}
private IEnumerable<BattleAction> OnCardUsed(CardUsingEventArgs args)
{
if (((Exhibit)this).Battle.BattleShouldEnd)
{
yield break;
}
if ((int)args.Card.CardType == 1)
{
TrackCounter++;
if (TrackCounter >= ((Exhibit)this).Value2)
{
((Exhibit)this).NotifyActivating();
BloodyRipperSe br = default(BloodyRipperSe);
if (((Unit)((Exhibit)this).Owner).TryGetStatusEffect<BloodyRipperSe>(ref br))
{
((StatusEffect)br).NotifyActivating();
}
yield return (BattleAction)(object)new ApplyStatusEffectAction<BloodDrainSe>((Unit)(object)((Exhibit)this).Owner, (int?)1, (int?)1, (int?)null, (int?)null, 0f, true);
TrackCounter = 0;
}
}
if (((GameEntity)args.Card).Id != "Knife")
{
int dmg = ((GameEntity)this).GameRun.BattleRng.NextInt(1, 3);
if (dmg >= ((Unit)((Exhibit)this).Owner).Hp)
{
dmg = ((Unit)((Exhibit)this).Owner).Hp - 1;
}
yield return (BattleAction)new DamageAction((Unit)(object)((Exhibit)this).Owner, (Unit)(object)((Exhibit)this).Owner, DamageInfo.HpLose((float)dmg, true), "Sacrifice", (GunType)0);
}
}
}
public sealed class BloodRipperSeDef : StatusEffectTemplate
{
public override IdContainer GetId()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return IdContainer.op_Implicit("BloodyRipperSe");
}
public override LocalizationOption LoadLocalization()
{
return (LocalizationOption)(object)BepinexPlugin.StatusEffectBatchLoc.AddEntity((EntityDefinition)(object)this);
}
public override Sprite LoadSprite()
{
return ResourceLoader.LoadSprite("BloodyRipperEx.png", BepinexPlugin.embeddedSource, (Rect?)null, 1, (Vector2?)null);
}
public override StatusEffectConfig MakeConfig()
{
StatusEffectConfig val = ((StatusEffectTemplate)this).DefaultConfig();
val.HasLevel = true;
val.Type = (StatusEffectType)2;
val.HasCount = true;
return val;
}
}
[EntityLogic(typeof(BloodRipperSeDef))]
public sealed class BloodyRipperSe : StatusEffect
{
}
public sealed class ChaoticBloodMagicCardDef : CardTemplate
{
public override IdContainer GetId()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return IdContainer.op_Implicit("ChaoticBloodMagicCard");
}
public override CardImages LoadCardImages()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
CardImages val = new CardImages(BepinexPlugin.embeddedSource);
val.AutoLoad((CardTemplate)(object)this, ".png", "", false);
return val;
}
public override LocalizationOption LoadLocalization()
{
return (LocalizationOption)(object)BepinexPlugin.CardBatchLoc.AddEntity((EntityDefinition)(object)this);
}
public override CardConfig MakeConfig()
{
//IL_0041: 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_00c4: Unknown result type (might be due to invalid IL or missing references)
//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00f3: Unknown result type (might be due to invalid IL or missing references)
//IL_0193: Unknown result type (might be due to invalid IL or missing references)
//IL_0199: Expected O, but got Unknown
string[][] array = new string[0][];
bool value = BepinexPlugin.poolNewCards.Value;
TargetType? val = (TargetType)2;
List<ManaColor> obj = new List<ManaColor> { (ManaColor)4 };
ManaGroup val2 = default(ManaGroup);
((ManaGroup)(ref val2)).Any = 1;
((ManaGroup)(ref val2)).Red = 1;
ManaGroup val3 = val2;
int? num = 11;
int? num2 = 17;
val2 = default(ManaGroup);
((ManaGroup)(ref val2)).Red = 2;
ManaGroup? val4 = val2;
val2 = default(ManaGroup);
((ManaGroup)(ref val2)).Red = 1;
((ManaGroup)(ref val2)).Philosophy = 1;
return new CardConfig(0, "", 10, true, array, "RemiZhua", "RemiZhuaB", 0, false, value, true, false, true, (Rarity)0, (CardType)1, val, (IReadOnlyList<ManaColor>)obj, false, val3, (ManaGroup?)null, (int?)null, num, num2, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, val4, (ManaGroup?)val2, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (Keyword)0, (Keyword)0, false, (Keyword)0, (Keyword)0, (IReadOnlyList<string>)new List<string>(), (IReadOnlyList<string>)new List<string>(), (IReadOnlyList<string>)new List<string>(), (IReadOnlyList<string>)new List<string>(), "Sakuya", "", "", false, "かわやばぐ", (IReadOnlyList<string>)new List<string>());
}
}
[EntityLogic(typeof(ChaoticBloodMagicCardDef))]
public sealed class ChaoticBloodMagicCard : Card
{
protected override void OnEnterBattle(BattleController battle)
{
((Card)this).ReactBattleEvent<DieEventArgs>(((Card)this).Battle.EnemyDied, (EventSequencedReactor<DieEventArgs>)OnEnemyDied);
}
private IEnumerable<BattleAction> OnEnemyDied(DieEventArgs args)
{
if (args.DieSource == this)
{
yield return (BattleAction)new GainManaAction(((Card)this).Mana);
}
}
}
public sealed class ConsequenceOfHickeysCardDef : CardTemplate
{
public override IdContainer GetId()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return IdContainer.op_Implicit("ConsequenceOfHickeysCard");
}
public override CardImages LoadCardImages()
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Expected O, but got Unknown
return new CardImages(BepinexPlugin.embeddedSource, ResourceLoader.LoadTexture("ConsequencesOfHickeysCard.png", BepinexPlugin.embeddedSource));
}
public override LocalizationOption LoadLocalization()
{
return (LocalizationOption)(object)BepinexPlugin.CardBatchLoc.AddEntity((EntityDefinition)(object)this);
}
public override CardConfig MakeConfig()
{
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0180: Unknown result type (might be due to invalid IL or missing references)
//IL_0186: Expected O, but got Unknown
string[][] array = new string[0][];
bool value = BepinexPlugin.poolNewCards.Value;
TargetType? val = (TargetType)1;
List<ManaColor> obj = new List<ManaColor> { (ManaColor)4 };
ManaGroup val2 = default(ManaGroup);
((ManaGroup)(ref val2)).Red = 1;
ManaGroup val3 = val2;
val2 = default(ManaGroup);
((ManaGroup)(ref val2)).Any = 1;
return new CardConfig(0, "", 10, true, array, "Simple1", "Simple2", 0, false, value, true, false, true, (Rarity)0, (CardType)1, val, (IReadOnlyList<ManaColor>)obj, false, val3, (ManaGroup?)val2, (int?)null, (int?)3, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)2, (int?)1, (int?)2, (int?)3, (ManaGroup?)null, (ManaGroup?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (Keyword)0, (Keyword)0, false, (Keyword)0, (Keyword)0, (IReadOnlyList<string>)new List<string>(), (IReadOnlyList<string>)new List<string>(), (IReadOnlyList<string>)new List<string> { "Knife" }, (IReadOnlyList<string>)new List<string> { "Knife" }, "Sakuya", "", "", false, "@kon_ypaaa", (IReadOnlyList<string>)new List<string>());
}
}
[EntityLogic(typeof(ConsequenceOfHickeysCardDef))]
public sealed class ConsequenceOfHickeysCard : Card
{
protected override IEnumerable<BattleAction> Actions(UnitSelector selector, ManaGroup consumingMana, Interaction precondition)
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
yield return (BattleAction)(object)PerformAction.Gun((Unit)(object)((Card)this).Battle.Player, (Unit)(object)((Card)this).Battle.Player, "ESakuyaShoot2", 0f);
yield return ((Card)this).SacrificeAction(((Card)this).Value1);
yield return ((Card)this).AttackAction(selector, (GunPair)null);
yield return (BattleAction)new AddCardsToHandAction((IEnumerable<Card>)Library.CreateCards<Knife>(((Card)this).Value2, false), (AddCardsType)0);
}
}
}
namespace VariantsC.Sakuya.C.BunniesCorrection
{
public sealed class MoonTipsSpacesuitCardDef : CardTemplate
{
public override IdContainer GetId()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return IdContainer.op_Implicit("MoonTipsSpacesuitCard");
}
public override CardImages LoadCardImages()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
CardImages val = new CardImages(BepinexPlugin.embeddedSource);
val.AutoLoad((CardTemplate)(object)this, ".png", "", false);
return val;
}
public override LocalizationOption LoadLocalization()
{
return (LocalizationOption)(object)BepinexPlugin.CardBatchLoc.AddEntity((EntityDefinition)(object)this);
}
public override CardConfig MakeConfig()
{
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0148: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: Expected O, but got Unknown
return new CardConfig(0, "", 10, true, new string[0][], "Simple1", "Simple1", 0, false, false, true, true, false, (Rarity)1, (CardType)6, (TargetType?)(TargetType)0, (IReadOnlyList<ManaColor>)new List<ManaColor>(), false, default(ManaGroup), (ManaGroup?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (ManaGroup?)null, (ManaGroup?)null, (int?)null, (int?)null, (int?)1, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (Keyword)0, (Keyword)0, false, (Keyword)0, (Keyword)0, (IReadOnlyList<string>)new List<string>(), (IReadOnlyList<string>)new List<string>(), (IReadOnlyList<string>)new List<string>(), (IReadOnlyList<string>)new List<string>(), (string)null, "", "", false, "DD/neo", (IReadOnlyList<string>)new List<string>());
}
}
[EntityLogic(typeof(MoonTipsSpacesuitCardDef))]
public sealed class MoonTipsSpacesuitCard : Card
{
}
public sealed class MoonTipsSpacesuitSeDef : StatusEffectTemplate
{
public override IdContainer GetId()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return IdContainer.op_Implicit("MoonTipsSpacesuitSe");
}
public override LocalizationOption LoadLocalization()
{
return (LocalizationOption)(object)BepinexPlugin.StatusEffectBatchLoc.AddEntity((EntityDefinition)(object)this);
}
public override Sprite LoadSprite()
{
return ResourcesHelper.TryGetSprite<Exhibit>("Yuhangfu");
}
public override StatusEffectConfig MakeConfig()
{
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_004e: Expected O, but got Unknown
return new StatusEffectConfig(0, "", 10, (StatusEffectType)0, false, true, (int?)null, false, (StackType?)(StackType)0, false, (StackType?)(StackType)0, (DurationDecreaseTiming)0, false, (StackType?)(StackType)3, (StackType?)(StackType)3, false, (Keyword)0, (IReadOnlyList<string>)new List<string>(), "Default", "Default", "Default");
}
}
[EntityLogic(typeof(MoonTipsSpacesuitSeDef))]
public sealed class MoonTipsSpacesuitSe : StatusEffect
{
protected override void OnAdded(Unit unit)
{
((StatusEffect)this).HandleOwnerEvent<DamageEventArgs>(((StatusEffect)this).Owner.DamageTaking, (GameEventHandler<DamageEventArgs>)OnPlayerDamageTaking);
}
private void OnPlayerDamageTaking(DamageEventArgs args)
{
//IL_0002: 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_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
DamageInfo damageInfo = args.DamageInfo;
if (MathExtensions.RoundToInt(((DamageInfo)(ref damageInfo)).Damage) > 0)
{
((StatusEffect)this).NotifyActivating();
damageInfo = args.DamageInfo;
args.DamageInfo = ((DamageInfo)(ref damageInfo)).ReduceActualDamageBy(1);
((GameEventArgs)args).AddModifier((GameEntity)(object)this);
}
}
}
[HarmonyPatch]
internal class MoonTipsBag_Patch
{
private static IEnumerable<MethodBase> TargetMethods()
{
yield return ExtraAccess.InnerMoveNext(typeof(MoonTipsBag), "Actions");
}
public static bool DoPatch()
{
GameMaster instance = Singleton<GameMaster>.Instance;
bool? obj;
if (instance == null)
{
obj = null;
}
else
{
GameRunController currentGameRun = instance.CurrentGameRun;
if (currentGameRun == null)
{
obj = null;
}
else
{
PlayerUnit player = currentGameRun.Player;
obj = ((player != null) ? new bool?(player.HasExhibit<BloodyRipperEx>()) : null);
}
}
bool? flag = obj;
return flag.GetValueOrDefault();
}
private static void CreateNewOption(List<Card> list)
{
if (DoPatch())
{
list.Add((Card)(object)Library.CreateCard<MoonTipsSpacesuitCard>());
}
}
private static bool CheckOption(Card card, MoonTipsBag moonTipsBag)
{
if (card is MoonTipsSpacesuitCard)
{
((Card)moonTipsBag).Battle.RequestDebugAction(((Card)moonTipsBag).BuffAction<MoonTipsSpacesuitSe>(0, 0, 0, 0, 0.2f), "Special Moon Tip");
return true;
}
return false;
}
private static IEnumerable<CodeInstruction> Transpiler(MethodBase original, IEnumerable<CodeInstruction> instructions, ILGenerator generator)
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Expected O, but got Unknown
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_009d: Expected O, but got Unknown
//IL_00c5: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Expected O, but got Unknown
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
//IL_00fc: Expected O, but got Unknown
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_011c: Expected O, but got Unknown
//IL_012f: Unknown result type (might be due to invalid IL or missing references)
//IL_0135: Expected O, but got Unknown
//IL_015d: Unknown result type (might be due to invalid IL or missing references)
//IL_0163: Expected O, but got Unknown
//IL_017b: Unknown result type (might be due to invalid IL or missing references)
//IL_0181: Expected O, but got Unknown
Label label = default(Label);
return new CodeMatcher(instructions, generator).End().MatchBack(false, (CodeMatch[])(object)new CodeMatch[1] { CodeMatch.op_Implicit(OpCodes.Ldarg_0) }).CreateLabel(ref label)
.Start()
.MatchForward(true, (CodeMatch[])(object)new CodeMatch[1] { CodeMatch.op_Implicit(new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(Library), "CreateCard", new Type[0], (Type[])null).MakeGenericMethod(typeof(MoonTipsHeal)))) })
.Advance(2)
.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[1]
{
new CodeInstruction(OpCodes.Dup, (object)null)
})
.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[1]
{
new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(MoonTipsBag_Patch), "CreateNewOption", (Type[])null, (Type[])null))
})
.MatchForward(false, (CodeMatch[])(object)new CodeMatch[1] { CodeMatch.op_Implicit(new CodeInstruction(OpCodes.Callvirt, (object)AccessTools.PropertyGetter(typeof(MiniSelectCardInteraction), "SelectedCard"))) })
.Advance(2)
.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[1]
{
new CodeInstruction(OpCodes.Ldloc_3, (object)null)
})
.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[1]
{
new CodeInstruction(OpCodes.Ldloc_1, (object)null)
})
.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[1]
{
new CodeInstruction(OpCodes.Call, (object)AccessTools.Method(typeof(MoonTipsBag_Patch), "CheckOption", (Type[])null, (Type[])null))
})
.InsertAndAdvance((CodeInstruction[])(object)new CodeInstruction[1]
{
new CodeInstruction(OpCodes.Brtrue, (object)label)
})
.InstructionEnumeration();
}
}
}
namespace VariantsC.Reimu.C
{
public sealed class ChocolateCoinExDef : ExhibitTemplate
{
[EntityLogic(typeof(ChocolateCoinExDef))]
public sealed class ChocolateCoinEx : ShiningExhibit
{
protected override void OnEnterBattle()
{
((Exhibit)this).ReactBattleEvent<UnitEventArgs>(((Unit)((Exhibit)this).Battle.Player).TurnStarting, (EventSequencedReactor<UnitEventArgs>)OnTurnStarting);
((Exhibit)this).Counter = ((Exhibit)this).Value1;
}
protected override void OnLeaveBattle()
{
((Exhibit)this).Counter = 0;
}
private IEnumerable<BattleAction> OnTurnStarting(UnitEventArgs args)
{
if (((Exhibit)this).Counter <= 0)
{
yield break;
}
IEnumerable<Card> basics = ((Exhibit)this).Battle.DrawZone.Where((Card c) => c.IsBasic);
if (basics.Count() == 0)
{
basics = ((Exhibit)this).Battle.DiscardZone.Where((Card c) => c.IsBasic);
}
if (basics.Count() == 0)
{
basics = ((Exhibit)this).Battle.HandZone.Where((Card c) => c.IsBasic);
}
if (basics.Count() > 0)
{
((Exhibit)this).NotifyActivating();
yield return (BattleAction)new ExileCardAction(CollectionsExtensions.Sample<Card>(basics, ((GameEntity)this).GameRun.BattleRng));
}
int counter = ((Exhibit)this).Counter;
((Exhibit)this).Counter = counter - 1;
}
}
public override IdContainer GetId()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return IdContainer.op_Implicit("ChocolateCoinEx");
}
public override LocalizationOption LoadLocalization()
{
return (LocalizationOption)(object)BepinexPlugin.ExhibitBatchLoc.AddEntity((EntityDefinition)(object)this);
}
public override ExhibitSprites LoadSprite()
{
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Expected O, but got Unknown
return new ExhibitSprites(ResourceLoader.LoadSprite("ChocolateCoinEx.png", BepinexPlugin.embeddedSource, (Rect?)null, 1, (Vector2?)null));
}
public override ExhibitConfig MakeConfig()
{
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Expected O, but got Unknown
return new ExhibitConfig(0, "", -5, false, false, false, false, (AppearanceType)0, "Reimu", (ExhibitLosableType)1, (Rarity)3, (int?)4, (int?)null, (int?)null, (ManaGroup?)null, (ManaColor?)null, (ManaColor?)(ManaColor)6, 1, true, (int?)null, (Keyword)131074, (IReadOnlyList<string>)new List<string>(), (IReadOnlyList<string>)new List<string>());
}
}
public sealed class JabReimuCUltDef : UltimateSkillTemplate
{
public override IdContainer GetId()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return IdContainer.op_Implicit("JabReimuCUlt");
}
public override LocalizationOption LoadLocalization()
{
return (LocalizationOption)(object)BepinexPlugin.UltimateSkillBatchLoc.AddEntity((EntityDefinition)(object)this);
}
public override Sprite LoadSprite()
{
return ResourceLoader.LoadSprite("reimu_fist.png", BepinexPlugin.embeddedSource, (Rect?)null, 1, (Vector2?)null);
}
public override UltimateSkillConfig MakeConfig()
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
return new UltimateSkillConfig("", 10, 45, 45, 5, (UsRepeatableType)0, 13, 0, 0, (Keyword)0, (IReadOnlyList<string>)new List<string>(), (IReadOnlyList<string>)new List<string>());
}
}
[EntityLogic(typeof(JabReimuCUltDef))]
public sealed class JabReimuCUlt : UltimateSkill
{
public override DamageInfo Damage => DamageInfo.Attack((float)((UltimateSkill)this).Config.Damage, false);
public JabReimuCUlt()
{
((UltimateSkill)this).TargetType = (TargetType)1;
((UltimateSkill)this).GunName = "博丽一拳";
}
protected override IEnumerable<BattleAction> Actions(UnitSelector selector)
{
yield return (BattleAction)new DamageAction((Unit)(object)((UltimateSkill)this).Owner, (Unit)(object)selector.GetEnemy(((UltimateSkill)this).Battle), ((UltimateSkill)this).Damage, ((UltimateSkill)this).GunName, (GunType)0);
}
}
public sealed class RollingPebbleCardDef : CardTemplate
{
public override IdContainer GetId()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return IdContainer.op_Implicit("RollingPebbleCard");
}
public override CardImages LoadCardImages()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
CardImages val = new CardImages(BepinexPlugin.embeddedSource);
val.AutoLoad((CardTemplate)(object)this, ".png", "", false);
return val;
}
public override LocalizationOption LoadLocalization()
{
return (LocalizationOption)(object)BepinexPlugin.CardBatchLoc.AddEntity((EntityDefinition)(object)this);
}
public override CardConfig MakeConfig()
{
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0177: Unknown result type (might be due to invalid IL or missing references)
//IL_017d: Expected O, but got Unknown
string[][] array = new string[0][];
bool value = BepinexPlugin.poolNewCards.Value;
TargetType? val = (TargetType)1;
List<ManaColor> obj = new List<ManaColor> { (ManaColor)6 };
ManaGroup val2 = default(ManaGroup);
((ManaGroup)(ref val2)).Any = 1;
return new CardConfig(0, "", 10, true, array, "ENitoriShoot1", "", 0, false, value, true, false, true, (Rarity)0, (CardType)1, val, (IReadOnlyList<ManaColor>)obj, false, val2, (ManaGroup?)null, (int?)null, (int?)6, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)5, (int?)null, (int?)null, (int?)null, (ManaGroup?)null, (ManaGroup?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (int?)null, (Keyword)2147483648u, (Keyword)2147483904u, false, (Keyword)0, (Keyword)0, (IReadOnlyList<string>)new List<string>(), (IReadOnlyList<string>)new List<string>(), (IReadOnlyList<string>)new List<string>(), (IReadOnlyList<string>)new List<string>(), "Koishi", "", "", false, "わらび餅", (IReadOnlyList<string>)new List<string> { "minato_hitori" });
}
}
[EntityLogic(typeof(RollingPebbleCardDef))]
public sealed class RollingPebbleCard : Card
{
private int extraDmg = 0;
public override DamageInfo Damage => CalcDmg();
protected override void OnLeaveBattle()
{
extraDmg = 0;
}
private DamageInfo CalcDmg()
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
return DamageInfo.Attack((float)(((Card)this).RawDamage + extraDmg), ((Card)this).IsAccuracy);
}
protected override IEnumerable<BattleAction> Actions(UnitSelector selector, ManaGroup consumingMana, Interaction precondition)
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
if (((Card)this).IsUpgraded)
{
extraDmg += ((Card)this).Value1 * ((Card)this).SynergyAmount(consumingMana, (ManaColor)0, 1);
}
string gun = ((Card)this).GunName;
DamageInfo damage = ((Card)this).Damage;
if (((DamageInfo)(ref damage)).Amount >= 30f)
{
gun = "ENitoriShoot2";
}
yield return ((Card)this).AttackAction((IEnumerable<Unit>)selector.GetUnits(((Card)this).Battle), gun, CalcDmg());
if (!((Card)this).IsUpgraded)
{
extraDmg += ((Card)this).Value1 * ((Card)this).SynergyAmount(consumingMana, (ManaColor)0, 1);
}
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
internal IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}