-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Arithmetic is dead. And compare_int. And compare_num. Kinda. Long live the math! #70936
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks a lot for doing this!
{ "u_val": "spell_level", "school": "test_trait" } - u_spell_level can't use school syntax yet
There's u_school_level()
. It was split from u_spell_level()
on purpose.
I lost track half way through, so I focused on the test errors. I'll take another look later.
Co-authored-by: andrei <[email protected]>
Co-authored-by: andrei <[email protected]>
{ "compare_int": [ { "faction_like": "old_guard" }, "<", { "const": -45 } ] }, | ||
{ "compare_num": [ { "u_val": "var", "var_name": "government_assassins_sent" }, "<=", { "const": 6 } ] }, | ||
{ "math": [ "u_val('faction_like: old_guard')", "<", "-45" ] }, | ||
{ "math": [ "government_assassins_sent", "<=", "6" ] }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ "math": [ "government_assassins_sent", "<=", "6" ] }, | |
{ "math": [ "u_government_assassins_sent", "<=", "6" ] }, |
@@ -375,7 +375,7 @@ | |||
"spawn_message": "A professional-looking individual steps out of hiding and begins rapidly approaching you.", | |||
"spawn_message_plural": "Professional-looking individuals step out of hiding and begin rapidly approaching you." | |||
}, | |||
{ "arithmetic": [ { "u_val": "var", "var_name": "government_assassins_sent" }, "+=", { "const": 2 } ] } | |||
{ "math": [ "government_assassins_sent", "+=", "2" ] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ "math": [ "government_assassins_sent", "+=", "2" ] } | |
{ "math": [ "u_government_assassins_sent", "+=", "2" ] } |
@@ -391,7 +391,7 @@ | |||
"spawn_message": "A professional-looking individual steps out of hiding and begins rapidly approaching you.", | |||
"spawn_message_plural": "Professional-looking individuals step out of hiding and begin rapidly approaching you." | |||
}, | |||
{ "arithmetic": [ { "u_val": "var", "var_name": "government_assassins_sent" }, "+=", { "const": 2 } ] } | |||
{ "math": [ "government_assassins_sent", "+=", "2" ] } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
{ "math": [ "government_assassins_sent", "+=", "2" ] } | |
{ "math": [ "u_government_assassins_sent", "+=", "2" ] } |
Summary
None
Purpose of change
Replace almost all instances of
arithmetic
,compare_int
andcompare_num
in favor of mathDescribe the solution
Search all places this three fields are met in the json, and replace them with
math
, where possibleFields that are not changed:
hour
,{ "time": "3 days" }
,time_since_cataclysm
,time_since_var
- anything that touches time{ "u_val": "spell_level", "school": "test_trait" }
- u_spell_level can't use school syntax yetu_school_level()
exists, apparentlymoon
- same as timeTesting
TBD
Additional context
I hope i ported all variables to math properly, but i would ask to doublecheck it
u_adjust_var
would be the next one methinks@TGWeaver you probably want to port this changes into your out of repo version of mod, so you won't accidentally overwrite it