using System;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using BepInEx.Logging;
using IL.RoR2;
using IL.RoR2.Orbs;
using IL.RoR2.Projectile;
using Microsoft.CodeAnalysis;
using Mono.Cecil;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using MonoMod.RuntimeDetour.HookGen;
using On.RoR2;
using On.RoR2.Projectile;
using R2API.AutoVersionGen;
using R2API.Utils;
using RoR2;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2BepInExPack.Utilities;
using UnityEngine;
using UnityEngine.Networking;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("R2API.DamageType")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.1.2.0")]
[assembly: AssemblyInformationalVersion("1.1.2+733d42438524ee7fa178e1f85d00f8b8f9772b6a")]
[assembly: AssemblyProduct("R2API.DamageType")]
[assembly: AssemblyTitle("R2API.DamageType")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.1.2.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
namespace Microsoft.CodeAnalysis
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
internal sealed class EmbeddedAttribute : Attribute
{
}
}
namespace System.Runtime.CompilerServices
{
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)]
internal sealed class RefSafetyRulesAttribute : Attribute
{
public readonly int Version;
public RefSafetyRulesAttribute(int P_0)
{
Version = P_0;
}
}
}
namespace System.Diagnostics.CodeAnalysis
{
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
[ExcludeFromCodeCoverage]
[DebuggerNonUserCode]
internal sealed class MemberNotNullAttribute : Attribute
{
public string[] Members { get; }
public MemberNotNullAttribute(string member)
{
Members = new string[1] { member };
}
public MemberNotNullAttribute(params string[] members)
{
Members = members;
}
}
[AttributeUsage(AttributeTargets.Method | AttributeTargets.Property, Inherited = false, AllowMultiple = true)]
[ExcludeFromCodeCoverage]
[DebuggerNonUserCode]
internal sealed class MemberNotNullWhenAttribute : Attribute
{
public bool ReturnValue { get; }
public string[] Members { get; }
public MemberNotNullWhenAttribute(bool returnValue, string member)
{
ReturnValue = returnValue;
Members = new string[1] { member };
}
public MemberNotNullWhenAttribute(bool returnValue, params string[] members)
{
ReturnValue = returnValue;
Members = members;
}
}
}
namespace R2API
{
[AutoVersion]
public static class DamageAPI
{
public enum ModdedDamageType
{
}
public class ModdedDamageTypeHolder
{
internal byte[] values = Array.Empty<byte>();
public ModdedDamageTypeHolder()
{
SetHooks();
}
public ModdedDamageTypeHolder(byte[] values)
{
SetHooks();
if (values.Length != 0)
{
this.values = values.ToArray();
}
}
public void Add(ModdedDamageType moddedDamageType)
{
CompressedFlagArrayUtilities.Add(ref values, (int)moddedDamageType);
}
public void Add(ModdedDamageTypeHolder moddedDamageTypeHolder)
{
CompressedFlagArrayUtilities.Add(ref values, moddedDamageTypeHolder.values);
}
public bool Remove(ModdedDamageType moddedDamageType)
{
return CompressedFlagArrayUtilities.Remove(ref values, (int)moddedDamageType);
}
public bool Remove(ModdedDamageTypeHolder moddedDamageTypeHolder)
{
return CompressedFlagArrayUtilities.Remove(ref values, moddedDamageTypeHolder.values);
}
public bool Has(ModdedDamageType moddedDamageType)
{
return CompressedFlagArrayUtilities.Has(values, (int)moddedDamageType);
}
public void CopyTo(DamageInfo damageInfo)
{
CopyToInternal(damageInfo);
}
public void CopyTo(BulletAttack bulletAttack)
{
CopyToInternal(bulletAttack);
}
public void CopyTo(DamageOrb damageOrb)
{
CopyToInternal(damageOrb);
}
public void CopyTo(GenericDamageOrb genericDamageOrb)
{
CopyToInternal(genericDamageOrb);
}
public void CopyTo(LightningOrb lightningOrb)
{
CopyToInternal(lightningOrb);
}
public void CopyTo(BlastAttack blastAttack)
{
CopyToInternal(blastAttack);
}
public void CopyTo(OverlapAttack overlapAttack)
{
CopyToInternal(overlapAttack);
}
public void CopyTo(DotStack dotStack)
{
CopyToInternal(dotStack);
}
public void CopyTo(CrocoDamageTypeController croco)
{
CopyToInternal(croco);
}
internal void CopyToInternal(object obj)
{
damageTypeHolders.Remove(obj);
damageTypeHolders.Add(obj, MakeCopy());
}
public ModdedDamageTypeHolder MakeCopy()
{
SetHooks();
return new ModdedDamageTypeHolder
{
values = ((values.Length == 0) ? values : values.ToArray())
};
}
public static ModdedDamageTypeHolder ReadFromNetworkReader(NetworkReader reader)
{
SetHooks();
byte[] array = CompressedFlagArrayUtilities.ReadFromNetworkReader(reader, ModdedDamageTypeCount);
if (array.Length == 0)
{
return null;
}
return new ModdedDamageTypeHolder
{
values = array
};
}
public void WriteToNetworkWriter(NetworkWriter writer)
{
CompressedFlagArrayUtilities.WriteToNetworkWriter(values, writer, ModdedDamageTypeCount);
}
}
public sealed class ModdedDamageTypeHolderComponent : MonoBehaviour
{
[HideInInspector]
[SerializeField]
internal byte[] values = Array.Empty<byte>();
public void Add(ModdedDamageType moddedDamageType)
{
CompressedFlagArrayUtilities.Add(ref values, (int)moddedDamageType);
}
public void Add(ModdedDamageTypeHolder moddedDamageTypeHolder)
{
CompressedFlagArrayUtilities.Add(ref values, moddedDamageTypeHolder.values);
}
public bool Remove(ModdedDamageType moddedDamageType)
{
return CompressedFlagArrayUtilities.Remove(ref values, (int)moddedDamageType);
}
public bool Remove(ModdedDamageTypeHolder moddedDamageTypeHolder)
{
return CompressedFlagArrayUtilities.Remove(ref values, moddedDamageTypeHolder.values);
}
public bool Has(ModdedDamageType moddedDamageType)
{
return CompressedFlagArrayUtilities.Has(values, (int)moddedDamageType);
}
public void CopyTo(DamageInfo damageInfo)
{
CopyToInternal(damageInfo);
}
public void CopyTo(BulletAttack bulletAttack)
{
CopyToInternal(bulletAttack);
}
public void CopyTo(DamageOrb damageOrb)
{
CopyToInternal(damageOrb);
}
public void CopyTo(GenericDamageOrb genericDamageOrb)
{
CopyToInternal(genericDamageOrb);
}
public void CopyTo(LightningOrb lightningOrb)
{
CopyToInternal(lightningOrb);
}
public void CopyTo(BlastAttack blastAttack)
{
CopyToInternal(blastAttack);
}
public void CopyTo(OverlapAttack overlapAttack)
{
CopyToInternal(overlapAttack);
}
public void CopyTo(DotStack dotStack)
{
CopyToInternal(dotStack);
}
public void CopyTo(CrocoDamageTypeController croco)
{
CopyToInternal(croco);
}
internal void CopyToInternal(object obj)
{
damageTypeHolders.Remove(obj);
damageTypeHolders.Add(obj, new ModdedDamageTypeHolder(values));
}
public ModdedDamageTypeHolder MakeHolder()
{
SetHooks();
return new ModdedDamageTypeHolder(values);
}
}
private delegate void BlastAttackDamageInfoWriteDelegate(BlastAttackDamageInfoWriteOrig orig, ref BlastAttackDamageInfo self, NetworkWriter networkWriter);
private delegate void BlastAttackDamageInfoWriteOrig(ref BlastAttackDamageInfo self, NetworkWriter networkWriter);
private delegate void BlastAttackDamageInfoReadDelegate(BlastAttackDamageInfoReadOrig orig, ref BlastAttackDamageInfo self, NetworkReader networkReader);
private delegate void BlastAttackDamageInfoReadOrig(ref BlastAttackDamageInfo self, NetworkReader networkReader);
[CompilerGenerated]
private static class <>O
{
public static hook_Write_NetworkWriter_DamageInfo <0>__WriteDamageInfo;
public static hook_ReadDamageInfo <1>__ReadDamageInfo;
public static Manipulator <2>__BulletAttackDefaultHitCallbackIL;
public static Manipulator <3>__DamageOrbOnArrivalIL;
public static Manipulator <4>__GenericDamageOrbOnArrivalIL;
public static Manipulator <5>__LightningOrbOnArrivalIL;
public static Manipulator <6>__ChainGunOrbOnArrivalIL;
public static Manipulator <7>__DeathProjectileFixedUpdateIL;
public static Manipulator <8>__ProjectileDotZoneResetOverlapIL;
public static Manipulator <9>__ProjectileExplosionDetonateServerIL;
public static Manipulator <10>__ProjectileGrantOnKillOnDestroyOnDestroyIL;
public static Manipulator <11>__ProjectileIntervalOverlapAttackFixedUpdateIL;
public static Manipulator <12>__ProjectileOverlapAttackStartIL;
public static Manipulator <13>__ProjectileOverlapAttackResetOverlapAttackIL;
public static Manipulator <14>__ProjectileProximityBeamControllerUpdateServerIL;
public static Manipulator <15>__ProjectileSingleTargetImpactOnProjectileImpactIL;
public static Manipulator <16>__DotControllerEvaluateDotStacksForTypeIL;
public static Manipulator <17>__DotControllerAddPendingDamageEntryIL;
public static Manipulator <18>__BlastAttackHandleHitsIL;
public static Manipulator <19>__BlastAttackPerformDamageServerIL;
public static BlastAttackDamageInfoWriteDelegate <20>__BlastAttackDamageInfoWrite;
public static BlastAttackDamageInfoReadDelegate <21>__BlastAttackDamageInfoRead;
public static Manipulator <22>__OverlapAttackProcessHitsIL;
public static Manipulator <23>__OverlapAttackPerformDamageIL;
public static hook_Serialize <24>__OverlapAttackMessageSerialize;
public static hook_Deserialize <25>__OverlapAttackMessageDeserialize;
public static Manipulator <26>__GlobalEventManagerOnHitAllIL;
public static Manipulator <27>__HealthComponentSendDamageDealtIL;
public static hook_Serialize <28>__DamageDealtMessageSerialize;
public static hook_Deserialize <29>__DamageDealtMessageDeserialize;
public static Manipulator <30>__ContactDamageFireOverlapsIL;
public static Manipulator <31>__DelayBlastDetonateIL;
public static hook_GetDamageType <32>__CrocoDamageTypeControllerGetDamageType;
public static hook_InitializeProjectile <33>__ProjectileManagerInitializeProjectile;
}
public const string PluginGUID = "com.bepis.r2api.damagetype";
public const string PluginName = "R2API.DamageType";
private static readonly FixedConditionalWeakTable<object, ModdedDamageTypeHolder> damageTypeHolders = new FixedConditionalWeakTable<object, ModdedDamageTypeHolder>();
private static bool _hooksEnabled = false;
private static DamageTypeExtended signalDamageType = (DamageTypeExtended)2048;
public const string PluginVersion = "1.1.2";
private static ModdedDamageTypeHolder TempHolder { get; set; }
[Obsolete("All submodules are automatically loaded and this property is now unused")]
public static bool Loaded => true;
public static int ModdedDamageTypeCount { get; private set; }
internal static void SetHooks()
{
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Expected O, but got Unknown
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Expected O, but got Unknown
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Expected O, but got Unknown
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Expected O, but got Unknown
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Expected O, but got Unknown
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00c3: Expected O, but got Unknown
//IL_00d8: 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_00e3: Expected O, but got Unknown
//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_00fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Expected O, but got Unknown
//IL_0118: 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)
//IL_0123: Expected O, but got Unknown
//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)
//IL_0143: Expected O, but got Unknown
//IL_0158: Unknown result type (might be due to invalid IL or missing references)
//IL_015d: Unknown result type (might be due to invalid IL or missing references)
//IL_0163: Expected O, but got Unknown
//IL_0178: Unknown result type (might be due to invalid IL or missing references)
//IL_017d: Unknown result type (might be due to invalid IL or missing references)
//IL_0183: Expected O, but got Unknown
//IL_0198: Unknown result type (might be due to invalid IL or missing references)
//IL_019d: Unknown result type (might be due to invalid IL or missing references)
//IL_01a3: Expected O, but got Unknown
//IL_01b8: Unknown result type (might be due to invalid IL or missing references)
//IL_01bd: Unknown result type (might be due to invalid IL or missing references)
//IL_01c3: Expected O, but got Unknown
//IL_01d8: 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_01e3: Expected O, but got Unknown
//IL_01f8: Unknown result type (might be due to invalid IL or missing references)
//IL_01fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0203: Expected O, but got Unknown
//IL_0218: Unknown result type (might be due to invalid IL or missing references)
//IL_021d: Unknown result type (might be due to invalid IL or missing references)
//IL_0223: Expected O, but got Unknown
//IL_0238: Unknown result type (might be due to invalid IL or missing references)
//IL_023d: Unknown result type (might be due to invalid IL or missing references)
//IL_0243: Expected O, but got Unknown
//IL_0258: Unknown result type (might be due to invalid IL or missing references)
//IL_025d: Unknown result type (might be due to invalid IL or missing references)
//IL_0263: Expected O, but got Unknown
//IL_0278: 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_0283: Expected O, but got Unknown
//IL_0300: Unknown result type (might be due to invalid IL or missing references)
//IL_0305: Unknown result type (might be due to invalid IL or missing references)
//IL_030b: Expected O, but got Unknown
//IL_0320: Unknown result type (might be due to invalid IL or missing references)
//IL_0325: Unknown result type (might be due to invalid IL or missing references)
//IL_032b: Expected O, but got Unknown
//IL_0340: Unknown result type (might be due to invalid IL or missing references)
//IL_0345: Unknown result type (might be due to invalid IL or missing references)
//IL_034b: Expected O, but got Unknown
//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_036b: Expected O, but got Unknown
//IL_0380: Unknown result type (might be due to invalid IL or missing references)
//IL_0385: Unknown result type (might be due to invalid IL or missing references)
//IL_038b: Expected O, but got Unknown
//IL_03a0: Unknown result type (might be due to invalid IL or missing references)
//IL_03a5: Unknown result type (might be due to invalid IL or missing references)
//IL_03ab: Expected O, but got Unknown
//IL_03c0: Unknown result type (might be due to invalid IL or missing references)
//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
//IL_03cb: Expected O, but got Unknown
//IL_03e0: Unknown result type (might be due to invalid IL or missing references)
//IL_03e5: Unknown result type (might be due to invalid IL or missing references)
//IL_03eb: Expected O, but got Unknown
//IL_0400: Unknown result type (might be due to invalid IL or missing references)
//IL_0405: Unknown result type (might be due to invalid IL or missing references)
//IL_040b: Expected O, but got Unknown
//IL_0420: Unknown result type (might be due to invalid IL or missing references)
//IL_0425: Unknown result type (might be due to invalid IL or missing references)
//IL_042b: Expected O, but got Unknown
//IL_0440: Unknown result type (might be due to invalid IL or missing references)
//IL_0445: Unknown result type (might be due to invalid IL or missing references)
//IL_044b: Expected O, but got Unknown
//IL_0460: Unknown result type (might be due to invalid IL or missing references)
//IL_0465: Unknown result type (might be due to invalid IL or missing references)
//IL_046b: Expected O, but got Unknown
if (!_hooksEnabled)
{
object obj = <>O.<0>__WriteDamageInfo;
if (obj == null)
{
hook_Write_NetworkWriter_DamageInfo val = WriteDamageInfo;
<>O.<0>__WriteDamageInfo = val;
obj = (object)val;
}
NetworkExtensions.Write_NetworkWriter_DamageInfo += (hook_Write_NetworkWriter_DamageInfo)obj;
object obj2 = <>O.<1>__ReadDamageInfo;
if (obj2 == null)
{
hook_ReadDamageInfo val2 = ReadDamageInfo;
<>O.<1>__ReadDamageInfo = val2;
obj2 = (object)val2;
}
NetworkExtensions.ReadDamageInfo += (hook_ReadDamageInfo)obj2;
object obj3 = <>O.<2>__BulletAttackDefaultHitCallbackIL;
if (obj3 == null)
{
Manipulator val3 = BulletAttackDefaultHitCallbackIL;
<>O.<2>__BulletAttackDefaultHitCallbackIL = val3;
obj3 = (object)val3;
}
BulletAttack.DefaultHitCallbackImplementation += (Manipulator)obj3;
object obj4 = <>O.<3>__DamageOrbOnArrivalIL;
if (obj4 == null)
{
Manipulator val4 = DamageOrbOnArrivalIL;
<>O.<3>__DamageOrbOnArrivalIL = val4;
obj4 = (object)val4;
}
DamageOrb.OnArrival += (Manipulator)obj4;
object obj5 = <>O.<4>__GenericDamageOrbOnArrivalIL;
if (obj5 == null)
{
Manipulator val5 = GenericDamageOrbOnArrivalIL;
<>O.<4>__GenericDamageOrbOnArrivalIL = val5;
obj5 = (object)val5;
}
GenericDamageOrb.OnArrival += (Manipulator)obj5;
object obj6 = <>O.<5>__LightningOrbOnArrivalIL;
if (obj6 == null)
{
Manipulator val6 = LightningOrbOnArrivalIL;
<>O.<5>__LightningOrbOnArrivalIL = val6;
obj6 = (object)val6;
}
LightningOrb.OnArrival += (Manipulator)obj6;
object obj7 = <>O.<6>__ChainGunOrbOnArrivalIL;
if (obj7 == null)
{
Manipulator val7 = ChainGunOrbOnArrivalIL;
<>O.<6>__ChainGunOrbOnArrivalIL = val7;
obj7 = (object)val7;
}
ChainGunOrb.OnArrival += (Manipulator)obj7;
object obj8 = <>O.<7>__DeathProjectileFixedUpdateIL;
if (obj8 == null)
{
Manipulator val8 = DeathProjectileFixedUpdateIL;
<>O.<7>__DeathProjectileFixedUpdateIL = val8;
obj8 = (object)val8;
}
DeathProjectile.FixedUpdate += (Manipulator)obj8;
object obj9 = <>O.<8>__ProjectileDotZoneResetOverlapIL;
if (obj9 == null)
{
Manipulator val9 = ProjectileDotZoneResetOverlapIL;
<>O.<8>__ProjectileDotZoneResetOverlapIL = val9;
obj9 = (object)val9;
}
ProjectileDotZone.ResetOverlap += (Manipulator)obj9;
object obj10 = <>O.<9>__ProjectileExplosionDetonateServerIL;
if (obj10 == null)
{
Manipulator val10 = ProjectileExplosionDetonateServerIL;
<>O.<9>__ProjectileExplosionDetonateServerIL = val10;
obj10 = (object)val10;
}
ProjectileExplosion.DetonateServer += (Manipulator)obj10;
object obj11 = <>O.<10>__ProjectileGrantOnKillOnDestroyOnDestroyIL;
if (obj11 == null)
{
Manipulator val11 = ProjectileGrantOnKillOnDestroyOnDestroyIL;
<>O.<10>__ProjectileGrantOnKillOnDestroyOnDestroyIL = val11;
obj11 = (object)val11;
}
ProjectileGrantOnKillOnDestroy.OnDestroy += (Manipulator)obj11;
object obj12 = <>O.<11>__ProjectileIntervalOverlapAttackFixedUpdateIL;
if (obj12 == null)
{
Manipulator val12 = ProjectileIntervalOverlapAttackFixedUpdateIL;
<>O.<11>__ProjectileIntervalOverlapAttackFixedUpdateIL = val12;
obj12 = (object)val12;
}
ProjectileIntervalOverlapAttack.FixedUpdate += (Manipulator)obj12;
object obj13 = <>O.<12>__ProjectileOverlapAttackStartIL;
if (obj13 == null)
{
Manipulator val13 = ProjectileOverlapAttackStartIL;
<>O.<12>__ProjectileOverlapAttackStartIL = val13;
obj13 = (object)val13;
}
ProjectileOverlapAttack.Start += (Manipulator)obj13;
object obj14 = <>O.<13>__ProjectileOverlapAttackResetOverlapAttackIL;
if (obj14 == null)
{
Manipulator val14 = ProjectileOverlapAttackResetOverlapAttackIL;
<>O.<13>__ProjectileOverlapAttackResetOverlapAttackIL = val14;
obj14 = (object)val14;
}
ProjectileOverlapAttack.ResetOverlapAttack += (Manipulator)obj14;
object obj15 = <>O.<14>__ProjectileProximityBeamControllerUpdateServerIL;
if (obj15 == null)
{
Manipulator val15 = ProjectileProximityBeamControllerUpdateServerIL;
<>O.<14>__ProjectileProximityBeamControllerUpdateServerIL = val15;
obj15 = (object)val15;
}
ProjectileProximityBeamController.UpdateServer += (Manipulator)obj15;
object obj16 = <>O.<15>__ProjectileSingleTargetImpactOnProjectileImpactIL;
if (obj16 == null)
{
Manipulator val16 = ProjectileSingleTargetImpactOnProjectileImpactIL;
<>O.<15>__ProjectileSingleTargetImpactOnProjectileImpactIL = val16;
obj16 = (object)val16;
}
ProjectileSingleTargetImpact.OnProjectileImpact += (Manipulator)obj16;
object obj17 = <>O.<16>__DotControllerEvaluateDotStacksForTypeIL;
if (obj17 == null)
{
Manipulator val17 = DotControllerEvaluateDotStacksForTypeIL;
<>O.<16>__DotControllerEvaluateDotStacksForTypeIL = val17;
obj17 = (object)val17;
}
DotController.EvaluateDotStacksForType += (Manipulator)obj17;
object obj18 = <>O.<17>__DotControllerAddPendingDamageEntryIL;
if (obj18 == null)
{
Manipulator val18 = DotControllerAddPendingDamageEntryIL;
<>O.<17>__DotControllerAddPendingDamageEntryIL = val18;
obj18 = (object)val18;
}
DotController.AddPendingDamageEntry += (Manipulator)obj18;
object obj19 = <>O.<18>__BlastAttackHandleHitsIL;
if (obj19 == null)
{
Manipulator val19 = BlastAttackHandleHitsIL;
<>O.<18>__BlastAttackHandleHitsIL = val19;
obj19 = (object)val19;
}
BlastAttack.HandleHits += (Manipulator)obj19;
object obj20 = <>O.<19>__BlastAttackPerformDamageServerIL;
if (obj20 == null)
{
Manipulator val20 = BlastAttackPerformDamageServerIL;
<>O.<19>__BlastAttackPerformDamageServerIL = val20;
obj20 = (object)val20;
}
BlastAttack.PerformDamageServer += (Manipulator)obj20;
HookEndpointManager.Add((MethodBase)Reflection.GetMethodCached(typeof(BlastAttackDamageInfo), "Write"), (Delegate)new BlastAttackDamageInfoWriteDelegate(BlastAttackDamageInfoWrite));
HookEndpointManager.Add((MethodBase)Reflection.GetMethodCached(typeof(BlastAttackDamageInfo), "Read"), (Delegate)new BlastAttackDamageInfoReadDelegate(BlastAttackDamageInfoRead));
object obj21 = <>O.<22>__OverlapAttackProcessHitsIL;
if (obj21 == null)
{
Manipulator val21 = OverlapAttackProcessHitsIL;
<>O.<22>__OverlapAttackProcessHitsIL = val21;
obj21 = (object)val21;
}
OverlapAttack.ProcessHits += (Manipulator)obj21;
object obj22 = <>O.<23>__OverlapAttackPerformDamageIL;
if (obj22 == null)
{
Manipulator val22 = OverlapAttackPerformDamageIL;
<>O.<23>__OverlapAttackPerformDamageIL = val22;
obj22 = (object)val22;
}
OverlapAttack.PerformDamage += (Manipulator)obj22;
object obj23 = <>O.<24>__OverlapAttackMessageSerialize;
if (obj23 == null)
{
hook_Serialize val23 = OverlapAttackMessageSerialize;
<>O.<24>__OverlapAttackMessageSerialize = val23;
obj23 = (object)val23;
}
OverlapAttackMessage.Serialize += (hook_Serialize)obj23;
object obj24 = <>O.<25>__OverlapAttackMessageDeserialize;
if (obj24 == null)
{
hook_Deserialize val24 = OverlapAttackMessageDeserialize;
<>O.<25>__OverlapAttackMessageDeserialize = val24;
obj24 = (object)val24;
}
OverlapAttackMessage.Deserialize += (hook_Deserialize)obj24;
object obj25 = <>O.<26>__GlobalEventManagerOnHitAllIL;
if (obj25 == null)
{
Manipulator val25 = GlobalEventManagerOnHitAllIL;
<>O.<26>__GlobalEventManagerOnHitAllIL = val25;
obj25 = (object)val25;
}
GlobalEventManager.OnHitAllProcess += (Manipulator)obj25;
object obj26 = <>O.<27>__HealthComponentSendDamageDealtIL;
if (obj26 == null)
{
Manipulator val26 = HealthComponentSendDamageDealtIL;
<>O.<27>__HealthComponentSendDamageDealtIL = val26;
obj26 = (object)val26;
}
HealthComponent.SendDamageDealt += (Manipulator)obj26;
object obj27 = <>O.<28>__DamageDealtMessageSerialize;
if (obj27 == null)
{
hook_Serialize val27 = DamageDealtMessageSerialize;
<>O.<28>__DamageDealtMessageSerialize = val27;
obj27 = (object)val27;
}
DamageDealtMessage.Serialize += (hook_Serialize)obj27;
object obj28 = <>O.<29>__DamageDealtMessageDeserialize;
if (obj28 == null)
{
hook_Deserialize val28 = DamageDealtMessageDeserialize;
<>O.<29>__DamageDealtMessageDeserialize = val28;
obj28 = (object)val28;
}
DamageDealtMessage.Deserialize += (hook_Deserialize)obj28;
object obj29 = <>O.<30>__ContactDamageFireOverlapsIL;
if (obj29 == null)
{
Manipulator val29 = ContactDamageFireOverlapsIL;
<>O.<30>__ContactDamageFireOverlapsIL = val29;
obj29 = (object)val29;
}
ContactDamage.FireOverlaps += (Manipulator)obj29;
object obj30 = <>O.<31>__DelayBlastDetonateIL;
if (obj30 == null)
{
Manipulator val30 = DelayBlastDetonateIL;
<>O.<31>__DelayBlastDetonateIL = val30;
obj30 = (object)val30;
}
DelayBlast.Detonate += (Manipulator)obj30;
object obj31 = <>O.<32>__CrocoDamageTypeControllerGetDamageType;
if (obj31 == null)
{
hook_GetDamageType val31 = CrocoDamageTypeControllerGetDamageType;
<>O.<32>__CrocoDamageTypeControllerGetDamageType = val31;
obj31 = (object)val31;
}
CrocoDamageTypeController.GetDamageType += (hook_GetDamageType)obj31;
object obj32 = <>O.<33>__ProjectileManagerInitializeProjectile;
if (obj32 == null)
{
hook_InitializeProjectile val32 = ProjectileManagerInitializeProjectile;
<>O.<33>__ProjectileManagerInitializeProjectile = val32;
obj32 = (object)val32;
}
ProjectileManager.InitializeProjectile += (hook_InitializeProjectile)obj32;
_hooksEnabled = true;
}
}
internal static void UnsetHooks()
{
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Unknown result type (might be due to invalid IL or missing references)
//IL_003b: Expected O, but got Unknown
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Expected O, but got Unknown
//IL_0070: Unknown result type (might be due to invalid IL or missing references)
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
//IL_007b: Expected O, but got Unknown
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: Unknown result type (might be due to invalid IL or missing references)
//IL_009b: Expected O, but got Unknown
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Expected O, but got Unknown
//IL_00d0: Unknown result type (might be due to invalid IL or missing references)
//IL_00d5: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Expected O, but got Unknown
//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: Expected O, but got Unknown
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_0115: Unknown result type (might be due to invalid IL or missing references)
//IL_011b: Expected O, but got Unknown
//IL_0130: Unknown result type (might be due to invalid IL or missing references)
//IL_0135: Unknown result type (might be due to invalid IL or missing references)
//IL_013b: Expected O, but got Unknown
//IL_0150: Unknown result type (might be due to invalid IL or missing references)
//IL_0155: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: Expected O, but got Unknown
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_0175: Unknown result type (might be due to invalid IL or missing references)
//IL_017b: Expected O, but got Unknown
//IL_0190: Unknown result type (might be due to invalid IL or missing references)
//IL_0195: Unknown result type (might be due to invalid IL or missing references)
//IL_019b: Expected O, but got Unknown
//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
//IL_01bb: Expected O, but got Unknown
//IL_01d0: Unknown result type (might be due to invalid IL or missing references)
//IL_01d5: Unknown result type (might be due to invalid IL or missing references)
//IL_01db: Expected O, but got Unknown
//IL_01f0: Unknown result type (might be due to invalid IL or missing references)
//IL_01f5: Unknown result type (might be due to invalid IL or missing references)
//IL_01fb: Expected O, but got Unknown
//IL_0210: Unknown result type (might be due to invalid IL or missing references)
//IL_0215: Unknown result type (might be due to invalid IL or missing references)
//IL_021b: Expected O, but got Unknown
//IL_0230: Unknown result type (might be due to invalid IL or missing references)
//IL_0235: Unknown result type (might be due to invalid IL or missing references)
//IL_023b: Expected O, but got Unknown
//IL_0250: Unknown result type (might be due to invalid IL or missing references)
//IL_0255: Unknown result type (might be due to invalid IL or missing references)
//IL_025b: Expected O, but got Unknown
//IL_0270: Unknown result type (might be due to invalid IL or missing references)
//IL_0275: Unknown result type (might be due to invalid IL or missing references)
//IL_027b: Expected O, but got Unknown
//IL_02f8: Unknown result type (might be due to invalid IL or missing references)
//IL_02fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0303: Expected O, but got Unknown
//IL_0318: Unknown result type (might be due to invalid IL or missing references)
//IL_031d: Unknown result type (might be due to invalid IL or missing references)
//IL_0323: Expected O, but got Unknown
//IL_0338: Unknown result type (might be due to invalid IL or missing references)
//IL_033d: Unknown result type (might be due to invalid IL or missing references)
//IL_0343: Expected O, but got Unknown
//IL_0358: Unknown result type (might be due to invalid IL or missing references)
//IL_035d: Unknown result type (might be due to invalid IL or missing references)
//IL_0363: Expected O, but got Unknown
//IL_0378: Unknown result type (might be due to invalid IL or missing references)
//IL_037d: Unknown result type (might be due to invalid IL or missing references)
//IL_0383: Expected O, but got Unknown
//IL_0398: Unknown result type (might be due to invalid IL or missing references)
//IL_039d: Unknown result type (might be due to invalid IL or missing references)
//IL_03a3: Expected O, but got Unknown
//IL_03b8: Unknown result type (might be due to invalid IL or missing references)
//IL_03bd: Unknown result type (might be due to invalid IL or missing references)
//IL_03c3: Expected O, but got Unknown
//IL_03d8: Unknown result type (might be due to invalid IL or missing references)
//IL_03dd: Unknown result type (might be due to invalid IL or missing references)
//IL_03e3: Expected O, but got Unknown
//IL_03f8: Unknown result type (might be due to invalid IL or missing references)
//IL_03fd: Unknown result type (might be due to invalid IL or missing references)
//IL_0403: Expected O, but got Unknown
//IL_0418: Unknown result type (might be due to invalid IL or missing references)
//IL_041d: Unknown result type (might be due to invalid IL or missing references)
//IL_0423: Expected O, but got Unknown
//IL_0438: Unknown result type (might be due to invalid IL or missing references)
//IL_043d: Unknown result type (might be due to invalid IL or missing references)
//IL_0443: Expected O, but got Unknown
//IL_0458: Unknown result type (might be due to invalid IL or missing references)
//IL_045d: Unknown result type (might be due to invalid IL or missing references)
//IL_0463: Expected O, but got Unknown
object obj = <>O.<0>__WriteDamageInfo;
if (obj == null)
{
hook_Write_NetworkWriter_DamageInfo val = WriteDamageInfo;
<>O.<0>__WriteDamageInfo = val;
obj = (object)val;
}
NetworkExtensions.Write_NetworkWriter_DamageInfo -= (hook_Write_NetworkWriter_DamageInfo)obj;
object obj2 = <>O.<1>__ReadDamageInfo;
if (obj2 == null)
{
hook_ReadDamageInfo val2 = ReadDamageInfo;
<>O.<1>__ReadDamageInfo = val2;
obj2 = (object)val2;
}
NetworkExtensions.ReadDamageInfo -= (hook_ReadDamageInfo)obj2;
object obj3 = <>O.<2>__BulletAttackDefaultHitCallbackIL;
if (obj3 == null)
{
Manipulator val3 = BulletAttackDefaultHitCallbackIL;
<>O.<2>__BulletAttackDefaultHitCallbackIL = val3;
obj3 = (object)val3;
}
BulletAttack.DefaultHitCallbackImplementation -= (Manipulator)obj3;
object obj4 = <>O.<3>__DamageOrbOnArrivalIL;
if (obj4 == null)
{
Manipulator val4 = DamageOrbOnArrivalIL;
<>O.<3>__DamageOrbOnArrivalIL = val4;
obj4 = (object)val4;
}
DamageOrb.OnArrival -= (Manipulator)obj4;
object obj5 = <>O.<4>__GenericDamageOrbOnArrivalIL;
if (obj5 == null)
{
Manipulator val5 = GenericDamageOrbOnArrivalIL;
<>O.<4>__GenericDamageOrbOnArrivalIL = val5;
obj5 = (object)val5;
}
GenericDamageOrb.OnArrival -= (Manipulator)obj5;
object obj6 = <>O.<5>__LightningOrbOnArrivalIL;
if (obj6 == null)
{
Manipulator val6 = LightningOrbOnArrivalIL;
<>O.<5>__LightningOrbOnArrivalIL = val6;
obj6 = (object)val6;
}
LightningOrb.OnArrival -= (Manipulator)obj6;
object obj7 = <>O.<6>__ChainGunOrbOnArrivalIL;
if (obj7 == null)
{
Manipulator val7 = ChainGunOrbOnArrivalIL;
<>O.<6>__ChainGunOrbOnArrivalIL = val7;
obj7 = (object)val7;
}
ChainGunOrb.OnArrival -= (Manipulator)obj7;
object obj8 = <>O.<7>__DeathProjectileFixedUpdateIL;
if (obj8 == null)
{
Manipulator val8 = DeathProjectileFixedUpdateIL;
<>O.<7>__DeathProjectileFixedUpdateIL = val8;
obj8 = (object)val8;
}
DeathProjectile.FixedUpdate -= (Manipulator)obj8;
object obj9 = <>O.<8>__ProjectileDotZoneResetOverlapIL;
if (obj9 == null)
{
Manipulator val9 = ProjectileDotZoneResetOverlapIL;
<>O.<8>__ProjectileDotZoneResetOverlapIL = val9;
obj9 = (object)val9;
}
ProjectileDotZone.ResetOverlap -= (Manipulator)obj9;
object obj10 = <>O.<9>__ProjectileExplosionDetonateServerIL;
if (obj10 == null)
{
Manipulator val10 = ProjectileExplosionDetonateServerIL;
<>O.<9>__ProjectileExplosionDetonateServerIL = val10;
obj10 = (object)val10;
}
ProjectileExplosion.DetonateServer -= (Manipulator)obj10;
object obj11 = <>O.<10>__ProjectileGrantOnKillOnDestroyOnDestroyIL;
if (obj11 == null)
{
Manipulator val11 = ProjectileGrantOnKillOnDestroyOnDestroyIL;
<>O.<10>__ProjectileGrantOnKillOnDestroyOnDestroyIL = val11;
obj11 = (object)val11;
}
ProjectileGrantOnKillOnDestroy.OnDestroy -= (Manipulator)obj11;
object obj12 = <>O.<11>__ProjectileIntervalOverlapAttackFixedUpdateIL;
if (obj12 == null)
{
Manipulator val12 = ProjectileIntervalOverlapAttackFixedUpdateIL;
<>O.<11>__ProjectileIntervalOverlapAttackFixedUpdateIL = val12;
obj12 = (object)val12;
}
ProjectileIntervalOverlapAttack.FixedUpdate -= (Manipulator)obj12;
object obj13 = <>O.<12>__ProjectileOverlapAttackStartIL;
if (obj13 == null)
{
Manipulator val13 = ProjectileOverlapAttackStartIL;
<>O.<12>__ProjectileOverlapAttackStartIL = val13;
obj13 = (object)val13;
}
ProjectileOverlapAttack.Start -= (Manipulator)obj13;
object obj14 = <>O.<13>__ProjectileOverlapAttackResetOverlapAttackIL;
if (obj14 == null)
{
Manipulator val14 = ProjectileOverlapAttackResetOverlapAttackIL;
<>O.<13>__ProjectileOverlapAttackResetOverlapAttackIL = val14;
obj14 = (object)val14;
}
ProjectileOverlapAttack.ResetOverlapAttack -= (Manipulator)obj14;
object obj15 = <>O.<14>__ProjectileProximityBeamControllerUpdateServerIL;
if (obj15 == null)
{
Manipulator val15 = ProjectileProximityBeamControllerUpdateServerIL;
<>O.<14>__ProjectileProximityBeamControllerUpdateServerIL = val15;
obj15 = (object)val15;
}
ProjectileProximityBeamController.UpdateServer -= (Manipulator)obj15;
object obj16 = <>O.<15>__ProjectileSingleTargetImpactOnProjectileImpactIL;
if (obj16 == null)
{
Manipulator val16 = ProjectileSingleTargetImpactOnProjectileImpactIL;
<>O.<15>__ProjectileSingleTargetImpactOnProjectileImpactIL = val16;
obj16 = (object)val16;
}
ProjectileSingleTargetImpact.OnProjectileImpact -= (Manipulator)obj16;
object obj17 = <>O.<16>__DotControllerEvaluateDotStacksForTypeIL;
if (obj17 == null)
{
Manipulator val17 = DotControllerEvaluateDotStacksForTypeIL;
<>O.<16>__DotControllerEvaluateDotStacksForTypeIL = val17;
obj17 = (object)val17;
}
DotController.EvaluateDotStacksForType -= (Manipulator)obj17;
object obj18 = <>O.<17>__DotControllerAddPendingDamageEntryIL;
if (obj18 == null)
{
Manipulator val18 = DotControllerAddPendingDamageEntryIL;
<>O.<17>__DotControllerAddPendingDamageEntryIL = val18;
obj18 = (object)val18;
}
DotController.AddPendingDamageEntry -= (Manipulator)obj18;
object obj19 = <>O.<18>__BlastAttackHandleHitsIL;
if (obj19 == null)
{
Manipulator val19 = BlastAttackHandleHitsIL;
<>O.<18>__BlastAttackHandleHitsIL = val19;
obj19 = (object)val19;
}
BlastAttack.HandleHits -= (Manipulator)obj19;
object obj20 = <>O.<19>__BlastAttackPerformDamageServerIL;
if (obj20 == null)
{
Manipulator val20 = BlastAttackPerformDamageServerIL;
<>O.<19>__BlastAttackPerformDamageServerIL = val20;
obj20 = (object)val20;
}
BlastAttack.PerformDamageServer -= (Manipulator)obj20;
HookEndpointManager.Remove((MethodBase)Reflection.GetMethodCached(typeof(BlastAttackDamageInfo), "Write"), (Delegate)new BlastAttackDamageInfoWriteDelegate(BlastAttackDamageInfoWrite));
HookEndpointManager.Remove((MethodBase)Reflection.GetMethodCached(typeof(BlastAttackDamageInfo), "Read"), (Delegate)new BlastAttackDamageInfoReadDelegate(BlastAttackDamageInfoRead));
object obj21 = <>O.<22>__OverlapAttackProcessHitsIL;
if (obj21 == null)
{
Manipulator val21 = OverlapAttackProcessHitsIL;
<>O.<22>__OverlapAttackProcessHitsIL = val21;
obj21 = (object)val21;
}
OverlapAttack.ProcessHits -= (Manipulator)obj21;
object obj22 = <>O.<23>__OverlapAttackPerformDamageIL;
if (obj22 == null)
{
Manipulator val22 = OverlapAttackPerformDamageIL;
<>O.<23>__OverlapAttackPerformDamageIL = val22;
obj22 = (object)val22;
}
OverlapAttack.PerformDamage -= (Manipulator)obj22;
object obj23 = <>O.<24>__OverlapAttackMessageSerialize;
if (obj23 == null)
{
hook_Serialize val23 = OverlapAttackMessageSerialize;
<>O.<24>__OverlapAttackMessageSerialize = val23;
obj23 = (object)val23;
}
OverlapAttackMessage.Serialize -= (hook_Serialize)obj23;
object obj24 = <>O.<25>__OverlapAttackMessageDeserialize;
if (obj24 == null)
{
hook_Deserialize val24 = OverlapAttackMessageDeserialize;
<>O.<25>__OverlapAttackMessageDeserialize = val24;
obj24 = (object)val24;
}
OverlapAttackMessage.Deserialize -= (hook_Deserialize)obj24;
object obj25 = <>O.<26>__GlobalEventManagerOnHitAllIL;
if (obj25 == null)
{
Manipulator val25 = GlobalEventManagerOnHitAllIL;
<>O.<26>__GlobalEventManagerOnHitAllIL = val25;
obj25 = (object)val25;
}
GlobalEventManager.OnHitAllProcess -= (Manipulator)obj25;
object obj26 = <>O.<27>__HealthComponentSendDamageDealtIL;
if (obj26 == null)
{
Manipulator val26 = HealthComponentSendDamageDealtIL;
<>O.<27>__HealthComponentSendDamageDealtIL = val26;
obj26 = (object)val26;
}
HealthComponent.SendDamageDealt -= (Manipulator)obj26;
object obj27 = <>O.<28>__DamageDealtMessageSerialize;
if (obj27 == null)
{
hook_Serialize val27 = DamageDealtMessageSerialize;
<>O.<28>__DamageDealtMessageSerialize = val27;
obj27 = (object)val27;
}
DamageDealtMessage.Serialize -= (hook_Serialize)obj27;
object obj28 = <>O.<29>__DamageDealtMessageDeserialize;
if (obj28 == null)
{
hook_Deserialize val28 = DamageDealtMessageDeserialize;
<>O.<29>__DamageDealtMessageDeserialize = val28;
obj28 = (object)val28;
}
DamageDealtMessage.Deserialize -= (hook_Deserialize)obj28;
object obj29 = <>O.<30>__ContactDamageFireOverlapsIL;
if (obj29 == null)
{
Manipulator val29 = ContactDamageFireOverlapsIL;
<>O.<30>__ContactDamageFireOverlapsIL = val29;
obj29 = (object)val29;
}
ContactDamage.FireOverlaps -= (Manipulator)obj29;
object obj30 = <>O.<31>__DelayBlastDetonateIL;
if (obj30 == null)
{
Manipulator val30 = DelayBlastDetonateIL;
<>O.<31>__DelayBlastDetonateIL = val30;
obj30 = (object)val30;
}
DelayBlast.Detonate -= (Manipulator)obj30;
object obj31 = <>O.<32>__CrocoDamageTypeControllerGetDamageType;
if (obj31 == null)
{
hook_GetDamageType val31 = CrocoDamageTypeControllerGetDamageType;
<>O.<32>__CrocoDamageTypeControllerGetDamageType = val31;
obj31 = (object)val31;
}
CrocoDamageTypeController.GetDamageType -= (hook_GetDamageType)obj31;
object obj32 = <>O.<33>__ProjectileManagerInitializeProjectile;
if (obj32 == null)
{
hook_InitializeProjectile val32 = ProjectileManagerInitializeProjectile;
<>O.<33>__ProjectileManagerInitializeProjectile = val32;
obj32 = (object)val32;
}
ProjectileManager.InitializeProjectile -= (hook_InitializeProjectile)obj32;
_hooksEnabled = false;
}
private static DamageInfo ReadDamageInfo(orig_ReadDamageInfo orig, NetworkReader reader)
{
DamageInfo val = orig.Invoke(reader);
ModdedDamageTypeHolder moddedDamageTypeHolder = ModdedDamageTypeHolder.ReadFromNetworkReader(reader);
if (moddedDamageTypeHolder != null)
{
damageTypeHolders.Add((object)val, moddedDamageTypeHolder);
}
return val;
}
private static void WriteDamageInfo(orig_Write_NetworkWriter_DamageInfo orig, NetworkWriter writer, DamageInfo damageInfo)
{
orig.Invoke(writer, damageInfo);
ModdedDamageTypeHolder moddedDamageTypeHolder = default(ModdedDamageTypeHolder);
if (!damageTypeHolders.TryGetValue((object)damageInfo, ref moddedDamageTypeHolder))
{
writer.Write((byte)0);
}
else
{
moddedDamageTypeHolder.WriteToNetworkWriter(writer);
}
}
private static void BulletAttackDefaultHitCallbackIL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Expected O, but got Unknown
GotoAndEmitCopyCallForNewDamageInfo(new ILCursor(il));
}
private static void LightningOrbOnArrivalIL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
GotoAndEmitCopyCallForNewDamageInfo(val);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchNewobj<LightningOrb>(x)
});
val.Emit(OpCodes.Dup);
val.Emit(OpCodes.Ldarg_0);
EmitCopyCall(val);
}
private static void GenericDamageOrbOnArrivalIL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Expected O, but got Unknown
GotoAndEmitCopyCallForNewDamageInfo(new ILCursor(il));
}
private static void DamageOrbOnArrivalIL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Expected O, but got Unknown
GotoAndEmitCopyCallForNewDamageInfo(new ILCursor(il));
}
private static void ChainGunOrbOnArrivalIL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_004a: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
GotoAndEmitCopyCallForNewDamageInfo(val);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchNewobj<ChainGunOrb>(x)
});
val.Emit(OpCodes.Dup);
val.Emit(OpCodes.Ldarg_0);
EmitCopyCall(val);
}
private static void ProjectileProximityBeamControllerUpdateServerIL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchNewobj<LightningOrb>(x)
});
val.Emit(OpCodes.Dup);
val.Emit(OpCodes.Ldarg_0);
EmitCopyFromComponentCall(val);
}
private static void ProjectileOverlapAttackResetOverlapAttackIL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0023: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Expected O, but got Unknown
ILCursor val = new ILCursor(il);
val.Emit(OpCodes.Ldarg_0);
val.Emit<ProjectileOverlapAttack>(OpCodes.Ldfld, "attack");
val.Emit(OpCodes.Ldarg_0);
EmitCopyFromComponentCall(val);
}
private static void ProjectileOverlapAttackStartIL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchStfld<ProjectileOverlapAttack>(x, "attack")
});
val.Emit(OpCodes.Ldarg_0);
val.Emit<ProjectileOverlapAttack>(OpCodes.Ldfld, "attack");
val.Emit(OpCodes.Ldarg_0);
EmitCopyFromComponentCall(val);
}
private static void ProjectileIntervalOverlapAttackFixedUpdateIL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchNewobj<OverlapAttack>(x)
});
val.Emit(OpCodes.Dup);
val.Emit(OpCodes.Ldarg_0);
EmitCopyFromComponentCall(val);
}
private static void ProjectileExplosionDetonateServerIL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchNewobj<BlastAttack>(x)
});
val.Emit(OpCodes.Dup);
val.Emit(OpCodes.Ldarg_0);
EmitCopyFromComponentCall(val);
}
private static void ProjectileDotZoneResetOverlapIL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchStfld<ProjectileDotZone>(x, "attack")
});
val.Emit(OpCodes.Ldarg_0);
val.Emit<ProjectileDotZone>(OpCodes.Ldfld, "attack");
val.Emit(OpCodes.Ldarg_0);
EmitCopyFromComponentCall(val);
}
private static void ProjectileManagerInitializeProjectile(orig_InitializeProjectile orig, ProjectileController projectileController, FireProjectileInfo fireProjectileInfo)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_008a: 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)
orig.Invoke(projectileController, fireProjectileInfo);
ProjectileDamage component = ((Component)projectileController).GetComponent<ProjectileDamage>();
if (!Object.op_Implicit((Object)(object)component) || DamageTypeCombo.op_Implicit(component.damageType & DamageTypeCombo.op_Implicit(signalDamageType)) == 0L)
{
return;
}
ModdedDamageTypeHolderComponent component2 = ((Component)projectileController).GetComponent<ModdedDamageTypeHolderComponent>();
CrocoDamageTypeController component3 = projectileController.owner.GetComponent<CrocoDamageTypeController>();
ModdedDamageTypeHolder moddedDamageTypeHolder = default(ModdedDamageTypeHolder);
if (damageTypeHolders.TryGetValue((object)component3, ref moddedDamageTypeHolder))
{
if (Object.op_Implicit((Object)(object)component2))
{
component2.Add(moddedDamageTypeHolder);
}
else
{
((Component)projectileController).gameObject.AddComponent<ModdedDamageTypeHolderComponent>().Add(moddedDamageTypeHolder);
}
component.damageType &= DamageTypeCombo.op_Implicit(~signalDamageType);
}
}
private static void ProjectileSingleTargetImpactOnProjectileImpactIL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Expected O, but got Unknown
GotoAndEmitCopyComponentCallForNewDamageInfo(new ILCursor(il));
}
private static void ProjectileGrantOnKillOnDestroyOnDestroyIL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Expected O, but got Unknown
GotoAndEmitCopyComponentCallForNewDamageInfo(new ILCursor(il));
}
private static void DeathProjectileFixedUpdateIL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Expected O, but got Unknown
GotoAndEmitCopyComponentCallForNewDamageInfo(new ILCursor(il));
}
private static void DotControllerAddPendingDamageEntryIL(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_0075: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
int pendingDamageIndex = -1;
FieldReference val2 = default(FieldReference);
val.GotoNext(new Func<Instruction, bool>[3]
{
(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref pendingDamageIndex),
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 3),
(Instruction x) => ILPatternMatchingExt.MatchStfld(x, ref val2)
});
val.Emit(OpCodes.Ldloc, pendingDamageIndex);
EmitGetTempHolder(val);
EmitAssignHolderCall(val);
}
private static void DotControllerEvaluateDotStacksForTypeIL(ILContext il)
{
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_000d: Expected O, but got Unknown
//IL_0098: Unknown result type (might be due to invalid IL or missing references)
//IL_00b0: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Expected O, but got Unknown
ILCursor val = new ILCursor(il);
int dotStackIndex = -1;
ILLabel val2 = default(ILLabel);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[4]
{
(Instruction x) => ILPatternMatchingExt.MatchLdloc(x, ref dotStackIndex),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<DotStack>(x, "dotIndex"),
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 1),
(Instruction x) => ILPatternMatchingExt.MatchBneUn(x, ref val2)
});
val.Emit(OpCodes.Ldloc, dotStackIndex);
EmitSetTempHolder(val);
GotoAndEmitCopyCallForNewDamageInfo(new ILCursor(il));
}
private static void BlastAttackDamageInfoRead(BlastAttackDamageInfoReadOrig orig, ref BlastAttackDamageInfo self, NetworkReader networkReader)
{
orig(ref self, networkReader);
ModdedDamageTypeHolder moddedDamageTypeHolder = ModdedDamageTypeHolder.ReadFromNetworkReader(networkReader);
if (moddedDamageTypeHolder != null)
{
TempHolder = moddedDamageTypeHolder;
}
}
private static void BlastAttackDamageInfoWrite(BlastAttackDamageInfoWriteOrig orig, ref BlastAttackDamageInfo self, NetworkWriter networkWriter)
{
orig(ref self, networkWriter);
ModdedDamageTypeHolder tempHolder = TempHolder;
if (tempHolder == null)
{
networkWriter.Write((byte)0);
}
else
{
tempHolder.WriteToNetworkWriter(networkWriter);
}
}
private static void BlastAttackPerformDamageServerIL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchNewobj<DamageInfo>(x)
});
val.Emit(OpCodes.Dup);
EmitGetTempHolder(val);
EmitAssignHolderCall(val);
}
private static void BlastAttackHandleHitsIL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
val.GotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCall<NetworkServer>(x, "get_active")
});
val.Emit(OpCodes.Ldarg_0);
EmitSetTempHolder(val);
}
private static void OverlapAttackMessageDeserialize(orig_Deserialize orig, MessageBase self, NetworkReader reader)
{
orig.Invoke(self, reader);
ModdedDamageTypeHolder moddedDamageTypeHolder = ModdedDamageTypeHolder.ReadFromNetworkReader(reader);
if (moddedDamageTypeHolder != null)
{
TempHolder = moddedDamageTypeHolder;
}
}
private static void OverlapAttackMessageSerialize(orig_Serialize orig, MessageBase self, NetworkWriter writer)
{
orig.Invoke(self, writer);
ModdedDamageTypeHolder tempHolder = TempHolder;
if (tempHolder == null)
{
writer.Write((byte)0);
}
else
{
tempHolder.WriteToNetworkWriter(writer);
}
}
private static void OverlapAttackPerformDamageIL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchNewobj<DamageInfo>(x)
});
val.Emit(OpCodes.Dup);
EmitGetTempHolder(val);
EmitAssignHolderCall(val);
}
private static void OverlapAttackProcessHitsIL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
val.GotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchCall<NetworkServer>(x, "get_active")
});
val.Emit(OpCodes.Ldarg_0);
EmitSetTempHolder(val);
}
private static void GlobalEventManagerOnHitAllIL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
val.GotoNext(new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchLdsfld(x, typeof(Items), "Behemoth")
});
val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchNewobj<BlastAttack>(x)
});
val.Emit(OpCodes.Dup);
val.Emit(OpCodes.Ldarg_1);
EmitCopyCall(val);
}
private static void DamageDealtMessageDeserialize(orig_Deserialize orig, DamageDealtMessage self, NetworkReader reader)
{
orig.Invoke(self, reader);
ModdedDamageTypeHolder moddedDamageTypeHolder = ModdedDamageTypeHolder.ReadFromNetworkReader(reader);
if (moddedDamageTypeHolder != null)
{
damageTypeHolders.Add((object)self, moddedDamageTypeHolder);
}
}
private static void DamageDealtMessageSerialize(orig_Serialize orig, DamageDealtMessage self, NetworkWriter writer)
{
orig.Invoke(self, writer);
ModdedDamageTypeHolder moddedDamageTypeHolder = default(ModdedDamageTypeHolder);
if (!damageTypeHolders.TryGetValue((object)self, ref moddedDamageTypeHolder))
{
writer.Write((byte)0);
}
else
{
moddedDamageTypeHolder.WriteToNetworkWriter(writer);
}
}
private static void HealthComponentSendDamageDealtIL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchNewobj<DamageDealtMessage>(x)
});
val.Emit(OpCodes.Dup);
val.Emit(OpCodes.Ldarg_0);
val.Emit<DamageReport>(OpCodes.Ldfld, "damageInfo");
EmitCopyCall(val);
}
private static void DelayBlastDetonateIL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0038: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
val.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchNewobj<BlastAttack>(x)
});
val.Emit(OpCodes.Dup);
val.Emit(OpCodes.Ldarg_0);
EmitCopyFromComponentCall(val);
}
private static void ContactDamageFireOverlapsIL(ILContext il)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Expected O, but got Unknown
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_0065: Unknown result type (might be due to invalid IL or missing references)
//IL_0076: Unknown result type (might be due to invalid IL or missing references)
ILCursor val = new ILCursor(il);
val.GotoNext(new Func<Instruction, bool>[2]
{
(Instruction x) => ILPatternMatchingExt.MatchLdarg(x, 0),
(Instruction x) => ILPatternMatchingExt.MatchLdfld<ContactDamage>(x, "damageType")
});
val.Emit(OpCodes.Ldarg_0);
val.Emit<ContactDamage>(OpCodes.Ldfld, "overlapAttack");
val.Emit(OpCodes.Ldarg_0);
EmitCopyFromComponentCall(val);
}
private static DamageTypeCombo CrocoDamageTypeControllerGetDamageType(orig_GetDamageType orig, CrocoDamageTypeController self)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0018: Unknown result type (might be due to invalid IL or missing references)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
DamageTypeCombo val = orig.Invoke(self);
ModdedDamageTypeHolder moddedDamageTypeHolder = default(ModdedDamageTypeHolder);
if (damageTypeHolders.TryGetValue((object)self, ref moddedDamageTypeHolder))
{
val |= DamageTypeCombo.op_Implicit(signalDamageType);
}
return val;
}
private static void EmitGetTempHolder(ILCursor c)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
c.Emit(OpCodes.Call, (MethodBase)Reflection.GetPropertyCached(typeof(DamageAPI), "TempHolder").GetGetMethod(nonPublic: true));
}
private static void EmitSetTempHolder(ILCursor c)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
c.Emit(OpCodes.Call, (MethodBase)Reflection.GetMethodCached(typeof(DamageAPI), "MakeCopyOfModdedDamageTypeFromObject"));
c.Emit(OpCodes.Call, (MethodBase)Reflection.GetPropertyCached(typeof(DamageAPI), "TempHolder").GetSetMethod(nonPublic: true));
}
private static void GotoAndEmitCopyCallForNewDamageInfo(ILCursor c)
{
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
c.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchNewobj<DamageInfo>(x)
});
c.Emit(OpCodes.Dup);
c.Emit(OpCodes.Ldarg_0);
EmitCopyCall(c);
}
private static void GotoAndEmitCopyComponentCallForNewDamageInfo(ILCursor c)
{
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
c.GotoNext((MoveType)2, new Func<Instruction, bool>[1]
{
(Instruction x) => ILPatternMatchingExt.MatchNewobj<DamageInfo>(x)
});
c.Emit(OpCodes.Dup);
c.Emit(OpCodes.Ldarg_0);
EmitCopyFromComponentCall(c);
}
private static void EmitCopyCall(ILCursor c)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
c.Emit(OpCodes.Call, (MethodBase)Reflection.GetMethodCached(typeof(DamageAPI), "CopyModdedDamageType"));
}
private static void CopyModdedDamageType(object to, object from)
{
ModdedDamageTypeHolder moddedDamageTypeHolder = default(ModdedDamageTypeHolder);
if (from != null && to != null && damageTypeHolders.TryGetValue(from, ref moddedDamageTypeHolder))
{
moddedDamageTypeHolder.CopyToInternal(to);
}
}
private static void EmitCopyFromComponentCall(ILCursor c)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
c.Emit(OpCodes.Call, (MethodBase)Reflection.GetMethodCached(typeof(DamageAPI), "CopyModdedDamageTypeFromComponent"));
}
private static void CopyModdedDamageTypeFromComponent(object to, Component from)
{
if (Object.op_Implicit((Object)(object)from) && to != null)
{
ModdedDamageTypeHolderComponent component = from.GetComponent<ModdedDamageTypeHolderComponent>();
if (Object.op_Implicit((Object)(object)component))
{
component.CopyToInternal(to);
}
}
}
private static void EmitAssignHolderCall(ILCursor c)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
c.Emit(OpCodes.Call, (MethodBase)Reflection.GetMethodCached(typeof(DamageAPI), "AssignHolderToObject"));
}
private static void AssignHolderToObject(object obj, ModdedDamageTypeHolder holder)
{
if (holder != null && obj != null)
{
holder.CopyToInternal(obj);
}
}
private static ModdedDamageTypeHolder MakeCopyOfModdedDamageTypeFromObject(object from)
{
if (from == null)
{
return null;
}
ModdedDamageTypeHolder moddedDamageTypeHolder = default(ModdedDamageTypeHolder);
if (damageTypeHolders.TryGetValue(from, ref moddedDamageTypeHolder))
{
return moddedDamageTypeHolder.MakeCopy();
}
return null;
}
public static ModdedDamageType ReserveDamageType()
{
SetHooks();
if (ModdedDamageTypeCount >= 1152)
{
throw new IndexOutOfRangeException($"Reached the limit of {1152} ModdedDamageTypes. Please contact R2API developers to increase the limit");
}
return (ModdedDamageType)(ModdedDamageTypeCount++);
}
public static void AddModdedDamageType(this DamageInfo damageInfo, ModdedDamageType moddedDamageType)
{
AddModdedDamageTypeInternal(damageInfo, moddedDamageType);
}
public static void AddModdedDamageType(this BulletAttack bulletAttack, ModdedDamageType moddedDamageType)
{
AddModdedDamageTypeInternal(bulletAttack, moddedDamageType);
}
public static void AddModdedDamageType(this DamageOrb damageOrb, ModdedDamageType moddedDamageType)
{
AddModdedDamageTypeInternal(damageOrb, moddedDamageType);
}
public static void AddModdedDamageType(this GenericDamageOrb genericDamageOrb, ModdedDamageType moddedDamageType)
{
AddModdedDamageTypeInternal(genericDamageOrb, moddedDamageType);
}
public static void AddModdedDamageType(this LightningOrb lightningOrb, ModdedDamageType moddedDamageType)
{
AddModdedDamageTypeInternal(lightningOrb, moddedDamageType);
}
public static void AddModdedDamageType(this BlastAttack blastAttack, ModdedDamageType moddedDamageType)
{
AddModdedDamageTypeInternal(blastAttack, moddedDamageType);
}
public static void AddModdedDamageType(this OverlapAttack overlapAttack, ModdedDamageType moddedDamageType)
{
AddModdedDamageTypeInternal(overlapAttack, moddedDamageType);
}
public static void AddModdedDamageType(this DotStack dotStack, ModdedDamageType moddedDamageType)
{
AddModdedDamageTypeInternal(dotStack, moddedDamageType);
}
public static void AddModdedDamageType(this CrocoDamageTypeController croco, ModdedDamageType moddedDamageType)
{
AddModdedDamageTypeInternal(croco, moddedDamageType);
}
private static void AddModdedDamageTypeInternal(object obj, ModdedDamageType moddedDamageType)
{
SetHooks();
if ((int)moddedDamageType >= ModdedDamageTypeCount || moddedDamageType < (ModdedDamageType)0)
{
throw new ArgumentOutOfRangeException(string.Format("Parameter '{0}' with value {1} is out of range of registered types (0-{2})", "moddedDamageType", moddedDamageType, ModdedDamageTypeCount - 1));
}
ModdedDamageTypeHolder moddedDamageTypeHolder = default(ModdedDamageTypeHolder);
if (!damageTypeHolders.TryGetValue(obj, ref moddedDamageTypeHolder))
{
damageTypeHolders.Add(obj, moddedDamageTypeHolder = new ModdedDamageTypeHolder());
}
moddedDamageTypeHolder.Add(moddedDamageType);
}
public static bool RemoveModdedDamageType(this DamageInfo damageInfo, ModdedDamageType moddedDamageType)
{
return RemoveModdedDamageTypeInternal(damageInfo, moddedDamageType);
}
public static bool RemoveModdedDamageType(this BulletAttack bulletAttack, ModdedDamageType moddedDamageType)
{
return RemoveModdedDamageTypeInternal(bulletAttack, moddedDamageType);
}
public static bool RemoveModdedDamageType(this DamageOrb damageOrb, ModdedDamageType moddedDamageType)
{
return RemoveModdedDamageTypeInternal(damageOrb, moddedDamageType);
}
public static bool RemoveModdedDamageType(this GenericDamageOrb genericDamageOrb, ModdedDamageType moddedDamageType)
{
return RemoveModdedDamageTypeInternal(genericDamageOrb, moddedDamageType);
}
public static bool RemoveModdedDamageType(this LightningOrb lightningOrb, ModdedDamageType moddedDamageType)
{
return RemoveModdedDamageTypeInternal(lightningOrb, moddedDamageType);
}
public static bool RemoveModdedDamageType(this BlastAttack blastAttack, ModdedDamageType moddedDamageType)
{
return RemoveModdedDamageTypeInternal(blastAttack, moddedDamageType);
}
public static bool RemoveModdedDamageType(this OverlapAttack overlapAttack, ModdedDamageType moddedDamageType)
{
return RemoveModdedDamageTypeInternal(overlapAttack, moddedDamageType);
}
public static bool RemoveModdedDamageType(this DotStack dotStack, ModdedDamageType moddedDamageType)
{
return RemoveModdedDamageTypeInternal(dotStack, moddedDamageType);
}
public static bool RemoveModdedDamageType(this CrocoDamageTypeController croco, ModdedDamageType moddedDamageType)
{
return RemoveModdedDamageTypeInternal(croco, moddedDamageType);
}
private static bool RemoveModdedDamageTypeInternal(object obj, ModdedDamageType moddedDamageType)
{
SetHooks();
if ((int)moddedDamageType >= ModdedDamageTypeCount || moddedDamageType < (ModdedDamageType)0)
{
throw new ArgumentOutOfRangeException(string.Format("Parameter '{0}' with value {1} is out of range of registered types (0-{2})", "moddedDamageType", moddedDamageType, ModdedDamageTypeCount - 1));
}
ModdedDamageTypeHolder moddedDamageTypeHolder = default(ModdedDamageTypeHolder);
if (!damageTypeHolders.TryGetValue(obj, ref moddedDamageTypeHolder))
{
return false;
}
return moddedDamageTypeHolder.Remove(moddedDamageType);
}
public static bool HasModdedDamageType(this DamageInfo damageInfo, ModdedDamageType moddedDamageType)
{
return HasModdedDamageTypeInternal(damageInfo, moddedDamageType, ref damageInfo.damageType, damageInfo.attacker);
}
public static bool HasModdedDamageType(this BulletAttack bulletAttack, ModdedDamageType moddedDamageType)
{
return HasModdedDamageTypeInternal(bulletAttack, moddedDamageType, ref bulletAttack.damageType, bulletAttack.owner);
}
public static bool HasModdedDamageType(this DamageOrb damageOrb, ModdedDamageType moddedDamageType)
{
return HasModdedDamageTypeInternal(damageOrb, moddedDamageType, ref damageOrb.orbDamageType, damageOrb.attacker);
}
public static bool HasModdedDamageType(this GenericDamageOrb genericDamageOrb, ModdedDamageType moddedDamageType)
{
return HasModdedDamageTypeInternal(genericDamageOrb, moddedDamageType, ref genericDamageOrb.damageType, genericDamageOrb.attacker);
}
public static bool HasModdedDamageType(this LightningOrb lightningOrb, ModdedDamageType moddedDamageType)
{
return HasModdedDamageTypeInternal(lightningOrb, moddedDamageType, ref lightningOrb.damageType, lightningOrb.attacker);
}
public static bool HasModdedDamageType(this BlastAttack blastAttack, ModdedDamageType moddedDamageType)
{
return HasModdedDamageTypeInternal(blastAttack, moddedDamageType, ref blastAttack.damageType, blastAttack.attacker);
}
public static bool HasModdedDamageType(this OverlapAttack overlapAttack, ModdedDamageType moddedDamageType)
{
return HasModdedDamageTypeInternal(overlapAttack, moddedDamageType, ref overlapAttack.damageType, overlapAttack.attacker);
}
public static bool HasModdedDamageType(this DotStack dotStack, ModdedDamageType moddedDamageType)
{
return HasModdedDamageTypeInternal(dotStack, moddedDamageType, ref dotStack.damageType, dotStack.attackerObject);
}
public static bool HasModdedDamageType(this CrocoDamageTypeController croco, ModdedDamageType moddedDamageType)
{
return HasModdedDamageTypeInternal(croco, moddedDamageType);
}
[MethodImpl(MethodImplOptions.AggressiveInlining)]
private static bool HasModdedDamageTypeInternal(object obj, ModdedDamageType moddedDamageType, GameObject owner = null)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
DamageTypeCombo vanillaDamageType = default(DamageTypeCombo);
return HasModdedDamageTypeInternal(obj, moddedDamageType, ref vanillaDamageType);
}
private static bool HasModdedDamageTypeInternal(object obj, ModdedDamageType moddedDamageType, ref DamageTypeCombo vanillaDamageType, GameObject owner = null)
{
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00ba: Unknown result type (might be due to invalid IL or missing references)
//IL_00bf: Unknown result type (might be due to invalid IL or missing references)
//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
SetHooks();
if ((int)moddedDamageType >= ModdedDamageTypeCount || moddedDamageType < (ModdedDamageType)0)
{
throw new ArgumentOutOfRangeException(string.Format("Parameter '{0}' with value {1} is out of range of registered types (0-{2})", "moddedDamageType", moddedDamageType, ModdedDamageTypeCount - 1));
}
bool flag = DamageTypeCombo.op_Implicit(vanillaDamageType & DamageTypeCombo.op_Implicit(signalDamageType)) != 0;
ModdedDamageTypeHolder moddedDamageTypeHolder = default(ModdedDamageTypeHolder);
if (!damageTypeHolders.TryGetValue(obj, ref moddedDamageTypeHolder) && (!flag || !Object.op_Implicit((Object)(object)owner)))
{
return false;
}
if (flag && Object.op_Implicit((Object)(object)owner))
{
CrocoDamageTypeController component = owner.GetComponent<CrocoDamageTypeController>();
ModdedDamageTypeHolder moddedDamageTypeHolder2 = default(ModdedDamageTypeHolder);
if (Object.op_Implicit((Object)(object)component) && damageTypeHolders.TryGetValue((object)component, ref moddedDamageTypeHolder2))
{
damageTypeHolders.GetOrCreateValue(obj).Add(moddedDamageTypeHolder2);
vanillaDamageType &= DamageTypeCombo.op_Implicit(~signalDamageType);
}
}
return moddedDamageTypeHolder?.Has(moddedDamageType) ?? false;
}
public static ModdedDamageTypeHolder GetModdedDamageTypeHolder(this DamageInfo damageInfo)
{
return GetModdedDamageTypeHolderInternal(damageInfo);
}
public static ModdedDamageTypeHolder GetModdedDamageTypeHolder(this BulletAttack bulletAttack)
{
return GetModdedDamageTypeHolderInternal(bulletAttack);
}
public static ModdedDamageTypeHolder GetModdedDamageTypeHolder(this DamageOrb damageOrb)
{
return GetModdedDamageTypeHolderInternal(damageOrb);
}
public static ModdedDamageTypeHolder GetModdedDamageTypeHolder(this GenericDamageOrb genericDamageOrb)
{
return GetModdedDamageTypeHolderInternal(genericDamageOrb);
}
public static ModdedDamageTypeHolder GetModdedDamageTypeHolder(this LightningOrb lightningOrb)
{
return GetModdedDamageTypeHolderInternal(lightningOrb);
}
public static ModdedDamageTypeHolder GetModdedDamageTypeHolder(this BlastAttack blastAttack)
{
return GetModdedDamageTypeHolderInternal(blastAttack);
}
public static ModdedDamageTypeHolder GetModdedDamageTypeHolder(this OverlapAttack overlapAttack)
{
return GetModdedDamageTypeHolderInternal(overlapAttack);
}
public static ModdedDamageTypeHolder GetModdedDamageTypeHolder(this DotStack dotStack)
{
return GetModdedDamageTypeHolderInternal(dotStack);
}
public static ModdedDamageTypeHolder GetModdedDamageTypeHolder(this CrocoDamageTypeController croco)
{
return GetModdedDamageTypeHolderInternal(croco);
}
private static ModdedDamageTypeHolder GetModdedDamageTypeHolderInternal(object obj)
{
SetHooks();
ModdedDamageTypeHolder result = default(ModdedDamageTypeHolder);
if (!damageTypeHolders.TryGetValue(obj, ref result))
{
return null;
}
return result;
}
}
[BepInPlugin("com.bepis.r2api.damagetype", "R2API.DamageType", "1.1.2")]
public sealed class DamageTypePlugin : BaseUnityPlugin
{
internal static ManualLogSource Logger { get; set; }
private void Awake()
{
Logger = ((BaseUnityPlugin)this).Logger;
}
private void OnDestroy()
{
DamageAPI.UnsetHooks();
}
}
}
namespace R2API.AutoVersionGen
{
[AttributeUsage(AttributeTargets.Class, Inherited = false, AllowMultiple = false)]
internal class AutoVersionAttribute : Attribute
{
}
}