Add dodge window option
This commit is contained in:
@@ -15,15 +15,22 @@ namespace BanquetForCyka {
|
||||
|
||||
public static ConfigEntry<bool> debug;
|
||||
public static ConfigEntry<bool> debugXp;
|
||||
public static ConfigEntry<bool> debugDodgeWindow;
|
||||
|
||||
public static ExpressionConfigEntry xpMultiplier;
|
||||
public static ExpressionConfigEntry dodgeWindow;
|
||||
|
||||
public void Awake() {
|
||||
debug = Config.Bind("Debug", "Global Debug", false);
|
||||
debugXp = Config.Bind("Debug", "XP Debug", false);
|
||||
debugDodgeWindow = Config.Bind("Debug", "Dodge Window Debug", false);
|
||||
|
||||
xpMultiplier = new ExpressionConfigEntry(
|
||||
Config, "General", "XP Multiplier", "v*1",
|
||||
"XP Multiplier expression. Use 'v' to represent the original value.", debugXp);
|
||||
dodgeWindow = new ExpressionConfigEntry(
|
||||
Config, "General", "Dodge Window", "v*1",
|
||||
"Dodge Window expression. Use 'v' to represent the original value.", debugDodgeWindow);
|
||||
|
||||
Logger.LogInfo("BanquetForCyka loaded");
|
||||
HarmonyFileLog.Enabled = true;
|
||||
@@ -48,4 +55,14 @@ namespace BanquetForCyka {
|
||||
Main.LogDebug("Modified XP amount: " + amt, Main.debugXp);
|
||||
}
|
||||
}
|
||||
|
||||
[HarmonyPatch(typeof(Actions), "DodgeCalculation")]
|
||||
public class Actions_DodgeCalculation {
|
||||
public static void Postfix(ref float __result) {
|
||||
Main.LogDebug("Original dodge window: " + __result, Main.debugDodgeWindow);
|
||||
float result = Main.dodgeWindow.Evaluate(__result);
|
||||
__result = result;
|
||||
Main.LogDebug("Modified dodge window: " + __result, Main.debugDodgeWindow);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user