Decompiled source of Pathfinder v0.5.3
plugins/Pathfinder.dll
Decompiled 2 months 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 BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using EntityStates; using EntityStates.Commando; using EntityStates.Commando.CommandoWeapon; using EntityStates.Croco; using EntityStates.Drone.DroneWeapon; using EntityStates.Engi.EngiMissilePainter; using EntityStates.Engi.EngiWeapon; using EntityStates.Loader; using EntityStates.Merc; using HG; using HG.BlendableTypes; using HarmonyLib; using JetBrains.Annotations; using KinematicCharacterController; using On.RoR2; using Pathfinder; using Pathfinder.Components; using Pathfinder.Modules; using Pathfinder.Modules.Characters; using Pathfinder.Modules.CustomSkillDefs; using Pathfinder.Modules.NPC; using Pathfinder.Modules.Survivors; using R2API; using R2API.Utils; using RoR2; using RoR2.Achievements; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.HudOverlay; using RoR2.Orbs; using RoR2.Projectile; using RoR2.Skills; using RoR2.UI; using Skillstates.Pathfinder; using Skillstates.Pathfinder.Command; using Skillstates.Squall; using TMPro; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; using UnityEngine.Rendering; using UnityEngine.UI; [assembly: AssemblyTitle("Pathfinder")] [assembly: AssemblyProduct("Pathfinder")] [assembly: AssemblyInformationalVersion("1.0.0+c3fa3f4ac8ac1d1c3ecf08bf4bc46abc2dd94ef7")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyCompany("Pathfinder")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: CompilationRelaxations(8)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: UnverifiableCode] namespace Skillstates.Pathfinder { internal class AimBolas : AimThrowableBase { public static float loopDuration = 0.4f; public static float throwForce = 60f; private GameObject bolas; private string javReady = ""; private OverrideController controller; private ChildLocator childLocator; public override void OnEnter() { controller = ((EntityState)this).GetComponent<OverrideController>(); if (controller.javelinReady) { javReady = "Jav"; } bolas = ((Component)((BaseState)this).FindModelChild("Bolas")).gameObject; bolas.SetActive(true); ((EntityState)this).PlayAnimation("Gesture, Override", javReady + "BolasLoop", "Hand.playbackRate", loopDuration, 0f); base.projectilePrefab = Projectiles.shockBolas; base.arcVisualizerPrefab = PathfinderAssets.lineVisualizer; base.endpointVisualizerPrefab = PathfinderAssets.explosionVisualizer; base.endpointVisualizerRadiusScale = 18f; base.detonationRadius = 18f; base.damageCoefficient = 0f; base.setFuse = false; base.projectileBaseSpeed = 200f; base.maxDistance = float.PositiveInfinity; ((AimThrowableBase)this).OnEnter(); base.minimumDuration = 0.1f; } public override void FixedUpdate() { ((BaseState)this).StartAimMode(0.1f, false); ((AimThrowableBase)this).FixedUpdate(); } public override void OnExit() { ((EntityState)this).PlayAnimation("Gesture, Override", javReady + "BolasThrow", "Hand.playbackRate", loopDuration, 0f); bolas.SetActive(false); ((AimThrowableBase)this).OnExit(); } } internal class Evade : BaseState { public static float baseDuration = 0.2f; public static float speedCoefficient = 12f; public static float flatBonus = 65f; private float bonusFromMovespeed; private float totalDashBonus; public static SkillDef javelinSkill; private OverrideController controller; private GameObject dustPrefab; private Vector3 dashVector; public override void OnEnter() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //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_0074: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_00aa: 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_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c8: Unknown result type (might be due to invalid IL or missing references) //IL_00cd: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Expected O, but got Unknown ((BaseState)this).OnEnter(); controller = ((EntityState)this).GetComponent<OverrideController>(); Vector3 val = ((((EntityState)this).inputBank.moveVector == Vector3.zero) ? ((EntityState)this).characterDirection.forward : ((EntityState)this).inputBank.moveVector); dashVector = ((Vector3)(ref val)).normalized; ((EntityState)this).characterDirection.forward = dashVector; CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.velocity *= 0.1f; Util.PlaySound(SlideState.soundString, ((EntityState)this).gameObject); dustPrefab = Object.Instantiate<GameObject>(SlideState.slideEffectPrefab, ((BaseState)this).FindModelChild("Pathfinder")); EffectData val2 = new EffectData { origin = ((EntityState)this).characterBody.corePosition, rotation = Util.QuaternionSafeLookRotation(dashVector) }; EffectManager.SpawnEffect(PathfinderAssets.dashEffect, val2, false); if (!controller.javelinReady) { ((EntityState)this).PlayAnimation("FullBody, Override", "GroundDashF", "Dash.playbackRate", baseDuration, 0f); controller.ReadyJavelin(); } else { ((EntityState)this).PlayAnimation("FullBody, Override", "JavGroundDash", "Dash.playbackRate", baseDuration, 0f); } if (base.moveSpeedStat <= 0f) { totalDashBonus = 0f; return; } if (base.moveSpeedStat <= ((EntityState)this).characterBody.baseMoveSpeed) { totalDashBonus = flatBonus * (base.moveSpeedStat / ((EntityState)this).characterBody.baseMoveSpeed); return; } float num = base.moveSpeedStat - ((EntityState)this).characterBody.baseMoveSpeed; bonusFromMovespeed = num * ((EntityState)this).characterBody.baseMoveSpeed / base.moveSpeedStat; totalDashBonus = speedCoefficient * bonusFromMovespeed + flatBonus; } public override void FixedUpdate() { //IL_001a: 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_0032: 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_0047: Unknown result type (might be due to invalid IL or missing references) //IL_004c: Unknown result type (might be due to invalid IL or missing references) //IL_0051: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority) { ((EntityState)this).characterDirection.forward = dashVector; CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.rootMotion += dashVector * totalDashBonus * Time.fixedDeltaTime; ((EntityState)this).characterMotor.velocity.y = 0f; } if (((EntityState)this).fixedAge >= baseDuration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { if (Object.op_Implicit((Object)(object)dustPrefab)) { Object.Destroy((Object)(object)dustPrefab); } ((EntityState)this).PlayCrossfade("FullBody, Override", "BufferEmpty", 0.2f); ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)3; } } internal class JavelinToss : BaseState { private Animator animator; private ChildLocator childLocator; private GameObject shaft; private GameObject spearhead; private GameObject shaftBone; private Ray aimRay; private OverrideController controller; private float fireTime; private float throwForce = 150f; private bool hasFired = false; public static float baseDuration = 0.8f; public float duration; public override void OnEnter() { //IL_0059: 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) ((BaseState)this).OnEnter(); duration = baseDuration / base.attackSpeedStat; fireTime = duration * 0.15f; ((BaseState)this).StartAimMode(baseDuration + 0.1f, true); controller = ((EntityState)this).GetComponent<OverrideController>(); animator = ((EntityState)this).GetModelAnimator(); aimRay = ((BaseState)this).GetAimRay(); childLocator = ((EntityState)this).GetModelChildLocator(); shaft = ((Component)childLocator.FindChild("Shaft")).gameObject; shaftBone = ((Component)childLocator.FindChild("ShaftBone")).gameObject; spearhead = ((Component)childLocator.FindChild("Spearhead")).gameObject; if (Object.op_Implicit((Object)(object)animator)) { if (!animator.GetBool("isMoving") && animator.GetBool("isGrounded")) { ((EntityState)this).PlayAnimation("FullBody, Override", "JavelinToss", "Hand.playbackRate", duration, 0f); } else { ((EntityState)this).PlayAnimation("Gesture, Override", "JavelinToss", "Hand.playbackRate", duration, 0f); } } controller.UnreadyJavelin(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= fireTime && !hasFired) { shaft.SetActive(false); shaftBone.SetActive(false); spearhead.SetActive(false); if (((EntityState)this).isAuthority) { FireJavelin(); } } if (((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } private void FireJavelin() { //IL_001b: 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_006d: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007f: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) hasFired = true; Util.PlaySound(FireMines.throwMineSoundString, ((EntityState)this).gameObject); FireProjectileInfo val = default(FireProjectileInfo); val.crit = ((BaseState)this).RollCrit(); val.damage = Config.JavelinDamage.Value * base.damageStat; val.force = throwForce; val.owner = ((EntityState)this).gameObject; val.position = ((Ray)(ref aimRay)).origin; val.rotation = Util.QuaternionSafeLookRotation(((Ray)(ref aimRay)).direction); val.projectilePrefab = Projectiles.explodingJavelin; ProjectileManager.instance.FireProjectile(val); } public override void OnExit() { shaft.SetActive(true); shaftBone.SetActive(true); spearhead.SetActive(true); ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } internal class RendingTalons : BaseState { private Animator animator; private Vector3 flipVector; private OverrideController controller; private GameObject spearTrail; private OverlapAttack airSpinAttack; private OverlapAttack groundSpinAttack; public static float flipBaseDuration = 0.3f; public static float spinBaseDuration = 0.7f; public static float forwardVelocity = 1.2f; public static float upwardVelocity = 25f; private float previousAirControl; private bool isCrit; private bool airFlipFinished; private float flipStopwatch; private float flipDuration; private float spinStopwatch; private float spinDuration; private float spinFinishTime; private string javString = ""; public override void OnEnter() { //IL_0104: 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_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0128: Unknown result type (might be due to invalid IL or missing references) //IL_012d: Unknown result type (might be due to invalid IL or missing references) //IL_018a: Unknown result type (might be due to invalid IL or missing references) //IL_0190: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a5: Unknown result type (might be due to invalid IL or missing references) //IL_01aa: Unknown result type (might be due to invalid IL or missing references) //IL_01af: Unknown result type (might be due to invalid IL or missing references) //IL_0201: Unknown result type (might be due to invalid IL or missing references) //IL_020b: Expected O, but got Unknown //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_0255: Unknown result type (might be due to invalid IL or missing references) //IL_025a: Unknown result type (might be due to invalid IL or missing references) //IL_0276: Unknown result type (might be due to invalid IL or missing references) //IL_027b: Unknown result type (might be due to invalid IL or missing references) //IL_02c4: Unknown result type (might be due to invalid IL or missing references) //IL_02ce: Expected O, but got Unknown //IL_02f8: Unknown result type (might be due to invalid IL or missing references) //IL_02fd: Unknown result type (might be due to invalid IL or missing references) //IL_0319: Unknown result type (might be due to invalid IL or missing references) //IL_031e: Unknown result type (might be due to invalid IL or missing references) //IL_033a: Unknown result type (might be due to invalid IL or missing references) //IL_033f: Unknown result type (might be due to invalid IL or missing references) //IL_0349: Unknown result type (might be due to invalid IL or missing references) //IL_034e: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); animator = ((EntityState)this).GetModelAnimator(); flipDuration = flipBaseDuration / base.attackSpeedStat; controller = ((EntityState)this).GetComponent<OverrideController>(); spinDuration = spinBaseDuration / base.attackSpeedStat; spinFinishTime = spinDuration * 0.325f; previousAirControl = ((EntityState)this).characterMotor.airControl; ((EntityState)this).characterMotor.airControl = 1f; spearTrail = ((Component)((BaseState)this).FindModelChild("SpearTrail")).gameObject; spearTrail.SetActive(true); animator.SetLayerWeight(animator.GetLayerIndex("AimYaw"), 0f); animator.SetLayerWeight(animator.GetLayerIndex("AimPitch"), 0f); ((EntityState)this).PlayAnimation("FullBody, Override", "AirFlip2", "Flip.playbackRate", flipDuration, 0f); CharacterBody characterBody = ((EntityState)this).characterBody; characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags | 1); ((EntityState)this).characterBody.AddBuff(Buffs.rendingTalonMS); flipVector = ((EntityState)this).inputBank.moveVector; ((BaseState)this).StartAimMode(0.1f, true); ((EntityState)this).characterMotor.velocity.y = 0f; ((BaseCharacterController)((EntityState)this).characterMotor).Motor.ForceUnground(0.1f); ((EntityState)this).characterMotor.velocity.y += upwardVelocity; CharacterMotor characterMotor = ((EntityState)this).characterMotor; characterMotor.velocity += flipVector * base.moveSpeedStat * forwardVelocity; Transform modelTransform = ((EntityState)this).GetModelTransform(); HitBoxGroup hitBoxGroup = null; if (Object.op_Implicit((Object)(object)modelTransform)) { hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Spear"); } isCrit = ((BaseState)this).RollCrit(); airSpinAttack = new OverlapAttack(); airSpinAttack.attacker = ((EntityState)this).gameObject; airSpinAttack.inflictor = ((EntityState)this).gameObject; airSpinAttack.damageType = DamageTypeCombo.op_Implicit((DamageType)0); airSpinAttack.procCoefficient = 1f; airSpinAttack.teamIndex = ((BaseState)this).GetTeam(); airSpinAttack.isCrit = isCrit; airSpinAttack.forceVector = Vector3.zero; airSpinAttack.pushAwayForce = 1f; airSpinAttack.damage = 3.5f * base.damageStat; airSpinAttack.hitBoxGroup = hitBoxGroup; airSpinAttack.hitEffectPrefab = GroundLight.comboHitEffectPrefab; groundSpinAttack = new OverlapAttack(); groundSpinAttack.attacker = ((EntityState)this).gameObject; groundSpinAttack.inflictor = ((EntityState)this).gameObject; groundSpinAttack.damageType = DamageTypeCombo.op_Implicit((DamageType)32); groundSpinAttack.procCoefficient = 1f; groundSpinAttack.teamIndex = ((BaseState)this).GetTeam(); groundSpinAttack.isCrit = isCrit; groundSpinAttack.forceVector = -Vector3.up * 6000f; groundSpinAttack.pushAwayForce = 500f; groundSpinAttack.damage = 8f * base.damageStat; groundSpinAttack.hitBoxGroup = hitBoxGroup; groundSpinAttack.hitEffectPrefab = GroundLight.finisherHitEffectPrefab; } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); ((BaseState)this).StartAimMode(0.1f, false); if (airFlipFinished) { spinStopwatch += Time.fixedDeltaTime; } if (spinStopwatch >= spinDuration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } if (!((EntityState)this).characterMotor.isGrounded && !airFlipFinished && ((EntityState)this).isAuthority) { flipStopwatch += Time.fixedDeltaTime; if (flipStopwatch >= flipDuration) { flipStopwatch = 0f; airSpinAttack.ResetIgnoredHealthComponents(); } airSpinAttack.Fire((List<HurtBox>)null); } if (((EntityState)this).characterMotor.isGrounded && !airFlipFinished && ((EntityState)this).fixedAge >= BaseLeap.minimumDuration) { StartGroundSpin(); } if (airFlipFinished && spinStopwatch <= spinFinishTime && ((EntityState)this).isAuthority) { groundSpinAttack.Fire((List<HurtBox>)null); } else if (spinStopwatch > spinFinishTime) { spearTrail.SetActive(false); } } public void StartGroundSpin() { //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) airFlipFinished = true; ((EntityState)this).characterMotor.velocity = Vector3.zero; if (controller.javelinReady) { javString = "Jav"; } ((EntityState)this).PlayAnimation("FullBody, Override", javString + "SpinSweep", "Flip.playbackRate", spinDuration, 0f); Util.PlayAttackSpeedSound(GroundLight.finisherAttackSoundString, ((EntityState)this).gameObject, GroundLight.slashPitch); } public override void OnExit() { //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_0097: Unknown result type (might be due to invalid IL or missing references) animator.SetLayerWeight(animator.GetLayerIndex("AimYaw"), 1f); animator.SetLayerWeight(animator.GetLayerIndex("AimPitch"), 1f); spearTrail.SetActive(false); ((EntityState)this).characterBody.RemoveBuff(Buffs.rendingTalonMS); ((EntityState)this).characterMotor.airControl = previousAirControl; ((EntityState)this).PlayCrossfade("FullBody, Override", "BufferEmpty", 0.1f); CharacterBody characterBody = ((EntityState)this).characterBody; characterBody.bodyFlags = (BodyFlags)(characterBody.bodyFlags & -2); ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } internal class StrongThrust : BaseState { private Animator animator; private OverlapAttack attack; private OverrideController overrideController; public static float baseDuration = 0.8f; public static float smallHopVelocity = 5.5f; private float duration; private float earlyExitTime; private float fireTime; public bool isCancelling; private bool hasHopped; private bool hasFired; public override void OnEnter() { //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00dd: Expected O, but got Unknown //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0127: Unknown result type (might be due to invalid IL or missing references) //IL_012c: Unknown result type (might be due to invalid IL or missing references) //IL_0148: 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) ((BaseState)this).OnEnter(); duration = baseDuration / base.attackSpeedStat; fireTime = duration * 0.3f; animator = ((EntityState)this).GetModelAnimator(); animator.SetLayerWeight(animator.GetLayerIndex("AimPitch"), 0f); ((EntityState)this).PlayAnimation("Gesture, Override", "Thrust", "Thrust.playbackRate", duration, 0f); overrideController = ((EntityState)this).GetComponent<OverrideController>(); overrideController.UnreadyHeartseeker(); Transform modelTransform = ((EntityState)this).GetModelTransform(); HitBoxGroup hitBoxGroup = null; if (Object.op_Implicit((Object)(object)modelTransform)) { hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Spear"); } attack = new OverlapAttack(); attack.attacker = ((EntityState)this).gameObject; attack.inflictor = ((EntityState)this).gameObject; attack.damageType = DamageTypeCombo.op_Implicit((DamageType)0); attack.procCoefficient = 1f; attack.teamIndex = ((BaseState)this).GetTeam(); attack.isCrit = ((BaseState)this).RollCrit(); attack.forceVector = Vector3.zero; attack.pushAwayForce = 1f; attack.damage = 8f * base.damageStat; attack.hitBoxGroup = hitBoxGroup; attack.hitEffectPrefab = LoaderMeleeAttack.overchargeImpactEffectPrefab; } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); ((BaseState)this).StartAimMode(0.1f, true); if (((EntityState)this).fixedAge >= fireTime && !hasFired && ((EntityState)this).isAuthority) { EffectManager.SimpleMuzzleFlash(PathfinderAssets.thrustEffect, ((EntityState)this).gameObject, "SpearTip", true); Util.PlaySound("PF_Thrust", ((EntityState)this).gameObject); if (attack.Fire((List<HurtBox>)null) && !((EntityState)this).characterMotor.isGrounded && !hasHopped) { ((BaseState)this).SmallHop(((EntityState)this).characterMotor, smallHopVelocity); hasHopped = true; } hasFired = true; } if (((EntityState)this).fixedAge >= earlyExitTime) { animator.SetLayerWeight(animator.GetLayerIndex("AimPitch"), 1f); } if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } internal class Thrust : BaseState { private Animator animator; private OverlapAttack attack; public static float baseDuration = 0.7f; public static float smallHopVelocity = 5.5f; private float duration; private float earlyExitTime; private float fireTime; public bool isCancelling; private bool hasHopped; private bool hasFired; private bool isCrit; public override void OnEnter() { //IL_00ff: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Expected O, but got Unknown //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_0137: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) //IL_0158: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_01c8: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); duration = baseDuration / base.attackSpeedStat; earlyExitTime = duration * 0.67f; fireTime = duration * 0.3f; animator = ((EntityState)this).GetModelAnimator(); animator.SetLayerWeight(animator.GetLayerIndex("AimPitch"), 0f); ((EntityState)this).PlayAnimation("Gesture, Override", "Thrust", "Thrust.playbackRate", duration, 0f); PrimarySkillShurikenBehavior component = ((EntityState)this).GetComponent<PrimarySkillShurikenBehavior>(); if (isCancelling && Object.op_Implicit((Object)(object)component)) { component.OnSkillActivated(((EntityState)this).skillLocator.primary); } Transform modelTransform = ((EntityState)this).GetModelTransform(); HitBoxGroup hitBoxGroup = null; if (Object.op_Implicit((Object)(object)modelTransform)) { hitBoxGroup = Array.Find(((Component)modelTransform).GetComponents<HitBoxGroup>(), (HitBoxGroup element) => element.groupName == "Spear"); } attack = new OverlapAttack(); attack.attacker = ((EntityState)this).gameObject; attack.inflictor = ((EntityState)this).gameObject; attack.damageType = DamageTypeCombo.op_Implicit((DamageType)0); attack.procCoefficient = 1f; attack.teamIndex = ((BaseState)this).GetTeam(); attack.isCrit = ((BaseState)this).RollCrit(); attack.forceVector = Vector3.zero; attack.pushAwayForce = 1f; attack.damage = Config.ThrustDamage.Value * base.damageStat; attack.hitBoxGroup = hitBoxGroup; attack.hitEffectPrefab = null; DamageAPI.AddModdedDamageType(attack, PathfinderPlugin.piercing); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); ((BaseState)this).StartAimMode(0.1f, true); if (((EntityState)this).fixedAge >= fireTime && !hasFired && ((EntityState)this).isAuthority) { EffectManager.SimpleMuzzleFlash(PathfinderAssets.thrustEffect, ((EntityState)this).gameObject, "SpearTip", true); Util.PlaySound("PF_Thrust", ((EntityState)this).gameObject); if (attack.Fire((List<HurtBox>)null) && !((EntityState)this).characterMotor.isGrounded && !hasHopped) { ((BaseState)this).SmallHop(((EntityState)this).characterMotor, smallHopVelocity); hasHopped = true; } hasFired = true; } if (((EntityState)this).fixedAge >= earlyExitTime) { animator.SetLayerWeight(animator.GetLayerIndex("AimPitch"), 1f); } if (((EntityState)this).fixedAge >= earlyExitTime && ((EntityState)this).inputBank.skill1.down && ((EntityState)this).isAuthority && hasFired) { ((EntityState)this).characterBody.isSprinting = false; ((EntityState)this).outer.SetNextState((EntityState)(object)new Thrust { isCancelling = true }); } else if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } } namespace Skillstates.Pathfinder.Command { internal class AttackCommand : BaseIssueCommand { private HurtBox target; private string javString = ""; public override void OnEnter() { base.OnEnter(); target = commandTracker.GetTrackingTarget(); if (overrideController.javelinReady) { javString = "Jav"; } ((EntityState)this).PlayCrossfade("Gesture, Override", javString + "Point", "Hand.playbackRate", duration, 0.1f); falconerComponent.AttackOrder(target); } } internal class BaseIssueCommand : BaseState { protected FalconerComponent falconerComponent; protected OverrideController overrideController; public static float baseDuration = 0.7f; protected float duration; protected CommandTracker commandTracker; public override void OnEnter() { ((BaseState)this).OnEnter(); falconerComponent = ((EntityState)this).GetComponent<FalconerComponent>(); overrideController = ((EntityState)this).GetComponent<OverrideController>(); commandTracker = ((EntityState)this).GetComponent<CommandTracker>(); duration = baseDuration / base.attackSpeedStat; ((BaseState)this).StartAimMode(duration + 0.1f, false); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } internal class CommandMode : BaseState { private CommandTracker tracker; private OverrideController overrideController; private FalconerComponent falconerComponent; private OverlayController overlayController; public override void OnEnter() { //IL_005e: 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) ((BaseState)this).OnEnter(); tracker = ((EntityState)this).GetComponent<CommandTracker>(); overrideController = ((EntityState)this).GetComponent<OverrideController>(); falconerComponent = ((EntityState)this).GetComponent<FalconerComponent>(); tracker.ActivateIndicator(); overrideController.inCommandMode = true; Util.PlaySound(Paint.enterSoundString, ((EntityState)this).gameObject); overlayController = HudOverlayManager.AddOverlay(((EntityState)this).gameObject, new OverlayCreationParams { prefab = PathfinderAssets.commandCrosshair, childLocatorEntry = "ScopeContainer" }); overrideController.SetCommandSkills(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); } public override void OnExit() { tracker.DeactivateIndicator(); RemoveOverlay(); Util.PlaySound(Paint.exitSoundString, ((EntityState)this).gameObject); overrideController.UnsetCommandSkills(); overrideController.inCommandMode = false; ((EntityState)this).OnExit(); } private void RemoveOverlay() { if (overlayController != null) { HudOverlayManager.RemoveOverlay(overlayController); overlayController = null; } } } internal class FollowCommand : BaseIssueCommand { private string javString = ""; public override void OnEnter() { base.OnEnter(); if (overrideController.javelinReady) { javString = "Jav"; } ((EntityState)this).PlayCrossfade("Gesture, Override", javString + "Wave", "Hand.playbackRate", duration, 0.1f); falconerComponent.FollowOrder(); } } internal class SpecialCommand : BaseIssueCommand { public HurtBox target; private string javString = ""; public override void OnEnter() { base.OnEnter(); target = commandTracker.GetTrackingTarget(); if (overrideController.javelinReady) { javString = "Jav"; } ((EntityState)this).PlayCrossfade("Gesture, Override", javString + "Point", "Hand.playbackRate", duration, 0.1f); falconerComponent.SpecialOrder(target); } } } namespace Skillstates.Squall { internal class SquallMainState : BaseState { private Animator modelAnimator; private bool skill1InputReceived; private bool skill2InputReceived; private bool skill3InputReceived; private bool skill4InputReceived; private bool sprintInputReceived; public override void OnEnter() { ((BaseState)this).OnEnter(); modelAnimator = ((EntityState)this).GetModelAnimator(); ((EntityState)this).PlayAnimation("Body", "Hover"); modelAnimator.SetFloat("Fly.rate", 1f); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); PerformInputs(); } public override void Update() { ((EntityState)this).Update(); if (!(Time.deltaTime <= 0f)) { UpdateAnimParams(); } } private void PerformInputs() { //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0053: 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_0090: 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) if (!((EntityState)this).isAuthority) { return; } if (Object.op_Implicit((Object)(object)((EntityState)this).inputBank)) { if (Object.op_Implicit((Object)(object)((EntityState)this).rigidbodyMotor)) { ((EntityState)this).rigidbodyMotor.moveVector = ((EntityState)this).inputBank.moveVector * ((EntityState)this).characterBody.moveSpeed; } if (Object.op_Implicit((Object)(object)((EntityState)this).rigidbodyDirection)) { if (((EntityState)this).inputBank.moveVector != Vector3.zero) { ((EntityState)this).rigidbodyDirection.aimDirection = ((EntityState)this).inputBank.moveVector; } else { ((EntityState)this).rigidbodyDirection.aimDirection.y = 0f; } } skill1InputReceived = ((EntityState)this).inputBank.skill1.down; skill2InputReceived = ((EntityState)this).inputBank.skill2.down; skill3InputReceived = ((EntityState)this).inputBank.skill3.down; skill4InputReceived = ((EntityState)this).inputBank.skill4.down; sprintInputReceived |= ((EntityState)this).inputBank.sprint.down; if (((Vector3)(ref ((EntityState)this).inputBank.moveVector)).magnitude <= 0.5f) { sprintInputReceived = false; } ((EntityState)this).characterBody.isSprinting = sprintInputReceived; if (sprintInputReceived) { modelAnimator.SetFloat("Fly.rate", 1.5f); } sprintInputReceived = false; } if (Object.op_Implicit((Object)(object)((EntityState)this).skillLocator)) { if (skill1InputReceived && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.primary)) { ((EntityState)this).skillLocator.primary.ExecuteIfReady(); } if (skill2InputReceived && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.secondary)) { ((EntityState)this).skillLocator.secondary.ExecuteIfReady(); } if (skill3InputReceived && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.utility)) { ((EntityState)this).skillLocator.utility.ExecuteIfReady(); } if (skill4InputReceived && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.special)) { ((EntityState)this).skillLocator.special.ExecuteIfReady(); } } } private void UpdateAnimParams() { //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_0022: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)modelAnimator)) { Vector3 moveVector = ((EntityState)this).inputBank.moveVector; bool flag = moveVector != Vector3.zero && ((EntityState)this).characterBody.moveSpeed > Mathf.Epsilon; modelAnimator.SetBool("isMoving", flag); } } } internal class DiveToPoint : BaseState { public static float giveUpDuration = 3f; public static float speedCoefficient = 6f; public Vector3 divePosition; public float minDistanceFromPoint; public override void OnEnter() { ((BaseState)this).OnEnter(); ((EntityState)this).characterBody.isSprinting = true; if (minDistanceFromPoint <= 0f) { minDistanceFromPoint = 1f; } } public override void FixedUpdate() { //IL_0010: 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_0074: 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_0089: 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_0092: 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_00a4: 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_00b4: 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_00bd: 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_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_00de: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).FixedUpdate(); PerformInputs(); bool flag = Vector3.Distance(divePosition, ((EntityState)this).transform.position) <= minDistanceFromPoint; bool flag2 = ((EntityState)this).fixedAge >= giveUpDuration; if ((flag || flag2) && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } if (((EntityState)this).isAuthority) { RigidbodyDirection rigidbodyDirection = ((EntityState)this).rigidbodyDirection; Vector3 val = divePosition - ((EntityState)this).transform.position; rigidbodyDirection.aimDirection = ((Vector3)(ref val)).normalized; RigidbodyMotor rigidbodyMotor = ((EntityState)this).rigidbodyMotor; Vector3 rootMotion = rigidbodyMotor.rootMotion; val = divePosition - ((EntityState)this).transform.position; rigidbodyMotor.rootMotion = rootMotion + ((Vector3)(ref val)).normalized * (speedCoefficient * base.moveSpeedStat * Time.fixedDeltaTime); } } private void PerformInputs() { if (Object.op_Implicit((Object)(object)((EntityState)this).skillLocator)) { if (((EntityState)this).inputBank.skill1.down && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.primary)) { ((EntityState)this).skillLocator.primary.ExecuteIfReady(); } if (((EntityState)this).inputBank.skill2.down && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.secondary)) { ((EntityState)this).skillLocator.secondary.ExecuteIfReady(); } if (((EntityState)this).inputBank.skill3.down && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.utility)) { ((EntityState)this).skillLocator.utility.ExecuteIfReady(); } if (((EntityState)this).inputBank.skill4.down && Object.op_Implicit((Object)(object)((EntityState)this).skillLocator.special)) { ((EntityState)this).skillLocator.special.ExecuteIfReady(); } } } public override void OnExit() { ((EntityState)this).characterBody.isSprinting = false; ((EntityState)this).PlayCrossfade("FullBody, Override", "BufferEmpty", 0.2f); ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } internal class MissileLauncher : BaseState { public HurtBox target; public bool isCrit; private SquallController squallController; public static float baseDuration = 0.5f; private float duration; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / base.attackSpeedStat; isCrit = ((BaseState)this).RollCrit(); squallController = ((EntityState)this).GetComponent<SquallController>(); if (!((EntityState)this).characterBody.isPlayerControlled) { target = squallController.currentBestHurtbox; } else { target = null; } FireMissile(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void FireMissile() { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_0083: 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_009f: 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) if (NetworkServer.active && Object.op_Implicit((Object)(object)target) && target.healthComponent.alive) { MicroMissileOrb val = new MicroMissileOrb(); ((Orb)val).target = target; ((Orb)val).origin = ((EntityState)this).characterBody.corePosition; ((GenericDamageOrb)val).damageValue = Config.SquallMissileDamage.Value * base.damageStat; ((GenericDamageOrb)val).attacker = ((EntityState)this).gameObject; ((GenericDamageOrb)val).teamIndex = ((EntityState)this).teamComponent.teamIndex; ((GenericDamageOrb)val).isCrit = isCrit; ((GenericDamageOrb)val).procChainMask = default(ProcChainMask); ((GenericDamageOrb)val).procCoefficient = 1f; ((GenericDamageOrb)val).damageColorIndex = (DamageColorIndex)0; ((GenericDamageOrb)val).damageType = DamageTypeCombo.op_Implicit((DamageType)0); OrbManager.instance.AddOrb((Orb)(object)val); } EffectManager.SimpleMuzzleFlash(FireMissileBarrage.effectPrefab, ((EntityState)this).gameObject, "MissileLauncher", true); } public override void OnExit() { FireMissile(); ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } internal class MountedGuns : BaseState { public static float baseDuration = 0.2f; internal HealthComponent target; private BulletAttack leftAttack; private BulletAttack rightAttack; private Ray aimRay; private float duration; public override void OnEnter() { //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_0035: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0059: 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_006e: Unknown result type (might be due to invalid IL or missing references) //IL_0079: Unknown result type (might be due to invalid IL or missing references) //IL_0084: Unknown result type (might be due to invalid IL or missing references) //IL_008b: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00b8: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: 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_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00ea: Unknown result type (might be due to invalid IL or missing references) //IL_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_00f6: 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_00fd: Unknown result type (might be due to invalid IL or missing references) //IL_010d: Unknown result type (might be due to invalid IL or missing references) //IL_0119: 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_0130: Expected O, but got Unknown //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) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_014e: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: 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_016a: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0180: 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_019e: Unknown result type (might be due to invalid IL or missing references) //IL_01a9: Unknown result type (might be due to invalid IL or missing references) //IL_01b4: Unknown result type (might be due to invalid IL or missing references) //IL_01bf: Unknown result type (might be due to invalid IL or missing references) //IL_01c5: Unknown result type (might be due to invalid IL or missing references) //IL_01ca: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: Unknown result type (might be due to invalid IL or missing references) //IL_01db: Unknown result type (might be due to invalid IL or missing references) //IL_01e6: Unknown result type (might be due to invalid IL or missing references) //IL_01e8: Unknown result type (might be due to invalid IL or missing references) //IL_01ed: Unknown result type (might be due to invalid IL or missing references) //IL_01f2: Unknown result type (might be due to invalid IL or missing references) //IL_01f4: Unknown result type (might be due to invalid IL or missing references) //IL_01f9: Unknown result type (might be due to invalid IL or missing references) //IL_0209: Unknown result type (might be due to invalid IL or missing references) //IL_0215: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Expected O, but got Unknown ((BaseState)this).OnEnter(); duration = baseDuration / base.attackSpeedStat; aimRay = ((BaseState)this).GetAimRay(); if (((EntityState)this).isAuthority) { leftAttack = new BulletAttack { owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, origin = ((Ray)(ref aimRay)).origin, muzzleName = "GunL", minSpread = 0f, maxSpread = 0f, bulletCount = 1u, damage = Config.SquallGunDamage.Value * base.damageStat, tracerEffectPrefab = FireBarrage.tracerEffectPrefab, force = 1f, hitEffectPrefab = FirePistol2.hitEffectPrefab, stopperMask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, isCrit = ((BaseState)this).RollCrit(), radius = 1f, damageType = DamageTypeCombo.op_Implicit((DamageType)0), falloffModel = (FalloffModel)1, procCoefficient = Config.SquallGunProc.Value, maxDistance = 200f, aimVector = ((Ray)(ref aimRay)).direction }; rightAttack = new BulletAttack { owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, origin = ((Ray)(ref aimRay)).origin, muzzleName = "GunR", minSpread = 0f, maxSpread = 0f, bulletCount = 1u, damage = Config.SquallGunDamage.Value * base.damageStat, tracerEffectPrefab = FireBarrage.tracerEffectPrefab, force = 1f, hitEffectPrefab = FirePistol2.hitEffectPrefab, stopperMask = ((LayerIndex)(ref LayerIndex.entityPrecise)).mask, isCrit = ((BaseState)this).RollCrit(), radius = 1f, damageType = DamageTypeCombo.op_Implicit((DamageType)0), falloffModel = (FalloffModel)1, procCoefficient = Config.SquallGunProc.Value, maxDistance = 200f, aimVector = ((Ray)(ref aimRay)).direction }; FireBullet(leftAttack); FireBullet(rightAttack); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public void FireBullet(BulletAttack attack) { Util.PlaySound(FireBarrage.fireBarrageSoundString, ((EntityState)this).gameObject); EffectManager.SimpleMuzzleFlash(FireBarrage.effectPrefab, ((EntityState)this).gameObject, attack.muzzleName, false); if (((EntityState)this).isAuthority) { attack.Fire(); } } public override void OnExit() { ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } internal class ProjectileMissiles : BaseState { public GameObject target; public bool isCrit; private GameObject missilePrefab; private SquallController squallController; public static float baseDuration = 0.5f; private float duration; public override void OnEnter() { ((BaseState)this).OnEnter(); duration = baseDuration / base.attackSpeedStat; isCrit = ((BaseState)this).RollCrit(); missilePrefab = CommonAssets.missilePrefab; squallController = ((EntityState)this).GetComponent<SquallController>(); if (!((EntityState)this).characterBody.isPlayerControlled) { target = squallController.currentTarget; } else { target = null; } FireMissile(); } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= duration && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } private void FireMissile() { //IL_0012: 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_0025: 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) if (((EntityState)this).isAuthority) { MissileUtils.FireMissile(((EntityState)this).characterBody.corePosition, ((EntityState)this).characterBody, default(ProcChainMask), target, Config.SquallMissileDamage.Value * base.damageStat, isCrit, missilePrefab, (DamageColorIndex)0, Vector3.up, 200f, false); } } public override void OnExit() { FireMissile(); ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)1; } } public class SquallEvis : BaseState { public static float diveDuration = 0.2f; public static float attackDuration = 1.3f; public static float baseAttackInterval = 0.129f; public static float damageCoefficient = Config.specialDamageCoefficient.Value; public static float chargePerHit = Config.specialRechargeAmount.Value; internal HurtBox target; internal HurtBoxGroup targetHurtBoxes; private Transform modelTransform; private CharacterModel characterModel; private BatteryComponent batteryComponent; private SquallVFXComponents squallVFXComponent; private float attackInterval; private float stopwatch; private float maxHits; private float hitCount; private Vector3 startPosition; private Vector3 enemyPosition; private bool isCrit; private bool attackFinished; public override void OnEnter() { //IL_00c6: 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_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_00ed: 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) ((BaseState)this).OnEnter(); attackInterval = baseAttackInterval / base.attackSpeedStat; maxHits = Mathf.Floor(attackDuration / attackInterval); isCrit = ((BaseState)this).RollCrit(); modelTransform = ((EntityState)this).GetModelTransform(); characterModel = ((Component)modelTransform).GetComponent<CharacterModel>(); batteryComponent = ((EntityState)this).GetComponent<BatteryComponent>(); squallVFXComponent = ((EntityState)this).GetComponent<SquallVFXComponents>(); batteryComponent.pauseDrain = true; squallVFXComponent.ToggleVFX(onOff: false); CharacterModel obj = characterModel; obj.invisibilityCount++; if (Object.op_Implicit((Object)(object)target)) { targetHurtBoxes = target.hurtBoxGroup; startPosition = ((EntityState)this).transform.position; enemyPosition = ((Component)target).transform.position; squallVFXComponent.PlayDashEffect(startPosition, enemyPosition); Util.PlaySound(EvisDash.endSoundString, ((EntityState)this).gameObject); } } public override void FixedUpdate() { //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) ((EntityState)this).FixedUpdate(); stopwatch += Time.fixedDeltaTime; if (((EntityState)this).isAuthority) { ((EntityState)this).rigidbodyMotor.moveVector = Vector3.zero; } if (Object.op_Implicit((Object)(object)targetHurtBoxes)) { target = targetHurtBoxes.hurtBoxes[Random.Range(0, targetHurtBoxes.hurtBoxes.Length - 1)]; } if (Object.op_Implicit((Object)(object)target) && Object.op_Implicit((Object)(object)target.healthComponent) && stopwatch >= attackInterval && target.healthComponent.alive && ((EntityState)this).fixedAge >= diveDuration && !attackFinished && hitCount < maxHits) { stopwatch = 0f; DoAttack(); } if ((hitCount >= maxHits || ((EntityState)this).fixedAge >= diveDuration + attackDuration || !target.healthComponent.alive) && ((EntityState)this).isAuthority && !attackFinished) { FinishAttack(); } if (attackFinished && stopwatch >= diveDuration) { ((EntityState)this).outer.SetNextStateToMain(); } } private void DoAttack() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Expected O, but got Unknown //IL_004f: Unknown result type (might be due to invalid IL or missing references) //IL_0054: Unknown result type (might be due to invalid IL or missing references) //IL_011b: Unknown result type (might be due to invalid IL or missing references) //IL_0121: 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_0139: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active) { enemyPosition = ((Component)target).transform.position; DamageInfo val = new DamageInfo(); val.attacker = ((EntityState)this).gameObject; val.procCoefficient = 1f; val.crit = isCrit; val.position = enemyPosition; val.damage = base.damageStat * damageCoefficient; target.healthComponent.TakeDamage(val); if (target.healthComponent.alive) { target.healthComponent.body.AddTimedBuff(Buffs.armorShred, 7f); } GlobalEventManager.instance.OnHitEnemy(val, ((Component)target.healthComponent).gameObject); GlobalEventManager.instance.OnHitAll(val, ((Component)target.healthComponent).gameObject); } float amount = (isCrit ? (2f * chargePerHit) : chargePerHit); batteryComponent.Recharge(amount, canOvercharge: true); EffectManager.SimpleImpactEffect(PathfinderAssets.squallEvisEffect, enemyPosition, enemyPosition, true); EffectManager.SimpleImpactEffect(Assaulter.hitEffectPrefab, enemyPosition, enemyPosition, true); hitCount += 1f; } private void FinishAttack() { //IL_0008: 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) squallVFXComponent.PlayDashEffect(enemyPosition, startPosition); Util.PlaySound(EvisDash.endSoundString, ((EntityState)this).gameObject); attackFinished = true; stopwatch = 0f; } public override void OnExit() { CharacterModel obj = characterModel; obj.invisibilityCount--; batteryComponent.pauseDrain = false; squallVFXComponent.ToggleVFX(onOff: true); ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) return (InterruptPriority)2; } } } namespace Pathfinder { 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); } } [BepInPlugin("com.Bog.Pathfinder", "Pathfinder", "0.5.3")] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] public class PathfinderPlugin : BaseUnityPlugin { public const string MODUID = "com.Bog.Pathfinder"; public const string MODNAME = "Pathfinder"; public const string MODVERSION = "0.5.3"; public const string DEVELOPER_PREFIX = "BOG"; public static PathfinderPlugin instance; public static PluginInfo PInfo; public static GameObject pathfinderBodyPrefab; public static GameObject squallBodyPrefab; public static GameObject commandCrosshair; public static BodyIndex squallBodyIndex; public static BodyIndex teslaTrooperBodyIndex; public static SkillDef javelinSkill; internal static ModdedDamageType piercing; private void Awake() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) instance = this; PInfo = ((BaseUnityPlugin)this).Info; Log.Init(((BaseUnityPlugin)this).Logger); PathfinderAssets.Initialize(); Config.ReadConfig(this); States.RegisterStates(); Buffs.RegisterBuffs(); Projectiles.RegisterProjectiles(); Tokens.AddTokens(); ItemDisplays.PopulateDisplays(); piercing = DamageAPI.ReserveDamageType(); new Squall().Initialize(); new Pathfinder.Modules.Survivors.Pathfinder().Initialize(); new ContentPacks().Initialize(); Subscriptions(); Hook(); } private void Subscriptions() { GlobalEventManager.onClientDamageNotified += GlobalEventManager_onClientDamageNotified; } private void Hook() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0024: Expected O, but got Unknown //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Expected O, but got Unknown //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Expected O, but got Unknown //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Expected O, but got Unknown //IL_0062: Unknown result type (might be due to invalid IL or missing references) //IL_006c: Expected O, but got Unknown BodyCatalog.SetBodyPrefabs += new hook_SetBodyPrefabs(BodyCatalog_SetBodyPrefabs); CharacterBody.RecalculateStats += new hook_RecalculateStats(CharacterBody_RecalculateStats); HealthComponent.TakeDamage += new hook_TakeDamage(HealthComponent_TakeDamage); PrimarySkillShurikenBehavior.OnSkillActivated += new hook_OnSkillActivated(PrimarySkillShurikenBehavior_OnSkillActivated); SkillLocator.ApplyAmmoPack += new hook_ApplyAmmoPack(SkillLocator_ApplyAmmoPack); CharacterBody.AddBuff_BuffIndex += new hook_AddBuff_BuffIndex(CharacterBody_AddBuff_BuffIndex); } private void BodyCatalog_SetBodyPrefabs(orig_SetBodyPrefabs orig, GameObject[] newBodyPrefabs) { //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_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) orig.Invoke(newBodyPrefabs); squallBodyIndex = BodyCatalog.FindBodyIndex(squallBodyPrefab); teslaTrooperBodyIndex = BodyCatalog.FindBodyIndex("TeslaTrooperBody"); Log.Warning("Squall's body index is: " + ((object)(BodyIndex)(ref squallBodyIndex)).ToString()); } private void CharacterBody_AddBuff_BuffIndex(orig_AddBuff_BuffIndex orig, CharacterBody self, BuffIndex buffType) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_000a: Unknown result type (might be due to invalid IL or missing references) //IL_0010: 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) orig.Invoke(self, buffType); if (buffType == BuffCatalog.FindBuffIndex("Charged") && self.bodyIndex == squallBodyIndex) { BatteryComponent component = ((Component)self).GetComponent<BatteryComponent>(); if (Object.op_Implicit((Object)(object)component)) { component.Recharge(3f, canOvercharge: true); } } } private void SkillLocator_ApplyAmmoPack(orig_ApplyAmmoPack orig, SkillLocator self) { orig.Invoke(self); FalconerComponent component = ((Component)self).GetComponent<FalconerComponent>(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.squallController) || !NetworkServer.active) { return; } GenericSkill[] allSkills = component.squallController.skillLocator.allSkills; foreach (GenericSkill val in allSkills) { if (val.CanApplyAmmoPack()) { val.ApplyAmmoPack(); } } } private void PrimarySkillShurikenBehavior_OnSkillActivated(orig_OnSkillActivated orig, PrimarySkillShurikenBehavior self, GenericSkill skill) { OverrideController component = ((Component)self).GetComponent<OverrideController>(); if (!Object.op_Implicit((Object)(object)component) || (!component.javelinReady && !component.inCommandMode)) { orig.Invoke(self, skill); } } private void GlobalEventManager_onClientDamageNotified(DamageDealtMessage msg) { //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_00e2: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)msg.attacker)) { return; } SquallController component = msg.attacker.GetComponent<SquallController>(); if (!Object.op_Implicit((Object)(object)component) || !Object.op_Implicit((Object)(object)component.owner) || !Object.op_Implicit((Object)(object)msg.victim) || msg.isSilent) { return; } HealthComponent component2 = msg.victim.GetComponent<HealthComponent>(); if (!Object.op_Implicit((Object)(object)component2) || component2.dontShowHealthbar) { return; } TeamIndex objectTeam = TeamComponent.GetObjectTeam(((Component)component2).gameObject); foreach (CombatHealthBarViewer instances in CombatHealthBarViewer.instancesList) { if ((Object)(object)component.owner == (Object)(object)instances.viewerBodyObject && Object.op_Implicit((Object)(object)instances.viewerBodyObject)) { instances.HandleDamage(component2, objectTeam); } } } private void HealthComponent_TakeDamage(orig_TakeDamage orig, HealthComponent self, DamageInfo damageInfo) { //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) //IL_00a1: 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_0048: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_006c: 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_00f3: 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_0175: 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_0090: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0145: Unknown result type (might be due to invalid IL or missing references) //IL_014a: Unknown result type (might be due to invalid IL or missing references) if (self.body.bodyIndex == squallBodyIndex && Object.op_Implicit((Object)(object)damageInfo.attacker)) { CharacterBody component = damageInfo.attacker.GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component) && component.bodyIndex == teslaTrooperBodyIndex && component.teamComponent.teamIndex == self.body.teamComponent.teamIndex && NetworkServer.active) { self.body.AddBuff(BuffCatalog.FindBuffIndex("Charged")); } } if (DamageAPI.HasModdedDamageType(damageInfo, piercing) && !damageInfo.rejected && Object.op_Implicit((Object)(object)damageInfo.attacker)) { CharacterBody component2 = damageInfo.attacker.GetComponent<CharacterBody>(); if (Object.op_Implicit((Object)(object)component2)) { float num = Vector3.Distance(component2.corePosition, damageInfo.position); if (num >= 11f) { damageInfo.damage *= 1.3f; damageInfo.damageColorIndex = (DamageColorIndex)5; if (self.body.armor > 0f) { damageInfo.damageType = DamageTypeCombo.op_Implicit((DamageType)2); } EffectManager.SimpleImpactEffect(PathfinderAssets.thrustTipImpact, damageInfo.position, Vector3.zero, true); } else { EffectManager.SimpleImpactEffect(GroundLight.comboHitEffectPrefab, damageInfo.position, Vector3.zero, true); } } } orig.Invoke(self, damageInfo); } private void CharacterBody_RecalculateStats(orig_RecalculateStats orig, CharacterBody self) { //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) orig.Invoke(self); if (!Object.op_Implicit((Object)(object)self)) { return; } if (self.HasBuff(Buffs.electrocute)) { self.moveSpeed *= Config.electrocuteSlowAmount.Value; } if (self.HasBuff(Buffs.armorShred)) { self.armor -= Config.specialArmorShred.Value * (float)self.GetBuffCount(Buffs.armorShred); } if (self.HasBuff(Buffs.rendingTalonMS)) { self.moveSpeed *= 1.2f; } if (self.bodyIndex == squallBodyIndex) { BatteryComponent component = ((Component)self).GetComponent<BatteryComponent>(); if (Object.op_Implicit((Object)(object)component)) { component.rechargeRate = Config.batteryRechargeRate.Value * self.attackSpeed; } } } } } namespace Pathfinder.Modules { public static class Buffs { internal static BuffDef electrocute; internal static BuffDef armorShred; internal static BuffDef rendingTalonMS; internal static DotIndex electrocuteDoT; internal static void RegisterBuffs() { //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_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_002c: 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_0045: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) BuffDef val = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/ShockNearby/bdTeslaField.asset").WaitForCompletion(); BuffDef val2 = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/ArmorReductionOnHit/bdPulverized.asset").WaitForCompletion(); BuffDef val3 = Addressables.LoadAssetAsync<BuffDef>((object)"RoR2/Base/SprintOutOfCombat/bdWhipBoost.asset").WaitForCompletion(); electrocute = AddNewBuff("Electrocuted", val.iconSprite, Color.cyan, canStack: false, isDebuff: true); armorShred = AddNewBuff("ArmorShred", val2.iconSprite, Color.cyan, canStack: true, isDebuff: true); rendingTalonMS = AddNewBuff("RendingTalonsMS", val3.iconSprite, Color.white, canStack: false, isDebuff: false); RegisterDoTs(); } private static void RegisterDoTs() { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) electrocuteDoT = DotAPI.RegisterDotDef(0.2f, Config.electrocuteDPS.Value * 0.2f, (DamageColorIndex)0, electrocute, (CustomDotBehaviour)null, (CustomDotVisual)null); } internal static BuffDef AddNewBuff(string buffName, Sprite buffIcon, Color buffColor, bool canStack, bool isDebuff) { //IL_0010: 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) BuffDef val = ScriptableObject.CreateInstance<BuffDef>(); ((Object)val).name = buffName; val.buffColor = buffColor; val.canStack = canStack; val.isDebuff = isDebuff; val.eliteDef = null; val.iconSprite = buffIcon; Content.AddBuffDef(val); return val; } } public static class Config { private static ConfigEntry<string> modVersion; private static string pathfinderPrefix = "Pathfinder - "; private static string squallPrefix = "Squall - "; private static string versionSuffix = " - 0.5.3"; public static ConfigEntry<float> sortPosition; private static string primarySectionTitle = pathfinderPrefix + "Primary"; public static ConfigEntry<float> ThrustDamage; private static string secondarySectionTitle = pathfinderPrefix + "Secondary"; public static ConfigEntry<float> dashCD; public static ConfigEntry<float> JavelinDamage; private static string utilitySectionTitle = pathfinderPrefix + "Utility"; public static ConfigEntry<float> rendingTalonsCD; public static ConfigEntry<float> AirSpinDamage; public static ConfigEntry<float> GroundSpinDamage; public static ConfigEntry<float> bolasCD; public static ConfigEntry<float> electrocuteDPS; public static ConfigEntry<float> electrocuteSlowAmount; private static string squallBatteryTitle = squallPrefix + "Battery"; public static ConfigEntry<float> batteryDrainRate; public static ConfigEntry<float> batteryRechargeRate; public static ConfigEntry<bool> laserLineEnabled; private static string squallAttackTitle = squallPrefix + "Attack Mode"; public static ConfigEntry<float> SquallGunDamage; public static ConfigEntry<float> SquallGunProc; public static ConfigEntry<float> SquallMissileDamage; public static ConfigEntry<float> SquallMissileProc; public static string squallSpecialTitle = squallPrefix + "Special"; public static ConfigEntry<float> goForThroatCD; public static ConfigEntry<float> specialDamageCoefficient; public static ConfigEntry<float> specialRechargeAmount; public static ConfigEntry<float> specialArmorShred; public static void ReadConfig(PathfinderPlugin plugin) { ((BaseUnityPlugin)plugin).Config.Clear(); modVersion = ((BaseUnityPlugin)plugin).Config.Bind<string>("General", "Mod Version", "0.5.3", "Current version; don't touch this or it will reset your config"); sortPosition = ((BaseUnityPlugin)plugin).Config.Bind<float>("General", "Lobby Sort Position", 9.5f, "Sort position of Pathfinder in the character select lobby"); if (modVersion.Value != ((ConfigEntryBase)modVersion).DefaultValue.ToString()) { Log.Warning("Pathfinder - version mismatch detected, clearing config"); ((Dictionary<ConfigDefinition, string>)AccessTools.PropertyGetter(typeof(ConfigFile), "OrphanedEntries").Invoke(((BaseUnityPlugin)plugin).Config, null)).Clear(); modVersion.Value = ((ConfigEntryBase)modVersion).DefaultValue.ToString(); } ThrustDamage = ((BaseUnityPlugin)plugin).Config.Bind<float>(primarySectionTitle, "Thrust Damage Coefficient", 2.5f, "Damage coefficient of Thrust"); dashCD = ((BaseUnityPlugin)plugin).Config.Bind<float>(secondarySectionTitle, "Fleetfoot Cooldown", 6f, "Cooldown of Fleetfoot"); JavelinDamage = ((BaseUnityPlugin)plugin).Config.Bind<float>(secondarySectionTitle, "Javelin Damage Coefficient", 8f, "Damage coefficient of javelin toss"); bolasCD = ((BaseUnityPlugin)plugin).Config.Bind<float>(utilitySectionTitle, "Shock Bolas Cooldown", 18f, "Cooldown of Shock Bolas"); electrocuteDPS = ((BaseUnityPlugin)plugin).Config.Bind<float>(utilitySectionTitle, "Electrocute Damage per Second", 1.2f, "Damage % per second of Electrocute DoT"); electrocuteSlowAmount = ((BaseUnityPlugin)plugin).Config.Bind<float>(utilitySectionTitle, "Electrocute Slow Multiplier", 0.5f, "Movespeed multiplier of Electrocute DoT"); rendingTalonsCD = ((BaseUnityPlugin)plugin).Config.Bind<float>(utilitySectionTitle, "Rending Talons Cooldown", 6f, "Cooldown of Rending Talons"); AirSpinDamage = ((BaseUnityPlugin)plugin).Config.Bind<float>(utilitySectionTitle, "Air Spin Damage Coefficient", 3f, "Damage coefficient of Rending Talons aerial spin attack"); GroundSpinDamage = ((BaseUnityPlugin)plugin).Config.Bind<float>(utilitySectionTitle, "Ground Spin Damage Coefficient", 8f, "Damage coefficient of Rending Talons ground spin attack"); batteryDrainRate = ((BaseUnityPlugin)plugin).Config.Bind<float>(squallBatteryTitle, "Battery Drain Rate", 8f, "Amount battery drains per second while Squall is in Attack Mode"); batteryRechargeRate = ((BaseUnityPlugin)plugin).Config.Bind<float>(squallBatteryTitle, "Battery Recharge Rate", 1f, "Base battery recharge rate while Squall is in Follow Mode"); laserLineEnabled = ((BaseUnityPlugin)plugin).Config.Bind<bool>("General", "Enable Squall Laser Pointer", true, "Shows Squall's laser pointer"); SquallGunDamage = ((BaseUnityPlugin)plugin).Config.Bind<float>(squallAttackTitle, "Machine Guns Damage Coefficient", 0.3f, "Damage coefficient of Squall's machine guns. Each attack fires two bullets."); SquallGunProc = ((BaseUnityPlugin)plugin).Config.Bind<float>(squallAttackTitle, "Machine Guns Proc Coefficient", 0.3f, "Proc coefficient of Squall's machine guns. Each attack fires two bullets."); SquallMissileDamage = ((BaseUnityPlugin)plugin).Config.Bind<float>(squallAttackTitle, "Missile Launcher Damage Coefficient", 1.5f, "Damage coefficient of Squall's missile launcher."); goForThroatCD = ((BaseUnityPlugin)plugin).Config.Bind<float>(squallSpecialTitle, "Go for the Throat Cooldown", 12f, "Cooldown of Go for the Throat."); specialDamageCoefficient = ((BaseUnityPlugin)plugin).Config.Bind<float>(squallSpecialTitle, "Go for the Throat Damage Coefficient", 0.7f, "Damage coefficient per strike of Go for the Throat."); specialRechargeAmount = ((BaseUnityPlugin)plugin).Config.Bind<float>(squallSpecialTitle, "Go for the Throat Recharge Amount", 1f, "Percentage of battery recharged per strike of Go for the Throat."); specialArmorShred = ((BaseUnityPlugin)plugin).Config.Bind<float>(squallSpecialTitle, "Go for the Throat Armor Shred Amount", 2f, "Flat amount of armor deducted per strike of Go for the Throat."); } public static ConfigEntry<bool> CharacterEnableConfig(string characterName, string description = "Set to false to disable this character", bool enabledDefault = true) { return ((BaseUnityPlugin)PathfinderPlugin.instance).Config.Bind<bool>("General", "Enable " + characterName, enabledDefault, description); } } internal class ContentPacks : IContentPackProvider { internal ContentPack contentPack = new ContentPack(); public static List<GameObject> bodyPrefabs = new List<GameObject>(); public static List<GameObject> masterPrefabs = new List<GameObject>(); public static List<GameObject> projectilePrefabs = new List<GameObject>(); public static List<SurvivorDef> survivorDefs = new List<SurvivorDef>(); public static List<UnlockableDef> unlockableDefs = new List<UnlockableDef>(); public static List<SkillFamily> skillFamilies = new List<SkillFamily>(); public static List<SkillDef> skillDefs = new List<SkillDef>(); public static List<Type> entityStates = new List<Type>(); public static List<BuffDef> buffDefs = new List<BuffDef>(); public static List<EffectDef> effectDefs = new List<EffectDef>(); public static List<NetworkSoundEventDef> networkSoundEventDefs = new List<NetworkSoundEventDef>(); public string identifier => "com.Bog.Pathfinder"; public void Initialize() { //IL_0008: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Expected O, but got Unknown ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(ContentManager_collectContentPackProviders); } private void ContentManager_collectContentPackProviders(AddContentPackProviderDelegate addContentPackProvider) { addContentPackProvider.Invoke((IContentPackProvider)(object)this); } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { contentPack.identifier = identifier; contentPack.bodyPrefabs.Add(bodyPrefabs.ToArray()); contentPack.masterPrefabs.Add(masterPrefabs.ToArray()); contentPack.projectilePrefabs.Add(projectilePrefabs.ToArray()); contentPack.survivorDefs.Add(survivorDefs.ToArray()); contentPack.unlockableDefs.Add(unlockableDefs.ToArray()); contentPack.skillDefs.Add(skillDefs.ToArray()); contentPack.skillFamilies.Add(skillFamilies.ToArray()); contentPack.entityStateTypes.Add(entityStates.ToArray()); contentPack.buffDefs.Add(buffDefs.ToArray()); contentPack.effectDefs.Add(effectDefs.ToArray()); contentPack.networkSoundEventDefs.Add(networkSoundEventDefs.ToArray()); args.ReportProgress(1f); yield break; } public IEnumerator GenerateContentPackAsync(GetContentPackAsyncArgs args) { ContentPack.Copy(contentPack, args.output); args.ReportProgress(1f); yield break; } public IEnumerator FinalizeAsync(FinalizeAsyncArgs args) { args.ReportProgress(1f); yield break; } } internal class Content { public static void AddCharacterBodyPrefab(GameObject bprefab) { ContentPacks.bodyPrefabs.Add(bprefab); } public static void AddMasterPrefab(GameObject prefab) { ContentPacks.masterPrefabs.Add(prefab); } public static void AddProjectilePrefab(GameObject prefab) { ContentPacks.projectilePrefabs.Add(prefab); } public static void AddSurvivorDef(SurvivorDef survivorDef) { ContentPacks.survivorDefs.Add(survivorDef); } public static void AddUnlockableDef(UnlockableDef unlockableDef) { ContentPacks.unlockableDefs.Add(unlockableDef); } public static void AddSkillDef(SkillDef skillDef) { ContentPacks.skillDefs.Add(skillDef); } public static void AddSkillFamily(SkillFamily skillFamily) { ContentPacks.skillFamilies.Add(skillFamily); } public static void AddEntityState(Type entityState) { ContentPacks.entityStates.Add(entityState); } public static void AddBuffDef(BuffDef buffDef) { ContentPacks.buffDefs.Add(buffDef); } public static void AddEffectDef(EffectDef effectDef) { ContentPacks.effectDefs.Add(effectDef); } public static void AddNetworkSoundEventDef(NetworkSoundEventDef networkSoundEventDef) { ContentPacks.networkSoundEventDefs.Add(networkSoundEventDef); } } internal static class Helpers { internal const string agilePrefix = "<style=cIsUtility>Agile.</style> "; internal static string ScepterDescription(string desc) { return "\n<color=#d299ff>SCEPTER: " + desc + "</color>"; } public static T[] Append<T>(ref T[] array, List<T> list) { int num = array.Length; int count = list.Count; Array.Resize(ref array, num + count); list.CopyTo(array, num); return array; } public static Func<T[], T[]> AppendDel<T>(List<T> list) { return (T[] r) => Append(ref r, list); } } internal static class ItemDisplays { private static Dictionary<string, GameObject> itemDisplayPrefabs = new Dictionary<string, GameObject>(); internal static void PopulateDisplays() { PopulateFromBody("MageBody"); PopulateFromBody("LunarExploderBody"); PopulateCustomLightningArm(); } private static void PopulateFromBody(string bodyName) { ItemDisplayRuleSet itemDisplayRuleSet = ((Component)LegacyResourcesAPI.Load<GameObject>("Prefabs/CharacterBodies/" + bodyName).GetComponent<ModelLocator>().modelTransform).GetComponent<CharacterModel>().itemDisplayRuleSet; KeyAssetRuleGroup[] keyAssetRuleGroups = itemDisplayRuleSet.keyAssetRuleGroups; for (int i = 0; i < keyAssetRuleGroups.Length; i++) { ItemDisplayRule[] rules = keyAssetRuleGroups[i].displayRuleGroup.rules; for (int j = 0; j < rules.Length; j++) { GameObject followerPrefab = rules[j].followerPrefab; if (Object.op_Implicit((Object)(object)followerPrefab)) { string key = ((Object)followerPrefab).name?.ToLowerInvariant(); if (!itemDisplayPrefabs.ContainsKey(key)) { itemDisplayPrefabs[key] = followerPrefab; } } } } } private static void PopulateCustomLightningArm() { GameObject val = PrefabAPI.InstantiateClone(itemDisplayPrefabs["displaylightningarmright"], "DisplayLightningCustom", false); LimbMatcher component = val.GetComponent<LimbMatcher>(); component.limbPairs[0].targetChildLimb = "LightningArm1"; component.limbPairs[1].targetChildLimb = "LightningArm2"; component.limbPairs[2].targetChildLimb = "LightningArmEnd"; itemDisplayPrefabs["displaylightningarmcustom"] = val; } public static GameObject LoadDisplay(string name) { if (itemDisplayPrefabs.ContainsKey(name.ToLowerInvariant()) && Object.op_Implicit((Object)(object)itemDisplayPrefabs[name.ToLowerInvariant()])) { return itemDisplayPrefabs[name.ToLowerInvariant()]; } Log.Error("item display " + name + " returned null"); return null; } } internal static class Materials { private static List<Material> cachedMaterials = new List<Material>(); public static Material CreateHopooMaterial(string materialName) { //IL_0074: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Expected O, but got Unknown Material val = cachedMaterials.Find(delegate(Material mat) { materialName.Replace(" (Instance)", ""); return ((Object)mat).name.Contains(materialName); }); if (Object.op_Implicit((Object)(object)val)) { return val; } val = PathfinderAssets.mainAssetBundle.LoadAsset<Material>(materialName); if (!Object.op_Implicit((Object)(object)val)) { Log.Error("Failed to load material: " + materialName + " - Check to see that the material in your Unity project matches this name"); return new Material(PathfinderAssets.hotpoo); } return val.SetHopooMaterial(); } public static Material SetHopooMaterial(this Material tempMat) { //IL_006f: 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_0135: Unknown result type (might be due to invalid IL or missing references) if (cachedMaterials.Contains(tempMat)) { return tempMat; } float? num = null; float? num2 = null; Color? val = null; if (tempMat.IsKeywordEnabled("_NORMALMAP")) { num = tempMat.GetFloat("_BumpScale"); } if (tempMat.IsKeywordEnabled("_EMISSION")) { val = tempMat.GetColor("_EmissionColor"); } if (tempMat.IsKeywordEnabled("CUTOUT")) { num2 = tempMat.GetFloat("_Cutoff"); } tempMat.shader = PathfinderAssets.hotpoo; tempMat.SetColor("_Color", tempMat.GetColor("_Color")); tempMat.SetTexture("_MainTex", tempMat.GetTexture("_MainTex")); tempMat.SetTexture("_EmTex", tempMat.GetTexture("_EmissionMap")); tempMat.EnableKeyword("DITHER"); if (num.HasValue) { tempMat.SetFloat("_NormalStrength", num.Value); } if (val.HasValue) { tempMat.SetColor("_EmColor", val.Value); tempMat.SetFloat("_EmPower", 1f); } if (num2.HasValue) { tempMat.EnableKeyword("CUTOUT"); tempMat.SetFloat("_Cutoff", num2.Value); } if (tempMat.IsKeywordEnabled("NOCULL")) { tempMat.SetInt("_Cull", 0); } if (tempMat.IsKeywordEnabled("LIMBREMOVAL")) { tempMat.SetInt("_LimbRemovalOn", 1); } cachedMaterials.Add(tempMat); return tempMat; } public static Material MakeUnique(this Material material) { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown if (cachedMaterials.Contains(material)) { return new Material(material); } return material; } public static Material SetColor(this Material material, Color color) { //IL_0007: Unknown result type (might be due to invalid IL or missing references) material.SetColor("_Color", color); return material; } public static Material SetNormal(this Material material, float normalStrength = 1f) { material.SetFloat("_NormalStrength", normalStrength); return material; } public static Material SetEmission(this Material material) { return material.SetEmission(1f); } public static Material SetEmission(this Material material, float emission) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) return material.SetEmission(emission, Color.white); } public static Material SetEmission(this Material material, float emission, Color emissionColor) { //IL_0014: Unknown result type (might be due to invalid IL or missing references) material.SetFloat("_EmPower", emission); material.SetColor("_EmColor", emissionColor); return material; } public static Material SetCull(this Material material, bool cull = false) { material.SetInt("_Cull", cull ? 1 : 0); return material; } } internal static class PathfinderAssets { internal static AssetBundle mainAssetBundle; internal static GameObject BatteryMeter; internal static GameObject commandCrosshair; internal static GameObject thrustEffect; internal static GameObject thrustTipImpact; internal static GameObject dashEffect; internal static GameObject javEffect; internal static GameObject vaultEffect; internal static GameObject lightningRingEffect; internal static GameObject lineVisualizer; internal static GameObject explosionVisualizer; internal static GameObject squallEvisEffect; internal static GameObject squallDashEffect; internal static GameObject squallFollowFlash; internal static GameObject squallAttackFlash; internal static NetworkSoundEventDef swordHitSoundEvent; internal static Shader hotpoo = LegacyResourcesAPI.Load<Shader>("Shaders/Deferred/HGStandard"); internal static Material commandoMat; private static string[] assetNames = new string[0]; private const string assetFolder = "PF_Assets"; private const string assetbundleName = "pathfinderassets"; private const string soundbankFolder = "PF_Soundbanks"; private const string soundbankName = "PathfinderBank.bnk"; private const string csProjName = "Pathfinder"; public static string AssetBundlePath => Path.Combine(Path.GetDirectoryName(PathfinderPlugin.PInfo.Location), "PF_Assets", "pathfinderassets"); internal static void Initialize() { bool flag = false; LoadAssetBundle(); PopulateAssets(); } internal static void LoadAssetBundle() { try { if ((Object)(object)mainAssetBundle == (Object)null) { mainAssetBundle = AssetBundle.LoadFromFile(AssetBundlePath); } if (Object.op_Implicit((Object)(object)mainAssetBundle)) { Log.Warning("Morris asset bundle loaded successfully"); } } catch (Exception ex) { Log.Error("Failed to load assetbundle. Make sure your assetbundle name is setup correctly\n" + ex); return; } assetNames = mainAssetBundle.GetAllAssetNames(); } internal static void PopulateAssets() { //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_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0057: 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_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_00fb: Unknown result type (might be due to invalid IL or missing references) //IL_0100: 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_0176: Unknown result type (might be due to invalid IL or missing references) //IL_021c: Unknown result type (might be due to invalid IL or missing references) //IL_024e: Unknown result type (might be due to invalid IL or missing references) //IL_0253: Unknown result type (might be due to invalid IL or missing references) //IL_02a3: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02bb: Unknown result type (might be due to invalid IL or missing references) //IL_02c0: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)mainAssetBundle)) { Log.Error("There is no AssetBundle to load assets from."); return; } thrustEffect = LoadEffect("SpearThrust", parentToTransform: false); thrustTipImpact = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Merc/ImpactMercFocusedAssault.prefab").WaitForCompletion(); dashEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/SprintOutOfCombat/SprintActivate.prefab").WaitForCompletion(); javEffect = PrefabAPI.InstantiateClone(Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Vagrant/VagrantTrackingBombExplosion.prefab").WaitForCompletion(), "JavelinExplosionPrefab"); if (!Object.op_Implicit((Object)(object)javEffect.GetComponent<NetworkIdentity>())) { javEffect.AddComponent<NetworkIdentity>(); } AddNewEffectDef(javEffect, "Play_mage_m2_impact"); vaultEffect = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Feather/FeatherEffect.prefab").WaitForCompletion(); lightningRingEffect = mainAssetBundle.LoadAsset<GameObject>("LightningRing"); Texture2D val = mainAssetBundle.LoadAsset<Texture2D>("Blots"); Texture2D val2 = Addressables.LoadAssetAsync<Texture2D>((object)"RoR2/Base/Common/texCloudLightning1.png").WaitForCompletion(); Material material = Addressables.LoadAssetAsync<Material>((object)"RoR2/Base/TPHealingNova/matGlowFlowerAreaIndicator.mat").WaitForCompletion(); lightningRingEffect.AddComponent<NetworkIdentity>(); ParticleSystemRenderer component = ((Component)lightningRingEffect.transform.GetChild(0)).GetComponent<ParticleSystemRenderer>(); ((Renderer)component).material = material; ((Renderer)component).material.SetTexture("_Cloud1Tex", (Texture)(object)val2); ((Renderer)component).material.SetTexture("_Cloud2Tex", (Texture)(object)val2); ((Renderer)component).material.SetColor("_TintColor", Color.blue); ((Renderer)component).material.SetFloat("_RimPower", 6f); ((Renderer)component).material.SetFloat("_RimStrength", 1f); ParticleSystemRenderer component2 = ((Component)lightningRingEffect.transform.GetChild(0).GetChild(0)).GetComponent<ParticleSystemRenderer>(); ((Renderer)component2).material = material; ((Renderer)component2).material.SetTexture("_Cloud1Tex", (Texture)(object)val2); ((Renderer)component2).material.SetTexture("_Cloud2Tex", (Texture)(object)val2); ((Renderer)component2).material.SetFloat("_RimPower", 7f); ((Renderer)component2).material.SetColor("_TintColor", Color.green); BatteryMeter = mainAssetBundle.LoadAsset<GameObject>("BatteryMeter"); TextMeshProUGUI componentInChildren = BatteryMeter.GetComponentInChildren<TextMeshProUGUI>(); ((TMP_Text)componentInChildren).font = Addressables.LoadAssetAsync<TMP_FontAsset>((object)"RoR2/Base/Common/Fonts/Bombardier/tmpBombDropshadow.asset").WaitForCompletion(); squallFollowFlash = LoadEffect("FlashFollow"); squallAttackFlash = LoadEffect("FlashAttack"); squallEvisEffect = LoadEffect("SquallEvisEffect"); squallDashEffect = LoadEffect("SquallDash"); lineVisualizer = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Common/VFX/BasicThrowableVisualizer.prefab").WaitForCompletion(); explosionVisualizer = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Huntress/HuntressArrowRainIndicator.prefab").WaitForCompletion(); } private static GameObject CreateTracer(string originalTracerName, string newTracerName) { if ((Object)(object)LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/" + originalTracerName) == (Object)null) { return null; } GameObject val = PrefabAPI.InstantiateClone(LegacyResourcesAPI.Load<GameObject>("Prefabs/Effects/Tracers/" + originalTracerName), newTracerName, true); if (!Object.op_Implicit((Object)(object)val.GetComponent<EffectComponent>())) { val.AddComponent<EffectComponent>(); } if (!Object.op_Implicit((Object)(object)val.GetComponent<VFXAttributes>())) { val.AddComponent<VFXAttributes>(); } if (!Object.op_Implicit((Object)(object)val.GetComponent<NetworkIdentity>())) { val.AddComponent<NetworkIdentity>(); } val.GetComponent<Tracer>().speed = 250f; val.GetComponent<Tracer>().length = 50f; AddNewEffectDef(val); return val; } internal static NetworkSoundEventDef CreateNetworkSoundEventDef(string eventName) { NetworkSoundEventDef val = ScriptableObject.CreateInstance<NetworkSoundEventDef>(); val.akId = AkSoundEngine