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 v0.1.0
EnforcerTweaks.dll
Decompiled 7 hours ago
The result has been truncated due to the large size, download it to view full contents!
using System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.IO; using System.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.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("0.1.0.0")] [assembly: AssemblyInformationalVersion("0.1.0")] [assembly: AssemblyProduct("EnforcerTweaks")] [assembly: AssemblyTitle("EnforcerTweaks")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("0.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", "0.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.*/)] [R2APISubmoduleDependency(new string[] { "LanguageAPI", "RecalculateStatsAPI", "ProcTypeAPI", "PrefabAPI" })] public class EnforcerAltsPlugin : BaseUnityPlugin { [CompilerGenerated] private static class <>O { public static hook_OnEnter <0>__TauntState_OnEnter; public static hook_InitializeProjectile <1>__OnInitializeProjectile; public static hook_OnProjectileImpact <2>__ProjectileImpactExplosion_OnProjectileImpact; } 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_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_005d: Expected O, but got Unknown //IL_0072: Unknown result type (might be due to invalid IL or missing references) //IL_0077: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown //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: 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(); 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; object obj3 = <>O.<2>__ProjectileImpactExplosion_OnProjectileImpact; if (obj3 == null) { hook_OnProjectileImpact val3 = ProjectileImpactExplosion_OnProjectileImpact; <>O.<2>__ProjectileImpactExplosion_OnProjectileImpact = val3; obj3 = (object)val3; } ProjectileImpactExplosion.OnProjectileImpact += (hook_OnProjectileImpact)obj3; ((BaseUnityPlugin)this).Logger.LogInfo((object)"Enforcer Tweaks 0.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_00d6: Unknown result type (might be due to invalid IL or missing references) //IL_00e0: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(controller, info); if (BreacherSlug.firing && Object.op_Implicit((Object)(object)controller)) { controller.procCoefficient = 1f; ProjectileImpactExplosion component = ((Component)controller).GetComponent<ProjectileImpactExplosion>(); if (Object.op_Implicit((Object)(object)component)) { ((ProjectileExplosion)component).blastRadius = 0f; component.destroyOnEnemy = false; component.detonateOnEnemy = false; component.destroyOnWorld = true; ((ProjectileExplosion)component).childrenCount = 0; ((ProjectileExplosion)component).childrenProjectilePrefab = null; component.lifetime = 20f; component.lifetimeAfterImpact = 0f; component.lifetimeRandomOffset = 0f; } ProjectileSimple component2 = ((Component)controller).GetComponent<ProjectileSimple>(); if (Object.op_Implicit((Object)(object)component2)) { component2.lifetime = 20f; } Rigidbody component3 = ((Component)controller).GetComponent<Rigidbody>(); if (Object.op_Implicit((Object)(object)component3)) { component3.useGravity = 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 ProjectileImpactExplosion_OnProjectileImpact(orig_OnProjectileImpact orig, ProjectileImpactExplosion self, ProjectileImpactInfo impactInfo) { //IL_0002: 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_00cd: 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_00f6: Unknown result type (might be due to invalid IL or missing references) //IL_0102: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_0104: Unknown result type (might be due to invalid IL or missing references) //IL_0109: Unknown result type (might be due to invalid IL or missing references) //IL_010e: Unknown result type (might be due to invalid IL or missing references) //IL_012b: Unknown result type (might be due to invalid IL or missing references) //IL_0144: 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_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_0187: Unknown result type (might be due to invalid IL or missing references) //IL_017c: Unknown result type (might be due to invalid IL or missing references) //IL_0182: Unknown result type (might be due to invalid IL or missing references) //IL_018c: Unknown result type (might be due to invalid IL or missing references) //IL_0191: Unknown result type (might be due to invalid IL or missing references) //IL_01ac: Unknown result type (might be due to invalid IL or missing references) //IL_01c0: Unknown result type (might be due to invalid IL or missing references) //IL_01b7: 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_01cc: Expected O, but got Unknown orig.Invoke(self, impactInfo); if (!NetworkServer.active || !Object.op_Implicit((Object)(object)self)) { return; } SlugMarker component = ((Component)self).GetComponent<SlugMarker>(); if (!Object.op_Implicit((Object)(object)component)) { return; } Collider collider = impactInfo.collider; if (!Object.op_Implicit((Object)(object)collider)) { return; } HurtBox component2 = ((Component)collider).GetComponent<HurtBox>(); if (Object.op_Implicit((Object)(object)component2) && Object.op_Implicit((Object)(object)component2.healthComponent) && component2.healthComponent.alive && component.hitBodies.Add(component2.healthComponent)) { ProjectileController component3 = ((Component)self).GetComponent<ProjectileController>(); ProjectileDamage component4 = ((Component)self).GetComponent<ProjectileDamage>(); CharacterBody val = ((Object.op_Implicit((Object)(object)component3) && Object.op_Implicit((Object)(object)component3.owner)) ? component3.owner.GetComponent<CharacterBody>() : null); if (!Object.op_Implicit((Object)(object)val) || !((Object)(object)((Component)val).gameObject == (Object)(object)((Component)component2.healthComponent).gameObject)) { DamageInfo val2 = new DamageInfo { attacker = ((Object.op_Implicit((Object)(object)component3) && Object.op_Implicit((Object)(object)component3.owner)) ? component3.owner : null), inflictor = ((Component)self).gameObject, position = impactInfo.estimatedPointOfImpact, damage = (Object.op_Implicit((Object)(object)component4) ? component4.damage : 0f), crit = (Object.op_Implicit((Object)(object)component4) && component4.crit), force = (Object.op_Implicit((Object)(object)component4) ? component4.force : 0f) * ((Component)self).transform.forward, procChainMask = (ProcChainMask)(Object.op_Implicit((Object)(object)component3) ? component3.procChainMask : default(ProcChainMask)), procCoefficient = (Object.op_Implicit((Object)(object)component3) ? component3.procCoefficient : 1f), damageType = (Object.op_Implicit((Object)(object)component4) ? component4.damageType : DamageTypeCombo.op_Implicit((DamageType)0)) }; component2.healthComponent.TakeDamage(val2); GlobalEventManager.instance.OnHitAll(val2, ((Component)component2.healthComponent).gameObject); ((ProjectileExplosion)self).alive = 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 = "0.1.0"; } } namespace EnforcerAlts.States { public class BreacherShot : FireRiotShotgun { private static GameObject scaledTracerPrefab; private float damageMultiplier = 1f; private float spreadMultiplier = 1f; public override void OnEnter() { //IL_00a9: 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) ((GenericBulletBaseState)this).baseDuration = 0.4f; ((GenericBulletBaseState)this).muzzleName = "MuzzleGun"; ((GenericBulletBaseState)this).bulletCount = 6; ((GenericBulletBaseState)this).damageCoefficient = 0.7f; ((GenericBulletBaseState)this).minSpread = 1f; ((GenericBulletBaseState)this).maxSpread = 3f; ((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 = TryLoad("RoR2/DLC4/Enforcer/EnforcerRiotShotgunHit.prefab"); ((FireRiotShotgun)this).OnEnter(); EnforcerAltsPlugin.DebugLog($"BreacherShot fired: bullets={((GenericBulletBaseState)this).bulletCount} coeff={((GenericBulletBaseState)this).damageCoefficient}"); EnforcerBodyState enforcerBodyState = (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) ? ((Component)((EntityState)this).characterBody).GetComponent<EnforcerBodyState>() : null); if (Object.op_Implicit((Object)(object)enforcerBodyState)) { float cycle = ((((GenericBulletBaseState)this).duration > 0f) ? ((GenericBulletBaseState)this).duration : ((GenericBulletBaseState)this).baseDuration); enforcerBodyState.RegisterBreacherShot(cycle); EnforcerAltsPlugin.DebugLog($"Breacher shot: count {enforcerBodyState.breacherShotCount}"); damageMultiplier = 1f; spreadMultiplier = enforcerBodyState.BreacherSpreadMultiplier; } } public override void FireBullet(Ray aimRay) { //IL_0020: 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) if (Object.op_Implicit((Object)(object)((GenericBulletBaseState)this).muzzleTransform)) { ((Ray)(ref aimRay)).origin = ((GenericBulletBaseState)this).muzzleTransform.position; } ((GenericBulletBaseState)this).FireBullet(aimRay); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)2; } public override void ModifyBullet(BulletAttack bulletAttack) { ((FireRiotShotgun)this).ModifyBullet(bulletAttack); bulletAttack.damage *= damageMultiplier; bulletAttack.minSpread *= spreadMultiplier; bulletAttack.maxSpread *= spreadMultiplier; EnforcerAltsPlugin.DebugLog(string.Format("Breacher bullet: count={0} damage={1} tracer={2}", bulletAttack.bulletCount, bulletAttack.damage, Object.op_Implicit((Object)(object)bulletAttack.tracerEffectPrefab) ? ((Object)bulletAttack.tracerEffectPrefab).name : "null")); } 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; public static bool firing; public static GameObject projectilePrefab; public override void OnEnter() { ((BaseState)this).OnEnter(); interval = Config.SlugInterval.Value / ((BaseState)this).attackSpeedStat; 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_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) //IL_0221: Unknown result type (might be due to invalid IL or missing references) //IL_0235: Unknown result type (might be due to invalid IL or missing references) //IL_0236: Unknown result type (might be due to invalid IL or missing references) //IL_023d: Unknown result type (might be due to invalid IL or missing references) //IL_023f: Unknown result type (might be due to invalid IL or missing references) //IL_0244: Unknown result type (might be due to invalid IL or missing references) //IL_0292: Unknown result type (might be due to invalid IL or missing references) //IL_0299: Unknown result type (might be due to invalid IL or missing references) //IL_02a8: Unknown result type (might be due to invalid IL or missing references) //IL_02cd: Unknown result type (might be due to invalid IL or missing references) //IL_02d2: Unknown result type (might be due to invalid IL or missing references) //IL_02d3: Unknown result type (might be due to invalid IL or missing references) //IL_02d4: Unknown result type (might be due to invalid IL or missing references) //IL_02db: Unknown result type (might be due to invalid IL or missing references) //IL_02e0: Unknown result type (might be due to invalid IL or missing references) //IL_02ea: Unknown result type (might be due to invalid IL or missing references) //IL_02eb: Unknown result type (might be due to invalid IL or missing references) //IL_02ec: Unknown result type (might be due to invalid IL or missing references) //IL_02f1: Unknown result type (might be due to invalid IL or missing references) //IL_02fe: Expected O, but got Unknown if (fired) { return; } 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; } GenericSkill val6 = ((Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.skillLocator)) ? ((EntityState)this).characterBody.skillLocator.primary : null); BreacherSlugTracker breacherSlugTracker = (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) ? ((Component)((EntityState)this).characterBody).GetComponent<BreacherSlugTracker>() : null); if (!Object.op_Implicit((Object)(object)breacherSlugTracker) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { breacherSlugTracker = ((Component)((EntityState)this).characterBody).gameObject.AddComponent<BreacherSlugTracker>(); } if (Object.op_Implicit((Object)(object)val6) && Object.op_Implicit((Object)(object)breacherSlugTracker) && val6.stock >= val6.maxStock) { breacherSlugTracker.fullyCharged = true; } bool flag = Object.op_Implicit((Object)(object)breacherSlugTracker) && breacherSlugTracker.fullyCharged && Object.op_Implicit((Object)(object)val6) && val6.stock <= 1; if (flag) { breacherSlugTracker.fullyCharged = false; } 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) }); GameObject val7 = EnforcerAssets.TryLoad("RoR2/DLC4/Enforcer/EnforcerRiotShotgunTracerSlug.prefab"); if (Object.op_Implicit((Object)(object)val7)) { EffectData val8 = new EffectData { origin = val2 + normalized * 100f, start = val2, scale = 1f }; EffectManager.SpawnEffect(val7, val8, true); } 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_00f2: Unknown result type (might be due to invalid IL or missing references) //IL_00f7: Unknown result type (might be due to invalid IL or missing references) //IL_0103: Unknown result type (might be due to invalid IL or missing references) //IL_010a: Unknown result type (might be due to invalid IL or missing references) //IL_010b: Unknown result type (might be due to invalid IL or missing references) //IL_0111: Unknown result type (might be due to invalid IL or missing references) //IL_0112: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_0118: Unknown result type (might be due to invalid IL or missing references) //IL_012f: Unknown result type (might be due to invalid IL or missing references) //IL_0136: Unknown result type (might be due to invalid IL or missing references) //IL_0141: Unknown result type (might be due to invalid IL or missing references) //IL_014c: 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_0159: Unknown result type (might be due to invalid IL or missing references) //IL_015e: Unknown result type (might be due to invalid IL or missing references) //IL_0164: 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_016e: 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_0184: Unknown result type (might be due to invalid IL or missing references) //IL_0194: Unknown result type (might be due to invalid IL or missing references) //IL_01a3: Unknown result type (might be due to invalid IL or missing references) //IL_01ab: Unknown result type (might be due to invalid IL or missing references) //IL_01b5: Expected O, but got Unknown //IL_01b5: Unknown result type (might be due to invalid IL or missing references) //IL_01bc: 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); GenericSkill val2 = ((Object.op_Implicit((Object)(object)((EntityState)this).characterBody) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody.skillLocator)) ? ((EntityState)this).characterBody.skillLocator.primary : null); BreacherSlugTracker breacherSlugTracker = (Object.op_Implicit((Object)(object)((EntityState)this).characterBody) ? ((Component)((EntityState)this).characterBody).GetComponent<BreacherSlugTracker>() : null); if (!Object.op_Implicit((Object)(object)breacherSlugTracker) && Object.op_Implicit((Object)(object)((EntityState)this).characterBody)) { breacherSlugTracker = ((Component)((EntityState)this).characterBody).gameObject.AddComponent<BreacherSlugTracker>(); } if (Object.op_Implicit((Object)(object)val2) && Object.op_Implicit((Object)(object)breacherSlugTracker) && val2.stock >= val2.maxStock) { breacherSlugTracker.fullyCharged = true; } bool flag = Object.op_Implicit((Object)(object)breacherSlugTracker) && breacherSlugTracker.fullyCharged && Object.op_Implicit((Object)(object)val2) && val2.stock <= 1; if (flag) { breacherSlugTracker.fullyCharged = false; } 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 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; } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); 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; } 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> repelTimers = new Dictionary<CharacterBody, float>(); private readonly Dictionary<CharacterBody, float> playerHealTimers = new Dictionary<CharacterBody, float>(); private readonly Dictionary<CharacterBody, float> playerLingerUntil = new Dictionary<CharacterBody, float>(); private readonly List<CharacterBody> weakenedBodies = new List<CharacterBody>(); private readonly HashSet<CharacterBody> revitalizedBodies = 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_00c7: 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_00d9: 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) 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); if (Object.op_Implicit((Object)(object)val3.GetComponent<NetworkIdentity>())) { NetworkServer.Spawn(val3); } containmentFieldController.SetVisual(val3); } else { EnforcerAltsPlugin.DebugLog("Containment areaPrefab null"); } containmentFieldController.ApplyInitialWeaken(); return containmentFieldController; } private void OnDestroy() { //IL_00ad: 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) active.Remove(this); GlobalEventManager.onServerDamageDealt -= OnDamageDealt; ExitVisual(visual); ExitVisual(radiusVisual); if (Object.op_Implicit((Object)(object)EnforcerAssets.RevitalizingBuff)) { foreach (CharacterBody revitalizedBody in revitalizedBodies) { if (!Object.op_Implicit((Object)(object)revitalizedBody)) { continue; } bool flag = false; foreach (ContainmentFieldController item in active) { if (!((Object)(object)item == (Object)(object)this) && Object.op_Implicit((Object)(object)item)) { float num = (item.ending ? item.radius : item.CurrentRadius); if (Vector3.Distance(revitalizedBody.corePosition, ((Component)item).transform.position) <= num) { flag = true; break; } } } if (!flag && revitalizedBody.HasBuff(EnforcerAssets.RevitalizingBuff)) { revitalizedBody.RemoveBuff(EnforcerAssets.RevitalizingBuff); } } } revitalizedBodies.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); } private 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 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 (!Object.op_Implicit((Object)(object)EnforcerAssets.RevitalizingBuff)) { continue; } bool flag2 = val.HasBuff(EnforcerAssets.RevitalizingBuff); float value; if (flag) { playerLingerUntil[val] = Time.time + Config.FieldLingerDuration.Value; if (!flag2) { val.AddBuff(EnforcerAssets.RevitalizingBuff); revitalizedBodies.Add(val); } } else if (flag2 && (!playerLingerUntil.TryGetValue(val, out value) || !(Time.time < value))) { val.RemoveBuff(EnforcerAssets.RevitalizingBuff); revitalizedBodies.Remove(val); playerLingerUntil.Remove(val); } } 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 bool CanRepel(CharacterBody body) { if (!repelTimers.TryGetValue(body, out var value)) { return true; } if (Time.time < value) { return false; } repelTimers.Remove(body); return true; } 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_00d3: Unknown result type (might be due to invalid IL or missing references) //IL_00d9: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0133: Unknown result type (might be due to invalid IL or missing references) //IL_013a: Unknown result type (might be due to invalid IL or missing references) //IL_0146: 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); float value; bool flag = playerLingerUntil.TryGetValue(report.attackerBody, out value) && Time.time < value; if ((num || flag) && (!playerHealTimers.TryGetValue(report.attackerBody, out var value2) || !(Time.time < value2)) && Object.op_Implicit((Object)(object)report.attackerBody.healthComponent)) { report.attackerBody.healthComponent.Heal(report.attackerBody.maxHealth * 0.02f, default(ProcChainMask), true); playerHealTimers[report.attackerBody] = Time.time + 0.5f; if ((Object)(object)healEffectPrefab == (Object)null) { healEffectPrefab = EnforcerAssets.TryLoad("RoR2/Base/Medkit/MedkitHealEffect.prefab"); } if (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 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 RetaliationPassiveState : BaseSkillState { public override void OnEnter() { ((BaseState)this).OnEnter(); if (((EntityState)this).isAuthority) { ((EntityState)this).outer.SetNextStateToMain(); } } public override void FixedUpdate() { ((EntityState)this).FixedUpdate(); } public override InterruptPriority GetMinimumInterruptPriority() { return (InterruptPriority)0; } } public class SlugMarker : MonoBehaviour { public readonly HashSet<HealthComponent> hitBodies = new HashSet<HealthComponent>(); public float scale = 1f; private void Start() { //IL_0006: 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) ((Component)this).transform.localScale = Vector3.one * scale; } private void OnTriggerEnter(Collider collider) { //IL_00ac: Unknown result type (might be due to invalid IL or missing references) //IL_00b1: 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_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e9: Unknown result type (might be due to invalid IL or missing references) //IL_00ee: Unknown result type (might be due to invalid IL or missing references) //IL_00f3: Unknown result type (might be due to invalid IL or missing references) //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_0113: Unknown result type (might be due to invalid IL or missing references) //IL_012a: Unknown result type (might be due to invalid IL or missing references) //IL_0146: Unknown result type (might be due to invalid IL or missing references) //IL_014b: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_016b: Unknown result type (might be due to invalid IL or missing references) //IL_0160: Unknown result type (might be due to invalid IL or missing references) //IL_0166: Unknown result type (might be due to invalid IL or missing references) //IL_0170: Unknown result type (might be due to invalid IL or missing references) //IL_0175: Unknown result type (might be due to invalid IL or missing references) //IL_0190: 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) //IL_019a: Unknown result type (might be due to invalid IL or missing references) //IL_01a7: Unknown result type (might be due to invalid IL or missing references) //IL_01ae: Expected O, but got Unknown if (!NetworkServer.active || !Object.op_Implicit((Object)(object)collider)) { return; } HurtBox component = ((Component)collider).GetComponent<HurtBox>(); ProjectileController component2 = ((Component)this).GetComponent<ProjectileController>(); ProjectileDamage component3 = ((Component)this).GetComponent<ProjectileDamage>(); if (Object.op_Implicit((Object)(object)component) && Object.op_Implicit((Object)(object)component.healthComponent) && component.healthComponent.alive) { if (hitBodies.Add(component.healthComponent)) { CharacterBody val = ((Object.op_Implicit((Object)(object)component2) && Object.op_Implicit((Object)(object)component2.owner)) ? component2.owner.GetComponent<CharacterBody>() : null); if (!Object.op_Implicit((Object)(object)val) || !((Object)(object)((Component)val).gameObject == (Object)(object)((Component)component.healthComponent).gameObject)) { DamageInfo val2 = new DamageInfo { attacker = ((Object.op_Implicit((Object)(object)component2) && Object.op_Implicit((Object)(object)component2.owner)) ? component2.owner : null), inflictor = ((Component)this).gameObject, position = collider.ClosestPoint(((Component)this).transform.position), damage = (Object.op_Implicit((Object)(object)component3) ? component3.damage : 0f), crit = (Object.op_Implicit((Object)(object)component3) && component3.crit), force = (Object.op_Implicit((Object)(object)component3) ? component3.force : 0f) * ((Component)this).transform.forward, procChainMask = (ProcChainMask)(Object.op_Implicit((Object)(object)component2) ? component2.procChainMask : default(ProcChainMask)), procCoefficient = (Object.op_Implicit((Object)(object)component2) ? component2.procCoefficient : 1f), damageType = (Object.op_Implicit((Object)(object)component3) ? component3.damageType : DamageTypeCombo.op_Implicit((DamageType)0)) }; component.healthComponent.TakeDamage(val2); GlobalEventManager.instance.OnHitAll(val2, ((Component)component.healthComponent).gameObject); } } } else if (!Object.op_Implicit((Object)(object)((Component)collider).GetComponentInParent<HurtBox>())) { int layer = ((Component)collider).gameObject.layer; if (layer != LayerIndex.entityPrecise.intVal && layer != LayerIndex.projectile.intVal && layer != LayerIndex.triggerZone.intVal) { Object.Destroy((Object)(object)((Component)this).gameObject); } } } } } namespace EnforcerAlts.Modules { public static class RetaliationModule { [CompilerGenerated] private static class <>O { public static hook_OnBodyStart <0>__OnBodyStart; public static hook_OnBodyDestroyed <1>__OnBodyDestroyed; public static Action<DamageReport> <2>__OnDamageDealt; public static StatHookEventHandler <3>__AddArmor; public static hook_OnEnter <4>__ProtectAndServeDeactivate_OnEnter; public static hook_Init <5>__SurvivorCatalog_Init; } public static ModdedProcType RetaliationProc; public static GameObject RetaliationEffectPrefab; public static void Init() { //IL_0000: Unknown result type (might be due to invalid IL or missing references) //IL_0005: Unknown result type (might be due to invalid IL or missing references) //IL_001a: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0025: Expected O, but got Unknown //IL_003a: Unknown result type (might be due to invalid IL or missing references) //IL_003f: Unknown result type (might be due to invalid IL or missing references) //IL_0045: Expected O, but got Unknown //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: Expected O, but got Unknown //IL_009a: Unknown result type (might be due to invalid IL or missing references) //IL_009f: Unknown result type (might be due to invalid IL or missing references) //IL_00a5: Expected O, but got Unknown //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_00c5: Expected O, but got Unknown RetaliationProc = ProcTypeAPI.ReserveProcType(); object obj = <>O.<0>__OnBodyStart; if (obj == null) { hook_OnBodyStart val = OnBodyStart; <>O.<0>__OnBodyStart = val; obj = (object)val; } CharacterMaster.OnBodyStart += (hook_OnBodyStart)obj; object obj2 = <>O.<1>__OnBodyDestroyed; if (obj2 == null) { hook_OnBodyDestroyed val2 = OnBodyDestroyed; <>O.<1>__OnBodyDestroyed = val2; obj2 = (object)val2; } CharacterMaster.OnBodyDestroyed += (hook_OnBodyDestroyed)obj2; GlobalEventManager.onServerDamageDealt += OnDamageDealt; object obj3 = <>O.<3>__AddArmor; if (obj3 == null) { StatHookEventHandler val3 = AddArmor; <>O.<3>__AddArmor = val3; obj3 = (object)val3; } RecalculateStatsAPI.GetStatCoefficients += (StatHookEventHandler)obj3; object obj4 = <>O.<4>__ProtectAndServeDeactivate_OnEnter; if (obj4 == null) { hook_OnEnter val4 = ProtectAndServeDeactivate_OnEnter; <>O.<4>__ProtectAndServeDeactivate_OnEnter = val4; obj4 = (object)val4; } ProtectAndServeDeactivate.OnEnter += (hook_OnEnter)obj4; object obj5 = <>O.<5>__SurvivorCatalog_Init; if (obj5 == null) { hook_Init val5 = SurvivorCatalog_Init; <>O.<5>__SurvivorCatalog_Init = val5; obj5 = (object)val5; } SurvivorCatalog.Init += (hook_Init)obj5; } private static void SurvivorCatalog_Init(orig_Init orig) { //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Expected O, but got Unknown //IL_0101: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(); if ((Object)(object)EnforcerAssets.BreacherDef == (Object)null || (Object)(object)EnforcerAssets.BreacherSlugDef == (Object)null) { EnforcerAltsPlugin.DebugLog("EnforcerAlts: skill defs null in SurvivorCatalog_Init"); return; } SkillTransformationController val = default(SkillTransformationController); foreach (SurvivorDef allSurvivorDef in SurvivorCatalog.allSurvivorDefs) { if ((Object)(object)allSurvivorDef == (Object)null || (Object)(object)allSurvivorDef.bodyPrefab == (Object)null || allSurvivorDef.displayNameToken != "ENFORCER2_BODY_NAME" || !SkillTransformationController.TryFindByCustomName(allSurvivorDef.bodyPrefab, "ProtectAndServe", ref val) || !Object.op_Implicit((Object)(object)val)) { continue; } bool flag = false; foreach (SkillDefRelationship transformationSkillDef in val.transformationSkillDefs) { if ((Object)(object)transformationSkillDef.skillDef == (Object)(object)EnforcerAssets.BreacherDef) { flag = true; break; } } if (!flag) { SkillDefRelationship val2 = new SkillDefRelationship(); val2.skillDef = EnforcerAssets.BreacherDef; val2.overrideSkillDef = EnforcerAssets.BreacherSlugDef; val2.priority = (SkillOverridePriority)2; val.transformationSkillDefs.Add(val2); EnforcerAltsPlugin.DebugLog("EnforcerAlts: added Breacher transformation relationship"); } } } private static void ProtectAndServeDeactivate_OnEnter(orig_OnEnter orig, ProtectAndServeDeactivate self) { //IL_0080: 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_00b1: Unknown result type (might be due to invalid IL or missing references) //IL_00b6: Unknown result type (might be due to invalid IL or missing references) //IL_00c2: Unknown result type (might be due to invalid IL or missing references) //IL_00ce: Unknown result type (might be due to invalid IL or missing references) //IL_00d5: Unknown result type (might be due to invalid IL or missing references) //IL_00da: Unknown result type (might be due to invalid IL or missing references) //IL_00df: Unknown result type (might be due to invalid IL or missing references) //IL_00e1: Unknown result type (might be due to invalid IL or missing references) //IL_00e6: Unknown result type (might be due to invalid IL or missing references) //IL_00eb: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Unknown result type (might be due to invalid IL or missing references) //IL_0105: Unknown result type (might be due to invalid IL or missing references) //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011a: Unknown result type (might be due to invalid IL or missing references) //IL_0124: Unknown result type (might be due to invalid IL or missing references) //IL_0129: Unknown result type (might be due to invalid IL or missing references) //IL_012e: Unknown result type (might be due to invalid IL or missing references) //IL_0139: Unknown result type (might be due to invalid IL or missing references) //IL_013b: Unknown result type (might be due to invalid IL or missing references) //IL_0140: Unknown result type (might be due to invalid IL or missing references) //IL_0142: Unknown result type (might be due to invalid IL or missing references) //IL_0147: Unknown result type (might be due to invalid IL or missing references) //IL_0149: Unknown result type (might be due to invalid IL or missing references) //IL_0150: Unknown result type (might be due to invalid IL or missing references) //IL_0155: Unknown result type (might be due to invalid IL or missing references) //IL_015a: Unknown result type (might be due to invalid IL or missing references) //IL_015b: Unknown result type (might be due to invalid IL or missing references) //IL_015d: Unknown result type (might be due to invalid IL or missing references) //IL_0162: Unknown result type (might be due to invalid IL or missing references) //IL_0174: Unknown result type (might be due to invalid IL or missing references) //IL_0179: Unknown result type (might be due to invalid IL or missing references) //IL_017b: 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_018f: Expected O, but got Unknown orig.Invoke(self); if (!NetworkServer.active) { return; } CharacterBody characterBody = ((EntityState)self).characterBody; if (!Object.op_Implicit((Object)(object)characterBody)) { return; } EnforcerBodyState component = ((Component)characterBody).GetComponent<EnforcerBodyState>(); if (!Object.op_Implicit((Object)(object)component)) { return; } int num = component.ConsumeRetaliation(); if (num >= Config.RetaliationMinStacks.Value) { if ((Object)(object)RetaliationEffectPrefab == (Object)null) { RetaliationEffectPrefab = EnforcerAssets.TryLoad("RoR2/DLC4/Enforcer/EnfKineticChargeExplosionVFX.prefab"); } float baseDamage = characterBody.damage * Config.RetaliationDamagePerStack.Value * (float)num; ProcChainMask procChainMask = default(ProcChainMask); ProcTypeAPI.AddModdedProc(ref procChainMask, RetaliationProc); float num2 = Mathf.Lerp(0.5f, 1.2f, (float)num / (float)Config.MaxRetaliationStacks.Value); new BlastAttack { attacker = ((Component)characterBody).gameObject, inflictor = ((Component)characterBody).gameObject, teamIndex = characterBody.teamComponent.teamIndex, position = characterBody.corePosition, radius = Config.RetaliationRadius.Value * num2, baseDamage = baseDamage, baseForce = 24f + (float)num * 5f, bonusForce = Vector3.up * 3f, procCoefficient = 0.8f, falloffModel = (FalloffModel)0, attackerFiltering = (AttackerFiltering)2, damageType = new DamageTypeCombo(DamageTypeCombo.op_Implicit((DamageType)0), (DamageTypeExtended)0, (DamageSource)8), procChainMask = procChainMask }.Fire(); if (Object.op_Implicit((Object)(object)RetaliationEffectPrefab)) { EffectData val = new EffectData { origin = characterBody.corePosition, scale = num2 }; EffectManager.SpawnEffect(RetaliationEffectPrefab, val, true); } characterBody.healthComponent.AddBarrier(characterBody.maxHealth * Config.RetaliationBarrierPerStack.Value * (float)num); } } private static void OnBodyStart(orig_OnBodyStart orig, CharacterMaster self, CharacterBody body) { //IL_00f8: Unknown result type (might be due to invalid IL or missing references) //IL_00fe: Expected O, but got Unknown //IL_011c: Unknown result type (might be due to invalid IL or missing references) //IL_0126: Expected O, but got Unknown //IL_00bd: Unknown result type (might be due to invalid IL or missing references) //IL_00c4: Expected O, but got Unknown //IL_00df: Unknown result type (might be due to invalid IL or missing references) orig.Invoke(self, body); if (!NetworkServer.active || !Object.op_Implicit((Object)(object)body) || !Object.op_Implicit((Object)(object)((Component)body).GetComponent<EnforcerSurvivorController>())) { return; } EnforcerBodyState state = ((Component)body).GetComponent<EnforcerBodyState>(); if (!Object.op_Implicit((Object)(object)state)) { state = ((Component)body).gameObject.AddComponent<EnforcerBodyState>(); } SkillTransformationController val = default(SkillTransformationController); if (SkillTransformationController.TryFindByCustomName(((Component)body).gameObject, "ProtectAndServe", ref val) && Object.op_Implicit((Object)(object)val)) { bool flag = false; foreach (SkillDefRelationship transformationSkillDef in val.transformationSkillDefs) { if ((Object)(object)transformationSkillDef.skillDef == (Object)(object)EnforcerAssets.BreacherDef) { flag = true; break; } } if (!flag) { SkillDefRelationship val2 = new SkillDefRelationship(); val2.skillDef = EnforcerAssets.BreacherDef; val2.overrideSkillDef = EnforcerAssets.BreacherSlugDef; val2.priority = (SkillOverridePriority)2; val.transformationSkillDefs.Add(val2); } } ShieldDamageCallbackFunction val3 = (ShieldDamageCallbackFunction)delegate { state.NotifyDamageTaken(blocked: true); }; state.blockCallback = val3; EnforcerSurvivorController component = ((Component)body).GetComponent<EnforcerSurvivorController>(); component.anyShieldDamageCallbackServer = (ShieldDamageCallbackFunction)Delegate.Combine((Delegate?)(object)component.anyShieldDamageCallbackServer, (Delegate?)(object)val3); } private static void OnBodyDestroyed(orig_OnBodyDestroyed orig, CharacterMaster self, CharacterBody body) { //IL_0043: Unknown result type (might be due to invalid IL or missing references) //IL_004d: Expected O, but got Unknown if (Object.op_Implicit((Object)(object)body)) { EnforcerBodyState component = ((Component)body).GetComponent<EnforcerBodyState>(); if (Object.op_Implicit((Object)(object)component) && component.blockCallback != null && Object.op_Implicit((Object)(object)((Component)body).GetComponent<EnforcerSurvivorController>())) { EnforcerSurvivorController component2 = ((Component)body).GetComponent<EnforcerSurvivorController>(); component2.anyShieldDamageCallbackServer = (ShieldDamageCallbackFunction)Delegate.Remove((Delegate?)(object)component2.anyShieldDamageCallbackServer, (Delegate?)(object)component.blockCallback); } } orig.Invoke(self, body); } private static void OnDamageDealt(DamageReport report) { //IL_0019: Unknown result type (might be due to invalid IL or missing references) //IL_001f: Invalid comparison between Unknown and I4 //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_004f: Unknown result type (might be due to invalid IL or missing references) if (NetworkServer.active && report != null && Object.op_Implicit((Object)(object)report.victimBody) && (int)report.dotType == -1 && !(report.damageDealt <= 0f) && !((Object)(object)report.attacker == (Object)(object)((Component)report.victimBody).gameObject) && report.attackerTeamIndex != report.victimTeamIndex) { EnforcerBodyState component = ((Component)report.victimBody).GetComponent<EnforcerBodyState>(); if (Object.op_Implicit((Object)(object)component)) { component.NotifyDamageTaken(blocked: false); } } } private static void AddArmor(CharacterBody sender, StatHookEventArgs args) { EnforcerBodyState enforcerBodyState = (Object.op_Implicit((Object)(object)sender) ? ((Component)sender).GetComponent<EnforcerBodyState>() : null); if (Object.op_Implicit((Object)(object)enforcerBodyState)) { args.armorAdd += (float)enforcerBodyState.retaliationStacks * Config.RetaliationArmorPerStack.Value; } } } public static class SkillsModule { public const string BreacherNameToken = "ENFORCERALTS_BREACHER_NAME"; public const string BreacherDescToken = "ENFORCERALTS_BREACHER_DESCRIPTION"; public const string FieldNameToken = "ENFORCERALTS_CONTAINMENT_NAME"; public const string FieldDescToken = "ENFORCERALTS_CONTAINMENT_DESCRIPTION"; public static void Init() { ((ResourceAvailability)(ref SkillCatalog.skillsDefined)).onAvailable += AddVariants; } private static void AddVariants() { EnforcerAssets.AssignIcons(); AddVariant("ENFORCER2_PRIMARY_ALT_NAME", EnforcerAssets.BreacherDef); AddVariant("ENFORCER2_SPECIAL_ALT_NAME", EnforcerAssets.ContainmentDef); AddVariant("ENFORCER2_PASSIVE_NAME", EnforcerAssets.RetaliationDef); } private static void AddVariant(string vanillaToken, SkillDef addedDef) { //IL_005a: 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_0088: Expected O, but got Unknown //IL_0088: 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) if (!Object.op_Implicit((Object)(object)addedDef)) { return; } foreach (SkillFamily allSkillFamily in SkillCatalog.allSkillFamilies) { if (!((Object)(object)allSkillFamily == (Object)null) && ContainsToken(allSkillFamily, vanillaToken)) { if (!ContainsDef(allSkillFamily, addedDef)) { int num = allSkillFamily.variants.Length; Array.Resize(ref allSkillFamily.variants, num + 1); Variant[] variants = allSkillFamily.variants; Variant val = new Variant { skillDef = addedDef, unlockableName = "" }; ((Variant)(ref val)).viewableNode = new Node(addedDef.skillNameToken, false, (Node)null); variants[num] = val; } break; } } } private static bool ContainsToken(SkillFamily family, string token) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) //IL_0012: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_0020: Unknown result type (might be due to invalid IL or missing references) Variant[] variants = family.variants; foreach (Variant val in variants) { if (Object.op_Implicit((Object)(object)val.skillDef) && val.skillDef.skillNameToken == token) { return true; } } return false; } private static bool ContainsDef(SkillFamily family, SkillDef def) { //IL_000d: Unknown result type (might be due to invalid IL or missing references) Variant[] variants = family.variants; for (int i = 0; i < variants.Length; i++) { if ((Object)(object)variants[i].skillDef == (Object)(object)def) { return true; } } return false; } } } namespace EnforcerAlts.Core { public static class EnforcerAssets { public static SkillDef BreacherDef; public static SkillDef BreacherSlugDef; public static SkillDef ContainmentDef; public static SkillDef RetaliationDef; public static BuffDef RetaliationBuff; public static BuffDef RevitalizingBuff; public static GameObject SlugProjectilePrefab; public const string BreacherIconPath = "shotgun"; public const string SlugIconPath = "slug"; public const string ContainmentIconPath = "zone"; public const string RetaliationIconPath = "passive"; public static void Create() { //IL_0119: Unknown result type (might be due to invalid IL or missing references) //IL_011e: Unknown result type (might be due to invalid IL or missing references) //IL_017a: Unknown result type (might be due to invalid IL or missing references) //IL_01cf: 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_0227: Unknown result type (might be due to invalid IL or missing references) //IL_022c: Unknown result type (might be due to invalid IL or missing references) Language(); CreateProjectiles(); BreacherDef = MakeSkill("EnforcerAltsBreacher", "ENFORCERALTS_BREACHER_NAME", "ENFORCERALTS_BREACHER_DESCRIPTION", typeof(BreacherShot), "RoR2/DLC4/Characters/Enforcer/Skills/texEnforcerTrenchbroomAltIcon.png", 8, 0.65f); BreacherSlugDef = MakeSkill("EnforcerAltsBreacherSlug", "ENFORCERALTS_BREACHER_SLUG_NAME", "ENFORCERALTS_BREACHER_SLUG_DESCRIPTION", typeof(BreacherSlug), "RoR2/DLC4/Characters/Enforcer/Skills/texEnforcerTrenchbroomIcon.png", 3, 2f, new string[1] { "ENFORCER2_PRIMARY_KEYWORD_LASTSHOTCRIT" }); ContainmentDef = MakeSkill("EnforcerAltsContainment", "ENFORCERALTS_CONTAINMENT_NAME", "ENFORCERALTS_CONTAINMENT_DESCRIPTION", typeof(ContainmentDeploy), "RoR2/DLC4/Characters/Enforcer/Skills/texEnforcerRallyIcon.png", 1, Config.FieldDuration.Value * 1.8f, new string[2] { "KEYWORD_WEAK", "ENFORCERALTS_KEYWORD_REVITALIZING" }); RetaliationDef = ScriptableObject.CreateInstance<SkillDef>(); ((Object)RetaliationDef).name = "EnforcerAltsRetaliation"; RetaliationDef.skillName = "ENFORCERALTS_RETALIATION_NAME"; RetaliationDef.skillNameToken = "ENFORCERALTS_RETALIATION_NAME"; RetaliationDef.skillDescriptionToken = "ENFORCERALTS_RETALIATION_DESCRIPTION"; RetaliationDef.activationState = new SerializableEntityStateType(typeof(RetaliationPassiveState)); RetaliationDef.activationStateMachineName = "Body"; RetaliationDef.baseMaxStock = 0; RetaliationDef.requiredStock = 0; RetaliationDef.stockToConsume = 0; RetaliationDef.isCombatSkill = false; RetaliationDef.mustKeyPress = false; RetaliationDef.fullRestockOnAssign = true; RetaliationDef.interruptPriority = (InterruptPriority)0; RetaliationDef.keywordTokens = new string[1] { "ENFORCER2_SECONDARY_KEYWORD_DEFENSIVE_STANCE" }; RetaliationDef.icon = null; RetaliationBuff = ScriptableObject.CreateInstance<BuffDef>(); ((Object)RetaliationBuff).name = "bdRetaliation"; RetaliationBuff.buffColor = new Color(1f, 0.45f, 0.15f); RetaliationBuff.canStack = true; RetaliationBuff.isDebuff = false; RetaliationBuff.iconSprite = null; RevitalizingBuff = ScriptableObject.CreateInstance<BuffDef>(); ((Object)RevitalizingBuff).name = "bdRevitalizing"; RevitalizingBuff.buffColor = new Color(0.4f, 1f, 0.55f); RevitalizingBuff.canStack = false; RevitalizingBuff.isDebuff = false; RevitalizingBuff.iconSprite = null; ContentPacks.skillDefs.Add(BreacherDef); ContentPacks.skillDefs.Add(BreacherSlugDef); ContentPacks.skillDefs.Add(ContainmentDef); ContentPacks.skillDefs.Add(RetaliationDef); ContentPacks.buffDefs.Add(RetaliationBuff); ContentPacks.buffDefs.Add(RevitalizingBuff); ContentPacks.entityStateTypes.Add(typeof(BreacherShot)); ContentPacks.entityStateTypes.Add(typeof(BreacherSlug)); ContentPacks.entityStateTypes.Add(typeof(ContainmentDeploy)); ContentPacks.entityStateTypes.Add(typeof(RetaliationPassiveState)); } private static void Language() { LanguageAPI.Add("ENFORCERALTS_BREACHER_NAME", "Breacher Pump"); LanguageAPI.Add("ENFORCERALTS_BREACHER_DESCRIPTION", "Fire a spread shotgun for <style=cIsDamage>6x70% damage</style>. In Defensive Stance, fire a slow piercing slug for <style=cIsDamage>500% damage</style>."); LanguageAPI.Add("ENFORCERALTS_CONTAINMENT_NAME", "Containment Field"); LanguageAPI.Add("ENFORCERALTS_CONTAINMENT_DESCRIPTION", $"Deploy a {Config.FieldRadius.Value:0}m <style=cIsUtility>containment field</style> for {Config.FieldDuration.Value:0}s. " + "Enemies inside are <style=cIsDamage>Weakened</style>. Allies inside gain <style=cIsHealing>Revitalizing</style>, healing on hit. " + $"Effects linger for {Config.FieldLingerDuration.Value:0.0}s after leaving the field or after it ends."); LanguageAPI.Add("ENFORCER2_UTILITY_ALT_DESCRIPTION", "<style=cIsUtility>Launch</style> a remote-detonated grenade. <style=cIsUtility>Retrigger</style> to create a <style=cIsDamage>Pulling Blast</style> for <style=cIsDamage>300% damage</style>, <style=cIsHealth>Taunting</style> enemies " + $"for <style=cIsDamage>{Config.RipcordTauntDuration.Value}s</style>. Taunted enemies walk and attack you."); LanguageAPI.Add("ENFORCERALTS_KEYWORD_REVITALIZING", "<style=cKeywordName>Revitalizing</style><style=cSub>Players in this field heal for <style=cIsHealing>2% max health</style> over 0.5s when they hit an enemy.</style>"); LanguageAPI.Add("ENFORCERALTS_BREACHER_SLUG_NAME", "Breaching Slug"); LanguageAPI.Add("ENFORCERALTS_BREACHER_SLUG_DESCRIPTION", "In Defensive Stance, fire a slow piercing slug for <style=cIsDamage>500% damage</style>."); LanguageAPI.Add("ENFORCERALTS_RETALIATION_NAME", "Retaliation Protocol"); LanguageAPI.Add("ENFORCERALTS_RETALIATION_DESCRIPTION", $"Taking and blocking damage gives stacks. Max {Config.MaxRetaliationStacks.Value} stacks. " + $"Each stack grants +{Config.RetaliationArmorPerStack.Value} armor. " + $"Leaving defensive stance deals {Config.RetaliationDamagePerStack.Value}x damage per stack."); } private static SkillDef MakeSkill(string name, string nameToken, string descToken, Type stateType, string iconPath, int maxStock, float recharge, string[] keywords = null) { //IL_0023: Unknown result type (might be due to invalid IL or missing references) //IL_0028: Unknown result type (might be due to invalid IL or missing references) //IL_003a: Unknown result type (might be due to invalid IL or missing references) SkillDef obj = ScriptableObject.CreateInstance<SkillDef>(); ((Object)obj).name = name; obj.skillName = nameToken; obj.skillNameToken = nameToken; obj.skillDescriptionToken = descToken; obj.activationState = new SerializableEntityStateType(stateType); obj.activationStateMachineName = "Weapon"; obj.interruptPriority = (InterruptPriority)1; obj.baseMaxStock = maxStock; obj.baseRechargeInterval = recharge; obj.rechargeStock = 1; obj.requiredStock = 1; obj.stockToConsume = 1; obj.dontAllowPastMaxStocks = true; obj.beginSkillCooldownOnSkillEnd = false; obj.canceledFromSprinting = false; obj.forceSprintDuringState = false; obj.fullRestockOnAssign = true; obj.resetCooldownTimerOnUse = true; obj.isCombatSkill = true; obj.mustKeyPress = false; obj.cancelSprintingOnActivation = true; obj.keywordTokens = keywords; obj.icon = null; return obj; } public static void AssignIcons() { if (Object.op_Implicit((Object)(object)BreacherDef) && (Object)(object)BreacherDef.icon == (Object)null) { BreacherDef.icon = LoadIcon("shotgun"); } if (Object.op_Implicit((Object)(object)BreacherSlugDef) && (Object)(object)BreacherSlugDef.icon == (Object)null) { BreacherSlugDef.icon = LoadIcon("slug"); } if (Object.op_Implicit((Object)(object)ContainmentDef) && (Object)(object)ContainmentDef.icon == (Object)null) { ContainmentDef.icon = LoadIcon("zone"); } if (Object.op_Implicit((Object)(object)RetaliationDef) && (Object)(object)RetaliationDef.icon == (Object)null) { RetaliationDef.icon = LoadIcon("passive"); } if (Object.op_Implicit((Object)(object)RetaliationBuff) && (Object)(object)RetaliationBuff.iconSprite == (Object)null) { RetaliationBuff.iconSprite = LoadIcon("passive"); } if (Object.op_Implicit((Object)(object)RevitalizingBuff) && (Object)(object)RevitalizingBuff.iconSprite == (Object)null) { RevitalizingBuff.iconSprite = LoadIcon("zone"); } } private static string[] Variants(string path) { int num = path.LastIndexOf('.'); string text = ((num > 0 && num < path.Length - 1) ? path.Substring(0, num) : path); return new string[4] { path, text, "Assets/" + path, "Assets/" + text }; } public static Sprite LoadIcon(string path) { //IL_0024: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Unknown result type (might be due to invalid IL or missing references) Sprite val = LoadEmbeddedSprite(path); if (Object.op_Implicit((Object)(object)val)) { return val; } string[] array = Variants(path); foreach (string text in array) { Sprite val2 = null; try { val2 = Addressables.LoadAssetAsync<Sprite>((object)text).WaitForCompletion(); } catch { val2 = null; } if (!Object.op_Implicit((Object)(object)val2)) { val2 = LegacyResourcesAPI.Load<Sprite>(text); } if (Object.op_Implicit((Object)(object)val2)) { return val2; } } return null; } private static Sprite LoadEmbeddedSprite(string name) { //IL_006f: Unknown result type (might be due to invalid IL or missing references) //IL_0076: Expected O, but got Unknown //IL_009d: 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) Assembly assembly = typeof(EnforcerAssets).Assembly; string[] manifestResourceNames = assembly.GetManifestResourceNames(); foreach (string text in manifestResourceNames) { if (!text.EndsWith(name + ".png", StringComparison.OrdinalIgnoreCase)) { continue; } Stream manifestResourceStream = assembly.GetManifestResourceStream(text); if (manifestResourceStream != null) { byte[] array = new byte[manifestResourceStream.Length]; manifestResourceStream.Read(array, 0, array.Length); manifestResourceStream.Close(); Texture2D val = new Texture2D(2, 2, (TextureFormat)4, false); if (ImageConversion.LoadImage(val, array)) { return Sprite.Create(val, new Rect(0f, 0f, (float)((Texture)val).width, (float)((Texture)val).height), new Vector2(0.5f, 0.5f), 100f); } } } return null; } private static void CreateProjectiles() { //IL_010a: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)SlugProjectilePrefab)) { return; } GameObject val = TryLoad("RoR2/DLC4/Enforcer/EnforcerGrenadeClusterProjectile.prefab"); if (!Object.op_Implicit((Object)(object)val)) { EnforcerAltsPlugin.DebugLogWarning("Enforcer Tweaks: could not load grenade base prefab for slug."); return; } SlugProjectilePrefab = PrefabAPI.InstantiateClone(val, "EnforcerTweaksSlugProjectile", true); ProjectileController component = SlugProjectilePrefab.GetComponent<ProjectileController>(); if (Object.op_Implicit((Object)(object)component)) { component.procCoefficient = 1f; } ProjectileImpactExplosion component2 = SlugProjectilePrefab.GetComponent<ProjectileImpactExplosion>(); if (Object.op_Implicit((Object)(object)component2)) { ((ProjectileExplosion)component2).blastRadius = 0f; component2.destroyOnEnemy = false; component2.detonateOnEnemy = false; component2.destroyOnWorld = true; ((ProjectileExplosion)component2).childrenCount = 0; ((ProjectileExplosion)component2).childrenProjectilePrefab = null; component2.lifetime = 20f; component2.lifetimeAfterImpact = 0f; component2.lifetimeRandomOffset = 0f; } ProjectileSimple component3 = SlugProjectilePrefab.GetComponent<ProjectileSimple>(); if (Object.op_Implicit((Object)(object)component3)) { component3.lifetime = 20f; } Rigidbody component4 = SlugProjectilePrefab.GetComponent<Rigidbody>(); if (Object.op_Implicit((Object)(object)component4)) { component4.useGravity = false; } SlugProjectilePrefab.transform.localScale = Vector3.one; if (!Object.op_Implicit((Object)(object)SlugProjectilePrefab.GetComponent<SlugMarker>())) { SlugProjectilePrefab.AddComponent<SlugMarker>(); } Collider[] componentsInChildren = SlugProjectilePrefab.GetComponentsInChildren<Collider>(); for (int i = 0; i < componentsInChildren.Length; i++) { componentsInChildren[i].isTrigger = true; } PrefabAPI.RegisterNetworkPrefab(SlugProjectilePrefab); ContentAddition.AddProjectile(SlugProjectilePrefab); } public static GameObject TryLoad(params string[] paths) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0018: Expected O, but got Unknown //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) foreach (string text in paths) { try { GameObject val = ((AddressReferencedAsset<GameObject>)new AddressReferencedPrefab(text)).LoadAssetNow(); if (Object.op_Implicit((Object)(object)val)) { return val; } } catch (Exception ex) { EnforcerAltsPlugin.DebugLog("AddressReferencedPrefab error for " + text + ": " + ex.Message); } string[] array = Variants(text); foreach (string text2 in array) { GameObject val2 = null; try { val2 = Addressables.LoadAssetAsync<GameObject>((object)text2).WaitForCompletion(); } catch (Exception ex2) { EnforcerAltsPlugin.DebugLog("Addressables error for " + text2 + ": " + ex2.Message); val2 = null; } if (!Object.op_Implicit((Object)(object)val2)) { val2 = LegacyResourcesAPI.Load<GameObject>(text2); } if (Object.op_Implicit((Object)(object)val2)) { return val2; } } } EnforcerAltsPlugin.DebugLog("TryLoad failed for: " + string.Join(", ", paths)); return null; } } public static class Config { public static ConfigFile File; public static ConfigEntry<bool> DebugLogging; public static ConfigEntry<int> MaxRetaliationStacks; public static ConfigEntry<int> RetaliationPerHit; public static ConfigEntry<int> RetaliationPerBlock; public static ConfigEntry<float> RetaliationArmorPerStack; public static ConfigEntry<int> RetaliationMinStacks; public static ConfigEntry<float> RetaliationDamagePerStack; public static ConfigEntry<float> RetaliationRadius; public static ConfigEntry<float> RetaliationBarrierPerStack; public static ConfigEntry<float> RetaliationDecayDelay; public static ConfigEntry<float> RetaliationDecayRate; public static ConfigEntry<float> RetaliationGainCooldown; public static ConfigEntry<float> FieldRadius; public static ConfigEntry<float> FieldExpansionTime; public static ConfigEntry<float> FieldDuration; public static ConfigEntry<float> FieldLingerDuration; public static ConfigEntry<float> FieldWeakenDuration; public static ConfigEntry<float> SlugDamage; public static ConfigEntry<float> SlugInterval; public static ConfigEntry<float> SlugForce; public static ConfigEntry<float> RipcordTauntDuration; public static void Init(string configPath) { //IL_0002: Unknown result type (might be due to invalid IL or missing references) //IL_000c: Expected O, but got Unknown File = new ConfigFile(configPath, true); DebugLogging = File.Bind<bool>("General", "DebugLogging", false, "Enable debug logs for Enforcer Tweaks."); MaxRetaliationStacks = File.Bind<int>("Retaliation", "MaxStacks", 25, "Maximum Retaliation stacks."); RetaliationPerHit = File.Bind<int>("Retaliation", "StacksPerHit", 1, "Stacks from an unblocked damaging hit."); RetaliationPerBlock = File.Bind<int>("Retaliation", "StacksPerBlock", 2, "Stacks from a successful shield block."); RetaliationArmorPerStack = File.Bind<float>("Retaliation", "ArmorPerStack", 0.5f, "Armor added per stack. RoR2 armor is not a flat percent."); RetaliationMinStacks = File.Bind<int>("Retaliation", "MinStacksToRelease", 3, "Minimum stacks to trigger on voluntary stance exit."); RetaliationDamagePerStack = File.Bind<float>("Retaliation", "DamagePerStack", 2.8f, "Shockwave damage coefficient per stack."); RetaliationRadius = File.Bind<float>("Retaliation", "Radius", 12f, "Shockwave radius in meters."); RetaliationBarrierPerStack = File.Bind<float>("Retaliation", "BarrierPerStack", 0.005f, "Fraction of max health granted as barrier per stack."); RetaliationDecayDelay = File.Bind<float>("Retaliation", "DecayDelay", 3f, "Seconds out of combat before stacks decay."); RetaliationDecayRate = File.Bind<float>("Retaliation", "DecayRate", 3f, "Stacks lost per second during decay."); RetaliationGainCooldown = File.Bind<float>("Retaliation", "GainCooldown", 0.1f, "Minimum seconds between stack gains."); FieldRadius = File.Bind<float>("Containment", "Radius", 20f, "Final field radius in meters."); FieldExpansionTime = File.Bind<float>("Containment", "ExpansionTime", 0.65f, "Deployment expansion time."); FieldDuration = File.Bind<float>("Containment", "Duration", 10f, "Active field duration."); FieldLingerDuration = File.Bind<float>("Containment", "LingerDuration", 2.5f, "How long field effects linger after leaving the field or after it ends."); FieldWeakenDuration = File.Bind<float>("Containment", "WeakenDuration", 1.5f, "Weakened buff duration applied by the field."); SlugDamage = File.Bind<float>("Breacher", "SlugDamage", 5f, "Breaching Slug damage coefficient per enemy pierced."); SlugInterval = File.Bind<float>("Breacher", "SlugInterval", 2f, "Breaching Slug interval before attack speed."); SlugForce = File.Bind<float>("Breacher", "SlugForce", 220f, "Breaching Slug knockback force."); RipcordTauntDuration = File.Bind<float>("Taunt", "RipcordTauntDuration", 6f, "Ripcord taunt duration in seconds."); } } internal class ContentPacks : IContentPackProvider { internal readonly ContentPack contentPack = new ContentPack(); public static readonly List<SkillDef> skillDefs = new List<SkillDef>(); public static readonly List<BuffDef> buffDefs = new List<BuffDef>(); public static readonly List<Type> entityStateTypes = new List<Type>(); public string identifier => "com.Personal.EnforcerTweaks"; public void Initialize() { //IL_0007: Unknown result type (might be due to invalid IL or missing references) //IL_0011: Expected O, but got Unknown ContentManager.collectContentPackProviders += new CollectContentPackProvidersDelegate(AddProvider); } private void AddProvider(AddContentPackProviderDelegate add) { add.Invoke((IContentPackProvider)(object)this); } public IEnumerator LoadStaticContentAsync(LoadStaticContentAsyncArgs args) { contentPack.identifier = identifier; contentPack.skillDefs.Add(skillDefs.ToArray()); contentPack.buffDefs.Add(buffDefs.ToArray()); contentPack.entityStateTypes.Add(entityStateTypes.ToAr