using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Configuration;
using HarmonyLib;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = ".NET Framework 4.6")]
[assembly: AssemblyCompany("RavenCameraFX")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("RavenCameraFX")]
[assembly: AssemblyTitle("RavenCameraFX")]
[assembly: AssemblyVersion("1.0.0.0")]
public static class EasingFunction
{
public enum Ease
{
EaseInQuad,
EaseOutQuad,
EaseInOutQuad,
EaseInCubic,
EaseOutCubic,
EaseInOutCubic,
EaseInQuart,
EaseOutQuart,
EaseInOutQuart,
EaseInQuint,
EaseOutQuint,
EaseInOutQuint,
EaseInSine,
EaseOutSine,
EaseInOutSine,
EaseInExpo,
EaseOutExpo,
EaseInOutExpo,
EaseInCirc,
EaseOutCirc,
EaseInOutCirc,
Linear,
Spring,
EaseInBounce,
EaseOutBounce,
EaseInOutBounce,
EaseInBack,
EaseOutBack,
EaseInOutBack,
EaseInElastic,
EaseOutElastic,
EaseInOutElastic
}
public delegate float Function(float s, float e, float v);
private const float NATURAL_LOG_OF_2 = 0.6931472f;
public static float Linear(float start, float end, float value)
{
return Mathf.Lerp(start, end, value);
}
public static float Spring(float start, float end, float value)
{
value = Mathf.Clamp01(value);
value = (Mathf.Sin(value * (float)Math.PI * (0.2f + 2.5f * value * value * value)) * Mathf.Pow(1f - value, 2.2f) + value) * (1f + 1.2f * (1f - value));
return start + (end - start) * value;
}
public static float EaseInQuad(float start, float end, float value)
{
end -= start;
return end * value * value + start;
}
public static float EaseOutQuad(float start, float end, float value)
{
end -= start;
return (0f - end) * value * (value - 2f) + start;
}
public static float EaseInOutQuad(float start, float end, float value)
{
value /= 0.5f;
end -= start;
if (value < 1f)
{
return end * 0.5f * value * value + start;
}
value -= 1f;
return (0f - end) * 0.5f * (value * (value - 2f) - 1f) + start;
}
public static float EaseInCubic(float start, float end, float value)
{
end -= start;
return end * value * value * value + start;
}
public static float EaseOutCubic(float start, float end, float value)
{
value -= 1f;
end -= start;
return end * (value * value * value + 1f) + start;
}
public static float EaseInOutCubic(float start, float end, float value)
{
value /= 0.5f;
end -= start;
if (value < 1f)
{
return end * 0.5f * value * value * value + start;
}
value -= 2f;
return end * 0.5f * (value * value * value + 2f) + start;
}
public static float EaseInQuart(float start, float end, float value)
{
end -= start;
return end * value * value * value * value + start;
}
public static float EaseOutQuart(float start, float end, float value)
{
value -= 1f;
end -= start;
return (0f - end) * (value * value * value * value - 1f) + start;
}
public static float EaseInOutQuart(float start, float end, float value)
{
value /= 0.5f;
end -= start;
if (value < 1f)
{
return end * 0.5f * value * value * value * value + start;
}
value -= 2f;
return (0f - end) * 0.5f * (value * value * value * value - 2f) + start;
}
public static float EaseInQuint(float start, float end, float value)
{
end -= start;
return end * value * value * value * value * value + start;
}
public static float EaseOutQuint(float start, float end, float value)
{
value -= 1f;
end -= start;
return end * (value * value * value * value * value + 1f) + start;
}
public static float EaseInOutQuint(float start, float end, float value)
{
value /= 0.5f;
end -= start;
if (value < 1f)
{
return end * 0.5f * value * value * value * value * value + start;
}
value -= 2f;
return end * 0.5f * (value * value * value * value * value + 2f) + start;
}
public static float EaseInSine(float start, float end, float value)
{
end -= start;
return (0f - end) * Mathf.Cos(value * ((float)Math.PI / 2f)) + end + start;
}
public static float EaseOutSine(float start, float end, float value)
{
end -= start;
return end * Mathf.Sin(value * ((float)Math.PI / 2f)) + start;
}
public static float EaseInOutSine(float start, float end, float value)
{
end -= start;
return (0f - end) * 0.5f * (Mathf.Cos((float)Math.PI * value) - 1f) + start;
}
public static float EaseInExpo(float start, float end, float value)
{
end -= start;
return end * Mathf.Pow(2f, 10f * (value - 1f)) + start;
}
public static float EaseOutExpo(float start, float end, float value)
{
end -= start;
return end * (0f - Mathf.Pow(2f, -10f * value) + 1f) + start;
}
public static float EaseInOutExpo(float start, float end, float value)
{
value /= 0.5f;
end -= start;
if (value < 1f)
{
return end * 0.5f * Mathf.Pow(2f, 10f * (value - 1f)) + start;
}
value -= 1f;
return end * 0.5f * (0f - Mathf.Pow(2f, -10f * value) + 2f) + start;
}
public static float EaseInCirc(float start, float end, float value)
{
end -= start;
return (0f - end) * (Mathf.Sqrt(1f - value * value) - 1f) + start;
}
public static float EaseOutCirc(float start, float end, float value)
{
value -= 1f;
end -= start;
return end * Mathf.Sqrt(1f - value * value) + start;
}
public static float EaseInOutCirc(float start, float end, float value)
{
value /= 0.5f;
end -= start;
if (value < 1f)
{
return (0f - end) * 0.5f * (Mathf.Sqrt(1f - value * value) - 1f) + start;
}
value -= 2f;
return end * 0.5f * (Mathf.Sqrt(1f - value * value) + 1f) + start;
}
public static float EaseInBounce(float start, float end, float value)
{
end -= start;
float num = 1f;
return end - EaseOutBounce(0f, end, num - value) + start;
}
public static float EaseOutBounce(float start, float end, float value)
{
value /= 1f;
end -= start;
if (value < 0.36363637f)
{
return end * (7.5625f * value * value) + start;
}
if (value < 0.72727275f)
{
value -= 0.54545456f;
return end * (7.5625f * value * value + 0.75f) + start;
}
if ((double)value < 0.9090909090909091)
{
value -= 0.8181818f;
return end * (7.5625f * value * value + 0.9375f) + start;
}
value -= 21f / 22f;
return end * (7.5625f * value * value + 63f / 64f) + start;
}
public static float EaseInOutBounce(float start, float end, float value)
{
end -= start;
float num = 1f;
if (value < num * 0.5f)
{
return EaseInBounce(0f, end, value * 2f) * 0.5f + start;
}
return EaseOutBounce(0f, end, value * 2f - num) * 0.5f + end * 0.5f + start;
}
public static float EaseInBack(float start, float end, float value)
{
end -= start;
value /= 1f;
float num = 1.70158f;
return end * value * value * ((num + 1f) * value - num) + start;
}
public static float EaseOutBack(float start, float end, float value)
{
float num = 1.70158f;
end -= start;
value -= 1f;
return end * (value * value * ((num + 1f) * value + num) + 1f) + start;
}
public static float EaseInOutBack(float start, float end, float value)
{
float num = 1.70158f;
end -= start;
value /= 0.5f;
if (value < 1f)
{
num *= 1.525f;
return end * 0.5f * (value * value * ((num + 1f) * value - num)) + start;
}
value -= 2f;
num *= 1.525f;
return end * 0.5f * (value * value * ((num + 1f) * value + num) + 2f) + start;
}
public static float EaseInElastic(float start, float end, float value)
{
end -= start;
float num = 1f;
float num2 = num * 0.3f;
float num3 = 0f;
if (value == 0f)
{
return start;
}
if ((value /= num) == 1f)
{
return start + end;
}
float num4;
if (num3 == 0f || num3 < Mathf.Abs(end))
{
num3 = end;
num4 = num2 / 4f;
}
else
{
num4 = num2 / ((float)Math.PI * 2f) * Mathf.Asin(end / num3);
}
return 0f - num3 * Mathf.Pow(2f, 10f * (value -= 1f)) * Mathf.Sin((value * num - num4) * ((float)Math.PI * 2f) / num2) + start;
}
public static float EaseOutElastic(float start, float end, float value)
{
end -= start;
float num = 1f;
float num2 = num * 0.3f;
float num3 = 0f;
if (value == 0f)
{
return start;
}
if ((value /= num) == 1f)
{
return start + end;
}
float num4;
if (num3 == 0f || num3 < Mathf.Abs(end))
{
num3 = end;
num4 = num2 * 0.25f;
}
else
{
num4 = num2 / ((float)Math.PI * 2f) * Mathf.Asin(end / num3);
}
return num3 * Mathf.Pow(2f, -10f * value) * Mathf.Sin((value * num - num4) * ((float)Math.PI * 2f) / num2) + end + start;
}
public static float EaseInOutElastic(float start, float end, float value)
{
end -= start;
float num = 1f;
float num2 = num * 0.3f;
float num3 = 0f;
if (value == 0f)
{
return start;
}
if ((value /= num * 0.5f) == 2f)
{
return start + end;
}
float num4;
if (num3 == 0f || num3 < Mathf.Abs(end))
{
num3 = end;
num4 = num2 / 4f;
}
else
{
num4 = num2 / ((float)Math.PI * 2f) * Mathf.Asin(end / num3);
}
if (value < 1f)
{
return -0.5f * (num3 * Mathf.Pow(2f, 10f * (value -= 1f)) * Mathf.Sin((value * num - num4) * ((float)Math.PI * 2f) / num2)) + start;
}
return num3 * Mathf.Pow(2f, -10f * (value -= 1f)) * Mathf.Sin((value * num - num4) * ((float)Math.PI * 2f) / num2) * 0.5f + end + start;
}
public static float LinearD(float start, float end, float value)
{
return end - start;
}
public static float EaseInQuadD(float start, float end, float value)
{
return 2f * (end - start) * value;
}
public static float EaseOutQuadD(float start, float end, float value)
{
end -= start;
return (0f - end) * value - end * (value - 2f);
}
public static float EaseInOutQuadD(float start, float end, float value)
{
value /= 0.5f;
end -= start;
if (value < 1f)
{
return end * value;
}
value -= 1f;
return end * (1f - value);
}
public static float EaseInCubicD(float start, float end, float value)
{
return 3f * (end - start) * value * value;
}
public static float EaseOutCubicD(float start, float end, float value)
{
value -= 1f;
end -= start;
return 3f * end * value * value;
}
public static float EaseInOutCubicD(float start, float end, float value)
{
value /= 0.5f;
end -= start;
if (value < 1f)
{
return 1.5f * end * value * value;
}
value -= 2f;
return 1.5f * end * value * value;
}
public static float EaseInQuartD(float start, float end, float value)
{
return 4f * (end - start) * value * value * value;
}
public static float EaseOutQuartD(float start, float end, float value)
{
value -= 1f;
end -= start;
return -4f * end * value * value * value;
}
public static float EaseInOutQuartD(float start, float end, float value)
{
value /= 0.5f;
end -= start;
if (value < 1f)
{
return 2f * end * value * value * value;
}
value -= 2f;
return -2f * end * value * value * value;
}
public static float EaseInQuintD(float start, float end, float value)
{
return 5f * (end - start) * value * value * value * value;
}
public static float EaseOutQuintD(float start, float end, float value)
{
value -= 1f;
end -= start;
return 5f * end * value * value * value * value;
}
public static float EaseInOutQuintD(float start, float end, float value)
{
value /= 0.5f;
end -= start;
if (value < 1f)
{
return 2.5f * end * value * value * value * value;
}
value -= 2f;
return 2.5f * end * value * value * value * value;
}
public static float EaseInSineD(float start, float end, float value)
{
return (end - start) * 0.5f * (float)Math.PI * Mathf.Sin((float)Math.PI / 2f * value);
}
public static float EaseOutSineD(float start, float end, float value)
{
end -= start;
return (float)Math.PI / 2f * end * Mathf.Cos(value * ((float)Math.PI / 2f));
}
public static float EaseInOutSineD(float start, float end, float value)
{
end -= start;
return end * 0.5f * (float)Math.PI * Mathf.Sin((float)Math.PI * value);
}
public static float EaseInExpoD(float start, float end, float value)
{
return 6.931472f * (end - start) * Mathf.Pow(2f, 10f * (value - 1f));
}
public static float EaseOutExpoD(float start, float end, float value)
{
end -= start;
return 3.465736f * end * Mathf.Pow(2f, 1f - 10f * value);
}
public static float EaseInOutExpoD(float start, float end, float value)
{
value /= 0.5f;
end -= start;
if (value < 1f)
{
return 3.465736f * end * Mathf.Pow(2f, 10f * (value - 1f));
}
value -= 1f;
return 3.465736f * end / Mathf.Pow(2f, 10f * value);
}
public static float EaseInCircD(float start, float end, float value)
{
return (end - start) * value / Mathf.Sqrt(1f - value * value);
}
public static float EaseOutCircD(float start, float end, float value)
{
value -= 1f;
end -= start;
return (0f - end) * value / Mathf.Sqrt(1f - value * value);
}
public static float EaseInOutCircD(float start, float end, float value)
{
value /= 0.5f;
end -= start;
if (value < 1f)
{
return end * value / (2f * Mathf.Sqrt(1f - value * value));
}
value -= 2f;
return (0f - end) * value / (2f * Mathf.Sqrt(1f - value * value));
}
public static float EaseInBounceD(float start, float end, float value)
{
end -= start;
float num = 1f;
return EaseOutBounceD(0f, end, num - value);
}
public static float EaseOutBounceD(float start, float end, float value)
{
value /= 1f;
end -= start;
if (value < 0.36363637f)
{
return 2f * end * 7.5625f * value;
}
if (value < 0.72727275f)
{
value -= 0.54545456f;
return 2f * end * 7.5625f * value;
}
if ((double)value < 0.9090909090909091)
{
value -= 0.8181818f;
return 2f * end * 7.5625f * value;
}
value -= 21f / 22f;
return 2f * end * 7.5625f * value;
}
public static float EaseInOutBounceD(float start, float end, float value)
{
end -= start;
float num = 1f;
if (value < num * 0.5f)
{
return EaseInBounceD(0f, end, value * 2f) * 0.5f;
}
return EaseOutBounceD(0f, end, value * 2f - num) * 0.5f;
}
public static float EaseInBackD(float start, float end, float value)
{
float num = 1.70158f;
return 3f * (num + 1f) * (end - start) * value * value - 2f * num * (end - start) * value;
}
public static float EaseOutBackD(float start, float end, float value)
{
float num = 1.70158f;
end -= start;
value -= 1f;
return end * ((num + 1f) * value * value + 2f * value * ((num + 1f) * value + num));
}
public static float EaseInOutBackD(float start, float end, float value)
{
float num = 1.70158f;
end -= start;
value /= 0.5f;
if (value < 1f)
{
num *= 1.525f;
return 0.5f * end * (num + 1f) * value * value + end * value * ((num + 1f) * value - num);
}
value -= 2f;
num *= 1.525f;
return 0.5f * end * ((num + 1f) * value * value + 2f * value * ((num + 1f) * value + num));
}
public static float EaseInElasticD(float start, float end, float value)
{
return EaseOutElasticD(start, end, 1f - value);
}
public static float EaseOutElasticD(float start, float end, float value)
{
end -= start;
float num = 1f;
float num2 = num * 0.3f;
float num3 = 0f;
float num4;
if (num3 == 0f || num3 < Mathf.Abs(end))
{
num3 = end;
num4 = num2 * 0.25f;
}
else
{
num4 = num2 / ((float)Math.PI * 2f) * Mathf.Asin(end / num3);
}
return num3 * (float)Math.PI * num * Mathf.Pow(2f, 1f - 10f * value) * Mathf.Cos((float)Math.PI * 2f * (num * value - num4) / num2) / num2 - 3.465736f * num3 * Mathf.Pow(2f, 1f - 10f * value) * Mathf.Sin((float)Math.PI * 2f * (num * value - num4) / num2);
}
public static float EaseInOutElasticD(float start, float end, float value)
{
end -= start;
float num = 1f;
float num2 = num * 0.3f;
float num3 = 0f;
float num4;
if (num3 == 0f || num3 < Mathf.Abs(end))
{
num3 = end;
num4 = num2 / 4f;
}
else
{
num4 = num2 / ((float)Math.PI * 2f) * Mathf.Asin(end / num3);
}
if (value < 1f)
{
value -= 1f;
return -3.465736f * num3 * Mathf.Pow(2f, 10f * value) * Mathf.Sin((float)Math.PI * 2f * (num * value - 2f) / num2) - num3 * (float)Math.PI * num * Mathf.Pow(2f, 10f * value) * Mathf.Cos((float)Math.PI * 2f * (num * value - num4) / num2) / num2;
}
value -= 1f;
return num3 * (float)Math.PI * num * Mathf.Cos((float)Math.PI * 2f * (num * value - num4) / num2) / (num2 * Mathf.Pow(2f, 10f * value)) - 3.465736f * num3 * Mathf.Sin((float)Math.PI * 2f * (num * value - num4) / num2) / Mathf.Pow(2f, 10f * value);
}
public static float SpringD(float start, float end, float value)
{
value = Mathf.Clamp01(value);
end -= start;
return end * (6f * (1f - value) / 5f + 1f) * (-2.2f * Mathf.Pow(1f - value, 1.2f) * Mathf.Sin((float)Math.PI * value * (2.5f * value * value * value + 0.2f)) + Mathf.Pow(1f - value, 2.2f) * ((float)Math.PI * (2.5f * value * value * value + 0.2f) + 23.561945f * value * value * value) * Mathf.Cos((float)Math.PI * value * (2.5f * value * value * value + 0.2f)) + 1f) - 6f * end * (Mathf.Pow(1f - value, 2.2f) * Mathf.Sin((float)Math.PI * value * (2.5f * value * value * value + 0.2f)) + value / 5f);
}
public static Function GetEasingFunction(Ease easingFunction)
{
return easingFunction switch
{
Ease.EaseInQuad => EaseInQuad,
Ease.EaseOutQuad => EaseOutQuad,
Ease.EaseInOutQuad => EaseInOutQuad,
Ease.EaseInCubic => EaseInCubic,
Ease.EaseOutCubic => EaseOutCubic,
Ease.EaseInOutCubic => EaseInOutCubic,
Ease.EaseInQuart => EaseInQuart,
Ease.EaseOutQuart => EaseOutQuart,
Ease.EaseInOutQuart => EaseInOutQuart,
Ease.EaseInQuint => EaseInQuint,
Ease.EaseOutQuint => EaseOutQuint,
Ease.EaseInOutQuint => EaseInOutQuint,
Ease.EaseInSine => EaseInSine,
Ease.EaseOutSine => EaseOutSine,
Ease.EaseInOutSine => EaseInOutSine,
Ease.EaseInExpo => EaseInExpo,
Ease.EaseOutExpo => EaseOutExpo,
Ease.EaseInOutExpo => EaseInOutExpo,
Ease.EaseInCirc => EaseInCirc,
Ease.EaseOutCirc => EaseOutCirc,
Ease.EaseInOutCirc => EaseInOutCirc,
Ease.Linear => Linear,
Ease.Spring => Spring,
Ease.EaseInBounce => EaseInBounce,
Ease.EaseOutBounce => EaseOutBounce,
Ease.EaseInOutBounce => EaseInOutBounce,
Ease.EaseInBack => EaseInBack,
Ease.EaseOutBack => EaseOutBack,
Ease.EaseInOutBack => EaseInOutBack,
Ease.EaseInElastic => EaseInElastic,
Ease.EaseOutElastic => EaseOutElastic,
Ease.EaseInOutElastic => EaseInOutElastic,
_ => null,
};
}
public static Function GetEasingFunctionDerivative(Ease easingFunction)
{
return easingFunction switch
{
Ease.EaseInQuad => EaseInQuadD,
Ease.EaseOutQuad => EaseOutQuadD,
Ease.EaseInOutQuad => EaseInOutQuadD,
Ease.EaseInCubic => EaseInCubicD,
Ease.EaseOutCubic => EaseOutCubicD,
Ease.EaseInOutCubic => EaseInOutCubicD,
Ease.EaseInQuart => EaseInQuartD,
Ease.EaseOutQuart => EaseOutQuartD,
Ease.EaseInOutQuart => EaseInOutQuartD,
Ease.EaseInQuint => EaseInQuintD,
Ease.EaseOutQuint => EaseOutQuintD,
Ease.EaseInOutQuint => EaseInOutQuintD,
Ease.EaseInSine => EaseInSineD,
Ease.EaseOutSine => EaseOutSineD,
Ease.EaseInOutSine => EaseInOutSineD,
Ease.EaseInExpo => EaseInExpoD,
Ease.EaseOutExpo => EaseOutExpoD,
Ease.EaseInOutExpo => EaseInOutExpoD,
Ease.EaseInCirc => EaseInCircD,
Ease.EaseOutCirc => EaseOutCircD,
Ease.EaseInOutCirc => EaseInOutCircD,
Ease.Linear => LinearD,
Ease.Spring => SpringD,
Ease.EaseInBounce => EaseInBounceD,
Ease.EaseOutBounce => EaseOutBounceD,
Ease.EaseInOutBounce => EaseInOutBounceD,
Ease.EaseInBack => EaseInBackD,
Ease.EaseOutBack => EaseOutBackD,
Ease.EaseInOutBack => EaseInOutBackD,
Ease.EaseInElastic => EaseInElasticD,
Ease.EaseOutElastic => EaseOutElasticD,
Ease.EaseInOutElastic => EaseInOutElasticD,
_ => null,
};
}
}
namespace RavenCameraFX;
[BepInPlugin("com.personperhaps.ravencamerafx", "ravencamerafx", "1.0")]
public class Plugin : BaseUnityPlugin
{
[HarmonyPatch(typeof(LoadoutUi), "LoadSlotEntry")]
public class AnyWeaponSlot
{
public static bool CanUseWeaponEntry(WeaponEntry entry)
{
return GameManager.GameParameters().playerHasAllWeapons || GameManager.instance.gameInfo.team[GameManager.PlayerTeam()].IsWeaponEntryAvailable(entry);
}
public static bool Prefix(LoadoutUi __instance, ref WeaponEntry __result, WeaponSlot entrySlot, string keyName)
{
return true;
}
}
[HarmonyPatch(typeof(WeaponManager), "GetWeaponTagDictionary")]
public class AnyWeaponSlot2
{
public static bool Prefix(WeaponManager __instance, ref bool allSlots)
{
return true;
}
}
[HarmonyPatch(typeof(FpsActorController), "OnLand")]
public class OnLandPatch
{
public static bool Prefix(FpsActorController __instance)
{
//IL_001e: 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_0090: 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_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_00d4: Unknown result type (might be due to invalid IL or missing references)
//IL_00d9: 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_0124: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
//IL_013a: Unknown result type (might be due to invalid IL or missing references)
//IL_014f: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: Unknown result type (might be due to invalid IL or missing references)
//IL_0165: Unknown result type (might be due to invalid IL or missing references)
if (((ActorController)__instance).actor.IsSeated())
{
return false;
}
float num = Mathf.Clamp((0f - ((ActorController)__instance).actor.Velocity().y - 2f) * 0.3f, 0f, 2f);
if (((ActorController)__instance).IsSprinting())
{
num *= 2f;
}
__instance.fpParent.ApplyRecoil(new Vector3(0f, (0f - num) * 0.3f, 0f), true);
__instance.fpParent.KickCamera(new Vector3(num, 0f, 0f));
Vector3 val = ((ActorController)__instance).actor.Velocity();
((Vector3)(ref val))..ctor(0f, val.y, 0f);
SecondOrder cameraDipSpring = plugin.cameraDipSpring;
cameraDipSpring.yd += Vector3.ClampMagnitude(val, 7f);
plugin.AddForceToWeaponZRotation(new Vector3(Mathf.Lerp(-1f, 1f, Random.value), Mathf.Lerp(-1f, 1f, Random.value), Mathf.Lerp(-1f, 1f, Random.value)) * 0.2f * ((Vector3)(ref val)).magnitude, 0f);
plugin.AddForceToWeaponPushback(Vector3.down * ((Vector3)(ref val)).magnitude * 0.05f, -1f, 0f);
return false;
}
}
[HarmonyPatch(typeof(PlayerFpParent), "FixedUpdate")]
public class WeaponUpdatePatch
{
private static void Postfix(PlayerFpParent __instance)
{
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
//IL_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0030: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: 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)
//IL_0088: 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_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00b8: Unknown result type (might be due to invalid IL or missing references)
Transform shoulderParent = __instance.shoulderParent;
shoulderParent.localEulerAngles += plugin.WeaponLeaning() + plugin.WeaponZRotation() + plugin.weaponRecoilXRotation() + plugin.WeaponCrouchTuck() + plugin.TurnCameraRotate() + plugin.CameraWalkBob() * 15f;
Transform shoulderParent2 = __instance.shoulderParent;
shoulderParent2.localPosition += plugin.DownwardOffset() + plugin.MovementOffset();
Camera fpCamera = __instance.fpCamera;
fpCamera.fieldOfView += Mathf.Abs(plugin.CameraRecoilZRotation().z) * plugin.settings.cameraRecoilFovPower;
}
}
[HarmonyPatch(typeof(PlayerFpParent), "LateUpdate")]
public class CameraUpdatePatch
{
private static void Prefix(PlayerFpParent __instance)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0026: Unknown result type (might be due to invalid IL or missing references)
//IL_0093: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00f8: Unknown result type (might be due to invalid IL or missing references)
//IL_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_0116: Unknown result type (might be due to invalid IL or missing references)
_ = plugin.storedWeaponParentLocation;
if (0 == 0)
{
((Component)__instance.weaponParent).transform.localPosition = plugin.storedWeaponParentLocation;
if (plugin.AimLastFrame != ((ActorController)FpsActorController.instance).Aiming())
{
plugin.AddForceToWeaponZRotation(new Vector3(Mathf.Lerp(-1f, 1f, Random.value), Mathf.Lerp(-1f, 1f, Random.value), Mathf.Lerp(-1f, 1f, Random.value)) * plugin.settings.stanceChangeShake, 0f);
plugin.AddForceToWeaponPushback(new Vector3(Mathf.Lerp(-1f, 1f, Random.value), Mathf.Lerp(-1f, 1f, Random.value), Mathf.Lerp(-1f, 1f, Random.value)) * 0.07f * plugin.settings.stanceChangeShake, -1f, 0f);
}
plugin.AimLastFrame = ((ActorController)FpsActorController.instance).Aiming();
}
}
private static void Postfix(PlayerFpParent __instance)
{
//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_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_0040: Unknown result type (might be due to invalid IL or missing references)
//IL_0045: Unknown result type (might be due to invalid IL or missing references)
//IL_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Unknown result type (might be due to invalid IL or missing references)
//IL_0068: Unknown result type (might be due to invalid IL or missing references)
//IL_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_0084: Unknown result type (might be due to invalid IL or missing references)
//IL_008e: Unknown result type (might be due to invalid IL or missing references)
//IL_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_00af: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00be: Unknown result type (might be due to invalid IL or missing references)
//IL_00d4: Unknown result type (might be due to invalid IL or missing references)
plugin.storedWeaponParentLocation = ((Component)__instance.weaponParent).transform.localPosition;
Transform fpCameraParent = __instance.fpCameraParent;
fpCameraParent.localEulerAngles += plugin.CameraLeaning() + plugin.CameraRecoilZRotation() * 2f + plugin.CameraRecoilXRotation() + plugin.ProceduralCameraShake();
Transform fpCameraParent2 = __instance.fpCameraParent;
fpCameraParent2.position += plugin.CameraWalkBob() + plugin.CameraDip();
Transform transform = ((Component)__instance.weaponParent).transform;
transform.localPosition += plugin.WeaponPushback();
__instance.weaponParent.localScale = plugin.ViewmodelFlip();
plugin.UpdateCameraPhysicalMovement();
plugin.recoilControl = Mathf.MoveTowards(plugin.recoilControl, 1f, plugin.settings.recoilRecoverySpeed * plugin.DeltaTime());
plugin.recoilControl = Mathf.Lerp(plugin.recoilControl, 1f, plugin.settings.recoilRecoverySpeed * plugin.DeltaTime());
plugin.recoilControl = Mathf.Min(plugin.recoilControl, 3f);
}
}
[HarmonyPatch(typeof(Weapon), "ApplyRecoil")]
public class RecoilPatch
{
private static void Prefix(Weapon __instance)
{
//IL_00cb: Unknown result type (might be due to invalid IL or missing references)
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d7: Unknown result type (might be due to invalid IL or missing references)
//IL_00e7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ed: Unknown result type (might be due to invalid IL or missing references)
//IL_0147: Unknown result type (might be due to invalid IL or missing references)
//IL_0157: Unknown result type (might be due to invalid IL or missing references)
//IL_015d: Unknown result type (might be due to invalid IL or missing references)
//IL_0162: Unknown result type (might be due to invalid IL or missing references)
//IL_0169: Unknown result type (might be due to invalid IL or missing references)
//IL_016e: Unknown result type (might be due to invalid IL or missing references)
//IL_018e: 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_01a4: Unknown result type (might be due to invalid IL or missing references)
//IL_01aa: Unknown result type (might be due to invalid IL or missing references)
//IL_01f6: Unknown result type (might be due to invalid IL or missing references)
//IL_021b: Unknown result type (might be due to invalid IL or missing references)
//IL_0225: Unknown result type (might be due to invalid IL or missing references)
//IL_023e: Unknown result type (might be due to invalid IL or missing references)
//IL_0253: Unknown result type (might be due to invalid IL or missing references)
//IL_0259: Unknown result type (might be due to invalid IL or missing references)
//IL_025e: 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_027d: Unknown result type (might be due to invalid IL or missing references)
//IL_0282: Unknown result type (might be due to invalid IL or missing references)
if (__instance.UserIsPlayer())
{
if (__instance.configuration.autoReloadDelay <= 0f)
{
__instance.configuration.autoReloadDelay = 0.1f;
}
float num = ((Random.value > 0.5f) ? 1 : (-1));
float num2 = __instance.configuration.kickback * (__instance.user.controller.Prone() ? __instance.configuration.kickbackProneMultiplier : 1f) * plugin.recoilControl;
float num3 = (__instance.configuration.auto ? 1f : 0.6f);
plugin.recoilControl += num2 * plugin.settings.recoilRecoveryLoss;
plugin.AddForceToCameraZRotation(Vector3.back * num2 * num);
plugin.AddForceToCameraXRotation(Vector3.left * num2);
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor((float)Random.Range(-1, 1) * __instance.configuration.randomKick, Random.Range(0.5f, 1f) * __instance.configuration.randomKick, (float)Random.Range(-1, 1) * __instance.configuration.randomKick);
plugin.AddForceToWeaponPushback(Vector3.back * Mathf.Min(num2, 0.5f) * num3 + val * 0.2f, __instance.configuration.cooldown);
plugin.AddForceToCameraXRotation(Vector3.left * num2);
plugin.AddForceToWeaponXRotation(Vector3.left * num2);
plugin.AddForceToWeaponZRotation(new Vector3(Mathf.Lerp(-1f, 1f, Random.value), Mathf.Lerp(-1f, 1f, Random.value), Mathf.Lerp(-1f, 1f, Random.value)) * Mathf.Lerp(__instance.configuration.kickback, __instance.configuration.randomKick, 0.8f) * 4f * (__instance.aiming ? 0.3f : 1f));
plugin.PhysicallyMoveCamera(Vector3.right * num2 + Vector3.up * Mathf.Lerp(-1f, 1f, Random.value) * num2);
}
}
}
[HarmonyPatch(typeof(FpsActorController), "UpdateGameplay")]
public class SmoothStanceSwitchPatch
{
private static float beforeCameraHeight = 1.5f;
private static float beforeTargetCameraHeight = 1.5f;
public static void Prefix(FpsActorController __instance)
{
if (!((ActorController)__instance).actor.IsSeated() && !((ActorController)__instance).actor.IsOnLadder())
{
beforeCameraHeight = (float)typeof(FpsActorController).GetField("cameraHeight", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance);
beforeTargetCameraHeight = (float)typeof(FpsActorController).GetField("targetCameraHeight", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance);
}
}
public static void Postfix(FpsActorController __instance)
{
//IL_0090: Unknown result type (might be due to invalid IL or missing references)
//IL_0096: Expected O, but got Unknown
//IL_00a2: Unknown result type (might be due to invalid IL or missing references)
if (!((ActorController)__instance).actor.IsSeated() && !((ActorController)__instance).actor.IsOnLadder())
{
float num = EasingFunction.EaseOutSine(beforeCameraHeight, beforeTargetCameraHeight, plugin.settings.cameraStanceChangeSpeed * plugin.DeltaTime());
typeof(FpsActorController).GetField("cameraHeight", BindingFlags.Instance | BindingFlags.NonPublic).SetValue(__instance, num);
Transform val = (Transform)typeof(FpsActorController).GetField("fpCameraRoot", BindingFlags.Instance | BindingFlags.NonPublic).GetValue(__instance);
val.localPosition = new Vector3(0f, num, 0f);
}
}
}
[HarmonyPatch(typeof(FpsActorController), "Update")]
public class SmoothLeanPatch
{
public static void Prefix(out float __state, FpsActorController __instance)
{
__state = __instance.fpParent.lean;
}
public static void Postfix(float __state, FpsActorController __instance)
{
__instance.fpParent.lean = Mathf.Lerp(__state, ((ActorController)__instance).Lean() * 1.4f, Time.fixedDeltaTime * plugin.settings.cameraLeaningSpeed);
}
}
public static Plugin plugin;
public Settings settings;
public List<PropertyInfo> fields;
public List<ConfigEntry<float>> configEntries = new List<ConfigEntry<float>>();
public float aiming = 0f;
public float grounded = 0f;
public float moving = 0f;
public float cameraLean = 0f;
public float weaponLean = 0f;
public SecondOrder hipfireOffset = new SecondOrder(0.3f, 0.6f, 0.1f, Vector3.zero);
public SecondOrder movementOffset = new SecondOrder(0.4f, 0.4f, 0.1f, Vector3.zero);
public SecondOrder turnCameraRotate = new SecondOrder(1f, 0.5f, 0.1f, Vector3.zero);
public SecondOrder cameraRecoilZRotationSystem = new SecondOrder(1.6f, 0.4f, 0.1f, Vector3.zero);
public SecondOrder cameraRecoilXRotationSystem = new SecondOrder(2f, 0.4f, 0.1f, Vector3.zero);
public SecondOrder weaponRecoilXRotationSystem = new SecondOrder(4f, 0.2f, 0.1f, Vector3.zero);
public SecondOrder cameraDipSpring = new SecondOrder(1.5f, 0.5f, 0.1f, Vector3.zero);
public SecondOrder weaponCrouchTuck = new SecondOrder(2f, 0.5f, 0.1f, Vector3.zero);
private Vector3 targetRotation = Vector3.zero;
public SecondOrder weaponPushbackSystem = new SecondOrder(3f, 0.35f, 0.1f, Vector3.zero);
public SecondOrder weaponZRotation = new SecondOrder(2f, 0.2f, 0.05f, Vector3.zero);
public Vector2 cameraPhysicalMovement = Vector2.zero;
private static List<Tuple<Vector3, Quaternion>> armBones = new List<Tuple<Vector3, Quaternion>>();
public static Dictionary<Transform, Tuple<Vector3, Vector3>> bones = new Dictionary<Transform, Tuple<Vector3, Vector3>>();
public static Vector3 averageDelta = Vector3.zero;
public static SecondOrder shakeCoil = new SecondOrder(1.5f, 0.5f, 0.05f, Vector3.zero);
public Vector3 storedWeaponParentLocation;
public bool AimLastFrame = false;
public float recoilControl = 1f;
private Vector2 scrollPos;
private void Start()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Expected O, but got Unknown
Debug.Log((object)"ravencamerafx: Loading!");
Harmony val = new Harmony("ravencamerafx");
val.PatchAll();
plugin = this;
settings = new Settings();
fields = typeof(Settings).GetProperties().ToList();
foreach (PropertyInfo field in fields)
{
SettingAttribute settingAttribute = field.GetCustomAttribute(typeof(SettingAttribute)) as SettingAttribute;
settingAttribute.Changed = false;
settingAttribute.LastValue = (float)field.GetValue(settings);
ConfigEntry<float> val2 = ((BaseUnityPlugin)this).Config.Bind<float>(settingAttribute.Category, settingAttribute.Name, (float)field.GetValue(settings), (ConfigDescription)null);
field.SetValue(settings, val2.Value);
configEntries.Add(val2);
}
((BaseUnityPlugin)this).Config.Save();
}
public void UpdateConfig()
{
foreach (PropertyInfo field in fields)
{
SettingAttribute attribute = field.GetCustomAttribute(typeof(SettingAttribute)) as SettingAttribute;
configEntries.Where((ConfigEntry<float> x) => ((ConfigEntryBase)x).Definition.Key == attribute.Name).FirstOrDefault().Value = (float)field.GetValue(settings);
attribute.Changed = false;
attribute.LastValue = (float)field.GetValue(settings);
}
((BaseUnityPlugin)this).Config.Save();
}
public float DeltaTime()
{
return Time.deltaTime * Time.timeScale;
}
public float Aiming(bool immediate = false)
{
if ((Object)(object)FpsActorController.instance != (Object)null)
{
if (immediate)
{
return (!((ActorController)FpsActorController.instance).Aiming()) ? 1 : 0;
}
aiming = Mathf.Lerp(aiming, (float)((!((ActorController)FpsActorController.instance).Aiming()) ? 1 : 0), DeltaTime() * 2f);
return aiming;
}
return 0f;
}
public float Grounded(bool immediate = false)
{
if ((Object)(object)FpsActorController.instance != (Object)null)
{
if (immediate)
{
return ((ActorController)FpsActorController.instance).OnGround() ? 1 : 0;
}
grounded = Mathf.Lerp(grounded, (float)(((ActorController)FpsActorController.instance).OnGround() ? 1 : 0), DeltaTime() * 3f);
return grounded;
}
return 0f;
}
public float Moving(bool immediate = false)
{
//IL_0044: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
//IL_001c: Unknown result type (might be due to invalid IL or missing references)
//IL_0021: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)FpsActorController.instance != (Object)null)
{
Vector3 val;
if (immediate)
{
val = ((ActorController)FpsActorController.instance).Velocity();
return (((Vector3)(ref val)).magnitude > 10f) ? 1 : 0;
}
float num = moving;
val = ((ActorController)FpsActorController.instance).Velocity();
moving = Mathf.Lerp(num, Mathf.Min(((Vector3)(ref val)).magnitude / 20f, 1f), DeltaTime() * 5f);
return moving;
}
return 0f;
}
public Vector3 ViewmodelFlip()
{
//IL_0025: 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_002d: Unknown result type (might be due to invalid IL or missing references)
return new Vector3(Mathf.Lerp(-1f, 1f, settings.viewmodelFlip), 1f, 1f);
}
public Vector3 CameraLeaning()
{
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_0049: Unknown result type (might be due to invalid IL or missing references)
cameraLean = Mathf.Lerp(cameraLean, SteelInput.GetAxis((KeyBinds)0), DeltaTime() * settings.cameraLeanSpeed);
return cameraLean * settings.cameraLeanAmount * Vector3.forward;
}
public Vector3 WeaponLeaning()
{
//IL_003c: Unknown result type (might be due to invalid IL or missing references)
//IL_0041: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
weaponLean = Mathf.Lerp(weaponLean, SteelInput.GetAxis((KeyBinds)0), DeltaTime() * settings.weaponLeanSpeed);
return weaponLean * settings.weaponLeanAmount * Vector3.forward * plugin.Aiming();
}
public Vector3 DownwardOffset()
{
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: 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_0080: Unknown result type (might be due to invalid IL or missing references)
//IL_0085: Unknown result type (might be due to invalid IL or missing references)
//IL_008a: Unknown result type (might be due to invalid IL or missing references)
//IL_008d: Unknown result type (might be due to invalid IL or missing references)
return hipfireOffset.Update(DeltaTime() * settings.weaponDownwardOffsetSpeed, settings.weaponDownwardOffset * Aiming(immediate: true) * Vector3.up + settings.weaponForwardOffset * Aiming(immediate: true) * Vector3.forward) + Vector3.up * plugin.weaponCrouchTuck.y.z * 0.003f;
}
public Vector3 MovementOffset()
{
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//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_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_0054: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
Vector3 val = new Vector3(0f - SteelInput.GetAxis((KeyBinds)0), 0f, 0f - SteelInput.GetAxis((KeyBinds)1)) * 0.1f;
return movementOffset.Update(DeltaTime() * settings.weaponMovementOffsetSpeed, settings.weaponMovementOffset * val * Aiming(immediate: true));
}
public Vector3 TurnCameraRotate()
{
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_003f: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_0055: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor(SteelInput.GetAxis((KeyBinds)19) * 0.2f, 0f, SteelInput.GetAxis((KeyBinds)18));
return turnCameraRotate.Update(DeltaTime() * 1f, settings.cameraTurnWeaponMovement * val * Aiming(immediate: true));
}
public void AddForceToCameraZRotation(Vector3 force)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: 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)
cameraRecoilZRotationSystem.y = Vector3.Lerp(cameraRecoilZRotationSystem.y, force, 0.5f);
cameraRecoilZRotationSystem.yd = force * 2f;
cameraRecoilZRotationSystem.ChangeArgs(plugin.settings.cameraRecoilSnappyness, 0.4f, 0.1f);
}
public Vector3 CameraRecoilZRotation()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_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)
return cameraRecoilZRotationSystem.Update(DeltaTime(), Vector3.zero) * settings.cameraRecoilPower;
}
public void AddForceToCameraXRotation(Vector3 force)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: 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)
cameraRecoilXRotationSystem.y = Vector3.Lerp(cameraRecoilXRotationSystem.y, force, 0.1f);
cameraRecoilXRotationSystem.yd = force * 2f;
cameraRecoilXRotationSystem.ChangeArgs(plugin.settings.cameraRecoilUpSnappyness, 0.4f, 0.1f);
}
public Vector3 CameraRecoilXRotation()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_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)
return cameraRecoilXRotationSystem.Update(DeltaTime(), Vector3.zero) * settings.cameraRecoilUpRotationPower;
}
public void AddForceToWeaponXRotation(Vector3 force)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: 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)
weaponRecoilXRotationSystem.y = Vector3.Lerp(weaponRecoilXRotationSystem.y, force, 0.1f);
weaponRecoilXRotationSystem.yd = force * 2f;
}
public Vector3 weaponRecoilXRotation()
{
//IL_002e: 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_0043: Unknown result type (might be due to invalid IL or missing references)
//IL_0048: Unknown result type (might be due to invalid IL or missing references)
//IL_004b: Unknown result type (might be due to invalid IL or missing references)
weaponRecoilXRotationSystem.ChangeArgs(settings.weaponRecoilUpRotationSnap, 0.4f, 0.1f);
return weaponRecoilXRotationSystem.Update(DeltaTime(), Vector3.zero) * settings.weaponRecoilUpRotationPower;
}
public Vector3 CameraDip()
{
//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_001b: Unknown result type (might be due to invalid IL or missing references)
//IL_001e: Unknown result type (might be due to invalid IL or missing references)
return plugin.cameraDipSpring.Update(DeltaTime(), Vector3.zero);
}
public Vector3 WeaponCrouchTuck()
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_0083: Unknown result type (might be due to invalid IL or missing references)
//IL_0088: Unknown result type (might be due to invalid IL or missing references)
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_0056: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_0067: 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)
targetRotation = Vector3.zero;
if ((((ActorController)FpsActorController.instance).Crouch() || (((ActorController)FpsActorController.instance).Prone() && ((ActorController)FpsActorController.instance).IsAirborne())) && !((ActorController)FpsActorController.instance).Aiming())
{
targetRotation = Vector3.forward * settings.weaponTuckAngle * Aiming();
}
return plugin.weaponCrouchTuck.Update(DeltaTime(), targetRotation);
}
public Vector3 WeaponPushback()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0022: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
//IL_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0044: 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_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_005e: 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)
Vector3 val = weaponPushbackSystem.Update(DeltaTime(), Vector3.zero) * settings.weaponRecoilPushbackPower * 0.05f;
if (val.z < -0.025f)
{
val = Vector3.Lerp(val, Vector3.back * 0.025f, 0.8f);
}
return val;
}
public void AddForceToWeaponPushback(Vector3 force, float cooldown = -1f, float lerp = 0.2f)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
weaponPushbackSystem.y = Vector3.Lerp(weaponPushbackSystem.y, force, lerp);
weaponPushbackSystem.yd = force * 1.5f;
if (cooldown != -1f)
{
weaponPushbackSystem.ChangeArgs(Mathf.Lerp(0.4f / (cooldown + 0.01f), 3f, 0.5f), plugin.settings.weaponRecoilPushbackDrag, 0.1f);
}
}
public Vector3 WeaponZRotation()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_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_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_0029: Unknown result type (might be due to invalid IL or missing references)
//IL_002c: Unknown result type (might be due to invalid IL or missing references)
return weaponZRotation.Update(DeltaTime(), Vector3.zero) * settings.weaponRecoilYZRotation;
}
public void AddForceToWeaponZRotation(Vector3 force, float lerp = 0.1f)
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
//IL_0012: Unknown result type (might be due to invalid IL or missing references)
//IL_0014: Unknown result type (might be due to invalid IL or missing references)
//IL_0019: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Unknown result type (might be due to invalid IL or missing references)
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
weaponZRotation.y = Vector3.Lerp(weaponZRotation.y, force, lerp);
weaponZRotation.yd = force * 1.3f;
}
public Vector3 CameraWalkBob()
{
//IL_008e: 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_00b1: 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_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_0086: Unknown result type (might be due to invalid IL or missing references)
//IL_008b: Unknown result type (might be due to invalid IL or missing references)
//IL_00d9: Unknown result type (might be due to invalid IL or missing references)
float stepPhase = FpsActorController.instance.GetStepPhase();
Vector3 val = default(Vector3);
((Vector3)(ref val))..ctor(-0.05f * Mathf.Pow(Mathf.Abs(Mathf.Sin(3.14159f * stepPhase + 1.570795f) - 0.9f), 2f), -0.05f * Mathf.Pow(Mathf.Abs(Mathf.Cos(3.14159f * stepPhase * 2f) - 0.9f), 2f), 0f);
if (((ActorController)FpsActorController.instance).actor.IsSeated())
{
return Vector3.zero;
}
return val * Mathf.Lerp(0.2f, 1f, Aiming()) * Moving() * Grounded() * plugin.settings.cameraBobIntensity;
}
public void PhysicallyMoveCamera(Vector3 force)
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: Unknown result type (might be due to invalid IL or missing references)
//IL_0033: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_0039: Unknown result type (might be due to invalid IL or missing references)
Vector2 val = default(Vector2);
((Vector2)(ref val))..ctor(force.y * settings.cameraRecoilMoveCameraPowerHorizontal, force.x * settings.cameraRecoilMoveCameraPower);
cameraPhysicalMovement += val;
}
public void UpdateCameraPhysicalMovement()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//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_0028: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0037: Unknown result type (might be due to invalid IL or missing references)
LocalPlayer.controller.controller.m_MouseLook.ApplyScriptedRotation(cameraPhysicalMovement);
cameraPhysicalMovement = Vector2.MoveTowards(cameraPhysicalMovement, Vector2.op_Implicit(Vector3.zero), 0.5f);
}
public Vector3 ProceduralCameraShake()
{
//IL_03e2: Unknown result type (might be due to invalid IL or missing references)
//IL_03e7: Unknown result type (might be due to invalid IL or missing references)
//IL_03ec: Unknown result type (might be due to invalid IL or missing references)
//IL_03f1: Unknown result type (might be due to invalid IL or missing references)
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0007: Unknown result type (might be due to invalid IL or missing references)
//IL_03f5: Unknown result type (might be due to invalid IL or missing references)
//IL_03a7: Unknown result type (might be due to invalid IL or missing references)
//IL_03ac: Unknown result type (might be due to invalid IL or missing references)
//IL_03c0: Unknown result type (might be due to invalid IL or missing references)
//IL_03c5: Unknown result type (might be due to invalid IL or missing references)
//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
//IL_028a: Unknown result type (might be due to invalid IL or missing references)
//IL_028f: Unknown result type (might be due to invalid IL or missing references)
//IL_029a: Unknown result type (might be due to invalid IL or missing references)
//IL_02a4: Unknown result type (might be due to invalid IL or missing references)
//IL_02a9: Unknown result type (might be due to invalid IL or missing references)
//IL_02ae: 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_00b2: Unknown result type (might be due to invalid IL or missing references)
//IL_02d8: Unknown result type (might be due to invalid IL or missing references)
//IL_02e2: Unknown result type (might be due to invalid IL or missing references)
//IL_02e7: Unknown result type (might be due to invalid IL or missing references)
//IL_030c: Unknown result type (might be due to invalid IL or missing references)
//IL_0311: Unknown result type (might be due to invalid IL or missing references)
//IL_00fb: Unknown result type (might be due to invalid IL or missing references)
//IL_0353: Unknown result type (might be due to invalid IL or missing references)
//IL_0358: Unknown result type (might be due to invalid IL or missing references)
//IL_0359: Unknown result type (might be due to invalid IL or missing references)
//IL_035e: 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_012b: Unknown result type (might be due to invalid IL or missing references)
//IL_013d: Unknown result type (might be due to invalid IL or missing references)
//IL_014e: Unknown result type (might be due to invalid IL or missing references)
//IL_015e: Unknown result type (might be due to invalid IL or missing references)
//IL_016b: Unknown result type (might be due to invalid IL or missing references)
//IL_0172: Unknown result type (might be due to invalid IL or missing references)
//IL_0177: Unknown result type (might be due to invalid IL or missing references)
//IL_017b: Unknown result type (might be due to invalid IL or missing references)
//IL_0180: Unknown result type (might be due to invalid IL or missing references)
//IL_018a: 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_0199: Unknown result type (might be due to invalid IL or missing references)
//IL_019e: 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_01a2: Unknown result type (might be due to invalid IL or missing references)
//IL_01b3: 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)
//IL_01c2: Unknown result type (might be due to invalid IL or missing references)
//IL_01c7: Unknown result type (might be due to invalid IL or missing references)
//IL_01cc: Unknown result type (might be due to invalid IL or missing references)
//IL_0389: Unknown result type (might be due to invalid IL or missing references)
//IL_038e: Unknown result type (might be due to invalid IL or missing references)
//IL_0391: Unknown result type (might be due to invalid IL or missing references)
//IL_0396: Unknown result type (might be due to invalid IL or missing references)
try
{
Vector3 val = Vector3.zero;
if ((Object)(object)((ActorController)FpsActorController.instance).actor != (Object)null && !GameManager.IsSpectating())
{
if ((Object)(object)((ActorController)FpsActorController.instance).actor.activeWeapon != (Object)null && (Object)(object)((ActorController)FpsActorController.instance).actor.activeWeapon.arms != (Object)null)
{
Dictionary<Transform, Tuple<Vector3, Vector3>> dictionary = new Dictionary<Transform, Tuple<Vector3, Vector3>>();
List<Tuple<Vector3, Quaternion>> list = new List<Tuple<Vector3, Quaternion>>();
Transform[] array = ((ActorController)FpsActorController.instance).actor.activeWeapon.arms.bones;
foreach (Transform val2 in array)
{
list.Add(new Tuple<Vector3, Quaternion>(val2.localPosition, val2.localRotation));
}
armBones = list;
foreach (Transform key in bones.Keys)
{
_ = key.localPosition;
if (false)
{
break;
}
if (bones.ContainsKey(key))
{
Vector3 localPosition = key.localPosition;
dictionary.Add(key, new Tuple<Vector3, Vector3>(bones[key].Item1, bones[key].Item2));
Vector3 val3 = val;
Vector3 item = bones[key].Item1;
Quaternion localRotation = key.localRotation;
val = val3 + Vector3.ClampMagnitude((item - ((Quaternion)(ref localRotation)).eulerAngles) / 5f, 50f);
val += Vector3.ClampMagnitude(key.localPosition - bones[key].Item2, 50f);
}
}
Dictionary<Transform, Tuple<Vector3, Vector3>> dictionary2 = ((ActorController)FpsActorController.instance).actor.activeWeapon.arms.bones.ToDictionary((Transform x) => x, delegate(Transform x)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_0009: Unknown result type (might be due to invalid IL or missing references)
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
Quaternion localRotation2 = x.localRotation;
return new Tuple<Vector3, Vector3>(((Quaternion)(ref localRotation2)).eulerAngles, x.localPosition);
});
bones = dictionary2;
}
if (((Vector3)(ref averageDelta)).sqrMagnitude > 0.1f && ((Vector3)(ref shakeCoil.y)).magnitude < 20f)
{
SecondOrder secondOrder = shakeCoil;
secondOrder.yd += averageDelta * DeltaTime() * 10f;
}
else
{
averageDelta = Vector3.zero;
}
if (((ActorController)FpsActorController.instance).actor.IsAiming())
{
averageDelta /= 10f;
}
float num = ((((Vector3)(ref val)).magnitude < ((Vector3)(ref averageDelta)).magnitude) ? (Mathf.Pow(2f, Vector3.Distance(averageDelta, Vector3.zero) * -0.4f - 6f) * 400f + 1f) : 1f);
float num2;
if (!((double)((Vector3)(ref val)).magnitude > 0.2))
{
num2 = 1f;
}
else
{
Vector3 val4 = averageDelta - val;
num2 = Mathf.Log10(Mathf.Abs(((Vector3)(ref val4)).magnitude + 1f)) + 2.3f;
}
float num3 = num2;
float num4 = num3 * num / 4f;
averageDelta = Vector3.Lerp(averageDelta, val, num4);
}
return shakeCoil.Update(DeltaTime(), Vector3.zero) * plugin.settings.cameraMovementIntensity;
}
catch (Exception)
{
Debug.Log((object)"SHIT");
bones.Clear();
averageDelta = Vector3.zero;
return Vector3.zero;
}
}
private void OnGUI()
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Expected O, but got Unknown
//IL_004e: Unknown result type (might be due to invalid IL or missing references)
//IL_0077: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: 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)
GUIStyle val = new GUIStyle(GUI.skin.box);
if ((Object)(object)Options.instance == (Object)null || !Options.IsOpen())
{
return;
}
GUILayout.BeginArea(new Rect(0f, (float)(Screen.height - 600), 400f, 400f), string.Empty);
GUILayout.BeginVertical(val, Array.Empty<GUILayoutOption>());
GUILayout.BeginHorizontal(Array.Empty<GUILayoutOption>());
scrollPos = GUILayout.BeginScrollView(scrollPos, (GUILayoutOption[])(object)new GUILayoutOption[2]
{
GUILayout.Width(380f),
GUILayout.Height(395f)
});
GUILayout.Label("<b>Raven Camera FX 2</b>", Array.Empty<GUILayoutOption>());
if (GUILayout.Button("Save Config", Array.Empty<GUILayoutOption>()))
{
UpdateConfig();
}
foreach (PropertyInfo field in fields)
{
GUILayout.FlexibleSpace();
if (field.Name.StartsWith("divider"))
{
GUILayout.Space(5f);
GUILayout.Label("<b>" + (string)field.GetValue(settings) + "</b>", Array.Empty<GUILayoutOption>());
GUILayout.Space(2f);
continue;
}
SettingAttribute settingAttribute = field.GetCustomAttribute(typeof(SettingAttribute)) as SettingAttribute;
float num = Mathf.Round((float)field.GetValue(settings) * (1f / settingAttribute.round)) / (1f / settingAttribute.round);
if (settingAttribute.LastValue != num)
{
settingAttribute.Changed = true;
}
GUILayout.Label(settingAttribute.Name + ": " + num, Array.Empty<GUILayoutOption>());
field.SetValue(settings, GUILayout.HorizontalSlider(num, settingAttribute.MinVal, settingAttribute.MaxVal, Array.Empty<GUILayoutOption>()));
settingAttribute.LastValue = num;
GUILayout.FlexibleSpace();
}
GUILayout.EndScrollView();
GUILayout.EndHorizontal();
GUILayout.EndVertical();
GUILayout.EndArea();
}
}
[AttributeUsage(AttributeTargets.Property)]
public class SettingAttribute : Attribute
{
public string Name;
public float MaxVal;
public float MinVal;
public float LastValue;
public float round;
public string Category;
public bool Changed;
public SettingAttribute(string name, string category)
{
Name = name;
Category = category;
MaxVal = 1f;
MinVal = 0f;
round = 0.01f;
Changed = false;
LastValue = 0f;
}
}
public class SecondOrder
{
private Vector3 xp;
public Vector3 y;
public Vector3 yd;
public float k1;
public float k2;
public float k3;
private float PI = 3.14159f;
private float T_crit;
public SecondOrder(float f, float z, float r, Vector3 x0)
{
//IL_0097: 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_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ac: Unknown result type (might be due to invalid IL or missing references)
k1 = z / (PI * f);
k2 = 1f / (2f * PI * f * (2f * PI * f));
k3 = r * z / (2f * PI * f);
T_crit = 0.8f * (Mathf.Sqrt(4f * k2 + k1 * k1) - k1);
xp = x0;
y = x0;
yd = Vector3.zero;
}
public Vector3 Update(float T, Vector3 x)
{
//IL_0001: Unknown result type (might be due to invalid IL or missing references)
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: 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_0013: Unknown result type (might be due to invalid IL or missing references)
//IL_0015: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_0036: Unknown result type (might be due to invalid IL or missing references)
//IL_003d: Unknown result type (might be due to invalid IL or missing references)
//IL_0042: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Unknown result type (might be due to invalid IL or missing references)
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_0060: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Unknown result type (might be due to invalid IL or missing references)
//IL_0066: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Unknown result type (might be due to invalid IL or missing references)
//IL_0071: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_0082: Unknown result type (might be due to invalid IL or missing references)
//IL_0087: 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_0097: Unknown result type (might be due to invalid IL or missing references)
//IL_009c: Unknown result type (might be due to invalid IL or missing references)
//IL_00a1: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00b9: Unknown result type (might be due to invalid IL or missing references)
//IL_00bd: Unknown result type (might be due to invalid IL or missing references)
Vector3 val = (x - xp) / T;
xp = x;
int num = Mathf.CeilToInt(T / T_crit);
T /= (float)num;
for (int i = 0; i < num; i++)
{
y += T * yd;
yd += T * (x + k3 * val - y - k1 * yd) / k2;
}
return y;
}
public void ChangeArgs(float f, float z, float r)
{
k1 = z / (PI * f);
k2 = 1f / (2f * PI * f * (2f * PI * f));
k3 = r * z / (2f * PI * f);
T_crit = 0.8f * (Mathf.Sqrt(4f * k2 + k1 * k1) - k1);
}
}
public class Settings
{
[Setting("Viewmodel Flip", "Misc", MaxVal = 1f, round = 1f)]
public float viewmodelFlip { get; set; } = 1f;
[Setting("Weapon Tuck Stance Angle", "Misc", MaxVal = 70f)]
public float weaponTuckAngle { get; set; } = 10f;
[Setting("Aim Transition Weapon Shake Intensity", "Misc", MaxVal = 2f)]
public float stanceChangeShake { get; set; } = 1f;
[Setting("Procedural Camera Movement Intensity", "Misc", MaxVal = 2f)]
public float cameraMovementIntensity { get; set; } = 1f;
[Setting("Camera Q/E Lean Speed", "Misc", MaxVal = 10f)]
public float cameraLeaningSpeed { get; set; } = 6f;
[Setting("Camera Stance Change Speed", "Misc", MaxVal = 10f)]
public float cameraStanceChangeSpeed { get; set; } = 6f;
[Setting("Camera Bob Intensity", "Misc", MaxVal = 2f)]
public float cameraBobIntensity { get; set; } = 0.7f;
[Setting("Camera Lean Amount", "Misc", MaxVal = 10f)]
public float cameraLeanAmount { get; set; } = 1f;
[Setting("Camera Lean Speed", "Misc", MaxVal = 10f)]
public float cameraLeanSpeed { get; set; } = 2f;
[Setting("Weapon Lean Amount", "Misc", MaxVal = 20f)]
public float weaponLeanAmount { get; set; } = 2f;
[Setting("Weapon Lean Amount", "Misc", MaxVal = 10f)]
public float weaponLeanSpeed { get; set; } = 2f;
[Setting("Weapon Downward Offset", "Misc", MaxVal = -0.1f)]
public float weaponDownwardOffset { get; set; } = -0.05f;
[Setting("Weapon Offset Speed", "Misc", MaxVal = 10f)]
public float weaponDownwardOffsetSpeed { get; set; } = 4f;
[Setting("Weapon Forward Offset", "Misc", MaxVal = 0.5f, MinVal = -0.1f)]
public float weaponForwardOffset { get; set; } = -0.05f;
[Setting("Camera Turn Weapon Movement", "Misc", MaxVal = 15f)]
public float cameraTurnWeaponMovement { get; set; } = 3f;
[Setting("Weapon Movement Offset Speed", "Misc", MaxVal = 10f)]
public float weaponMovementOffsetSpeed { get; set; } = 4f;
[Setting("Weapon Movement Offset Amount", "Misc", MaxVal = 0.2f)]
public float weaponMovementOffset { get; set; } = 0.05f;
[Setting("Camera Recoil Power", "Recoil.Camera", MaxVal = 5f)]
public float cameraRecoilPower { get; set; } = 3f;
[Setting("Camera FOV Recoil Power", "Recoil.Camera", MaxVal = 2f)]
public float cameraRecoilFovPower { get; set; } = 1.2f;
[Setting("Camera Recoil Snappyness", "Recoil.Camera", MaxVal = 3f)]
public float cameraRecoilSnappyness { get; set; } = 1.6f;
[Setting("Camera Vertical Recoil", "Recoil.Camera", MaxVal = 20f)]
public float cameraRecoilUpRotationPower { get; set; } = 5f;
[Setting("Camera Vertical Recoil Snappyness", "Recoil.Camera", MaxVal = 3f)]
public float cameraRecoilUpSnappyness { get; set; } = 1.6f;
[Setting("Camera Mouse Movement", "Recoil.Camera", MaxVal = 1f)]
public float cameraRecoilMoveCameraPower { get; set; } = 0.5f;
[Setting("Camera Mouse Movement Horizontal", "Recoil.Camera", MaxVal = 1f)]
public float cameraRecoilMoveCameraPowerHorizontal { get; set; } = 0.2f;
[Setting("Weapon Recoil Pushback", "Recoil.Weapon", MaxVal = 50f)]
public float weaponRecoilPushbackPower { get; set; } = 30f;
[Setting("Weapon Recoil Pushback Recovery Drag", "Recoil.Weapon", MaxVal = 1f)]
public float weaponRecoilPushbackDrag { get; set; } = 0.4f;
[Setting("Weapon Recoil Random Rotation", "Recoil.Weapon", MaxVal = 25f)]
public float weaponRecoilYZRotation { get; set; } = 10f;
[Setting("Weapon Vertical Recoil", "Recoil.Weapon", MaxVal = 25f)]
public float weaponRecoilUpRotationPower { get; set; } = 10f;
[Setting("Weapon Vertical Recoil Snap", "Recoil.Weapon", MaxVal = 5f)]
public float weaponRecoilUpRotationSnap { get; set; } = 2f;
[Setting("Weapon Control Loss", "Recoil.Weapon", MaxVal = 2f)]
public float recoilRecoveryLoss { get; set; } = 1f;
[Setting("Weapon Control Recovery Speed", "Recoil.Weapon", MaxVal = 4f)]
public float recoilRecoverySpeed { get; set; } = 3f;
}