Decompiled source of MercBuff v1.0.1

MercBuff.dll

Decompiled 5 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 Microsoft.CodeAnalysis;
using RoR2;
using UnityEngine;
using UnityEngine.AddressableAssets;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETStandard,Version=v2.0", FrameworkDisplayName = ".NET Standard 2.0")]
[assembly: AssemblyCompany("MercBuff")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("MercBuff")]
[assembly: AssemblyTitle("MercBuff")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
[module: RefSafetyRules(11)]
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 MercBuff
{
	[BepInPlugin("com.Nuxlar.MercBuff", "MercBuff", "1.0.1")]
	public class MercBuff : BaseUnityPlugin
	{
		private GameObject merc = Addressables.LoadAssetAsync<GameObject>((object)"RoR2/Base/Merc/MercBody.prefab").WaitForCompletion();

		public void Awake()
		{
			ChangeEntityStateValue("RoR2/Base/Merc/EntityStates.Merc.Evis.asset", "damageCoefficient", "2.3");
			ChangeEntityStateValue("RoR2/Base/Merc/EntityStates.Merc.Assaulter2.asset", "damageCoefficient", "4");
			SkillLocator component = merc.GetComponent<SkillLocator>();
			component.utility.skillFamily.variants[0].skillDef.skillDescriptionToken = "<style=cIsDamage>Stunning</style>. Dash forward, dealing <style=cIsDamage>400% damage</style>. If you hit an enemy, <style=cIsDamage>you can dash again</style>, up to <style=cIsDamage>3</style> total.";
			component.special.skillFamily.variants[0].skillDef.skillDescriptionToken = "Target a nearby enemy, attacking them for <style=cIsDamage>230% damage</style> repeatedly. <style=cIsUtility>You cannot be hit for the duration</style>.";
		}

		private void ChangeEntityStateValue(string entityStateConfiguration, string fieldName, string newValue)
		{
			//IL_0001: Unknown result type (might be due to invalid IL or missing references)
			//IL_0006: Unknown result type (might be due to invalid IL or missing references)
			EntityStateConfiguration val = Addressables.LoadAssetAsync<EntityStateConfiguration>((object)entityStateConfiguration).WaitForCompletion();
			for (int i = 0; i < val.serializedFieldsCollection.serializedFields.Length; i++)
			{
				if (val.serializedFieldsCollection.serializedFields[i].fieldName == fieldName)
				{
					val.serializedFieldsCollection.serializedFields[i].fieldValue.stringValue = newValue;
				}
			}
		}
	}
}