From bfc997c91e51cab121b8001660c6a7d4f62d7fe0 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sun, 3 Mar 2019 11:55:46 -0500 Subject: [PATCH] Add various new features to the schema Addresses #3730 This is everything I could find by perusing the commit log. I may have missed something, however. --- data/schema/core/actionwml.cfg | 15 +++++++++++++-- data/schema/core/addons.cfg | 2 +- data/schema/core/conditionalwml.cfg | 1 + data/schema/filters/location.cfg | 2 +- data/schema/filters/unit.cfg | 2 ++ data/schema/game_config.cfg | 11 +++++++---- data/schema/units/abilities.cfg | 20 ++++++++++++++++++++ 7 files changed, 45 insertions(+), 8 deletions(-) diff --git a/data/schema/core/actionwml.cfg b/data/schema/core/actionwml.cfg index c71c4aa3b027..bb7a644ec1de 100644 --- a/data/schema/core/actionwml.cfg +++ b/data/schema/core/actionwml.cfg @@ -190,6 +190,7 @@ {FILTER_TAG "filter" unit {INSERT_TAG}} {SIMPLE_KEY x s_int} {SIMPLE_KEY y s_int} + {SIMPLE_KEY location_id string} {DEFAULT_KEY clear_shroud s_bool yes} {DEFAULT_KEY animate s_bool no} {DEFAULT_KEY check_passability s_bool yes} @@ -202,6 +203,7 @@ {SIMPLE_KEY y s_int} {SIMPLE_KEY mask map_data} {SIMPLE_KEY mask_file string} + {SIMPLE_KEY alignment mask_alignment} {DEFAULT_KEY border s_bool no} [tag] name="rule" @@ -248,6 +250,7 @@ {DEFAULT_KEY animate s_bool yes} {SIMPLE_KEY x s_coordinates} {SIMPLE_KEY y s_coordinates} + {SIMPLE_KEY location_id string} [/tag] [tag] name="allow_recruit,disallow_recruit,set_recruit" @@ -343,6 +346,8 @@ {SIMPLE_KEY to_x s_range_list} {SIMPLE_KEY to_y s_range_list} {SIMPLE_KEY to_location string} + {SIMPLE_KEY dir dir_list} + {DEFAULT_KEY clear_shroud s_bool no} {DEFAULT_KEY fire_event s_bool no} {DEFAULT_KEY check_passability s_bool yes} {SIMPLE_KEY force_scroll s_bool} @@ -485,7 +490,8 @@ name="replace_map" max=infinite {INSERT_TAG} - {SIMPLE_KEY map map_data} + {DEPRECATED_KEY map map_data} + {SIMPLE_KEY map_data map_data} {SIMPLE_KEY map_file string} {DEFAULT_KEY expand s_bool no} {DEFAULT_KEY shrink s_bool no} @@ -550,6 +556,7 @@ {SIMPLE_KEY value string} {SIMPLE_KEY x s_int} {SIMPLE_KEY y s_int} + {SIMPLE_KEY location_id string} [tag] name="from" {SIMPLE_KEY x s_int} @@ -621,6 +628,8 @@ {DEFAULT_KEY highlight s_bool yes} {SIMPLE_KEY sound string_list} {SIMPLE_KEY voice string_list} + {SIMPLE_KEY male_voice string_list} + {SIMPLE_KEY female_voice string_list} {SIMPLE_KEY variable string} {FORMATTING_KEYS} {SHOW_IF_TAG} @@ -732,6 +741,7 @@ {SIMPLE_KEY name string} # Override some supertag keys to allow variable substitutions {DEFAULT_KEY visible_in_fog s_bool yes} + {FILTER_TAG "filter_side" side ()} [/tag] [tag] name="remove_item" @@ -1197,13 +1207,14 @@ {SIMPLE_KEY facing dir} {SIMPLE_KEY x s_coordinates} {SIMPLE_KEY y s_coordinates} + {SIMPLE_KEY location_id string} [/tag] [/tag] [tag] name="random_placement" max=infinite {INSERT_TAG} - {REQUIRED_KEY num_items f_unsigned,s_unsigned} + {REQUIRED_KEY num_items f_unsigned,s_unsigned,s_int_percent} {REQUIRED_KEY variable string} {DEFAULT_KEY min_distance s_unsigned 0} {DEFAULT_KEY allow_less s_bool no} diff --git a/data/schema/core/addons.cfg b/data/schema/core/addons.cfg index e75b912f1c2d..557ea0a921f1 100644 --- a/data/schema/core/addons.cfg +++ b/data/schema/core/addons.cfg @@ -117,7 +117,6 @@ {SIMPLE_KEY terrain_liked terrain_list} [/tag] -# TODO: Is [event] really allowed at toplevel, outside a [scenario] or [era]? [tag] name="event" max=infinite @@ -458,6 +457,7 @@ {SIMPLE_KEY image string} {SIMPLE_KEY mask string} {SIMPLE_KEY lawful_bonus int} + {SIMPLE_KEY liminal_bonus int} {SIMPLE_KEY red int} {SIMPLE_KEY green int} {SIMPLE_KEY blue int} diff --git a/data/schema/core/conditionalwml.cfg b/data/schema/core/conditionalwml.cfg index d1f69f349abe..198ca9f465ed 100644 --- a/data/schema/core/conditionalwml.cfg +++ b/data/schema/core/conditionalwml.cfg @@ -36,6 +36,7 @@ {SIMPLE_KEY less_than_equal_to string} {SIMPLE_KEY boolean_equals string} {SIMPLE_KEY boolean_not_equals string} + {SIMPLE_KEY formula formula} [/tag] [tag] name="found_item" diff --git a/data/schema/filters/location.cfg b/data/schema/filters/location.cfg index a928e07b4763..9186df30cd8e 100644 --- a/data/schema/filters/location.cfg +++ b/data/schema/filters/location.cfg @@ -14,7 +14,7 @@ {SIMPLE_KEY radius s_int} {SIMPLE_KEY formula formula} {SIMPLE_KEY lua_function string} - {SIMPLE_KEY location_id string} + {SIMPLE_KEY location_id string_list} {FILTER_TAG "filter" unit ()} {FILTER_TAG "filter_owner" side ()} diff --git a/data/schema/filters/unit.cfg b/data/schema/filters/unit.cfg index 7fcbb17ba0ce..84b83dfd508f 100644 --- a/data/schema/filters/unit.cfg +++ b/data/schema/filters/unit.cfg @@ -31,6 +31,8 @@ {SIMPLE_KEY lua_function string} {SIMPLE_KEY ai_special string} {SIMPLE_KEY recall_cost s_range_list} + {SIMPLE_KEY usage string} + {SIMPLE_KEY alignment alignment} [tag] name="filter_wml" diff --git a/data/schema/game_config.cfg b/data/schema/game_config.cfg index 8e0ec7b41a68..0b0dce53712a 100644 --- a/data/schema/game_config.cfg +++ b/data/schema/game_config.cfg @@ -88,6 +88,11 @@ name=alignment value="lawful|neutral|chaotic|liminal" [/type] + [type] + name=mask_alignment + value="even|odd" + # TODO: Document the third option once we finalize its name + [/type] [type] name=ai_usage value="scout|fighter|archer|mixed fighter|healer|null" @@ -388,10 +393,8 @@ [tag] name="lua" max=infinite - [key] - name="code" - type="string" - [/key] + {SIMPLE_KEY name string} + {SIMPLE_KEY code string} {DATA_TAG args 0 1} [/tag] [/tag] diff --git a/data/schema/units/abilities.cfg b/data/schema/units/abilities.cfg index f6299bbe3f06..39448081450c 100644 --- a/data/schema/units/abilities.cfg +++ b/data/schema/units/abilities.cfg @@ -1,4 +1,13 @@ +#define BASED_ON_SPECIAL NAME + [tag] + name={NAME} + max=infinite + super="units/unit_type/attack/specials/" + {NAME} + {FILTER_TAG "filter_student" unit ()} + [/tag] +#enddef + [tag] # Using invalid characters to ensure it doesn't match a real tag. name="~generic~" @@ -69,12 +78,16 @@ name="resistance" max=infinite super="units/unit_type/abilities/~value~" + {FILTER_TAG "filter_weapon" weapon ()} + {FILTER_TAG "filter_second_weapon" weapon ()} [/tag] [tag] name="leadership" max=infinite super="units/unit_type/abilities/~generic~" {SIMPLE_KEY value f_int} + {FILTER_TAG "filter_weapon" weapon ()} + {FILTER_TAG "filter_second_weapon" weapon ()} [/tag] [tag] name="illuminates" @@ -119,8 +132,15 @@ super="units/unit_type/abilities/~generic~" {FILTER_TAG "filter_second_weapon" weapon ()} [/tag] +{BASED_ON_SPECIAL "attacks"} +{BASED_ON_SPECIAL "chance_to_hit"} +{BASED_ON_SPECIAL "damage"} +{BASED_ON_SPECIAL "drains"} +{BASED_ON_SPECIAL "berserk"} [tag] name="*" max=infinite super="units/unit_type/abilities/~generic~" [/tag] + +#undef BASED_ON_SPECIAL