using System;
using System.Collections;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using AncientScepter;
using BepInEx;
using BepInEx.Bootstrap;
using BepInEx.Configuration;
using EmotesAPI;
using EntityStates;
using EntityStates.Commando;
using EntityStates.GlobalSkills.LunarNeedle;
using EntityStates.Sniper.SniperWeapon;
using EntityStates.SniperClassicSkills;
using EntityStates.SniperClassicSkills.Nemesis;
using EntityStates.Toolbot;
using HG;
using HG.BlendableTypes;
using IL.RoR2;
using Inferno;
using KinematicCharacterController;
using Mono.Cecil.Cil;
using MonoMod.Cil;
using NS_KingKombatArena;
using On.EntityStates.GlobalSkills.LunarNeedle;
using On.RoR2;
using On.RoR2.CharacterAI;
using R2API;
using R2API.Utils;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using RoR2.Achievements;
using RoR2.CharacterAI;
using RoR2.ContentManagement;
using RoR2.Orbs;
using RoR2.Projectile;
using RoR2.Skills;
using RoR2.UI;
using SniperClassic;
using SniperClassic.Components;
using SniperClassic.Controllers;
using SniperClassic.Hooks;
using SniperClassic.Modules;
using SniperClassic.Modules.Achievements;
using SniperClassic.Setup;
using TILER2;
using TMPro;
using ThinkInvisible.ClassicItems;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.Networking;
using UnityEngine.Rendering;
using UnityEngine.SceneManagement;
using UnityEngine.UI;
using Zio.FileSystems;
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("SniperClassic")]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: AssemblyProduct("SniperClassic")]
[assembly: AssemblyTitle("SniperClassic")]
[assembly: AssemblyInformationalVersion("1.0.0+5ed1f012a2857969fe602a854d3a3498504b163f")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace EntityStates
{
public class SniperMain : GenericCharacterMain
{
private Animator cachedAnimator;
public override void OnEnter()
{
//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)
((GenericCharacterMain)this).OnEnter();
cachedAnimator = ((EntityState)this).GetModelAnimator();
Scene activeScene = SceneManager.GetActiveScene();
string name = ((Scene)(ref activeScene)).name;
if (name == "moon" || name == "moon2")
{
cachedAnimator.SetFloat("MoonMan", 1f);
}
}
}
}
namespace EntityStates.SniperClassicSkills
{
internal class SendSpotterDisrupt : SendSpotter
{
public override void SetSpotterMode()
{
spotterMode = SpotterMode.Disrupt;
}
}
internal class SendSpotter : BaseState
{
private float lastUpdateTime;
private SpotterTargetingController spotterTargetingController = null;
public static SkillDef specialSkillDef;
public static float baseExitDuration = 0f;
public static string attackSoundString = "Play_SniperClassic_spotter";
private GenericSkill specialSkillSlot;
private float timerSinceComplete;
private bool beginExit;
private bool foundTarget = false;
public SpotterMode spotterMode;
public override void OnEnter()
{
((BaseState)this).OnEnter();
lastUpdateTime = Time.time;
SetSpotterMode();
spotterTargetingController = ((EntityState)this).gameObject.GetComponent<SpotterTargetingController>();
if (Object.op_Implicit((Object)(object)spotterTargetingController) && Object.op_Implicit((Object)(object)spotterTargetingController.GetTrackingTarget()))
{
foundTarget = true;
}
specialSkillSlot = (Object.op_Implicit((Object)(object)((EntityState)this).skillLocator) ? ((EntityState)this).skillLocator.special : null);
if (foundTarget && Object.op_Implicit((Object)(object)specialSkillSlot))
{
if (((EntityState)this).isAuthority)
{
spotterTargetingController.ClientSendSpotter(spotterMode);
Util.PlaySound(attackSoundString, ((EntityState)this).gameObject);
}
specialSkillSlot.SetSkillOverride((object)this, specialSkillDef, (SkillOverridePriority)4);
if (!((EntityState)this).characterBody.isSprinting)
{
((BaseState)this).StartAimMode(1f, false);
}
((EntityState)this).GetModelAnimator().Play("SpotterOn");
}
else
{
((EntityState)this).OnExit();
}
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
float num = Time.time - lastUpdateTime;
lastUpdateTime = Time.time;
if (!Object.op_Implicit((Object)(object)specialSkillSlot) || specialSkillSlot.stock == 0)
{
beginExit = true;
}
if (beginExit)
{
timerSinceComplete += num;
if (timerSinceComplete > baseExitDuration)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
}
public override void OnExit()
{
if (foundTarget && Object.op_Implicit((Object)(object)specialSkillSlot))
{
specialSkillSlot.UnsetSkillOverride((object)this, specialSkillDef, (SkillOverridePriority)4);
}
((EntityState)this).OnExit();
}
public virtual void SetSpotterMode()
{
spotterMode = SpotterMode.ChainLightning;
}
}
internal class ReturnSpotter : BaseState
{
public static float baseExitDuration = 0.5f;
private SpotterTargetingController spotterTargetingController = null;
public override void OnEnter()
{
((BaseState)this).OnEnter();
spotterTargetingController = ((EntityState)this).gameObject.GetComponent<SpotterTargetingController>();
if (Object.op_Implicit((Object)(object)spotterTargetingController) && ((EntityState)this).isAuthority)
{
spotterTargetingController.ClientReturnSpotter();
}
if (!((EntityState)this).characterBody.isSprinting)
{
((BaseState)this).StartAimMode(1f, false);
}
((EntityState)this).GetModelAnimator().Play("SpotterOff");
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).fixedAge > SendSpotter.baseExitDuration)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override void OnExit()
{
((EntityState)this).OnExit();
}
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;
}
}
internal class SendSpotterDisruptScepter : SendSpotter
{
public override void SetSpotterMode()
{
spotterMode = SpotterMode.DisruptScepter;
}
}
internal class SendSpotterScepter : SendSpotter
{
public override void SetSpotterMode()
{
spotterMode = SpotterMode.ChainLightningScepter;
}
}
public class AimSmokeGrenade : AimThrowableBase
{
private AimStunDrone goodState = null;
private float lastUpdateTime;
public override void OnEnter()
{
//IL_001a: Unknown result type (might be due to invalid IL or missing references)
//IL_0024: Expected O, but got Unknown
lastUpdateTime = Time.time;
if (goodState == null)
{
goodState = new AimStunDrone();
}
base.maxDistance = 64f;
base.rayRadius = 2f;
base.arcVisualizerPrefab = ((AimThrowableBase)goodState).arcVisualizerPrefab;
base.projectilePrefab = FireSmokeGrenade.projectilePrefab;
base.endpointVisualizerPrefab = ((AimThrowableBase)goodState).endpointVisualizerPrefab;
base.endpointVisualizerRadiusScale = 12f;
base.setFuse = false;
base.damageCoefficient = 0f;
base.baseMinimumDuration = 0.2f;
base.projectileBaseSpeed = 80f;
((EntityState)this).GetModelAnimator().Play("SpotterOn");
((AimThrowableBase)this).OnEnter();
}
public override void FixedUpdate()
{
((EntityState)this).characterBody.SetAimTimer(2f);
float num = Time.time - lastUpdateTime;
lastUpdateTime = Time.time;
((EntityState)this).fixedAge = ((EntityState)this).fixedAge + num;
bool flag = false;
if (((EntityState)this).isAuthority && !((AimThrowableBase)this).KeyIsDown() && ((EntityState)this).fixedAge >= base.minimumDuration)
{
flag = true;
}
if (flag)
{
((AimThrowableBase)this).UpdateTrajectoryInfo(ref base.currentTrajectoryInfo);
((EntityState)this).outer.SetNextStateToMain();
}
}
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 FireSmokeGrenade : BaseSkillState
{
public static float baseDuration = 0.5f;
public static float blastRadius = 4f;
public static float bulletRecoil = 1f;
public static string muzzleString = "";
public static GameObject projectilePrefab;
private float duration;
private ChildLocator childLocator;
private Animator animator;
public override void OnEnter()
{
//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_00a9: Unknown result type (might be due to invalid IL or missing references)
//IL_00c6: Unknown result type (might be due to invalid IL or missing references)
//IL_00cf: 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_010e: 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_012f: Unknown result type (might be due to invalid IL or missing references)
//IL_0134: Unknown result type (might be due to invalid IL or missing references)
//IL_0138: Unknown result type (might be due to invalid IL or missing references)
//IL_013d: Unknown result type (might be due to invalid IL or missing references)
//IL_0142: Unknown result type (might be due to invalid IL or missing references)
//IL_015f: 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_0166: Unknown result type (might be due to invalid IL or missing references)
((BaseState)this).OnEnter();
duration = baseDuration / ((BaseState)this).attackSpeedStat;
childLocator = ((Component)((EntityState)this).GetModelTransform()).GetComponent<ChildLocator>();
animator = ((EntityState)this).GetModelAnimator();
Util.PlaySound("Play_commando_M2_grenade_throw", ((EntityState)this).gameObject);
((BaseState)this).AddRecoil(-2f * bulletRecoil, -3f * bulletRecoil, -1f * bulletRecoil, 1f * bulletRecoil);
((EntityState)this).characterBody.AddSpreadBloom(0.33f * bulletRecoil);
if (((EntityState)this).isAuthority)
{
Ray aimRay = ((BaseState)this).GetAimRay();
FireProjectileInfo val = default(FireProjectileInfo);
val.crit = false;
val.damage = 0f;
val.damageColorIndex = (DamageColorIndex)0;
val.damageTypeOverride = DamageTypeCombo.op_Implicit((DamageType)32);
val.force = 0f;
val.owner = ((EntityState)this).gameObject;
val.position = childLocator.FindChild(muzzleString).position;
val.procChainMask = default(ProcChainMask);
val.projectilePrefab = projectilePrefab;
Ray aimRay2 = ((BaseState)this).GetAimRay();
val.rotation = Quaternion.LookRotation(((Ray)(ref aimRay2)).direction);
val.useFuseOverride = false;
val.useSpeedOverride = false;
val.target = null;
FireProjectileInfo val2 = val;
ProjectileManager.instance.FireProjectile(val2);
((BaseState)this).AddRecoil(-2f * bulletRecoil, -3f * bulletRecoil, -1f * bulletRecoil, 1f * bulletRecoil);
}
}
public override void OnExit()
{
((EntityState)this).OnExit();
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
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 Backflip : BaseSkillState
{
public static float duration = 0.4f;
public static float stunRadius = 12f;
public static GameObject stunEffectPrefab;
public static GameObject shockEffectPrefab;
private Vector3 stunPosition;
private float previousAirControl;
public override void OnEnter()
{
//IL_002a: Unknown result type (might be due to invalid IL or missing references)
//IL_002f: Unknown result type (might be due to invalid IL or missing references)
//IL_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_003c: 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)
//IL_0166: 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_0178: Unknown result type (might be due to invalid IL or missing references)
//IL_0179: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0064: 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_0078: Unknown result type (might be due to invalid IL or missing references)
//IL_007d: Unknown result type (might be due to invalid IL or missing references)
//IL_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_008d: Unknown result type (might be due to invalid IL or missing references)
//IL_008f: Unknown result type (might be due to invalid IL or missing references)
//IL_009a: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00a5: 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_00b8: 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_00d7: 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_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_0154: Unknown result type (might be due to invalid IL or missing references)
//IL_0159: 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)
((BaseState)this).OnEnter();
previousAirControl = ((EntityState)this).characterMotor.airControl;
((EntityState)this).characterMotor.airControl = 0.15f;
Ray aimRay = ((BaseState)this).GetAimRay();
Vector3 val = -((Ray)(ref aimRay)).direction;
if (((EntityState)this).isAuthority)
{
val.y = Mathf.Max(val.y, 0.05f);
Vector3 val2 = ((Vector3)(ref val)).normalized * 4f * 10f;
Vector3 val3 = Vector3.up * 7f;
Vector3 val4 = new Vector3(val.x, 0f, val.z);
Vector3 val5 = ((Vector3)(ref val4)).normalized * 3f;
((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f);
((EntityState)this).characterMotor.velocity = val2 + val3 + val5;
((EntityState)this).characterMotor.velocity.y *= 0.8f;
if (((EntityState)this).characterMotor.velocity.y < 0f)
{
((EntityState)this).characterMotor.velocity.y *= 0.1f;
}
((EntityState)this).characterBody.isSprinting = true;
TriggerReload();
stunPosition = ((EntityState)this).characterBody.corePosition;
}
((EntityState)this).characterDirection.moveVector = val;
CharacterBody characterBody = ((EntityState)this).characterBody;
characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1);
((EntityState)this).PlayAnimation("FullBody, Override", "Backflip", "Backflip.playbackRate", 2f * duration, 0f);
Util.PlayAttackSpeedSound(DodgeState.dodgeSoundString, ((EntityState)this).gameObject, 1.5f);
if (NetworkServer.active && stunRadius > 0f)
{
StunEnemies(stunPosition);
}
}
private void StunEnemies(Vector3 stunPosition)
{
//IL_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_002e: 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_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)
if (!Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
{
return;
}
if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody.coreTransform))
{
EffectManager.SimpleEffect(stunEffectPrefab, stunPosition, ((EntityState)this).characterBody.coreTransform.rotation, true);
}
List<HealthComponent> list = new List<HealthComponent>();
Collider[] array = Physics.OverlapSphere(stunPosition, stunRadius, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask));
for (int i = 0; i < array.Length; i++)
{
HurtBox component = ((Component)array[i]).GetComponent<HurtBox>();
if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.healthComponent) || list.Contains(component.healthComponent))
{
continue;
}
list.Add(component.healthComponent);
if (Object.op_Implicit((Object)(object)component.healthComponent.body.teamComponent) && component.healthComponent.body.teamComponent.teamIndex != ((BaseState)this).GetTeam())
{
SetStateOnHurt component2 = ((Component)component.healthComponent).gameObject.GetComponent<SetStateOnHurt>();
if (Object.op_Implicit((Object)(object)component2) && component2.canBeStunned)
{
component2.SetStun(1f);
}
}
}
}
private void TriggerReload()
{
ReloadController component = ((Component)((EntityState)this).characterBody).GetComponent<ReloadController>();
if (Object.op_Implicit((Object)(object)component))
{
component.AutoReload();
}
}
public override void OnExit()
{
//IL_000f: Unknown result type (might be due to invalid IL or missing references)
//IL_0016: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_003e: Unknown result type (might be due to invalid IL or missing references)
//IL_0043: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).OnExit();
CharacterBody characterBody = ((EntityState)this).characterBody;
characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags & -2);
((EntityState)this).characterMotor.airControl = previousAirControl;
CharacterMotor characterMotor = ((EntityState)this).characterMotor;
characterMotor.velocity *= 0.9f;
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
((BaseState)this).StartAimMode(0.5f, false);
if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
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)7;
}
public override void OnSerialize(NetworkWriter writer)
{
//IL_0003: Unknown result type (might be due to invalid IL or missing references)
writer.Write(stunPosition);
}
public override void OnDeserialize(NetworkReader reader)
{
//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)
stunPosition = reader.ReadVector3();
}
}
internal class CombatRoll : BaseState
{
public static float duration = 0.4f;
public static float initialSpeedCoefficient = 7.25f;
public static float finalSpeedCoefficient = 3.625f;
public static string dodgeSoundString = DodgeState.dodgeSoundString;
public static float dodgeFOV = DodgeState.dodgeFOV;
public static float initialHopVelocity = 20f;
private float rollSpeed;
private Vector3 forwardDirection;
private Animator animator;
private Vector3 previousPosition;
private ScopeController scopeController;
public override void OnEnter()
{
//IL_0073: 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_00c6: 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_0097: 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_00cb: 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_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d2: 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_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_00e6: Unknown result type (might be due to invalid IL or missing references)
//IL_00eb: 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_00a0: 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_0211: Unknown result type (might be due to invalid IL or missing references)
//IL_021c: Unknown result type (might be due to invalid IL or missing references)
//IL_0221: Unknown result type (might be due to invalid IL or missing references)
//IL_0241: Unknown result type (might be due to invalid IL or missing references)
//IL_0234: Unknown result type (might be due to invalid IL or missing references)
//IL_0246: Unknown result type (might be due to invalid IL or missing references)
//IL_024f: Unknown result type (might be due to invalid IL or missing references)
//IL_0254: Unknown result type (might be due to invalid IL or missing references)
//IL_0256: Unknown result type (might be due to invalid IL or missing references)
//IL_025b: Unknown result type (might be due to invalid IL or missing references)
((BaseState)this).OnEnter();
scopeController = ((EntityState)this).gameObject.GetComponent<ScopeController>();
Util.PlaySound(dodgeSoundString, ((EntityState)this).gameObject);
animator = ((EntityState)this).GetModelAnimator();
ChildLocator component = ((Component)animator).GetComponent<ChildLocator>();
if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
{
Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector);
forwardDirection = ((Vector3)(ref val)).normalized;
}
Vector3 val2 = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : forwardDirection);
Vector3 val3 = Vector3.Cross(Vector3.up, val2);
float num = Vector3.Dot(forwardDirection, val2);
float num2 = Vector3.Dot(forwardDirection, val3);
((EntityState)this).PlayAnimation("FullBody, Override", "Roll", "Roll.playbackRate", duration * 2f, 0f);
animator.SetFloat("forwardSpeed", num, 0.1f, 1f / 60f);
animator.SetFloat("rightSpeed", num2, 0.1f, 1f / 60f);
if (Mathf.Abs(num) > Mathf.Abs(num2))
{
((EntityState)this).PlayAnimation("Body", (num > 0f) ? "DodgeForward" : "DodgeBackward", "Dodge.playbackRate", duration, 0f);
}
else
{
((EntityState)this).PlayAnimation("Body", (num2 > 0f) ? "DodgeRight" : "DodgeLeft", "Dodge.playbackRate", duration, 0f);
}
RecalculateRollSpeed();
if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection))
{
((EntityState)this).characterMotor.velocity.y = 0f;
((EntityState)this).characterMotor.velocity = forwardDirection * rollSpeed;
}
Vector3 val4 = (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) ? ((EntityState)this).characterMotor.velocity : Vector3.zero);
previousPosition = ((EntityState)this).transform.position - val4;
if (((EntityState)this).isAuthority)
{
TriggerReload();
}
if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
{
((EntityState)this).characterBody.AddTimedBuff(Buffs.Cloak, 1f);
}
}
private void RecalculateRollSpeed()
{
rollSpeed = base.moveSpeedStat * Mathf.Lerp(initialSpeedCoefficient, finalSpeedCoefficient, ((EntityState)this).fixedAge / duration);
}
public override void FixedUpdate()
{
//IL_006f: 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_007a: Unknown result type (might be due to invalid IL or missing references)
//IL_007f: Unknown result type (might be due to invalid IL or missing references)
//IL_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_00a2: Unknown result type (might be due to invalid IL or missing references)
//IL_00a3: Unknown result type (might be due to invalid IL or missing references)
//IL_012c: Unknown result type (might be due to invalid IL or missing references)
//IL_0131: 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_00bc: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: 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_00d8: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: Unknown result type (might be due to invalid IL or missing references)
//IL_00f9: Unknown result type (might be due to invalid IL or missing references)
//IL_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_011d: Unknown result type (might be due to invalid IL or missing references)
//IL_011f: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).FixedUpdate();
RecalculateRollSpeed();
if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams) && (!Object.op_Implicit((Object)(object)scopeController) || !scopeController.IsScoped))
{
((EntityState)this).cameraTargetParams.fovOverride = Mathf.Lerp(dodgeFOV, 60f, ((EntityState)this).fixedAge / duration);
}
Vector3 val = ((EntityState)this).transform.position - previousPosition;
Vector3 normalized = ((Vector3)(ref val)).normalized;
if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) && normalized != Vector3.zero)
{
Vector3 val2 = normalized * rollSpeed;
float y = val2.y;
val2.y = 0f;
float num = Mathf.Max(Vector3.Dot(val2, forwardDirection), 0f);
val2 = forwardDirection * num;
val2.y += Mathf.Max(y, 0f);
((EntityState)this).characterMotor.velocity = val2;
}
previousPosition = ((EntityState)this).transform.position;
if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override void Update()
{
//IL_0027: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).Update();
if (((EntityState)this).fixedAge < 0.75f * duration)
{
((EntityState)this).characterDirection.forward = forwardDirection;
}
}
public override void OnExit()
{
if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams) && (!Object.op_Implicit((Object)(object)scopeController) || !scopeController.IsScoped))
{
((EntityState)this).cameraTargetParams.fovOverride = -1f;
}
((EntityState)this).OnExit();
}
public override void OnSerialize(NetworkWriter writer)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).OnSerialize(writer);
writer.Write(forwardDirection);
}
public override void OnDeserialize(NetworkReader reader)
{
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_0010: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).OnDeserialize(reader);
forwardDirection = reader.ReadVector3();
}
private void TriggerReload()
{
ReloadController component = ((Component)((EntityState)this).characterBody).GetComponent<ReloadController>();
if (Object.op_Implicit((Object)(object)component))
{
component.AutoReload();
}
}
}
internal class AIReload : BaseState
{
public static float delay = 0.4f;
private bool triggeredReload = false;
public static float boltDuration = 0.5f;
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (!(((EntityState)this).fixedAge > delay))
{
return;
}
if (!triggeredReload)
{
triggeredReload = true;
ReloadController component = ((EntityState)this).GetComponent<ReloadController>();
if (Object.op_Implicit((Object)(object)component))
{
if (((EntityState)this).isAuthority)
{
component.SetReloadQuality(ReloadController.ReloadQuality.Perfect);
}
((EntityState)this).PlayAnimation("Reload, Override", "ReloadGunFull", "Reload.playbackRate", 0.5f, 0f);
}
}
else if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge > delay + boltDuration)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override void OnExit()
{
((EntityState)this).OnExit();
if (Object.op_Implicit((Object)(object)((EntityState)this).skillLocator) && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.primary))
{
((EntityState)this).skillLocator.primary.stock = ((EntityState)this).skillLocator.primary.maxStock;
}
}
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 abstract class BaseReloadState : BaseState
{
private float duration;
private ReloadController reloadComponent;
private ScopeController scopeComponent;
protected float internalBaseDuration;
public override void OnEnter()
{
((BaseState)this).OnEnter();
SetStats();
duration = internalBaseDuration;
scopeComponent = ((EntityState)this).GetComponent<ScopeController>();
reloadComponent = ((EntityState)this).GetComponent<ReloadController>();
if (Object.op_Implicit((Object)(object)scopeComponent))
{
scopeComponent.pauseCharge = true;
scopeComponent.charge = 0f;
}
if (Object.op_Implicit((Object)(object)reloadComponent))
{
reloadComponent.Reload(duration);
}
PlayReloadAnimation();
}
private void PlayReloadAnimation()
{
((EntityState)this).PlayAnimation("Reload, Override", "ReloadGunEnd");
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge > duration && reloadComponent.finishedReload)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public void AutoReload()
{
reloadComponent.SetReloadQuality(ReloadController.ReloadQuality.Perfect, playLoadSound: false);
((EntityState)this).PlayAnimation("Reload, Override", "BufferEmpty");
((EntityState)this).OnExit();
}
public override void OnExit()
{
((EntityState)this).OnExit();
if (Object.op_Implicit((Object)(object)scopeComponent))
{
scopeComponent.ResetCharge();
scopeComponent.pauseCharge = false;
}
}
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 abstract void SetStats();
}
public abstract class BaseSnipeState : BaseState
{
public float reloadDamageMult = 1f;
public float charge = 0f;
private ScopeController scopeComponent;
private ReloadController reloadComponent;
private float duration;
private GenericSkill primarySkillSlot;
private bool startedReload = false;
private bool isAI = false;
private bool isCharged = false;
protected float internalDamage;
protected float internalRadius;
protected float internalForce;
protected float internalBaseDuration;
protected string internalAttackSoundString;
protected string internalChargedAttackSoundString;
protected float internalRecoilAmplitude;
protected float inernalBaseChargeDuration;
protected SkillDef internalReloadDef;
protected float internalReloadBarLength;
public static GameObject effectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/muzzleflashes/muzzleflashbanditshotgun");
public static GameObject hitEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/muzzleflashes/muzzleflashbanditshotgun");
public static GameObject headshotEffectPrefab;
public override void OnEnter()
{
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_0175: Unknown result type (might be due to invalid IL or missing references)
//IL_0177: Unknown result type (might be due to invalid IL or missing references)
//IL_01e7: Unknown result type (might be due to invalid IL or missing references)
((BaseState)this).OnEnter();
isAI = !((EntityState)this).characterBody.isPlayerControlled;
SetStats();
primarySkillSlot = (Object.op_Implicit((Object)(object)((EntityState)this).skillLocator) ? ((EntityState)this).skillLocator.primary : null);
duration = internalBaseDuration;
scopeComponent = ((EntityState)this).GetComponent<ScopeController>();
bool flag = false;
float chargeMult = 1f;
if (Object.op_Implicit((Object)(object)scopeComponent))
{
charge = scopeComponent.ShotFired();
chargeMult = scopeComponent.GetChargeMult(charge);
scopeComponent.pauseCharge = true;
flag = scopeComponent.IsScoped;
}
reloadComponent = ((EntityState)this).GetComponent<ReloadController>();
reloadDamageMult = reloadComponent.GetDamageMult();
reloadComponent.hideLoadIndicator = true;
if (charge > 0f)
{
Util.HandleLuminousShotServer(((EntityState)this).characterBody);
}
reloadComponent.brReload = false;
isCharged = (((EntityState)this).isAuthority && charge > 0.5f) || (!((EntityState)this).isAuthority && scopeComponent.chargeShotReady);
Util.PlaySound(internalAttackSoundString, ((EntityState)this).gameObject);
if (isCharged)
{
Util.PlaySound(internalChargedAttackSoundString, ((EntityState)this).gameObject);
}
Ray aimRay = ((BaseState)this).GetAimRay();
((BaseState)this).StartAimMode(aimRay, 4f, false);
string text = "FireGun";
bool crit = ((BaseState)this).RollCrit();
if (isCharged)
{
text = "FireGunStrong";
}
((EntityState)this).PlayAnimation("Gesture, Override", text);
((EntityState)this).PlayAnimation("Reload, Override", "BufferEmpty");
EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, "Muzzle", false);
if (((EntityState)this).isAuthority)
{
FireBullet(aimRay, chargeMult, crit);
((EntityState)this).characterBody.AddSpreadBloom(0.6f);
}
float num = internalRecoilAmplitude * (flag ? 1f : 1f);
((BaseState)this).AddRecoil(-1f * num, -2f * internalRecoilAmplitude, -0.5f * num, 0.5f * num);
reloadComponent.ResetReloadQuality();
}
public virtual void FireBullet(Ray aimRay, float chargeMult, bool crit)
{
//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_001e: 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)
//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_003a: 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_0050: Unknown result type (might be due to invalid IL or missing references)
//IL_005b: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_006d: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_0095: 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_00a7: 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_00bd: Unknown result type (might be due to invalid IL or missing references)
//IL_00c4: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: 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_00e0: Unknown result type (might be due to invalid IL or missing references)
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
//IL_00f3: 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_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: Expected O, but got Unknown
//IL_0120: Unknown result type (might be due to invalid IL or missing references)
//IL_0136: Unknown result type (might be due to invalid IL or missing references)
//IL_0153: Unknown result type (might be due to invalid IL or missing references)
//IL_015d: Expected O, but got Unknown
float num = Mathf.Min(chargeMult, ScopeController.baseMaxChargeMult);
BulletAttack val = new BulletAttack
{
owner = ((EntityState)this).gameObject,
weapon = ((EntityState)this).gameObject,
origin = ((Ray)(ref aimRay)).origin,
aimVector = ((Ray)(ref aimRay)).direction,
minSpread = 0f,
maxSpread = 0f,
bulletCount = 1u,
procCoefficient = 1f,
damage = reloadDamageMult * internalDamage * base.damageStat * chargeMult,
force = internalForce,
falloffModel = (FalloffModel)0,
tracerEffectPrefab = Assets.snipeTracer,
muzzleName = "Muzzle",
hitEffectPrefab = hitEffectPrefab,
isCrit = crit,
HitEffectNormal = true,
radius = internalRadius * num,
smartCollision = true,
maxDistance = 2000f,
damageType = DamageTypeCombo.op_Implicit((DamageType)0),
stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask
};
val.damageType.damageSource = (DamageSource)((!(charge > 0f)) ? 1 : 2);
if (chargeMult >= ScopeController.baseMaxChargeMult)
{
DamageAPI.AddModdedDamageType(val, SniperContent.FullCharge);
if (global::SniperClassic.SniperClassic.enableWeakPoints)
{
val.modifyOutgoingDamageCallback = (ModifyOutgoingDamageCallback)delegate(BulletAttack _bulletAttack, ref BulletHit hitInfo, DamageInfo damageInfo)
{
//IL_0021: 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_002b: 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_0039: 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_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_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Expected O, but got Unknown
if (BulletAttack.IsSniperTargetHit(ref hitInfo))
{
damageInfo.damage *= ScopeController.weakpointMultiplier;
damageInfo.damageColorIndex = (DamageColorIndex)12;
EffectData val2 = new EffectData
{
origin = hitInfo.point,
rotation = Quaternion.LookRotation(-hitInfo.direction)
};
val2.SetHurtBoxReference(hitInfo.hitHurtBox);
EffectManager.SpawnEffect(headshotEffectPrefab, val2, true);
Util.PlaySound("Play_SniperClassic_headshot", ((EntityState)this).gameObject);
}
};
}
if (!global::SniperClassic.SniperClassic.arenaActive || !global::SniperClassic.SniperClassic.arenaNerf)
{
ref DamageType damageType = ref val.damageType.damageType;
damageType = (DamageType)((uint)damageType | 0x20u);
}
}
val.Fire();
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).fixedAge > duration && ((EntityState)this).isAuthority && !startedReload)
{
startedReload = true;
if (!isAI && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator) && Object.op_Implicit((Object)(object)primarySkillSlot))
{
reloadComponent.EnableReloadBar(internalReloadBarLength);
EnterReloadAnimation();
primarySkillSlot.SetSkillOverride((object)this, internalReloadDef, (SkillOverridePriority)4);
}
else
{
((EntityState)this).outer.SetNextState((EntityState)(object)new AIReload());
}
}
}
public virtual void EnterReloadAnimation()
{
((EntityState)this).PlayAnimation("Reload, Override", "ReloadGunReady");
}
public override void OnExit()
{
((EntityState)this).OnExit();
if (Object.op_Implicit((Object)(object)primarySkillSlot) && !isAI)
{
primarySkillSlot.UnsetSkillOverride((object)this, internalReloadDef, (SkillOverridePriority)4);
}
if (Object.op_Implicit((Object)(object)reloadComponent))
{
reloadComponent.hideLoadIndicator = false;
}
if (Object.op_Implicit((Object)(object)scopeComponent))
{
scopeComponent.pauseCharge = false;
}
}
public void AutoReload()
{
startedReload = true;
if (Object.op_Implicit((Object)(object)reloadComponent))
{
reloadComponent.SetReloadQuality(ReloadController.ReloadQuality.Perfect, playLoadSound: false);
}
((EntityState)this).outer.SetNextStateToMain();
}
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 void SetStats();
}
internal class HeavySnipe : BaseSnipeState
{
public static GameObject projectilePrefab;
public static GameObject headshotProjectilePrefab;
public static float damageCoefficient = 5.4f;
public static float radius = 0.4f;
public static float force = 2500f;
public static float baseDuration = 0.4f;
public static float baseChargeDuration = 3f;
public static float reloadBarLength = 1f;
public static SkillDef reloadDef;
public static string attackSoundString = "Play_SniperClassic_m1_heavy";
public static string chargedAttackSoundString = "Play_SniperClassic_m2_shoot";
public static float recoilAmplitude = 2.5f;
public override void SetStats()
{
internalDamage = damageCoefficient;
internalRadius = radius;
internalForce = force;
internalBaseDuration = baseDuration;
internalAttackSoundString = attackSoundString;
internalChargedAttackSoundString = chargedAttackSoundString;
internalRecoilAmplitude = recoilAmplitude;
internalReloadDef = reloadDef;
internalReloadBarLength = reloadBarLength;
}
public override void FireBullet(Ray aimRay, float chargeMult, bool crit)
{
//IL_000f: 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_0034: 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_008c: Unknown result type (might be due to invalid IL or missing references)
//IL_00c0: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: 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_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_00e3: Unknown result type (might be due to invalid IL or missing references)
//IL_011e: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
//IL_00ee: Unknown result type (might be due to invalid IL or missing references)
bool flag = chargeMult >= ScopeController.baseMaxChargeMult;
FireProjectileInfo val = default(FireProjectileInfo);
val.projectilePrefab = (flag ? headshotProjectilePrefab : projectilePrefab);
val.position = ((Ray)(ref aimRay)).origin;
val.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction);
val.owner = ((EntityState)this).gameObject;
val.damage = ((BaseState)this).damageStat * damageCoefficient * chargeMult * reloadDamageMult;
val.force = force;
val.crit = crit;
val.damageColorIndex = (DamageColorIndex)0;
val.target = null;
((FireProjectileInfo)(ref val)).speedOverride = -1f;
((FireProjectileInfo)(ref val)).fuseOverride = -1f;
val.damageTypeOverride = null;
FireProjectileInfo val2 = val;
DamageTypeCombo value = DamageTypeCombo.op_Implicit((DamageType)0) | DamageTypeCombo.op_Implicit((DamageSource)((!(charge > 0f)) ? 1 : 2));
if (flag)
{
DamageAPI.AddModdedDamageType(ref value, SniperContent.FullCharge);
if (!global::SniperClassic.SniperClassic.arenaActive && global::SniperClassic.SniperClassic.arenaNerf)
{
ref DamageType damageType = ref value.damageType;
damageType = (DamageType)((uint)damageType | 0x20u);
}
}
val2.damageTypeOverride = value;
ProjectileManager.instance.FireProjectile(val2);
}
}
internal class ReloadHeavySnipe : BaseReloadState
{
public static float baseDuration = 0.5f;
public override void SetStats()
{
internalBaseDuration = baseDuration;
}
}
internal class FireBattleRifle : BaseState
{
private ScopeController scopeComponent;
private ReloadController reloadComponent;
public float charge = 0f;
public static GameObject tracerEffectPrefab = FireRifle.tracerEffectPrefab;
public static GameObject effectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/muzzleflashes/muzzleflashbanditshotgun");
public static GameObject hitEffectPrefab = LegacyResourcesAPI.Load<GameObject>("prefabs/effects/muzzleflashes/muzzleflashbanditshotgun");
public static GameObject headshotEffectPrefab;
public static SkillDef reloadDef;
private GenericSkill primarySkillSlot;
private bool startedReload = false;
public static float reloadLength = 1.2f;
public static float damageCoefficient = 3.6f;
public static float force = 1000f;
public static float baseMinDuration = 0.33f;
public static float baseMaxDuration = 0.5f;
public static float radius = 0.4f;
public static string attackSoundString = "Play_SniperClassic_m1_br_shoot";
public static string chargedAttackSoundString = "Play_SniperClassic_m2_br";
public static float recoilAmplitude = 3f;
public static float baseChargeDuration = 2f;
public static NetworkSoundEventDef pingSound;
private float maxDuration;
private float minDuration;
private bool buttonReleased;
public bool isMash = false;
private bool lastShot = false;
private bool isScoped = false;
private bool isCharged = false;
private bool isAI = false;
public override void OnEnter()
{
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00e6: Unknown result type (might be due to invalid IL or missing references)
//IL_0202: Unknown result type (might be due to invalid IL or missing references)
//IL_0207: Unknown result type (might be due to invalid IL or missing references)
//IL_0209: Unknown result type (might be due to invalid IL or missing references)
//IL_029c: Unknown result type (might be due to invalid IL or missing references)
//IL_02a1: Unknown result type (might be due to invalid IL or missing references)
//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
//IL_02b9: Unknown result type (might be due to invalid IL or missing references)
//IL_02bc: Unknown result type (might be due to invalid IL or missing references)
//IL_02c1: Unknown result type (might be due to invalid IL or missing references)
//IL_02c6: Unknown result type (might be due to invalid IL or missing references)
//IL_02c9: Unknown result type (might be due to invalid IL or missing references)
//IL_02d4: Unknown result type (might be due to invalid IL or missing references)
//IL_02df: Unknown result type (might be due to invalid IL or missing references)
//IL_02ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0306: 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_0325: Unknown result type (might be due to invalid IL or missing references)
//IL_0333: Unknown result type (might be due to invalid IL or missing references)
//IL_0335: Unknown result type (might be due to invalid IL or missing references)
//IL_033a: Unknown result type (might be due to invalid IL or missing references)
//IL_0345: Unknown result type (might be due to invalid IL or missing references)
//IL_034d: 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_0360: Unknown result type (might be due to invalid IL or missing references)
//IL_0367: Unknown result type (might be due to invalid IL or missing references)
//IL_0375: Unknown result type (might be due to invalid IL or missing references)
//IL_037c: Unknown result type (might be due to invalid IL or missing references)
//IL_0388: Unknown result type (might be due to invalid IL or missing references)
//IL_038e: Unknown result type (might be due to invalid IL or missing references)
//IL_0393: Unknown result type (might be due to invalid IL or missing references)
//IL_0398: Unknown result type (might be due to invalid IL or missing references)
//IL_039a: Unknown result type (might be due to invalid IL or missing references)
//IL_039f: Unknown result type (might be due to invalid IL or missing references)
//IL_03a6: Expected O, but got Unknown
//IL_03be: Unknown result type (might be due to invalid IL or missing references)
//IL_03d7: Unknown result type (might be due to invalid IL or missing references)
//IL_03f7: Unknown result type (might be due to invalid IL or missing references)
//IL_0401: Expected O, but got Unknown
((BaseState)this).OnEnter();
primarySkillSlot = (Object.op_Implicit((Object)(object)((EntityState)this).skillLocator) ? ((EntityState)this).skillLocator.primary : null);
scopeComponent = ((EntityState)this).GetComponent<ScopeController>();
reloadComponent = ((EntityState)this).GetComponent<ReloadController>();
if (Object.op_Implicit((Object)(object)reloadComponent))
{
reloadComponent.hideLoadIndicator = true;
}
maxDuration = baseMaxDuration / base.attackSpeedStat;
minDuration = baseMinDuration / base.attackSpeedStat;
if (((EntityState)this).characterBody.skillLocator.primary.stock > 0)
{
((EntityState)this).characterBody.skillLocator.primary.rechargeStopwatch = 0f;
}
else
{
lastShot = true;
if (((EntityState)this).isAuthority)
{
EffectManager.SimpleSoundEffect(pingSound.index, ((EntityState)this).transform.position, true);
}
}
float num = 1f;
if (Object.op_Implicit((Object)(object)scopeComponent))
{
charge = scopeComponent.ShotFired();
num = scopeComponent.GetChargeMult(charge);
isScoped = scopeComponent.IsScoped;
scopeComponent.pauseCharge = true;
}
if (charge > 0f)
{
Util.HandleLuminousShotServer(((EntityState)this).characterBody);
}
float num2 = recoilAmplitude * (isScoped ? 0.1f : 1f);
((BaseState)this).AddRecoil(-1f * num2, -2f * num2, -0.5f * num2, 0.5f * num2);
isCharged = (((EntityState)this).isAuthority && charge > 0.2f) || (!((EntityState)this).isAuthority && scopeComponent.chargeShotReady);
Util.PlaySound(isCharged ? chargedAttackSoundString : attackSoundString, ((EntityState)this).gameObject);
Ray aimRay = ((BaseState)this).GetAimRay();
((BaseState)this).StartAimMode(aimRay, 4f, false);
string text = "FireGunMark";
bool isCrit = ((BaseState)this).RollCrit();
if (isCharged)
{
text = "FireMarkCharge";
}
((EntityState)this).PlayAnimation("Gesture, Override", text, "FireGun.playbackRate", maxDuration, 0f);
((EntityState)this).PlayAnimation("Reload, Override", "BufferEmpty");
string text2 = "Muzzle";
EffectManager.SimpleMuzzleFlash(effectPrefab, ((EntityState)this).gameObject, text2, false);
if (((EntityState)this).isAuthority)
{
float num3 = Mathf.Min(num, ScopeController.baseMaxChargeMult);
BulletAttack val = new BulletAttack
{
owner = ((EntityState)this).gameObject,
weapon = ((EntityState)this).gameObject,
origin = ((Ray)(ref aimRay)).origin,
aimVector = ((Ray)(ref aimRay)).direction,
minSpread = 0f,
maxSpread = (isScoped ? 0f : ((EntityState)this).characterBody.spreadBloomAngle),
bulletCount = 1u,
procCoefficient = 1f,
damage = damageCoefficient * base.damageStat * num,
force = force * num3,
falloffModel = (FalloffModel)0,
tracerEffectPrefab = Assets.markTracer,
muzzleName = text2,
hitEffectPrefab = hitEffectPrefab,
isCrit = isCrit,
HitEffectNormal = true,
radius = radius * num3,
smartCollision = true,
maxDistance = 2000f,
stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask,
damageType = DamageTypeCombo.op_Implicit((DamageType)0)
};
val.damageType.damageSource = (DamageSource)((!(charge > 0f)) ? 1 : 2);
if (num >= ScopeController.baseMaxChargeMult)
{
DamageAPI.AddModdedDamageType(val, SniperContent.FullCharge);
if (global::SniperClassic.SniperClassic.enableWeakPoints)
{
val.modifyOutgoingDamageCallback = (ModifyOutgoingDamageCallback)delegate(BulletAttack _bulletAttack, ref BulletHit hitInfo, DamageInfo damageInfo)
{
//IL_0021: 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_002b: 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_0039: 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_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_004b: Unknown result type (might be due to invalid IL or missing references)
//IL_0051: Expected O, but got Unknown
if (BulletAttack.IsSniperTargetHit(ref hitInfo))
{
damageInfo.damage *= ScopeController.weakpointMultiplier;
damageInfo.damageColorIndex = (DamageColorIndex)12;
EffectData val2 = new EffectData
{
origin = hitInfo.point,
rotation = Quaternion.LookRotation(-hitInfo.direction)
};
val2.SetHurtBoxReference(hitInfo.hitHurtBox);
EffectManager.SpawnEffect(headshotEffectPrefab, val2, true);
Util.PlaySound("Play_SniperClassic_headshot", ((EntityState)this).gameObject);
}
};
}
if (!global::SniperClassic.SniperClassic.arenaActive || !global::SniperClassic.SniperClassic.arenaNerf)
{
ref DamageType damageType = ref val.damageType.damageType;
damageType = (DamageType)((uint)damageType | 0x20u);
}
}
val.Fire();
((EntityState)this).characterBody.AddSpreadBloom(0.6f);
}
isAI = !((EntityState)this).characterBody.isPlayerControlled;
}
public override void OnExit()
{
if (lastShot && !isAI)
{
primarySkillSlot.UnsetSkillOverride((object)this, reloadDef, (SkillOverridePriority)4);
}
if (Object.op_Implicit((Object)(object)scopeComponent))
{
scopeComponent.pauseCharge = false;
}
if (!buttonReleased && Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
{
((EntityState)this).characterBody.SetSpreadBloom(0f, false);
}
((EntityState)this).OnExit();
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
buttonReleased |= !((EntityState)this).inputBank.skill1.down;
if (!(((EntityState)this).fixedAge >= maxDuration) || !((EntityState)this).isAuthority)
{
return;
}
if (!lastShot)
{
((EntityState)this).outer.SetNextStateToMain();
}
else
{
if (startedReload)
{
return;
}
startedReload = true;
if (!isAI)
{
if (Object.op_Implicit((Object)(object)((EntityState)this).skillLocator) && Object.op_Implicit((Object)(object)primarySkillSlot))
{
reloadComponent.EnableReloadBar(reloadLength, brReload: true, ReloadBR.baseDuration);
EnterReloadAnimation();
primarySkillSlot.SetSkillOverride((object)this, reloadDef, (SkillOverridePriority)4);
}
else if (reloadComponent.finishedReload)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
else
{
((EntityState)this).outer.SetNextState((EntityState)(object)new AIReload());
}
}
}
public virtual void EnterReloadAnimation()
{
((EntityState)this).PlayAnimation("Reload, Override", "ReloadMarkReady");
}
public override InterruptPriority GetMinimumInterruptPriority()
{
//IL_002f: 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_0032: Unknown result type (might be due to invalid IL or missing references)
if (!lastShot && buttonReleased && ((EntityState)this).fixedAge >= minDuration)
{
return (InterruptPriority)0;
}
return (InterruptPriority)1;
}
public void AutoReload()
{
((EntityState)this).outer.SetNextStateToMain();
}
}
internal class ReloadBR : BaseState
{
public bool forceFail;
public bool buttonReleased = false;
private float duration;
public ScopeController scopeComponent;
public ReloadController reloadComponent;
public static float baseDuration = 0.6f;
public static bool scaleReloadSpeed = false;
public override void OnEnter()
{
((BaseState)this).OnEnter();
duration = (scaleReloadSpeed ? (baseDuration / base.attackSpeedStat) : baseDuration);
scopeComponent = ((EntityState)this).GetComponent<ScopeController>();
reloadComponent = ((EntityState)this).GetComponent<ReloadController>();
((EntityState)this).PlayAnimation("Reload, Override", "ReloadMarkEnd");
if (Object.op_Implicit((Object)(object)scopeComponent))
{
scopeComponent.pauseCharge = true;
scopeComponent.charge = 0f;
}
if (Object.op_Implicit((Object)(object)reloadComponent))
{
reloadComponent.ReloadBR(duration, forceFail);
}
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge > duration && reloadComponent.finishedReload)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
public override void OnExit()
{
if (Object.op_Implicit((Object)(object)scopeComponent))
{
scopeComponent.ResetCharge();
scopeComponent.pauseCharge = false;
}
if (Object.op_Implicit((Object)(object)((EntityState)this).skillLocator))
{
((EntityState)this).skillLocator.primary.stock = ((EntityState)this).skillLocator.primary.maxStock;
}
((EntityState)this).OnExit();
}
public void AutoReload()
{
((EntityState)this).outer.SetNextStateToMain();
}
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;
}
}
internal class ReloadSnipe : BaseReloadState
{
public static float baseDuration = 0.5f;
public override void SetStats()
{
internalBaseDuration = baseDuration;
}
}
internal class Snipe : BaseSnipeState
{
public static float damageCoefficient = 4.3f;
public static float radius = 0.4f;
public static float force = 2000f;
public static float baseDuration = 0.4f;
public static float baseChargeDuration = 3f;
public static float reloadBarLength = 0.6f;
public static float reloadBarLengthSlow = 1f;
public static SkillDef reloadDef;
public static string attackSoundString = "Play_SniperClassic_m1_shoot";
public static string chargedAttackSoundString = "Play_SniperClassic_m2_shoot";
public static float recoilAmplitude = 2.5f;
public static ConfigEntry<bool> useSlowReload;
public override void SetStats()
{
internalDamage = damageCoefficient;
internalRadius = radius;
internalForce = force;
internalBaseDuration = baseDuration;
internalAttackSoundString = attackSoundString;
internalChargedAttackSoundString = chargedAttackSoundString;
internalRecoilAmplitude = recoilAmplitude;
internalReloadDef = reloadDef;
internalReloadBarLength = (useSlowReload.Value ? reloadBarLengthSlow : reloadBarLength);
}
}
public class SecondaryScope : BaseState
{
private float lastUpdateTime;
private CameraParamsOverrideHandle camOverrideHandle;
private CharacterCameraParamsData shoulderCameraParams = new CharacterCameraParamsData
{
isFirstPerson = BlendableBool.op_Implicit(false),
maxPitch = BlendableFloat.op_Implicit(70f),
minPitch = BlendableFloat.op_Implicit(-70f),
pivotVerticalOffset = BlendableFloat.op_Implicit(-0f),
idealLocalCameraPos = BlendableVector3.op_Implicit(new Vector3(1.8f, -0.2f, -6f)),
wallCushion = BlendableFloat.op_Implicit(0.1f)
};
private CharacterCameraParamsData scopeCameraParams = new CharacterCameraParamsData
{
isFirstPerson = BlendableBool.op_Implicit(true),
maxPitch = BlendableFloat.op_Implicit(70f),
minPitch = BlendableFloat.op_Implicit(-70f),
pivotVerticalOffset = BlendableFloat.op_Implicit(0f),
idealLocalCameraPos = BlendableVector3.op_Implicit(new Vector3(0f, 0f, 0f)),
wallCushion = BlendableFloat.op_Implicit(0.1f)
};
public static ConfigEntry<KeyboardShortcut> cameraToggleKey;
public static float maxFOV = 50f;
public static float minFOV = 5f;
public static ConfigEntry<float> zoomFOV;
public static GameObject scopeCrosshairPrefab;
public static GameObject noscopeCrosshairPrefab;
public static GameObject scopeWeakpointCrosshairPrefab;
public static GameObject noscopeWeakpointCrosshairPrefab;
public static bool resetZoom = true;
public static ConfigEntry<bool> toggleScope;
public static ConfigEntry<bool> enableScroll;
public static ConfigEntry<float> scrollSpeedMult;
private float currentFOV = 40f;
private GameObject laserPointerObject;
public ScopeController scopeComponent;
private bool buttonReleased = false;
private float chargeDuration;
private Vector3 cameraOffset;
private Vector3 initialCameraPosition;
private bool heavySlow = false;
private bool cameraToggleWasPressed = false;
private bool beginExit = false;
private OverrideRequest crosshairOverrideRequest;
private CameraParamsOverrideHandle cameraParamsOverrideHandle;
private GameObject currentCrosshairPrefab;
private bool fovChanged = false;
private bool disabledItemDisplays = false;
private CharacterModel characterModel;
public override void OnEnter()
{
//IL_027f: 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_028c: Unknown result type (might be due to invalid IL or missing references)
//IL_0299: Unknown result type (might be due to invalid IL or missing references)
//IL_02aa: 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_02bb: Unknown result type (might be due to invalid IL or missing references)
//IL_02c0: Unknown result type (might be due to invalid IL or missing references)
//IL_02cc: Unknown result type (might be due to invalid IL or missing references)
//IL_02d3: 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)
((BaseState)this).OnEnter();
lastUpdateTime = Time.time;
chargeDuration = 1.5f;
if ((!Object.op_Implicit((Object)(object)((EntityState)this).characterBody) || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody.master) || ((EntityState)this).characterBody.master.inventory.GetItemCount(Items.LunarPrimaryReplacement) <= 0) && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator))
{
switch (((EntityState)this).skillLocator.primary.baseSkill.skillName)
{
case "Snipe":
chargeDuration = Snipe.baseChargeDuration;
break;
case "HeavySnipe":
chargeDuration = HeavySnipe.baseChargeDuration;
break;
case "FireBR":
chargeDuration = FireBattleRifle.baseChargeDuration;
break;
}
}
Transform modelTransform = ((EntityState)this).GetModelTransform();
if (Object.op_Implicit((Object)(object)modelTransform))
{
characterModel = ((Component)modelTransform).GetComponent<CharacterModel>();
}
((EntityState)this).GetModelAnimator().SetBool("scoped", true);
currentFOV = zoomFOV.Value;
scopeComponent = ((EntityState)this).gameObject.GetComponent<ScopeController>();
if (Object.op_Implicit((Object)(object)scopeComponent))
{
scopeComponent.EnterScope();
currentFOV = scopeComponent.storedFOV;
}
if (NetworkServer.active && Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
{
((EntityState)this).characterBody.AddBuff(Buffs.Slow50);
}
if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
{
GameObject val = null;
bool flag = false;
if (currentFOV >= maxFOV)
{
val = ((!global::SniperClassic.SniperClassic.enableWeakPoints || !Object.op_Implicit((Object)(object)scopeComponent) || !scopeComponent.FullCharged()) ? noscopeCrosshairPrefab : noscopeWeakpointCrosshairPrefab);
flag = true;
}
else
{
val = ((!global::SniperClassic.SniperClassic.enableWeakPoints || !Object.op_Implicit((Object)(object)scopeComponent) || !scopeComponent.FullCharged()) ? scopeCrosshairPrefab : scopeWeakpointCrosshairPrefab);
DisableItemDisplays();
}
crosshairOverrideRequest = CrosshairUtils.RequestOverrideForBody(((EntityState)this).characterBody, val, (OverridePriority)1);
currentCrosshairPrefab = val;
CameraParamsOverrideRequest val2 = default(CameraParamsOverrideRequest);
val2.cameraParamsData = (flag ? shoulderCameraParams : scopeCameraParams);
val2.priority = 1f;
CameraParamsOverrideRequest val3 = val2;
val3.cameraParamsData.fov = BlendableFloat.op_Implicit(currentFOV);
camOverrideHandle = ((EntityState)this).cameraTargetParams.AddParamsOverride(val3, 0.2f);
}
laserPointerObject = Object.Instantiate<GameObject>(LegacyResourcesAPI.Load<GameObject>("Prefabs/LaserPointerBeamEnd"));
laserPointerObject.GetComponent<LaserPointerController>().source = ((EntityState)this).inputBank;
}
public void DisableItemDisplays()
{
if (!disabledItemDisplays && ((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)characterModel) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && ((EntityState)this).characterBody.isPlayerControlled)
{
disabledItemDisplays = true;
characterModel.DisableAllItemDisplays();
}
}
public void EnableItemDisplays()
{
if (disabledItemDisplays && ((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)characterModel) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory) && ((EntityState)this).characterBody.isPlayerControlled)
{
disabledItemDisplays = false;
characterModel.UpdateItemDisplay(((EntityState)this).characterBody.inventory);
}
}
public override void OnExit()
{
//IL_0066: 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)
EntityState.Destroy((Object)(object)laserPointerObject);
if (NetworkServer.active && Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && ((EntityState)this).characterBody.HasBuff(Buffs.Slow50))
{
((EntityState)this).characterBody.RemoveBuff(Buffs.Slow50);
}
if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
{
((EntityState)this).cameraTargetParams.RemoveParamsOverride(camOverrideHandle, 0.2f);
}
OverrideRequest val = crosshairOverrideRequest;
if (val != null)
{
val.Dispose();
}
((EntityState)this).GetModelAnimator().SetBool("scoped", false);
if (Object.op_Implicit((Object)(object)scopeComponent))
{
scopeComponent.SetStoredFoV(currentFOV);
scopeComponent.ExitScope();
if (heavySlow)
{
scopeComponent.ResetCharge();
}
}
if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterMotor.isGrounded)
{
((EntityState)this).characterMotor.jumpCount = 0;
}
EnableItemDisplays();
((EntityState)this).OnExit();
}
public override void Update()
{
//IL_0078: Unknown result type (might be due to invalid IL or missing references)
((EntityState)this).Update();
float num = currentFOV;
bool keyPressed = Util.GetKeyPressed(cameraToggleKey);
if (!cameraToggleWasPressed && keyPressed)
{
if (currentFOV >= maxFOV)
{
currentFOV = zoomFOV.Value;
}
else
{
currentFOV = maxFOV;
}
}
cameraToggleWasPressed = keyPressed;
if (enableScroll.Value)
{
float num2 = Input.mouseScrollDelta.y * scrollSpeedMult.Value;
if (num2 != 0f)
{
currentFOV = Mathf.Clamp(currentFOV - num2, minFOV, maxFOV);
}
}
if (Object.op_Implicit((Object)(object)scopeComponent))
{
scopeComponent.SetStoredFoV(currentFOV);
}
if (num != currentFOV)
{
fovChanged = true;
}
UpdateCrosshairAndCamera();
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
float num = Time.time - lastUpdateTime;
lastUpdateTime = Time.time;
((BaseState)this).StartAimMode(2f, false);
if (heavySlow && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody))
{
((EntityState)this).characterMotor.jumpCount = ((EntityState)this).characterBody.maxJumpCount;
}
if (!buttonReleased && Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && !((EntityState)this).inputBank.skill2.down)
{
buttonReleased = true;
}
if (((EntityState)this).isAuthority)
{
bool flag = false;
if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank))
{
flag = !((EntityState)this).inputBank.skill2.down && (!toggleScope.Value || beginExit);
if (((EntityState)this).inputBank.skill2.down && toggleScope.Value && buttonReleased)
{
beginExit = true;
}
}
if (!Object.op_Implicit((Object)(object)((EntityState)this).inputBank) || flag)
{
((EntityState)this).outer.SetNextStateToMain();
return;
}
}
((EntityState)this).characterBody.isSprinting = false;
if (Object.op_Implicit((Object)(object)scopeComponent))
{
scopeComponent.SetStoredFoV(currentFOV);
scopeComponent.AddCharge(num * base.attackSpeedStat / chargeDuration);
}
}
private void UpdateCrosshairAndCamera()
{
//IL_013b: Unknown result type (might be due to invalid IL or missing references)
//IL_0145: Unknown result type (might be due to invalid IL or missing references)
//IL_014d: Unknown result type (might be due to invalid IL or missing references)
//IL_016c: Unknown result type (might be due to invalid IL or missing references)
//IL_0164: Unknown result type (might be due to invalid IL or missing references)
//IL_0171: Unknown result type (might be due to invalid IL or missing references)
//IL_0182: Unknown result type (might be due to invalid IL or missing references)
//IL_0184: Unknown result type (might be due to invalid IL or missing references)
//IL_0193: Unknown result type (might be due to invalid IL or missing references)
//IL_0198: 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_01ab: Unknown result type (might be due to invalid IL or missing references)
//IL_01b0: Unknown result type (might be due to invalid IL or missing references)
if (!Object.op_Implicit((Object)(object)((EntityState)this).characterBody) || !Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
{
return;
}
bool flag = false;
GameObject val = currentCrosshairPrefab;
if (!(currentFOV >= maxFOV))
{
val = ((!global::SniperClassic.SniperClassic.enableWeakPoints || !Object.op_Implicit((Object)(object)scopeComponent) || !scopeComponent.FullCharged()) ? scopeCrosshairPrefab : scopeWeakpointCrosshairPrefab);
}
else
{
val = ((!global::SniperClassic.SniperClassic.enableWeakPoints || !Object.op_Implicit((Object)(object)scopeComponent) || !scopeComponent.FullCharged()) ? noscopeCrosshairPrefab : noscopeWeakpointCrosshairPrefab);
flag = true;
}
if ((Object)(object)currentCrosshairPrefab != (Object)(object)val)
{
OverrideRequest val2 = crosshairOverrideRequest;
if (val2 != null)
{
val2.Dispose();
}
crosshairOverrideRequest = CrosshairUtils.RequestOverrideForBody(((EntityState)this).characterBody, val, (OverridePriority)1);
currentCrosshairPrefab = val;
}
if (fovChanged)
{
fovChanged = false;
if (Object.op_Implicit((Object)(object)((EntityState)this).cameraTargetParams))
{
((EntityState)this).cameraTargetParams.RemoveParamsOverride(camOverrideHandle, 0f);
CameraParamsOverrideRequest val3 = default(CameraParamsOverrideRequest);
val3.cameraParamsData = ((Object.op_Implicit((Object)(object)currentCrosshairPrefab) == flag) ? shoulderCameraParams : scopeCameraParams);
val3.priority = 1f;
CameraParamsOverrideRequest val4 = val3;
val4.cameraParamsData.fov = BlendableFloat.op_Implicit(currentFOV);
camOverrideHandle = ((EntityState)this).cameraTargetParams.AddParamsOverride(val4, 0f);
}
if (flag)
{
EnableItemDisplays();
}
else
{
DisableItemDisplays();
}
}
}
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;
}
}
}
namespace EntityStates.SniperClassicSkills.Nemesis
{
public class FireRailgunSingle : BaseState
{
public static float force = 1000f;
public static float damageCoefficient = 2.6f;
public static float heatCost = 15f;
public static float bulletRadius = 0.4f;
public static float baseDuration = 0.4f;
public static GameObject tracerEffectPrefab;
public static GameObject hitEffectPrefab;
private float duration;
public override void OnEnter()
{
//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_0073: 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_0084: 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_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_009d: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00ab: Unknown result type (might be due to invalid IL or missing references)
//IL_00b6: Unknown result type (might be due to invalid IL or missing references)
//IL_00c1: 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_00d3: Unknown result type (might be due to invalid IL or missing references)
//IL_00e5: Unknown result type (might be due to invalid IL or missing references)
//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
//IL_00f2: 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_0102: Unknown result type (might be due to invalid IL or missing references)
//IL_010d: Unknown result type (might be due to invalid IL or missing references)
//IL_0118: 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_012b: Unknown result type (might be due to invalid IL or missing references)
//IL_0136: 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_0149: 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_0154: Unknown result type (might be due to invalid IL or missing references)
//IL_0159: 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_0160: Unknown result type (might be due to invalid IL or missing references)
((BaseState)this).OnEnter();
duration = baseDuration / base.attackSpeedStat;
RailgunHeatController component = ((EntityState)this).GetComponent<RailgunHeatController>();
if (Object.op_Implicit((Object)(object)component) && !component.overheated)
{
Util.PlaySound("Play_SniperClassicNemesis_RailgunShoot", ((EntityState)this).gameObject);
if (((EntityState)this).isAuthority)
{
component.AddHeat(heatCost);
Ray aimRay = ((BaseState)this).GetAimRay();
new BulletAttack
{
owner = ((EntityState)this).gameObject,
weapon = ((EntityState)this).gameObject,
origin = ((Ray)(ref aimRay)).origin,
aimVector = ((Ray)(ref aimRay)).direction,
minSpread = 0f,
maxSpread = 0f,
bulletCount = 1u,
procCoefficient = 1f,
damage = base.damageStat * damageCoefficient,
force = force,
falloffModel = (FalloffModel)0,
tracerEffectPrefab = tracerEffectPrefab,
muzzleName = "Muzzle",
hitEffectPrefab = hitEffectPrefab,
isCrit = ((BaseState)this).RollCrit(),
HitEffectNormal = true,
radius = bulletRadius,
smartCollision = true,
maxDistance = 2000f,
stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask,
damageType = DamageTypeCombo.op_Implicit((DamageType)0)
}.Fire();
}
}
else
{
Util.PlaySound("Play_SniperClassicNemesis_RailgunOverheat", ((EntityState)this).gameObject);
}
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).fixedAge > duration)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
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 DischargeRailgunSingle : BaseState
{
public static float minDamageCoefficient = 2.6f;
public static float maxDamageCoefficient = 14f;
public static float minForce = 1000f;
public static float maxForce = 3000f;
public static float minBulletRadius = 0.4f;
public static float maxBulletRadius = 1.2f;
public static float baseDuration = 0.83f;
public static GameObject tracerEffectPrefab;
public static GameObject hitEffectPrefab;
private float duration;
public override void OnEnter()
{
//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_006e: 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_007f: 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_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_009b: 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_00b1: 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_00c3: 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_00e5: 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_00fe: Unknown result type (might be due to invalid IL or missing references)
//IL_0103: Unknown result type (might be due to invalid IL or missing references)
//IL_010e: Unknown result type (might be due to invalid IL or missing references)
//IL_0119: 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_0130: Unknown result type (might be due to invalid IL or missing references)
//IL_0137: 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_0155: Unknown result type (might be due to invalid IL or missing references)
//IL_0161: Unknown result type (might be due to invalid IL or missing references)
//IL_0167: Unknown result type (might be due to invalid IL or missing references)
//IL_016c: Unknown result type (might be due to invalid IL or missing references)
//IL_0171: Unknown result type (might be due to invalid IL or missing references)
//IL_0173: Unknown result type (might be due to invalid IL or missing references)
//IL_0178: Unknown result type (might be due to invalid IL or missing references)
((BaseState)this).OnEnter();
duration = baseDuration;
RailgunHeatController component = ((EntityState)this).GetComponent<RailgunHeatController>();
if (Object.op_Implicit((Object)(object)component) && !component.empty)
{
Util.PlaySound("Play_SniperClassicNemesis_RailgunDischarge", ((EntityState)this).gameObject);
if (((EntityState)this).isAuthority)
{
float num = component.DischargeRailgunSingle(duration);
Ray aimRay = ((BaseState)this).GetAimRay();
new BulletAttack
{
owner = ((EntityState)this).gameObject,
weapon = ((EntityState)this).gameObject,
origin = ((Ray)(ref aimRay)).origin,
aimVector = ((Ray)(ref aimRay)).direction,
minSpread = 0f,
maxSpread = 0f,
bulletCount = 1u,
procCoefficient = 1f,
damage = Mathf.Lerp(minDamageCoefficient, maxDamageCoefficient, num),
force = Mathf.Lerp(minForce, maxForce, num),
falloffModel = (FalloffModel)0,
tracerEffectPrefab = tracerEffectPrefab,
muzzleName = "Muzzle",
hitEffectPrefab = hitEffectPrefab,
isCrit = ((BaseState)this).RollCrit(),
HitEffectNormal = true,
radius = Mathf.Lerp(minBulletRadius, maxBulletRadius, num),
smartCollision = true,
maxDistance = 2000f,
stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask,
damageType = DamageTypeCombo.op_Implicit((DamageType)0)
}.Fire();
}
}
else
{
Util.PlaySound("Play_SniperClassicNemesis_RailgunOverheat", ((EntityState)this).gameObject);
}
}
public override void FixedUpdate()
{
((EntityState)this).FixedUpdate();
if (((EntityState)this).fixedAge > duration)
{
((EntityState)this).outer.SetNextStateToMain();
}
}
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;
}
}
}
namespace SniperClassic
{
public class FuckingDisconnectedSniper : MonoBehaviour
{
[SerializeField]
private Transform fuckingSniper;
[SerializeField]
private Animator fuckingAnimator;
[SerializeField]
private bool pos;
[SerializeField]
private bool rot;
private void LateUpdate()
{
//IL_0053: Unknown result type (might be due to invalid IL or missing references)
//IL_0074: Unknown result type (might be due to invalid IL or missing references)
if (Object.op_Implicit((Object)(object)fuckingSniper) && Object.op_Implicit((Object)(object)fuckingAnimator) && fuckingAnimator.GetFloat("aiming") < 0.5f)
{
if (pos)
{
fuckingSniper.position = ((Component)this).transform.position;
}
if (rot)
{
fuckingSniper.rotation = ((Component)this).transform.rotation;
}
}
}
}
public class whythefuckarethetoesnotconnectedtothefoot : MonoBehaviour
{
[SerializeField]
private Transform foot;
private void LateUpdate()
{
//IL_000d: Unknown result type (might be due to invalid IL or missing references)
((Component)this).transform.position = foot.position;
}
private void OnDisable()
{
((Component)this).transform.parent = foot;
}
}
public class RailgunHeatIndicatorController : MonoBehaviour
{
private HudElement hudElement;
public Image image;
private RailgunHeatController heatController;
public static Color chargeColor = new Color(1f, 1f, 94f, 62f / 85f);
public static Color overheatColor = new Color(0.8980392f, 42f / 85f, 12f / 85f, 62f / 85f);
public void Awake()
{
hudElement = ((Component)this).GetComponent<HudElement>();
image = ((Component)this).GetComponent<Image>();
heatController = ((Component)hudElement.targetCharacterBody).gameObject.GetComponent<RailgunHeatController>();
}
public void FixedUpdate()
{
//IL_002b: 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)
if (Object.op_Implicit((Object)(object)heatController))
{
((Graphic)image).color = (heatController.overheated ? overheatColor : chargeColor);
image.fillAmount = heatController.gunHeatPercent;
}
}
}
public class ReloadController : NetworkBehaviour
{
public enum ReloadQuality
{
Bad,
Good,
Perfect
}
public static Texture2D indicatorMarkStock;
public static Texture2D indicatorGood;
public static Texture2D indicatorPerfect;
private Rect rectMarkStock = default(Rect);
public static Texture2D reloadBar2Border;
public static Texture2D reloadBar2BorderFinish;
public static Texture2D reloadBar2;
public static Texture2D reloadBar2Fail;
public static Texture2D reloadBar2Good;
public static Texture2D reloadBar2Perfect;
private Rect rectBar2 = default(Rect);
private float bar2LeftBound = 0f;
private static float bar2PixelLength;
private static float bar2VerticalOffset;
public static Texture2D reloadSlider2;
public static Texture2D reloadSlider2Fail;
private Rect rectSlider2 = default(Rect);
public static string boltReloadSoundString;
public static string failSoundString;
public static string goodReloadSoundString;
public static string perfectReloadSoundString;
public static string casingSoundString;
public static float reloadBarScale;
public static float reloadIndicatorScale;
public bool brReload = false;
public bool failedReload = false;
public bool menuActive = false;
private float reloadProgress = 0f;
private float barLeftBound;
private ReloadQuality currentReloadQuality = ReloadQuality.Bad;
private float brReloadDuration = 0.5f;
private float reloadLength = 0.6f;
private bool reloadBarBounces = true;
private bool reloadMovingBackwards = false;
private bool reloadReverse = false;
private float reloadLingerTimer = 0f;
private bool pauseReload = false;
private bool standardReload = true;
private bool triggeredBRReload = false;
private SkillLocator skillLocator;
private Animator modelAnimator;
private HealthComponent healthComponent;
private CharacterBody characterBody;
public bool hideLoadIndicator = false;
public bool isReloading = false;
private Rect rectBar = default(Rect);
private Rect rectCursor = default(Rect);
private Rect rectIndicator = default(Rect);
internal const float basePerfectBeginPercent = 0.25f;
internal const float basePerfectEndPercent = 0.42499998f;
internal const float baseGoodBeginPercent = 0.42499998f;
internal const float baseGoodEndPercent = 19f / 30f;
internal const float screenFraction = 0.0009259259f;
public static Texture2D reloadRegionGood;
public static Texture2D reloadRegionPerfect;
public static Texture2D reloadRegionGoodFail;
public static Texture2D reloadRegionPerfectFail;
public float perfectBeginPercent;
public float perfectEndPercent;
public float goodBeginPercent;
public float goodEndPercent;
private Rect rectGood = default(Rect);
private Rect rectPerfect = default(Rect);
private static float sliderTolerance;
public bool finishedReload = false;
private static int kCmdCmdResetSpotter;
private static int kCmdCmdPlayReloadSound;
private static int kRpcRpcPlayReloadSound;
private static int kCmdCmdPlayReloadFail;
private static int kRpcRpcPlayReloadFail;
public void AutoReload()
{
EntityState.PlayAnimationOnAnimator(modelAnimator, "Reload, Override", "BufferEmpty");
if (Object.op_Implicit((Object)(object)skillLocator) && Object.op_Implicit((Object)(object)skillLocator.primary) && Object.op_Implicit((Object)(object)skillLocator.primary.stateMachine))
{
Type type = ((object)skillLocator.primary.stateMachine.state).GetType();
if (type == typeof(Snipe))
{
(skillLocator.primary.stateMachine.state as Snipe).AutoReload();
}
else if (type == typeof(HeavySnipe))
{
(skillLocator.primary.stateMachine.state as HeavySnipe).AutoReload();
}
else if (type == typeof(ReloadHeavySnipe))
{
(skillLocator.primary.stateMachine.state as ReloadHeavySnipe).AutoReload();
}
else if (type == typeof(ReloadSnipe))
{
(skillLocator.primary.stateMachine.state as ReloadSnipe).AutoReload();
}
else if (type == typeof(FireBattleRifle))
{
DisableReloadBar();
SetReloadQuality(ReloadQuality.Good, playLoadSound: false);
(skillLocator.primary.stateMachine.state as FireBattleRifle).AutoReload();
}
else if (type == typeof(ReloadBR))
{
DisableReloadBar();
SetReloadQuality(ReloadQuality.Good, playLoadSound: false);
(skillLocator.primary.stateMachine.state as ReloadBR).AutoReload();
}
else
{
switch (skillLocator.primary.skillDef.skillName)
{
case "Snipe":
case "ReloadSnipe":
case "HeavySnipe":
case "ReloadHeavySnipe":
if (GetReloadQuality() != ReloadQuality.Perfect)
{
SetReloadQuality(ReloadQuality.Perfect, playLoadSound: false);
hideLoadIndicator = false;
}
break;
case "BattleRifle":
case "ReloadBR":
if (skillLocator.primary.stock < skillLocator.primary.maxStock)
{
DisableReloadBar();
SetReloadQuality(ReloadQuality.Good, playLoadSound: false);
}
break;
default:
DisableReloadBar();
break;
}
}
if (skillLocator.primary.maxStock > 1)
{
skillLocator.primary.stock = skillLocator.primary.maxStock;
}
}
finishedReload = true;
}
public void ResetReloadQuality()
{
currentReloadQuality = ReloadQuality.Bad;
}
[Client]
public void ClientResetSpotter(float percent)
{
if (!NetworkClient.active)
{
Debug.LogWarning((object)"[Client] function 'System.Void SniperClassic.ReloadController::ClientResetSpotter(System.Single)' called on server");
return;
}
CallCmdResetSpotter(percent);
if (characterBody.skillLocator.special.stock < characterBody.skillLocator.special.maxStock)
{
GenericSkill special = characterBody.skillLocator.special;
special.rechargeStopwatch += percent * characterBody.skillLocator.special.CalculateFinalRechargeInterval();
}
}
[Command]
private void CmdResetSpotter(float percent)
{
SpotterRechargeController component = ((Component)characterBody).GetComponent<SpotterRechargeController>();
if (Object.op_Implicit((Object)(object)component))
{
component.LowerCooldown(percent);
}
}
public void SetReloadQuality(ReloadQuality r, bool playLoadSound = true)
{
currentReloadQuality = r;
if (playLoadSound)
{
switch (currentReloadQuality)
{
case ReloadQuality.Good:
Util.PlaySound(goodReloadSoundString, ((Component)this).gameObject);
break;
case ReloadQuality.Perfect:
Util.PlaySound(perfectReloadSoundString, ((Component)this).gameObject);
break;
}
}
Util.PlaySound(boltReloadSoundString, ((Component)this).gameObject);
Util.PlaySound(casingSoundString, ((Component)this).gameObject);
if (((NetworkBehaviour)this).hasAuthority)
{
CallCmdPlayReloadSound((int)currentReloadQuality, playLoadSound);
}
}
[Command]
public void CmdPlayReloadSound(int rq, bool playLoadSound)
{
CallRpcPlayReloadSound(rq, playLoadSound);
}
[ClientRpc]
public void RpcPlayReloadSound(int rq, bool playLoadSound)
{
if (((NetworkBehaviour)this).hasAuthority)
{
return;
}
if (playLoadSound)
{
switch (rq)
{
case 1:
Util.PlaySound(goodReloadSoundString, ((Component)this).gameObject);
break;
case 2:
Util.PlaySound(perfectReloadSoundString, ((Component)this).gameObject);
break;
}
}
Util.PlaySound(boltReloadSoundString, ((Component)this).gameObject);
Util.PlaySound(casingSoundString, ((Component)this).gameObject);
}
[Command]
private void CmdPlayReloadFail()
{
CallRpcPlayReloadFail();
}
[ClientRpc]
private void RpcPlayReloadFail()
{
if (!((NetworkBehaviour)this).hasAuthority)
{
Util.PlaySound(failSoundString, ((Component)this).gameObject);
}
}
public float GetDamageMult()
{
return currentReloadQuality switch
{
ReloadQuality.Good => 1.25f,
ReloadQuality.Perfect => 1.5f,
_ => 1f,
};
}
public ReloadQuality GetReloadQuality()
{
return currentReloadQuality;
}
public void Awake()
{
reloadProgress = 0f;
characterBody = ((Component)this).GetComponent<CharacterBody>();
healthComponent = characterBody.healthComponent;
skillLocator = characterBody.skillLocator;
modelAnimator = ((Component)characterBody.modelLocator.modelTransform).GetComponent<Animator>();
}
private float ScaleToScreen(float pixelValue)
{
return pixelValue * (float)Screen.height * reloadBarScale * 0.0009259259f;
}
private Vector2 CenterRect(Rect rect, float xOffset = 0f, float yOffset = 0f)
{
//IL_0031: 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_0039: Unk