using System;
using System.Collections.Generic;
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.Logging;
using BrutalCompany.Component;
using GameNetcodeStuff;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using Project1.Data;
using Unity.Netcode;
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("BrutalCompany")]
[assembly: AssemblyConfiguration("Release")]
[assembly: AssemblyDescription("My first plugin")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: AssemblyInformationalVersion("1.0.0")]
[assembly: AssemblyProduct("BrutalCompany")]
[assembly: AssemblyTitle("BrutalCompany")]
[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 Project1
{
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "BrutalCompany";
public const string PLUGIN_NAME = "BrutalCompany";
public const string PLUGIN_VERSION = "1.0.0";
}
}
namespace Project1.Data
{
internal enum EventEnum
{
None,
Turret,
Landmine,
Hoarding,
Lasso,
Unfair,
OopsAllSnareFlea,
BrackenAndCoil,
Chaos,
GoToRend,
All,
Delivery,
ReplaceItems,
Schizophrenia,
SupriseLandmines,
ResetHeat,
SpawnTurret
}
}
namespace BrutalCompany
{
[BepInPlugin("BrutalCompany", "BrutalCompany", "1.0.0")]
public class Plugin : BaseUnityPlugin
{
public static bool loaded;
private Harmony _harmony = new Harmony("BrutalCompany");
public static List<SelectableLevel> levelsModified = new List<SelectableLevel>();
public static Dictionary<SelectableLevel, float> levelHeatVal;
public static Dictionary<SelectableLevel, List<SpawnableEnemyWithRarity>> levelEnemySpawns;
public static Dictionary<SpawnableEnemyWithRarity, int> enemyRaritys;
public static Dictionary<SpawnableEnemyWithRarity, AnimationCurve> enemyPropCurves;
public static ManualLogSource mls;
private void Awake()
{
mls = Logger.CreateLogSource("BrutalCompany");
mls.LogInfo((object)"Loaded Brutal Company and applying patches.");
_harmony.PatchAll(typeof(Plugin));
mls = ((BaseUnityPlugin)this).Logger;
levelHeatVal = new Dictionary<SelectableLevel, float>();
enemyRaritys = new Dictionary<SpawnableEnemyWithRarity, int>();
levelEnemySpawns = new Dictionary<SelectableLevel, List<SpawnableEnemyWithRarity>>();
enemyPropCurves = new Dictionary<SpawnableEnemyWithRarity, AnimationCurve>();
}
public void OnDestroy()
{
//IL_000c: Unknown result type (might be due to invalid IL or missing references)
//IL_0011: Unknown result type (might be due to invalid IL or missing references)
//IL_0017: Expected O, but got Unknown
if (!loaded)
{
GameObject val = new GameObject("QuotaChanger");
Object.DontDestroyOnLoad((Object)val);
val.AddComponent<QuotaAjuster>();
loaded = true;
}
}
[HarmonyPatch(typeof(RoundManager), "LoadNewLevel")]
[HarmonyPrefix]
private static bool ModifyLevel(ref SelectableLevel newLevel)
{
//IL_01ff: Unknown result type (might be due to invalid IL or missing references)
//IL_0206: Expected O, but got Unknown
//IL_052c: Unknown result type (might be due to invalid IL or missing references)
//IL_0531: Unknown result type (might be due to invalid IL or missing references)
//IL_0536: Unknown result type (might be due to invalid IL or missing references)
//IL_0540: Expected O, but got Unknown
//IL_059a: Unknown result type (might be due to invalid IL or missing references)
//IL_059f: Unknown result type (might be due to invalid IL or missing references)
//IL_05a4: Unknown result type (might be due to invalid IL or missing references)
//IL_05ae: Expected O, but got Unknown
//IL_0a4a: Unknown result type (might be due to invalid IL or missing references)
//IL_0a4f: Unknown result type (might be due to invalid IL or missing references)
//IL_0a60: Unknown result type (might be due to invalid IL or missing references)
//IL_0a65: Unknown result type (might be due to invalid IL or missing references)
//IL_0a6a: Unknown result type (might be due to invalid IL or missing references)
//IL_0a74: Expected O, but got Unknown
//IL_0a07: Unknown result type (might be due to invalid IL or missing references)
//IL_0a0c: Unknown result type (might be due to invalid IL or missing references)
//IL_0a1d: Unknown result type (might be due to invalid IL or missing references)
//IL_0a22: Unknown result type (might be due to invalid IL or missing references)
//IL_0a27: Unknown result type (might be due to invalid IL or missing references)
//IL_0a31: Expected O, but got Unknown
//IL_0afc: Unknown result type (might be due to invalid IL or missing references)
//IL_0b01: Unknown result type (might be due to invalid IL or missing references)
//IL_0b12: Unknown result type (might be due to invalid IL or missing references)
//IL_0b17: Unknown result type (might be due to invalid IL or missing references)
//IL_0b1c: Unknown result type (might be due to invalid IL or missing references)
//IL_0b26: Expected O, but got Unknown
//IL_0abc: Unknown result type (might be due to invalid IL or missing references)
//IL_0ac1: Unknown result type (might be due to invalid IL or missing references)
//IL_0ad2: Unknown result type (might be due to invalid IL or missing references)
//IL_0ad7: Unknown result type (might be due to invalid IL or missing references)
//IL_0adc: Unknown result type (might be due to invalid IL or missing references)
//IL_0ae6: Expected O, but got Unknown
//IL_0ced: Unknown result type (might be due to invalid IL or missing references)
//IL_0cf2: Unknown result type (might be due to invalid IL or missing references)
//IL_0d05: Unknown result type (might be due to invalid IL or missing references)
//IL_0d0a: Unknown result type (might be due to invalid IL or missing references)
//IL_0d0f: Unknown result type (might be due to invalid IL or missing references)
//IL_0d19: Expected O, but got Unknown
//IL_0d2e: Unknown result type (might be due to invalid IL or missing references)
//IL_0d33: Unknown result type (might be due to invalid IL or missing references)
//IL_0d46: Unknown result type (might be due to invalid IL or missing references)
//IL_0d4b: Unknown result type (might be due to invalid IL or missing references)
//IL_0d5e: Unknown result type (might be due to invalid IL or missing references)
//IL_0d63: Unknown result type (might be due to invalid IL or missing references)
//IL_0d68: Unknown result type (might be due to invalid IL or missing references)
//IL_0d72: Expected O, but got Unknown
//IL_0c78: Unknown result type (might be due to invalid IL or missing references)
//IL_0c7d: Unknown result type (might be due to invalid IL or missing references)
//IL_0c8e: Unknown result type (might be due to invalid IL or missing references)
//IL_0c93: Unknown result type (might be due to invalid IL or missing references)
//IL_0c98: Unknown result type (might be due to invalid IL or missing references)
//IL_0ca2: Expected O, but got Unknown
//IL_0d93: Unknown result type (might be due to invalid IL or missing references)
//IL_0d98: Unknown result type (might be due to invalid IL or missing references)
//IL_0dab: Unknown result type (might be due to invalid IL or missing references)
//IL_0db0: Unknown result type (might be due to invalid IL or missing references)
//IL_0dc3: Unknown result type (might be due to invalid IL or missing references)
//IL_0dc8: Unknown result type (might be due to invalid IL or missing references)
//IL_0dcd: Unknown result type (might be due to invalid IL or missing references)
//IL_0dd7: Expected O, but got Unknown
//IL_0df8: Unknown result type (might be due to invalid IL or missing references)
//IL_0dfd: Unknown result type (might be due to invalid IL or missing references)
//IL_0e02: Unknown result type (might be due to invalid IL or missing references)
//IL_0e0c: Expected O, but got Unknown
//IL_0e2d: Unknown result type (might be due to invalid IL or missing references)
//IL_0e32: Unknown result type (might be due to invalid IL or missing references)
//IL_0e37: Unknown result type (might be due to invalid IL or missing references)
//IL_0e41: Expected O, but got Unknown
if (((NetworkBehaviour)RoundManager.Instance).IsHost)
{
QuotaAjuster.CleanupAllSpawns();
EventEnum eventEnum = (EventEnum)Mathf.Clamp(Random.Range(-1, 17), 0, 99);
if (!levelHeatVal.ContainsKey(newLevel))
{
levelHeatVal.Add(newLevel, 0f);
}
if (!levelEnemySpawns.ContainsKey(newLevel))
{
List<SpawnableEnemyWithRarity> list = new List<SpawnableEnemyWithRarity>();
foreach (SpawnableEnemyWithRarity enemy in newLevel.Enemies)
{
list.Add(enemy);
}
levelEnemySpawns.Add(newLevel, list);
}
levelEnemySpawns.TryGetValue(newLevel, out var value);
newLevel.Enemies = value;
foreach (SelectableLevel item3 in levelHeatVal.Keys.ToList())
{
levelHeatVal.TryGetValue(item3, out var value2);
levelHeatVal[item3] = Mathf.Clamp(value2 - 5f, 0f, 100f);
if (eventEnum == EventEnum.ResetHeat || eventEnum == EventEnum.All)
{
levelHeatVal[item3] = 0f;
}
}
levelHeatVal.TryGetValue(newLevel, out var value3);
foreach (SpawnableEnemyWithRarity enemy2 in newLevel.Enemies)
{
if (!enemyRaritys.ContainsKey(enemy2))
{
enemyRaritys.Add(enemy2, enemy2.rarity);
}
int value4 = 0;
enemyRaritys.TryGetValue(enemy2, out value4);
enemy2.rarity = value4;
}
foreach (SpawnableEnemyWithRarity enemy3 in newLevel.Enemies)
{
if (!enemyPropCurves.ContainsKey(enemy3))
{
enemyPropCurves.Add(enemy3, enemy3.enemyType.probabilityCurve);
}
AnimationCurve value5 = new AnimationCurve();
enemyPropCurves.TryGetValue(enemy3, out value5);
enemy3.enemyType.probabilityCurve = value5;
}
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);
HUDManager.Instance.AddTextToChatOnServer("<color=orange>MOON IS AT " + value3 + "% HEAT</color>", -1);
if (value3 > 49f)
{
HUDManager.Instance.AddTextToChatOnServer("<color=red>HEAT LEVEL IS DANGEROUSLY HIGH. <color=white>\nVISIT OTHER MOONS TO LOWER HEAT LEVEL.</color>", -1);
}
Random.Range(-5, 3);
Random.Range(-5, 3);
if (newLevel.sceneName == "CompanyBuilding")
{
eventEnum = EventEnum.None;
}
switch (eventEnum)
{
default:
HUDManager.Instance.AddTextToChatOnServer("<color=green>Level event: NONE</color>", -1);
break;
case EventEnum.None:
HUDManager.Instance.AddTextToChatOnServer("<color=green>Level event: NONE</color>", -1);
break;
case EventEnum.Turret:
HUDManager.Instance.AddTextToChatOnServer("<color=red>Level event: TURRET HELL</color>", -1);
break;
case EventEnum.Landmine:
HUDManager.Instance.AddTextToChatOnServer("<color=red>Level event: LANDMINE HELL</color>", -1);
break;
case EventEnum.Hoarding:
HUDManager.Instance.AddTextToChatOnServer("<color=red>Level event: HOARDER TOWN</color>", -1);
foreach (SpawnableEnemyWithRarity enemy4 in newLevel.Enemies)
{
if ((Object)(object)enemy4.enemyType.enemyPrefab.GetComponent<HoarderBugAI>() != (Object)null)
{
enemy4.rarity = 999;
}
}
break;
case EventEnum.Lasso:
HUDManager.Instance.AddTextToChatOnServer("<color=red>Level event: LASSO MAN IS REAL</color>", -1);
AddLassomanToLevel(newLevel);
break;
case EventEnum.Unfair:
HUDManager.Instance.AddTextToChatOnServer("<color=red>Level event: UNFAIR COMPANY</color>", -1);
break;
case EventEnum.OopsAllSnareFlea:
HUDManager.Instance.AddTextToChatOnServer("<color=red>Level event: OOPS, ALL SNARE FLEAS!</color>", -1);
foreach (SpawnableEnemyWithRarity enemy5 in newLevel.Enemies)
{
enemy5.rarity = 0;
if ((Object)(object)enemy5.enemyType.enemyPrefab.GetComponent<CentipedeAI>() != (Object)null)
{
enemy5.rarity = 999;
}
}
break;
case EventEnum.BrackenAndCoil:
HUDManager.Instance.AddTextToChatOnServer("<color=red>Level event: THE WORST COMBO OF ALL TIME</color>", -1);
foreach (SpawnableEnemyWithRarity enemy6 in newLevel.Enemies)
{
enemy6.rarity = 0;
if ((Object)(object)enemy6.enemyType.enemyPrefab.GetComponent<FlowermanAI>() != (Object)null)
{
enemy6.rarity = 999;
}
if ((Object)(object)enemy6.enemyType.enemyPrefab.GetComponent<SpringManAI>() != (Object)null)
{
enemy6.rarity = 999;
}
}
break;
case EventEnum.Chaos:
HUDManager.Instance.AddTextToChatOnServer("<color=red>Level event: CHAOS COMPANY</color>", -1);
foreach (SpawnableEnemyWithRarity enemy7 in newLevel.Enemies)
{
enemy7.enemyType.probabilityCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[1]
{
new Keyframe(0f, 1000f)
});
}
break;
case EventEnum.All:
{
HUDManager.Instance.AddTextToChatOnServer("<color=red>Level event: ALL</color>", -1);
foreach (SpawnableEnemyWithRarity enemy8 in newLevel.Enemies)
{
enemy8.enemyType.probabilityCurve = new AnimationCurve((Keyframe[])(object)new Keyframe[1]
{
new Keyframe(0f, 1000f)
});
}
foreach (SpawnableEnemyWithRarity enemy9 in newLevel.Enemies)
{
enemy9.rarity = 0;
if ((Object)(object)enemy9.enemyType.enemyPrefab.GetComponent<FlowermanAI>() != (Object)null)
{
enemy9.rarity = 999;
}
if ((Object)(object)enemy9.enemyType.enemyPrefab.GetComponent<SpringManAI>() != (Object)null)
{
enemy9.rarity = 999;
}
}
foreach (SpawnableEnemyWithRarity enemy10 in newLevel.Enemies)
{
if ((Object)(object)enemy10.enemyType.enemyPrefab.GetComponent<CentipedeAI>() != (Object)null)
{
enemy10.rarity = 999;
}
}
AddLassomanToLevel(newLevel);
foreach (SpawnableEnemyWithRarity enemy11 in newLevel.Enemies)
{
if ((Object)(object)enemy11.enemyType.enemyPrefab.GetComponent<LassoManAI>() != (Object)null)
{
enemy11.rarity = 999;
}
}
foreach (SpawnableEnemyWithRarity enemy12 in newLevel.Enemies)
{
if ((Object)(object)enemy12.enemyType.enemyPrefab.GetComponent<HoarderBugAI>() != (Object)null)
{
enemy12.rarity = 999;
}
}
foreach (SpawnableEnemyWithRarity enemy13 in newLevel.Enemies)
{
if ((Object)(object)enemy13.enemyType.enemyPrefab.GetComponent<DressGirlAI>() != (Object)null)
{
enemy13.rarity = 9999;
}
}
int num3 = Random.Range(2, 9);
for (int k = 0; k < num3; k++)
{
int item2 = Random.Range(0, 3);
Object.FindObjectOfType<Terminal>().orderedItemsFromTerminal.Add(item2);
}
Terminal val2 = Object.FindObjectOfType<Terminal>();
int count = val2.orderedItemsFromTerminal.Count;
val2.orderedItemsFromTerminal.Clear();
for (int l = 0; l < count; l++)
{
val2.orderedItemsFromTerminal.Add(0);
}
QuotaAjuster.slSpawnTimer = -10f;
QuotaAjuster.surpriseLandmines += 120;
break;
}
case EventEnum.Delivery:
{
HUDManager.Instance.AddTextToChatOnServer("<color=green>Level event: DELIVERY!</color>", -1);
int num2 = Random.Range(2, 9);
for (int j = 0; j < num2; j++)
{
int item = Random.Range(0, 6);
Object.FindObjectOfType<Terminal>().orderedItemsFromTerminal.Add(item);
}
break;
}
case EventEnum.ReplaceItems:
{
HUDManager.Instance.AddTextToChatOnServer("<color=red>Level event: YOU BOUGHT WALKIES, RIGHT?</color>", -1);
Terminal val = Object.FindObjectOfType<Terminal>();
int num = val.orderedItemsFromTerminal.Count;
if (num == 0)
{
num = 1;
}
val.orderedItemsFromTerminal.Clear();
for (int i = 0; i < num; i++)
{
val.orderedItemsFromTerminal.Add(0);
}
break;
}
case EventEnum.Schizophrenia:
HUDManager.Instance.AddTextToChatOnServer("<color=red>Level event: SCHIZOPHRENIA</color>", -1);
foreach (SpawnableEnemyWithRarity enemy14 in newLevel.Enemies)
{
if ((Object)(object)enemy14.enemyType.enemyPrefab.GetComponent<DressGirlAI>() != (Object)null)
{
enemy14.rarity = 9999;
}
}
break;
case EventEnum.SupriseLandmines:
HUDManager.Instance.AddTextToChatOnServer("<color=red>Level event: SPONTANEOUS COMBUSTION</color>", -1);
QuotaAjuster.slSpawnTimer = -10f;
QuotaAjuster.surpriseLandmines += 120;
break;
case EventEnum.ResetHeat:
HUDManager.Instance.AddTextToChatOnServer("<color=green>Level event: RESET ALL HEAT</color>", -1);
break;
case EventEnum.SpawnTurret:
HUDManager.Instance.AddTextToChatOnServer("<color=red>Level event: THE COMPANIES AUTOMATED DEFENSE SYSTEM</color>", -1);
QuotaAjuster.shouldSpawnTurret = true;
break;
}
SelectableLevel val3 = newLevel;
mls.LogWarning((object)"Map Objects");
SpawnableMapObject[] spawnableMapObjects = val3.spawnableMapObjects;
foreach (SpawnableMapObject val4 in spawnableMapObjects)
{
if ((Object)(object)val4.prefabToSpawn.GetComponentInChildren<Turret>() != (Object)null)
{
QuotaAjuster.turret = val4.prefabToSpawn;
if (eventEnum == EventEnum.Turret || eventEnum == EventEnum.All)
{
val4.numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[2]
{
new Keyframe(0f, 200f),
new Keyframe(1f, 25f)
});
}
else
{
val4.numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[2]
{
new Keyframe(0f, 0f),
new Keyframe(1f, 10f)
});
}
}
else if ((Object)(object)val4.prefabToSpawn.GetComponentInChildren<Landmine>() != (Object)null)
{
QuotaAjuster.landmine = val4.prefabToSpawn;
if (eventEnum == EventEnum.Landmine || eventEnum == EventEnum.All)
{
val4.numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[2]
{
new Keyframe(0f, 300f),
new Keyframe(1f, 170f)
});
}
else
{
val4.numberToSpawn = new AnimationCurve((Keyframe[])(object)new Keyframe[2]
{
new Keyframe(0f, 0f),
new Keyframe(1f, 70f)
});
}
}
mls.LogInfo((object)((object)val4.prefabToSpawn).ToString());
}
mls.LogWarning((object)"Enemies");
foreach (SpawnableEnemyWithRarity enemy15 in val3.Enemies)
{
mls.LogInfo((object)(enemy15.enemyType.enemyName + "--rarity = " + enemy15.rarity));
}
mls.LogWarning((object)"Daytime Enemies");
foreach (SpawnableEnemyWithRarity daytimeEnemy in val3.DaytimeEnemies)
{
mls.LogInfo((object)daytimeEnemy.enemyType.enemyName);
}
if (!levelsModified.Contains(newLevel))
{
levelsModified.Add(newLevel);
val3.minScrap = val3.minScrap;
val3.maxScrap += 45;
val3.minTotalScrapValue = val3.minTotalScrapValue;
val3.maxTotalScrapValue += 800;
val3.daytimeEnemySpawnChanceThroughDay = new AnimationCurve((Keyframe[])(object)new Keyframe[2]
{
new Keyframe(0f, 7f),
new Keyframe(0.5f, 7f)
});
val3.maxEnemyPowerCount += 2000;
val3.maxOutsideEnemyPowerCount += 20;
val3.maxDaytimeEnemyPowerCount += 200;
newLevel = val3;
}
val3.enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[2]
{
new Keyframe(0f, 0.1f + value3),
new Keyframe(0.5f, 500f + value3)
});
val3.outsideEnemySpawnChanceThroughDay = new AnimationCurve((Keyframe[])(object)new Keyframe[3]
{
new Keyframe(0f, -30f + value3),
new Keyframe(20f, -30f + value3),
new Keyframe(21f, 10f + value3)
});
if (eventEnum == EventEnum.Unfair || eventEnum == EventEnum.All)
{
val3.outsideEnemySpawnChanceThroughDay = new AnimationCurve((Keyframe[])(object)new Keyframe[3]
{
new Keyframe(0f, 10f + value3),
new Keyframe(20f, 10f + value3),
new Keyframe(21f, 10f + value3)
});
}
if (eventEnum == EventEnum.Hoarding || eventEnum == EventEnum.All)
{
val3.enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[1]
{
new Keyframe(0f, 500f + value3)
});
}
if (eventEnum == EventEnum.Chaos || eventEnum == EventEnum.All)
{
val3.enemySpawnChanceThroughoutDay = new AnimationCurve((Keyframe[])(object)new Keyframe[1]
{
new Keyframe(0f, 500f + value3)
});
}
levelHeatVal.TryGetValue(newLevel, out value3);
levelHeatVal[newLevel] = Mathf.Clamp(value3 + 20f, 0f, 100f);
Terminal val5 = Object.FindObjectOfType<Terminal>();
val5.groupCredits += 120;
val5.SyncGroupCreditsServerRpc(val5.groupCredits, val5.numberOfItemsInDropship);
if (val5.groupCredits > 250)
{
HUDManager.Instance.AddTextToChatOnServer("<color=green>(You get free money every time you land, spend it!)</color>", -1);
}
}
return true;
}
private static void AddLassomanToLevel(SelectableLevel newLevel)
{
//IL_011e: Unknown result type (might be due to invalid IL or missing references)
//IL_0123: Unknown result type (might be due to invalid IL or missing references)
//IL_0128: Unknown result type (might be due to invalid IL or missing references)
//IL_0132: 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)
});
}
}
}
}
}
namespace BrutalCompany.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 BrutalCompany.Component
{
internal class QuotaAjuster : MonoBehaviour
{
public TimeOfDay TOD;
public float messageTimer = 58f;
public static int surpriseLandmines;
public static GameObject landmine;
public static GameObject turret;
public static List<GameObject> objectsToCleanUp = new List<GameObject>();
public static float slSpawnTimer;
public static bool shouldSpawnTurret;
public void Awake()
{
Plugin.mls.LogWarning((object)"Changing quota variables");
}
public void Update()
{
//IL_0171: 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_0196: Unknown result type (might be due to invalid IL or missing references)
//IL_01b5: Unknown result type (might be due to invalid IL or missing references)
//IL_00a0: Unknown result type (might be due to invalid IL or missing references)
//IL_00b4: Unknown result type (might be due to invalid IL or missing references)
//IL_00db: Unknown result type (might be due to invalid IL or missing references)
//IL_00e0: 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_010c: Unknown result type (might be due to invalid IL or missing references)
if ((Object)(object)TOD == (Object)null)
{
TOD = Object.FindFirstObjectByType<TimeOfDay>();
}
else
{
TOD.quotaVariables.baseIncrease = 275f;
}
if ((Object)(object)StartOfRound.Instance != (Object)null && StartOfRound.Instance.shipIsLeaving)
{
surpriseLandmines = -1;
}
if (surpriseLandmines > 0)
{
if (slSpawnTimer > 0f)
{
slSpawnTimer = Random.Range(-4, -1);
PlayerControllerB[] allPlayerScripts = StartOfRound.Instance.allPlayerScripts;
PlayerControllerB val = allPlayerScripts[Random.Range(0, allPlayerScripts.Length)];
if ((Object)(object)val != (Object)null)
{
if (Vector3.Distance(((Component)val).transform.position, new Vector3(9.33f, 5.2f, 1021f)) < 1f)
{
slSpawnTimer = 1f;
return;
}
GameObject val2 = Object.Instantiate<GameObject>(landmine, ((Component)val).transform.position, Quaternion.identity);
val2.transform.position = ((Component)val).transform.position;
Plugin.mls.LogWarning((object)((Component)val).transform.position);
val2.GetComponent<NetworkObject>().Spawn(true);
objectsToCleanUp.Add(val2);
}
}
else
{
slSpawnTimer += Time.deltaTime;
}
}
if (shouldSpawnTurret & ((Object)(object)turret != (Object)null))
{
shouldSpawnTurret = false;
GameObject val3 = Object.Instantiate<GameObject>(turret, new Vector3(3.87f, 0.84f, -14.23f), Quaternion.identity);
val3.transform.position = new Vector3(3.87f, 0.84f, -14.23f);
val3.transform.forward = new Vector3(1f, 0f, 0f);
val3.GetComponent<NetworkObject>().Spawn(true);
objectsToCleanUp.Add(val3);
}
}
public static void CleanupAllSpawns()
{
foreach (GameObject item in objectsToCleanUp)
{
if ((Object)(object)item != (Object)null)
{
item.GetComponent<NetworkObject>().Despawn(true);
}
}
objectsToCleanUp.Clear();
}
}
}