using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AddWatermark;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Logging;
using HarmonyLib;
using JetBrains.Annotations;
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.Cards;
using LBoL.Core.SaveData;
using LBoL.Core.StatusEffects;
using LBoL.Core.Units;
using LBoL.EntityLib.Adventures;
using LBoL.EntityLib.PlayerUnits;
using LBoL.EntityLib.Stages;
using LBoL.EntityLib.Stages.NormalStages;
using LBoL.Presentation;
using LBoL.Presentation.Debugs;
using LBoL.Presentation.I10N;
using LBoL.Presentation.UI;
using LBoL.Presentation.UI.Panels;
using LBoLEntitySideloader;
using LBoLEntitySideloader.Attributes;
using LBoLEntitySideloader.Entities;
using LBoLEntitySideloader.Resource;
using TakanesCheats;
using UnityEngine;
using test.Cheats;
[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("TakanesCheats")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("TakanesCheats")]
[assembly: AssemblyTitle("TakanesCheats")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace TakanesCheats
{
[BepInPlugin("intoxicatedkid.takanescheats", "Takane's Cheats", "1.0.0")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInProcess("LBoL.exe")]
public class BepinexPlugin : BaseUnityPlugin
{
[HarmonyPatch(typeof(GameMaster), "CoSetupGameRun")]
private class GameMaster_CoSetupGameRun_Patch
{
private static void Postfix(GameMaster __instance)
{
((MonoBehaviour)__instance).StartCoroutine(coroutine());
}
private static IEnumerator coroutine()
{
yield return (object)new WaitUntil((Func<bool>)delegate
{
GameRunController currentGameRun = Singleton<GameMaster>.Instance.CurrentGameRun;
return ((currentGameRun != null) ? currentGameRun.Player : null) != null;
});
if (!Singleton<GameMaster>.Instance.CurrentGameRun.Player.HasExhibit<TakanesCheatsDef.TakanesCheats>())
{
Singleton<GameMaster>.Instance.CurrentGameRun.GainExhibitInstantly((Exhibit)(object)Library.CreateExhibit<TakanesCheatsDef.TakanesCheats>(), false, (VisualSourceData)null);
}
}
}
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("intoxicatedkid.takanescheats", "");
private void Awake()
{
log = ((BaseUnityPlugin)this).Logger;
Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
EntityManager.RegisterSelf();
harmony.PatchAll();
if (Chainloader.PluginInfos.ContainsKey("neo.lbol.tools.watermark"))
{
WatermarkWrapper.ActivateWatermark();
}
}
private void OnDestroy()
{
if (harmony != null)
{
harmony.UnpatchSelf();
}
}
}
public class GameDebugMenuUI : MonoBehaviour
{
public class Notification
{
public string Content { get; set; }
public float Time { get; set; }
}
public abstract class DebugWindow
{
public readonly WeakReference<GameDebugMenuUI> _parent = new WeakReference<GameDebugMenuUI>(null);
public const int ButtonHeight = 30;
public GameDebugMenuUI Parent
{
get
{
if (!_parent.TryGetTarget(out var target))
{
return null;
}
return target;
}
set
{
_parent.SetTarget(value);
}
}
public abstract string Title { get; }
public static GUIStyle LeftAlign => new GUIStyle(GUI.skin.button)
{
alignment = (TextAnchor)3
};
public virtual bool IsActive { get; set; }
public Rect Rect { get; set; }
public abstract Rect InitRect { get; }
public virtual void OnAwake()
{
}
public virtual void OnLocaleChanged()
{
}
public AreaScope ContentScope()
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0020: 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_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Expected O, but got Unknown
Rect rect = Rect;
float num = ((Rect)(ref rect)).width - 20f;
rect = Rect;
return new AreaScope(new Rect(10f, 30f, num, ((Rect)(ref rect)).height - 40f));
}
public void DrawWindow()
{
//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_0024: Unknown result type (might be due to invalid IL or missing references)
Rect rect = Rect;
if (GUI.Button(new Rect(((Rect)(ref rect)).width - 18f, 0f, 18f, 18f), "x"))
{
IsActive = false;
}
else
{
DrawContent();
}
}
public abstract void DrawContent();
public static bool Filter(GameEntity entity, string filter)
{
filter = filter.Trim();
if (entity.Id.IndexOf(filter, StringComparison.CurrentCultureIgnoreCase) < 0)
{
return entity.Name.IndexOf(filter, StringComparison.CurrentCultureIgnoreCase) >= 0;
}
return true;
}
public static bool Filter(string source, string filter)
{
filter = filter.Trim();
return source.IndexOf(filter, StringComparison.CurrentCultureIgnoreCase) >= 0;
}
public DebugWindow()
{
}
}
public abstract class BattleDebugWindowBase : DebugWindow
{
public override void DrawContent()
{
GameRunController currentGameRun = Singleton<GameMaster>.Instance.CurrentGameRun;
BattleController val = ((currentGameRun != null) ? currentGameRun.Battle : null);
if (val == null)
{
IsActive = false;
return;
}
AreaScope val2 = ContentScope();
try
{
DrawBattleContent(val);
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
public abstract void DrawBattleContent(BattleController battle);
public BattleDebugWindowBase()
{
}
}
public abstract class GameRunDebugWindowBase : DebugWindow
{
public override void DrawContent()
{
GameRunController currentGameRun = Singleton<GameMaster>.Instance.CurrentGameRun;
BattleController val = ((currentGameRun != null) ? currentGameRun.Battle : null);
if (currentGameRun == null || val != null)
{
IsActive = false;
return;
}
AreaScope val2 = ContentScope();
try
{
DrawGameRunContent(currentGameRun);
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
public abstract void DrawGameRunContent(GameRunController gameRun);
public GameRunDebugWindowBase()
{
}
}
public class BattleDebugWindow : BattleDebugWindowBase
{
public static readonly char[] ColorShortNames = ManaColors.Colors.Select((ManaColor c) => ManaColorExtensions.ToShortName(c)).ToArray();
public readonly SortedDictionary<char, Texture> _colorTextures = new SortedDictionary<char, Texture>();
public string _drawCount = "1";
public string _hp = "10";
public override string Title => "Battle Debug";
public override Rect InitRect => new Rect(20f, 20f, 220f, 500f);
public override void OnAwake()
{
Dictionary<string, Sprite> dictionary = Resources.LoadAll<Sprite>("Sprite Assets/ManaSprite").ToDictionary((Sprite s) => ((Object)s).name);
char[] colorShortNames = ColorShortNames;
for (int i = 0; i < colorShortNames.Length; i++)
{
char c = colorShortNames[i];
if (dictionary.TryGetValue(c.ToString(), out var value))
{
_colorTextures.Add(c, (Texture)(object)GenerateTextureFromSprite(value));
}
else
{
Debug.LogError((object)$"Cannot find mana sprite '{c}' for battle debug UI");
}
}
static Texture2D GenerateTextureFromSprite(Sprite sprite)
{
//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_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Expected O, but got Unknown
Rect rect = sprite.rect;
Texture2D val = new Texture2D((int)((Rect)(ref rect)).width, (int)((Rect)(ref rect)).height);
Color[] pixels = sprite.texture.GetPixels((int)((Rect)(ref rect)).x, (int)((Rect)(ref rect)).y, (int)((Rect)(ref rect)).width, (int)((Rect)(ref rect)).height);
val.SetPixels(pixels);
val.Apply(true);
return val;
}
}
public override void DrawBattleContent(BattleController battle)
{
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Expected O, but got Unknown
//IL_0187: Unknown result type (might be due to invalid IL or missing references)
//IL_018c: Unknown result type (might be due to invalid IL or missing references)
//IL_0195: Expected O, but got Unknown
//IL_019a: Unknown result type (might be due to invalid IL or missing references)
//IL_01a1: Expected O, but got Unknown
//IL_0146: Unknown result type (might be due to invalid IL or missing references)
//IL_0161: Expected O, but got Unknown
//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
//IL_01f5: Expected O, but got Unknown
//IL_0220: Unknown result type (might be due to invalid IL or missing references)
//IL_0227: Expected O, but got Unknown
//IL_0255: Unknown result type (might be due to invalid IL or missing references)
//IL_027f: Expected O, but got Unknown
//IL_0291: Unknown result type (might be due to invalid IL or missing references)
//IL_0296: Unknown result type (might be due to invalid IL or missing references)
//IL_029b: Unknown result type (might be due to invalid IL or missing references)
//IL_029e: Unknown result type (might be due to invalid IL or missing references)
//IL_02a0: Unknown result type (might be due to invalid IL or missing references)
//IL_02aa: Unknown result type (might be due to invalid IL or missing references)
//IL_02bb: Expected O, but got Unknown
//IL_02ea: Unknown result type (might be due to invalid IL or missing references)
//IL_02f1: Expected O, but got Unknown
//IL_031f: Unknown result type (might be due to invalid IL or missing references)
//IL_0349: Expected O, but got Unknown
//IL_035b: Unknown result type (might be due to invalid IL or missing references)
//IL_0360: Unknown result type (might be due to invalid IL or missing references)
//IL_0367: Unknown result type (might be due to invalid IL or missing references)
//IL_036c: Unknown result type (might be due to invalid IL or missing references)
//IL_036f: Unknown result type (might be due to invalid IL or missing references)
//IL_0371: Unknown result type (might be due to invalid IL or missing references)
//IL_037b: Unknown result type (might be due to invalid IL or missing references)
//IL_038c: Expected O, but got Unknown
//IL_03bb: Unknown result type (might be due to invalid IL or missing references)
//IL_03c2: Expected O, but got Unknown
//IL_03f0: Unknown result type (might be due to invalid IL or missing references)
//IL_041a: Expected O, but got Unknown
//IL_042c: Unknown result type (might be due to invalid IL or missing references)
//IL_0431: Unknown result type (might be due to invalid IL or missing references)
//IL_0436: Unknown result type (might be due to invalid IL or missing references)
//IL_0439: Unknown result type (might be due to invalid IL or missing references)
//IL_043b: Unknown result type (might be due to invalid IL or missing references)
//IL_0445: Unknown result type (might be due to invalid IL or missing references)
//IL_0456: Expected O, but got Unknown
//IL_0490: Unknown result type (might be due to invalid IL or missing references)
//IL_0497: Expected O, but got Unknown
//IL_0541: Unknown result type (might be due to invalid IL or missing references)
//IL_054c: Unknown result type (might be due to invalid IL or missing references)
//IL_0567: Expected O, but got Unknown
//IL_05f1: Unknown result type (might be due to invalid IL or missing references)
//IL_060c: Expected O, but got Unknown
//IL_066c: Unknown result type (might be due to invalid IL or missing references)
//IL_067b: Expected O, but got Unknown
//IL_0936: Unknown result type (might be due to invalid IL or missing references)
//IL_0945: Expected O, but got Unknown
//IL_088e: Unknown result type (might be due to invalid IL or missing references)
//IL_089a: Expected O, but got Unknown
//IL_0789: Unknown result type (might be due to invalid IL or missing references)
//IL_0795: Expected O, but got Unknown
base.Parent._windowTable[WindowID.AddCard].IsActive = GUILayout.Toggle(base.Parent._windowTable[WindowID.AddCard].IsActive, "Add Card", GUI.skin.button, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) });
base.Parent._windowTable[WindowID.AddStatusEffect].IsActive = GUILayout.Toggle(base.Parent._windowTable[WindowID.AddStatusEffect].IsActive, "Add Effect", GUI.skin.button, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) });
GUILayout.Space(10f);
HorizontalScope val = new HorizontalScope(Array.Empty<GUILayoutOption>());
try
{
_drawCount = GUILayout.TextField(_drawCount, Array.Empty<GUILayoutOption>());
if (GUILayout.Button("Draw Card", Array.Empty<GUILayoutOption>()))
{
if (!int.TryParse(_drawCount, out var result))
{
Debug.LogError((object)("Invalid draw count string: " + _drawCount));
}
else if (result <= 0)
{
Debug.LogError((object)("Invalid draw count string: " + _drawCount));
}
else
{
battle.RequestDebugAction((BattleAction)new DrawManyCardAction(result), $"Debug: Draw {result}");
}
}
}
finally
{
((IDisposable)val)?.Dispose();
}
GUILayout.Space(10f);
GUIStyle val2 = new GUIStyle(GUI.skin.label)
{
alignment = (TextAnchor)4
};
HorizontalScope val3 = new HorizontalScope(Array.Empty<GUILayoutOption>());
try
{
char[] colorShortNames = ColorShortNames;
for (int i = 0; i < colorShortNames.Length; i++)
{
char key = colorShortNames[i];
GUILayout.Label(new GUIContent(_colorTextures[key], key.ToString()), val2, (GUILayoutOption[])(object)new GUILayoutOption[2]
{
GUILayout.Width(25f),
GUILayout.Height(20f)
});
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
HorizontalScope val4 = new HorizontalScope(Array.Empty<GUILayoutOption>());
try
{
char[] colorShortNames2 = ColorShortNames;
for (int j = 0; j < colorShortNames2.Length; j++)
{
char c = colorShortNames2[j];
if (GUILayout.Button(new GUIContent("1", "Gain 1 " + c), (GUILayoutOption[])(object)new GUILayoutOption[2]
{
GUILayout.Width(25f),
GUILayout.Height(20f)
}))
{
ManaGroup val5 = ManaGroup.Single(ManaColors.FromShortName(c).Value);
battle.RequestDebugAction((BattleAction)new GainManaAction(val5), $"Debug: Gain {val5}");
}
}
}
finally
{
((IDisposable)val4)?.Dispose();
}
HorizontalScope val6 = new HorizontalScope(Array.Empty<GUILayoutOption>());
try
{
char[] colorShortNames3 = ColorShortNames;
for (int k = 0; k < colorShortNames3.Length; k++)
{
char c2 = colorShortNames3[k];
if (GUILayout.Button(new GUIContent("10", "Gain 10 " + c2), (GUILayoutOption[])(object)new GUILayoutOption[2]
{
GUILayout.Width(25f),
GUILayout.Height(20f)
}))
{
ManaGroup val7 = ManaGroup.Single(ManaColors.FromShortName(c2).Value) * 10;
battle.RequestDebugAction((BattleAction)new GainManaAction(val7), $"Debug: Gain {val7}");
}
}
}
finally
{
((IDisposable)val6)?.Dispose();
}
HorizontalScope val8 = new HorizontalScope(Array.Empty<GUILayoutOption>());
try
{
char[] colorShortNames4 = ColorShortNames;
for (int l = 0; l < colorShortNames4.Length; l++)
{
char c3 = colorShortNames4[l];
if (GUILayout.Button(new GUIContent("-1", "Lose 1 " + c3), (GUILayoutOption[])(object)new GUILayoutOption[2]
{
GUILayout.Width(25f),
GUILayout.Height(20f)
}))
{
ManaGroup val9 = ManaGroup.Single(ManaColors.FromShortName(c3).Value);
battle.RequestDebugAction((BattleAction)new LoseManaAction(val9), $"Debug: Lose {val9}");
}
}
}
finally
{
((IDisposable)val8)?.Dispose();
}
GUILayout.Space(10f);
HorizontalScope val10 = new HorizontalScope(Array.Empty<GUILayoutOption>());
try
{
GUILayout.Label("To self: ", Array.Empty<GUILayoutOption>());
_hp = GUILayout.TextField(_hp, Array.Empty<GUILayoutOption>());
if (GUILayout.Button("Damage", Array.Empty<GUILayoutOption>()))
{
if (!int.TryParse(_hp, out var result2))
{
Debug.LogError((object)("Invalid hp string: " + _hp));
}
else if (result2 <= 0)
{
Debug.LogError((object)("Invalid hp string: " + _hp));
}
else
{
battle.RequestDebugAction((BattleAction)new DamageAction((Unit)(object)battle.Player, (Unit)(object)battle.Player, DamageInfo.HpLose((float)result2, false), "Instant", (GunType)0), $"Debug: Damage Self {result2}");
}
}
if (GUILayout.Button("Heal", Array.Empty<GUILayoutOption>()))
{
if (!int.TryParse(_hp, out var result3))
{
Debug.LogError((object)("Invalid hp string: " + _hp));
}
else if (result3 <= 0)
{
Debug.LogError((object)("Invalid hp string: " + _hp));
}
else
{
battle.RequestDebugAction((BattleAction)new HealAction((Unit)(object)battle.Player, (Unit)(object)battle.Player, result3, (HealType)0, 0.2f), $"Debug: Heal Self {result3}");
}
}
}
finally
{
((IDisposable)val10)?.Dispose();
}
UltimateSkill us = battle.Player.Us;
if (us != null)
{
GUILayout.Space(10f);
if (GUILayout.Button("Gain Power (1 bar)", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
{
battle.RequestDebugAction((BattleAction)new GainPowerAction(us.PowerPerLevel), "Debug: Gain Power");
}
}
GUILayout.Space(5f);
if (GUILayout.Button("Upgrade Hand", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
{
List<Card> list = battle.HandZone.Where((Card card) => card.CanUpgrade).ToList();
if (list.Count > 0)
{
bool flag = true;
string text = null;
foreach (Card item in list)
{
string text2;
if (flag)
{
text2 = "{" + ((GameEntity)item).Name + "}";
flag = false;
}
else
{
text2 = ", {" + ((GameEntity)item).Name + "}";
}
text += text2;
}
string text3 = "Debug: Upgrade cards: " + text;
battle.RequestDebugAction((BattleAction)new UpgradeCardsAction((IEnumerable<Card>)list), text3);
}
else
{
Debug.Log((object)"No cards in hand can be upgraded.");
}
}
GUILayout.Space(5f);
if (GUILayout.Button("Exile Hand", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
{
List<Card> list2 = battle.HandZone.ToList();
if (list2.Count > 0)
{
bool flag2 = true;
string text4 = null;
foreach (Card item2 in list2)
{
string text5;
if (flag2)
{
text5 = "{" + ((GameEntity)item2).Name + "}";
flag2 = false;
}
else
{
text5 = ", {" + ((GameEntity)item2).Name + "}";
}
text4 += text5;
}
string text6 = "Debug: Exile cards: " + text4;
battle.RequestDebugAction((BattleAction)new ExileManyCardAction((IEnumerable<Card>)list2), text6);
}
else
{
Debug.Log((object)"No cards in hand can be upgraded.");
}
}
GUILayout.Space(5f);
base.Parent._windowTable[WindowID.GunTest].IsActive = GUILayout.Toggle(base.Parent._windowTable[WindowID.GunTest].IsActive, "Gun Test", GUI.skin.button, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) });
GUILayout.FlexibleSpace();
if (GUILayout.Button("i r winner", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
{
battle.RequestDebugAction((BattleAction)new InstantWinAction(), "Debug: Instant Win");
IsActive = false;
}
}
}
public class MainMenuDebugWindow : DebugWindow
{
public static readonly List<(string name, StartGameData data)> DebugRoutes;
public override string Title => "Main Menu Debug";
public override Rect InitRect => new Rect(800f, -20f, 200f, 500f);
public override void DrawContent()
{
if (Singleton<GameMaster>.Instance.CurrentGameRun != null)
{
IsActive = false;
return;
}
AreaScope val = ContentScope();
try
{
if (GUILayout.Button("Quick Battle Normal", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
{
Koishi val2 = Library.CreatePlayerUnit<Koishi>();
Exhibit val3 = Library.CreateExhibit(((PlayerUnit)val2).Config.ExhibitA);
int value = 1000;
UltimateSkill us = Library.CreateUs(((PlayerUnit)val2).Config.UltimateSkillA);
((PlayerUnit)val2).SetUs(us);
Card[] array = ((PlayerUnit)val2).Config.DeckA.Select((string c) => (!c.EndsWith("+")) ? Library.CreateCard(c, false, (int?)null) : Library.CreateCard(c.Substring(0, c.Length - 1), true, (int?)null)).ToArray();
Stage[] array2 = (Stage[])(object)new Stage[1] { ((Stage)Library.CreateStage<BattleAdvTest>()).AsNormalFinal() };
GameMaster.StartGame((GameDifficulty)1, (PuzzleFlag)0, (PlayerUnit)(object)val2, (PlayerType)0, val3, (int?)value, (IEnumerable<Card>)array, (IEnumerable<Stage>)array2, (Type)null, Enumerable.Empty<JadeBox>(), (GameMode)1, true);
}
if (GUILayout.Button("Quick Battle Lunatic", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
{
Koishi val4 = Library.CreatePlayerUnit<Koishi>();
Exhibit val5 = Library.CreateExhibit(((PlayerUnit)val4).Config.ExhibitA);
int value2 = 1000;
UltimateSkill us2 = Library.CreateUs(((PlayerUnit)val4).Config.UltimateSkillA);
((PlayerUnit)val4).SetUs(us2);
Card[] array3 = ((PlayerUnit)val4).Config.DeckA.Select((string c) => (!c.EndsWith("+")) ? Library.CreateCard(c, false, (int?)null) : Library.CreateCard(c.Substring(0, c.Length - 1), true, (int?)null)).ToArray();
Stage[] array4 = (Stage[])(object)new Stage[1] { ((Stage)Library.CreateStage<BattleAdvTest>()).AsNormalFinal() };
GameMaster.StartGame((GameDifficulty)3, (PuzzleFlag)0, (PlayerUnit)(object)val4, (PlayerType)0, val5, (int?)value2, (IEnumerable<Card>)array3, (IEnumerable<Stage>)array4, (Type)null, Enumerable.Empty<JadeBox>(), (GameMode)1, true);
}
if (GUILayout.Button("Alice Test", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
{
Alice val6 = Library.CreatePlayerUnit<Alice>();
Exhibit val7 = Library.CreateExhibit(((PlayerUnit)val6).Config.ExhibitA);
int value3 = 1000;
UltimateSkill us3 = Library.CreateUs(((PlayerUnit)val6).Config.UltimateSkillA);
((PlayerUnit)val6).SetUs(us3);
Card[] array5 = ((PlayerUnit)val6).Config.DeckA.Select((string c) => (!c.EndsWith("+")) ? Library.CreateCard(c, false, (int?)null) : Library.CreateCard(c.Substring(0, c.Length - 1), true, (int?)null)).ToArray();
Stage[] array6 = (Stage[])(object)new Stage[1] { ((Stage)Library.CreateStage<BattleAdvTest>()).AsNormalFinal() };
GameMaster.StartGame((GameDifficulty)3, (PuzzleFlag)0, (PlayerUnit)(object)val6, (PlayerType)0, val7, (int?)value3, (IEnumerable<Card>)array5, (IEnumerable<Stage>)array6, (Type)null, Enumerable.Empty<JadeBox>(), (GameMode)1, true);
}
if (GUILayout.Button("Quick AllStations", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
{
PlayerUnit val8 = Library.GetSelectablePlayers().First();
Exhibit val9 = Library.CreateExhibit(val8.Config.ExhibitA);
int value4 = 1000;
UltimateSkill us4 = Library.CreateUs(val8.Config.UltimateSkillA);
val8.SetUs(us4);
Card[] array7 = val8.Config.DeckA.Select((string c) => (!c.EndsWith("+")) ? Library.CreateCard(c, false, (int?)null) : Library.CreateCard(c.Substring(0, c.Length - 1), true, (int?)null)).ToArray();
Stage[] array8 = (Stage[])(object)new Stage[1] { ((Stage)Library.CreateStage<AllStations>()).AsNormalFinal() };
GameMaster.StartGame((GameDifficulty)1, (PuzzleFlag)0, val8, (PlayerType)0, val9, (int?)value4, (IEnumerable<Card>)array7, (IEnumerable<Stage>)array8, (Type)null, Enumerable.Empty<JadeBox>(), (GameMode)1, true);
}
if (GUILayout.Button("Quick SingleRoutes", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
{
PlayerUnit val10 = Library.GetSelectablePlayers().First();
Exhibit val11 = Library.CreateExhibit(val10.Config.ExhibitA);
int value5 = 1000;
UltimateSkill us5 = Library.CreateUs(val10.Config.UltimateSkillA);
val10.SetUs(us5);
Card[] array9 = val10.Config.DeckA.Select((string c) => (!c.EndsWith("+")) ? Library.CreateCard(c, false, (int?)null) : Library.CreateCard(c.Substring(0, c.Length - 1), true, (int?)null)).ToArray();
Stage[] array10 = (Stage[])(object)new Stage[4]
{
(Stage)Library.CreateStage<SingleRoute>(),
(Stage)Library.CreateStage<SingleRouteStage2>(),
((Stage)Library.CreateStage<SingleRouteStage3>()).AsNormalFinal(),
((Stage)Library.CreateStage<FinalStage>()).AsTrueEndFinal()
};
GameMaster.StartGame((GameDifficulty)1, (PuzzleFlag)0, val10, (PlayerType)0, val11, (int?)value5, (IEnumerable<Card>)array9, (IEnumerable<Stage>)array10, (Type)null, Enumerable.Empty<JadeBox>(), (GameMode)1, true);
}
GUILayout.Space(30f);
GUILayout.Label("Debug Routes", Array.Empty<GUILayoutOption>());
foreach (var (text, val12) in DebugRoutes)
{
if (GUILayout.Button(text, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
{
((UiPanel<StartGameData>)(object)UiManager.GetPanel<StartGamePanel>()).Show(val12);
IsActive = false;
}
}
GUILayout.Space(30f);
if (GUILayout.Button("Load GameRun", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
{
base.Parent._windowTable[WindowID.LoadGameRun].IsActive = true;
}
if (GUILayout.Button("Quick Abandon GameRun", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }) && Singleton<GameMaster>.Instance.GameRunSaveData != null)
{
GameMaster.RequestAbandonGameRun(true);
}
}
finally
{
((IDisposable)val)?.Dispose();
}
}
static MainMenuDebugWindow()
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Expected O, but got Unknown
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Expected O, but got Unknown
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Expected O, but got Unknown
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_0099: Expected O, but got Unknown
List<(string, StartGameData)> list = new List<(string, StartGameData)>
{
("SingleRoutes", new StartGameData
{
StagesCreateFunc = () => (Stage[])(object)new Stage[4]
{
(Stage)Library.CreateStage<SingleRoute>(),
(Stage)Library.CreateStage<SingleRouteStage2>(),
((Stage)Library.CreateStage<SingleRouteStage3>()).AsNormalFinal(),
((Stage)Library.CreateStage<FinalStage>()).AsTrueEndFinal()
}
}),
("BattleAdvTest", new StartGameData
{
StagesCreateFunc = () => (Stage[])(object)new Stage[1] { ((Stage)Library.CreateStage<BattleAdvTest>()).AsNormalFinal() }
}),
("AllStations", new StartGameData
{
StagesCreateFunc = () => (Stage[])(object)new Stage[1] { ((Stage)Library.CreateStage<AllStations>()).AsNormalFinal() }
})
};
StartGameData val = new StartGameData();
val.StagesCreateFunc = () => (Stage[])(object)new Stage[5]
{
(Stage)Library.CreateStage<BossOnlyStage>().WithLevel(1),
(Stage)Library.CreateStage<BossOnlyStage>().WithLevel(2),
(Stage)Library.CreateStage<BossOnlyStage>().WithLevel(3),
((Stage)Library.CreateStage<BossOnlyStage>().WithLevel(4)).AsNormalFinal(),
((Stage)Library.CreateStage<FinalStage>()).AsTrueEndFinal()
};
val.DebutAdventure = typeof(Debut);
list.Add(("BossOnly", val));
DebugRoutes = list;
}
}
public class LoadGameRunWindow : DebugWindow
{
public Vector2 _scrollPosition;
public bool _isActive;
public readonly List<string> _list = new List<string>();
public const string Dir = "SaveData/Debug";
public override string Title => "Load GameRun";
public override Rect InitRect => new Rect(300f, 20f, 400f, 400f);
public override bool IsActive
{
get
{
return _isActive;
}
set
{
_isActive = value;
if (value)
{
if (!Directory.Exists("SaveData/Debug"))
{
return;
}
{
foreach (string item in Directory.EnumerateFiles("SaveData/Debug"))
{
_list.Add(Path.GetFileName(item));
}
return;
}
}
_list.Clear();
}
}
public override void DrawContent()
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Expected O, but got Unknown
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Expected O, but got Unknown
if (Singleton<GameMaster>.Instance.CurrentGameRun != null)
{
IsActive = false;
return;
}
AreaScope val = ContentScope();
try
{
ScrollViewScope val2 = new ScrollViewScope(_scrollPosition, Array.Empty<GUILayoutOption>());
try
{
_scrollPosition = val2.scrollPosition;
foreach (string item in _list)
{
if (GUILayout.Button(new GUIContent(item), DebugWindow.LeftAlign, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
{
GameMaster.RestoreGameRun(SaveDataHelper.DeserializeGameRun(File.ReadAllBytes(Path.Combine("SaveData/Debug", item))));
}
}
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
finally
{
((IDisposable)val)?.Dispose();
}
}
}
public class GameRunDebugWindow : GameRunDebugWindowBase
{
public override string Title => "Game-run Debug";
public override Rect InitRect => new Rect(20f, 20f, 200f, 400f);
public override void DrawGameRunContent(GameRunController gameRun)
{
if (GUILayout.Button("Add Exhibit", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
{
DebugWindow debugWindow = base.Parent._windowTable[WindowID.AddExhibit];
debugWindow.IsActive = !debugWindow.IsActive;
}
if (GUILayout.Button("Add Deck Card", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
{
DebugWindow debugWindow2 = base.Parent._windowTable[WindowID.AddCard];
debugWindow2.IsActive = !debugWindow2.IsActive;
}
if (GUILayout.Button("Clear Deck Cards", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
{
gameRun.RemoveDeckCards((IEnumerable<Card>)gameRun.BaseDeck, false);
}
if (GUILayout.Button("Player Max Hp", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
{
gameRun.GainMaxHp(200, true, true);
}
GUILayout.Space(20f);
GUILayout.Label("Editor Tools", Array.Empty<GUILayoutOption>());
if (!GUILayout.Button("SE Icon Check", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
{
return;
}
List<StatusEffectConfig> list = new List<StatusEffectConfig>();
foreach (StatusEffectConfig item in StatusEffectConfig.AllConfig())
{
if ((Object)(object)ResourcesHelper.TryGetSprite<StatusEffect>(item.Id) == (Object)null)
{
list.Add(item);
}
}
list = list.OrderBy((StatusEffectConfig config) => config.Index).ToList();
foreach (StatusEffectConfig item2 in list)
{
Debug.Log((object)$"{item2.Index}: {item2.Id}");
}
}
}
public class AddExhibitWindow : GameRunDebugWindowBase
{
public class ExhibitInfo
{
public readonly Exhibit Exhibit;
public readonly string Id;
public readonly string Name;
public readonly string Description;
public ExhibitInfo(Exhibit exhibit)
{
Exhibit = exhibit;
Id = ((GameEntity)exhibit).Id;
Name = ((GameEntity)exhibit).Name;
Description = ((GameEntity)exhibit).Description;
}
}
public List<ExhibitInfo> _exhibitInfos;
public string _filter;
public Vector2 _scrollPosition;
public override string Title => "Add Exhibit";
public override Rect InitRect => new Rect(300f, 20f, 400f, 400f);
public List<ExhibitInfo> GetExhibitList()
{
if (_exhibitInfos != null)
{
return _exhibitInfos;
}
try
{
_exhibitInfos = (from <>h__TransparentIdentifier0 in Enumerable.Select(Library.EnumerateExhibitTypes(), ((Type exhibitType, ExhibitConfig config) kv) => new
{
kv = kv,
exhibit = Library.CreateExhibit(kv.exhibitType)
})
orderby <>h__TransparentIdentifier0.exhibit.Config.Order, ((GameEntity)<>h__TransparentIdentifier0.exhibit).Name
select new ExhibitInfo(<>h__TransparentIdentifier0.exhibit)).ToList();
}
catch (Exception ex)
{
_exhibitInfos = new List<ExhibitInfo>();
Debug.LogError((object)ex);
}
return _exhibitInfos;
}
public override void OnLocaleChanged()
{
_exhibitInfos = null;
}
public override void DrawGameRunContent(GameRunController gameRun)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_008a: Expected O, but got Unknown
//IL_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Expected O, but got Unknown
HorizontalScope val = new HorizontalScope(Array.Empty<GUILayoutOption>());
try
{
GUILayout.Label("Filter: ", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(50f) });
_filter = GUILayout.TextField(_filter, Array.Empty<GUILayoutOption>());
if (GUILayout.Button("x", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(25f) }))
{
_filter = null;
}
}
finally
{
((IDisposable)val)?.Dispose();
}
ScrollViewScope val2 = new ScrollViewScope(_scrollPosition, Array.Empty<GUILayoutOption>());
try
{
_scrollPosition = val2.scrollPosition;
foreach (ExhibitInfo exhibit in GetExhibitList())
{
if (!gameRun.Player.HasExhibit(((object)exhibit.Exhibit).GetType()) && (string.IsNullOrWhiteSpace(_filter) || DebugWindow.Filter((GameEntity)(object)exhibit.Exhibit, _filter)) && GUILayout.Button(new GUIContent(exhibit.Id + " (" + exhibit.Name + ")", exhibit.Description), DebugWindow.LeftAlign, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
{
GameMaster.DebugGainExhibit(Library.CreateExhibit(((object)exhibit.Exhibit).GetType()));
}
}
}
finally
{
((IDisposable)val2)?.Dispose();
}
}
}
public class AddCardWindow : DebugWindow
{
public class CardInfo
{
public readonly Card Card;
public readonly string Id;
public readonly string Name;
public readonly string Description;
public CardInfo(Card card)
{
//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_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Invalid comparison between Unknown and I8
Card = card;
Id = ((GameEntity)card).Id;
Name = ((GameEntity)card).Name;
object obj;
if (!card.IsXCost)
{
ManaGroup cost = card.Cost;
obj = ((object)(ManaGroup)(ref cost)).ToString();
}
else
{
obj = "X";
}
string text = "[" + (string?)obj + "]" + ((GameEntity)card).Description;
if ((long)card.Keywords > 0L)
{
Description = text + "\n<" + string.Join(" ", from k in card.EnumerateCardKeywords()
select Keywords.GetDisplayWord(k).Name) + ">";
}
else
{
Description = text;
}
}
}
public readonly string[] _targets = new string[4] { "Hand", "Discard", "Exile", "DrawTop" };
public List<CardInfo> _cardInfos;
public bool _upgraded;
public int _targetId;
public string _filter;
public Vector2 _scrollPosition;
public override string Title => "Add Card";
public override Rect InitRect => new Rect(300f, 20f, 400f, 400f);
public List<CardInfo> GetCardList()
{
if (_cardInfos != null)
{
return _cardInfos;
}
try
{
_cardInfos = (from <>h__TransparentIdentifier0 in Enumerable.Select(Library.EnumerateCardTypes(), ((Type cardType, CardConfig config) kv) => new
{
kv = kv,
card = Library.CreateCard(kv.cardType)
})
orderby <>h__TransparentIdentifier0.card.Config.Order, ((GameEntity)<>h__TransparentIdentifier0.card).Id
select new CardInfo(<>h__TransparentIdentifier0.card)).ToList();
}
catch (Exception ex)
{
_cardInfos = new List<CardInfo>();
Debug.LogError((object)ex);
}
return _cardInfos;
}
public override void OnLocaleChanged()
{
_cardInfos = null;
}
public override void DrawContent()
{
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Expected O, but got Unknown
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Expected O, but got Unknown
//IL_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_0123: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Expected O, but got Unknown
//IL_012d: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: Unknown result type (might be due to invalid IL or missing references)
//IL_0199: Unknown result type (might be due to invalid IL or missing references)
//IL_01bb: Expected O, but got Unknown
//IL_022d: Unknown result type (might be due to invalid IL or missing references)
//IL_0248: Expected O, but got Unknown
//IL_026b: Unknown result type (might be due to invalid IL or missing references)
//IL_0286: Expected O, but got Unknown
//IL_02a6: Unknown result type (might be due to invalid IL or missing references)
//IL_02c1: Expected O, but got Unknown
//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
//IL_02fe: Expected O, but got Unknown
GameRunController currentGameRun = Singleton<GameMaster>.Instance.CurrentGameRun;
if (currentGameRun == null)
{
IsActive = false;
return;
}
BattleController battle = currentGameRun.Battle;
AreaScope val = ContentScope();
try
{
HorizontalScope val2 = new HorizontalScope(Array.Empty<GUILayoutOption>());
try
{
_upgraded = GUILayout.Toggle(_upgraded, "Upgraded", Array.Empty<GUILayoutOption>());
_targetId = GUILayout.SelectionGrid(_targetId, _targets, _targets.Length, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(320f) });
}
finally
{
((IDisposable)val2)?.Dispose();
}
HorizontalScope val3 = new HorizontalScope(Array.Empty<GUILayoutOption>());
try
{
GUILayout.Label("Filter: ", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(50f) });
_filter = GUILayout.TextField(_filter, Array.Empty<GUILayoutOption>());
if (GUILayout.Button("x", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(25f) }))
{
_filter = null;
}
}
finally
{
((IDisposable)val3)?.Dispose();
}
ScrollViewScope val4 = new ScrollViewScope(_scrollPosition, Array.Empty<GUILayoutOption>());
try
{
_scrollPosition = val4.scrollPosition;
foreach (CardInfo card in GetCardList())
{
if ((string.IsNullOrWhiteSpace(_filter) || DebugWindow.Filter((GameEntity)(object)card.Card, _filter)) && GUILayout.Button(new GUIContent(card.Id + " (" + card.Name + ")", card.Description), DebugWindow.LeftAlign, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
{
Card val5 = card.Card.Clone();
if (_upgraded)
{
val5.Upgrade();
}
if (battle == null)
{
currentGameRun.AddDeckCards((IEnumerable<Card>)(object)new Card[1] { val5 }, false, (VisualSourceData)null);
}
else if (_targetId == 0)
{
battle.RequestDebugAction((BattleAction)new AddCardsToHandAction((Card[])(object)new Card[1] { val5 }), "Debug: Add Card to Hand" + ((GameEntity)val5).Name);
}
else if (_targetId == 1)
{
battle.RequestDebugAction((BattleAction)new AddCardsToDiscardAction((Card[])(object)new Card[1] { val5 }), "Debug: Add Card to Discard " + ((GameEntity)val5).Name);
}
else if (_targetId == 2)
{
battle.RequestDebugAction((BattleAction)new AddCardsToExileAction((Card[])(object)new Card[1] { val5 }), "Debug: Add Card to Discard " + ((GameEntity)val5).Name);
}
else if (_targetId == 3)
{
battle.RequestDebugAction((BattleAction)new AddCardsToDrawZoneAction((IEnumerable<Card>)(object)new Card[1] { val5 }, (DrawZoneTarget)0, (AddCardsType)0), "Debug: Add Card to Discard " + ((GameEntity)val5).Name);
}
}
}
}
finally
{
((IDisposable)val4)?.Dispose();
}
}
finally
{
((IDisposable)val)?.Dispose();
}
}
}
public class AddStatusEffectWindow : BattleDebugWindowBase
{
public List<StatusEffect> _statusEffects;
public readonly string[] _targets = new string[5] { "Player", "Enemy0", "Enemy1", "Enemy2", "AllEnemies" };
public int _targetId;
public string _level = "1";
public string _duration = "1";
public string _limit = "0";
public string _count = "0";
public string _filter;
public Vector2 _scrollPosition;
public override string Title => "Add StatusEffect";
public override Rect InitRect => new Rect(300f, 20f, 400f, 400f);
public List<StatusEffect> GetStatusEffectList()
{
if (_statusEffects != null)
{
return _statusEffects;
}
try
{
_statusEffects = (from kv in Library.EnumerateStatusEffectTypes()
select Library.CreateStatusEffect(kv.statusEffectType) into s
orderby s.Config.Order, ((GameEntity)s).Id
select s).ToList();
}
catch (Exception ex)
{
_statusEffects = new List<StatusEffect>();
Debug.LogError((object)ex);
}
return _statusEffects;
}
public override void OnLocaleChanged()
{
_statusEffects = null;
}
public override void DrawBattleContent(BattleController battle)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Expected O, but got Unknown
//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Expected O, but got Unknown
//IL_017c: Unknown result type (might be due to invalid IL or missing references)
//IL_0183: Expected O, but got Unknown
//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0205: Expected O, but got Unknown
//IL_0207: Unknown result type (might be due to invalid IL or missing references)
//IL_020c: Unknown result type (might be due to invalid IL or missing references)
//IL_0277: Unknown result type (might be due to invalid IL or missing references)
//IL_0299: Expected O, but got Unknown
//IL_038b: Unknown result type (might be due to invalid IL or missing references)
//IL_03a6: Expected O, but got Unknown
//IL_04ba: Unknown result type (might be due to invalid IL or missing references)
//IL_04d5: Expected O, but got Unknown
//IL_0414: Unknown result type (might be due to invalid IL or missing references)
//IL_042f: Expected O, but got Unknown
HorizontalScope val = new HorizontalScope(Array.Empty<GUILayoutOption>());
try
{
GUILayout.Label("Target: ", Array.Empty<GUILayoutOption>());
_targetId = GUILayout.SelectionGrid(_targetId, _targets, _targets.Length, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(320f) });
}
finally
{
((IDisposable)val)?.Dispose();
}
HorizontalScope val2 = new HorizontalScope(Array.Empty<GUILayoutOption>());
try
{
GUILayout.Label("Level: ", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(50f) });
_level = GUILayout.TextField(_level, Array.Empty<GUILayoutOption>());
GUILayout.Space(20f);
GUILayout.Label("Duration: ", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) });
_duration = GUILayout.TextField(_duration, Array.Empty<GUILayoutOption>());
}
finally
{
((IDisposable)val2)?.Dispose();
}
HorizontalScope val3 = new HorizontalScope(Array.Empty<GUILayoutOption>());
try
{
GUILayout.Label("Limit: ", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(50f) });
_limit = GUILayout.TextField(_limit, Array.Empty<GUILayoutOption>());
GUILayout.Space(20f);
GUILayout.Label("Count: ", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) });
_count = GUILayout.TextField(_count, Array.Empty<GUILayoutOption>());
}
finally
{
((IDisposable)val3)?.Dispose();
}
HorizontalScope val4 = new HorizontalScope(Array.Empty<GUILayoutOption>());
try
{
GUILayout.Label("Filter: ", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(50f) });
_filter = GUILayout.TextField(_filter, Array.Empty<GUILayoutOption>());
if (GUILayout.Button("x", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(25f) }))
{
_filter = null;
}
}
finally
{
((IDisposable)val4)?.Dispose();
}
ScrollViewScope val5 = new ScrollViewScope(_scrollPosition, Array.Empty<GUILayoutOption>());
try
{
_scrollPosition = val5.scrollPosition;
foreach (StatusEffect statusEffect in GetStatusEffectList())
{
if ((!string.IsNullOrWhiteSpace(_filter) && !DebugWindow.Filter((GameEntity)(object)statusEffect, _filter)) || !GUILayout.Button(new GUIContent(((GameEntity)statusEffect).Id + " (" + ((GameEntity)statusEffect).Name + ")", statusEffect.Brief ?? "No Brief"), DebugWindow.LeftAlign, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
{
continue;
}
int result2;
int result3;
int result4;
if (!int.TryParse(_level, out var result))
{
Debug.LogError((object)"Invalid level string");
}
else if (!int.TryParse(_duration, out result2))
{
Debug.LogError((object)"Invalid duration string");
}
else if (!int.TryParse(_limit, out result3))
{
Debug.LogError((object)"Invalid limit string");
}
else if (!int.TryParse(_count, out result4))
{
Debug.LogError((object)"Invalid count string");
}
else if (_targetId == 0)
{
battle.RequestDebugAction((BattleAction)new ApplyStatusEffectAction(((object)statusEffect).GetType(), (Unit)(object)battle.Player, (int?)result, (int?)result2, (int?)result4, (int?)result3, 0f, true), "Debug: Apply " + ((GameEntity)statusEffect).Name);
}
else if (_targetId == _targets.Length - 1)
{
foreach (EnemyUnit alife in battle.EnemyGroup.Alives)
{
battle.RequestDebugAction((BattleAction)new ApplyStatusEffectAction(((object)statusEffect).GetType(), (Unit)(object)alife, (int?)result, (int?)result2, (int?)result4, (int?)result3, 0f, true), "Debug: Apply " + ((GameEntity)statusEffect).Name);
}
}
else
{
EnemyUnit val6 = battle.EnemyGroup.Alives.OrderBy((EnemyUnit e) => (e.MovePriority, e.RootIndex)).ElementAt(_targetId - 1);
battle.RequestDebugAction((BattleAction)new ApplyStatusEffectAction(((object)statusEffect).GetType(), (Unit)(object)val6, (int?)result, (int?)result2, (int?)result4, (int?)result3, 0f, true), "Debug: Apply " + ((GameEntity)statusEffect).Name);
}
}
}
finally
{
((IDisposable)val5)?.Dispose();
}
}
}
public class GunTestWindow : BattleDebugWindowBase
{
public List<string> _allGunName;
public readonly string[] _sources = new string[4] { "Player", "Enemy0", "Enemy1", "Enemy2" };
public int _sourceId;
public readonly string[] _targets = new string[5] { "Player", "Enemy0", "Enemy1", "Enemy2", "All" };
public int _targetId = 1;
public string _damage = "0";
public float _delay;
public string _filter;
public Vector2 _scrollPosition;
public bool _isActive;
public override string Title => "Gun Test";
public override Rect InitRect => new Rect(300f, 20f, 400f, 400f);
public override bool IsActive
{
get
{
return _isActive;
}
set
{
if (_isActive != value)
{
_isActive = value;
_allGunName = (value ? (from config in GunConfig.AllConfig()
select config.Name).ToList() : null);
}
}
}
public static void RequestDebugAction(BattleController battle, BattleAction action, string recordName, float delay = 0f)
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Expected O, but got Unknown
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Expected O, but got Unknown
if (delay > 0f)
{
battle.RequestDebugAction((BattleAction)new WaitForYieldInstructionAction((YieldInstruction)new WaitForSeconds(delay)), recordName + " (Delay)");
}
battle.RequestDebugAction(action, recordName);
}
public override void DrawBattleContent(BattleController battle)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Expected O, but got Unknown
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Expected O, but got Unknown
//IL_019e: Unknown result type (might be due to invalid IL or missing references)
//IL_01a5: Expected O, but got Unknown
//IL_0217: Unknown result type (might be due to invalid IL or missing references)
//IL_0221: Unknown result type (might be due to invalid IL or missing references)
//IL_0227: Expected O, but got Unknown
//IL_0229: Unknown result type (might be due to invalid IL or missing references)
//IL_022e: Unknown result type (might be due to invalid IL or missing references)
//IL_0421: Unknown result type (might be due to invalid IL or missing references)
//IL_0429: Unknown result type (might be due to invalid IL or missing references)
//IL_03d0: Unknown result type (might be due to invalid IL or missing references)
//IL_03d8: Unknown result type (might be due to invalid IL or missing references)
//IL_037e: Unknown result type (might be due to invalid IL or missing references)
//IL_0386: Unknown result type (might be due to invalid IL or missing references)
HorizontalScope val = new HorizontalScope(Array.Empty<GUILayoutOption>());
try
{
GUILayout.Label("Source: ", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(50f) });
_sourceId = GUILayout.SelectionGrid(_sourceId, _sources, _sources.Length, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(320f) });
}
finally
{
((IDisposable)val)?.Dispose();
}
HorizontalScope val2 = new HorizontalScope(Array.Empty<GUILayoutOption>());
try
{
GUILayout.Label("Targets: ", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(50f) });
_targetId = GUILayout.SelectionGrid(_targetId, _targets, _targets.Length, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(320f) });
}
finally
{
((IDisposable)val2)?.Dispose();
}
HorizontalScope val3 = new HorizontalScope(Array.Empty<GUILayoutOption>());
try
{
GUILayout.Label("Damage: ", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) });
_damage = GUILayout.TextField(_damage, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(50f) });
NotifyGunTime = GUILayout.Toggle(NotifyGunTime, "Nofity Time", Array.Empty<GUILayoutOption>());
GUILayout.Label($"Delay: {_delay: 0.##}", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(80f) });
_delay = GUILayout.HorizontalSlider(_delay, 0f, 10f, Array.Empty<GUILayoutOption>());
}
finally
{
((IDisposable)val3)?.Dispose();
}
HorizontalScope val4 = new HorizontalScope(Array.Empty<GUILayoutOption>());
try
{
GUILayout.Label("Filter: ", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(60f) });
_filter = GUILayout.TextField(_filter, Array.Empty<GUILayoutOption>());
if (GUILayout.Button("x", (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Width(25f) }))
{
_filter = null;
}
}
finally
{
((IDisposable)val4)?.Dispose();
}
ScrollViewScope val5 = new ScrollViewScope(_scrollPosition, Array.Empty<GUILayoutOption>());
try
{
_scrollPosition = val5.scrollPosition;
foreach (string item in _allGunName)
{
if ((!string.IsNullOrWhiteSpace(_filter) && !DebugWindow.Filter(item, _filter)) || !GUILayout.Button(GunConfig.FromName(item).Id + " " + item, DebugWindow.LeftAlign, (GUILayoutOption[])(object)new GUILayoutOption[1] { GUILayout.Height(30f) }))
{
continue;
}
if (!int.TryParse(_damage, out var result))
{
Debug.LogError((object)"Invalid damage string");
}
else if (_sourceId == 0 && _targetId == 0)
{
Debug.LogError((object)"Invalid source/target: player to player");
}
else if (_sourceId != 0 && _targetId != 0)
{
Debug.LogError((object)"Invalid source/target: enemy to enemy");
}
else if (_sourceId == 0)
{
if (_targetId == _targets.Length - 1)
{
RequestDebugAction(battle, ((BattleAction)new DamageAction((Unit)(object)battle.Player, (IEnumerable<Unit>)battle.EnemyGroup.Alives, DamageInfo.Attack((float)result, false), item, (GunType)0)).SetCause((ActionCause)1), "Debug: Gun Test " + item, _delay);
continue;
}
EnemyUnit val6 = ((IEnumerable<EnemyUnit>)battle.EnemyGroup).ElementAt(_targetId - 1);
RequestDebugAction(battle, ((BattleAction)new DamageAction((Unit)(object)battle.Player, (Unit)(object)val6, DamageInfo.Attack((float)result, false), item, (GunType)0)).SetCause((ActionCause)1), "Debug: Gun Test " + item, _delay);
}
else
{
EnemyUnit val7 = ((IEnumerable<EnemyUnit>)battle.EnemyGroup).ElementAt(_sourceId - 1);
RequestDebugAction(battle, ((BattleAction)new DamageAction((Unit)(object)val7, (Unit)(object)battle.Player, DamageInfo.Attack((float)result, false), item, (GunType)0)).SetSource((GameEntity)(object)val7).SetCause((ActionCause)17), "Debug: Gun Test " + item, _delay);
}
}
}
finally
{
((IDisposable)val5)?.Dispose();
}
}
}
public enum WindowID
{
MainMenu,
LoadGameRun,
GameRunEntry,
BattleEntry,
AddExhibit,
AddCard,
AddStatusEffect,
GunTest
}
public static readonly List<Notification> Notifications = new List<Notification>();
public readonly SortedDictionary<WindowID, DebugWindow> _windowTable = new SortedDictionary<WindowID, DebugWindow>
{
[WindowID.MainMenu] = new MainMenuDebugWindow(),
[WindowID.LoadGameRun] = new LoadGameRunWindow(),
[WindowID.GameRunEntry] = new GameRunDebugWindow(),
[WindowID.BattleEntry] = new BattleDebugWindow(),
[WindowID.AddExhibit] = new AddExhibitWindow(),
[WindowID.AddCard] = new AddCardWindow(),
[WindowID.AddStatusEffect] = new AddStatusEffectWindow(),
[WindowID.GunTest] = new GunTestWindow()
};
public static bool NotifyGunTime { get; set; }
public static void Notify(string content, float time = 5f)
{
Notifications.Add(new Notification
{
Content = content,
Time = time
});
}
public void Awake()
{
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
foreach (KeyValuePair<WindowID, DebugWindow> item in _windowTable)
{
item.Deconstruct(out var _, out var value);
DebugWindow debugWindow = value;
debugWindow.Parent = this;
debugWindow.Rect = debugWindow.InitRect;
debugWindow.OnAwake();
}
UiManager.Instance.DebugMenuAction.performed += delegate
{
OnDebugMenuClick();
};
L10nManager.LocaleChanged += delegate
{
foreach (KeyValuePair<WindowID, DebugWindow> item2 in _windowTable)
{
item2.Deconstruct(out var _, out var value2);
value2.OnLocaleChanged();
}
};
}
public void OnDebugMenuClick()
{
if (_windowTable[WindowID.MainMenu].IsActive)
{
_windowTable[WindowID.MainMenu].IsActive = false;
return;
}
if (_windowTable[WindowID.GameRunEntry].IsActive)
{
_windowTable[WindowID.GameRunEntry].IsActive = false;
return;
}
if (_windowTable[WindowID.BattleEntry].IsActive)
{
_windowTable[WindowID.BattleEntry].IsActive = false;
return;
}
GameRunController currentGameRun = Singleton<GameMaster>.Instance.CurrentGameRun;
if (currentGameRun == null)
{
_windowTable[WindowID.MainMenu].IsActive = true;
}
else if (currentGameRun.Battle != null)
{
_windowTable[WindowID.BattleEntry].IsActive = true;
}
else
{
_windowTable[WindowID.GameRunEntry].IsActive = true;
}
}
public void DoWindow(int windowID)
{
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Expected O, but got Unknown
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Expected O, but got Unknown
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ae: Unknown result type (might be due to invalid IL or missing references)
//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: Unknown result type (might be due to invalid IL or missing references)
//IL_00da: Unknown result type (might be due to invalid IL or missing references)
_windowTable[(WindowID)windowID].DrawWindow();
string tooltip = GUI.tooltip;
if (!string.IsNullOrWhiteSpace(tooltip))
{
GUIContent val = new GUIContent(tooltip);
Vector2 mousePosition = Event.current.mousePosition;
GUIStyle val2 = new GUIStyle(GUI.skin.label)
{
alignment = (TextAnchor)4
};
val2.normal.background = Texture2D.whiteTexture;
GUIStyle val3 = val2;
Vector2 val4 = val3.CalcSize(val);
Rect val5 = default(Rect);
((Rect)(ref val5))..ctor(mousePosition.x + 10f, mousePosition.y + 10f, val4.x + 10f, val4.y + 5f);
Color backgroundColor = GUI.backgroundColor;
GUI.backgroundColor = new Color(0f, 0f, 0f, 0.5f);
GUI.Label(val5, tooltip, val3);
GUI.backgroundColor = backgroundColor;
}
GUI.DragWindow();
}
public void OnGUI()
{
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: 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_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Expected O, but got Unknown
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_0125: Unknown result type (might be due to invalid IL or missing references)
//IL_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_0131: Expected O, but got Unknown
//IL_0137: Unknown result type (might be due to invalid IL or missing references)
//IL_013e: Expected O, but got Unknown
float num = (float)Screen.height / 600f;
int num2 = (int)((float)Screen.width / num) - 100;
int num3 = (int)((float)Screen.height / num) - 100;
GUI.matrix = Matrix4x4.TRS(Vector3.zero, Quaternion.identity, new Vector3(num, num, 1f)) * Matrix4x4.Translate(new Vector3(50f, 50f, 0f));
foreach (var (windowID2, debugWindow2) in _windowTable)
{
if (debugWindow2.IsActive)
{
debugWindow2.Rect = GUI.Window((int)windowID2, debugWindow2.Rect, new WindowFunction(DoWindow), debugWindow2.Title);
}
}
if (CollectionsExtensions.Empty<Notification>((IReadOnlyCollection<Notification>)Notifications))
{
return;
}
GUIStyle box = GUI.skin.box;
box.alignment = (TextAnchor)3;
AreaScope val = new AreaScope(new Rect((float)(num2 - 200), 0f, 200f, (float)num3));
try
{
VerticalScope val2 = new VerticalScope(Array.Empty<GUILayoutOption>());
try
{
foreach (Notification notification in Notifications)
{
notification.Time -= Time.deltaTime;
GUILayout.Box(notification.Content, box, (GUILayoutOption[])(object)new GUILayoutOption[2]
{
GUILayout.Width(200f),
GUILayout.Height(20f)
});
}
}
finally
{
((IDisposable)val2)?.Dispose();
}
Notifications.RemoveAll((Notification n) => n.Time <= 0f);
}
finally
{
((IDisposable)val)?.Dispose();
}
}
}
public static class PInfo
{
public const string GUID = "intoxicatedkid.takanescheats";
public const string Name = "Takane's Cheats";
public const string version = "1.0.0";
public static readonly Harmony harmony = new Harmony("intoxicatedkid.takanescheats");
}
public sealed class TakanesCheatsDef : ExhibitTemplate
{
[EntityLogic(typeof(TakanesCheatsDef))]
[UsedImplicitly]
public sealed class TakanesCheats : Exhibit
{
[HarmonyPatch(typeof(ExhibitInfoPanel), "OnShowing")]
private class ExhibitInfoPanel_OnShowing_Patch
{
private static void Postfix(ExhibitInfoPanel __instance, ref Exhibit payload)
{
Exhibit obj = payload;
GameRunController currentGameRun = Singleton<GameMaster>.Instance.CurrentGameRun;
if (obj == ((currentGameRun != null) ? currentGameRun.Player.GetExhibit<TakanesCheats>() : null))
{
((MonoBehaviour)Singleton<GameMaster>.Instance).StartCoroutine(coroutine());
}
}
private static IEnumerator coroutine()
{
yield return (object)new WaitForFixedUpdate();
GameDebugMenuUI gameDebugMenuUI = ((Component)UiManager.Instance).GetComponentInChildren<GameDebugMenuUI>();
if ((Object)(object)gameDebugMenuUI != (Object)null)
{
gameDebugMenuUI.OnDebugMenuClick();
}
else
{
AlphaDebugMenuDef.AlphaDebugMenu();
}
}
}
}
public override IdContainer GetId()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
return IdContainer.op_Implicit("TakanesCheats");
}
public override LocalizationOption LoadLocalization()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
GlobalLocalization val = new GlobalLocalization((IResourceSource)(object)BepinexPlugin.directorySource);
val.DiscoverAndLoadLocFiles((EntityDefinition)(object)this);
return (LocalizationOption)(object)val;
}
public override ExhibitSprites LoadSprite()
{
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Expected O, but got Unknown
string folder = "";
ExhibitSprites val = new ExhibitSprites();
Func<string, Sprite> func = (string s) => ResourceLoader.LoadSprite(folder + IdContainer.op_Implicit(((EntityDefinition)this).GetId()) + s + ".png", BepinexPlugin.embeddedSource, (Rect?)null, 1, (Vector2?)null);
val.main = func("");
return val;
}
public override ExhibitConfig MakeConfig()
{
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Expected O, but got Unknown
return new ExhibitConfig(BepinexPlugin.sequenceTable.Next(typeof(ExhibitConfig)), "", 10, true, false, false, false, (AppearanceType)3, "", (ExhibitLosableType)2, (Rarity)4, (int?)null, (int?)null, (int?)null, (ManaGroup?)null, (ManaColor?)null, (ManaColor?)null, 0, false, (int?)null, (Keyword)0, (IReadOnlyList<string>)new List<string>(), (IReadOnlyList<string>)new List<string>());
}
}
internal class WatermarkWrapper
{
[MethodImpl(MethodImplOptions.NoInlining)]
internal static void ActivateWatermark()
{
API.ActivateWatermark();
}
}
}
namespace test.Cheats
{
internal class AlphaDebugMenuDef
{
internal static void AlphaDebugMenu()
{
((Component)Singleton<GameMaster>.Instance).GetComponentInChildren<GameDebugMenuUI>().OnDebugMenuClick();
}
}
public class InitCheatsDef
{
public static void Instantiate(Transform transform)
{
GameObject gameObject = ((Component)UiManager.Instance).gameObject;
gameObject.AddComponent<GameDebugMenuUI>();
}
}
[HarmonyPriority(700)]
[HarmonyPatch(typeof(GameMaster), "StartupEnterMainMenu")]
internal class InitDebugMenu_Patch
{
private static void Prefix()
{
InitCheatsDef.Instantiate(((Component)Singleton<GameMaster>.Instance).transform);
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
internal IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}