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 Projectiles Configurator v1.1.0
ProjectilesConfigurator.dll
Decompiled 5 months agousing System; using System.Collections; using System.Collections.Generic; using System.Diagnostics; using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using BepInEx; using BepInEx.Bootstrap; using BepInEx.Configuration; using BepInEx.Logging; using HG.Coroutines; using HG.Reflection; using Microsoft.CodeAnalysis; using RiskOfOptions; using RiskOfOptions.Options; using RoR2; using RoR2.Projectile; using UnityEngine; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: OptIn] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ProjectilesConfigurator")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0+6c869157678ad0a79eafefb69035bde051fe5e48")] [assembly: AssemblyProduct("ProjectilesConfigurator")] [assembly: AssemblyTitle("ProjectilesConfigurator")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: RefSafetyRules(11)] [module: UnverifiableCode] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Microsoft.CodeAnalysis.Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [Microsoft.CodeAnalysis.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 ProjectilesConfigurator { public static class ModCompatabilities { public static class RiskOfOptionsCompatability { public const string GUID = "com.rune580.riskofoptions"; public static void AddConfig<T1, T2>(T1 config, T2 value) where T1 : ConfigEntryBase { //IL_001f: Unknown result type (might be due to invalid IL or missing references) //IL_0029: Expected O, but got Unknown //IL_0049: Unknown result type (might be due to invalid IL or missing references) //IL_0053: Expected O, but got Unknown //IL_0073: Unknown result type (might be due to invalid IL or missing references) //IL_007d: Expected O, but got Unknown //IL_009d: Unknown result type (might be due to invalid IL or missing references) //IL_00a7: Expected O, but got Unknown //IL_00c9: Unknown result type (might be due to invalid IL or missing references) //IL_00d3: Expected O, but got Unknown if (config is ConfigEntry<float>) { ModSettingsManager.AddOption((BaseOption)new FloatFieldOption(config as ConfigEntry<float>)); } if (config is ConfigEntry<bool>) { ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(config as ConfigEntry<bool>)); } if (config is ConfigEntry<int>) { ModSettingsManager.AddOption((BaseOption)new IntFieldOption(config as ConfigEntry<int>)); } if (config is ConfigEntry<string>) { ModSettingsManager.AddOption((BaseOption)new StringInputFieldOption(config as ConfigEntry<string>)); } if (value is Enum) { ModSettingsManager.AddOption((BaseOption)new ChoiceOption((ConfigEntryBase)(object)(config as ConfigEntry<T2>))); } } } } [Serializable] [BepInPlugin("com.brynzananas.projectilesconfigurator", "Projectiles Configurator", "1.1.0")] [BepInDependency(/*Could not decode attribute arguments.*/)] public class ProjectilesConfiguratorPlugin : BaseUnityPlugin { public delegate void ConfigureProjectile(GameObject projectile, string sectionName); public delegate void ConfigureProjectileAsync(ParallelCoroutine parallelCoroutine, GameObject projectile, string sectionName); [CompilerGenerated] private sealed class <<ConfigureProjectilesStart>g__runLoadCoroutine|23_0>d : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <<ConfigureProjectilesStart>g__runLoadCoroutine|23_0>d(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>1__state = -2; } private bool MoveNext() { switch (<>1__state) { default: return false; case 0: <>1__state = -1; <>2__current = parallelCoroutine; <>1__state = 1; return true; case 1: <>1__state = -1; Log.LogMessage((object)("Finished configuring projectiles. Time took: " + stopwatch.ElapsedMilliseconds + "ms")); stopwatch.Stop(); return false; } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } [CompilerGenerated] private sealed class <>c__DisplayClass24_0 { public ProjectileSimple projectileSimple; public ConfigEntry<float> desiredForwardSpeed; public ProjectileImpactExplosion projectileImpactExplosion; public ConfigEntry<float> lifetime; public ProjectileExplosion projectileExplosion; public ConfigEntry<float> blastRadius; public ConfigEntry<float> blastDamageCoefficient; public ConfigEntry<float> blastProcCoefficient; public bool hasChildren; public ConfigEntry<int> childrenCount; public ConfigEntry<float> childrenDamageCoefficient; public ConfigEntry<bool> childrenInheritDamageType; public bool canApplyDot; public ConfigEntry<bool> applyDot; public ConfigEntry<float> dotDuration; public ConfigEntry<float> dotDamageMultiplier; public ConfigEntry<bool> calculateTotalDamage; public ConfigEntry<float> totalDamageMultiplier; public ProjectileOverlapAttack projectileOverlapAttack; public ConfigEntry<float> overlapDamageCoefficient; public ConfigEntry<float> overlapProcCoefficient; public ConfigEntry<float> overlapPushAwayForce; public ConfigEntry<int> overlapMaximumOverlapTargets; public ConfigEntry<float> overlapFireFrequency; public ConfigEntry<float> overlapResetInterval; public ConfigEntry<bool> overlapIsSphereOverlap; public ConfigEntry<bool> overlapScaleWithVelocity; public ConfigEntry<bool> overlapIsOverrideTeam; public ConfigEntry<TeamIndex> overlapOverrideTeam; public ConfigEntry<bool> overlapCanHitOwner; public ProjectileSteerTowardTarget projectileSteerTowardTarget; public ConfigEntry<bool> steerYAxisOnly; public ConfigEntry<float> steerRotationSpeed; public ConfigEntry<bool> steerIncreaseSpeedOvertime; public ConfigEntry<float> steerMaxRotationSpeed; public ConfigEntry<float> steerRotationAddPerSecond; public BoomerangProjectile boomerangProjectile; public ConfigEntry<float> boomerangTravelSpeed; public ConfigEntry<float> boomerangCharge; public ConfigEntry<float> boomerangTransitionDuration; public ConfigEntry<bool> boomerangCanHitCharacters; public ConfigEntry<bool> boomerangCanHitWorld; public MissileController missileController; public ConfigEntry<float> missileMaxVelocity; public ConfigEntry<float> missileRollVelocity; public ConfigEntry<float> missileAcceleration; public ConfigEntry<float> missileDelayTimer; public ConfigEntry<float> missileGiveupTimer; public ConfigEntry<float> missileDeathTimer; public ConfigEntry<float> missileTurbulence; public ConfigEntry<float> missileMaxSeekDistance; } [CompilerGenerated] private sealed class <ConfigureProjectileThread>d__24 : IEnumerator<object>, IEnumerator, IDisposable { private int <>1__state; private object <>2__current; public GameObject projectile; public string sectionName; private <>c__DisplayClass24_0 <>8__1; private List<ConfigEntryBase> <configEntryBases>5__2; private ConfigEntry<FalloffModel> <falloffModel>5__3; private ProjectileCharacterController <projectileCharacterController>5__4; private List<ConfigEntryBase>.Enumerator <>s__5; private ConfigEntryBase <configEntryBase>5__6; private ConfigEntry<float> <configEntry>5__7; private ConfigEntry<int> <configEntry2>5__8; private ConfigEntry<bool> <configEntry1>5__9; object IEnumerator<object>.Current { [DebuggerHidden] get { return <>2__current; } } object IEnumerator.Current { [DebuggerHidden] get { return <>2__current; } } [DebuggerHidden] public <ConfigureProjectileThread>d__24(int <>1__state) { this.<>1__state = <>1__state; } [DebuggerHidden] void IDisposable.Dispose() { <>8__1 = null; <configEntryBases>5__2 = null; <falloffModel>5__3 = null; <projectileCharacterController>5__4 = null; <>s__5 = default(List<ConfigEntryBase>.Enumerator); <configEntryBase>5__6 = null; <configEntry>5__7 = null; <configEntry2>5__8 = null; <configEntry1>5__9 = null; <>1__state = -2; } private bool MoveNext() { //IL_0e37: Unknown result type (might be due to invalid IL or missing references) //IL_0750: Unknown result type (might be due to invalid IL or missing references) switch (<>1__state) { default: return false; case 0: { <>1__state = -1; <>8__1 = new <>c__DisplayClass24_0(); <configEntryBases>5__2 = new List<ConfigEntryBase>(); <>8__1.projectileSimple = projectile.GetComponent<ProjectileSimple>(); <>8__1.desiredForwardSpeed = null; <>8__1.lifetime = null; <>8__1.projectileExplosion = projectile.GetComponent<ProjectileExplosion>(); <falloffModel>5__3 = null; <>8__1.blastRadius = null; <>8__1.blastDamageCoefficient = null; <>8__1.blastProcCoefficient = null; <>8__1.hasChildren = false; <>8__1.childrenCount = null; <>8__1.childrenDamageCoefficient = null; <>8__1.childrenInheritDamageType = null; <>8__1.canApplyDot = false; <>8__1.applyDot = null; <>8__1.dotDuration = null; <>8__1.dotDamageMultiplier = null; <>8__1.calculateTotalDamage = null; <>8__1.totalDamageMultiplier = null; <projectileCharacterController>5__4 = projectile.GetComponent<ProjectileCharacterController>(); ref ProjectileImpactExplosion projectileImpactExplosion = ref <>8__1.projectileImpactExplosion; ProjectileExplosion projectileExplosion = <>8__1.projectileExplosion; projectileImpactExplosion = (ProjectileImpactExplosion)(object)((projectileExplosion is ProjectileImpactExplosion) ? projectileExplosion : null); <>8__1.projectileOverlapAttack = projectile.GetComponent<ProjectileOverlapAttack>(); <>8__1.overlapDamageCoefficient = null; <>8__1.overlapProcCoefficient = null; <>8__1.overlapPushAwayForce = null; <>8__1.overlapMaximumOverlapTargets = null; <>8__1.overlapFireFrequency = null; <>8__1.overlapResetInterval = null; <>8__1.overlapIsSphereOverlap = null; <>8__1.overlapScaleWithVelocity = null; <>8__1.overlapIsOverrideTeam = null; <>8__1.overlapOverrideTeam = null; <>8__1.overlapCanHitOwner = null; <>8__1.projectileSteerTowardTarget = projectile.GetComponent<ProjectileSteerTowardTarget>(); <>8__1.steerYAxisOnly = null; <>8__1.steerRotationSpeed = null; <>8__1.steerIncreaseSpeedOvertime = null; <>8__1.steerMaxRotationSpeed = null; <>8__1.steerRotationAddPerSecond = null; <>8__1.boomerangProjectile = projectile.GetComponent<BoomerangProjectile>(); <>8__1.boomerangTravelSpeed = null; <>8__1.boomerangCharge = null; <>8__1.boomerangTransitionDuration = null; <>8__1.boomerangCanHitCharacters = null; <>8__1.boomerangCanHitWorld = null; <>8__1.missileController = projectile.GetComponent<MissileController>(); <>8__1.missileMaxVelocity = null; <>8__1.missileRollVelocity = null; <>8__1.missileAcceleration = null; <>8__1.missileDelayTimer = null; <>8__1.missileGiveupTimer = null; <>8__1.missileDeathTimer = null; <>8__1.missileTurbulence = null; <>8__1.missileMaxSeekDistance = null; <>2__current = null; <>1__state = 1; return true; } case 1: <>1__state = -1; if (Object.op_Implicit((Object)(object)<>8__1.projectileSimple)) { <>8__1.desiredForwardSpeed = CreateConfig(sectionName, "Desired Forward Speed", <>8__1.projectileSimple.desiredForwardSpeed, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 2; return true; } if (Object.op_Implicit((Object)(object)<projectileCharacterController>5__4)) { <>8__1.desiredForwardSpeed = CreateConfig(sectionName, "Desired Forward Speed", <projectileCharacterController>5__4.velocity, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 5; return true; } goto IL_071f; case 2: <>1__state = -1; if (Object.op_Implicit((Object)(object)<>8__1.projectileImpactExplosion) && <>8__1.projectileImpactExplosion.explodeOnLifeTimeExpiration) { <>8__1.lifetime = CreateConfig(sectionName, "Lifetime", <>8__1.projectileImpactExplosion.lifetime, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 3; return true; } <>8__1.lifetime = CreateConfig(sectionName, "Lifetime", <>8__1.projectileSimple.lifetime, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 4; return true; case 3: <>1__state = -1; goto IL_071f; case 4: <>1__state = -1; goto IL_071f; case 5: <>1__state = -1; if (Object.op_Implicit((Object)(object)<>8__1.projectileImpactExplosion) && <>8__1.projectileImpactExplosion.explodeOnLifeTimeExpiration) { <>8__1.lifetime = CreateConfig(sectionName, "Lifetime", <>8__1.projectileImpactExplosion.lifetime, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 6; return true; } <>8__1.lifetime = CreateConfig(sectionName, "Lifetime", <projectileCharacterController>5__4.lifetime, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 7; return true; case 6: <>1__state = -1; goto IL_071f; case 7: <>1__state = -1; goto IL_071f; case 8: <>1__state = -1; <>8__1.blastRadius = CreateConfig(sectionName, "Explosion Blast Radius", <>8__1.projectileExplosion.blastRadius, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 9; return true; case 9: <>1__state = -1; <>8__1.blastDamageCoefficient = CreateConfig(sectionName, "Explosion Blast Damage Coefficient", <>8__1.projectileExplosion.blastDamageCoefficient, "The percentage of the damage, proc coefficient, and force of the initial projectile. Ranges from 0-1", <configEntryBases>5__2); <>2__current = null; <>1__state = 10; return true; case 10: <>1__state = -1; <>8__1.blastProcCoefficient = CreateConfig(sectionName, "Explosion Blast Proc Coefficient", <>8__1.projectileExplosion.blastProcCoefficient, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 11; return true; case 11: <>1__state = -1; <>8__1.hasChildren = Object.op_Implicit((Object)(object)<>8__1.projectileExplosion.childrenProjectilePrefab); if (<>8__1.hasChildren) { <>8__1.childrenCount = CreateConfig(sectionName, "Explosion Children Count", <>8__1.projectileExplosion.childrenCount, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 12; return true; } goto IL_098b; case 12: <>1__state = -1; <>8__1.childrenDamageCoefficient = CreateConfig(sectionName, "Explosion Children Damage Coefficient", <>8__1.projectileExplosion.childrenDamageCoefficient, "What percentage of our damage does the children get?", <configEntryBases>5__2); <>2__current = null; <>1__state = 13; return true; case 13: <>1__state = -1; <>8__1.childrenInheritDamageType = CreateConfig(sectionName, "Explosion Children Inherit Damage Type", <>8__1.projectileExplosion.childrenInheritDamageType, "Should children inherit the damage type of this projectile?", <configEntryBases>5__2); <>2__current = null; <>1__state = 14; return true; case 14: <>1__state = -1; goto IL_098b; case 15: <>1__state = -1; <>8__1.dotDuration = CreateConfig(sectionName, "Explosion DoT Duration", <>8__1.projectileExplosion.dotDuration, "Duration in seconds of the DoT. Unused if calculateTotalDamage is true.", <configEntryBases>5__2); <>2__current = null; <>1__state = 16; return true; case 16: <>1__state = -1; <>8__1.dotDamageMultiplier = CreateConfig(sectionName, "Explosion DoT Damage Multiplier", <>8__1.projectileExplosion.dotDamageMultiplier, "Multiplier on the per-tick damage", <configEntryBases>5__2); <>2__current = null; <>1__state = 17; return true; case 17: <>1__state = -1; <>8__1.calculateTotalDamage = CreateConfig(sectionName, "Explosion Calculate Total Damage", <>8__1.projectileExplosion.calculateTotalDamage, "If true, we disregard the duration and instead specify the total damage.", <configEntryBases>5__2); <>2__current = null; <>1__state = 18; return true; case 18: <>1__state = -1; <>8__1.totalDamageMultiplier = CreateConfig(sectionName, "Explosion Total Damage Multiplier", <>8__1.projectileExplosion.totalDamageMultiplier, "totalDamage = totalDamageMultiplier * attacker's damage", <configEntryBases>5__2); <>2__current = null; <>1__state = 19; return true; case 19: <>1__state = -1; goto IL_0b43; case 20: <>1__state = -1; <>8__1.overlapProcCoefficient = CreateConfig(sectionName, "Overlap Attack Proc Coefficient", <>8__1.projectileOverlapAttack.overlapProcCoefficient, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 21; return true; case 21: <>1__state = -1; <>8__1.overlapPushAwayForce = CreateConfig(sectionName, "Overlap Attack Push Away Force", <>8__1.projectileOverlapAttack.pushAwayForce, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 22; return true; case 22: <>1__state = -1; <>8__1.overlapMaximumOverlapTargets = CreateConfig(sectionName, "Overlap Attack Maximum Overlap Targets", <>8__1.projectileOverlapAttack.maximumOverlapTargets, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 23; return true; case 23: <>1__state = -1; <>8__1.overlapFireFrequency = CreateConfig(sectionName, "Overlap Attack Fire Frequency", <>8__1.projectileOverlapAttack.fireFrequency, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 24; return true; case 24: <>1__state = -1; <>8__1.overlapResetInterval = CreateConfig(sectionName, "Overlap Attack Reset Interval", <>8__1.projectileOverlapAttack.resetInterval, "If non-negative, the attack clears its hit memory at the specified interval.", <configEntryBases>5__2); <>2__current = null; <>1__state = 25; return true; case 25: <>1__state = -1; <>8__1.overlapIsSphereOverlap = CreateConfig(sectionName, "Overlap Attack Is Sphere Overlap", <>8__1.projectileOverlapAttack.isSphereOverlap, "Treat the hurtbox's scale as a radius to define a sphere. Assumes a uniformly scaled hurtbox", <configEntryBases>5__2); <>2__current = null; <>1__state = 26; return true; case 26: <>1__state = -1; <>8__1.overlapScaleWithVelocity = CreateConfig(sectionName, "Overlap Attack Scale With Velocity", <>8__1.projectileOverlapAttack.ScaleWithVelocity, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 27; return true; case 27: <>1__state = -1; <>8__1.overlapIsOverrideTeam = CreateConfig(sectionName, "Overlap Attack Is Override Team", <>8__1.projectileOverlapAttack.isOverrideTeam, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 28; return true; case 28: <>1__state = -1; <>8__1.overlapOverrideTeam = CreateConfig<TeamIndex>(sectionName, "Overlap Attack Override Team Index", <>8__1.projectileOverlapAttack.OverrideTeamIndex, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 29; return true; case 29: <>1__state = -1; <>8__1.overlapCanHitOwner = CreateConfig(sectionName, "Overlap Attack Can Hit Owner", <>8__1.projectileOverlapAttack.canHitOwner, "If artifact of chaos is active, then this overlap attack can hurt the owner", <configEntryBases>5__2); <>2__current = null; <>1__state = 30; return true; case 30: <>1__state = -1; goto IL_0eb8; case 31: <>1__state = -1; <>8__1.steerRotationSpeed = CreateConfig(sectionName, "Steer Toward Target Rotation Speed", <>8__1.projectileSteerTowardTarget.rotationSpeed, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 32; return true; case 32: <>1__state = -1; <>8__1.steerIncreaseSpeedOvertime = CreateConfig(sectionName, "Steer Toward Target Increase Speed Overtime", <>8__1.projectileSteerTowardTarget.increaseSpeedOverTime, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 33; return true; case 33: <>1__state = -1; <>8__1.steerMaxRotationSpeed = CreateConfig(sectionName, "Steer Toward Target Max Rotation Speed", <>8__1.projectileSteerTowardTarget.maxRotationSpeed, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 34; return true; case 34: <>1__state = -1; <>8__1.steerRotationAddPerSecond = CreateConfig(sectionName, "Steer Toward Target Rotation Add Per Second", <>8__1.projectileSteerTowardTarget.rotationAddPerSecond, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 35; return true; case 35: <>1__state = -1; goto IL_1059; case 36: <>1__state = -1; <>8__1.boomerangCharge = CreateConfig(sectionName, "Boomerang Charge", <>8__1.boomerangProjectile.charge, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 37; return true; case 37: <>1__state = -1; <>8__1.boomerangTransitionDuration = CreateConfig(sectionName, "Boomerang Transition Duration", <>8__1.boomerangProjectile.transitionDuration, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 38; return true; case 38: <>1__state = -1; <>8__1.boomerangCanHitCharacters = CreateConfig(sectionName, "Boomerang Travel Can Hit Characters", <>8__1.boomerangProjectile.canHitCharacters, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 39; return true; case 39: <>1__state = -1; <>8__1.boomerangCanHitWorld = CreateConfig(sectionName, "Boomerang Travel Can Hit World", <>8__1.boomerangProjectile.canHitWorld, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 40; return true; case 40: <>1__state = -1; goto IL_11fa; case 41: <>1__state = -1; <>8__1.missileRollVelocity = CreateConfig(sectionName, "Missile Roll Velocity", <>8__1.missileController.rollVelocity, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 42; return true; case 42: <>1__state = -1; <>8__1.missileAcceleration = CreateConfig(sectionName, "Missile Acceleration", <>8__1.missileController.acceleration, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 43; return true; case 43: <>1__state = -1; <>8__1.missileDelayTimer = CreateConfig(sectionName, "Missile Delay Timer", <>8__1.missileController.delayTimer, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 44; return true; case 44: <>1__state = -1; <>8__1.missileGiveupTimer = CreateConfig(sectionName, "Missile Giveup Timer", <>8__1.missileController.giveupTimer, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 45; return true; case 45: <>1__state = -1; <>8__1.missileDeathTimer = CreateConfig(sectionName, "Missile Death Timer", <>8__1.missileController.deathTimer, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 46; return true; case 46: <>1__state = -1; <>8__1.missileTurbulence = CreateConfig(sectionName, "Missile Turbulence", <>8__1.missileController.turbulence, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 47; return true; case 47: <>1__state = -1; <>8__1.missileMaxSeekDistance = CreateConfig(sectionName, "Missile Max Seek Distance", <>8__1.missileController.maxSeekDistance, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 48; return true; case 48: { <>1__state = -1; break; } IL_098b: <>8__1.canApplyDot = <>8__1.projectileExplosion.applyDot; if (<>8__1.canApplyDot) { <>8__1.applyDot = CreateConfig(sectionName, "Explosion Apply DoT", <>8__1.projectileExplosion.applyDot, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 15; return true; } goto IL_0b43; IL_0eb8: if (Object.op_Implicit((Object)(object)<>8__1.projectileSteerTowardTarget)) { <>8__1.steerYAxisOnly = CreateConfig(sectionName, "Steer Toward Target Y Axis Only", <>8__1.projectileSteerTowardTarget.yAxisOnly, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 31; return true; } goto IL_1059; IL_1059: if (Object.op_Implicit((Object)(object)<>8__1.boomerangProjectile)) { <>8__1.boomerangTravelSpeed = CreateConfig(sectionName, "Boomerang Travel Speed", <>8__1.boomerangProjectile.travelSpeed, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 36; return true; } goto IL_11fa; IL_071f: if (Object.op_Implicit((Object)(object)<>8__1.projectileExplosion)) { <falloffModel>5__3 = CreateConfig<FalloffModel>(sectionName, "Explosion Falloff Model", <>8__1.projectileExplosion.falloffModel, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 8; return true; } goto IL_0b43; IL_0b43: if (Object.op_Implicit((Object)(object)<>8__1.projectileOverlapAttack)) { <>8__1.overlapDamageCoefficient = CreateConfig(sectionName, "Overlap Attack Damage Coefficient", <>8__1.projectileOverlapAttack.damageCoefficient, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 20; return true; } goto IL_0eb8; IL_11fa: if (Object.op_Implicit((Object)(object)<>8__1.missileController)) { <>8__1.missileMaxVelocity = CreateConfig(sectionName, "Missile Max Velocity", <>8__1.missileController.maxVelocity, "", <configEntryBases>5__2); <>2__current = null; <>1__state = 41; return true; } break; } <>s__5 = <configEntryBases>5__2.GetEnumerator(); try { while (<>s__5.MoveNext()) { <configEntryBase>5__6 = <>s__5.Current; <configEntry>5__7 = <configEntryBase>5__6 as ConfigEntry<float>; if (<configEntry>5__7 == null) { <configEntry2>5__8 = <configEntryBase>5__6 as ConfigEntry<int>; if (<configEntry2>5__8 == null) { <configEntry1>5__9 = <configEntryBase>5__6 as ConfigEntry<bool>; if (<configEntry1>5__9 == null) { continue; } <configEntry1>5__9.SettingChanged += ConfigEntry_SettingChanged; <configEntry1>5__9 = null; } else { <configEntry2>5__8.SettingChanged += ConfigEntry_SettingChanged; } <configEntry2>5__8 = null; } else { <configEntry>5__7.SettingChanged += ConfigEntry_SettingChanged; } <configEntry>5__7 = null; <configEntryBase>5__6 = null; } } finally { ((IDisposable)<>s__5).Dispose(); } <>s__5 = default(List<ConfigEntryBase>.Enumerator); UpdateProjectile(); GetProjectileCustomConfigs?.Invoke(projectile, sectionName); return false; void ConfigEntry_SettingChanged(object sender, EventArgs e) { UpdateProjectile(); } void UpdateProjectile() { //IL_0290: Unknown result type (might be due to invalid IL or missing references) //IL_0295: Unknown result type (might be due to invalid IL or missing references) if (Object.op_Implicit((Object)(object)((<>c__DisplayClass24_0)this).projectileSimple)) { ((<>c__DisplayClass24_0)this).projectileSimple.desiredForwardSpeed = ((<>c__DisplayClass24_0)this).desiredForwardSpeed.Value; if (Object.op_Implicit((Object)(object)((<>c__DisplayClass24_0)this).projectileImpactExplosion) && ((<>c__DisplayClass24_0)this).projectileImpactExplosion.explodeOnLifeTimeExpiration) { ((<>c__DisplayClass24_0)this).projectileImpactExplosion.lifetime = ((<>c__DisplayClass24_0)this).lifetime.Value; ((<>c__DisplayClass24_0)this).projectileSimple.lifetime = float.PositiveInfinity; } else { ((<>c__DisplayClass24_0)this).projectileSimple.lifetime = ((<>c__DisplayClass24_0)this).lifetime.Value; } } if (Object.op_Implicit((Object)(object)((<>c__DisplayClass24_0)this).projectileExplosion)) { ((<>c__DisplayClass24_0)this).projectileExplosion.blastRadius = ((<>c__DisplayClass24_0)this).blastRadius.Value; ((<>c__DisplayClass24_0)this).projectileExplosion.blastDamageCoefficient = ((<>c__DisplayClass24_0)this).blastDamageCoefficient.Value; ((<>c__DisplayClass24_0)this).projectileExplosion.blastProcCoefficient = ((<>c__DisplayClass24_0)this).blastProcCoefficient.Value; if (((<>c__DisplayClass24_0)this).hasChildren) { ((<>c__DisplayClass24_0)this).projectileExplosion.childrenCount = ((<>c__DisplayClass24_0)this).childrenCount.Value; ((<>c__DisplayClass24_0)this).projectileExplosion.childrenDamageCoefficient = ((<>c__DisplayClass24_0)this).childrenDamageCoefficient.Value; ((<>c__DisplayClass24_0)this).projectileExplosion.childrenInheritDamageType = ((<>c__DisplayClass24_0)this).childrenInheritDamageType.Value; } if (((<>c__DisplayClass24_0)this).canApplyDot) { ((<>c__DisplayClass24_0)this).projectileExplosion.applyDot = ((<>c__DisplayClass24_0)this).applyDot.Value; ((<>c__DisplayClass24_0)this).projectileExplosion.dotDuration = ((<>c__DisplayClass24_0)this).dotDuration.Value; ((<>c__DisplayClass24_0)this).projectileExplosion.dotDamageMultiplier = ((<>c__DisplayClass24_0)this).dotDamageMultiplier.Value; ((<>c__DisplayClass24_0)this).projectileExplosion.calculateTotalDamage = ((<>c__DisplayClass24_0)this).calculateTotalDamage.Value; ((<>c__DisplayClass24_0)this).projectileExplosion.totalDamageMultiplier = ((<>c__DisplayClass24_0)this).totalDamageMultiplier.Value; } } if (Object.op_Implicit((Object)(object)((<>c__DisplayClass24_0)this).projectileOverlapAttack)) { ((<>c__DisplayClass24_0)this).projectileOverlapAttack.damageCoefficient = ((<>c__DisplayClass24_0)this).overlapDamageCoefficient.Value; ((<>c__DisplayClass24_0)this).projectileOverlapAttack.overlapProcCoefficient = ((<>c__DisplayClass24_0)this).overlapProcCoefficient.Value; ((<>c__DisplayClass24_0)this).projectileOverlapAttack.pushAwayForce = ((<>c__DisplayClass24_0)this).overlapPushAwayForce.Value; ((<>c__DisplayClass24_0)this).projectileOverlapAttack.maximumOverlapTargets = ((<>c__DisplayClass24_0)this).overlapMaximumOverlapTargets.Value; ((<>c__DisplayClass24_0)this).projectileOverlapAttack.fireFrequency = ((<>c__DisplayClass24_0)this).overlapFireFrequency.Value; ((<>c__DisplayClass24_0)this).projectileOverlapAttack.resetInterval = ((<>c__DisplayClass24_0)this).overlapResetInterval.Value; ((<>c__DisplayClass24_0)this).projectileOverlapAttack.isSphereOverlap = ((<>c__DisplayClass24_0)this).overlapIsSphereOverlap.Value; ((<>c__DisplayClass24_0)this).projectileOverlapAttack.ScaleWithVelocity = ((<>c__DisplayClass24_0)this).overlapScaleWithVelocity.Value; ((<>c__DisplayClass24_0)this).projectileOverlapAttack.isOverrideTeam = ((<>c__DisplayClass24_0)this).overlapIsOverrideTeam.Value; ((<>c__DisplayClass24_0)this).projectileOverlapAttack.OverrideTeamIndex = ((<>c__DisplayClass24_0)this).overlapOverrideTeam.Value; ((<>c__DisplayClass24_0)this).projectileOverlapAttack.canHitOwner = ((<>c__DisplayClass24_0)this).overlapCanHitOwner.Value; } if (Object.op_Implicit((Object)(object)((<>c__DisplayClass24_0)this).projectileSteerTowardTarget)) { ((<>c__DisplayClass24_0)this).projectileSteerTowardTarget.yAxisOnly = ((<>c__DisplayClass24_0)this).steerYAxisOnly.Value; ((<>c__DisplayClass24_0)this).projectileSteerTowardTarget.rotationSpeed = ((<>c__DisplayClass24_0)this).steerRotationSpeed.Value; ((<>c__DisplayClass24_0)this).projectileSteerTowardTarget.increaseSpeedOverTime = ((<>c__DisplayClass24_0)this).steerIncreaseSpeedOvertime.Value; ((<>c__DisplayClass24_0)this).projectileSteerTowardTarget.maxRotationSpeed = ((<>c__DisplayClass24_0)this).steerMaxRotationSpeed.Value; ((<>c__DisplayClass24_0)this).projectileSteerTowardTarget.rotationAddPerSecond = ((<>c__DisplayClass24_0)this).steerRotationAddPerSecond.Value; } if (Object.op_Implicit((Object)(object)((<>c__DisplayClass24_0)this).boomerangProjectile)) { ((<>c__DisplayClass24_0)this).boomerangProjectile.travelSpeed = ((<>c__DisplayClass24_0)this).boomerangTravelSpeed.Value; ((<>c__DisplayClass24_0)this).boomerangProjectile.charge = ((<>c__DisplayClass24_0)this).boomerangCharge.Value; ((<>c__DisplayClass24_0)this).boomerangProjectile.transitionDuration = ((<>c__DisplayClass24_0)this).boomerangTransitionDuration.Value; ((<>c__DisplayClass24_0)this).boomerangProjectile.canHitCharacters = ((<>c__DisplayClass24_0)this).boomerangCanHitCharacters.Value; ((<>c__DisplayClass24_0)this).boomerangProjectile.canHitWorld = ((<>c__DisplayClass24_0)this).boomerangCanHitWorld.Value; } if (Object.op_Implicit((Object)(object)((<>c__DisplayClass24_0)this).missileController)) { ((<>c__DisplayClass24_0)this).missileController.maxVelocity = ((<>c__DisplayClass24_0)this).missileMaxVelocity.Value; ((<>c__DisplayClass24_0)this).missileController.rollVelocity = ((<>c__DisplayClass24_0)this).missileRollVelocity.Value; ((<>c__DisplayClass24_0)this).missileController.acceleration = ((<>c__DisplayClass24_0)this).missileAcceleration.Value; ((<>c__DisplayClass24_0)this).missileController.delayTimer = ((<>c__DisplayClass24_0)this).missileDelayTimer.Value; ((<>c__DisplayClass24_0)this).missileController.giveupTimer = ((<>c__DisplayClass24_0)this).missileGiveupTimer.Value; ((<>c__DisplayClass24_0)this).missileController.deathTimer = ((<>c__DisplayClass24_0)this).missileDeathTimer.Value; ((<>c__DisplayClass24_0)this).missileController.turbulence = ((<>c__DisplayClass24_0)this).missileTurbulence.Value; ((<>c__DisplayClass24_0)this).missileController.maxSeekDistance = ((<>c__DisplayClass24_0)this).missileMaxSeekDistance.Value; } } } bool IEnumerator.MoveNext() { //ILSpy generated this explicit interface implementation from .override directive in MoveNext return this.MoveNext(); } [DebuggerHidden] void IEnumerator.Reset() { throw new NotSupportedException(); } } public const string ModGuid = "com.brynzananas.projectilesconfigurator"; public const string ModName = "Projectiles Configurator"; public const string ModVer = "1.1.0"; public static Dictionary<string, int> names = new Dictionary<string, int>(); public static ConfigureProjectile GetProjectileCustomConfigs; public static ConfigureProjectileAsync GetProjectileCustomConfigsAsync; private static ParallelCoroutine parallelCoroutine; private static Stopwatch stopwatch; public static bool riskOfOptionsEnabled { get; private set; } public static ConfigFile configFile { get; private set; } public static ManualLogSource Log { get; private set; } public void Awake() { configFile = ((BaseUnityPlugin)this).Config; Log = ((BaseUnityPlugin)this).Logger; riskOfOptionsEnabled = Chainloader.PluginInfos.ContainsKey("com.rune580.riskofoptions"); } [SystemInitializer(new Type[] { typeof(ProjectileCatalog) })] private static void ConfigureProjectilesStart() { //IL_0011: Unknown result type (might be due to invalid IL or missing references) //IL_001b: Expected O, but got Unknown Log.LogMessage((object)"Begin configuring projectiles"); parallelCoroutine = new ParallelCoroutine(); stopwatch = Stopwatch.StartNew(); stopwatch.Start(); int num = 0; GameObject[] projectilePrefabs = ProjectileCatalog.projectilePrefabs; foreach (GameObject val in projectilePrefabs) { num++; string text = ((Object)val).name; char[] array = new char[6] { '\n', '\t', '"', '\'', '[', ']' }; char[] array2 = array; foreach (char c in array2) { while (text.Contains(c)) { text = text.Replace(c, ' '); } } text.Trim(); if (!Utility.IsNullOrWhiteSpace(text)) { int k; for (k = 0; names.ContainsKey(text + ((k == 0) ? "" : ((object)k))); k++) { } text += ((k == 0) ? "" : ((object)k)); names.Add(text, k); ConfigEntry<bool> val2 = CreateConfig(text, "Enable Config", defaultValue: false, "Enable configuration for this projectile?", null, enableRiskOfOptions: false); if (val2.Value) { parallelCoroutine.Add(ConfigureProjectileThread(val, text)); GetProjectileCustomConfigsAsync?.Invoke(parallelCoroutine, val, text); } } } ((MonoBehaviour)RoR2Application.instance).StartCoroutine(runLoadCoroutine()); [IteratorStateMachine(typeof(<<ConfigureProjectilesStart>g__runLoadCoroutine|23_0>d))] static IEnumerator runLoadCoroutine() { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <<ConfigureProjectilesStart>g__runLoadCoroutine|23_0>d(0); } } [IteratorStateMachine(typeof(<ConfigureProjectileThread>d__24))] private static IEnumerator ConfigureProjectileThread(GameObject projectile, string sectionName) { //yield-return decompiler failed: Unexpected instruction in Iterator.Dispose() return new <ConfigureProjectileThread>d__24(0) { projectile = projectile, sectionName = sectionName }; } private static ConfigEntry<T> CreateConfig<T>(string section, string key, T defaultValue, string description, List<ConfigEntryBase> configEntryBases) { return CreateConfig(section, key, defaultValue, description, configEntryBases, enableRiskOfOptions: true); } private static ConfigEntry<T> CreateConfig<T>(string section, string key, T defaultValue, string description, List<ConfigEntryBase> configEntryBases, bool enableRiskOfOptions) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Expected O, but got Unknown //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown ConfigDefinition val = new ConfigDefinition(section, key); ConfigDescription val2 = new ConfigDescription(description, (AcceptableValueBase)null, Array.Empty<object>()); ConfigEntry<T> val3 = configFile.Bind<T>(val, defaultValue, val2); configEntryBases?.Add((ConfigEntryBase)(object)val3); if (enableRiskOfOptions && riskOfOptionsEnabled) { ModCompatabilities.RiskOfOptionsCompatability.AddConfig<ConfigEntry<T>, T>(val3, defaultValue); } return val3; } public static ConfigEntry<T> CreateConfig<T>(string section, string key, T defaultValue, string description, bool autoHandleRiskOfOptions) { //IL_0003: Unknown result type (might be due to invalid IL or missing references) //IL_0009: Expected O, but got Unknown //IL_0010: Unknown result type (might be due to invalid IL or missing references) //IL_0016: Expected O, but got Unknown ConfigDefinition val = new ConfigDefinition(section, key); ConfigDescription val2 = new ConfigDescription(description, (AcceptableValueBase)null, Array.Empty<object>()); ConfigEntry<T> val3 = configFile.Bind<T>(val, defaultValue, val2); if (autoHandleRiskOfOptions && riskOfOptionsEnabled) { ModCompatabilities.RiskOfOptionsCompatability.AddConfig<ConfigEntry<T>, T>(val3, defaultValue); } return val3; } public static ConfigEntry<T> CreateConfig<T>(string section, string key, T defaultValue, string description) { return CreateConfig(section, key, defaultValue, description, autoHandleRiskOfOptions: true); } } }