using System;
using System.Collections.Generic;
using System.Diagnostics;
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.Configuration;
using BepInEx.Logging;
using HarmonyLib;
using LBoL.Base;
using LBoL.ConfigData;
using LBoL.Core;
using LBoL.Core.Adventures;
using LBoL.Core.Battle;
using LBoL.Core.Battle.BattleActions;
using LBoL.Core.Cards;
using LBoL.Core.GapOptions;
using LBoL.Core.Randoms;
using LBoL.Core.Stations;
using LBoL.Core.StatusEffects;
using LBoL.Core.Units;
using LBoL.EntityLib.Adventures;
using LBoL.EntityLib.Cards.Neutral.Black;
using LBoL.EntityLib.Cards.Neutral.Blue;
using LBoL.EntityLib.Cards.Neutral.Colorless;
using LBoL.EntityLib.Cards.Neutral.Green;
using LBoL.EntityLib.Cards.Neutral.Red;
using LBoL.EntityLib.Cards.Neutral.White;
using LBoL.Presentation;
using LBoL.Presentation.Units;
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("DoubleBoss")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.0.6.0")]
[assembly: AssemblyInformationalVersion("0.0.6")]
[assembly: AssemblyProduct("DoubleBoss")]
[assembly: AssemblyTitle("DoubleBoss")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.6.0")]
[module: UnverifiableCode]
namespace DoubleBoss
{
[BepInPlugin("a254389063.lbol.DoubleBoss", "DoubleBoss", "0.0.6")]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInProcess("LBoL.exe")]
public class BepinexPlugin : BaseUnityPlugin
{
private static readonly Harmony harmony;
internal static ManualLogSource log;
public static ConfigEntry<bool> EnableDoubleBoss;
public static ConfigEntry<bool> EnableCertainFuture;
public static ConfigEntry<bool> EnableBinary;
public static ConfigEntry<bool> EnableNightTerrors;
public static ConfigEntry<bool> EnableTerminal;
public static ConfigEntry<bool> EnableCursedRun;
public static ConfigEntry<bool> EnableOneHitWonder;
public static ConfigEntry<bool> EnableMidas;
public static ConfigEntry<bool> EnableLethality;
public static ConfigEntry<bool> EnableDeadlyEvents;
public static ConfigEntry<bool> EnableStarterDeck;
public static ConfigEntry<bool> EnableMyTrueForm;
public static ConfigEntry<int> DailyChallenges;
public static ConfigEntry<bool> EnableFlight;
public static ConfigEntry<bool> EnableRestlessJourney;
public static ConfigEntry<bool> EnableCardsReimu;
public static ConfigEntry<bool> EnableCardsMarisa;
public static ConfigEntry<bool> EnableCardsSakuya;
public static ConfigEntry<bool> EnableCardsCirno;
public static ConfigEntry<bool> EnableCardsKoishi;
public static ConfigEntry<bool> EnableHeirloom;
public static ConfigEntry<bool> EnableColossus;
private void Awake()
{
log = ((BaseUnityPlugin)this).Logger;
Object.DontDestroyOnLoad((Object)(object)((Component)this).gameObject);
((Object)((Component)this).gameObject).hideFlags = (HideFlags)61;
EnableDoubleBoss = ((BaseUnityPlugin)this).Config.Bind<bool>("EnableDoubleBoss", "Double Boss/双重Boss", false, "Fight 2 bosses at the end of Act 3.\n第三幕终点需要连续与两个不同的Boss战斗。");
EnableCertainFuture = ((BaseUnityPlugin)this).Config.Bind<bool>("EnableCertainFuture", "Certain Future/前路已定", false, "The map contain only one path.\n地图上只有一条道路。");
EnableBinary = ((BaseUnityPlugin)this).Config.Bind<bool>("EnableBinary", "Binary/两者择一", false, "Card rewards contain only 2 cards.\n卡牌奖励只有2张牌。\n");
EnableNightTerrors = ((BaseUnityPlugin)this).Config.Bind<bool>("EnableNightTerrors", "Night Terrors/暗夜惊魂", false, "Drinking at gaps costs 5 max HP.\n在隙间饮茶会失去5点最大生命值。");
EnableTerminal = ((BaseUnityPlugin)this).Config.Bind<bool>("EnableTerminal", "Terminal/身患绝症", false, "Whenever you enter a new room, lose 1 max HP.\n你每进入一个新房间都会失去1点最大生命值。");
EnableCursedRun = ((BaseUnityPlugin)this).Config.Bind<bool>("EnableCursedRun", "Cursed Run/诅咒局", false, "Whenever you defeat a Boss or pick an exhibit from Supply event, obtain a Misfortune.\n每打败一个Boss或在补给事件中获取一个展品都会获得一张厄运。");
EnableOneHitWonder = ((BaseUnityPlugin)this).Config.Bind<bool>("EnableOneHitWonder", "One Hit Wonder/一血传奇", false, "Start the game with 1 max HP.\n初始最大生命值为1点。");
EnableMidas = ((BaseUnityPlugin)this).Config.Bind<bool>("EnableMidas", "Midas/点金手", false, "You cannot upgrade cards at Gaps.\n你不能在隙间升级卡牌。");
EnableLethality = ((BaseUnityPlugin)this).Config.Bind<bool>("EnableLethality", "Lethality/死斗", false, "All enemies start each combat with +3 Firepower.\n所有敌人在战斗开始时获得+3火力。");
EnableDeadlyEvents = ((BaseUnityPlugin)this).Config.Bind<bool>("EnableDeadlyEvents", "Deadly Events/致命事件", false, "Adventure rooms can contain Enemies and Elites.\n事件房间可能会出现敌人和精英。");
EnableStarterDeck = ((BaseUnityPlugin)this).Config.Bind<bool>("EnableStarterDeck", "Starter Deck/初始牌组", false, "Enemies no longer drop cards.\n敌人不再掉落卡牌。");
EnableRestlessJourney = ((BaseUnityPlugin)this).Config.Bind<bool>("EnableRestlessJourney", "Restless Journey/不宁旅途", false, "The Player no longer heals to full health when entering new acts.\n进入新阶段时玩家不会再回复所有的生命值。");
EnableColossus = ((BaseUnityPlugin)this).Config.Bind<bool>("EnableColossus", "Colossus/巨大化", false, "Enemies now have more HP.\n敌人现在拥有更多生命值。");
DailyChallenges = ((BaseUnityPlugin)this).Config.Bind<int>("DailyChallenges", "Daily Challenges/日常挑战", 0, "Embark on a run with exactly X random negative modifiers. Overrides other negative modifiers. ( Take effect when the value is greater than 0, selected mods will be shown in Log )\n以随机X种负面特效开始一局游戏。覆盖其它的负面特效。(值大于0时生效,选择的特效将在日志中显示)");
EnableMyTrueForm = ((BaseUnityPlugin)this).Config.Bind<bool>("EnableMyTrueForm", "My True Form/完美形态", false, "Start with a copy of The Immortal Flame, The Falling Moon Rabbit, The Reclusive Sage, Tale of the Bamboo Cutter, True Full Moon, and Filthless World.\n初始拥有不死的烈焰、天降的月兔、贤者的归隐、竹取的物语、真实的满月、无秽的世界各一张。");
EnableFlight = ((BaseUnityPlugin)this).Config.Bind<bool>("EnableFlight", "Flight/飞行", false, "You may ignore paths when choosing the next room to travel to.\n在选择每一层房间时可以无视路线。");
EnableHeirloom = ((BaseUnityPlugin)this).Config.Bind<bool>("EnableHeirloom", "Heirloom/传家宝", false, "Start with 1 Rare exhibit.\n开始时获得一件随机稀有展品。");
EnableCardsReimu = ((BaseUnityPlugin)this).Config.Bind<bool>("EnableCardsReimu", "Reimu Cards/博丽灵梦牌", false, "Reimu cards now appear in rewards and shops.\n卡牌奖励和商店中会出现博丽灵梦牌。");
EnableCardsMarisa = ((BaseUnityPlugin)this).Config.Bind<bool>("EnableCardsMarisa", "Marisa Cards/雾雨魔理沙牌", false, "Marisa cards now appear in rewards and shops.\n卡牌奖励和商店中会出现雾雨魔理沙牌。");
EnableCardsSakuya = ((BaseUnityPlugin)this).Config.Bind<bool>("EnableCardsSakuya", "Sakuya Cards/十六夜咲夜牌", false, "Sakuya cards now appear in rewards and shops.\n卡牌奖励和商店中会出现十六夜咲夜牌。");
EnableCardsCirno = ((BaseUnityPlugin)this).Config.Bind<bool>("EnableCardsCirno", "Cirno Cards/琪露诺牌", false, "Cirno cards now appear in rewards and shops.\n卡牌奖励和商店中会出现琪露诺牌。");
EnableCardsKoishi = ((BaseUnityPlugin)this).Config.Bind<bool>("EnableCardsKoishi", "Koishi Cards/古明地恋牌", false, "Koishi cards now appear in rewards and shops.\n卡牌奖励和商店中会出现古明地恋牌。");
harmony.PatchAll();
if (Chainloader.PluginInfos.ContainsKey("neo.lbol.tools.watermark"))
{
WatermarkWrapper.ActivateWatermark();
}
}
private void OnDestroy()
{
if (harmony != null)
{
harmony.UnpatchSelf();
}
}
static BepinexPlugin()
{
harmony = PInfo.harmony;
}
}
public static class PInfo
{
public const string GUID = "a254389063.lbol.DoubleBoss";
public const string Name = "Double Boss";
public const string version = "0.0.6";
public static readonly Harmony harmony;
static PInfo()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Expected O, but got Unknown
harmony = new Harmony("a254389063.lbol.DoubleBoss");
}
}
public sealed class DoubleBoss
{
[HarmonyPatch(typeof(Stage), "CreateMap")]
private class WindGodLake_CreateMap_Patch
{
private static void Postfix(Stage __instance, ref GameMap __result)
{
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Expected O, but got Unknown
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: Expected O, but got Unknown
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_00a6: Expected O, but got Unknown
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: Expected O, but got Unknown
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Expected O, but got Unknown
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_0107: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Expected O, but got Unknown
//IL_0123: Unknown result type (might be due to invalid IL or missing references)
//IL_0128: Unknown result type (might be due to invalid IL or missing references)
//IL_0130: Unknown result type (might be due to invalid IL or missing references)
//IL_0141: Expected O, but got Unknown
//IL_0151: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_0163: Expected O, but got Unknown
//IL_05c2: Unknown result type (might be due to invalid IL or missing references)
//IL_05c8: Expected O, but got Unknown
//IL_05ce: Unknown result type (might be due to invalid IL or missing references)
//IL_05d5: Expected O, but got Unknown
//IL_05e3: Unknown result type (might be due to invalid IL or missing references)
//IL_05e8: Unknown result type (might be due to invalid IL or missing references)
//IL_05f4: Expected O, but got Unknown
//IL_0602: Unknown result type (might be due to invalid IL or missing references)
//IL_0607: Unknown result type (might be due to invalid IL or missing references)
//IL_061f: Expected O, but got Unknown
//IL_062f: Unknown result type (might be due to invalid IL or missing references)
//IL_0634: Unknown result type (might be due to invalid IL or missing references)
//IL_0640: Expected O, but got Unknown
//IL_0650: Unknown result type (might be due to invalid IL or missing references)
//IL_0655: Unknown result type (might be due to invalid IL or missing references)
//IL_065c: Unknown result type (might be due to invalid IL or missing references)
//IL_066d: Expected O, but got Unknown
//IL_067d: Unknown result type (might be due to invalid IL or missing references)
//IL_0682: Unknown result type (might be due to invalid IL or missing references)
//IL_068a: Unknown result type (might be due to invalid IL or missing references)
//IL_069b: Expected O, but got Unknown
//IL_06ab: Unknown result type (might be due to invalid IL or missing references)
//IL_06b0: Unknown result type (might be due to invalid IL or missing references)
//IL_06bd: Expected O, but got Unknown
//IL_0734: Unknown result type (might be due to invalid IL or missing references)
//IL_073e: Expected O, but got Unknown
//IL_0236: Unknown result type (might be due to invalid IL or missing references)
//IL_023b: Unknown result type (might be due to invalid IL or missing references)
//IL_0245: Unknown result type (might be due to invalid IL or missing references)
//IL_0254: Expected O, but got Unknown
//IL_0757: Unknown result type (might be due to invalid IL or missing references)
//IL_075c: Unknown result type (might be due to invalid IL or missing references)
//IL_0767: Unknown result type (might be due to invalid IL or missing references)
//IL_0776: Expected O, but got Unknown
//IL_0811: Unknown result type (might be due to invalid IL or missing references)
//IL_081b: Expected O, but got Unknown
//IL_02e8: Unknown result type (might be due to invalid IL or missing references)
//IL_02ed: Unknown result type (might be due to invalid IL or missing references)
//IL_02f7: Unknown result type (might be due to invalid IL or missing references)
//IL_0306: Expected O, but got Unknown
//IL_084e: Unknown result type (might be due to invalid IL or missing references)
//IL_0853: Unknown result type (might be due to invalid IL or missing references)
//IL_085e: Unknown result type (might be due to invalid IL or missing references)
//IL_086d: Expected O, but got Unknown
//IL_08f0: Unknown result type (might be due to invalid IL or missing references)
//IL_08fa: Expected O, but got Unknown
//IL_039d: Unknown result type (might be due to invalid IL or missing references)
//IL_03a2: Unknown result type (might be due to invalid IL or missing references)
//IL_03ad: Unknown result type (might be due to invalid IL or missing references)
//IL_03bc: Expected O, but got Unknown
//IL_092f: Unknown result type (might be due to invalid IL or missing references)
//IL_0934: Unknown result type (might be due to invalid IL or missing references)
//IL_0940: Unknown result type (might be due to invalid IL or missing references)
//IL_094f: Expected O, but got Unknown
if (!BepinexPlugin.EnableDoubleBoss.Value || __instance.Level != 3)
{
return;
}
if (!BepinexPlugin.EnableCertainFuture.Value)
{
ConstructorInfo constructorInfo = typeof(GameMap).GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic)[0];
__result = (GameMap)constructorInfo.Invoke(new object[4]
{
18,
5,
(object)(UiType)2,
__instance.Boss.Id
});
RandomGen val = new RandomGen(__instance.MapSeed);
__result.Nodes[0, 0] = new MapNode(__result, 0, 0, 1)
{
StationType = (StationType)7
};
__result.Nodes[5, 0] = new MapNode(__result, 5, 0, 1)
{
StationType = (StationType)(__instance.IsSelectingBoss ? 8 : 9)
};
__result.Nodes[10, 0] = new MapNode(__result, 10, 0, 2)
{
StationType = (StationType)3
};
__result.Nodes[15, 0] = new MapNode(__result, 15, 0, 3)
{
StationType = (StationType)4
};
__result.Nodes[16, 0] = new MapNode(__result, 16, 0, 3)
{
StationType = (StationType)10,
FollowerList = { 0 }
};
__result.Nodes[17, 0] = new MapNode(__result, 17, 0, 3)
{
StationType = (StationType)10
};
for (int i = 1; i < 5; i++)
{
__result.Nodes[0, 0].FollowerList.Add(i);
__result.Nodes[5, 0].FollowerList.Add(i);
__result.Nodes[10, 0].FollowerList.Add(i);
}
__result.Nodes[15, 0].FollowerList.Add(0);
StationType[,] array = (StationType[,])AccessTools.Method(typeof(GameMap), "GetAct1", new Type[1] { typeof(RandomGen) }, (Type[])null).Invoke(null, new object[1] { val });
for (int j = 1; j < 5; j++)
{
for (int k = 1; k < 5; k++)
{
__result.Nodes[j, k] = new MapNode(__result, j, k, 1)
{
StationType = array[j - 1, k - 1]
};
__result.Nodes[j, k].FollowerList.Add((j != 4) ? k : 0);
}
}
array = (StationType[,])AccessTools.Method(typeof(GameMap), "GetAct2", new Type[1] { typeof(RandomGen) }, (Type[])null).Invoke(null, new object[1] { val });
for (int l = 6; l < 10; l++)
{
for (int m = 1; m < 5; m++)
{
__result.Nodes[l, m] = new MapNode(__result, l, m, 2)
{
StationType = array[l - 6, m - 1]
};
__result.Nodes[l, m].FollowerList.Add((l != 9) ? m : 0);
}
}
array = (StationType[,])AccessTools.Method(typeof(GameMap), "GetAct3", new Type[1] { typeof(RandomGen) }, (Type[])null).Invoke(null, new object[1] { val });
for (int n = 11; n < 15; n++)
{
for (int num = 1; num < 5; num++)
{
__result.Nodes[n, num] = new MapNode(__result, n, num, 3)
{
StationType = array[n - 11, num - 1]
};
__result.Nodes[n, num].FollowerList.Add((n != 14) ? num : 0);
}
}
MethodInfo methodInfo = AccessTools.Method(typeof(GameMap), "CreateSideWays", new Type[4]
{
typeof(GameMap),
typeof(RandomGen),
typeof(int),
typeof(int)
}, (Type[])null);
methodInfo.Invoke(null, new object[4] { __result, val, 1, 5 });
methodInfo.Invoke(null, new object[4] { __result, val, 6, 10 });
methodInfo.Invoke(null, new object[4] { __result, val, 11, 15 });
PropertyInfo property = typeof(GameMap).GetProperty("StartNode", BindingFlags.Instance | BindingFlags.Public);
PropertyInfo? property2 = typeof(GameMap).GetProperty("BossNode", BindingFlags.Instance | BindingFlags.Public);
PropertyInfo? property3 = typeof(GameMap).GetProperty("EndNode", BindingFlags.Instance | BindingFlags.Public);
property.SetValue(__result, __result.Nodes[0, 0]);
property3.SetValue(__result, __result.Nodes[17, 0]);
property2.SetValue(__result, __result.Nodes[17, 0]);
__result.StartNode.Status = (MapNodeStatus)1;
}
else if (BepinexPlugin.EnableCertainFuture.Value)
{
ConstructorInfo constructorInfo2 = typeof(GameMap).GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic)[0];
__result = (GameMap)constructorInfo2.Invoke(new object[4]
{
18,
5,
(object)(UiType)2,
(__instance.Boss == null) ? null : __instance.Boss.Id
});
RandomGen val2 = new RandomGen(__instance.MapSeed);
__result.Nodes[0, 0] = new MapNode(__result, 0, 0, 1)
{
StationType = (StationType)7
};
__result.Nodes[5, 0] = new MapNode(__result, 5, 0, 1)
{
StationType = (StationType)(__instance.IsSelectingBoss ? 8 : 9)
};
__result.Nodes[10, 0] = new MapNode(__result, 10, 0, 2)
{
StationType = (StationType)3
};
__result.Nodes[15, 0] = new MapNode(__result, 15, 0, 3)
{
StationType = (StationType)4,
FollowerList = { 0 }
};
__result.Nodes[16, 0] = new MapNode(__result, 16, 0, 3)
{
StationType = (StationType)10,
FollowerList = { 0 }
};
__result.Nodes[17, 0] = new MapNode(__result, 17, 0, 3)
{
StationType = (StationType)10
};
StationType[,] array2 = (StationType[,])AccessTools.Method(typeof(GameMap), "GetAct1", new Type[1] { typeof(RandomGen) }, (Type[])null).Invoke(null, new object[1] { val2 });
RepeatableRandomPool<int> val3 = new RepeatableRandomPool<int>();
for (int num2 = 1; num2 < 5; num2++)
{
val3.Add(num2, 1f);
}
int num3 = val3.SampleOrDefault(new RandomGen(((GameEntity)__instance).GameRun.RootRng.NextULong()));
for (int num4 = 1; num4 < 5; num4++)
{
__result.Nodes[num4, num3] = new MapNode(__result, num4, num3, 1)
{
StationType = array2[num4 - 1, num3 - 1]
};
__result.Nodes[num4, num3].FollowerList.Add((num4 != 4) ? num3 : 0);
}
__result.Nodes[0, 0].FollowerList.Add(num3);
array2 = (StationType[,])AccessTools.Method(typeof(GameMap), "GetAct2", new Type[1] { typeof(RandomGen) }, (Type[])null).Invoke(null, new object[1] { val2 });
num3 = val3.SampleOrDefault(new RandomGen(((GameEntity)__instance).GameRun.RootRng.NextULong()));
__result.Nodes[5, 0].FollowerList.Add(num3);
for (int num5 = 6; num5 < 10; num5++)
{
__result.Nodes[num5, num3] = new MapNode(__result, num5, num3, 2)
{
StationType = array2[num5 - 6, num3 - 1]
};
__result.Nodes[num5, num3].FollowerList.Add((num5 != 9) ? num3 : 0);
}
array2 = (StationType[,])AccessTools.Method(typeof(GameMap), "GetAct3", new Type[1] { typeof(RandomGen) }, (Type[])null).Invoke(null, new object[1] { val2 });
num3 = val3.SampleOrDefault(new RandomGen(((GameEntity)__instance).GameRun.RootRng.NextULong()));
__result.Nodes[10, 0].FollowerList.Add(num3);
for (int num6 = 11; num6 < 15; num6++)
{
__result.Nodes[num6, num3] = new MapNode(__result, num6, num3, 3)
{
StationType = array2[num6 - 11, num3 - 1]
};
__result.Nodes[num6, num3].FollowerList.Add((num6 != 14) ? num3 : 0);
}
PropertyInfo? property4 = typeof(GameMap).GetProperty("StartNode", BindingFlags.Instance | BindingFlags.Public);
PropertyInfo property5 = typeof(GameMap).GetProperty("BossNode", BindingFlags.Instance | BindingFlags.Public);
PropertyInfo property6 = typeof(GameMap).GetProperty("EndNode", BindingFlags.Instance | BindingFlags.Public);
property4.SetValue(__result, __result.Nodes[0, 0]);
property5.SetValue(__result, __result.Nodes[17, 0]);
property6.SetValue(__result, __result.Nodes[17, 0]);
__result.StartNode.Status = (MapNodeStatus)1;
}
}
}
[HarmonyPatch(typeof(BattleStation), "OnEnter")]
private class WindGodLake_SetBoss2_Patch
{
private static void Prefix(BattleStation __instance)
{
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Invalid comparison between Unknown and I4
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Expected O, but got Unknown
if (BepinexPlugin.EnableDoubleBoss.Value && ((Station)__instance).Stage.Level == 3 && (int)((Station)__instance).Type == 10 && ((Station)__instance).Level == 17)
{
RepeatableRandomPool<string> bossPool = ((Station)__instance).Stage.BossPool;
bossPool.Remove(((Station)__instance).Stage.Boss.Id);
string text = bossPool.SampleOrDefault(new RandomGen(((Station)__instance).GameRun.RootRng.NextULong()));
if (text != null)
{
__instance.EnemyGroupEntry = Library.GetEnemyGroupEntry(text);
}
}
}
}
[HarmonyPatch(typeof(BossStation), "GenerateRewards")]
private class WindGodLake_ClearBoss1Rewards_Patch
{
private static bool Prefix(BossStation __instance)
{
if (BepinexPlugin.EnableDoubleBoss.Value && ((Station)__instance).Stage.Level == 3)
{
return ((Station)__instance).Level != 16;
}
return true;
}
}
[HarmonyPatch(typeof(BossStation), "GenerateBossRewards")]
private class WindGodLake_ClearBoss1ExhibitsRewards_Patch
{
private static bool Prefix(BossStation __instance)
{
if (BepinexPlugin.EnableDoubleBoss.Value && ((Station)__instance).Stage.Level == 3)
{
return ((Station)__instance).Level != 16;
}
return true;
}
}
}
internal class WatermarkWrapper
{
[MethodImpl(MethodImplOptions.NoInlining)]
internal static void ActivateWatermark()
{
API.ActivateWatermark();
}
}
public sealed class CertainFuture
{
[HarmonyPatch(typeof(Stage), "CreateMap")]
private class CreateMap_Patch
{
private static void Postfix(Stage __instance, ref GameMap __result)
{
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Expected O, but got Unknown
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Expected O, but got Unknown
//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_00ba: Expected O, but got Unknown
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Expected O, but got Unknown
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
//IL_0106: Expected O, but got Unknown
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Unknown result type (might be due to invalid IL or missing references)
//IL_0122: Unknown result type (might be due to invalid IL or missing references)
//IL_0133: Expected O, but got Unknown
//IL_0143: 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_0155: Expected O, but got Unknown
//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
//IL_01c7: Expected O, but got Unknown
//IL_01e0: Unknown result type (might be due to invalid IL or missing references)
//IL_01e5: Unknown result type (might be due to invalid IL or missing references)
//IL_01ef: Unknown result type (might be due to invalid IL or missing references)
//IL_01fe: Expected O, but got Unknown
//IL_028c: 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_02a0: Expected O, but got Unknown
//IL_02d3: Unknown result type (might be due to invalid IL or missing references)
//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
//IL_02f1: Expected O, but got Unknown
//IL_0367: 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_0385: Expected O, but got Unknown
//IL_03ba: Unknown result type (might be due to invalid IL or missing references)
//IL_03bf: Unknown result type (might be due to invalid IL or missing references)
//IL_03ca: Unknown result type (might be due to invalid IL or missing references)
//IL_03d9: Expected O, but got Unknown
if (BepinexPlugin.EnableCertainFuture.Value && __instance.Level != 4 && (!BepinexPlugin.EnableDoubleBoss.Value || __instance.Level != 3))
{
ConstructorInfo constructorInfo = typeof(GameMap).GetConstructors(BindingFlags.Instance | BindingFlags.NonPublic)[0];
__result = (GameMap)constructorInfo.Invoke(new object[4]
{
17,
5,
(object)(UiType)2,
(__instance.Boss == null) ? null : __instance.Boss.Id
});
RandomGen val = new RandomGen(__instance.MapSeed);
__result.Nodes[0, 0] = new MapNode(__result, 0, 0, 1)
{
StationType = (StationType)7
};
__result.Nodes[5, 0] = new MapNode(__result, 5, 0, 1)
{
StationType = (StationType)(__instance.IsSelectingBoss ? 8 : 9)
};
__result.Nodes[10, 0] = new MapNode(__result, 10, 0, 2)
{
StationType = (StationType)3
};
__result.Nodes[15, 0] = new MapNode(__result, 15, 0, 3)
{
StationType = (StationType)4,
FollowerList = { 0 }
};
__result.Nodes[16, 0] = new MapNode(__result, 16, 0, 3)
{
StationType = (StationType)10
};
StationType[,] array = (StationType[,])AccessTools.Method(typeof(GameMap), "GetAct1", new Type[1] { typeof(RandomGen) }, (Type[])null).Invoke(null, new object[1] { val });
RepeatableRandomPool<int> val2 = new RepeatableRandomPool<int>();
for (int i = 1; i < 5; i++)
{
val2.Add(i, 1f);
}
int num = val2.SampleOrDefault(new RandomGen(__instance.MapSeed));
for (int j = 1; j < 5; j++)
{
__result.Nodes[j, num] = new MapNode(__result, j, num, 1)
{
StationType = array[j - 1, num - 1]
};
__result.Nodes[j, num].FollowerList.Add((j != 4) ? num : 0);
}
__result.Nodes[0, 0].FollowerList.Add(num);
array = (StationType[,])AccessTools.Method(typeof(GameMap), "GetAct2", new Type[1] { typeof(RandomGen) }, (Type[])null).Invoke(null, new object[1] { val });
num = val2.SampleOrDefault(new RandomGen(new RandomGen(__instance.MapSeed).NextULong()));
__result.Nodes[5, 0].FollowerList.Add(num);
for (int k = 6; k < 10; k++)
{
__result.Nodes[k, num] = new MapNode(__result, k, num, 2)
{
StationType = array[k - 6, num - 1]
};
__result.Nodes[k, num].FollowerList.Add((k != 9) ? num : 0);
}
array = (StationType[,])AccessTools.Method(typeof(GameMap), "GetAct3", new Type[1] { typeof(RandomGen) }, (Type[])null).Invoke(null, new object[1] { val });
num = val2.SampleOrDefault(new RandomGen(new RandomGen(new RandomGen(__instance.MapSeed).NextULong()).NextULong()));
__result.Nodes[10, 0].FollowerList.Add(num);
for (int l = 11; l < 15; l++)
{
__result.Nodes[l, num] = new MapNode(__result, l, num, 3)
{
StationType = array[l - 11, num - 1]
};
__result.Nodes[l, num].FollowerList.Add((l != 14) ? num : 0);
}
PropertyInfo property = typeof(GameMap).GetProperty("StartNode", BindingFlags.Instance | BindingFlags.Public);
PropertyInfo? property2 = typeof(GameMap).GetProperty("BossNode", BindingFlags.Instance | BindingFlags.Public);
PropertyInfo? property3 = typeof(GameMap).GetProperty("EndNode", BindingFlags.Instance | BindingFlags.Public);
property.SetValue(__result, __result.Nodes[0, 0]);
property3.SetValue(__result, __result.Nodes[16, 0]);
property2.SetValue(__result, __result.Nodes[16, 0]);
__result.StartNode.Status = (MapNodeStatus)1;
}
}
}
}
public sealed class Binary
{
[HarmonyPatch(typeof(GameRunController), "GetRewardCards")]
private class GetRewardCards_Patch
{
private static void Postfix(GameRunController __instance, ref Card[] __result)
{
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Expected O, but got Unknown
if (!BepinexPlugin.EnableBinary.Value)
{
return;
}
int num = __result.Length;
RepeatableRandomPool<int> val = new RepeatableRandomPool<int>();
for (int i = 0; i < __result.Length; i++)
{
val.Add(i, 1f);
}
int num2 = val.SampleOrDefault(new RandomGen(__instance.RootRng.NextULong()));
Card[] array = (Card[])(object)new Card[__result.Length - 1];
int j = 0;
int num3 = 0;
for (; j < num; j++)
{
if (j != num2)
{
array[num3] = __result[j];
num3++;
}
}
__result = array;
}
}
}
}
namespace System.Runtime.CompilerServices
{
[AttributeUsage(AttributeTargets.Assembly, AllowMultiple = true)]
internal sealed class IgnoresAccessChecksToAttribute : Attribute
{
internal IgnoresAccessChecksToAttribute(string assemblyName)
{
}
}
}
namespace DoubleBoss
{
public sealed class NightTerrors
{
[HarmonyPatch(typeof(GapStation), "DrinkTea")]
private class DrinkTea_Patch
{
private static bool Prefix(GapStation __instance)
{
if (BepinexPlugin.EnableNightTerrors.Value)
{
((Station)__instance).GameRun.LoseMaxHp(5, true);
}
return true;
}
}
}
public sealed class Terminal
{
[HarmonyPatch(typeof(Station), "OnEnter")]
private class OnEnterStation_Patch
{
private static bool Prefix(GapStation __instance)
{
if (BepinexPlugin.EnableTerminal.Value)
{
((Station)__instance).GameRun.LoseMaxHp(1, true);
}
return true;
}
}
[HarmonyPatch(typeof(AdventureStation), "OnEnter")]
private class OnEnterAdventureStation_Patch
{
private static bool Prefix(GapStation __instance)
{
if (BepinexPlugin.EnableTerminal.Value)
{
((Station)__instance).GameRun.LoseMaxHp(1, true);
}
return true;
}
}
[HarmonyPatch(typeof(BattleStation), "OnEnter")]
private class OnEnterBattleStation_Patch
{
private static bool Prefix(GapStation __instance)
{
if (BepinexPlugin.EnableTerminal.Value)
{
((Station)__instance).GameRun.LoseMaxHp(1, true);
}
return true;
}
}
[HarmonyPatch(typeof(GapStation), "OnEnter")]
private class OnEnterGapStation_Patch
{
private static bool Prefix(GapStation __instance)
{
if (BepinexPlugin.EnableTerminal.Value)
{
((Station)__instance).GameRun.LoseMaxHp(1, true);
}
return true;
}
}
[HarmonyPatch(typeof(SelectStation), "OnEnter")]
private class OnEnterSelectStation_Patch
{
private static bool Prefix(GapStation __instance)
{
if (BepinexPlugin.EnableTerminal.Value)
{
((Station)__instance).GameRun.LoseMaxHp(1, true);
}
return true;
}
}
[HarmonyPatch(typeof(ShopStation), "OnEnter")]
private class OnEnterShopStation_Patch
{
private static bool Prefix(GapStation __instance)
{
if (BepinexPlugin.EnableTerminal.Value)
{
((Station)__instance).GameRun.LoseMaxHp(1, true);
}
return true;
}
}
[HarmonyPatch(typeof(SupplyStation), "OnEnter")]
private class OnEnterSupplyStation_Patch
{
private static bool Prefix(GapStation __instance)
{
if (BepinexPlugin.EnableTerminal.Value)
{
((Station)__instance).GameRun.LoseMaxHp(1, true);
}
return true;
}
}
[HarmonyPatch(typeof(TradeStation), "OnEnter")]
private class OnEnterTradeStation_Patch
{
private static bool Prefix(GapStation __instance)
{
if (BepinexPlugin.EnableTerminal.Value)
{
((Station)__instance).GameRun.LoseMaxHp(1, true);
}
return true;
}
}
}
public sealed class CursedRun
{
[HarmonyPatch(typeof(BossStation), "GenerateBossRewards")]
private class GenerateBossRewards_Patch
{
private static bool Prefix(BossStation __instance)
{
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
if (BepinexPlugin.EnableCursedRun.Value)
{
((Station)__instance).GameRun.AddDeckCard(((Station)__instance).GameRun.GetRandomCurseCard(new RandomGen(((Station)__instance).GameRun.RootRng.NextULong()), false), true, (VisualSourceData)null);
}
return true;
}
}
[HarmonyPatch(typeof(Adventure), "GainExhibitRunner")]
private class GainExhibitRunnerSupply_Patch
{
private static bool Prefix(Adventure __instance)
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Invalid comparison between Unknown and I4
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Expected O, but got Unknown
if (BepinexPlugin.EnableCursedRun.Value && (int)__instance.Station.Type == 3)
{
__instance.GameRun.AddDeckCard(__instance.GameRun.GetRandomCurseCard(new RandomGen(__instance.GameRun.RootRng.NextULong()), false), true, (VisualSourceData)null);
}
return true;
}
}
}
public sealed class OneHitWonder
{
[HarmonyPatch(typeof(Debut), "InitVariables")]
private class InitVariables_Patch
{
private static void Postfix(Debut __instance)
{
if (BepinexPlugin.EnableOneHitWonder.Value)
{
((Adventure)__instance).GameRun.SetHpAndMaxHp(1, 1, true);
}
}
}
}
public sealed class Midas
{
[HarmonyPatch(typeof(GapStation), "OnEnter")]
private class OnEnterGapStation_Patch
{
private static void Postfix(GapStation __instance)
{
if (BepinexPlugin.EnableMidas.Value)
{
__instance.GapOptions.RemoveAll((GapOption item) => item is UpgradeCard);
}
}
}
}
public sealed class Lethality
{
[HarmonyPatch(typeof(BattleController), "StartBattle")]
private class StartBattle_Patch
{
private static void Postfix(BattleController __instance)
{
if (!BepinexPlugin.EnableLethality.Value)
{
return;
}
foreach (EnemyUnit allAliveEnemy in __instance.AllAliveEnemies)
{
__instance.React(Reactor.op_Implicit((BattleAction)(object)new ApplyStatusEffectAction<Firepower>((Unit)(object)allAliveEnemy, (int?)3, (int?)null, (int?)null, (int?)null, 0f, true)), (GameEntity)(object)allAliveEnemy, (ActionCause)10);
}
}
}
}
public sealed class DeadlyEvents
{
[HarmonyPatch(typeof(GameRunController), "EnterMapNode")]
private class EnterAdventureMapNode_Patch
{
private static bool Prefix(GameRunController __instance, ref MapNode node)
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Invalid comparison between Unknown and I4
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Expected O, but got Unknown
if (BepinexPlugin.EnableDeadlyEvents.Value && (int)node.StationType == 6)
{
RepeatableRandomPool<int> val = new RepeatableRandomPool<int>();
for (int i = 0; i < 100; i++)
{
val.Add(i, 1f);
}
int num = val.SampleOrDefault(new RandomGen(__instance.RootRng.NextULong()));
if (num < 20)
{
node.StationType = (StationType)1;
}
else if (num < 30)
{
node.StationType = (StationType)2;
}
}
return true;
}
}
}
public sealed class StarterDeck
{
[HarmonyPatch(typeof(Station), "AddReward")]
private class AddCardReward_Patch
{
private static bool Prefix(Station __instance, ref StationReward reward)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Invalid comparison between Unknown and I4
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Invalid comparison between Unknown and I4
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Invalid comparison between Unknown and I4
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Invalid comparison between Unknown and I4
if (BepinexPlugin.EnableStarterDeck.Value && ((int)__instance.Type == 1 || (int)__instance.Type == 2 || (int)__instance.Type == 10) && (int)reward.Type == 1)
{
return false;
}
return true;
}
}
}
public sealed class MyTrueForm
{
[HarmonyPatch(typeof(Debut), "InitVariables")]
private class InitVariables_Patch
{
private static void Postfix(Debut __instance)
{
if (BepinexPlugin.EnableMyTrueForm.Value)
{
Card[] array = (Card[])(object)new Card[6]
{
(Card)Library.CreateCard<MeihongPower>(),
(Card)Library.CreateCard<YuetuInvincible>(),
(Card)Library.CreateCard<YonglinCard>(),
(Card)Library.CreateCard<HuiyeMana>(),
(Card)Library.CreateCard<TrueMoon>(),
(Card)Library.CreateCard<MoonWorld>()
};
((Adventure)__instance).GameRun.AddDeckCards((IEnumerable<Card>)array, true, (VisualSourceData)null);
}
}
}
}
public sealed class DailyChallenges
{
[HarmonyPatch(typeof(GameMaster), "CoNewGameRun")]
private class CoSetupGameRun_Patch
{
private static bool Prefix(Debut __instance)
{
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_0162: Expected O, but got Unknown
if (BepinexPlugin.DailyChallenges.Value > 0)
{
int value = BepinexPlugin.DailyChallenges.Value;
value = ((value > 10) ? 10 : value);
BepinexPlugin.EnableBinary.Value = false;
BepinexPlugin.EnableCertainFuture.Value = false;
BepinexPlugin.EnableCursedRun.Value = false;
BepinexPlugin.EnableDeadlyEvents.Value = false;
BepinexPlugin.EnableLethality.Value = false;
BepinexPlugin.EnableMidas.Value = false;
BepinexPlugin.EnableNightTerrors.Value = false;
BepinexPlugin.EnableTerminal.Value = false;
BepinexPlugin.EnableRestlessJourney.Value = false;
BepinexPlugin.EnableColossus.Value = false;
UniqueRandomPool<ConfigEntry<bool>> obj = new UniqueRandomPool<ConfigEntry<bool>>(false);
obj.Add(BepinexPlugin.EnableBinary, 1f);
obj.Add(BepinexPlugin.EnableCertainFuture, 1f);
obj.Add(BepinexPlugin.EnableCursedRun, 1f);
obj.Add(BepinexPlugin.EnableDeadlyEvents, 1f);
obj.Add(BepinexPlugin.EnableLethality, 1f);
obj.Add(BepinexPlugin.EnableMidas, 1f);
obj.Add(BepinexPlugin.EnableNightTerrors, 1f);
obj.Add(BepinexPlugin.EnableTerminal, 1f);
obj.Add(BepinexPlugin.EnableRestlessJourney, 1f);
obj.Add(BepinexPlugin.EnableColossus, 1f);
Random random = new Random();
uint num = (uint)random.Next();
uint num2 = (uint)random.Next();
ulong num3 = ((ulong)num << 32) | num2;
ConfigEntry<bool>[] array = obj.SampleMany(new RandomGen(num3), value, true);
foreach (ConfigEntry<bool> obj2 in array)
{
obj2.Value = true;
Debug.Log((object)((ConfigEntryBase)obj2).Definition);
}
}
return true;
}
}
}
public sealed class Flight : IMapModeOverrider
{
[HarmonyPatch(typeof(Debut), "InitVariables")]
private class InitVariables_Patch
{
private static void Postfix(Debut __instance)
{
if (BepinexPlugin.EnableFlight.Value)
{
((Adventure)__instance).GameRun.AddMapModeOverrider((IMapModeOverrider)(object)new Flight());
}
}
}
public GameRunMapMode? MapMode => (GameRunMapMode)1;
public void OnEnteredWithMode()
{
}
}
public sealed class RestlessJourney
{
[HarmonyPatch(typeof(GameRunController), "EnterNextStage")]
private class EnterNextStage_Patch
{
private static bool Prefix(GameRunController __instance)
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
if (!BepinexPlugin.EnableRestlessJourney.Value)
{
return true;
}
if ((int)__instance.Status != 0)
{
throw new InvalidOperationException("Cannot enter next stage while not running");
}
AccessTools.Method(typeof(GameRunController), "LeaveStation", (Type[])null, (Type[])null).Invoke(__instance, null);
AccessTools.Method(typeof(GameRunController), "EnterStage", (Type[])null, (Type[])null).Invoke(__instance, new object[1] { Traverse.Create((object)__instance).Field("_stageIndex").GetValue<int>() + 1 });
return false;
}
}
}
public sealed class CharacterCards
{
[HarmonyPatch(typeof(GameRunController), "CreateValidCardsPool")]
private class CreateValidCardPool_Patch
{
private static void Postfix(GameRunController __instance, ref UniqueRandomPool<Type> __result, ref CardWeightTable weightTable, ref ManaGroup? manaLimit, ref bool colorLimit, ref bool applyFactors, ref bool battleRolling, ref Predicate<CardConfig> filter)
{
//IL_01a5: Unknown result type (might be due to invalid IL or missing references)
//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
//IL_01b1: Unknown result type (might be due to invalid IL or missing references)
//IL_01b6: Unknown result type (might be due to invalid IL or missing references)
//IL_01e4: Unknown result type (might be due to invalid IL or missing references)
//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
HashSet<string> hashSet = new HashSet<string> { ((GameEntity)__instance.Player).Id };
if (__instance.AllCharacterCardsFlag > 0)
{
foreach (PlayerUnitConfig item in PlayerUnitConfig.AllConfig())
{
hashSet.Add(item.Id);
}
}
else
{
foreach (Exhibit exhibit in __instance.Player.Exhibits)
{
if (exhibit.OwnerId != null)
{
hashSet.Add(exhibit.OwnerId);
}
}
if (BepinexPlugin.EnableCardsReimu.Value)
{
hashSet.Add("Reimu");
}
if (BepinexPlugin.EnableCardsMarisa.Value)
{
hashSet.Add("Marisa");
}
if (BepinexPlugin.EnableCardsSakuya.Value)
{
hashSet.Add("Sakuya");
}
if (BepinexPlugin.EnableCardsCirno.Value)
{
hashSet.Add("Cirno");
}
if (BepinexPlugin.EnableCardsKoishi.Value)
{
hashSet.Add("Koishi");
}
}
UniqueRandomPool<Type> val = new UniqueRandomPool<Type>(false);
foreach (var (type, val2) in Library.EnumerateRollableCardTypes(__instance.UnlockLevel))
{
if (!val2.IsPooled || val2.DebugLevel > __instance.CardValidDebugLevel || (battleRolling && !val2.FindInBattle) || (filter != null && !filter(val2)))
{
continue;
}
if (manaLimit.HasValue)
{
ManaGroup mana = manaLimit.GetValueOrDefault();
ManaGroup cost = val2.Cost;
if (((ManaGroup)(ref cost)).Amount > 5)
{
if (!((ManaGroup)(ref mana)).CanAfford(ManaGroupExtensions.WithAny(cost, 0)))
{
continue;
}
}
else if (!((ManaGroup)(ref mana)).CanAfford(cost))
{
continue;
}
if (colorLimit && Enumerable.Any(val2.Colors, (ManaColor c) => ((ManaGroup)(ref mana)).GetValue(c) == 0))
{
continue;
}
}
float num = weightTable.WeightFor(val2, ((GameEntity)__instance.Player).Id, (ISet<string>)hashSet);
if (num > 0f)
{
float num2 = (float)AccessTools.Method(typeof(GameRunController), "BaseCardWeight", (Type[])null, (Type[])null).Invoke(__instance, new object[2] { val2, applyFactors });
val.Add(type, num * num2);
}
}
__result = val;
}
}
}
public sealed class Heirloom
{
[HarmonyPatch(typeof(Debut), "InitVariables")]
private class InitVariables_Patch
{
private static void Postfix(Debut __instance)
{
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
if (BepinexPlugin.EnableHeirloom.Value)
{
GameMaster.DebugGainExhibit(((Adventure)__instance).GameRun.RollNormalExhibit(((Adventure)__instance).GameRun.ExhibitRng, new ExhibitWeightTable(RarityWeightTable.OnlyRare, AppearanceWeightTable.AllOnes), (Func<Exhibit>)null, (Predicate<ExhibitConfig>)null));
}
}
}
}
public sealed class Colossus
{
[HarmonyPatch(typeof(BattleController), "StartBattle")]
private class StartBattle_Patch
{
private static void Postfix(BattleController __instance)
{
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
if (!BepinexPlugin.EnableColossus.Value)
{
return;
}
foreach (EnemyUnit allAliveEnemy in __instance.AllAliveEnemies)
{
__instance.GameRun.SetEnemyHpAndMaxHp((int)((float)((Unit)allAliveEnemy).Hp * 1.5f), (int)((float)((Unit)allAliveEnemy).MaxHp * 1.5f), allAliveEnemy, true);
IEnemyUnitView view = allAliveEnemy.View;
UnitView val = (UnitView)(object)((view is UnitView) ? view : null);
Transform transform = ((Component)val).transform;
transform.localScale *= 1.5f;
((Unit)allAliveEnemy).SetView((IUnitView)(object)val);
}
}
}
[HarmonyPatch(typeof(BattleController), "Spawn", new Type[]
{
typeof(EnemyUnit),
typeof(EnemyUnit),
typeof(int),
typeof(bool)
})]
private class Spawn_Patch
{
private static void Postfix(BattleController __instance, ref EnemyUnit __result)
{
if (BepinexPlugin.EnableColossus.Value)
{
((Unit)__result).SetMaxHp((int)((float)((Unit)__result).Hp * 1.5f), (int)((float)((Unit)__result).MaxHp * 1.5f));
}
}
}
}
}