Decompiled source of HUNK v1.5.14
HunkMod.dll
Decompiled a week 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.InteropServices; 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 EntityStates; using EntityStates.BeetleGuardMonster; using EntityStates.Bison; using EntityStates.BrotherMonster; using EntityStates.ClayBruiser.Weapon; using EntityStates.Commando.CommandoWeapon; using EntityStates.Croco; using EntityStates.GlobalSkills.LunarDetonator; using EntityStates.GlobalSkills.LunarNeedle; using EntityStates.LemurianBruiserMonster; using EntityStates.Mage.Weapon; using EntityStates.Missions.BrotherEncounter; using EntityStates.ParentMonster; using EntityStates.VoidInfestor; using HG; using HG.BlendableTypes; using HunkMod; using HunkMod.Modules; using HunkMod.Modules.Achievements; using HunkMod.Modules.Components; using HunkMod.Modules.Components.UI; using HunkMod.Modules.Enemies; using HunkMod.Modules.Misc; using HunkMod.Modules.Objectives; using HunkMod.Modules.Survivors; using HunkMod.Modules.Weapons; using HunkMod.SkillStates; using HunkMod.SkillStates.BaseStates; using HunkMod.SkillStates.C4; using HunkMod.SkillStates.Emote; using HunkMod.SkillStates.Hunk; using HunkMod.SkillStates.Hunk.Cling; using HunkMod.SkillStates.Hunk.Counter; using HunkMod.SkillStates.Hunk.Weapon.ATM; using HunkMod.SkillStates.Hunk.Weapon.AssaultRifle; using HunkMod.SkillStates.Hunk.Weapon.BlueRose; using HunkMod.SkillStates.Hunk.Weapon.Flamethrower; using HunkMod.SkillStates.Hunk.Weapon.GoldenGun; using HunkMod.SkillStates.Hunk.Weapon.GrenadeLauncher; using HunkMod.SkillStates.Hunk.Weapon.M19; using HunkMod.SkillStates.Hunk.Weapon.MUP; using HunkMod.SkillStates.Hunk.Weapon.Magnum; using HunkMod.SkillStates.Hunk.Weapon.Railgun; using HunkMod.SkillStates.Hunk.Weapon.Revolver; using HunkMod.SkillStates.Hunk.Weapon.RocketLauncher; using HunkMod.SkillStates.Hunk.Weapon.SMG; using HunkMod.SkillStates.Hunk.Weapon.ScanGun; using HunkMod.SkillStates.Hunk.Weapon.Shotgun; using HunkMod.SkillStates.Hunk.Weapon.Slugger; using HunkMod.SkillStates.Parasite; using HunkMod.SkillStates.Virus; using JetBrains.Annotations; using KinematicCharacterController; using MaterialHud; using Mono.Cecil.Cil; using MonoMod.Cil; using On.EntityStates; using On.EntityStates.BeetleGuardMonster; using On.EntityStates.Bison; using On.EntityStates.BrotherMonster; using On.EntityStates.ClayBruiser.Weapon; using On.EntityStates.GlobalSkills.LunarDetonator; using On.EntityStates.GlobalSkills.LunarNeedle; using On.EntityStates.LemurianBruiserMonster; using On.EntityStates.Missions.BrotherEncounter; using On.EntityStates.ParentMonster; using On.RoR2; using On.RoR2.Projectile; using On.RoR2.UI; using On.RoR2.UI.MainMenu; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using R2API.Utils; using Rewired; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.Achievements; using RoR2.Audio; using RoR2.CameraModes; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.ExpansionManagement; using RoR2.HudOverlay; using RoR2.Navigation; using RoR2.Networking; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using RoR2.UI.MainMenu; using TMPro; using ThreeEyedGames; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.EventSystems; using UnityEngine.Events; 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("HunkMod")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("HunkMod")] [assembly: AssemblyTitle("HunkMod")] [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 HunkCameraParams { DEFAULT, AIM, AIM_SNIPER, MELEE, 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 HunkWeaponDef : ScriptableObject { public enum AnimationSet { Pistol, SMG, Rocket, Unarmed, Throwable, PistolAlt, Railgun } [Header("General")] public string nameToken = ""; public string descriptionToken = ""; public Sprite icon = null; public GameObject crosshairPrefab = null; public int magSize = 8; public float magPickupMultiplier = 1f; public int startingMags = 1; public float reloadDuration = 2.4f; public string ammoName = ""; public bool allowAutoReload = true; public bool exposeWeakPoints = true; public bool roundReload = false; public bool canPickUpAmmo = true; [Header("Skills")] public SkillDef primarySkillDef; [Header("Visuals")] public GameObject modelPrefab; public AnimationSet animationSet = AnimationSet.SMG; public bool storedOnBack = true; [Header("UI")] public float damageFillValue; public float rangefillValue; public float fireRateFillValue; public float reloadFillValue; public float accuracyFillValue; [HideInInspector] public ushort index; [HideInInspector] public ItemDef itemDef; public static HunkWeaponDef CreateWeaponDefFromInfo(HunkWeaponDefInfo weaponDefInfo) { HunkWeaponDef hunkWeaponDef = (HunkWeaponDef)(object)ScriptableObject.CreateInstance(typeof(HunkWeaponDef)); ((Object)hunkWeaponDef).name = weaponDefInfo.nameToken; hunkWeaponDef.nameToken = weaponDefInfo.nameToken; hunkWeaponDef.descriptionToken = weaponDefInfo.descriptionToken; hunkWeaponDef.icon = weaponDefInfo.icon; hunkWeaponDef.crosshairPrefab = weaponDefInfo.crosshairPrefab; hunkWeaponDef.magSize = weaponDefInfo.magSize; hunkWeaponDef.magPickupMultiplier = weaponDefInfo.magPickupMultiplier; hunkWeaponDef.startingMags = weaponDefInfo.startingMags; hunkWeaponDef.reloadDuration = weaponDefInfo.reloadDuration; hunkWeaponDef.ammoName = weaponDefInfo.ammoName; hunkWeaponDef.primarySkillDef = weaponDefInfo.primarySkillDef; hunkWeaponDef.modelPrefab = weaponDefInfo.modelPrefab; hunkWeaponDef.animationSet = weaponDefInfo.animationSet; hunkWeaponDef.storedOnBack = weaponDefInfo.storedOnBack; hunkWeaponDef.damageFillValue = weaponDefInfo.damageFillValue; hunkWeaponDef.rangefillValue = weaponDefInfo.rangefillValue; hunkWeaponDef.fireRateFillValue = weaponDefInfo.fireRateFillValue; hunkWeaponDef.reloadFillValue = weaponDefInfo.reloadFillValue; hunkWeaponDef.accuracyFillValue = weaponDefInfo.accuracyFillValue; return hunkWeaponDef; } public HunkWeaponDef CloneWeapon(bool addToCatalog = true) { HunkWeaponDef hunkWeaponDef = Object.Instantiate<HunkWeaponDef>(this); HunkWeaponCatalog.AddWeapon(hunkWeaponDef, addItem: false); ContentAddition.AddItemDef(hunkWeaponDef.itemDef); return hunkWeaponDef; } } [Serializable] public struct HunkWeaponDefInfo { public string nameToken; public string descriptionToken; public Sprite icon; public GameObject crosshairPrefab; public int magSize; public float magPickupMultiplier; public int startingMags; public float reloadDuration; public string ammoName; public SkillDef primarySkillDef; public GameObject modelPrefab; public HunkWeaponDef.AnimationSet animationSet; public bool storedOnBack; public float damageFillValue; public float rangefillValue; public float fireRateFillValue; public float reloadFillValue; public float accuracyFillValue; } 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 HunkMod { [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.*/)] [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.Hunk", "Hunk", "1.5.14")] [R2APISubmoduleDependency(new string[] { "PrefabAPI", "LanguageAPI", "SoundAPI", "DirectorAPI", "LoadoutAPI", "UnlockableAPI", "NetworkingAPI", "RecalculateStatsAPI" })] public class MainPlugin : BaseUnityPlugin { public const string MODUID = "com.rob.Hunk"; public const string MODNAME = "Hunk"; public const string MODVERSION = "1.5.14"; public const string developerPrefix = "ROB"; public static MainPlugin instance; public static bool badaBingBadaBoom = false; public static bool spawnedGuaranteedCase = false; public static bool hasInitLate = false; public static List<HurtBox> hurtboxesList = new List<HurtBox>(); public static List<HunkProjectileTracker> projectileList = new List<HunkProjectileTracker>(); public static bool scepterInstalled => Chainloader.PluginInfos.ContainsKey("com.DestroyedClone.AncientScepter"); public static bool rooInstalled => Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"); public static bool riskUIInstalled => Chainloader.PluginInfos.ContainsKey("bubbet.riskui"); public static bool greenAlienHeadInstalled => Chainloader.PluginInfos.ContainsKey("com.Borbo.GreenAlienHead"); public static bool qolChestsInstalled => Chainloader.PluginInfos.ContainsKey("Faust.QoLChests"); public static bool emptyChestsInstalled => Chainloader.PluginInfos.ContainsKey("com.Elysium.ECBG"); public static bool unlockAllInstalled => Chainloader.PluginInfos.ContainsKey("com.xoxfaby.UnlockAll"); public static bool moreShrinesInstalled => Chainloader.PluginInfos.ContainsKey("com.evaisa.moreshrines"); public static bool ss2Installed => Chainloader.PluginInfos.ContainsKey("com.evaisa.moreshrines"); private void Awake() { instance = this; Config.myConfig = ((BaseUnityPlugin)this).Config; Log.Init(((BaseUnityPlugin)this).Logger); Config.ReadConfig(); Assets.PopulateAssets(); CameraParams.InitializeParams(); States.RegisterStates(); Projectiles.RegisterProjectiles(); Tokens.AddTokens(); ItemDisplays.PopulateDisplays(); new Hunk().CreateCharacter(); new Parasite().CreateCharacter(); NetworkingAPI.RegisterMessageType<SyncWeapon>(); NetworkingAPI.RegisterMessageType<SyncOverlay>(); NetworkingAPI.RegisterMessageType<SyncStoredWeapon>(); NetworkingAPI.RegisterMessageType<SyncDecapitation>(); NetworkingAPI.RegisterMessageType<SyncAmmoPickup>(); NetworkingAPI.RegisterMessageType<SyncGunDrop>(); NetworkingAPI.RegisterMessageType<SyncGunDrop2>(); NetworkingAPI.RegisterMessageType<SyncGunSwap>(); NetworkingAPI.RegisterMessageType<SyncVirus>(); NetworkingAPI.RegisterMessageType<SyncCombatStopwatch>(); NetworkingAPI.RegisterMessageType<SyncWeaponCaseOpen>(); NetworkingAPI.RegisterMessageType<SyncHeadshot>(); NetworkingAPI.RegisterMessageType<SyncCaseItem>(); NetworkingAPI.RegisterMessageType<SyncTemplarExplosion>(); NetworkingAPI.RegisterMessageType<SyncTVirus>(); NetworkingAPI.RegisterMessageType<SyncTVirusOverlay>(); NetworkingAPI.RegisterMessageType<SyncCVirus>(); NetworkingAPI.RegisterMessageType<SyncCVirusOverlay>(); NetworkingAPI.RegisterMessageType<SyncHunkTarget>(); Hook(); new ContentPacks().Initialize(); ContentManager.onContentPacksAssigned += LateSetup; CreateWeapons(); } private void LateSetup(ReadOnlyArray<ReadOnlyContentPack> obj) { Hunk.SetItemDisplays(); } private void CreateWeapons() { new SMG().Init(); new M19().Init(); new MUP().Init(); new Magnum().Init(); new Shotgun().Init(); new Slugger().Init(); new RocketLauncher().Init(); new ATM().Init(); new Revolver().Init(); new Flamethrower().Init(); new GrenadeLauncher().Init(); new GoldenGun().Init(); new BlueRose().Init(); new AssaultRifle().Init(); new Railgun().Init(); new Flashlight().Init(); new ScanGun().Init(); } private void Hook() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats); HurtBox.OnEnable += new hook_OnEnable(HurtBox_OnEnable); HurtBox.OnDisable += new hook_OnDisable(HurtBox_OnDisable); ProjectileGhostController.Awake += new hook_Awake(ProjectileGhostController_Awake); } private void ProjectileGhostController_Awake(orig_Awake orig, ProjectileGhostController self) { if (Object.op_Implicit((Object)(object)self)) { ((Component)self).gameObject.AddComponent<HunkProjectileTracker>(); } orig.Invoke(self); } private void HurtBox_OnEnable(orig_OnEnable orig, HurtBox self) { orig.Invoke(self); hurtboxesList.Add(self); } private void HurtBox_OnDisable(orig_OnDisable orig, HurtBox self) { orig.Invoke(self); hurtboxesList.Remove(self); } private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self) { orig.Invoke(self); if (!Object.op_Implicit((Object)(object)self)) { return; } if (self.HasBuff(Hunk.immobilizedBuff)) { self.moveSpeed = 0f; } if (!Object.op_Implicit((Object)(object)self.inventory)) { return; } int itemCount = self.inventory.GetItemCount(Hunk.gVirus); if (itemCount > 0) { self.armor += (float)(itemCount - 4) * 2.5f; self.attackSpeed += (float)itemCount * 0.05f; self.damage += (float)itemCount * 1.5f; for (int i = 0; i < itemCount; i++) { self.moveSpeed /= 1.1f; } } if (self.inventory.GetItemCount(Hunk.tVirus) > 0) { self.armor -= 10f; } int num = self.inventory.GetItemCount(Hunk.gVirusSample) + self.inventory.GetItemCount(Hunk.tVirusSample) + self.inventory.GetItemCount(Hunk.cVirusSample); if (num > 0) { self.regen += (float)num * 0.5f; self.armor += (float)num * 2f; } } 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 class HunkWeaponCatalog { public static Dictionary<string, HunkWeaponDef> weaponDrops = new Dictionary<string, HunkWeaponDef>(); public static HunkWeaponDef[] weaponDefs = new HunkWeaponDef[0]; public static List<ItemDef> itemDefs = new List<ItemDef>(0); public static void AddWeapon(HunkWeaponDef weaponDef, bool addItem = true) { Array.Resize(ref weaponDefs, weaponDefs.Length + 1); int num = weaponDefs.Length - 1; weaponDef.index = (ushort)num; weaponDefs[num] = weaponDef; weaponDef.index = (ushort)num; if (addItem) { itemDefs.Add(weaponDef.itemDef); } Debug.Log((object)("Added " + weaponDef.nameToken + " to Hunk weapon catalog with index: " + weaponDef.index)); } public static void AddWeaponDrop(string bodyName, HunkWeaponDef weaponDef, bool autoComplete = true) { if (autoComplete) { if (!bodyName.Contains("Body")) { bodyName += "Body"; } if (!bodyName.Contains("(Clone)")) { bodyName += "(Clone)"; } } weaponDrops.Add(bodyName, weaponDef); } public static HunkWeaponDef GetWeaponFromIndex(int index) { return weaponDefs[index]; } } } namespace HunkMod.SkillStates { public class FuckMyAss : GenericCharacterDeath { public override bool shouldAutoDestroy => false; public override void OnEnter() { ((GenericCharacterDeath)this).OnEnter(); EntityState.Destroy((Object)(object)((Component)((EntityState)this).modelLocator.modelTransform).gameObject); } 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 HunkMod.SkillStates.Virus { public class Death : GenericCharacterDeath { private bool hasDied; public override void FixedUpdate() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0063: 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) //IL_007e: Unknown result type (might be due to invalid IL or missing references) //IL_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008f: 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_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00fa: Unknown result type (might be due to invalid IL or missing references) //IL_0111: 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) if (((EntityState)this).isAuthority) { BlastAttack val = new BlastAttack(); val.radius = 8f; val.procCoefficient = 0.01f; val.position = ((EntityState)this).characterBody.corePosition; val.attacker = ((EntityState)this).gameObject; val.crit = false; val.baseDamage = ((BaseState)this).damageStat * 2f; val.falloffModel = (FalloffModel)2; val.baseForce = 4000f; val.bonusForce = Vector3.up * 600f; val.teamIndex = TeamComponent.GetObjectTeam(val.attacker); val.damageType = (DamageType)131072; val.attackerFiltering = (AttackerFiltering)2; val.Fire(); } Util.PlaySound("sfx_hunk_grenade_explosion", ((EntityState)this).gameObject); ((GenericCharacterDeath)this).FixedUpdate(); if (NetworkServer.active && !hasDied) { hasDied = true; EffectManager.SimpleImpactEffect(Assets.bloodExplosionEffect, ((EntityState)this).characterBody.corePosition, Vector3.up, true); EffectManager.SimpleImpactEffect(Assets.cVirusExplosion, ((EntityState)this).characterBody.corePosition, Vector3.up, true); ((GenericCharacterDeath)this).DestroyBodyAsapServer(); EntityState.Destroy((Object)(object)((EntityState)this).gameObject); } } public override void OnExit() { ((GenericCharacterDeath)this).DestroyModel(); ((GenericCharacterDeath)this).OnExit(); } } } namespace HunkMod.SkillStates.Parasite { public class Death : GenericCharacterDeath { private bool hasDied; public override void FixedUpdate() { //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_0066: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_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_0089: Unknown result type (might be due to invalid IL or missing references) ((GenericCharacterDeath)this).FixedUpdate(); if (((EntityState)this).fixedAge > Death.deathDelay && NetworkServer.active && !hasDied) { hasDied = true; if (Object.op_Implicit((Object)(object)((Component)((EntityState)this).characterBody.master).GetComponent<KeycardHolder>())) { PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(HunkMod.Modules.Survivors.Hunk.gVirusSample.itemIndex), ((EntityState)this).characterBody.corePosition + Vector3.up * 0.5f, Vector3.up * 20f); } EffectManager.SimpleImpactEffect(Death.deathEffectPrefab, ((EntityState)this).characterBody.corePosition, Vector3.up, true); ((GenericCharacterDeath)this).DestroyBodyAsapServer(); EntityState.Destroy((Object)(object)((EntityState)this).gameObject); } } public override void OnExit() { ((GenericCharacterDeath)this).DestroyModel(); ((GenericCharacterDeath)this).OnExit(); } } public class Infest : BaseState { private Transform targetTransform; private GameObject infestVfxInstance; private OverlapAttack attack; private List<HurtBox> victimsStruck = new List<HurtBox>(); public override void OnEnter() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Expected O, but got Unknown //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_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0172: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_017d: Expected O, but got Unknown //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01e5: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_024c: Unknown result type (might be due to invalid IL or missing references) //IL_0251: 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_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0270: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_0291: Unknown result type (might be due to invalid IL or missing references) //IL_02a1: Unknown result type (might be due to invalid IL or missing references) //IL_02b0: Unknown result type (might be due to invalid IL or missing references) //IL_02c8: 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_02f2: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); ((EntityState)this).PlayAnimation("Base", "Infest"); Util.PlaySound(Infest.enterSoundString, ((EntityState)this).gameObject); if (Object.op_Implicit((Object)(object)Infest.enterEffectPrefab)) { EffectManager.SimpleImpactEffect(Infest.enterEffectPrefab, ((EntityState)this).characterBody.corePosition, Vector3.up, false); } if (Object.op_Implicit((Object)(object)Infest.infestVfxPrefab)) { infestVfxInstance = Object.Instantiate<GameObject>(Infest.infestVfxPrefab, ((EntityState)this).transform.position, Quaternion.identity); infestVfxInstance.transform.parent = ((EntityState)this).transform; } HitBoxGroup hitBoxGroup = null; Transform modelTransform = ((EntityState)this).GetModelTransform(); if (Object.op_Implicit((Object)(object)modelTransform)) { hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Infest"); } attack = new OverlapAttack(); attack.attacker = ((EntityState)this).gameObject; attack.inflictor = ((EntityState)this).gameObject; attack.teamIndex = ((BaseState)this).GetTeam(); attack.damage = Infest.infestDamageCoefficient * base.damageStat; attack.hitEffectPrefab = null; attack.hitBoxGroup = hitBoxGroup; attack.isCrit = ((BaseState)this).RollCrit(); attack.damageType = (DamageType)32; attack.damageColorIndex = (DamageColorIndex)9; BullseyeSearch val = new BullseyeSearch(); val.viewer = ((EntityState)this).characterBody; val.teamMaskFilter = TeamMask.allButNeutral; ((TeamMask)(ref val.teamMaskFilter)).RemoveTeam(((EntityState)this).characterBody.teamComponent.teamIndex); val.sortMode = (SortMode)1; val.minDistanceFilter = 0f; val.maxDistanceFilter = Infest.searchMaxDistance; val.searchOrigin = ((EntityState)this).inputBank.aimOrigin; val.searchDirection = ((EntityState)this).inputBank.aimDirection; val.maxAngleFilter = Infest.searchMaxAngle; val.filterByLoS = true; val.RefreshCandidates(); HurtBox val2 = val.GetResults().FirstOrDefault(); if (Object.op_Implicit((Object)(object)val2)) { targetTransform = ((Component)val2).transform; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { Vector3 position = targetTransform.position; float velocityInitialSpeed = Infest.velocityInitialSpeed; Vector3 val3 = position - ((EntityState)this).transform.position; Vector2 val4 = default(Vector2); ((Vector2)(ref val4))..ctor(val3.x, val3.z); float magnitude = ((Vector2)(ref val4)).magnitude; float num = Trajectory.CalculateInitialYSpeed(magnitude / velocityInitialSpeed, val3.y); Vector3 val5 = default(Vector3); ((Vector3)(ref val5))..ctor(val4.x / magnitude * velocityInitialSpeed, num, val4.y / magnitude * velocityInitialSpeed); ((EntityState)this).characterMotor.velocity = val5; ((EntityState)this).characterMotor.disableAirControlUntilCollision = true; ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(); ((EntityState)this).characterDirection.forward = val5; } } } public override void FixedUpdate() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_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_0053: 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_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_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_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) ((EntityState)this).FixedUpdate(); if (Object.op_Implicit((Object)(object)targetTransform) && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { Vector3 val = targetTransform.position - ((EntityState)this).transform.position; Vector3 velocity = ((EntityState)this).characterMotor.velocity; velocity = Vector3.RotateTowards(velocity, val, Infest.velocityTurnRate * Time.fixedDeltaTime * (MathF.PI / 180f), 0f); ((EntityState)this).characterMotor.velocity = velocity; if (NetworkServer.active && attack.Fire(victimsStruck)) { for (int i = 0; i < victimsStruck.Count; i++) { HealthComponent healthComponent = victimsStruck[i].healthComponent; CharacterBody body = healthComponent.body; CharacterMaster master = body.master; if (healthComponent.alive && (Object)(object)master != (Object)null && !body.isPlayerControlled && !((Enum)body.bodyFlags).HasFlag((Enum)(object)(BodyFlags)2)) { ((Component)body).gameObject.AddComponent<VirusHandler>(); BaseAI component = ((Component)master).GetComponent<BaseAI>(); if (Object.op_Implicit((Object)(object)component)) { component.enemyAttention = 0f; component.ForceAcquireNearestEnemyIfNoCurrentEnemy(); } Object.DestroyImmediate((Object)(object)((Component)((EntityState)this).characterBody.master).GetComponent<KeycardHolder>()); ((EntityState)this).healthComponent.Suicide((GameObject)null, (GameObject)null, (DamageType)0); if (Object.op_Implicit((Object)(object)Infest.successfulInfestEffectPrefab)) { EffectManager.SimpleImpactEffect(Infest.successfulInfestEffectPrefab, ((EntityState)this).transform.position, Vector3.up, false); } break; } } } } if (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterDirection.moveVector = ((EntityState)this).characterMotor.velocity; } if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterMotor.isGrounded && ((EntityState)this).fixedAge > 0.1f) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)infestVfxInstance)) { EntityState.Destroy((Object)(object)infestVfxInstance); } ((EntityState)this).OnExit(); } } } namespace HunkMod.SkillStates.Hunk { public class AirDodge : BaseHunkSkillState { public Vector3 overrideVelocity = Vector3.zero; protected Vector3 slipVector = Vector3.zero; private float stopwatch; private float previousAirControl; public float checkRadius = 10f; private SphereSearch search; private List<HurtBox> hits; private bool success; protected virtual bool forcePerfect => false; public override void OnEnter() { //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0049: 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_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0056: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_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_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_0099: 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_00c5: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_02b4: Unknown result type (might be due to invalid IL or missing references) //IL_02d0: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: 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_02ef: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02fb: 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_030a: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_0322: Unknown result type (might be due to invalid IL or missing references) //IL_0327: Unknown result type (might be due to invalid IL or missing references) //IL_0341: Unknown result type (might be due to invalid IL or missing references) //IL_034c: Unknown result type (might be due to invalid IL or missing references) //IL_0352: Unknown result type (might be due to invalid IL or missing references) //IL_0357: Unknown result type (might be due to invalid IL or missing references) //IL_035a: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_036f: Unknown result type (might be due to invalid IL or missing references) //IL_0388: Unknown result type (might be due to invalid IL or missing references) //IL_038a: Unknown result type (might be due to invalid IL or missing references) //IL_038c: Unknown result type (might be due to invalid IL or missing references) //IL_0391: Unknown result type (might be due to invalid IL or missing references) //IL_0393: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_039a: Unknown result type (might be due to invalid IL or missing references) //IL_039f: Unknown result type (might be due to invalid IL or missing references) //IL_0143: Unknown result type (might be due to invalid IL or missing references) //IL_015f: Unknown result type (might be due to invalid IL or missing references) //IL_016f: 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_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0180: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_0199: Unknown result type (might be due to invalid IL or missing references) //IL_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_01b1: 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_01d0: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e1: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01e9: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_01fe: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0219: Unknown result type (might be due to invalid IL or missing references) //IL_021b: Unknown result type (might be due to invalid IL or missing references) //IL_0220: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) //IL_0227: Unknown result type (might be due to invalid IL or missing references) //IL_0229: Unknown result type (might be due to invalid IL or missing references) //IL_022e: Unknown result type (might be due to invalid IL or missing references) //IL_03a7: Unknown result type (might be due to invalid IL or missing references) //IL_03ac: Unknown result type (might be due to invalid IL or missing references) //IL_03c3: Unknown result type (might be due to invalid IL or missing references) //IL_03c8: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); ((EntityState)this).characterMotor.jumpCount = ((EntityState)this).characterBody.maxJumpCount; Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector); slipVector = ((Vector3)(ref val)).normalized; previousAirControl = ((EntityState)this).characterMotor.airControl; ((EntityState)this).characterMotor.airControl = BaseLeap.airControl; Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 direction = ((Ray)(ref aimRay)).direction; CharacterBody characterBody = ((EntityState)this).characterBody; characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1); Util.PlaySound("sfx_hunk_airdodge", ((EntityState)this).gameObject); hits = new List<HurtBox>(); search = new SphereSearch(); search.mask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask; search.radius = checkRadius; bool flag = SearchAttacker(); if (forcePerfect) { flag = true; } if (!flag) { ((EntityState)this).PlayCrossfade("FullBody, Override", "AirDodge", 0.05f); if (((EntityState)this).isAuthority) { ((EntityState)this).characterBody.isSprinting = true; direction.y = Mathf.Max(direction.y, 0.25f * BaseLeap.minimumY); Vector3 val2 = slipVector * (0.35f * BaseLeap.aimVelocity) * 12f; Vector3 val3 = Vector3.up * 0.75f * BaseLeap.upwardVelocity; Vector3 val4 = direction * (0.35f * BaseLeap.aimVelocity) * 12f; val4.x = 0f; val4.z = 0f; val = new Vector3(direction.x, 0f, direction.z); Vector3 val5 = ((Vector3)(ref val)).normalized * (1.1f * BaseLeap.forwardVelocity); ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(); ((EntityState)this).characterMotor.velocity = val2 + val4 + val3 + val5; } } else { ((EntityState)this).PlayCrossfade("FullBody, Override", "AirDodgePerfect", 0.05f); hunk.iFrames = 0.75f; success = true; hunk.lockOnTimer = 1.5f; hunk.TriggerDodge(); if (((EntityState)this).isAuthority) { Util.PlaySound("sfx_hunk_dodge_perfect", ((EntityState)this).gameObject); ((EntityState)this).characterBody.isSprinting = true; direction.y = Mathf.Max(direction.y, 1.05f * BaseLeap.minimumY); Vector3 val6 = slipVector * (0.5f * BaseLeap.aimVelocity) * 12f; Vector3 val7 = Vector3.up * 0.75f * BaseLeap.upwardVelocity; Vector3 val8 = direction * (0.75f * BaseLeap.aimVelocity) * 12f; val8.x = 0f; val8.z = 0f; val = new Vector3(direction.x, 0f, direction.z); Vector3 val9 = ((Vector3)(ref val)).normalized * (1.1f * BaseLeap.forwardVelocity); ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(); ((EntityState)this).characterMotor.velocity = val6 + val8 + val7 + val9; } } if (overrideVelocity != Vector3.zero) { ((EntityState)this).characterMotor.velocity = overrideVelocity; } } public bool SearchAttacker() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) //IL_01a6: Unknown result type (might be due to invalid IL or missing references) //IL_01b1: Unknown result type (might be due to invalid IL or missing references) //IL_0217: Unknown result type (might be due to invalid IL or missing references) //IL_0222: Unknown result type (might be due to invalid IL or missing references) hunk.targetHurtbox = null; hits.Clear(); search.ClearCandidates(); search.origin = ((EntityState)this).characterBody.corePosition; search.RefreshCandidates(); search.FilterCandidatesByDistinctHurtBoxEntities(); search.FilterCandidatesByHurtBoxTeam(TeamMask.GetUnprotectedTeams(((EntityState)this).teamComponent.teamIndex)); search.GetHurtBoxes(hits); foreach (HurtBox hit in hits) { HealthComponent healthComponent = hit.healthComponent; if (Object.op_Implicit((Object)(object)healthComponent) && healthComponent.body.outOfCombatStopwatch <= 1f) { return true; } } Collider[] array = Physics.OverlapSphere(((EntityState)this).characterBody.corePosition, checkRadius * 0.5f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.projectile)).mask)); for (int i = 0; i < array.Length; i++) { ProjectileController componentInParent = ((Component)array[i]).GetComponentInParent<ProjectileController>(); if (Object.op_Implicit((Object)(object)componentInParent) && componentInParent.teamFilter.teamIndex != ((EntityState)this).characterBody.teamComponent.teamIndex) { return true; } } foreach (HunkProjectileTracker projectile in MainPlugin.projectileList) { if (Object.op_Implicit((Object)(object)projectile) && Vector3.Distance(((Component)projectile).transform.position, ((EntityState)this).transform.position) <= checkRadius) { return true; } } foreach (GolemLaser golemLaser in HunkMod.Modules.Survivors.Hunk.golemLasers) { if (Object.op_Implicit((Object)(object)golemLaser) && Vector3.Distance(golemLaser.endPoint, ((EntityState)this).transform.position) <= checkRadius * 0.5f) { return true; } } return false; } public override void OnExit() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) base.OnExit(); CharacterBody characterBody = ((EntityState)this).characterBody; characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags & -2); ((EntityState)this).characterMotor.airControl = previousAirControl; } public override void FixedUpdate() { base.FixedUpdate(); ((EntityState)this).characterBody.aimTimer = -1f; hunk.reloadTimer = 1f; stopwatch += Time.fixedDeltaTime; EntityStateMachine.FindByCustomName(((EntityState)this).gameObject, "Aim").SetNextStateToMain(); ((EntityState)this).skillLocator.primary.stock = 0; ((EntityState)this).skillLocator.primary.rechargeStopwatch = -0.3f; ((EntityState)this).skillLocator.secondary.stock = 0; ((EntityState)this).skillLocator.secondary.rechargeStopwatch = -0.3f; if (stopwatch >= 0.1f && ((EntityState)this).isAuthority && ((EntityState)this).characterMotor.isGrounded) { SetNextState(); } if (stopwatch >= 0.1f && ((EntityState)this).isAuthority && success && ((EntityState)this).inputBank.skill1.down) { AttemptCling(); } } private void AttemptCling() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0127: 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_017a: 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_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01a4: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: 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_01b2: Expected O, but got Unknown //IL_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01d9: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_0203: Unknown result type (might be due to invalid IL or missing references) //IL_020e: 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_021f: Unknown result type (might be due to invalid IL or missing references) //IL_0224: Unknown result type (might be due to invalid IL or missing references) //IL_0228: Unknown result type (might be due to invalid IL or missing references) //IL_022d: Unknown result type (might be due to invalid IL or missing references) //IL_023e: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02ba: Unknown result type (might be due to invalid IL or missing references) //IL_025b: Unknown result type (might be due to invalid IL or missing references) //IL_0262: Unknown result type (might be due to invalid IL or missing references) //IL_0267: Unknown result type (might be due to invalid IL or missing references) //IL_026c: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) BullseyeSearch2 bullseyeSearch = new BullseyeSearch2 { teamMaskFilter = TeamMask.GetEnemyTeams(((BaseState)this).GetTeam()), filterByLoS = false, searchOrigin = ((EntityState)this).transform.position, searchDirection = Random.onUnitSphere, sortMode = BullseyeSearch2.SortMode.Distance, onlyBullseyes = false, maxDistanceFilter = 3f, maxAngleFilter = 360f }; bullseyeSearch.RefreshCandidates(); bullseyeSearch.FilterOutGameObject(((EntityState)this).gameObject); List<HurtBox> list = bullseyeSearch.GetResults().ToList(); RaycastHit val6 = default(RaycastHit); foreach (HurtBox item in list) { if (!Object.op_Implicit((Object)(object)item) || !Object.op_Implicit((Object)(object)item.healthComponent) || !Object.op_Implicit((Object)(object)item.healthComponent.body)) { continue; } ((EntityState)this).PlayCrossfade("FullBody, Override", "Cling", 0.1f); Util.PlaySound("sfx_ravager_grab", ((EntityState)this).gameObject); HurtBox val = item; float num = float.PositiveInfinity; HurtBox[] componentsInChildren = ((Component)item.healthComponent).gameObject.GetComponentsInChildren<HurtBox>(); foreach (HurtBox val2 in componentsInChildren) { float num2 = Vector3.Distance(((EntityState)this).transform.position, ((Component)val2).transform.position); if (num2 < num) { num = num2; val = val2; } } if (((EntityState)this).isAuthority) { Vector3 val3 = ((EntityState)this).transform.position - ((Component)val).transform.position; Vector3 val4 = ((Vector3)(ref val3)).normalized * hunk.snapOffset; GameObject val5 = new GameObject(); val5.transform.parent = ((Component)val).transform; val5.transform.position = ((Component)val).transform.position + val4; ((Component)((EntityState)this).characterBody.mainHurtBox).gameObject.SetActive(false); Vector3 position = ((EntityState)this).transform.position; val3 = ((EntityState)this).transform.position - ((Component)val).transform.position; if (Physics.Raycast(position, -((Vector3)(ref val3)).normalized, ref val6, 20f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask))) { val4 = ((Component)val).transform.position - ((RaycastHit)(ref val6)).point; val5.transform.position = ((RaycastHit)(ref val6)).point; } ((Component)((EntityState)this).characterBody.mainHurtBox).gameObject.SetActive(true); EntityStateMachine.FindByCustomName(((EntityState)this).gameObject, "Body").SetNextState((EntityState)(object)new HunkMod.SkillStates.Hunk.Cling.Cling { targetHurtbox = val, offset = val4, anchor = val5 }); ((EntityState)this).outer.SetNextStateToMain(); } break; } } protected virtual void SetNextState() { if (success) { ((EntityState)this).outer.SetNextState((EntityState)(object)new PerfectLanding()); } else { ((EntityState)this).outer.SetNextState((EntityState)(object)new SlowRoll()); } } 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 BaseHunkSkillState : BaseSkillState { private Animator _animator; private bool knifeWasActive; protected HunkController hunk; protected HunkWeaponDef cachedWeaponDef; protected virtual bool turningAllowed => true; protected virtual bool normalizeModel => false; protected virtual bool hideGun => false; protected virtual string prop { get; set; } public virtual void AddRecoil2(float x1, float x2, float y1, float y2) { if (Config.enableRecoil.Value) { ((BaseState)this).AddRecoil(x1, x2, y1, y2); } } public virtual Ray GetAimRay2() { //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 ((BaseState)this).GetAimRay(); } public override void OnEnter() { hunk = ((EntityState)this).GetComponent<HunkController>(); if (Object.op_Implicit((Object)(object)hunk)) { cachedWeaponDef = hunk.weaponDef; } _animator = ((EntityState)this).GetModelAnimator(); ((BaseState)this).OnEnter(); if (!turningAllowed) { ((EntityState)this).characterDirection.turnSpeed = 0f; } if (hideGun) { ((Component)((EntityState)this).GetModelChildLocator().FindChild("Weapon")).gameObject.SetActive(false); knifeWasActive = ((Component)((BaseState)this).FindModelChild("KnifeModel")).gameObject.activeSelf; ((Component)((BaseState)this).FindModelChild("KnifeModel")).gameObject.SetActive(false); } if (!string.IsNullOrEmpty(prop)) { ((Component)((EntityState)this).GetModelChildLocator().FindChild(prop)).gameObject.SetActive(true); } if (normalizeModel) { ((EntityState)this).modelLocator.normalizeToFloor = true; } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (Object.op_Implicit((Object)(object)_animator)) { _animator.SetBool("isAiming", hunk.isAiming); if (hunk.isAiming) { _animator.SetFloat("aimBlend", 1f); } else { _animator.SetFloat("aimBlend", 0f); } } } public override void OnExit() { ((EntityState)this).OnExit(); if (!turningAllowed) { ((EntityState)this).characterDirection.turnSpeed = hunk.baseTurnSpeed; } if (hideGun) { ((Component)((EntityState)this).GetModelChildLocator().FindChild("Weapon")).gameObject.SetActive(true); ((Component)((BaseState)this).FindModelChild("KnifeModel")).gameObject.SetActive(knifeWasActive); } if (!string.IsNullOrEmpty(prop)) { ((Component)((EntityState)this).GetModelChildLocator().FindChild(prop)).gameObject.SetActive(false); } if (normalizeModel) { ((EntityState)this).modelLocator.normalizeToFloor = false; } } } public class KnifeCounter : BaseMeleeAttack { private GameObject swingEffectInstance; private GameObject knifeInstance; private bool knifeHidden; public override void OnEnter() { //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0181: 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) hunk = ((EntityState)this).GetComponent<HunkController>(); SkillDef knifeSkin = hunk.knifeSkin; if (Object.op_Implicit((Object)(object)knifeSkin)) { if (HunkMod.Modules.Survivors.Hunk.knifeSkins.ContainsKey(knifeSkin)) { prop = ""; knifeInstance = CreateKnife(HunkMod.Modules.Survivors.Hunk.knifeSkins[knifeSkin]); } else { prop = "HiddenKnifeModel"; } } hitboxName = "Knife"; damageCoefficient = 8f; pushForce = 200f; baseDuration = 1.25f; baseEarlyExitTime = 0.55f; attackRecoil = 5f / ((BaseState)this).attackSpeedStat; attackStartTime = 0.165f; attackEndTime = 0.25f; hitStopDuration = 0.24f; smoothHitstop = true; swingSoundString = "sfx_hunk_swing_knife"; swingEffectPrefab = Assets.knifeSwingEffect; hitSoundString = ""; hitEffectPrefab = Assets.knifeImpactEffect; impactSound = Assets.knifeImpactSoundDef.index; damageType = (DamageType)544; muzzleString = "KnifeSwingMuzzle"; base.OnEnter(); if (Object.op_Implicit((Object)(object)hunk.variant)) { Util.PlaySound("sfx_hunk_kick_foley", ((EntityState)this).gameObject); hitStopDuration *= 1.25f; swingSoundString = "sfx_jacket_swing_bat"; attack.impactSound = Assets.batImpactSoundDef.index; attack.hitEffectPrefab = Assets.batImpactEffect; swingEffectPrefab = Assets.batSwingEffect; } else { Util.PlaySound("sfx_hunk_foley_knife", ((EntityState)this).gameObject); } EntityStateMachine.FindByCustomName(((EntityState)this).gameObject, "Aim").SetNextStateToMain(); ((EntityState)this).skillLocator.secondary.stock = 0; ((EntityState)this).skillLocator.secondary.rechargeStopwatch = 0f; hunk.lockOnTimer = -1f; } public override void FixedUpdate() { base.FixedUpdate(); if (hunk.isAiming && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } else if (!knifeHidden && stopwatch >= 0.85f * duration) { knifeHidden = true; if (prop != "") { ((Component)((BaseState)this).FindModelChild(prop)).gameObject.SetActive(false); } if (Object.op_Implicit((Object)(object)knifeInstance)) { EntityState.Destroy((Object)(object)knifeInstance); } } } public override void OnExit() { if (!knifeHidden) { knifeHidden = true; if (prop != "") { ((Component)((BaseState)this).FindModelChild(prop)).gameObject.SetActive(false); } if (Object.op_Implicit((Object)(object)knifeInstance)) { EntityState.Destroy((Object)(object)knifeInstance); } } base.OnExit(); } protected override void FireAttack() { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).isAuthority) { Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 direction = ((Ray)(ref aimRay)).direction; direction.y = Mathf.Max(direction.y, direction.y * 0.5f); ((BaseState)this).FindModelChild("MeleePivot").rotation = Util.QuaternionSafeLookRotation(direction); } base.FireAttack(); } protected override void PlaySwingEffect() { //IL_000d: 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_001c: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).characterMotor.velocity = ((EntityState)this).characterDirection.forward * -25f; Util.PlaySound(swingSoundString, ((EntityState)this).gameObject); if (!Object.op_Implicit((Object)(object)swingEffectPrefab)) { return; } Transform val = ((BaseState)this).FindModelChild(muzzleString); if (Object.op_Implicit((Object)(object)val)) { swingEffectInstance = Object.Instantiate<GameObject>(swingEffectPrefab, val); if (swingIndex == 1) { Transform transform = swingEffectInstance.transform; transform.localScale *= 0.75f; } ScaleParticleSystemDuration component = swingEffectInstance.GetComponent<ScaleParticleSystemDuration>(); if (Object.op_Implicit((Object)(object)component)) { component.newDuration = component.initialDuration; } } } protected override void TriggerHitStop() { base.TriggerHitStop(); hunk.TriggerCounter(); if (Object.op_Implicit((Object)(object)swingEffectInstance)) { ScaleParticleSystemDuration component = swingEffectInstance.GetComponent<ScaleParticleSystemDuration>(); if (Object.op_Implicit((Object)(object)component)) { component.newDuration = 20f; } } } private GameObject CreateKnife(GameObject modelPrefab) { //IL_003d: 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_005f: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)hunk.variant)) { return null; } GameObject val = Object.Instantiate<GameObject>(modelPrefab); val.transform.parent = ((BaseState)this).FindModelChild("KnifeBase"); val.transform.localPosition = Vector3.zero; val.transform.localRotation = Quaternion.identity; val.transform.localScale = Vector3.one; return val; } protected override void ClearHitStop() { base.ClearHitStop(); if (Object.op_Implicit((Object)(object)swingEffectInstance)) { ScaleParticleSystemDuration component = swingEffectInstance.GetComponent<ScaleParticleSystemDuration>(); if (Object.op_Implicit((Object)(object)component)) { component.newDuration = component.initialDuration; } } } protected override void PlayAttackAnimation() { ((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty"); ((EntityState)this).PlayCrossfade("FullBody, Override", "KnifeCounter", "Knife.playbackRate", duration, 0.1f); } protected override void SetNextState() { } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0021: 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_0024: Unknown result type (might be due to invalid IL or missing references) if (stopwatch >= 0.5f * duration) { return (InterruptPriority)0; } return (InterruptPriority)4; } } public class MainState : GenericCharacterMain { private HunkController hunk; private Animator animator; public LocalUser localUser; public override void OnEnter() { ((GenericCharacterMain)this).OnEnter(); animator = ((BaseCharacterMain)this).modelAnimator; hunk = ((EntityState)this).GetComponent<HunkController>(); FindLocalUser(); CheckForSuperSkin(); } private void CheckForSuperSkin() { //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Invalid comparison between Unknown and I4 //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_0193: Unknown result type (might be due to invalid IL or missing references) //IL_0198: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01b3: Unknown result type (might be due to invalid IL or missing references) //IL_01b8: Unknown result type (might be due to invalid IL or missing references) //IL_01c2: Unknown result type (might be due to invalid IL or missing references) CharacterModel component = ((Component)((EntityState)this).GetModelTransform()).GetComponent<CharacterModel>(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)((Component)component).GetComponent<ModelSkinController>())) { return; } ModelSkinController component2 = ((Component)component).GetComponent<ModelSkinController>(); if (component2.skins[component2.currentSkinIndex].nameToken.Contains("SUPER")) { ((Component)((BaseState)this).FindModelChild("EyeTrailL")).gameObject.SetActive(true); ((Component)((BaseState)this).FindModelChild("EyeTrailR")).gameObject.SetActive(true); if ((int)((EntityState)this).teamComponent.teamIndex != 1) { return; } ((Renderer)((Component)((BaseState)this).FindModelChild("EyeTrailR")).gameObject.GetComponent<TrailRenderer>()).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/Railgunner/matRailgunBeam.mat").WaitForCompletion(); ((Renderer)((Component)((BaseState)this).FindModelChild("EyeTrailL")).gameObject.GetComponent<TrailRenderer>()).material = Addressables.LoadAssetAsync<Material>((object)"RoR2/DLC1/Railgunner/matRailgunBeam.mat").WaitForCompletion(); if ((!Object.op_Implicit((Object)(object)hunk) || !Object.op_Implicit((Object)(object)hunk.weaponTracker) || !Helpers.HunkHasWeapon(BaseWeapon<ATM>.instance.weaponDef, hunk.weaponTracker)) && !hunk.spawnedATM && ((EntityState)this).characterBody.isPlayerControlled) { hunk.spawnedATM = true; if (NetworkServer.active) { PickupDropletController.CreatePickupDroplet(PickupCatalog.FindPickupIndex(BaseWeapon<ATM>.instance.itemDef.itemIndex), ((EntityState)this).characterBody.corePosition, -((EntityState)this).characterBody.inputBank.aimDirection * 20f); } } } else if (component2.skins[component2.currentSkinIndex].nameToken.Contains("TOFU")) { ((EntityState)this).characterBody.portraitIcon = Assets.LoadCharacterIcon("Tofu"); } else if (component2.skins[component2.currentSkinIndex].nameToken.Contains("WESKER") && Config.loreAccurateWeskah.Value && MainPlugin.scepterInstalled) { TryGiveScepter(); } } private void TryGiveScepter() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory) && ((EntityState)this).characterBody.inventory.GetItemCount(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("AncientScepter"))) <= 0 && NetworkServer.active) { ((EntityState)this).characterBody.inventory.GiveItem(ItemCatalog.GetItemDef(ItemCatalog.FindItemIndex("AncientScepter")), 1); } } public override void FixedUpdate() { //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Unknown result type (might be due to invalid IL or missing references) ((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); } animator.SetBool("isAiming", hunk.isAiming); if (hunk.isAiming) { animator.SetFloat("aimBlend", 1f); } else { animator.SetFloat("aimBlend", 0f); } } if (Object.op_Implicit((Object)(object)hunk) && Object.op_Implicit((Object)(object)hunk.weaponDef) && (Object)(object)hunk.weaponDef == (Object)(object)BaseWeapon<Railgun>.instance.weaponDef) { ((EntityState)this).characterBody.isSprinting = false; CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.moveDirection *= 0.5f; } 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 bool CanExecuteSkill(GenericSkill skillSlot) { if (Object.op_Implicit((Object)(object)hunk) && Object.op_Implicit((Object)(object)hunk.weaponDef) && (Object)(object)hunk.weaponDef == (Object)(object)BaseWeapon<Railgun>.instance.weaponDef) { if ((Object)(object)skillSlot.skillFamily == (Object)(object)((EntityState)this).skillLocator.primary.skillFamily && !hunk.isAiming) { return false; } if ((Object)(object)skillSlot.skillFamily == (Object)(object)((EntityState)this).skillLocator.utility.skillFamily) { return false; } } return ((GenericCharacterMain)this).CanExecuteSkill(skillSlot); } public override void ProcessJump() { //IL_0272: Unknown result type (might be due to invalid IL or missing references) //IL_0277: Unknown result type (might be due to invalid IL or missing references) //IL_027e: Unknown result type (might be due to invalid IL or missing references) //IL_028f: Expected O, but got Unknown //IL_02b2: Unknown result type (might be due to invalid IL or missing references) //IL_02b7: Unknown result type (might be due to invalid IL or missing references) //IL_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_02e0: Expected O, but got Unknown //IL_02f5: Unknown result type (might be due to invalid IL or missing references) //IL_02fa: Unknown result type (might be due to invalid IL or missing references) //IL_0301: Unknown result type (might be due to invalid IL or missing references) //IL_030c: Unknown result type (might be due to invalid IL or missing references) //IL_0313: Unknown result type (might be due to invalid IL or missing references) //IL_0318: Unknown result type (might be due to invalid IL or missing references) //IL_031d: Unknown result type (might be due to invalid IL or missing references) //IL_0328: Expected O, but got Unknown //IL_0358: Unknown result type (might be due to invalid IL or missing references) //IL_036a: Unknown result type (might be due to invalid IL or missing references) //IL_0398: Unknown result type (might be due to invalid IL or missing references) //IL_039d: Unknown result type (might be due to invalid IL or missing references) if ((Object.op_Implicit((Object)(object)hunk) && Object.op_Implicit((Object)(object)hunk.weaponDef) && (Object)(object)hunk.weaponDef == (Object)(object)BaseWeapon<Railgun>.instance.weaponDef) || !((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; } } Util.PlaySound("sfx_hunk_jump", ((EntityState)this).gameObject); 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 PerfectLanding : BaseHunkSkillState { protected Vector3 slipVector = Vector3.zero; public float duration = 0.8f; private bool peepee; private float coeff = 12f; private bool skidibi; protected override bool normalizeModel => true; public override void OnEnter() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); hunk.isRolling = true; Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector); slipVector = ((Vector3)(ref val)).normalized; ((EntityState)this).PlayCrossfade("FullBody, Override", "PerfectLanding", 0.05f); Util.PlaySound("sfx_hunk_step_foley", ((EntityState)this).gameObject); EntityStateMachine.FindByCustomName(((EntityState)this).gameObject, "Aim").SetNextStateToMain(); ((EntityState)this).skillLocator.secondary.stock = 0; ((EntityState)this).skillLocator.secondary.rechargeStopwatch = 0f; ((EntityState)this).skillLocator.utility.AddOneStock(); ((EntityState)this).skillLocator.utility.stock = ((EntityState)this).skillLocator.utility.maxStock; ((EntityState)this).skillLocator.primary.SetSkillOverride((object)this, HunkMod.Modules.Survivors.Hunk.counterSkillDef, (SkillOverridePriority)4); hunk.desiredYOffset = 0.6f; hunk.immobilized = true; hunk.iFrames = 0.25f; ApplyBuff(); CreateDashEffect(); } public virtual void ApplyBuff() { } public virtual void CreateDashEffect() { } public override void FixedUpdate() { //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01e7: Unknown result type (might be due to invalid IL or missing references) //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) if (peepee && ((EntityState)this).isAuthority) { ((EntityState)this).characterMotor.jumpCount = 0; if (((ButtonState)(ref ((EntityState)this).inputBank.jump)).justPressed) { ((EntityState)this).PlayCrossfade("FullBody, Override", "BufferEmpty", 0.05f); ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(); ((EntityState)this).outer.SetNextStateToMain(); return; } } else { ((EntityState)this).characterMotor.jumpCount = ((EntityState)this).characterBody.maxJumpCount; } base.FixedUpdate(); ((EntityState)this).characterBody.aimTimer = -1f; hunk.reloadTimer = 1f; ((EntityState)this).characterMotor.velocity = Vector3.zero; ((EntityState)this).characterMotor.rootMotion = slipVector * (coeff * 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 = slipVector; } if (!peepee && ((EntityState)this).fixedAge >= 0.4f * duration) { peepee = true; coeff = 4f; } if (!skidibi && ((EntityState)this).fixedAge >= 0.85f * duration) { skidibi = true; hunk.desiredYOffset = hunk.defaultYOffset; } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 0.65f * duration && ((EntityState)this).inputBank.moveVector != Vector3.zero) { ((EntityState)this).outer.SetNextStateToMain(); ((EntityState)this).GetModelAnimator().SetTrigger("forceCancel"); return; } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } ((EntityState)this).inputBank.moveVector = Vector3.zero; } 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.75f; } public override void OnExit() { //IL_006f: 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) DampenVelocity(); hunk.isRolling = false; ((EntityState)this).characterMotor.jumpCount = 0; hunk.desiredYOffset = hunk.defaultYOffset; hunk.immobilized = false; ((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)this, HunkMod.Modules.Survivors.Hunk.counterSkillDef, (SkillOverridePriority)4); base.OnExit(); if (((EntityState)this).isAuthority && ((EntityState)this).inputBank.moveVector != Vector3.zero) { ((EntityState)this).characterBody.isSprinting = true; } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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) if (peepee) { return (InterruptPriority)0; } return (InterruptPriority)4; } } public class Reload : BaseHunkSkillState { public float baseDuration = 2.4f; public string animString = "Reload"; public InterruptPriority interruptPriority = (InterruptPriority)1; private float duration; private bool success; private bool cummed = false; public override void OnEnter() { //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); duration = cachedWeaponDef.reloadDuration / ((BaseState)this).attackSpeedStat; hunk.isReloading = true; bool flag = cachedWeaponDef.roundReload; if ((Object)(object)hunk.weaponDef == (Object)(object)BaseWeapon<Revolver>.instance.weaponDef && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory) && ((EntityState)this).characterBody.inventory.GetItemCount(Revolver.speedloader) > 0 && hunk.ammo <= 0) { flag = false; } if (hunk.weaponTracker.weaponData[hunk.weaponTracker.equippedIndex].totalAmmo <= 0) { duration = 0.3f; success = false; Util.PlaySound("sfx_hunk_gun_click", ((EntityState)this).gameObject); return; } if (flag) { if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextState((EntityState)(object)new RoundReload { baseDuration = baseDuration, interruptPriority = interruptPriority }); } return; } if ((Object)(object)hunk.weaponDef == (Object)(object)BaseWeapon<Revolver>.instance.weaponDef) { duration = BaseWeapon<MUP>.instance.weaponDef.reloadDuration / ((BaseState)this).attackSpeedStat; } if (hunk.weaponDef.animationSet == HunkWeaponDef.AnimationSet.Pistol || hunk.weaponDef.animationSet == HunkWeaponDef.AnimationSet.PistolAlt) { animString = "ReloadPistol"; ((EntityState)this).PlayCrossfade("Gesture, Override", animString, "Reload.playbackRate", duration, 0.1f); success = true; Util.PlaySound("sfx_hunk_pistol_reload_01", ((EntityState)this).gameObject); return; } if (hunk.weaponDef.nameToken.Contains("GRENADE")) { animString = "ReloadSingle"; } ((EntityState)this).PlayCrossfade("Gesture, Override", animString, "Reload.playbackRate", duration, 0.1f); success = true; Util.PlaySound("sfx_hunk_smg_reload_01", ((EntityState)this).gameObject); } public override void OnExit() { base.OnExit(); hunk.isReloading = false; } public override void FixedUpdate() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) base.FixedUpdate(); hunk.reloadTimer = 2f; hunk.ammoKillTimer = 3f; if (((EntityState)this).isAuthority && ((EntityState)this).inputBank.skill2.down && (int)interruptPriority == 0 && hunk.ammo > 0) { ((EntityState)this).outer.SetNextStateToMain(); return; } if (((EntityState)this).fixedAge >= 0.84f * duration && !cummed) { cummed = true; if (success) { hunk.FinishReload(); } } if (((EntityState)this).isAuthority && ((EntityState)this).inputBank.skill3.down && ((EntityState)this).skillLocator.utility.stock > 0) { ((EntityState)this).outer.SetNextStateToMain(); } else if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_001a: 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_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).fixedAge <= 0.1f) { return (InterruptPriority)4; } return interruptPriority; } } public class Roll : BaseHunkSkillState { protected Vector3 slipVector = Vector3.zero; public float duration = 1.1f; private bool peepee; private float coeff = 24f; private bool skidibi; private bool slowing; private float currentTimeScale = 1f; protected override bool turningAllowed => false; protected override bool normalizeModel => true; public override void OnEnter() { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_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_0081: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); if (Config.enableRollSnap.Value) { hunk.lockOnTimer = 0.55f; } hunk.speedLineTimer = 0.25f; hunk.TriggerDodge(); hunk.isRolling = true; Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector); slipVector = ((Vector3)(ref val)).normalized; ((EntityState)this).gameObject.layer = LayerIndex.fakeActor.intVal; ((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers(); ((EntityState)this).PlayCrossfade("FullBody, Override", "DodgeRoll", "Dodge.playbackRate", duration * 1.4f, 0.05f); Util.PlaySound("sfx_hunk_roll2", ((EntityState)this).gameObject); if (((EntityState)this).isAuthority) { Util.PlaySound("sfx_hunk_dodge_perfect", ((EntityState)this).gameObject); } EntityStateMachine.FindByCustomName(((EntityState)this).gameObject, "Aim").SetNextStateToMain(); ((EntityState)this).skillLocator.secondary.stock = 0; ((EntityState)this).skillLocator.secondary.rechargeStopwatch = 0f; ((EntityState)this).skillLocator.utility.AddOneStock(); ((EntityState)this).skillLocator.utility.stock = ((EntityState)this).skillLocator.utility.maxStock; ((EntityState)this).skillLocator.primary.SetSkillOverride((object)this, HunkMod.Modules.Survivors.Hunk.counterSkillDef, (SkillOverridePriority)4); hunk.desiredYOffset = 0.6f; hunk.immobilized = true; hunk.iFrames = 0.75f; ApplyBuff(); CreateDashEffect(); CreateTargetedEffect(); } private void CreateTargetedEffect() { if (Object.op_Implicit((Object)(object)hunk.targetHurtbox) && ((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)hunk.targetHurtbox.healthComponent) && Object.op_Implicit((Object)(object)hunk.targetHurtbox.healthComponent.modelLocator) && Object.op_Implicit((Object)(object)hunk.targetHurtbox.healthComponent.modelLocator.modelTransform)) { Transform modelTransform = hunk.targetHurtbox.healthComponent.modelLocator.modelTransform; TemporaryOverlay val = ((Component)modelTransform).gameObject.AddComponent<TemporaryOverlay>(); val.duration = 1f; val.destroyComponentOnEnd = true; val.originalMaterial = Assets.targetOverlayMat; val.inspectorCharacterModel = ((Component)modelTransform).GetComponent<CharacterModel>(); val.alphaCurve = AnimationCurve.EaseInOut(0f, 2f, 1f, 0f); val.animateShaderAlpha = true; } } public virtual void ApplyBuff() { } public virtual void CreateDashEffect() { } public override void FixedUpdate() { //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0123: 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_026a: Unknown result type (might be due to invalid IL or missing references) //IL_02e9: Unknown result type (might be due to invalid IL or missing references) //IL_02ee: Unknown result type (might be due to invalid IL or missing references) if (peepee && ((EntityState)this).isAuthority) { ((EntityState)this).characterMotor.jumpCount = 0; if (((ButtonState)(ref ((EntityState)this).inputBank.jump)).justPressed) { ((EntityState)this).PlayCrossfade("FullBody, Override", "BufferEmpty", 0.05f); ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(); ((EntityState)this).outer.SetNextStateToMain(); return; } } else { ((EntityState)this).characterMotor.jumpCount = ((EntityState)this).characterBody.maxJumpCount; } base.FixedUpdate(); ((EntityState)this).characterBody.aimTimer = -1f; hunk.reloadTimer = 1f; ((EntityState)this).characterMotor.velocity = Vector3.zero; ((EntityState)this).characterMotor.rootMotion = slipVector * (coeff * 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 = slipVector; } if (!peepee && ((EntityState)this).fixedAge >= 0.4f * duration) { peepee = true; coeff = 4f; ((EntityState)this).gameObject.layer = LayerIndex.defaultLayer.intVal; ((BaseCharacterController)((EntityState)this).characterMotor).Motor.RebuildCollidableLayers(); } if (!skidibi && ((EntityState)this).fixedAge >= 0.85f * duration) { skidibi = true; hunk.desiredYOffset = hunk.defaultYOffset; } if (slowing) { currentTimeScale += Time.unscaledDeltaTime * 1.1f; if (currentTimeScale >= 1f) { slowing = false; currentTimeScale = 1f; } Time.timeScale = currentTimeScale; } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 0.6f * duration && ((EntityState)this).inputBank.moveVector != Vector3.zero && !((EntityState)this).inputBank.skill2.down) { ((EntityState)this).outer.SetNextStateToMain(); ((EntityState)this).GetModelAnimator().SetTrigger("forceCancel"); return; } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } ((EntityState)this).inputBank.moveVector = Vector3.zero; } 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.75f; } public override void OnExit() { //IL_006f: 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) hunk.immobilized = false; DampenVelocity(); hunk.isRolling = false; ((EntityState)this).characterMotor.jumpCount = 0; hunk.desiredYOffset = hunk.defaultYOffset; ((EntityState)this).skillLocator.primary.UnsetSkillOverride((object)this, HunkMod.Modules.Survivors.Hunk.counterSkillDef, (SkillOverridePriority)4); base.OnExit(); if (((EntityState)this).isAuthority && ((EntityState)this).inputBank.moveVector != Vector3.zero) { ((EntityState)this).characterBody.isSprinting = true; } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_000c: 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) if (peepee) { return (InterruptPriority)0; } return (InterruptPriority)4; } } public class RoundReload : BaseHunkSkillState { private enum SubState { Startup, Loading, End } public float baseDuration = 2.4f; public InterruptPriority interruptPriority = (InterruptPriority)1; private float duration; private float stopwatch; private SubState subState; public override void OnEnter() { base.OnEnter(); duration = cachedWeaponDef.reloadDuration / ((BaseState)this).attackSpeedStat; hunk