Please disclose if any significant portion of your mod was created using AI tools by adding the 'AI Generated' category. Failing to do so may result in the mod being removed from Thunderstore.
Decompiled source of EnforcerTweaks v1.1.0
EnforcerTweaks.dll
Decompiled 3 days 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.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Configuration; using BepInEx.Logging; using EnforcerAlts.Components; using EnforcerAlts.Core; using EnforcerAlts.Modules; using EnforcerAlts.States; using EntityStates; using EntityStates.Enforcer; using Microsoft.CodeAnalysis; using On.EntityStates; using On.EntityStates.Enforcer; using On.RoR2; using On.RoR2.Projectile; using R2API; using R2API.AddressReferencedAssets; using R2API.Utils; using RoR2; using RoR2.CharacterAI; using RoR2.ContentManagement; using RoR2.Projectile; using RoR2.Skills; using UnityEngine; using UnityEngine.AddressableAssets; using UnityEngine.Networking; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("EnforcerTweaks")] [assembly: AssemblyConfiguration("Release")] [assembly: AssemblyFileVersion("1.1.0.0")] [assembly: AssemblyInformationalVersion("1.1.0")] [assembly: AssemblyProduct("EnforcerTweaks")] [assembly: AssemblyTitle("EnforcerTweaks")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.1.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Embedded] [AttributeUsage(AttributeTargets.Module, AllowMultiple = false, Inherited = false)] internal sealed class RefSafetyRulesAttribute : Attribute { public readonly int Version; public RefSafetyRulesAttribute(int P_0) { Version = P_0; } } } namespace EnforcerAlts { [BepInPlugin("com.Personal.EnforcerTweaks", "Enforcer Tweaks", "1.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [BepInDependency(/*Could not decode attribute arguments.*/)] [NetworkCompatibility(/*Could not decode attribute arguments.*/)] public class EnforcerAltsPlugin : BaseUnityPlugin { [CompilerGenerated] private static class <>O { public static hook_OnEnter <0>__TauntState_OnEnter; public static hook_InitializeProjectile <1>__OnInitializeProjectile; } private static ContentPacks contentPacks; internal static ManualLogSource LogSource; public static void DebugLog(string msg) { if (Config.DebugLogging != null && Config.DebugLogging.Value) { ManualLogSource logSource = LogSource; if (logSource != null) { logSource.LogInfo((object)msg); } } } public static void DebugLogWarning(string msg) { if (Config.DebugLogging != null && Config.DebugLogging.Value) { ManualLogSource logSource = LogSource; if (logSource != null) { logSource.LogWarning((object)msg); } } } private void Awake() { //IL_0057: 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_0062: Expected O, but got Unknown //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007c: Unknown result type (might be due to invalid IL or missing references) //IL_0082: Expected O, but got Unknown LogSource = ((BaseUnityPlugin)this).Logger; Config.Init(Paths.ConfigPath + "\\com.Personal.EnforcerTweaks.cfg"); EnforcerAssets.Create(); contentPacks = new ContentPacks(); contentPacks.Initialize(); RetaliationModule.Init(); SkillsModule.Init(); BulwarkModule.Init(); object obj = <>O.<0>__TauntState_OnEnter; if (obj == null) { hook_OnEnter val = TauntState_OnEnter; <>O.<0>__TauntState_OnEnter = val; obj = (object)val; } TauntState.OnEnter += (hook_OnEnter)obj; object obj2 = <>O.<1>__OnInitializeProjectile; if (obj2 == null) { hook_InitializeProjectile val2 = OnInitializeProjectile; <>O.<1>__OnInitializeProjectile = val2; obj2 = (object)val2; } ProjectileManager.InitializeProjectile += (hook_InitializeProjectile)obj2; ((BaseUnityPlugin)this).Logger.LogInfo((object)"Enforcer Tweaks 1.1.0 loaded."); } private static void OnInitializeProjectile(orig_InitializeProjectile orig, ProjectileController controller, FireProjectileInfo info) { //IL_0002: 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_00d2: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(controller, info); if (!BreacherSlug.firing || !Object.op_Implicit((Object)(object)controller)) { return; } controller.procCoefficient = 1f; controller.doNotPerformImpactOnCollision = true; ProjectileSimple component = ((Component)controller).GetComponent<ProjectileSimple>(); if (Object.op_Implicit((Object)(object)component)) { component.lifetime = Config.SlugLifetime.Value; component.desiredForwardSpeed = Config.SlugSpeed.Value; component.updateAfterFiring = false; if (!Object.op_Implicit((Object)(object)component.lifetimeExpiredEffect)) { component.lifetimeExpiredEffect = EnforcerAssets.TryLoad("RoR2/DLC4/Enforcer/EnfKineticChargeExplosionHitVFX.prefab"); } } Rigidbody component2 = ((Component)controller).GetComponent<Rigidbody>(); if (Object.op_Implicit((Object)(object)component2)) { component2.useGravity = false; component2.freezeRotation = false; } if (!Object.op_Implicit((Object)(object)((Component)controller).GetComponent<SlugMarker>())) { ((Component)controller).gameObject.AddComponent<SlugMarker>(); Transform transform = ((Component)controller).transform; transform.localScale *= 1f; } Collider[] componentsInChildren = ((Component)controller).GetComponentsInChildren<Collider>(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].isTrigger = true; } } private static void TauntState_OnEnter(orig_OnEnter orig, TauntState self) { if (self != null) { self.tauntDuration = Config.RipcordTauntDuration.Value; } orig.Invoke(self); } } public static class PluginInfo { public const string guid = "com.Personal.EnforcerTweaks"; public const string name = "Enforcer Tweaks"; public const string version = "1.1.0"; } } namespace EnforcerAlts.States { public class BreacherLaser : BaseSkillState { private static GameObject hitEffectPrefab; private LaserChargeController charge; private LineRenderer laserBeam; private Transform muzzle; private float shotTimer; private float burstElapsed; private float burstRoundInterval; private float burstDuration; private int burstShots; private bool previousAlwaysAim; private Animator modelAnimator; private int fireAnimationLayer = -1; private LaserWeaponPose weaponPose; public override void OnEnter() { //IL_00aa: Unknown result type (might be due to invalid IL or missing references) ((BaseState)this).OnEnter(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { previousAlwaysAim = ((EntityState)this).characterBody.alwaysAim; ((EntityState)this).characterBody.alwaysAim = true; } muzzle = ((BaseState)this).FindModelChild("MuzzleGun"); charge = (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) ? ((Component)((EntityState)this).characterBody).GetComponent<LaserChargeController>() : null); if (!Object.op_Implicit((Object)(object)charge) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { charge = ((Component)((EntityState)this).characterBody).gameObject.AddComponent<LaserChargeController>(); } hitEffectPrefab = EnforcerAssets.LaserHitEffectPrefab; CreateBeam(); FreezeFirePose(); ((BaseState)this).StartAimMode(((BaseState)this).GetAimRay(), 0.5f, false); Util.PlaySound("Play_DLC4_Skills_Engi_LaserCutter_Shoot_Start", ((EntityState)this).gameObject); if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((BaseSkillState)this).activatorSkillSlot)) { ((BaseSkillState)this).activatorSkillSlot.SetBlockedCooldownSkillState(true); ((BaseSkillState)this).activatorSkillSlot.rechargeStopwatch = 0f; } shotTimer = 0f; burstElapsed = 0f; burstShots = 0; burstRoundInterval = Mathf.Max(0.01f, Config.LaserFireInterval.Value) / Mathf.Max(0.01f, ((BaseState)this).attackSpeedStat); int num = Mathf.Max(1, Config.LaserBurstRounds.Value); burstDuration = Mathf.Max(0.05f, (float)(num - 1) * burstRoundInterval + 0.06f); if (Object.op_Implicit((Object)(object)laserBeam)) { ((Renderer)laserBeam).enabled = true; } UpdateBeam(); if (((EntityState)this).isAuthority) { FireRound(1); burstShots = 1; } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { ((EntityState)this).characterBody.SetAimTimer(0.5f); } UpdateBeam(); if (((EntityState)this).isAuthority) { burstElapsed += Time.fixedDeltaTime; shotTimer += Time.fixedDeltaTime; int num = Mathf.Max(1, Config.LaserBurstRounds.Value); while (burstShots < num && shotTimer >= burstRoundInterval) { shotTimer -= burstRoundInterval; burstShots++; FireRound(burstShots); } if (((EntityState)this).characterBody.isSprinting || !Object.op_Implicit((Object)(object)((BaseSkillState)this).activatorSkillSlot) || (Object)(object)((BaseSkillState)this).activatorSkillSlot.skillDef != (Object)(object)EnforcerAssets.BreacherLaserDef || (burstShots >= num && burstElapsed >= burstDuration)) { ((EntityState)this).outer.SetNextStateToMain(); } } } private void FreezeFirePose() { //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0110: Unknown result type (might be due to invalid IL or missing references) //IL_015c: Unknown result type (might be due to invalid IL or missing references) //IL_0167: Unknown result type (might be due to invalid IL or missing references) //IL_016c: Unknown result type (might be due to invalid IL or missing references) //IL_0171: Unknown result type (might be due to invalid IL or missing references) //IL_0173: 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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_019b: Unknown result type (might be due to invalid IL or missing references) //IL_01a2: Unknown result type (might be due to invalid IL or missing references) modelAnimator = ((EntityState)this).GetModelAnimator(); if (!Object.op_Implicit((Object)(object)modelAnimator)) { return; } fireAnimationLayer = modelAnimator.GetLayerIndex("Gesture, UpperBody, Underride"); int num = Animator.StringToHash("FireRiotShotgun"); if (fireAnimationLayer < 0 || !modelAnimator.HasState(fireAnimationLayer, num)) { EnforcerAltsPlugin.DebugLogWarning("Focus laser could not find the FireRiotShotgun animation state."); return; } Transform root = (Object.op_Implicit((Object)(object)((EntityState)this).modelLocator) ? ((EntityState)this).modelLocator.modelTransform : null); Transform val = FindBone(root, "upper_armR"); Transform val2 = FindBone(root, "lower_armR"); Transform val3 = FindBone(root, "handR"); Transform val4 = FindBone(root, "shotgun_prop"); if (Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)val3) && Object.op_Implicit((Object)(object)val4)) { weaponPose = ((EntityState)this).gameObject.AddComponent<LaserWeaponPose>(); weaponPose.SetPose(val, val2, val3, val4); ((Behaviour)weaponPose).enabled = false; } float num2 = 0.2f; float num3 = float.NegativeInfinity; Ray aimRay = ((BaseState)this).GetAimRay(); for (int i = 0; i <= 20; i++) { float num4 = (float)i / 20f; modelAnimator.Play(num, fireAnimationLayer, num4); modelAnimator.Update(0f); if (!Object.op_Implicit((Object)(object)muzzle)) { continue; } Vector3 val5 = muzzle.position - ((EntityState)this).characterBody.corePosition; float num5 = val5.y * 1.5f + Vector3.Dot(val5, ((Ray)(ref aimRay)).direction) * 0.25f + Vector3.Dot(muzzle.forward, ((Ray)(ref aimRay)).direction); if (num5 > num3) { num3 = num5; num2 = num4; if (Object.op_Implicit((Object)(object)weaponPose)) { weaponPose.Capture(); } } } modelAnimator.Play(num, fireAnimationLayer, num2); modelAnimator.SetFloat("FireRiotShotgun.playbackRate", 0f); modelAnimator.Update(0f); if (Object.op_Implicit((Object)(object)weaponPose)) { ((Behaviour)weaponPose).enabled = true; } EnforcerAltsPlugin.DebugLog($"Focus laser fire pose frozen on layer {fireAnimationLayer} at {num2:0.00} " + $"directBonePose={(Object)(object)weaponPose != (Object)null}."); } private static Transform FindBone(Transform root, string name) { if (!Object.op_Implicit((Object)(object)root)) { return null; } if (((Object)root).name == name) { return root; } for (int i = 0; i < root.childCount; i++) { Transform val = FindBone(root.GetChild(i), name); if (Object.op_Implicit((Object)(object)val)) { return val; } } return null; } private void CreateBeam() { //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //IL_0086: 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) if (Object.op_Implicit((Object)(object)EnforcerAssets.LaserBeamMaterial)) { GameObject val = new GameObject("BreacherLaserBeam"); laserBeam = val.AddComponent<LineRenderer>(); ((Renderer)laserBeam).sharedMaterial = EnforcerAssets.LaserBeamMaterial; laserBeam.positionCount = 2; laserBeam.useWorldSpace = true; laserBeam.startWidth = 0.18f; laserBeam.endWidth = 0.18f; laserBeam.startColor = new Color(1f, 0.55f, 0.15f, 1f); laserBeam.endColor = new Color(1f, 0.55f, 0.15f, 0.8f); ((Renderer)laserBeam).enabled = false; UpdateBeam(); } } private void UpdateBeam() { //IL_000f: Unknown result type (might be due to invalid IL or missing references) //IL_0014: Unknown result type (might be due to invalid IL or missing references) //IL_0031: 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_0036: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_0059: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_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) if (Object.op_Implicit((Object)(object)laserBeam)) { Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 val = (Object.op_Implicit((Object)(object)muzzle) ? muzzle.position : ((Ray)(ref aimRay)).origin); Vector3 point = ((Ray)(ref aimRay)).GetPoint(Mathf.Max(1f, Config.LaserRange.Value)); RaycastHit val2 = default(RaycastHit); if (Util.CharacterRaycast(((EntityState)this).gameObject, aimRay, ref val2, Mathf.Max(1f, Config.LaserRange.Value), CommonMasks.bullet, (QueryTriggerInteraction)1)) { point = ((RaycastHit)(ref val2)).point; } laserBeam.SetPosition(0, val); laserBeam.SetPosition(1, point); } } private void FireRound(int roundNumber) { //IL_0001: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_0016: 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_0063: 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_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_0078: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00c1: Unknown result type (might be due to invalid IL or missing references) //IL_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00f5: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0107: Unknown result type (might be due to invalid IL or missing references) //IL_010c: Unknown result type (might be due to invalid IL or missing references) //IL_0117: Unknown result type (might be due to invalid IL or missing references) //IL_0122: Unknown result type (might be due to invalid IL or missing references) //IL_013c: 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_0150: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Expected O, but got Unknown //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_0165: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0177: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017e: Unknown result type (might be due to invalid IL or missing references) //IL_0185: Unknown result type (might be due to invalid IL or missing references) //IL_01ea: Unknown result type (might be due to invalid IL or missing references) //IL_01f0: Unknown result type (might be due to invalid IL or missing references) Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 origin = ((Ray)(ref aimRay)).origin; Vector3 direction = ((Ray)(ref aimRay)).direction; bool num = Object.op_Implicit((Object)(object)charge) && charge.RegisterHealShot(); float num2 = (Object.op_Implicit((Object)(object)charge) ? charge.DamageMultiplier : 1f); new BulletAttack { owner = ((EntityState)this).gameObject, weapon = ((EntityState)this).gameObject, aimVector = direction, origin = origin, damage = ((BaseState)this).damageStat * Mathf.Max(0f, Config.LaserBaseDamage.Value) * num2, bulletCount = 1u, maxDistance = Mathf.Max(1f, Config.LaserRange.Value), radius = Mathf.Max(0f, Config.LaserRadius.Value), procCoefficient = Mathf.Max(0f, Config.LaserProcCoefficient.Value), falloffModel = (FalloffModel)0, stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask, minSpread = 0f, maxSpread = 0f, force = Mathf.Max(0f, Config.LaserForce.Value), isCrit = ((BaseState)this).RollCrit(), hitCallback = new HitCallback(LaserHit), hitEffectPrefab = hitEffectPrefab, muzzleName = "MuzzleGun", smartCollision = false, queryTriggerInteraction = (QueryTriggerInteraction)1, damageType = { damageSource = (DamageSource)1 } }.Fire(); if (num && Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.healthComponent)) { float num3 = ((EntityState)this).characterBody.maxHealth * Mathf.Max(0f, Config.LaserHealFraction.Value); ((EntityState)this).characterBody.healthComponent.Heal(num3, default(ProcChainMask), true); EnforcerAltsPlugin.DebugLog($"Focus laser heal: target={((Object)((EntityState)this).characterBody).name} amount={num3:0.0} " + $"fullChargeShots={Mathf.Max(1, Config.LaserHealShots.Value)}"); } EnforcerAltsPlugin.DebugLog($"Focus laser round: burstShot={roundNumber}/{Mathf.Max(1, Config.LaserBurstRounds.Value)} " + $"stock={(Object.op_Implicit((Object)(object)((BaseSkillState)this).activatorSkillSlot) ? ((BaseSkillState)this).activatorSkillSlot.stock : 0)} " + $"stacks={(Object.op_Implicit((Object)(object)charge) ? charge.stacks : 0f):0.0} damageMultiplier={num2:0.00}"); } private bool LaserHit(BulletAttack attack, ref BulletHit hit) { bool num = BulletAttack.defaultHitCallback.Invoke(attack, ref hit); HealthComponent val = (Object.op_Implicit((Object)(object)hit.hitHurtBox) ? hit.hitHurtBox.healthComponent : null); if (num && Object.op_Implicit((Object)(object)val) && val.alive && Object.op_Implicit((Object)(object)charge)) { charge.AddHit(); } return num; } public override void OnExit() { if (Object.op_Implicit((Object)(object)laserBeam)) { EntityState.Destroy((Object)(object)((Component)laserBeam).gameObject); } if (Object.op_Implicit((Object)(object)weaponPose)) { EntityState.Destroy((Object)(object)weaponPose); } if (Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { ((EntityState)this).characterBody.alwaysAim = previousAlwaysAim; } Animator val = ((EntityState)this).GetModelAnimator(); if (Object.op_Implicit((Object)(object)val)) { val.SetFloat("FireRiotShotgun.playbackRate", 1f); } Util.PlaySound("Stop_DLC4_Skills_Engi_LaserCutter_Shoot_Loop", ((EntityState)this).gameObject); Util.PlaySound("Play_engi_R_walkingTurret_laser_end", ((EntityState)this).gameObject); if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((BaseSkillState)this).activatorSkillSlot)) { ((BaseSkillState)this).activatorSkillSlot.SetBlockedCooldownSkillState(false); } FocusLaserSkillDef focusLaserSkillDef = (Object.op_Implicit((Object)(object)((BaseSkillState)this).activatorSkillSlot) ? (((BaseSkillState)this).activatorSkillSlot.skillDef as FocusLaserSkillDef) : null); if (Object.op_Implicit((Object)(object)focusLaserSkillDef)) { focusLaserSkillDef.SetBurstReadyDelay(((BaseSkillState)this).activatorSkillSlot, Mathf.Max(0f, Config.LaserBurstInterval.Value) / Mathf.Max(0.01f, ((BaseState)this).attackSpeedStat)); } ((EntityState)this).OnExit(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public class BreacherShot : FireRiotShotgun { private int pelletHits; private bool breacherShot; public override void OnEnter() { //IL_00bb: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) ((GenericBulletBaseState)this).baseDuration = 0.4f; ((GenericBulletBaseState)this).muzzleName = "MuzzleGun"; ((GenericBulletBaseState)this).bulletCount = 6; ((GenericBulletBaseState)this).bulletRadius = 1.38f; ((GenericBulletBaseState)this).useSmartCollision = true; ((GenericBulletBaseState)this).damageCoefficient = 0.6f; ((GenericBulletBaseState)this).minSpread = 0f; ((GenericBulletBaseState)this).maxSpread = 1f; ((GenericBulletBaseState)this).maxDistance = 50f; ((GenericBulletBaseState)this).procCoefficient = 0.7f; ((GenericBulletBaseState)this).fireSoundString = "Play_Char_Enforcer_Primary_Shotgun_Fire"; ((GenericBulletBaseState)this).muzzleFlashPrefab = TryLoad("RoR2/DLC4/Enforcer/EnforcerRiotShotgunMuzzle.prefab"); ((GenericBulletBaseState)this).tracerEffectPrefab = TryLoad("RoR2/DLC4/Enforcer/EnforcerRiotShotgunTracer.prefab"); if (Object.op_Implicit((Object)(object)((GenericBulletBaseState)this).tracerEffectPrefab)) { ((GenericBulletBaseState)this).tracerEffectPrefab.transform.localScale = Vector3.one * 0.5f; } ((GenericBulletBaseState)this).hitEffectPrefab = EnforcerAssets.ShotgunHitEffectPrefab; pelletHits = 0; EnforcerBodyState enforcerBodyState = (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) ? ((Component)((EntityState)this).characterBody).GetComponent<EnforcerBodyState>() : null); breacherShot = Object.op_Implicit((Object)(object)enforcerBodyState) && enforcerBodyState.ConsumeBreacherShot(); ((FireRiotShotgun)this).OnEnter(); CheckBreacherShot(enforcerBodyState); GenericSkill val = ((Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.skillLocator)) ? ((EntityState)this).characterBody.skillLocator.primary : null); EnforcerAltsPlugin.DebugLog($"BreacherShot fired: pellets={CurrentPelletCount()} breacherShot={breacherShot} stock={(Object.op_Implicit((Object)(object)val) ? val.stock : (-1))}/{(Object.op_Implicit((Object)(object)val) ? val.maxStock : (-1))}"); } public override void ModifyBullet(BulletAttack bulletAttack) { //IL_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00bb: Expected O, but got Unknown ((FireRiotShotgun)this).ModifyBullet(bulletAttack); float num = (bulletAttack.minSpread + bulletAttack.maxSpread) * 0.5f; bulletAttack.minSpread -= num; bulletAttack.maxSpread -= num; bulletAttack.spreadPitchScale = 1f; bulletAttack.spreadYawScale = 1f; if (breacherShot) { bulletAttack.bulletCount = (uint)Mathf.Max(1, Mathf.RoundToInt((float)bulletAttack.bulletCount * Config.BreacherPelletMultiplier.Value)); bulletAttack.damage *= Config.BreacherDamageMultiplier.Value; } ModifyOutgoingDamageCallback originalDamageCallback = bulletAttack.modifyOutgoingDamageCallback; bulletAttack.modifyOutgoingDamageCallback = (ModifyOutgoingDamageCallback)delegate(BulletAttack attack, ref BulletHit hit, DamageInfo damageInfo) { if (originalDamageCallback != null) { originalDamageCallback.Invoke(attack, ref hit, damageInfo); } TrackPellet(hit); }; } private void TrackPellet(BulletHit hit) { //IL_0078: 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) HealthComponent val = (Object.op_Implicit((Object)(object)hit.hitHurtBox) ? hit.hitHurtBox.healthComponent : null); if (!Object.op_Implicit((Object)(object)val) && Object.op_Implicit((Object)(object)hit.entityObject)) { val = hit.entityObject.GetComponent<HealthComponent>(); } if (Object.op_Implicit((Object)(object)val) && val.alive && Object.op_Implicit((Object)(object)val.body) && (!Object.op_Implicit((Object)(object)val.body.teamComponent) || val.body.teamComponent.teamIndex != ((EntityState)this).teamComponent.teamIndex)) { pelletHits++; EnforcerAltsPlugin.DebugLog($"Pellet hit {pelletHits}/{CurrentPelletCount()} on {((Object)val).name}"); } } private int CurrentPelletCount() { int num = ((GenericBulletBaseState)this).bulletCount; if (breacherShot) { num = Mathf.RoundToInt((float)num * Config.BreacherPelletMultiplier.Value); } return Mathf.Max(1, num); } private void CheckBreacherShot(EnforcerBodyState state) { if (Object.op_Implicit((Object)(object)state)) { int num = CurrentPelletCount(); EnforcerAltsPlugin.DebugLog($"Breacher Shot check: {pelletHits}/{num} pellets"); if (pelletHits >= num) { state.GrantBreacherShot(); Util.PlaySound("Play_Char_Enforcer_Reload_Pump", ((EntityState)this).gameObject); EnforcerAltsPlugin.DebugLog($"Breacher Shot ready: {pelletHits}/{num} pellets hit enemies"); } } } public override void FireBullet(Ray aimRay) { //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_0019: 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_0060: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_007c: 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_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) Vector3 point = ((Ray)(ref aimRay)).GetPoint(1000f); string arg = "none"; RaycastHit val = default(RaycastHit); if (Util.CharacterRaycast(((EntityState)this).gameObject, aimRay, ref val, 1000f, CommonMasks.bullet, (QueryTriggerInteraction)1)) { point = ((RaycastHit)(ref val)).point; arg = (Object.op_Implicit((Object)(object)((RaycastHit)(ref val)).collider) ? ((Object)((RaycastHit)(ref val)).collider).name : "none"); } EnforcerAltsPlugin.DebugLog($"Shotgun aim: target={arg} distance={Vector3.Distance(((Ray)(ref aimRay)).origin, point):0.00}m " + $"origin={((Ray)(ref aimRay)).origin:0.00} direction={((Ray)(ref aimRay)).direction:0.00}"); ((GenericBulletBaseState)this).FireBullet(aimRay); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } private static GameObject TryLoad(params string[] paths) { //IL_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) foreach (string text in paths) { GameObject val = null; string[] array = new string[2] { text, text.EndsWith(".prefab") ? text.Substring(0, text.Length - 7) : (text + ".prefab") }; foreach (string text2 in array) { try { val = Addressables.LoadAssetAsync<GameObject>((object)text2).WaitForCompletion(); } catch (Exception ex) { EnforcerAltsPlugin.DebugLog("Addressables error for " + text2 + ": " + ex.Message); val = null; } if (!Object.op_Implicit((Object)(object)val)) { val = LegacyResourcesAPI.Load<GameObject>(text2); } if (Object.op_Implicit((Object)(object)val)) { EnforcerAltsPlugin.DebugLog("Loaded prefab: " + text2); return val; } } } EnforcerAltsPlugin.DebugLog("Failed to load prefabs: " + string.Join(", ", paths)); return null; } } public class BreacherSlug : BaseSkillState { private float interval; private bool fired; private GenericSkill primarySkill; public static bool firing; public static GameObject projectilePrefab; public override void OnEnter() { ((BaseState)this).OnEnter(); primarySkill = ((Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.skillLocator)) ? ((EntityState)this).characterBody.skillLocator.primary : null); float num = (Object.op_Implicit((Object)(object)EnforcerAssets.BreacherSlugDef) ? EnforcerAssets.BreacherSlugDef.baseRechargeInterval : 2f); interval = Mathf.Min(Config.SlugInterval.Value, num * 0.8f) / ((BaseState)this).attackSpeedStat; HoldRecharge(); if (((EntityState)this).isAuthority) { Fire(); } } private void Fire() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_0046: Unknown result type (might be due to invalid IL or missing references) //IL_003e: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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_0055: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_0064: Unknown result type (might be due to invalid IL or missing references) //IL_0069: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Unknown result type (might be due to invalid IL or missing references) //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0097: Unknown result type (might be due to invalid IL or missing references) //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00ad: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b3: Unknown result type (might be due to invalid IL or missing references) //IL_00b7: Unknown result type (might be due to invalid IL or missing references) //IL_00bc: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00ab: Unknown result type (might be due to invalid IL or missing references) //IL_014d: Unknown result type (might be due to invalid IL or missing references) //IL_0161: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0169: Unknown result type (might be due to invalid IL or missing references) //IL_016b: 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_01be: 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_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0130: Unknown result type (might be due to invalid IL or missing references) if (!fired) { fired = true; Util.PlaySound("Play_Char_Enforcer_ClusterGrenade_Fire", ((EntityState)this).gameObject); Ray aimRay = ((BaseState)this).GetAimRay(); Transform val = ((BaseState)this).FindModelChild("MuzzleGun"); Vector3 val2 = (Object.op_Implicit((Object)(object)val) ? val.position : ((Ray)(ref aimRay)).origin); Vector3 val3 = ((Ray)(ref aimRay)).origin + ((Ray)(ref aimRay)).direction * 1000f; RaycastHit val4 = default(RaycastHit); if (Util.CharacterRaycast(((EntityState)this).gameObject, aimRay, ref val4, 1000f, LayerMask.op_Implicit(LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask) | LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask)), (QueryTriggerInteraction)1)) { val3 = ((RaycastHit)(ref val4)).point; } Vector3 val5 = val3 - val2; Vector3 normalized = ((Vector3)(ref val5)).normalized; projectilePrefab = EnforcerAssets.SlugProjectilePrefab; if (!Object.op_Implicit((Object)(object)projectilePrefab)) { projectilePrefab = EnforcerAssets.TryLoad("RoR2/DLC4/Enforcer/EnforcerGrenadeArcProjectile.prefab"); } EnforcerAltsPlugin.DebugLog("Slug prefab: " + (Object.op_Implicit((Object)(object)projectilePrefab) ? ((Object)projectilePrefab).name : "null")); if (!Object.op_Implicit((Object)(object)projectilePrefab)) { EnforcerAltsPlugin.DebugLogWarning("BreacherSlug: projectile prefab null, falling back to hitscan"); Hitscan(aimRay, normalized); return; } bool flag = CheckLastRound(); firing = true; ProjectileManager.instance.FireProjectile(new FireProjectileInfo { projectilePrefab = projectilePrefab, position = val2, rotation = Quaternion.LookRotation(normalized), owner = ((EntityState)this).gameObject, damage = ((BaseState)this).damageStat * Config.SlugDamage.Value, force = Config.SlugForce.Value, crit = (((BaseState)this).RollCrit() || flag), damageTypeOverride = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)0), (DamageTypeExtended)0, (DamageSource)1) }); firing = false; } } private void Hitscan(Ray aim, Vector3 dir) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Unknown result type (might be due to invalid IL or missing references) //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_003c: 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_0044: Unknown result type (might be due to invalid IL or missing references) //IL_004a: Unknown result type (might be due to invalid IL or missing references) //IL_004b: 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) //IL_0068: 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_007a: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0090: 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_0097: Unknown result type (might be due to invalid IL or missing references) //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a2: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Unknown result type (might be due to invalid IL or missing references) //IL_00b2: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_00db: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Expected O, but got Unknown //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) Transform val = ((BaseState)this).FindModelChild("MuzzleGun"); Vector3 origin = (Object.op_Implicit((Object)(object)val) ? val.position : ((Ray)(ref aim)).origin); bool flag = CheckLastRound(); new BulletAttack { owner = ((EntityState)this).gameObject, weapon = null, aimVector = dir, origin = origin, damage = ((BaseState)this).damageStat * Config.SlugDamage.Value, bulletCount = 1u, maxDistance = 200f, radius = 0.55f, procCoefficient = 1f, falloffModel = (FalloffModel)0, stopperMask = ((LayerIndex)(ref LayerIndex.world)).mask, minSpread = 0f, maxSpread = 0f, force = Config.SlugForce.Value, isCrit = (((BaseState)this).RollCrit() || flag), hitCallback = new HitCallback(PierceHit), damageType = { damageSource = (DamageSource)1 } }.Fire(); } private bool CheckLastRound() { GenericSkill val = ((Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.skillLocator)) ? ((EntityState)this).characterBody.skillLocator.primary : null); if (!Object.op_Implicit((Object)(object)val)) { return false; } BreacherSlugTracker breacherSlugTracker = ((Component)((EntityState)this).characterBody).GetComponent<BreacherSlugTracker>(); if (!Object.op_Implicit((Object)(object)breacherSlugTracker)) { breacherSlugTracker = ((Component)((EntityState)this).characterBody).gameObject.AddComponent<BreacherSlugTracker>(); } bool flag = breacherSlugTracker.fullyCharged && val.stock <= 0; if (flag) { breacherSlugTracker.fullyCharged = false; } EnforcerAltsPlugin.DebugLog($"BreacherSlug stock {val.stock}/{val.maxStock} lastRound={flag}"); return flag; } private bool PierceHit(BulletAttack attack, ref BulletHit hit) { GameObject entityObject = hit.entityObject; EnforcerAltsPlugin.DebugLog("BreacherSlug hit: " + ((entityObject != null) ? ((Object)entityObject).name : null)); BulletAttack.defaultHitCallback.Invoke(attack, ref hit); return true; } private void HoldRecharge() { if (Object.op_Implicit((Object)(object)primarySkill)) { primarySkill.rechargeStopwatch = 0f; } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); HoldRecharge(); if (((EntityState)this).fixedAge >= interval && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } } public class BreacherSlugTracker : MonoBehaviour { public bool fullyCharged; private CharacterBody body; private void Awake() { body = ((Component)this).GetComponent<CharacterBody>(); } private void Update() { if (!fullyCharged && Object.op_Implicit((Object)(object)body) && Object.op_Implicit((Object)(object)body.skillLocator)) { GenericSkill primary = body.skillLocator.primary; if (Object.op_Implicit((Object)(object)primary) && primary.maxStock > 0 && primary.stock >= primary.maxStock) { fullyCharged = true; } } } } public class BulwarkRage : BaseSkillState { private const float StateDuration = 0.6f; private const float ShockwaveDelay = 0.3f; private const float TauntVerticalMultiplier = 2.5f; private static GameObject shockwavePrefab; private float shockwaveRadius; private bool shockwaveSpawned; public override void OnEnter() { ((BaseState)this).OnEnter(); ((EntityState)this).PlayAnimation("FullBody, Override", "KineticChargeExplode", "KineticChargeExplode.playbackRate", 0.6f, 0f); Util.PlaySound("Play_DLC4_Char_Enforcer_KineticCharge_PreExplode", ((EntityState)this).gameObject); if (((EntityState)this).isAuthority) { ApplyRage(); } } private void ApplyRage() { //IL_008c: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_0093: 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_00a5: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00b9: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) //IL_00c5: Unknown result type (might be due to invalid IL or missing references) //IL_00cc: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d8: Unknown result type (might be due to invalid IL or missing references) //IL_00e7: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { return; } float num = (shockwaveRadius = Mathf.Max(0.1f, Config.BulwarkRadius.Value)); HashSet<CharacterBody> hashSet = new HashSet<CharacterBody>(); CharacterBody[] array = Object.FindObjectsOfType<CharacterBody>(); foreach (CharacterBody val in array) { if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val.healthComponent) || !val.healthComponent.alive || !Object.op_Implicit((Object)(object)val.teamComponent)) { continue; } TeamIndex teamIndex = val.teamComponent.teamIndex; if (teamIndex == ((EntityState)this).teamComponent.teamIndex || (int)teamIndex == 0) { continue; } Vector3 val2 = val.corePosition - ((EntityState)this).characterBody.corePosition; Vector2 val3 = new Vector2(val2.x, val2.z); if (((Vector2)(ref val3)).magnitude > num || Mathf.Abs(val2.y) > num * 2.5f || !hashSet.Add(val)) { continue; } _ = val.healthComponent; if (val.HasBuff(Buffs.TearGasBerserk)) { continue; } BaseAI val4 = (Object.op_Implicit((Object)(object)val.master) ? ((Component)val.master).GetComponent<BaseAI>() : null); if ((Object)(object)val4 != (Object)null) { if (val4.customTarget != null) { val4.customTarget.gameObject = ((Component)((EntityState)this).characterBody).gameObject; } val4.currentEnemy.gameObject = ((Component)((EntityState)this).characterBody).gameObject; val4.enemyAttention = val4.enemyAttentionDuration; } val.AddTimedBuff(Buffs.TearGasBerserk, Config.BulwarkTauntDuration.Value); } int num2 = Mathf.Min(Mathf.Max(0, Config.BulwarkMaxStacks.Value), hashSet.Count); BulwarkRageController.Apply(((EntityState)this).characterBody, num2, Config.BulwarkBuffDuration.Value, hashSet); if (Object.op_Implicit((Object)(object)EnforcerAssets.BulwarkRageBuff) && num2 > 0) { for (int j = 0; j < num2; j++) { ((EntityState)this).characterBody.AddTimedBuff(EnforcerAssets.BulwarkRageBuff, Config.BulwarkBuffDuration.Value); } } if (Object.op_Implicit((Object)(object)EnforcerAssets.RageBuff)) { ((EntityState)this).characterBody.AddTimedBuff(EnforcerAssets.RageBuff, Config.BulwarkBuffDuration.Value); } if (Object.op_Implicit((Object)(object)EnforcerAssets.HardeningBuff)) { ((EntityState)this).characterBody.AddTimedBuff(EnforcerAssets.HardeningBuff, Config.BulwarkBuffDuration.Value); } SpawnOrbitingShields(); GenericSkill skill = (Object.op_Implicit((Object)(object)((BaseSkillState)this).activatorSkillSlot) ? ((BaseSkillState)this).activatorSkillSlot : (Object.op_Implicit((Object)(object)((EntityState)this).skillLocator) ? ((EntityState)this).skillLocator.utility : null)); BulwarkCooldownController.DelayCooldown(((EntityState)this).characterBody, skill, Config.BulwarkBuffDuration.Value); EnforcerAltsPlugin.DebugLog($"Bulwark Rage: taunted={hashSet.Count} stacks={num2} duration={Config.BulwarkBuffDuration.Value:0.0}s " + $"radius={num:0.0}m verticalRadius={num * 2.5f:0.0}m " + $"buffStacks={(Object.op_Implicit((Object)(object)EnforcerAssets.BulwarkRageBuff) ? ((EntityState)this).characterBody.GetBuffCount(EnforcerAssets.BulwarkRageBuff) : 0)} " + $"moveSpeed+={Config.BulwarkMoveSpeedMultiplier.Value * 100f:0}% " + $"jump+={Config.BulwarkJumpPowerMultiplier.Value * 100f:0}% " + $"DR={(Config.BulwarkBaseDr.Value + (float)num2 * Config.BulwarkDrPerEnemy.Value) * 100f:0}%"); } private void SpawnOrbitingShields() { //IL_0022: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)EnforcerAssets.BulwarkShieldAttachmentPrefab)) { EnforcerAltsPlugin.DebugLogWarning("Bulwark Rage orbiting shield prefab missing at spawn."); return; } GameObject val = Object.Instantiate<GameObject>(EnforcerAssets.BulwarkShieldAttachmentPrefab, ((EntityState)this).characterBody.corePosition, Quaternion.identity); val.SetActive(true); NetworkedBodyAttachment component = val.GetComponent<NetworkedBodyAttachment>(); if (!Object.op_Implicit((Object)(object)component)) { Object.Destroy((Object)(object)val); EnforcerAltsPlugin.DebugLogWarning("Bulwark Rage orbiting shield attachment component missing."); } else { component.AttachToGameObjectAndSpawn(((Component)((EntityState)this).characterBody).gameObject, (string)null); Object.Destroy((Object)(object)val, Config.BulwarkBuffDuration.Value + 0.1f); EnforcerAltsPlugin.DebugLog($"Bulwark Rage orbiting shields spawned duration={Config.BulwarkBuffDuration.Value:0.0}s"); } } private void SpawnShockwave(float radius) { //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_003b: Unknown result type (might be due to invalid IL or missing references) //IL_0042: 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_0069: Expected O, but got Unknown if (!Object.op_Implicit((Object)(object)shockwavePrefab)) { shockwavePrefab = EnforcerAssets.TryLoad("RoR2/DLC4/Enforcer/EnforcerLeapImpact.prefab"); } if (Object.op_Implicit((Object)(object)shockwavePrefab)) { EffectManager.SpawnEffect(shockwavePrefab, new EffectData { origin = ((EntityState)this).characterBody.corePosition, scale = Mathf.Max(0.1f, radius / 15f) }, true); EnforcerAltsPlugin.DebugLog($"Bulwark Rage shield slam impact spawned radius={radius:0.0}"); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).isAuthority && !shockwaveSpawned && ((EntityState)this).fixedAge >= 0.3f) { shockwaveSpawned = true; SpawnShockwave(shockwaveRadius); } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 0.6f) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } public class ContainmentDeploy : BaseSkillState { public override void OnEnter() { //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002c: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Unknown result type (might be due to invalid IL or missing references) //IL_005c: Unknown result type (might be due to invalid IL or missing references) //IL_0061: Unknown result type (might be due to invalid IL or missing references) //IL_0063: Unknown result type (might be due to invalid IL or missing references) //IL_0065: Unknown result type (might be due to invalid IL or missing references) //IL_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_0079: Unknown result type (might be due to invalid IL or missing references) //IL_008a: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Unknown result type (might be due to invalid IL or missing references) //IL_0052: Unknown result type (might be due to invalid IL or missing references) //IL_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00a8: 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_00a3: Unknown result type (might be due to invalid IL or missing references) //IL_00a9: Unknown result type (might be due to invalid IL or missing references) //IL_00b0: Unknown result type (might be due to invalid IL or missing references) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bd: 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_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_0106: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0131: Unknown result type (might be due to invalid IL or missing references) //IL_0132: Unknown result type (might be due to invalid IL or missing references) //IL_013c: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_0157: Unknown result type (might be due to invalid IL or missing references) //IL_00e3: Unknown result type (might be due to invalid IL or missing references) //IL_00ed: Unknown result type (might be due to invalid IL or missing references) //IL_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_0176: Unknown result type (might be due to invalid IL or missing references) //IL_017b: Unknown result type (might be due to invalid IL or missing references) //IL_018b: Unknown result type (might be due to invalid IL or missing references) //IL_0197: Unknown result type (might be due to invalid IL or missing references) //IL_01a1: Unknown result type (might be due to invalid IL or missing references) //IL_01a8: 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_01d4: Unknown result type (might be due to invalid IL or missing references) //IL_01e4: Unknown result type (might be due to invalid IL or missing references) //IL_0207: Unknown result type (might be due to invalid IL or missing references) //IL_020c: Unknown result type (might be due to invalid IL or missing references) //IL_0252: 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_0267: Expected O, but got Unknown //IL_016b: 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) ((BaseState)this).OnEnter(); if (NetworkServer.active && Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { EnforcerAltsPlugin.DebugLog("ContainmentDeploy used"); Ray aimRay = ((BaseState)this).GetAimRay(); RaycastHit val = default(RaycastHit); Vector3 val2; if (Physics.Raycast(aimRay, ref val, 60f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { val2 = ((RaycastHit)(ref val)).point; } else { Vector3 point = ((Ray)(ref aimRay)).GetPoint(35f); RaycastHit val3 = default(RaycastHit); val2 = ((!Physics.Raycast(point + Vector3.up * 30f, Vector3.down, ref val3, 60f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) ? point : ((RaycastHit)(ref val3)).point); } Vector3 val4 = val2 - ((EntityState)this).characterBody.corePosition; Vector3 val5 = default(Vector3); ((Vector3)(ref val5))..ctor(val4.x, 0f, val4.z); if (((Vector3)(ref val5)).magnitude > 35f) { val5 = ((Vector3)(ref val5)).normalized * 35f; } ((Vector3)(ref val2))..ctor(((EntityState)this).characterBody.corePosition.x + val5.x, val2.y, ((EntityState)this).characterBody.corePosition.z + val5.z); RaycastHit val6 = default(RaycastHit); if (Physics.Raycast(val2 + Vector3.up * 20f, Vector3.down, ref val6, 40f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { val2 = ((RaycastHit)(ref val6)).point; } GameObject val7 = new GameObject("ContainmentNode") { layer = LayerIndex.projectile.intVal }; val7.transform.position = ((EntityState)this).characterBody.corePosition; val7.AddComponent<NetworkIdentity>(); val7.AddComponent<NetworkTransform>(); Rigidbody obj = val7.AddComponent<Rigidbody>(); obj.isKinematic = false; obj.useGravity = true; obj.drag = 0f; obj.collisionDetectionMode = (CollisionDetectionMode)1; val7.AddComponent<SphereCollider>().radius = 0.5f; ContainmentNode containmentNode = val7.AddComponent<ContainmentNode>(); containmentNode.owner = ((Component)((EntityState)this).characterBody).gameObject; containmentNode.ownerTeam = ((EntityState)this).characterBody.teamComponent.teamIndex; containmentNode.radius = Config.FieldRadius.Value; containmentNode.expansionTime = Config.FieldExpansionTime.Value; containmentNode.duration = Config.FieldDuration.Value; containmentNode.weakenDuration = Config.FieldWeakenDuration.Value; containmentNode.target = val2; containmentNode.speed = 40f; NetworkServer.Spawn(val7); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); if (((EntityState)this).fixedAge >= 0.6f && ((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)1; } } public class ContainmentFieldController : MonoBehaviour { public static readonly List<ContainmentFieldController> active = new List<ContainmentFieldController>(); private static GameObject areaPrefab; private static GameObject healEffectPrefab; public GameObject owner; public TeamIndex ownerTeam; public float radius; public float expansionTime; public float age; public float duration; private bool ending; private float lingerTimer; private readonly Dictionary<CharacterBody, float> playerHealVfxUntil = new Dictionary<CharacterBody, float>(); private readonly List<CharacterBody> weakenedBodies = new List<CharacterBody>(); private readonly HashSet<CharacterBody> playersInside = new HashSet<CharacterBody>(); private CharacterBody[] cachedBodies = (CharacterBody[])(object)new CharacterBody[0]; private float nextBodyRefresh; private GameObject visual; private GameObject radiusVisual; public float CurrentRadius => Mathf.Lerp(0f, radius, Mathf.Clamp01(age / Mathf.Max(0.01f, expansionTime))); private void Awake() { active.Add(this); GlobalEventManager.onServerDamageDealt += OnDamageDealt; } public static void LoadPrefabs() { if ((Object)(object)areaPrefab == (Object)null) { areaPrefab = EnforcerAssets.TryLoad("RoR2/DLC4/Enforcer/EnforcerCrowdControlBeaconArea.prefab"); } } public static ContainmentFieldController SpawnField(Vector3 point, GameObject owner, TeamIndex ownerTeam, float radius, float expansionTime, float duration) { //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_0006: Unknown result type (might be due to invalid IL or missing references) //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_005f: Unknown result type (might be due to invalid IL or missing references) //IL_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_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0099: Unknown result type (might be due to invalid IL or missing references) //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0044: Unknown result type (might be due to invalid IL or missing references) //IL_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_0058: Unknown result type (might be due to invalid IL or missing references) //IL_00ca: Unknown result type (might be due to invalid IL or missing references) //IL_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_00e8: Unknown result type (might be due to invalid IL or missing references) //IL_0108: Unknown result type (might be due to invalid IL or missing references) //IL_0153: Unknown result type (might be due to invalid IL or missing references) LoadPrefabs(); RaycastHit val = default(RaycastHit); if (Physics.Raycast(point + Vector3.up * 50f, Vector3.down, ref val, 100f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { point = ((RaycastHit)(ref val)).point + Vector3.up * 0.05f; } EnforcerAltsPlugin.DebugLog($"Containment field spawned at {point} radius={radius}"); GameObject val2 = new GameObject("ContainmentField"); val2.transform.position = point; ContainmentFieldController containmentFieldController = val2.AddComponent<ContainmentFieldController>(); containmentFieldController.owner = owner; containmentFieldController.ownerTeam = ownerTeam; containmentFieldController.radius = radius; containmentFieldController.expansionTime = expansionTime; containmentFieldController.duration = duration; if (Object.op_Implicit((Object)(object)areaPrefab)) { GameObject val3 = Object.Instantiate<GameObject>(areaPrefab, point, Quaternion.identity); val3.transform.localScale = Vector3.one * (radius / 30f); StripNonVisualComponents(val3); TeamFilter component = val3.GetComponent<TeamFilter>(); if (Object.op_Implicit((Object)(object)component)) { component.teamIndex = ownerTeam; } if (Object.op_Implicit((Object)(object)val3.GetComponent<NetworkIdentity>())) { NetworkServer.Spawn(val3); } containmentFieldController.SetVisual(val3); EnforcerAltsPlugin.DebugLog($"Containment field visual ready: renderers={val3.GetComponentsInChildren<Renderer>(true).Length} " + $"particles={val3.GetComponentsInChildren<ParticleSystem>(true).Length} team={ownerTeam}"); } else { EnforcerAltsPlugin.DebugLog("Containment areaPrefab null"); } containmentFieldController.ApplyInitialWeaken(); return containmentFieldController; } private void OnDestroy() { EnforcerAltsPlugin.DebugLog($"Containment field destroyed: age={age:0.00}s duration={duration:0.00}s ending={ending}"); active.Remove(this); GlobalEventManager.onServerDamageDealt -= OnDamageDealt; ExitVisual(visual); ExitVisual(radiusVisual); foreach (CharacterBody item in playersInside) { if (Object.op_Implicit((Object)(object)item)) { RevitalizingController component = ((Component)item).GetComponent<RevitalizingController>(); if (Object.op_Implicit((Object)(object)component)) { component.RefreshLinger(Config.FieldLingerDuration.Value); component.ExitField(); } } } playersInside.Clear(); } private static void ExitVisual(GameObject vfx) { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) if (!Object.op_Implicit((Object)(object)vfx)) { return; } TemporaryVisualEffect component = vfx.GetComponent<TemporaryVisualEffect>(); if (Object.op_Implicit((Object)(object)component)) { component.visualState = (VisualState)1; return; } ParticleSystem[] componentsInChildren = vfx.GetComponentsInChildren<ParticleSystem>(); foreach (ParticleSystem obj in componentsInChildren) { MainModule main = obj.main; ((MainModule)(ref main)).loop = false; obj.Stop(); } AnimateShaderAlpha[] componentsInChildren2 = vfx.GetComponentsInChildren<AnimateShaderAlpha>(); for (int i = 0; i < componentsInChildren2.Length; i++) { ((Behaviour)componentsInChildren2[i]).enabled = true; } Object.Destroy((Object)(object)vfx, 1.5f); } public static void StripNonVisualComponents(GameObject obj) { for (int i = 0; i < 8; i++) { bool flag = false; MonoBehaviour[] componentsInChildren = obj.GetComponentsInChildren<MonoBehaviour>(true); MonoBehaviour[] array = componentsInChildren; foreach (MonoBehaviour val in array) { if (Object.op_Implicit((Object)(object)val) && !(val is TemporaryVisualEffect) && !(val is VFXAttributes) && !(val is AnimateShaderAlpha) && !(val is ObjectScaleCurve) && !(val is LightIntensityCurve) && !(val is FlickerLight) && !(val is Billboard) && !(val is TeamAreaIndicator) && !(val is TeamFilter) && !(val is NetworkIdentity) && !IsRequiredByOther(val, componentsInChildren)) { Object.Destroy((Object)(object)val); flag = true; } } if (!flag) { break; } } } private static bool IsRequiredByOther(MonoBehaviour target, MonoBehaviour[] all) { Type type = ((object)target).GetType(); foreach (MonoBehaviour val in all) { if (!Object.op_Implicit((Object)(object)val) || (Object)(object)val == (Object)(object)target) { continue; } object[] customAttributes = ((object)val).GetType().GetCustomAttributes(typeof(RequireComponent), inherit: true); foreach (object obj in customAttributes) { RequireComponent val2 = (RequireComponent)((obj is RequireComponent) ? obj : null); if (val2 != null && (val2.m_Type0 == type || val2.m_Type1 == type || val2.m_Type2 == type)) { return true; } } } return false; } public void SetVisual(GameObject vfx) { visual = vfx; } public void SetRadiusVisual(GameObject vfx) { //IL_007b: Unknown result type (might be due to invalid IL or missing references) radiusVisual = vfx; BuffWard val = (Object.op_Implicit((Object)(object)vfx) ? vfx.GetComponent<BuffWard>() : null); if (Object.op_Implicit((Object)(object)val)) { val.Networkradius = radius; val.expires = true; val.expireDuration = duration; val.buffDef = null; } TemporaryVisualEffect val2 = (Object.op_Implicit((Object)(object)vfx) ? vfx.GetComponent<TemporaryVisualEffect>() : null); if (Object.op_Implicit((Object)(object)val2)) { val2.parentTransform = ((Component)this).transform; val2.radius = radius; val2.visualState = (VisualState)0; } } public void ApplyInitialWeaken() { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_002a: Unknown result type (might be due to invalid IL or missing references) //IL_002f: Unknown result type (might be due to invalid IL or missing references) //IL_0034: Unknown result type (might be due to invalid IL or missing references) RefreshBodies(); CharacterBody[] array = cachedBodies; foreach (CharacterBody val in array) { if (IsEnemy(val)) { Vector3 val2 = ((Component)this).transform.position - val.corePosition; if (!(((Vector3)(ref val2)).sqrMagnitude > radius * radius)) { ApplyWeaken(val); } } } } private void FixedUpdate() { //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00f4: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active) { return; } age += Time.fixedDeltaTime; if (age >= duration && !ending) { ending = true; lingerTimer = Config.FieldLingerDuration.Value; ExitVisual(visual); ExitVisual(radiusVisual); visual = null; radiusVisual = null; } if (ending) { lingerTimer -= Time.fixedDeltaTime; if (lingerTimer <= 0f) { Object.Destroy((Object)(object)((Component)this).gameObject); return; } } RefreshBodies(); float num = (ending ? radius : CurrentRadius); CharacterBody[] array = cachedBodies; foreach (CharacterBody val in array) { if (!Object.op_Implicit((Object)(object)val) || !Object.op_Implicit((Object)(object)val.healthComponent)) { continue; } bool flag = Vector3.Distance(val.corePosition, ((Component)this).transform.position) <= num; if (val.isPlayerControlled) { if (flag) { RevitalizingController revitalizingController = RevitalizingController.Get(val); if (!playersInside.Contains(val)) { playersInside.Add(val); revitalizingController.EnterField(); } revitalizingController.RefreshLinger(Config.FieldLingerDuration.Value); } else if (playersInside.Remove(val)) { RevitalizingController component = ((Component)val).GetComponent<RevitalizingController>(); if (Object.op_Implicit((Object)(object)component)) { component.ExitField(); } } } else if (IsEnemy(val) && !val.isFlying && flag && !val.HasBuff(Buffs.Weak)) { ApplyWeaken(val); } } } private bool IsEnemy(CharacterBody body) { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_003d: 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_0046: Unknown result type (might be due to invalid IL or missing references) //IL_0048: Invalid comparison between Unknown and I4 if (!Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)body.healthComponent) || !Object.op_Implicit((Object)(object)body.teamComponent) || !body.healthComponent.alive) { return false; } TeamIndex teamIndex = body.teamComponent.teamIndex; if (teamIndex != ownerTeam) { return (int)teamIndex > 0; } return false; } private void ApplyWeaken(CharacterBody body) { BuffDef weak = Buffs.Weak; if (Object.op_Implicit((Object)(object)weak) && Object.op_Implicit((Object)(object)body)) { body.AddTimedBuff(weak, Mathf.Max(Config.FieldWeakenDuration.Value, Config.FieldLingerDuration.Value), 1); if (!weakenedBodies.Contains(body)) { weakenedBodies.Add(body); } } } private void OnDamageDealt(DamageReport report) { //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0116: Unknown result type (might be due to invalid IL or missing references) //IL_011d: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Expected O, but got Unknown if (!NetworkServer.active || report == null || !Object.op_Implicit((Object)(object)report.attackerBody) || !report.attackerBody.isPlayerControlled) { return; } bool num = Vector3.Distance(report.attackerBody.corePosition, ((Component)this).transform.position) <= (ending ? radius : CurrentRadius); CharacterBody attackerBody = report.attackerBody; RevitalizingController revitalizingController = ((Component)attackerBody).GetComponent<RevitalizingController>(); bool flag = Object.op_Implicit((Object)(object)revitalizingController) && revitalizingController.LingerActive; if (!num && !flag) { return; } if (!Object.op_Implicit((Object)(object)revitalizingController)) { revitalizingController = RevitalizingController.Get(attackerBody); } revitalizingController.RefreshLinger(Config.FieldLingerDuration.Value); revitalizingController.NotifyHit(); if ((Object)(object)healEffectPrefab == (Object)null) { healEffectPrefab = EnforcerAssets.TryLoad("RoR2/Base/Medkit/MedkitHealEffect.prefab"); } int num2; if (playerHealVfxUntil.TryGetValue(attackerBody, out var value)) { num2 = ((Time.time >= value) ? 1 : 0); if (num2 == 0) { goto IL_0103; } } else { num2 = 1; } playerHealVfxUntil[attackerBody] = Time.time + 0.5f; goto IL_0103; IL_0103: if (num2 != 0 && Object.op_Implicit((Object)(object)healEffectPrefab)) { EffectData val = new EffectData { origin = report.attackerBody.corePosition }; val.SetNetworkedObjectReference(((Component)report.attackerBody).gameObject); EffectManager.SpawnEffect(healEffectPrefab, val, true); } } private void RefreshBodies() { if (!(Time.time < nextBodyRefresh)) { nextBodyRefresh = Time.time + 0.5f; cachedBodies = Object.FindObjectsOfType<CharacterBody>(); } } } public class ContainmentLeap : CrowdControlLeap { public override void OnEnter() { //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_001f: 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_0096: Unknown result type (might be due to invalid IL or missing references) Vector3 inheritedVelocity = (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) ? ((EntityState)this).characterMotor.velocity : Vector3.zero); CopyVanillaLeapFields(this); TuneLeapFields(); EnforcerAltsPlugin.DebugLog($"ContainmentLeap tuned fields type={((object)this).GetType().Name} fwd={((GenericBaseLeap)this).forwardVelocity} up={((GenericBaseLeap)this).upwardVelocity}"); ((CrowdControlLeap)this).OnEnter(); ApplyLaunchVelocity(inheritedVelocity); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { EnforcerAltsPlugin.DebugLog("ContainmentLeap actual launch type=" + ((object)this).GetType().Name + " " + $"velocity={((EntityState)this).characterMotor.velocity:0.00} speed={((Vector3)(ref ((EntityState)this).characterMotor.velocity)).magnitude:0.00}"); } } protected virtual void ApplyLaunchVelocity(Vector3 inheritedVelocity) { } protected virtual void TuneLeapFields() { } private static void CopyVanillaLeapFields(ContainmentLeap target) { EntityState obj = EntityStateCatalog.InstantiateState(typeof(CrowdControlLeap)); CrowdControlLeap val = (CrowdControlLeap)(object)((obj is CrowdControlLeap) ? obj : null); if (val == null) { EnforcerAltsPlugin.DebugLogWarning("ContainmentLeap: could not read vanilla leap fields."); return; } EntityStateCatalog.InitializeStateFields((EntityState)(object)val); ((GenericBaseLeap)target).minimumDuration = ((GenericBaseLeap)val).minimumDuration; ((GenericBaseLeap)target).leapSoundString = ((GenericBaseLeap)val).leapSoundString; ((GenericBaseLeap)target).airControl = ((GenericBaseLeap)val).airControl; ((GenericBaseLeap)target).aimVelocity = ((GenericBaseLeap)val).aimVelocity; ((GenericBaseLeap)target).upwardVelocity = ((GenericBaseLeap)val).upwardVelocity; ((GenericBaseLeap)target).forwardVelocity = ((GenericBaseLeap)val).forwardVelocity; ((GenericBaseLeap)target).minimumY = ((GenericBaseLeap)val).minimumY; ((GenericBaseLeap)target).inheritedVelocityFraction = ((GenericBaseLeap)val).inheritedVelocityFraction; ((GenericBaseLeap)target).minYVelocityForAnim = ((GenericBaseLeap)val).minYVelocityForAnim; ((GenericBaseLeap)target).maxYVelocityForAnim = ((GenericBaseLeap)val).maxYVelocityForAnim; ((GenericBaseLeap)target).soundLoopStartEvent = ((GenericBaseLeap)val).soundLoopStartEvent; ((GenericBaseLeap)target).soundLoopStopEvent = ((GenericBaseLeap)val).soundLoopStopEvent; ((GenericBaseLeap)target).detonateOnWallImpact = ((GenericBaseLeap)val).detonateOnWallImpact; ((GenericBaseLeap)target).landingSound = ((GenericBaseLeap)val).landingSound; EnforcerAltsPlugin.DebugLog($"ContainmentLeap base fields aim={((GenericBaseLeap)target).aimVelocity} fwd={((GenericBaseLeap)target).forwardVelocity} up={((GenericBaseLeap)target).upwardVelocity} height={CrowdControlLeap.heightOverride}"); } public override void SetNextState() { ((EntityState)this).outer.SetNextState((EntityState)(object)new ContainmentSlam()); } } public class ContainmentNode : MonoBehaviour { public GameObject owner; public TeamIndex ownerTeam; public float radius; public float expansionTime; public float duration; public float weakenDuration; public Vector3 target; public float speed = 35f; private float age; private bool created; private Rigidbody body; private void Awake() { body = ((Component)this).GetComponent<Rigidbody>(); } private void Start() { //IL_001d: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or missing references) //IL_0035: Unknown result type (might be due to invalid IL or missing references) //IL_0040: Unknown result type (might be due to invalid IL or missing references) //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) //IL_007a: Unknown result type (might be due to invalid IL or missing references) //IL_007e: 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_00a6: Unknown result type (might be due to invalid IL or missing references) //IL_00fc: Unknown result type (might be due to invalid IL or missing references) //IL_00d2: 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) if (Object.op_Implicit((Object)(object)body)) { body.useGravity = true; Vector3 val = target - ((Component)this).transform.position; Vector3 val2 = default(Vector3); ((Vector3)(ref val2))..ctor(val.x, 0f, val.z); float num = Mathf.Clamp(((Vector3)(ref val2)).magnitude / Mathf.Max(1f, speed), 0.3f, 1.2f); Vector3 velocity = val2 / num; velocity.y = (val.y - 0.5f * Physics.gravity.y * num * num) / num; body.velocity = velocity; } GameObject val3 = LegacyResourcesAPI.Load<GameObject>("RoR2/Base/Engi/EngiGrenadeGhost.prefab"); if (Object.op_Implicit((Object)(object)val3)) { GameObject obj = Object.Instantiate<GameObject>(val3, ((Component)this).transform); obj.transform.localPosition = Vector3.zero; obj.transform.localScale = Vector3.one; } EnforcerAltsPlugin.DebugLog($"ContainmentNode start: speed={speed} target={target}"); } private void FixedUpdate() { //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0067: 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) //IL_00b5: Unknown result type (might be due to invalid IL or missing references) if (!NetworkServer.active || created) { return; } age += Time.fixedDeltaTime; float num = Vector3.Distance(((Component)this).transform.position, target); if (age > 1.2f || num <= speed * Time.fixedDeltaTime + 1f) { EnforcerAltsPlugin.DebugLog("ContainmentNode reaching target, creating field"); CreateField(target); Object.Destroy((Object)(object)((Component)this).gameObject); } else if (Object.op_Implicit((Object)(object)body)) { Vector3 velocity = body.velocity; if (((Vector3)(ref velocity)).sqrMagnitude < 4f) { EnforcerAltsPlugin.DebugLog("ContainmentNode slow, creating field"); CreateField(((Component)this).transform.position); Object.Destroy((Object)(object)((Component)this).gameObject); } } } private void OnCollisionEnter(Collision collision) { //IL_001e: Unknown result type (might be due to invalid IL or missing references) if (!created && NetworkServer.active) { created = true; CreateField(((Component)this).transform.position); Object.Destroy((Object)(object)((Component)this).gameObject); } } private void CreateField(Vector3 point) { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0001: 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_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) RaycastHit val = default(RaycastHit); if (Physics.Raycast(point + Vector3.up * 5f, Vector3.down, ref val, 20f, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.world)).mask), (QueryTriggerInteraction)1)) { point = ((RaycastHit)(ref val)).point; } ContainmentFieldController.SpawnField(point, owner, ownerTeam, radius, expansionTime, duration); } } public class ContainmentSlam : BaseCharacterMain { public static float baseDuration = 1f; public static float minimumDuration = 0.1f; public static string animationString = "ShieldSlam"; public static string animationParamString = "ShieldSlam.playbackRate"; public static float slamAnimationDuration = 1f; private bool hasDeployedServer; private int slamStateHash; private int slamParamHash; private float duration; private Vector3 footPositionFromAuthority; public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)0; } public override void OnSerialize(NetworkWriter writer) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).OnSerialize(writer); writer.Write(footPositionFromAuthority); } public override void OnDeserialize(NetworkReader reader) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).OnDeserialize(reader); footPositionFromAuthority = reader.ReadVector3(); } public override void OnEnter() { //IL_0020: Unknown result type (might be due to invalid IL or missing references) //IL_0027: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_003c: Unknown result type (might be due to invalid IL or missing references) //IL_0041: Unknown result type (might be due to invalid IL or missing references) ((BaseCharacterMain)this).OnEnter(); if (((EntityState)this).isAuthority) { footPositionFromAuthority = ((EntityState)this).characterBody.footPosition; } if (footPositionFromAuthority == default(Vector3)) { footPositionFromAuthority = ((EntityState)this).characterBody.footPosition; } slamStateHash = Animator.StringToHash(animationString); slamParamHash = Animator.StringToHash(animationParamString); duration = baseDuration / ((BaseState)this).attackSpeedStat; Util.PlaySound(CrowdControlSlamGround.enterSoundString, ((EntityState)this).gameObject); ((EntityState)this).PlayAnimation("FullBody, Override", slamStateHash, slamParamHash, slamAnimationDuration / ((BaseState)this).attackSpeedStat); Detonate(); } public override void FixedUpdate() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) ((BaseCharacterMain)this).FixedUpdate(); if (Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).isAuthority) { ((EntityState)this).characterMotor.moveDirection = Vector3.zero; ((EntityState)this).characterMotor.velocity = Vector3.zero; } if (!hasDeployedServer && NetworkServer.active && ((EntityState)this).fixedAge >= minimumDuration) { DeployOnceServer(); } if (((EntityState)this).isAuthority) { Util.HandlePerformSkills(((EntityState)this).skillLocator, ((EntityState)this).inputBank); if (((EntityState)this).fixedAge >= duration) { ((EntityState)this).outer.SetNextStateToMain(); } } } private void Detonate() { //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) //IL_0050: Unknown result type (might be due to invalid IL or missing references) //IL_005a: Unknown result type (might be due to invalid IL or missing references) //IL_006b: Expected O, but got Unknown //IL_001b: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_0030: Unknown result type (might be due to invalid IL or missing references) //IL_0086: Unknown result type (might be due to invalid IL or missing references) //IL_0091: Unknown result type (might be due to invalid IL or missing references) //IL_011f: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Unknown result type (might be due to invalid IL or missing references) //IL_012e: 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 (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.moveDirection = Vector3.zero; ((EntityState)this).characterMotor.velocity = Vector3.zero; } GameObject statePrefab = GetStatePrefab(CrowdControlSlamGround.blastEffectPrefab); if (Object.op_Implicit((Object)(object)statePrefab)) { EffectManager.SpawnEffect(statePrefab, new EffectData { origin = footPositionFromAuthority, scale = CrowdControlSlamGround.blastRadius }, false); } if (!NetworkServer.active) { return; } float num = Mathf.Max(0.1f, CrowdControlSlamGround.blastRadius); Collider[] array = Physics.OverlapSphere(footPositionFromAuthority, num, LayerMask.op_Implicit(((LayerIndex)(ref LayerIndex.entityPrecise)).mask), (QueryTriggerInteraction)2); HashSet<HealthComponent> hashSet = new HashSet<HealthComponent>(); Collider[] array2 = array; foreach (Collider val in array2) { if (!Object.op_Implicit((Object)(object)val)) { continue; } HurtBox component = ((Component)val).GetComponent<HurtBox>(); HealthComponent val2 = (Object.op_Implicit((Object)(object)component) ? component.healthComponent : null); if (Object.op_Implicit((Object)(object)val2) && val2.alive && Object.op_Implicit((Object)(object)val2.body) && Object.op_Implicit((Object)(object)val2.body.teamComponent)) { TeamIndex teamIndex = val2.body.teamComponent.teamIndex; if (teamIndex != ((EntityState)this).teamComponent.teamIndex && (int)teamIndex != 0 && hashSet.Add(val2)) { SetStateOnHurt.SetStunOnObject(((Component)val2).gameObject, Config.FieldStunDuration.Value); } } } EnforcerAltsPlugin.DebugLog($"Containment slam stunned={hashSet.Count} radius={num:0.0}"); } private static GameObject GetStatePrefab(object statePrefab) { if (statePrefab == null) { return null; } PropertyInfo property = statePrefab.GetType().GetProperty("gameObject"); if (property != null) { object? value = property.GetValue(statePrefab); return (GameObject)((value is GameObject) ? value : null); } FieldInfo field = statePrefab.GetType().GetField("gameObject"); if (!(field != null)) { return null; } object? value2 = field.GetValue(statePrefab); return (GameObject)((value2 is GameObject) ? value2 : null); } private void DeployOnceServer() { //IL_0011: 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) if (!hasDeployedServer) { hasDeployedServer = true; ContainmentFieldController.SpawnField(footPositionFromAuthority, Object.op_Implicit((Object)(object)((EntityState)this).characterBody) ? ((Component)((EntityState)this).characterBody).gameObject : null, (TeamIndex)((!Object.op_Implicit((Object)(object)((EntityState)this).teamComponent)) ? (-1) : ((int)((EntityState)this).teamComponent.teamIndex)), Config.FieldRadius.Value, Config.FieldExpansionTime.Value, Config.FieldDuration.Value); } } public override void OnExit() { //IL_001b: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.moveDirection = Vector3.zero; } if (!hasDeployedServer && NetworkServer.active) { DeployOnceServer(); } ((BaseCharacterMain)this).OnExit(); } } public class FocusLaserSmash : ContainmentLeap { private const float SmashUpwardVelocity = 55f; private const float SmashForwardVelocity = 22f; private bool landingVelocityLogged; public override void FixedUpdate() { //IL_0069: Unknown result type (might be due to invalid IL or missing references) if (((EntityState)this).isAuthority && !landingVelocityLogged && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor) && ((EntityState)this).characterMotor.isGrounded && ((EntityState)this).fixedAge >= ((GenericBaseLeap)this).minimumDuration) { landingVelocityLogged = true; float num = 0f - ((EntityState)this).characterBody.baseJumpPower - 20f; EnforcerAltsPlugin.DebugLog($"FocusLaserSmash landing velocity={((EntityState)this).characterMotor.velocity:0.00} " + $"bigManThreshold={num:0.00} " + $"canTriggerBigMan={((EntityState)this).characterMotor.velocity.y <= num}"); } ((GenericBaseLeap)this).FixedUpdate(); } protected override void TuneLeapFields() { ((GenericBaseLeap)this).forwardVelocity = 22f; ((GenericBaseLeap)this).upwardVelocity = 55f; } public override float GetUpwardVelocityVector() { EnforcerAltsPlugin.DebugLog("FocusLaserSmash upward velocity override=55"); return 55f; } protected override void ApplyLaunchVelocity(Vector3 inheritedVelocity) { //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) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_002b: Unknown result type (might be due to invalid IL or missing references) //IL_002e: 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_0051: Unknown result type (might be due to invalid IL or missing references) //IL_0085: Unknown result type (might be due to invalid IL or missing references) //IL_0090: Unknown result type (might be due to invalid IL or missing references) //IL_009b: Unknown result type (might be due to invalid IL or missing references) //IL_00a0: Unknown result type (might be due to invalid IL or missing references) //IL_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_00b4: Unknown result type (might be due to invalid IL or missing references) //IL_00ba: Unknown result type (might be due to invalid IL or missing references) //IL_00bf: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Unknown result type (might be due to invalid IL or missing references) //IL_00cb: Unknown result type (might be due to invalid IL or missing references) //IL_00d0: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00e5: Unknown result type (might be due to invalid IL or missing references) //IL_0070: Unknown result type (might be due to invalid IL or missing references) //IL_0075: Unknown result type (might be due to invalid IL or missing references) landingVelocityLogged = false; if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { Ray aimRay = ((BaseState)this).GetAimRay(); Vector3 direction = ((Ray)(ref aimRay)).direction; direction.y = Mathf.Max(direction.y, ((GenericBaseLeap)this).minimumY); Vector3 forward = default(Vector3); ((Vector3)(ref forward))..ctor(direction.x, 0f, direction.z); if (((Vector3)(ref forward)).sqrMagnitude < 0.001f) { forward = ((EntityState)this).transform.forward; } ((Vector3)(ref forward)).Normalize(); ((EntityState)this).characterMotor.velocity = ((Vector3)(ref direction)).normalized * ((GenericBaseLeap)this).aimVelocity * ((BaseState)this).moveSpeedStat + Vector3.up * 55f + forward * 22f + inheritedVelocity * ((GenericBaseLeap)this).inheritedVelocityFraction; EnforcerAltsPlugin.DebugLog($"FocusLaserSmash forced launch velocity={((EntityState)this).characterMotor.velocity:0.00} " + $"speed={((Vector3)(ref ((EntityState)this).characterMotor.velocity)).magnitude:0.00}"); } } public override void SetNextState() { ((EntityState)this).outer.SetNextState((EntityState)(object)new FocusLaserSmashSlam()); } } public class FocusLaserSmashSlam : BaseCharacterMain { private const float Duration = 0.8f; private const float ShockwaveDelay = 0.1f; private static GameObject shockwavePrefab; private Vector3 footPositionFromAuthority; private bool shockwaveSpawned; private bool knockbackChecked; private readonly Dictionary<CharacterBody, Vector3> knockbackStartPositions = new Dictionary<CharacterBody, Vector3>(); public override void OnSerialize(NetworkWriter writer) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).OnSerialize(writer); writer.Write(footPositionFromAuthority); } public override void OnDeserialize(NetworkReader reader) { //IL_0009: Unknown result type (might be due to invalid IL or missing references) //IL_000e: Unknown result type (might be due to invalid IL or missing references) ((EntityState)this).OnDeserialize(reader); footPositionFromAuthority = reader.ReadVector3(); } public override void OnEnter() { //IL_0020: 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_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0038: Unknown result type (might be due to invalid IL or missing references) //IL_003d: Unknown result type (might be due to invalid IL or missing references) //IL_00ae: Unknown result type (might be due to invalid IL or missing references) //IL_00be: Unknown result type (might be due to invalid IL or missing references) //IL_00c3: Unknown result type (might be due to invalid IL or missing references) ((BaseCharacterMain)this).OnEnter(); if (((EntityState)this).isAuthority) { footPositionFromAuthority = ((EntityState)this).characterBody.footPosition; } if (footPositionFromAuthority == Vector3.zero) { footPositionFromAuthority = ((EntityState)this).characterBody.footPosition; } ((EntityState)this).PlayAnimation("FullBody, Override", "KineticCharge_Jump_land", "CrowdControlGroundEnd.playbackRate", 0.8f / Mathf.Max(0.01f, ((BaseState)this).attackSpeedStat), 0f); Util.PlaySound("Play_Char_Enforcer_SpecialA_Rally_Leap_Land", ((EntityState)this).gameObject); ((EntityState)this).characterBody.SetAimTimer(1f); if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.moveDirection = Vector3.zero; ((EntityState)this).characterMotor.velocity = Vector3.zero; } } public override void FixedUpdate() { //IL_0021: Unknown result type (might be due to invalid IL or missing references) //IL_0031: Unknown result type (might be due to invalid IL or missing references) //IL_0036: Unknown result type (might be due to invalid IL or missing references) ((BaseCharacterMain)this).FixedUpdate(); if (((EntityState)this).isAuthority && Object.op_Implicit((Object)(object)((EntityState)this).characterMotor)) { ((EntityState)this).characterMotor.moveDirection = Vector3.zero; ((EntityState)this).characterMotor.velocity = Vector3.zero; } if (((EntityState)this).isAuthority && !shockwaveSpawned && ((EntityState)this).fixedAge >= 0.1f) { shockwaveSpawned = true; SpawnShockwave(); } if (((EntityState)this).isAuthority && shockwaveSpawned && !knockbackChecked && ((EntityState)this).fixedAge >= 0.45f) { knockbackChecked = true; LogKnockbackResults(); } if (((EntityState)this).isAuthority && ((EntityState)this).fixedAge >= 0.8f) { ((EntityState)this).outer.SetNextStateToMain(); } } private void SpawnShockwave() { //IL_0015: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_0026: Unknown result type (might be due to invalid IL or missing references) //IL_0032: Unknown result type (might be due to invalid IL or mis