mirror of
https://github.com/soarqin/DSP_Mods.git
synced 2025-12-08 20:53:28 +08:00
balance tweaks
This commit is contained in:
@@ -19,19 +19,21 @@ public class LogisticHub : BaseUnityPlugin
|
|||||||
{
|
{
|
||||||
Module.Miner.Enabled = Config.Bind("Miner", "Enabled", true, "enable/disable this plugin");
|
Module.Miner.Enabled = Config.Bind("Miner", "Enabled", true, "enable/disable this plugin");
|
||||||
Module.Miner.OreEnergyConsume = Config.Bind("Miner", "EnergyConsumptionForOre", 2000000L,
|
Module.Miner.OreEnergyConsume = Config.Bind("Miner", "EnergyConsumptionForOre", 2000000L,
|
||||||
"Energy consumption for each ore vein group(in 0.5W)");
|
"Energy consumption for each ore vein group(in W)");
|
||||||
Module.Miner.OilEnergyConsume = Config.Bind("Miner", "EnergyConsumptionForOil", 3600000L,
|
Module.Miner.OreMiningMultiplier = Config.Bind("Miner", "OreMiningMultiplier", 3,
|
||||||
"Energy consumption for each oil seep(in 0.5W)");
|
new ConfigDescription("Mining multiplier for ore veins, multiplies to the number of veins in the group", new AcceptableValueRange<int>(1, 100)));
|
||||||
Module.Miner.WaterEnergyConsume = Config.Bind("Miner", "EnergyConsumptionForWater", 2000000L,
|
Module.Miner.OreMiningScale = Config.Bind("Miner", "OreMiningScale", 100,
|
||||||
"Energy consumption for water slot(in kW)");
|
|
||||||
Module.Miner.WaterSpeed = Config.Bind("Miner", "WaterMiningSpeed", 10,
|
|
||||||
"Water mining speed (count per second)");
|
|
||||||
Module.Miner.MiningScale = Config.Bind("Miner", "MiningScale", 0,
|
|
||||||
"""
|
"""
|
||||||
0 for Auto(which means having researched makes mining scale 300, otherwise 100).
|
0 for Auto(which means having researched advanced mining machine makes mining scale 300, otherwise 100).
|
||||||
Mining scale(in percents) for slots below half of slot limits, and the scale reduces to 100% smoothly till reach full.
|
Mining scale(in percents) for slots below half of slot limits, and the scale reduces to 100% smoothly till reach full.
|
||||||
Please note that the power consumption increases by the square of the scale which is the same as Advanced Mining Machine.
|
Please note that the power consumption increases by the square of the scale which is the same as Advanced Mining Machine.
|
||||||
""");
|
""");
|
||||||
|
Module.Miner.OilEnergyConsume = Config.Bind("Miner", "EnergyConsumptionForOil", 1800000L,
|
||||||
|
"Energy consumption for each oil seep(in W)");
|
||||||
|
Module.Miner.WaterEnergyConsume = Config.Bind("Miner", "EnergyConsumptionForWater", 2000000L,
|
||||||
|
"Energy consumption for water slot(in W)");
|
||||||
|
Module.Miner.WaterSpeed = Config.Bind("Miner", "WaterMiningSpeed", 10,
|
||||||
|
"Water mining speed (count per second)");
|
||||||
Module.Miner.FuelIlsSlot = Config.Bind("Miner", "ILSFuelSlot", 4,
|
Module.Miner.FuelIlsSlot = Config.Bind("Miner", "ILSFuelSlot", 4,
|
||||||
new ConfigDescription("Fuel slot for ILS, set 0 to disable.", new AcceptableValueRange<int>(0, 5)));
|
new ConfigDescription("Fuel slot for ILS, set 0 to disable.", new AcceptableValueRange<int>(0, 5)));
|
||||||
Module.Miner.FuelPlsSlot = Config.Bind("Miner", "PLSFuelSlot", 4,
|
Module.Miner.FuelPlsSlot = Config.Bind("Miner", "PLSFuelSlot", 4,
|
||||||
|
|||||||
@@ -11,10 +11,11 @@ public class Miner : PatchImpl<Miner>
|
|||||||
{
|
{
|
||||||
public static ConfigEntry<bool> Enabled;
|
public static ConfigEntry<bool> Enabled;
|
||||||
public static ConfigEntry<long> OreEnergyConsume;
|
public static ConfigEntry<long> OreEnergyConsume;
|
||||||
|
public static ConfigEntry<int> OreMiningScale;
|
||||||
|
public static ConfigEntry<int> OreMiningMultiplier;
|
||||||
public static ConfigEntry<long> OilEnergyConsume;
|
public static ConfigEntry<long> OilEnergyConsume;
|
||||||
public static ConfigEntry<long> WaterEnergyConsume;
|
public static ConfigEntry<long> WaterEnergyConsume;
|
||||||
public static ConfigEntry<int> WaterSpeed;
|
public static ConfigEntry<int> WaterSpeed;
|
||||||
public static ConfigEntry<int> MiningScale;
|
|
||||||
public static ConfigEntry<int> FuelIlsSlot;
|
public static ConfigEntry<int> FuelIlsSlot;
|
||||||
public static ConfigEntry<int> FuelPlsSlot;
|
public static ConfigEntry<int> FuelPlsSlot;
|
||||||
|
|
||||||
@@ -23,6 +24,8 @@ public class Miner : PatchImpl<Miner>
|
|||||||
private static long _miningFrames;
|
private static long _miningFrames;
|
||||||
private static long _miningSpeedScaleLong;
|
private static long _miningSpeedScaleLong;
|
||||||
private static bool _advancedMiningMachineUnlocked;
|
private static bool _advancedMiningMachineUnlocked;
|
||||||
|
private static int _miningMultiplier = 3;
|
||||||
|
private static int _miningScale = 100;
|
||||||
private static uint _miningCostBarrier;
|
private static uint _miningCostBarrier;
|
||||||
private static uint _miningCostBarrierOil;
|
private static uint _miningCostBarrierOil;
|
||||||
private static int[] _mineIndex;
|
private static int[] _mineIndex;
|
||||||
@@ -90,6 +93,15 @@ public class Miner : PatchImpl<Miner>
|
|||||||
private static void CheckRecipes()
|
private static void CheckRecipes()
|
||||||
{
|
{
|
||||||
_advancedMiningMachineUnlocked = GameMain.history.recipeUnlocked.Contains(119);
|
_advancedMiningMachineUnlocked = GameMain.history.recipeUnlocked.Contains(119);
|
||||||
|
_miningMultiplier = OreMiningMultiplier.Value;
|
||||||
|
if (OreMiningScale.Value == 0)
|
||||||
|
{
|
||||||
|
_miningScale = _advancedMiningMachineUnlocked ? 300 : 100;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
_miningScale = OreMiningScale.Value;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void UpdateMiningCostRate()
|
private static void UpdateMiningCostRate()
|
||||||
@@ -163,11 +175,7 @@ public class Miner : PatchImpl<Miner>
|
|||||||
if (storage.count >= storage.max) continue;
|
if (storage.count >= storage.max) continue;
|
||||||
int amount;
|
int amount;
|
||||||
long energyConsume;
|
long energyConsume;
|
||||||
var miningScale = MiningScale.Value;
|
var miningScale = _miningScale;
|
||||||
if (miningScale == 0)
|
|
||||||
{
|
|
||||||
miningScale = _advancedMiningMachineUnlocked ? 300 : 100;
|
|
||||||
}
|
|
||||||
if (miningScale > 100 && storage.count * 2 > storage.max)
|
if (miningScale > 100 && storage.count * 2 > storage.max)
|
||||||
{
|
{
|
||||||
miningScale = 100 + ((miningScale - 100) * (storage.max - storage.count) * 2 + storage.max - 1) / storage.max;
|
miningScale = 100 + ((miningScale - 100) * (storage.max - storage.count) * 2 + storage.max - 1) / storage.max;
|
||||||
@@ -175,7 +183,7 @@ public class Miner : PatchImpl<Miner>
|
|||||||
|
|
||||||
if (itemIndex > 0)
|
if (itemIndex > 0)
|
||||||
{
|
{
|
||||||
(amount, energyConsume) = Mine(factory, veins, itemId, miningScale, (int)frameCounter, station.energy);
|
(amount, energyConsume) = Mine(factory, veins, itemId, miningScale, (int)frameCounter, _miningMultiplier, station.energy);
|
||||||
if (amount < 0) continue;
|
if (amount < 0) continue;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -242,7 +250,7 @@ public class Miner : PatchImpl<Miner>
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private static (int, long) Mine(PlanetFactory factory, ProductVeinData[] allVeins, int productId, int percent, int counter, long energyMax)
|
private static (int, long) Mine(PlanetFactory factory, ProductVeinData[] allVeins, int productId, int percent, int counter, int multiplier, long energyMax)
|
||||||
{
|
{
|
||||||
var veins = allVeins[productId - 1000];
|
var veins = allVeins[productId - 1000];
|
||||||
if (veins == null)
|
if (veins == null)
|
||||||
@@ -257,7 +265,7 @@ public class Miner : PatchImpl<Miner>
|
|||||||
/* if is Oil */
|
/* if is Oil */
|
||||||
if (productId == 1007)
|
if (productId == 1007)
|
||||||
{
|
{
|
||||||
energy = (OilEnergyConsume.Value * length * percent * percent + 9999L) / 10000L;
|
energy = OilEnergyConsume.Value * length;
|
||||||
if (energy > energyMax)
|
if (energy > energyMax)
|
||||||
return (-1, -1L);
|
return (-1, -1L);
|
||||||
var countf = 0f;
|
var countf = 0f;
|
||||||
@@ -266,8 +274,7 @@ public class Miner : PatchImpl<Miner>
|
|||||||
{
|
{
|
||||||
countf += veinsPool[veinIndices[i]].amount * 4 * VeinData.oilSpeedMultiplier;
|
countf += veinsPool[veinIndices[i]].amount * 4 * VeinData.oilSpeedMultiplier;
|
||||||
}
|
}
|
||||||
|
count = (int)(countf * (counter * percent) / 100f);
|
||||||
count = ((int)countf * counter * percent + 99) / 100;
|
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
return (-1, -1L);
|
return (-1, -1L);
|
||||||
barrier = _miningCostBarrierOil;
|
barrier = _miningCostBarrierOil;
|
||||||
@@ -275,7 +282,7 @@ public class Miner : PatchImpl<Miner>
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
count = (length * counter * percent + 99) / 100;
|
count = (length * multiplier * counter * percent + 99) / 100;
|
||||||
if (count == 0)
|
if (count == 0)
|
||||||
return (-1, -1L);
|
return (-1, -1L);
|
||||||
energy = (OreEnergyConsume.Value * veins.GroupCount * percent * percent + 9999L) / 10000L;
|
energy = (OreEnergyConsume.Value * veins.GroupCount * percent * percent + 9999L) / 10000L;
|
||||||
|
|||||||
Reference in New Issue
Block a user