Decompiled source of SuperTravel v2.0.1

SuperTravel.dll

Decompiled 4 months ago
using System.Diagnostics;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using System.Security;
using System.Security.Permissions;
using BepInEx;
using HarmonyLib;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("SuperTravel")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SuperTravel")]
[assembly: AssemblyCopyright("Copyright ©  2021")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("c5450fe0-edcf-483f-b9ea-4b1ef9d36da7")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.0.0.0")]
[module: UnverifiableCode]
namespace SuperTravel;

[BepInPlugin("boctimus.supertravel", "Super Travel", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
	[HarmonyPatch(/*Could not decode attribute arguments.*/)]
	public class SpeedOutOfCombat
	{
		private static void Postfix(CharacterStats __instance, ref float __result)
		{
			Character character = __instance.m_character;
			if (!character.IsAI && !character.IsEnemyClose(15f))
			{
				__result += 1f;
				character.Stats.GetStat((StatType)6).AddMultiplierStack("staminaOutOfCombat", -0.7f);
			}
			else
			{
				character.Stats.GetStat((StatType)6).RemoveMultiplierStack("staminaOutOfCombat");
			}
		}
	}

	public const string GUID = "boctimus.supertravel";

	public const string NAME = "Super Travel";

	public const string VERSION = "1.0.0";

	internal void Awake()
	{
		//IL_0006: Unknown result type (might be due to invalid IL or missing references)
		new Harmony("boctimus.supertravel").PatchAll();
	}
}