Decompiled source of Driver v1.6.4
DriverMod.dll
Decompiled a month ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using AncientScepter; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using ClassicItemsReturns.Items; using EntityStates; using EntityStates.AI; using EntityStates.BrotherMonster.Weapon; using EntityStates.Commando; using EntityStates.Commando.CommandoWeapon; using EntityStates.GlobalSkills.LunarDetonator; using EntityStates.GlobalSkills.LunarNeedle; using EntityStates.GolemMonster; using EntityStates.Huntress; using EntityStates.LemurianBruiserMonster; using EntityStates.Mage.Weapon; using HG; using HG.BlendableTypes; using LostInTransit; using MaterialHud; using Moonstorm.Starstorm2; using On.EntityStates.AI; using On.EntityStates.GlobalSkills.LunarDetonator; using On.EntityStates.GlobalSkills.LunarNeedle; using On.RoR2; using On.RoR2.UI; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using R2API.Utils; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.Achievements; using RoR2.Audio; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.HudOverlay; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using RobDriver.Modules; using RobDriver.Modules.Achievements; using RobDriver.Modules.Components; using RobDriver.Modules.Survivors; using RobDriver.Modules.Weapons; using RobDriver.SkillStates; using RobDriver.SkillStates.BaseStates; using RobDriver.SkillStates.Driver; using RobDriver.SkillStates.Driver.ArmBFG; using RobDriver.SkillStates.Driver.ArmCannon; using RobDriver.SkillStates.Driver.ArtiGauntlet; using RobDriver.SkillStates.Driver.BadassShotgun; using RobDriver.SkillStates.Driver.Bazooka; using RobDriver.SkillStates.Driver.BeetleShield; using RobDriver.SkillStates.Driver.Compat.NemmandoGun; using RobDriver.SkillStates.Driver.Compat.NemmercGun; using RobDriver.SkillStates.Driver.GoldenGun; using RobDriver.SkillStates.Driver.GolemGun; using RobDriver.SkillStates.Driver.GrenadeLauncher; using RobDriver.SkillStates.Driver.HeavyMachineGun; using RobDriver.SkillStates.Driver.LunarGrenade; using RobDriver.SkillStates.Driver.LunarHammer; using RobDriver.SkillStates.Driver.LunarPistol; using RobDriver.SkillStates.Driver.LunarRifle; using RobDriver.SkillStates.Driver.MachineGun; using RobDriver.SkillStates.Driver.PlasmaCannon; using RobDriver.SkillStates.Driver.PyriteGun; using RobDriver.SkillStates.Driver.Revolver; using RobDriver.SkillStates.Driver.RiotShotgun; using RobDriver.SkillStates.Driver.RocketLauncher; using RobDriver.SkillStates.Driver.SMG; using RobDriver.SkillStates.Driver.Shotgun; using RobDriver.SkillStates.Driver.Skateboard; using RobDriver.SkillStates.Driver.SlugShotgun; using RobDriver.SkillStates.Driver.SniperRifle; using RobDriver.SkillStates.Driver.SupplyDrop; using RobDriver.SkillStates.Driver.SupplyDrop.Nerfed; using RobDriver.SkillStates.Driver.SupplyDrop.Scepter; using RobDriver.SkillStates.Driver.VoidPistol; using RobDriver.SkillStates.Driver.VoidRifle; using RobDriver.SkillStates.Emote; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.Rendering.PostProcessing; using UnityEngine.SceneManagement; using UnityEngine.UI; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")] [assembly: AssemblyCompany("DriverMod")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("DriverMod")] [assembly: AssemblyTitle("DriverMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: UnverifiableCode] internal static class Log { internal static ManualLogSource _logSource; internal static void Init(ManualLogSource logSource) { _logSource = logSource; } internal static void Debug(object data) { _logSource.LogDebug(data); } internal static void Error(object data) { _logSource.LogError(data); } internal static void Fatal(object data) { _logSource.LogFatal(data); } internal static void Info(object data) { _logSource.LogInfo(data); } internal static void Message(object data) { _logSource.LogMessage(data); } internal static void Warning(object data) { _logSource.LogWarning(data); } } internal enum DriverCameraParams { DEFAULT, AIM_PISTOL, AIM_SNIPER, EMOTE } public class StupidFuckingBullshit : MonoBehaviour { public ParticleSystem faggot; private void Awake() { faggot = ((Component)this).GetComponentInChildren<ParticleSystem>(); ((Component)faggot).transform.SetParent((Transform)null); } private void FixedUpdate() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) ((Component)faggot).transform.SetPositionAndRotation(((Component)this).transform.position, ((Component)this).transform.rotation); } } [CreateAssetMenu(fileName = "wpn", menuName = "ScriptableObjects/WeaponDef", order = 1)] public class DriverWeaponDef : ScriptableObject { public enum AnimationSet { Default, TwoHanded, BigMelee } public enum BuffType { Crit, Damage, AttackSpeed } [Header("General")] public string nameToken = ""; public string descriptionToken = ""; public Texture icon = null; public GameObject crosshairPrefab = null; public DriverWeaponTier tier = DriverWeaponTier.Common; public int shotCount = 8; public BuffType buffType = BuffType.Damage; [Header("Skills")] public SkillDef primarySkillDef; public SkillDef secondarySkillDef; [Header("Visuals")] public Mesh mesh; public Material material; public AnimationSet animationSet = AnimationSet.Default; public string calloutSoundString = ""; [Header("Other")] public string configIdentifier = ""; public float dropChance = 0f; [HideInInspector] public ushort index; [HideInInspector] public GameObject pickupPrefab; public string equipAnimationString { get { if (animationSet == AnimationSet.Default) { return "EquipPistol"; } return "BufferEmpty"; } } public Color color => (Color)(tier switch { DriverWeaponTier.Common => Helpers.whiteItemColor, DriverWeaponTier.Uncommon => Helpers.greenItemColor, DriverWeaponTier.Legendary => Helpers.redItemColor, DriverWeaponTier.Unique => Helpers.yellowItemColor, DriverWeaponTier.Lunar => Helpers.lunarItemColor, DriverWeaponTier.Void => Helpers.voidItemColor, _ => Helpers.whiteItemColor, }); public static DriverWeaponDef CreateWeaponDefFromInfo(DriverWeaponDefInfo weaponDefInfo) { DriverWeaponDef driverWeaponDef = (DriverWeaponDef)(object)ScriptableObject.CreateInstance(typeof(DriverWeaponDef)); ((Object)driverWeaponDef).name = weaponDefInfo.nameToken; driverWeaponDef.nameToken = weaponDefInfo.nameToken; driverWeaponDef.descriptionToken = weaponDefInfo.descriptionToken; driverWeaponDef.icon = weaponDefInfo.icon; driverWeaponDef.crosshairPrefab = weaponDefInfo.crosshairPrefab; driverWeaponDef.tier = weaponDefInfo.tier; driverWeaponDef.shotCount = weaponDefInfo.shotCount; driverWeaponDef.buffType = weaponDefInfo.buffType; driverWeaponDef.primarySkillDef = weaponDefInfo.primarySkillDef; driverWeaponDef.secondarySkillDef = weaponDefInfo.secondarySkillDef; driverWeaponDef.mesh = weaponDefInfo.mesh; driverWeaponDef.material = weaponDefInfo.material; driverWeaponDef.animationSet = weaponDefInfo.animationSet; driverWeaponDef.calloutSoundString = weaponDefInfo.calloutSoundString; driverWeaponDef.configIdentifier = weaponDefInfo.configIdentifier; driverWeaponDef.dropChance = weaponDefInfo.dropChance; return driverWeaponDef; } } [Serializable] public struct DriverWeaponDefInfo { public string nameToken; public string descriptionToken; public Texture icon; public GameObject crosshairPrefab; public DriverWeaponTier tier; public int shotCount; public DriverWeaponDef.BuffType buffType; public SkillDef primarySkillDef; public SkillDef secondarySkillDef; public Mesh mesh; public Material material; public DriverWeaponDef.AnimationSet animationSet; public string calloutSoundString; public string configIdentifier; public float dropChance; } public enum DriverWeaponTier { Common, Uncommon, Legendary, Unique, Void, Lunar } internal class BodyInfo { internal string bodyName = ""; internal string bodyNameToken = ""; internal string subtitleNameToken = ""; internal Color bodyColor = Color.white; internal Texture characterPortrait = null; internal GameObject crosshair = null; internal GameObject podPrefab = null; internal float maxHealth = 100f; internal float healthGrowth = 2f; internal float healthRegen = 0f; internal float shield = 0f; internal float shieldGrowth = 0f; internal float moveSpeed = 7f; internal float moveSpeedGrowth = 0f; internal float acceleration = 80f; internal float jumpPower = 15f; internal float jumpPowerGrowth = 0f; internal float damage = 12f; internal float attackSpeed = 1f; internal float attackSpeedGrowth = 0f; internal float armor = 0f; internal float armorGrowth = 0f; internal float crit = 1f; internal float critGrowth = 0f; internal int jumpCount = 1; } internal class CustomRendererInfo { internal string childName; internal Material material; internal bool ignoreOverlays; } internal class SkillDefInfo { public string skillName; public string skillNameToken; public string skillDescriptionToken; public string[] keywordTokens = new string[0]; public Sprite skillIcon; public SerializableEntityStateType activationState; public InterruptPriority interruptPriority; public string activationStateMachineName; public float baseRechargeInterval; public int baseMaxStock = 1; public int rechargeStock = 1; public int requiredStock = 1; public int stockToConsume = 1; public bool isCombatSkill = true; public bool canceledFromSprinting; public bool forceSprintDuringState; public bool cancelSprintingOnActivation = true; public bool beginSkillCooldownOnSkillEnd; public bool fullRestockOnAssign = true; public bool resetCooldownTimerOnUse; public bool mustKeyPress; public SkillDefInfo() { } public SkillDefInfo(string skillName, string skillNameToken, string skillDescriptionToken, Sprite skillIcon, SerializableEntityStateType activationState, string activationStateMachineName, InterruptPriority interruptPriority, bool isCombatSkill, float baseRechargeInterval) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0073: 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) this.skillName = skillName; this.skillNameToken = skillNameToken; this.skillDescriptionToken = skillDescriptionToken; this.skillIcon = skillIcon; this.activationState = activationState; this.activationStateMachineName = activationStateMachineName; this.interruptPriority = interruptPriority; this.isCombatSkill = isCombatSkill; this.baseRechargeInterval = baseRechargeInterval; } public SkillDefInfo(string skillName, string skillNameToken, string skillDescriptionToken, Sprite skillIcon, SerializableEntityStateType activationState, string activationStateMachineName = "Weapon", bool agile = false) { //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) this.skillName = skillName; this.skillNameToken = skillNameToken; this.skillDescriptionToken = skillDescriptionToken; this.skillIcon = skillIcon; this.activationState = activationState; this.activationStateMachineName = activationStateMachineName; interruptPriority = (InterruptPriority)0; isCombatSkill = true; baseRechargeInterval = 0f; requiredStock = 0; stockToConsume = 0; cancelSprintingOnActivation = !agile; if (agile) { keywordTokens = new string[1] { "KEYWORD_AGILE" }; } } } namespace DriverMod.Modules.Weapons { internal class WispJar { } } namespace RobDriver { [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.rob.Driver", "Driver", "1.6.4")] [R2APISubmoduleDependency(new string[] { "PrefabAPI", "LanguageAPI", "SoundAPI", "DirectorAPI", "LoadoutAPI", "UnlockableAPI", "NetworkingAPI", "RecalculateStatsAPI" })] public class DriverPlugin : BaseUnityPlugin { public const string MODUID = "com.rob.Driver"; public const string MODNAME = "Driver"; public const string MODVERSION = "1.6.4"; public const string developerPrefix = "ROB"; public static DriverPlugin instance; public static bool starstormInstalled => Chainloader.PluginInfos.ContainsKey("com.TeamMoonstorm.Starstorm2"); public static bool scepterInstalled => Chainloader.PluginInfos.ContainsKey("com.DestroyedClone.AncientScepter"); public static bool rooInstalled => Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"); public static bool litInstalled => Chainloader.PluginInfos.ContainsKey("com.ContactLight.LostInTransit"); public static bool classicItemsInstalled => Chainloader.PluginInfos.ContainsKey("com.RiskySleeps.ClassicItemsReturns"); public static bool riskUIInstalled => Chainloader.PluginInfos.ContainsKey("bubbet.riskui"); public static bool extendedLoadoutInstalled => Chainloader.PluginInfos.ContainsKey("com.KingEnderBrine.ExtendedLoadout"); public static bool greenAlienHeadInstalled => Chainloader.PluginInfos.ContainsKey("com.Borbo.GreenAlienHead"); private void Awake() { instance = this; Config.myConfig = ((BaseUnityPlugin)this).Config; Log.Init(((BaseUnityPlugin)this).Logger); Config.ReadConfig(); Assets.PopulateAssets(); CameraParams.InitializeParams(); States.RegisterStates(); DamageTypes.Init(); Buffs.RegisterBuffs(); Projectiles.RegisterProjectiles(); Tokens.AddTokens(); ItemDisplays.PopulateDisplays(); NetMessages.RegisterNetworkMessages(); new Driver().CreateCharacter(); NetworkingAPI.RegisterMessageType<SyncWeapon>(); NetworkingAPI.RegisterMessageType<SyncOverlay>(); NetworkingAPI.RegisterMessageType<SyncStoredWeapon>(); NetworkingAPI.RegisterMessageType<SyncDecapitation>(); Hook(); new ContentPacks().Initialize(); ContentManager.onContentPacksAssigned += LateSetup; CreateWeapons(); } private void LateSetup(ReadOnlyArray<ReadOnlyContentPack> obj) { Driver.SetItemDisplays(); } private void CreateWeapons() { new ArmBFG().Init(); new CrabGun().Init(); new LunarGrenade().Init(); new ScavGun().Init(); new ArtiGauntlet().Init(); new BanditRevolver().Init(); new CommandoSMG().Init(); new Revolver().Init(); new SMG().Init(); } private void Hook() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Expected O, but got Unknown //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Expected O, but got Unknown if (Config.dynamicCrosshairUniversal.Value) { CrosshairController.Awake += new hook_Awake(CrosshairController_Awake); } CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats); } private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.woundDebuff)) { self.armor -= 40f; } if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.syringeDamageBuff)) { self.damage += self.level * 2f; } if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.syringeAttackSpeedBuff)) { self.attackSpeed += 0.5f; } if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.syringeCritBuff)) { self.crit += 30f; } if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.syringeNewBuff)) { self.attackSpeed += 0.5f; self.regen += 5f; } if (Object.op_Implicit((Object)(object)self) && self.HasBuff(Buffs.syringeScepterBuff)) { self.damage += self.level * 2.5f; self.attackSpeed += 0.75f; self.crit += 40f; self.regen += 10f; } } private void CrosshairController_Awake(orig_Awake orig, CrosshairController self) { orig.Invoke(self); if (!((Object)self).name.Contains("SprintCrosshair") && !Object.op_Implicit((Object)(object)((Component)self).GetComponent<DynamicCrosshair>())) { ((Component)self).gameObject.AddComponent<DynamicCrosshair>(); } } private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args) { } public static float GetICBMDamageMult(CharacterBody body) { float num = 1f; if (Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.inventory)) { int itemCount = body.inventory.GetItemCount(Items.MoreMissile); int num2 = itemCount - 1; if (num2 > 0) { num += (float)num2 * 0.5f; } } return num; } public static bool CheckIfBodyIsTerminal(CharacterBody body) { if (starstormInstalled) { return _CheckIfBodyIsTerminal(body); } return false; } public static bool _CheckIfBodyIsTerminal(CharacterBody body) { return body.HasBuff(Buffs.BuffTerminationReady); } } public static class DriverWeaponCatalog { public static Dictionary<string, DriverWeaponDef> weaponDrops = new Dictionary<string, DriverWeaponDef>(); public static DriverWeaponDef[] weaponDefs = new DriverWeaponDef[0]; internal static DriverWeaponDef Pistol; internal static DriverWeaponDef PyriteGun; internal static DriverWeaponDef GoldenGun; internal static DriverWeaponDef PrototypeRocketLauncher; internal static DriverWeaponDef ArmCannon; internal static DriverWeaponDef PlasmaCannon; internal static DriverWeaponDef Behemoth; internal static DriverWeaponDef BeetleShield; internal static DriverWeaponDef LunarPistol; internal static DriverWeaponDef VoidPistol; internal static DriverWeaponDef Needler; internal static DriverWeaponDef GolemRifle; internal static DriverWeaponDef LunarRifle; internal static DriverWeaponDef LunarHammer; internal static DriverWeaponDef NemmandoGun; internal static DriverWeaponDef NemmercGun; public static void AddWeapon(DriverWeaponDef weaponDef) { Array.Resize(ref weaponDefs, weaponDefs.Length + 1); int num = weaponDefs.Length - 1; weaponDef.index = (ushort)num; weaponDefs[num] = weaponDef; weaponDef.index = (ushort)num; weaponDef.pickupPrefab = Assets.CreatePickupObject(weaponDef); if (!Object.op_Implicit((Object)(object)weaponDef.icon)) { switch (weaponDef.tier) { case DriverWeaponTier.Common: weaponDef.icon = Assets.mainAssetBundle.LoadAsset<Texture>("texGenericWeaponGrey"); break; case DriverWeaponTier.Uncommon: weaponDef.icon = Assets.mainAssetBundle.LoadAsset<Texture>("texGenericWeaponGreen"); break; case DriverWeaponTier.Legendary: weaponDef.icon = Assets.mainAssetBundle.LoadAsset<Texture>("texGenericWeaponRed"); break; case DriverWeaponTier.Unique: weaponDef.icon = Assets.mainAssetBundle.LoadAsset<Texture>("texGenericWeaponYellow"); break; case DriverWeaponTier.Lunar: weaponDef.icon = Assets.mainAssetBundle.LoadAsset<Texture>("texGenericWeaponBlue"); break; case DriverWeaponTier.Void: weaponDef.icon = Assets.mainAssetBundle.LoadAsset<Texture>("texGenericWeaponPurple"); break; } } Config.InitWeaponConfig(weaponDef); Debug.Log((object)("Added " + weaponDef.nameToken + " to catalog with index: " + weaponDef.index)); } public static void AddWeaponDrop(string bodyName, DriverWeaponDef weaponDef, bool autoComplete = true) { if (autoComplete) { if (!bodyName.Contains("Body")) { bodyName += "Body"; } if (!bodyName.Contains("(Clone)")) { bodyName += "(Clone)"; } } weaponDrops.Add(bodyName, weaponDef); } public static bool IsWeaponPistol(DriverWeaponDef weaponDef) { return (Object)(object)weaponDef == (Object)(object)Pistol || (Object)(object)weaponDef == (Object)(object)LunarPistol || (Object)(object)weaponDef == (Object)(object)VoidPistol; } public static DriverWeaponDef GetWeaponFromIndex(int index) { return weaponDefs[index]; } public static DriverWeaponDef GetRandomWeapon() { List<DriverWeaponDef> list = new List<DriverWeaponDef>(); for (int i = 0; i < weaponDefs.Length; i++) { if (Config.GetWeaponConfigEnabled(weaponDefs[i]) && weaponDefs[i].shotCount > 0) { list.Add(weaponDefs[i]); } } DriverWeaponDef[] array = list.ToArray(); if (array.Length == 0) { return weaponDefs[0]; } return array[Random.Range(0, array.Length)]; } public static DriverWeaponDef GetRandomWeaponFromTier(DriverWeaponTier tier) { List<DriverWeaponDef> list = new List<DriverWeaponDef>(); for (int i = 0; i < weaponDefs.Length; i++) { if (Object.op_Implicit((Object)(object)weaponDefs[i]) && weaponDefs[i].tier == tier && Config.GetWeaponConfigEnabled(weaponDefs[i])) { list.Add(weaponDefs[i]); } } DriverWeaponDef[] array = list.ToArray(); if (array.Length == 0) { return weaponDefs[0]; } return array[Random.Range(0, array.Length)]; } } } namespace RobDriver.SkillStates { public class FuckMyAss : GenericCharacterDeath { public override bool shouldAutoDestroy => false; public override void OnEnter() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_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_0039: 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) ((GenericCharacterDeath)this).OnEnter(); Vector3 val = Vector3.up * 3f; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { val += ((EntityState)this).characterMotor.velocity; ((Behaviour)((EntityState)this).characterMotor).enabled = false; } if (!Object.op_Implicit((Object)(object)((GenericCharacterDeath)this).cachedModelTransform)) { return; } RagdollController component = ((Component)((GenericCharacterDeath)this).cachedModelTransform).GetComponent<RagdollController>(); if (!Object.op_Implicit((Object)(object)component)) { return; } Transform[] bones = component.bones; foreach (Transform val2 in bones) { if (Object.op_Implicit((Object)(object)val2)) { ((Component)val2).gameObject.layer = LayerIndex.ragdoll.intVal; ((Component)val2).gameObject.SetActive(true); } } component.BeginRagdoll(val); } public override void PlayDeathAnimation(float crossfadeDuration = 0.1f) { } public override void FixedUpdate() { ((GenericCharacterDeath)this).FixedUpdate(); if (NetworkServer.active && ((EntityState)this).fixedAge > 4f) { EntityState.Destroy((Object)(object)((EntityState)this).gameObject); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)6; } } } namespace RobDriver.SkillStates.Emote { public class BaseEmote : BaseState { private CameraParamsOverrideHandle camOverrideHandle; private Animator animator; private ChildLocator childLocator; private float duration; private uint activePlayID; public LocalUser localUser; public override void OnEnter() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); animator = ((EntityState)this).GetModelAnimator(); childLocator = ((EntityState)this).GetModelChildLocator(); FindLocalUser(); ((EntityState)this).characterBody.hideCrosshair = true; camOverrideHandle = CameraParams.OverrideCameraParams(((EntityState)this).cameraTargetParams, DriverCameraParams.EMOTE); } private void FindLocalUser() { if (localUser != null || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { return; } foreach (LocalUser readOnlyLocalUsers in LocalUserManager.readOnlyLocalUsersList) { if ((Object)(object)readOnlyLocalUsers.cachedBody == (Object)(object)((EntityState)this).characterBody) { localUser = readOnlyLocalUsers; break; } } } protected void PlayEmote(string animString, string soundString = "", float animDuration = 0f) { PlayEmote(animString, soundString, ((EntityState)this).GetModelAnimator(), animDuration); } protected void PlayEmote(string animString, string soundString, Animator animator, float animDuration = 0f) { if (animDuration >= 0f && duration != 0f) { animDuration = duration; } if (duration > 0f) { EntityState.PlayAnimationOnAnimator(animator, "FullBody, Override", animString, "Emote.playbackRate", animDuration); } else { animator.SetFloat("Emote.playbackRate", 1f); EntityState.PlayAnimationOnAnimator(animator, "FullBody, Override", animString); } if (!string.IsNullOrEmpty(soundString)) { activePlayID = Util.PlaySound(soundString, ((EntityState)this).gameObject); } } public override void Update() { ((EntityState)this).Update(); if (((EntityState)this).isAuthority) { CheckEmote<Rest>(Config.restKey); CheckEmote<Taunt>(Config.tauntKey); CheckEmote<Dance>(Config.danceKey); } } private void CheckEmote(KeyCode keybind, EntityState state) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (Input.GetKeyDown(keybind) && !localUser.isUIFocused) { ((EntityState)this).outer.SetInterruptState(state, (InterruptPriority)0); } } private void CheckEmote<T>(ConfigEntry<KeyboardShortcut> keybind) where T : EntityState, new() { if (Config.GetKeyPressed(keybind)) { FindLocalUser(); if (localUser != null && !localUser.isUIFocused) { ((EntityState)this).outer.SetInterruptState((EntityState)(object)new T(), (InterruptPriority)0); } } } public override void FixedUpdate() { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); bool flag = false; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded) { flag = true; } if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank)) { if (((EntityState)this).inputBank.skill1.down) { flag = true; } if (((EntityState)this).inputBank.skill2.down) { flag = true; } if (((EntityState)this).inputBank.skill3.down) { flag = true; } if (((EntityState)this).inputBank.skill4.down) { flag = true; } if (((EntityState)this).inputBank.moveVector != Vector3.zero) { flag = true; } } if (duration > 0f && ((EntityState)this).fixedAge >= duration) { flag = true; } if (flag && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).OnExit(); ((EntityState)this).characterBody.hideCrosshair = false; ((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty"); if (activePlayID != 0) { AkSoundEngine.StopPlayingID(activePlayID); } ((EntityState)this).cameraTargetParams.RemoveParamsOverride(camOverrideHandle, 0.5f); } 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)0; } } public class Dance : BaseEmote { public override void OnEnter() { base.OnEnter(); if (((EntityState)this).characterBody.skinIndex == 1) { PlayEmote("Dance", "sfx_jacket_dance"); } else if (((EntityState)this).characterBody.skinIndex == 2) { PlayEmote("Dance", "sfx_slugger_dance"); } else { PlayEmote("Dance", "sfx_driver_dance"); } ((Component)((BaseState)this).FindModelChild("Boombox")).gameObject.SetActive(true); } public override void OnExit() { base.OnExit(); ((Component)((BaseState)this).FindModelChild("Boombox")).gameObject.SetActive(false); } } public class Rest : BaseEmote { public override void OnEnter() { base.OnEnter(); PlayEmote("RestEmote", "", 1.5f); } } public class Taunt : BaseEmote { public override void OnEnter() { base.OnEnter(); PlayEmote("Taunt", "", 1.5f); Util.PlaySound("sfx_driver_boom", ((EntityState)this).gameObject); } } } namespace RobDriver.SkillStates.Driver { public class BaseDriverSkillState : BaseSkillState { protected DriverController iDrive; protected DriverWeaponDef cachedWeaponDef; protected virtual bool hideGun => false; protected virtual string prop => ""; public virtual void AddRecoil2(float x1, float x2, float y1, float y2) { if (Config.enableRecoil.Value) { ((BaseState)this).AddRecoil(x1, x2, y1, y2); } } public override void OnEnter() { iDrive = ((EntityState)this).GetComponent<DriverController>(); if (Object.op_Implicit((Object)(object)iDrive)) { cachedWeaponDef = iDrive.weaponDef; } ((BaseState)this).OnEnter(); if (hideGun) { ((Component)((EntityState)this).GetModelChildLocator().FindChild("PistolModel")).gameObject.SetActive(false); } if (prop != "") { ((Component)((EntityState)this).GetModelChildLocator().FindChild(prop)).gameObject.SetActive(true); } } public override void OnExit() { ((EntityState)this).OnExit(); if (hideGun) { ((Component)((EntityState)this).GetModelChildLocator().FindChild("PistolModel")).gameObject.SetActive(true); } if (prop != "") { ((Component)((EntityState)this).GetModelChildLocator().FindChild(prop)).gameObject.SetActive(false); } } } public class Dash : BaseState { protected Vector3 slipVector = Vector3.zero; public float duration = 0.3f; public float speedCoefficient = 7f; private Vector3 cachedForward; public override void OnEnter() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0033: 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_0038: 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_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector); slipVector = ((Vector3)(ref val)).normalized; cachedForward = ((EntityState)this).characterDirection.forward; Animator modelAnimator = ((EntityState)this).GetModelAnimator(); Vector3 val2 = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.forward : slipVector); Vector3 val3 = Vector3.Cross(Vector3.up, val2); float num = Vector3.Dot(slipVector, val2); float num2 = Vector3.Dot(slipVector, val3); modelAnimator.SetFloat("dashF", num); modelAnimator.SetFloat("dashR", num2); ((EntityState)this).PlayCrossfade("FullBody, Override", "Dash", "Dash.playbackRate", duration * 1.5f, 0.05f); ((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty"); Util.PlaySound("sfx_driver_dash", ((EntityState)this).gameObject); ApplyBuff(); CreateDashEffect(); } public virtual void ApplyBuff() { } public virtual void CreateDashEffect() { } public override void FixedUpdate() { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); ((EntityState)this).characterMotor.velocity = Vector3.zero; ((EntityState)this).characterMotor.rootMotion = slipVector * (base.moveSpeedStat * speedCoefficient * Time.fixedDeltaTime) * Mathf.Cos(((EntityState)this).fixedAge / duration * (MathF.PI / 2f)); if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterDirection.forward = cachedForward; } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public virtual void DampenVelocity() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.velocity *= 0.8f; } public override void OnExit() { DampenVelocity(); ((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)4; } } public class Heal : BaseDriverSkillState { public float startupDelay = 0.65f; public float healPercentPerTick = 0.01f; public float tickStopwatch = 0.25f; private float stopwatch; private bool cancelling; protected override string prop => "MedkitModel"; protected override bool hideGun => true; public override void OnEnter() { base.OnEnter(); ((EntityState)this).PlayCrossfade("FullBody, Override", "Heal", "Action.playbackRate", startupDelay, 0.1f); } public override void OnExit() { base.OnExit(); ((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty"); } public override void FixedUpdate() { //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) ((EntityState)this).FixedUpdate(); ((BaseState)this).attackSpeedStat = ((EntityState)this).characterBody.attackSpeed; if (((EntityState)this).fixedAge >= startupDelay / ((BaseState)this).attackSpeedStat) { HandleHeal(); } if (((EntityState)this).isAuthority) { if (!((BaseState)this).isGrounded) { cancelling = true; } if (((EntityState)this).healthComponent.health >= ((EntityState)this).healthComponent.fullHealth || (((ButtonState)(ref ((EntityState)this).inputBank.skill4)).justPressed && ((EntityState)this).fixedAge >= 0.1f)) { cancelling = true; } if (((EntityState)this).inputBank.moveVector != Vector3.zero && ((EntityState)this).fixedAge >= 0.1f) { cancelling = true; } if (cancelling) { ((EntityState)this).outer.SetNextStateToMain(); } } } protected virtual void HandleHeal() { stopwatch += Time.fixedDeltaTime; if (stopwatch >= tickStopwatch / ((BaseState)this).attackSpeedStat) { TryHeal(); } } protected virtual void TryHeal() { //IL_0030: 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) stopwatch = 0f; if (NetworkServer.active) { ((EntityState)this).healthComponent.Heal(((EntityState)this).healthComponent.fullHealth * healPercentPerTick, default(ProcChainMask), true); } } } public class JammedGun : BaseDriverSkillState { public float duration = 5f; public override void OnEnter() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_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_004c: Expected O, but got Unknown base.OnEnter(); ((EntityState)this).PlayAnimation("Gesture, Override", "GunJammed", "Action.playbackRate", duration); EffectData val = new EffectData { origin = ((BaseState)this).FindModelChild("PistolMuzzle").position, rotation = Quaternion.identity }; EffectManager.SpawnEffect(Assets.jammedEffectPrefab, val, false); Util.PlaySound("sfx_driver_gun_jammed", ((EntityState)this).gameObject); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (Object.op_Implicit((Object)(object)iDrive) && (Object)(object)iDrive.weaponDef != (Object)(object)cachedWeaponDef) { ((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty"); ((EntityState)this).outer.SetNextStateToMain(); } else 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)6; } } public class MainState : GenericCharacterMain { private Animator animator; public LocalUser localUser; public override void OnEnter() { ((GenericCharacterMain)this).OnEnter(); animator = ((BaseCharacterMain)this).modelAnimator; FindLocalUser(); } public override void FixedUpdate() { ((GenericCharacterMain)this).FixedUpdate(); if (Object.op_Implicit((Object)(object)animator)) { bool flag = false; if (!((EntityState)this).characterBody.outOfDanger || !((EntityState)this).characterBody.outOfCombat) { flag = true; } animator.SetBool("inCombat", flag); if (((BaseState)this).isGrounded) { animator.SetFloat("airBlend", 0f); } else { animator.SetFloat("airBlend", 1f); } } if (((EntityState)this).isAuthority && ((EntityState)this).characterMotor.isGrounded) { CheckEmote<Rest>(Config.restKey); CheckEmote<Taunt>(Config.tauntKey); CheckEmote<Dance>(Config.danceKey); } } private void CheckEmote(KeyCode keybind, EntityState state) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (Input.GetKeyDown(keybind) && !localUser.isUIFocused) { ((EntityState)this).outer.SetInterruptState(state, (InterruptPriority)0); } } private void CheckEmote<T>(ConfigEntry<KeyboardShortcut> keybind) where T : EntityState, new() { if (Config.GetKeyPressed(keybind)) { FindLocalUser(); if (localUser != null && !localUser.isUIFocused) { ((EntityState)this).outer.SetInterruptState((EntityState)(object)new T(), (InterruptPriority)0); } } } private void FindLocalUser() { if (localUser != null || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { return; } foreach (LocalUser readOnlyLocalUsers in LocalUserManager.readOnlyLocalUsersList) { if ((Object)(object)readOnlyLocalUsers.cachedBody == (Object)(object)((EntityState)this).characterBody) { localUser = readOnlyLocalUsers; break; } } } public override void ProcessJump() { //IL_020e: Unknown result type (might be due to invalid IL or missing references) //IL_0213: Unknown result type (might be due to invalid IL or missing references) //IL_021a: Unknown result type (might be due to invalid IL or missing references) //IL_022b: Expected O, but got Unknown //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0265: Unknown result type (might be due to invalid IL or missing references) //IL_027c: Expected O, but got Unknown //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0295: 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_02a7: Unknown result type (might be due to invalid IL or missing references) //IL_02ae: Unknown result type (might be due to invalid IL or missing references) //IL_02b3: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Expected O, but got Unknown //IL_02f3: Unknown result type (might be due to invalid IL or missing references) //IL_0305: Unknown result type (might be due to invalid IL or missing references) //IL_0333: Unknown result type (might be due to invalid IL or missing references) //IL_0338: Unknown result type (might be due to invalid IL or missing references) if (!((BaseCharacterMain)this).hasCharacterMotor) { return; } bool flag = false; bool flag2 = false; if (!base.jumpInputReceived || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody) || ((EntityState)this).characterMotor.jumpCount >= ((EntityState)this).characterBody.maxJumpCount) { return; } int itemCount = ((EntityState)this).characterBody.inventory.GetItemCount(Items.JumpBoost); float num = 1f; float num2 = 1f; if (((EntityState)this).characterMotor.jumpCount >= ((EntityState)this).characterBody.baseJumpCount) { flag = true; num = 1.5f; num2 = 1.5f; } else if (itemCount > 0 && ((EntityState)this).characterBody.isSprinting) { float num3 = ((EntityState)this).characterBody.acceleration * ((EntityState)this).characterMotor.airControl; if (((EntityState)this).characterBody.moveSpeed > 0f && num3 > 0f) { flag2 = true; float num4 = Mathf.Sqrt(10f * (float)itemCount / num3); float num5 = ((EntityState)this).characterBody.moveSpeed / num3; num = (num4 + num5) / num5; } } GenericCharacterMain.ApplyJumpVelocity(((EntityState)this).characterMotor, ((EntityState)this).characterBody, num, num2, false); if (((BaseCharacterMain)this).hasModelAnimator) { int layerIndex = ((BaseCharacterMain)this).modelAnimator.GetLayerIndex("Body"); if (layerIndex >= 0) { if (((EntityState)this).characterBody.isSprinting) { ((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("SprintJump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex); } else if (flag) { ((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("BonusJump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex); } else { ((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("Jump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex); } } } if (flag) { EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/FeatherEffect"), new EffectData { origin = ((EntityState)this).characterBody.footPosition }, true); } else if (((EntityState)this).characterMotor.jumpCount > 0) { EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/CharacterLandImpact"), new EffectData { origin = ((EntityState)this).characterBody.footPosition, scale = ((EntityState)this).characterBody.radius }, true); } if (flag2) { EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/BoostJumpEffect"), new EffectData { origin = ((EntityState)this).characterBody.footPosition, rotation = Util.QuaternionSafeLookRotation(((EntityState)this).characterMotor.velocity) }, true); } CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.jumpCount++; if (Object.op_Implicit((Object)(object)animator)) { float num6 = ((CharacterAnimatorWalkParamCalculator)(ref ((BaseCharacterMain)this).animatorWalkParamCalculator)).animatorWalkSpeed.y; float num7 = ((CharacterAnimatorWalkParamCalculator)(ref ((BaseCharacterMain)this).animatorWalkParamCalculator)).animatorWalkSpeed.x; if ((Mathf.Abs(num6) <= 0.45f && Mathf.Abs(num7) <= 0.45f) || ((EntityState)this).inputBank.moveVector == Vector3.zero) { num6 = 0f; num7 = 0f; } if (Mathf.Abs(num6) > Mathf.Abs(num7)) { num6 = ((!(num6 > 0f)) ? (-1f) : 1f); num7 = 0f; } else if (Mathf.Abs(num6) < Mathf.Abs(num7)) { num7 = ((!(num7 > 0f)) ? (-1f) : 1f); num6 = 0f; } animator.SetFloat("forwardSpeedCached", num7); animator.SetFloat("rightSpeedCached", num6); } } } public class ReloadPistol : BaseDriverSkillState { public float baseDuration = 2.4f; public string animString = "ReloadPistol"; public InterruptPriority interruptPriority = (InterruptPriority)2; public CameraParamsOverrideHandle camParamsOverrideHandle; public bool aiming; private bool wasAiming; private float duration; private bool heheheha; public override void OnEnter() { base.OnEnter(); if (iDrive.passive.isPistolOnly) { baseDuration *= 0.5f; } duration = baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).GetModelAnimator().SetFloat("aimBlend", 1f); ((EntityState)this).PlayCrossfade("Gesture, Override", animString, "Action.playbackRate", duration * 1.1f, 0.1f); Util.PlaySound("sfx_driver_reload_01", ((EntityState)this).gameObject); wasAiming = aiming; if (NetworkServer.active && aiming) { ((EntityState)this).characterBody.AddBuff(Buffs.Slow50); } } public override void OnExit() { //IL_002f: 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_0063: 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) base.OnExit(); if (((EntityState)this).fixedAge <= duration && ((CameraParamsOverrideHandle)(ref camParamsOverrideHandle)).isValid) { ((EntityState)this).cameraTargetParams.RemoveParamsOverride(camParamsOverrideHandle, 0.2f); } if (((CameraParamsOverrideHandle)(ref camParamsOverrideHandle)).isValid && !aiming) { ((EntityState)this).cameraTargetParams.RemoveParamsOverride(camParamsOverrideHandle, 0.2f); } if (NetworkServer.active && aiming) { ((EntityState)this).characterBody.RemoveBuff(Buffs.Slow50); } if (((EntityState)this).inputBank.skill3.down && (Object)(object)((EntityState)this).skillLocator.utility.skillDef == (Object)(object)RobDriver.Modules.Survivors.Driver.skateboardSkillDef) { ((EntityState)this).PlayCrossfade("Gesture, Override", "BufferEmpty", 0.25f); } } public override void FixedUpdate() { //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (aiming) { ((EntityState)this).characterBody.isSprinting = false; ((EntityState)this).characterBody.SetAimTimer(1f); } if (((EntityState)this).isAuthority && aiming && !((EntityState)this).inputBank.skill2.down) { aiming = false; if (((CameraParamsOverrideHandle)(ref camParamsOverrideHandle)).isValid) { ((EntityState)this).cameraTargetParams.RemoveParamsOverride(camParamsOverrideHandle, 0.2f); } ((EntityState)this).GetModelAnimator().SetFloat("aimBlend", 0f); if (NetworkServer.active) { ((EntityState)this).characterBody.RemoveBuff(Buffs.Slow50); } } if (!aiming && wasAiming && ((EntityState)this).fixedAge >= 0.8f * duration && !heheheha) { heheheha = true; ((EntityState)this).PlayCrossfade("Gesture, Override", "BufferEmpty", 0.25f); } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { iDrive.FinishReload(); if (aiming) { ((EntityState)this).outer.SetNextState((EntityState)(object)new SteadyAim { skipAnim = true, camParamsOverrideHandle = camParamsOverrideHandle }); } else { ((EntityState)this).outer.SetNextStateToMain(); } } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) return interruptPriority; } } public class Shoot : BaseDriverSkillState { public static float damageCoefficient = 2.2f; public static float procCoefficient = 1f; public static float baseDuration = 0.7f; public static float baseCritDuration = 0.9f; public static float baseCritDuration2 = 1.4f; public static float force = 200f; public static float recoil = 2f; public static float range = 2000f; public static GameObject tracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/TracerGoldGat"); public static GameObject critTracerEffectPrefab = LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/TracerCaptainShotgun"); private float duration; private float fireTime; private float fireTime2; private bool hasFired; private bool hasFired2; private string muzzleString; private bool isCrit; private GameObject effectInstance; private uint spinPlayID; private bool oldShoot; protected virtual float _damageCoefficient => damageCoefficient; public virtual string shootSoundString { get { if (isCrit) { return "sfx_driver_pistol_shoot_critical"; } return "sfx_driver_pistol_shoot"; } } public virtual FalloffModel falloff => (FalloffModel)1; protected virtual GameObject tracerPrefab { get { if (isCrit) { return critTracerEffectPrefab; } return tracerEffectPrefab; } } public override void OnEnter() { //IL_00db: 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_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; ((EntityState)this).characterBody.isSprinting = false; oldShoot = Config.oldCritShot.Value; fireTime = 0.1f * duration; fireTime2 = 0.2f * duration; ((EntityState)this).characterBody.SetAimTimer(2f); muzzleString = "PistolMuzzle"; isCrit = ((BaseState)this).RollCrit(); if (isCrit) { if (oldShoot) { duration = baseCritDuration / ((BaseState)this).attackSpeedStat; fireTime = 0.5f * duration; fireTime2 = 0.55f * duration; effectInstance = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/CommandoReloadFX.prefab").WaitForCompletion()); effectInstance.transform.parent = ((BaseState)this).FindModelChild("Pistol"); effectInstance.transform.localRotation = Quaternion.Euler(new Vector3(0f, 80f, 0f)); effectInstance.transform.localPosition = Vector3.zero; spinPlayID = Util.PlaySound("sfx_driver_pistol_spin", ((EntityState)this).gameObject); ((EntityState)this).PlayAnimation("Gesture, Override", "ShootCritical", "Shoot.playbackRate", duration); } else { duration = baseCritDuration2 / ((BaseState)this).attackSpeedStat; fireTime = 0f * duration; fireTime2 = 0.05f * duration; ((EntityState)this).PlayAnimation("Gesture, Override", "ShootCriticalAlt", "Shoot.playbackRate", duration); } } else { if (((EntityState)this).isAuthority) { hasFired = true; Fire(); } ((EntityState)this).PlayAnimation("Gesture, Override", "Shoot", "Shoot.playbackRate", duration * 1.5f); } if (iDrive.passive.isPistolOnly) { iDrive.ConsumeAmmo(1f, scaleWithAttackSpeed: false); } if ((iDrive.passive.isBullets || iDrive.passive.isRyan) && ((EntityState)this).characterBody.HasBuff(Buffs.bulletDefs[iDrive.currentBulletIndex])) { iDrive.ConsumeAmmo(1f, scaleWithAttackSpeed: false); } } public override void OnExit() { base.OnExit(); if (spinPlayID != 0) { AkSoundEngine.StopPlayingID(spinPlayID); } if (Object.op_Implicit((Object)(object)effectInstance)) { EntityState.Destroy((Object)(object)effectInstance); } } private void Fire() { //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_005f: 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_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //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_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_0135: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: 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_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_016e: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: 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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c6: Unknown result type (might be due to invalid IL or missing references) //IL_01cc: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01dd: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ef: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_020d: Unknown result type (might be due to invalid IL or missing references) //IL_0218: Unknown result type (might be due to invalid IL or missing references) //IL_0223: Unknown result type (might be due to invalid IL or missing references) //IL_0225: Unknown result type (might be due to invalid IL or missing references) //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_0237: Expected O, but got Unknown //IL_023f: Unknown result type (might be due to invalid IL or missing references) if (iDrive.passive.isBullets || iDrive.passive.isRyan) { GameObject muzzleEffectPrefab = FirePistol2.muzzleEffectPrefab; MainModule main = ((Component)muzzleEffectPrefab.transform.GetChild(1)).GetComponent<ParticleSystem>().main; ((MainModule)(ref main)).startColor = MinMaxGradient.op_Implicit(Buffs.bulletDefs[iDrive.currentBulletIndex].buffColor); EffectManager.SimpleMuzzleFlash(muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); } else { EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, muzzleString, false); } Util.PlaySound(shootSoundString, ((EntityState)this).gameObject); if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); base.AddRecoil2(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil); BulletAttack val = new BulletAttack { bulletCount = 1u, aimVector = ((Ray)(ref aimRay)).direction, origin = ((Ray)(ref aimRay)).origin, damage = _damageCoefficient * ((BaseState)this).damageStat, damageColorIndex = (DamageColorIndex)0, damageType = iDrive.bulletDamageType, falloffModel = falloff, maxDistance = range, force = force, hitMask = CommonMasks.bullet, minSpread = 0f, maxSpread = ((EntityState)this).characterBody.spreadBloomAngle * 2f, isCrit = isCrit, owner = ((EntityState)this).gameObject, muzzleName = muzzleString, smartCollision = true, procChainMask = default(ProcChainMask), procCoefficient = procCoefficient, radius = 0.75f, sniper = false, stopperMask = CommonMasks.bullet, weapon = null, tracerEffectPrefab = tracerPrefab, spreadPitchScale = 1f, spreadYawScale = 1f, queryTriggerInteraction = (QueryTriggerInteraction)0, hitEffectPrefab = FirePistol2.hitEffectPrefab }; DamageAPI.AddModdedDamageType(val, iDrive.moddedBulletType); val.Fire(); } ((EntityState)this).characterBody.AddSpreadBloom(1.25f); } public override void FixedUpdate() { //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01d8: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (Object.op_Implicit((Object)(object)iDrive) && (Object)(object)iDrive.weaponDef != (Object)(object)cachedWeaponDef) { ((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty"); ((EntityState)this).outer.SetNextStateToMain(); return; } if (((EntityState)this).fixedAge >= fireTime && ((EntityState)this).isAuthority && !hasFired) { hasFired = true; Fire(); } if (isCrit && ((EntityState)this).fixedAge >= fireTime2 && ((EntityState)this).isAuthority && !hasFired2) { hasFired2 = true; Fire(); } if (oldShoot) { if (Object.op_Implicit((Object)(object)effectInstance) && ((EntityState)this).fixedAge >= 0.4f * duration) { EntityState.Destroy((Object)(object)effectInstance); AkSoundEngine.StopPlayingID(spinPlayID); spinPlayID = 0u; Util.PlaySound("sfx_driver_pistol_ready", ((EntityState)this).gameObject); } } else if (isCrit && !Object.op_Implicit((Object)(object)effectInstance) && ((EntityState)this).fixedAge >= 0.55f * duration) { effectInstance = Object.Instantiate<GameObject>(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Commando/CommandoReloadFX.prefab").WaitForCompletion()); effectInstance.transform.parent = ((BaseState)this).FindModelChild("Pistol"); effectInstance.transform.localRotation = Quaternion.Euler(new Vector3(0f, 80f, 0f)); effectInstance.transform.localPosition = Vector3.zero; spinPlayID = Util.PlaySound("sfx_driver_pistol_spin", ((EntityState)this).gameObject); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { if (iDrive.passive.isPistolOnly || iDrive.passive.isBullets || iDrive.passive.isRyan) { ((EntityState)this).outer.SetNextState((EntityState)(object)new WaitForReload()); } else { ((EntityState)this).outer.SetNextStateToMain(); } } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_005d: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) float num = 0.5f; if (isCrit && oldShoot) { num = 0.75f; } if (((EntityState)this).fixedAge >= num * duration) { return (InterruptPriority)0; } if (isCrit && !hasFired2) { return (InterruptPriority)2; } return (InterruptPriority)1; } } public class Slide : BaseDriverSkillState { private Vector3 forwardDirection; private GameObject slideEffectInstance; private bool startedStateGrounded; private Animator animator; private bool classicSound; public override void OnEnter() { //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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_0094: 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_017a: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: Expected O, but got Unknown //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); animator = ((EntityState)this).GetModelAnimator(); classicSound = Config.classicDodgeSound.Value; if (classicSound) { Util.PlaySound(SlideState.soundString, ((EntityState)this).gameObject); } if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { CharacterDirection characterDirection = ((EntityState)this).characterDirection; Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector); characterDirection.forward = ((Vector3)(ref val)).normalized; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { startedStateGrounded = ((EntityState)this).characterMotor.isGrounded; } ((EntityState)this).characterBody.SetSpreadBloom(0f, false); if (Object.op_Implicit((Object)(object)iDrive) && Object.op_Implicit((Object)(object)iDrive.weaponDef) && iDrive.weaponDef.animationSet == DriverWeaponDef.AnimationSet.TwoHanded) { animator.SetBool("holding", true); ((EntityState)this).PlayAnimation("Gesture, Override", "HoldGun"); } if (!startedStateGrounded) { if (!classicSound) { Util.PlaySound("sfx_driver_air_dodge", ((EntityState)this).gameObject); } EffectManager.SpawnEffect(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/ImpactEffects/CharacterLandImpact"), new EffectData { origin = ((EntityState)this).characterBody.footPosition, scale = ((EntityState)this).characterBody.radius }, true); ((EntityState)this).PlayAnimation("FullBody, Override", "AirDodge"); Vector3 velocity = ((EntityState)this).characterMotor.velocity; velocity.y = ((EntityState)this).characterBody.jumpPower; ((EntityState)this).characterMotor.velocity = velocity; } else { if (!classicSound) { Util.PlaySound("sfx_driver_dodge", ((EntityState)this).gameObject); } ((EntityState)this).PlayAnimation("FullBody, Override", "Slide", "Slide.playbackRate", SlideState.slideDuration); if (Object.op_Implicit((Object)(object)SlideState.slideEffectPrefab)) { Transform val2 = ((BaseState)this).FindModelChild("Root"); slideEffectInstance = Object.Instantiate<GameObject>(SlideState.slideEffectPrefab, val2); } } } public override void Update() { ((EntityState)this).Update(); if (Object.op_Implicit((Object)(object)animator)) { animator.SetBool("isGrounded", ((BaseState)this).isGrounded); } } public override void FixedUpdate() { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0132: 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_013c: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (Object.op_Implicit((Object)(object)animator)) { animator.SetBool("isGrounded", ((BaseState)this).isGrounded); } if (!((BaseState)this).isGrounded && Object.op_Implicit((Object)(object)slideEffectInstance)) { EntityState.Destroy((Object)(object)slideEffectInstance); } if (((EntityState)this).isAuthority) { float num = (startedStateGrounded ? SlideState.slideDuration : SlideState.jumpDuration); if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank) && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterDirection.moveVector = ((EntityState)this).inputBank.moveVector; forwardDirection = ((EntityState)this).characterDirection.forward; } if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { float num2 = ((!startedStateGrounded) ? SlideState.jumpforwardSpeedCoefficientCurve.Evaluate(((EntityState)this).fixedAge / num) : SlideState.forwardSpeedCoefficientCurve.Evaluate(((EntityState)this).fixedAge / num)); CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.rootMotion += num2 * ((BaseState)this).moveSpeedStat * forwardDirection * Time.fixedDeltaTime; } if (((EntityState)this).fixedAge >= num) { ((EntityState)this).outer.SetNextStateToMain(); } } } public override void OnExit() { PlayImpactAnimation(); if (Object.op_Implicit((Object)(object)slideEffectInstance)) { EntityState.Destroy((Object)(object)slideEffectInstance); } animator.SetBool("holding", false); base.OnExit(); } private void PlayImpactAnimation() { Animator modelAnimator = ((EntityState)this).GetModelAnimator(); int layerIndex = modelAnimator.GetLayerIndex("Impact"); if (layerIndex >= 0) { modelAnimator.SetLayerWeight(layerIndex, 1f); } } 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 SteadyAim : BaseDriverSkillState { public float baseShotDuration = 0.3f; public float baseChargeDuration = 0.15f; public static float damageCoefficient = 5f; public static float recoil = 0.5f; protected bool lastCharge; public bool skipAnim = false; public CameraParamsOverrideHandle camParamsOverrideHandle; private OverlayController overlayController; private float shotCooldown; private float chargeTimer; private float chargeDuration; private bool isCharged; private bool isCrit; private int cachedShots; private float cachedShotTimer; private PrimarySkillShurikenBehavior shurikenComponent; private bool _autoFocus; private bool autoFocus; private bool cancelling; private bool adaptiveFocus; private bool reloading; private GameObject lightEffectInstance; private Animator animator; private bool jamFlag; protected virtual bool isPiercing => false; protected virtual float _damageCoefficient => damageCoefficient; protected virtual GameObject tracerPrefab { get { if (isCrit) { return Shoot.critTracerEffectPrefab; } return Shoot.tracerEffectPrefab; } } public override void OnEnter() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01ee: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); animator = ((EntityState)this).GetModelAnimator(); if (!((CameraParamsOverrideHandle)(ref camParamsOverrideHandle)).isValid) { camParamsOverrideHandle = CameraParams.OverrideCameraParams(((EntityState)this).cameraTargetParams, DriverCameraParams.AIM_PISTOL); } ((EntityState)this).PlayAnimation("AimPitch", "SteadyAimPitch"); if (NetworkServer.active) { ((EntityState)this).characterBody.AddBuff(Buffs.Slow50); } shurikenComponent = ((EntityState)this).GetComponent<PrimarySkillShurikenBehavior>(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody.master) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.master.inventory)) { ((EntityState)this).characterBody.master.inventory.onInventoryChanged += Inventory_onInventoryChanged; } ((EntityState)this).characterBody._defaultCrosshairPrefab = Assets.pistolAimCrosshairPrefab; _autoFocus = Config.autoFocus.Value; adaptiveFocus = Config.adaptiveFocus.Value; chargeDuration = baseChargeDuration / ((BaseState)this).attackSpeedStat; autoFocus = false; if (adaptiveFocus && chargeDuration <= 0.1f) { autoFocus = true; } if (_autoFocus) { autoFocus = true; } if (!skipAnim) { PlayAnim(); Util.PlaySound("sfx_driver_aim_foley", ((EntityState)this).gameObject); } ((Component)((BaseState)this).FindModelChild("PistolSight")).gameObject.SetActive(true); if (iDrive.passive.isPistolOnly || iDrive.passive.isBullets || iDrive.passive.isRyan) { overlayController = HudOverlayManager.AddOverlay(((EntityState)this).gameObject, new OverlayCreationParams { prefab = Assets.headshotOverlay, childLocatorEntry = "ScopeContainer" }); animator.SetLayerWeight(animator.GetLayerIndex("AltPistol, Override"), 1f); } else { animator.SetLayerWeight(animator.GetLayerIndex("AltPistol, Override"), 0f); } lightEffectInstance = Object.Instantiate<GameObject>(Assets.mainAssetBundle.LoadAsset<GameObject>("GunLight")); } protected virtual void PlayAnim() { ((EntityState)this).PlayAnimation("Gesture, Override", "SteadyAim", "Action.playbackRate", 0.25f); } protected virtual void PlayExitAnim() { ((EntityState)this).PlayAnimation("Gesture, Override", "SteadyAimEnd", "Action.playbackRate", 0.2f); } private void Inventory_onInventoryChanged() { shurikenComponent = ((EntityState)this).GetComponent<PrimarySkillShurikenBehavior>(); } private void UpdateLightEffect() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); RaycastHit val = default(RaycastHit); if (Physics.Raycast(((Ray)(ref aimRay)).origin, ((Ray)(ref aimRay)).direction, ref val, Shoot.range, LayerMask.op_Implicit(CommonMasks.bullet))) { lightEffectInstance.SetActive(true); lightEffectInstance.transform.position = ((RaycastHit)(ref val)).point + ((Ray)(ref aimRay)).direction * -0.3f; } else { lightEffectInstance.SetActive(false); } } public override void FixedUpdate() { //IL_029b: Unknown result type (might be due to invalid IL or missing references) //IL_02a0: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); chargeDuration = baseChargeDuration / ((BaseState)this).attackSpeedStat; autoFocus = false; if (adaptiveFocus && chargeDuration <= 0.1f) { autoFocus = true; } if (_autoFocus) { autoFocus = true; } shotCooldown -= Time.fixedDeltaTime; cachedShotTimer -= Time.fixedDeltaTime; ((EntityState)this).characterBody.outOfCombatStopwatch = 0f; ((EntityState)this).characterBody.isSprinting = false; ((EntityState)this).characterBody.SetAimTimer(0.2f); ((BaseState)this).attackSpeedStat = ((EntityState)this).characterBody.attackSpeed; ((BaseState)this).damageStat = ((EntityState)this).characterBody.damage; ((BaseState)this).critStat = ((EntityState)this).characterBody.crit; UpdateLightEffect(); if (Object.op_Implicit((Object)(object)iDrive) && (Object)(object)iDrive.weaponDef != (Object)(object)cachedWeaponDef) { cancelling = true; ((EntityState)this).outer.SetNextStateToMain(); return; } if (reloading && shotCooldown <= 0f) { reloading = false; iDrive.FinishReload(); } if (((EntityState)this).skillLocator.secondary.stock < 1) { isCharged = false; chargeTimer = 0f; } else if (shotCooldown <= 0f) { chargeTimer += Time.fixedDeltaTime; } if (!isCharged && chargeTimer >= chargeDuration) { isCharged = true; Util.PlaySound("sfx_driver_pistol_ready", ((EntityState)this).gameObject); } if (iDrive.weaponTimer <= 0f && (iDrive.passive.isPistolOnly || iDrive.passive.isBullets || iDrive.passive.isRyan)) { if (shotCooldown <= 0f && ((EntityState)this).inputBank.skill1.down && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextState((EntityState)(object)new ReloadPistol { animString = "SteadyAimReload", camParamsOverrideHandle = camParamsOverrideHandle, aiming = true }); reloading = true; } } else if (shotCooldown <= 0f && ((EntityState)this).isAuthority) { if (autoFocus) { if (((EntityState)this).inputBank.skill1.down) { if (((EntityState)this).skillLocator.secondary.stock > 0) { if (isCharged) { isCrit = ((BaseState)this).RollCrit(); Fire(); } } else { isCrit = ((BaseState)this).RollCrit(); Fire(); } } } else if (((EntityState)this).inputBank.skill1.down) { isCrit = ((BaseState)this).RollCrit(); Fire(); } } if (cachedShots > 0 && ((EntityState)this).isAuthority && cachedShotTimer <= 0f) { Fire2(cachedShots); cachedShots = 0; } if (!((EntityState)this).inputBank.skill2.down && ((EntityState)this).isAuthority && !reloading) { if (jamFlag && shotCooldown > 0f && Object.op_Implicit((Object)(object)iDrive) && iDrive.AddJamBuildup()) { ((EntityState)this).outer.SetNextState((EntityState)(object)new JammedGun()); return; } if (iDrive.passive.isPistolOnly && iDrive.weaponTimer != iDrive.maxWeaponTimer) { ((EntityState)this).outer.SetNextState((EntityState)(object)new WaitForReload()); return; } ((EntityState)this).outer.SetNextStateToMain(); } if (Object.op_Implicit((Object)(object)iDrive)) { if (((EntityState)this).skillLocator.secondary.stock < 1) { iDrive.chargeValue = 0f; return; } float chargeValue = Util.Remap(chargeTimer, 0f, chargeDuration, 0f, 1f); iDrive.chargeValue = chargeValue; } } protected virtual void PlayShootAnim(bool wasCharged, bool wasCrit, float speed) { string text = "SteadyAimFire"; if (wasCharged) { text = ((!wasCrit) ? "SteadyAimFireCharged" : "SteadyAimFireChargedCritical"); } else if (wasCrit) { text = "SteadyAimFireCritical"; } ((EntityState)this).PlayAnimation("Gesture, Override", text, "Action.playbackRate", speed); } protected virtual string GetSoundString(bool crit, bool charged) { string result = "sfx_driver_pistol_shoot"; if (crit) { result = "sfx_driver_pistol_shoot_critical"; } if (charged) { result = "sfx_driver_pistol_shoot_charged"; } return result; } public virtual void Fire() { //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_023b: Unknown result type (might be due to invalid IL or missing references) //IL_024a: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03b1: Unknown result type (might be due to invalid IL or missing references) //IL_03b8: Unknown result type (might be due to invalid IL or missing references) //IL_03bb: Unknown result type (might be due to invalid IL or missing references) //IL_03c6: Unknown result type (might be due to invalid IL or missing references) //IL_03c9: Unknown result type (might be due to invalid IL or missing references) //IL_03ce: Unknown result type (might be due to invalid IL or missing references) //IL_03d3: Unknown result type (might be due to invalid IL or missing references) //IL_03e2: Unknown result type (might be due to invalid IL or missing references) //IL_03e4: Unknown result type (might be due to invalid IL or missing references) //IL_03e9: Unknown result type (might be due to invalid IL or missing references) //IL_03f0: Unknown result type (might be due to invalid IL or missing references) //IL_03f5: Unknown result type (might be due to invalid IL or missing references) //IL_03fa: Unknown result type (might be due to invalid IL or missing references) //IL_03fb: Unknown result type (might be due to invalid IL or missing references) //IL_03fd: Unknown result type (might be due to invalid IL or missing references) //IL_0402: Unknown result type (might be due to invalid IL or missing references) //IL_040e: Unknown result type (might be due to invalid IL or missing references) //IL_0419: Unknown result type (might be due to invalid IL or missing references) //IL_041a: Unknown result type (might be due to invalid IL or missing references) //IL_041f: Unknown result type (might be due to invalid IL or missing references) //IL_0424: Unknown result type (might be due to invalid IL or missing references) //IL_042f: Unknown result type (might be due to invalid IL or missing references) //IL_043a: Unknown result type (might be due to invalid IL or missing references) //IL_0446: Unknown result type (might be due to invalid IL or missing references) //IL_0452: Unknown result type (might be due to invalid IL or missing references) //IL_045d: Unknown result type (might be due to invalid IL or missing references) //IL_0464: Unknown result type (might be due to invalid IL or missing references) //IL_046a: Unknown result type (might be due to invalid IL or missing references) //IL_0470: Unknown result type (might be due to invalid IL or missing references) //IL_047b: Unknown result type (might be due to invalid IL or missing references) //IL_0486: Unknown result type (might be due to invalid IL or missing references) //IL_048d: Unknown result type (might be due to invalid IL or missing references) //IL_048e: Unknown result type (might be due to invalid IL or missing references) //IL_0493: Unknown result type (might be due to invalid IL or missing references) //IL_0498: Unknown result type (might be due to invalid IL or missing references) //IL_049f: Unknown result type (might be due to invalid IL or missing references) //IL_04ab: Unknown result type (might be due to invalid IL or missing references) //IL_04b6: Unknown result type (might be due to invalid IL or missing references) //IL_04c1: Unknown result type (might be due to invalid IL or missing references) //IL_04c3: Unknown result type (might be due to invalid IL or missing references) //IL_04c8: Unknown result type (might be due to invalid IL or missing references) //IL_04d5: Expected O, but got Unknown //IL_04dd: Unknown result type (might be due to invalid IL or missing references) //IL_025c: Unknown result type (might be due to invalid IL or missing references) //IL_0261: Unknown result type (might be due to invalid IL or missing references) //IL_0268: Unknown result type (might be due to invalid IL or missing references) //IL_026b: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0279: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_0283: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0294: 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_02a0: Unknown result type (might be due to invalid IL or missing references) //IL_02a5: 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_02ab: 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_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02be: 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_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: 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_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02f6: Unknown result type (might be due to invalid IL or missing references) //IL_0302: Unknown result type (might be due to invalid IL or missing references) //IL_030d: Unknown result type (might be due to invalid IL or missing references) //IL_0314: Unknown result type (might be due to invalid IL or missing references) //IL_031a: Unknown result type (might be due to invalid IL or missing references) //IL_0320: Unknown result type (might be due to invalid IL or missing references) //IL_032b: Unknown result type (might be due to invalid IL or missing references) //IL_0336: Unknown result type (might be due to invalid IL or missing references) //IL_033d: Unknown result type (might be due to invalid IL or missing references) //IL_0343: Unknown result type (might be due to invalid IL or missing references) //IL_0348: 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_0354: 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_036b: Unknown result type (might be due to invalid IL or missing references) //IL_0376: Unknown result type (might be due to invalid IL or missing references) //IL_0378: Unknown result type (might be due to invalid IL or missing references) //IL_037d: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Expected O, but got Unknown //IL_0392: Unknown result type (might be due to invalid IL or missing references) //IL_052f: Unknown result type (might be due to invalid IL or missing references) //IL_0539: Expected O, but got Unknown if (iDrive.passive.isPistolOnly) { iDrive.ConsumeAmmo(1f, scaleWithAttackSpeed: false); } if ((iDrive.passive.isBullets || iDrive.passive.isRyan) && ((EntityState)this).characterBody.HasBuff(Buffs.bulletDefs[iDrive.currentBulletIndex])) { iDrive.ConsumeAmmo(1f, scaleWithAttackSpeed: false); } if (Object.op_Implicit((Object)(object)shurikenComponent)) { shurikenComponent.OnSkillActivated(((EntityState)this).skillLocator.primary); } if (((EntityState)this).fixedAge <= 0.25f) { jamFlag = true; } bool wasCharged = isCharged; shotCooldown = baseShotDuration / ((BaseState)this).attackSpeedStat; chargeTimer = 0f; isCharged = false; EffectManager.SimpleMuzzleFlash(FirePistol2.muzzleEffectPrefab, ((EntityState)this).gameObject, "PistolMuzzle", false); if (isCrit) { cachedShots++; cachedShotTimer = 0.05f; } if (wasCharged) { ((EntityState)this).characterBody.AddSpreadBloom(1.5f); } else { ((EntityState)this).characterBody.AddSpreadBloom(0.35f); } Util.PlaySound(GetSoundString(isCrit, wasCharged), ((EntityState)this).gameObject); PlayShootAnim(wasCharged, isCrit, shotCooldown * 1.5f); if (!((EntityState)this).isAuthority) { return; } Ray aimRay = ((BaseState)this).GetAimRay(); base.AddRecoil2(-1f * recoil, -2f * recoil, -0.5f * recoil, 0.5f * recoil); float num = Shoot.damageCoefficient; if (wasCharged) { num = _damageCoefficient; ((EntityState)this).skillLocator.secondary.DeductStock(1); } lastCharge = wasCharged; FalloffModel falloffModel = (FalloffModel)1; if (lastCharge) { falloffModel = (FalloffModel)0; } if (isPiercing) { BulletAttack val = new BulletAttack { bulletCount = 1u, aimVector = ((Ray)(ref aimRay)).direction, origin = ((Ray)(ref aimRay)).origin, damage = num * ((BaseState)this).damageStat, damageColorIndex = (DamageColorIndex)0, damageType = iDrive.bulletDamageType, falloffModel = falloffModel, maxDistance = Shoot.range, force = Shoot.force, hitMask = CommonMasks.bullet, minSpread = 0f, maxSpread = 0f, isCrit = isCrit, owner = ((EntityState)this).gameObject, muzzleName = "PistolMuzzle", smartCollision = true, procChainMask = default(ProcChainMask), procCoefficient = Shoot.procCoefficient, radius = 1f, sniper = false, stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask, weapon = null, tracerEffectPrefab = tracerPrefab, spreadPitchScale = 0f, spreadYawScale = 0f, queryTriggerInteraction = (QueryTriggerInteraction)0, hitEffectPrefab = FirePistol2.hitEffectPrefab }; DamageAPI.AddModdedDamageType(val, iDrive.moddedBulletType); val.Fire(); return; } BulletAttack val2 = new BulletAttack { bulletCount = 1u, aimVector = ((Ray)(ref aimRay)).direction, origin = ((Ray)(ref aimRay)).origin, damage = num * ((BaseState)this).damageStat, damageColorIndex = (DamageColorIndex)0, damageType = iDrive.bulletDamageType, falloffModel = falloffModel, maxDistance = Shoot.range, force = Shoot.force, hitMask = CommonMasks.bullet, minSpread = 0f, maxSpread = 0f, isCrit = isCrit, owner = ((EntityState)this).gameObject, muzzleName = "PistolMuzzle", smartCollision = true, procChainMask = default(ProcChainMask), procCoefficient = Shoot.procCoefficient, radius = 1f, sniper = false, stopperMask = CommonMasks.bullet, weapon = null, tracerEffectPrefab = tracerPrefab, spreadPitchScale = 0f, spreadYawScale = 0f, queryTriggerInteraction = (QueryTriggerInteraction)0, hitEffectPrefab = FirePistol2.hitEffectPrefab }; DamageAPI.AddModdedDamageType(val2, iDrive.moddedBulletType); if (iDrive.passive.isPistolOnly || iDrive.passive.isBullets || iDrive.passive.isRyan) { val2.modifyOutgoingDamageCallback = (ModifyOutgoingDamageCallback)delegate(BulletAttack _bulletAttack, ref BulletHit hitInfo, DamageInfo damageInfo) { //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0068: 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_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_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Expected O, but got Unknown //IL_009c: Unknown result type (might be due to invalid IL or missing references) //IL_00a1: Unknown result type (might be due to invalid IL or missing references) if (BulletAttack.IsSniperTargetHit(ref hitInfo)) { if (iDrive.passive.isPistolOnly) { damageInfo.damage *= 2f; } else { damageInfo.damage *= 1.5f; } damageInfo.damageColorIndex = (DamageColorIndex)12; if (wasCharged) { EffectData val3 = new EffectData { origin = hitInfo.point, rotation = Quaternion.LookRotation(-hitInfo.direction) }; val3.SetHurtBoxReference(hitInfo.hitHurtBox); EffectManager.SpawnEffect(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Junk/Common/VFX/WeakPointProcEffect.prefab").WaitForCompletion(), val3, true); Util.PlaySound("sfx_driver_headshot", ((EntityState)this).gameObject); ((Component)hitInfo.hitHurtBox.healthComponent).gameObject.AddComponent<DriverHeadshotTracker>(); } } }; } val2.Fire(); } public void Fire2(int bulletCount) { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: 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_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00dc: 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_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_00ef: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0156: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01a0: 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_01b6: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01bd: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Expected O, but got Unknown //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_0224: