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 BepInEx.Logging;
using Microsoft.CodeAnalysis;
using R2API;
using RoR2;
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.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("MegaTempest")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("MegaTempest")]
[assembly: AssemblyTitle("MegaTempest")]
[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 MegaTempest
{
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInDependency(/*Could not decode attribute arguments.*/)]
[BepInPlugin("MegaTempest", "MegaTempest", "1.1.1")]
internal class DifficultyExample : BaseUnityPlugin
{
private DifficultyIndex myIndex;
public static ConfigEntry<float> difficultyScaling { get; set; }
public static ConfigEntry<float> movementSpeedBonus { get; set; }
public static ConfigEntry<float> attackSpeedBonus { get; set; }
public static ConfigEntry<float> armorPerLevel { get; set; }
private void Awake()
{
//IL_0158: Unknown result type (might be due to invalid IL or missing references)
//IL_0163: Unknown result type (might be due to invalid IL or missing references)
//IL_0169: Expected O, but got Unknown
//IL_016b: Unknown result type (might be due to invalid IL or missing references)
//IL_0170: Unknown result type (might be due to invalid IL or missing references)
//IL_01a0: Unknown result type (might be due to invalid IL or missing references)
//IL_01aa: Expected O, but got Unknown
difficultyScaling = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Difficulty Scaling", 8f, "The difficulty scaling. Monsoon is 3, Tempest is 6, default is 8");
movementSpeedBonus = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Movement Speed", 0.35f, "The movement speed bonus given to monsters. Default is 0.35");
attackSpeedBonus = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Attack Speed", 0.25f, "The attack speed bonus given to monsters. Default is 0.25");
armorPerLevel = ((BaseUnityPlugin)this).Config.Bind<float>("General", "Armor per Level", 0.5f, "The armor per level given to monsters. Default is 0.5");
DifficultyDef val = new DifficultyDef(difficultyScaling.Value, "Mega Tempest", "icon.png", "Behindert schwer. <br><br> Difficulty scaling: + " + (difficultyScaling.Value * 50f - 100f) + "%<br> Movement speed bonus: " + movementSpeedBonus.Value * 100f + "%<br> Attack speed bonus: " + attackSpeedBonus.Value * 100f + "%<br> Armor per level: " + armorPerLevel.Value + "<br>", new Color(0.5f, 0.1f, 0.2f), "nr", true);
myIndex = DifficultyAPI.AddDifficulty(val);
Run.onRunStartGlobal += delegate(Run run)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
if (run.selectedDifficulty != myIndex)
{
}
};
Run.onRunDestroyGlobal += delegate(Run run)
{
//IL_0002: Unknown result type (might be due to invalid IL or missing references)
//IL_0008: Unknown result type (might be due to invalid IL or missing references)
if (run.selectedDifficulty != myIndex)
{
}
};
RecalculateStatsAPI.GetStatCoefficients += new StatHookEventHandler(RecalculateStatsAPI_GetStatCoefficients);
Console.WriteLine("Mega Tempest awake completed.");
}
private void RecalculateStatsAPI_GetStatCoefficients(CharacterBody sender, StatHookEventArgs args)
{
//IL_0006: Unknown result type (might be due to invalid IL or missing references)
//IL_000b: Unknown result type (might be due to invalid IL or missing references)
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_000e: Unknown result type (might be due to invalid IL or missing references)
//IL_0047: Unknown result type (might be due to invalid IL or missing references)
//IL_004d: Invalid comparison between Unknown and I4
DifficultyIndex selectedDifficulty = Run.instance.selectedDifficulty;
if (selectedDifficulty == myIndex && Object.op_Implicit((Object)(object)sender) && Object.op_Implicit((Object)(object)sender.teamComponent) && ((Object)((Component)sender).gameObject).name != "BrotherBody(Clone)" && (int)sender.teamComponent.teamIndex == 2)
{
args.moveSpeedMultAdd += movementSpeedBonus.Value;
args.attackSpeedMultAdd += attackSpeedBonus.Value;
args.levelArmorAdd += armorPerLevel.Value;
}
}
}
}
namespace ExamplePlugin
{
internal static class Log
{
private static ManualLogSource _logSource;
internal static void Init(ManualLogSource logSource)
{
_logSource = logSource;
}
internal static void Debug(object data)
{
_logSource.LogDebug(data);
}
internal static void Error(object data)
{
_logSource.LogError(data);
}
internal static void Fatal(object data)
{
_logSource.LogFatal(data);
}
internal static void Info(object data)
{
_logSource.LogInfo(data);
}
internal static void Message(object data)
{
_logSource.LogMessage(data);
}
internal static void Warning(object data)
{
_logSource.LogWarning(data);
}
}
}