Skip to content

Commit b274dc4

Browse files
authored
Merge pull request #54974 from Ramza13/age-height
Add dialog functions for age, height and improve formatting of compare_int
2 parents 982f988 + 5074f1e commit b274dc4

25 files changed

+269
-277
lines changed

data/json/effect_on_condition.json

Lines changed: 7 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@
4646
"and": [
4747
{ "or": [ { "is_weather": "thunder" }, { "is_weather": "lightning" } ] },
4848
{ "one_in_chance": 50 },
49-
{ "compare_int": [ { "u_val": "pos_z" }, { "const": 0 } ], "op": ">=" }
49+
{ "compare_int": [ { "u_val": "pos_z" }, ">=", { "const": 0 } ] }
5050
]
5151
},
5252
"deactivate_condition": { "not": { "or": [ { "is_weather": "thunder" }, { "is_weather": "lightning" } ] } },
@@ -65,7 +65,7 @@
6565
"and": [
6666
{ "is_weather": "lightning" },
6767
{ "one_in_chance": 600 },
68-
{ "compare_int": [ { "u_val": "pos_z" }, { "const": 0 } ], "op": ">=" }
68+
{ "compare_int": [ { "u_val": "pos_z" }, ">=", { "const": 0 } ] }
6969
]
7070
},
7171
"deactivate_condition": { "not": { "is_weather": "lightning" } },
@@ -84,11 +84,7 @@
8484
"global": true,
8585
"run_for_npcs": true,
8686
"condition": {
87-
"and": [
88-
{ "is_weather": "acid_drizzle" },
89-
"u_is_outside",
90-
{ "compare_int": [ { "u_val": "pain" }, { "const": 30 } ], "op": "<" }
91-
]
87+
"and": [ { "is_weather": "acid_drizzle" }, "u_is_outside", { "compare_int": [ { "u_val": "pain" }, "<", { "const": 30 } ] } ]
9288
},
9389
"deactivate_condition": { "not": { "is_weather": "acid_drizzle" } },
9490
"effect": [
@@ -107,7 +103,7 @@
107103
"and": [
108104
{ "is_weather": "acid_rain" },
109105
"u_is_outside",
110-
{ "compare_int": [ { "u_val": "pain" }, { "const": 100 } ], "op": "<" },
106+
{ "compare_int": [ { "u_val": "pain" }, "<", { "const": 100 } ] },
111107
{
112108
"not": { "or": [ { "u_has_wielded_with_flag": "RAIN_PROTECT" }, { "u_has_worn_with_flag": "RAINPROOF" } ] }
113109
}
@@ -143,9 +139,7 @@
143139
"id": "bio_drain",
144140
"recurrence_min": "30 minutes",
145141
"recurrence_max": "1 hours 30 minutes",
146-
"condition": {
147-
"and": [ { "u_has_bionics": "bio_drain" }, { "compare_int": [ { "u_val": "power" }, { "power": "25 kJ" } ], "op": ">=" } ]
148-
},
142+
"condition": { "and": [ { "u_has_bionics": "bio_drain" }, { "compare_int": [ { "u_val": "power" }, ">=", { "power": "25 kJ" } ] } ] },
149143
"deactivate_condition": { "not": { "u_has_bionics": "bio_drain" } },
150144
"effect": [
151145
{ "u_message": "Your batteries discharge slightly.", "type": "bad" },
@@ -263,7 +257,7 @@
263257
"recurrence_min": "1 hours",
264258
"recurrence_max": "3 hours",
265259
"condition": {
266-
"and": [ { "u_has_bionics": "bio_shakes" }, { "compare_int": [ { "u_val": "power" }, { "power": "25 kJ" } ], "op": ">=" } ]
260+
"and": [ { "u_has_bionics": "bio_shakes" }, { "compare_int": [ { "u_val": "power" }, ">=", { "power": "25 kJ" } ] } ]
267261
},
268262
"deactivate_condition": { "not": { "u_has_bionics": "bio_shakes" } },
269263
"effect": [
@@ -282,7 +276,7 @@
282276
"and": [
283277
{ "u_has_bionics": "bio_glowy" },
284278
{ "not": { "u_has_effect": "glowy_led" } },
285-
{ "compare_int": [ { "u_val": "power" }, { "power": "1 kJ" } ], "op": ">=" }
279+
{ "compare_int": [ { "u_val": "power" }, ">=", { "power": "1 kJ" } ] }
286280
]
287281
},
288282
"deactivate_condition": { "not": { "u_has_bionics": "bio_glowy" } },

data/json/monster_special_attacks/spells.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@
445445
{
446446
"type": "effect_on_condition",
447447
"id": "EOC_absence_capture_attack",
448-
"condition": { "compare_int": [ { "distance": [ "u", "npc" ] }, { "const": 3 } ], "op": ">" },
448+
"condition": { "compare_int": [ { "distance": [ "u", "npc" ] }, ">", { "const": 3 } ] },
449449
"effect": [
450450
{ "u_location_variable": { "global_val": "portal_cage" } },
451451
{

data/json/mutations/mutations.json

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@
2727
"triggers": [
2828
[
2929
{
30-
"condition": { "compare_int": [ { "u_val": "morale" }, { "const": 20 } ], "op": ">" },
30+
"condition": { "compare_int": [ { "u_val": "morale" }, ">", { "const": 20 } ] },
3131
"msg_on": { "text": "You're so happy, you're glowing!", "rating": "mixed" }
3232
},
3333
{
34-
"condition": { "compare_int": [ { "u_val": "hunger" }, { "const": 110 } ], "op": ">" },
34+
"condition": { "compare_int": [ { "u_val": "hunger" }, ">", { "const": 110 } ] },
3535
"msg_on": { "text": "You're feeling hungry; time to lure some prey!", "rating": "mixed" }
3636
}
3737
]
@@ -49,11 +49,11 @@
4949
"triggers": [
5050
[
5151
{
52-
"condition": { "compare_int": [ { "u_val": "morale" }, { "const": 20 } ], "op": ">" },
52+
"condition": { "compare_int": [ { "u_val": "morale" }, ">", { "const": 20 } ] },
5353
"msg_off": { "text": "Your glow fades.", "rating": "mixed" }
5454
},
5555
{
56-
"condition": { "compare_int": [ { "u_val": "hunger" }, { "const": 110 } ], "op": ">" },
56+
"condition": { "compare_int": [ { "u_val": "hunger" }, ">", { "const": 110 } ] },
5757
"msg_off": { "text": "Your glow fades.", "rating": "mixed" }
5858
}
5959
]
@@ -137,18 +137,13 @@
137137
"triggers": [
138138
[
139139
{
140-
"condition": { "compare_int": [ { "u_val": "morale" }, { "const": -50 } ], "op": "<" },
140+
"condition": { "compare_int": [ { "u_val": "morale" }, "<", { "const": -50 } ] },
141141
"msg_on": { "text": "Everything is terrible and this makes you so ANGRY!", "rating": "mixed" }
142142
}
143143
],
144144
[
145145
{
146-
"condition": {
147-
"or": [
148-
{ "compare_int": [ { "u_val": "hour" }, { "const": 6 } ], "op": "<" },
149-
{ "compare_int": [ { "u_val": "hour" }, { "const": 21 } ], "op": ">" }
150-
]
151-
},
146+
"condition": { "or": [ { "compare_int": [ "hour", "<", { "const": 6 } ] }, { "compare_int": [ "hour", ">", { "const": 21 } ] } ] },
152147
"msg_on": { "text": "Everything is terrible and this makes you so ANGRY!", "rating": "mixed" }
153148
}
154149
]
@@ -167,12 +162,7 @@
167162
"triggers": [
168163
[
169164
{
170-
"condition": {
171-
"and": [
172-
{ "compare_int": [ { "u_val": "hour" }, { "const": 6 } ], "op": ">" },
173-
{ "compare_int": [ { "u_val": "hour" }, { "const": 21 } ], "op": "<" }
174-
]
175-
},
165+
"condition": { "and": [ { "compare_int": [ "hour", ">", { "const": 6 } ] }, { "compare_int": [ "hour", "<", { "const": 21 } ] } ] },
176166
"msg_on": { "text": "As the morning comes, you return back to normal.", "rating": "good" }
177167
}
178168
]
@@ -273,7 +263,7 @@
273263
"category": [ "INSECT", "TROGLOBITE", "RAT" ],
274264
"enchantments": [
275265
{
276-
"condition": { "compare_int": [ { "u_val": "pos_z" }, { "const": 0 } ], "op": "<" },
266+
"condition": { "compare_int": [ { "u_val": "pos_z" }, "<", { "const": 0 } ] },
277267
"values": [ { "value": "BONUS_BLOCK", "add": 1 }, { "value": "BONUS_DODGE", "add": 1 } ]
278268
}
279269
]
@@ -384,7 +374,7 @@
384374
"category": [ "BATRACHIAN" ],
385375
"enchantments": [
386376
{
387-
"condition": { "compare_int": [ { "u_val": "pos_z" }, { "const": 0 } ], "op": "<" },
377+
"condition": { "compare_int": [ { "u_val": "pos_z" }, "<", { "const": 0 } ] },
388378
"values": [ { "value": "SLEEPY", "add": 20 } ]
389379
}
390380
]

data/json/npcs/Backgrounds/OtherSurvivorStories/Brigitte_LaCroix_Background.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
"condition": {
1111
"and": [
1212
{
13-
"compare_int": [ { "npc_val": "var", "var_name": "direction", "type": "randomize", "context": "dialogue" }, { "const": 1 } ],
14-
"op": "="
13+
"compare_int": [ { "npc_val": "var", "var_name": "direction", "type": "randomize", "context": "dialogue" }, "=", { "const": 1 } ]
1514
},
1615
{ "npc_has_trait": "BOSS_Brigitte_LaCroix_01" },
1716
{

data/json/npcs/Backgrounds/OtherSurvivorStories/Lapin_01.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
"condition": {
1111
"and": [
1212
{
13-
"compare_int": [ { "npc_val": "var", "var_name": "direction", "type": "randomize", "context": "dialogue" }, { "const": 1 } ],
14-
"op": "="
13+
"compare_int": [ { "npc_val": "var", "var_name": "direction", "type": "randomize", "context": "dialogue" }, "=", { "const": 1 } ]
1514
},
1615
{ "npc_has_trait": "BOSS_Lapin_01" },
1716
{ "not": { "u_has_var": "directions", "type": "BOSS", "context": "mission", "value": "lapin" } }

data/json/npcs/Backgrounds/OtherSurvivorStories/NC_Farmer_background.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
"condition": {
1111
"and": [
1212
{
13-
"compare_int": [ { "npc_val": "var", "var_name": "direction", "type": "randomize", "context": "dialogue" }, { "const": 1 } ],
14-
"op": "="
13+
"compare_int": [ { "npc_val": "var", "var_name": "direction", "type": "randomize", "context": "dialogue" }, "=", { "const": 1 } ]
1514
},
1615
{ "npc_has_trait": "BOSS_NC_FARMER_01" },
1716
{ "not": { "u_has_var": "directions", "type": "BOSS", "context": "mission", "value": "farmer" } }

data/json/npcs/Backgrounds/OtherSurvivorStories/NC_SURVIVOR_CHEF_background.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@
1010
"condition": {
1111
"and": [
1212
{
13-
"compare_int": [ { "npc_val": "var", "var_name": "direction", "type": "randomize", "context": "dialogue" }, { "const": 1 } ],
14-
"op": "="
13+
"compare_int": [ { "npc_val": "var", "var_name": "direction", "type": "randomize", "context": "dialogue" }, "=", { "const": 1 } ]
1514
},
1615
{ "npc_has_trait": "BOSS_NC_SURVIVOR_CHEF_01" },
1716
{ "not": { "u_has_var": "directions", "type": "BOSS", "context": "mission", "value": "chef" } }

data/json/npcs/TALK_COMPUTER.json

Lines changed: 3 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -43,26 +43,16 @@
4343
"dynamic_line": "REFUGEE CENTER FOUND! IF YOU HAVE ANY FEEDBACK CONCERNING YOUR VISIT PLEASE CONTACT\n THE DEPARTMENT OF EMERGENCY MANAGEMENT PUBLIC AFFAIRS OFFICE.\n THE LOCAL OFFICE CAN BE REACHED BETWEEN THE HOURS OF 9AM AND\n 4PM AT 555-0164.\n\nIF YOU WOULD LIKE TO SPEAK WITH SOMEONE IN PERSON OR WOULD LIKE\nTO WRITE US A LETTER PLEASE SEND IT TO…",
4444
"responses": [
4545
{
46-
"condition": {
47-
"not": {
48-
"compare_int": [ { "global_val": "var", "var_name": "find_refugee_center", "type": "weather", "context": "ps" }, { "const": 1 } ],
49-
"op": "="
50-
}
51-
},
46+
"condition": { "not": { "compare_int": [ { "global_val": "var", "var_name": "find_refugee_center" }, "=", { "const": 1 } ] } },
5247
"text": "Make a note of the location.",
5348
"topic": "COMP_REFUGEE_CENTER_MAIN",
5449
"effect": [
5550
{ "assign_mission": "MISSION_REACH_REFUGEE_CENTER" },
56-
{
57-
"arithmetic": [ { "global_val": "var", "var_name": "find_refugee_center", "type": "weather", "context": "ps" }, "=", { "const": 1 } ]
58-
}
51+
{ "arithmetic": [ { "global_val": "var", "var_name": "find_refugee_center" }, "=", { "const": 1 } ] }
5952
]
6053
},
6154
{
62-
"condition": {
63-
"compare_int": [ { "global_val": "var", "var_name": "find_refugee_center", "type": "weather", "context": "ps" }, { "const": 1 } ],
64-
"op": "="
65-
},
55+
"condition": { "compare_int": [ { "global_val": "var", "var_name": "find_refugee_center" }, "=", { "const": 1 } ] },
6656
"text": "Press any key.",
6757
"topic": "COMP_REFUGEE_CENTER_MAIN"
6858
}

0 commit comments

Comments
 (0)