Skip to content

Commit 66246e9

Browse files
[Magiclysm] Spellcasting profs adjustments (#82745)
* Add EoC to capture Difficulty/Cast time * Add jmath * Convert EoCs to jmath * Log change * Change from log to sqrt
1 parent 84f9934 commit 66246e9

File tree

2 files changed

+133
-24
lines changed

2 files changed

+133
-24
lines changed

data/mods/Magiclysm/effect_on_conditions/spellcasting/proficiencies.json

Lines changed: 109 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
11
[
2+
{
3+
"type": "effect_on_condition",
4+
"id": "EOC_MAGICLYSM_CAPTURE_DIFFICULTY_AND_CASTING_TIME",
5+
"eoc_type": "EVENT",
6+
"required_event": "spellcasting_finish",
7+
"effect": [
8+
{ "math": [ "u_last_spell_cast_difficulty = _difficulty" ] },
9+
{ "math": [ "u_last_spell_cast_casting_time = _cast_time" ] },
10+
{
11+
"math": [ "_adjustments = ( u_last_spell_cast_difficulty * (sqrt(u_last_spell_cast_casting_time / 100) ) )" ]
12+
},
13+
{
14+
"u_message": "Your last spell was Difficulty <u_val:last_spell_cast_difficulty> with casting time <u_val:last_spell_cast_casting_time>. The adjustments value is <context_val:adjustments>.",
15+
"type": "debug"
16+
}
17+
]
18+
},
219
{
320
"type": "effect_on_condition",
421
"id": "EOC_SPELLCASTING_EVOCATION_PROFICIENCY_ADD",
@@ -16,21 +33,29 @@
1633
"if": { "math": [ "u_proficiency('prof_magic_evocation_master', 'format': 'percent') >= 100" ] },
1734
"then": [ { "math": [ "u_prof_level = 3" ] }, { "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] } ],
1835
"else": [
19-
{ "math": [ "u_proficiency('prof_magic_evocation_master', 'format': 'percent') += rng(1,4) / 64" ] },
36+
{
37+
"math": [ "u_proficiency('prof_magic_evocation_master', 'format': 'percent') += casting_proficiency_master_xp_modifier()" ]
38+
},
2039
{ "math": [ "u_prof_level = 2" ] },
2140
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
2241
]
2342
}
2443
],
2544
"else": [
26-
{ "math": [ "u_proficiency('prof_magic_evocation_apprentice', 'format': 'percent') += rng(1,4) / 32" ] },
45+
{
46+
"math": [
47+
"u_proficiency('prof_magic_evocation_apprentice', 'format': 'percent') += casting_proficiency_apprentice_xp_modifier()"
48+
]
49+
},
2750
{ "math": [ "u_prof_level = 1" ] },
2851
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
2952
]
3053
}
3154
],
3255
"else": [
33-
{ "math": [ "u_proficiency('prof_magic_evocation_beginner', 'format': 'percent') += rng(1,4) / 16" ] },
56+
{
57+
"math": [ "u_proficiency('prof_magic_evocation_beginner', 'format': 'percent') += casting_proficiency_beginner_xp_modifier()" ]
58+
},
3459
{ "math": [ "u_prof_level = 0" ] },
3560
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
3661
]
@@ -54,21 +79,29 @@
5479
"if": { "math": [ "u_proficiency('prof_magic_channel_master', 'format': 'percent') >= 100" ] },
5580
"then": [ { "math": [ "u_prof_level = 3" ] }, { "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] } ],
5681
"else": [
57-
{ "math": [ "u_proficiency('prof_magic_channel_master', 'format': 'percent') += rng(1,4) / 64" ] },
82+
{
83+
"math": [ "u_proficiency('prof_magic_channel_master', 'format': 'percent') += casting_proficiency_master_xp_modifier()" ]
84+
},
5885
{ "math": [ "u_prof_level = 2" ] },
5986
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
6087
]
6188
}
6289
],
6390
"else": [
64-
{ "math": [ "u_proficiency('prof_magic_channel_apprentice', 'format': 'percent') += rng(1,4) / 32" ] },
91+
{
92+
"math": [
93+
"u_proficiency('prof_magic_channel_apprentice', 'format': 'percent') += casting_proficiency_apprentice_xp_modifier()"
94+
]
95+
},
6596
{ "math": [ "u_prof_level = 1" ] },
6697
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
6798
]
6899
}
69100
],
70101
"else": [
71-
{ "math": [ "u_proficiency('prof_magic_channel_beginner', 'format': 'percent') += rng(1,4) / 16" ] },
102+
{
103+
"math": [ "u_proficiency('prof_magic_channel_beginner', 'format': 'percent') += casting_proficiency_beginner_xp_modifier()" ]
104+
},
72105
{ "math": [ "u_prof_level = 0" ] },
73106
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
74107
]
@@ -92,21 +125,27 @@
92125
"if": { "math": [ "u_proficiency('prof_magic_summon_master', 'format': 'percent') >= 100" ] },
93126
"then": [ { "math": [ "u_prof_level = 3" ] }, { "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] } ],
94127
"else": [
95-
{ "math": [ "u_proficiency('prof_magic_summon_master', 'format': 'percent') += rng(1,4) / 64" ] },
128+
{
129+
"math": [ "u_proficiency('prof_magic_summon_master', 'format': 'percent') += casting_proficiency_master_xp_modifier()" ]
130+
},
96131
{ "math": [ "u_prof_level = 2" ] },
97132
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
98133
]
99134
}
100135
],
101136
"else": [
102-
{ "math": [ "u_proficiency('prof_magic_summon_apprentice', 'format': 'percent') += rng(1,4) / 32" ] },
137+
{
138+
"math": [ "u_proficiency('prof_magic_summon_apprentice', 'format': 'percent') += casting_proficiency_apprentice_xp_modifier()" ]
139+
},
103140
{ "math": [ "u_prof_level = 1" ] },
104141
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
105142
]
106143
}
107144
],
108145
"else": [
109-
{ "math": [ "u_proficiency('prof_magic_summon_beginner', 'format': 'percent') += rng(1,4) / 16" ] },
146+
{
147+
"math": [ "u_proficiency('prof_magic_summon_beginner', 'format': 'percent') += casting_proficiency_beginner_xp_modifier()" ]
148+
},
110149
{ "math": [ "u_prof_level = 0" ] },
111150
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
112151
]
@@ -130,21 +169,31 @@
130169
"if": { "math": [ "u_proficiency('prof_magic_enhancement_master', 'format': 'percent') >= 100" ] },
131170
"then": [ { "math": [ "u_prof_level = 3" ] }, { "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] } ],
132171
"else": [
133-
{ "math": [ "u_proficiency('prof_magic_enhancement_master', 'format': 'percent') += rng(1,4) / 64" ] },
172+
{
173+
"math": [ "u_proficiency('prof_magic_enhancement_master', 'format': 'percent') += casting_proficiency_master_xp_modifier()" ]
174+
},
134175
{ "math": [ "u_prof_level = 2" ] },
135176
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
136177
]
137178
}
138179
],
139180
"else": [
140-
{ "math": [ "u_proficiency('prof_magic_enhancement_apprentice', 'format': 'percent') += rng(1,4) / 32" ] },
181+
{
182+
"math": [
183+
"u_proficiency('prof_magic_enhancement_apprentice', 'format': 'percent') += casting_proficiency_apprentice_xp_modifier()"
184+
]
185+
},
141186
{ "math": [ "u_prof_level = 1" ] },
142187
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
143188
]
144189
}
145190
],
146191
"else": [
147-
{ "math": [ "u_proficiency('prof_magic_enhancement_beginner', 'format': 'percent') += rng(1,4) / 16" ] },
192+
{
193+
"math": [
194+
"u_proficiency('prof_magic_enhancement_beginner', 'format': 'percent') += casting_proficiency_beginner_xp_modifier()"
195+
]
196+
},
148197
{ "math": [ "u_prof_level = 0" ] },
149198
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
150199
]
@@ -168,21 +217,29 @@
168217
"if": { "math": [ "u_proficiency('prof_magic_enervation_master', 'format': 'percent') >= 100" ] },
169218
"then": [ { "math": [ "u_prof_level = 3" ] }, { "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] } ],
170219
"else": [
171-
{ "math": [ "u_proficiency('prof_magic_enervation_master', 'format': 'percent') += rng(1,4) / 64" ] },
220+
{
221+
"math": [ "u_proficiency('prof_magic_enervation_master', 'format': 'percent') += casting_proficiency_master_xp_modifier()" ]
222+
},
172223
{ "math": [ "u_prof_level = 2" ] },
173224
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
174225
]
175226
}
176227
],
177228
"else": [
178-
{ "math": [ "u_proficiency('prof_magic_enervation_apprentice', 'format': 'percent') += rng(1,4) / 32" ] },
229+
{
230+
"math": [
231+
"u_proficiency('prof_magic_enervation_apprentice', 'format': 'percent') += casting_proficiency_apprentice_xp_modifier()"
232+
]
233+
},
179234
{ "math": [ "u_prof_level = 1" ] },
180235
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
181236
]
182237
}
183238
],
184239
"else": [
185-
{ "math": [ "u_proficiency('prof_magic_enervation_beginner', 'format': 'percent') += rng(1,4) / 16" ] },
240+
{
241+
"math": [ "u_proficiency('prof_magic_enervation_beginner', 'format': 'percent') += casting_proficiency_beginner_xp_modifier()" ]
242+
},
186243
{ "math": [ "u_prof_level = 0" ] },
187244
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
188245
]
@@ -206,21 +263,29 @@
206263
"if": { "math": [ "u_proficiency('prof_magic_conveyance_master', 'format': 'percent') >= 100" ] },
207264
"then": [ { "math": [ "u_prof_level = 3" ] }, { "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] } ],
208265
"else": [
209-
{ "math": [ "u_proficiency('prof_magic_conveyance_master', 'format': 'percent') += rng(1,4) / 64" ] },
266+
{
267+
"math": [ "u_proficiency('prof_magic_conveyance_master', 'format': 'percent') += casting_proficiency_master_xp_modifier()" ]
268+
},
210269
{ "math": [ "u_prof_level = 2" ] },
211270
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
212271
]
213272
}
214273
],
215274
"else": [
216-
{ "math": [ "u_proficiency('prof_magic_conveyance_apprentice', 'format': 'percent') += rng(1,4) / 32" ] },
275+
{
276+
"math": [
277+
"u_proficiency('prof_magic_conveyance_apprentice', 'format': 'percent') += casting_proficiency_apprentice_xp_modifier()"
278+
]
279+
},
217280
{ "math": [ "u_prof_level = 1" ] },
218281
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
219282
]
220283
}
221284
],
222285
"else": [
223-
{ "math": [ "u_proficiency('prof_magic_conveyance_beginner', 'format': 'percent') += rng(1,4) / 16" ] },
286+
{
287+
"math": [ "u_proficiency('prof_magic_conveyance_beginner', 'format': 'percent') += casting_proficiency_beginner_xp_modifier()" ]
288+
},
224289
{ "math": [ "u_prof_level = 0" ] },
225290
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
226291
]
@@ -244,21 +309,31 @@
244309
"if": { "math": [ "u_proficiency('prof_magic_restoration_master', 'format': 'percent') >= 100" ] },
245310
"then": [ { "math": [ "u_prof_level = 3" ] }, { "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] } ],
246311
"else": [
247-
{ "math": [ "u_proficiency('prof_magic_restoration_master', 'format': 'percent') += rng(1,4) / 64" ] },
312+
{
313+
"math": [ "u_proficiency('prof_magic_restoration_master', 'format': 'percent') += casting_proficiency_master_xp_modifier()" ]
314+
},
248315
{ "math": [ "u_prof_level = 2" ] },
249316
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
250317
]
251318
}
252319
],
253320
"else": [
254-
{ "math": [ "u_proficiency('prof_magic_restoration_apprentice', 'format': 'percent') += rng(1,4) / 32" ] },
321+
{
322+
"math": [
323+
"u_proficiency('prof_magic_restoration_apprentice', 'format': 'percent') += casting_proficiency_apprentice_xp_modifier()"
324+
]
325+
},
255326
{ "math": [ "u_prof_level = 1" ] },
256327
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
257328
]
258329
}
259330
],
260331
"else": [
261-
{ "math": [ "u_proficiency('prof_magic_restoration_beginner', 'format': 'percent') += rng(1,4) / 16" ] },
332+
{
333+
"math": [
334+
"u_proficiency('prof_magic_restoration_beginner', 'format': 'percent') += casting_proficiency_beginner_xp_modifier()"
335+
]
336+
},
262337
{ "math": [ "u_prof_level = 0" ] },
263338
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
264339
]
@@ -282,21 +357,31 @@
282357
"if": { "math": [ "u_proficiency('prof_magic_transformation_master', 'format': 'percent') >= 100" ] },
283358
"then": [ { "math": [ "u_prof_level = 3" ] }, { "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] } ],
284359
"else": [
285-
{ "math": [ "u_proficiency('prof_magic_transformation_master', 'format': 'percent') += rng(1,4) / 64" ] },
360+
{
361+
"math": [ "u_proficiency('prof_magic_transformation_master', 'format': 'percent') += casting_proficiency_master_xp_modifier()" ]
362+
},
286363
{ "math": [ "u_prof_level = 2" ] },
287364
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
288365
]
289366
}
290367
],
291368
"else": [
292-
{ "math": [ "u_proficiency('prof_magic_transformation_apprentice', 'format': 'percent') += rng(1,4) / 32" ] },
369+
{
370+
"math": [
371+
"u_proficiency('prof_magic_transformation_apprentice', 'format': 'percent') += casting_proficiency_apprentice_xp_modifier()"
372+
]
373+
},
293374
{ "math": [ "u_prof_level = 1" ] },
294375
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
295376
]
296377
}
297378
],
298379
"else": [
299-
{ "math": [ "u_proficiency('prof_magic_transformation_beginner', 'format': 'percent') += rng(1,4) / 16" ] },
380+
{
381+
"math": [
382+
"u_proficiency('prof_magic_transformation_beginner', 'format': 'percent') += casting_proficiency_beginner_xp_modifier()"
383+
]
384+
},
300385
{ "math": [ "u_prof_level = 0" ] },
301386
{ "math": [ "u_prof_lowest = min(u_prof_level, u_prof_lowest)" ] }
302387
]

data/mods/Magiclysm/jmath.json

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,5 +40,29 @@
4040
"id": "transformation_proficiency_modifier",
4141
"num_args": 0,
4242
"return": "1 + ( (u_proficiency('prof_magic_transformation_beginner', 'format': 'percent') / 1000) + (u_proficiency('prof_magic_transformation_apprentice', 'format': 'percent') / 1000) + (u_proficiency('prof_magic_transformation_master', 'format': 'percent') / 1000) )"
43+
},
44+
{
45+
"type": "jmath_function",
46+
"id": "casting_proficiency_beginner_xp_modifier",
47+
"num_args": 0,
48+
"return": "(rng(1,4) / 16) * casting_proficiency_adjustments()"
49+
},
50+
{
51+
"type": "jmath_function",
52+
"id": "casting_proficiency_apprentice_xp_modifier",
53+
"num_args": 0,
54+
"return": "(rng(1,4) / 32) * casting_proficiency_adjustments()"
55+
},
56+
{
57+
"type": "jmath_function",
58+
"id": "casting_proficiency_master_xp_modifier",
59+
"num_args": 0,
60+
"return": "(rng(1,4) / 64) * casting_proficiency_adjustments()"
61+
},
62+
{
63+
"type": "jmath_function",
64+
"id": "casting_proficiency_adjustments",
65+
"num_args": 0,
66+
"return": "u_last_spell_cast_difficulty * (sqrt(u_last_spell_cast_casting_time / 100) )"
4367
}
4468
]

0 commit comments

Comments
 (0)