From 453b3de8f5b476b277c2ca2f4c643b4d5ed435a7 Mon Sep 17 00:00:00 2001 From: b3brodie Date: Sat, 14 Dec 2024 22:24:13 -0800 Subject: [PATCH] adjust existing eocs to meet new requirements --- .../mods/Magiclysm/eoc_spell_learn_boost.json | 17 +++++----------- .../eocs/spell_learning_eoc.json | 20 ++++++++++++++++--- data/mods/Xedra_Evolved/jmath.json | 7 ------- .../mods/Xedra_Evolved/spells/spell_eocs.json | 18 ++++++++++++----- 4 files changed, 35 insertions(+), 27 deletions(-) diff --git a/data/mods/Magiclysm/eoc_spell_learn_boost.json b/data/mods/Magiclysm/eoc_spell_learn_boost.json index f0a067466e09e..019448e906b9b 100644 --- a/data/mods/Magiclysm/eoc_spell_learn_boost.json +++ b/data/mods/Magiclysm/eoc_spell_learn_boost.json @@ -1,11 +1,4 @@ [ - { - "type": "jmath_function", - "id": "mc_spell_exp_diff", - "num_args": 1, - "//": "accept the spell level, return a difference in experience between spell's current level and the next level", - "return": "spell_exp_for_level(_0 + 1) - spell_exp_for_level(_0)" - }, { "type": "jmath_function", "id": "mc_spell_train_focus_factor", @@ -48,7 +41,7 @@ "math": [ "u_spell_exp(_spell)", "+=", - "mc_spell_exp_diff(u_spell_level(_spell)) / mc_spell_cost_train_factor(_cost, 16, 65) * mc_spell_train_focus_factor(u_val('focus'),u_spell_level(_spell))" + "(spell_exp_for_level(_spell, u_spell_level(_spell)+1) - spell_exp_for_level(_spell, u_spell_level(_spell))) / mc_spell_cost_train_factor(_cost, 16, 65) * mc_spell_train_focus_factor(u_val('focus'),u_spell_level(_spell))" ] } ] @@ -107,7 +100,7 @@ "math": [ "u_spell_exp(_spell)", "+=", - "mc_spell_exp_diff(u_spell_level(_spell)) / mc_spell_cost_train_factor(_cost, 20, 75) * mc_spell_train_focus_factor(u_val('focus'),u_spell_level(_spell))" + "(spell_exp_for_level(_spell, u_spell_level(_spell)+1) - spell_exp_for_level(_spell, u_spell_level(_spell))) / mc_spell_cost_train_factor(_cost, 20, 75) * mc_spell_train_focus_factor(u_val('focus'),u_spell_level(_spell))" ] } ] @@ -124,7 +117,7 @@ "math": [ "u_spell_exp(_spell)", "+=", - "mc_spell_exp_diff(u_spell_level(_spell)) * (_cost / 5000) * mc_spell_train_focus_factor(u_val('focus'),u_spell_level(_spell))" + "(spell_exp_for_level(_spell, u_spell_level(_spell)+1) - spell_exp_for_level(_spell, u_spell_level(_spell))) * (_cost / 5000) * mc_spell_train_focus_factor(u_val('focus'),u_spell_level(_spell))" ] } ] @@ -165,14 +158,14 @@ "math": [ "u_spell_exp(_spell)", "+=", - "mc_spell_exp_diff(u_spell_level(_spell)) / mc_spell_cost_train_factor(_cost, 16, 65) * mc_spell_train_focus_factor(u_val('focus'),u_spell_level(_spell))" + "(spell_exp_for_level(_spell, u_spell_level(_spell)+1) - spell_exp_for_level(_spell, u_spell_level(_spell))) / mc_spell_cost_train_factor(_cost, 16, 65) * mc_spell_train_focus_factor(u_val('focus'),u_spell_level(_spell))" ] }, { "math": [ "debug_mc_additional_spell_xp", "=", - "mc_spell_exp_diff(u_spell_level(_spell)) / mc_spell_cost_train_factor(_cost, 16, 65) * mc_spell_train_focus_factor(u_val('focus'),u_spell_level(_spell))" + "(spell_exp_for_level(_spell, u_spell_level(_spell)+1) - spell_exp_for_level(_spell, u_spell_level(_spell))) / mc_spell_cost_train_factor(_cost, 16, 65) * mc_spell_train_focus_factor(u_val('focus'),u_spell_level(_spell))" ] }, { "u_message": "debug_mc_additional_spell_xp: ", "type": "debug" } diff --git a/data/mods/Xedra_Evolved/eocs/spell_learning_eoc.json b/data/mods/Xedra_Evolved/eocs/spell_learning_eoc.json index 743fbba1acd90..52f7ea1bb4073 100644 --- a/data/mods/Xedra_Evolved/eocs/spell_learning_eoc.json +++ b/data/mods/Xedra_Evolved/eocs/spell_learning_eoc.json @@ -11,15 +11,29 @@ ] }, "effect": [ - { "math": [ "debug_xe_spell_exp_diff = (spell_exp_diff(u_spell_level(_spell)))" ] }, + { + "math": [ + "debug_xe_spell_exp_diff = spell_exp_for_level(_spell, u_spell_level(_spell)+1) - spell_exp_for_level(_spell, u_spell_level(_spell))" + ] + }, { "math": [ "debug_xe_spell_train_factor = (spell_train_factor(_cost))" ] }, - { "math": [ "debug_xe_spell_xp_give = spell_exp_diff(u_spell_level(_spell))/spell_train_factor(_cost)" ] }, + { + "math": [ + "debug_xe_spell_xp_give = (spell_exp_for_level(_spell, u_spell_level(_spell)+1) - spell_exp_for_level(_spell, u_spell_level(_spell)))/spell_train_factor(_cost)" + ] + }, { "u_message": "school: ", "type": "debug" }, { "u_message": "spell: ", "type": "debug" }, { "u_message": "spell_exp_diff: ", "type": "debug" }, { "u_message": "spell_train_factor: ", "type": "debug" }, { "u_message": "amount of XP added: ", "type": "debug" }, - { "math": [ "u_spell_exp(_spell)", "+=", "spell_exp_diff(u_spell_level(_spell))/spell_train_factor(_cost)" ] } + { + "math": [ + "u_spell_exp(_spell)", + "+=", + "(spell_exp_for_level(_spell, u_spell_level(_spell)+1) - spell_exp_for_level(_spell, u_spell_level(_spell)))/spell_train_factor(_cost)" + ] + } ] }, { diff --git a/data/mods/Xedra_Evolved/jmath.json b/data/mods/Xedra_Evolved/jmath.json index 45f0d1d676062..32552e168e7bd 100644 --- a/data/mods/Xedra_Evolved/jmath.json +++ b/data/mods/Xedra_Evolved/jmath.json @@ -18,13 +18,6 @@ "//": "used to transform the variable time (the smallest measure is 1 second) to the spell time (the smallest measure is 1 move, 1 second = 100 moves)", "return": "_0 * 100" }, - { - "type": "jmath_function", - "id": "spell_exp_diff", - "num_args": 1, - "//": "accept the spell level, return a difference in experience between spell's current level and the next level", - "return": "spell_exp_for_level(_0 + 1) - spell_exp_for_level(_0)" - }, { "type": "jmath_function", "id": "spell_train_factor", diff --git a/data/mods/Xedra_Evolved/spells/spell_eocs.json b/data/mods/Xedra_Evolved/spells/spell_eocs.json index 59b178a5d496c..99874658bf266 100644 --- a/data/mods/Xedra_Evolved/spells/spell_eocs.json +++ b/data/mods/Xedra_Evolved/spells/spell_eocs.json @@ -99,7 +99,7 @@ "math": [ "u_spell_exp('xedra_dreamer_generate_accelerated_time')", "+=", - "spell_exp_diff(u_spell_level('xedra_dreamer_generate_accelerated_time'))/spell_train_factor(200)" + "(spell_exp_for_level('xedra_dreamer_generate_accelerated_time', u_spell_level('xedra_dreamer_generate_accelerated_time')+1) - spell_exp_for_level('xedra_dreamer_generate_accelerated_time', u_spell_level('xedra_dreamer_generate_accelerated_time')))/spell_train_factor(200)" ] } ], @@ -143,7 +143,7 @@ "math": [ "u_spell_exp('spell_ethereal_wings')", "+=", - "spell_exp_diff(u_spell_level('spell_ethereal_wings'))/spell_train_factor(200)" + "(spell_exp_for_level('spell_ethereal_wings', u_spell_level('spell_ethereal_wings')+1) - spell_exp_for_level('spell_ethereal_wings', u_spell_level('spell_ethereal_wings')))/spell_train_factor(200)" ] } ], @@ -184,7 +184,11 @@ "time_in_future": { "math": [ "((u_spell_level('spell_karma_arms')+1)*500)" ] } }, { - "math": [ "u_spell_exp('spell_karma_arms')", "+=", "spell_exp_diff(u_spell_level('spell_karma_arms'))/spell_train_factor(200)" ] + "math": [ + "u_spell_exp('spell_karma_arms')", + "+=", + "(spell_exp_for_level('spell_karma_arms', u_spell_level('spell_karma_arms')+1) - spell_exp_for_level('spell_karma_arms', u_spell_level('spell_karma_arms')))/spell_train_factor(200)" + ] } ], "false_effect": [ @@ -218,7 +222,11 @@ "time_in_future": { "math": [ "((u_spell_level('spell_devil_tail')+1)*900)" ] } }, { - "math": [ "u_spell_exp('spell_devil_tail')", "+=", "spell_exp_diff(u_spell_level('spell_devil_tail'))/spell_train_factor(100)" ] + "math": [ + "u_spell_exp('spell_devil_tail')", + "+=", + "(spell_exp_for_level('spell_devil_tail', u_spell_level('spell_devil_tail')+1) - spell_exp_for_level('spell_devil_tail', u_spell_level('spell_devil_tail')))/spell_train_factor(100)" + ] } ], "false_effect": [ { "u_lose_trait": "devil_tail" }, { "u_message": "Your devil tail fades away.", "type": "neutral" } ] @@ -258,7 +266,7 @@ "math": [ "u_spell_exp('spell_stalker_eyes')", "+=", - "spell_exp_diff(u_spell_level('spell_stalker_eyes'))/spell_train_factor(200)" + "(spell_exp_for_level('spell_stalker_eyes', u_spell_level('spell_stalker_eyes')+1) - spell_exp_for_level('spell_stalker_eyes', u_spell_level('spell_stalker_eyes')))/spell_train_factor(200)" ] } ],