Decompiled source of Sicarian Infiltrator v1.0.2
plugins/MonoMod.Backports.dll
Decompiled 2 weeks agousing System; using System.Buffers; using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; using System.Diagnostics.CodeAnalysis; using System.Globalization; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.ConstrainedExecution; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using System.Threading; using Microsoft.CodeAnalysis; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: CLSCompliant(true)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("0x0ade, DaNike")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyCopyright("Copyright 2024 0x0ade, DaNike")] [assembly: AssemblyDescription("A set of backports of new BCL features to all frameworks which MonoMod supports.")] [assembly: AssemblyFileVersion("1.1.2.0")] [assembly: AssemblyInformationalVersion("1.1.2+a1b82852b")] [assembly: AssemblyProduct("MonoMod.Backports")] [assembly: AssemblyTitle("MonoMod.Backports")] [assembly: AssemblyMetadata("RepositoryUrl", "https://github.com/MonoMod/MonoMod.git")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.2.0")] [assembly: TypeForwardedTo(typeof(ArrayPool<>))] [assembly: TypeForwardedTo(typeof(BuffersExtensions))] [assembly: TypeForwardedTo(typeof(IBufferWriter<>))] [assembly: TypeForwardedTo(typeof(IMemoryOwner<>))] [assembly: TypeForwardedTo(typeof(IPinnable))] [assembly: TypeForwardedTo(typeof(MemoryHandle))] [assembly: TypeForwardedTo(typeof(MemoryManager<>))] [assembly: TypeForwardedTo(typeof(ReadOnlySequence<>))] [assembly: TypeForwardedTo(typeof(ReadOnlySequenceSegment<>))] [assembly: TypeForwardedTo(typeof(StandardFormat))] [assembly: TypeForwardedTo(typeof(ConcurrentBag<>))] [assembly: TypeForwardedTo(typeof(ConcurrentDictionary<, >))] [assembly: TypeForwardedTo(typeof(ConcurrentQueue<>))] [assembly: TypeForwardedTo(typeof(ConcurrentStack<>))] [assembly: TypeForwardedTo(typeof(EnumerablePartitionerOptions))] [assembly: TypeForwardedTo(typeof(IProducerConsumerCollection<>))] [assembly: TypeForwardedTo(typeof(OrderablePartitioner<>))] [assembly: TypeForwardedTo(typeof(Partitioner))] [assembly: TypeForwardedTo(typeof(Partitioner<>))] [assembly: TypeForwardedTo(typeof(IReadOnlyCollection<>))] [assembly: TypeForwardedTo(typeof(IReadOnlyList<>))] [assembly: TypeForwardedTo(typeof(IStructuralComparable))] [assembly: TypeForwardedTo(typeof(IStructuralEquatable))] [assembly: TypeForwardedTo(typeof(HashCode))] [assembly: TypeForwardedTo(typeof(Memory<>))] [assembly: TypeForwardedTo(typeof(MemoryExtensions))] [assembly: TypeForwardedTo(typeof(ReadOnlyMemory<>))] [assembly: TypeForwardedTo(typeof(ReadOnlySpan<>))] [assembly: TypeForwardedTo(typeof(IntrospectionExtensions))] [assembly: TypeForwardedTo(typeof(IReflectableType))] [assembly: TypeForwardedTo(typeof(TypeDelegator))] [assembly: TypeForwardedTo(typeof(TypeInfo))] [assembly: TypeForwardedTo(typeof(CallerFilePathAttribute))] [assembly: TypeForwardedTo(typeof(CallerLineNumberAttribute))] [assembly: TypeForwardedTo(typeof(CallerMemberNameAttribute))] [assembly: TypeForwardedTo(typeof(ConditionalWeakTable<, >))] [assembly: TypeForwardedTo(typeof(TupleElementNamesAttribute))] [assembly: TypeForwardedTo(typeof(Unsafe))] [assembly: TypeForwardedTo(typeof(DefaultDllImportSearchPathsAttribute))] [assembly: TypeForwardedTo(typeof(DllImportSearchPath))] [assembly: TypeForwardedTo(typeof(MemoryMarshal))] [assembly: TypeForwardedTo(typeof(SequenceMarshal))] [assembly: TypeForwardedTo(typeof(SequencePosition))] [assembly: TypeForwardedTo(typeof(Span<>))] [assembly: TypeForwardedTo(typeof(SpinLock))] [assembly: TypeForwardedTo(typeof(SpinWait))] [assembly: TypeForwardedTo(typeof(ThreadLocal<>))] [assembly: TypeForwardedTo(typeof(Volatile))] [assembly: TypeForwardedTo(typeof(Tuple))] [assembly: TypeForwardedTo(typeof(Tuple<>))] [assembly: TypeForwardedTo(typeof(Tuple<, >))] [assembly: TypeForwardedTo(typeof(Tuple<, , >))] [assembly: TypeForwardedTo(typeof(Tuple<, , , >))] [assembly: TypeForwardedTo(typeof(Tuple<, , , , >))] [assembly: TypeForwardedTo(typeof(Tuple<, , , , , >))] [assembly: TypeForwardedTo(typeof(Tuple<, , , , , , >))] [assembly: TypeForwardedTo(typeof(Tuple<, , , , , , , >))] [assembly: TypeForwardedTo(typeof(ValueTuple))] [assembly: TypeForwardedTo(typeof(ValueTuple<>))] [assembly: TypeForwardedTo(typeof(ValueTuple<, >))] [assembly: TypeForwardedTo(typeof(ValueTuple<, , >))] [assembly: TypeForwardedTo(typeof(ValueTuple<, , , >))] [assembly: TypeForwardedTo(typeof(ValueTuple<, , , , >))] [assembly: TypeForwardedTo(typeof(ValueTuple<, , , , , >))] [assembly: TypeForwardedTo(typeof(ValueTuple<, , , , , , >))] [assembly: TypeForwardedTo(typeof(ValueTuple<, , , , , , , >))] [assembly: TypeForwardedTo(typeof(WeakReference<>))] [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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NativeIntegerAttribute : Attribute { public readonly bool[] TransformFlags; public NativeIntegerAttribute() { TransformFlags = new bool[1] { true }; } public NativeIntegerAttribute(bool[] P_0) { TransformFlags = 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; } } } internal static class AssemblyInfo { public const string AssemblyName = "MonoMod.Backports"; public const string AssemblyVersion = "1.1.2"; } namespace MonoMod.SourceGen.Attributes { [AttributeUsage(AttributeTargets.Class)] internal sealed class EmitILOverloadsAttribute : Attribute { public EmitILOverloadsAttribute(string filename, string kind) { } } internal static class ILOverloadKind { public const string Cursor = "ILCursor"; public const string Matcher = "ILMatcher"; } } namespace MonoMod.Backports { public static class MethodImplOptionsEx { public const MethodImplOptions Unmanaged = MethodImplOptions.Unmanaged; public const MethodImplOptions NoInlining = MethodImplOptions.NoInlining; public const MethodImplOptions ForwardRef = MethodImplOptions.ForwardRef; public const MethodImplOptions Synchronized = MethodImplOptions.Synchronized; public const MethodImplOptions NoOptimization = MethodImplOptions.NoOptimization; public const MethodImplOptions PreserveSig = MethodImplOptions.PreserveSig; public const MethodImplOptions AggressiveInlining = MethodImplOptions.AggressiveInlining; public const MethodImplOptions AggressiveOptimization = MethodImplOptions.AggressiveOptimization; public const MethodImplOptions InternalCall = MethodImplOptions.InternalCall; } } namespace MonoMod.Backports.ILHelpers { [CLSCompliant(false)] public static class UnsafeRaw { [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public unsafe static T Read<T>(void* source) { return Unsafe.Read<T>(source); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public unsafe static T ReadUnaligned<T>(void* source) { return Unsafe.ReadUnaligned<T>(source); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static T ReadUnaligned<T>(ref byte source) { return Unsafe.ReadUnaligned<T>(ref source); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public unsafe static void Write<T>(void* destination, T value) { Unsafe.Write(destination, value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public unsafe static void WriteUnaligned<T>(void* destination, T value) { Unsafe.WriteUnaligned(destination, value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static void WriteUnaligned<T>(ref byte destination, T value) { Unsafe.WriteUnaligned(ref destination, value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public unsafe static void Copy<T>(void* destination, ref T source) { Unsafe.Copy(destination, ref source); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public unsafe static void Copy<T>(ref T destination, void* source) { Unsafe.Copy(ref destination, source); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public unsafe static void* AsPointer<T>(ref T value) { return Unsafe.AsPointer(ref value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static void SkipInit<T>(out T value) { Unsafe.SkipInit<T>(out value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public unsafe static void CopyBlock(void* destination, void* source, uint byteCount) { Unsafe.CopyBlock(destination, source, byteCount); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static void CopyBlock(ref byte destination, ref byte source, uint byteCount) { Unsafe.CopyBlock(ref destination, ref source, byteCount); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public unsafe static void CopyBlockUnaligned(void* destination, void* source, uint byteCount) { Unsafe.CopyBlockUnaligned(destination, source, byteCount); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static void CopyBlockUnaligned(ref byte destination, ref byte source, uint byteCount) { Unsafe.CopyBlockUnaligned(ref destination, ref source, byteCount); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public unsafe static void InitBlock(void* startAddress, byte value, uint byteCount) { Unsafe.InitBlock(startAddress, value, byteCount); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static void InitBlock(ref byte startAddress, byte value, uint byteCount) { Unsafe.InitBlock(ref startAddress, value, byteCount); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public unsafe static void InitBlockUnaligned(void* startAddress, byte value, uint byteCount) { Unsafe.InitBlockUnaligned(startAddress, value, byteCount); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static void InitBlockUnaligned(ref byte startAddress, byte value, uint byteCount) { Unsafe.InitBlockUnaligned(ref startAddress, value, byteCount); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static T As<T>(object o) where T : class { return Unsafe.As<T>(o); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public unsafe static ref T AsRef<T>(void* source) { return ref Unsafe.AsRef<T>(source); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static ref T AsRef<T>(in T source) { return ref Unsafe.AsRef(in source); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static ref TTo As<TFrom, TTo>(ref TFrom source) { return ref Unsafe.As<TFrom, TTo>(ref source); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static ref T Unbox<T>(object box) where T : struct { return ref Unsafe.Unbox<T>(box); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static ref T AddByteOffset<T>(ref T source, nint byteOffset) { return ref Unsafe.AddByteOffset(ref source, byteOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static ref T AddByteOffset<T>(ref T source, nuint byteOffset) { return ref Unsafe.AddByteOffset(ref source, byteOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static ref T SubtractByteOffset<T>(ref T source, nint byteOffset) { return ref Unsafe.SubtractByteOffset(ref source, byteOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static ref T SubtractByteOffset<T>(ref T source, nuint byteOffset) { return ref Unsafe.SubtractByteOffset(ref source, byteOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static nint ByteOffset<T>(ref T origin, ref T target) { return Unsafe.ByteOffset(ref origin, ref target); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static bool AreSame<T>(ref T left, ref T right) { return Unsafe.AreSame(ref left, ref right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static bool IsAddressGreaterThan<T>(ref T left, ref T right) { return Unsafe.IsAddressGreaterThan(ref left, ref right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static bool IsAddressLessThan<T>(ref T left, ref T right) { return Unsafe.IsAddressLessThan(ref left, ref right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static bool IsNullRef<T>(ref T source) { return Unsafe.IsNullRef(ref source); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static ref T NullRef<T>() { return ref Unsafe.NullRef<T>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static int SizeOf<T>() { return Unsafe.SizeOf<T>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static ref T Add<T>(ref T source, int elementOffset) { return ref Unsafe.Add(ref source, elementOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public unsafe static void* Add<T>(void* source, int elementOffset) { return Unsafe.Add<T>(source, elementOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static ref T Add<T>(ref T source, nint elementOffset) { return ref Unsafe.Add(ref source, elementOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static ref T Add<T>(ref T source, nuint elementOffset) { return ref Unsafe.Add(ref source, elementOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static ref T Subtract<T>(ref T source, int elementOffset) { return ref Unsafe.Subtract(ref source, elementOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public unsafe static void* Subtract<T>(void* source, int elementOffset) { return Unsafe.Subtract<T>(source, elementOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static ref T Subtract<T>(ref T source, nint elementOffset) { return ref Unsafe.Subtract(ref source, elementOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [NonVersionable] public static ref T Subtract<T>(ref T source, nuint elementOffset) { return ref Unsafe.Subtract(ref source, elementOffset); } } } namespace System { public static class ArrayEx { public static int MaxLength => 1879048191; [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T[] Empty<T>() { return Array.Empty<T>(); } } public static class EnvironmentEx { public static int CurrentManagedThreadId => Environment.CurrentManagedThreadId; } public sealed class Gen2GcCallback : CriticalFinalizerObject { private readonly Func<bool>? _callback0; private readonly Func<object, bool>? _callback1; private GCHandle _weakTargetObj; private Gen2GcCallback(Func<bool> callback) { _callback0 = callback; } private Gen2GcCallback(Func<object, bool> callback, object targetObj) { _callback1 = callback; _weakTargetObj = GCHandle.Alloc(targetObj, GCHandleType.Weak); } public static void Register(Func<bool> callback) { new Gen2GcCallback(callback); } public static void Register(Func<object, bool> callback, object targetObj) { new Gen2GcCallback(callback, targetObj); } ~Gen2GcCallback() { if (_weakTargetObj.IsAllocated) { object target = _weakTargetObj.Target; if (target == null) { _weakTargetObj.Free(); return; } try { if (!_callback1(target)) { _weakTargetObj.Free(); return; } } catch { } } else { try { if (!_callback0()) { return; } } catch { } } GC.ReRegisterForFinalize(this); } } public static class MathEx { [MethodImpl(MethodImplOptions.AggressiveInlining)] public static byte Clamp(byte value, byte min, byte max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static decimal Clamp(decimal value, decimal min, decimal max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static double Clamp(double value, double min, double max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static short Clamp(short value, short min, short max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int Clamp(int value, int min, int max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static long Clamp(long value, long min, long max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static nint Clamp(nint value, nint min, nint max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static sbyte Clamp(sbyte value, sbyte min, sbyte max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static float Clamp(float value, float min, float max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static ushort Clamp(ushort value, ushort min, ushort max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static uint Clamp(uint value, uint min, uint max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static ulong Clamp(ulong value, ulong min, ulong max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static nuint Clamp(nuint value, nuint min, nuint max) { if (min > max) { ThrowMinMaxException(min, max); } if (value < min) { return min; } if (value > max) { return max; } return value; } [DoesNotReturn] private static void ThrowMinMaxException<T>(T min, T max) { throw new ArgumentException($"Minimum {min} is less than maximum {max}"); } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class NonVersionableAttribute : Attribute { } public static class StringComparerEx { [MethodImpl(MethodImplOptions.AggressiveInlining)] public static StringComparer FromComparison(StringComparison comparisonType) { return StringComparer.FromComparison(comparisonType); } } public static class StringExtensions { [MethodImpl(MethodImplOptions.AggressiveInlining)] public static string Replace(this string self, string oldValue, string newValue, StringComparison comparison) { System.ThrowHelper.ThrowIfArgumentNull(self, System.ExceptionArgument.self); System.ThrowHelper.ThrowIfArgumentNull(oldValue, System.ExceptionArgument.oldValue); System.ThrowHelper.ThrowIfArgumentNull(newValue, System.ExceptionArgument.newValue); return self.Replace(oldValue, newValue, comparison); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool Contains(this string self, string value, StringComparison comparison) { System.ThrowHelper.ThrowIfArgumentNull(self, System.ExceptionArgument.self); System.ThrowHelper.ThrowIfArgumentNull(value, System.ExceptionArgument.value); return self.Contains(value, comparison); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool Contains(this string self, char value, StringComparison comparison) { System.ThrowHelper.ThrowIfArgumentNull(self, System.ExceptionArgument.self); return self.Contains(value, comparison); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int GetHashCode(this string self, StringComparison comparison) { System.ThrowHelper.ThrowIfArgumentNull(self, System.ExceptionArgument.self); return self.GetHashCode(comparison); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int IndexOf(this string self, char value, StringComparison comparison) { System.ThrowHelper.ThrowIfArgumentNull(self, System.ExceptionArgument.self); return self.IndexOf(value, comparison); } } internal static class ThrowHelper { [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static void ThrowIfArgumentNull([NotNull] object? obj, System.ExceptionArgument argument) { if (obj == null) { ThrowArgumentNullException(argument); } } [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static void ThrowIfArgumentNull([NotNull] object? obj, string argument, string? message = null) { if (obj == null) { ThrowArgumentNullException(argument, message); } } [DoesNotReturn] internal static void ThrowArgumentNullException(System.ExceptionArgument argument) { throw CreateArgumentNullException(argument); } [DoesNotReturn] internal static void ThrowArgumentNullException(string argument, string? message = null) { throw CreateArgumentNullException(argument, message); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateArgumentNullException(System.ExceptionArgument argument) { return CreateArgumentNullException(argument.ToString()); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateArgumentNullException(string argument, string? message = null) { return new ArgumentNullException(argument, message); } [DoesNotReturn] internal static void ThrowArrayTypeMismatchException() { throw CreateArrayTypeMismatchException(); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateArrayTypeMismatchException() { return new ArrayTypeMismatchException(); } [DoesNotReturn] internal static void ThrowArgumentException_InvalidTypeWithPointersNotSupported(Type type) { throw CreateArgumentException_InvalidTypeWithPointersNotSupported(type); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateArgumentException_InvalidTypeWithPointersNotSupported(Type type) { return new ArgumentException($"Type {type} with managed pointers cannot be used in a Span"); } [DoesNotReturn] internal static void ThrowArgumentException_DestinationTooShort() { throw CreateArgumentException_DestinationTooShort(); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateArgumentException_DestinationTooShort() { return new ArgumentException("Destination too short"); } [DoesNotReturn] internal static void ThrowArgumentException(string message, string? argument = null) { throw CreateArgumentException(message, argument); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateArgumentException(string message, string? argument) { return new ArgumentException(message, argument ?? ""); } [DoesNotReturn] internal static void ThrowIndexOutOfRangeException() { throw CreateIndexOutOfRangeException(); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateIndexOutOfRangeException() { return new IndexOutOfRangeException(); } [DoesNotReturn] internal static void ThrowArgumentOutOfRangeException() { throw CreateArgumentOutOfRangeException(); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateArgumentOutOfRangeException() { return new ArgumentOutOfRangeException(); } [DoesNotReturn] internal static void ThrowArgumentOutOfRangeException(System.ExceptionArgument argument) { throw CreateArgumentOutOfRangeException(argument); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateArgumentOutOfRangeException(System.ExceptionArgument argument) { return new ArgumentOutOfRangeException(argument.ToString()); } [DoesNotReturn] internal static void ThrowArgumentOutOfRangeException_PrecisionTooLarge() { throw CreateArgumentOutOfRangeException_PrecisionTooLarge(); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateArgumentOutOfRangeException_PrecisionTooLarge() { return new ArgumentOutOfRangeException("precision", $"Precision too large (max: {99})"); } [DoesNotReturn] internal static void ThrowArgumentOutOfRangeException_SymbolDoesNotFit() { throw CreateArgumentOutOfRangeException_SymbolDoesNotFit(); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateArgumentOutOfRangeException_SymbolDoesNotFit() { return new ArgumentOutOfRangeException("symbol", "Bad format specifier"); } [DoesNotReturn] internal static void ThrowInvalidOperationException() { throw CreateInvalidOperationException(); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateInvalidOperationException() { return new InvalidOperationException(); } [DoesNotReturn] internal static void ThrowInvalidOperationException_OutstandingReferences() { throw CreateInvalidOperationException_OutstandingReferences(); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateInvalidOperationException_OutstandingReferences() { return new InvalidOperationException("Outstanding references"); } [DoesNotReturn] internal static void ThrowInvalidOperationException_UnexpectedSegmentType() { throw CreateInvalidOperationException_UnexpectedSegmentType(); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateInvalidOperationException_UnexpectedSegmentType() { return new InvalidOperationException("Unexpected segment type"); } [DoesNotReturn] internal static void ThrowInvalidOperationException_EndPositionNotReached() { throw CreateInvalidOperationException_EndPositionNotReached(); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateInvalidOperationException_EndPositionNotReached() { return new InvalidOperationException("End position not reached"); } [DoesNotReturn] internal static void ThrowArgumentOutOfRangeException_PositionOutOfRange() { throw CreateArgumentOutOfRangeException_PositionOutOfRange(); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateArgumentOutOfRangeException_PositionOutOfRange() { return new ArgumentOutOfRangeException("position"); } [DoesNotReturn] internal static void ThrowArgumentOutOfRangeException_OffsetOutOfRange() { throw CreateArgumentOutOfRangeException_OffsetOutOfRange(); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateArgumentOutOfRangeException_OffsetOutOfRange() { return new ArgumentOutOfRangeException("offset"); } [DoesNotReturn] internal static void ThrowObjectDisposedException_ArrayMemoryPoolBuffer() { throw CreateObjectDisposedException_ArrayMemoryPoolBuffer(); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateObjectDisposedException_ArrayMemoryPoolBuffer() { return new ObjectDisposedException("ArrayMemoryPoolBuffer"); } [DoesNotReturn] internal static void ThrowFormatException_BadFormatSpecifier() { throw CreateFormatException_BadFormatSpecifier(); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateFormatException_BadFormatSpecifier() { return new FormatException("Bad format specifier"); } [DoesNotReturn] internal static void ThrowArgumentException_OverlapAlignmentMismatch() { throw CreateArgumentException_OverlapAlignmentMismatch(); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateArgumentException_OverlapAlignmentMismatch() { return new ArgumentException("Overlap alignment mismatch"); } [DoesNotReturn] internal static void ThrowNotSupportedException(string? msg = null) { throw CreateThrowNotSupportedException(msg); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateThrowNotSupportedException(string? msg) { return new NotSupportedException(); } [DoesNotReturn] internal static void ThrowKeyNullException() { ThrowArgumentNullException(System.ExceptionArgument.key); } [DoesNotReturn] internal static void ThrowValueNullException() { throw CreateThrowValueNullException(); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateThrowValueNullException() { return new ArgumentException("Value is null"); } [DoesNotReturn] internal static void ThrowOutOfMemoryException() { throw CreateOutOfMemoryException(); } [MethodImpl(MethodImplOptions.NoInlining)] private static Exception CreateOutOfMemoryException() { return new OutOfMemoryException(); } public static bool TryFormatThrowFormatException(out int bytesWritten) { bytesWritten = 0; ThrowFormatException_BadFormatSpecifier(); return false; } public static bool TryParseThrowFormatException<T>(out T value, out int bytesConsumed) { value = default(T); bytesConsumed = 0; ThrowFormatException_BadFormatSpecifier(); return false; } [DoesNotReturn] public static void ThrowArgumentValidationException<T>(ReadOnlySequenceSegment<T>? startSegment, int startIndex, ReadOnlySequenceSegment<T>? endSegment) { throw CreateArgumentValidationException(startSegment, startIndex, endSegment); } private static Exception CreateArgumentValidationException<T>(ReadOnlySequenceSegment<T>? startSegment, int startIndex, ReadOnlySequenceSegment<T>? endSegment) { if (startSegment == null) { return CreateArgumentNullException(System.ExceptionArgument.startSegment); } if (endSegment == null) { return CreateArgumentNullException(System.ExceptionArgument.endSegment); } if (startSegment != endSegment && startSegment.RunningIndex > endSegment.RunningIndex) { return CreateArgumentOutOfRangeException(System.ExceptionArgument.endSegment); } if ((uint)startSegment.Memory.Length < (uint)startIndex) { return CreateArgumentOutOfRangeException(System.ExceptionArgument.startIndex); } return CreateArgumentOutOfRangeException(System.ExceptionArgument.endIndex); } [DoesNotReturn] public static void ThrowArgumentValidationException(Array? array, int start) { throw CreateArgumentValidationException(array, start); } private static Exception CreateArgumentValidationException(Array? array, int start) { if (array == null) { return CreateArgumentNullException(System.ExceptionArgument.array); } if ((uint)start > (uint)array.Length) { return CreateArgumentOutOfRangeException(System.ExceptionArgument.start); } return CreateArgumentOutOfRangeException(System.ExceptionArgument.length); } [DoesNotReturn] internal static void ThrowArgumentException_TupleIncorrectType(object other) { throw new ArgumentException($"Value tuple of incorrect type (found {other.GetType()})", "other"); } [DoesNotReturn] public static void ThrowStartOrEndArgumentValidationException(long start) { throw CreateStartOrEndArgumentValidationException(start); } private static Exception CreateStartOrEndArgumentValidationException(long start) { if (start < 0) { return CreateArgumentOutOfRangeException(System.ExceptionArgument.start); } return CreateArgumentOutOfRangeException(System.ExceptionArgument.length); } } internal enum ExceptionArgument { length, start, bufferSize, minimumBufferSize, elementIndex, comparable, comparer, destination, offset, startSegment, endSegment, startIndex, endIndex, array, culture, manager, key, collection, index, type, self, value, oldValue, newValue } public static class TypeExtensions { public static bool IsByRefLike(this Type type) { System.ThrowHelper.ThrowIfArgumentNull(type, System.ExceptionArgument.type); if ((object)type == null) { System.ThrowHelper.ThrowArgumentNullException(System.ExceptionArgument.type); } return type.IsByRefLike; } } } namespace System.Threading { public static class MonitorEx { [MethodImpl(MethodImplOptions.AggressiveInlining)] public static void Enter(object obj, ref bool lockTaken) { Monitor.Enter(obj, ref lockTaken); } } } namespace System.Text { public static class StringBuilderExtensions { [MethodImpl(MethodImplOptions.AggressiveInlining)] public static StringBuilder Clear(this StringBuilder builder) { System.ThrowHelper.ThrowIfArgumentNull(builder, "builder"); return builder.Clear(); } } } namespace System.Numerics { public static class BitOperations { private static ReadOnlySpan<byte> TrailingZeroCountDeBruijn => new byte[32] { 0, 1, 28, 2, 29, 14, 24, 3, 30, 22, 20, 15, 25, 17, 4, 8, 31, 27, 13, 23, 21, 19, 16, 7, 26, 12, 18, 6, 11, 5, 10, 9 }; private static ReadOnlySpan<byte> Log2DeBruijn => new byte[32] { 0, 9, 1, 10, 13, 21, 2, 29, 11, 14, 16, 18, 22, 25, 3, 30, 8, 12, 20, 28, 15, 17, 24, 7, 19, 27, 23, 6, 26, 5, 4, 31 }; [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static int LeadingZeroCount(uint value) { if (value == 0) { return 32; } return 0x1F ^ Log2SoftwareFallback(value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static int LeadingZeroCount(ulong value) { uint num = (uint)(value >> 32); if (num == 0) { return 32 + LeadingZeroCount((uint)value); } return LeadingZeroCount(num); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static int Log2(uint value) { value |= 1u; return Log2SoftwareFallback(value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static int Log2(ulong value) { value |= 1; uint num = (uint)(value >> 32); if (num == 0) { return Log2((uint)value); } return 32 + Log2(num); } private static int Log2SoftwareFallback(uint value) { value |= value >> 1; value |= value >> 2; value |= value >> 4; value |= value >> 8; value |= value >> 16; return Unsafe.AddByteOffset(ref MemoryMarshal.GetReference(Log2DeBruijn), (IntPtr)(int)(value * 130329821 >> 27)); } [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static int Log2Ceiling(uint value) { int num = Log2(value); if (PopCount(value) != 1) { num++; } return num; } [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static int Log2Ceiling(ulong value) { int num = Log2(value); if (PopCount(value) != 1) { num++; } return num; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static int PopCount(uint value) { return SoftwareFallback(value); static int SoftwareFallback(uint value) { value -= (value >> 1) & 0x55555555; value = (value & 0x33333333) + ((value >> 2) & 0x33333333); value = ((value + (value >> 4)) & 0xF0F0F0F) * 16843009 >> 24; return (int)value; } } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static int PopCount(ulong value) { if (IntPtr.Size == 8) { return PopCount((uint)value) + PopCount((uint)(value >> 32)); } return SoftwareFallback(value); static int SoftwareFallback(ulong value) { value -= (value >> 1) & 0x5555555555555555L; value = (value & 0x3333333333333333L) + ((value >> 2) & 0x3333333333333333L); value = ((value + (value >> 4)) & 0xF0F0F0F0F0F0F0FL) * 72340172838076673L >> 56; return (int)value; } } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int TrailingZeroCount(int value) { return TrailingZeroCount((uint)value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static int TrailingZeroCount(uint value) { if (value == 0) { return 32; } return Unsafe.AddByteOffset(ref MemoryMarshal.GetReference(TrailingZeroCountDeBruijn), (IntPtr)(int)((value & (0 - value)) * 125613361 >> 27)); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int TrailingZeroCount(long value) { return TrailingZeroCount((ulong)value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static int TrailingZeroCount(ulong value) { uint num = (uint)value; if (num == 0) { return 32 + TrailingZeroCount((uint)(value >> 32)); } return TrailingZeroCount(num); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static uint RotateLeft(uint value, int offset) { return (value << offset) | (value >> 32 - offset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static ulong RotateLeft(ulong value, int offset) { return (value << offset) | (value >> 64 - offset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static uint RotateRight(uint value, int offset) { return (value >> offset) | (value << 32 - offset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static ulong RotateRight(ulong value, int offset) { return (value >> offset) | (value << 64 - offset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static uint ResetLowestSetBit(uint value) { return value & (value - 1); } [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static uint ResetBit(uint value, int bitPos) { return value & (uint)(~(1 << bitPos)); } } public static class BitOperationsEx { [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsPow2(int value) { if ((value & (value - 1)) == 0) { return value > 0; } return false; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static bool IsPow2(uint value) { if ((value & (value - 1)) == 0) { return value != 0; } return false; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsPow2(long value) { if ((value & (value - 1)) == 0L) { return value > 0; } return false; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static bool IsPow2(ulong value) { if ((value & (value - 1)) == 0L) { return value != 0; } return false; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static bool IsPow2(nint value) { if ((value & (value - 1)) == 0) { return value > 0; } return false; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static bool IsPow2(nuint value) { if ((value & (value - 1)) == 0) { return value != 0; } return false; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static uint RoundUpToPowerOf2(uint value) { value--; value |= value >> 1; value |= value >> 2; value |= value >> 4; value |= value >> 8; value |= value >> 16; return value + 1; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static ulong RoundUpToPowerOf2(ulong value) { value--; value |= value >> 1; value |= value >> 2; value |= value >> 4; value |= value >> 8; value |= value >> 16; value |= value >> 32; return value + 1; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static nuint RoundUpToPowerOf2(nuint value) { if (IntPtr.Size == 8) { return (nuint)RoundUpToPowerOf2((ulong)value); } return RoundUpToPowerOf2((uint)value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static int LeadingZeroCount(uint value) { return BitOperations.LeadingZeroCount(value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static int LeadingZeroCount(ulong value) { return BitOperations.LeadingZeroCount(value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static int LeadingZeroCount(nuint value) { if (IntPtr.Size == 8) { return LeadingZeroCount((ulong)value); } return LeadingZeroCount((uint)value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static int Log2(uint value) { return BitOperations.Log2(value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static int Log2(ulong value) { return BitOperations.Log2(value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static int Log2(nuint value) { if (IntPtr.Size == 8) { return Log2((ulong)value); } return Log2((uint)value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static int PopCount(uint value) { return BitOperations.PopCount(value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static int PopCount(ulong value) { return BitOperations.PopCount(value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static int PopCount(nuint value) { if (IntPtr.Size == 8) { return PopCount((ulong)value); } return PopCount((uint)value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int TrailingZeroCount(int value) { return BitOperations.TrailingZeroCount(value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static int TrailingZeroCount(uint value) { return BitOperations.TrailingZeroCount(value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int TrailingZeroCount(long value) { return BitOperations.TrailingZeroCount(value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static int TrailingZeroCount(ulong value) { return BitOperations.TrailingZeroCount(value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int TrailingZeroCount(nint value) { if (IntPtr.Size == 8) { return TrailingZeroCount((long)value); } return TrailingZeroCount((int)value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static int TrailingZeroCount(nuint value) { if (IntPtr.Size == 8) { return TrailingZeroCount((ulong)value); } return TrailingZeroCount((uint)value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static uint RotateLeft(uint value, int offset) { return BitOperations.RotateLeft(value, offset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static ulong RotateLeft(ulong value, int offset) { return BitOperations.RotateLeft(value, offset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static nuint RotateLeft(nuint value, int offset) { if (IntPtr.Size == 8) { return (nuint)RotateLeft((ulong)value, offset); } return RotateLeft((uint)value, offset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static uint RotateRight(uint value, int offset) { return BitOperations.RotateRight(value, offset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static ulong RotateRight(ulong value, int offset) { return BitOperations.RotateRight(value, offset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [CLSCompliant(false)] public static nuint RotateRight(nuint value, int offset) { if (IntPtr.Size == 8) { return (nuint)RotateRight((ulong)value, offset); } return RotateRight((uint)value, offset); } } } namespace System.IO { public static class StreamExtensions { public static void CopyTo(this Stream src, Stream destination) { System.ThrowHelper.ThrowIfArgumentNull(src, "src"); src.CopyTo(destination); } public static void CopyTo(this Stream src, Stream destination, int bufferSize) { System.ThrowHelper.ThrowIfArgumentNull(src, "src"); src.CopyTo(destination, bufferSize); } } } namespace System.Collections { internal static class HashHelpers { public const uint HashCollisionThreshold = 100u; public const int MaxPrimeArrayLength = 2147483587; public const int HashPrime = 101; private static readonly int[] s_primes = new int[72] { 3, 7, 11, 17, 23, 29, 37, 47, 59, 71, 89, 107, 131, 163, 197, 239, 293, 353, 431, 521, 631, 761, 919, 1103, 1327, 1597, 1931, 2333, 2801, 3371, 4049, 4861, 5839, 7013, 8419, 10103, 12143, 14591, 17519, 21023, 25229, 30293, 36353, 43627, 52361, 62851, 75431, 90523, 108631, 130363, 156437, 187751, 225307, 270371, 324449, 389357, 467237, 560689, 672827, 807403, 968897, 1162687, 1395263, 1674319, 2009191, 2411033, 2893249, 3471899, 4166287, 4999559, 5999471, 7199369 }; public static bool IsPrime(int candidate) { if (((uint)candidate & (true ? 1u : 0u)) != 0) { int num = (int)Math.Sqrt(candidate); for (int i = 3; i <= num; i += 2) { if (candidate % i == 0) { return false; } } return true; } return candidate == 2; } public static int GetPrime(int min) { if (min < 0) { throw new ArgumentException("Prime minimum cannot be less than zero"); } int[] array = s_primes; foreach (int num in array) { if (num >= min) { return num; } } for (int j = min | 1; j < int.MaxValue; j += 2) { if (IsPrime(j) && (j - 1) % 101 != 0) { return j; } } return min; } public static int ExpandPrime(int oldSize) { int num = 2 * oldSize; if ((uint)num > 2147483587u && 2147483587 > oldSize) { return 2147483587; } return GetPrime(num); } public static ulong GetFastModMultiplier(uint divisor) { return ulong.MaxValue / (ulong)divisor + 1; } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static uint FastMod(uint value, uint divisor, ulong multiplier) { return (uint)(((multiplier * value >> 32) + 1) * divisor >> 32); } } } namespace System.Collections.Concurrent { public static class ConcurrentExtensions { public static void Clear<T>(this ConcurrentBag<T> bag) { System.ThrowHelper.ThrowIfArgumentNull(bag, "bag"); bag.Clear(); } public static void Clear<T>(this ConcurrentQueue<T> queue) { System.ThrowHelper.ThrowIfArgumentNull(queue, "queue"); queue.Clear(); } public static TValue AddOrUpdate<TKey, TValue, TArg>(this ConcurrentDictionary<TKey, TValue> dict, TKey key, Func<TKey, TArg, TValue> addValueFactory, Func<TKey, TValue, TArg, TValue> updateValueFactory, TArg factoryArgument) where TKey : notnull { System.ThrowHelper.ThrowIfArgumentNull(dict, "dict"); return dict.AddOrUpdate(key, addValueFactory, updateValueFactory, factoryArgument); } public static TValue GetOrAdd<TKey, TValue, TArg>(this ConcurrentDictionary<TKey, TValue> dict, TKey key, Func<TKey, TArg, TValue> valueFactory, TArg factoryArgument) where TKey : notnull { System.ThrowHelper.ThrowIfArgumentNull(dict, "dict"); return dict.GetOrAdd(key, valueFactory, factoryArgument); } public static bool TryRemove<TKey, TValue>(this ConcurrentDictionary<TKey, TValue> dict, KeyValuePair<TKey, TValue> item) where TKey : notnull { System.ThrowHelper.ThrowIfArgumentNull(dict, "dict"); if (dict.TryRemove(item.Key, out TValue value)) { if (EqualityComparer<TValue>.Default.Equals(item.Value, value)) { return true; } dict.AddOrUpdate(item.Key, (TKey _) => value, (TKey _, TValue _) => value); return false; } return false; } } } namespace System.Runtime { public struct DependentHandle : IDisposable { private sealed class DependentHolder : CriticalFinalizerObject { public GCHandle TargetHandle; private IntPtr dependent; public object? Dependent { get { return GCHandle.FromIntPtr(dependent).Target; } set { IntPtr value2 = GCHandle.ToIntPtr(GCHandle.Alloc(value, GCHandleType.Normal)); IntPtr intPtr; do { intPtr = dependent; } while (Interlocked.CompareExchange(ref dependent, value2, intPtr) == intPtr); GCHandle.FromIntPtr(intPtr).Free(); } } public DependentHolder(GCHandle targetHandle, object dependent) { TargetHandle = targetHandle; this.dependent = GCHandle.ToIntPtr(GCHandle.Alloc(dependent, GCHandleType.Normal)); } ~DependentHolder() { if (!AppDomain.CurrentDomain.IsFinalizingForUnload() && (!Environment.HasShutdownStarted && (TargetHandle.IsAllocated && TargetHandle.Target != null))) { GC.ReRegisterForFinalize(this); } else { GCHandle.FromIntPtr(dependent).Free(); } } } private GCHandle dependentHandle; private volatile bool allocated; public bool IsAllocated => allocated; public object? Target { get { if (!allocated) { throw new InvalidOperationException(); } return UnsafeGetTarget(); } set { if (!allocated || value != null) { throw new InvalidOperationException(); } UnsafeSetTargetToNull(); } } public object? Dependent { get { if (!allocated) { throw new InvalidOperationException(); } return UnsafeGetHolder()?.Dependent; } set { if (!allocated) { throw new InvalidOperationException(); } UnsafeSetDependent(value); } } public (object? Target, object? Dependent) TargetAndDependent { get { if (!allocated) { throw new InvalidOperationException(); } return (UnsafeGetTarget(), Dependent); } } public DependentHandle(object? target, object? dependent) { GCHandle targetHandle = GCHandle.Alloc(target, GCHandleType.WeakTrackResurrection); dependentHandle = AllocDepHolder(targetHandle, dependent); GC.KeepAlive(target); allocated = true; } private static GCHandle AllocDepHolder(GCHandle targetHandle, object? dependent) { return GCHandle.Alloc((dependent != null) ? new DependentHolder(targetHandle, dependent) : null, GCHandleType.WeakTrackResurrection); } private DependentHolder? UnsafeGetHolder() { return Unsafe.As<DependentHolder>(dependentHandle.Target); } internal object? UnsafeGetTarget() { return UnsafeGetHolder()?.TargetHandle.Target; } internal object? UnsafeGetTargetAndDependent(out object? dependent) { dependent = null; DependentHolder dependentHolder = UnsafeGetHolder(); if (dependentHolder == null) { return null; } object target = dependentHolder.TargetHandle.Target; if (target == null) { return null; } dependent = dependentHolder.Dependent; return target; } internal void UnsafeSetTargetToNull() { Free(); } internal void UnsafeSetDependent(object? value) { DependentHolder dependentHolder = UnsafeGetHolder(); if (dependentHolder != null) { if (!dependentHolder.TargetHandle.IsAllocated) { Free(); } else { dependentHolder.Dependent = value; } } } private void FreeDependentHandle() { if (allocated) { UnsafeGetHolder()?.TargetHandle.Free(); dependentHandle.Free(); } allocated = false; } private void Free() { FreeDependentHandle(); } public void Dispose() { Free(); allocated = false; } } } namespace System.Runtime.InteropServices { public static class MarshalEx { private static readonly MethodInfo? Marshal_SetLastWin32Error_Meth = typeof(Marshal).GetMethod("SetLastPInvokeError", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic) ?? typeof(Marshal).GetMethod("SetLastWin32Error", BindingFlags.Static | BindingFlags.Public | BindingFlags.NonPublic); private static readonly Action<int>? Marshal_SetLastWin32Error = (((object)Marshal_SetLastWin32Error_Meth == null) ? null : ((Action<int>)Delegate.CreateDelegate(typeof(Action<int>), Marshal_SetLastWin32Error_Meth))); [MethodImpl(MethodImplOptions.AggressiveInlining)] public static int GetLastPInvokeError() { return Marshal.GetLastWin32Error(); } public static void SetLastPInvokeError(int error) { (Marshal_SetLastWin32Error ?? throw new PlatformNotSupportedException("Cannot set last P/Invoke error (no method Marshal.SetLastWin32Error or Marshal.SetLastPInvokeError)"))(error); } } } namespace System.Runtime.CompilerServices { [ExcludeFromCodeCoverage] [DebuggerNonUserCode] internal static class IsExternalInit { } [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] public sealed class CallerArgumentExpressionAttribute : Attribute { public string ParameterName { get; } public CallerArgumentExpressionAttribute(string parameterName) { ParameterName = parameterName; } } internal interface ICWTEnumerable<T> { IEnumerable<T> SelfEnumerable { get; } IEnumerator<T> GetEnumerator(); } internal sealed class CWTEnumerable<TKey, TValue> : IEnumerable<KeyValuePair<TKey, TValue>>, IEnumerable where TKey : class where TValue : class? { private readonly ConditionalWeakTable<TKey, TValue> cwt; public CWTEnumerable(ConditionalWeakTable<TKey, TValue> table) { cwt = table; } public IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator() { return cwt.GetEnumerator(); } IEnumerator IEnumerable.GetEnumerator() { return GetEnumerator(); } } public static class ConditionalWeakTableExtensions { public static IEnumerable<KeyValuePair<TKey, TValue>> AsEnumerable<TKey, TValue>(this ConditionalWeakTable<TKey, TValue> self) where TKey : class where TValue : class? { System.ThrowHelper.ThrowIfArgumentNull(self, "self"); if (self != null) { return self; } if (self is ICWTEnumerable<KeyValuePair<TKey, TValue>> iCWTEnumerable) { return iCWTEnumerable.SelfEnumerable; } return new CWTEnumerable<TKey, TValue>(self); } public static IEnumerator<KeyValuePair<TKey, TValue>> GetEnumerator<TKey, TValue>(this ConditionalWeakTable<TKey, TValue> self) where TKey : class where TValue : class? { System.ThrowHelper.ThrowIfArgumentNull(self, "self"); if (self != null) { return ((IEnumerable<KeyValuePair<TKey, TValue>>)self).GetEnumerator(); } if (self is ICWTEnumerable<KeyValuePair<TKey, TValue>> iCWTEnumerable) { return iCWTEnumerable.GetEnumerator(); } throw new PlatformNotSupportedException("This version of MonoMod.Backports was built targeting a version of the framework where ConditionalWeakTable is enumerable, but it isn't!"); } public static void Clear<TKey, TValue>(this ConditionalWeakTable<TKey, TValue> self) where TKey : class where TValue : class? { System.ThrowHelper.ThrowIfArgumentNull(self, "self"); self.Clear(); } public static bool TryAdd<TKey, TValue>(this ConditionalWeakTable<TKey, TValue> self, TKey key, TValue value) where TKey : class where TValue : class? { TValue value2 = value; System.ThrowHelper.ThrowIfArgumentNull(self, "self"); bool didAdd = false; self.GetValue(key, delegate { didAdd = true; return value2; }); return didAdd; } } [InterpolatedStringHandler] public ref struct DefaultInterpolatedStringHandler { private const int GuessedLengthPerHole = 11; private const int MinimumArrayPoolLength = 256; private readonly IFormatProvider? _provider; private char[]? _arrayToReturnToPool; private Span<char> _chars; private int _pos; private readonly bool _hasCustomFormatter; internal ReadOnlySpan<char> Text => _chars.Slice(0, _pos); public DefaultInterpolatedStringHandler(int literalLength, int formattedCount) { _provider = null; _chars = (_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(GetDefaultLength(literalLength, formattedCount))); _pos = 0; _hasCustomFormatter = false; } public DefaultInterpolatedStringHandler(int literalLength, int formattedCount, IFormatProvider? provider) { _provider = provider; _chars = (_arrayToReturnToPool = ArrayPool<char>.Shared.Rent(GetDefaultLength(literalLength, formattedCount))); _pos = 0; _hasCustomFormatter = provider != null && HasCustomFormatter(provider); } public DefaultInterpolatedStringHandler(int literalLength, int formattedCount, IFormatProvider? provider, Span<char> initialBuffer) { _provider = provider; _chars = initialBuffer; _arrayToReturnToPool = null; _pos = 0; _hasCustomFormatter = provider != null && HasCustomFormatter(provider); } [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static int GetDefaultLength(int literalLength, int formattedCount) { return Math.Max(256, literalLength + formattedCount * 11); } public override string ToString() { return Text.ToString(); } public string ToStringAndClear() { string result = Text.ToString(); Clear(); return result; } [MethodImpl(MethodImplOptions.AggressiveInlining)] internal void Clear() { char[] arrayToReturnToPool = _arrayToReturnToPool; this = default(DefaultInterpolatedStringHandler); if (arrayToReturnToPool != null) { ArrayPool<char>.Shared.Return(arrayToReturnToPool); } } [MethodImpl(MethodImplOptions.AggressiveInlining)] public void AppendLiteral(string value) { if (value.Length == 1) { Span<char> chars = _chars; int pos = _pos; if ((uint)pos < (uint)chars.Length) { chars[pos] = value[0]; _pos = pos + 1; } else { GrowThenCopyString(value); } } else if (value.Length == 2) { Span<char> chars2 = _chars; int pos2 = _pos; if ((uint)pos2 < chars2.Length - 1) { value.AsSpan().CopyTo(chars2.Slice(pos2)); _pos = pos2 + 2; } else { GrowThenCopyString(value); } } else { AppendStringDirect(value); } } private void AppendStringDirect(string value) { if (value.AsSpan().TryCopyTo(_chars.Slice(_pos))) { _pos += value.Length; } else { GrowThenCopyString(value); } } public void AppendFormatted<T>(T value) { if (_hasCustomFormatter) { AppendCustomFormatter(value, null); return; } if (typeof(T) == typeof(IntPtr)) { AppendFormatted(Unsafe.As<T, IntPtr>(ref value)); return; } if (typeof(T) == typeof(UIntPtr)) { AppendFormatted(Unsafe.As<T, UIntPtr>(ref value)); return; } string text = ((!(value is IFormattable)) ? value?.ToString() : ((IFormattable)(object)value).ToString(null, _provider)); if (text != null) { AppendStringDirect(text); } } public void AppendFormatted<T>(T value, string? format) { if (_hasCustomFormatter) { AppendCustomFormatter(value, format); return; } if (typeof(T) == typeof(IntPtr)) { AppendFormatted(Unsafe.As<T, IntPtr>(ref value), format); return; } if (typeof(T) == typeof(UIntPtr)) { AppendFormatted(Unsafe.As<T, UIntPtr>(ref value), format); return; } string text = ((!(value is IFormattable)) ? value?.ToString() : ((IFormattable)(object)value).ToString(format, _provider)); if (text != null) { AppendStringDirect(text); } } public void AppendFormatted<T>(T value, int alignment) { int pos = _pos; AppendFormatted(value); if (alignment != 0) { AppendOrInsertAlignmentIfNeeded(pos, alignment); } } public void AppendFormatted<T>(T value, int alignment, string? format) { int pos = _pos; AppendFormatted(value, format); if (alignment != 0) { AppendOrInsertAlignmentIfNeeded(pos, alignment); } } [MethodImpl(MethodImplOptions.AggressiveInlining)] private void AppendFormatted(IntPtr value) { if (IntPtr.Size == 4) { AppendFormatted((int)value); } else { AppendFormatted((long)value); } } [MethodImpl(MethodImplOptions.AggressiveInlining)] private void AppendFormatted(IntPtr value, string? format) { if (IntPtr.Size == 4) { AppendFormatted((int)value, format); } else { AppendFormatted((long)value, format); } } [MethodImpl(MethodImplOptions.AggressiveInlining)] private void AppendFormatted(UIntPtr value) { if (UIntPtr.Size == 4) { AppendFormatted((uint)value); } else { AppendFormatted((ulong)value); } } [MethodImpl(MethodImplOptions.AggressiveInlining)] private void AppendFormatted(UIntPtr value, string? format) { if (UIntPtr.Size == 4) { AppendFormatted((uint)value, format); } else { AppendFormatted((ulong)value, format); } } public void AppendFormatted(ReadOnlySpan<char> value) { if (value.TryCopyTo(_chars.Slice(_pos))) { _pos += value.Length; } else { GrowThenCopySpan(value); } } public void AppendFormatted(ReadOnlySpan<char> value, int alignment = 0, string? format = null) { bool flag = false; if (alignment < 0) { flag = true; alignment = -alignment; } int num = alignment - value.Length; if (num <= 0) { AppendFormatted(value); return; } EnsureCapacityForAdditionalChars(value.Length + num); if (flag) { value.CopyTo(_chars.Slice(_pos)); _pos += value.Length; _chars.Slice(_pos, num).Fill(' '); _pos += num; } else { _chars.Slice(_pos, num).Fill(' '); _pos += num; value.CopyTo(_chars.Slice(_pos)); _pos += value.Length; } } public void AppendFormatted(string? value) { if (!_hasCustomFormatter && value != null && value.AsSpan().TryCopyTo(_chars.Slice(_pos))) { _pos += value.Length; } else { AppendFormattedSlow(value); } } [MethodImpl(MethodImplOptions.NoInlining)] private void AppendFormattedSlow(string? value) { if (_hasCustomFormatter) { AppendCustomFormatter(value, null); } else if (value != null) { EnsureCapacityForAdditionalChars(value.Length); value.AsSpan().CopyTo(_chars.Slice(_pos)); _pos += value.Length; } } public void AppendFormatted(string? value, int alignment = 0, string? format = null) { this.AppendFormatted<string>(value, alignment, format); } public void AppendFormatted(object? value, int alignment = 0, string? format = null) { this.AppendFormatted<object>(value, alignment, format); } [MethodImpl(MethodImplOptions.AggressiveInlining)] internal static bool HasCustomFormatter(IFormatProvider provider) { if (provider.GetType() != typeof(CultureInfo)) { return provider.GetFormat(typeof(ICustomFormatter)) != null; } return false; } [MethodImpl(MethodImplOptions.NoInlining)] private void AppendCustomFormatter<T>(T value, string? format) { ICustomFormatter customFormatter = (ICustomFormatter)_provider.GetFormat(typeof(ICustomFormatter)); if (customFormatter != null) { string text = customFormatter.Format(format, value, _provider); if (text != null) { AppendStringDirect(text); } } } private void AppendOrInsertAlignmentIfNeeded(int startingPos, int alignment) { int num = _pos - startingPos; bool flag = false; if (alignment < 0) { flag = true; alignment = -alignment; } int num2 = alignment - num; if (num2 > 0) { EnsureCapacityForAdditionalChars(num2); if (flag) { _chars.Slice(_pos, num2).Fill(' '); } else { _chars.Slice(startingPos, num).CopyTo(_chars.Slice(startingPos + num2)); _chars.Slice(startingPos, num2).Fill(' '); } _pos += num2; } } [MethodImpl(MethodImplOptions.AggressiveInlining)] private void EnsureCapacityForAdditionalChars(int additionalChars) { if (_chars.Length - _pos < additionalChars) { Grow(additionalChars); } } [MethodImpl(MethodImplOptions.NoInlining)] private void GrowThenCopyString(string value) { Grow(value.Length); value.AsSpan().CopyTo(_chars.Slice(_pos)); _pos += value.Length; } [MethodImpl(MethodImplOptions.NoInlining)] private void GrowThenCopySpan(ReadOnlySpan<char> value) { Grow(value.Length); value.CopyTo(_chars.Slice(_pos)); _pos += value.Length; } [MethodImpl(MethodImplOptions.NoInlining)] private void Grow(int additionalChars) { GrowCore((uint)(_pos + additionalChars)); } [MethodImpl(MethodImplOptions.NoInlining)] private void Grow() { GrowCore((uint)(_chars.Length + 1)); } [MethodImpl(MethodImplOptions.AggressiveInlining)] private void GrowCore(uint requiredMinCapacity) { int minimumLength = (int)MathEx.Clamp(Math.Max(requiredMinCapacity, Math.Min((uint)(_chars.Length * 2), uint.MaxValue)), 256u, 2147483647u); char[] array = ArrayPool<char>.Shared.Rent(minimumLength); _chars.Slice(0, _pos).CopyTo(array); char[] arrayToReturnToPool = _arrayToReturnToPool; _chars = (_arrayToReturnToPool = array); if (arrayToReturnToPool != null) { ArrayPool<char>.Shared.Return(arrayToReturnToPool); } } } [AttributeUsage(AttributeTargets.Assembly, Inherited = false, AllowMultiple = false)] public sealed class DisableRuntimeMarshallingAttribute : Attribute { } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct, AllowMultiple = false, Inherited = false)] public sealed class InterpolatedStringHandlerAttribute : Attribute { } [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] public sealed class InterpolatedStringHandlerArgumentAttribute : Attribute { public string[] Arguments { get; } public InterpolatedStringHandlerArgumentAttribute(string argument) { Arguments = new string[1] { argument }; } public InterpolatedStringHandlerArgumentAttribute(params string[] arguments) { Arguments = arguments; } } internal interface ITuple { int Length { get; } object? this[int index] { get; } } [AttributeUsage(AttributeTargets.Method, Inherited = false)] public sealed class ModuleInitializerAttribute : Attribute { } } 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; } } public static class ExtraDynamicallyAccessedMemberTypes { public const DynamicallyAccessedMemberTypes Interfaces = (DynamicallyAccessedMemberTypes)8192; } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Interface | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, Inherited = false)] public sealed class DynamicallyAccessedMembersAttribute : Attribute { public DynamicallyAccessedMemberTypes MemberTypes { get; } public DynamicallyAccessedMembersAttribute(DynamicallyAccessedMemberTypes memberTypes) { MemberTypes = memberTypes; } } [Flags] public enum DynamicallyAccessedMemberTypes { None = 0, PublicParameterlessConstructor = 1, PublicConstructors = 3, NonPublicConstructors = 4, PublicMethods = 8, NonPublicMethods = 0x10, PublicFields = 0x20, NonPublicFields = 0x40, PublicNestedTypes = 0x80, NonPublicNestedTypes = 0x100, PublicProperties = 0x200, NonPublicProperties = 0x400, PublicEvents = 0x800, NonPublicEvents = 0x1000, All = -1 } [AttributeUsage(AttributeTargets.Method | AttributeTargets.Property | AttributeTargets.Parameter, AllowMultiple = false, Inherited = false)] public sealed class UnscopedRefAttribute : Attribute { } }
plugins/MonoMod.ILHelpers.dll
Decompiled 2 weeks agousing System; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using Microsoft.CodeAnalysis; using MonoMod.Backports.ILHelpers; [assembly: AssemblyMetadata("IsTrimmable", "True")] [assembly: AssemblyCopyright("Copyright 2024 0x0ade, DaNike")] [assembly: CLSCompliant(false)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyInformationalVersion("1.1.0")] [assembly: AssemblyTitle("MonoMod.ILHelpers")] [assembly: AssemblyCompany("0x0ade, DaNike")] [assembly: AssemblyDescription("Package Description")] [assembly: AssemblyMetadata(".NETFrameworkAssembly", "")] [assembly: AssemblyMetadata("Serviceable", "True")] [assembly: AssemblyVersion("1.1.0.0")] [assembly: TypeForwardedTo(typeof(UnsafeRaw))] namespace System.Runtime.Versioning { [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Constructor | AttributeTargets.Method, AllowMultiple = false, Inherited = false)] internal sealed class NonVersionableAttribute : Attribute { } } namespace System.Runtime.CompilerServices { internal sealed class IsReadOnlyAttribute : Attribute { } } namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [Microsoft.CodeAnalysis.Embedded] [CompilerGenerated] [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] internal sealed class NativeIntegerAttribute : Attribute { public readonly bool[] TransformFlags; public NativeIntegerAttribute() { TransformFlags = new bool[1] { true }; } public NativeIntegerAttribute(bool[] A_0) { TransformFlags = A_0; } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)] [Microsoft.CodeAnalysis.Embedded] [CompilerGenerated] internal sealed class NullableAttribute : Attribute { public readonly byte[] NullableFlags; public NullableAttribute(byte A_0) { NullableFlags = new byte[1] { A_0 }; } public NullableAttribute(byte[] A_0) { NullableFlags = A_0; } } [AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)] [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class NullableContextAttribute : Attribute { public readonly byte Flag; public NullableContextAttribute(byte A_0) { Flag = A_0; } } } namespace MonoMod { public static class ILHelpers { [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe static T TailCallDelegatePtr<T>(IntPtr source) { return ((delegate*<T>)source)(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public static T TailCallFunc<T>(Func<T> func) { return func(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] public unsafe static ref T ObjectAsRef<T>(object obj) { fixed (object obj2 = obj) { T** ptr = (T**)(&obj2); return ref *(*ptr); } } } } namespace System.Runtime.CompilerServices { public static class Unsafe { [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static T Read<T>(void* source) { return Unsafe.Read<T>(source); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static T ReadUnaligned<T>(void* source) { return Unsafe.ReadUnaligned<T>(source); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static T ReadUnaligned<T>(ref byte source) { return Unsafe.ReadUnaligned<T>(ref source); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static void Write<T>(void* destination, T value) { Unsafe.Write(destination, value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static void WriteUnaligned<T>(void* destination, T value) { Unsafe.WriteUnaligned(destination, value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static void WriteUnaligned<T>(ref byte destination, T value) { Unsafe.WriteUnaligned(ref destination, value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static void Copy<T>(void* destination, ref T source) { Unsafe.Write(destination, source); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static void Copy<T>(ref T destination, void* source) { destination = Unsafe.Read<T>(source); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static void* AsPointer<T>(ref T value) { return Unsafe.AsPointer(ref value); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static void SkipInit<T>(out T value) { } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static int SizeOf<T>() { return Unsafe.SizeOf<T>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static void CopyBlock(void* destination, void* source, uint byteCount) { // IL cpblk instruction Unsafe.CopyBlock(destination, source, byteCount); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static void CopyBlock(ref byte destination, ref byte source, uint byteCount) { // IL cpblk instruction Unsafe.CopyBlock(ref destination, ref source, byteCount); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static void CopyBlockUnaligned(void* destination, void* source, uint byteCount) { // IL cpblk instruction Unsafe.CopyBlockUnaligned(destination, source, byteCount); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static void CopyBlockUnaligned(ref byte destination, ref byte source, uint byteCount) { // IL cpblk instruction Unsafe.CopyBlockUnaligned(ref destination, ref source, byteCount); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static void InitBlock(void* startAddress, byte value, uint byteCount) { // IL initblk instruction Unsafe.InitBlock(startAddress, value, byteCount); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static void InitBlock(ref byte startAddress, byte value, uint byteCount) { // IL initblk instruction Unsafe.InitBlock(ref startAddress, value, byteCount); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static void InitBlockUnaligned(void* startAddress, byte value, uint byteCount) { // IL initblk instruction Unsafe.InitBlockUnaligned(startAddress, value, byteCount); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static void InitBlockUnaligned(ref byte startAddress, byte value, uint byteCount) { // IL initblk instruction Unsafe.InitBlockUnaligned(ref startAddress, value, byteCount); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static T As<T>(object o) where T : class { return (T)o; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static ref T AsRef<T>(void* source) { return ref *(T*)source; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static ref T AsRef<T>(in T source) { return ref source; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static ref TTo As<TFrom, TTo>(ref TFrom source) { return ref Unsafe.As<TFrom, TTo>(ref source); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static ref T Unbox<T>(object box) where T : struct { return ref (T)box; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static ref T Add<T>(ref T source, int elementOffset) { return ref Unsafe.Add(ref source, elementOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static void* Add<T>(void* source, int elementOffset) { return (byte*)source + (nint)elementOffset * (nint)Unsafe.SizeOf<T>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static ref T Add<T>(ref T source, nint elementOffset) { return ref Unsafe.Add(ref source, elementOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static ref T Add<T>(ref T source, nuint elementOffset) { return ref Unsafe.Add(ref source, elementOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static ref T AddByteOffset<T>(ref T source, nint byteOffset) { return ref Unsafe.AddByteOffset(ref source, byteOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static ref T AddByteOffset<T>(ref T source, nuint byteOffset) { return ref Unsafe.AddByteOffset(ref source, byteOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static ref T Subtract<T>(ref T source, int elementOffset) { return ref Unsafe.Subtract(ref source, elementOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static void* Subtract<T>(void* source, int elementOffset) { return (byte*)source - (nint)elementOffset * (nint)Unsafe.SizeOf<T>(); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static ref T Subtract<T>(ref T source, nint elementOffset) { return ref Unsafe.Subtract(ref source, elementOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static ref T Subtract<T>(ref T source, nuint elementOffset) { return ref Unsafe.Subtract(ref source, elementOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static ref T SubtractByteOffset<T>(ref T source, nint byteOffset) { return ref Unsafe.SubtractByteOffset(ref source, byteOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static ref T SubtractByteOffset<T>(ref T source, nuint byteOffset) { return ref Unsafe.SubtractByteOffset(ref source, byteOffset); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static nint ByteOffset<T>(ref T origin, ref T target) { return Unsafe.ByteOffset(target: ref target, origin: ref origin); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static bool AreSame<T>(ref T left, ref T right) { return Unsafe.AreSame(ref left, ref right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static bool IsAddressGreaterThan<T>(ref T left, ref T right) { return Unsafe.IsAddressGreaterThan(ref left, ref right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public static bool IsAddressLessThan<T>(ref T left, ref T right) { return Unsafe.IsAddressLessThan(ref left, ref right); } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static bool IsNullRef<T>(ref T source) { return Unsafe.AsPointer(ref source) == null; } [MethodImpl(MethodImplOptions.AggressiveInlining)] [System.Runtime.Versioning.NonVersionable] public unsafe static ref T NullRef<T>() { return ref *(T*)null; } } }
plugins/SicarianInfiltrator.dll
Decompiled 2 weeks ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using EmotesAPI; using EntityStates; using EntityStates.Toolbot; using HG.Reflection; using JetBrains.Annotations; using Microsoft.CodeAnalysis; using On.RoR2; using R2API; using R2API.Utils; using RiskOfOptions; using RiskOfOptions.Options; using RoR2; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.Projectile; using RoR2.Skills; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("SicarianInfiltrator")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+bb5829ae217a32f6ca1e05aa62d915e21fcce7a5")] [assembly: AssemblyProduct("SicarianInfiltrator")] [assembly: AssemblyTitle("SicarianInfiltrator")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [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 SicarianInfiltrator { public class Assets { public static AssetBundle assetBundle; public static GameObject SicarianInfiltratorBody; public static GameObject ToolBotBody; public static GameObject LoaderBody; public static GameObject CommandoBody; public static GameObject SicarianInfiltratorMaster; public static AISkillDriver[] AISkillDrivers; public static CharacterBody SicarianInfiltratorBodyComponent; public static SurvivorDef SicarianInfiltratorSurvivor; public static SkinDef DefaultSkin; public static GameObject SicarianInfiltratorEmote; public static GameObject TaserSlash; public static GameObject Slam; public static GameObject LoaderSlam; public static GameObject Explosion; public static Material RoboballMaterial; public static GameObject Indicator; public static GameObject ARCGrenadeProjectile; public static SkillDef Untargetable; public static SkillDef FireFlechet; public static SkillDef TaserGoad; public static SkillDef HelmetSlam; public static SkillDef ThrowARCGrenade; public static SkillFamily Passive; public static SkillFamily Primary; public static SkillFamily Secondary; public static SkillFamily Utility; public static SkillFamily Special; public static BuffDef Electrifying; public static BuffDef ShortDamage; public static ModdedDamageType ShockingDamageType = DamageAPI.ReserveDamageType(); public static Dictionary<string, string> actualNames = new Dictionary<string, string>(); public static void Init() { //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: 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_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_025f: Unknown result type (might be due to invalid IL or missing references) //IL_0264: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027c: 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) //IL_0294: Unknown result type (might be due to invalid IL or missing references) //IL_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02bf: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) assetBundle = AssetBundle.LoadFromFileAsync(Path.Combine(Path.GetDirectoryName(Main.PluginInfo.Location), "assetbundles", "sicarianinfiltratorassets")).assetBundle; Material[] array = assetBundle.LoadAllAssets<Material>(); foreach (Material val in array) { if (((Object)val.shader).name.StartsWith("StubbedRoR2")) { string text = ((Object)val.shader).name.Replace("StubbedRoR2", "RoR2") + ".shader"; Shader val2 = Addressables.LoadAssetAsync<Shader>((object)text).WaitForCompletion(); if (Object.op_Implicit((Object)(object)val2)) { val.shader = val2; } } } ToolBotBody = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Toolbot/ToolbotBody.prefab").WaitForCompletion(); LoaderBody = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Loader/LoaderBody.prefab").WaitForCompletion(); CommandoBody = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/CommandoBody.prefab").WaitForCompletion(); SicarianInfiltratorBody = assetBundle.LoadAsset<GameObject>("Assets/SicarianInfiltrator/Character/SicarianInfiltratorBody.prefab").RegisterCharacterBody(); SicarianInfiltratorMaster = assetBundle.LoadAsset<GameObject>("Assets/SicarianInfiltrator/Character/SicarianInfiltratorMonsterMaster.prefab").RegisterCharacterMaster(); AISkillDrivers = SicarianInfiltratorMaster.GetComponents<AISkillDriver>(); SicarianInfiltratorSurvivor = assetBundle.LoadAsset<SurvivorDef>("Assets/SicarianInfiltrator/Character/SicarianInfiltrator.asset").RegisterSurvivor<SurvivorDef>(); SicarianInfiltratorBodyComponent = SicarianInfiltratorBody.GetComponent<CharacterBody>(); SicarianInfiltratorBodyComponent.preferredPodPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/NetworkedObjects/SurvivorPod"); SicarianInfiltratorBodyComponent._defaultCrosshairPrefab = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/UI/StandardCrosshair.prefab").WaitForCompletion(); SicarianInfiltratorBody.CopyComponent<AkBank>(ToolBotBody.GetComponent<AkBank>()); SicarianInfiltratorBody.CopyComponent<AkBank>(CommandoBody.GetComponent<AkBank>()); SicarianInfiltratorBody.CopyComponent<AkBank>(LoaderBody.GetComponent<AkBank>()); GameObject gameObject = ((Component)SicarianInfiltratorBody.GetComponent<ModelLocator>().modelTransform).gameObject; gameObject.GetComponent<FootstepHandler>().footstepDustPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/GenericFootstepDust"); SicarianInfiltratorEmote = assetBundle.LoadAsset<GameObject>("Assets/SicarianInfiltrator/Character/SicarianInfiltratorEmote.prefab"); if (Main.emotesEnabled) { ModCompatabilities.EmoteCompatability.Init(); } DefaultSkin = assetBundle.LoadAsset<SkinDef>("Assets/SicarianInfiltrator/Character/SicarianInfiltratorDefaultSkin.asset"); TaserSlash = assetBundle.LoadAsset<GameObject>("Assets/SicarianInfiltrator/Effects/SwingEffect.prefab"); Slam = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/BeetleGuard/BeetleGuardGroundSlam.prefab").WaitForCompletion(); LoaderSlam = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Loader/LoaderGroundSlam.prefab").WaitForCompletion(); Explosion = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Toolbot/OmniExplosionVFXToolbotQuick.prefab").WaitForCompletion(); Indicator = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Huntress/HuntressArrowRainIndicator.prefab").WaitForCompletion(); RoboballMaterial = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/RoboBallBoss/matSummonRoboBall.mat").WaitForCompletion(); SicarianInfiltratorSurvivor.displayPrefab.GetComponentInChildren<TemporaryOverlay>().originalMaterial = RoboballMaterial; Untargetable = assetBundle.LoadAsset<SkillDef>("Assets/SicarianInfiltrator/Skills/UntargetablePassive.asset").RegisterSkillDef<SkillDef>("Untargetable"); FireFlechet = assetBundle.LoadAsset<SkillDef>("Assets/SicarianInfiltrator/Skills/FireFlechet.asset").RegisterSkillDef<SkillDef>("Flechet"); TaserGoad = assetBundle.LoadAsset<SkillDef>("Assets/SicarianInfiltrator/Skills/TaserGoad.asset").RegisterSkillDef<SkillDef>("Taser Goad"); HelmetSlam = assetBundle.LoadAsset<SkillDef>("Assets/SicarianInfiltrator/Skills/HelmetSlam.asset").RegisterSkillDef<SkillDef>("Dome Helmet Slam"); ThrowARCGrenade = assetBundle.LoadAsset<SkillDef>("Assets/SicarianInfiltrator/Skills/ThrowARCGrenade.asset").RegisterSkillDef<SkillDef>("ARC Grenade"); Passive = assetBundle.LoadAsset<SkillFamily>("Assets/SicarianInfiltrator/SkillFamilies/SicarianInfiltratorPassive.asset").RegisterSkillFamily<SkillFamily>(); Primary = assetBundle.LoadAsset<SkillFamily>("Assets/SicarianInfiltrator/SkillFamilies/SicarianInfiltratorPrimary.asset").RegisterSkillFamily<SkillFamily>(); Secondary = assetBundle.LoadAsset<SkillFamily>("Assets/SicarianInfiltrator/SkillFamilies/SicarianInfiltratorSecondary.asset").RegisterSkillFamily<SkillFamily>(); Utility = assetBundle.LoadAsset<SkillFamily>("Assets/SicarianInfiltrator/SkillFamilies/SicarianInfiltratorUtillity.asset").RegisterSkillFamily<SkillFamily>(); Special = assetBundle.LoadAsset<SkillFamily>("Assets/SicarianInfiltrator/SkillFamilies/SicarianInfiltratorSpecial.asset").RegisterSkillFamily<SkillFamily>(); Electrifying = assetBundle.LoadAsset<BuffDef>("Assets/SicarianInfiltrator/Buffs/Electrifying.asset").RegisterBuffDef<BuffDef>(); ShortDamage = assetBundle.LoadAsset<BuffDef>("Assets/SicarianInfiltrator/Buffs/ShortDamage.asset").RegisterBuffDef<BuffDef>(); ARCGrenadeProjectile = assetBundle.LoadAsset<GameObject>("Assets/SicarianInfiltrator/Projectiles/ARCGrenade.prefab").RegisterProjectile("ARC Grenade"); Extensions.RegisterState(typeof(FireFlechet)); Extensions.RegisterState(typeof(SwingTaserGoad)); Extensions.RegisterState(typeof(SwingTaserGoadSecond)); Extensions.RegisterState(typeof(DomeStomp)); Extensions.RegisterState(typeof(ThrowARCGrenade)); } } public class ARCGrenadeComponent : MonoBehaviour { [HideInInspector] public ThrowARCGrenade throwARCGrenadeState; public ProjectileController projectileController; public ProjectileImpactExplosion projectileImpactExplosion; [HideInInspector] public CharacterBody characterBody; [HideInInspector] public GameObject indicator; public void Start() { //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0196: 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_0175: Unknown result type (might be due to invalid IL or missing references) //IL_01d6: Unknown result type (might be due to invalid IL or missing references) //IL_01db: 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) if ((Object)(object)projectileController == (Object)null) { return; } characterBody = (Object.op_Implicit((Object)(object)projectileController.owner) ? projectileController.owner.GetComponent<CharacterBody>() : null); GenericSkill[] array = (Object.op_Implicit((Object)(object)characterBody.skillLocator) ? characterBody.skillLocator.allSkills : null); if (array != null && array.Length != 0) { GenericSkill[] array2 = array; foreach (GenericSkill val in array2) { if (!((Object)(object)val == (Object)null) && !((Object)(object)val.stateMachine == (Object)null) && val.stateMachine.state != null) { throwARCGrenadeState = ((val.stateMachine.state is ThrowARCGrenade) ? (val.stateMachine.state as ThrowARCGrenade) : null); if (throwARCGrenadeState != null) { break; } } } } if (Object.op_Implicit((Object)(object)projectileImpactExplosion) && throwARCGrenadeState != null) { indicator = throwARCGrenadeState.indicator; if (Object.op_Implicit((Object)(object)((EntityState)throwARCGrenadeState).characterBody)) { Rigidbody rigidbody = projectileController.rigidbody; rigidbody.velocity *= ((EntityState)throwARCGrenadeState).characterBody.attackSpeed; } ProjectileImpactExplosion obj = projectileImpactExplosion; Vector3 velocity = projectileController.rigidbody.velocity; obj.lifetime = Trajectory.CalculateGroundTravelTime(((Vector3)(ref velocity)).magnitude, throwARCGrenadeState.distance); if (projectileController.rigidbody.useGravity) { Vector3 velocity2 = projectileController.rigidbody.velocity; velocity2.y += Trajectory.CalculateInitialYSpeedForFlightDuration(projectileImpactExplosion.lifetime); projectileController.rigidbody.velocity = velocity2; } } } public void OnEnable() { if (Object.op_Implicit((Object)(object)projectileImpactExplosion)) { ProjectileImpactExplosion obj = projectileImpactExplosion; ((ProjectileExplosion)obj).OnProjectileExplosion = (Action<BlastAttack, Result>)Delegate.Combine(((ProjectileExplosion)obj).OnProjectileExplosion, new Action<BlastAttack, Result>(OnProjectileExplosion)); } } public void OnDisable() { if (Object.op_Implicit((Object)(object)projectileImpactExplosion)) { ProjectileImpactExplosion obj = projectileImpactExplosion; ((ProjectileExplosion)obj).OnProjectileExplosion = (Action<BlastAttack, Result>)Delegate.Remove(((ProjectileExplosion)obj).OnProjectileExplosion, new Action<BlastAttack, Result>(OnProjectileExplosion)); } } public void OnDestroy() { if (Object.op_Implicit((Object)(object)indicator)) { Object.Destroy((Object)(object)indicator); } } private void OnProjectileExplosion(BlastAttack attack, Result result) { } } public class UntargetableComponent : MonoBehaviour { public CharacterBody characterBody; public CharacterModel characterModel; public Inventory inventory; public bool serverActive; public bool providing; public static float shortDamageDuration => UntargetableConfig.shortDamageDuration.Value; public void Awake() { characterBody = ((Component)this).GetComponent<CharacterBody>(); characterModel = ((Object.op_Implicit((Object)(object)characterBody) && Object.op_Implicit((Object)(object)characterBody.modelLocator) && Object.op_Implicit((Object)(object)characterBody.modelLocator.modelTransform)) ? ((Component)characterBody.modelLocator.modelTransform).GetComponent<CharacterModel>() : null); inventory = characterBody.inventory; serverActive = NetworkServer.active; } private void SetProvidingBuff(bool shouldProvide) { //IL_00f9: Unknown result type (might be due to invalid IL or missing references) if (shouldProvide == providing || (Object)(object)characterBody == (Object)null) { return; } providing = shouldProvide; if (providing) { if (serverActive) { characterBody.AddBuff(Buffs.CloakSpeed); characterBody.AddBuff(Buffs.Cloak); characterBody.ClearTimedBuffs(Assets.ShortDamage); characterBody.AddBuff(Assets.ShortDamage); } if (Object.op_Implicit((Object)(object)characterModel)) { AddOverlay(shortDamageDuration); } } else { if (Object.op_Implicit((Object)(object)characterModel)) { AddOverlay(shortDamageDuration); } if (serverActive) { characterBody.RemoveBuff(Buffs.Cloak); characterBody.RemoveBuff(Buffs.CloakSpeed); characterBody.SetBuffCount(Assets.ShortDamage.buffIndex, 0); characterBody.AddTimedBuff(Assets.ShortDamage, shortDamageDuration); } } } public void AddOverlay(float duration) { TemporaryOverlay val = ((Component)this).gameObject.AddComponent<TemporaryOverlay>(); val.alphaCurve = AnimationCurve.EaseInOut(0f, 1f, 1f, 0f); val.animateShaderAlpha = true; val.destroyComponentOnEnd = true; val.duration = duration; val.originalMaterial = Assets.RoboballMaterial; val.inspectorCharacterModel = characterModel; val.AddToCharacerModel(characterModel); } private void OnDisable() { SetProvidingBuff(shouldProvide: false); } private void FixedUpdate() { SetProvidingBuff(characterBody.outOfCombat); } } [CreateAssetMenu(menuName = "RoR2/SkillDef/UntargetableSkillDef")] public class UntargetableSkillDef : SkillDef { public class UntargetableSkillInstanceData : BaseSkillInstanceData { public UntargetableComponent untargetableComponent; } public override BaseSkillInstanceData OnAssigned([NotNull] GenericSkill skillSlot) { return (BaseSkillInstanceData)(object)new UntargetableSkillInstanceData { untargetableComponent = ((Component)skillSlot).gameObject.GetOrAddComponent<UntargetableComponent>() }; } public override void OnUnassigned([NotNull] GenericSkill skillSlot) { UntargetableSkillInstanceData untargetableSkillInstanceData = ((skillSlot.skillInstanceData != null && skillSlot.skillInstanceData is UntargetableSkillInstanceData) ? (skillSlot.skillInstanceData as UntargetableSkillInstanceData) : null); UntargetableComponent untargetableComponent = ((untargetableSkillInstanceData != null) ? untargetableSkillInstanceData.untargetableComponent : ((Component)skillSlot).gameObject.GetComponent<UntargetableComponent>()); if (Object.op_Implicit((Object)(object)untargetableComponent)) { Object.Destroy((Object)(object)untargetableComponent); } ((SkillDef)this).OnUnassigned(skillSlot); } } public class FireFlechetConfig { public static ConfigEntry<float> damageCoefficient = Main.configFile.Bind<float>("Flechet", "Damage Coefficient", 0.7f, "").RegisterConfig<float>(); public static ConfigEntry<float> procCoefficient = Main.configFile.Bind<float>("Flechet", "Proc Coefficient", 1f, "").RegisterConfig<float>(); public static ConfigEntry<float> electrifyingTimer = Main.configFile.Bind<float>("Flechet", "Shocking Timer", 3f, "").RegisterConfig<float>(); public static ConfigEntry<int> electrifyingAmount = Main.configFile.Bind<int>("Flechet", "Shocking Amount", 25, "Amount needed to Shock the target").RegisterConfig<int>(); public static ConfigEntry<float> shockDuration = Main.configFile.Bind<float>("Flechet", "Shock Duration", 1f, "").RegisterConfig<float>(); public static ConfigEntry<float> maxDistance = Main.configFile.Bind<float>("Flechet", "Dart Distance", 128f, "").RegisterConfig<float>(ApplyAiRange); public static ConfigEntry<float> spreadBloomValue = Main.configFile.Bind<float>("Flechet", "Spread Bloom", 0.25f, "").RegisterConfig<float>(); public static ConfigEntry<float> force = Main.configFile.Bind<float>("Flechet", "Force", 30f, "").RegisterConfig<float>(); public static ConfigEntry<float> baseDuration = Main.configFile.Bind<float>("Flechet", "Base Duration", 0.2f, "").RegisterConfig<float>(); public static ConfigEntry<float> fireRateIncreaseOverTime = Main.configFile.Bind<float>("Flechet", "Fire Rate Increase Over Time Rate", 2f, "").RegisterConfig<float>(); public static ConfigEntry<float> horizontalSpreadIncreaseOverTime = Main.configFile.Bind<float>("Flechet", "Horizontal Spread Increase Over Time Rate", 2f, "").RegisterConfig<float>(); public static ConfigEntry<float> verticalSpreadIncreaseOverTime = Main.configFile.Bind<float>("Flechet", "Vertical Spread Increase Over Time Rate", 2f, "").RegisterConfig<float>(); public static ConfigEntry<float> maxIncreasedFireRate = Main.configFile.Bind<float>("Flechet", "Max Fire Rate Increase Over Time", 15f, "").RegisterConfig<float>(); public static ConfigEntry<float> maxIncreasedHorizontalSpread = Main.configFile.Bind<float>("Flechet", "Max Horizontal Spread Increase Over Time", 3f, "").RegisterConfig<float>(); public static ConfigEntry<float> maxIncreasedVerticalSpread = Main.configFile.Bind<float>("Flechet", "Max Vertical Spread Increase Over Time", 1f, "").RegisterConfig<float>(); public static ConfigEntry<float> minSpread = Main.configFile.Bind<float>("Flechet", "Min Spread", 3f, "").RegisterConfig<float>(); public static ConfigEntry<int> bulletCount = Main.configFile.Bind<int>("Flechet", "Bullet Count", 1, "").RegisterConfig<int>(); public static void ApplyAiRange(ConfigEntry<float> configEntry) { AISkillDriver val = Assets.AISkillDrivers[3]; val.maxDistance = configEntry.Value / 2f; configEntry.SettingChanged += ConfigEntry_SettingChanged; void ConfigEntry_SettingChanged(object sender, EventArgs e) { AISkillDriver val2 = Assets.AISkillDrivers[3]; val2.maxDistance = configEntry.Value / 2f; } } } public class TaserGoadConfig { public static ConfigEntry<float> firstSwingDamageCoefficient = Main.configFile.Bind<float>("Taser Goad", "First Swing Damage Coefficient", 2f, "").RegisterConfig<float>(); public static ConfigEntry<float> firstSwingProcCoefficient = Main.configFile.Bind<float>("Taser Goad", "First Swing Proc Coefficient", 1f, "").RegisterConfig<float>(); public static ConfigEntry<float> firstSwingBaseDuration = Main.configFile.Bind<float>("Taser Goad", "First Swing Base Duration", 0.2f, "").RegisterConfig<float>(); public static ConfigEntry<float> secondSwingDamageCoefficient = Main.configFile.Bind<float>("Taser Goad", "Second Swing Damage Coefficient", 4f, "").RegisterConfig<float>(); public static ConfigEntry<float> secondSwingProcCoefficient = Main.configFile.Bind<float>("Taser Goad", "Second Swing Proc Coefficient", 1f, "").RegisterConfig<float>(); public static ConfigEntry<float> secondSwingBaseDuration = Main.configFile.Bind<float>("Taser Goad", "Second Swing Base Duration", 0.2f, "").RegisterConfig<float>(); public static ConfigEntry<float> force = Main.configFile.Bind<float>("Taser Goad", "Force", 80f, "").RegisterConfig<float>(); public static ConfigEntry<float> baseAcceleration = Main.configFile.Bind<float>("Taser Goad", "Acceleration", 5f, "").RegisterConfig<float>(); public static ConfigEntry<float> baseCurrent = Main.configFile.Bind<float>("Taser Goad", "Current Velocity", 5f, "").RegisterConfig<float>(); public static ConfigEntry<float> baseMaxSpeed = Main.configFile.Bind<float>("Taser Goad", "Acceleration Time", 0.2f, "").RegisterConfig<float>(); public static ConfigEntry<float> baseInvincibilityWindow = Main.configFile.Bind<float>("Taser Goad", "Invincibility Window", 0.2f, "").RegisterConfig<float>(); public static ConfigEntry<bool> addLightArmor = Main.configFile.Bind<bool>("Taser Goad", "Add Light Armor During Skill State?", true, "").RegisterConfig<bool>(); } public class HelmetSlamConfig { public static ConfigEntry<float> damageCoefficient = Main.configFile.Bind<float>("Dome Helmet Slam", "Damage Coefficient", 10f, "").RegisterConfig<float>(); public static ConfigEntry<float> procCoefficient = Main.configFile.Bind<float>("Dome Helmet Slam", "Proc Coefficient", 1f, "").RegisterConfig<float>(); public static ConfigEntry<float> force = Main.configFile.Bind<float>("Dome Helmet Slam", "Force", 200f, "").RegisterConfig<float>(); public static ConfigEntry<float> bonusForce = Main.configFile.Bind<float>("Dome Helmet Slam", "Bonus Force", 200f, "").RegisterConfig<float>(); public static ConfigEntry<float> radius = Main.configFile.Bind<float>("Dome Helmet Slam", "Radius", 12f, "").RegisterConfig<float>(); public static ConfigEntry<float> jumpPower = Main.configFile.Bind<float>("Dome Helmet Slam", "Jump Power", 2f, "").RegisterConfig<float>(); public static ConfigEntry<float> gravityScale = Main.configFile.Bind<float>("Dome Helmet Slam", "Gravity Increase", 5f, "").RegisterConfig<float>(); public static ConfigEntry<float> walkSpeedPenalty = Main.configFile.Bind<float>("Dome Helmet Slam", "Speed Increase", 5f, "").RegisterConfig<float>(); public static ConfigEntry<FalloffModel> slamDamageFalloff = Main.configFile.Bind<FalloffModel>("Dome Helmet Slam", "Slam Falloff", (FalloffModel)1, "").RegisterConfig<FalloffModel>(); } public class ThrowARCGrenadeConfig { public static ConfigEntry<float> damageCoefficient = Main.configFile.Bind<float>("ARC Grenade", "Damage Coefficient", 10f, "").RegisterConfig<float>(); public static ConfigEntry<float> baseDuration = Main.configFile.Bind<float>("ARC Grenade", "Base Duration", 0.4f, "").RegisterConfig<float>(); public static ConfigEntry<float> baseDistance = Main.configFile.Bind<float>("ARC Grenade", "Distance", 48f, "").RegisterConfig<float>(ApplyAiRange); public static void ApplyAiRange(ConfigEntry<float> configEntry) { AISkillDriver val = Assets.AISkillDrivers[0]; val.maxDistance = configEntry.Value; configEntry.SettingChanged += ConfigEntry_SettingChanged; void ConfigEntry_SettingChanged(object sender, EventArgs e) { AISkillDriver val2 = Assets.AISkillDrivers[0]; val2.maxDistance = configEntry.Value; } } } public class UntargetableConfig { public static ConfigEntry<float> shortDamageMultiplier = Main.configFile.Bind<float>("Untargetable", "Short Damage Boost Damage Multiplier", 1f, "").RegisterConfig<float>(); public static ConfigEntry<float> shortDamageMaxMultiplier = Main.configFile.Bind<float>("Untargetable", "Short Damage Boost Damage Max Multiplier", 2.5f, "").RegisterConfig<float>(); public static ConfigEntry<float> shortDamageDuration = Main.configFile.Bind<float>("Untargetable", "Short Damage Boost Duration", 2.5f, "").RegisterConfig<float>(); public static ConfigEntry<float> shortDamageTotalMultiplier = Main.configFile.Bind<float>("Untargetable", "Short Damage Boost Total Multiplier", 10f, "").RegisterConfig<float>(); } public class ContentPacks : IContentPackProvider { internal ContentPack contentPack = new ContentPack(); public static List<GameObject> bodies = new List<GameObject>(); public static List<BuffDef> buffs = new List<BuffDef>(); public static List<SkillDef> skills = new List<SkillDef>(); public static List<SkillFamily> skillFamilies = new List<SkillFamily>(); public static List<GameObject> projectiles = new List<GameObject>(); public static List<GameObject> networkPrefabs = new List<GameObject>(); public static List<SurvivorDef> survivors = new List<SurvivorDef>(); public static List<Type> states = new List<Type>(); public static List<NetworkSoundEventDef> sounds = new List<NetworkSoundEventDef>(); public static List<UnlockableDef> unlockableDefs = new List<UnlockableDef>(); public static List<GameObject> masters = new List<GameObject>(); public string identifier => "com.brynzananas.sicarianinfiltrator.ContentProvider"; public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(contentPack, args.output); args.ReportProgress(1f); yield break; } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { contentPack.identifier = identifier; contentPack.skillDefs.Add(skills.ToArray()); contentPack.skillFamilies.Add(skillFamilies.ToArray()); contentPack.bodyPrefabs.Add(bodies.ToArray()); contentPack.buffDefs.Add(buffs.ToArray()); contentPack.projectilePrefabs.Add(projectiles.ToArray()); contentPack.survivorDefs.Add(survivors.ToArray()); contentPack.entityStateTypes.Add(states.ToArray()); contentPack.networkSoundEventDefs.Add(sounds.ToArray()); contentPack.networkedObjectPrefabs.Add(networkPrefabs.ToArray()); contentPack.unlockableDefs.Add(unlockableDefs.ToArray()); contentPack.masterPrefabs.Add(masters.ToArray()); yield break; } } public class FireFlechet : BaseSkillState { public static float animationDuration = 1.5f; public static float animationTransition = 0.1f; public float duration; public float stopwatch; public static float damageCoefficient => FireFlechetConfig.damageCoefficient.Value; public static float procCoefficient => FireFlechetConfig.procCoefficient.Value; public static float maxDistance => FireFlechetConfig.maxDistance.Value; public static float spreadBloomValue => FireFlechetConfig.spreadBloomValue.Value; public static float force => FireFlechetConfig.force.Value; public static float baseDuration => FireFlechetConfig.baseDuration.Value; public static float fireRateIncreaseOverTime => FireFlechetConfig.fireRateIncreaseOverTime.Value; public static float horizontalSpreadIncreaseOverTime => FireFlechetConfig.horizontalSpreadIncreaseOverTime.Value; public static float verticalSpreadIncreaseOverTime => FireFlechetConfig.verticalSpreadIncreaseOverTime.Value; public static float maxIncreasedFireRate => FireFlechetConfig.maxIncreasedFireRate.Value; public static float maxIncreasedHorizontalSpread => FireFlechetConfig.maxIncreasedHorizontalSpread.Value; public static float maxIncreasedVerticalSpread => FireFlechetConfig.maxIncreasedVerticalSpread.Value; public static float minSpread => FireFlechetConfig.minSpread.Value; public static int bulletCount => FireFlechetConfig.bulletCount.Value; public void FireBullet(Ray aimRay, int bulletCount, float spreadPitchScale, float spreadYawScale) { //IL_0002: 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_0025: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: 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_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Expected O, but got Unknown //IL_0136: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).StartAimMode(aimRay, 3f, false); if (((EntityState)this).isAuthority) { BulletAttack val = new BulletAttack { aimVector = ((Ray)(ref aimRay)).direction, origin = ((Ray)(ref aimRay)).origin, owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, bulletCount = (uint)bulletCount, damage = ((BaseState)this).damageStat * damageCoefficient, damageColorIndex = (DamageColorIndex)0, damageType = DamageTypeCombo.GenericPrimary, falloffModel = (FalloffModel)1, force = force, HitEffectNormal = false, procChainMask = default(ProcChainMask), procCoefficient = procCoefficient, maxDistance = maxDistance, radius = 0.1f, isCrit = ((BaseState)this).RollCrit(), muzzleName = "Muzzle", minSpread = minSpread, hitEffectPrefab = BaseNailgunState.hitEffectPrefab, maxSpread = ((EntityState)this).characterBody.spreadBloomAngle, smartCollision = false, sniper = false, spreadPitchScale = spreadPitchScale, spreadYawScale = spreadYawScale, tracerEffectPrefab = BaseNailgunState.tracerEffectPrefab, allowTrajectoryAimAssist = false }; DamageAPI.AddModdedDamageType(val, Assets.ShockingDamageType); val.Fire(); GenericSkill activatorSkillSlot = ((BaseSkillState)this).activatorSkillSlot; int stock = activatorSkillSlot.stock; activatorSkillSlot.stock = stock - 1; ((EntityState)this).characterBody.OnSkillActivated(((BaseSkillState)this).activatorSkillSlot); } if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { ((EntityState)this).characterBody.AddSpreadBloom(spreadBloomValue); } Util.PlaySound(BaseNailgunState.fireSoundString, ((EntityState)this).gameObject); ((EntityState)this).PlayAnimation("LeftHand, Override", "Shoot", "Shoot.playbackRate", animationDuration, animationTransition); ((EntityState)this).PlayAnimation("LeftHand, Additive", "Shoot"); EffectManager.SimpleMuzzleFlash(BaseNailgunState.muzzleFlashPrefab, ((EntityState)this).gameObject, BaseNailgunState.muzzleName, false); } public float CalculateDuration() { return baseDuration / ((EntityState)this).characterBody.attackSpeed / Mathf.Min(((EntityState)this).fixedAge * fireRateIncreaseOverTime + 1f, maxIncreasedFireRate); } public override void OnEnter() { ((BaseState)this).OnEnter(); duration = CalculateDuration(); stopwatch = duration; } public override void FixedUpdate() { //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); stopwatch += ((EntityState)this).GetDeltaTime(); if (!(stopwatch >= duration)) { return; } if (((EntityState)this).isAuthority && (!((BaseSkillState)this).IsKeyDownAuthority() || ((BaseSkillState)this).activatorSkillSlot.stock <= 0)) { ((EntityState)this).outer.SetStateToMain(); return; } int num = 0; while (stopwatch >= duration) { stopwatch -= duration; num++; } Ray aimRay = ((BaseState)this).GetAimRay(); TrajectoryAimAssist.ApplyTrajectoryAimAssist(ref aimRay, maxDistance, ((EntityState)this).gameObject, 1f); Vector3 direction = ((Ray)(ref aimRay)).direction; FireBullet(aimRay, num * bulletCount, MathF.Min(((EntityState)this).fixedAge * verticalSpreadIncreaseOverTime * ((EntityState)this).characterBody.attackSpeed, maxIncreasedVerticalSpread), MathF.Min(((EntityState)this).fixedAge * horizontalSpreadIncreaseOverTime * ((EntityState)this).characterBody.attackSpeed, maxIncreasedHorizontalSpread)); duration = CalculateDuration(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } public abstract class BaseSwingTaserGoad : BaseSkillState { public Vector3 direction; public float duration; public HitBoxGroup hitBoxGroup; public OverlapAttack overlapAttack; public float acceleration; public float current; public bool armorAdded; public Vector3 currentVector; public bool crit; public abstract float baseDuration { get; } public abstract float damageCoefficient { get; } public abstract float procCoefficient { get; } public abstract string hitboxName { get; } public static float force => TaserGoadConfig.force.Value; public static float baseAcceleration => TaserGoadConfig.baseAcceleration.Value; public static float baseCurrent => TaserGoadConfig.baseCurrent.Value; public static float baseMaxSpeed => TaserGoadConfig.baseMaxSpeed.Value; public static float baseInvincivilityWindow => TaserGoadConfig.baseInvincibilityWindow.Value; public static bool addLightArmor => TaserGoadConfig.addLightArmor.Value; public abstract void SetNextState(); public override void OnEnter() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); SetupOverlapAttack(); duration = baseDuration / ((BaseState)this).attackSpeedStat; acceleration = ((BaseState)this).moveSpeedStat * baseAcceleration; current = baseCurrent; Ray aimRay = ((BaseState)this).GetAimRay(); direction = new Vector3(((Ray)(ref aimRay)).direction.x, 0f, ((Ray)(ref aimRay)).direction.z); ((BaseState)this).StartAimMode(2f, true); if (NetworkServer.active) { ((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenRejectAllDamage, baseInvincivilityWindow); if (addLightArmor) { ((EntityState)this).characterBody.AddBuff(Buffs.SmallArmorBoost); armorAdded = true; } } } public override void OnExit() { ((EntityState)this).OnExit(); if (NetworkServer.active && armorAdded) { ((EntityState)this).characterBody.RemoveBuff(Buffs.SmallArmorBoost); } } public void SetupOverlapAttack() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_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_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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) //IL_0091: 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) OverlapAttack val = new OverlapAttack(); val.attacker = ((EntityState)this).gameObject; val.damage = ((EntityState)this).characterBody.damage; val.damageColorIndex = (DamageColorIndex)0; val.damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)16777216), (DamageTypeExtended)0, (DamageSource)2); val.forceVector = ((EntityState)this).transform.forward; val.hitBoxGroup = null; val.inflictor = ((EntityState)this).gameObject; val.isCrit = false; val.procChainMask = default(ProcChainMask); val.pushAwayForce = force; val.procCoefficient = 1f; val.teamIndex = ((BaseState)this).GetTeam(); overlapAttack = val; } public void Swing(Vector3 vector3, float damageMultiplier, bool crit, float procCoefficient, string hitboxName) { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).isAuthority) { hitBoxGroup = ((BaseState)this).FindHitBoxGroup(hitboxName); if (Object.op_Implicit((Object)(object)hitBoxGroup)) { overlapAttack.forceVector = vector3; overlapAttack.hitBoxGroup = hitBoxGroup; overlapAttack.damage = ((EntityState)this).characterBody.damage * damageMultiplier; overlapAttack.isCrit = crit; overlapAttack.procCoefficient = procCoefficient; overlapAttack.Fire((List<HurtBox>)null); } } } public override void FixedUpdate() { //IL_005b: 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_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: 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) ((EntityState)this).FixedUpdate(); ((BaseState)this).StartAimMode(2f, false); current = Mathf.SmoothDamp(current, 0f, ref acceleration, baseMaxSpeed); if (((EntityState)this).isAuthority) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = direction * ((EntityState)this).characterBody.moveSpeed * current; } else if (Object.op_Implicit((Object)(object)((EntityState)this).rigidbody)) { ((EntityState)this).rigidbody.velocity = direction * ((EntityState)this).characterBody.moveSpeed * current; } if (((EntityState)this).fixedAge < baseDuration) { Swing(direction, damageCoefficient, crit, procCoefficient, hitboxName); } if (((EntityState)this).fixedAge >= duration && !((BaseSkillState)this).IsKeyDownAuthority()) { SetNextState(); } } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } public class SwingTaserGoad : BaseSwingTaserGoad { public static Vector3 effectScale = new Vector3(1f, 1f, 1f); public static string enterSound = "Play_loader_m1_swing"; public bool end = true; public override float damageCoefficient => TaserGoadConfig.firstSwingDamageCoefficient.Value; public override float procCoefficient => TaserGoadConfig.firstSwingProcCoefficient.Value; public override float baseDuration => TaserGoadConfig.firstSwingBaseDuration.Value; public override string hitboxName => "TaserClose"; public override void OnEnter() { //IL_006e: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); crit = ((BaseState)this).RollCrit(); ((EntityState)this).PlayAnimation("UpperBody, Override", "Slash1", "Slash.playbackRate", 0.583f, 0f); Util.PlaySound(enterSound, ((EntityState)this).gameObject); GameObject val = Object.Instantiate<GameObject>(Assets.TaserSlash); val.transform.SetParent(((EntityState)this).modelLocator.modelTransform, false); val.transform.localScale = effectScale; } public override void OnExit() { base.OnExit(); ((EntityState)this).PlayAnimation("UpperBody, Override", "BufferEmpty", "Slash.playbackRate", 1f, 0.5f); } public override void SetNextState() { EntityStateMachine outer = ((EntityState)this).outer; SwingTaserGoadSecond swingTaserGoadSecond = new SwingTaserGoadSecond(); ((BaseSkillState)swingTaserGoadSecond).activatorSkillSlot = ((BaseSkillState)this).activatorSkillSlot; swingTaserGoadSecond.crit = crit; outer.SetNextState((EntityState)(object)swingTaserGoadSecond); } } public class SwingTaserGoadSecond : BaseSwingTaserGoad { public static Vector3 effectScale = new Vector3(-1f, 1f, 1.5f); public static string enterSound = "Play_loader_m1_swing"; public override float damageCoefficient => TaserGoadConfig.secondSwingDamageCoefficient.Value; public override float procCoefficient => TaserGoadConfig.secondSwingProcCoefficient.Value; public override float baseDuration => TaserGoadConfig.secondSwingBaseDuration.Value; public override string hitboxName => "TaserFar"; public override void OnEnter() { //IL_0062: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); ((EntityState)this).PlayAnimation("UpperBody, Override", "Slash2", "Slash.playbackRate", 0.583f, 0f); Util.PlaySound(enterSound, ((EntityState)this).gameObject); GameObject val = Object.Instantiate<GameObject>(Assets.TaserSlash); val.transform.SetParent(((EntityState)this).modelLocator.modelTransform, false); val.transform.localScale = effectScale; } public override void OnExit() { base.OnExit(); } public override void SetNextState() { ((EntityState)this).outer.SetNextStateToMain(); } } public class DomeStomp : GenericCharacterMain { public static float indicatorSmoothTime = 0.2f; public static float timeUntilFixedUpdateCheck = 0.1f; public static string enterSound = "Play_loader_R_variant_activate"; public static string exitSound = "Play_loader_R_variant_slam"; public bool fire = true; public GameObject indicator; public float indicatorAcceleration; public static float damageCoefficient => HelmetSlamConfig.damageCoefficient.Value; public static float procCoefficient => HelmetSlamConfig.procCoefficient.Value; public static float force => HelmetSlamConfig.force.Value; public static float bonusForce => HelmetSlamConfig.bonusForce.Value; public static float radius => HelmetSlamConfig.radius.Value; public static float jumpPower => HelmetSlamConfig.jumpPower.Value; public static float gravityScale => HelmetSlamConfig.gravityScale.Value; public static float walkSpeedPenalty => HelmetSlamConfig.walkSpeedPenalty.Value; public static FalloffModel slamDamageFalloff => HelmetSlamConfig.slamDamageFalloff.Value; public Vector3 gravity => (Vector3)(Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) ? new Vector3(0f, Physics.gravity.y, 0f) : Physics.gravity); public override void ProcessJump() { } public void PlaceIndicator() { //IL_001c: 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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)indicator == (Object)null) { return; } Vector3 footPosition = ((EntityState)this).characterBody.footPosition; Vector3 val = gravity; RaycastHit val2 = default(RaycastHit); if (Physics.Raycast(footPosition, ((Vector3)(ref val)).normalized, ref val2, 99999f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)0)) { if (!indicator.activeSelf) { indicator.SetActive(true); } indicator.transform.position = ((RaycastHit)(ref val2)).point; } else if (indicator.activeSelf) { indicator.SetActive(false); } } public override void OnEnter() { //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Expected O, but got Unknown ((GenericCharacterMain)this).OnEnter(); Util.PlaySound(enterSound, ((EntityState)this).gameObject); int layerIndex = ((BaseCharacterMain)this).modelAnimator.GetLayerIndex("Body"); if (layerIndex >= 0) { ((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("Jump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex); } ((EntityState)this).PlayAnimation("FullBody, Additive", "FlipEnter", "Slam.playbackRate", 0.5f, 0f); indicator = Object.Instantiate<GameObject>(Assets.Indicator); indicator.transform.localScale = Vector3.zero; PlaceIndicator(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { if (((EntityState)this).isAuthority) { ((EntityState)this).characterMotor.velocity.y = gravity.y * -1f * jumpPower; ((EntityState)this).characterMotor.onHitGroundAuthority += new HitGroundDelegate(CharacterMotor_onHitGroundAuthority); } if (NetworkServer.active) { ((EntityState)this).characterBody.AddBuff(Buffs.IgnoreFallDamage); } CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.gravityScale *= gravityScale; CharacterMotor characterMotor2 = ((EntityState)this).characterMotor; characterMotor2.airControl *= ((BaseState)this).attackSpeedStat; CharacterMotor characterMotor3 = ((EntityState)this).characterMotor; characterMotor3.walkSpeedPenaltyCoefficient *= walkSpeedPenalty; } else if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void FixedUpdate() { ((GenericCharacterMain)this).FixedUpdate(); if (((EntityState)this).fixedAge >= timeUntilFixedUpdateCheck && ((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterMotor.isGrounded) { FireExplosion(); } } public override void Update() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) ((GenericCharacterMain)this).Update(); float num = Mathf.SmoothDamp(((EntityState)this).transform.localScale.x, radius, ref indicatorAcceleration, indicatorSmoothTime * Time.deltaTime); indicator.transform.localScale = new Vector3(num, num, num); PlaceIndicator(); } public override void OnExit() { //IL_0081: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Expected O, but got Unknown ((GenericCharacterMain)this).OnExit(); ((EntityState)this).PlayAnimation("FullBody, Additive", "BufferEmpty", "Slam.playbackRate", 0.1f, 0f); if (NetworkServer.active) { ((EntityState)this).characterBody.RemoveBuff(Buffs.IgnoreFallDamage); ((EntityState)this).characterBody.AddTimedBuff(Buffs.IgnoreFallDamage, 1f); } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { if (((EntityState)this).isAuthority) { ((EntityState)this).characterMotor.onHitGroundAuthority -= new HitGroundDelegate(CharacterMotor_onHitGroundAuthority); } CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.airControl /= ((BaseState)this).attackSpeedStat; CharacterMotor characterMotor2 = ((EntityState)this).characterMotor; characterMotor2.gravityScale /= gravityScale; CharacterMotor characterMotor3 = ((EntityState)this).characterMotor; characterMotor3.walkSpeedPenaltyCoefficient /= walkSpeedPenalty; } if (Object.op_Implicit((Object)(object)indicator)) { EntityState.Destroy((Object)(object)indicator); } } public unsafe void FireExplosion() { //IL_001e: 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_002f: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_00c2: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Expected O, but got I4 //IL_00e8: 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_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Expected O, but got Unknown //IL_0121: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Expected O, but got Unknown if (fire && ((EntityState)this).isAuthority) { ? val = new BlastAttack { attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject }; ? val2 = val; int num; if (!Object.op_Implicit((Object)(object)((EntityState)this).teamComponent)) { num = -1; val = num; num = (int)val; } else { val = ((EntityState)this).teamComponent.teamIndex; num = (int)val; } ((BlastAttack)val2).teamIndex = (TeamIndex)val; ((BlastAttack)num).baseDamage = ((EntityState)this).characterBody.damage * damageCoefficient; ((BlastAttack)num).baseForce = force * 0.2f; Unsafe.Write(&((BlastAttack)num).position, ((EntityState)this).characterBody.footPosition); ((BlastAttack)num).radius = radius; Unsafe.Write(&((BlastAttack)num).falloffModel, (FalloffModel)1); Unsafe.Write(&((BlastAttack)num).bonusForce, gravity * -1f * bonusForce); ((BlastAttack)num).procCoefficient = procCoefficient; Unsafe.Write(&((BlastAttack)num).damageType, new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)32), (DamageTypeExtended)0, (DamageSource)4)); BlastAttack val3 = (BlastAttack)(object)num; val3.Fire(); fire = false; EffectData val4 = new EffectData { origin = val3.position, scale = val3.radius }; EffectManager.SpawnEffect(Assets.Slam, val4, true); EffectData val5 = new EffectData { origin = val3.position, scale = val3.radius }; EffectManager.SpawnEffect(Assets.LoaderSlam, val5, true); ((EntityState)this).outer.SetNextStateToMain(); } } private void CharacterMotor_onHitGroundAuthority(ref HitGroundInfo hitGroundInfo) { FireExplosion(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } public class ThrowARCGrenade : BaseSkillState { public static float indicatorSmoothTime = 0.2f; public static GameObject projectile = Assets.ARCGrenadeProjectile; public static string throwSound = "Play_commando_M2_grenade_throw"; public static Dictionary<GameObject, List<ThrowARCGrenade>> throwARCGrenades = new Dictionary<GameObject, List<ThrowARCGrenade>>(); public bool fire = true; public GameObject indicator; public float stopwatch; public float duration; public float distance; public float radius; public float indicatorAcceleration; public float startingVelocity; public Vector3 finalIndicatorPosition; public ProjectileImpactExplosion projectileImpactExplosion; public ProjectileSimple projectileSimple; public Dictionary<Collider, HurtBox> keyValuePairs = new Dictionary<Collider, HurtBox>(); public ChildLocator childLocator; public GameObject gun; public GameObject grenade; public static float damageCoefficient => ThrowARCGrenadeConfig.damageCoefficient.Value; public static float baseDuration => ThrowARCGrenadeConfig.baseDuration.Value; public static float baseDistance => ThrowARCGrenadeConfig.baseDistance.Value; public override void OnEnter() { //IL_0035: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; indicator = Object.Instantiate<GameObject>(Assets.Indicator); indicator.transform.localScale = Vector3.zero; projectileImpactExplosion = projectile.GetComponent<ProjectileImpactExplosion>(); radius = (Object.op_Implicit((Object)(object)projectileImpactExplosion) ? ((ProjectileExplosion)projectileImpactExplosion).blastRadius : 0f); ((EntityState)this).PlayAnimation("LeftHand, Override", "SelectGrenade"); childLocator = ((Object.op_Implicit((Object)(object)((EntityState)this).modelLocator) && Object.op_Implicit((Object)(object)((EntityState)this).modelLocator.modelTransform)) ? ((Component)((EntityState)this).modelLocator.modelTransform).GetComponent<ChildLocator>() : null); if (Object.op_Implicit((Object)(object)childLocator)) { gun = ((Component)childLocator.FindChild("Gun")).gameObject; grenade = ((Component)childLocator.FindChild("Grenade")).gameObject; } if (Object.op_Implicit((Object)(object)gun)) { gun.SetActive(false); } if (Object.op_Implicit((Object)(object)grenade)) { grenade.SetActive(true); } } public void PlaceIndicator(Ray ray) { //IL_001e: 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_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_0217: 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_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022e: 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_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: 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_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) if ((Object)(object)indicator == (Object)null) { return; } float num = Mathf.SmoothDamp(((EntityState)this).transform.localScale.x, radius, ref indicatorAcceleration, indicatorSmoothTime * Time.deltaTime); indicator.transform.localScale = new Vector3(num, num, num); RaycastHit[] array = Physics.RaycastAll(ray, baseDistance, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) + LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)0); bool hit = false; distance = baseDistance; RaycastHit raycastHit = default(RaycastHit); if (array != null && array.Length != 0) { RaycastHit[] array2 = array; for (int i = 0; i < array2.Length; i++) { RaycastHit raycastHit2 = array2[i]; if (!(((RaycastHit)(ref raycastHit2)).distance < distance)) { continue; } HurtBox val; if (keyValuePairs.ContainsKey(((RaycastHit)(ref raycastHit2)).collider)) { val = keyValuePairs[((RaycastHit)(ref raycastHit2)).collider]; } else { val = ((Component)((RaycastHit)(ref raycastHit2)).collider).GetComponent<HurtBox>(); keyValuePairs.Add(((RaycastHit)(ref raycastHit2)).collider, val); } if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)((EntityState)this).teamComponent)) { CharacterBody val2 = (Object.op_Implicit((Object)(object)val.healthComponent) ? val.healthComponent.body : null); if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val2.teamComponent) && val2.teamComponent.teamIndex != ((EntityState)this).teamComponent.teamIndex) { Catch(ref hit, ref raycastHit, raycastHit2); } } else { Catch(ref hit, ref raycastHit, raycastHit2); } } } if (hit) { indicator.transform.position = ((RaycastHit)(ref raycastHit)).point; } else { indicator.transform.position = ((Ray)(ref ray)).origin + ((Ray)(ref ray)).direction * distance; } } private void Catch(ref bool hit, ref RaycastHit raycastHit, RaycastHit raycastHit1) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0003: Unknown result type (might be due to invalid IL or missing references) raycastHit = raycastHit1; distance = ((RaycastHit)(ref raycastHit)).distance; hit = true; } public void FireProjectile() { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_004e: 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_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) fire = false; Ray aimRay = ((BaseState)this).GetAimRay(); Util.PlaySound(throwSound, ((EntityState)this).gameObject); ((EntityState)this).PlayAnimation("LeftHand, Override", "ThrowGrenade"); if (Object.op_Implicit((Object)(object)grenade)) { grenade.SetActive(false); } PlaceIndicator(aimRay); if (((EntityState)this).isAuthority) { TrajectoryAimAssist.ApplyTrajectoryAimAssist(ref aimRay, projectile, ((EntityState)this).gameObject, 1f); FireProjectileInfo val = default(FireProjectileInfo); val.projectilePrefab = projectile; val.position = ((Ray)(ref aimRay)).origin; val.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction); val.owner = ((EntityState)this).gameObject; val.damage = damageCoefficient * ((EntityState)this).characterBody.damage; val.force = 0f; val.crit = ((BaseState)this).RollCrit(); val.damageTypeOverride = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)0), (DamageTypeExtended)0, (DamageSource)8); FireProjectileInfo val2 = val; ProjectileManager.instance.FireProjectile(val2); } } public override void Update() { //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_001f: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).Update(); if (fire) { Ray aimRay = ((BaseState)this).GetAimRay(); PlaceIndicator(aimRay); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!fire || (((EntityState)this).isAuthority && !((BaseSkillState)this).IsKeyDownAuthority())) { if (fire) { FireProjectile(); } stopwatch += Time.fixedDeltaTime; if (stopwatch >= baseDuration) { ((EntityState)this).outer.SetNextStateToMain(); } } } public override void OnExit() { ((EntityState)this).OnExit(); if (Object.op_Implicit((Object)(object)gun)) { gun.SetActive(true); } if (Object.op_Implicit((Object)(object)grenade)) { grenade.SetActive(false); } throwARCGrenades.Remove(((EntityState)this).gameObject); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } public class Hooks { [CompilerGenerated] private static class <>O { public static hook_HandleCascadingBuffs <0>__CharacterBody_HandleCascadingBuffs; public static hook_TakeDamageProcess <1>__HealthComponent_TakeDamageProcess; public static Action <2>__sus; } public static float MaxShortDamageMultipler => UntargetableConfig.shortDamageMultiplier.Value; public static float MaxShortDamageMaxMultipler => UntargetableConfig.shortDamageMaxMultiplier.Value; public static float MaxShortDamageTotal => UntargetableConfig.shortDamageTotalMultiplier.Value; public static float ShockingTimer => FireFlechetConfig.electrifyingTimer.Value; public static float ShockDuration => FireFlechetConfig.shockDuration.Value; public static int ShockAmmount => FireFlechetConfig.electrifyingAmount.Value; public static void SetHooks() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_001c: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Expected O, but got Unknown object obj = <>O.<0>__CharacterBody_HandleCascadingBuffs; if (obj == null) { hook_HandleCascadingBuffs val = CharacterBody_HandleCascadingBuffs; <>O.<0>__CharacterBody_HandleCascadingBuffs = val; obj = (object)val; } CharacterBody.HandleCascadingBuffs += (hook_HandleCascadingBuffs)obj; object obj2 = <>O.<1>__HealthComponent_TakeDamageProcess; if (obj2 == null) { hook_TakeDamageProcess val2 = HealthComponent_TakeDamageProcess; <>O.<1>__HealthComponent_TakeDamageProcess = val2; obj2 = (object)val2; } HealthComponent.TakeDamageProcess += (hook_TakeDamageProcess)obj2; RoR2Application.onLoadFinished = (Action)Delegate.Combine(RoR2Application.onLoadFinished, new Action(sus)); } private static void sus() { Language.Init(); } private static void HealthComponent_TakeDamageProcess(orig_TakeDamageProcess orig, HealthComponent self, DamageInfo damageInfo) { //IL_0101: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) CharacterBody val = (Object.op_Implicit((Object)(object)damageInfo.attacker) ? damageInfo.attacker.GetComponent<CharacterBody>() : null); if ((Object)(object)val != (Object)null) { List<TimedBuff> timedBuffs = val.timedBuffs; float num = 0f; int num2 = 0; for (int i = 0; i < timedBuffs.Count; i++) { TimedBuff val2 = timedBuffs[i]; if (val2 != null && val2.buffIndex == Assets.ShortDamage.buffIndex) { num2++; num += MathF.Min(val2.timer, MaxShortDamageMaxMultipler); } } num += (float)(val.GetBuffCount(Assets.ShortDamage) - num2) * MaxShortDamageMaxMultipler; damageInfo.damage *= Mathf.Max(Mathf.Min(1f + num, MaxShortDamageTotal), 1f); } orig.Invoke(self, damageInfo); if ((Object)(object)self.body == (Object)null || !DamageAPI.HasModdedDamageType(damageInfo, Assets.ShockingDamageType)) { return; } List<TimedBuff> timedBuffs2 = self.body.timedBuffs; foreach (TimedBuff item in timedBuffs2) { item.timer = item.totalDuration; } self.body.AddTimedBuff(Assets.Electrifying, ShockingTimer); } private static void CharacterBody_HandleCascadingBuffs(orig_HandleCascadingBuffs orig, CharacterBody self) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self); if (self.GetBuffCount(Assets.Electrifying) >= ShockAmmount) { SetStateOnHurt component = ((Component)self).GetComponent<SetStateOnHurt>(); if ((Object)(object)component != (Object)null) { component.SetShock(ShockDuration); } self.SetBuffCount(Assets.Electrifying.buffIndex, 0); } } } public class Language { public const string styleExit = "</style>"; public const string styleDamage = "<style=cIsDamage>"; public const string styleUtility = "<style=cIsUtility>"; public const string styleKeyword = "<style=cKeywordName>"; public const string styleSub = "<style=cSub>"; public static string UntargetableDesc => "While out of combat, turn <style=cIsUtility>invisible</style> and receive a small boost to <style=cIsUtility>movement speed</style> and <style=cIsDamage>damage</style>. <style=cIsDamage>Damage boost</style> persists after entering combat and lingers down."; public static string FireFlechetDesc => $"{"<style=cIsDamage>"}Electrifying{"</style>"}. Rapidly shoot an enemy for {"<style=cIsDamage>" + FireFlechetConfig.damageCoefficient.Value * 100f}% damage{"</style>"}. Fire rate and horizontal spread increases over time."; public static string TaserGoadDesc => $"{"<style=cIsDamage>"}Shocking{"</style>"}. Swing in front on enter for {"<style=cIsDamage>" + TaserGoadConfig.firstSwingDamageCoefficient.Value * 100f}% damage{"</style>"} and swing again on button release for {"<style=cIsDamage>" + TaserGoadConfig.secondSwingDamageCoefficient.Value * 100f}% damage{"</style>"}."; public static string HelmetSlamDesc => $"{"<style=cIsDamage>"}Stunning{"</style>"}. Jump up and slam down, dealing {"<style=cIsDamage>" + HelmetSlamConfig.damageCoefficient.Value * 100f}% damage{"</style>"} on impact. Movement speed is increased by {"<style=cIsUtility>" + HelmetSlamConfig.walkSpeedPenalty.Value * 100f}%{"</style>"} during slam attack."; public static string ThrowARCGrenadeDesc => $"{"<style=cIsDamage>"}Stunning{"</style>"}. Throw a grenade that explodes for {"<style=cIsDamage>" + ThrowARCGrenadeConfig.damageCoefficient.Value * 100f}% damage{"</style>"}."; public static string ElectrifyingDesc => $"{"<style=cKeywordName>"}Electrifying{"</style>"}{"<style=cSub>"}Hittting an enemy {FireFlechetConfig.electrifyingAmount.Value} times will apply {"<style=cIsDamage>"}Shock{"</style>"} for {FireFlechetConfig.shockDuration.Value} seconds{"</style>"}"; public static string UntargetableDescRu => "Вне опасности, обретите <style=cIsUtility>невидимость</style> и получите малый бонус к <style=cIsUtility>скорости передвижения</style> и <style=cIsDamage>урону</style>. <style=cIsDamage>Бонус к урону</style> остается после вхождения в бой, но бастро угасает."; public static string FireFlechetDescRu => $"{"<style=cIsDamage>"}Повышение Тока{"</style>"}. Быстро стреляет во врага и наносит {"<style=cIsDamage>" + FireFlechetConfig.damageCoefficient.Value * 100f}% урона{"</style>"}. Скорость атаки и горизонтальный разброс повышается со временем."; public static string TaserGoadDescRu => $"{"<style=cIsDamage>"}Разряд{"</style>"}. Взмахни вперёд нанося {"<style=cIsDamage>" + TaserGoadConfig.firstSwingDamageCoefficient.Value * 100f}% урона{"</style>"} и взмахни снова при отпускании кнопки нанося {"<style=cIsDamage>" + TaserGoadConfig.secondSwingDamageCoefficient.Value * 100f}% урона{"</style>"}."; public static string HelmetSlamDescRu => $"{"<style=cIsDamage>"}Оглушение{"</style>"}. Прыгни и взерни вниз, нанося {"<style=cIsDamage>" + HelmetSlamConfig.damageCoefficient.Value * 100f}% урона{"</style>"} при приземлении. Скорость передвижения увеличена в {"<style=cIsUtility>" + HelmetSlamConfig.walkSpeedPenalty.Value * 100f}%{"</style>"} во время падения."; public static string ThrowARCGrenadeDescRu => $"{"<style=cIsDamage>"}Оглушение{"</style>"}. После броска эта граната взрывается и наносит {"<style=cIsDamage>" + ThrowARCGrenadeConfig.damageCoefficient.Value * 100f}% урона{"</style>"}."; public static string ElectrifyingDescRu => $"{"<style=cKeywordName>"}Повышение Тока{{{"</style>"}{"<style=cSub>"}Ударив по врагу {FireFlechetConfig.electrifyingAmount.Value} раз враг {"<style=cIsDamage>"}Разрядится{"</style>"} на {FireFlechetConfig.shockDuration.Value} секунд{"</style>"}"; public static string ElectrifyingName => "KEYWORD_ELECTRIFYING"; public static void Init() { AddLanguageToken(Assets.Untargetable.skillNameToken, "Untargetable"); AddLanguageToken(Assets.Untargetable.skillNameToken, "Нецелевой", "ru"); AddLanguageToken(Assets.Untargetable.skillDescriptionToken, UntargetableDesc); AddLanguageToken(Assets.Untargetable.skillDescriptionToken, UntargetableDescRu, "ru"); AddLanguageToken(Assets.FireFlechet.skillNameToken, "Flechet"); AddLanguageToken(Assets.FireFlechet.skillNameToken, "Флешет", "ru"); AddLanguageToken(Assets.FireFlechet.skillDescriptionToken, FireFlechetDesc); AddLanguageToken(Assets.FireFlechet.skillDescriptionToken, FireFlechetDescRu, "ru"); AddLanguageToken(ElectrifyingName, ElectrifyingDesc); AddLanguageToken(ElectrifyingName, ElectrifyingDescRu, "ru"); FireFlechetConfig.damageCoefficient.SettingChanged += FireFlechetChangeSec; FireFlechetConfig.electrifyingAmount.SettingChanged += ShockingAmount_SettingChanged; FireFlechetConfig.shockDuration.SettingChanged += ShockingAmount_SettingChanged; AddLanguageToken(Assets.TaserGoad.skillNameToken, "Taser Goad"); AddLanguageToken(Assets.TaserGoad.skillNameToken, "Удар Электрошокером", "ru"); AddLanguageToken(Assets.TaserGoad.skillDescriptionToken, TaserGoadDesc); AddLanguageToken(Assets.TaserGoad.skillDescriptionToken, TaserGoadDescRu, "ru"); TaserGoadConfig.firstSwingDamageCoefficient.SettingChanged += TaserGoadChangeDesc; TaserGoadConfig.secondSwingDamageCoefficient.SettingChanged += TaserGoadChangeDesc; AddLanguageToken(Assets.HelmetSlam.skillNameToken, "Dome Helmet Slam"); AddLanguageToken(Assets.HelmetSlam.skillNameToken, "Грохот Купольным Шлемом", "Ru"); AddLanguageToken(Assets.HelmetSlam.skillDescriptionToken, HelmetSlamDesc); AddLanguageToken(Assets.HelmetSlam.skillDescriptionToken, HelmetSlamDescRu, "ru"); HelmetSlamConfig.damageCoefficient.SettingChanged += HelmetSlamChangeDesc; HelmetSlamConfig.walkSpeedPenalty.SettingChanged += HelmetSlamChangeDesc; AddLanguageToken(Assets.ThrowARCGrenade.skillNameToken, "ARC Grenade"); AddLanguageToken(Assets.ThrowARCGrenade.skillNameToken, "ARC Граната", "ru"); AddLanguageToken(Assets.ThrowARCGrenade.skillDescriptionToken, ThrowARCGrenadeDesc); AddLanguageToken(Assets.ThrowARCGrenade.skillDescriptionToken, ThrowARCGrenadeDescRu, "ru"); ThrowARCGrenadeConfig.damageCoefficient.SettingChanged += ThrowARCGrenadeChangeDesc; AddLanguageToken(Assets.SicarianInfiltratorBodyComponent.baseNameToken, "Sicarian Infiltrator"); AddLanguageToken(Assets.SicarianInfiltratorBodyComponent.baseNameToken, "Сикариан Диверсант", "ru"); AddLanguageToken(Assets.SicarianInfiltratorBodyComponent.subtitleNameToken, "Sinister Warrior"); AddLanguageToken(Assets.SicarianInfiltratorBodyComponent.subtitleNameToken, "Мрачный Воин", "ru"); AddLanguageToken(Assets.SicarianInfiltratorSurvivor.descriptionToken, "Sicarian Infiltrator is a stealthy and swift character that is reliable in all situations of the game. <style=cSub>\r\n\r\n< ! > Untargetable makes you invisible while out of combat and provides a small boost to movement speed and damage. Use it to ambush enemies!.\r\n\r\n< ! > Flechet is powerful at both short and long range, firing quickly, shocking enemies and activating many item effects.\r\n\r\n< ! > Dome Helmet Slam is both an excelent ability for fast movement and daamaging a group of enemies.\r\n\r\n< ! > ARC Grenade can be used to heavily damage and stun a group of enemies.\r\n\r\n< ! > Taser Goad slashes through enemy groups and shocks them, while giving short invincibility duration and small armor boost, use it to your advantage!\r\n</style>\r\n"); AddLanguageToken(Assets.SicarianInfiltratorSurvivor.descriptionToken, "Сикариан Десантник — быстрый и скрытный персонаж. На него можно положиться в любой игровой ситуации. <style=cSub>\r\n\r\n< ! > Нецелевой делает обладателя невидимым вне опасности и дает небольшой бонус к скорости передвижению и урону.\r\n\r\n< ! > Флешет хорош и на коротких, и на длинных дистанциях. Этот быстрый навык, который разряжает врагов и активирует множество эффектов от предметов.\r\n\r\n< ! > Грохот купольным шлемом это отличный навык для передвижения и нанесения урона по группе врагов.\r\n\r\n< ! > ARC Граната может быть использована чтобы наносить тяжелый урона и останавливать группу врагов.\r\n\r\n< ! > Удар Электрошокером разрезает врагов и разряжает их, выдавая атакующему неуязвимость на короткое время и маленбкий бонус к броне на протяжении всего приема!\r\n</style>\r\n", "ru"); AddLanguageToken(Assets.SicarianInfiltratorSurvivor.displayNameToken, "Sicarian Infiltrator"); AddLanguageToken(Assets.SicarianInfiltratorSurvivor.displayNameToken, "Сикариан Диверсант", "ru"); AddLanguageToken(Assets.SicarianInfiltratorSurvivor.displayNameToken, "Sicarian Infiltrator"); AddLanguageToken(Assets.SicarianInfiltratorBodyComponent.baseNameToken.Replace("_NAME", "_OUTRO"), "..and so he left, as he found a way to return to his Adeptus Master."); AddLanguageToken(Assets.SicarianInfiltratorBodyComponent.baseNameToken.Replace("_NAME", "_OUTRO"), "...и он ушел, найдя путь вернуться к его Адептусу Мастеру.", "ru"); AddLanguageToken(Assets.SicarianInfiltratorBodyComponent.baseNameToken.Replace("_NAME", "_FAIL"), "..and so he vanished, as he couldn't manage to return to his Adeptus Master."); AddLanguageToken(Assets.SicarianInfiltratorBodyComponent.baseNameToken.Replace("_NAME", "_FAIL"), "...и он исчез, не найдя путь вернуться к его Адептусу Мастеру.", "ru"); AddLanguageToken(Assets.SicarianInfiltratorBodyComponent.baseNameToken.Replace("_NAME", "_LORE"), "A Sicarian Infiltrator is a member of perhaps the most sinister of the Adeptus Mechanicus' Skitarii warrior clades, for their neurostatic bombardment robs their victims of their senses. When hunting, they emit a white noise that fills the visual, auditory and even olfactory spectrums with static, leaving their foes all but helpless before the killing begins.\r\n\r\nTall and slender, Sicarian Infiltrators pick their way across the battlefield with the stilted grace of spearfisher birds. They were not always this way, however, for each Sicarian is far from whole -- not in spirit, nor in body.\r\n\r\nAs with their Ruststalker brethren, every Sicarian Infiltrator was once a warrior of the Skitarii who, in the pursuance of the Cult Mechanicus' agenda, was blasted limb from limb, extensively burned or otherwise dismembered. During the data-harvest at a battle's end, if these fallen are judged still fit to serve the Omnissiah, they are not incinerated but instead taken back to the augmetic slabs.\r\n\r\nThere they are given a new lease on life by the addition of slender but powerful metal limbs. Technically speaking, all the Magi Biologis need to create a Sicarian is a head, a torso and some limb stumps, though a detachment from emotion and a knack for inspiring fear is vital for the best results.\r\n\r\nWith such awesome power at their command, it is tempting for Sicarian Infiltrators to employ their neurostatic off the battlefield, against uncooperative Imperial citizens. This escalation often leads to unnecessary complications, and Infiltrators must struggle to reconnect with their dwindling shreds of Humanity and discover less direct ways to achieve their aims.\r\n\r\n\r\nContents\r\n1\tRole\r\n1.1\tNotable Formations\r\n2\tUnit Composition\r\n3\tWargear\r\n4\tSources\r\n5\tGallery\r\nRole\r\nSicarian Infiltrator\r\nThis Sicarian Infiltrator stands ready to face the foes of the Machine God.\r\n\r\nAn Infiltrator can bypass enemy defences with ease, though this ability owes nothing to stealth, nor skill. Instead it hinges upon the potency and variety of the disruptive wavelengths they broadcast from their domed helms and jutting antennae.\r\n\r\nWhen the Infiltrators approach, their prey's every sensory apparatus is bombarded by overwhelming stimuli. Vox-casters howl with anguished feedback whilst vid-screens craze with fizzing static. Yet this crippling electromagnetic assault is even more effective upon natural senses than artificial ones.\r\n\r\nEars ring with cruel tinnitus, eyes water and turn red, and the taste of burnt metal fills the mouth. It is all the Infiltrators' victims can do to remember how to breathe. As their prey clasps hands over bleeding ears and screws shut bloodshot eyes, the Sicarian Infiltrators simply walk into point-blank range and open fire.\r\n\r\nThis sensory assault, though broad in spectrum, is calibrated precisely by the tech-priest sanctioning these macabre assassins. Those Skitarii sent to fight alongside the Infiltrators are given null codes that transmute the frequencies into harmless song; to them, the constant barrarge of neurostatic coming from each domed helmet is nothing more than a soft psalm to the Omnissiah's glory.\r\n\r\nFor this reason Infitrators are seen as wise and holy heroes by their Skitarii brethren, talismans against data corruption that fight a selfless war on the front line. Only to the enemy is truth revealed. There is little virtue left inside these merciless prowlers, and what personality remains is interested only in death.\r\n\r\nNotable Formations\r\nSicarian Killclade - The vile hissing that accompanies a Sicarian Killclade on the hunt gnaws at the mind. When the stomach-churning hum of transonic weaponry mingles with the mind numbing aura of an Infiltrator assault, its effect can be magnified, leaving those brave or foolish enough to stand their ground all but crippled. The sight of their foes reeling from their approach fills the Sicarians with righteous faith, readying them for the hyperaction imperatives their masters inload as they near the foe. At an unspoken command, the Sicarian Ruststalkers of the Killclade will burst from concealment like hunter-arachnids. Their Transonic Weapons flash azure as they plunge headlong into the foe with reckless haste, then gory red as the butchery begins. A Sicarian Killclade typically consists of three squads of Sicarian Ruststalkers accompanied by a single squad of Sicarian Infiltrators.\r\nUnit Composition\r\n4-9 Sicarian Infiltrators\r\n1 Infiltrator Princeps\r\nWargear\r\nAs standard, all Sicarian Infiltrators are armed with:\r\n\r\nSicarian Battle Armour - As agility is of paramount importance to the long-limbed killers of the Sicarian brotherhood, Sicarian Infiltrators go to war clad in Sicarian Battle Armour. This is made up of a multi-layered alloy that, though thin and flexible, provides admirable physical protection. This alloy, informally known as aegium, acts as a capacitor that harnesses the energy of incoming attacks and disperses it harmlessly across the wearers bionic frame.\r\nStubcarbine - A Stubcarbine, though compact, has the stopping power of the Heavy Stubbers mounted on the tanks of the Astra Militarum. When a squad of Sicarians opens fire with these weapons, the air fills with a storm of solid shot that chews their victims to ruin.\r\nPower Sword - A Power Weapon is sheathed in the lethal haze of a disruptive energy field that eats through armour, flesh and bone with ease.\r\nAll members of a Sicarian Infiltrator squad can choose to replace their Stubcarbine and Power Sword with:\r\n\r\nFlechette Blaster - A Flechette Blaster is a lightweight but lethal weapon, a favoured tool of Sicarian Infiltrators. It fires hundreds of tiny darts, each of which bears a dormant cerebral cell awakened in the gun's chamber. Where one dart hits home, it emits a bioelectric pulse that attracts others, resulting in a series of impacts that burrow through bone.\r\nTaser Goad - Powered by hyperdynamo capacitors, Taser Weapons store an incredible amount of potential energy. A solid impact will cause this energy to be discharged in a scorching blast, only to be harnessed once more by the electrothief prongs at the weapon's tip.\r\nOptional wargear that an Infiltrator Princeps can take include:\r\n\r\nInfoslave Skull - The dextrous skull-and-digit adjutants that accompany senior Skitarii record hard data at a prolific rate. To know their findings are recorded and reported back is a great boon to the Skitarii, who draw courage and strength from the fact their sacrifices will not be in vain.\r\nRelics of Mars - Relics of Mars are items of terrifying power that are sometimes bestowed upon a Skitarii Alpha or Sicarian Princeps by a senior tech-priest for them to field test.\r\nSpecial Issue Wargear - Elite Skitarii warriors have the right to bear special issue wargear into battle, which can include either a Conversion Field or Refractor Field, and Digital Weapons.\r\nSources\r\nCodex: Adeptus Mechanicus (8th Edition), pp. 51, 79\r\nCodex: Adeptus Mechanicus - Skitarii (7th Edition), pp. 28, 32, 34-39, 60, 66\r\nWrath & Glory: Forsaken System Player Guide (RPG), pg. 110"); static void FireFlechetChangeSec(object sender, EventArgs e) { AddLanguageToken(Assets.FireFlechet.skillDescriptionToken, FireFlechetDesc); AddLanguageToken(Assets.FireFlechet.skillDescriptionToken, FireFlechetDescRu, "ru"); } static void HelmetSlamChangeDesc(object sender, EventArgs e) { AddLanguageToken(Assets.HelmetSlam.skillDescriptionToken, HelmetSlamDesc); AddLanguageToken(Assets.HelmetSlam.skillDescriptionToken, HelmetSlamDescRu, "ru"); } static void ShockingAmount_SettingChanged(object sender, EventArgs e) { AddLanguageToken(ElectrifyingName, ElectrifyingDesc); AddLanguageToken(ElectrifyingName, ElectrifyingDescRu, "ru"); } static void TaserGoadChangeDesc(object sender, EventArgs e) { AddLanguageToken(Assets.TaserGoad.skillDescriptionToken, TaserGoadDesc); AddLanguageToken(Assets.TaserGoad.skillDescriptionToken, TaserGoadDescRu, "ru"); } static void ThrowARCGrenadeChangeDesc(object sender, EventArgs e) { AddLanguageToken(Assets.ThrowARCGrenade.skillNameToken, ThrowARCGrenadeDesc); AddLanguageToken(Assets.ThrowARCGrenade.skillNameToken, ThrowARCGrenadeDescRu, "ru"); } } public static void AddLanguageToken(string token, string output, string language) { Debug.Log((object)("Adding token: " + token + "\nWith output: " + output + "\nTo language: " + language)); Dictionary<string, string> dictionary = (Language.languagesByName.ContainsKey(language) ? Language.languagesByName[language].stringsByToken : null); Debug.Log((object)dictionary); if (dictionary != null) { if (dictionary.ContainsKey(token)) { dictionary[token] = output; } else { dictionary.Add(token, output); } } } public static void AddLanguageToken(string token, string output) { AddLanguageToken(token, output, "en"); } } [Serializable] [BepInPlugin("com.brynzananas.sicarianinfiltrator", "Sicarian Infiltrator", "1.0.0")] [BepInDependency("com.bepis.r2api", "5.1.5")] [BepInDependency("com.bepis.r2api.damagetype", "1.0.4")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class Main : BaseUnityPlugin { [Serializable] [CompilerGenerated] private sealed class <>c { public static readonly <>c <>9 = new <>c(); public static CollectContentPackProvidersDelegate <>9__13_0; internal void <Awake>b__13_0(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)new ContentPacks()); } } public const string ModGuid = "com.brynzananas.sicarianinfiltrator"; public const string ModName = "Sicarian Infiltrator"; public const string ModVer = "1.0.0"; public static bool emotesEnabled; public static bool riskOfOptionsEnabled; public static PluginInfo PluginInfo { get; private set; } public static ConfigFile configFile { get; private set; } public void Awake() { //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_008a: Expected O, but got Unknown PluginInfo = ((BaseUnityPlugin)this).Info; configFile = ((BaseUnityPlugin)this).Config; emotesEnabled = Chainloader.PluginInfos.ContainsKey("com.weliveinasociety.CustomEmotesAPI"); riskOfOptionsEnabled = Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"); Assets.Init(); Hooks.SetHooks(); new FireFlechetConfig(); new TaserGoadConfig(); new HelmetSlamConfig(); new ThrowARCGrenadeConfig(); new UntargetableConfig(); object obj = <>c.<>9__13_0; if (obj == null) { CollectContentPackProvidersDelegate val = delegate(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)new ContentPacks()); }; <>c.<>9__13_0 = val; obj = (object)val; } ContentManager.collectContentPackProviders += (CollectContentPackProvidersDelegate)obj; } } public class ModCompatabilities { public class EmoteCompatability { [CompilerGenerated] private static class <>O { public static AnimationChanged <0>__CustomEmotesAPI_animChanged; } public const string GUID = "com.weliveinasociety.CustomEmotesAPI"; public static void Init() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Expected O, but got Unknown CustomEmotesAPI.ImportArmature(Assets.SicarianInfiltratorBody, Assets.SicarianInfiltratorEmote, 0, true); Assets.SicarianInfiltratorEmote.GetComponent<BoneMapper>().scale = 1f; object obj = <>O.<0>__CustomEmotesAPI_animChanged; if (obj == null) { AnimationChanged val = CustomEmotesAPI_animChanged; <>O.<0>__CustomEmotesAPI_animChanged = val; obj = (object)val; } CustomEmotesAPI.animChanged += (AnimationChanged)obj; } private static void CustomEmotesAPI_animChanged(string newAnimation, BoneMapper mapper) { if (!(((Object)mapper).name == "SicarianInfiltratorEmote")) { return; } ChildLocator component = ((Component)((Component)mapper).transform.parent).GetComponent<ChildLocator>(); if (!Object.op_Implicit((Object)(object)component)) { return; } if (newAnimation == "none") { Transform obj = component.FindChild("Gun"); if (obj != null) { ((Component)obj).gameObject.SetActive(true); } Transform obj2 = component.FindChild("TaserGoad"); if (obj2 != null) { ((Component)obj2).gameObject.SetActive(true); } } else { Transform obj3 = component.FindChild("Gun"); if (obj3 != null) { ((Component)obj3).gameObject.SetActive(false); } Transform obj4 = component.FindChild("TaserGoad"); if (obj4 != null) { ((Component)obj4).gameObject.SetActive(false); } } } } public class RiskOfOptionsCompatability { public const string GUID = "com.rune580.riskofoptions"; public static void AddConfig<T>(ConfigEntry<T> config) { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Expected O, but got Unknown //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Expected O, but got Unknown //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Expected O, but got Unknown //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Expected O, but got Unknown //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Expected O, but got Unknown if (config is ConfigEntry<float>) { ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(config as ConfigEntry<float>)); } if (config is ConfigEntry<bool>) { ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(config as ConfigEntry<bool>)); } if (config is ConfigEntry<int>) { ModSettingsManager.AddOption((BaseOption)new IntFieldOption(config as ConfigEntry<int>)); } if (config is ConfigEntry<string>) { ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(config as ConfigEntry<string>)); } if (typeof(T).IsEnum) { ModSettingsManager.AddOption((BaseOption)new ChoiceOption((ConfigEntryBase)(object)config)); } } } } public class Utils { public class SkillDefCreator { public Type state; public string activationState; public Sprite sprite; public string name; public string nameToken; public string descToken; public string[] keywordsTokens; public int maxStocks = 1; public float rechargeInterval; public bool beginSkillCooldownOnSkillEnd = true; public bool canceledFromSprinting; public bool cancelSprinting = true; public bool fullRestockOnAssign = true; public InterruptPriority interruptPriority = (InterruptPriority)0; public bool isCombat; public bool mustKeyPress; public int requiredStock; public int rechargeStock; public int stockToConsume; public SkillFamily skillFamily; public bool resetCooldownTimerOnUse; } public static T AddSkill<T>(SkillDefCreator skillDefCreator) where T : SkillDef { //IL_0050: Unknown result type (might be due to invalid IL or missing references) return AddSkill<T>(skillDefCreator.state, skillDefCreator.activationState, skillDefCreator.sprite, skillDefCreator.name, skillDefCreator.nameToken, skillDefCreator.descToken, skillDefCreator.keywordsTokens, skillDefCreator.maxStocks, skillDefCreator.rechargeInterval, skillDefCreator.beginSkillCooldownOnSkillEnd, skillDefCreator.canceledFromSprinting, skillDefCreator.cancelSprinting, skillDefCreator.fullRestockOnAssign, skillDefCreator.interruptPriority, skillDefCreator.isCombat, skillDefCreator.mustKeyPress, skillDefCreator.requiredStock, skillDefCreator.rechargeStock, skillDefCreator.stockToConsume, skillDefCreator.skillFamily, skillDefCreator.beginSkillCooldownOnSkillEnd); } public static T AddSkill<T>(Type state, string activationState, Sprite sprite, string name, string nameToken, string descToken, string[] keywordTokens, int maxStocks, float rechargeInterval, bool beginSkillCooldownOnSkillEnd, bool canceledFromSprinting, bool cancelSprinting, bool fullRestockOnAssign, InterruptPriority interruptPriority, bool isCombat, bool mustKeyPress, int requiredStock, int rechargeStock, int stockToConsume, SkillFamily skillFamily, bool resetCooldownTimerOnUse = false) where T : SkillDef { //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_008c: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) GameObject sicarianInfiltratorBody = Assets.SicarianInfiltratorBody; T val = ScriptableObject.CreateInstance<T>(); SkillsAPI.SetBonusStockMultiplier((SkillDef)(object)val, maxStocks); ((SkillDef)val).activationState = new SerializableEntityStateType(state); ((SkillDef)val).activationStateMachineName = activationState; ((SkillDef)val).baseMaxStock = maxStocks; ((SkillDef)val).baseRechargeInterval = rechargeInterval; ((SkillDef)val).beginSkillCooldownOnSkillEnd = beginSkillCooldownOnSkillEnd; ((SkillDef)val).canceledFromSprinting = canceledFromSprinting; ((SkillDef)val).cancelSprintingOnActivation = cancelSprinting; ((SkillDef)val).fullRestockOnAssign = fullRestockOnAssign; ((SkillDef)val).interruptPriority = interruptPriority; ((SkillDef)val).isCombatSkill = isCombat; ((SkillDef)val).mustKeyPress = mustKeyPress; ((SkillDef)val).rechargeStock = rechargeStock; ((SkillDef)val).requiredStock = requiredStock; ((SkillDef)val).stockToConsume = stockToConsume;