Decompiled source of Classfixes Power Adjustment v1.0.1

PowerAdjustmentLearn.dll

Decompiled 10 months ago
using System;
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 BepInEx.Logging;
using SideLoader;
using UnityEngine;

[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("OutwardModTemplate")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("OutwardModTemplate")]
[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 PowerAdjustmentLearn;

[BepInPlugin("PowerAdjustmentLearn", "PowerAdjustmentLearn", "1.0.0")]
public class PowerAdjustmentLearn : BaseUnityPlugin
{
	public const string GUID = "PowerAdjustmentLearn";

	public const string NAME = "PowerAdjustmentLearn";

	public const string VERSION = "1.0.0";

	internal static ManualLogSource Log;

	public const int PowerAdjustmentID = -35115;

	public Skill PowerAdjustmentSkill;

	internal void Awake()
	{
		Log = ((BaseUnityPlugin)this).Logger;
		Log.LogMessage((object)"Hello world from PowerAdjustmentLearn 1.0.0!");
		SL.OnSceneLoaded += OnSceneLoaded;
	}

	private void OnSceneLoaded()
	{
		try
		{
			foreach (Character value in CharacterManager.Instance.Characters.Values)
			{
				if (!value.IsAI && (Object)(object)value.Inventory != (Object)null && !value.Inventory.LearnedSkill((Item)(object)PowerAdjustmentSkill))
				{
					value.Inventory.ReceiveSkillReward(-35115);
				}
			}
		}
		catch (Exception arg)
		{
			Log.LogMessage((object)$"Exception during PowerAdjustmentLearn.OnSceneLoaded: {arg}");
		}
	}
}