using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
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 BepInEx;
using HarmonyLib;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using ModdingUtils.Utils;
using Nullmanager;
using RarityLib.Utils;
using RootCore;
using UnboundLib;
using UnboundLib.GameModes;
using UnboundLib.Networking;
using UnboundLib.Utils;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(/*Could not decode attribute arguments.*/)]
[assembly: TargetFramework(".NETFramework,Version=v4.7.1", FrameworkDisplayName = ".NET Framework 4.7.1")]
[assembly: SecurityPermission(8, SkipVerification = true)]
[assembly: AssemblyVersion("0.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Embedded]
[AttributeUsage(/*Could not decode attribute arguments.*/)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace RootNulledCards
{
public class DeNuller : OnAddEffect
{
[CompilerGenerated]
private sealed class <>c__DisplayClass0_0 : Object
{
public CharacterData data;
public DeNuller <>4__this;
public Player player;
internal void <OnAdd>b__0()
{
List<CardInfo> currentCards = data.currentCards;
List<int> val = new List<int>();
List<CardInfo> val2 = new List<CardInfo>();
for (int i = 0; i < currentCards.Count; i++)
{
CardInfo obj = currentCards[i];
NullCardInfo val3 = (NullCardInfo)(object)((obj is NullCardInfo) ? obj : null);
if (val3 != null)
{
val.Add(i);
val2.Add(val3.NulledSorce);
}
}
((MonoBehaviour)Unbound.Instance).StartCoroutine(<>4__this.ReplaceCards(player, val.ToArray(), val2.ToArray()));
}
}
[CompilerGenerated]
private sealed class <ReplaceCards>d__1 : Object, IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public string[] twoLetterCodes;
public int[] indeces;
public Player player;
public CardInfo[] newCards;
public bool editCardBar;
private List<bool> <reassign>5__2;
private List<CardInfo> <newCardsToAssign>5__3;
private List<string> <twoLetterCodesToAssign>5__4;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ReplaceCards>d__1(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<reassign>5__2 = null;
<newCardsToAssign>5__3 = null;
<twoLetterCodesToAssign>5__4 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Unknown result type (might be due to invalid IL or missing references)
//IL_01b4: Unknown result type (might be due to invalid IL or missing references)
//IL_01be: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
{
<>1__state = -1;
if (twoLetterCodes == null)
{
twoLetterCodes = (string[])(object)new String[indeces.Length];
for (int i = 0; i < twoLetterCodes.Length; i++)
{
twoLetterCodes[i] = "";
}
}
<reassign>5__2 = new List<bool>();
List<CardInfo> val = new List<CardInfo>();
Enumerator<CardInfo> enumerator = player.data.currentCards.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
CardInfo current = enumerator.Current;
val.Add(current);
}
}
finally
{
((IDisposable)enumerator).Dispose();
}
<newCardsToAssign>5__3 = new List<CardInfo>();
<twoLetterCodesToAssign>5__4 = new List<string>();
int num = 0;
for (int j = 0; j < val.Count; j++)
{
if (!Enumerable.Contains<int>((IEnumerable<int>)(object)indeces, j))
{
<newCardsToAssign>5__3.Add(val[j]);
<twoLetterCodesToAssign>5__4.Add("");
<reassign>5__2.Add(true);
}
else if ((Object)(object)newCards[num] == (Object)null)
{
<newCardsToAssign>5__3.Add(val[j]);
<twoLetterCodesToAssign>5__4.Add("");
num++;
<reassign>5__2.Add(true);
}
else
{
<newCardsToAssign>5__3.Add(newCards[num]);
<twoLetterCodesToAssign>5__4.Add(twoLetterCodes[num]);
num++;
<reassign>5__2.Add(false);
}
}
Cards.instance.RemoveAllCardsFromPlayer(player, editCardBar);
<>2__current = (object)new WaitForSecondsRealtime(0.1f);
<>1__state = 1;
return true;
}
case 1:
<>1__state = -1;
if (editCardBar)
{
CardBarUtils.instance.ClearCardBar(player);
}
Cards.instance.AddCardsToPlayer(player, <newCardsToAssign>5__3.ToArray(), <reassign>5__2.ToArray(), <twoLetterCodesToAssign>5__4.ToArray(), (float[])null, (float[])null, editCardBar);
return false;
}
}
[DebuggerHidden]
void IEnumerator.Reset()
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
throw new NotSupportedException();
}
}
public override void OnAdd(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Expected O, but got Unknown
<>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0();
CS$<>8__locals0.data = data;
CS$<>8__locals0.<>4__this = this;
CS$<>8__locals0.player = player;
ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)Core.instance, 2, (Action)delegate
{
List<CardInfo> currentCards = CS$<>8__locals0.data.currentCards;
List<int> val = new List<int>();
List<CardInfo> val2 = new List<CardInfo>();
for (int i = 0; i < currentCards.Count; i++)
{
CardInfo obj = currentCards[i];
NullCardInfo val3 = (NullCardInfo)(object)((obj is NullCardInfo) ? obj : null);
if (val3 != null)
{
val.Add(i);
val2.Add(val3.NulledSorce);
}
}
((MonoBehaviour)Unbound.Instance).StartCoroutine(CS$<>8__locals0.<>4__this.ReplaceCards(CS$<>8__locals0.player, val.ToArray(), val2.ToArray()));
});
}
[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
public IEnumerator ReplaceCards(Player player, int[] indeces, CardInfo[] newCards, string[] twoLetterCodes = null, bool editCardBar = true)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return (IEnumerator)(object)new <ReplaceCards>d__1(0)
{
player = player,
indeces = indeces,
newCards = newCards,
twoLetterCodes = twoLetterCodes,
editCardBar = editCardBar
};
}
}
public class DistillAcquisition : MonoBehaviour
{
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("Systems.R00t.Nulls", "Nulled Cards", "1.1.0")]
[BepInProcess("Rounds.exe")]
public class Main : BaseUnityPlugin
{
[CompilerGenerated]
private sealed class <>c__DisplayClass5_0 : Object
{
public Player player;
internal bool <ExtraPicks>b__0(int i)
{
return PlayerManager.instance.players[i].playerID == player.playerID;
}
}
[CompilerGenerated]
private sealed class <ExtraPicks>d__5 : Object, IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
private <>c__DisplayClass5_0 <>8__1;
private Player[] <>7__wrap1;
private int <>7__wrap2;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <ExtraPicks>d__5(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>8__1 = null;
<>7__wrap1 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_011c: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Expected O, but got Unknown
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>7__wrap1 = PlayerManager.instance.players.ToArray();
<>7__wrap2 = 0;
goto IL_016b;
case 1:
<>1__state = -1;
CardChoiceVisuals.instance.Show(Enumerable.First<int>(Enumerable.Where<int>(Enumerable.Range(0, PlayerManager.instance.players.Count), (Func<int, bool>)((int i) => PlayerManager.instance.players[i].playerID == <>8__1.player.playerID))), true);
<>2__current = CardChoice.instance.DoPick(1, <>8__1.player.playerID, (PickerType)1);
<>1__state = 2;
return true;
case 2:
<>1__state = -1;
<>2__current = (object)new WaitForSecondsRealtime(0.1f);
<>1__state = 3;
return true;
case 3:
<>1__state = -1;
<>2__current = GameModeManager.TriggerHook("PlayerPickEnd");
<>1__state = 4;
return true;
case 4:
{
<>1__state = -1;
goto IL_0156;
}
IL_016b:
if (<>7__wrap2 < <>7__wrap1.Length)
{
<>8__1 = new <>c__DisplayClass5_0();
<>8__1.player = <>7__wrap1[<>7__wrap2];
if (CharacterStatModifiersExtension.GetRootData(<>8__1.player).knowledge > 0)
{
<>2__current = GameModeManager.TriggerHook("PlayerPickStart");
<>1__state = 1;
return true;
}
goto IL_0156;
}
<>7__wrap1 = null;
return false;
IL_0156:
<>8__1 = null;
<>7__wrap2++;
goto IL_016b;
}
}
[DebuggerHidden]
void IEnumerator.Reset()
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
throw new NotSupportedException();
}
}
[CompilerGenerated]
private sealed class <PointEnd>d__6 : Object, IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <PointEnd>d__6(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>1__state = -2;
}
private bool MoveNext()
{
if (<>1__state != 0)
{
return false;
}
<>1__state = -1;
Enumerable.ToList<Player>((IEnumerable<Player>)(object)PlayerManager.instance.players).ForEach((Action<Player>)delegate(Player player)
{
CharacterStatModifiersExtension.AjustNulls(player.data.stats, CharacterStatModifiersExtension.GetRootData(player).nullsPerPoint);
});
return false;
}
[DebuggerHidden]
void IEnumerator.Reset()
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
throw new NotSupportedException();
}
}
private const string ModId = "Systems.R00t.Nulls";
private const string ModName = "Nulled Cards";
public const string Version = "1.1.0";
private void Awake()
{
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
new Harmony("Systems.R00t.Nulls").PatchAll();
Core.RegesterCards(AssetUtils.LoadAssetBundleFromResources("nullcardassets", typeof(Main).Assembly).LoadAsset<GameObject>("Nulled").GetComponent<CardList>(), false);
}
private void Start()
{
NullManager.instance.RegesterOnAddCallback((Action<NullCardInfo, Player>)OnNullAdd);
GameModeManager.AddHook("PlayerPickEnd", (Func<IGameModeHandler, IEnumerator>)ExtraPicks);
GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)PointEnd);
}
[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
internal IEnumerator ExtraPicks(IGameModeHandler gm)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return (IEnumerator)(object)new <ExtraPicks>d__5(0);
}
[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
internal IEnumerator PointEnd(IGameModeHandler gm)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return (IEnumerator)(object)new <PointEnd>d__6(0);
}
internal void OnNullAdd(NullCardInfo card, Player player)
{
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
Gun component = ((Component)((Component)player).GetComponent<Holding>().holdable).GetComponent<Gun>();
GunAmmo componentInChildren = ((Component)component).GetComponentInChildren<GunAmmo>();
CharacterData component2 = ((Component)player).GetComponent<CharacterData>();
((Component)player).GetComponent<HealthHandler>();
((Component)player).GetComponent<Gravity>();
Block component3 = ((Component)player).GetComponent<Block>();
CharacterStatModifiers component4 = ((Component)player).GetComponent<CharacterStatModifiers>();
component2.maxHealth *= CharacterStatModifiersExtension.GetRootData(component4).nullData.Health_multiplier;
component4.movementSpeed *= CharacterStatModifiersExtension.GetRootData(component4).nullData.MovmentSpeed_multiplier;
component4.lifeSteal += CharacterStatModifiersExtension.GetRootData(component4).nullData.Lifesteal;
component3.cdMultiplier *= CharacterStatModifiersExtension.GetRootData(component4).nullData.block_cdMultiplier;
component.damage *= CharacterStatModifiersExtension.GetRootData(component4).nullData.Damage_multiplier;
component.reflects += CharacterStatModifiersExtension.GetRootData(component4).nullData.gun_Reflects;
componentInChildren.maxAmmo += CharacterStatModifiersExtension.GetRootData(component4).nullData.gun_Ammo;
if (RarityUtils.GetRarityData(((CardInfo)card).rarity).relativeRarity <= RarityUtils.GetRarityData((Rarity)2).relativeRarity)
{
component4.respawns += CharacterStatModifiersExtension.GetRootData(component4).nullData.Revives;
}
}
}
public class PowerDistillation : OnAddEffect
{
[CompilerGenerated]
private sealed class <>c__DisplayClass1_0 : Object
{
public Player player;
}
[CompilerGenerated]
private sealed class <>c__DisplayClass1_1 : Object
{
public float time;
public int cardCount;
public CardInfo randomCard;
public <>c__DisplayClass1_0 CS$<>8__locals1;
internal bool <addRandomCards>b__0()
{
time += Time.deltaTime;
if (CS$<>8__locals1.player.data.currentCards.Count <= cardCount && !((Object)(object)CS$<>8__locals1.player.data.currentCards[CS$<>8__locals1.player.data.currentCards.Count - 1] == (Object)(object)randomCard))
{
return time > 5f;
}
return true;
}
}
[CompilerGenerated]
private sealed class <addRandomCards>d__1 : Object, IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public Player player;
private <>c__DisplayClass1_0 <>8__1;
public Gun gun;
public GunAmmo gunAmmo;
public CharacterData data;
public HealthHandler health;
public Gravity gravity;
public Block block;
public CharacterStatModifiers characterStats;
public PowerDistillation <>4__this;
private int <i>5__2;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <addRandomCards>d__1(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>8__1 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
//IL_01bf: Expected O, but got Unknown
int num = <>1__state;
PowerDistillation powerDistillation = <>4__this;
switch (num)
{
default:
return false;
case 0:
<>1__state = -1;
<>8__1 = new <>c__DisplayClass1_0();
<>8__1.player = player;
<>2__current = null;
<>1__state = 1;
return true;
case 1:
<>1__state = -1;
<i>5__2 = 0;
break;
case 2:
<>1__state = -1;
<i>5__2++;
break;
}
if (<i>5__2 < 2)
{
<>c__DisplayClass1_1 CS$<>8__locals0 = new <>c__DisplayClass1_1();
CS$<>8__locals0.CS$<>8__locals1 = <>8__1;
CS$<>8__locals0.randomCard = Cards.instance.NORARITY_GetRandomCardWithCondition(CS$<>8__locals0.CS$<>8__locals1.player, gun, gunAmmo, data, health, gravity, block, characterStats, (Func<CardInfo, Player, Gun, GunAmmo, CharacterData, HealthHandler, Gravity, Block, CharacterStatModifiers, bool>)powerDistillation.condition, 1000);
if ((Object)(object)CS$<>8__locals0.randomCard == (Object)null)
{
CardInfo[] array = Enumerable.ToArray<CardInfo>(Enumerable.Concat<CardInfo>((IEnumerable<CardInfo>)(object)Enumerable.ToList<CardInfo>((IEnumerable<CardInfo>)(object)(ObservableCollection<CardInfo>)typeof(CardManager).GetField("activeCards", (BindingFlags)40).GetValue((object)null)), (IEnumerable<CardInfo>)(object)(List<CardInfo>)typeof(CardManager).GetField("inactiveCards", (BindingFlags)40).GetValue((object)null)));
CS$<>8__locals0.randomCard = Cards.instance.DrawRandomCardWithCondition(array, CS$<>8__locals0.CS$<>8__locals1.player, (Gun)null, (GunAmmo)null, (CharacterData)null, (HealthHandler)null, (Gravity)null, (Block)null, (CharacterStatModifiers)null, (Func<CardInfo, Player, Gun, GunAmmo, CharacterData, HealthHandler, Gravity, Block, CharacterStatModifiers, bool>)powerDistillation.condition, 1000);
}
CS$<>8__locals0.cardCount = Enumerable.Count<CardInfo>((IEnumerable<CardInfo>)(object)CS$<>8__locals0.CS$<>8__locals1.player.data.currentCards);
UtilityExtenions.GiveCard(CS$<>8__locals0.CS$<>8__locals1.player, CS$<>8__locals0.randomCard);
CS$<>8__locals0.time = 0f;
<>2__current = (object)new WaitUntil((Func<bool>)delegate
{
CS$<>8__locals0.time += Time.deltaTime;
return CS$<>8__locals0.CS$<>8__locals1.player.data.currentCards.Count > CS$<>8__locals0.cardCount || (Object)(object)CS$<>8__locals0.CS$<>8__locals1.player.data.currentCards[CS$<>8__locals0.CS$<>8__locals1.player.data.currentCards.Count - 1] == (Object)(object)CS$<>8__locals0.randomCard || CS$<>8__locals0.time > 5f;
});
<>1__state = 2;
return true;
}
return false;
}
[DebuggerHidden]
void IEnumerator.Reset()
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
throw new NotSupportedException();
}
}
public override void OnAdd(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
((MonoBehaviour)Core.instance).StartCoroutine(addRandomCards(player, gun, gunAmmo, data, health, gravity, block, characterStats));
}
[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
public IEnumerator addRandomCards(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return (IEnumerator)(object)new <addRandomCards>d__1(0)
{
<>4__this = this,
player = player,
gun = gun,
gunAmmo = gunAmmo,
data = data,
health = health,
gravity = gravity,
block = block,
characterStats = characterStats
};
}
public bool condition(CardInfo card, Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Invalid comparison between Unknown and I4
if ((int)card.rarity == 2 && !Enumerable.Any<CardCategory>(Enumerable.Intersect<CardCategory>((IEnumerable<CardCategory>)(object)card.categories, (IEnumerable<CardCategory>)(object)Core.NoLotteryCategories)))
{
return (Object)(object)card != (Object)(object)CardList.GetCardInfo("Integraty");
}
return false;
}
}
}
namespace RootNulledCards.Patches
{
[Serializable]
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
internal class CardChoicePatchIDoEndPick : Object
{
[CompilerGenerated]
private sealed class <>c__DisplayClass0_0 : Object
{
public CardChoice __instance;
internal bool <Prefix>b__0(Player p)
{
return p.playerID == __instance.pickrID;
}
}
[CompilerGenerated]
private sealed class <>c__DisplayClass1_0 : Object
{
public CardChoice __instance;
internal bool <GrabCard>b__0(Player p)
{
return p.playerID == __instance.pickrID;
}
}
[CompilerGenerated]
private sealed class <>c__DisplayClass2_0 : Object
{
public int playerID;
internal bool <GiveNulls>b__0(Player p)
{
return p.playerID == playerID;
}
}
[CompilerGenerated]
private sealed class <GrabCard>d__1 : Object, IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public CardChoice __instance;
public GameObject card;
private <>c__DisplayClass1_0 <>8__1;
public float speed;
private Vector3 <startPos>5__2;
private Vector3 <endPos>5__3;
private float <c2>5__4;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <GrabCard>d__1(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<>8__1 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_00a4: 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_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_00dc: Unknown result type (might be due to invalid IL or missing references)
//IL_00e2: Unknown result type (might be due to invalid IL or missing references)
//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: Unknown result type (might be due to invalid IL or missing references)
//IL_015a: Unknown result type (might be due to invalid IL or missing references)
//IL_0160: Unknown result type (might be due to invalid IL or missing references)
//IL_0165: Unknown result type (might be due to invalid IL or missing references)
//IL_016a: Unknown result type (might be due to invalid IL or missing references)
//IL_016d: Unknown result type (might be due to invalid IL or missing references)
//IL_0177: Unknown result type (might be due to invalid IL or missing references)
//IL_017c: Unknown result type (might be due to invalid IL or missing references)
switch (<>1__state)
{
default:
return false;
case 0:
<>1__state = -1;
<>8__1 = new <>c__DisplayClass1_0();
<>8__1.__instance = __instance;
if (PlayerManager.instance.players.Find((Predicate<Player>)((Player p) => p.playerID == <>8__1.__instance.pickrID)).data.view.IsMine)
{
card.GetComponentInChildren<ApplyCardStats>().Pick(<>8__1.__instance.pickrID, false, <>8__1.__instance.pickerType);
}
<startPos>5__2 = card.transform.position;
<endPos>5__3 = ((Component)CardChoiceVisuals.instance).transform.position;
<c2>5__4 = 0f;
break;
case 1:
<>1__state = -1;
break;
}
if (<c2>5__4 < 1f)
{
CardChoiceVisuals.instance.framesToSnap = 1;
Vector3 position = Vector3.LerpUnclamped(<startPos>5__2, <endPos>5__3, <>8__1.__instance.curve.Evaluate(<c2>5__4));
card.transform.position = position;
<c2>5__4 += Time.deltaTime * speed;
<>2__current = null;
<>1__state = 1;
return true;
}
Vector3 val = <startPos>5__2 - <endPos>5__3;
GamefeelManager.GameFeel(Vector2.op_Implicit(((Vector3)(ref val)).normalized * 2f));
card.GetComponentInChildren<CardVisuals>().Leave();
card.GetComponentInChildren<CardVisuals>().Pick();
return false;
}
[DebuggerHidden]
void IEnumerator.Reset()
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
throw new NotSupportedException();
}
}
public static void Prefix(CardChoice __instance, ref List<GameObject> ___spawnedCards, ref GameObject pickedCard, ref float ___speed)
{
<>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0();
CS$<>8__locals0.__instance = __instance;
if ((Object)(object)pickedCard == (Object)null || !((Object)(object)pickedCard.GetComponent<DistillAcquisition>() != (Object)null))
{
return;
}
for (int i = 0; i < ___spawnedCards.Count; i++)
{
if (Object.op_Implicit((Object)(object)___spawnedCards[i]) && (Object)(object)___spawnedCards[i].gameObject != (Object)(object)pickedCard)
{
((MonoBehaviour)CS$<>8__locals0.__instance).StartCoroutine(GrabCard(___spawnedCards[i], ___speed, CS$<>8__locals0.__instance));
}
}
if (PlayerManager.instance.players.Find((Predicate<Player>)((Player p) => p.playerID == CS$<>8__locals0.__instance.pickrID)).data.view.IsMine)
{
NetworkingManager.RPC(typeof(CardChoicePatchIDoEndPick), "GiveNulls", (object[])(object)new Object[2]
{
(object)CS$<>8__locals0.__instance.pickrID,
(object)(___spawnedCards.Count - 1)
});
}
___spawnedCards.Clear();
___spawnedCards.Add(pickedCard);
}
[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
private static IEnumerator GrabCard(GameObject card, float speed, CardChoice __instance)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return (IEnumerator)(object)new <GrabCard>d__1(0)
{
card = card,
speed = speed,
__instance = __instance
};
}
[UnboundRPC]
public static void GiveNulls(int playerID, int amount)
{
<>c__DisplayClass2_0 CS$<>8__locals0 = new <>c__DisplayClass2_0();
CS$<>8__locals0.playerID = playerID;
CharacterStatModifiersExtension.AjustNulls(PlayerManager.instance.players.Find((Predicate<Player>)((Player p) => p.playerID == CS$<>8__locals0.playerID)).data.stats, (int)((float)amount * 3.5f));
}
}
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
internal class ApplyCardStatsPatch : Object
{
private static void Postfix(ApplyCardStats __instance, Player ___playerToUpgrade)
{
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
if (CharacterStatModifiersExtension.GetRootData(___playerToUpgrade).knowledge > 0)
{
if (((Component)__instance).GetComponent<CardInfo>().sourceCard is NullCardInfo || ((Component)__instance).GetComponent<CardInfo>() is NullCardInfo)
{
CharacterStatModifiersRootData rootData = CharacterStatModifiersExtension.GetRootData(___playerToUpgrade);
rootData.knowledge--;
}
else
{
CharacterStatModifiersExtension.AjustNulls(___playerToUpgrade.data.stats, (int)Mathf.Ceil(0.5f + (float)NullManager.instance.GetNullValue(((Component)__instance).GetComponent<CardInfo>().rarity) * 1.5f));
}
}
}
}
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
public class AllowedCardPatch : Object
{
private static void Postfix(Player player, CardInfo card, ref bool __result, Cards __instance)
{
if (card != null && player != null)
{
if (CharacterStatModifiersExtension.GetRootData(player).knowledge > 0 && (!CardInfoExtension.IsNullable(card) || CardInfoExtension.IsAntiCard(card)))
{
__result = false;
}
if ((Object)(object)card == (Object)(object)CardList.GetCardInfo("Integraty") && !Enumerable.Any<CardInfo>((IEnumerable<CardInfo>)(object)player.data.currentCards, (Func<CardInfo, bool>)((CardInfo c) => c is NullCardInfo)))
{
__result = false;
}
}
}
}
}