Skip to content
This repository has been archived by the owner on Jun 25, 2023. It is now read-only.

Commit

Permalink
Release version
Browse files Browse the repository at this point in the history
  • Loading branch information
NotoriousPyro committed Oct 26, 2022
1 parent 8949bf4 commit c472769
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 15 deletions.
28 changes: 26 additions & 2 deletions Buildings/ReactorData.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<NuclearReactorProto>(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<ProductProto>(Ids.Products.UraniumRod);
Expand All @@ -17,15 +38,17 @@ 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<NuclearReactorProto>(Ids.Buildings.NuclearReactor).Graphics.IconPath)
.BuildAndAdd();

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<NuclearReactorProto>(Ids.Buildings.NuclearReactor).Graphics.IconPath)
Expand All @@ -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<NuclearReactorProto>(Ids.Buildings.NuclearReactor).Graphics.IconPath)
Expand Down
10 changes: 5 additions & 5 deletions NuclearPlus.Core.cs
Original file line number Diff line number Diff line change
@@ -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<string> 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<string> logger, string message) => logger($"{Core.Name}[{Core.Version}]: {message}");
}
2 changes: 1 addition & 1 deletion NuclearPlus.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
</Target>
<PropertyGroup>
<OutputType>Library</OutputType>
<TargetFramework>net46</TargetFramework>
<TargetFramework>net48</TargetFramework>
<Configurations>Debug;Release</Configurations>
<GenerateAssemblyInfo>true</GenerateAssemblyInfo>
<Authors>NotoriousPyro</Authors>
Expand Down
2 changes: 1 addition & 1 deletion NuclearPlusIds.Products.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
Expand Down
11 changes: 5 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Binary file added docs/research.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/research_tree.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit c472769

Please sign in to comment.