using System;
using System.Diagnostics;
using System.Linq;
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 On.RoR2;
using RiskOfOptions;
using RiskOfOptions.OptionConfigs;
using RiskOfOptions.Options;
using RoR2;
using UnityEngine;
using UnityEngine.SceneManagement;
[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("MoreOrder")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0+8efd1312aa857615d6db1e37dd549dbe2f7ffc1b")]
[assembly: AssemblyProduct("MoreOrder")]
[assembly: AssemblyTitle("MoreOrder")]
[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 MoreOrder
{
[BepInPlugin("com.monkeytotok.shrinemod", "MoreOrder", "1.0.0")]
public class MoreOrder : BaseUnityPlugin
{
public static ConfigEntry<float> shrineChance_stage1;
public static ConfigEntry<float> shrineChance_stage2;
public static ConfigEntry<float> shrineChance_stage3;
public static ConfigEntry<float> shrineChance_stage4;
public static ConfigEntry<float> shrineChance_stage5;
public static ConfigEntry<float> shrineChance_finalStage;
public static ConfigEntry<bool> spawn_in_stage1;
public static ConfigEntry<bool> spawn_in_stage2;
public static ConfigEntry<bool> spawn_in_stage3;
public static ConfigEntry<bool> spawn_in_stage4;
public static ConfigEntry<bool> spawn_in_stage5;
public static ConfigEntry<bool> spawn_in_finalStage;
private static readonly string[] stages1 = new string[7] { "blackbeach", "golemplains", "snowyforest", "lakes", "lakesnight", "village", "villagenight" };
private static readonly string[] stages2 = new string[4] { "goolake", "foggyswamp", "ancientloft", "lemuriantemple" };
private static readonly string[] stages3 = new string[5] { "frozenwall", "wispgraveyard", "sulfurpools", "habitat", "habitatfall" };
private static readonly string[] stages4 = new string[4] { "dampcavesimple", "shipgraveyard", "rootjungle", "meridian" };
private static readonly string[] stages5 = new string[2] { "skymeadow", "helminthroost" };
private static readonly string[] finalStage = new string[1] { "moon2" };
public void Awake()
{
//IL_0211: Unknown result type (might be due to invalid IL or missing references)
//IL_021b: Expected O, but got Unknown
shrineChance_stage1 = ((BaseUnityPlugin)this).Config.Bind<float>("Stage1", "Probability_Stage1", 0f, "Probability of spawning the Shrine of Order in the stage (0.0 = 0%, 1.0 = 100%)");
shrineChance_stage2 = ((BaseUnityPlugin)this).Config.Bind<float>("Stage2", "Probability_Stage2", 0f, "Probability of spawning the Shrine of Order in the stage (0.0 = 0%, 1.0 = 100%)");
shrineChance_stage3 = ((BaseUnityPlugin)this).Config.Bind<float>("Stage3", "Probability_Stage3", 1f, "Probability of spawning the Shrine of Order in the stage (0.0 = 0%, 1.0 = 100%)");
shrineChance_stage4 = ((BaseUnityPlugin)this).Config.Bind<float>("Stage4", "Probability_Stage4", 0f, "Probability of spawning the Shrine of Order in the stage (0.0 = 0%, 1.0 = 100%)");
shrineChance_stage5 = ((BaseUnityPlugin)this).Config.Bind<float>("Stage5", "Probability_Stage5", 0f, "Probability of spawning the Shrine of Order in the stage (0.0 = 0%, 1.0 = 100%)");
shrineChance_finalStage = ((BaseUnityPlugin)this).Config.Bind<float>("FinalStage", "Probability_FinalStage", 1f, "Probability of spawning the Shrine of Order in the stage (0.0 = 0%, 1.0 = 100%)");
spawn_in_stage1 = ((BaseUnityPlugin)this).Config.Bind<bool>("Stage1", "SpawnIn_Stage1", false, "The Shrine of Order will have a chance of spawning in any map of stage 1");
spawn_in_stage2 = ((BaseUnityPlugin)this).Config.Bind<bool>("Stage2", "SpawnIn_Stage2", false, "The Shrine of Order will have a chance of spawning in any map of stage 2");
spawn_in_stage3 = ((BaseUnityPlugin)this).Config.Bind<bool>("Stage3", "SpawnIn_Stage3", true, "The Shrine of Order will have a chance of spawning in any map of stage 3");
spawn_in_stage4 = ((BaseUnityPlugin)this).Config.Bind<bool>("Stage4", "SpawnIn_Stage4", false, "The Shrine of Order will have a chance of spawning in any map of stage 4");
spawn_in_stage5 = ((BaseUnityPlugin)this).Config.Bind<bool>("Stage5", "SpawnIn_Stage5", false, "The Shrine of Order will have a chance of spawning in any map of stage 5");
spawn_in_finalStage = ((BaseUnityPlugin)this).Config.Bind<bool>("FinalStage", "SpawnIn_FinalStage", true, "The Shrine of Order will have a chance of spawning in the final stage");
Type type = Type.GetType("RiskOfOptions.ModSettingsManager, RiskOfOptions");
if (type != null)
{
try
{
Set_Options();
}
catch (Exception ex)
{
((BaseUnityPlugin)this).Logger.LogError((object)("Erreur lors de l'enregistrement des options RiskOfOptions : " + ex));
}
}
else
{
((BaseUnityPlugin)this).Logger.LogInfo((object)"RiskOfOptions non détecté. Les options ne seront pas ajoutées.");
}
((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreOrder : loaded 22 !");
SceneDirector.Start += new hook_Start(SceneDirector_Start);
}
private void Set_Options()
{
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_001b: Expected O, but got Unknown
//IL_0021: 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_0031: Unknown result type (might be due to invalid IL or missing references)
//IL_003c: 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_004f: Unknown result type (might be due to invalid IL or missing references)
//IL_0059: Expected O, but got Unknown
//IL_005e: Expected O, but got Unknown
//IL_0059: Unknown result type (might be due to invalid IL or missing references)
//IL_0063: Expected O, but got Unknown
//IL_0069: Unknown result type (might be due to invalid IL or missing references)
//IL_0073: Expected O, but got Unknown
//IL_0079: Unknown result type (might be due to invalid IL or missing references)
//IL_007e: Unknown result type (might be due to invalid IL or missing references)
//IL_0089: Unknown result type (might be due to invalid IL or missing references)
//IL_0094: Unknown result type (might be due to invalid IL or missing references)
//IL_009f: Unknown result type (might be due to invalid IL or missing references)
//IL_00a7: Unknown result type (might be due to invalid IL or missing references)
//IL_00b1: Expected O, but got Unknown
//IL_00b6: Expected O, but got Unknown
//IL_00b1: Unknown result type (might be due to invalid IL or missing references)
//IL_00bb: Expected O, but got Unknown
//IL_00c1: Unknown result type (might be due to invalid IL or missing references)
//IL_00cb: Expected O, but got Unknown
//IL_00d1: Unknown result type (might be due to invalid IL or missing references)
//IL_00d6: Unknown result type (might be due to invalid IL or missing references)
//IL_00e1: Unknown result type (might be due to invalid IL or missing references)
//IL_00ec: Unknown result type (might be due to invalid IL or missing references)
//IL_00f7: Unknown result type (might be due to invalid IL or missing references)
//IL_00ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0109: Expected O, but got Unknown
//IL_010e: Expected O, but got Unknown
//IL_0109: Unknown result type (might be due to invalid IL or missing references)
//IL_0113: Expected O, but got Unknown
//IL_0119: Unknown result type (might be due to invalid IL or missing references)
//IL_0123: Expected O, but got Unknown
//IL_0129: Unknown result type (might be due to invalid IL or missing references)
//IL_012e: Unknown result type (might be due to invalid IL or missing references)
//IL_0139: Unknown result type (might be due to invalid IL or missing references)
//IL_0144: Unknown result type (might be due to invalid IL or missing references)
//IL_014f: Unknown result type (might be due to invalid IL or missing references)
//IL_0157: Unknown result type (might be due to invalid IL or missing references)
//IL_0161: Expected O, but got Unknown
//IL_0166: Expected O, but got Unknown
//IL_0161: Unknown result type (might be due to invalid IL or missing references)
//IL_016b: Expected O, but got Unknown
//IL_0171: Unknown result type (might be due to invalid IL or missing references)
//IL_017b: Expected O, but got Unknown
//IL_0181: Unknown result type (might be due to invalid IL or missing references)
//IL_0186: Unknown result type (might be due to invalid IL or missing references)
//IL_0191: Unknown result type (might be due to invalid IL or missing references)
//IL_019c: Unknown result type (might be due to invalid IL or missing references)
//IL_01a7: Unknown result type (might be due to invalid IL or missing references)
//IL_01af: Unknown result type (might be due to invalid IL or missing references)
//IL_01b9: Expected O, but got Unknown
//IL_01be: Expected O, but got Unknown
//IL_01b9: Unknown result type (might be due to invalid IL or missing references)
//IL_01c3: Expected O, but got Unknown
//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
//IL_01d3: Expected O, but got Unknown
//IL_01d9: Unknown result type (might be due to invalid IL or missing references)
//IL_01de: Unknown result type (might be due to invalid IL or missing references)
//IL_01e9: Unknown result type (might be due to invalid IL or missing references)
//IL_01f4: Unknown result type (might be due to invalid IL or missing references)
//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0207: Unknown result type (might be due to invalid IL or missing references)
//IL_0211: Expected O, but got Unknown
//IL_0216: Expected O, but got Unknown
//IL_0211: Unknown result type (might be due to invalid IL or missing references)
//IL_021b: Expected O, but got Unknown
ModSettingsManager.SetModDescription("Ce mod permet d'augmenter la probabilité d'apparition des Shrines of Order.");
ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(spawn_in_stage1));
ModSettingsManager.AddOption((BaseOption)new SliderOption(shrineChance_stage1, (SliderConfig)new StepSliderConfig
{
min = 0f,
max = 1f,
increment = 0.01f,
checkIfDisabled = new IsDisabledDelegate(Get_Spawn_In_Stage1)
}));
ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(spawn_in_stage2));
ModSettingsManager.AddOption((BaseOption)new SliderOption(shrineChance_stage2, (SliderConfig)new StepSliderConfig
{
min = 0f,
max = 1f,
increment = 0.01f,
checkIfDisabled = new IsDisabledDelegate(Get_Spawn_In_Stage2)
}));
ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(spawn_in_stage3));
ModSettingsManager.AddOption((BaseOption)new SliderOption(shrineChance_stage3, (SliderConfig)new StepSliderConfig
{
min = 0f,
max = 1f,
increment = 0.01f,
checkIfDisabled = new IsDisabledDelegate(Get_Spawn_In_Stage3)
}));
ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(spawn_in_stage4));
ModSettingsManager.AddOption((BaseOption)new SliderOption(shrineChance_stage4, (SliderConfig)new StepSliderConfig
{
min = 0f,
max = 1f,
increment = 0.01f,
checkIfDisabled = new IsDisabledDelegate(Get_Spawn_In_Stage4)
}));
ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(spawn_in_stage5));
ModSettingsManager.AddOption((BaseOption)new SliderOption(shrineChance_stage5, (SliderConfig)new StepSliderConfig
{
min = 0f,
max = 1f,
increment = 0.01f,
checkIfDisabled = new IsDisabledDelegate(Get_Spawn_In_Stage5)
}));
ModSettingsManager.AddOption((BaseOption)new CheckBoxOption(spawn_in_finalStage));
ModSettingsManager.AddOption((BaseOption)new SliderOption(shrineChance_finalStage, (SliderConfig)new StepSliderConfig
{
min = 0f,
max = 1f,
increment = 0.01f,
checkIfDisabled = new IsDisabledDelegate(Get_Spawn_In_FinalStage)
}));
}
private bool Get_Spawn_In_Stage1()
{
return !spawn_in_stage1.Value;
}
private bool Get_Spawn_In_Stage2()
{
return !spawn_in_stage2.Value;
}
private bool Get_Spawn_In_Stage3()
{
return !spawn_in_stage3.Value;
}
private bool Get_Spawn_In_Stage4()
{
return !spawn_in_stage4.Value;
}
private bool Get_Spawn_In_Stage5()
{
return !spawn_in_stage5.Value;
}
private bool Get_Spawn_In_FinalStage()
{
return !spawn_in_finalStage.Value;
}
private void SceneDirector_Start(orig_Start orig, SceneDirector self)
{
//IL_0009: 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)
orig.Invoke(self);
Scene activeScene = SceneManager.GetActiveScene();
string name = ((Scene)(ref activeScene)).name;
((BaseUnityPlugin)this).Logger.LogInfo((object)("MoreOrder : Scene active : " + name));
if (CheckStageName(name))
{
SpawnShrineOfOrder();
}
}
private bool CheckStageName(string sceneName)
{
if (spawn_in_stage1.Value && Random.value <= shrineChance_stage1.Value && stages1.Any((string prefix) => sceneName.StartsWith(prefix)))
{
((BaseUnityPlugin)this).Logger.LogInfo((object)("MoreOrder : Stage Valid " + sceneName));
return true;
}
if (spawn_in_stage2.Value && Random.value <= shrineChance_stage2.Value && stages2.Any((string prefix) => sceneName.StartsWith(prefix)))
{
return true;
}
if (spawn_in_stage3.Value && Random.value <= shrineChance_stage3.Value && stages3.Any((string prefix) => sceneName.StartsWith(prefix)))
{
return true;
}
if (spawn_in_stage4.Value && Random.value <= shrineChance_stage4.Value && stages4.Any((string prefix) => sceneName.StartsWith(prefix)))
{
return true;
}
if (spawn_in_stage5.Value && Random.value <= shrineChance_stage5.Value && stages5.Any((string prefix) => sceneName.StartsWith(prefix)))
{
return true;
}
if (spawn_in_finalStage.Value && Random.value <= shrineChance_finalStage.Value && finalStage.Any((string prefix) => sceneName.StartsWith(prefix)))
{
return true;
}
return false;
}
private void SpawnShrineOfOrder()
{
//IL_002d: Unknown result type (might be due to invalid IL or missing references)
//IL_0032: Unknown result type (might be due to invalid IL or missing references)
//IL_0034: Unknown result type (might be due to invalid IL or missing references)
//IL_003a: Expected O, but got Unknown
//IL_0046: Unknown result type (might be due to invalid IL or missing references)
//IL_004c: Expected O, but got Unknown
InteractableSpawnCard val = LegacyResourcesAPI.Load<InteractableSpawnCard>("SpawnCards/InteractableSpawnCard/iscShrineRestack");
if ((Object)(object)val == (Object)null)
{
((BaseUnityPlugin)this).Logger.LogError((object)"MoreOrder : spawn card not found. ");
return;
}
DirectorPlacementRule val2 = new DirectorPlacementRule
{
placementMode = (PlacementMode)4
};
DirectorSpawnRequest val3 = new DirectorSpawnRequest((SpawnCard)(object)val, val2, Run.instance.stageRng);
val3.ignoreTeamMemberLimit = true;
GameObject val4 = DirectorCore.instance.TrySpawnObject(val3);
if ((Object)(object)val4 != (Object)null)
{
((BaseUnityPlugin)this).Logger.LogInfo((object)"MoreOrder : Shrined spawned!");
}
}
}
}
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);
}
}
}