Decompiled source of ArtificerPrimaryRangeFix v1.0.1

ArtificerPrimaryRangeFix.dll

Decompiled 2 months ago
using System;
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.Configuration;
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: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = "")]
[assembly: AssemblyCompany("ArtificerPrimaryRangeFix")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("ArtificerPrimaryRangeFix")]
[assembly: AssemblyTitle("ArtificerPrimaryRangeFix")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace ArtificerPrimaryRangeFix
{
	[BepInPlugin("com.Moffein.ArtificerPrimaryRangeFix", "ArtificerPrimaryRangeFix", "1.0.0")]
	public class ArtificerPrimaryRangeFix : BaseUnityPlugin
	{
		public static float lifetime = 10f;

		public void Awake()
		{
			//IL_0011: 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_0030: Expected O, but got Unknown
			//IL_0030: Expected O, but got Unknown
			lifetime = ((BaseUnityPlugin)this).Config.Bind<float>(new ConfigDefinition("General", "Projectile Lifetime"), 10f, new ConfigDescription("Time before the projectile despawns. Vanilla is 2s.", (AcceptableValueBase)null, Array.Empty<object>())).Value;
			GameObject projectile = LegacyResourcesAPI.Load<GameObject>("prefabs/projectiles/magefireboltbasic");
			GameObject projectile2 = LegacyResourcesAPI.Load<GameObject>("prefabs/projectiles/magelightningboltbasic");
			IncreaseProjectileLifetime(projectile);
			IncreaseProjectileLifetime(projectile2);
		}

		private void IncreaseProjectileLifetime(GameObject projectile)
		{
			ProjectileSimple component = projectile.GetComponent<ProjectileSimple>();
			component.lifetime = lifetime;
		}
	}
}
namespace R2API.Utils
{
	[AttributeUsage(AttributeTargets.Assembly)]
	public class ManualNetworkRegistrationAttribute : Attribute
	{
	}
}