using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Runtime.Versioning;
using BepInEx;
using BepInEx.Logging;
using EquinoxsModUtils;
using HarmonyLib;
[assembly: CompilationRelaxations(8)]
[assembly: RuntimeCompatibility(WrapNonExceptionThrows = true)]
[assembly: Debuggable(DebuggableAttribute.DebuggingModes.Default | DebuggableAttribute.DebuggingModes.DisableOptimizations | DebuggableAttribute.DebuggingModes.IgnoreSymbolStoreSequencePoints | DebuggableAttribute.DebuggingModes.EnableEditAndContinue)]
[assembly: AssemblyTitle("EarlyBaseBuilding")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("EarlyBaseBuilding")]
[assembly: AssemblyCopyright("Copyright © 2023")]
[assembly: AssemblyTrademark("")]
[assembly: ComVisible(false)]
[assembly: Guid("7ec88224-3d33-4228-89bc-bb8f8c84091f")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: TargetFramework(".NETFramework,Version=v4.7.2", FrameworkDisplayName = ".NET Framework 4.7.2")]
[assembly: AssemblyVersion("1.0.0.0")]
namespace EarlyBaseBuilding;
[BepInPlugin("com.equinox.EarlyBaseBuilding", "EarlyBaseBuilding", "2.0.0")]
public class EarlyBaseBuildingPlugin : BaseUnityPlugin
{
private const string MyGUID = "com.equinox.EarlyBaseBuilding";
private const string PluginName = "EarlyBaseBuilding";
private const string VersionString = "2.0.0";
private static readonly Harmony Harmony = new Harmony("com.equinox.EarlyBaseBuilding");
public static ManualLogSource Log = new ManualLogSource("EarlyBaseBuilding");
private void Awake()
{
((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: EarlyBaseBuilding, VersionString: 2.0.0 is loading...");
Harmony.PatchAll();
Events.GameDefinesLoaded += OnGameDefinesLoaded;
Events.GameLoaded += OnGameLoaded;
((BaseUnityPlugin)this).Logger.LogInfo((object)"PluginName: EarlyBaseBuilding, VersionString: 2.0.0 is loaded.");
Log = ((BaseUnityPlugin)this).Logger;
}
private void OnGameDefinesLoaded()
{
List<string> list = new List<string>
{
"Calycite Platform (1x1)", "Calycite Platform (3x3)", "Calycite Platform (5x5)", "Catwalk (3x9)", "Catwalk (5x9)", "Calycite Wall (3x3)", "Calycite Wall (5x3)", "Calycite Wall (5x5)", "Calycite Gate (5x2)", "Calycite Gate (5x5)",
"Calycite Gate (10x5)", "Calycite Wall Cap (3x1)", "Calycite Wall Cap (5x1)", "Calycite Wall Corner (1x1)", "Calycite Vertical Wall Cap (3x1)", "Calycite Vertical Wall Cap (5x1)", "Calycite Vertical Wall Corner (1x1)", "Calycite Wall Cutaway (2x2)", "Calycite Wall Cutaway (3x3)", "Calycite Wall Cutaway (5x3)",
"Calycite Wall Cutaway (5x5)", "Calycite Pillar (1x1)", "Calycite Pillar (1x3)", "Calycite Pillar (1x5)", "Calycite Angle Support (3x3)", "Calycite Beam (1x1)", "Calycite Beam (3x1)", "Calycite Beam (5x1)", "Calycite Ramp (1x1)", "Calycite Ramp (1x3)",
"Calycite Ramp (1x5)"
};
List<string> list2 = new List<string>
{
"Metal Stairs (1x1)", "Metal Stairs (3x1)", "Metal Stairs (3x3)", "Metal Stairs (3x5)", "Railing (1x1)", "Railing (3x1)", "Railing (5x1)", "Railing Corner (1x1)", "Railing Corner (3x3)", "Metal Pillar (1x1)",
"Metal Pillar (1x3)", "Metal Pillar (1x5)", "Metal Angle Support (5x2)", "Metal Rib Base (1x2)", "Metal Rib Middle (1x3)", "Metal Beam (1x1)", "Metal Beam (1x3)", "Metal Beam (1x5)"
};
List<string> list3 = new List<string> { "Small Floor Pot", "Wall Pot", "Medium Floor Pot", "Ceiling Plant (1x1)", "Ceiling Plant (3x3)", "Wall Plant (1x1)", "Wall Plant (3x3)" };
List<string> list4 = new List<string>
{
"Light Stick", "Red Light Stick", "Green Light Stick", "Blue Light Stick", "Overhead Light", "Standing Lamp (1x5)", "Wall Light (1x1)", "Wall Light (3x1)", "Hanging Lamp (1x1)", "Fan Lamp (7x2)",
"Disco Block (1x1)", "Glow Block (1x1)"
};
List<ResourceInfo> list5 = new List<ResourceInfo> { Resources.GetResourceInfoByName("Limestone", false) };
List<ResourceInfo> list6 = new List<ResourceInfo> { Resources.GetResourceInfoByName("Iron Ingot", false) };
List<ResourceInfo> list7 = new List<ResourceInfo> { Resources.GetResourceInfoByName("Plantmatter", false) };
List<ResourceInfo> list8 = new List<ResourceInfo>
{
Resources.GetResourceInfoByName("Iron Ingot", false),
Resources.GetResourceInfoByName("Copper Wire", false)
};
foreach (string item in list)
{
SchematicsRecipeData recipeForBuildable = GetRecipeForBuildable(Resources.GetResourceInfoByName(item, false));
recipeForBuildable.ingTypes = list5.ToArray();
recipeForBuildable.ingQuantities = new int[1] { 5 };
}
foreach (string item2 in list2)
{
SchematicsRecipeData recipeForBuildable2 = GetRecipeForBuildable(Resources.GetResourceInfoByName(item2, false));
recipeForBuildable2.ingTypes = list6.ToArray();
recipeForBuildable2.ingQuantities = new int[1] { 2 };
}
foreach (string item3 in list3)
{
SchematicsRecipeData recipeForBuildable3 = GetRecipeForBuildable(Resources.GetResourceInfoByName(item3, false));
recipeForBuildable3.ingTypes = list7.ToArray();
recipeForBuildable3.ingQuantities = new int[1] { 5 };
}
foreach (string item4 in list4)
{
SchematicsRecipeData recipeForBuildable4 = GetRecipeForBuildable(Resources.GetResourceInfoByName(item4, false));
recipeForBuildable4.ingTypes = list8.ToArray();
recipeForBuildable4.ingQuantities = new int[2] { 1, 1 };
}
}
private void OnGameLoaded()
{
List<string> list = new List<string>
{
"Stairs & Walkways I", "Stairs & Walkways II", "Stairs & Walkways III", "Light Stick (Primary Colors)", "DECO Series I", "DECO Series II", "DECO Series III", "DECO Plants & Ceilings", "DECO Plants & Walls", "Gates I",
"Gates II", "Gates III", "Gates IV", "Light Stick", "Overhead Light", "Overhead Light II", "Platforms I", "Beams", "Platforms II", "DECO Static Lights",
"DECO Dynamic Lights", "Supports I", "Supports II", "Supports III", "Supports IV", "Wall Lights", "Walls I", "Walls II", "Walls III"
};
foreach (string item in list)
{
Unlock unlockByName = Unlocks.GetUnlockByName(item, false);
TechTreeState.instance.UnlockTech(((UniqueIdScriptableObject)unlockByName).uniqueId, false, false);
}
}
private SchematicsRecipeData GetRecipeForBuildable(ResourceInfo info)
{
return GameDefines.instance.schematicsRecipeEntries.Where((SchematicsRecipeData recipe) => recipe.outputTypes.Contains(info)).First();
}
}