using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Bootstrap;
using CardChoiceSpawnUniqueCardPatch.CustomCategories;
using HarmonyLib;
using InControl;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using ModdingUtils.Extensions;
using ModdingUtils.Utils;
using Photon.Pun;
using RSCards.Cards;
using RSCards.Utilities;
using Sonigon;
using UnboundLib;
using UnboundLib.Cards;
using UnboundLib.GameModes;
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: AssemblyVersion("0.0.0.0")]
[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 RSCards
{
public class CardHolder : MonoBehaviour
{
public List<GameObject> Cards;
public List<GameObject> HiddenCards;
public static Dictionary<string, CardInfo> cards = new Dictionary<string, CardInfo>();
internal void RegisterCards()
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0120: 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_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: 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_013e: Unknown result type (might be due to invalid IL or missing references)
//IL_0143: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
Enumerator<GameObject> enumerator = Cards.GetEnumerator();
DateTime utcNow;
try
{
while (enumerator.MoveNext())
{
GameObject current = enumerator.Current;
current.AddComponent<Template>();
if (RSCards.RSClasses && ((Object)current).name == "Twin Scythe")
{
continue;
}
utcNow = DateTime.UtcNow;
if (DateTools.WeekOf(new DateTime(((DateTime)(ref utcNow)).Year, 4, 1)) || !(((Object)current).name == "Repentence"))
{
utcNow = DateTime.UtcNow;
if (!DateTools.WeekOf(new DateTime(((DateTime)(ref utcNow)).Year, 4, 1)) || !(((Object)current).name == "Repentance"))
{
CustomCard.RegisterUnityCard(current, "RSC", current.GetComponent<CardInfo>().cardName, true, (Action<CardInfo>)null);
CustomCardCategories.instance.UpdateAndPullCategoriesFromCard(current.GetComponent<CardInfo>());
cards.Add(current.GetComponent<CardInfo>().cardName, current.GetComponent<CardInfo>());
}
}
}
}
finally
{
((IDisposable)enumerator).Dispose();
}
Enumerator<GameObject> enumerator2 = HiddenCards.GetEnumerator();
try
{
while (enumerator2.MoveNext())
{
GameObject current2 = enumerator2.Current;
current2.AddComponent<Template>();
utcNow = DateTime.UtcNow;
if (DateTools.WeekOf(new DateTime(((DateTime)(ref utcNow)).Year, 4, 1)) || !(((Object)current2).name == "Repen10ce"))
{
CustomCard.RegisterUnityCard(current2, "RSC", current2.GetComponent<CardInfo>().cardName, false, (Action<CardInfo>)null);
CustomCardCategories.instance.UpdateAndPullCategoriesFromCard(current2.GetComponent<CardInfo>());
Cards.instance.AddHiddenCard(current2.GetComponent<CardInfo>());
cards.Add(current2.GetComponent<CardInfo>().cardName, current2.GetComponent<CardInfo>());
}
}
}
finally
{
((IDisposable)enumerator2).Dispose();
}
}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("com.rsmind.rounds.RSCards", "RSCards", "1.4.5")]
[BepInProcess("Rounds.exe")]
public class RSCards : BaseUnityPlugin
{
[CompilerGenerated]
private sealed class <PlayerPickStart>d__10 : Object, IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public IGameModeHandler gm;
public RSCards <>4__this;
private Enumerator<Player> <>s__1;
private Player <player>5__2;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <PlayerPickStart>d__10(int <>1__state)
{
this.<>1__state = <>1__state;
}
[DebuggerHidden]
void IDisposable.Dispose()
{
<player>5__2 = null;
<>1__state = -2;
}
private bool MoveNext()
{
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
if (<>1__state != 0)
{
return false;
}
<>1__state = -1;
<>s__1 = PlayerManager.instance.players.GetEnumerator();
try
{
while (<>s__1.MoveNext())
{
<player>5__2 = <>s__1.Current;
if (((Component)((Component)<player>5__2.data).GetComponent<Holding>().holdable).GetComponent<Gun>().reflects >= 2)
{
CharacterStatModifiersExtension.GetAdditionalData(<player>5__2.data.stats).blacklistedCategories.Remove(RSCardCategories.BounceAbsorptionCategory);
}
else
{
CharacterStatModifiersExtension.GetAdditionalData(<player>5__2.data.stats).blacklistedCategories.Add(RSCardCategories.BounceAbsorptionCategory);
}
if (((Component)<player>5__2).GetComponent<CharacterStatModifiers>().lifeSteal >= 0.5f)
{
CharacterStatModifiersExtension.GetAdditionalData(<player>5__2.data.stats).blacklistedCategories.Remove(RSCardCategories.RepentanceCategory);
}
else
{
CharacterStatModifiersExtension.GetAdditionalData(<player>5__2.data.stats).blacklistedCategories.Add(RSCardCategories.RepentanceCategory);
}
<player>5__2 = null;
}
}
finally
{
((IDisposable)<>s__1).Dispose();
}
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 = "com.rsmind.rounds.RSCards";
private const string ModName = "RSCards";
public const string Version = "1.4.5";
public const string ModInitials = "RSC";
internal static bool RSClasses;
public static bool Debug;
internal static AssetBundle assets;
[field: CompilerGenerated]
[field: DebuggerBrowsable(/*Could not decode attribute arguments.*/)]
public static RSCards instance
{
[CompilerGenerated]
get;
[CompilerGenerated]
private set;
}
private void Awake()
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Expected O, but got Unknown
Harmony val = new Harmony("com.rsmind.rounds.RSCards");
val.PatchAll();
}
private void Start()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
Enumerator<string, PluginInfo> enumerator = Chainloader.PluginInfos.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
if (enumerator.Current.Value.Metadata.GUID == "com.rsmind.rounds.RSClasses")
{
RSClasses = true;
break;
}
}
}
finally
{
((IDisposable)enumerator).Dispose();
}
instance = this;
assets = AssetUtils.LoadAssetBundleFromResources("rscardart", typeof(RSCards).Assembly);
if ((Object)(object)assets == (Object)null)
{
Debug.Log((object)"Failed to load RSCards asset bundle");
}
assets.LoadAsset<GameObject>("CardHolder").GetComponent<CardHolder>().RegisterCards();
GameModeManager.AddHook("PlayerPickStart", (Func<IGameModeHandler, IEnumerator>)PlayerPickStart);
}
[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
private IEnumerator PlayerPickStart(IGameModeHandler gm)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return (IEnumerator)(object)new <PlayerPickStart>d__10(0)
{
<>4__this = this,
gm = gm
};
}
}
internal static class RSCardCategories : Object
{
public static CardCategory BounceAbsorptionCategory = CustomCardCategories.instance.CardCategory("BounceAbsorptionCategory");
public static CardCategory RepentanceCategory = CustomCardCategories.instance.CardCategory("RepentanceCategory");
}
}
namespace RSCards.Utilities
{
internal static class DateTools : Object
{
public static bool DayOf(DateTime holiday)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: 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)
DateTime val = DateTime.UtcNow;
double num = ((DateTime)(ref val)).ToOADate();
val = ((DateTime)(ref holiday)).AddHours(-12.0);
double num2 = ((DateTime)(ref val)).ToOADate();
val = ((DateTime)(ref holiday)).AddHours(36.0);
double num3 = ((DateTime)(ref val)).ToOADate();
return num > num2 && num < num3;
}
public static bool DayOf(DateTime[] holidays)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
for (int i = 0; i < holidays.Length; i++)
{
if (DayOf(holidays[i]))
{
return true;
}
}
return false;
}
public static bool WeekOf(DateTime holiday)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
DateTime val = DateTime.UtcNow;
double num = ((DateTime)(ref val)).ToOADate();
val = ((DateTime)(ref holiday)).AddDays(-6.0);
val = ((DateTime)(ref val)).AddHours(-12.0);
double num2 = ((DateTime)(ref val)).ToOADate();
val = ((DateTime)(ref holiday)).AddDays(6.0);
val = ((DateTime)(ref val)).AddHours(36.0);
double num3 = ((DateTime)(ref val)).ToOADate();
return num > num2 && num < num3;
}
public static bool WeekOf(DateTime[] holidays)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
for (int i = 0; i < holidays.Length; i++)
{
if (WeekOf(holidays[i]))
{
return true;
}
}
return false;
}
public static void DateTest(DateTime testDate)
{
//IL_0001: 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)
if (DayOf(testDate))
{
Debug.Log((object)String.Format("It's {0}/{1} somewhere", (object)((DateTime)(ref testDate)).Month, (object)((DateTime)(ref testDate)).Day));
}
else if (WeekOf(testDate))
{
Debug.Log((object)String.Format("It's the week of {0}/{1} somewhere", (object)((DateTime)(ref testDate)).Month, (object)((DateTime)(ref testDate)).Day));
}
else
{
Debug.Log((object)String.Format("It's not {0}/{1} anywhere", (object)((DateTime)(ref testDate)).Month, (object)((DateTime)(ref testDate)).Day));
}
}
}
}
namespace RSCards.Cards
{
internal class Template : CustomCard
{
public override void SetupCard(CardInfo cardInfo, Gun gun, ApplyCardStats cardStats, CharacterStatModifiers statModifiers, Block block)
{
if (RSCards.Debug)
{
Debug.Log((object)String.Concat("[RSC][Card] ", ((CustomCard)this).GetTitle(), " has been setup."));
}
}
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
if (RSCards.Debug)
{
Debug.Log((object)String.Format("[{0}][Card] {1} has been added to player {2}.", (object)"RSC", (object)((CustomCard)this).GetTitle(), (object)player.playerID));
}
}
public override void OnRemoveCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
if (RSCards.Debug)
{
Debug.Log((object)String.Format("[{0}][Card] {1} has been removed from player {2}.", (object)"RSC", (object)((CustomCard)this).GetTitle(), (object)player.playerID));
}
}
protected override string GetTitle()
{
return "CardName";
}
protected override string GetDescription()
{
return "CardDescription";
}
protected override GameObject GetCardArt()
{
return null;
}
protected override Rarity GetRarity()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (Rarity)0;
}
protected override CardInfoStat[] GetStats()
{
//IL_0009: 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)
//IL_0015: 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_002b: 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_0033: Expected O, but got Unknown
return (CardInfoStat[])(object)new CardInfoStat[1]
{
new CardInfoStat
{
positive = true,
stat = "Effect",
amount = "No",
simepleAmount = (SimpleAmount)0
}
};
}
protected override CardThemeColorType GetTheme()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0005: Unknown result type (might be due to invalid IL or missing references)
return (CardThemeColorType)7;
}
public override string GetModName()
{
return "RSC";
}
}
}
namespace RSCards.MonoBehaviors
{
public class Hitscan_Bullet_Mono : MonoBehaviour
{
private GameObject trail;
private void OnDestroy()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Expected O, but got Unknown
trail.transform.SetPositionAndRotation(((Component)this).transform.position, ((Component)this).transform.rotation);
ExtensionMethods.ExecuteAfterSeconds((MonoBehaviour)(object)RSCards.instance, 2f, (Action)([CompilerGenerated] () =>
{
Object.Destroy((Object)(object)trail);
}));
}
private void Start()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
//IL_0035: 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)
trail = new GameObject("Hitscan_Trail", (Type[])(object)new Type[1] { typeof(TrailRenderer) });
trail.transform.SetPositionAndRotation(((Component)this).transform.position, ((Component)this).transform.rotation);
trail.GetComponent<TrailRenderer>().startWidth = 0.1f;
trail.GetComponent<TrailRenderer>().endWidth = 0.1f;
trail.GetComponent<TrailRenderer>().time = 1f;
((Renderer)trail.GetComponent<TrailRenderer>()).sharedMaterial = RSCards.assets.LoadAsset<Material>("Material");
RayHitReflect componentInParent = ((Component)this).GetComponentInParent<RayHitReflect>();
if (componentInParent != null)
{
componentInParent.reflects = 0;
}
}
private void Update()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
trail.transform.SetPositionAndRotation(((Component)this).transform.position, ((Component)this).transform.rotation);
}
}
public class Mortar_Mono : MonoBehaviour
{
public bool snap;
public bool trigger;
public float rotateSpeed = 1000f;
private SpawnedAttack spawned;
private MoveTransform move;
private float startVelocity;
private bool isOn;
private ProjectileHit hit;
private float c;
private PhotonView view;
private ChildRPC childRPC;
private void OnDestroy()
{
}
private void Start()
{
childRPC = ((Component)this).GetComponentInParent<ChildRPC>();
view = ((Component)this).GetComponentInParent<PhotonView>();
hit = ((Component)this).GetComponentInParent<ProjectileHit>();
move = ((Component)this).GetComponentInParent<MoveTransform>();
spawned = ((Component)this).GetComponentInParent<SpawnedAttack>();
startVelocity = ((Vector3)(ref move.velocity)).magnitude;
((Component)this).GetComponentInParent<SyncProjectile>().active = true;
}
private void Update()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_001f: 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_0070: 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_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: 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_00c7: Unknown result type (might be due to invalid IL or missing references)
//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_00ce: Unknown result type (might be due to invalid IL or missing references)
//IL_00de: Unknown result type (might be due to invalid IL or missing references)
//IL_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
//IL_0143: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: Unknown result type (might be due to invalid IL or missing references)
//IL_0152: Unknown result type (might be due to invalid IL or missing references)
//IL_01a4: Unknown result type (might be due to invalid IL or missing references)
//IL_01ab: 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_01d9: Unknown result type (might be due to invalid IL or missing references)
//IL_01de: Unknown result type (might be due to invalid IL or missing references)
try
{
if (!view.IsMine)
{
return;
}
Vector3 val = Vector3.zero;
if (((PlayerActionSet)spawned.spawner.data.playerActions).Device != null)
{
val = spawned.spawner.data.input.aimDirection;
}
else
{
val = MainCam.instance.cam.ScreenToWorldPoint(Input.mousePosition) - ((Component)this).transform.position;
val.z = 0f;
((Vector3)(ref val)).Normalize();
}
trigger = spawned.spawner.data.weaponHandler.gun.ReadyAmount() < 0.01f;
val += Vector3.Cross(Vector3.forward, val) * move.selectedSpread;
c += TimeHandler.deltaTime;
if (!trigger)
{
return;
}
if (snap)
{
if (spawned.spawner.data.block.blockedThisFrame)
{
move.velocity *= -1f;
((Behaviour)this).enabled = false;
}
}
else if (((Vector3)(ref val)).magnitude > 0.2f && hit.sinceReflect > 2f)
{
move.velocity = Vector3.RotateTowards(move.velocity, ((Vector3)(ref val)).normalized * startVelocity, rotateSpeed * TimeHandler.deltaTime, rotateSpeed * TimeHandler.deltaTime * 10f);
if (c > 0.1f)
{
c = 0f;
}
if (!isOn)
{
MoveTransform obj = move;
obj.simulateGravity++;
}
isOn = true;
}
else
{
if (isOn)
{
MoveTransform obj2 = move;
obj2.simulateGravity--;
}
isOn = false;
}
}
catch (Object)
{
}
}
}
public class Repentence_Mono : MonoBehaviour
{
private void Start()
{
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Unknown result type (might be due to invalid IL or missing references)
Player componentInParent = ((Component)this).GetComponentInParent<Player>();
int num = 0;
Enumerator<CardInfo> enumerator = componentInParent.data.currentCards.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
CardInfo current = enumerator.Current;
if (current.cardName == "Repentence")
{
num++;
}
}
}
finally
{
((IDisposable)enumerator).Dispose();
}
if (num == 9)
{
Cards.instance.AddCardToPlayer(componentInParent, Cards.instance.GetCardWithName("Repen10ce"), false, "", 0f, 0f);
}
}
}
internal class Scythe : MonoBehaviour
{
public bool ableToHit = true;
public bool active = true;
public float damage = 35f;
private Player player;
private Dictionary<int, float> recent = new Dictionary<int, float>();
private GameObject scythe;
private void OnDestroy()
{
Object.Destroy((Object)(object)scythe);
}
private void Start()
{
player = ((Component)this).GetComponentInParent<Player>();
scythe = Object.Instantiate<GameObject>(RSCards.assets.LoadAsset<GameObject>("Scythe"), ((Component)player).transform);
scythe.SetActive(true);
}
public void DoHit()
{
//IL_0024: 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_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_00a4: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: Expected O, but got Unknown
//IL_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_00e8: Unknown result type (might be due to invalid IL or missing references)
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0105: Unknown result type (might be due to invalid IL or missing references)
//IL_012b: Unknown result type (might be due to invalid IL or missing references)
//IL_015e: Unknown result type (might be due to invalid IL or missing references)
//IL_0163: Unknown result type (might be due to invalid IL or missing references)
//IL_016e: Unknown result type (might be due to invalid IL or missing references)
//IL_0173: Unknown result type (might be due to invalid IL or missing references)
//IL_0178: Unknown result type (might be due to invalid IL or missing references)
//IL_017d: Unknown result type (might be due to invalid IL or missing references)
//IL_0181: 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_0197: Unknown result type (might be due to invalid IL or missing references)
//IL_019c: Unknown result type (might be due to invalid IL or missing references)
if (!player.data.view.IsMine)
{
return;
}
float y = ((Component)this).transform.localScale.y;
Collider2D[] array = Physics2D.OverlapCircleAll(Vector2.op_Implicit(scythe.transform.position), y);
Collider2D[] array2 = array;
foreach (Collider2D val in array2)
{
ProjectileHit componentInParent = ((Component)val).gameObject.GetComponentInParent<ProjectileHit>();
Damagable component = ((Component)val).gameObject.GetComponent<Damagable>();
HealthHandler component2 = ((Component)val).gameObject.GetComponent<HealthHandler>();
Vector2 val3;
if (Object.op_Implicit((Object)(object)component2))
{
Player val2 = (Player)ExtensionMethods.GetFieldValue((object)component2, "player");
SoundManager.Instance.PlayAtPosition(component2.soundBounce, ((Component)this).transform, ((Component)component).transform);
val3 = Vector2.op_Implicit(((Component)val2).transform.position) - Vector2.op_Implicit(scythe.transform.position);
component2.CallTakeForce(((Vector2)(ref val3)).normalized * 2500f, (ForceMode2D)1, true, false, 0f);
ableToHit = false;
if (((Component)(Player)ExtensionMethods.GetFieldValue((object)component2, "player")).GetComponent<Block>().blockedThisFrame)
{
continue;
}
}
if (Object.op_Implicit((Object)(object)component))
{
val3 = Vector2.op_Implicit(((Component)component).transform.position) - Vector2.op_Implicit(((Component)this).transform.position);
component.CallTakeDamage(((Vector2)(ref val3)).normalized * damage, Vector2.op_Implicit(((Component)this).transform.position), ((Component)this).gameObject, player, true);
}
if (Object.op_Implicit((Object)(object)componentInParent))
{
componentInParent.deathEvent.Invoke();
Object.Destroy((Object)(object)((Component)componentInParent).gameObject);
}
}
}
public void UpdatePos(double angle, float rotation, float radius)
{
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
double num = angle * Math.PI / 180.0;
Vector3 localPosition = default(Vector3);
((Vector3)(ref localPosition))..ctor((float)((double)radius * Math.Sin(num)), (float)((double)radius * Math.Cos(num)), 0f);
Quaternion rotation2 = default(Quaternion);
((Quaternion)(ref rotation2)).eulerAngles = new Vector3(0f, 0f, rotation);
scythe.transform.localPosition = localPosition;
scythe.transform.rotation = rotation2;
}
public void SetColor(Color color)
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
scythe.GetComponent<SpriteRenderer>().color = color;
}
}
public class TwinScythe_Mono : MonoBehaviour
{
[CompilerGenerated]
private sealed class <PointEnd>d__11 : Object, IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public IGameModeHandler gm;
public TwinScythe_Mono <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <PointEnd>d__11(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;
<>4__this.active = false;
return false;
}
[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 <PointStart>d__10 : Object, IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public IGameModeHandler gm;
public TwinScythe_Mono <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <PointStart>d__10(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;
<>4__this.active = true;
<>4__this.rotation = 0f;
<>4__this.angle = 0.0;
<>4__this.UpdateStats();
return false;
}
[DebuggerHidden]
void IEnumerator.Reset()
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
throw new NotSupportedException();
}
}
private double angle = 0.0;
private float rotation = 0f;
private bool active = false;
private Color color = new Color(0.5f, 0.5f, 0.5f);
private List<Scythe> scythes = new List<Scythe>();
private Player player;
private void Start()
{
player = ((Component)this).GetComponentInParent<Player>();
TwinScythe_Mono[] componentsInChildren = ((Component)player).GetComponentsInChildren<TwinScythe_Mono>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
if (!((Object)(object)componentsInChildren[i] == (Object)(object)this))
{
Object.Destroy((Object)(object)this);
}
}
GameModeManager.AddHook("PointStart", (Func<IGameModeHandler, IEnumerator>)PointStart);
GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)PointEnd);
}
private void FixedUpdate()
{
//IL_00a8: Unknown result type (might be due to invalid IL or missing references)
//IL_00ad: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0145: Unknown result type (might be due to invalid IL or missing references)
//IL_014a: 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_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_0138: Unknown result type (might be due to invalid IL or missing references)
angle += 200f * TimeHandler.deltaTime;
if (angle > 360.0)
{
Enumerator<Scythe> enumerator = scythes.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
Scythe current = enumerator.Current;
current.ableToHit = true;
}
}
finally
{
((IDisposable)enumerator).Dispose();
}
angle -= 360.0;
}
rotation = (rotation - 1200f * TimeHandler.deltaTime) % 360f;
int num = 0;
Enumerator<Scythe> enumerator2 = scythes.GetEnumerator();
try
{
while (enumerator2.MoveNext())
{
Scythe current2 = enumerator2.Current;
double num2 = angle + (double)(360f / (float)Enumerable.Count<Scythe>((IEnumerable<Scythe>)(object)scythes) * (float)num);
current2.UpdatePos(num2, rotation, 2f);
if (active && current2.ableToHit)
{
current2.DoHit();
}
if (current2.ableToHit)
{
Color val = color;
val.a = 1f;
current2.SetColor(val);
}
else
{
Color val2 = color;
val2.a = 0.5f;
current2.SetColor(val2);
}
num++;
}
}
finally
{
((IDisposable)enumerator2).Dispose();
}
}
public void UpdateStats()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Expected O, but got Unknown
color = player.GetTeamColors().color;
int num = 0;
Enumerator<CardInfo> enumerator = player.data.currentCards.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
CardInfo current = enumerator.Current;
if ((Object)(object)current == (Object)(object)CardHolder.cards["Twin Scythe"])
{
num++;
}
}
}
finally
{
((IDisposable)enumerator).Dispose();
}
num = Math.Min(num, 4);
while (Enumerable.Count<Scythe>((IEnumerable<Scythe>)(object)scythes) < num)
{
GameObject val = new GameObject("Scythe", (Type[])(object)new Type[1] { typeof(Scythe) });
val.transform.SetParent(((Component)player).transform);
scythes.Add(val.GetComponent<Scythe>());
}
while (Enumerable.Count<Scythe>((IEnumerable<Scythe>)(object)scythes) > Math.Max(num, 0))
{
Object.Destroy((Object)(object)scythes[0]);
scythes.Remove(scythes[0]);
}
}
private void OnDestroy()
{
GameModeManager.RemoveHook("PointStart", (Func<IGameModeHandler, IEnumerator>)PointStart);
GameModeManager.RemoveHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)PointEnd);
while (Enumerable.Count<Scythe>((IEnumerable<Scythe>)(object)scythes) > 0)
{
Object.Destroy((Object)(object)scythes[0]);
scythes.Remove(scythes[0]);
}
}
[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
private IEnumerator PointStart(IGameModeHandler gm)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return (IEnumerator)(object)new <PointStart>d__10(0)
{
<>4__this = this,
gm = gm
};
}
[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
private IEnumerator PointEnd(IGameModeHandler gm)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return (IEnumerator)(object)new <PointEnd>d__11(0)
{
<>4__this = this,
gm = gm
};
}
}
}