using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using Game.Economy;
using Game.Prefabs;
using HarmonyLib;
using Microsoft.CodeAnalysis;
using UnityEngine;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: TargetFramework(".NETStandard,Version=v2.1", FrameworkDisplayName = ".NET Standard 2.1")]
[assembly: AssemblyCompany("WhitesharkCheatOverhaul")]
[assembly: AssemblyConfiguration("Debug")]
[assembly: AssemblyFileVersion("0.0.1.0")]
[assembly: AssemblyInformationalVersion("0.0.1+60d8eb3115475881a32fc7113de5eaf2bc2f3f24")]
[assembly: AssemblyProduct("WhitesharkCheatOverhaul")]
[assembly: AssemblyTitle("WhitesharkCheatOverhaul")]
[assembly: AssemblyVersion("0.0.1.0")]
[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.Class | AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Event | AttributeTargets.Parameter | AttributeTargets.ReturnValue | AttributeTargets.GenericParameter, AllowMultiple = false, Inherited = false)]
internal sealed class NullableAttribute : Attribute
{
public readonly byte[] NullableFlags;
public NullableAttribute(byte P_0)
{
NullableFlags = new byte[1] { P_0 };
}
public NullableAttribute(byte[] P_0)
{
NullableFlags = P_0;
}
}
[CompilerGenerated]
[Microsoft.CodeAnalysis.Embedded]
[AttributeUsage(AttributeTargets.Class | AttributeTargets.Struct | AttributeTargets.Method | AttributeTargets.Interface | AttributeTargets.Delegate, AllowMultiple = false, Inherited = false)]
internal sealed class NullableContextAttribute : Attribute
{
public readonly byte Flag;
public NullableContextAttribute(byte P_0)
{
Flag = P_0;
}
}
[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 WhitesharkCheatOverhaul
{
[BepInPlugin("WhitesharkCheatOverhaul", "CheatOverhaul", "0.0.1")]
public class WhitesharkCheatOverhaul : BaseUnityPlugin
{
public static ManualLogSource GameLogger;
private void Awake()
{
GameLogger = ((BaseUnityPlugin)this).Logger;
Harmony val = Harmony.CreateAndPatchAll(Assembly.GetExecutingAssembly(), "WhitesharkCheatOverhaul_Cities2Harmony");
IEnumerable<MethodBase> patchedMethods = val.GetPatchedMethods();
((BaseUnityPlugin)this).Logger.LogInfo((object)("Plugin WhitesharkCheatOverhaul 0.0.1 is loaded! Patched methods: " + patchedMethods.Count()));
foreach (MethodBase item in patchedMethods)
{
((BaseUnityPlugin)this).Logger.LogInfo((object)("Patched method: " + item.Module.Name + ":" + item.Name));
}
}
}
[HarmonyPatch(typeof(PrefabSystem), "AddPrefab")]
public static class PowerPlants_Consumption_Pollution_Production
{
private static readonly Dictionary<string, (int, int, int, int, int, int, int)> _ConsumptionAndPollution = new Dictionary<string, (int, int, int, int, int, int, int)>
{
{
"GasPowerPlant01",
(50, 0, 0, 0, 0, 0, 10000000)
},
{
"SmallCoalPowerPlant01",
(50, 0, 0, 0, 0, 0, 10000000)
}
};
[HarmonyPrefix]
public static bool Prefix(object __instance, PrefabBase prefab)
{
if (_ConsumptionAndPollution.TryGetValue(((Object)prefab).name, out var value))
{
(int, int, int, int, int, int, int) tuple = value;
int item = tuple.Item1;
int item2 = tuple.Item2;
int item3 = tuple.Item3;
int item4 = tuple.Item4;
int item5 = tuple.Item5;
int item6 = tuple.Item6;
int item7 = tuple.Item7;
ServiceConsumption component = ((ComponentBase)prefab).GetComponent<ServiceConsumption>();
component.m_Upkeep = item;
component.m_GarbageAccumulation = item3;
component.m_WaterConsumption = item2;
Pollution component2 = ((ComponentBase)prefab).GetComponent<Pollution>();
component2.m_AirPollution = item4;
component2.m_GroundPollution = item5;
component2.m_NoisePollution = item6;
PowerPlant component3 = ((ComponentBase)prefab).GetComponent<PowerPlant>();
component3.m_ElectricityProduction = item7;
}
return true;
}
}
[HarmonyPatch(typeof(PrefabSystem), "AddPrefab")]
public static class WaterPump_Consumption_Pollution_Production
{
private static readonly Dictionary<string, (int, int, int, int, int)> _watercostAndCapacity = new Dictionary<string, (int, int, int, int, int)> {
{
"WaterPumpingStation01",
(50, 1000000, 0, 0, 0)
} };
[HarmonyPrefix]
public static bool Prefix(object __instance, PrefabBase prefab)
{
if (_watercostAndCapacity.TryGetValue(((Object)prefab).name, out var value))
{
(int, int, int, int, int) tuple = value;
int item = tuple.Item1;
int item2 = tuple.Item2;
int item3 = tuple.Item3;
int item4 = tuple.Item4;
int item5 = tuple.Item5;
ServiceConsumption component = ((ComponentBase)prefab).GetComponent<ServiceConsumption>();
component.m_Upkeep = item;
component.m_GarbageAccumulation = item3;
component.m_ElectricityConsumption = item4;
Pollution component2 = ((ComponentBase)prefab).GetComponent<Pollution>();
component2.m_NoisePollution = item5;
WaterPumpingStation component3 = ((ComponentBase)prefab).GetComponent<WaterPumpingStation>();
component3.m_Capacity = item2;
}
return true;
}
}
[HarmonyPatch(typeof(PrefabSystem), "AddPrefab")]
public static class LowpowerPatch_Costs
{
private static readonly Dictionary<string, (int, int, int)> _lowpowercostAndCapacity = new Dictionary<string, (int, int, int)> {
{
"TransformerStation01",
(50, 0, 0)
} };
[HarmonyPrefix]
public static bool Prefix(object __instance, PrefabBase prefab)
{
if (_lowpowercostAndCapacity.TryGetValue(((Object)prefab).name, out var value))
{
(int, int, int) tuple = value;
int item = tuple.Item1;
int item2 = tuple.Item2;
int item3 = tuple.Item3;
ServiceConsumption component = ((ComponentBase)prefab).GetComponent<ServiceConsumption>();
component.m_Upkeep = item;
component.m_GarbageAccumulation = item2;
Pollution component2 = ((ComponentBase)prefab).GetComponent<Pollution>();
component2.m_NoisePollution = item3;
}
return true;
}
}
[HarmonyPatch(typeof(PrefabSystem), "AddPrefab")]
public static class ServerPatch_Costs
{
private static readonly Dictionary<string, (int, int, int, int, int, int, int)> _servercostAndCapacity = new Dictionary<string, (int, int, int, int, int, int, int)> {
{
"ServerFarm01",
(50, 0, 0, 0, 12500, 200000, 0)
} };
[HarmonyPrefix]
public static bool Prefix(object __instance, PrefabBase prefab)
{
if (_servercostAndCapacity.TryGetValue(((Object)prefab).name, out var value))
{
(int, int, int, int, int, int, int) tuple = value;
int item = tuple.Item1;
int item2 = tuple.Item2;
int item3 = tuple.Item3;
int item4 = tuple.Item4;
int item5 = tuple.Item5;
int item6 = tuple.Item6;
int item7 = tuple.Item7;
ServiceConsumption component = ((ComponentBase)prefab).GetComponent<ServiceConsumption>();
component.m_Upkeep = item;
component.m_ElectricityConsumption = item2;
component.m_WaterConsumption = item3;
component.m_GarbageAccumulation = item4;
TelecomFacility component2 = ((ComponentBase)prefab).GetComponent<TelecomFacility>();
component2.m_Range = item5;
component2.m_NetworkCapacity = item6;
Pollution component3 = ((ComponentBase)prefab).GetComponent<Pollution>();
component3.m_NoisePollution = item7;
}
return true;
}
}
[HarmonyPatch(typeof(PrefabSystem), "AddPrefab")]
public static class GarbagePatch_Costs
{
private static readonly Dictionary<string, (int, int)> _garbagecostAndCapacity = new Dictionary<string, (int, int)> {
{
"GarbageTruck01",
(80000, 10000)
} };
[HarmonyPrefix]
public static bool Prefix(object __instance, PrefabBase prefab)
{
if (_garbagecostAndCapacity.TryGetValue(((Object)prefab).name, out var value))
{
(int, int) tuple = value;
int item = tuple.Item1;
int item2 = tuple.Item2;
GarbageTruck component = ((ComponentBase)prefab).GetComponent<GarbageTruck>();
component.m_GarbageCapacity = item;
component.m_UnloadRate = item2;
}
return true;
}
}
[HarmonyPatch(typeof(PrefabSystem), "AddPrefab")]
public static class BusPatch_Costs
{
private static readonly Dictionary<string, (int, int)> _buscostAndCapacity = new Dictionary<string, (int, int)>
{
{
"Bus01",
(1000, 10000)
},
{
"Bus02",
(1000, 10000)
},
{
"Bus03",
(1000, 10000)
}
};
[HarmonyPrefix]
public static bool Prefix(object __instance, PrefabBase prefab)
{
if (_buscostAndCapacity.TryGetValue(((Object)prefab).name, out var value))
{
(int, int) tuple = value;
int item = tuple.Item1;
int item2 = tuple.Item2;
PublicTransport component = ((ComponentBase)prefab).GetComponent<PublicTransport>();
component.m_PassengerCapacity = item;
component.m_MaintenanceRange = item2;
}
return true;
}
}
[HarmonyPatch(typeof(PrefabSystem), "AddPrefab")]
public static class GaragePatch_Costs
{
private static readonly Dictionary<string, (int, int)> _parkingcostAndCapacity = new Dictionary<string, (int, int)>
{
{
"ParkingHall01",
(1000, 1)
},
{
"ParkingHall02",
(1000, 1)
}
};
[HarmonyPrefix]
public static bool Prefix(object __instance, PrefabBase prefab)
{
if (_parkingcostAndCapacity.TryGetValue(((Object)prefab).name, out var value))
{
(int, int) tuple = value;
int item = tuple.Item1;
int item2 = tuple.Item2;
ParkingFacility component = ((ComponentBase)prefab).GetComponent<ParkingFacility>();
component.m_GarageMarkerCapacity = item;
component.m_ComfortFactor = item2;
}
return true;
}
}
[HarmonyPatch(typeof(PrefabSystem), "AddPrefab")]
public static class ParkPatch_Happiness
{
private static readonly Dictionary<string, (int, int, int, int, int, int, int, int)> _parkCoverageAndAttraction = new Dictionary<string, (int, int, int, int, int, int, int, int)>
{
{
"CityPark01",
(100000, 50000, 0, 0, 0, 20000, 50, 50)
},
{
"CityPark02",
(100000, 50000, 0, 0, 0, 20000, 50, 50)
},
{
"CityPark03",
(100000, 50000, 0, 0, 0, 20000, 50, 50)
},
{
"CityPark04",
(100000, 50000, 0, 0, 0, 20000, 50, 50)
}
};
[HarmonyPrefix]
public static bool Prefix(object __instance, PrefabBase prefab)
{
if (_parkCoverageAndAttraction.TryGetValue(((Object)prefab).name, out var value))
{
(int, int, int, int, int, int, int, int) tuple = value;
int item = tuple.Item1;
int item2 = tuple.Item2;
int item3 = tuple.Item3;
int item4 = tuple.Item4;
int item5 = tuple.Item5;
int item6 = tuple.Item6;
int item7 = tuple.Item7;
int item8 = tuple.Rest.Item1;
ServiceConsumption component = ((ComponentBase)prefab).GetComponent<ServiceConsumption>();
component.m_ElectricityConsumption = item3;
component.m_GarbageAccumulation = item5;
component.m_WaterConsumption = item4;
ServiceCoverage component2 = ((ComponentBase)prefab).GetComponent<ServiceCoverage>();
component2.m_Range = item;
component2.m_Capacity = item6;
component2.m_Magnitude = item7;
Attraction component3 = ((ComponentBase)prefab).GetComponent<Attraction>();
component3.m_Attractiveness = item2;
LeisureProvider component4 = ((ComponentBase)prefab).GetComponent<LeisureProvider>();
component4.m_Efficiency = item8;
}
return true;
}
}
[HarmonyPatch(typeof(PrefabSystem), "AddPrefab")]
public static class SewagePatch_Costs
{
private static readonly Dictionary<string, (int, int, int, int, int, int, int)> _sewagecostAndCapacity = new Dictionary<string, (int, int, int, int, int, int, int)> {
{
"WastewaterTreatmentPlant01",
(10000000, 1, 50, 0, 0, 0, 0)
} };
[HarmonyPrefix]
public static bool Prefix(object __instance, PrefabBase prefab)
{
if (_sewagecostAndCapacity.TryGetValue(((Object)prefab).name, out var value))
{
(int, int, int, int, int, int, int) tuple = value;
int item = tuple.Item1;
int item2 = tuple.Item2;
int item3 = tuple.Item3;
int item4 = tuple.Item4;
int item5 = tuple.Item5;
int item6 = tuple.Item6;
int item7 = tuple.Item7;
SewageOutlet component = ((ComponentBase)prefab).GetComponent<SewageOutlet>();
component.m_Capacity = item;
component.m_Purification = item2;
ServiceConsumption component2 = ((ComponentBase)prefab).GetComponent<ServiceConsumption>();
component2.m_Upkeep = item3;
component2.m_GarbageAccumulation = item4;
Pollution component3 = ((ComponentBase)prefab).GetComponent<Pollution>();
component3.m_GroundPollution = item5;
component3.m_AirPollution = item6;
component3.m_NoisePollution = item7;
}
return true;
}
}
[HarmonyPatch(typeof(PrefabSystem), "AddPrefab")]
public static class CustomFarm
{
private static readonly Dictionary<string, ResourceInEditor[]> _customitems;
[HarmonyPrefix]
public static bool Prefix(object __instance, PrefabBase prefab)
{
if (_customitems.TryGetValue(((Object)prefab).name, out ResourceInEditor[] value))
{
BuildingProperties component = ((ComponentBase)prefab).GetComponent<BuildingProperties>();
List<ResourceInEditor> list = component.m_AllowedManufactured.ToList();
list.AddRange(value);
component.m_AllowedManufactured = list.Distinct().ToArray();
}
return true;
}
static CustomFarm()
{
Dictionary<string, ResourceInEditor[]> dictionary = new Dictionary<string, ResourceInEditor[]>();
ResourceInEditor[] array = new ResourceInEditor[9];
RuntimeHelpers.InitializeArray(array, (RuntimeFieldHandle)/*OpCode not supported: LdMemberToken*/);
dictionary.Add("IndustrialManufacturingSignature01", (ResourceInEditor[])(object)array);
_customitems = dictionary;
}
}
[HarmonyPatch(typeof(PrefabSystem), "AddPrefab")]
public static class CustomPopHouse
{
private static readonly Dictionary<string, (float, float)> _wellbeingAndRadius = new Dictionary<string, (float, float)> {
{
"EU_ResidentialLowSignature01",
(10000f, 50000f)
} };
[HarmonyPrefix]
public static bool Prefix(object __instance, PrefabBase prefab)
{
if (_wellbeingAndRadius.TryGetValue(((Object)prefab).name, out var value))
{
(float, float) tuple = value;
float item = tuple.Item1;
float item2 = tuple.Item2;
LocalEffects component = ((ComponentBase)prefab).GetComponent<LocalEffects>();
LocalEffectInfo val = ((IEnumerable<LocalEffectInfo>)component.m_Effects).FirstOrDefault((Func<LocalEffectInfo, bool>)((LocalEffectInfo effect) => (int)effect.m_Type == 3));
val.m_Delta = item;
val.m_Radius = item2;
}
return true;
}
}
[HarmonyPatch(typeof(PrefabSystem), "AddPrefab")]
public static class TrainPatch_Costs
{
private static readonly Dictionary<string, (int, int)> _trainCapacity = new Dictionary<string, (int, int)>
{
{
"TrainPassengerCar01",
(1000, 10000)
},
{
"TrainPassengerEngine01",
(1000, 10000)
}
};
[HarmonyPrefix]
public static bool Prefix(object __instance, PrefabBase prefab)
{
if (_trainCapacity.TryGetValue(((Object)prefab).name, out var value))
{
(int, int) tuple = value;
int item = tuple.Item1;
int item2 = tuple.Item2;
PublicTransport component = ((ComponentBase)prefab).GetComponent<PublicTransport>();
component.m_PassengerCapacity = item;
component.m_MaintenanceRange = item2;
}
return true;
}
}
[HarmonyPatch(typeof(PrefabSystem), "AddPrefab")]
public static class SubwayPatch_Costs
{
private static readonly Dictionary<string, (int, int)> _subwayCapacity = new Dictionary<string, (int, int)>
{
{
"SubwayCar01",
(1000, 10000)
},
{
"SubwayEngine01",
(1000, 10000)
}
};
[HarmonyPrefix]
public static bool Prefix(object __instance, PrefabBase prefab)
{
if (_subwayCapacity.TryGetValue(((Object)prefab).name, out var value))
{
(int, int) tuple = value;
int item = tuple.Item1;
int item2 = tuple.Item2;
PublicTransport component = ((ComponentBase)prefab).GetComponent<PublicTransport>();
component.m_PassengerCapacity = item;
component.m_MaintenanceRange = item2;
}
return true;
}
}
[HarmonyPatch(typeof(PrefabSystem), "AddPrefab")]
public static class TramPatch_Costs
{
private static readonly Dictionary<string, (int, int)> _tramCapacity = new Dictionary<string, (int, int)>
{
{
"TramCar01",
(1000, 10000)
},
{
"TramEngine01",
(1000, 10000)
}
};
[HarmonyPrefix]
public static bool Prefix(object __instance, PrefabBase prefab)
{
if (_tramCapacity.TryGetValue(((Object)prefab).name, out var value))
{
(int, int) tuple = value;
int item = tuple.Item1;
int item2 = tuple.Item2;
PublicTransport component = ((ComponentBase)prefab).GetComponent<PublicTransport>();
component.m_PassengerCapacity = item;
component.m_MaintenanceRange = item2;
}
return true;
}
}
[HarmonyPatch(typeof(PrefabSystem), "AddPrefab")]
public static class PostOfficePatch
{
private static readonly Dictionary<string, (int, int, int)> _postofficeCapacity = new Dictionary<string, (int, int, int)> {
{
"PostOffice01",
(1000000, 3000, 50)
} };
[HarmonyPrefix]
public static bool Prefix(object __instance, PrefabBase prefab)
{
if (_postofficeCapacity.TryGetValue(((Object)prefab).name, out var value))
{
(int, int, int) tuple = value;
int item = tuple.Item1;
int item2 = tuple.Item2;
int item3 = tuple.Item3;
PostFacility component = ((ComponentBase)prefab).GetComponent<PostFacility>();
component.m_MailStorageCapacity = item;
component.m_MailBoxCapacity = item2;
component.m_PostVanCapacity = item3;
}
return true;
}
}
[HarmonyPatch(typeof(PrefabSystem), "AddPrefab")]
public static class IncineratorPatch_Costs
{
private static readonly Dictionary<string, (int, int, int, int, int, int, int)> _incineratorCapacity = new Dictionary<string, (int, int, int, int, int, int, int)> {
{
"IncinerationPlant01",
(3000000, 100, 0, 50, 0, 0, 0)
} };
[HarmonyPrefix]
public static bool Prefix(object __instance, PrefabBase prefab)
{
if (_incineratorCapacity.TryGetValue(((Object)prefab).name, out var value))
{
(int, int, int, int, int, int, int) tuple = value;
int item = tuple.Item1;
int item2 = tuple.Item2;
int item3 = tuple.Item3;
int item4 = tuple.Item4;
int item5 = tuple.Item5;
int item6 = tuple.Item6;
int item7 = tuple.Item7;
ServiceConsumption component = ((ComponentBase)prefab).GetComponent<ServiceConsumption>();
component.m_Upkeep = item4;
component.m_WaterConsumption = item3;
Pollution component2 = ((ComponentBase)prefab).GetComponent<Pollution>();
component2.m_GroundPollution = item5;
component2.m_AirPollution = item6;
component2.m_NoisePollution = item7;
GarbageFacility component3 = ((ComponentBase)prefab).GetComponent<GarbageFacility>();
component3.m_GarbageCapacity = item;
component3.m_VehicleCapacity = item2;
}
return true;
}
}
public static class MyPluginInfo
{
public const string PLUGIN_GUID = "WhitesharkCheatOverhaul";
public const string PLUGIN_NAME = "WhitesharkCheatOverhaul";
public const string PLUGIN_VERSION = "0.0.1";
}
}