Add xp multiplier maybe
This commit is contained in:
Binary file not shown.
@@ -3,6 +3,7 @@ using BepInEx;
|
||||
using BepInEx.Configuration;
|
||||
using HarmonyLib;
|
||||
using HarmonyLib.Tools;
|
||||
using MGSC;
|
||||
|
||||
namespace Quasimorph {
|
||||
[BepInPlugin(PluginGuid, PluginName, PluginVersion)]
|
||||
@@ -21,7 +22,7 @@ namespace Quasimorph {
|
||||
Config.Bind("General", "Scrapping Multiplier", 1,
|
||||
new ConfigDescription("Scrapping Multiplier", new AcceptableValueRange<int>(1, 10000)));
|
||||
xpMultiplier =
|
||||
Config.Bind("General", "XP Multiplier", 1,
|
||||
Config.Bind("General", "XP Multiplier", 1f,
|
||||
new ConfigDescription("XP Multiplier", new AcceptableValueRange<float>(0.01f, 100f)));
|
||||
|
||||
Logger.LogInfo("Quasicyka loaded");
|
||||
@@ -31,5 +32,15 @@ namespace Quasimorph {
|
||||
var originalMethods = harmony.GetPatchedMethods();
|
||||
Logger.LogInfo("Patched " + originalMethods.Count() + " methods");
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(Perk), nameof(Perk.AddExp))]
|
||||
[HarmonyPrefix]
|
||||
public static void AddExp(ref int val) {
|
||||
if (debug.Value)
|
||||
Console.WriteLine($"Before: {val}");
|
||||
val = (int)((float)val * scrappingMultiplier.Value);
|
||||
if (debug.Value)
|
||||
Console.WriteLine($"After: {val}");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user