Skip to content

Commit

Permalink
Improve dialog functions handling of min max. (CleverRaven#55352)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ramza13 authored Feb 17, 2022
1 parent 7b044a9 commit 106e58b
Show file tree
Hide file tree
Showing 16 changed files with 232 additions and 249 deletions.
58 changes: 20 additions & 38 deletions data/json/effect_on_condition.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,7 @@
{
"type": "effect_on_condition",
"id": "thunder",
"recurrence_min": 1,
"recurrence_max": 1,
"recurrence": 1,
"global": true,
"condition": {
"and": [
Expand All @@ -58,8 +57,7 @@
{
"type": "effect_on_condition",
"id": "lightning",
"recurrence_min": 1,
"recurrence_max": 1,
"recurrence": 1,
"global": true,
"condition": {
"and": [
Expand All @@ -73,14 +71,13 @@
{ "u_message": "A flash of lightning illuminates your surroundings!" },
{ "sound_effect": "thunder_near", "id": "environment" },
"lightning",
{ "custom_light_level": 100, "length_min": "1 seconds", "length_max": "1 seconds" }
{ "custom_light_level": 100, "length": [ "1 seconds", "1 seconds" ] }
]
},
{
"type": "effect_on_condition",
"id": "acid_drizzle",
"recurrence_min": 1,
"recurrence_max": 1,
"recurrence": 1,
"global": true,
"run_for_npcs": true,
"condition": {
Expand All @@ -95,8 +92,7 @@
{
"type": "effect_on_condition",
"id": "acid_rain",
"recurrence_min": 1,
"recurrence_max": 1,
"recurrence": 1,
"global": true,
"run_for_npcs": true,
"condition": {
Expand All @@ -115,8 +111,7 @@
{
"type": "effect_on_condition",
"id": "snow",
"recurrence_min": 6,
"recurrence_max": 6,
"recurrence": 6,
"global": true,
"run_for_npcs": true,
"condition": { "and": [ { "is_weather": "snowing" }, "u_is_outside" ] },
Expand All @@ -126,8 +121,7 @@
{
"type": "effect_on_condition",
"id": "snowstorm",
"recurrence_min": 6,
"recurrence_max": 6,
"recurrence": 6,
"global": true,
"run_for_npcs": true,
"condition": { "and": [ { "is_weather": "snowstorm" }, "u_is_outside" ] },
Expand All @@ -137,8 +131,7 @@
{
"type": "effect_on_condition",
"id": "bio_drain",
"recurrence_min": "30 minutes",
"recurrence_max": "1 hours 30 minutes",
"recurrence": [ "30 minutes", "1 hours 30 minutes" ],
"condition": { "and": [ { "u_has_bionics": "bio_drain" }, { "compare_int": [ { "u_val": "power" }, ">=", { "power": "25 kJ" } ] } ] },
"deactivate_condition": { "not": { "u_has_bionics": "bio_drain" } },
"effect": [
Expand All @@ -160,17 +153,15 @@
{
"type": "effect_on_condition",
"id": "ambient_subway",
"recurrence_min": "1 hours",
"recurrence_max": "2 hours",
"recurrence": [ "1 hours", "2 hours" ],
"global": true,
"condition": { "or": [ { "u_at_om_location": "subway_ns" }, { "u_at_om_location": "subway_ew" } ] },
"effect": [ { "u_message": "<AMBIENT_SUBWAY>", "snippet": true, "sound": true } ]
},
{
"type": "effect_on_condition",
"id": "ambient_lab_subway",
"recurrence_min": "1 hours",
"recurrence_max": "2 hours",
"recurrence": [ "1 hours", "2 hours" ],
"global": true,
"condition": { "or": [ { "u_at_om_location": "lab_subway_ns" }, { "u_at_om_location": "lab_subway_ew" } ] },
"effect": [ { "u_message": "AMBIENT_LAB_SUBWAY", "snippet": true, "sound": true } ]
Expand All @@ -182,14 +173,13 @@
"deactivate_condition": { "not": { "or": [ { "u_has_trait": "PROF_HUB01_ANCILLIARY" }, { "u_has_effect": "robofac_surveillance" } ] } },
"effect": [
{ "u_spawn_monster": "mon_robofac_camspy", "real_count": 1, "min_radius": 15, "max_radius": 40, "outdoor_only": true },
{ "queue_eocs": "eoc_robofac_surveillance", "time_in_future_min": "1 days", "time_in_future_max": "7 days" }
{ "queue_eocs": "eoc_robofac_surveillance", "time_in_future": [ "1 days", "7 days" ] }
]
},
{
"type": "effect_on_condition",
"id": "bio_trip",
"recurrence_min": "25 minutes",
"recurrence_max": "1 hours 15 minutes",
"recurrence": [ "25 minutes", "1 hours 15 minutes" ],
"condition": {
"and": [
{ "u_has_bionics": "bio_trip" },
Expand All @@ -206,8 +196,7 @@
{
"type": "effect_on_condition",
"id": "mut_eyestalk",
"recurrence_min": "2 hours 15 minutes",
"recurrence_max": "10 hours 15 minutes",
"recurrence": [ "2 hours 15 minutes", "10 hours 15 minutes" ],
"condition": {
"and": [
{ "u_has_trait": "EYESTALKS1" },
Expand All @@ -224,8 +213,7 @@
{
"type": "effect_on_condition",
"id": "bio_spasm",
"recurrence_min": "2 hours 30 minutes",
"recurrence_max": "7 hours 30 minutes",
"recurrence": [ "2 hours 30 minutes", "7 hours 30 minutes" ],
"condition": {
"and": [
{ "u_has_bionics": "bio_spasm" },
Expand All @@ -244,8 +232,7 @@
{
"type": "effect_on_condition",
"id": "bio_shakes",
"recurrence_min": "1 hours",
"recurrence_max": "3 hours",
"recurrence": [ "1 hours", "3 hours" ],
"condition": {
"and": [ { "u_has_bionics": "bio_shakes" }, { "compare_int": [ { "u_val": "power" }, ">=", { "power": "25 kJ" } ] } ]
},
Expand All @@ -260,8 +247,7 @@
{
"type": "effect_on_condition",
"id": "bio_glowy",
"recurrence_min": "25 minutes",
"recurrence_max": "1 hours 15 minutes",
"recurrence": [ "25 minutes", "1 hours 15 minutes" ],
"condition": {
"and": [
{ "u_has_bionics": "bio_glowy" },
Expand All @@ -279,17 +265,15 @@
{
"type": "effect_on_condition",
"id": "bio_sleepy",
"recurrence_min": "25 minutes",
"recurrence_max": "1 hours 15 minutes",
"recurrence": [ "25 minutes", "1 hours 15 minutes" ],
"condition": { "and": [ { "u_has_bionics": "bio_sleepy" }, { "not": { "u_has_effect": "sleep" } } ] },
"deactivate_condition": { "not": { "u_has_bionics": "bio_sleepy" } },
"effect": [ { "arithmetic": [ { "u_val": "fatigue" }, "++" ] } ]
},
{
"type": "effect_on_condition",
"id": "bio_itchy",
"recurrence_min": "25 minutes",
"recurrence_max": "1 hours 15 minutes",
"recurrence": [ "25 minutes", "1 hours 15 minutes" ],
"condition": { "and": [ { "u_has_bionics": "bio_itchy" }, { "not": { "u_has_effect": "formication" } } ] },
"deactivate_condition": { "not": { "u_has_bionics": "bio_itchy" } },
"effect": [
Expand All @@ -300,8 +284,7 @@
{
"type": "effect_on_condition",
"id": "bio_noise",
"recurrence_min": "30 minutes",
"recurrence_max": "1 hours 30 minutes",
"recurrence": [ "30 minutes", "1 hours 30 minutes" ],
"condition": { "and": [ { "u_has_bionics": "bio_noise" }, { "not": { "u_has_effect": "narcosis" } } ] },
"deactivate_condition": { "not": { "u_has_bionics": "bio_noise" } },
"effect": [
Expand Down Expand Up @@ -331,8 +314,7 @@
{
"type": "effect_on_condition",
"id": "bio_leaky",
"recurrence_min": "3 minutes",
"recurrence_max": "9 minutes",
"recurrence": [ "3 minutes", "9 minutes" ],
"condition": { "u_has_bionics": "bio_leaky" },
"deactivate_condition": { "not": { "u_has_bionics": "bio_leaky" } },
"effect": [ { "u_mod_healthy": -1, "cap": -200 } ]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@
{
"type": "effect_on_condition",
"id": "lab_security_check",
"recurrence_min": 1,
"recurrence_max": 1,
"recurrence": 1,
"condition": {
"and": [ { "u_at_om_location": "lab_1x1x2_RES_8_apartments_lower" }, { "not": { "u_has_item": "id_science_medical_red" } } ]
},
Expand All @@ -19,8 +18,7 @@
{
"type": "effect_on_condition",
"id": "lab_security_check_surface_3",
"recurrence_min": 5,
"recurrence_max": 30,
"recurrence": [ 5, 30 ],
"condition": {
"and": [ { "u_at_om_location": "lab_res_8_SWU_ground" }, { "not": { "u_has_item": "id_science_maintenance_green" } } ]
},
Expand All @@ -29,8 +27,7 @@
{
"type": "effect_on_condition",
"id": "lab_security_check_surface_2",
"recurrence_min": 5,
"recurrence_max": 30,
"recurrence": [ 5, 30 ],
"condition": {
"and": [ { "u_at_om_location": "lab_res_8_SWD_ground" }, { "not": { "u_has_item": "id_science_maintenance_green" } } ]
},
Expand All @@ -53,8 +50,7 @@
{
"type": "effect_on_condition",
"id": "lab_security_check_surface_1",
"recurrence_min": 1,
"recurrence_max": 1,
"recurrence": 1,
"condition": {
"and": [ { "u_at_om_location": "lab_CORE_2x1_WC_ground" }, { "not": { "u_has_item": "id_science_maintenance_green" } } ]
},
Expand Down Expand Up @@ -94,8 +90,7 @@
{
"type": "effect_on_condition",
"id": "lab_check_magenta_security_drop",
"recurrence_min": 3,
"recurrence_max": 5,
"recurrence": [ 3, 5 ],
"condition": {
"and": [
{ "u_at_om_location": "lab_security_z-1" },
Expand Down Expand Up @@ -123,8 +118,7 @@
{
"type": "effect_on_condition",
"id": "lab_1x1x2_RES_8_check_SEC",
"recurrence_min": 5,
"recurrence_max": 10,
"recurrence": [ 5, 10 ],
"condition": {
"and": [ { "u_at_om_location": "lab_1x1_RES_8_commons_SEC" }, { "not": { "u_has_item": "id_science_security_yellow" } } ]
},
Expand All @@ -146,8 +140,7 @@
{
"type": "effect_on_condition",
"id": "lab_1x1x2_RES_8_check_MAINT",
"recurrence_min": 5,
"recurrence_max": 10,
"recurrence": [ 5, 10 ],
"condition": {
"and": [ { "u_at_om_location": "lab_1x1_RES_8_commons_MAINT" }, { "not": { "u_has_item": "id_science_maintenance_yellow" } } ]
},
Expand All @@ -169,8 +162,7 @@
{
"type": "effect_on_condition",
"id": "lab_concourse_bot_release",
"recurrence_min": 5,
"recurrence_max": 10,
"recurrence": [ 5, 10 ],
"condition": {
"and": [
{ "u_at_om_location": "lab_CORE_2x1_1DN" },
Expand Down Expand Up @@ -221,8 +213,7 @@
{
"type": "effect_on_condition",
"id": "lab_concourse_bot_release_2",
"recurrence_min": 5,
"recurrence_max": 10,
"recurrence": [ 5, 10 ],
"condition": {
"and": [
{ "u_at_om_location": "lab_CORE_2x1_2DN" },
Expand Down Expand Up @@ -273,8 +264,7 @@
{
"type": "effect_on_condition",
"id": "lab_magenta_security_check",
"recurrence_min": 15,
"recurrence_max": 30,
"recurrence": [ 15, 30 ],
"condition": { "and": [ { "u_at_om_location": "lab_security_z-5" }, { "not": { "u_has_item": "id_science_security_magenta" } } ] },
"effect": [ { "mapgen_update": "release_bots_4", "om_terrain": "lab_security_z-5" } ]
},
Expand All @@ -293,8 +283,7 @@
{
"type": "effect_on_condition",
"id": "lab_cyan_mutagen_check",
"recurrence_min": 15,
"recurrence_max": 30,
"recurrence": [ 15, 30 ],
"condition": { "and": [ { "u_at_om_location": "lab_2x2_MUT_tier_2_NE" }, { "not": { "u_has_item": "id_science_mutagen_cyan" } } ] },
"effect": [ { "mapgen_update": "release_bots_5", "om_terrain": "lab_2x2_MUT_tier_2_NE" } ]
},
Expand All @@ -308,8 +297,7 @@
{
"type": "effect_on_condition",
"id": "lab_cyan_mutagen_check_2",
"recurrence_min": 15,
"recurrence_max": 30,
"recurrence": [ 15, 30 ],
"condition": {
"and": [ { "u_at_om_location": "lab_2x2_MUT_tier_2_NW_final_flr" }, { "not": { "u_has_item": "id_science_mutagen_cyan" } } ]
},
Expand All @@ -325,8 +313,7 @@
{
"type": "effect_on_condition",
"id": "lab_cyan_mutagen_check_3",
"recurrence_min": 15,
"recurrence_max": 30,
"recurrence": [ 15, 30 ],
"condition": { "and": [ { "u_at_om_location": "lab_2x2_MUT_tier_2_SW" }, { "not": { "u_has_item": "id_science_mutagen_cyan" } } ] },
"effect": [ { "mapgen_update": "release_bots_7", "om_terrain": "lab_2x2_MUT_tier_2_SW" } ]
},
Expand All @@ -340,8 +327,7 @@
{
"type": "effect_on_condition",
"id": "lab_cyan_mutagen_check_4",
"recurrence_min": 15,
"recurrence_max": 30,
"recurrence": [ 15, 30 ],
"condition": { "and": [ { "u_at_om_location": "lab_2x2_MUT_tier_2_SE" }, { "not": { "u_has_item": "id_science_mutagen_cyan" } } ] },
"effect": [ { "mapgen_update": "release_bots_8", "om_terrain": "lab_2x2_MUT_tier_2_SE" } ]
},
Expand All @@ -355,32 +341,28 @@
{
"type": "effect_on_condition",
"id": "lab_pink_mutagen_check",
"recurrence_min": 15,
"recurrence_max": 30,
"recurrence": [ 15, 30 ],
"condition": { "and": [ { "u_at_om_location": "lab_2x2_MUT_tier_1_NE" }, { "not": { "u_has_item": "id_science_mutagen_pink" } } ] },
"effect": [ { "mapgen_update": "release_bots_5", "om_terrain": "lab_2x2_MUT_tier_1_NE" } ]
},
{
"type": "effect_on_condition",
"id": "lab_pink_mutagen_check_2",
"recurrence_min": 15,
"recurrence_max": 30,
"recurrence": [ 15, 30 ],
"condition": { "and": [ { "u_at_om_location": "lab_2x2_MUT_tier_1_NW" }, { "not": { "u_has_item": "id_science_mutagen_pink" } } ] },
"effect": [ { "mapgen_update": "release_bots_6", "om_terrain": "lab_2x2_MUT_tier_1_NW" } ]
},
{
"type": "effect_on_condition",
"id": "lab_pink_mutagen_check_3",
"recurrence_min": 15,
"recurrence_max": 30,
"recurrence": [ 15, 30 ],
"condition": { "and": [ { "u_at_om_location": "lab_2x2_MUT_tier_1_SW" }, { "not": { "u_has_item": "id_science_mutagen_pink" } } ] },
"effect": [ { "mapgen_update": "release_bots_7", "om_terrain": "lab_2x2_MUT_tier_1_SW" } ]
},
{
"type": "effect_on_condition",
"id": "lab_pink_mutagen_check_4",
"recurrence_min": 15,
"recurrence_max": 30,
"recurrence": [ 15, 30 ],
"condition": { "and": [ { "u_at_om_location": "lab_2x2_MUT_tier_1_SE" }, { "not": { "u_has_item": "id_science_mutagen_pink" } } ] },
"effect": [ { "mapgen_update": "release_bots_8", "om_terrain": "lab_2x2_MUT_tier_1_SE" } ]
}
Expand Down
3 changes: 1 addition & 2 deletions data/json/monster_special_attacks/spells.json
Original file line number Diff line number Diff line change
Expand Up @@ -457,8 +457,7 @@
"u_transform_radius": 2,
"ter_furn_transform": "portal_cage_revert_transform",
"target_var": { "global_val": "portal_cage" },
"time_in_future_min": "3 seconds",
"time_in_future_max": "5 seconds"
"time_in_future": [ "3 seconds", "5 seconds" ]
},
{ "u_message": "All the empty space around you is suddenly even emptier than should be possible." }
],
Expand Down
2 changes: 1 addition & 1 deletion data/json/mutations/mutation_eocs.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"effect": [
{ "u_assign_activity": "ACT_GENERIC_EOC", "duration": "3 seconds" },
{ "arithmetic": [ { "u_val": "stamina" }, "-=", { "const": 700 } ] },
{ "queue_eocs": [ "EOC_BIOLUM3_cast" ], "time_in_future_min": 2, "time_in_future_max": 2 }
{ "queue_eocs": [ "EOC_BIOLUM3_cast" ], "time_in_future": 2 }
],
"false_effect": [ { "u_message": "You don't have enough stamina to activate your Bioluminescent Flare.", "type": "bad" } ]
},
Expand Down
Loading

0 comments on commit 106e58b

Please sign in to comment.