Add xp patch
This commit is contained in:
@@ -14,10 +14,12 @@ namespace TavernDave {
|
||||
|
||||
public static ConfigEntry<float> moneyMultiplier;
|
||||
public static ConfigEntry<int> fastSpeed;
|
||||
public static ConfigEntry<float> staffXpMultiplier;
|
||||
|
||||
public void Awake() {
|
||||
moneyMultiplier = Config.Bind("General", "MoneyMultiplier", 1f);
|
||||
fastSpeed = Config.Bind("General", "FastSpeed", 1);
|
||||
staffXpMultiplier = Config.Bind("General", "StaffXpMultiplier", 1f);
|
||||
|
||||
Logger.LogInfo("Cyka mod loaded");
|
||||
HarmonyFileLog.Enabled = true;
|
||||
@@ -52,5 +54,15 @@ namespace TavernDave {
|
||||
Console.WriteLine($"Game speed modified to {gameSpeed}");
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(StaffModel), "UpdateXp")]
|
||||
public static void PrefixXp(ref int id, ref int amount) {
|
||||
Console.WriteLine($"Staff xp is {amount}");
|
||||
if (amount > 0) {
|
||||
amount = (int)(amount * Main.staffXpMultiplier.Value);
|
||||
Console.WriteLine($"Staff xp modified to {amount}");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user