Some mods target the Mono version of the game, which is available by opting into the Steam beta branch "alternate"
Decompiled source of ReactiveCartel v1.1.1
ReactiveCartel.dll
Decompiled 2 months agousing System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Resources; using System.Runtime.CompilerServices; using System.Runtime.Versioning; using System.Security; using System.Security.Permissions; using FishNet; using HarmonyLib; using MelonLoader; using Microsoft.CodeAnalysis; using ReactiveCartel; using ReactiveCartel.Patches; using S1API.Leveling; using ScheduleOne.Cartel; using ScheduleOne.DevUtilities; using ScheduleOne.Map; using ScheduleOne.Persistence; using UnityEngine; using UnityEngine.Events; [assembly: CompilationRelaxations(8)] [assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)] [assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)] [assembly: MelonInfo(typeof(Core), "ReactiveCartel", "1.1.0", "Lumahex", null)] [assembly: MelonGame("TVGS", "Schedule I")] [assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")] [assembly: AssemblyCompany("ReactiveCartel")] [assembly: AssemblyConfiguration("Debug")] [assembly: AssemblyFileVersion("1.0.0.0")] [assembly: AssemblyInformationalVersion("1.0.0")] [assembly: AssemblyProduct("ReactiveCartel")] [assembly: AssemblyTitle("ReactiveCartel")] [assembly: NeutralResourcesLanguage("en-US")] [assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)] [assembly: AssemblyVersion("1.0.0.0")] [module: UnverifiableCode] [module: RefSafetyRules(11)] namespace Microsoft.CodeAnalysis { [CompilerGenerated] [Embedded] internal sealed class EmbeddedAttribute : Attribute { } } namespace System.Runtime.CompilerServices { [CompilerGenerated] [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 ReactiveCartel { public class Core : MelonMod { private bool _initialized = false; public override void OnInitializeMelon() { //IL_0017: Unknown result type (might be due to invalid IL or missing references) //IL_001d: Expected O, but got Unknown ((MelonBase)this).LoggerInstance.Msg("Reactive Cartel Initialized."); Harmony val = new Harmony("ReactiveCartel"); val.PatchAll(); MelonLogger.Msg("Harmony Patches Applied"); } public override void OnUpdate() { if (!_initialized && ReactiveCartel.Patches.ReactiveCartel.TryToInitialize()) { _initialized = true; } } } } namespace ReactiveCartel.Patches { public static class ReactiveCartel { [CompilerGenerated] private static class <>O { public static UnityAction <0>__OnLoadComplete; } public static bool GameLoaded; public static bool TryToInitialize() { //IL_002e: Unknown result type (might be due to invalid IL or missing references) //IL_0033: Unknown result type (might be due to invalid IL or missing references) //IL_0039: Expected O, but got Unknown if ((Object)(object)Singleton<LoadManager>.Instance == (Object)null) { return false; } UnityEvent onLoadComplete = Singleton<LoadManager>.Instance.onLoadComplete; object obj = <>O.<0>__OnLoadComplete; if (obj == null) { UnityAction val = OnLoadComplete; <>O.<0>__OnLoadComplete = val; obj = (object)val; } onLoadComplete.AddListener((UnityAction)obj); MelonLogger.Msg("Hooked LoadManager"); return true; } private static void OnLoadComplete() { //IL_0037: Unknown result type (might be due to invalid IL or missing references) //IL_004e: Unknown result type (might be due to invalid IL or missing references) GameLoaded = true; MelonLogger.Msg("Game fully loaded"); if (InstanceFinder.IsServer) { CartelRegionActivities[] array = Object.FindObjectsOfType<CartelRegionActivities>(); CartelRegionActivities[] array2 = array; foreach (CartelRegionActivities val in array2) { val.HoursUntilNextActivity = CartelRegionActivities.GetNewCooldown(val.Region); MelonLogger.Msg($"Recalculated {val.Region}: {val.HoursUntilNextActivity} hours"); } } } } [HarmonyPatch(typeof(CartelRegionActivities), "GetNewCooldown")] public static class RegionalCooldownPatch { private static bool Prefix(EMapRegion region, ref int __result) { //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_0092: Unknown result type (might be due to invalid IL or missing references) if (!ReactiveCartel.GameLoaded) { return true; } if (!LevelManager.Exists) { return true; } FullRank currentRank = LevelManager.CurrentRank; int rankIndex = ((FullRank)(ref currentRank)).GetRankIndex(); float num = 40f; float num2 = Mathf.Clamp01((float)rankIndex + 1f / num); float num3 = Mathf.Lerp(24f, 6f, num2); float num4 = Mathf.Lerp(48f, 12f, num2); __result = Mathf.RoundToInt(Random.Range(num3, num4)); MelonLogger.Msg($"[ReactiveCartel] Region: {region} | RankIndex: {rankIndex} | Progress: {num2:F2} | Cooldown: {__result}h"); return false; } } [HarmonyPatch(typeof(CartelRegionActivities), "TryStartActivity")] public static class TryStartActivity_WeightedPatch { private static bool Prefix(CartelRegionActivities __instance) { //IL_000e: Unknown result type (might be due to invalid IL or missing references) //IL_0013: Unknown result type (might be due to invalid IL or missing references) //IL_002d: Unknown result type (might be due to invalid IL or missing references) FullRank currentRank = LevelManager.CurrentRank; int playerRank = ((FullRank)(ref currentRank)).GetRankIndex(); __instance.HoursUntilNextActivity = CartelRegionActivities.GetNewCooldown(__instance.Region); List<CartelActivity> activities = __instance.Activities; List<CartelActivity> list = activities.Where((CartelActivity a) => a.IsRegionValidForActivity(__instance.Region)).ToList(); if (list.Count == 0) { return false; } List<float> weights = list.Select((CartelActivity a) => GetWeight(a, playerRank)).ToList(); CartelActivity item = WeightedPick(list, weights); int num = activities.IndexOf(item); AccessTools.Method(typeof(CartelRegionActivities), "StartActivity", (Type[])null, (Type[])null).Invoke(__instance, new object[2] { null, num }); return false; } private static float GetWeight(CartelActivity activity, int playerRank) { bool flag = activity is Ambush || activity is RobDealer; float num = Mathf.Clamp01((float)(playerRank + 1) / 40f); if (flag) { return 1f + num * 5f; } return 1f; } private static CartelActivity WeightedPick(List<CartelActivity> options, List<float> weights) { float num = 0f; foreach (float weight in weights) { num += weight; } float num2 = Random.Range(0f, num); float num3 = 0f; for (int i = 0; i < options.Count; i++) { num3 += weights[i]; if (num2 <= num3) { return options[i]; } } return options[0]; } } }