Decompiled source of Belmont v1.0.1
plugins/rob_gaming-Belmont/BelmontMod.dll
Decompiled 2 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BelmontMod.Content; using BelmontMod.Content.Components; using BelmontMod.Content.Enemies; using BelmontMod.Content.Misc; using BelmontMod.Content.Objective; using BelmontMod.Content.Survivors; using BelmontMod.Modules; using BelmontMod.Modules.Achievements; using BelmontMod.SkillStates; using BelmontMod.SkillStates.BaseStates; using BelmontMod.SkillStates.Belmont; using BelmontMod.SkillStates.Belmont.Melee; using BelmontMod.SkillStates.Belmont.Subweapon; using BelmontMod.SkillStates.Belmont.Whip; using BelmontMod.SkillStates.Emote; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.Commando; using EntityStates.Croco; using EntityStates.Huntress; using HG; using HG.BlendableTypes; using HunkMod.Modules; using JetBrains.Annotations; using KinematicCharacterController; using On.RoR2; using On.RoR2.UI; using On.RoR2.UI.MainMenu; using R2API; using R2API.Networking; using R2API.Networking.Interfaces; using R2API.Utils; using Rewired.ComponentControls.Effects; using RiskOfOptions; using RiskOfOptions.OptionConfigs; using RiskOfOptions.Options; using RoR2; using RoR2.Achievements; using RoR2.Audio; using RoR2.CameraModes; using RoR2.ContentManagement; using RoR2.Navigation; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using RoR2.UI.MainMenu; using ThreeEyedGames; using Unity.Jobs; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.Rendering.PostProcessing; using UnityEngine.SceneManagement; [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.1", FrameworkDisplayName = "")] [assembly: AssemblyCompany("BelmontMod")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("BelmontMod")] [assembly: AssemblyTitle("BelmontMod")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: UnverifiableCode] public class RocketRotation : MonoBehaviour { private Rigidbody rb; private void Awake() { rb = ((Component)this).GetComponent<Rigidbody>(); } private void FixedUpdate() { //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) Transform transform = ((Component)this).transform; Vector3 velocity = rb.velocity; transform.rotation = Util.QuaternionSafeLookRotation(((Vector3)(ref velocity)).normalized); } } 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); } } 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 BelmontCameraParams { DEFAULT, AIM, EMOTE } internal class BodyInfo { internal string bodyName = ""; internal string bodyNameToken = ""; internal string subtitleNameToken = ""; internal Color bodyColor = Color.white; public Vector3 modelBasePosition = new Vector3(0f, -0.9f, 0f); public Vector3 aimOrigin = new Vector3(0f, 1.4f, 0f); public Vector3 cameraPivot = new Vector3(0f, 1.59f, 0f); 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 icon; 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; icon = 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; icon = 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 BelmontMod { [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInPlugin("com.rob.Belmont", "Belmont", "1.0.1")] [R2APISubmoduleDependency(new string[] { "PrefabAPI", "LanguageAPI", "SoundAPI", "DirectorAPI", "LoadoutAPI", "UnlockableAPI", "NetworkingAPI", "RecalculateStatsAPI" })] public class MainPlugin : BaseUnityPlugin { public const string MODUID = "com.rob.Belmont"; public const string MODNAME = "Belmont"; public const string MODVERSION = "1.0.1"; public const string developerPrefix = "ROB"; public static MainPlugin instance; public static List<HurtBox> hurtboxesList = new List<HurtBox>(); public static bool scepterInstalled => Chainloader.PluginInfos.ContainsKey("com.DestroyedClone.AncientScepter"); public static bool rooInstalled => Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"); public static bool hunkInstalled => Chainloader.PluginInfos.ContainsKey("com.rob.Hunk"); private void Awake() { instance = this; Files.PluginInfo = ((BaseUnityPlugin)this).Info; Config.myConfig = ((BaseUnityPlugin)this).Config; Log.Init(((BaseUnityPlugin)this).Logger); Config.ReadConfig(); BelmontAssets.PopulateAssets(); CameraParams.InitializeParams(); States.RegisterStates(); Projectiles.RegisterProjectiles(); new LanguageTokens(); ItemDisplays.PopulateDisplays(); NetworkingAPI.RegisterMessageType<SyncTreasureChestAnimation>(); NetworkingAPI.RegisterMessageType<SyncMorningStarOverlay>(); new Belmont().CreateCharacter(); new Gargoyle().CreateCharacter(); new GreatGargoyle().CreateCharacter(); Hook(); new ContentPacks().Initialize(); ContentManager.onContentPacksAssigned += LateSetup; } private void LateSetup(ReadOnlyArray<ReadOnlyContentPack> obj) { Belmont.SetItemDisplays(); } 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 HurtBox.OnEnable += new hook_OnEnable(HurtBox_OnEnable); HurtBox.OnDisable += new hook_OnDisable(HurtBox_OnDisable); } 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); } 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; } } } namespace BelmontMod.SkillStates { public class FuckMyAss : GenericCharacterDeath { public override bool shouldAutoDestroy => false; public override void OnEnter() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) ((GenericCharacterDeath)this).OnEnter(); Vector3 val = Vector3.up * 3f; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { val += ((EntityState)this).characterMotor.velocity; ((Behaviour)((EntityState)this).characterMotor).enabled = false; } if (!Object.op_Implicit((Object)(object)((GenericCharacterDeath)this).cachedModelTransform)) { return; } RagdollController component = ((Component)((GenericCharacterDeath)this).cachedModelTransform).GetComponent<RagdollController>(); if (!Object.op_Implicit((Object)(object)component)) { return; } Transform[] bones = component.bones; foreach (Transform val2 in bones) { if (Object.op_Implicit((Object)(object)val2)) { ((Component)val2).gameObject.layer = LayerIndex.ragdoll.intVal; ((Component)val2).gameObject.SetActive(true); } } component.BeginRagdoll(val); } public override void PlayDeathAnimation(float crossfadeDuration = 0.1f) { } public override void FixedUpdate() { ((GenericCharacterDeath)this).FixedUpdate(); if (NetworkServer.active && ((EntityState)this).fixedAge > 4f) { EntityState.Destroy((Object)(object)((EntityState)this).gameObject); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)7; } } } namespace BelmontMod.SkillStates.Emote { public class BaseEmote : BaseState { private CameraParamsOverrideHandle camOverrideHandle; private Animator animator; private ChildLocator childLocator; private float duration; private uint activePlayID; public LocalUser localUser; public override void OnEnter() { //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); animator = ((EntityState)this).GetModelAnimator(); childLocator = ((EntityState)this).GetModelChildLocator(); FindLocalUser(); ((EntityState)this).characterBody.hideCrosshair = true; camOverrideHandle = CameraParams.OverrideCameraParams(((EntityState)this).cameraTargetParams, BelmontCameraParams.EMOTE); } private void FindLocalUser() { if (localUser != null || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { return; } foreach (LocalUser readOnlyLocalUsers in LocalUserManager.readOnlyLocalUsersList) { if ((Object)(object)readOnlyLocalUsers.cachedBody == (Object)(object)((EntityState)this).characterBody) { localUser = readOnlyLocalUsers; break; } } } protected void PlayEmote(string animString, string soundString = "", float animDuration = 0f) { PlayEmote(animString, soundString, ((EntityState)this).GetModelAnimator(), animDuration); } protected void PlayEmote(string animString, string soundString, Animator animator, float animDuration = 0f) { if (animDuration >= 0f && duration != 0f) { animDuration = duration; } if (duration > 0f) { EntityState.PlayAnimationOnAnimator(animator, "FullBody, Override", animString, "Emote.playbackRate", animDuration, 0f); } else { animator.SetFloat("Emote.playbackRate", 1f); EntityState.PlayAnimationOnAnimator(animator, "FullBody, Override", animString); } if (!string.IsNullOrEmpty(soundString)) { activePlayID = Util.PlaySound(soundString, ((EntityState)this).gameObject); } } public override void Update() { ((EntityState)this).Update(); if (((EntityState)this).isAuthority) { CheckEmote<Rest>(Config.restKey); CheckEmote<Taunt>(Config.tauntKey); CheckEmote<Dance>(Config.danceKey); } } private void CheckEmote(KeyCode keybind, EntityState state) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (Input.GetKeyDown(keybind) && !localUser.isUIFocused) { ((EntityState)this).outer.SetInterruptState(state, (InterruptPriority)0); } } private void CheckEmote<T>(ConfigEntry<KeyboardShortcut> keybind) where T : EntityState, new() { if (Config.GetKeyPressed(keybind)) { FindLocalUser(); if (localUser != null && !localUser.isUIFocused) { ((EntityState)this).outer.SetInterruptState((EntityState)(object)new T(), (InterruptPriority)0); } } } public override void FixedUpdate() { //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); bool flag = false; if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded) { flag = true; } if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank)) { if (((EntityState)this).inputBank.skill1.down) { flag = true; } if (((EntityState)this).inputBank.skill2.down) { flag = true; } if (((EntityState)this).inputBank.skill3.down) { flag = true; } if (((EntityState)this).inputBank.skill4.down) { flag = true; } if (((EntityState)this).inputBank.moveVector != Vector3.zero) { flag = true; } } if (duration > 0f && ((EntityState)this).fixedAge >= duration) { flag = true; } if (flag && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).OnExit(); ((EntityState)this).characterBody.hideCrosshair = false; ((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty"); if (activePlayID != 0) { AkSoundEngine.StopPlayingID(activePlayID); } ((EntityState)this).cameraTargetParams.RemoveParamsOverride(camOverrideHandle, 0.5f); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)0; } } public class Dance : BaseEmote { public override void OnEnter() { base.OnEnter(); PlayEmote("Dance"); } } public class Rest : BaseEmote { public override void OnEnter() { base.OnEnter(); PlayEmote("Rest", "", 1.5f); } } public class Taunt : BaseEmote { public override void OnEnter() { base.OnEnter(); PlayEmote("TauntEmote", "", 1.5f); } } } namespace BelmontMod.SkillStates.Belmont { public class BaseBelmontSkillState : BaseSkillState { protected BelmontController belmont; protected virtual bool turningAllowed => true; protected virtual bool normalizeModel => false; protected virtual bool HasItem(ItemDef itemDef) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory)) { return ((EntityState)this).characterBody.inventory.GetItemCount(itemDef) > 0; } return false; } public override void OnEnter() { ValidateControllerReference(); ((BaseState)this).OnEnter(); if (!turningAllowed) { ((EntityState)this).characterDirection.turnSpeed = 0f; } if (normalizeModel) { ((EntityState)this).modelLocator.normalizeToFloor = true; } } public override void OnExit() { ((EntityState)this).OnExit(); if (!turningAllowed) { ((EntityState)this).characterDirection.turnSpeed = belmont.baseTurnSpeed; } if (normalizeModel) { ((EntityState)this).modelLocator.normalizeToFloor = false; } } protected void ValidateControllerReference() { belmont = ((EntityState)this).gameObject.GetComponent<BelmontController>(); } } public class BaseBelmontState : BaseState { protected BelmontController belmont; protected virtual bool HasItem(ItemDef itemDef) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.inventory)) { return ((EntityState)this).characterBody.inventory.GetItemCount(itemDef) > 0; } return false; } public override void OnEnter() { ValidateControllerReference(); ((BaseState)this).OnEnter(); } protected void ValidateControllerReference() { belmont = ((EntityState)this).gameObject.GetComponent<BelmontController>(); } } public class Falling : BaseBelmontSkillState { public Vector3 overrideVelocity = Vector3.zero; protected Vector3 slipVector = Vector3.zero; private float stopwatch; private float previousAirControl; public override void OnEnter() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0067: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Unknown result type (might be due to invalid IL or missing references) //IL_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) //IL_007c: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_00ec: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: 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_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: 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_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0154: Unknown result type (might be due to invalid IL or missing references) //IL_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_018f: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_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_019a: Unknown result type (might be due to invalid IL or missing references) //IL_019f: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: 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_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); 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); if (((EntityState)this).isAuthority) { ((EntityState)this).characterBody.isSprinting = true; direction.y = Mathf.Max(direction.y, 1.05f * BaseLeap.minimumY); Vector3 val2 = slipVector * (0.5f * BaseLeap.aimVelocity) * 12f; Vector3 val3 = Vector3.up * 0.75f * BaseLeap.upwardVelocity; Vector3 val4 = direction * (0.75f * 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(0.1f); ((EntityState)this).characterMotor.velocity = val2 + val4 + val3 + val5; } if (overrideVelocity != Vector3.zero) { ((EntityState)this).characterMotor.velocity = overrideVelocity; } } 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; belmont.shouldCancelFreefall = false; } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); stopwatch += Time.fixedDeltaTime; if (belmont.shouldCancelFreefall) { if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } ((EntityState)this).PlayAnimation("FullBody, Override Soft", "BufferEmpty"); } else if (stopwatch >= 0.1f && ((EntityState)this).isAuthority && ((EntityState)this).characterMotor.isGrounded) { SetNextState(); } } protected virtual void SetNextState() { ((EntityState)this).outer.SetNextState((EntityState)(object)new Roll()); } 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 MainState : GenericCharacterMain { private Animator animator; public LocalUser localUser; private BelmontController belmont; public override void OnEnter() { ((GenericCharacterMain)this).OnEnter(); animator = ((BaseCharacterMain)this).modelAnimator; belmont = ((EntityState)this).GetComponent<BelmontController>(); FindLocalUser(); } public override void FixedUpdate() { //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_00bf: Unknown result type (might be due to invalid IL or missing references) if (belmont.isSwinging) { ((EntityState)this).inputBank.moveVector = Vector3.zero; } ((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.SetFloat("aimDir", ((EntityState)this).inputBank.aimDirection.y); } } public override void Update() { ((GenericCharacterMain)this).Update(); if (((EntityState)this).isAuthority && ((EntityState)this).characterMotor.isGrounded) { CheckEmote<Rest>(Config.restKey); CheckEmote<Taunt>(Config.tauntKey); CheckEmote<Dance>(Config.danceKey); } } private void CheckEmote(KeyCode keybind, EntityState state) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) if (Input.GetKeyDown(keybind) && !localUser.isUIFocused) { ((EntityState)this).outer.SetInterruptState(state, (InterruptPriority)0); } } private void CheckEmote<T>(ConfigEntry<KeyboardShortcut> keybind) where T : EntityState, new() { if (Config.GetKeyPressed(keybind)) { FindLocalUser(); if (localUser != null && !localUser.isUIFocused) { ((EntityState)this).outer.SetInterruptState((EntityState)(object)new T(), (InterruptPriority)0); } } } private void FindLocalUser() { if (localUser != null || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { return; } foreach (LocalUser readOnlyLocalUsers in LocalUserManager.readOnlyLocalUsersList) { if ((Object)(object)readOnlyLocalUsers.cachedBody == (Object)(object)((EntityState)this).characterBody) { localUser = readOnlyLocalUsers; break; } } } public override void ProcessJump() { //IL_022a: Unknown result type (might be due to invalid IL or missing references) //IL_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Expected O, but got Unknown //IL_026a: Unknown result type (might be due to invalid IL or missing references) //IL_026f: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_0281: Unknown result type (might be due to invalid IL or missing references) //IL_0298: Expected O, but got Unknown //IL_02ac: Unknown result type (might be due to invalid IL or missing references) //IL_02b1: Unknown result type (might be due to invalid IL or missing references) //IL_02b8: Unknown result type (might be due to invalid IL or missing references) //IL_02c3: Unknown result type (might be due to invalid IL or missing references) //IL_02ca: Unknown result type (might be due to invalid IL or missing references) //IL_02cf: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02df: Expected O, but got Unknown //IL_030f: Unknown result type (might be due to invalid IL or missing references) //IL_0321: Unknown result type (might be due to invalid IL or missing references) //IL_034f: Unknown result type (might be due to invalid IL or missing references) //IL_0354: Unknown result type (might be due to invalid IL or missing references) if (!((BaseCharacterMain)this).hasCharacterMotor) { return; } bool flag = false; bool flag2 = false; if (!base.jumpInputReceived || !Object.op_Implicit((Object)(object)((EntityState)this).characterBody) || ((EntityState)this).characterMotor.jumpCount >= ((EntityState)this).characterBody.maxJumpCount) { return; } Util.PlaySound("sfx_belmont_jump", ((EntityState)this).gameObject); int itemCount = ((EntityState)this).characterBody.inventory.GetItemCount(Items.JumpBoost); float num = 1f; float num2 = 1f; if (((EntityState)this).characterMotor.jumpCount >= ((EntityState)this).characterBody.baseJumpCount) { flag = true; num = 1.5f; num2 = 1.5f; } else if (itemCount > 0 && ((EntityState)this).characterBody.isSprinting) { float num3 = ((EntityState)this).characterBody.acceleration * ((EntityState)this).characterMotor.airControl; if (((EntityState)this).characterBody.moveSpeed > 0f && num3 > 0f) { flag2 = true; float num4 = Mathf.Sqrt(10f * (float)itemCount / num3); float num5 = ((EntityState)this).characterBody.moveSpeed / num3; num = (num4 + num5) / num5; } } GenericCharacterMain.ApplyJumpVelocity(((EntityState)this).characterMotor, ((EntityState)this).characterBody, num, num2, false); if (((BaseCharacterMain)this).hasModelAnimator) { int layerIndex = ((BaseCharacterMain)this).modelAnimator.GetLayerIndex("Body"); if (layerIndex >= 0) { if (((EntityState)this).characterBody.isSprinting && flag2) { ((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("SprintJump", ((BaseCharacterMain)this).smoothingParameters.intoJumpTransitionTime, layerIndex); } else if (((EntityState)this).characterMotor.jumpCount == 0) { ((BaseCharacterMain)this).modelAnimator.CrossFadeInFixedTime("Jump", ((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 Roll : BaseBelmontSkillState { protected Vector3 slipVector = Vector3.zero; public float duration = 1.1f; private bool peepee; private float coeff = 12f; protected override bool turningAllowed => false; protected override bool normalizeModel => true; public override void OnEnter() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); 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 Soft", "Roll", "Landing.playbackRate", duration * 1.2f, 0.05f); Util.PlaySound("sfx_hunk_roll2", ((EntityState)this).gameObject); } public override void FixedUpdate() { //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: 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_00dc: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_01df: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_02a6: Unknown result type (might be due to invalid IL or missing references) //IL_02ab: Unknown result type (might be due to invalid IL or missing references) 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(0.1f); ((EntityState)this).outer.SetNextStateToMain(); return; } } else { ((EntityState)this).characterMotor.jumpCount = ((EntityState)this).characterBody.maxJumpCount; } ((EntityState)this).FixedUpdate(); ((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 (belmont.shouldCancelFreefall) { if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } ((EntityState)this).PlayAnimation("FullBody, Override Soft", "BufferEmpty"); return; } 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 (((EntityState)this).fixedAge >= 0.55f * duration && ((EntityState)this).inputBank.moveVector != Vector3.zero) { ((EntityState)this).GetModelAnimator().SetTrigger("shouldCancel"); if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } if (NetworkServer.active) { ((EntityState)this).characterBody.AddTimedBuff(Buffs.KillMoveSpeed, 0.25f); ((EntityState)this).characterBody.AddTimedBuff(Buffs.KillMoveSpeed, 0.5f); ((EntityState)this).characterBody.AddTimedBuff(Buffs.KillMoveSpeed, 0.75f); } } else { 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_0029: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) DampenVelocity(); ((EntityState)this).characterMotor.jumpCount = 0; base.OnExit(); if (((EntityState)this).isAuthority && ((EntityState)this).inputBank.moveVector != Vector3.zero) { ((EntityState)this).characterBody.isSprinting = true; } belmont.shouldCancelFreefall = false; } 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)5; } } } namespace BelmontMod.SkillStates.Belmont.Whip { public class Crack : BaseBelmontSkillState { public HurtBox targetHurtbox; public float damageCoefficient = 6f; public float baseDuration = 1.5f; private float duration; private bool hasFired = false; private bool hasPlayedSound = false; private float targetTimer; private bool isCrit; private bool whipWasActive; private int swingIndex; private bool hasMorningStar; private Vector3 targetPosition { get { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_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_0036: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)targetHurtbox)) { return ((Component)targetHurtbox).transform.position; } return ((BaseState)this).FindModelChild("WhipRTip").position; } } public override void OnEnter() { base.OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; whipWasActive = belmont.whipActiveTimer > 0f; belmont.PerformWhipCrack(duration); belmont.tracker.maxTrackingAngle = 45f; belmont.tracker.maxTrackingDistance = 40f; isCrit = ((BaseState)this).RollCrit(); belmont.whipActiveTimer = duration; hasMorningStar = HasItem(BelmontMod.Content.Survivors.Belmont.morningStar); ModifyWhip(); if (whipWasActive) { swingIndex = Random.Range(0, 3); } else { swingIndex = 0; } ((EntityState)this).PlayCrossfade("Gesture, Override", "WhipCrack" + (swingIndex + 1), "Whip.playbackRate", duration, 0.05f); if (hasMorningStar) { Util.PlaySound("sfx_belmont_morningstar_foley_0" + (swingIndex + 1), ((EntityState)this).gameObject); } else { Util.PlaySound("sfx_belmont_whip_foley_0" + (swingIndex + 1), ((EntityState)this).gameObject); } } private void ModifyWhip() { if (!Object.op_Implicit((Object)(object)belmont.characterModel)) { return; } if (hasMorningStar) { ((Component)((BaseState)this).FindModelChild("WhipRenderer")).gameObject.SetActive(false); ((Component)((BaseState)this).FindModelChild("MorningStarRenderer")).gameObject.SetActive(true); return; } ((Component)((BaseState)this).FindModelChild("WhipRenderer")).gameObject.SetActive(true); ((Component)((BaseState)this).FindModelChild("MorningStarRenderer")).gameObject.SetActive(false); if (isCrit) { belmont.characterModel.baseRendererInfos[7].defaultMaterial = BelmontAssets.critWhipMat; } else { belmont.characterModel.baseRendererInfos[7].defaultMaterial = BelmontAssets.baseWhipMat; } belmont.characterModel.UpdateMaterials(); } public override void OnExit() { base.OnExit(); belmont.tracker.maxTrackingDistance = 40f; belmont.tracker.maxTrackingAngle = 20f; } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); ((BaseState)this).StartAimMode(0.5f, false); if (!hasFired) { HurtBox trackingTarget = belmont.tracker.GetTrackingTarget(); if (Object.op_Implicit((Object)(object)trackingTarget)) { targetHurtbox = trackingTarget; targetTimer = 0.2f; } else { targetTimer -= Time.fixedDeltaTime; if (targetTimer <= 0f) { targetHurtbox = null; } } } if (!hasFired && ((EntityState)this).fixedAge >= 0.32f * duration) { hasFired = true; FireBlast(); belmont.tracker.maxTrackingDistance = 40f; belmont.tracker.maxTrackingAngle = 30f; if (((EntityState)this).isAuthority) { float num = 6f / ((BaseState)this).attackSpeedStat; ((BaseState)this).AddRecoil(-1f * num, -2f * num, -0.5f * num, 0.5f * num); } } if (!hasPlayedSound && ((EntityState)this).fixedAge >= 0.3f * duration) { hasPlayedSound = true; if (!hasMorningStar) { Util.PlaySound("sfx_belmont_whip_impact", ((EntityState)this).gameObject); } } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { belmont.HideWhip(); ((EntityState)this).outer.SetNextStateToMain(); } } public void FireBlast() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Expected O, but got Unknown //IL_0048: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009a: 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_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014f: Expected O, but got Unknown //IL_01d1: Unknown result type (might be due to invalid IL or missing references) if (hasMorningStar) { Util.PlaySound("sfx_belmont_morningstar_impact", ((EntityState)this).gameObject); } if (((EntityState)this).isAuthority) { BlastAttack val = new BlastAttack(); val.radius = 4f; val.procCoefficient = 1f; val.position = targetPosition; val.attacker = ((EntityState)this).gameObject; val.crit = isCrit; val.baseDamage = ((BaseState)this).damageStat * damageCoefficient; val.falloffModel = (FalloffModel)2; val.baseForce = 200f; val.bonusForce = Vector3.up * 50f; val.teamIndex = TeamComponent.GetObjectTeam(val.attacker); val.damageType = DamageTypeCombo.op_Implicit((DamageType)0); val.attackerFiltering = (AttackerFiltering)2; HitPoint[] array = val.CollectHits(); if (array.Length != 0 && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && !((EntityState)this).characterMotor.isGrounded) { ((BaseState)this).SmallHop(((EntityState)this).characterMotor, 9f / ((BaseState)this).attackSpeedStat); } GameObject val2 = BelmontAssets.whipImpactEffect; if (isCrit) { val2 = BelmontAssets.whipCritImpactEffect; } EffectManager.SpawnEffect(val2, new EffectData { origin = targetPosition }, true); if (Object.op_Implicit((Object)(object)targetHurtbox) && Object.op_Implicit((Object)(object)targetHurtbox.healthComponent) && targetHurtbox.healthComponent.alive && hasMorningStar) { MorningStarExplosion morningStarExplosion = ((Component)targetHurtbox.healthComponent).gameObject.AddComponent<MorningStarExplosion>(); morningStarExplosion.attacker = ((EntityState)this).gameObject; morningStarExplosion.damageStat = ((BaseState)this).damageStat; morningStarExplosion.isCrit = isCrit; } val.Fire(); } } 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 (((EntityState)this).fixedAge >= duration * 0.7f) { return (InterruptPriority)0; } return (InterruptPriority)1; } } public class PivotSwing : BaseBelmontSkillState { public HurtBox targetHurtbox; public float cachedInput; public float baseDuration = 0.5f; private GameObject rotationPoint; private GameObject anchor; private float speed; private GameObject whip; private LineRenderer whipLine; private float animFloat; private GameObject rootEffectInstance; private float reelSpeed; private float cachedDistance; private float currentDistance; private bool shouldCancel { get { if (!((EntityState)this).inputBank.skill3.down) { return true; } if (!Object.op_Implicit((Object)(object)targetHurtbox)) { return true; } return false; } } public override void OnEnter() { //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0134: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_018d: 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_0194: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); baseDuration = belmont.whipDuration; if (!Object.op_Implicit((Object)(object)targetHurtbox)) { ((EntityState)this).outer.SetNextStateToMain(); return; } reelSpeed = belmont.whipReelSpeed; Util.PlaySound("sfx_belmont_whip_latch", ((EntityState)this).gameObject); animFloat = 0f; float num = Vector3.Distance(((EntityState)this).transform.position, ((Component)targetHurtbox).transform.position); speed = ((EntityState)this).characterBody.baseMoveSpeed * Util.Remap(num, 0f, 28f, belmont.whipMinSpeed, belmont.whipMaxSpeed); ((EntityState)this).PlayCrossfade("FullBody, Override Soft", "Swing", 0.05f); ((EntityState)this).PlayCrossfade("FullBody, Override", "BufferEmpty", 0.02f); whip = ((Component)((BaseState)this).FindModelChild("WhipLLine")).gameObject; whipLine = whip.GetComponent<LineRenderer>(); whipLine.SetPositions((Vector3[])(object)new Vector3[2] { whip.transform.position, whip.transform.position }); whip.SetActive(true); belmont.isSwinging = true; ((EntityState)this).characterDirection.turnSpeed = 2048f; SetupPoints(); CharacterBody characterBody = ((EntityState)this).characterBody; characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1); } private void SetupPoints() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0021: Expected O, but got Unknown //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_00af: Unknown result type (might be due to invalid IL or missing references) //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_00c4: 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_0149: 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_0169: Unknown result type (might be due to invalid IL or missing references) //IL_01c3: Unknown result type (might be due to invalid IL or missing references) //IL_01d3: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) anchor = new GameObject("Anchor"); rotationPoint = new GameObject("RotationPoint"); rotationPoint.transform.position = ((EntityState)this).transform.position; anchor.transform.position = targetHurtbox.healthComponent.body.corePosition; anchor.transform.rotation = Util.QuaternionSafeLookRotation(((EntityState)this).transform.position - anchor.transform.position); rotationPoint.transform.rotation = Util.QuaternionSafeLookRotation(anchor.transform.position - ((EntityState)this).transform.position); rotationPoint.transform.SetParent(anchor.transform, true); rootEffectInstance = Object.Instantiate<GameObject>(BelmontAssets.whipRootEffect); rootEffectInstance.transform.SetParent(anchor.transform, false); rootEffectInstance.transform.localPosition = new Vector3(0f, -1f, 0f); rootEffectInstance.transform.rotation = Quaternion.identity; rootEffectInstance.transform.localScale = Vector3.one * 0.33f; string name = ((Object)((Component)targetHurtbox.healthComponent).gameObject).name; if (BelmontAssets.whipRootEffectScale.ContainsKey(name)) { rootEffectInstance.transform.localScale = BelmontAssets.whipRootEffectScale[name]; } cachedDistance = Vector3.Distance(anchor.transform.position, rotationPoint.transform.position); currentDistance = cachedDistance; } public override void OnExit() { //IL_0092: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) base.OnExit(); if (Object.op_Implicit((Object)(object)belmont)) { belmont.isSwinging = false; } if (Object.op_Implicit((Object)(object)anchor)) { EntityState.Destroy((Object)(object)anchor); } if (Object.op_Implicit((Object)(object)rotationPoint)) { EntityState.Destroy((Object)(object)rotationPoint); } if (Object.op_Implicit((Object)(object)whip)) { whip.SetActive(false); } ((EntityState)this).characterDirection.turnSpeed = belmont.baseTurnSpeed; CharacterBody characterBody = ((EntityState)this).characterBody; characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags & -2); ((EntityState)this).PlayCrossfade("FullBody, Override Soft", "SwingRelease", 0.05f); } private void UpdateRotation() { //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006a: 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) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0115: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_0125: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)targetHurtbox)) { anchor.transform.position = targetHurtbox.healthComponent.body.corePosition + Vector3.up; Quaternion val = Quaternion.Euler(0f, speed * Time.fixedDeltaTime * cachedInput, 0f); anchor.transform.rotation = anchor.transform.rotation * val; cachedDistance -= reelSpeed * Time.fixedDeltaTime * 2f; if (cachedDistance < 5f) { cachedDistance = 5f; } currentDistance = Mathf.Lerp(currentDistance, cachedDistance, 1.5f * Time.fixedDeltaTime); rotationPoint.transform.position = anchor.transform.position + anchor.transform.forward * currentDistance; reelSpeed = Mathf.Lerp(reelSpeed, 0f, ((EntityState)this).fixedAge / baseDuration); if (reelSpeed <= 0f) { reelSpeed = 0f; } } } public override void Update() { //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).Update(); ((EntityState)this).characterBody.isSprinting = true; if (Object.op_Implicit((Object)(object)targetHurtbox) && Object.op_Implicit((Object)(object)anchor) && Object.op_Implicit((Object)(object)rotationPoint)) { whipLine.SetPositions((Vector3[])(object)new Vector3[2] { whip.transform.position, anchor.transform.position - Vector3.up }); } } private void UpdateAnimator() { Animator modelAnimator = ((EntityState)this).GetModelAnimator(); if (Object.op_Implicit((Object)(object)modelAnimator)) { animFloat = Mathf.Lerp(animFloat, 0f - cachedInput, belmont.swingAnimSpeed * Time.fixedDeltaTime); modelAnimator.SetFloat("dashR", animFloat); } } private void UpdatePlayerRotation() { //IL_000c: 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_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) Vector3 moveVector = anchor.transform.position - ((EntityState)this).transform.position; ((EntityState)this).characterDirection.moveVector = moveVector; } public override void FixedUpdate() { //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_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_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: 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_022f: Unknown result type (might be due to invalid IL or missing references) //IL_0234: Unknown result type (might be due to invalid IL or missing references) //IL_0239: Unknown result type (might be due to invalid IL or missing references) //IL_0247: Unknown result type (might be due to invalid IL or missing references) //IL_024f: Unknown result type (might be due to invalid IL or missing references) //IL_0259: Unknown result type (might be due to invalid IL or missing references) //IL_025e: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_00f1: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_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) ((EntityState)this).FixedUpdate(); ((EntityState)this).characterBody.isSprinting = true; ((EntityState)this).characterBody.aimTimer = -1f; if (Object.op_Implicit((Object)(object)targetHurtbox) && Object.op_Implicit((Object)(object)anchor) && Object.op_Implicit((Object)(object)rotationPoint)) { if (((EntityState)this).isAuthority) { UpdateRotation(); UpdatePlayerRotation(); Vector3 val = rotationPoint.transform.position; Vector3 position = anchor.transform.position; Vector3 val2 = val - anchor.transform.position; RaycastHit val3 = default(RaycastHit); if (Physics.SphereCast(position, 0.6f, ((Vector3)(ref val2)).normalized, ref val3, Vector3.Distance(anchor.transform.position, val), LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask))) { Vector3 point = ((RaycastHit)(ref val3)).point; val2 = val - anchor.transform.position; val = point - ((Vector3)(ref val2)).normalized * 0.5f; currentDistance = Vector3.Distance(anchor.transform.position, val); } ((BaseCharacterController)((EntityState)this).characterMotor).Motor.SetPosition(val, false); } whipLine.SetPositions((Vector3[])(object)new Vector3[2] { whip.transform.position, anchor.transform.position }); UpdateAnimator(); } if (!((EntityState)this).isAuthority || !(((EntityState)this).fixedAge >= baseDuration) || !shouldCancel) { return; } if (((BaseState)this).isGrounded) { belmont.shouldCancelFreefall = false; ((EntityState)this).outer.SetNextState((EntityState)(object)new Roll()); return; } belmont.shouldCancelFreefall = false; if (Object.op_Implicit((Object)(object)targetHurtbox)) { UpdateRotation(); } Vector3 val4 = rotationPoint.transform.position - ((EntityState)this).transform.position; ((EntityState)this).outer.SetNextState((EntityState)(object)new Falling { overrideVelocity = val4 * speed * 0.35f }); } } public class PreDash : BaseBelmontSkillState { public float baseDuration = 0.15f; protected Vector3 slipVector = Vector3.zero; public float duration = 0.15f; private Vector3 cachedForward; private HurtBox targetHurtbox; private GameObject whip; private LineRenderer whipLine; private float cachedInput; public override void OnEnter() { //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_0065: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) //IL_00e2: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_010f: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0123: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_01b2: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: Unknown result type (might be due to invalid IL or missing references) //IL_01c9: Unknown result type (might be due to invalid IL or missing references) //IL_01ce: Unknown result type (might be due to invalid IL or missing references) //IL_01fb: Unknown result type (might be due to invalid IL or missing references) //IL_0200: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); duration = baseDuration; if (Object.op_Implicit((Object)(object)belmont.tracker.GetTrackingTarget())) { duration = 0.3f; } Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector); slipVector = ((Vector3)(ref val)).normalized; cachedForward = ((EntityState)this).characterDirection.forward; targetHurtbox = belmont.tracker.GetTrackingTarget(); Animator modelAnimator = ((EntityState)this).GetModelAnimator(); if (Object.op_Implicit((Object)(object)targetHurtbox)) { Vector3 moveVector = ((Component)targetHurtbox).transform.position - ((EntityState)this).transform.position; ((EntityState)this).characterDirection.moveVector = moveVector; } Vector3 val2 = (Object.op_Implicit((Object)(object)((EntityState)this).characterDirection) ? ((EntityState)this).characterDirection.moveVector : slipVector); Vector3 val3 = Vector3.Cross(Vector3.up, val2); float num = Vector3.Dot(slipVector, val2); float num2 = Vector3.Dot(slipVector, val3); modelAnimator.SetFloat("dashF", num); modelAnimator.SetFloat("dashR", num2); if (num2 > 0f) { cachedInput = -1f; } else { cachedInput = 1f; } whip = ((Component)((BaseState)this).FindModelChild("WhipLLine")).gameObject; whipLine = whip.GetComponent<LineRenderer>(); whipLine.SetPositions((Vector3[])(object)new Vector3[2] { whip.transform.position, whip.transform.position }); whip.SetActive(true); ApplyBuff(); CreateDashEffect(); ((EntityState)this).characterDirection.moveVector = slipVector; if (Object.op_Implicit((Object)(object)targetHurtbox)) { Util.PlaySound("sfx_belmont_whip_swing", ((EntityState)this).gameObject); ((EntityState)this).PlayAnimation("FullBody, Override", "DashTarget", "Dash.playbackRate", duration * 2f, 0f); } else { ((EntityState)this).PlayAnimation("FullBody, Override", "Dash", "Dash.playbackRate", duration * 4f, 0f); } } public virtual void ApplyBuff() { if (NetworkServer.active) { ((EntityState)this).characterBody.AddTimedBuff(Buffs.HiddenInvincibility, duration); } } public virtual void CreateDashEffect() { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0007: Expected O, but got Unknown //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) EffectData val = new EffectData(); val.rotation = Util.QuaternionSafeLookRotation(slipVector); val.origin = ((EntityState)this).characterBody.corePosition; EffectManager.SpawnEffect(BelmontAssets.dashEffect, val, false); float num = 3f; if (((EntityState)this).isAuthority) { ((BaseState)this).AddRecoil(-1f * num, -2f * num, -0.5f * num, 0.5f * num); } Transform val2 = belmont.childLocator.FindChild("JetL"); Transform val3 = belmont.childLocator.FindChild("JetR"); if (Object.op_Implicit((Object)(object)val2)) { Object.Instantiate<GameObject>(BelmontAssets.jetEffect, val2); } if (Object.op_Implicit((Object)(object)val3)) { Object.Instantiate<GameObject>(BelmontAssets.jetEffect, val3); } } private void UpdateWhipEffect() { //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)targetHurtbox)) { whipLine.SetPositions((Vector3[])(object)new Vector3[2] { whip.transform.position, Vector3.Lerp(whip.transform.position, ((Component)targetHurtbox).transform.position, Util.Remap(((EntityState)this).fixedAge, 0f, duration, 0f, 1f)) }); } } public override void Update() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Unknown result type (might be due to invalid IL or missing references) //IL_004c: 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) ((EntityState)this).Update(); ((EntityState)this).characterBody.isSprinting = true; if (Object.op_Implicit((Object)(object)targetHurtbox)) { Vector3 moveVector = ((Component)targetHurtbox).transform.position - ((EntityState)this).transform.position; ((EntityState)this).characterDirection.moveVector = moveVector; } } public override void FixedUpdate() { //IL_001c: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0037: 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_0066: Unknown result type (might be due to invalid IL or missing references) //IL_0071: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0082: 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_00b2: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); ((EntityState)this).characterBody.isSprinting = true; ((EntityState)this).characterMotor.velocity = slipVector * ((BaseState)this).moveSpeedStat * belmont.dashSpeed * Time.fixedDeltaTime; if (Object.op_Implicit((Object)(object)targetHurtbox)) { Vector3 moveVector = ((Component)targetHurtbox).transform.position - ((EntityState)this).transform.position; ((EntityState)this).characterDirection.moveVector = moveVector; } UpdateWhipEffect(); if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterDirection)) { ((EntityState)this).characterDirection.forward = cachedForward; } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= duration) { if (Object.op_Implicit((Object)(object)targetHurtbox) && ((EntityState)this).inputBank.skill3.down) { ((EntityState)this).outer.SetNextState((EntityState)(object)new PivotSwing { targetHurtbox = targetHurtbox, cachedInput = cachedInput }); } else { ((EntityState)this).outer.SetNextStateToMain(); } } } public virtual void DampenVelocity() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0017: Unknown result type (might be due to invalid IL or missing references) CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.velocity *= 0.8f; } public override void OnExit() { DampenVelocity(); if (!((EntityState)this).inputBank.skill3.down && Object.op_Implicit((Object)(object)whip)) { whip.SetActive(false); } if (!Object.op_Implicit((Object)(object)targetHurtbox) && Object.op_Implicit((Object)(object)whip)) { whip.SetActive(false); } base.OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)5; } } public class PrepThrow : BaseBelmontSkillState { public HurtBox target; private GameObject rootEffectInstance; protected GameObject areaIndicatorInstance { get; set; } public override void OnEnter() { //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007b: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_0114: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); target = belmont.tracker.GetTrackingTarget(); rootEffectInstance = Object.Instantiate<GameObject>(BelmontAssets.whipRootEffect); rootEffectInstance.transform.SetParent(((Component)target).transform, false); rootEffectInstance.transform.localPosition = new Vector3(0f, -1f, 0f); rootEffectInstance.transform.rotation = Quaternion.identity; rootEffectInstance.transform.localScale = Vector3.one * 0.33f; string name = ((Object)((Component)target.healthComponent).gameObject).name; if (BelmontAssets.whipRootEffectScale.ContainsKey(name)) { rootEffectInstance.transform.localScale = BelmontAssets.whipRootEffectScale[name]; } if (Object.op_Implicit((Object)(object)ArrowRain.areaIndicatorPrefab)) { areaIndicatorInstance = Object.Instantiate<GameObject>(ArrowRain.areaIndicatorPrefab); areaIndicatorInstance.transform.localScale = Vector3.zero; } } private void UpdateAreaIndicator() { //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_0021: 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_007d: Unknown result type (might be due to invalid IL or missing references) //IL_0095: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)areaIndicatorInstance)) { float num = 128f; Ray aimRay = ((BaseState)this).GetAimRay(); RaycastHit val = default(RaycastHit); if (Physics.Raycast(aimRay, ref val, num, LayerMask.op_Implicit(CommonMasks.bullet))) { areaIndicatorInstance.transform.position = ((RaycastHit)(ref val)).point; areaIndicatorInstance.transform.up = ((RaycastHit)(ref val)).normal; } else { areaIndicatorInstance.transform.position = ((Ray)(ref aimRay)).GetPoint(num); areaIndicatorInstance.transform.up = -((Ray)(ref aimRay)).direction; } } } public override void OnExit() { base.OnExit(); belmont.lockOnTarget = null; if (Object.op_Implicit((Object)(object)rootEffectInstance)) { EntityState.Destroy((Object)(object)rootEffectInstance); } if (Object.op_Implicit((Object)(object)areaIndicatorInstance)) { EntityState.Destroy((Object)(object)areaIndicatorInstance); } } public override void FixedUpdate() { //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (Object.op_Implicit((Object)(object)areaIndicatorInstance)) { float num = Util.Remap(((EntityState)this).fixedAge, 0f, 0.3f, 0f, 8f); if (num >= 8f) { num = 8f; } areaIndicatorInstance.transform.localScale = new Vector3(num, num, num); } if (!((EntityState)this).inputBank.skill2.down && ((EntityState)this).isAuthority) { ThrowTarget throwTarget = new ThrowTarget(); Transform val = (Object.op_Implicit((Object)(object)areaIndicatorInstance) ? areaIndicatorInstance.transform : ((EntityState)this).transform); throwTarget.target = target; throwTarget.throwPosition = val.position; ((EntityState)this).outer.SetNextState((EntityState)(object)throwTarget); } } public override void Update() { ((EntityState)this).Update(); UpdateAreaIndicator(); } } public class ThrownState : BaseBelmontSkillState { public CharacterBody attackerBody; public Vector3 overrideVelocity = Vector3.zero; private float stopwatch; private float previousAirControl; private bool wasPlayer; public override void OnEnter() { //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); previousAirControl = ((EntityState)this).characterMotor.airControl; ((EntityState)this).characterMotor.airControl = BaseLeap.airControl; CharacterBody characterBody = ((EntityState)this).characterBody; characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = overrideVelocity; ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f); wasPlayer = ((BaseCharacterController)((EntityState)this).characterMotor).Motor.playerCharacter; ((BaseCharacterController)((EntityState)this).characterMotor).Motor.playerCharacter = true; } else if (Object.op_Implicit((Object)(object)((EntityState)this).rigidbody)) { ((EntityState)this).rigidbody.velocity = overrideVelocity; } } 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); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((BaseCharacterController)((EntityState)this).characterMotor).Motor.playerCharacter = wasPlayer; ((EntityState)this).characterMotor.airControl = previousAirControl; } } public override void FixedUpdate() { //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_0067: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); stopwatch += Time.fixedDeltaTime; if (stopwatch <= 0.5f) { if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = overrideVelocity; } else if (Object.op_Implicit((Object)(object)((EntityState)this).rigidbody)) { ((EntityState)this).rigidbody.velocity = overrideVelocity; } } if (stopwatch >= 0.25f && ((EntityState)this).isAuthority && ((EntityState)this).characterMotor.isGrounded) { SetNextState(); } } protected virtual void SetNextState() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).outer.SetNextStateToMain(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.velocity *= 0.1f; } FireBlast(); } private void FireBlast() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_000b: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0018: 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_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Expected O, but got Unknown //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown //IL_0088: Unknown result type (might be due to invalid IL or missing references) //IL_008d: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f9: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_010a: 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_0117: Unknown result type (might be due to invalid IL or missing references) EffectManager.SpawnEffect(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/SurvivorPod/PodGroundImpact.prefab").WaitForCompletion(), new EffectData { origin = ((EntityState)this).transform.position, rotation = Quaternion.identity, scale = 1f }, false); if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)attackerBody)) { BlastAttack val = new BlastAttack(); val.radius = 8f; val.procCoefficient = 1f; val.position = ((EntityState)this).characterBody.corePosition; val.attacker = ((Component)attackerBody).gameObject; val.crit = attackerBody.RollCrit(); val.baseDamage = attackerBody.damage * 8f; val.falloffModel = (FalloffModel)1; val.baseForce = 400f; val.bonusForce = Vector3.up * 200f; val.teamIndex = TeamComponent.GetObjectTeam(val.attacker); val.damageType = DamageTypeCombo.op_Implicit((DamageType)0); val.attackerFiltering = (AttackerFiltering)2; val.Fire(); } } 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 ThrowTarget : BaseBelmontSkillState { public float baseDuration = 0.2f; public HurtBox target; public Vector3 throwPosition; private float duration; public override void OnEnter() { base.OnEnter(); duration = baseDuration / ((BaseState)this).attackSpeedStat; if (Object.op_Implicit((Object)(object)target)) { PerformThrow(); } } private void PerformThrow() { //IL_0050: 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_006a: Unknown result type (might be due to invalid IL or missing references) //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Unknown result type (might be due to invalid IL or missing references) //IL_0087: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)target.healthComponent)) { EntityStateMachine val = EntityStateMachine.FindByCustomName(((Component)target.healthComponent).gameObject, "Body"); if (Object.op_Implicit((Object)(object)val)) { ThrownState obj = new ThrownState { attackerBody = ((EntityState)this).characterBody }; Vector3 val2 = throwPosition - target.healthComponent.body.corePosition; obj.overrideVelocity = ((Vector3)(ref val2)).normalized * belmont.throwForce; val.SetNextState((EntityState)(object)obj); } } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } } namespace BelmontMod.SkillStates.Belmont.Subweapon { public class BaseAimState : BaseBelmontSkillState { public CameraParamsOverrideHandle camParamsOverrideHandle; protected bool useGravity = true; protected float detonationRadius = 8f; protected float projectileBaseSpeed = 8f; protected float endpointVisualizerRadiusScale = 1f; protected float rayRadius = 0.5f; protected float maxDistance = 25f; protected GameObject projectilePrefab = Projectiles.holyWaterFlaskProjectile; private GameObject propInstance; protected LineRenderer arcVisualizerLineRenderer; protected Transform endpointVisualizerTransform; private CalculateArcPointsJob calculateArcPointsJob; private JobHandle calculateArcPointsJobHandle; private Vector3[] pointsBuffer = Array.Empty<Vector3>(); private Action completeArcPointsVisualizerJobMethod; protected TrajectoryInfo currentTrajectoryInfo; public override void OnEnter() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00d4: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Expected O, but got Unknown //IL_0194: Unknown result type (might be due to invalid IL or missing references) base.OnEnter(); PlayAnim(); if (!((CameraParamsOverrideHandle)(ref camParamsOverrideHandle)).isValid) { camParamsOverrideHandle = CameraParams.OverrideCameraParams(((EntityState)this).cameraTargetParams, BelmontCameraParams.AIM); } if (NetworkServer.active) { ((EntityState)this).characterBody.AddBuff(Buffs.Slow50); } CreateProp(); if (Object.op_Implicit((Object)(object)ArrowRain.areaIndicatorPrefab)) { endpointVisualizerTransform = Object.Instantiate<GameObject>(ArrowRain.areaIndicatorPrefab).transform; ((Component)endpointVisualizerTransform).transform.localScale = Vector3.zero; } if (Object.op_Implicit((Object)(object)BelmontAssets.aimPredictionEffect)) { arcVisualizerLineRenderer = Object.Instantiate<GameObject>(BelmontAssets.aimPredictionEffect, ((EntityState)this).transform.position, Quaternion.identity).GetComponent<LineRenderer>(); calculateArcPointsJob = default(CalculateArcPointsJob); completeArcPointsVisualizerJobMethod = CompleteArcVisualizerJob; RoR2Application.onLateUpdate += completeArcPointsVisualizerJobMethod; } ProjectileSimple component = projectilePrefab.GetComponent<ProjectileSimple>(); if (Object.op_Implicit((Object)(object)component)) { projectileBaseSpeed = component.velocity; } Rigidbody component2 = projectilePrefab.GetComponent<Rigidbody>(); if (Object.op_Implicit((Object)(object)component2)) { useGravity = component2.useGravity; } ProjectileImpactExplosion component3 = projectilePrefab.GetComponent<ProjectileImpactExplosion>(); if (Object.op_Implicit((Object)(object)component3)) { detonationRadius = ((ProjectileExplosion)component3).blastRadius; if (Object.op_Implicit((Object)(object)endpointVisualizerTransform)) { endpointVisualizerTransform.localScale = new Vector3(detonationRadius, detonationRadius, detonationRadius); } } UpdateVisualizers(currentTrajectoryInfo); SceneCamera.onSceneCameraPreRender += new SceneCameraDelegate(OnPreRenderSceneCam); } protected virtual void CreateProp() { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) propInstance = Object.Instantiate<GameObject>(BelmontAssets.holyWater); propInstance.transform.SetParent(belmont.childLocator.FindChild("Weapon"), false); propInstance.transform.localPosition = Vector3.zero; propInstance.transform.localRotation = Quaternion.identity; } protected virtual void PlayAnim() { ((EntityState)this).PlayCrossfade("Gesture, Override", "Aim", 0.05f); ((EntityState)this).PlayCrossfade("AimPitch", "AimPitchAiming", 0.05f); } public override void FixedUpdate() { //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) ((EntityState)this).FixedUpdate(); ((EntityState)this).characterBody.outOfCombatStopwatch = 0f; ((EntityState)this).characterBody.isSprinting = false; ((EntityState)this).characterBody.SetAimTimer(0.2f); if (!((EntityState)this).inputBank.skill4.down && ((EntityState)this).isAuthority && ((EntityState)this).fixedAge > 0.1f) { UpdateTrajectoryInfo(out currentTrajectoryInfo); BaseThrowState baseThrowState = new BaseThrowState(); baseThrowState.currentTrajectoryInfo = currentTrajectoryInfo; ((EntityState)this).outer.SetNextState((EntityState)(object)baseThrowState); } } public override void Update() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).Update(); UpdateTrajectoryInfo(out currentTrajectoryInfo); UpdateVisualizers(currentTrajectoryInfo); } private void UpdateVisualizers(TrajectoryInfo trajectoryInfo) { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0048: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c6: Unknown result type (might be due to invalid IL or missing references) //IL_00c7: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_006d: Unknown result type (might be due to invalid IL or missing references) //IL_0107: 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_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009e: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a4: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)arcVisualizerLineRenderer) && ((JobHandle)(ref calculateArcPointsJobHandle)).IsCompleted) { ((CalculateArcPointsJob)(ref calculateArcPointsJob)).SetParameters(((Ray)(ref trajectoryInfo.finalRay)).origin, ((Ray)(ref trajectoryInfo.finalRay)).direction * trajectoryInfo.speedOverride, trajectoryInfo.travelTime, arcVisualizerLineRenderer.positionCount, useGravity ? Physics.gravity.y : 0f); calculateArcPointsJobHandle = IJobParallelForExtensions.Schedule<CalculateArcPointsJob>(calculateArcPointsJob, calculateArcPointsJob.outputPositions.Length, 32, default(JobHandle)); } if (Object.op_Implicit((Object)(object)endpointVisualizerTransform)) { endpointVisualizerTransform.SetPositionAndRotation(trajectoryInfo.hitPoint, Util.QuaternionSafeLookRotation(trajectoryInfo.hitNormal)); if (!endpointVisualizerRadiusScale.Equals(0f)) { endpointVisualizerTransform.localScale = new Vector3(endpointVisualizerRadiusScale, endpointVisualizerRadiusScale, endpointVisualizerRadiusScale); } } } protected virtual void UpdateTrajectoryInfo(out TrajectoryInfo dest) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0080: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_0098: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type