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 System.Security;
using System.Security.Permissions;
using BepInEx;
using CardChoiceSpawnUniqueCardPatch.CustomCategories;
using HarmonyLib;
using Jotunn.Utils;
using Microsoft.CodeAnalysis;
using ModdingUtils.MonoBehaviours;
using ModdingUtils.Utils;
using Photon.Pun;
using PickPhaseImprovements;
using RootCore;
using RootCore.ArtStuffs;
using RootCore.CardConditions;
using UnboundLib;
using UnboundLib.Cards;
using UnboundLib.GameModes;
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("1.1.6.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 RootAdvancedCards
{
internal class AntiJump : ReversibleEffect
{
private bool pressed = false;
private bool fliped = false;
private float grounded = 0.25f;
private float lastY = 0f;
public override void OnStart()
{
((ReversibleEffect)this).OnStart();
((ReversibleEffect)this).SetLivesToEffect(2147483647);
base.gravityModifier.gravityForce_mult = -1f;
base.gunStatModifier.gravity_mult = -1f;
}
public override void OnUpdate()
{
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
//IL_0162: Unknown result type (might be due to invalid IL or missing references)
if (Math.Round((double)lastY, 1) == Math.Round((double)((Component)base.player).gameObject.transform.position.y, 1))
{
grounded -= Time.deltaTime;
}
else
{
grounded = 0.5f;
}
if (grounded <= 0f)
{
Core.Debug((object)"auto flipping!");
if (fliped)
{
((ReversibleEffect)this).ClearModifiers(true);
}
else
{
((ReversibleEffect)this).ApplyModifiers();
}
grounded = 0.5f;
fliped = !fliped;
base.player.data.jump.Jump(true, 2f);
}
if (base.data.input.jumpIsPressed)
{
if (!pressed)
{
if (fliped)
{
((ReversibleEffect)this).ClearModifiers(true);
}
else
{
((ReversibleEffect)this).ApplyModifiers();
}
fliped = !fliped;
base.player.data.jump.Jump(true, 1f);
}
pressed = true;
}
else
{
pressed = false;
}
lastY = ((Component)base.player).gameObject.transform.position.y;
}
}
public class CakeRestrictions : Object
{
public static string[] cakes = (string[])(object)new String[10] { "Cake_Trinket", "Cake_Common", "Cake_Scarce", "Cake_Uncommon", "Cake_Exotic", "Cake_Rare", "Cake_Epic", "Cake_Legendary", "Cake_Mythical", "Cake_Divine" };
public static bool CanHaveCake(Player player, RootCardInfo Cake)
{
if (!Cake.Key.Contains("Cake_"))
{
return true;
}
if (player == null)
{
return false;
}
int num = Enumerable.Count<CardInfo>(Enumerable.Where<CardInfo>((IEnumerable<CardInfo>)(object)player.data.currentCards, (Func<CardInfo, bool>)delegate(CardInfo card)
{
RootCardInfo val = (RootCardInfo)(object)((card is RootCardInfo) ? card : null);
return val != null && val.Key.StartsWith("Cake_");
}));
return UtilityExtenions.IndexOf((Array)(object)cakes, (object)Cake.Key) - 3 < num;
}
}
public class dewish : CustomCard
{
public override void OnAddCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
}
public override void OnReassignCard(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
CharacterStatModifiersRootData rootData = CharacterStatModifiersExtension.GetRootData(characterStats);
rootData.freeCards--;
}
protected override GameObject GetCardArt()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
throw new NotImplementedException();
}
protected override string GetDescription()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
throw new NotImplementedException();
}
protected override Rarity GetRarity()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
throw new NotImplementedException();
}
protected override CardInfoStat[] GetStats()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
throw new NotImplementedException();
}
protected override CardThemeColorType GetTheme()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
throw new NotImplementedException();
}
protected override string GetTitle()
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
throw new NotImplementedException();
}
}
public class GiveGrizzly : MonoBehaviour
{
[Serializable]
[CompilerGenerated]
private sealed class <>c : Object
{
public static readonly <>c <>9 = new <>c();
public static Action <>9__0_0;
internal void <Start>b__0_0()
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
List<Player> val = Enumerable.ToList<Player>((IEnumerable<Player>)(object)PlayerManager.instance.players);
Enumerator<Player> enumerator = val.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
Player current = enumerator.Current;
if (GameModeManager.CurrentHandler.GetTeamScore(current.teamID).rounds == 0)
{
UtilityExtenions.GiveCard(current, "Grizzly");
}
}
}
finally
{
((IDisposable)enumerator).Dispose();
}
}
}
private void Start()
{
//IL_001b: 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_0026: Expected O, but got Unknown
Core instance = Core.instance;
object obj = <>c.<>9__0_0;
if (obj == null)
{
Action val = delegate
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
List<Player> val2 = Enumerable.ToList<Player>((IEnumerable<Player>)(object)PlayerManager.instance.players);
Enumerator<Player> enumerator = val2.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
Player current = enumerator.Current;
if (GameModeManager.CurrentHandler.GetTeamScore(current.teamID).rounds == 0)
{
UtilityExtenions.GiveCard(current, "Grizzly");
}
}
}
finally
{
((IDisposable)enumerator).Dispose();
}
};
<>c.<>9__0_0 = val;
obj = (object)val;
}
ExtensionMethods.ExecuteAfterFrames((MonoBehaviour)(object)instance, 2, (Action)obj);
}
}
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("Systems.R00t.Advanced", "Root Advanced Cards", "1.1.6")]
[BepInProcess("Rounds.exe")]
public class Main : BaseUnityPlugin
{
[CompilerGenerated]
private sealed class <GameStart>d__5 : Object, IEnumerator<object>, IEnumerator, IDisposable
{
private int <>1__state;
private object <>2__current;
public IGameModeHandler gm;
public Main <>4__this;
object IEnumerator<object>.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
object IEnumerator.Current
{
[DebuggerHidden]
get
{
return <>2__current;
}
}
[DebuggerHidden]
public <GameStart>d__5(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;
Oroboros.oroboros = 1;
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.Advanced";
private const string ModName = "Root Advanced Cards";
public const string Version = "1.1.6";
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("Systems.R00t.Advanced");
val.PatchAll();
AssetBundle val2 = AssetUtils.LoadAssetBundleFromResources("advancedassets", typeof(Main).Assembly);
Core.RegesterCards(val2.LoadAsset<GameObject>("Advanced").GetComponent<CardList>(), false);
val2.LoadAsset<GameObject>("AdvancedPhotonPool").GetComponent<PhotonPool>().Regester();
}
private void Start()
{
Cards.instance.AddCardValidationFunction((Func<Player, CardInfo, bool>)delegate(Player player, CardInfo cardinfo)
{
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
if (UtilityExtenions.HasCard(player, "Simulacrum"))
{
if (!cardinfo.allowMultiple || PickManager.ShuffleCards.ContainsKey(cardinfo) || Enumerable.Any<CardCategory>(Enumerable.Intersect<CardCategory>((IEnumerable<CardCategory>)(object)cardinfo.categories, (IEnumerable<CardCategory>)(object)new CardCategory[3]
{
CustomCardCategories.instance.CardCategory("GearUp_Card-Shuffle"),
CustomCardCategories.instance.CardCategory("CardManipulation"),
CustomCardCategories.instance.CardCategory("NoPreGamePick")
})))
{
return false;
}
if (cardinfo.rarity == RootCardInfo.GetRarity((CardRarity)10))
{
return false;
}
}
return true;
});
PickManager.RegisterDrawValidationFunction((Func<CardInfo[], CardInfo, ValidationResult>)delegate(CardInfo[] hand, CardInfo card)
{
//IL_006a: Unknown result type (might be due to invalid IL or missing references)
//IL_006e: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
RootCardInfo val = (RootCardInfo)(object)((card is RootCardInfo) ? card : null);
if (val != null && val.Key.StartsWith("Cake_"))
{
foreach (CardInfo val2 in hand)
{
RootCardInfo val3 = (RootCardInfo)(object)((val2 is RootCardInfo) ? val2 : null);
if (val3 != null && val3.Key.StartsWith("Cake_"))
{
return (ValidationResult)1;
}
}
}
return (ValidationResult)0;
});
GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)GameStart);
CardStatVarHandler.VarMap.Add("Ourobors", (Func<GameObject, string>)((GameObject go) => String.Format("{0}", (object)(Oroboros.oroboros * 10))));
}
[IteratorStateMachine(/*Could not decode attribute arguments.*/)]
internal IEnumerator GameStart(IGameModeHandler gm)
{
//yield-return decompiler failed: Unexpected instruction in Iterator.Dispose()
return (IEnumerator)(object)new <GameStart>d__5(0)
{
<>4__this = this,
gm = gm
};
}
}
public class Oroboros : OnAddEffect
{
internal static int oroboros = 1;
public override void OnAdd(Player player, Gun gun, GunAmmo gunAmmo, CharacterData data, HealthHandler health, Gravity gravity, Block block, CharacterStatModifiers characterStats)
{
CharacterStatModifiersRootData rootData = CharacterStatModifiersExtension.GetRootData(characterStats);
rootData.flatProjectileDamage += (float)(10 * oroboros);
CharacterStatModifiersRootData rootData2 = CharacterStatModifiersExtension.GetRootData(characterStats);
rootData2.flatHPboost += (float)(10 * oroboros);
}
}
internal class WitchTime : ReversibleEffect
{
public float time_remaning;
private bool running;
public override void OnStart()
{
((ReversibleEffect)this).OnStart();
base.characterStatModifiersModifier.movementSpeed_mult = 2f;
base.gravityModifier.gravityForce_mult = 4f;
base.characterStatModifiersModifier.jump_mult = 1.6f;
base.gunStatModifier.projectielSimulatonSpeed_mult = 2f;
base.gunAmmoStatModifier.reloadTimeMultiplier_mult = 0.5f;
base.gunStatModifier.attackSpeed_mult = 2f;
base.blockModifier.cdMultiplier_mult = 2f;
base.blockModifier.cdAdd_mult = 2f;
time_remaning = CharacterStatModifiersExtension.GetRootData(base.player).witchTimeDuration;
TimeHandler instance = TimeHandler.instance;
instance.baseTimeScale /= 2f;
((ReversibleEffect)this).ApplyModifiers();
running = true;
}
public override void OnUpdate()
{
((ReversibleEffect)this).OnUpdate();
if (running)
{
Core.Debug((object)time_remaning);
if (time_remaning < 0f)
{
((ReversibleEffect)this).Destroy();
}
time_remaning -= Time.deltaTime;
}
}
public override void OnOnDisable()
{
((ReversibleEffect)this).OnOnDisable();
((ReversibleEffect)this).Destroy();
}
public override void OnOnDestroy()
{
((ReversibleEffect)this).OnOnDestroy();
TimeHandler.instance.baseTimeScale = Mathf.Clamp(TimeHandler.instance.baseTimeScale * 2f, 0f, 0.85f);
}
}
}
namespace RootAdvancedCards.Square
{
public class SquarePlayer : MonoBehaviour
{
public enum botState : Enum
{
defense,
aggro,
passive
}
public enum difficulty : Enum
{
easy,
medium,
hard,
godmode
}
private class Danger : MonoBehaviour
{
}
public GameObject boundsMarker;
[HideInInspector]
public difficulty currentDifficulty = difficulty.godmode;
private botState currentState;
private bool panic;
public bool botCanMove;
public bool botCanFire;
public bool canFire;
public bool canMove = true;
public bool canLookJump = true;
private Rigidbody2D rig;
private float speed = 1500f;
private float jumpHeight = 1000f;
[HideInInspector]
public float life = 100f;
public int team;
private float lifeTime;
private float jumpTime;
private float jumpCD;
[HideInInspector]
public bool bot;
[HideInInspector]
public bool zombie;
[HideInInspector]
public bool freeAim = true;
public AudioClip jump;
public AudioClip damageSound;
public AudioSource myAudioSource;
private float cd1 = 10f;
private float cd2 = 10f;
[HideInInspector]
public float CD1;
[HideInInspector]
public float CD2;
[HideInInspector]
public float CDAim = 0.5f;
private float extraCD1;
private float extraCD2;
private bool overHeat1;
private bool overHeat2;
private float overHeatAmount1;
private float overHeatAmount2;
[HideInInspector]
public float pushback1;
[HideInInspector]
public float pushback2;
public bool follow1;
public bool follow2;
public Transform aim;
public Transform lifeBox;
[HideInInspector]
public string fire1;
[HideInInspector]
public string fire2;
[HideInInspector]
public Color color;
private float thresh = 0.4f;
private int aimInt;
private int attacker;
private int storedAimInt;
private Vector2 attackDirr = new Vector2(0f, 0f);
private bool healthReg;
private int playerNumber;
private int blinkCounter;
[HideInInspector]
public string v;
[HideInInspector]
public string vc;
[HideInInspector]
public string c;
[HideInInspector]
public string h;
[HideInInspector]
public string s1;
[HideInInspector]
public string s2;
private float damageColor;
private bool dead;
private float botChangeAim;
private float degrees;
[HideInInspector]
public GameObject[] targetPoints;
private Vector3 currentTargetPoint;
[HideInInspector]
public Transform otherPlayer;
private float sightThreshold;
private float sightCounter;
private float targetSwitchTime = 4f;
private int previousCollider = -1;
private RaycastHit2D hitPlayer;
private int m_startHealth;
private int m_healthRegSpeed;
private float m_healthHitTimer;
[HideInInspector]
public Transform point;
public LayerMask mapMask;
public LayerMask playerMask;
public LayerMask myMask;
public LayerMask projectilePlayerMask;
public LayerMask safeMask;
private Danger[] dangers;
private RaycastHit2D rightHit;
private RaycastHit2D leftHit;
private RaycastHit2D upHit;
private RaycastHit2D downHit;
private RaycastHit2D voidCheck;
private bool directionRight;
private float botDodgeTimer = 0.4f;
private float botStateUpdate = 1f;
private float botStartTimer;
private bool timeToFire;
private float timeToSwitchFire = 3f;
private int dif;
private float freezeTime;
private float extraDamageShake;
private float shootRand;
private float posCheckCounter;
private Vector3 lastCheckPos;
private bool canFireAgain1 = true;
private bool canFireAgain2 = true;
private bool auto1 = true;
private bool auto2 = true;
private int ammo1 = -1;
private int ammo2 = -1;
private int currentAmmo1 = 10;
private int currentAmmo2 = 10;
private void Awake()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
boundsMarker.GetComponentInChildren<SpriteRenderer>().color = color;
boundsMarker.SetActive(false);
lastCheckPos = ((Component)this).transform.position;
shootRand = Random.Range(0.75f, 1f);
if (bot)
{
switch (currentDifficulty)
{
case difficulty.easy:
sightThreshold = 1f;
break;
case difficulty.medium:
sightThreshold = 0.6f;
break;
case difficulty.hard:
sightThreshold = 0.2f;
break;
case difficulty.godmode:
sightThreshold = 0f;
break;
}
currentTargetPoint = new Vector3((float)Random.Range(-10, 10), (float)Random.Range(-7, 7), 0f);
GameObject[] array = GameObject.FindGameObjectsWithTag("player");
int num = 0;
GameObject[] array2 = array;
GameObject[] array3 = array2;
foreach (GameObject val in array3)
{
if ((Object)(object)val.transform != (Object)(object)((Component)this).transform && Object.op_Implicit((Object)(object)val.GetComponent<SquarePlayer>()))
{
num++;
}
}
if (zombie)
{
currentState = botState.aggro;
}
}
m_startHealth = (int)life;
}
public void initializeBot()
{
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_005c: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: 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_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_00df: Unknown result type (might be due to invalid IL or missing references)
//IL_00e4: Unknown result type (might be due to invalid IL or missing references)
projectilePlayerMask = LayerMask.op_Implicit(~(1 << ((Component)this).gameObject.layer));
string[] array = (string[])(object)new String[4] { "team1", "team2", "team3", "team4" };
LayerMask val = LayerMask.op_Implicit(LayerMask.GetMask(array));
projectilePlayerMask = LayerMask.op_Implicit(LayerMask.op_Implicit(projectilePlayerMask) & LayerMask.op_Implicit(val));
myMask = LayerMask.op_Implicit(~(1 << ((Component)this).gameObject.layer));
string[] array2 = (string[])(object)new String[6] { "team1", "team2", "team3", "team4", "map", "mapMove" };
LayerMask val2 = LayerMask.op_Implicit(LayerMask.GetMask(array2));
myMask = LayerMask.op_Implicit(LayerMask.op_Implicit(myMask) & LayerMask.op_Implicit(val2));
}
private void Start()
{
Debug.Log((object)Camera.main.pixelWidth);
rig = ((Component)this).gameObject.GetComponent<Rigidbody2D>();
((Object)((Component)this).gameObject).name = ((Object)((Component)this).gameObject).name.Replace("(Clone)", String.Empty);
dif = (int)(currentDifficulty + 1);
if (fire1 == "katana" || fire1 == "cubeShot")
{
overHeat1 = true;
if (fire1 == "katana")
{
overHeatAmount1 = 0.05f;
}
else
{
overHeatAmount1 = 0.02f;
}
}
if (fire2 == "katana" || fire2 == "cubeShot")
{
overHeat2 = true;
if (fire2 == "katana")
{
overHeatAmount2 = 0.05f;
}
else
{
overHeatAmount2 = 0.02f;
}
}
if (fire1 == "katana")
{
auto1 = false;
}
if (fire2 == "katana")
{
auto2 = false;
}
if (fire1 == "revolver")
{
auto1 = false;
ammo1 = 6;
currentAmmo1 = ammo1;
}
if (fire2 == "revolver")
{
auto2 = false;
ammo2 = 6;
currentAmmo2 = ammo2;
}
}
private void displayBoundsMarker()
{
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: 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_0056: 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_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
//IL_0264: Unknown result type (might be due to invalid IL or missing references)
//IL_019d: Unknown result type (might be due to invalid IL or missing references)
//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
//IL_01ac: Unknown result type (might be due to invalid IL or missing references)
//IL_01bc: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_035f: Unknown result type (might be due to invalid IL or missing references)
//IL_029c: Unknown result type (might be due to invalid IL or missing references)
//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
//IL_02b3: Unknown result type (might be due to invalid IL or missing references)
//IL_01cf: Unknown result type (might be due to invalid IL or missing references)
//IL_0465: Unknown result type (might be due to invalid IL or missing references)
//IL_0488: Unknown result type (might be due to invalid IL or missing references)
//IL_038e: Unknown result type (might be due to invalid IL or missing references)
//IL_0393: Unknown result type (might be due to invalid IL or missing references)
//IL_03a8: Unknown result type (might be due to invalid IL or missing references)
//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
//IL_0100: 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_03bb: Unknown result type (might be due to invalid IL or missing references)
//IL_01f9: Unknown result type (might be due to invalid IL or missing references)
//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
//IL_012f: Unknown result type (might be due to invalid IL or missing references)
//IL_02ef: Unknown result type (might be due to invalid IL or missing references)
//IL_02e3: Unknown result type (might be due to invalid IL or missing references)
//IL_0225: Unknown result type (might be due to invalid IL or missing references)
//IL_03e4: Unknown result type (might be due to invalid IL or missing references)
//IL_03d8: Unknown result type (might be due to invalid IL or missing references)
//IL_031e: Unknown result type (might be due to invalid IL or missing references)
//IL_0413: Unknown result type (might be due to invalid IL or missing references)
if (!boundsMarker.activeInHierarchy)
{
boundsMarker.SetActive(true);
}
Vector3 val = Camera.main.WorldToScreenPoint(((Component)this).transform.position);
float num = 1f;
float num2 = 2f;
float num3 = 0f;
float num4 = 0f;
int num5 = 0;
if (val.x > (float)Camera.main.pixelWidth)
{
num3 = Camera.main.ScreenToWorldPoint(new Vector3((float)Camera.main.pixelWidth, ((Component)this).transform.position.y)).x - num;
num5 = 180;
if (val.y < (float)Camera.main.pixelHeight && val.y > 0f)
{
num4 = ((Component)this).transform.position.y;
Debug.Log(String.Concat("yPos set to: ", ((Single)(ref num4)).ToString()));
}
if (val.y > (float)Camera.main.pixelHeight)
{
num5 = 135;
Debug.Log("A");
}
else if (val.y < 0f)
{
num5 = 225;
Debug.Log("B");
}
Debug.Log(String.Concat("xPOsRIGHT set to: ", ((Single)(ref num3)).ToString()));
}
else if (val.x <= 0f)
{
num3 = Camera.main.ScreenToWorldPoint(new Vector3(0f, ((Component)this).transform.position.y)).x + num;
num5 = 0;
if (val.y < (float)Camera.main.pixelHeight && val.y > 0f)
{
num4 = ((Component)this).transform.position.y;
}
if (val.y > (float)Camera.main.pixelHeight)
{
num5 = 45;
Debug.Log("A");
}
else if (val.y < 0f)
{
num5 = 315;
Debug.Log("B");
}
Debug.Log(String.Concat("xPOsLEFT set to: ", ((Single)(ref num3)).ToString()));
}
if (val.y > (float)Camera.main.pixelHeight)
{
num4 = Camera.main.ScreenToWorldPoint(new Vector3((float)Camera.main.pixelWidth, (float)Camera.main.pixelHeight)).y - num;
num5 = 90;
if (val.x < (float)Camera.main.pixelWidth && val.x > 0f)
{
num3 = ((Component)this).transform.position.x;
}
if (val.x > (float)Camera.main.pixelWidth)
{
num5 = 135;
Debug.Log("A");
}
else if (val.x < 0f)
{
num5 = 45;
Debug.Log("B");
}
Debug.Log(String.Concat("yPOsUP set to: ", ((Single)(ref num4)).ToString()));
}
else if (val.y <= 0f)
{
num4 = Camera.main.ScreenToWorldPoint(new Vector3((float)Camera.main.pixelWidth, 0f)).y + num;
num5 = 270;
if (val.x < (float)Camera.main.pixelWidth && val.x > 0f)
{
num3 = ((Component)this).transform.position.x;
}
if (val.x > (float)Camera.main.pixelWidth)
{
num5 = 225;
Debug.Log("A");
}
else if (val.x < 0f)
{
num5 = 315;
Debug.Log("B");
}
Debug.Log(String.Concat("yPOsDOWN set to: ", ((Single)(ref num4)).ToString()));
}
boundsMarker.transform.position = new Vector3(num3, num4, 0f);
boundsMarker.transform.rotation = Quaternion.Euler(0f, 180f, (float)num5);
}
private void checkBoundaries()
{
//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)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
Vector3 val = Camera.main.WorldToScreenPoint(((Component)this).transform.position);
if (val.x < 0f || val.x > (float)Camera.main.pixelWidth || val.y > (float)Camera.main.pixelHeight || val.y < 0f)
{
displayBoundsMarker();
}
else if (boundsMarker.activeInHierarchy)
{
boundsMarker.SetActive(false);
}
}
private void Update()
{
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_028c: Unknown result type (might be due to invalid IL or missing references)
//IL_1064: Unknown result type (might be due to invalid IL or missing references)
//IL_106c: Unknown result type (might be due to invalid IL or missing references)
//IL_106e: Unknown result type (might be due to invalid IL or missing references)
//IL_1072: Unknown result type (might be due to invalid IL or missing references)
//IL_0fcd: Unknown result type (might be due to invalid IL or missing references)
//IL_11a7: Unknown result type (might be due to invalid IL or missing references)
//IL_1182: Unknown result type (might be due to invalid IL or missing references)
//IL_10e2: Unknown result type (might be due to invalid IL or missing references)
//IL_0383: Unknown result type (might be due to invalid IL or missing references)
//IL_0388: Unknown result type (might be due to invalid IL or missing references)
//IL_038d: Unknown result type (might be due to invalid IL or missing references)
//IL_0398: 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_03a7: Unknown result type (might be due to invalid IL or missing references)
//IL_03b3: Unknown result type (might be due to invalid IL or missing references)
//IL_03b8: Unknown result type (might be due to invalid IL or missing references)
//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
//IL_03c2: Unknown result type (might be due to invalid IL or missing references)
//IL_03cd: Unknown result type (might be due to invalid IL or missing references)
//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
//IL_03dc: Unknown result type (might be due to invalid IL or missing references)
//IL_03e8: Unknown result type (might be due to invalid IL or missing references)
//IL_03ed: Unknown result type (might be due to invalid IL or missing references)
//IL_03f2: Unknown result type (might be due to invalid IL or missing references)
//IL_03fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0407: Unknown result type (might be due to invalid IL or missing references)
//IL_040c: Unknown result type (might be due to invalid IL or missing references)
//IL_0418: Unknown result type (might be due to invalid IL or missing references)
//IL_041d: Unknown result type (might be due to invalid IL or missing references)
//IL_0422: Unknown result type (might be due to invalid IL or missing references)
//IL_0427: Unknown result type (might be due to invalid IL or missing references)
//IL_0432: Unknown result type (might be due to invalid IL or missing references)
//IL_043c: Unknown result type (might be due to invalid IL or missing references)
//IL_0441: 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_0376: Unknown result type (might be due to invalid IL or missing references)
//IL_0a96: Unknown result type (might be due to invalid IL or missing references)
//IL_0a9b: Unknown result type (might be due to invalid IL or missing references)
//IL_0aa6: Unknown result type (might be due to invalid IL or missing references)
//IL_045d: Unknown result type (might be due to invalid IL or missing references)
//IL_0462: Unknown result type (might be due to invalid IL or missing references)
//IL_0467: Unknown result type (might be due to invalid IL or missing references)
//IL_046c: Unknown result type (might be due to invalid IL or missing references)
//IL_0477: Unknown result type (might be due to invalid IL or missing references)
//IL_0481: Unknown result type (might be due to invalid IL or missing references)
//IL_0486: Unknown result type (might be due to invalid IL or missing references)
//IL_0519: Unknown result type (might be due to invalid IL or missing references)
//IL_051f: Unknown result type (might be due to invalid IL or missing references)
//IL_0524: Unknown result type (might be due to invalid IL or missing references)
//IL_0565: Unknown result type (might be due to invalid IL or missing references)
//IL_0575: Unknown result type (might be due to invalid IL or missing references)
//IL_0585: Unknown result type (might be due to invalid IL or missing references)
//IL_058f: Unknown result type (might be due to invalid IL or missing references)
//IL_0548: Unknown result type (might be due to invalid IL or missing references)
//IL_054e: Unknown result type (might be due to invalid IL or missing references)
//IL_0553: Unknown result type (might be due to invalid IL or missing references)
//IL_04bc: Unknown result type (might be due to invalid IL or missing references)
//IL_04c7: Unknown result type (might be due to invalid IL or missing references)
//IL_05ae: Unknown result type (might be due to invalid IL or missing references)
//IL_05be: Unknown result type (might be due to invalid IL or missing references)
//IL_05ce: Unknown result type (might be due to invalid IL or missing references)
//IL_05d8: Unknown result type (might be due to invalid IL or missing references)
//IL_04e7: Unknown result type (might be due to invalid IL or missing references)
//IL_0b62: Unknown result type (might be due to invalid IL or missing references)
//IL_0b6e: Unknown result type (might be due to invalid IL or missing references)
//IL_0c05: Unknown result type (might be due to invalid IL or missing references)
//IL_0c10: Unknown result type (might be due to invalid IL or missing references)
//IL_0c15: Unknown result type (might be due to invalid IL or missing references)
//IL_0c1a: Unknown result type (might be due to invalid IL or missing references)
//IL_0c22: Unknown result type (might be due to invalid IL or missing references)
//IL_0c27: Unknown result type (might be due to invalid IL or missing references)
//IL_0c29: Unknown result type (might be due to invalid IL or missing references)
//IL_0c33: Unknown result type (might be due to invalid IL or missing references)
//IL_0c38: Unknown result type (might be due to invalid IL or missing references)
//IL_0c3d: Unknown result type (might be due to invalid IL or missing references)
//IL_0c3f: Unknown result type (might be due to invalid IL or missing references)
//IL_0c41: Unknown result type (might be due to invalid IL or missing references)
//IL_0c46: Unknown result type (might be due to invalid IL or missing references)
//IL_0c4d: Unknown result type (might be due to invalid IL or missing references)
//IL_0c54: Unknown result type (might be due to invalid IL or missing references)
//IL_0c5f: Unknown result type (might be due to invalid IL or missing references)
//IL_0c69: Unknown result type (might be due to invalid IL or missing references)
//IL_0c6e: Unknown result type (might be due to invalid IL or missing references)
//IL_0641: Unknown result type (might be due to invalid IL or missing references)
//IL_064c: Unknown result type (might be due to invalid IL or missing references)
//IL_0651: Unknown result type (might be due to invalid IL or missing references)
//IL_0656: Unknown result type (might be due to invalid IL or missing references)
//IL_065b: Unknown result type (might be due to invalid IL or missing references)
//IL_0660: Unknown result type (might be due to invalid IL or missing references)
//IL_066b: Unknown result type (might be due to invalid IL or missing references)
//IL_0675: Unknown result type (might be due to invalid IL or missing references)
//IL_067a: Unknown result type (might be due to invalid IL or missing references)
//IL_067e: Unknown result type (might be due to invalid IL or missing references)
//IL_0683: Unknown result type (might be due to invalid IL or missing references)
//IL_0693: Unknown result type (might be due to invalid IL or missing references)
//IL_069e: Unknown result type (might be due to invalid IL or missing references)
//IL_06a3: Unknown result type (might be due to invalid IL or missing references)
//IL_06a8: Unknown result type (might be due to invalid IL or missing references)
//IL_06ad: Unknown result type (might be due to invalid IL or missing references)
//IL_06b2: Unknown result type (might be due to invalid IL or missing references)
//IL_06bd: Unknown result type (might be due to invalid IL or missing references)
//IL_06c7: Unknown result type (might be due to invalid IL or missing references)
//IL_06cc: Unknown result type (might be due to invalid IL or missing references)
//IL_06d0: Unknown result type (might be due to invalid IL or missing references)
//IL_06d5: Unknown result type (might be due to invalid IL or missing references)
//IL_073c: Unknown result type (might be due to invalid IL or missing references)
//IL_08ae: Unknown result type (might be due to invalid IL or missing references)
//IL_0763: Unknown result type (might be due to invalid IL or missing references)
//IL_0d21: Unknown result type (might be due to invalid IL or missing references)
//IL_08d5: Unknown result type (might be due to invalid IL or missing references)
//IL_0d48: Unknown result type (might be due to invalid IL or missing references)
//IL_0d73: Unknown result type (might be due to invalid IL or missing references)
//IL_0d9b: Unknown result type (might be due to invalid IL or missing references)
//IL_0dc3: Unknown result type (might be due to invalid IL or missing references)
//IL_0dd6: Unknown result type (might be due to invalid IL or missing references)
//IL_0e01: Unknown result type (might be due to invalid IL or missing references)
//IL_0e14: Unknown result type (might be due to invalid IL or missing references)
//IL_0e3f: Unknown result type (might be due to invalid IL or missing references)
//IL_0e52: Unknown result type (might be due to invalid IL or missing references)
//IL_0e7d: Unknown result type (might be due to invalid IL or missing references)
//IL_0e90: Unknown result type (might be due to invalid IL or missing references)
if (canLookJump)
{
rig.AddForce(Vector2.up * Time.deltaTime * 750f);
}
if (overHeat1 && extraCD1 > -0.07f && cd1 > CD1 + extraCD1 + 0.2f)
{
extraCD1 -= Time.deltaTime;
}
if (overHeat2 && extraCD2 > -0.07f && cd2 > CD2 + extraCD2 + 0.2f)
{
extraCD2 -= Time.deltaTime;
}
if (bot)
{
CheckTravel();
}
checkBoundaries();
botChangeAim += Time.deltaTime;
if ((canLookJump || bot) && (!botCanMove || !bot))
{
jumpHeight = 100f;
}
else
{
if (jumpHeight == 100f)
{
dangers = Object.FindObjectsOfType<Danger>();
}
jumpHeight = 1000f;
}
if (dif < 4)
{
if (timeToSwitchFire < 0f)
{
if (timeToFire)
{
timeToSwitchFire = Random.Range(1 / dif, 5 / dif);
}
else
{
timeToSwitchFire = Random.Range(dif, 3 * dif);
}
timeToFire = !timeToFire;
}
timeToSwitchFire -= Time.deltaTime;
}
else
{
timeToFire = true;
}
if (extraDamageShake > 0f)
{
extraDamageShake -= Time.deltaTime * 1f;
}
CDAim -= Time.deltaTime;
if (!canLookJump)
{
lifeTime += Time.deltaTime;
}
((Component)lifeBox).transform.localScale = new Vector3(life / (float)m_startHealth, life / (float)m_startHealth, 1f);
int num = 500;
if (bot)
{
botStartTimer += Time.deltaTime;
if (botStartTimer > 4f)
{
botCanMove = true;
}
if (botStartTimer > 4.5f)
{
botCanFire = true;
}
targetSwitchTime -= Time.deltaTime;
if (botDodgeTimer > -0.1f)
{
botDodgeTimer -= Time.deltaTime;
}
if (botStateUpdate > -0.1f)
{
botStateUpdate -= Time.deltaTime;
}
if ((Object)(object)point != (Object)null)
{
currentTargetPoint = point.position;
}
rightHit = Physics2D.Raycast(Vector2.op_Implicit(((Component)this).transform.position), Vector2.right, 1f, LayerMask.op_Implicit(mapMask));
leftHit = Physics2D.Raycast(Vector2.op_Implicit(((Component)this).transform.position), -Vector2.right, 1f, LayerMask.op_Implicit(mapMask));
upHit = Physics2D.Raycast(Vector2.op_Implicit(((Component)this).transform.position), Vector2.up, 1f, LayerMask.op_Implicit(mapMask));
downHit = Physics2D.Raycast(Vector2.op_Implicit(((Component)this).transform.position), -Vector2.up, 1f, LayerMask.op_Implicit(mapMask));
if (botCanMove)
{
voidCheck = Physics2D.Raycast(Vector2.op_Implicit(((Component)this).transform.position), -Vector2.up, 500f, LayerMask.op_Implicit(safeMask));
if (dangers != null)
{
Danger[] array = dangers;
Danger[] array2 = array;
foreach (Danger danger in array2)
{
if (Vector3.Distance(((Component)danger).transform.position, ((Component)this).transform.position) < 5f)
{
changeTargetPoint(((Component)danger).transform.position);
}
}
}
if (currentState == botState.aggro)
{
Debug.DrawLine(((Component)this).transform.position, currentTargetPoint, Color.red);
}
else if (currentState == botState.defense)
{
Debug.DrawLine(((Component)this).transform.position, currentTargetPoint, Color.yellow);
}
if ((Vector3.Distance(((Component)this).transform.position, new Vector3(-16f, ((Component)this).transform.position.y, ((Component)this).transform.position.z)) < 7f && !directionRight) || !(Vector3.Distance(((Component)this).transform.position, new Vector3(16f, ((Component)this).transform.position.y, ((Component)this).transform.position.z)) < 7f) || directionRight)
{
}
if ((Object)(object)((RaycastHit2D)(ref voidCheck)).collider == (Object)null || ((Component)((RaycastHit2D)(ref voidCheck)).collider).tag == "kill")
{
panic = true;
Vector3 position = ((Component)this).transform.position;
RaycastHit2D val = Physics2D.Raycast(Vector2.op_Implicit(((Component)this).transform.position), Vector2.left + Vector2.down, 500f, LayerMask.op_Implicit(safeMask));
float num2 = Vector3.Distance(position, Vector2.op_Implicit(((RaycastHit2D)(ref val)).point));
Vector3 position2 = ((Component)this).transform.position;
val = Physics2D.Raycast(Vector2.op_Implicit(((Component)this).transform.position), Vector2.right + Vector2.down, 500f, LayerMask.op_Implicit(safeMask));
if (num2 < Vector3.Distance(position2, Vector2.op_Implicit(((RaycastHit2D)(ref val)).point)))
{
Debug.Log("Panic Moving LEFT!");
directionRight = false;
botMoveLeft();
}
else
{
Debug.Log("Panic Moving RIGHT!");
directionRight = true;
botMoveRight();
}
}
else
{
panic = false;
}
if (currentTargetPoint.y < ((Component)this).transform.position.y)
{
if (currentTargetPoint.x < ((Component)this).transform.position.x)
{
if (Object.op_Implicit((Object)(object)((RaycastHit2D)(ref leftHit)).collider) && Object.op_Implicit((Object)(object)((RaycastHit2D)(ref downHit)).collider))
{
if (!Object.op_Implicit((Object)(object)((RaycastHit2D)(ref upHit)).collider))
{
botJump();
}
}
else if (!panic)
{
if (!Object.op_Implicit((Object)(object)((RaycastHit2D)(ref leftHit)).collider))
{
directionRight = false;
}
if (!directionRight)
{
botMoveLeft();
}
}
}
else if (Object.op_Implicit((Object)(object)((RaycastHit2D)(ref rightHit)).collider))
{
botJump();
}
else if (!panic)
{
if (Object.op_Implicit((Object)(object)((RaycastHit2D)(ref leftHit)).collider) && !directionRight)
{
directionRight = true;
}
if (directionRight)
{
botMoveRight();
}
else
{
botMoveLeft();
}
}
}
else if (currentTargetPoint.y > ((Component)this).transform.position.y)
{
if (currentTargetPoint.x > ((Component)this).transform.position.x)
{
if (Object.op_Implicit((Object)(object)((RaycastHit2D)(ref rightHit)).collider))
{
if (!Object.op_Implicit((Object)(object)((RaycastHit2D)(ref upHit)).collider))
{
botJump();
}
}
else
{
if (Object.op_Implicit((Object)(object)((RaycastHit2D)(ref leftHit)).collider) && !directionRight)
{
if (Random.Range(0, 2) > 0)
{
botJump();
}
else
{
directionRight = true;
}
}
if (!panic)
{
if (directionRight)
{
botMoveRight();
}
else
{
botMoveLeft();
}
}
}
}
else if (Object.op_Implicit((Object)(object)((RaycastHit2D)(ref leftHit)).collider))
{
if (!Object.op_Implicit((Object)(object)((RaycastHit2D)(ref upHit)).collider))
{
botJump();
}
}
else
{
if (!Object.op_Implicit((Object)(object)((RaycastHit2D)(ref leftHit)).collider))
{
botJump();
directionRight = false;
}
if (!panic && !directionRight)
{
botMoveLeft();
}
}
}
if ((Object)(object)((RaycastHit2D)(ref leftHit)).collider != (Object)null)
{
}
if ((Object)(object)((RaycastHit2D)(ref rightHit)).collider != (Object)null && (Object)(object)((Component)((Component)((RaycastHit2D)(ref rightHit)).collider).transform.root).GetComponent<SquarePlayer>() != (Object)null)
{
}
}
Collider2D[] array3 = Physics2D.OverlapCircleAll(Vector2.op_Implicit(((Component)this).transform.position), 50f, LayerMask.op_Implicit(projectilePlayerMask));
int num3 = 0;
Collider2D[] array4 = array3;
Collider2D[] array5 = array4;
foreach (Collider2D val2 in array5)
{
if (!((Object)(object)val2 != (Object)null) || !((Object)(object)((Component)((Component)val2).transform).GetComponent<SquarePlayer>() != (Object)null) || !((Object)(object)((Component)val2).transform != (Object)(object)((Component)this).transform) || !botCanFire || ((Component)((Component)val2).transform).GetComponent<SquarePlayer>().team == team)
{
continue;
}
if ((Object)(object)((Component)val2).transform != (Object)(object)otherPlayer)
{
otherPlayer = ((Component)val2).transform;
}
if (Vector3.Distance(((Component)this).transform.position, ((Component)val2).transform.position) < 2f)
{
if (fire1 == "shield")
{
botFire(firstWeapon: true);
}
if (fire2 == "shield")
{
botFire(firstWeapon: false);
}
if (Random.Range(0, 2) > 0 && botDodgeTimer <= 0f)
{
botJump();
botDodgeTimer = 0.4f;
}
}
Vector3 val3 = ((Component)val2).transform.position - ((Component)this).transform.position;
Vector3 val4 = ((Component)this).transform.position + Vector3.Normalize(val3) * 0.5f;
RaycastHit2D val5 = Physics2D.Raycast(Vector2.op_Implicit(val4), new Vector2(val3.x, val3.y), 100f, LayerMask.op_Implicit(myMask));
if ((Object)(object)((RaycastHit2D)(ref val5)).transform != (Object)(object)((Component)this).transform && ((Component)((RaycastHit2D)(ref val5)).transform).tag == "player")
{
if (!Object.op_Implicit((Object)(object)((Component)((RaycastHit2D)(ref val5)).transform).GetComponent<SquarePlayer>()))
{
continue;
}
if (sightCounter < sightThreshold + 0.4f)
{
sightCounter += Time.deltaTime;
}
if (botChangeAim > 0.3f)
{
botChangeAim = 0f;
previousCollider = num3;
if (((Vector3)(ref val3)).normalized.x > 0.8f)
{
aimInt = 0;
}
else if (((Vector3)(ref val3)).normalized.x < -0.8f)
{
aimInt = 180;
}
else if (((Vector3)(ref val3)).normalized.y > 0.8f)
{
aimInt = -90;
}
else if (((Vector3)(ref val3)).normalized.y < -0.8f)
{
aimInt = 90;
}
else if (((Vector3)(ref val3)).normalized.x > 0f && ((Vector3)(ref val3)).normalized.y > 0f)
{
aimInt = -45;
}
else if (((Vector3)(ref val3)).normalized.x < 0f && ((Vector3)(ref val3)).normalized.y < 0f)
{
aimInt = 135;
}
else if (((Vector3)(ref val3)).normalized.x < 0f && ((Vector3)(ref val3)).normalized.y > 0f)
{
aimInt = -135;
}
else if (((Vector3)(ref val3)).normalized.x > 0f && ((Vector3)(ref val3)).normalized.y < 0f)
{
aimInt = -45;
}
num3++;
}
}
else if (previousCollider == -1 && sightCounter > 0f)
{
sightCounter -= Time.deltaTime;
}
}
if (num3 == 0)
{
previousCollider = -1;
}
}
jumpTime += Time.deltaTime;
jumpCD += Time.deltaTime;
cd1 += Time.deltaTime;
cd2 += Time.deltaTime;
damageColor -= Time.deltaTime;
if (lifeTime > 2f)
{
if (damageColor > 0f)
{
SpriteRenderer[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren<SpriteRenderer>();
SpriteRenderer[] array6 = componentsInChildren;
foreach (SpriteRenderer val6 in array6)
{
val6.color = new Color(1f, 1f, 1f);
}
return;
}
SpriteRenderer[] componentsInChildren2 = ((Component)this).gameObject.GetComponentsInChildren<SpriteRenderer>();
SpriteRenderer[] array7 = componentsInChildren2;
Color val8 = default(Color);
foreach (SpriteRenderer val7 in array7)
{
((Color)(ref val8))..ctor(color.r + freezeTime / 2f, color.g + freezeTime / 2f, color.b + freezeTime / 2f, 1f);
val7.color = val8;
Color val9 = val8;
val7.color = val9;
if ((Object)(object)((Component)val7).transform == (Object)(object)((Component)this).transform)
{
val7.color = new Color(color.r + freezeTime / 2f, color.g + freezeTime / 2f, color.b + freezeTime / 2f, 0.5f);
}
}
return;
}
blinkCounter++;
if (blinkCounter > 15)
{
blinkCounter = 0;
}
SpriteRenderer[] componentsInChildren3 = ((Component)this).gameObject.GetComponentsInChildren<SpriteRenderer>();
SpriteRenderer[] array8 = componentsInChildren3;
foreach (SpriteRenderer val10 in array8)
{
if (blinkCounter < 12)
{
val10.color = new Color(color.r, color.g, color.b, 1f);
}
else
{
val10.color = new Color(1f, 1f, 1f, 0f);
}
}
}
private void LateUpdate()
{
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_005f: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
//IL_0081: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_0091: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_0349: Unknown result type (might be due to invalid IL or missing references)
//IL_034f: Unknown result type (might be due to invalid IL or missing references)
if (CDAim > 0f)
{
if (freeAim)
{
aimInt = (int)(0f - degrees);
}
else
{
aimInt = storedAimInt;
}
}
aim.rotation = Quaternion.Euler(new Vector3((float)aimInt, 90f, 0f));
hitPlayer = Physics2D.Raycast(Vector2.op_Implicit(aim.position), Vector2.op_Implicit(aim.forward), 100f, LayerMask.op_Implicit(myMask));
canFireAgain1 = true;
canFireAgain2 = true;
if (botCanFire && timeToFire && sightCounter > shootRand * sightThreshold)
{
float num = Random.Range(0f, 1f);
if (num > Time.deltaTime * 30f * sightThreshold)
{
if (fire2 != "shield")
{
if (currentDifficulty == difficulty.godmode)
{
if (fire2 == "sniper" && (Object)(object)((RaycastHit2D)(ref hitPlayer)).transform != (Object)null)
{
if (Object.op_Implicit((Object)(object)((Component)((RaycastHit2D)(ref hitPlayer)).transform.root).GetComponent<SquarePlayer>()))
{
Debug.Log("GOD FIRE");
botFire(firstWeapon: false);
}
}
else
{
botFire(firstWeapon: false);
}
}
else
{
botFire(firstWeapon: false);
}
}
if (fire1 != "shield")
{
if (currentDifficulty == difficulty.godmode)
{
if (fire1 == "sniper" && (Object)(object)((RaycastHit2D)(ref hitPlayer)).transform != (Object)null)
{
if ((Object)(object)((Component)((RaycastHit2D)(ref hitPlayer)).transform).GetComponent<SquarePlayer>() != (Object)null)
{
botFire(firstWeapon: true);
}
}
else
{
botFire(firstWeapon: true);
}
}
else
{
botFire(firstWeapon: true);
}
}
}
}
if ((cd1 > CD1 || cd2 > CD2) && botStateUpdate <= 0f)
{
if (currentState != botState.aggro)
{
currentState = botState.aggro;
changeTargetPoint();
targetSwitchTime = 5f;
}
botStateUpdate = 1f;
}
else if (botStateUpdate <= 0f)
{
if (currentState != 0 && !zombie)
{
currentState = botState.defense;
changeTargetPoint();
targetSwitchTime = 5f;
}
botStateUpdate = 1f;
}
if (targetSwitchTime <= 0f)
{
changeTargetPoint();
targetSwitchTime = 5f;
}
if (Vector3.Distance(((Component)this).transform.position, currentTargetPoint) < 2f)
{
changeTargetPoint();
Debug.Log("REACHED DESTINATION!");
}
if (healthReg)
{
if (m_healthHitTimer >= 1f)
{
if (life < (float)m_startHealth)
{
life += Time.deltaTime * (float)m_healthRegSpeed;
}
}
else
{
m_healthHitTimer += Time.deltaTime;
}
}
if (freezeTime > 0f)
{
freezeTime -= Time.deltaTime;
}
else
{
freezeTime = 0f;
}
}
private void CheckTravel()
{
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
posCheckCounter += Time.deltaTime;
if (posCheckCounter > 0.5f)
{
if (Vector3.Distance(lastCheckPos, ((Component)this).transform.position) < 2f)
{
changeTargetPoint();
}
posCheckCounter = 0f;
lastCheckPos = ((Component)this).transform.position;
}
}
private void FixedUpdate()
{
//IL_0008: 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_0036: 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)
Rigidbody2D obj = rig;
obj.velocity *= 0.95f;
if (freezeTime > 0f)
{
Rigidbody2D obj2 = rig;
obj2.velocity *= 0f;
Rigidbody2D obj3 = rig;
obj3.angularVelocity *= 0f;
rig.gravityScale = 0f;
canMove = false;
}
else
{
rig.gravityScale = 1.5f;
canMove = true;
}
}
private void Freeze(float t)
{
if (lifeTime > 2f)
{
freezeTime = t;
}
}
private void OnCollisionStay2D(Collision2D other)
{
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
jumpTime = 0f;
if (((Component)other.transform).tag == "kill")
{
extraDamageShake = -0.75f;
TakeDamage(101f, 0, Vector3.up);
}
}
private void OnCollisionEnter2D(Collision2D other)
{
}
public void TakeDamage(float damage, int a, Vector3 info)
{
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: 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_011e: 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_012f: Expected O, but got Unknown
//IL_0189: Unknown result type (might be due to invalid IL or missing references)
//IL_01c8: Unknown result type (might be due to invalid IL or missing references)
//IL_01dc: Unknown result type (might be due to invalid IL or missing references)
//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
//IL_01ec: Unknown result type (might be due to invalid IL or missing references)
//IL_01f1: Unknown result type (might be due to invalid IL or missing references)
//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
//IL_0202: Unknown result type (might be due to invalid IL or missing references)
//IL_0207: Unknown result type (might be due to invalid IL or missing references)
//IL_0215: Unknown result type (might be due to invalid IL or missing references)
//IL_022c: Unknown result type (might be due to invalid IL or missing references)
if (!(lifeTime > 2f))
{
return;
}
extraDamageShake += damage / 75f;
if (damageColor < -0.05f)
{
damageColor = 0.1f;
myAudioSource.PlayOneShot(damageSound);
}
life -= damage;
if (healthReg)
{
m_healthHitTimer = 0f;
}
if (a != 0)
{
attacker = a;
}
attackDirr = new Vector2(info.x, info.y);
if (life <= 0f && !dead)
{
dead = true;
((Component)Camera.main).SendMessage("setShake", (object)(0.5f + extraDamageShake));
Object.Destroy((Object)(object)((Component)this).gameObject);
GameObject val = (GameObject)Object.Instantiate(Resources.Load("corpse"), ((Component)this).transform.position, ((Component)this).transform.rotation);
Rigidbody2D[] componentsInChildren = val.GetComponentsInChildren<Rigidbody2D>();
Rigidbody2D[] array = componentsInChildren;
foreach (Rigidbody2D val2 in array)
{
((Component)Camera.main).SendMessage("setFreeze2", (object)extraDamageShake);
float num = Random.Range(0.2f, 0.4f);
((Component)val2).transform.localScale = new Vector3(num, num, 1f);
float num2 = 50f * extraDamageShake + 20f;
val2.AddForce(new Vector2(Random.Range(0f - num2, num2), Random.Range(0f - num2, num2)));
val2.AddForce(Vector2.op_Implicit(Vector3.Normalize(((Component)val2).transform.position - ((Component)this).transform.position) * num2 * 1.3f));
val2.AddForce(attackDirr * Random.Range(0f, num2 * 3f));
}
AudioSource component = val.GetComponent<AudioSource>();
component.volume += extraDamageShake;
}
}
private void setControls(int i)
{
v = String.Concat("v", ((Int32)(ref i)).ToString());
vc = String.Concat("vc", ((Int32)(ref i)).ToString());
c = String.Concat("c", ((Int32)(ref i)).ToString());
h = String.Concat("h", ((Int32)(ref i)).ToString());
s1 = String.Concat("s1", ((Int32)(ref i)).ToString());
s2 = String.Concat("s2", ((Int32)(ref i)).ToString());
((Component)this).gameObject.layer = 20 + i;
if (bot)
{
initializeBot();
}
playerNumber = i;
}
private void setColor(Color c)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: 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_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
color = c;
SpriteRenderer[] componentsInChildren = ((Component)this).gameObject.GetComponentsInChildren<SpriteRenderer>();
SpriteRenderer[] array = componentsInChildren;
foreach (SpriteRenderer val in array)
{
val.color = c;
if ((Object)(object)((Component)val).transform == (Object)(object)((Component)this).transform)
{
val.color = new Color(c.r, c.g, c.b, 0.5f);
}
}
}
public void botMoveLeft()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
if (Mathf.Abs(rig.velocity.x) < 500f)
{
rig.AddForce(Vector2.op_Implicit(Vector3.right * Time.deltaTime * (0f - speed)));
}
if (Mathf.Abs(rig.angularVelocity) < 250f)
{
rig.AddTorque(speed * Time.deltaTime / 5f);
}
}
public void botMoveRight()
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
if (Mathf.Abs(rig.velocity.x) < 500f)
{
rig.AddForce(Vector2.op_Implicit(Vector3.right * Time.deltaTime * speed));
}
if (Mathf.Abs(rig.angularVelocity) < 250f)
{
rig.AddTorque(speed * (0f - Time.deltaTime) / 5f);
}
}
public void botFire(bool firstWeapon)
{
if (!panic)
{
}
}
public void botJump()
{
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
if (jumpTime < 0.2f && (double)jumpCD > 0.25)
{
rig.AddForce(Vector2.op_Implicit(Vector3.up * jumpHeight));
jumpTime = 1f;
jumpCD = 0f;
myAudioSource.PlayOneShot(jump);
}
}
public void changeTargetPoint()
{
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: 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_0149: Unknown result type (might be due to invalid IL or missing references)
//IL_014c: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_0169: Unknown result type (might be due to invalid IL or missing references)
//IL_016b: 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_0122: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_008c: 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_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00aa: Unknown result type (might be due to invalid IL or missing references)
switch (currentState)
{
case botState.aggro:
{
Vector3 val4 = ((!((Object)(object)otherPlayer != (Object)null)) ? new Vector3((float)Random.Range(-10, 10), (float)Random.Range(-7, 7), 0f) : new Vector3(otherPlayer.position.x + (float)Random.Range(-1, 1), otherPlayer.position.y + (float)Random.Range(-1, 1), 0f));
if (val4 == currentTargetPoint)
{
changeTargetPoint();
}
else
{
currentTargetPoint = val4;
}
break;
}
case botState.defense:
{
Vector3 val2 = default(Vector3);
((Vector3)(ref val2))..ctor((float)Random.Range(-10, 10), (float)Random.Range(-7, 7), 0f);
Collider2D[] array = Physics2D.OverlapCircleAll(Vector2.op_Implicit(val2), 5f, LayerMask.op_Implicit(playerMask));
Collider2D[] array2 = array;
Collider2D[] array3 = array2;
foreach (Collider2D val3 in array3)
{
changeTargetPoint();
}
currentTargetPoint = val2;
break;
}
case botState.passive:
{
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor((float)Random.Range(-10, 10), (float)Random.Range(-7, 7), 0f);
if (val == currentTargetPoint)
{
changeTargetPoint();
}
else
{
currentTargetPoint = val;
}
break;
}
}
}
public void changeTargetPoint(Vector3 pos)
{
//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_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: 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)
Vector3 val = ((Component)this).transform.position - pos + ((Component)this).transform.position / 2f;
if (val.x > ((Component)this).transform.position.x)
{
directionRight = true;
}
else
{
directionRight = false;
}
Debug.DrawLine(((Component)this).transform.position, val, Color.red, 0.1f);
currentTargetPoint = val;
}
public void ChangeDifficulty(int dif)
{
switch (dif)
{
case 1:
currentDifficulty = difficulty.easy;
break;
case 2:
currentDifficulty = difficulty.medium;
break;
case 3:
currentDifficulty = difficulty.hard;
break;
case 4:
currentDifficulty = difficulty.godmode;
break;
}
switch (currentDifficulty)
{
case difficulty.easy:
sightThreshold = 1f;
break;
case difficulty.medium:
sightThreshold = 0.7f;
break;
case difficulty.hard:
sightThreshold = 0.4f;
break;
case difficulty.godmode:
sightThreshold = 0.1f;
break;
}
}
}
}
namespace RootAdvancedCards.Patches
{
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
public class ApplyCardStatsPatches : Object
{
[HarmonyPatch("RPCA_Pick")]
[HarmonyPrefix]
public static void RPCA_Pick(ref int[] actorIDs)
{
List<int> val = Enumerable.ToList<int>((IEnumerable<int>)(object)actorIDs);
for (int i = 0; i < actorIDs.Length; i++)
{
Player playerWithActorID = PlayerManager.instance.GetPlayerWithActorID(actorIDs[i]);
if ((Object)(object)playerWithActorID != (Object)null && UtilityExtenions.HasCard(playerWithActorID, "Simulacrum"))
{
val.Add(playerWithActorID.data.view.ControllerActorNr);
}
}
actorIDs = val.ToArray();
}
[HarmonyPatch("OFFLINE_Pick")]
[HarmonyPrefix]
public static void OFFLINE_Pick(ref Player[] players)
{
List<Player> val = Enumerable.ToList<Player>((IEnumerable<Player>)(object)players);
for (int i = 0; i < players.Length; i++)
{
Player val2 = players[i];
if ((Object)(object)val2 != (Object)null && UtilityExtenions.HasCard(val2, "Simulacrum"))
{
val.Add(val2);
}
}
players = val.ToArray();
}
}
[Serializable]
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
internal class BlockPatchblocked : Object
{
private static void Prefix(Block __instance, GameObject projectile, Vector3 forward, Vector3 hitPos)
{
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Expected O, but got Unknown
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Expected O, but got Unknown
ProjectileHit component = projectile.GetComponent<ProjectileHit>();
HealthHandler val = (HealthHandler)Traverse.Create((object)__instance).Field("health").GetValue();
Player val2 = (Player)Traverse.Create((object)val).Field("player").GetValue();
if (CharacterStatModifiersExtension.GetRootData(val2).witchTimeDuration > 0f && component.ownPlayer.teamID != val2.teamID)
{
ExtensionMethods.GetOrAddComponent<WitchTime>(((Component)val2).gameObject, false).time_remaning = CharacterStatModifiersExtension.GetRootData(val2).witchTimeDuration;
}
}
}
[Serializable]
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
internal class DamagePatch : Object
{
[HarmonyPatch("CallTakeDamage")]
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
[HarmonyPatch("DoDamage")]
[HarmonyPatch("TakeDamageOverTime")]
[HarmonyPriority(2147483647)]
private static void Prefix(ref Player damagingPlayer)
{
if ((Object)(object)damagingPlayer != (Object)null && UtilityExtenions.HasCard(damagingPlayer, "Anonymity"))
{
damagingPlayer = null;
}
}
}
[Serializable]
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
internal class HealthHandlerPatchDie : Object
{
[CompilerGenerated]
private sealed class <>c__DisplayClass0_0 : Object
{
public int count;
internal void <RPCA_Die>b__0(Player player)
{
int num = UtilityExtenions.CardCount(player, "Ouroboros") * count * 10;
CharacterStatModifiersRootData rootData = CharacterStatModifiersExtension.GetRootData(player);
rootData.flatProjectileDamage += (float)num;
CharacterStatModifiersRootData rootData2 = CharacterStatModifiersExtension.GetRootData(player);
rootData2.flatHPboost += (float)num;
if (GameManager.instance.battleOngoing)
{
CharacterStatModifiersRootData rootData3 = CharacterStatModifiersExtension.GetRootData(player);
rootData3.tempflatHPboost += (float)num;
CharacterData data = player.data;
data.maxHealth += (float)num;
}
}
}
[HarmonyPrefix]
[HarmonyPatch("RPCA_Die")]
[HarmonyPatch("RPCA_Die_Phoenix")]
private static void RPCA_Die(HealthHandler __instance, CharacterData ___data, Player ___player)
{
if (!((Object)(object)__instance != (Object)null) || __instance.isRespawning || ___data.dead || !UtilityExtenions.HasCard(___player, "Ouroboros"))
{
return;
}
<>c__DisplayClass0_0 CS$<>8__locals0 = new <>c__DisplayClass0_0();
CS$<>8__locals0.count = UtilityExtenions.CardCount(___player, "Ouroboros");
Oroboros.oroboros += CS$<>8__locals0.count;
PlayerManager.instance.players.ForEach((Action<Player>)delegate(Player player)
{
int num = UtilityExtenions.CardCount(player, "Ouroboros") * CS$<>8__locals0.count * 10;
CharacterStatModifiersRootData rootData = CharacterStatModifiersExtension.GetRootData(player);
rootData.flatProjectileDamage += (float)num;
CharacterStatModifiersRootData rootData2 = CharacterStatModifiersExtension.GetRootData(player);
rootData2.flatHPboost += (float)num;
if (GameManager.instance.battleOngoing)
{
CharacterStatModifiersRootData rootData3 = CharacterStatModifiersExtension.GetRootData(player);
rootData3.tempflatHPboost += (float)num;
CharacterData data = player.data;
data.maxHealth += (float)num;
}
});
}
}
public class LockPlayerSize : MonoBehaviour
{
private void FixedUpdate()
{
((Component)this).GetComponentInParent<Player>().data.health = 0f;
}
}
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
internal class PlayerSizePatch : Object
{
public static void Postfix(CharacterStatModifiers __instance)
{
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
if (((Component)__instance).GetComponentInChildren<LockPlayerSize>() != null)
{
((Component)__instance).transform.localScale = Vector3.one;
__instance.data.playerVel.mass = 25f;
}
}
}
[Serializable]
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
public class PerminentCardPatch : Object
{
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
[HarmonyPrefix]
public static bool AddPrefix(Player player, CardInfo card)
{
RootCardInfo val = (RootCardInfo)(object)((card is RootCardInfo) ? card : null);
return val == null || !val.Perminent || !UtilityExtenions.HasCard(player, card);
}
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
[HarmonyPrefix]
public static bool RPCAddPrefix(string cardObjectName, int playerID)
{
CardInfo cardWithObjectName = Cards.instance.GetCardWithObjectName(cardObjectName);
Player playerWithID = PlayerManager.instance.GetPlayerWithID(playerID);
RootCardInfo val = (RootCardInfo)(object)((cardWithObjectName is RootCardInfo) ? cardWithObjectName : null);
return val == null || !val.Perminent || !UtilityExtenions.HasCard(playerWithID, cardWithObjectName);
}
[HarmonyPatch("RemoveAllCardsFromPlayer")]
public static void Prefix(Player player, out CardInfo[] __state)
{
__state = Enumerable.ToArray<CardInfo>(Enumerable.Where<CardInfo>((IEnumerable<CardInfo>)(object)player.data.currentCards, (Func<CardInfo, bool>)((CardInfo card) => ((RootCardInfo)(((card is RootCardInfo) ? card : null)?)).Perminent ?? false)));
}
[HarmonyPatch("RemoveAllCardsFromPlayer")]
public static void Postfix(Player player, ref CardInfo[] __state)
{
Cards.instance.AddCardsToPlayer(player, __state, false, (string[])null, (float[])null, (float[])null, true);
}
}
[HarmonyPatch(/*Could not decode attribute arguments.*/)]
public class AllowedCardPatch : Object
{
private static bool CakeCheck;
private static void Postfix(Player player, CardInfo card, ref bool __result, Cards __instance)
{
if (card == null || player == null || CakeCheck)
{
return;
}
RootCardInfo val = (RootCardInfo)(object)((card is RootCardInfo) ? card : null);
if (val == null)
{
return;
}
if (val.Key == "Cake_Toggle")
{
__result = false;
}
if (val.Key.StartsWith("Cake_"))
{
if (val.Restricted && !CardManager.IsCardActive((CardInfo)(object)CardList.GetCardInfo("Cake_Toggle")))
{
__result = false;
return;
}
CakeCheck = true;
__result = __result && CakeRestrictions.CanHaveCake(player, val) && __instance.PlayerIsAllowedCard(player, (CardInfo)(object)CardList.GetCardInfo("Cake_Toggle"));
CakeCheck = false;
}
}
}
}
namespace RootAdvancedCards.GunEffects
{
internal class Devourer : DealtDamageEffect
{
public Hunger hunger;
public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer = null)
{
//IL_0018: 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)
Core.Debug((object)hunger);
((ReversibleEffect)hunger).gunStatModifier.projectileColor = Color.white;
hunger.hungerLevel = 1;
}
}
internal class Hunger : ReversibleEffect
{
internal int hungerLevel = 1;
internal int hungerGrowth = 0;
internal int hungerMax = 30;
public void AttackAction()
{
hungerLevel += hungerGrowth;
}
public override void OnAwake()
{
Hunger componentInChildren = ((Component)((Component)this).transform.parent).GetComponentInChildren<Hunger>();
componentInChildren.hungerGrowth++;
if ((Object)(object)componentInChildren != (Object)(object)this)
{
Object.DestroyImmediate((Object)(object)((Component)this).gameObject);
}
}
public override void OnStart()
{
//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_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Expected O, but got Unknown
base.gunStatModifier.projectileColor = Color.white;
((ReversibleEffect)this).SetLivesToEffect(2147483647);
base.gun.AddAttackAction(new Action(AttackAction));
}
public override void OnOnDestroy()
{
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Expected O, but got Unknown
base.gun.RemoveAttackAction(new Action(AttackAction));
}
public override void OnUpdate()
{
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
if ((float)hungerLevel != base.gunStatModifier.damage_mult && PlayerStatus.PlayerAliveAndSimulated(base.player))
{
hungerLevel = Mathf.Clamp(hungerLevel, 1, hungerMax);
float num = 1f - Mathf.Clamp((float)hungerLevel / (float)hungerMax, 0f, 1f);
base.gunStatModifier.projectileColor = Colour.New(1.0, (double)num, (double)num, 1.0);
((ReversibleEffect)this).ClearModifiers(true);
base.gunStatModifier.damage_mult = hungerLevel;
((ReversibleEffect)this).ApplyModifiers();
}
}
public override void OnOnDisable()
{
hungerLevel = 1;
}
}
internal class LethalAttacks : RayHitEffect
{
public override HasToReturn DoHitEffect(HitInfo hit)
{
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: Unknown result type (might be due to invalid IL or missing references)
//IL_007c: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)hit.transform))
{
return (HasToReturn)1;
}
CharacterData component = ((Component)hit.transform).GetComponent<CharacterData>();
if (component != null && component.health < 0f && !component.dead)
{
if (component.stats.remainingRespawns > 0)
{
component.view.RPC("RPCA_Die_Phoenix", (RpcTarget)0, (object[])(object)new Object[1] { (object)Vector2.down });
}
else
{
component.view.RPC("RPCA_Die", (RpcTarget)0, (object[])(object)new Object[1] { (object)Vector2.down });
}
}
return (HasToReturn)1;
}
}
public class ShotBustBullet : MonoBehaviour
{
public static int count;
private int id;
private void Awake()
{
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: 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_0044: Unknown result type (might be due to invalid IL or missing references)
id = count++;
((Component)this).transform.rotation = getShootRotation(id, 6);
Transform transform = ((Component)this).transform;
transform.position += ((Component)this).transform.forward;
if (count == 6)
{
count = 0;
}
}
private void LateUpdate()
{
if (((Component)this).GetComponent<MoveTransform>().distanceTravelled > 9f)
{
PhotonNetwork.Destroy(((Component)this).gameObject);
}
}
private Quaternion getShootRotation(int bulletID, int numOfProj)
{
//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_0028: 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)
//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_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
Vector3 forward = ((Component)this).transform.forward;
float num = (float)numOfProj * 0.05f;
float num2 = (float)bulletID * (num * 2f / (float)(numOfProj - 1)) - num;
forward += Vector3.Cross(forward, Vector3.forward) * num2;
return Quaternion.LookRotation(forward);
}
}
public class StunHit : CustomProjectileHit
{
[PunRPC]
public override void RPCA_DoCusomeHit(Vector2 hitPoint, Vector2 hitNormal, Vector2 vel, int viewID = -1, int colliderID = -1, bool wasBlocked = false)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_002c: 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: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: 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_0020: Unknown result type (might be due to invalid IL or missing references)
//IL_0025: Unknown result type (might be due to invalid IL or missing references)
//IL_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_012a: Unknown result type (might be due to invalid IL or missing references)
//IL_0130: Invalid comparison between Unknown and I4
//IL_0171: 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)
//IL_02db: Unknown result type (might be due to invalid IL or missing references)
//IL_02e0: 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_02e5: Invalid comparison between Unknown and I4
//IL_02f2: Unknown result type (might be due to invalid IL or missing references)
//IL_02f5: Invalid comparison between Unknown and I4
HitInfo val = new HitInfo();
if (Object.op_Implicit((Object)(object)((ProjectileHit)this).move))
{
((ProjectileHit)this).move.velocity = Vector2.op_Implicit(vel);
}
val.point = hitPoint;
val.normal = hitNormal;
val.collider = null;
if (viewID != -1)
{
PhotonView photonView = PhotonNetwork.GetPhotonView(viewID);
val.collider = ((Component)photonView).GetComponentInChildren<Collider2D>();
val.transform = ((Component)photonView).transform;
}
else if (colliderID != -1)
{
val.collider = ((Component)MapManager.instance.currentMap.Map).GetComponentsInChildren<Collider2D>()[colliderID];
val.transform = ((Component)val.collider).transform;
}
HealthHandler val2 = null;
if (Object.op_Implicit((Object)(object)val.transform))
{
val2 = ((Component)val.transform).GetComponent<HealthHandler>();
}
if (((ProjectileHit)this).isAllowedToSpawnObjects)
{
((Component)this).transform.position = Vector2.op_Implicit(val.point);
}
if (Object.op_Implicit((Object)(object)val.collider))
{
ProjectileHitSurface component = ((Component)val.collider).GetComponent<ProjectileHitSurface>();
if (Object.op_Implicit((Object)(object)component) && (int)component.HitSurface(val, ((Component)this).gameObject) == 0)
{
return;
}
}
if (Object.op_Implicit((Object)(object)val2))
{
Block component2 = ((Component)val2).GetComponent<Block>();
if (wasBlocked)
{
component2.DoBlock(((Component)this).gameObject, ((Component)this).transform.forward, Vector2.op_Implicit(val.point));
if (((ProjectileHit)this).destroyOnBlock)
{
((ProjectileHit)this).DestroyMe();
}
((ProjectileHit)this).sinceReflect = 0f;
return;
}
CharacterStatModifiers component3 = ((Component)val2).GetComponent<CharacterStatModifiers>();
if (((ProjectileHit)this).movementSlow != 0f && !wasBlocked)
{
component3.RPCA_AddSlow(((ProjectileHit)this).movementSlow, false);
}
}
float num = 1f;
PlayerVelocity val3 = null;
if (Object.op_Implicit((Object)(object)val.transform))
{
val3 = ((Component)val.transform).GetComponentInParent<PlayerVelocity>();
}
if (Object.op_Implicit((Object)(object)val.collider))
{
StunHandler componentInParent = ((Component)val.collider).GetComponentInParent<StunHandler>();
if (Object.op_Implicit((Object)(object)componentInParent))
{
if (Object.op_Implicit((Object)(object)val2) && ((ProjectileHit)this).percentageDamage != 0f)
{
((ProjectileHit)this).damage = ((ProjectileHit)this).damage + ((Component)val2).GetComponent<CharacterData>().maxHealth * ((ProjectileHit)this).percentageDamage;
}
componentInParent.AddStun(((ProjectileHit)this).damage * ((ProjectileHit)this).dealDamageMultiplierr * 0.01f + ((Component)componentInParent).GetComponent<CharacterData>().stunTime);
}
}
bool flag = false;
if (((ProjectileHit)this).effects != null && ((ProjectileHit)this).effects.Count != 0)
{
for (int i = 0; i < ((ProjectileHit)this).effects.Count; i++)
{
HasToReturn val4 = ((ProjectileHit)this).effects[i].DoHitEffect(val);
if ((int)val4 == 0)
{
flag = true;
}
if ((int)val4 == 2)
{
return;
}
}
}
if (!flag)
{
((ProjectileHit)this).deathEvent.Invoke();
((ProjectileHit)this).DestroyMe();
}
}
}
}
namespace RootAdvancedCards.CardConditions
{
public class TooSoonCondition : CardCondition
{
public override bool IsPlayerAllowedCard(Player player)
{
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Expected I4, but got Unknown
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
List<int> val = Enumerable.ToList<int>(Enumerable.Distinct<int>(Enumerable.Select<Player, int>((IEnumerable<Player>)(object)PlayerManager.instance.players, (Func<Player, int>)((Player x) => x.teamID))));
int num = (int)(Int32)GameModeManager.CurrentHandler.Settings["roundsToWinGame"];
bool flag = false;
Enumerator<int> enumerator = val.GetEnumerator();
try
{
while (enumerator.MoveNext())
{
int current = enumerator.Current;
if (GameModeManager.CurrentHandler.GetTeamScore(current).rounds == num - 1)
{
if (flag)
{
return false;
}
flag = true;
}
else if (GameModeManager.CurrentHandler.GetTeamScore(current).rounds != 0)
{
return false;
}
}
}
finally
{
((IDisposable)enumerator).Dispose();
}
return flag;
}
}
}