Crazy Cataclysm widget modification #57956
NetSysFire
started this conversation in
Ideas
Replies: 1 comment 1 reply
-
You can do this with conditional clauses. That's actually how these were JSON-ified in the first place, and it's really easy to expand. You could do that with something like this: diff --git a/data/mods/CrazyCataclysm/crazy_widgets.json b/data/mods/CrazyCataclysm/crazy_widgets.json
index ea2484837a..3ac45dd2bd 100644
--- a/data/mods/CrazyCataclysm/crazy_widgets.json
+++ b/data/mods/CrazyCataclysm/crazy_widgets.json
@@ -76,7 +76,33 @@
"condition": {
"and": [
{ "compare_int": [ { "u_val": "bmi_permil" }, ">", { "const": 35000 } ] },
- { "compare_int": [ { "u_val": "bmi_permil" }, "<=", { "const": 40000 } ] }
+ { "compare_int": [ { "u_val": "bmi_permil" }, "<=", { "const": 40000 } ] },
+ { "not": { "u_has_trait": "THRESH_FELINE" } },
+ { "not": { "u_has_trait": "THRESH_LUPINE" } }
+ ]
+ }
+ },
+ {
+ "id": "very_obese",
+ "text": "Persian",
+ "color": "red",
+ "condition": {
+ "and": [
+ { "compare_int": [ { "u_val": "bmi_permil" }, ">", { "const": 35000 } ] },
+ { "compare_int": [ { "u_val": "bmi_permil" }, "<=", { "const": 40000 } ] },
+ { "u_has_trait": "THRESH_FELINE" }
+ ]
+ }
+ },
+ {
+ "id": "very_obese",
+ "text": "Good boi",
+ "color": "red",
+ "condition": {
+ "and": [
+ { "compare_int": [ { "u_val": "bmi_permil" }, ">", { "const": 35000 } ] },
+ { "compare_int": [ { "u_val": "bmi_permil" }, "<=", { "const": 40000 } ] },
+ { "u_has_trait": "THRESH_LUPINE" }
]
}
}, See the documentation for a (almost) full list of possible conditions. |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First of all, I hope to summon @wapcaplet, the jsonifier of the sidebar widgets, here since I think they can help me. This is most definitely not worthy of an issue, so I am using a discussion instead.
My plan is as follows:
Crazy Cataclysm replaces "very obese" with "Husky".
Cataclysm-DDA/data/mods/CrazyCataclysm/crazy_widgets.json
Lines 73 to 80 in 424215f
I want to replace that with "Persian" when the character has crossed the feline mutation threshold to make Crazy Cataclysm even more crazy. And maybe also replace "Husky" with "Good boi" when the player has crossed the lupine mutation threshold. But as far as I can see there is no variable for this and since this is more or less just a cosmetic minor edge case (like the mood faces), I do not even know if it is worth exposing another variable for something silly like this.
Beta Was this translation helpful? Give feedback.
All reactions