using System;
using System.Collections.Generic;
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 HarmonyLib;
using NotSoBrutalCompany.Events;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints)]
[assembly: TargetFramework(".NETFramework,Version=v4.6", FrameworkDisplayName = ".NET Framework 4.6")]
[assembly: AssemblyCompany("NotSoBrutalCompany")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("Brutal mod for Lethal Company")]
[assembly: AssemblyFileVersion("1.4.0.0")]
[assembly: AssemblyInformationalVersion("1.4.0")]
[assembly: AssemblyProduct("NotSoBrutalCompany")]
[assembly: AssemblyTitle("NotSoBrutalCompany")]
[assembly: SecurityPermission(SecurityAction.RequestMinimum, SkipVerification = true)]
[assembly: AssemblyVersion("1.4.0.0")]
[module: UnverifiableCode]
namespace NotSoBrutalCompany
{
public class ConfigSettings
{
public ConfigEntry<bool> EnableDeadlineModification { get; set; }
public ConfigEntry<int> DeadlineDays { get; set; }
public ConfigEntry<bool> EnableQuotaModification { get; set; }
public ConfigEntry<int> StartingQuota { get; set; }
public ConfigEntry<int> QuotaIncrease { get; set; }
public ConfigEntry<bool> EnableCreditModification { get; set; }
public ConfigEntry<int> StartingCredits { get; set; }
public ConfigEntry<int> PassiveCredits { get; set; }
public ConfigEntry<bool> EnableScrapModification { get; set; }
public ConfigEntry<int> MinScrapModifier { get; set; }
public ConfigEntry<int> MaxScrapModifier { get; set; }
public ConfigEntry<int> MinScrapValueModifier { get; set; }
public ConfigEntry<int> MaxScrapValueModifier { get; set; }
public ConfigEntry<bool> EnableEnemyModification { get; set; }
public ConfigEntry<int> MaxInsideEnemyPowerModifier { get; set; }
public ConfigEntry<int> MaxOutsideEnemyPowerModifier { get; set; }
public ConfigEntry<int> MaxDaytimeEnemyPowerModifier { get; set; }
public ConfigEntry<float> InsideEnemySpawnCurve1 { get; set; }
public ConfigEntry<float> InsideEnemySpawnCurve2 { get; set; }
public ConfigEntry<float> OutsideEnemySpawnCurve1 { get; set; }
public ConfigEntry<float> OutsideEnemySpawnCurve2 { get; set; }
public ConfigEntry<float> OutsideEnemySpawnCurve3 { get; set; }
public ConfigEntry<float> DaytimeEnemySpawnCurve1 { get; set; }
public ConfigEntry<float> DaytimeEnemySpawnCurve2 { get; set; }
public ConfigEntry<bool> EnableHazardModification { get; set; }
public ConfigEntry<float> TurretSpawnCurve1 { get; set; }
public ConfigEntry<float> TurretSpawnCurve2 { get; set; }
public ConfigEntry<float> MineSpawnCurve1 { get; set; }
public ConfigEntry<float> MineSpawnCurve2 { get; set; }
public ConfigEntry<bool> EventHidden { get; set; }
public ConfigEntry<int> EventProbability { get; set; }
public ConfigEntry<bool> EnableFlowermanCoilEvent { get; set; }
public ConfigEntry<int> FlowermanCoilEventFlowermanMax { get; set; }
public ConfigEntry<int> FlowermanCoilEventCoilHeadMax { get; set; }
public ConfigEntry<bool> EnableDogEvent { get; set; }
public ConfigEntry<bool> EnableHoardingBugsEvent { get; set; }
public ConfigEntry<int> HoardingBugsEventHoardingMax { get; set; }
public ConfigEntry<bool> EnableJetpackEvent { get; set; }
public ConfigEntry<int> JetpackEventJetpackCount { get; set; }
public ConfigEntry<bool> EnableLandmineEvent { get; set; }
public ConfigEntry<bool> EnableLassoEvent { get; set; }
public ConfigEntry<bool> EnableLittleGirlEvent { get; set; }
public ConfigEntry<bool> EnableMonkeyEvent { get; set; }
public ConfigEntry<bool> EnableRandomDeliveryEvent { get; set; }
public ConfigEntry<bool> EnableSnareFleaEvent { get; set; }
public ConfigEntry<int> SnareFleaEventSnareFleaMax { get; set; }
public ConfigEntry<bool> EnableSpiderEvent { get; set; }
public ConfigEntry<int> SpiderEventSpiderMax { get; set; }
public ConfigEntry<bool> EnableThumperEvent { get; set; }
public ConfigEntry<int> ThumperEventThumperMax { get; set; }
public ConfigEntry<bool> EnableThunderEvent { get; set; }
public ConfigEntry<bool> EnableTurretEvent { get; set; }
public ConfigEntry<bool> EnableWalkiDeliveryEvent { get; set; }
public ConfigEntry<bool> EnableCoilHeadEvent { get; set; }
public ConfigEntry<int> CoilHeadEventCoilHeadMax { get; set; }
public ConfigEntry<bool> EnableJesterEvent { get; set; }
public ConfigEntry<int> JesterEventJesterMax { get; set; }
public void LoadConfigs()
{
EnableDeadlineModification = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("Deadline", "DeadlineModification", false, "False to go back to vanilla dealine value or avoid conflicting with other mods.");
DeadlineDays = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("Deadline", "DeadlineDays", 3, "Days until deadline.");
EnableQuotaModification = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("Quota", "EnableQuotaModification", true, "False to go back to vanilla quota values or avoid conflicting with other mods.");
StartingQuota = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("Quota", "StartingQuota", 500, "Starting quota.");
QuotaIncrease = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("Quota", "QuotaIncrease", 275, "Quota increase after the dealine.");
EnableCreditModification = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("Credits", "EnableCreditModification", true, "False to go back to vanilla credit values or avoid conflicting with other mods.");
StartingCredits = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("Credits", "StartingCredits", 80, "Starting credits.");
PassiveCredits = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("Credits", "PassiveCredits", 120, "Passive credits at the start of every level.");
EnableScrapModification = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("Scraps", "EnableScrapModification", true, "False to go back to vanilla scrap values or avoid conflicting with other mods.");
MinScrapModifier = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("Scraps", "MinScrapModifier", 0, "Added to the minimum total number of scraps in a level.");
MaxScrapModifier = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("Scraps", "MaxScrapModifier", 45, "Added to the maximum total number of scraps in a level.");
MinScrapValueModifier = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("Scraps", "MinScrapValueModifier", 0, "Added to the minimum total value of scraps in a level.");
MaxScrapValueModifier = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("Scraps", "MaxScrapValueModifier", 800, "Added to the maximum total value of scraps in a level.");
EnableEnemyModification = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("Enemies", "EnableEnemyModification", true, "False to go back to vanilla enemy values or avoid conflicting with other mods.");
MaxInsideEnemyPowerModifier = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("Enemies", "MaxInsideEnemyPowerModifier", 2000, "Added to the maximum enemy power for inside enemies, this controls the maximum level difficulty.");
MaxOutsideEnemyPowerModifier = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("Enemies", "MaxOutsideEnemyPowerModifier", 20, "Added to the maximum enemy power for outside enemies, this controls the maximum level difficulty.");
MaxDaytimeEnemyPowerModifier = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("Enemies", "MaxDaytimeEnemyPowerModifier", 200, "Added to the maximum enemy power for daytime enemies, this controls the maximum level difficulty.");
InsideEnemySpawnCurve1 = ((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("Enemies", "InsideEnemySpawnCurveValue1", 0.1f, "Spawn curve for inside enemies, start of the day.");
InsideEnemySpawnCurve2 = ((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("Enemies", "InsideEnemySpawnCurveValue2", 500f, "Spawn curve for inside enemies, midday.");
OutsideEnemySpawnCurve1 = ((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("Enemies", "OutsideEnemySpawnCurve1", -30f, "Spawn curve for outside enemies, start of the day.");
OutsideEnemySpawnCurve2 = ((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("Enemies", "OutsideEnemySpawnCurve2", -30f, "Spawn curve for outside enemies, 4 hours bfore launch.");
OutsideEnemySpawnCurve3 = ((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("Enemies", "OutsideEnemySpawnCurve3", 10f, "Spawn curve for outside enemies, 3 hours before launch");
DaytimeEnemySpawnCurve1 = ((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("Enemies", "DaytimeEnemySpawnCurve1", 7f, "Spawn curve for daytime enemies, start of the day.");
DaytimeEnemySpawnCurve2 = ((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("Enemies", "DaytimeEnemySpawnCurve2", 7f, "Spawn curve for daytime enemies, midday.");
EnableHazardModification = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("Hazards", "EnableHazardModification", true, "False to go back to vanilla hazard values or avoid conflicting with other mods.");
TurretSpawnCurve1 = ((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("Hazards", "TurretSpawnCurve1", 0f, "Spawn curve for turrets, first value. Increase the number of turrets in levels.");
TurretSpawnCurve2 = ((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("Hazards", "TurretSpawnCurve2", 10f, "Spawn curve for turrets, second value. Increase the number of turrets in levels.");
MineSpawnCurve1 = ((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("Hazards", "MineSpawnCurve1", 0f, "Spawn curve for mines, first value. Increase the number of mines in levels.");
MineSpawnCurve2 = ((BaseUnityPlugin)Plugin.instance).Config.Bind<float>("Hazards", "MineSpawnCurve2", 70f, "Spawn curve for mines, second value. Increase the number of mines in levels.");
EventHidden = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("Events", "EventHidden", false, "Set to true to hide events in the chat.");
EventProbability = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("Events", "EventProbablity", 4, "Value from 0 to 10. 0 there's almost always an event and 10 there's never an event.");
EnableFlowermanCoilEvent = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("FlowermanCoilEvent", "EnableFlowermanCoilEvent", true, "Is the flowerman and coil (The deadliest combo of all time) event active.");
FlowermanCoilEventFlowermanMax = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("FlowermanCoilEvent", "FlowermanCoilEventFlowermanMax", 3, "Maximum number of flowerman during the event (capped by power modifier).");
FlowermanCoilEventCoilHeadMax = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("FlowermanCoilEvent", "FlowermanCoilEventCoilHeadMax", 5, "Maximum number of coil head during the event (capped by power modifier).");
EnableDogEvent = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("DogEvent", "EnableDogEvent", true, "Is the dog event(Who let the dogs out) active.");
EnableHoardingBugsEvent = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("HoardingBugsEvent", "EnableHoardingBugsEvent", true, "Is the hoarding bugs event(Kleptomania) active.");
HoardingBugsEventHoardingMax = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("HoardingBugsEvent", "HoardingBugsEventHoardingMax", 15, "Maximum number of hoarding bugs during the event (capped by power modifier).");
EnableJetpackEvent = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("JetpackEvent", "EnableJetpackEvent", true, "Is the jetpack event(Jetpack delivery) active.");
JetpackEventJetpackCount = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("JetpackEvent", "JetpackEventJetpackCount", 5, "Number of jetpacks during jetpack event.");
EnableLandmineEvent = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("LandmineEvent", "EnableLandmineEvent", true, "Is the landmine event(Landmine hell) active.");
EnableLassoEvent = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("LassoEvent", "EnableLassoEvent", true, "Is the lasso event(Lasso man is real) active.");
EnableLittleGirlEvent = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("LittleGirlEvent", "EnableLittleGirlEvent", true, "Is the little girl event(Sweet Little Girl) active.");
EnableMonkeyEvent = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("MonkeyEvent", "EnableMonkeyEvent", true, "Is the monkey event(Monke) active.");
EnableRandomDeliveryEvent = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("RandomDeliveryEvent", "EnableRandomDeliveryEvent", true, "Is the random delivery event(Lost delivery) active.");
EnableSnareFleaEvent = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("SnareFleaEvent", "EnableSnareFleaEvent", true, "Is the snare flea event(Ready to suffocate ?) active.");
SnareFleaEventSnareFleaMax = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("SnareFleaEvent", "SnareFleaEventSnareFleaMax", 6, "Maximum number of snare flea during the event (capped by power modifier).");
EnableSpiderEvent = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("SpiderEvent", "EnableSpiderEvent", true, "Is the spider event(Arachnophobia) active.");
SpiderEventSpiderMax = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("SpiderEvent", "SpiderEventSpiderMax", 6, "Maximum number of spiders during the event (capped by power modifier).");
EnableThumperEvent = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("ThumperEvent", "EnableThumperEvent", true, "Is the thumper event(Thump Thump Thump) active.");
ThumperEventThumperMax = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("ThumperEvent", "ThumperEventThumperMax", 6, "Maximum number of thumper during the event (capped by power modifier).");
EnableThunderEvent = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("ThunderEvent", "EnableThunderEvent", true, "Is the thunder event(Thunderstruck) active.");
EnableTurretEvent = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("TurretEvent", "EnableTurretEvent", true, "Is the turret event(Turret hell) active.");
EnableWalkiDeliveryEvent = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("WalkiDeliveryEvent", "EnableWalkiDeliveryEvent", true, "Is the walki delivery event(Walkie delivery) active.");
EnableCoilHeadEvent = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("CoilHeadEvent", "EnableCoilHeadEvent", true, "Is the coil head event(Boing!) active.");
CoilHeadEventCoilHeadMax = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("CoilHeadEvent", "CoilHeadEventCoilHeadMax", 5, "Maximum number of coil head during the event (capped by power modifier).");
EnableJesterEvent = ((BaseUnityPlugin)Plugin.instance).Config.Bind<bool>("JesterEvent", "EnableJesterEvent", true, "Is the jester event(Thump Thump Thump) active.");
JesterEventJesterMax = ((BaseUnityPlugin)Plugin.instance).Config.Bind<int>("JesterEvent", "JesterEventJesterMax", 4, "Maximum number of jester during the event (capped by power modifier).");
}
}
[BepInPlugin("NotSoBrutalCompany", "NotSoBrutalCompany", "1.4.0")]
public class Plugin : BaseUnityPlugin
{
public static Plugin instance;
public static ConfigSettings configSettings = new ConfigSettings();
public static bool loaded;
public static BrutalEvent gameEvent = null;
internal static EventCreator eventCreator = new EventCreator();
public static SelectableLevel lastLevel = null;
public static List<int> difficultyModifiedLevels = new List<int>();
private Harmony _harmony = new Harmony("NotSoBrutalCompany");
public static ManualLogSource mls;
private void Awake()
{
instance = this;
configSettings.LoadConfigs();
BrutalEventList.AddBaseEvents(configSettings);
mls = Logger.CreateLogSource("NotSoBrutalCompany");
mls.LogInfo((object)"Loaded Not so Brutal Company and applying patches.");
_harmony.PatchAll(typeof(Plugin));
mls = ((BaseUnityPlugin)this).Logger;
}
public void OnDestroy()
{
}
[HarmonyPatch(typeof(TimeOfDay), "Awake")]
[HarmonyPrefix]
private static void QuotaAjuster(TimeOfDay __instance)
{
if (configSettings.EnableQuotaModification.Value)
{
__instance.quotaVariables.startingQuota = configSettings.StartingQuota.Value;
}
if (configSettings.EnableCreditModification.Value)
{
__instance.quotaVariables.startingCredits = configSettings.StartingCredits.Value;
__instance.quotaVariables.baseIncrease = configSettings.QuotaIncrease.Value;
}
if (configSettings.EnableDeadlineModification.Value)
{
__instance.quotaVariables.deadlineDaysAmount = configSettings.DeadlineDays.Value;
}
}
[HarmonyPatch(typeof(RoundManager), "LoadNewLevel")]
[HarmonyPrefix]
private static bool LoadNewLevel(ref SelectableLevel newLevel)
{
mls.LogInfo((object)"NotSoBrutalCompany logs");
HUDManager.Instance.AddTextToChatOnServer("\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n", -1);
ChangeLevelDifficulty(ref newLevel);
if (gameEvent != null)
{
gameEvent.OnLoadNewLevelCleanup(ref lastLevel);
}
if (newLevel.sceneName == "CompanyBuilding")
{
gameEvent = new NoneEvent();
}
else
{
Terminal val = Object.FindObjectOfType<Terminal>();
if (configSettings.EnableCreditModification.Value)
{
val.groupCredits += configSettings.PassiveCredits.Value;
}
int num = 0;
do
{
gameEvent = eventCreator.GetRandomEventWithWeight(configSettings.EventProbability.Value);
num++;
}
while (!gameEvent.IsValid(ref newLevel) && num < 4);
if (num >= 4)
{
gameEvent = new NoneEvent();
}
}
if (configSettings.EventHidden.Value)
{
HUDManager.Instance.AddTextToChatOnServer("<color=red>Level event:</color> <color=green>?</color>", -1);
}
else
{
HUDManager.Instance.AddTextToChatOnServer("<color=red>Level event:</color> <color=green>" + gameEvent.GetEventName() + "</color>", -1);
}
gameEvent.OnLoadNewLevel(ref newLevel, configSettings);
lastLevel = newLevel;
return true;
}
private static void ChangeLevelDifficulty(ref SelectableLevel newLevel)
{
//IL_01c9: Unknown result type (might be due to invalid IL or missing references)
//IL_01ce: 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_01ee: Unknown result type (might be due to invalid IL or missing references)
//IL_01f3: Unknown result type (might be due to invalid IL or missing references)
//IL_01fd: Expected O, but got Unknown
//IL_021b: Unknown result type (might be due to invalid IL or missing references)
//IL_0220: Unknown result type (might be due to invalid IL or missing references)
//IL_023b: Unknown result type (might be due to invalid IL or missing references)
//IL_0240: Unknown result type (might be due to invalid IL or missing references)
//IL_0245: Unknown result type (might be due to invalid IL or missing references)
//IL_024f: Expected O, but got Unknown
//IL_026d: Unknown result type (might be due to invalid IL or missing references)
//IL_0272: Unknown result type (might be due to invalid IL or missing references)
//IL_028d: Unknown result type (might be due to invalid IL or missing references)
//IL_0292: Unknown result type (might be due to invalid IL or missing references)
//IL_02ad: Unknown result type (might be due to invalid IL or missing references)
//IL_02b2: Unknown result type (might be due to invalid IL or missing references)
//IL_02b7: Unknown result type (might be due to invalid IL or missing references)
//IL_02c1: Expected O, but got Unknown
//IL_00f0: Unknown result type (might be due to invalid IL or missing references)
//IL_00f5: Unknown result type (might be due to invalid IL or missing references)
//IL_0110: Unknown result type (might be due to invalid IL or missing references)
//IL_0115: Unknown result type (might be due to invalid IL or missing references)
//IL_011a: Unknown result type (might be due to invalid IL or missing references)
//IL_0124: Expected O, but got Unknown
//IL_0156: Unknown result type (might be due to invalid IL or missing references)
//IL_015b: Unknown result type (might be due to invalid IL or missing references)
//IL_0176: Unknown result type (might be due to invalid IL or missing references)
//IL_017b: Unknown result type (might be due to invalid IL or missing references)
//IL_0180: Unknown result type (might be due to invalid IL or missing references)
//IL_018a: Expected O, but got Unknown
if (difficultyModifiedLevels.Contains(newLevel.levelID))
{
return;
}
if (configSettings.EnableScrapModification.Value)
{
SelectableLevel obj = newLevel;
obj.minScrap += configSettings.MinScrapModifier.Value;
SelectableLevel obj2 = newLevel;
obj2.maxScrap += configSettings.MaxScrapModifier.Value;
SelectableLevel obj3 = newLevel;
obj3.minTotalScrapValue += configSettings.MinScrapValueModifier.Value;
SelectableLevel obj4 = newLevel;
obj4.maxTotalScrapValue += configSettings.MaxScrapValueModifier.Value;
}
if (configSettings.EnableHazardModification.Value)
{
SpawnableMapObject[] spawnableMapObjects = newLevel.spawnableMapObjects;
foreach (SpawnableMapObject val in spawnableMapObjects)
{
if ((Object)(object)val.prefabToSpawn.GetComponentInChildren<Turret>() != (Object)null)
{
val.numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[2]
{
new Keyframe(0f, configSettings.TurretSpawnCurve1.Value),
new Keyframe(1f, configSettings.TurretSpawnCurve2.Value)
});
}
else if ((Object)(object)val.prefabToSpawn.GetComponentInChildren<Landmine>() != (Object)null)
{
val.numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[2]
{
new Keyframe(0f, configSettings.MineSpawnCurve1.Value),
new Keyframe(1f, configSettings.MineSpawnCurve2.Value)
});
}
}
}
if (configSettings.EnableEnemyModification.Value)
{
newLevel.enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[2]
{
new Keyframe(0f, configSettings.InsideEnemySpawnCurve1.Value),
new Keyframe(0.5f, configSettings.InsideEnemySpawnCurve2.Value)
});
newLevel.daytimeEnemySpawnChanceThroughDay = new AnimationCurve((Keyframe[])(object)new Keyframe[2]
{
new Keyframe(0f, configSettings.DaytimeEnemySpawnCurve1.Value),
new Keyframe(0.5f, configSettings.DaytimeEnemySpawnCurve2.Value)
});
newLevel.outsideEnemySpawnChanceThroughDay = new AnimationCurve((Keyframe[])(object)new Keyframe[3]
{
new Keyframe(0f, configSettings.OutsideEnemySpawnCurve1.Value),
new Keyframe(20f, configSettings.OutsideEnemySpawnCurve2.Value),
new Keyframe(21f, configSettings.OutsideEnemySpawnCurve3.Value)
});
SelectableLevel obj5 = newLevel;
obj5.maxEnemyPowerCount += configSettings.MaxInsideEnemyPowerModifier.Value;
SelectableLevel obj6 = newLevel;
obj6.maxOutsideEnemyPowerCount += configSettings.MaxOutsideEnemyPowerModifier.Value;
SelectableLevel obj7 = newLevel;
obj7.maxDaytimeEnemyPowerCount += configSettings.MaxDaytimeEnemyPowerModifier.Value;
}
difficultyModifiedLevels.Add(newLevel.levelID);
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "NotSoBrutalCompany";
public const string PLUGIN_NAME = "NotSoBrutalCompany";
public const string PLUGIN_VERSION = "1.4.0";
}
}
namespace NotSoBrutalCompany.ManualPatches
{
[HarmonyPatch(typeof(TimeOfDay), "Start")]
internal class Patch_QuotaAjuster
{
private static void Prefix(TimeOfDay __instance)
{
Plugin.mls.LogWarning((object)"Changing quota variables in patch!");
__instance.quotaVariables.startingQuota = 1000;
__instance.quotaVariables.startingCredits = 250;
__instance.quotaVariables.baseIncrease = 500f;
__instance.quotaVariables.randomizerMultiplier = 0f;
__instance.quotaVariables.deadlineDaysAmount = 10;
}
}
}
namespace NotSoBrutalCompany.Heat
{
public class HeatController
{
}
}
namespace NotSoBrutalCompany.Events
{
internal class BrackenCoilEventCreator : BrutalEventCreator
{
public override BrutalEvent Create()
{
return new BrackenCoilEvent();
}
}
internal class BrackenCoilEvent : BrutalEvent
{
private AnimationCurve oldAnimationCurve;
private List<int> rarities = new List<int>();
private int oldCoilMax;
private int oldFlowerMax;
public override string GetEventName()
{
return "The deadliest combo of all time";
}
public override void OnLoadNewLevel(ref SelectableLevel newLevel, ConfigSettings configs)
{
//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_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Expected O, but got Unknown
oldAnimationCurve = newLevel.enemySpawnChanceThroughoutDay;
newLevel.enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[1]
{
new Keyframe(0f, 500f)
});
for (int i = 0; i < newLevel.Enemies.Count; i++)
{
rarities.Add(newLevel.Enemies[i].rarity);
if ((Object)(object)newLevel.Enemies[i].enemyType.enemyPrefab.GetComponent<FlowermanAI>() != (Object)null)
{
newLevel.Enemies[i].rarity = 999;
oldFlowerMax = newLevel.Enemies[i].enemyType.MaxCount;
newLevel.Enemies[i].enemyType.MaxCount = configs.FlowermanCoilEventFlowermanMax.Value;
}
if ((Object)(object)newLevel.Enemies[i].enemyType.enemyPrefab.GetComponent<SpringManAI>() != (Object)null)
{
newLevel.Enemies[i].rarity = 999;
oldCoilMax = newLevel.Enemies[i].enemyType.MaxCount;
newLevel.Enemies[i].enemyType.MaxCount = configs.FlowermanCoilEventCoilHeadMax.Value;
}
}
}
public override void OnLoadNewLevelCleanup(ref SelectableLevel newLevel)
{
newLevel.enemySpawnChanceThroughoutDay = oldAnimationCurve;
for (int i = 0; i < newLevel.Enemies.Count; i++)
{
newLevel.Enemies[i].rarity = rarities[i];
if ((Object)(object)newLevel.Enemies[i].enemyType.enemyPrefab.GetComponent<FlowermanAI>() != (Object)null)
{
newLevel.Enemies[i].enemyType.MaxCount = oldFlowerMax;
}
if ((Object)(object)newLevel.Enemies[i].enemyType.enemyPrefab.GetComponent<SpringManAI>() != (Object)null)
{
newLevel.Enemies[i].enemyType.MaxCount = oldCoilMax;
}
}
}
public override bool IsValid(ref SelectableLevel newLevel)
{
bool flag = false;
bool flag2 = false;
foreach (SpawnableEnemyWithRarity enemy in newLevel.Enemies)
{
if ((Object)(object)enemy.enemyType.enemyPrefab.GetComponent<FlowermanAI>() != (Object)null)
{
flag = true;
}
else if ((Object)(object)enemy.enemyType.enemyPrefab.GetComponent<SpringManAI>() != (Object)null)
{
flag2 = true;
}
}
if (flag && flag2)
{
return true;
}
return false;
}
}
public abstract class BrutalEventCreator
{
public abstract BrutalEvent Create();
}
public abstract class BrutalEvent
{
public abstract string GetEventName();
public abstract void OnLoadNewLevel(ref SelectableLevel newLevel, ConfigSettings configs);
public virtual void OnLoadNewLevelCleanup(ref SelectableLevel newLevel)
{
}
public virtual bool IsValid(ref SelectableLevel newLevel)
{
return true;
}
}
internal class CoilHeadEventCreator : BrutalEventCreator
{
public override BrutalEvent Create()
{
return new CoilHeadEvent();
}
}
internal class CoilHeadEvent : BrutalEvent
{
private AnimationCurve oldAnimationCurve;
private List<int> rarities = new List<int>();
private int oldMaxCount;
public override string GetEventName()
{
return "Boing!";
}
public override void OnLoadNewLevel(ref SelectableLevel newLevel, ConfigSettings configs)
{
//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_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Expected O, but got Unknown
oldAnimationCurve = newLevel.enemySpawnChanceThroughoutDay;
newLevel.enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[1]
{
new Keyframe(0f, 500f)
});
for (int i = 0; i < newLevel.Enemies.Count; i++)
{
rarities.Add(newLevel.Enemies[i].rarity);
newLevel.Enemies[i].rarity = 0;
if ((Object)(object)newLevel.Enemies[i].enemyType.enemyPrefab.GetComponent<SpringManAI>() != (Object)null)
{
newLevel.Enemies[i].rarity = 999;
oldMaxCount = newLevel.Enemies[i].enemyType.MaxCount;
newLevel.Enemies[i].enemyType.MaxCount = configs.CoilHeadEventCoilHeadMax.Value;
}
}
}
public override void OnLoadNewLevelCleanup(ref SelectableLevel newLevel)
{
newLevel.enemySpawnChanceThroughoutDay = oldAnimationCurve;
for (int i = 0; i < newLevel.Enemies.Count; i++)
{
newLevel.Enemies[i].rarity = rarities[i];
if ((Object)(object)newLevel.Enemies[i].enemyType.enemyPrefab.GetComponent<SpringManAI>() != (Object)null)
{
newLevel.Enemies[i].enemyType.MaxCount = oldMaxCount;
}
}
}
public override bool IsValid(ref SelectableLevel newLevel)
{
foreach (SpawnableEnemyWithRarity enemy in newLevel.Enemies)
{
if ((Object)(object)enemy.enemyType.enemyPrefab.GetComponent<SpringManAI>() != (Object)null)
{
return true;
}
}
return false;
}
}
internal class DogEventCreator : BrutalEventCreator
{
public override BrutalEvent Create()
{
return new DogEvent();
}
}
internal class DogEvent : BrutalEvent
{
private AnimationCurve oldOutsideSpawnChance;
private List<int> rarities = new List<int>();
public override string GetEventName()
{
return "Who let the dogs out";
}
public override void OnLoadNewLevel(ref SelectableLevel newLevel, ConfigSettings configs)
{
//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_0037: 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_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Expected O, but got Unknown
oldOutsideSpawnChance = newLevel.outsideEnemySpawnChanceThroughDay;
newLevel.outsideEnemySpawnChanceThroughDay = new AnimationCurve((Keyframe[])(object)new Keyframe[3]
{
new Keyframe(0f, 3f),
new Keyframe(20f, 3f),
new Keyframe(21f, 3f)
});
for (int i = 0; i < newLevel.OutsideEnemies.Count; i++)
{
rarities.Add(newLevel.OutsideEnemies[i].rarity);
newLevel.OutsideEnemies[i].rarity = 0;
if ((Object)(object)newLevel.OutsideEnemies[i].enemyType.enemyPrefab.GetComponent<MouthDogAI>() != (Object)null)
{
newLevel.OutsideEnemies[i].rarity = 999;
}
}
}
public override void OnLoadNewLevelCleanup(ref SelectableLevel newLevel)
{
newLevel.outsideEnemySpawnChanceThroughDay = oldOutsideSpawnChance;
for (int i = 0; i < newLevel.OutsideEnemies.Count; i++)
{
newLevel.OutsideEnemies[i].rarity = rarities[i];
}
}
}
internal class EventCreator
{
private List<BrutalEventCreator> customEventOrder = new List<BrutalEventCreator>
{
new JesterEventCreator(),
new CoilHeadEventCreator(),
new JesterEventCreator()
};
private int customCurrentIndex;
private int currentIndex;
public BrutalEvent GetRandomEvent()
{
List<BrutalEventCreator> events = BrutalEventList.GetEvents();
Random random = new Random();
return events[random.Next(events.Count)].Create();
}
public BrutalEvent GetRandomEventWithWeight(int eventProbability)
{
if (new Random().Next(0, 10) < eventProbability)
{
return new NoneEvent();
}
return GetRandomEvent();
}
public BrutalEvent GetEventInOrder()
{
List<BrutalEventCreator> events = BrutalEventList.GetEvents();
BrutalEventCreator brutalEventCreator = events[currentIndex];
currentIndex++;
if (currentIndex >= events.Count)
{
currentIndex = 0;
}
return brutalEventCreator.Create();
}
public BrutalEvent GetEventInCustomOrder()
{
BrutalEventCreator brutalEventCreator = customEventOrder[customCurrentIndex];
customCurrentIndex++;
if (customCurrentIndex >= customEventOrder.Count)
{
customCurrentIndex = 0;
}
return brutalEventCreator.Create();
}
}
public static class BrutalEventList
{
private static List<BrutalEventCreator> events = new List<BrutalEventCreator>();
public static List<BrutalEventCreator> GetEvents()
{
return events;
}
public static void AddEvent(BrutalEventCreator brutalEvent)
{
events.Add(brutalEvent);
}
internal static void AddBaseEvents(ConfigSettings configs)
{
if (configs.EnableFlowermanCoilEvent.Value)
{
AddEvent(new BrackenCoilEventCreator());
}
if (configs.EnableDogEvent.Value)
{
AddEvent(new DogEventCreator());
}
if (configs.EnableHoardingBugsEvent.Value)
{
AddEvent(new HoardingEventCreator());
}
if (configs.EnableJetpackEvent.Value)
{
AddEvent(new JetpackDeliveryCreator());
}
if (configs.EnableLandmineEvent.Value)
{
AddEvent(new LandmineEventCreator());
}
if (configs.EnableLassoEvent.Value)
{
AddEvent(new LassoEventCreator());
}
if (configs.EnableLittleGirlEvent.Value)
{
AddEvent(new LittleGirlEventCreator());
}
if (configs.EnableMonkeyEvent.Value)
{
AddEvent(new MonkeyEventCreator());
}
if (configs.EnableRandomDeliveryEvent.Value)
{
AddEvent(new RandomDeliveryEventCreator());
}
if (configs.EnableSnareFleaEvent.Value)
{
AddEvent(new SnareFleaEventCreator());
}
if (configs.EnableSpiderEvent.Value)
{
AddEvent(new SpiderEventCreator());
}
if (configs.EnableThumperEvent.Value)
{
AddEvent(new ThumperEventCreator());
}
if (configs.EnableThunderEvent.Value)
{
AddEvent(new ThunderEventCreator());
}
if (configs.EnableTurretEvent.Value)
{
AddEvent(new TurretEventCreator());
}
if (configs.EnableWalkiDeliveryEvent.Value)
{
AddEvent(new WalkiDeliveryEventCreator());
}
if (configs.EnableCoilHeadEvent.Value)
{
AddEvent(new CoilHeadEventCreator());
}
if (configs.EnableJesterEvent.Value)
{
AddEvent(new JesterEventCreator());
}
}
}
internal class GoldMineEvent : BrutalEvent
{
public override string GetEventName()
{
return "Gold Mine";
}
public override void OnLoadNewLevel(ref SelectableLevel newLevel, ConfigSettings configs)
{
foreach (SpawnableItemWithRarity item in newLevel.spawnableScrap)
{
_ = item;
}
}
}
internal class HoardingEventCreator : BrutalEventCreator
{
public override BrutalEvent Create()
{
return new HoardingEvent();
}
}
internal class HoardingEvent : BrutalEvent
{
private AnimationCurve oldAnimationCurve;
private List<int> rarities = new List<int>();
private int oldMaxCount;
public override string GetEventName()
{
return "Kleptomania";
}
public override void OnLoadNewLevel(ref SelectableLevel newLevel, ConfigSettings configs)
{
//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_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Expected O, but got Unknown
oldAnimationCurve = newLevel.enemySpawnChanceThroughoutDay;
newLevel.enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[1]
{
new Keyframe(0f, 500f)
});
for (int i = 0; i < newLevel.Enemies.Count; i++)
{
rarities.Add(newLevel.Enemies[i].rarity);
newLevel.Enemies[i].rarity = 0;
if ((Object)(object)newLevel.Enemies[i].enemyType.enemyPrefab.GetComponent<HoarderBugAI>() != (Object)null)
{
newLevel.Enemies[i].rarity = 999;
oldMaxCount = newLevel.Enemies[i].enemyType.MaxCount;
newLevel.Enemies[i].enemyType.MaxCount = configs.HoardingBugsEventHoardingMax.Value;
}
}
}
public override void OnLoadNewLevelCleanup(ref SelectableLevel newLevel)
{
newLevel.enemySpawnChanceThroughoutDay = oldAnimationCurve;
for (int i = 0; i < newLevel.Enemies.Count; i++)
{
newLevel.Enemies[i].rarity = rarities[i];
if ((Object)(object)newLevel.Enemies[i].enemyType.enemyPrefab.GetComponent<HoarderBugAI>() != (Object)null)
{
newLevel.Enemies[i].enemyType.MaxCount = oldMaxCount;
}
}
}
public override bool IsValid(ref SelectableLevel newLevel)
{
foreach (SpawnableEnemyWithRarity enemy in newLevel.Enemies)
{
if ((Object)(object)enemy.enemyType.enemyPrefab.GetComponent<HoarderBugAI>() != (Object)null)
{
return true;
}
}
return false;
}
}
internal class JesterEventCreator : BrutalEventCreator
{
public override BrutalEvent Create()
{
return new JesterEvent();
}
}
internal class JesterEvent : BrutalEvent
{
private AnimationCurve oldAnimationCurve;
private List<int> rarities = new List<int>();
private int oldMaxCount;
public override string GetEventName()
{
return "Jack-In-The-Box";
}
public override void OnLoadNewLevel(ref SelectableLevel newLevel, ConfigSettings configs)
{
//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_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Expected O, but got Unknown
oldAnimationCurve = newLevel.enemySpawnChanceThroughoutDay;
newLevel.enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[1]
{
new Keyframe(0f, 500f)
});
for (int i = 0; i < newLevel.Enemies.Count; i++)
{
rarities.Add(newLevel.Enemies[i].rarity);
newLevel.Enemies[i].rarity = 0;
if ((Object)(object)newLevel.Enemies[i].enemyType.enemyPrefab.GetComponent<JesterAI>() != (Object)null)
{
newLevel.Enemies[i].rarity = 999;
oldMaxCount = newLevel.Enemies[i].enemyType.MaxCount;
newLevel.Enemies[i].enemyType.MaxCount = configs.JesterEventJesterMax.Value;
}
}
}
public override void OnLoadNewLevelCleanup(ref SelectableLevel newLevel)
{
newLevel.enemySpawnChanceThroughoutDay = oldAnimationCurve;
for (int i = 0; i < newLevel.Enemies.Count; i++)
{
newLevel.Enemies[i].rarity = rarities[i];
if ((Object)(object)newLevel.Enemies[i].enemyType.enemyPrefab.GetComponent<JesterAI>() != (Object)null)
{
newLevel.Enemies[i].enemyType.MaxCount = oldMaxCount;
}
}
}
public override bool IsValid(ref SelectableLevel newLevel)
{
foreach (SpawnableEnemyWithRarity enemy in newLevel.Enemies)
{
if ((Object)(object)enemy.enemyType.enemyPrefab.GetComponent<JesterAI>() != (Object)null)
{
return true;
}
}
return false;
}
}
internal class JetpackDeliveryCreator : BrutalEventCreator
{
public override BrutalEvent Create()
{
return new JetpackDelivery();
}
}
internal class JetpackDelivery : BrutalEvent
{
public override string GetEventName()
{
return "Jetpack delivery";
}
public override void OnLoadNewLevel(ref SelectableLevel newLevel, ConfigSettings configs)
{
int value = configs.JetpackEventJetpackCount.Value;
int item = 9;
Terminal val = Object.FindObjectOfType<Terminal>();
for (int i = 0; i < value; i++)
{
val.orderedItemsFromTerminal.Add(item);
}
}
}
internal class LandmineEventCreator : BrutalEventCreator
{
public override BrutalEvent Create()
{
return new LandmineEvent();
}
}
internal class LandmineEvent : BrutalEvent
{
private AnimationCurve oldCurve;
public override string GetEventName()
{
return "Landmine hell";
}
public override void OnLoadNewLevel(ref SelectableLevel newLevel, ConfigSettings configs)
{
//IL_0042: 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_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Expected O, but got Unknown
SpawnableMapObject[] spawnableMapObjects = newLevel.spawnableMapObjects;
foreach (SpawnableMapObject val in spawnableMapObjects)
{
if ((Object)(object)val.prefabToSpawn.GetComponentInChildren<Landmine>() != (Object)null)
{
oldCurve = val.numberToSpawn;
val.numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[2]
{
new Keyframe(0f, 120f),
new Keyframe(1f, 68f)
});
}
}
}
public override void OnLoadNewLevelCleanup(ref SelectableLevel newLevel)
{
SpawnableMapObject[] spawnableMapObjects = newLevel.spawnableMapObjects;
foreach (SpawnableMapObject val in spawnableMapObjects)
{
if ((Object)(object)val.prefabToSpawn.GetComponentInChildren<Turret>() != (Object)null)
{
val.numberToSpawn = oldCurve;
}
}
}
}
internal class LassoEventCreator : BrutalEventCreator
{
public override BrutalEvent Create()
{
return new LassoEvent();
}
}
internal class LassoEvent : BrutalEvent
{
public override string GetEventName()
{
return "Lasso man is real";
}
public override void OnLoadNewLevel(ref SelectableLevel newLevel, ConfigSettings configs)
{
//IL_0121: Unknown result type (might be due to invalid IL or missing references)
//IL_0126: Unknown result type (might be due to invalid IL or missing references)
//IL_012b: Unknown result type (might be due to invalid IL or missing references)
//IL_0135: Expected O, but got Unknown
bool flag = false;
bool flag2 = false;
foreach (SpawnableEnemyWithRarity enemy in newLevel.Enemies)
{
if ((Object)(object)enemy.enemyType.enemyPrefab.GetComponent<LassoManAI>() != (Object)null)
{
flag = true;
}
}
if (!flag)
{
SelectableLevel[] levels = StartOfRound.Instance.levels;
for (int i = 0; i < levels.Length; i++)
{
foreach (SpawnableEnemyWithRarity enemy2 in levels[i].Enemies)
{
if ((Object)(object)enemy2.enemyType.enemyPrefab.GetComponent<LassoManAI>() != (Object)null && !flag2)
{
flag2 = true;
newLevel.Enemies.Add(enemy2);
}
}
}
}
foreach (SpawnableEnemyWithRarity enemy3 in newLevel.Enemies)
{
if ((Object)(object)enemy3.enemyType.enemyPrefab.GetComponent<LassoManAI>() != (Object)null)
{
enemy3.rarity = 999;
enemy3.enemyType.probabilityCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[1]
{
new Keyframe(0f, 10000f)
});
}
}
}
public override void OnLoadNewLevelCleanup(ref SelectableLevel newLevel)
{
for (int num = newLevel.Enemies.Count - 1; num >= 0; num--)
{
if ((Object)(object)newLevel.Enemies[num].enemyType.enemyPrefab.GetComponent<LassoManAI>() != (Object)null)
{
newLevel.Enemies.RemoveAt(num);
}
}
}
}
internal class LittleGirlEventCreator : BrutalEventCreator
{
public override BrutalEvent Create()
{
return new LittleGirlEvent();
}
}
internal class LittleGirlEvent : BrutalEvent
{
private int oldRarity;
public override string GetEventName()
{
return "Sweet Little Girl";
}
public override void OnLoadNewLevel(ref SelectableLevel newLevel, ConfigSettings configs)
{
for (int i = 0; i < newLevel.Enemies.Count; i++)
{
if ((Object)(object)newLevel.Enemies[i].enemyType.enemyPrefab.GetComponent<DressGirlAI>() != (Object)null)
{
oldRarity = newLevel.Enemies[i].rarity;
newLevel.Enemies[i].rarity = 999;
}
}
}
public override void OnLoadNewLevelCleanup(ref SelectableLevel newLevel)
{
for (int i = 0; i < newLevel.Enemies.Count; i++)
{
if ((Object)(object)newLevel.Enemies[i].enemyType.enemyPrefab.GetComponent<DressGirlAI>() != (Object)null)
{
oldRarity = newLevel.Enemies[i].rarity;
}
}
}
}
internal class MonkeyEventCreator : BrutalEventCreator
{
public override BrutalEvent Create()
{
return new MonkeyEvent();
}
}
internal class MonkeyEvent : BrutalEvent
{
private AnimationCurve oldOutsideSpawnChance;
private List<int> rarities = new List<int>();
public override string GetEventName()
{
return "Monke";
}
public override void OnLoadNewLevel(ref SelectableLevel newLevel, ConfigSettings configs)
{
//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_0037: 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_004d: Unknown result type (might be due to invalid IL or missing references)
//IL_0052: Unknown result type (might be due to invalid IL or missing references)
//IL_0057: Unknown result type (might be due to invalid IL or missing references)
//IL_0061: Expected O, but got Unknown
oldOutsideSpawnChance = newLevel.outsideEnemySpawnChanceThroughDay;
newLevel.outsideEnemySpawnChanceThroughDay = new AnimationCurve((Keyframe[])(object)new Keyframe[3]
{
new Keyframe(0f, 3f),
new Keyframe(20f, 3f),
new Keyframe(21f, 3f)
});
for (int i = 0; i < newLevel.OutsideEnemies.Count; i++)
{
rarities.Add(newLevel.OutsideEnemies[i].rarity);
newLevel.OutsideEnemies[i].rarity = 0;
if ((Object)(object)newLevel.OutsideEnemies[i].enemyType.enemyPrefab.GetComponent<BaboonBirdAI>() != (Object)null)
{
newLevel.OutsideEnemies[i].rarity = 999;
}
}
}
public override void OnLoadNewLevelCleanup(ref SelectableLevel newLevel)
{
newLevel.outsideEnemySpawnChanceThroughDay = oldOutsideSpawnChance;
for (int i = 0; i < newLevel.OutsideEnemies.Count; i++)
{
newLevel.OutsideEnemies[i].rarity = rarities[i];
}
}
public override bool IsValid(ref SelectableLevel newLevel)
{
foreach (SpawnableEnemyWithRarity outsideEnemy in newLevel.OutsideEnemies)
{
if ((Object)(object)outsideEnemy.enemyType.enemyPrefab.GetComponent<BaboonBirdAI>() != (Object)null)
{
return true;
}
}
return false;
}
}
public class NoneEvent : BrutalEvent
{
public override string GetEventName()
{
return "None";
}
public override void OnLoadNewLevel(ref SelectableLevel newLevel, ConfigSettings config)
{
}
}
internal class RandomDeliveryEventCreator : BrutalEventCreator
{
public override BrutalEvent Create()
{
return new RandomDeliveryEvent();
}
}
internal class RandomDeliveryEvent : BrutalEvent
{
public override string GetEventName()
{
return "Lost delivery";
}
public override void OnLoadNewLevel(ref SelectableLevel newLevel, ConfigSettings configs)
{
int num = Random.Range(2, 9);
for (int i = 0; i < num; i++)
{
int item = Random.Range(0, 6);
Object.FindObjectOfType<Terminal>().orderedItemsFromTerminal.Add(item);
}
}
}
internal class SnareFleaEventCreator : BrutalEventCreator
{
public override BrutalEvent Create()
{
return new SnareFleaEvent();
}
}
internal class SnareFleaEvent : BrutalEvent
{
private AnimationCurve oldAnimationCurve;
private List<int> rarities = new List<int>();
private int oldMaxCount;
public override string GetEventName()
{
return "Ready to suffocate ?";
}
public override void OnLoadNewLevel(ref SelectableLevel newLevel, ConfigSettings configs)
{
//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_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Expected O, but got Unknown
oldAnimationCurve = newLevel.enemySpawnChanceThroughoutDay;
newLevel.enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[1]
{
new Keyframe(0f, 500f)
});
for (int i = 0; i < newLevel.Enemies.Count; i++)
{
rarities.Add(newLevel.Enemies[i].rarity);
newLevel.Enemies[i].rarity = 0;
if ((Object)(object)newLevel.Enemies[i].enemyType.enemyPrefab.GetComponent<CentipedeAI>() != (Object)null)
{
newLevel.Enemies[i].rarity = 999;
oldMaxCount = newLevel.Enemies[i].enemyType.MaxCount;
newLevel.Enemies[i].enemyType.MaxCount = configs.SnareFleaEventSnareFleaMax.Value;
}
}
}
public override void OnLoadNewLevelCleanup(ref SelectableLevel newLevel)
{
newLevel.enemySpawnChanceThroughoutDay = oldAnimationCurve;
for (int i = 0; i < newLevel.Enemies.Count; i++)
{
newLevel.Enemies[i].rarity = rarities[i];
if ((Object)(object)newLevel.Enemies[i].enemyType.enemyPrefab.GetComponent<CentipedeAI>() != (Object)null)
{
newLevel.Enemies[i].enemyType.MaxCount = oldMaxCount;
}
}
}
public override bool IsValid(ref SelectableLevel newLevel)
{
foreach (SpawnableEnemyWithRarity enemy in newLevel.Enemies)
{
if ((Object)(object)enemy.enemyType.enemyPrefab.GetComponent<CentipedeAI>() != (Object)null)
{
return true;
}
}
return false;
}
}
internal class SpiderEventCreator : BrutalEventCreator
{
public override BrutalEvent Create()
{
return new SpiderEvent();
}
}
internal class SpiderEvent : BrutalEvent
{
private AnimationCurve oldAnimationCurve;
private List<int> rarities = new List<int>();
private int oldMaxCount;
public override string GetEventName()
{
return "Arachnophobia";
}
public override void OnLoadNewLevel(ref SelectableLevel newLevel, ConfigSettings configs)
{
//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_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Expected O, but got Unknown
oldAnimationCurve = newLevel.enemySpawnChanceThroughoutDay;
newLevel.enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[1]
{
new Keyframe(0f, 500f)
});
for (int i = 0; i < newLevel.Enemies.Count; i++)
{
rarities.Add(newLevel.Enemies[i].rarity);
newLevel.Enemies[i].rarity = 0;
if ((Object)(object)newLevel.Enemies[i].enemyType.enemyPrefab.GetComponent<SandSpiderAI>() != (Object)null)
{
newLevel.Enemies[i].rarity = 999;
oldMaxCount = newLevel.Enemies[i].enemyType.MaxCount;
newLevel.Enemies[i].enemyType.MaxCount = configs.SpiderEventSpiderMax.Value;
}
}
}
public override void OnLoadNewLevelCleanup(ref SelectableLevel newLevel)
{
newLevel.enemySpawnChanceThroughoutDay = oldAnimationCurve;
for (int i = 0; i < newLevel.Enemies.Count; i++)
{
newLevel.Enemies[i].rarity = rarities[i];
if ((Object)(object)newLevel.Enemies[i].enemyType.enemyPrefab.GetComponent<SandSpiderAI>() != (Object)null)
{
newLevel.Enemies[i].enemyType.MaxCount = oldMaxCount;
}
}
}
public override bool IsValid(ref SelectableLevel newLevel)
{
foreach (SpawnableEnemyWithRarity enemy in newLevel.Enemies)
{
if ((Object)(object)enemy.enemyType.enemyPrefab.GetComponent<SandSpiderAI>() != (Object)null)
{
return true;
}
}
return false;
}
}
internal class ThumperEventCreator : BrutalEventCreator
{
public override BrutalEvent Create()
{
return new ThumperEvent();
}
}
internal class ThumperEvent : BrutalEvent
{
private AnimationCurve oldAnimationCurve;
private List<int> rarities = new List<int>();
private int oldMaxCount;
public override string GetEventName()
{
return "Thump Thump Thump";
}
public override void OnLoadNewLevel(ref SelectableLevel newLevel, ConfigSettings configs)
{
//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_002b: Unknown result type (might be due to invalid IL or missing references)
//IL_0035: Expected O, but got Unknown
oldAnimationCurve = newLevel.enemySpawnChanceThroughoutDay;
newLevel.enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[1]
{
new Keyframe(0f, 500f)
});
for (int i = 0; i < newLevel.Enemies.Count; i++)
{
rarities.Add(newLevel.Enemies[i].rarity);
newLevel.Enemies[i].rarity = 0;
if ((Object)(object)newLevel.Enemies[i].enemyType.enemyPrefab.GetComponent<CrawlerAI>() != (Object)null)
{
newLevel.Enemies[i].rarity = 999;
oldMaxCount = newLevel.Enemies[i].enemyType.MaxCount;
newLevel.Enemies[i].enemyType.MaxCount = configs.ThumperEventThumperMax.Value;
}
}
}
public override void OnLoadNewLevelCleanup(ref SelectableLevel newLevel)
{
newLevel.enemySpawnChanceThroughoutDay = oldAnimationCurve;
for (int i = 0; i < newLevel.Enemies.Count; i++)
{
newLevel.Enemies[i].rarity = rarities[i];
if ((Object)(object)newLevel.Enemies[i].enemyType.enemyPrefab.GetComponent<CrawlerAI>() != (Object)null)
{
newLevel.Enemies[i].enemyType.MaxCount = oldMaxCount;
}
}
}
public override bool IsValid(ref SelectableLevel newLevel)
{
foreach (SpawnableEnemyWithRarity enemy in newLevel.Enemies)
{
if ((Object)(object)enemy.enemyType.enemyPrefab.GetComponent<CrawlerAI>() != (Object)null)
{
return true;
}
}
return false;
}
}
internal class ThunderEventCreator : BrutalEventCreator
{
public override BrutalEvent Create()
{
return new ThunderEvent();
}
}
internal class ThunderEvent : BrutalEvent
{
private LevelWeatherType oldType;
private bool oldOverrideWeather;
public override string GetEventName()
{
return "Thunderstruck";
}
public override void OnLoadNewLevel(ref SelectableLevel newLevel, ConfigSettings configs)
{
//IL_0003: 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)
//IL_001d: Unknown result type (might be due to invalid IL or missing references)
oldType = newLevel.overrideWeatherType;
oldOverrideWeather = newLevel.overrideWeather;
newLevel.currentWeather = (LevelWeatherType)2;
newLevel.overrideWeather = false;
}
public override void OnLoadNewLevelCleanup(ref SelectableLevel newLevel)
{
//IL_0003: 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)
newLevel.currentWeather = oldType;
newLevel.overrideWeather = oldOverrideWeather;
}
}
internal class TurretEventCreator : BrutalEventCreator
{
public override BrutalEvent Create()
{
return new TurretEvent();
}
}
internal class TurretEvent : BrutalEvent
{
private AnimationCurve oldCurve;
public override string GetEventName()
{
return "Turret hell";
}
public override void OnLoadNewLevel(ref SelectableLevel newLevel, ConfigSettings configs)
{
//IL_0042: 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_0058: Unknown result type (might be due to invalid IL or missing references)
//IL_005d: Unknown result type (might be due to invalid IL or missing references)
//IL_0062: Unknown result type (might be due to invalid IL or missing references)
//IL_006c: Expected O, but got Unknown
SpawnableMapObject[] spawnableMapObjects = newLevel.spawnableMapObjects;
foreach (SpawnableMapObject val in spawnableMapObjects)
{
if ((Object)(object)val.prefabToSpawn.GetComponentInChildren<Turret>() != (Object)null)
{
oldCurve = val.numberToSpawn;
val.numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[2]
{
new Keyframe(0f, 100f),
new Keyframe(1f, 13f)
});
}
}
}
public override void OnLoadNewLevelCleanup(ref SelectableLevel newLevel)
{
SpawnableMapObject[] spawnableMapObjects = newLevel.spawnableMapObjects;
foreach (SpawnableMapObject val in spawnableMapObjects)
{
if ((Object)(object)val.prefabToSpawn.GetComponentInChildren<Turret>() != (Object)null)
{
val.numberToSpawn = oldCurve;
}
}
}
}
internal class WalkiDeliveryEventCreator : BrutalEventCreator
{
public override BrutalEvent Create()
{
return new WalkiDeliveryEvent();
}
}
internal class WalkiDeliveryEvent : BrutalEvent
{
public override string GetEventName()
{
return "Walkie delivery";
}
public override void OnLoadNewLevel(ref SelectableLevel newLevel, ConfigSettings configs)
{
Terminal val = Object.FindObjectOfType<Terminal>();
int num = val.orderedItemsFromTerminal.Count;
if (num < 5)
{
num = 5;
}
for (int i = 0; i < num; i++)
{
val.orderedItemsFromTerminal.Add(0);
}
}
}
}