Multiply research
This commit is contained in:
@@ -16,6 +16,7 @@ namespace BlacksmithMaster {
|
|||||||
|
|
||||||
public static ConfigEntry<float> xpMultiplier;
|
public static ConfigEntry<float> xpMultiplier;
|
||||||
public static ConfigEntry<float> moneyMultiplier;
|
public static ConfigEntry<float> moneyMultiplier;
|
||||||
|
public static ConfigEntry<float> researchMultiplier;
|
||||||
|
|
||||||
public void Awake() {
|
public void Awake() {
|
||||||
debug = Config.Bind("General", "Debug", false);
|
debug = Config.Bind("General", "Debug", false);
|
||||||
@@ -26,6 +27,9 @@ namespace BlacksmithMaster {
|
|||||||
moneyMultiplier =
|
moneyMultiplier =
|
||||||
Config.Bind("General", "Money Multiplier", 1f,
|
Config.Bind("General", "Money Multiplier", 1f,
|
||||||
new ConfigDescription("Money Multiplier", new AcceptableValueRange<float>(0.01f, 1024f)));
|
new ConfigDescription("Money Multiplier", new AcceptableValueRange<float>(0.01f, 1024f)));
|
||||||
|
researchMultiplier = Config.Bind(
|
||||||
|
"General", "Research Multiplier", 1f,
|
||||||
|
new ConfigDescription("Research Multiplier", new AcceptableValueRange<float>(0.01f, 1024f)));
|
||||||
|
|
||||||
Logger.LogInfo("Cykasmith loaded");
|
Logger.LogInfo("Cykasmith loaded");
|
||||||
HarmonyFileLog.Enabled = true;
|
HarmonyFileLog.Enabled = true;
|
||||||
@@ -59,4 +63,14 @@ namespace BlacksmithMaster {
|
|||||||
Main.LogDebug("Modified money amount: " + value);
|
Main.LogDebug("Modified money amount: " + value);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[HarmonyPatch(typeof(ResourcesModel), "ChangeResearchPoints")]
|
||||||
|
public class ResourcesModel_ChangeResearchPoints {
|
||||||
|
public static void Prefix(ref int value) {
|
||||||
|
Main.LogDebug("Original research amount: " + value);
|
||||||
|
if (value > 0)
|
||||||
|
value = (int)((float)value * Main.researchMultiplier.Value);
|
||||||
|
Main.LogDebug("Modified research amount: " + value);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user