Add xp multiplier
This commit is contained in:
@@ -2,18 +2,19 @@
|
||||
using System.Text;
|
||||
using CykaOfQud;
|
||||
using HarmonyLib;
|
||||
using XRL.World;
|
||||
|
||||
namespace CykaOfIndustry {
|
||||
[HarmonyPatch]
|
||||
public class Patches {
|
||||
[HarmonyPostfix]
|
||||
[HarmonyPatch(typeof(XRL.World.Parts.Leveler), "GetXPForLevel")]
|
||||
static void xpPerLevelMultiplier(ref int __result) {
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(XRL.World.Parts.Experience), "HandleEvent")]
|
||||
static void xpMultiplier(ref AwardedXPEvent E) {
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("CykaOfQud: Old XP for level {0}", __result);
|
||||
__result = (int)(__result * Main.xpPerLevelMultiplier.Value);
|
||||
Console.WriteLine("CykaOfQud: Old XP {0}", E.Amount);
|
||||
E.Amount = (int)(E.Amount * Main.xpMultiplier.Value);
|
||||
if (Main.debugMode.Value)
|
||||
Console.WriteLine("CykaOfQud: New XP for level {0}", __result);
|
||||
Console.WriteLine("CykaOfQud: New XP {0}", E.Amount);
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
|
||||
Reference in New Issue
Block a user