using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using CR.Cards;
using CR.Extensions;
using CR.MonoBehaviors;
using CardChoiceSpawnUniqueCardPatch.CustomCategories;
using ClassesManagerReborn;
using ClassesManagerReborn.Util;
using HarmonyLib;
using Jotunn.Utils;
using ModdingUtils.Extensions;
using ModdingUtils.MonoBehaviours;
using ModdingUtils.RoundsEffects;
using ModdingUtils.Utils;
using ModsPlus;
using Photon.Pun;
using RarityLib.Utils;
using Sonigon;
using Sonigon.Internal;
using SoundImplementation;
using TMPro;
using UnboundLib;
using UnboundLib.Cards;
using UnboundLib.GameModes;
using UnboundLib.Networking;
using UnboundLib.Utils;
using UnboundLib.Utils.UI;
using UnityEngine;
using UnityEngine.Events;
using UnityEngine.UI;
using WWMO.MonoBehaviours;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: AssemblyTitle("CosmicRounds")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("CosmicRounds")]
[assembly: AssemblyCopyright("Copyright © 2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("00bda730-a353-4cb7-a2f2-7acfc83c9392")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace CR
{
[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.XAngelMoonX.rounds.CosmicRounds", "Cosmic Rounds", "2.7.0")]
[BepInProcess("Rounds.exe")]
public class CR : BaseUnityPlugin
{
[Serializable]
[CompilerGenerated]
private sealed class <>c
{
public static readonly <>c <>9 = new <>c();
public static UnityAction <>9__6_0;
public static Action<CardInfo> <>9__6_1;
public static Action<CardInfo> <>9__6_2;
public static Action<CardInfo> <>9__6_3;
public static Action<CardInfo> <>9__6_4;
public static Action<CardInfo> <>9__6_5;
public static Action<CardInfo> <>9__6_6;
public static Action<CardInfo> <>9__6_7;
public static Action<CardInfo> <>9__6_8;
public static Action<CardInfo> <>9__6_9;
public static Action<CardInfo> <>9__6_10;
public static Action<CardInfo> <>9__6_11;
public static Action<CardInfo> <>9__6_12;
public static Action<CardInfo> <>9__6_13;
internal void <Start>b__6_0()
{
}
internal void <Start>b__6_1(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
}
internal void <Start>b__6_2(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
}
internal void <Start>b__6_3(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
}
internal void <Start>b__6_4(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
}
internal void <Start>b__6_5(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
}
internal void <Start>b__6_6(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
}
internal void <Start>b__6_7(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
}
internal void <Start>b__6_8(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
}
internal void <Start>b__6_9(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
}
internal void <Start>b__6_10(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
}
internal void <Start>b__6_11(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
}
internal void <Start>b__6_12(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
}
internal void <Start>b__6_13(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
}
}
internal static List<CardInfo> hiddenCards = new List<CardInfo>();
private const string ModId = "com.XAngelMoonX.rounds.CosmicRounds";
private const string ModName = "CR";
public const string Version = "2.7.0";
internal static AssetBundle ArtAsset;
public static ConfigEntry<float> globalVolMute;
public static ConfigEntry<bool> crSpecialVFX;
public static SoundEvent fieldsound;
private SoundParameterIntensity soundParameterIntensity = new SoundParameterIntensity(1f, (UpdateMode)0);
public int weakassstartuppatch;
public static CR instance { get; private set; }
private static void Main()
{
}
private void Awake()
{
globalVolMute = ((BaseUnityPlugin)this).Config.Bind<float>("CR", "Volume for CR SFX", 100f, "Volume for CR SFX");
crSpecialVFX = ((BaseUnityPlugin)this).Config.Bind<bool>("CR", "Toggle for CR VFX", true, "Toggle for CR VFX");
GameModeManager.AddHook("GameEnd", (Func<IGameModeHandler, IEnumerator>)ResetEffects);
GameModeManager.AddHook("PointEnd", (Func<IGameModeHandler, IEnumerator>)ResetColors);
}
private IEnumerator ResetEffects(IGameModeHandler gm)
{
DestroyAll<ShockMono>();
DestroyAll<StunMono>();
DestroyAll<MosquitoMono>();
DestroyAll<BeetleMono>();
DestroyAll<FearFactorMono>();
DestroyAll<CriticalHitMono>();
DestroyAll<FlamethrowerMono>();
DestroyAll<SyphonMono>();
DestroyAll<TaserMono>();
DestroyAll<HolsterMono>();
DestroyAll<FlexMono>();
DestroyAll<DroneMono>();
DestroyAll<GoldenGlazeMono>();
DestroyAll<GoldHealthMono>();
DestroyAll<SugarGlazeMono>();
DestroyAll<SugarMoveMono>();
DestroyAll<MitosisMono>();
DestroyAll<MitosisBlockMono>();
DestroyAll<MeiosisMono>();
DestroyAll<MeiosisReloadMono>();
DestroyAll<PogoMono>();
DestroyAll<CloudMono>();
DestroyAll<PulseMono>();
DestroyAll<DriveMono>();
DestroyAll<CriticalMono>();
DestroyAll<DropMono>();
DestroyAll<SunMono>();
DestroyAll<MeteorMono>();
DestroyAll<CometMono>();
DestroyAll<UnicornMono>();
DestroyAll<GravityMono>();
DestroyAll<IgniteMono>();
DestroyAll<IgniteEffect>();
DestroyAll<FaeEmbersMono>();
DestroyAll<CareenMono>();
DestroyAll<AsteroidMono>();
DestroyAll<PulsarMono>();
DestroyAll<GlueMono>();
DestroyAll<AquaRingMono>();
DestroyAll<QuasarMono>();
DestroyAll<CakeMono>();
DestroyAll<ChlorophyllMono>();
DestroyAll<HiveMono>();
DestroyAll<BarrierMono>();
DestroyAll<HeartitionMono>();
DestroyAll<HeartbeatMono>();
DestroyAll<HeartburnMono>();
DestroyAll<HeartthumpMono>();
DestroyAll<LoveHertzMono>();
DestroyAll<SweetheartMono>();
DestroyAll<DarkMono>();
DestroyAll<RingMono>();
DestroyAll<PingMono>();
DestroyAll<ShootingStarMono>();
DestroyAll<SatelliteMono>();
DestroyAll<BeeMono>();
DestroyAll<IceTrailMono>();
DestroyAll<StarMono>();
DestroyAll<PumpkinMono>();
DestroyAll<HeartMono>();
DestroyAll<BeeSpriteMono>();
DestroyAll<BeeShotMono>();
DestroyAll<FireMono>();
DestroyAll<FireballMono>();
DestroyAll<HolyFireMono>();
DestroyAll<HolyMono>();
DestroyAll<HaloMono>();
DestroyAll<HaloBlockMono>();
DestroyAll<HolyShotMono>();
DestroyAll<HaloFireMono>();
DestroyAll<HyperMono>();
DestroyAll<AllMono>();
DestroyAll<AllRegenMono>();
DestroyAll<HyperRegenMono>();
DestroyAll<MistletoeMono>();
DestroyAll<FrozenMono>();
DestroyAll<LoveTapMono>();
DestroyAll<SealMono>();
DestroyAll<SealSealMono>();
DestroyAll<BatteryMono>();
DestroyAll<AssaultMono>();
DestroyAll<DingMono>();
DestroyAll<DischargeMono>();
DestroyAll<BulkUpMono>();
DestroyAll<QuantumMono>();
DestroyAll<ChargeMono>();
DestroyAll<ChargeCDMono>();
DestroyAll<EnchantMono>();
DestroyAll<EnchantCDMono>();
DestroyAll<CrowSpriteMono>();
DestroyAll<HawkSpriteMono>();
DestroyAll<DropballSpriteMono>();
DestroyAll<DoveSpriteMono>();
DestroyAll<VultureSpriteMono>();
DestroyAll<SquidMono>();
DestroyAll<CrushMono>();
DestroyAll<TossMono>();
DestroyAll<ResonateMono>();
DestroyAll<ScarabMono>();
DestroyAll<MoonMono>();
DestroyAll<ReplicateMono>();
DestroyAll<ZodiacMono>();
yield break;
}
private IEnumerator ResetColors(IGameModeHandler gm)
{
DestroyAll<BeetleRegenMono>();
DestroyAll<GoldHealthMono>();
DestroyAll<SugarMoveMono>();
DestroyAll<MitosisBlockMono>();
DestroyAll<MeiosisReloadMono>();
DestroyAll<CriticalMono>();
DestroyAll<RedMono>();
DestroyAll<OrangeMono>();
DestroyAll<YellowMono>();
DestroyAll<GreenMono>();
DestroyAll<CyanMono>();
DestroyAll<BlueMono>();
DestroyAll<PurpleMono>();
DestroyAll<PinkMono>();
DestroyAll<IgniteEffect>();
DestroyAll<PulsarEffect>();
DestroyAll<GlueEffect>();
DestroyAll<CakeReloadMono>();
DestroyAll<ChlorophyllReloadMono>();
DestroyAll<HiveBlockMono>();
DestroyAll<SweetheartEffect>();
DestroyAll<HaloBlockMono>();
DestroyAll<AllRegenMono>();
DestroyAll<HyperRegenMono>();
DestroyAll<FrozenMono>();
DestroyAll<SealSealMono>();
DestroyAll<ChargeCDMono>();
DestroyAll<EnchantCDMono>();
DestroyAll<CrushEffect>();
DestroyAll<TossEffect>();
DestroyAll<ResonateRing>();
DestroyAll<ScarabRegenMono>();
yield break;
}
private void DestroyAll<T>() where T : Object
{
T[] array = Object.FindObjectsOfType<T>();
for (int num = array.Length - 1; num >= 0; num--)
{
Object.Destroy((Object)(object)array[num]);
}
}
private void Start()
{
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Expected O, but got Unknown
ArtAsset = AssetUtils.LoadAssetBundleFromResources("cr_assets", typeof(CR).Assembly);
if ((Object)(object)ArtAsset == (Object)null)
{
Debug.Log((object)"Failed to load CR art asset bundle");
}
object obj = <>c.<>9__6_0;
if (obj == null)
{
UnityAction val = delegate
{
};
<>c.<>9__6_0 = val;
obj = (object)val;
}
Unbound.RegisterMenu("CR Settings", (UnityAction)obj, (Action<GameObject>)NewGUI, (GameObject)null, true);
GameModeManager.AddHook("GameEnd", (Func<IGameModeHandler, IEnumerator>)ResetEffects);
GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)ResetEffects);
GameModeManager.AddHook("GameEnd", (Func<IGameModeHandler, IEnumerator>)ResetEffects);
GameModeManager.AddHook("GameStart", (Func<IGameModeHandler, IEnumerator>)ResetEffects);
CustomCard.BuildCard<BeetleCard>();
CustomCard.BuildCard<CrowCard>();
CustomCard.BuildCard<HawkCard>();
CustomCard.BuildCard<SpeedUpCard>();
CustomCard.BuildCard<MosquitoCard>();
CustomCard.BuildCard<SuperSonicCard>();
CustomCard.BuildCard<StasisCard>();
CustomCard.BuildCard<OnesKingCard>();
CustomCard.BuildCard<BulletTimeCard>();
CustomCard.BuildCard<StunCard>();
CustomCard.BuildCard<FearFactorCard>();
CustomCard.BuildCard<StarCard>();
CustomCard.BuildCard<CriticalHitCard>();
CustomCard.BuildCard<FlamethrowerCard>();
CustomCard.BuildCard<SyphonCard>();
CustomCard.BuildCard<DropshotCard>();
CustomCard.BuildCard<ReconCard>();
CustomCard.BuildCard<TaserCard>();
CustomCard.BuildCard<HolsterCard>();
CustomCard.BuildCard<FlexCard>();
CustomCard.BuildCard<DroneCard>();
CustomCard.BuildCard<SparkCard>();
CustomCard.BuildCard<GoldenGlazeCard>();
CustomCard.BuildCard<FocusCard>();
CustomCard.BuildCard<SugarGlazeCard>();
CustomCard.BuildCard<MitosisCard>();
CustomCard.BuildCard<MeiosisCard>();
CustomCard.BuildCard<PogoCard>();
CustomCard.BuildCard<AllCard>();
CustomCard.BuildCard<CloudCard>();
CustomCard.BuildCard<PulseCard>();
CustomCard.BuildCard<DriveCard>();
CustomCard.BuildCard<SunCard>();
CustomCard.BuildCard<CometCard>();
CustomCard.BuildCard<MeteorCard>();
CustomCard.BuildCard<UnicornCard>();
CustomCard.BuildCard<GravityCard>();
CustomCard.BuildCard<IgniteCard>();
CustomCard.BuildCard<FaeEmbersCard>();
CustomCard.BuildCard<CareenCard>();
CustomCard.BuildCard<AsteroidCard>();
CustomCard.BuildCard<PulsarCard>();
CustomCard.BuildCard<GlueCard>();
CustomCard.BuildCard<AquaRingCard>();
CustomCard.BuildCard<QuasarCard>();
CustomCard.BuildCard<CakeCard>();
CustomCard.BuildCard<EggCard>();
CustomCard.BuildCard<ChlorophyllCard>();
CustomCard.BuildCard<HiveCard>();
CustomCard.BuildCard<BarrierCard>();
CustomCard.BuildCard<DoveCard>();
CustomCard.BuildCard<HeartitionCard>();
CustomCard.BuildCard<HeartbeatCard>();
CustomCard.BuildCard<HeartburnCard>();
CustomCard.BuildCard<HeartthumpCard>();
CustomCard.BuildCard<LoveHertzCard>();
CustomCard.BuildCard<SweetheartCard>();
CustomCard.BuildCard<DarkMatterCard>();
CustomCard.BuildCard<RingCard>();
CustomCard.BuildCard<PingCard>();
CustomCard.BuildCard<ShootingStarCard>();
CustomCard.BuildCard<SatelliteCard>();
CustomCard.BuildCard<VultureCard>();
CustomCard.BuildCard<HyperSonicCard>();
CustomCard.BuildCard<IceShardCard>();
CustomCard.BuildCard<JackOLanternCard>();
CustomCard.BuildCard<HaloCard>();
CustomCard.BuildCard<MistletoeCard>();
CustomCard.BuildCard<LoveStruckCard>();
CustomCard.BuildCard<TabulaRasaCard>();
CustomCard.BuildCard<SealCard>();
CustomCard.BuildCard<BatteryCard>();
CustomCard.BuildCard<AssaultCard>();
CustomCard.BuildCard<DingCard>();
CustomCard.BuildCard<DischargeCard>();
CustomCard.BuildCard<BulkUpCard>();
CustomCard.BuildCard<QuantumCard>();
CustomCard.BuildCard<ChargeCard>();
CustomCard.BuildCard<EnchantCard>();
CustomCard.BuildCard<ArrayCard>();
CustomCard.BuildCard<ClearMindCard>((Action<CardInfo>)delegate(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
});
CustomCard.BuildCard<SquidCard>();
CustomCard.BuildCard<AquariusCard>();
CustomCard.BuildCard<PiscesCard>();
CustomCard.BuildCard<AriesCard>();
CustomCard.BuildCard<TaurusCard>();
CustomCard.BuildCard<GeminiCard>();
CustomCard.BuildCard<CancerCard>();
CustomCard.BuildCard<LeoCard>();
CustomCard.BuildCard<VirgoCard>();
CustomCard.BuildCard<LibraCard>();
CustomCard.BuildCard<ScorpioCard>();
CustomCard.BuildCard<SagittariusCard>();
CustomCard.BuildCard<CapricornCard>();
CustomCard.BuildCard<CrushCard>();
CustomCard.BuildCard<TossCard>();
CustomCard.BuildCard<ResonateCard>();
CustomCard.BuildCard<ScarabCard>();
CustomCard.BuildCard<MoonCard>();
CustomCard.BuildCard<ReplicateCard>();
CustomCard.BuildCard<ZodiacCard>();
CustomCard.BuildCard<ZodiacCardPlus>();
CustomCard.BuildCard<AquariusCardPlus>((Action<CardInfo>)delegate(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
});
CustomCard.BuildCard<PiscesCardPlus>((Action<CardInfo>)delegate(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
});
CustomCard.BuildCard<AriesCardPlus>((Action<CardInfo>)delegate(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
});
CustomCard.BuildCard<TaurusCardPlus>((Action<CardInfo>)delegate(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
});
CustomCard.BuildCard<GeminiCardPlus>((Action<CardInfo>)delegate(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
});
CustomCard.BuildCard<CancerCardPlus>((Action<CardInfo>)delegate(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
});
CustomCard.BuildCard<LeoCardPlus>((Action<CardInfo>)delegate(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
});
CustomCard.BuildCard<VirgoCardPlus>((Action<CardInfo>)delegate(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
});
CustomCard.BuildCard<LibraCardPlus>((Action<CardInfo>)delegate(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
});
CustomCard.BuildCard<ScorpioCardPlus>((Action<CardInfo>)delegate(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
});
CustomCard.BuildCard<SagittariusCardPlus>((Action<CardInfo>)delegate(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
});
CustomCard.BuildCard<CapricornCardPlus>((Action<CardInfo>)delegate(CardInfo cardInfo)
{
Cards.instance.AddHiddenCard(cardInfo);
hiddenCards.Add(cardInfo);
});
}
private void GlobalVolAction(float val)
{
globalVolMute.Value = val;
}
private void GlobalVFXAction(bool val)
{
crSpecialVFX.Value = val;
}
private void NewGUI(GameObject menu)
{
TextMeshProUGUI val = default(TextMeshProUGUI);
MenuHandler.CreateText("CR Settings", menu, ref val, 60, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
Slider val2 = default(Slider);
MenuHandler.CreateSlider("SFX Volume", menu, 50, 0f, 1f, globalVolMute.Value, (UnityAction<float>)GlobalVolAction, ref val2, false, (Color?)null, (Direction)0, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
MenuHandler.CreateToggle(crSpecialVFX.Value, "VFX Toggle", menu, (UnityAction<bool>)GlobalVFXAction, 50, true, (Color?)null, (TMP_FontAsset)null, (Material)null, (TextAlignmentOptions?)null);
}
}
}
namespace CR.Patches
{
[Serializable]
[HarmonyPatch(typeof(Player), "FullReset")]
internal class PlayerPatchFullReset
{
private static void Prefix(Player __instance)
{
CustomEffects.DestroyAllEffects(((Component)__instance).gameObject);
__instance.data.currentCards = new List<CardInfo>();
}
}
[Serializable]
[HarmonyPatch(typeof(Gun), "ResetStats")]
internal class GunPatchResetStats
{
private static void Prefix(Gun __instance)
{
CustomEffects.DestroyAllEffects(((Component)__instance).gameObject);
__instance.player.data.currentCards = new List<CardInfo>();
}
}
[Serializable]
[HarmonyPatch(typeof(Block), "ResetStats")]
internal class BlockPatchResetStats
{
private static void Prefix(Block __instance)
{
CustomEffects.DestroyAllEffects(((Component)__instance).gameObject);
}
}
[Serializable]
[HarmonyPatch(typeof(CharacterStatModifiers), "ResetStats")]
internal class CharacterStatModifiersPatchResetStats
{
private static void Prefix(CharacterStatModifiers __instance)
{
CustomEffects.DestroyAllEffects(((Component)__instance).gameObject);
}
}
[Serializable]
[HarmonyPatch(typeof(CustomCard), "OnRemoveCard")]
internal class CustomCardOnRemoveCard
{
private static void Prefix(Player __instance)
{
CustomEffects.DestroyAllEffects(((Component)__instance).gameObject);
}
}
}
namespace CR.MonoBehaviors
{
public class ShockMono : RayHitPoison
{
[Header("Sounds")]
public SoundEvent soundEventDamageOverTime;
[Header("Settings")]
public float time = 1f;
public float interval = 0.2f;
public Color color = Color.yellow;
private void Start()
{
if ((Object)(object)((Component)this).GetComponentInParent<ProjectileHit>() != (Object)null)
{
((Component)this).GetComponentInParent<ProjectileHit>().bulletCanDealDeamage = false;
}
}
public override HasToReturn DoHitEffect(HitInfo hit)
{
//IL_0048: 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_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: 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)
//IL_006b: 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)
if (Object.op_Implicit((Object)(object)hit.transform))
{
RayHitPoison[] componentsInChildren = ((Component)((Component)this).transform.root).GetComponentsInChildren<RayHitPoison>();
ProjectileHit componentInParent = ((Component)this).GetComponentInParent<ProjectileHit>();
DamageOverTime component = ((Component)hit.transform).GetComponent<DamageOverTime>();
if (Object.op_Implicit((Object)(object)component))
{
component.TakeDamageOverTime(Vector2.op_Implicit(componentInParent.damage * ((Component)this).transform.forward / (float)componentsInChildren.Length), Vector2.op_Implicit(((Component)this).transform.position), time, interval, color, soundEventDamageOverTime, ((Component)this).GetComponentInParent<ProjectileHit>().ownWeapon, ((Component)this).GetComponentInParent<ProjectileHit>().ownPlayer, true);
}
return (HasToReturn)1;
}
return (HasToReturn)1;
}
public void Destroy()
{
Object.Destroy((Object)(object)this);
}
}
public class StunMono : RayHitEffect
{
private Random rand;
private int chance;
public static SoundEvent fieldsound;
private SoundParameterIntensity soundParameterIntensity = new SoundParameterIntensity(0.8f, (UpdateMode)0);
private void Start()
{
}
public void Destroy()
{
Object.Destroy((Object)(object)this);
}
public override HasToReturn DoHitEffect(HitInfo hit)
{
//IL_0128: Unknown result type (might be due to invalid IL or missing references)
//IL_0243: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)hit.transform))
{
ProjectileHit componentInParent = ((Component)this).GetComponentInParent<ProjectileHit>();
StunHandler component = ((Component)hit.transform).GetComponent<StunHandler>();
Player component2 = ((Component)hit.transform).GetComponent<Player>();
rand = new Random();
if (Object.op_Implicit((Object)(object)component2) && component2.data.view.IsMine)
{
chance = rand.Next(1, 101);
if (componentInParent.damage >= 25f)
{
if (Object.op_Implicit((Object)(object)component) && chance <= 25)
{
NetworkingManager.RPC(typeof(StunMono), "RPCA_StunPlayer", new object[2] { 1f, component2.playerID });
if (!Object.op_Implicit((Object)(object)fieldsound))
{
AudioClip val = CR.ArtAsset.LoadAsset<AudioClip>("stun");
SoundContainer val2 = ScriptableObject.CreateInstance<SoundContainer>();
val2.audioClip[0] = val;
val2.setting.volumeIntensityEnable = true;
fieldsound = ScriptableObject.CreateInstance<SoundEvent>();
fieldsound.soundContainerArray[0] = val2;
}
soundParameterIntensity.intensity = ((Component)this).transform.localScale.x * Optionshandler.vol_Master * Optionshandler.vol_Sfx / 1.2f * CR.globalVolMute.Value;
SoundManager.Instance.Play(fieldsound, ((Component)this).transform, (SoundParameterBase[])(object)new SoundParameterBase[1] { (SoundParameterBase)soundParameterIntensity });
}
}
else if (Object.op_Implicit((Object)(object)component) && (float)chance <= 25f && component2.data.view.IsMine)
{
NetworkingManager.RPC(typeof(StunMono), "RPCA_StunPlayer", new object[2] { 0.7f, component2.playerID });
if (!Object.op_Implicit((Object)(object)fieldsound))
{
AudioClip val3 = CR.ArtAsset.LoadAsset<AudioClip>("stun");
SoundContainer val4 = ScriptableObject.CreateInstance<SoundContainer>();
val4.audioClip[0] = val3;
val4.setting.volumeIntensityEnable = true;
fieldsound = ScriptableObject.CreateInstance<SoundEvent>();
fieldsound.soundContainerArray[0] = val4;
}
soundParameterIntensity.intensity = ((Component)this).transform.localScale.x * Optionshandler.vol_Master * Optionshandler.vol_Sfx / 1.2f * CR.globalVolMute.Value;
SoundManager.Instance.Play(fieldsound, ((Component)this).transform, (SoundParameterBase[])(object)new SoundParameterBase[1] { (SoundParameterBase)soundParameterIntensity });
}
}
return (HasToReturn)1;
}
return (HasToReturn)1;
}
[UnboundRPC]
private static void RPCA_StunPlayer(float duration, int playerID)
{
ExtensionMethods.GetPlayerWithID(PlayerManager.instance, playerID).data.stunHandler.AddStun(duration);
}
}
public class MosquitoMono : RayHitPoison
{
[Header("Sounds")]
public SoundEvent soundEventDamageOverTime;
[Header("Settings")]
public float time = 2f;
public float interval = 0.5f;
public Color color = Color.red;
private void Start()
{
if ((Object)(object)((Component)this).GetComponentInParent<ProjectileHit>() != (Object)null)
{
((Component)this).GetComponentInParent<ProjectileHit>().bulletCanDealDeamage = false;
}
}
public override HasToReturn DoHitEffect(HitInfo hit)
{
//IL_0048: 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_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: 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)
//IL_006b: 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)
if (Object.op_Implicit((Object)(object)hit.transform))
{
RayHitPoison[] componentsInChildren = ((Component)((Component)this).transform.root).GetComponentsInChildren<RayHitPoison>();
ProjectileHit componentInParent = ((Component)this).GetComponentInParent<ProjectileHit>();
DamageOverTime component = ((Component)hit.transform).GetComponent<DamageOverTime>();
if (Object.op_Implicit((Object)(object)component))
{
component.TakeDamageOverTime(Vector2.op_Implicit(componentInParent.damage * ((Component)this).transform.forward / (float)componentsInChildren.Length), Vector2.op_Implicit(((Component)this).transform.position), time, interval, color, soundEventDamageOverTime, ((Component)this).GetComponentInParent<ProjectileHit>().ownWeapon, ((Component)this).GetComponentInParent<ProjectileHit>().ownPlayer, true);
}
return (HasToReturn)1;
}
return (HasToReturn)1;
}
public void Destroy()
{
Object.Destroy((Object)(object)this);
}
}
public class BeetleMono : MonoBehaviour
{
internal Player player;
internal Gun gun;
internal GunAmmo gunAmmo;
internal Gravity gravity;
internal HealthHandler healthHandler;
internal CharacterData data;
internal Block block;
private readonly float updateDelay = 0.1f;
private float startTime;
public int numcheck;
public bool active;
private void Start()
{
data = ((Component)this).GetComponentInParent<CharacterData>();
HealthHandler obj = data.healthHandler;
obj.reviveAction = (Action)Delegate.Combine(obj.reviveAction, new Action(ResetTimer));
}
private void OnDestroy()
{
HealthHandler obj = data.healthHandler;
obj.reviveAction = (Action)Delegate.Combine(obj.reviveAction, new Action(ResetTimer));
}
public void Destroy()
{
Object.Destroy((Object)(object)this);
}
public void Awake()
{
player = ((Component)this).gameObject.GetComponent<Player>();
gun = ((Component)((Component)player).GetComponent<Holding>().holdable).GetComponent<Gun>();
data = ((Component)player).GetComponent<CharacterData>();
healthHandler = ((Component)player).GetComponent<HealthHandler>();
gravity = ((Component)player).GetComponent<Gravity>();
block = ((Component)player).GetComponent<Block>();
gunAmmo = ((Component)gun).GetComponentInChildren<GunAmmo>();
numcheck = 0;
}
private void Update()
{
if (!(Time.time >= startTime + updateDelay))
{
return;
}
ResetTimer();
for (int i = 0; i <= player.data.currentCards.Count - 1; i++)
{
if (player.data.currentCards[i].cardName == "Beetle")
{
numcheck++;
}
}
if (numcheck > 0)
{
ResetTimer();
if (player.data.health < player.data.maxHealth && !active)
{
active = true;
((Component)((Component)player).transform).gameObject.AddComponent<BeetleRegenMono>();
}
}
}
private void ResetTimer()
{
startTime = Time.time;
numcheck = 0;
}
}
public class BeetleRegenMono : ReversibleEffect
{
private readonly Color color = Color.blue;
private ReversibleColorEffect colorEffect;
private BeetleMono effect;
private readonly float updateDelay = 0.1f;
private float startTime;
public override void OnOnEnable()
{
}
public override void OnStart()
{
HealthHandler healthHandler = base.player.data.healthHandler;
healthHandler.regeneration += 5f;
effect = ((Component)base.player).GetComponent<BeetleMono>();
ResetTimer();
}
public override void OnUpdate()
{
if (Time.time >= startTime + updateDelay)
{
ResetTimer();
if (base.player.data.health >= base.player.data.maxHealth)
{
((ReversibleEffect)this).Destroy();
}
if (((Component)this).GetComponent<Player>().data.dead || ((Component)this).GetComponent<Player>().data.health <= 0f || !((Component)((Component)this).GetComponent<Player>()).gameObject.activeInHierarchy)
{
ResetTimer();
((ReversibleEffect)this).Destroy();
}
}
}
public override void OnOnDisable()
{
}
public override void OnOnDestroy()
{
effect.active = false;
if (base.player.data.healthHandler.regeneration >= 5f)
{
HealthHandler healthHandler = base.player.data.healthHandler;
healthHandler.regeneration -= 5f;
}
}
private void ResetTimer()
{
startTime = Time.time;
}
}
public class FearFactorMono : MonoBehaviour
{
private class DestroyOnUnparent : MonoBehaviour
{
private void Update()
{
object obj;
if (this == null)
{
obj = null;
}
else
{
Transform transform = ((Component)this).transform;
obj = ((transform != null) ? transform.parent : null);
}
if ((Object)obj == (Object)null)
{
Object.Destroy((Object)(object)this);
}
}
}
private Player player;
private static GameObject lineEffect;
public LineEffect componentInChildren;
public GameObject fearEffect;
public GameObject factorObject;
private readonly float updateDelay = 0.1f;
private readonly float effectCooldown = 1f;
private readonly float maxDistance = 7.1f;
private float startTime;
private float timeOfLastEffect;
private int numcheck;
private void Awake()
{
player = ((Component)this).GetComponent<Player>();
}
private void Start()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Expected O, but got Unknown
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: Expected O, but got Unknown
//IL_00c8: Unknown result type (might be due to invalid IL or missing references)
//IL_00cd: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00ea: Unknown result type (might be due to invalid IL or missing references)
//IL_00ef: Unknown result type (might be due to invalid IL or missing references)
ResetEffectTimer();
ResetTimer();
factorObject = new GameObject();
factorObject.transform.SetParent(((Component)player).transform);
factorObject.transform.position = ((Component)player).transform.position;
factorObject.AddComponent<DestroyOnUnparent>();
if ((Object)(object)lineEffect == (Object)null)
{
GetLineEffect();
}
fearEffect = Object.Instantiate<GameObject>(lineEffect, factorObject.transform);
fearEffect.AddComponent<DestroyOnUnparent>();
componentInChildren = fearEffect.GetComponentInChildren<LineEffect>();
LineEffect obj = componentInChildren;
Gradient val = new Gradient();
val.alphaKeys = (GradientAlphaKey[])(object)new GradientAlphaKey[1]
{
new GradientAlphaKey(0.7f, 0f)
};
val.colorKeys = (GradientColorKey[])(object)new GradientColorKey[1]
{
new GradientColorKey(Color.red, 0f)
};
val.mode = (GradientMode)1;
obj.colorOverTime = val;
componentInChildren.widthMultiplier = 1f;
componentInChildren.radius = 3f;
componentInChildren.raycastCollision = true;
componentInChildren.useColorOverTime = true;
}
private void GetLineEffect()
{
lineEffect = ((Component)((Component)CardChoice.instance.cards.First((CardInfo c) => ((Object)c).name.Equals("ChillingPresence"))).gameObject.GetComponentInChildren<CharacterStatModifiers>().AddObjectToPlayer.GetComponentInChildren<LineEffect>()).gameObject;
}
public void Destroy()
{
componentInChildren.Stop();
Object.Destroy((Object)(object)factorObject);
Object.Destroy((Object)(object)fearEffect);
Object.Destroy((Object)(object)componentInChildren);
Object.Destroy((Object)(object)this);
}
private void OnDestroy()
{
LineEffect obj = componentInChildren;
if (obj != null)
{
obj.Stop();
}
if ((Object)(object)componentInChildren != (Object)null)
{
Object.Destroy((Object)(object)componentInChildren);
}
Object.Destroy((Object)(object)factorObject);
Object.Destroy((Object)(object)fearEffect);
}
private void Update()
{
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
if (!(Time.time >= startTime + updateDelay))
{
return;
}
for (int i = 0; i <= player.data.currentCards.Count - 1; i++)
{
if (player.data.currentCards[i].cardName == "Fear Factor")
{
numcheck++;
}
}
if (numcheck > 0)
{
ResetTimer();
if (!(Time.time >= timeOfLastEffect + effectCooldown))
{
return;
}
int mask = LayerMask.GetMask(new string[1] { "Projectile" });
{
foreach (Collider2D item in from uwu in Physics2D.OverlapCircleAll(Vector2.op_Implicit(((Component)this).transform.position), 7.2f, mask)
where (Object)(object)((Component)uwu).gameObject.GetComponentInParent<ProjectileHit>() != (Object)null && (Object)(object)((Component)uwu).gameObject.GetComponentInParent<ProjectileHit>().ownPlayer != (Object)(object)player && PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)uwu).gameObject.transform.position), player).canSee
select uwu)
{
_ = item;
ResetEffectTimer();
((Weapon)player.data.weaponHandler.gun).Attack(0f, true, 0.75f, 1f, false);
}
return;
}
}
Destroy();
}
private void ResetTimer()
{
startTime = Time.time;
numcheck = 0;
}
private void ResetEffectTimer()
{
timeOfLastEffect = Time.time;
}
}
public class CriticalHitMono : RayHitPoison
{
private class CritSpawner : MonoBehaviour
{
private void Start()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
((Component)this).gameObject.transform.localScale = new Vector3(1f, 1f, 1f);
((Component)this).gameObject.AddComponent<RemoveAfterSeconds>().seconds = 1f;
ExtensionMethods.SetFieldValue((object)((Component)((Component)this).gameObject.transform.GetChild(1)).GetComponent<LineEffect>(), "inited", (object)false);
typeof(LineEffect).InvokeMember("Init", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, ((Component)((Component)this).gameObject.transform.GetChild(1)).GetComponent<LineEffect>(), new object[0]);
((Component)((Component)this).gameObject.transform.GetChild(1)).GetComponent<LineEffect>().radius = 4f;
ExtensionMethods.SetFieldValue((object)((Component)((Component)this).gameObject.transform.GetChild(1)).GetComponent<LineEffect>(), "startWidth", (object)0.5f);
((Component)((Component)this).gameObject.transform.GetChild(1)).GetComponent<LineEffect>().Play();
}
}
[Header("Sounds")]
public SoundEvent soundEventDamageOverTime;
[Header("Settings")]
public float time = 0.1f;
public float interval = 0.1f;
public Color color = new Color(1f, 1f, 0f, 1f);
private Random rand;
private int chance;
private int truechance;
public CriticalMono crit;
private static GameObject critvisual;
public static SoundEvent fieldsound;
private SoundParameterIntensity soundParameterIntensity = new SoundParameterIntensity(0.8f, (UpdateMode)0);
public static GameObject critVisual
{
get
{
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_0160: Unknown result type (might be due to invalid IL or missing references)
//IL_0165: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)critvisual != (Object)null)
{
return critvisual;
}
List<CardInfo> first = ((ObservableCollection<CardInfo>)typeof(CardManager).GetField("activeCards", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null)).ToList();
List<CardInfo> second = (List<CardInfo>)typeof(CardManager).GetField("inactiveCards", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null);
critvisual = Object.Instantiate<GameObject>(((Component)(from card in first.Concat(second).ToList()
where card.cardName.ToLower() == "overpower"
select card).First()).GetComponent<CharacterStatModifiers>().AddObjectToPlayer.GetComponent<SpawnObjects>().objectToSpawn[0], new Vector3(0f, 100000f, 0f), Quaternion.identity);
((Object)critvisual).name = "E_Critical";
Object.DontDestroyOnLoad((Object)(object)critvisual);
ParticleSystem[] componentsInChildren = critvisual.GetComponentsInChildren<ParticleSystem>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
componentsInChildren[i].startColor = new Color(0.8f, 1f, 0f, 1f);
}
((Component)critvisual.transform.GetChild(1)).GetComponent<LineEffect>().colorOverTime.colorKeys = (GradientColorKey[])(object)new GradientColorKey[1]
{
new GradientColorKey(new Color(0.8f, 1f, 0f, 1f), 0f)
};
Object.Destroy((Object)(object)((Component)critvisual.transform.GetChild(2)).gameObject);
((Component)critvisual.transform.GetChild(1)).GetComponent<LineEffect>().offsetMultiplier = 0f;
((Component)critvisual.transform.GetChild(1)).GetComponent<LineEffect>().playOnAwake = true;
Object.Destroy((Object)(object)critvisual.GetComponent<FollowPlayer>());
critvisual.GetComponent<DelayEvent>().time = 0f;
Object.Destroy((Object)(object)critvisual.GetComponent<SoundUnityEventPlayer>());
Object.Destroy((Object)(object)critvisual.GetComponent<Explosion>());
Object.Destroy((Object)(object)critvisual.GetComponent<Explosion_Overpower>());
Object.Destroy((Object)(object)critvisual.GetComponent<RemoveAfterSeconds>());
critvisual.AddComponent<CritSpawner>();
return critvisual;
}
set
{
}
}
private void Start()
{
if ((Object)(object)((Component)this).GetComponentInParent<ProjectileHit>() != (Object)null)
{
((Component)this).GetComponentInParent<ProjectileHit>().bulletCanDealDeamage = false;
}
}
public override HasToReturn DoHitEffect(HitInfo hit)
{
//IL_0253: Unknown result type (might be due to invalid IL or missing references)
//IL_0258: Unknown result type (might be due to invalid IL or missing references)
//IL_0261: Unknown result type (might be due to invalid IL or missing references)
//IL_0266: Unknown result type (might be due to invalid IL or missing references)
//IL_0271: Unknown result type (might be due to invalid IL or missing references)
//IL_0276: Unknown result type (might be due to invalid IL or missing references)
//IL_029b: Unknown result type (might be due to invalid IL or missing references)
//IL_0139: Unknown result type (might be due to invalid IL or missing references)
//IL_0176: Unknown result type (might be due to invalid IL or missing references)
//IL_017b: 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_01a9: Unknown result type (might be due to invalid IL or missing references)
//IL_01dd: Unknown result type (might be due to invalid IL or missing references)
//IL_01e2: Unknown result type (might be due to invalid IL or missing references)
//IL_01eb: Unknown result type (might be due to invalid IL or missing references)
//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
//IL_01fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0200: Unknown result type (might be due to invalid IL or missing references)
//IL_0212: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)hit.transform))
{
RayHitPoison[] componentsInChildren = ((Component)((Component)this).transform.root).GetComponentsInChildren<RayHitPoison>();
ProjectileHit componentInParent = ((Component)this).GetComponentInParent<ProjectileHit>();
DamageOverTime component = ((Component)hit.transform).GetComponent<DamageOverTime>();
rand = new Random();
Player component2 = ((Component)hit.transform).GetComponent<Player>();
if (Object.op_Implicit((Object)(object)component2))
{
if (component2.data.view.IsMine)
{
chance = rand.Next(1, 101);
}
Player[] array = PlayerManager.instance.players.ToArray();
for (int i = 0; i < array.Length; i++)
{
if (array[i].data.view.IsMine)
{
truechance = chance;
}
}
if (Object.op_Implicit((Object)(object)component) && truechance >= 51)
{
if (!Object.op_Implicit((Object)(object)fieldsound))
{
AudioClip val = CR.ArtAsset.LoadAsset<AudioClip>("critical");
SoundContainer val2 = ScriptableObject.CreateInstance<SoundContainer>();
val2.audioClip[0] = val;
val2.setting.volumeIntensityEnable = true;
fieldsound = ScriptableObject.CreateInstance<SoundEvent>();
fieldsound.soundContainerArray[0] = val2;
}
soundParameterIntensity.intensity = ((Component)this).transform.localScale.x * Optionshandler.vol_Master * Optionshandler.vol_Sfx / 1.2f * CR.globalVolMute.Value;
SoundManager.Instance.PlayAtPosition(fieldsound, ((Component)this).transform, Vector2.op_Implicit(hit.point), (SoundParameterBase[])(object)new SoundParameterBase[1] { (SoundParameterBase)soundParameterIntensity });
Object.Instantiate<GameObject>(critVisual, ((Component)this).gameObject.transform.position, Quaternion.identity);
crit = ((Component)hit.transform).gameObject.AddComponent<CriticalMono>();
component.TakeDamageOverTime(Vector2.op_Implicit(componentInParent.damage * 2f * ((Component)this).transform.forward / (float)componentsInChildren.Length), Vector2.op_Implicit(((Component)this).transform.position), time, interval, color, soundEventDamageOverTime, ((Component)this).GetComponentInParent<ProjectileHit>().ownWeapon, ((Component)this).GetComponentInParent<ProjectileHit>().ownPlayer, true);
}
else if (Object.op_Implicit((Object)(object)component))
{
component.TakeDamageOverTime(Vector2.op_Implicit(componentInParent.damage * ((Component)this).transform.forward / (float)componentsInChildren.Length), Vector2.op_Implicit(((Component)this).transform.position), time, interval, new Color(1f, 1f, 1f, 1f), soundEventDamageOverTime, ((Component)this).GetComponentInParent<ProjectileHit>().ownWeapon, ((Component)this).GetComponentInParent<ProjectileHit>().ownPlayer, true);
}
}
return (HasToReturn)1;
}
return (HasToReturn)1;
}
public void Destroy()
{
Object.Destroy((Object)(object)this);
}
}
public class FlamethrowerMono : RayHitPoison
{
[Header("Sounds")]
public SoundEvent soundEventDamageOverTime;
[Header("Settings")]
public float time = 1f;
public float interval = 0.25f;
private void Start()
{
if ((Object)(object)((Component)this).GetComponentInParent<ProjectileHit>() != (Object)null)
{
((Component)this).GetComponentInParent<ProjectileHit>().bulletCanDealDeamage = false;
}
}
public override HasToReturn DoHitEffect(HitInfo hit)
{
//IL_0048: 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_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: 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)
//IL_006b: Unknown result type (might be due to invalid IL or missing references)
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)hit.transform))
{
RayHitPoison[] componentsInChildren = ((Component)((Component)this).transform.root).GetComponentsInChildren<RayHitPoison>();
ProjectileHit componentInParent = ((Component)this).GetComponentInParent<ProjectileHit>();
DamageOverTime component = ((Component)hit.transform).GetComponent<DamageOverTime>();
if (Object.op_Implicit((Object)(object)component))
{
component.TakeDamageOverTime(Vector2.op_Implicit(componentInParent.damage * ((Component)this).transform.forward / (float)componentsInChildren.Length), Vector2.op_Implicit(((Component)this).transform.position), time, interval, new Color(1f, 0.3f, 0f, 1f), soundEventDamageOverTime, ((Component)this).GetComponentInParent<ProjectileHit>().ownWeapon, ((Component)this).GetComponentInParent<ProjectileHit>().ownPlayer, true);
}
return (HasToReturn)1;
}
return (HasToReturn)1;
}
public void Destroy()
{
Object.Destroy((Object)(object)this);
}
}
public class BurnMono : HitSurfaceEffect
{
public Block block;
public Player player;
public CharacterData data;
public Gun gun;
public BoxTouchingLava_Mono hotbox;
public static SoundEvent fieldsound;
private SoundParameterIntensity soundParameterIntensity = new SoundParameterIntensity(0.7f, (UpdateMode)0);
private void Awake()
{
player = ((Component)this).GetComponent<Player>();
block = ((Component)this).GetComponent<Block>();
data = ((Component)this).GetComponent<CharacterData>();
gun = ((Component)this).GetComponent<Gun>();
}
public override void Hit(Vector2 position, Vector2 normal, Vector2 velocity)
{
//IL_005a: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Unknown result type (might be due to invalid IL or missing references)
//IL_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: 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_00dd: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
//IL_0171: Unknown result type (might be due to invalid IL or missing references)
//IL_0194: Unknown result type (might be due to invalid IL or missing references)
//IL_01d2: Unknown result type (might be due to invalid IL or missing references)
//IL_01ea: Unknown result type (might be due to invalid IL or missing references)
//IL_0280: Unknown result type (might be due to invalid IL or missing references)
//IL_028a: Unknown result type (might be due to invalid IL or missing references)
//IL_028f: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)fieldsound))
{
AudioClip val = CR.ArtAsset.LoadAsset<AudioClip>("fire");
SoundContainer val2 = ScriptableObject.CreateInstance<SoundContainer>();
val2.audioClip[0] = val;
val2.setting.volumeIntensityEnable = true;
fieldsound = ScriptableObject.CreateInstance<SoundEvent>();
fieldsound.soundContainerArray[0] = val2;
}
soundParameterIntensity.intensity = ((Component)this).transform.localScale.x * Optionshandler.vol_Master * Optionshandler.vol_Sfx / 1.2f * CR.globalVolMute.Value;
SoundManager.Instance.PlayAtPosition(fieldsound, ((Component)this).transform, Vector2.op_Implicit(position), (SoundParameterBase[])(object)new SoundParameterBase[1] { (SoundParameterBase)soundParameterIntensity });
GameObject val3 = Object.Instantiate<GameObject>(((GameObject)Resources.Load("0 cards/Demonic pact")).GetComponent<Gun>().objectsToSpawn[0].effect);
val3.transform.position = Vector2.op_Implicit(position);
((Object)val3).hideFlags = (HideFlags)61;
((Object)val3).name = "Explosion";
val3.AddComponent<RemoveAfterSeconds>().seconds = 2f;
ParticleSystem[] componentsInChildren = val3.GetComponentsInChildren<ParticleSystem>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
componentsInChildren[i].startColor = new Color(1f, 0.8f, 0.1f, 1f);
}
ParticleSystemRenderer[] componentsInChildren2 = val3.GetComponentsInChildren<ParticleSystemRenderer>();
foreach (ParticleSystemRenderer obj in componentsInChildren2)
{
((Renderer)obj).material.color = new Color(1f, 0.8f, 0.1f, 1f);
((Renderer)obj).sharedMaterial.color = new Color(1f, 0.8f, 0.1f, 1f);
}
Material[] componentsInChildren3 = val3.GetComponentsInChildren<Material>();
for (int i = 0; i < componentsInChildren3.Length; i++)
{
componentsInChildren3[i].color = new Color(1f, 0.8f, 0.1f, 1f);
}
foreach (Collider2D item in from uwu in Physics2D.OverlapCircleAll(position, 3f)
where !Object.op_Implicit((Object)(object)((Component)uwu).gameObject.GetComponentInParent<ProjectileHit>()) && !Object.op_Implicit((Object)(object)((Component)uwu).gameObject.GetComponent<Player>()) && Object.op_Implicit((Object)(object)((Component)uwu).GetComponent<Rigidbody2D>())
select uwu)
{
if (item.attachedRigidbody.isKinematic || ((Component)item.attachedRigidbody).gameObject.layer == LayerMask.NameToLayer("BackgroundObject"))
{
continue;
}
if (Object.op_Implicit((Object)(object)((Component)item.attachedRigidbody).GetComponent<DamagableEvent>()))
{
((Damagable)((Component)item.attachedRigidbody).GetComponent<DamagableEvent>()).CallTakeDamage(Vector2.up * 2f, Vector2.zero, (GameObject)null, (Player)null, true);
continue;
}
if (!Object.op_Implicit((Object)(object)((Component)item.attachedRigidbody).gameObject.GetComponent<BoxTouchingLava_Mono>()))
{
hotbox = ((Component)item.attachedRigidbody).gameObject.AddComponent<BoxTouchingLava_Mono>();
}
else
{
hotbox = ((Component)item.attachedRigidbody).gameObject.GetComponent<BoxTouchingLava_Mono>();
}
BoxTouchingLava_Mono obj2 = hotbox;
obj2.heatPercent += 0.25f;
hotbox.heatPercent = Mathf.Min(hotbox.heatPercent, 1f);
}
}
}
public class SyphonMono : RayHitEffect
{
private class SyphSpawner : MonoBehaviour
{
private void Start()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
((Component)this).gameObject.transform.localScale = new Vector3(1f, 1f, 1f);
((Component)this).gameObject.AddComponent<RemoveAfterSeconds>().seconds = 1f;
ExtensionMethods.SetFieldValue((object)((Component)((Component)this).gameObject.transform.GetChild(1)).GetComponent<LineEffect>(), "inited", (object)false);
typeof(LineEffect).InvokeMember("Init", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, ((Component)((Component)this).gameObject.transform.GetChild(1)).GetComponent<LineEffect>(), new object[0]);
((Component)((Component)this).gameObject.transform.GetChild(1)).GetComponent<LineEffect>().radius = 4f;
ExtensionMethods.SetFieldValue((object)((Component)((Component)this).gameObject.transform.GetChild(1)).GetComponent<LineEffect>(), "startWidth", (object)0.5f);
((Component)((Component)this).gameObject.transform.GetChild(1)).GetComponent<LineEffect>().Play();
}
}
private Random rand;
public int chance = 100;
private int truechance = 100;
private static GameObject syphvisual;
public static SoundEvent fieldsound;
private SoundParameterIntensity soundParameterIntensity = new SoundParameterIntensity(0.6f, (UpdateMode)0);
public static GameObject syphonVisual
{
get
{
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_010c: Unknown result type (might be due to invalid IL or missing references)
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_0160: Unknown result type (might be due to invalid IL or missing references)
//IL_0165: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)syphvisual != (Object)null)
{
return syphvisual;
}
List<CardInfo> first = ((ObservableCollection<CardInfo>)typeof(CardManager).GetField("activeCards", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null)).ToList();
List<CardInfo> second = (List<CardInfo>)typeof(CardManager).GetField("inactiveCards", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null);
syphvisual = Object.Instantiate<GameObject>(((Component)(from card in first.Concat(second).ToList()
where card.cardName.ToLower() == "overpower"
select card).First()).GetComponent<CharacterStatModifiers>().AddObjectToPlayer.GetComponent<SpawnObjects>().objectToSpawn[0], new Vector3(0f, 100000f, 0f), Quaternion.identity);
((Object)syphvisual).name = "E_Syphon";
Object.DontDestroyOnLoad((Object)(object)syphvisual);
ParticleSystem[] componentsInChildren = syphvisual.GetComponentsInChildren<ParticleSystem>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
componentsInChildren[i].startColor = new Color(1f, 0.3f, 0.8f, 1f);
}
((Component)syphvisual.transform.GetChild(1)).GetComponent<LineEffect>().colorOverTime.colorKeys = (GradientColorKey[])(object)new GradientColorKey[1]
{
new GradientColorKey(new Color(1f, 0.3f, 0.8f, 1f), 0f)
};
Object.Destroy((Object)(object)((Component)syphvisual.transform.GetChild(2)).gameObject);
((Component)syphvisual.transform.GetChild(1)).GetComponent<LineEffect>().offsetMultiplier = 0f;
((Component)syphvisual.transform.GetChild(1)).GetComponent<LineEffect>().playOnAwake = true;
Object.Destroy((Object)(object)syphvisual.GetComponent<FollowPlayer>());
syphvisual.GetComponent<DelayEvent>().time = 0f;
Object.Destroy((Object)(object)syphvisual.GetComponent<SoundUnityEventPlayer>());
Object.Destroy((Object)(object)syphvisual.GetComponent<Explosion>());
Object.Destroy((Object)(object)syphvisual.GetComponent<Explosion_Overpower>());
Object.Destroy((Object)(object)syphvisual.GetComponent<RemoveAfterSeconds>());
syphvisual.AddComponent<SyphSpawner>();
return syphvisual;
}
set
{
}
}
private void Start()
{
}
public void Destroy()
{
Object.Destroy((Object)(object)this);
}
public override HasToReturn DoHitEffect(HitInfo hit)
{
if (Object.op_Implicit((Object)(object)hit.transform))
{
ProjectileHit componentInParent = ((Component)this).GetComponentInParent<ProjectileHit>();
((Component)hit.transform).GetComponent<SilenceHandler>();
rand = new Random();
Player component = ((Component)hit.transform).GetComponent<Player>();
if (Object.op_Implicit((Object)(object)component) && component.data.view.IsMine)
{
chance = rand.Next(1, 101);
NetworkingManager.RPC(typeof(SyphonMono), "SyncChance", new object[3] { component.playerID, componentInParent.damage, chance });
}
return (HasToReturn)1;
}
return (HasToReturn)1;
}
[UnboundRPC]
public static void SyncChance(int playerID, float damage, int chance = 0)
{
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Expected O, but got Unknown
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Expected O, but got Unknown
//IL_011b: 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)
Player val = (Player)typeof(PlayerManager).InvokeMember("GetPlayerWithID", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, PlayerManager.instance, new object[1] { playerID });
if (chance >= 50)
{
if (!Object.op_Implicit((Object)(object)fieldsound))
{
AudioClip val2 = CR.ArtAsset.LoadAsset<AudioClip>("syphon");
SoundContainer val3 = ScriptableObject.CreateInstance<SoundContainer>();
val3.audioClip[0] = val2;
val3.setting.volumeIntensityEnable = true;
fieldsound = ScriptableObject.CreateInstance<SoundEvent>();
fieldsound.soundContainerArray[0] = val3;
}
SoundParameterIntensity val4 = new SoundParameterIntensity(0.6f, (UpdateMode)0);
val4.intensity = Optionshandler.vol_Master * Optionshandler.vol_Sfx / 1.2f * CR.globalVolMute.Value;
SoundManager.Instance.Play(fieldsound, ((Component)val).transform, (SoundParameterBase[])(object)new SoundParameterBase[1] { (SoundParameterBase)val4 });
if (damage >= 21f)
{
val.data.silenceHandler.RPCA_AddSilence(1.5f);
}
else
{
val.data.silenceHandler.RPCA_AddSilence(0.8f);
}
Object.Instantiate<GameObject>(syphonVisual, ((Component)val).gameObject.transform.position, Quaternion.identity);
}
}
}
public class TaserMono : MonoBehaviour
{
private class TaserSpawner : MonoBehaviour
{
private void Start()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
((Component)this).gameObject.transform.localScale = new Vector3(1f, 1f, 1f);
((Component)this).gameObject.AddComponent<RemoveAfterSeconds>().seconds = 1.5f;
ExtensionMethods.SetFieldValue((object)((Component)((Component)this).gameObject.transform.GetChild(1)).GetComponent<LineEffect>(), "inited", (object)false);
typeof(LineEffect).InvokeMember("Init", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.InvokeMethod, null, ((Component)((Component)this).gameObject.transform.GetChild(1)).GetComponent<LineEffect>(), new object[0]);
((Component)((Component)this).gameObject.transform.GetChild(1)).GetComponent<LineEffect>().radius = 4.4f;
ExtensionMethods.SetFieldValue((object)((Component)((Component)this).gameObject.transform.GetChild(1)).GetComponent<LineEffect>(), "startWidth", (object)1f);
((Component)((Component)this).gameObject.transform.GetChild(1)).GetComponent<LineEffect>().Play();
}
}
private readonly float maxDistance = 8.2f;
public Block block;
public Player player;
public CharacterData data;
private Action<BlockTriggerType> taser;
private Action<BlockTriggerType> basic;
private static GameObject taserVisu;
private readonly float updateDelay = 0.1f;
private readonly float effectCooldown = 1f;
private float startTime;
private float timeOfLastEffect;
private bool canTrigger;
private bool hasTriggered;
public int numcheck;
public static SoundEvent fieldsound;
private SoundParameterIntensity soundParameterIntensity = new SoundParameterIntensity(0.5f, (UpdateMode)0);
public static GameObject taserVisual
{
get
{
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: 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)
//IL_013d: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)taserVisu != (Object)null)
{
return taserVisu;
}
List<CardInfo> first = ((ObservableCollection<CardInfo>)typeof(CardManager).GetField("activeCards", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null)).ToList();
List<CardInfo> second = (List<CardInfo>)typeof(CardManager).GetField("inactiveCards", BindingFlags.Static | BindingFlags.NonPublic).GetValue(null);
taserVisu = Object.Instantiate<GameObject>(((Component)(from card in first.Concat(second).ToList()
where card.cardName.ToLower() == "overpower"
select card).First()).GetComponent<CharacterStatModifiers>().AddObjectToPlayer.GetComponent<SpawnObjects>().objectToSpawn[0], new Vector3(0f, 100000f, 0f), Quaternion.identity);
((Object)taserVisu).name = "E_Taser";
Object.DontDestroyOnLoad((Object)(object)taserVisu);
ParticleSystem[] componentsInChildren = taserVisu.GetComponentsInChildren<ParticleSystem>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
componentsInChildren[i].startColor = Color.yellow;
}
((Component)taserVisu.transform.GetChild(1)).GetComponent<LineEffect>().colorOverTime.colorKeys = (GradientColorKey[])(object)new GradientColorKey[1]
{
new GradientColorKey(Color.yellow, 0f)
};
Object.Destroy((Object)(object)((Component)taserVisu.transform.GetChild(2)).gameObject);
((Component)taserVisu.transform.GetChild(1)).GetComponent<LineEffect>().offsetMultiplier = 0f;
((Component)taserVisu.transform.GetChild(1)).GetComponent<LineEffect>().playOnAwake = true;
Object.Destroy((Object)(object)taserVisu.GetComponent<FollowPlayer>());
taserVisu.GetComponent<DelayEvent>().time = 0f;
Object.Destroy((Object)(object)taserVisu.GetComponent<SoundUnityEventPlayer>());
Object.Destroy((Object)(object)taserVisu.GetComponent<Explosion>());
Object.Destroy((Object)(object)taserVisu.GetComponent<Explosion_Overpower>());
Object.Destroy((Object)(object)taserVisu.GetComponent<RemoveAfterSeconds>());
taserVisu.AddComponent<TaserSpawner>();
return taserVisu;
}
set
{
}
}
private void Start()
{
player = ((Component)this).GetComponent<Player>();
block = ((Component)this).GetComponent<Block>();
data = ((Component)this).GetComponent<CharacterData>();
ResetEffectTimer();
ResetTimer();
canTrigger = true;
hasTriggered = false;
basic = block.BlockAction;
numcheck = 0;
if (Object.op_Implicit((Object)(object)block))
{
taser = GetDoBlockAction(player, block).Invoke;
block.FirstBlockActionThatDelaysOthers = (Action<BlockTriggerType>)Delegate.Combine(block.FirstBlockActionThatDelaysOthers, taser);
block.delayOtherActions = true;
}
}
public void Destroy()
{
Object.Destroy((Object)(object)this);
}
public void OnDestroy()
{
block.BlockAction = basic;
}
private void Update()
{
if (!(Time.time >= startTime + updateDelay))
{
return;
}
for (int i = 0; i <= player.data.currentCards.Count - 1; i++)
{
if (player.data.currentCards[i].cardName == "Taser")
{
numcheck++;
}
}
if (numcheck > 0)
{
ResetTimer();
if (Time.time >= timeOfLastEffect + effectCooldown)
{
canTrigger = true;
}
else
{
canTrigger = false;
}
}
else
{
Object.Destroy((Object)(object)this);
}
}
public Action<BlockTriggerType> GetDoBlockAction(Player player, Block block)
{
return delegate(BlockTriggerType trigger)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Invalid comparison between Unknown and I4
//IL_0070: 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)
//IL_00fa: Unknown result type (might be due to invalid IL or missing references)
//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0104: 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)
//IL_0142: Unknown result type (might be due to invalid IL or missing references)
//IL_0147: 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)
if ((int)trigger != 1)
{
if (!Object.op_Implicit((Object)(object)fieldsound))
{
AudioClip val = CR.ArtAsset.LoadAsset<AudioClip>("taser");
SoundContainer val2 = ScriptableObject.CreateInstance<SoundContainer>();
val2.audioClip[0] = val;
val2.setting.volumeIntensityEnable = true;
fieldsound = ScriptableObject.CreateInstance<SoundEvent>();
fieldsound.soundContainerArray[0] = val2;
}
soundParameterIntensity.intensity = ((Component)this).transform.localScale.x * Optionshandler.vol_Master * Optionshandler.vol_Sfx / 1.2f * CR.globalVolMute.Value;
SoundManager.Instance.Play(fieldsound, ((Component)this).transform, (SoundParameterBase[])(object)new SoundParameterBase[1] { (SoundParameterBase)soundParameterIntensity });
Object.Instantiate<GameObject>(taserVisual, ((Component)this.player).transform.position, Quaternion.identity);
Vector2 val3 = Vector2.op_Implicit(((Component)block).transform.position);
Player[] array = PlayerManager.instance.players.ToArray();
for (int i = 0; i < array.Length; i++)
{
if (array[i].teamID != player.teamID && Vector2.Distance(val3, Vector2.op_Implicit(((Component)array[i]).transform.position)) < maxDistance && PlayerManager.instance.CanSeePlayer(Vector2.op_Implicit(((Component)player).transform.position), array[i]).canSee)
{
((Component)((Component)array[i]).transform).GetComponent<StunHandler>();
((Component)((Component)array[i]).transform).GetComponent<DamageOverTime>();
if (canTrigger)
{
NetworkingManager.RPC(typeof(StunMono), "RPCA_StunPlayer", new object[2]
{
0.75f,
array[i].playerID
});
hasTriggered = true;
}
}
}
if (hasTriggered)
{
hasTriggered = false;
canTrigger = false;
ResetEffectTimer();
}
}
};
}
private void ResetTimer()
{
startTime = Time.time;
numcheck = 0;
}
private void ResetEffectTimer()
{
timeOfLastEffect = Time.time;
}
}
public class HolsterMono : MonoBehaviour
{
public Block block;
public Player player;
public CharacterData data;
public Gun gun;
private Action<BlockTriggerType> handgun;
private Action<BlockTriggerType> basic;
private readonly float updateDelay = 0.1f;
private float startTime;
public int numcheck;
private void Awake()
{
player = ((Component)this).GetComponent<Player>();
block = ((Component)this).GetComponent<Block>();
data = ((Component)this).GetComponent<CharacterData>();
gun = ((Component)this).GetComponent<Gun>();
basic = block.BlockAction;
numcheck = 0;
if (Object.op_Implicit((Object)(object)block))
{
handgun = GetDoBlockAction(player, block, data).Invoke;
block.BlockAction = (Action<BlockTriggerType>)Delegate.Combine(block.BlockAction, handgun);
}
}
private void Update()
{
if (!(Time.time >= startTime + updateDelay))
{
return;
}
for (int i = 0; i <= player.data.currentCards.Count - 1; i++)
{
if (player.data.currentCards[i].cardName == "Holster")
{
numcheck++;
}
}
if (numcheck > 0)
{
ResetTimer();
}
else
{
Object.Destroy((Object)(object)this);
}
}
private void ResetTimer()
{
startTime = Time.time;
numcheck = 0;
}
public void Destroy()
{
Object.Destroy((Object)(object)this);
}
public void OnDestroy()
{
block.BlockAction = basic;
}
public Action<BlockTriggerType> GetDoBlockAction(Player player, Block block, CharacterData data)
{
return delegate(BlockTriggerType trigger)
{
//IL_0000: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Invalid comparison between Unknown and I4
if ((int)trigger != 1)
{
((Weapon)this.player.data.weaponHandler.gun).Attack(1E-05f, true, 2f, 1f, false);
MitosisMono[] components = ((Component)this.player).GetComponents<MitosisMono>();
foreach (MitosisMono mitosisMono in components)
{
if ((Object)(object)mitosisMono != (Object)null)
{
mitosisMono.Failsafe = false;
mitosisMono.Active = false;
}
}
HiveMono[] components2 = ((Component)this.player).GetComponents<HiveMono>();
foreach (HiveMono hiveMono in components2)
{
if ((Object)(object)hiveMono != (Object)null)
{
hiveMono.Failsafe = false;
hiveMono.Active = false;
}
}
MitosisBlockMono[] components3 = ((Component)this.player).GetComponents<MitosisBlockMono>();
foreach (MitosisBlockMono mitosisBlockMono in components3)
{
if ((Object)(object)mitosisBlockMono != (Object)null)
{
((ReversibleEffect)mitosisBlockMono).Destroy();
}
}
HiveBlockMono[] components4 = ((Component)this.player).GetComponents<HiveBlockMono>();
foreach (HiveBlockMono hiveBlockMono in components4)
{
if ((Object)(object)hiveBlockMono != (Object)null)
{
((ReversibleEffect)hiveBlockMono).Destroy();
}
}
}
};
}
}
public class FlexMono : DealtDamageEffect
{
private Player player;
private CharacterData data;
private Block block;
private readonly float updateDelay = 0.1f;
private readonly float effectCooldown = 3f;
private float startTime;
private float timeOfLastEffect;
private bool canTrigger;
public int numcheck;
private void Start()
{
ResetEffectTimer();
ResetTimer();
canTrigger = true;
numcheck = 0;
}
public void Destroy()
{
Object.Destroy((Object)(object)this);
}
private void Update()
{
//IL_00c7: 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)
if (!(Time.time >= startTime + updateDelay))
{
return;
}
ResetTimer();
int i = 0;
if (player.data.currentCards != null)
{
for (; i <= player.data.currentCards.Count - 1; i++)
{
if (player.data.currentCards[i].cardName == "Flex")
{
numcheck++;
}
}
}
if (numcheck > 0)
{
if (Time.time >= timeOfLastEffect + effectCooldown)
{
if (!canTrigger)
{
canTrigger = true;
player.data.block.RPCA_DoBlock(false, true, (BlockTriggerType)0, default(Vector3), false);
ResetEffectTimer();
}
canTrigger = true;
}
else
{
canTrigger = true;
}
}
else
{
Object.Destroy((Object)(object)this);
}
}
public override void DealtDamage(Vector2 damage, bool selfDamage, Player damagedPlayer = null)
{
player = ((Component)this).gameObject.GetComponent<Player>();
data = ((Component)player).GetComponent<CharacterData>();
block = ((Component)player).GetComponent<Block>();
if (canTrigger)
{
canTrigger = false;
}
}
private void ResetTimer()
{
startTime = Time.time;
numcheck = 0;
}
private void ResetEffectTimer()
{
timeOfLastEffect = Time.time;
numcheck = 0;
}
}
public class DroneMono : MonoBehaviour
{
[Header("Sound")]
public SoundEvent soundHomingFound;
private bool soundHomingCanPlay = true;
[Header("Settings")]
public float amount = 1f;
public float scalingDrag = 0.85f;
private SyncProjectile sync;
public float drag = 0.85f;
public float spread = 1f;
private MoveTransform move;
private bool isOn;
public RotSpring rot1;
public RotSpring rot2;
private FlickerEvent[] flicks;
private PhotonView view;
private SoundEvent soundSpawn;
public static SoundEvent fieldsound;
private Player closestPlayer;
private bool flag;
private SoundParameterIntensity soundParameterIntensity = new SoundParameterIntensity(0.5f, (UpdateMode)0);
private void Start()
{
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
move = ((Component)this).GetComponentInParent<MoveTransform>();
flicks = ((Component)this).GetComponentsInChildren<FlickerEvent>();
view = ((Component)this).GetComponentInParent<PhotonView>();
sync = ((Component)this).GetComponentInParent<SyncProjectile>();
sync.active = true;
GameObject addObjectToPlayer = ((GameObject)Resources.Load("0 cards/Homing")).GetComponent<CharacterStatModifiers>().AddObjectToPlayer;
soundSpawn = addObjectToPlayer.GetComponent<Homing>().soundHomingFound;
}
public void Destroy()
{
Object.Destroy((Object)(object)this);
}
private void Update()
{
//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_005e: 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_007a: 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_008f: 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_01a7: Unknown result type (might be due to invalid IL or missing references)
//IL_01b2: Unknown result type (might be due to invalid IL or missing references)
//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
//IL_01cd: Unknown result type (might be due to invalid IL or missing references)
//IL_01dd: 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_01f2: Unknown result type (might be due to invalid IL or missing references)
//IL_01f7: Unknown result type (might be due to invalid IL or missing references)
//IL_01fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0208: Unknown result type (might be due to invalid IL or missing references)
//IL_020d: Unknown result type (might be due to invalid IL or missing references)
//IL_0214: Unknown result type (might be due to invalid IL or missing references)
//IL_0219: Unknown result type (might be due to invalid IL or missing references)
//IL_0236: Unknown result type (might be due to invalid IL or missing references)
//IL_0241: Unknown result type (might be due to invalid IL or missing references)
//IL_0247: Unknown result type (might be due to invalid IL or missing references)
//IL_0251: Unknown result type (might be due to invalid IL or missing references)
//IL_025c: Unknown result type (might be due to invalid IL or missing references)
//IL_0261: Unknown result type (might be due to invalid IL or missing references)
//IL_0266: Unknown result type (might be due to invalid IL or missing references)
//IL_0272: Unknown result type (might be due to invalid IL or missing references)
//IL_027d: Unknown result type (might be due to invalid IL or missing references)
//IL_0287: Unknown result type (might be due to invalid IL or missing references)
//IL_0292: Unknown result type (might be due to invalid IL or missing references)
//IL_0297: 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_02a8: Unknown result type (might be due to invalid IL or missing references)
//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
//IL_02b4: Unknown result type (might be due to invalid IL or missing references)
//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
//IL_02c3: Unknown result type (might be due to invalid IL or missing references)
//IL_02cd: 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_02ec: Unknown result type (might be due to invalid IL or missing references)
//IL_02f7: Unknown result type (might be due to invalid IL or missing references)
//IL_02fc: Unknown result type (might be due to invalid IL or missing references)
//IL_0301: Unknown result type (might be due to invalid IL or missing references)
//IL_0322: Unknown result type (might be due to invalid IL or missing references)
//IL_0327: Unknown result type (might be due to invalid IL or missing references)
//IL_0331: Unknown result type (might be due to invalid IL or missing references)
//IL_0341: Unknown result type (might be due to invalid IL or missing references)
//IL_0351: Unknown result type (might be due to invalid IL or missing references)
//IL_035b: Unknown result type (might be due to invalid IL or missing references)
//IL_0360: Unknown result type (might be due to invalid IL or missing references)
//IL_0365: Unknown result type (might be due to invalid IL or missing references)
//IL_03fa: Unknown result type (might be due to invalid IL or missing references)
object obj;
if (this == null)
{
obj = null;
}
else
{
GameObject gameObject = ((Component)this).gameObject;
if (gameObject == null)
{
obj = null;
}
else
{
Transform transform = gameObject.transform;
obj = ((transform != null) ? transform.parent : null);
}
}
if (!((Object)obj != (Object)null))
{
return;
}
if ((Object)(object)PlayerManager.instance.GetClosestPlayer(Vector2.op_Implicit(((Component)this).transform.position), true) != (Object)null)
{
closestPlayer = PlayerManager.instance.GetClosestPlayer(Vector2.op_Implicit(((Component)this).transform.position), true);
flag = Vector2.Distance(Vector2.op_Implicit(((Component)this).transform.position), Vector2.op_Implicit(((Component)closestPlayer).transform.position)) <= 30f;
}
Player ownPlayer = ((Component)this).GetComponentInParent<ProjectileHit>().ownPlayer;
if (!Object.op_Implicit((Object)(object)closestPlayer) || !flag || closestPlayer.teamID == ownPlayer.teamID || !((Component)closestPlayer.data).gameObject.activeInHierarchy)
{
if (isOn)
{
MoveTransform obj2 = move;
obj2.simulateGravity--;
}
isOn = false;
for (int i = 0; i < flicks.Length; i++)
{
flicks[i].isOn = false;
}
return;
}
if (closestPlayer.teamID != ownPlayer.teamID && Object.op_Implicit((Object)(object)closestPlayer) && flag && !closestPlayer.data.dead && ((Component)closestPlayer.data).gameObject.activeInHierarchy)
{
Vector3 val = ((Component)closestPlayer).transform.position + ((Component)this).transform.right * move.selectedSpread * Vector3.Distance(((Component)this).transform.position, ((Component)closestPlayer).transform.position) * spread;
float num = Vector3.Angle(((Component)this).transform.root.forward, val - ((Component)this).transform.position);
if (num <= 90f)
{
MoveTransform obj3 = move;
obj3.velocity -= move.velocity * num * TimeHandler.deltaTime * scalingDrag;
MoveTransform obj4 = move;
obj4.velocity -= move.velocity * TimeHandler.deltaTime * drag;
MoveTransform obj5 = move;
obj5.velocity += Vector3.ClampMagnitude(val - ((Component)this).transform.position, 10f) * TimeHandler.deltaTime * ((Vector3)(ref move.localForce)).magnitude * 1.5f * amount;
move.velocity.z = 0f;
MoveTransform obj6 = move;
obj6.velocity += Vector3.up * TimeHandler.deltaTime * move.gravity * move.multiplier * 1.5f;
if (!isOn)
{
MoveTransform obj7 = move;
obj7.simulateGravity++;
if (soundHomingCanPlay)
{
soundHomingCanPlay = false;
if (!Object.op_Implicit((Object)(object)fieldsound))
{
AudioClip val2 = CR.ArtAsset.LoadAsset<AudioClip>("drone");
SoundContainer val3 = ScriptableObject.CreateInstance<SoundContainer>();
val3.audioClip[0] = val2;
val3.setting.volumeIntensityEnable = true;
fieldsound = ScriptableObject.CreateInstance<SoundEvent>();
fieldsound.soundContainerArray[0] = val3;
}
soundParameterIntensity.intensity = ((Component)this).transform.localScale.x * Optionshandler.vol_Master * Optionshandler.vol_Sfx / 1.2f * CR.globalVolMute.Value;
SoundManager.Instance.Play(fieldsound, ((Component)this).transform, (SoundParameterBase[])(object)new SoundParameterBase[1] { (SoundParameterBase)soundParameterIntensity });
}
}
isOn = true;
for (int j = 0; j < flicks.Length; j++)
{
flicks[j].isOn = true;
}
rot1.target = 90f;
rot2.target = -90f;
return;
}
}
if (isOn)
{
MoveTransform obj8 = move;
obj8.simulateGravity--;
}
isOn = false;
for (int k = 0; k < flicks.Length; k++)
{
flicks[k].isOn = false;
}
rot1.target = 90f;
rot2.target = -90f;
}
}
public class GoldenGlazeMono : RayHitEffect
{
public static SoundEvent fieldsound;
private SoundParameterIntensity soundParameterIntensity = new SoundParameterIntensity(0.7f, (UpdateMode)0);
public override HasToReturn DoHitEffect(HitInfo hit)
{
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)hit.transform))
{
CharacterStatModifiers component = ((Component)hit.transform).GetComponent<CharacterStatModifiers>();
GoldHealthMono component2 = ((Component)hit.transform).GetComponent<GoldHealthMono>();
if (Object.op_Implicit((Object)(object)((Component)hit.transform).GetComponent<DamageOverTime>()))
{
if (Object.op_Implicit((Object)(object)component))
{
component.RPCA_AddSlow(2.2f, true);
}
if (!Object.op_Implicit((Object)(object)component2))
{
((Component)hit.transform).gameObject.AddComponent<GoldHealthMono>();
if (!Object.op_Implicit((Object)(object)fieldsound))
{
AudioClip val = CR.ArtAsset.LoadAsset<AudioClip>("golden");
SoundContainer val2 = ScriptableObject.CreateInstance<SoundContainer>();
val2.audioClip[0] = val;
val2.setting.volumeIntensityEnable = true;
fieldsound = ScriptableObject.CreateInstance<SoundEvent>();
fieldsound.soundContainerArray[0] = val2;
}
soundParameterIntensity.intensity = ((Component)this).transform.localScale.x * Optionshandler.vol_Master * Optionshandler.vol_Sfx / 1.2f * CR.globalVolMute.Value;
SoundManager.Instance.Play(fieldsound, ((Component)this).transform, (SoundParameterBase[])(object)new SoundParameterBase[1] { (SoundParameterBase)soundParameterIntensity });
}
}
return (HasToReturn)1;
}
return (HasToReturn)1;
}
public void Destroy()
{
Object.Destroy((Object)(object)this);
}
}
public class GoldHealthMono : ReversibleEffect
{
private readonly Color color = Color.yellow;
private ReversibleColorEffect colorEffect;
private readonly float updateDelay = 0.1f;
private readonly float effectCooldown = 3f;
private float startTime;
private float timeOfLastEffect;
public override void OnOnEnable()
{
if ((Object)(object)colorEffect != (Object)null)
{
((ColorEffect)colorEffect).Destroy();
}
}
public override void OnStart()
{
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
base.characterDataModifier.maxHealth_mult = 0.7f;
base.characterStatModifiersModifier.movementSpeed_mult = 0.5f;
base.characterStatModifiersModifier.jump_mult = 0.5f;
colorEffect = ((Component)base.player).gameObject.AddComponent<ReversibleColorEffect>();
((ColorEffect)colorEffect).SetColor(color);
colorEffect.SetLivesToEffect(1);
ResetEffectTimer();
ResetTimer();
}
public override void OnUpdate()
{
if (Time.time >= startTime + updateDelay)
{
ResetTimer();
if (Time.time >= timeOfLastEffect + effectCooldown)
{
((ReversibleEffect)this).Destroy();
((ColorEffect)colorEffect).Destroy();
}
if (((Component)this).GetComponent<Player>().data.dead || ((Component)this).GetComponent<Player>().data.health <= 0f || !((Component)((Component)this).GetComponent<Player>()).gameObject.activeInHierarchy)
{
ResetTimer();
((ReversibleEffect)this).Destroy();
}
}
}
public override void OnOnDisable()
{
if ((Object)(object)colorEffect != (Object)null)
{
((ColorEffect)colorEffect).Destroy();
ResetEffectTimer();
ResetTimer();
}
}
public override void OnOnDestroy()
{
if ((Object)(object)colorEffect != (Object)null)
{
((ColorEffect)colorEffect).Destroy();
ResetEffectTimer();
ResetTimer();
}
}
private void ResetTimer()
{
startTime = Time.time;
}
private void ResetEffectTimer()
{
timeOfLastEffect = Time.time;
}
}
public class SugarGlazeMono : RayHitEffect
{
public static SoundEvent fieldsound;
private SoundParameterIntensity soundParameterIntensity = new SoundParameterIntensity(0.6f, (UpdateMode)0);
public override HasToReturn DoHitEffect(HitInfo hit)
{
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)hit.transform))
{
PlayerJump component = ((Component)hit.transform).GetComponent<PlayerJump>();
SugarMoveMono component2 = ((Component)hit.transform).GetComponent<SugarMoveMono>();
if (Object.op_Implicit((Object)(object)((Component)hit.transform).GetComponent<DamageOverTime>()))
{
if (Object.op_Implicit((Object)(object)component))
{
component.Jump(false, 2f);
}
if (!Object.op_Implicit((Object)(object)component2))
{
((Component)hit.transform).gameObject.AddComponent<SugarMoveMono>();
if (!Object.op_Implicit((Object)(object)fieldsound))
{
AudioClip val = CR.ArtAsset.LoadAsset<AudioClip>("pogo");
SoundContainer val2 = ScriptableObject.CreateInstance<SoundContainer>();
val2.audioClip[0] = val;
val2.setting.volumeIntensityEnable = true;
fieldsound = ScriptableObject.CreateInstance<SoundEvent>();
fieldsound.soundContainerArray[0] = val2;
}
soundParameterIntensity.intensity = ((Component)this).transform.localScale.x * Optionshandler.vol_Master * Optionshandler.vol_Sfx / 1.2f * CR.globalVolMute.Value;
SoundManager.Instance.Play(fieldsound, ((Component)this).transform, (SoundParameterBase[])(object)new SoundParameterBase[1] { (SoundParameterBase)soundParameterIntensity });
}
}
return (HasToReturn)1;
}
return (HasToReturn)1;
}
public void Destroy()
{
Object.Destroy((Object)(object)this);
}
}
public class SugarMoveMono : ReversibleEffect
{
private readonly Color color = Color.magenta;
private ReversibleColorEffect colorEffect;
private readonly float updateDelay = 0.1f;
private readonly float effectCooldown = 2f;
private float startTime;
private float timeOfLastEffect;
public override void OnOnEnable()
{
if ((Object)(object)colorEffect != (Object)null)
{
((ColorEffect)colorEffect).Destroy();
}
}
public override void OnStart()
{
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
base.characterStatModifiersModifier.movementSpeed_mult = 2.5f;
base.gravityModifier.gravityForce_mult = 2.5f;
base.characterStatModifiersModifier.jump_mult = 2.5f;
colorEffect = ((Component)base.player).gameObject.AddComponent<ReversibleColorEffect>();
((ColorEffect)colorEffect).SetColor(color);
colorEffect.SetLivesToEffect(1);
ResetEffectTimer();
ResetTimer();
}
public override void OnUpdate()
{
if (Time.time >= startTime + updateDelay)
{
ResetTimer();
if (Time.time >= timeOfLastEffect + effectCooldown)
{
((ReversibleEffect)this).Destroy();
((ColorEffect)colorEffect).Destroy();
}
if (((Component)this).GetComponent<Player>().data.dead || ((Component)this).GetComponent<Player>().data.health <= 0f || !((Component)((Component)this).GetComponent<Player>()).gameObject.activeInHierarchy)
{
ResetTimer();
((ReversibleEffect)this).Destroy();
}
}
}
public override void OnOnDisable()
{
if ((Object)(object)colorEffect != (Object)null)
{
((ColorEffect)colorEffect).Destroy();
ResetEffectTimer();
ResetTimer();
}
}
public override void OnOnDestroy()
{
if ((Object)(object)colorEffect != (Object)null)
{
((ColorEffect)colorEffect).Destroy();
ResetEffectTimer();
ResetTimer();
}
}
private void ResetTimer()
{
startTime = Time.time;
}
private void ResetEffectTimer()
{
timeOfLastEffect = Time.time;
}
}
public class MitosisMono : MonoBehaviour
{
private CharacterData data;
private Block block;
private Player player;
private Gun gun;
private Action<BlockTriggerType> mitosis;
private Action<BlockTriggerType> basic;
private Action<GameObject> goon;
private Transform particleTransform;
private SoundEvent soundSpawn;
private SoundEvent soundShoot;
private bool alreadyActivated;
private ParticleSystem[] parts;
public bool Active;
public bool Failsafe;
public bool rain;
private readonly float updateDelay = 0.1f;
private float startTime;
public int numcheck;
public void Start()
{
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
data = ((Component)this).GetComponentInParent<CharacterData>();
player = ((Component)this).GetComponent<Player>();
block = ((Component)this).GetComponent<Block>();
GameObject addObjectToPlayer = ((GameObject)Resources.Load("0 cards/Empower")).GetComponent<CharacterStatModifiers>().AddObjectToPlayer;
soundSpawn = addObjectToPlayer.GetComponent<Empower>().soundEmpowerSpawn;
soundShoot = addObjectToPlayer.GetComponent<Empower>().addObjectToBullet.GetComponent<SoundUnityEventPlayer>().soundStart;
GameObject gameObject = ((Component)addObjectToPlayer.transform.GetChild(0)).gameObject;
particleTransform = Object.Instantiate<GameObject>(gameObject, ((Component)this).transform).transform;
parts = ((Component)this).GetComponentsInChildren<ParticleSystem>();
gun = data.weaponHandler.gun;
basic = block.FirstBlockActionThatDelaysOthers;
goon = gun.ShootPojectileAction;
mitosis = GetDoBlockAction(player, block, data).Invoke;
block.FirstBlockActionThatDelaysOthers = (Action<BlockTriggerType>)Delegate.Combine(block.FirstBlockActionThatDelaysOthers, mitosis);
block.delayOtherActions = true;
gun.ShootPojectileAction = (Action<GameObject>)Delegate.Combine(gun.ShootPojectileAction, new Action<GameObject>(Attack));
Failsafe = false;
Active = false;
rain = false;
}
private void Attack(GameObject projectile)
{
if (!rain)
{
((Component)this).GetComponents<MitosisBlockMono>();
if (Active)
{
SoundManager.Instance.PlayAtPosition(soundShoot, SoundManager.Instance.GetTransform(), ((Component)this).transform);
Failsafe = false;
Active = false;
}
}
}
public Action<BlockTriggerType> GetDoBlockAction(Player player, Block block, CharacterData data)
{
return delegate(BlockTriggerType trigger)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_000a: Invalid comparison between Unknown and I4
if (!rain && (int)trigger != 1 && !Active && !Object.op_Implicit((Object)(object)((Component)((Component)this.player).transform).gameObject.GetComponent<MitosisBlockMono>()))
{
((Component)((Component)this.player).transform).gameObject.AddComponent<MitosisBlockMono>();
Active = true;
Failsafe = true;
}
};
}
public void Destroy()
{
Object.Destroy((Object)(object)this);
}
public void OnDestroy()
{
block.BlockAction = basic;
gun.ShootPojectileAction = goon;
Object.Destroy((Object)(object)soundShoot);
Object.Destroy((Object)(object)soundSpawn);
Failsafe = false;
Active = false;
}
public void Update()
{
//IL_00ba: 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_011d: Unknown result type (might be due to invalid IL or missing references)
if (!(Time.time >= startTime + updateDelay))
{
return;
}
ResetTimer();
int i = 0;
if (player.data.currentCards != null)
{
for (; i <= player.data.currentCards.Count - 1; i++)
{
if (player.data.currentCards[i].cardName == "Mitosis")
{
numcheck++;
}
}
}
if (numcheck > 0)
{
if (Active)
{
Transform transform = ((Component)data.weaponHandler.gun).transform;
particleTransform.position = transform.position;
particleTransform.rotation = transform.rotation;
ParticleSystem[] array = parts;
if (!alreadyActivated)
{
SoundManager.Instance.PlayAtPosition(soundSpawn, SoundManager.Instance.GetTransform(), ((Component)this).transform);
array = parts;
for (int j = 0; j < array.Length; j++)
{
array[j].Play();
array[j].startColor = Color.green;
}
alreadyActivated = true;
}
}
else if (alreadyActivated)
{
ParticleSystem[] array2 = parts;
for (int k = 0; k < array2.Length; k++)
{
array2[k].Stop();
}
alreadyActivated = false;
}
}
else
{
Destroy();
}
}
private void ResetTimer()
{
startTime = Time.time;
numcheck = 0;
}
}
public class MitosisBlockMono : ReversibleEffect
{
private readonly Color color = Color.green;
private ReversibleColorEffect colorEffect;
public MitosisMono effect;
public GameObject epo;
private readonly float updateDelay = 0.1f;
private float startTime;
public override void OnOnEnable()
{
if ((Object)(object)colorEffect != (Object)null)
{
((ColorEffect)colorEffect).Destroy();
}
}
public override void OnStart()
{
//IL_0072: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ea: 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_01a7: Unknown result type (might be due to invalid IL or missing references)
//IL_01ca: Unknown result type (might be due to invalid IL or missing references)
//IL_0203: Unknown result type (might be due to invalid IL or missing references)
//IL_0219: Unknown result type (might be due to invalid IL or missing references)
//IL_021e: 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_0230: Unknown result type (might be due to invalid IL or missing references)
//IL_0237: Unknown result type (might be due to invalid IL or missing references)
//IL_0247: Expected O, but got Unknown
//IL_025a: Unknown result type (might be due to invalid IL or missing references)
GunStatModifier gunStatModifier = base.gunStatModifier;
gunStatModifier.numberOfProjectiles_add++;
GunStatModifier gunStatModifier2 = base.gunStatModifier;
gunStatModifier2.spread_add += 0.05f;
GunStatModifier gunStatModifier3 = base.gunStatModifier;
gunStatModifier3.damage_mult *= 1.25f;
GunStatModifier gunStatModifier4 = base.gunStatModifier;
gunStatModifier4.projectielSimulatonSpeed_mult *= 1.75f;
base.gunStatModifier.projectileColor = new Color(0f, 1f, 0f, 1f);
colorEffect = ((Component)base.player).gameObject.AddComponent<ReversibleColorEffect>();
effect = ((Component)base.player).GetComponent<MitosisMono>();
List<ObjectsToSpawn> objectsToSpawn_add = base.gunStatModifier.objectsToSpawn_add;
GameObject val = Object.Instantiate<GameObject>(((GameObject)Resources.Load("0 cards/Demonic pact")).GetComponent<Gun>().objectsToSpawn[0].effect);
val.transform.position = new Vector3(1000f, 0f, 0f);
((Object)val).hideFlags = (HideFlags)61;
((Object)val).name = "Explosion";
val.GetComponent<RemoveAfterSeconds>().seconds = 2f;
val.GetComponent<Explosion>().force = 400f;
val.GetComponent<Explosion>().damage = 5f;
val.GetComponent<Explosion>().range = 4f;
ParticleSystem[] componentsInChildren = val.GetComponentsInChildren<ParticleSystem>();
for (int i = 0; i < componentsInChildren.Length; i++)
{
componentsInChildren[i].startColor = new Color(0.1f, 1f, 0f, 1f);
}
ParticleSystemRenderer[] componentsInChildren2 = val.GetComponentsInChildren<ParticleSystemRenderer>();
foreach (ParticleSystemRenderer obj in componentsInChildren2)
{
((Renderer)obj).material.color = new Color(0.2f, 1f, 0.2f, 1f);
((Renderer)obj).sharedMaterial.color = new Color(0.2f, 1f, 0.2f, 1f);
}
Material[] componentsInChildren3 = val.GetComponentsInChildren<Material>();
for (int i = 0; i < componentsInChildren3.Length; i++)
{
componentsInChildren3[i].color = new Color(0.2f, 1f, 0.2f, 1f);
}
objectsToSpawn_add.Add(new ObjectsToSpawn
{
effect = val,
normalOffset = 0f,
numberOfSpawns = 1,
scaleFromDamage = 1f
});
base.gunStatModifier.objectsToSpawn_add = objectsToSpawn_add;
((ColorEffect)colorEffect).SetColor(color);
colorEffect.SetLivesToEffect(1);
ResetTimer();
}
public override void OnUpdate()
{
if (Time.time >= startTime + updateDelay)
{
ResetTimer();
if (!effect.Failsafe || !effect.Active)
{
((ReversibleEffect)this).Destroy();
((ColorEffect)colorEffect).Destroy();
}
if (((Component)this).GetComponent<Player>().data.dead || ((Component)this).GetComponent<Player>().data.health <= 0f || !((Component)((Component)this).GetComponent<Player>()).gameObject.activeInHierarchy)
{
ResetTimer();
((ReversibleEffect)this).Destroy();
}
}
}
public override void OnOnDisable()
{
if ((Object)(object)colorEffect != (Object)null)
{
((ColorEffect)colorEffect).Destroy();
}
}
public override void OnOnDestroy()
{
if ((Object)(object)colorEffect != (Object)null)
{
((ColorEffect)colorEffect).Destroy();
effect.Active = false;
}
}
private void ResetTimer()
{
startTime = Time.time;
}
}
public class MeiosisMono : MonoBehaviour
{
private CharacterData data;
private Block block;
public Player player;
private Gun gun;
public bool able;
private readonly float updateDelay = 0.1f;
private readonly float effectCooldown = 1f;
private float timeOfLastEffect;
private float startTime;
public int numcheck;
public void Start()
{
data = ((Component)this).GetComponentInParent<CharacterData>();
player = ((Component)this).GetComponent<Player>();
block = ((Component)this).GetComponent<Block>();
gun = ((Component)this).GetComponent<Gun>();
able = true;
ResetTimer();
ResetEffectTimer();
}
public void Update()
{
if (!(Time.time >= startTime + updateDelay))
{
return;
}
ResetTimer();
int i = 0;
if (player.data.currentCards != null)
{
for (; i <= player.data.currentCards.Count - 1; i++)
{
if (player.data.currentCards[i].cardName == "Meiosis")
{
numcheck++;
}
}
}
if (numcheck > 0)
{
if (Time.time >= timeOfLastEffect + effectCooldown && player.data.weaponHandler.gun.isReloading && able)
{
((Component)((Component)player).transform).gameObject.AddComponent<MeiosisReloadMono>();
ResetEffectTimer();
able = false;
}
}
else
{
Destroy();
}
}
private void ResetTimer()
{
startTime = Time.time;
}
private void ResetEffectTimer()
{
timeOfLastEffect = Time.time;
}
public void Destroy()
{
Object.Destroy((Object)(object)this);
}
}
public c