Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of FajisBastianPatch v1.2.0
Faji'sBastianRework.dll
Decompiled 7 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; using System.Runtime.Versioning; using Bastian; using BepInEx; using BepInEx.Configuration; using EntityStates; using EntityStates.Merc; using HarmonyLib; using KinematicCharacterController; using R2API; using RoR2; using RoR2.Skills; using UnityEngine; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: AssemblyTitle("Faji'sBastianRework")] [assembly: AssemblyDescription("")] [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("HP")] [assembly: AssemblyProduct("Faji'sBastianRework")] [assembly: AssemblyCopyright("Copyright © HP 2025")] [assembly: AssemblyTrademark("")] [assembly: ComVisible(false)] [assembly: Guid("e7143390-952a-4efc-910e-7b0468bfa1ce")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")] [assembly: AssemblyVersion("1.0.0.0")] namespace BastianPatch; public static class BastianOverrides { public static void Apply() { Debug.Log((object)"[BastianPatch] Apply() called"); LanguageAPI.Add("BASTIAN_M2", "Ion Burst / Ion Channel"); LanguageAPI.Add("BASTIAN_M2_DESCRIPTION", "<style=cIsUtility>TAP:</style> Fire a quick ion shot for <style=cIsDamage>200% damage</style>.\n<style=cIsUtility>HOLD:</style> Sacrifice a portion of your health to greatly increase damage. If you have at least <style=cIsUtility>2 Ion Charges</style>, the shot ricochets to another target. Each additional 2 charges adds another bounce, up to <style=cIsUtility>5 total targets</style> at <style=cIsUtility>10 Ion Charges</style>."); LanguageAPI.Add("BASTIAN_UTIL", "Dash / Empowered Dash"); LanguageAPI.Add("BASTIAN_UTIL_DESCRIPTION", "<style=cIsUtility>TAP:</style> Dash forward, <style=cIsUtility>stunning</style> nearby enemies.\n<style=cIsUtility>HOLD:</style> Sacrifice health to trigger a powerful explosion. Consumes <style=cIsUtility>15 Ion Charges</style> to grant the <style=cIsUtility>Evasive</style> buff to yourself and nearby allies, enhancing mobility and survivability."); LanguageAPI.Add("BASTIAN_SPEC", "Ion Release / Ion Detonation"); LanguageAPI.Add("BASTIAN_SPEC_DESCRIPTION", "<style=cIsUtility>TAP:</style> Consume all Ion to heal based on stacks and gain speed. <style=cIsUtility>While this skill is recharging, you cannot generate Ion Charges.</style>\n<style=cIsUtility>HOLD:</style> Sacrifice health to unleash a massive explosion, granting team buffs. <style=cIsUtility>While this skill is recharging, you cannot generate Ion Charges.</style>"); LanguageAPI.Add("BASTIAN_SPEC_KEYWORD", "Evasive: Gain <style=cIsUtility>35% movement speed</style>, <style=cIsUtility>+X% regen</style>, and augment your abilities. While active, Ion gain is halved."); } } [BepInPlugin("com.OnlyFaji.bastianpatch", "Bastian Patch", "1.0.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class Plugin : BaseUnityPlugin { public const string PluginGuid = "com.OnlyFaji.bastianpatch"; public const string PluginName = "Bastian Patch"; public const string PluginVersion = "1.0.0"; public static BuffDef HiddenInvincibility; public static BuffDef SpeedBuff; public static uint DashFastEventId; public static GameObject ExplosionEffectPrefab; private void Awake() { //IL_0006: Unknown result type (might be due to invalid IL or missing references) new Harmony("com.OnlyFaji.bastianpatch").PatchAll(); RicochetHandler.InitConfig(((BaseUnityPlugin)this).Config); Language.onCurrentLanguageChanged += BastianOverrides.Apply; Type type = AccessTools.TypeByName("Bastian.Prefabs"); if (type == null) { ((BaseUnityPlugin)this).Logger.LogError((object)"[BastianPatch] Could not find Bastian.Prefabs!"); return; } object? value = AccessTools.Field(type, "muzzleflash").GetValue(null); TapSecondary.muzzleflash = (GameObject)((value is GameObject) ? value : null); object? value2 = AccessTools.Field(type, "tracer").GetValue(null); TapSecondary.tracer = (GameObject)((value2 is GameObject) ? value2 : null); object? value3 = AccessTools.Field(type, "bulletImpact").GetValue(null); TapSecondary.bulletImpact = (GameObject)((value3 is GameObject) ? value3 : null); HoldSecondary.muzzleflash = TapSecondary.muzzleflash; HoldSecondary.tracer = TapSecondary.tracer; HoldSecondary.bulletImpact = TapSecondary.bulletImpact; object? value4 = AccessTools.Field(type, "speed").GetValue(null); SpeedBuff = (BuffDef)((value4 is BuffDef) ? value4 : null); object? value5 = AccessTools.Field(type, "explosionEffect").GetValue(null); ExplosionEffectPrefab = (GameObject)((value5 is GameObject) ? value5 : null); Type type2 = AccessTools.TypeByName("Bastian.Buffs"); if (type2 != null) { object? value6 = AccessTools.Field(type2, "HiddenInvincibility").GetValue(null); HiddenInvincibility = (BuffDef)((value6 is BuffDef) ? value6 : null); } Type type3 = AccessTools.TypeByName("Bastian.Sounds"); if (type3 != null) { FieldInfo fieldInfo = AccessTools.Field(type3, "Play_Bastian_DashFast"); if (fieldInfo != null) { DashFastEventId = (uint)fieldInfo.GetValue(null); } } Type type4 = AccessTools.TypeByName("Bastian.Configs"); if (type4 == null) { ((BaseUnityPlugin)this).Logger.LogError((object)"[BastianPatch] Could not find Bastian.Configs!"); return; } FieldInfo fieldInfo2 = AccessTools.Field(type4, "M2_Damage"); if (fieldInfo2 != null) { object value7 = fieldInfo2.GetValue(null); if (value7 != null) { PropertyInfo property = value7.GetType().GetProperty("Value"); if (property != null) { float num = (HoldSecondary.baseDamageCoefficient = (TapSecondary.damageCoefficient = (float)property.GetValue(value7))); ((BaseUnityPlugin)this).Logger.LogInfo((object)$"[BastianPatch] Configs: M2_Damage={num}"); } } } HoldUtilityDash.sacrificePercent = ((BaseUnityPlugin)this).Config.Bind<float>("Utility", "SacrificePercent", 0.25f, "Fraction of current HP to sacrifice on Hold Utility Dash").Value; HoldUtilityDash.baseDamageCoefficient = ((BaseUnityPlugin)this).Config.Bind<float>("Utility", "BaseDamageCoefficient", 5f, "Base damage coefficient for Hold Utility Dash (500% = 5.0)").Value; HoldUtilityDash.sacrificeScaling = ((BaseUnityPlugin)this).Config.Bind<float>("Utility", "SacrificeScaling", 0.01f, "Scaling factor applied per HP lost for Hold Utility Dash").Value; TapSpecial.healPerStack = ((BaseUnityPlugin)this).Config.Bind<float>("Special", "Tap_HealPerIonStack", 0.01f, "Heal fraction of max HP per Ion stack consumed on Tap Special (0.01 = 1%)").Value; HoldSpecial.sacrificePercent = ((BaseUnityPlugin)this).Config.Bind<float>("Special", "Hold_SacrificePercent", 0.75f, "Fraction of current HP to sacrifice on Hold Special (0.75 = 75%)").Value; HoldSpecial.baseDamageCoefficient = ((BaseUnityPlugin)this).Config.Bind<float>("Special", "Hold_BaseDamageCoefficient", 5f, "Base damage coefficient for Hold Special (500% = 5.0)").Value; HoldSpecial.ionScaling = ((BaseUnityPlugin)this).Config.Bind<float>("Special", "Hold_IonScalingPerStack", 50f, "Additive damage coefficient gained per Ion stack consumed on Hold Special").Value; HoldSpecial.sacrificeScaling = ((BaseUnityPlugin)this).Config.Bind<float>("Special", "Hold_SacrificeScaling", 0.01f, "Additive damage coefficient gained per HP lost on Hold Special").Value; RoR2Application.onLoad = (Action)Delegate.Combine(RoR2Application.onLoad, (Action)delegate { //IL_0042: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_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_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) SkillDef val = SkillCatalog.allSkillDefs.FirstOrDefault((Func<SkillDef, bool>)((SkillDef sd) => sd.skillNameToken == "BASTIAN_M2")); if ((Object)(object)val != (Object)null) { val.activationState = new SerializableEntityStateType(typeof(SecondaryDispatcher)); val.activationStateMachineName = "Weapon"; val.baseMaxStock = 8; val.stockToConsume = 0; val.beginSkillCooldownOnSkillEnd = true; val.mustKeyPress = true; } SkillDef val2 = SkillCatalog.allSkillDefs.FirstOrDefault((Func<SkillDef, bool>)((SkillDef sd) => sd.skillNameToken == "BASTIAN_UTIL")); if ((Object)(object)val2 != (Object)null) { val2.activationState = new SerializableEntityStateType(typeof(UtilityDispatcher)); val2.activationStateMachineName = "Body"; val2.baseMaxStock = 3; val2.stockToConsume = 0; val2.beginSkillCooldownOnSkillEnd = true; val2.mustKeyPress = true; } SkillDef val3 = SkillCatalog.allSkillDefs.FirstOrDefault((Func<SkillDef, bool>)((SkillDef sd) => sd.skillNameToken == "BASTIAN_SPEC")); if ((Object)(object)val3 != (Object)null) { val3.activationState = new SerializableEntityStateType(typeof(SpecialDispatcher)); val3.activationStateMachineName = "Body"; val3.baseMaxStock = 1; val3.stockToConsume = 0; val3.beginSkillCooldownOnSkillEnd = true; val3.mustKeyPress = true; } }); } private void Start() { ((BaseUnityPlugin)this).Logger.LogInfo((object)"[BastianPatch] Calling Apply() in Start()"); BastianOverrides.Apply(); } } [HarmonyPatch(typeof(BlastDamageBuildupController), "FillChargeAuthority")] public static class BlastChargePatch { private static bool Prefix(BlastDamageBuildupController __instance) { CharacterBody component = ((Component)__instance).GetComponent<CharacterBody>(); if ((Object)(object)component == (Object)null) { return true; } SkillLocator skillLocator = component.skillLocator; if ((Object)(object)skillLocator == (Object)null || (Object)(object)skillLocator.special == (Object)null) { return true; } if (skillLocator.special.cooldownRemaining > 0f) { return false; } return true; } } public class HoldSecondary : BaseSkillState { public static GameObject muzzleflash; public static GameObject tracer; public static GameObject bulletImpact; public static float baseDamageCoefficient = 2f; public static float sacrificePercent = 0.15f; public static float sacrificeScaling = 0.007f; private float duration; private bool hasFired; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = 0.5f / ((BaseState)this).attackSpeedStat; Debug.Log((object)"[BastianPatch] Entered HoldSecondary state!"); if ((Object)(object)((EntityState)this).skillLocator?.secondary != (Object)null && ((EntityState)this).skillLocator.secondary.stock > 0) { ((EntityState)this).skillLocator.secondary.DeductStock(1); } ((EntityState)this).PlayAnimation("Gesture, Aimed", "Shoot", "M2", duration, 0f); ((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty"); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!hasFired && ((EntityState)this).fixedAge >= 0.1f * duration) { hasFired = true; FireEmpoweredBullet(); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void FireEmpoweredBullet() { //IL_007b: 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_0087: 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_0093: 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_00b0: Expected O, but got Unknown //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0104: 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_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0120: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0137: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_0164: Unknown result type (might be due to invalid IL or missing references) //IL_016f: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_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_019a: Expected O, but got Unknown //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01ad: Expected O, but got Unknown Util.PlaySound("Play_Bastian_Fire", ((EntityState)this).gameObject); EffectManager.SimpleMuzzleFlash(muzzleflash, ((EntityState)this).gameObject, "fingerMuzzle", false); CharacterBody characterBody = ((EntityState)this).characterBody; if ((Object)(object)((characterBody != null) ? characterBody.healthComponent : null) == (Object)null) { return; } float num = ((EntityState)this).characterBody.healthComponent.health * sacrificePercent; ((EntityState)this).characterBody.healthComponent.TakeDamage(new DamageInfo { damage = num, damageType = DamageTypeCombo.op_Implicit((DamageType)1), attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject }); float num2 = num * sacrificeScaling; float num3 = baseDamageCoefficient + num2; float finalDamage = num3 * ((BaseState)this).damageStat; Ray aimRay = ((BaseState)this).GetAimRay(); bool crit = ((BaseState)this).RollCrit(); if (!((EntityState)this).isAuthority) { return; } BulletAttack val = new BulletAttack { owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, origin = ((Ray)(ref aimRay)).origin, aimVector = ((Ray)(ref aimRay)).direction, damage = finalDamage, isCrit = crit, tracerEffectPrefab = tracer, hitEffectPrefab = bulletImpact, muzzleName = "fingerMuzzle", force = 150f, procCoefficient = 0.6f, maxDistance = 100f, radius = 1f, falloffModel = (FalloffModel)0 }; val.hitCallback = (HitCallback)delegate(BulletAttack ba, ref BulletHit hitInfo) { if (Object.op_Implicit((Object)(object)hitInfo.hitHurtBox)) { RicochetHandler.HandleRicochet(((EntityState)this).characterBody, hitInfo.hitHurtBox, finalDamage, crit, null); } return BulletAttack.defaultHitCallback.Invoke(ba, ref hitInfo); }; 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)1; } } public class HoldSpecial : BaseSkillState { public float charge; public static float sacrificePercent = 0.75f; public static float baseDamageCoefficient = 5f; public static float ionScaling = 0.4f; public static float sacrificeScaling = 0.01f; private float duration = 0.35f; private float fireDelay; private bool hasFired; public override void OnEnter() { ((BaseState)this).OnEnter(); if ((Object)(object)((EntityState)this).skillLocator != (Object)null && (Object)(object)((EntityState)this).skillLocator.special != (Object)null) { ((EntityState)this).skillLocator.special.DeductStock(1); } duration /= ((BaseState)this).attackSpeedStat; fireDelay = duration * 0.16f; ((EntityState)this).PlayCrossfade("FullBody, Override", "Release", "Special", duration, duration * 0.1f); } public override void FixedUpdate() { //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_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_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) //IL_00a9: 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_00c6: Expected O, but got Unknown //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_013f: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0163: Unknown result type (might be due to invalid IL or missing references) //IL_0168: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_0187: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_018e: 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_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01d2: Unknown result type (might be due to invalid IL or missing references) //IL_01e3: Expected O, but got Unknown ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge < fireDelay && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } if (((EntityState)this).fixedAge >= fireDelay && !hasFired) { hasFired = true; if (((EntityState)this).isAuthority) { float num = ((EntityState)this).characterBody.healthComponent.health * sacrificePercent; ((EntityState)this).characterBody.healthComponent.TakeDamage(new DamageInfo { damage = num, damageType = DamageTypeCombo.op_Implicit((DamageType)1), attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject }); BlastDamageBuildupController component = ((Component)((EntityState)this).characterBody).GetComponent<BlastDamageBuildupController>(); int num2 = 0; if ((Object)(object)component != (Object)null) { num2 = Mathf.FloorToInt(component.charge); component.charge = 0f; component.SyncCheckBuffs(0f); } float num3 = baseDamageCoefficient + (float)num2 * ionScaling; float num4 = num * sacrificeScaling; float num5 = num3 + num4; float baseDamage = num5 * ((BaseState)this).damageStat; new BlastAttack { attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, teamIndex = ((EntityState)this).teamComponent.teamIndex, baseDamage = baseDamage, radius = 75f, position = ((EntityState)this).characterBody.corePosition, falloffModel = (FalloffModel)0, procCoefficient = 1f }.Fire(); if ((Object)(object)Plugin.ExplosionEffectPrefab != (Object)null) { EffectManager.SpawnEffect(Plugin.ExplosionEffectPrefab, new EffectData { origin = ((EntityState)this).characterBody.corePosition, scale = 75f }, true); } ((BaseState)this).SmallHop(((EntityState)this).characterMotor, ((EntityState)this).characterBody.jumpPower); } } 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; } } internal class HoldSpecialStart : BaseSkillState { private float duration = 1f; private AimRequest aimRequest; private bool success; private float charge; public override void OnEnter() { //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_007e: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration /= ((BaseState)this).attackSpeedStat; ((EntityState)this).PlayAnimation("FullBody, Override", "Charge", "Special", duration, 0f); AkSoundEngine.PostEvent(Plugin.DashFastEventId, ((EntityState)this).gameObject); Transform val = ((BaseState)this).FindModelChild("center"); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)Plugin.ExplosionEffectPrefab)) { Object.Instantiate<GameObject>(Plugin.ExplosionEffectPrefab, val.position, Quaternion.identity, val); } if ((Object)(object)((EntityState)this).cameraTargetParams != (Object)null) { aimRequest = ((EntityState)this).cameraTargetParams.RequestAimType((AimType)2); } if ((Object)(object)((EntityState)this).characterMotor != (Object)null) { ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f); ((BaseState)this).SmallHop(((EntityState)this).characterMotor, 16f); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).isAuthority) { ((EntityState)this).characterMotor.velocity.y += 11f * Time.deltaTime; } if (((EntityState)this).fixedAge >= duration) { success = true; if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextState((EntityState)(object)new HoldSpecial { charge = charge }); } } } public override void OnExit() { ((EntityState)this).OnExit(); AimRequest obj = aimRequest; if (obj != null) { obj.Dispose(); } if (!success) { ((EntityState)this).PlayAnimation("FullBody, Override", "BufferEmpty"); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } public override void OnSerialize(NetworkWriter writer) { ((BaseSkillState)this).OnSerialize(writer); writer.Write(charge); } public override void OnDeserialize(NetworkReader reader) { ((BaseSkillState)this).OnDeserialize(reader); charge = reader.ReadSingle(); } } internal class HoldUtilityDash : BaseSkillState { private Vector3 dashVector; private float duration = 0.35f; private bool appliedEffects; private bool stoppedEarly; public static float sacrificePercent = 0.25f; public static float sacrificeScaling = 0.01f; public static float baseDamageCoefficient = 5f; public override void OnEnter() { //IL_008e: Unknown result type (might be due to invalid IL or missing references) //IL_0093: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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) ((BaseState)this).OnEnter(); if ((Object)(object)((EntityState)this).skillLocator?.utility != (Object)null) { ((EntityState)this).skillLocator.utility.DeductStock(1); } ((EntityState)this).PlayAnimation("FullBody, Override", "Dash", "Utility", duration * 3f, 0f); if (NetworkServer.active && (Object)(object)Plugin.HiddenInvincibility != (Object)null) { ((EntityState)this).characterBody.AddBuff(Plugin.HiddenInvincibility); } Vector3 aimDirection = ((EntityState)this).inputBank.aimDirection; dashVector = ((Vector3)(ref aimDirection)).normalized; } public override void FixedUpdate() { //IL_002e: 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_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_0060: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Unknown result type (might be due to invalid IL or missing references) //IL_0077: 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_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0089: Unknown result type (might be due to invalid IL or missing references) //IL_008e: 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) ((EntityState)this).FixedUpdate(); if (!stoppedEarly && (Object)(object)((EntityState)this).characterMotor != (Object)null) { CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.rootMotion += dashVector * (((BaseState)this).moveSpeedStat * EvisDash.speedCoefficient * Time.fixedDeltaTime); Vector3 position = ((EntityState)this).transform.position; Vector3 val = dashVector; LayerIndex val2 = LayerIndex.world; int num = LayerMask.op_Implicit(((LayerIndex)(ref val2)).mask); val2 = LayerIndex.entityPrecise; RaycastHit val3 = default(RaycastHit); if (Physics.SphereCast(position, 1f, val, ref val3, 1.5f, num | LayerMask.op_Implicit(((LayerIndex)(ref val2)).mask))) { stoppedEarly = true; } } if (!appliedEffects && (((EntityState)this).fixedAge >= duration || stoppedEarly) && ((EntityState)this).isAuthority) { appliedEffects = true; DoEmpoweredEffects(); } if ((((EntityState)this).fixedAge >= duration || stoppedEarly) && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void DoEmpoweredEffects() { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown //IL_0072: 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_0083: Unknown result type (might be due to invalid IL or missing references) //IL_008f: Unknown result type (might be due to invalid IL or missing references) //IL_0096: 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_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: 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_011a: Expected O, but got Unknown //IL_01c7: Unknown result type (might be due to invalid IL or missing references) //IL_01eb: Unknown result type (might be due to invalid IL or missing references) //IL_01f6: Unknown result type (might be due to invalid IL or missing references) float num = ((EntityState)this).characterBody.healthComponent.health * sacrificePercent; ((EntityState)this).characterBody.healthComponent.TakeDamage(new DamageInfo { damage = num, damageType = DamageTypeCombo.op_Implicit((DamageType)1), attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject }); float num2 = num * sacrificeScaling; float num3 = baseDamageCoefficient + num2; float baseDamage = num3 * ((BaseState)this).damageStat; new BlastAttack { attacker = ((EntityState)this).gameObject, inflictor = ((EntityState)this).gameObject, teamIndex = ((EntityState)this).teamComponent.teamIndex, baseDamage = baseDamage, radius = 20f, position = ((EntityState)this).characterBody.corePosition, falloffModel = (FalloffModel)0, procCoefficient = 0.6f }.Fire(); if ((Object)(object)Plugin.ExplosionEffectPrefab != (Object)null) { EffectManager.SpawnEffect(Plugin.ExplosionEffectPrefab, new EffectData { origin = ((EntityState)this).characterBody.corePosition, scale = 20f }, true); } ((EntityState)this).PlayCrossfade("FullBody, Override", "Release", "Special", 0.35f, 0.1f); ((BaseState)this).SmallHop(((EntityState)this).characterMotor, ((EntityState)this).characterBody.jumpPower); BlastDamageBuildupController component = ((Component)((EntityState)this).characterBody).GetComponent<BlastDamageBuildupController>(); if (!((Object)(object)component != (Object)null) || !(component.charge >= 15f)) { return; } component.charge -= 15f; component.SyncCheckBuffs(component.charge); if (!((Object)(object)Plugin.SpeedBuff != (Object)null)) { return; } foreach (TeamComponent teamMember in TeamComponent.GetTeamMembers(((EntityState)this).teamComponent.teamIndex)) { if (Vector3.Distance(teamMember.body.corePosition, ((EntityState)this).characterBody.corePosition) <= 20f) { teamMember.body.AddTimedBuff(Plugin.SpeedBuff, 10f); } } } public override void OnExit() { if (NetworkServer.active && (Object)(object)Plugin.HiddenInvincibility != (Object)null) { ((EntityState)this).characterBody.RemoveBuff(Plugin.HiddenInvincibility); } ((EntityState)this).OnExit(); } } internal class HoldUtilityStart : BaseState { private float duration = 0.29f; public override void OnEnter() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration /= base.attackSpeedStat; if ((Object)(object)((EntityState)this).characterMotor != (Object)null) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } ((EntityState)this).PlayAnimation("FullBody, Override", "Dash Windup", "Utility", duration, 0f); if (Plugin.DashFastEventId != 0) { AkSoundEngine.PostEvent(Plugin.DashFastEventId, ((EntityState)this).gameObject); } ((EntityState)this).characterBody.SetAimTimer(0f); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextState((EntityState)(object)new HoldUtilityDash()); } } } public static class RicochetHandler { private static ConfigEntry<int> MaxBounces; private static ConfigEntry<float> BounceRadius; private static ConfigEntry<int> ChargeCostPerBounce; private static readonly GameObject Tracer = (GameObject)AccessTools.Field(AccessTools.TypeByName("Bastian.Prefabs"), "tracer").GetValue(null); public static void InitConfig(ConfigFile config) { MaxBounces = config.Bind<int>("Ricochet", "MaxBounces", 5, "Maximum number of ricochet bounces"); BounceRadius = config.Bind<float>("Ricochet", "BounceRadius", 40f, "Maximum distance (meters) to search for the next ricochet target"); ChargeCostPerBounce = config.Bind<int>("Ricochet", "ChargeCostPerBounce", 2, "Ion charges consumed per ricochet bounce"); } public static void HandleRicochet(CharacterBody attackerBody, HurtBox initialTarget, float baseDamage, bool isCrit, object damageTypeCombo) { //IL_00de: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00f0: 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_0118: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013e: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) //IL_0152: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0165: 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_0173: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_017f: Unknown result type (might be due to invalid IL or missing references) //IL_0181: Unknown result type (might be due to invalid IL or missing references) //IL_0186: Unknown result type (might be due to invalid IL or missing references) //IL_018b: 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_0192: 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_01ae: Unknown result type (might be due to invalid IL or missing references) //IL_01bb: Expected O, but got Unknown //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_01d5: Unknown result type (might be due to invalid IL or missing references) //IL_01da: Unknown result type (might be due to invalid IL or missing references) //IL_01e2: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f5: Unknown result type (might be due to invalid IL or missing references) //IL_01fa: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Expected O, but got Unknown BlastDamageBuildupController component = ((Component)attackerBody).GetComponent<BlastDamageBuildupController>(); if ((Object)(object)component == (Object)null) { return; } int num = (int)component.charge; int num2 = Mathf.Min(MaxBounces.Value, num / ChargeCostPerBounce.Value); if (num2 <= 0) { return; } HashSet<HurtBox> hashSet = new HashSet<HurtBox> { initialTarget }; HurtBox val = initialTarget; for (int i = 0; i < num2; i++) { HurtBox val2 = FindNextTarget(val, hashSet, BounceRadius.Value); if ((Object)(object)val2 == (Object)null) { break; } component.charge -= (float)ChargeCostPerBounce.Value; if (component.charge < 0f) { component.charge = 0f; } component.SyncCheckBuffs(component.charge); hashSet.Add(val2); DamageType val3 = (DamageType)0; if (damageTypeCombo is DamageTypeCombo val4) { val3 = val4.damageType; } Vector3 val5 = ((Component)val2).transform.position - ((Component)val).transform.position; Vector3 normalized = ((Vector3)(ref val5)).normalized; BulletAttack val6 = new BulletAttack { owner = ((Component)attackerBody).gameObject, weapon = ((Component)attackerBody).gameObject, origin = ((Component)val).transform.position, aimVector = normalized, damage = baseDamage, isCrit = isCrit, procCoefficient = 0.6f, damageType = DamageTypeCombo.op_Implicit(val3), falloffModel = (FalloffModel)0, maxDistance = BounceRadius.Value, radius = 1f, tracerEffectPrefab = Tracer }; val6.Fire(); if ((Object)(object)Tracer != (Object)null) { EffectData val7 = new EffectData { origin = ((Component)val).transform.position, start = ((Component)val2).transform.position }; val7.SetHurtBoxReference(val2); EffectManager.SpawnEffect(Tracer, val7, true); } val = val2; } } private static HurtBox FindNextTarget(HurtBox from, HashSet<HurtBox> alreadyHit, float radius) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_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_0017: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004b: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_0058: Expected O, but got Unknown BullseyeSearch val = new BullseyeSearch { searchOrigin = ((Component)from).transform.position, searchDirection = Vector3.zero, maxDistanceFilter = radius, teamMaskFilter = TeamMask.GetEnemyTeams(from.healthComponent.body.teamComponent.teamIndex), sortMode = (SortMode)1, filterByLoS = false }; val.RefreshCandidates(); List<HurtBox> list = val.GetResults().ToList(); if (list.Count <= 1) { return null; } foreach (HurtBox item in list) { if (!alreadyHit.Contains(item)) { return item; } } foreach (HurtBox item2 in list) { if ((Object)(object)item2 != (Object)(object)from) { return item2; } } return null; } } public class SecondaryDispatcher : BaseSkillState { private bool transitioned; public static float HoldThreshold = 0.25f; public override void OnEnter() { ((BaseState)this).OnEnter(); transitioned = false; Debug.Log((object)"[BastianPatch] Entered SecondaryDispatcher state!"); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!transitioned) { if (!((EntityState)this).inputBank.skill2.down) { Debug.Log((object)"[BastianPatch] Branching to TapSecondary"); ((EntityState)this).outer.SetNextState((EntityState)(object)new TapSecondary()); transitioned = true; } else if (((EntityState)this).fixedAge >= HoldThreshold) { Debug.Log((object)"[BastianPatch] Branching to HoldSecondary"); ((EntityState)this).outer.SetNextState((EntityState)(object)new HoldSecondary()); transitioned = true; } } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } public class SpecialDispatcher : BaseSkillState { private float pressStartTime; private bool transitioned; public static float HoldThreshold = 0.2f; public override void OnEnter() { ((BaseState)this).OnEnter(); pressStartTime = Time.time; transitioned = false; Debug.Log((object)"[BastianPatch] Entered SpecialDispatcher state!"); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!transitioned) { if (!((EntityState)this).inputBank.skill4.down) { Debug.Log((object)"[BastianPatch] Branching to TapSpecial"); ((EntityState)this).outer.SetNextState((EntityState)(object)new TapSpecial()); transitioned = true; } else if (Time.time - pressStartTime >= HoldThreshold) { Debug.Log((object)"[BastianPatch] Branching to HoldSpecialStart"); ((EntityState)this).outer.SetNextState((EntityState)(object)new HoldSpecialStart()); transitioned = true; } } } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } public class TapSecondary : BaseSkillState { public static GameObject muzzleflash; public static GameObject tracer; public static GameObject bulletImpact; public static float damageCoefficient = 2f; private float duration; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = 0.5f / ((BaseState)this).attackSpeedStat; Debug.Log((object)"[BastianPatch] Entered TapSecondary state!"); if (Object.op_Implicit((Object)(object)((EntityState)this).skillLocator) && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.secondary)) { ((EntityState)this).skillLocator.secondary.DeductStock(1); } ((EntityState)this).PlayAnimation("Gesture, Aimed", "Shoot", "M2", duration, 0f); ((EntityState)this).PlayAnimation("Gesture, Override", "BufferEmpty"); FireBullet(); ((EntityState)this).outer.SetNextStateToMain(); } private void FireBullet() { //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_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_005b: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0068: Unknown result type (might be due to invalid IL or missing references) //IL_006b: 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_0088: Unknown result type (might be due to invalid IL or missing references) //IL_0094: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00c0: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d7: 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_00e4: Unknown result type (might be due to invalid IL or missing references) Util.PlaySound("Play_Bastian_Fire", ((EntityState)this).gameObject); EffectManager.SimpleMuzzleFlash(muzzleflash, ((EntityState)this).gameObject, "fingerMuzzle", false); Ray aimRay = ((BaseState)this).GetAimRay(); if (((EntityState)this).isAuthority) { new BulletAttack { owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, origin = ((Ray)(ref aimRay)).origin, aimVector = ((Ray)(ref aimRay)).direction, damage = damageCoefficient * ((BaseState)this).damageStat, isCrit = ((BaseState)this).RollCrit(), tracerEffectPrefab = tracer, hitEffectPrefab = bulletImpact, muzzleName = "fingerMuzzle", force = 150f, procCoefficient = 0.6f, maxDistance = 100f, radius = 1f, falloffModel = (FalloffModel)0 }.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)1; } } public class TapSpecial : BaseSkillState { public static float healPerStack = 0.01f; public override void OnEnter() { //IL_00cf: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_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_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); if ((Object)(object)((EntityState)this).skillLocator?.special != (Object)null) { ((EntityState)this).skillLocator.special.DeductStock(1); } BlastDamageBuildupController component = ((Component)((EntityState)this).characterBody).GetComponent<BlastDamageBuildupController>(); if ((Object)(object)component != (Object)null && component.charge > 0f) { int num = Mathf.FloorToInt(component.charge); component.charge = 0f; component.SyncCheckBuffs(0f); CharacterBody characterBody = ((EntityState)this).characterBody; if ((Object)(object)((characterBody != null) ? characterBody.healthComponent : null) != (Object)null) { float num2 = ((EntityState)this).characterBody.healthComponent.fullHealth * healPerStack * (float)num; ((EntityState)this).characterBody.healthComponent.Heal(num2, default(ProcChainMask), true); } if ((Object)(object)Plugin.SpeedBuff != (Object)null) { ((EntityState)this).characterBody.AddTimedBuff(Plugin.SpeedBuff, 10f); } if ((Object)(object)Plugin.ExplosionEffectPrefab != (Object)null) { GameObject val = Object.Instantiate<GameObject>(Plugin.ExplosionEffectPrefab, ((EntityState)this).characterBody.corePosition, Quaternion.identity); val.transform.localScale = Vector3.one * 10f; val.AddComponent<ImplodeEffect>(); } } ((EntityState)this).outer.SetNextStateToMain(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } public class ImplodeEffect : MonoBehaviour { private float lifetime = 0.5f; private float age; private Vector3 startScale; private void Start() { //IL_0007: 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) startScale = ((Component)this).transform.localScale; } private void Update() { //IL_0028: 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_0033: Unknown result type (might be due to invalid IL or missing references) age += Time.deltaTime; float num = age / lifetime; ((Component)this).transform.localScale = Vector3.Lerp(startScale, Vector3.zero, num); if (age >= lifetime) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } internal class TapUtilityDash : BaseSkillState { private Vector3 dashVector; private float duration = 0.35f; private readonly float stunRadius = 5f; public override void OnEnter() { //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) ((BaseState)this).OnEnter(); if ((Object)(object)((EntityState)this).skillLocator != (Object)null && (Object)(object)((EntityState)this).skillLocator.utility != (Object)null) { ((EntityState)this).skillLocator.utility.DeductStock(1); } ((EntityState)this).PlayAnimation("FullBody, Override", "Dash", "Utility", duration * 3f, 0f); if (NetworkServer.active && (Object)(object)Plugin.HiddenInvincibility != (Object)null) { ((EntityState)this).characterBody.AddBuff(Plugin.HiddenInvincibility); } dashVector = ((EntityState)this).inputBank.aimDirection; } public override void FixedUpdate() { //IL_001f: 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_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_005e: Unknown result type (might be due to invalid IL or missing references) //IL_0069: 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_0071: 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_00dd: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if ((Object)(object)((EntityState)this).characterMotor != (Object)null) { CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.rootMotion += dashVector * (((BaseState)this).moveSpeedStat * EvisDash.speedCoefficient * Time.fixedDeltaTime); } if (NetworkServer.active) { Vector3 position = ((EntityState)this).transform.position; float num = stunRadius; LayerIndex entityPrecise = LayerIndex.entityPrecise; Collider[] array = Physics.OverlapSphere(position, num, LayerMask.op_Implicit(((LayerIndex)(ref entityPrecise)).mask)); Collider[] array2 = array; foreach (Collider val in array2) { HurtBox component = ((Component)val).GetComponent<HurtBox>(); if ((Object)(object)component != (Object)null && (Object)(object)component.healthComponent != (Object)null && component.healthComponent.alive) { TeamMask enemyTeams = TeamMask.GetEnemyTeams(((EntityState)this).teamComponent.teamIndex); if (((TeamMask)(ref enemyTeams)).HasTeam(component.healthComponent.body.teamComponent.teamIndex)) { SetStateOnHurt.SetStunOnObject(((Component)component.healthComponent).gameObject, 1f); } } } } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).PlayCrossfade("FullBody, Override", "Release", "Special", 0.35f, 0.1f); ((BaseState)this).SmallHop(((EntityState)this).characterMotor, ((EntityState)this).characterBody.jumpPower * 0.5f); ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (NetworkServer.active && (Object)(object)Plugin.HiddenInvincibility != (Object)null) { ((EntityState)this).characterBody.RemoveBuff(Plugin.HiddenInvincibility); } ((EntityState)this).OnExit(); } } internal class TapUtilityStart : BaseState { private float duration = 0.29f; public override void OnEnter() { //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration /= base.attackSpeedStat; if ((Object)(object)((EntityState)this).characterMotor != (Object)null) { ((EntityState)this).characterMotor.velocity = Vector3.zero; } ((EntityState)this).PlayAnimation("FullBody, Override", "Dash Windup", "Utility", duration, 0f); if (Plugin.DashFastEventId != 0) { AkSoundEngine.PostEvent(Plugin.DashFastEventId, ((EntityState)this).gameObject); } ((EntityState)this).characterBody.SetAimTimer(0f); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextState((EntityState)(object)new TapUtilityDash()); } } } public class UtilityDispatcher : BaseSkillState { private float pressStartTime; private bool transitioned; public static float HoldThreshold = 0.25f; public override void OnEnter() { ((BaseState)this).OnEnter(); pressStartTime = Time.time; transitioned = false; Debug.Log((object)"[BastianPatch] Entered UtilityDispatcher state!"); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (!transitioned) { if (!((EntityState)this).inputBank.skill3.down) { Debug.Log((object)"[BastianPatch] Branching to TapUtilityStart"); ((EntityState)this).outer.SetNextState((EntityState)(object)new TapUtilityStart()); transitioned = true; } else if (Time.time - pressStartTime >= HoldThreshold) { Debug.Log((object)"[BastianPatch] Branching to HoldUtilityStart"); ((EntityState)this).outer.SetNextState((EntityState)(object)new HoldUtilityStart()); transitioned = true; } } } 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; } }