108 lines
4.1 KiB
C#
108 lines
4.1 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
using CykaOfQud;
|
|
using HarmonyLib;
|
|
using XRL.World;
|
|
|
|
namespace CykaOfIndustry {
|
|
[HarmonyPatch]
|
|
public class Patches {
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch(typeof(XRL.World.Parts.Experience), "HandleEvent")]
|
|
static void xpMultiplier(ref AwardedXPEvent E) {
|
|
if (Main.debugMode.Value)
|
|
Console.WriteLine("CykaOfQud: AwardedXPEvent: Old XP {0}", E.Amount);
|
|
E.Amount = (int)(E.Amount * Main.xpMultiplier.Value);
|
|
if (Main.debugMode.Value)
|
|
Console.WriteLine("CykaOfQud: AwardedXPEvent: New XP {0}", E.Amount);
|
|
}
|
|
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch(typeof(XRL.World.Parts.Leveler), "AddHitpoints")]
|
|
static void hitpointsPerLevelMultiplier(StringBuilder sb, ref int HPGain) {
|
|
if (Main.debugMode.Value)
|
|
Console.WriteLine("CykaOfQud: AddHitpoints: Old HP for level {0}", HPGain);
|
|
if (HPGain == 0)
|
|
HPGain = 1;
|
|
HPGain = (int)(HPGain * Main.hitpointsPerLevelMultiplier.Value);
|
|
if (Main.debugMode.Value)
|
|
Console.WriteLine("CykaOfQud: AddHitpoints: New HP for level {0}", HPGain);
|
|
}
|
|
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch(typeof(XRL.World.Parts.Leveler), "AddSkillPoints")]
|
|
static void skillPointsPerLevelMultiplier(StringBuilder sb, ref int SPGain) {
|
|
if (Main.debugMode.Value)
|
|
Console.WriteLine("CykaOfQud: AddSkillPoints: Old SP for level {0}", SPGain);
|
|
if (SPGain == 0)
|
|
SPGain = 1;
|
|
SPGain = (int)(SPGain * Main.skillPointsPerLevelMultiplier.Value);
|
|
if (Main.debugMode.Value)
|
|
Console.WriteLine("CykaOfQud: AddSkillPoints: New SP for level {0}", SPGain);
|
|
}
|
|
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch(typeof(XRL.World.Parts.Leveler), "AddMutationPoints")]
|
|
static void mutationPointsPerLevelMultiplier(StringBuilder sb, ref int MPGain) {
|
|
if (Main.debugMode.Value)
|
|
Console.WriteLine("CykaOfQud: AddMutationPoints: Old MP for level {0}", MPGain);
|
|
if (MPGain == 0)
|
|
MPGain = 1;
|
|
MPGain = (int)(MPGain * Main.mutationPointsPerLevelMultiplier.Value);
|
|
if (Main.debugMode.Value)
|
|
Console.WriteLine("CykaOfQud: AddMutationPoints: New MP for level {0}", MPGain);
|
|
}
|
|
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch(typeof(XRL.World.Parts.Leveler), "AddAttributePoints")]
|
|
static void attributePointsPerLevelMultiplier(StringBuilder sb, ref int APGain) {
|
|
if (Main.debugMode.Value)
|
|
Console.WriteLine("CykaOfQud: AddAttributePoints: Old AP for level {0}", APGain);
|
|
if (APGain == 0)
|
|
APGain = 1;
|
|
APGain = (int)(APGain * Main.attributePointsPerLevelMultiplier.Value);
|
|
if (Main.debugMode.Value)
|
|
Console.WriteLine("CykaOfQud: AddAttributePoints: New AP for level {0}", APGain);
|
|
}
|
|
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch(typeof(XRL.World.Parts.Leveler), "AddAttributeBonus")]
|
|
static void attributeBonusPerLevelMultiplier(StringBuilder sb, ref int ABGain) {
|
|
if (Main.debugMode.Value)
|
|
Console.WriteLine("CykaOfQud: AddAttributeBonus: Old AB for level {0}", ABGain);
|
|
ABGain = (int)(ABGain * Main.attributeBonusPerLevelMultiplier.Value);
|
|
if (ABGain == 0)
|
|
ABGain = 2;
|
|
if (Main.debugMode.Value)
|
|
Console.WriteLine("CykaOfQud: AddAttributeBonus: New AB for level {0}", ABGain);
|
|
}
|
|
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch(typeof(XRL.World.Parts.BitLocker), "AddBits")]
|
|
static void disassemblyBonusMultiplier(ref string Bits) {
|
|
if (Main.debugMode.Value)
|
|
Console.WriteLine("CykaOfQud: AddBits: Old {0}", Bits);
|
|
|
|
StringBuilder output = new StringBuilder();
|
|
foreach (char c in Bits) {
|
|
output.Append(new string(c, (int)Math.Ceiling(Main.disassemblyBonusMultiplier.Value)));
|
|
}
|
|
Bits = output.ToString();
|
|
|
|
if (Main.debugMode.Value)
|
|
Console.WriteLine("CykaOfQud: AddBits: New {0}", Bits);
|
|
}
|
|
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch(typeof(XRL.World.Parts.BitLocker), "AddAllBits")]
|
|
static void addAllBits(ref int num) {
|
|
if (Main.debugMode.Value)
|
|
Console.WriteLine("CykaOfQud: AddAllBits: Old {0}", num);
|
|
num = (int)(num * Main.disassemblyBonusMultiplier.Value);
|
|
if (Main.debugMode.Value)
|
|
Console.WriteLine("CykaOfQud: AddAllBits: New {0}", num);
|
|
}
|
|
}
|
|
}
|