diff --git a/Buildings/ReactorData.cs b/Buildings/ReactorData.cs index 0f18e54..62d80f5 100644 --- a/Buildings/ReactorData.cs +++ b/Buildings/ReactorData.cs @@ -3,11 +3,32 @@ using Mafi.Core.Mods; using Mafi.Core.Products; using Mafi.Core.Factory.NuclearReactors; +using Mafi.Core.Prototypes; +using System; namespace NuclearPlus.Buildings; internal class ReactorData : IModData { + + private EntityCostsTpl ReactorCostBuilder(ProtoRegistrator registrator, + double productCostMulti, + double maintenanceCostsMulti, + double workersCostMulti + ) { + var reactorCost = registrator.PrototypesDb.GetOrThrow(Ids.Buildings.NuclearReactor).Costs; + var costs = new EntityCostsTpl.Builder() + .Maintenance( + (int)Math.Round(reactorCost.Maintenance.MaintenancePerMonth.Value.ToIntCeiled() * maintenanceCostsMulti), + reactorCost.Maintenance.Product.Id + ) + .Workers((int)Math.Round(reactorCost.Workers * workersCostMulti)); + foreach (var product in reactorCost.Price.Products) { + costs.Product(((int)Math.Round(product.Quantity.Value * productCostMulti)), product.Product.Id); + } + return costs; + } + public void RegisterData(ProtoRegistrator registrator) { var uraniumRod = registrator.PrototypesDb.GetOrThrow(Ids.Products.UraniumRod); @@ -17,7 +38,8 @@ public void RegisterData(ProtoRegistrator registrator) registrator.NuclearReactorProtoBuilder() .Start("Plutonium nuclear reactor", NuclearPlusIds.Buildings.PlutoniumReactor) - .Description("This reactor can utilize plutonium rods.") + .Description("This reactor can utilize plutonium rods. Plutonium is around 100 times more energy dense than uranium, thus only 1% of the fuel is used.") + .SetCost(ReactorCostBuilder(registrator, 2, 1.2, 1.2)) .AddFuelPair(plutoniumRod, spentFuel, 18000.Seconds()) .SetCategories(Ids.ToolbarCategories.MachinesElectricity) .SetCustomIconPath(registrator.PrototypesDb.GetOrThrow(Ids.Buildings.NuclearReactor).Graphics.IconPath) @@ -25,7 +47,8 @@ public void RegisterData(ProtoRegistrator registrator) registrator.NuclearReactorProtoBuilder() .Start("Plutonium fast breeder reactor", NuclearPlusIds.Buildings.PlutoniumBreederReactor) - .Description("This reactor can utilize plutonium rods. The output of this reactor contains more fissile material than was consumed in the reaction. Plutonium is around 100 times more energy dense than uranium, thus only 1% of the fuel is used.") + .Description("This reactor can utilize plutonium rods. Plutonium is around 100 times more energy dense than uranium, thus only 1% of the fuel is used. The output of this reactor contains more fissile material than was consumed in the reaction.") + .SetCost(ReactorCostBuilder(registrator, 2, 1.5, 1.5)) .AddFuelPair(plutoniumRod, breederSpentFuel, 18000.Seconds()) .SetCategories(Ids.ToolbarCategories.MachinesElectricity) .SetCustomIconPath(registrator.PrototypesDb.GetOrThrow(Ids.Buildings.NuclearReactor).Graphics.IconPath) @@ -34,6 +57,7 @@ public void RegisterData(ProtoRegistrator registrator) registrator.NuclearReactorProtoBuilder() .Start("Uranium fast breeder reactor", NuclearPlusIds.Buildings.BreederReactor) .Description("This reactor can utilize uranium rods. The output of this reactor contains more fissile material than was consumed in the reaction.") + .SetCost(ReactorCostBuilder(registrator, 2, 2, 1.5)) .AddFuelPair(uraniumRod, breederSpentFuel, 180.Seconds()) .SetCategories(Ids.ToolbarCategories.MachinesElectricity) .SetCustomIconPath(registrator.PrototypesDb.GetOrThrow(Ids.Buildings.NuclearReactor).Graphics.IconPath) diff --git a/NuclearPlus.Core.cs b/NuclearPlus.Core.cs index db828bc..8264fb6 100644 --- a/NuclearPlus.Core.cs +++ b/NuclearPlus.Core.cs @@ -1,10 +1,10 @@ using System; using System.Reflection; -public static class Core +internal static class Core { - public static string Name => Assembly.GetCallingAssembly().GetName().Name; - public static string Version => Assembly.GetCallingAssembly().GetName().Version.ToString(); - public static int VersionInt => int.Parse(Version.Replace(".", "")); - public static void LogWithVersion(Action logger, string message) => logger($"{Core.Name}[{Core.Version}]: {message}"); + internal static string Name => Assembly.GetCallingAssembly().GetName().Name; + internal static string Version => Assembly.GetCallingAssembly().GetName().Version.ToString(); + internal static int VersionInt => int.Parse(Version.Replace(".", "")); + internal static void LogWithVersion(Action logger, string message) => logger($"{Core.Name}[{Core.Version}]: {message}"); } diff --git a/NuclearPlus.csproj b/NuclearPlus.csproj index 9d271f9..c487079 100644 --- a/NuclearPlus.csproj +++ b/NuclearPlus.csproj @@ -20,7 +20,7 @@ Library - net46 + net48 Debug;Release true NotoriousPyro diff --git a/NuclearPlusIds.Products.cs b/NuclearPlusIds.Products.cs index b4eeb12..c79c076 100644 --- a/NuclearPlusIds.Products.cs +++ b/NuclearPlusIds.Products.cs @@ -17,7 +17,7 @@ public static class Products public static readonly ProductProto.ID UranylNitrate = Ids.Products.CreateId("UranylNitrate"); public static readonly ProductProto.ID PlutoniumNitrate = Ids.Products.CreateId("PlutoniumNitrate"); public static readonly ProductProto.ID BreederSpentFuel = Ids.Products.CreateId("BreederSpentFuel"); - public static readonly ProductProto.ID BreederSpentFuelFromUranium = Ids.Products.CreateId("BreederSpentFuelFromUranium"); + //public static readonly ProductProto.ID BreederSpentFuelFromUranium = Ids.Products.CreateId("BreederSpentFuelFromUranium"); public static readonly ProductProto.ID PlutoniumRod = Ids.Products.CreateId("PlutoniumRod"); public static readonly ProductProto.ID PlutoniumPellets = Ids.Products.CreateId("PlutoniumPellets"); } diff --git a/README.md b/README.md index 64a7b4c..aeea12f 100644 --- a/README.md +++ b/README.md @@ -33,13 +33,12 @@ Download the latest release: https://github.com/NotoriousPyro/NuclearPlus/releas # How to use ## Basic setup -![Basic setup](docs/basicsetup.png) +***COMING SOON...*** ## Research -Research is currently limited to a single item which unlocks everything, this may be changed later... +Research is via: * **Advanced nuclear**: dependant on Nuclear reactor first being completed. -![Research: Advanced Nuclear](docs/research_advancednuclear.png) +* **Plutonoum power production**: dependant on Robotic III and Advanced nuclear first being completed. +![Research](docs/research.png) +![Research Tree](docs/research_tree.png) -## Recipes -* Incineration plant -![Recipes: ](docs/recipes_.png) diff --git a/docs/research.png b/docs/research.png new file mode 100644 index 0000000..59beca8 Binary files /dev/null and b/docs/research.png differ diff --git a/docs/research_tree.png b/docs/research_tree.png new file mode 100644 index 0000000..3e31c78 Binary files /dev/null and b/docs/research_tree.png differ