From b7937d32eb67ea8e956a0b8f393b98fcb1d072df Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Fri, 30 Mar 2018 16:43:31 -0400 Subject: [PATCH] Schema: Definition of [micro_ai] tag, including all known MicroAIs --- data/schema/core/actionwml.cfg | 254 +++++++++++++++++++++++++++++++++ data/schema/game_config.cfg | 4 + 2 files changed, 258 insertions(+) diff --git a/data/schema/core/actionwml.cfg b/data/schema/core/actionwml.cfg index 2c7e2f0d13d6..408c6419e75f 100644 --- a/data/schema/core/actionwml.cfg +++ b/data/schema/core/actionwml.cfg @@ -1146,5 +1146,259 @@ {ACTION_TAG "command" ()} [/tag] {EMPTY_TAG "break,continue,return" 0 infinite} + # The MicroAI tag is in a league of its own... + [tag] + name="micro_ai" + max=infinite + {INSERT_TAG} + {REQUIRED_KEY ai_type string} + {REQUIRED_KEY side s_unsigned} + {REQUIRED_KEY action micro_ai_action} + {SIMPLE_KEY ca_id string} + [switch] + key=ai_type + [case] + value=wolves + {FILTER_TAG "filter" unit min=1} + {FILTER_TAG "filter_second" unit min=1} + {DEFAULT_KEY attack_only_prey s_bool no} + {SIMPLE_KEY avoid_type string_list} + {DEFAULT_KEY ca_score s_unsigned 90000} + [/case] + [case] + value=wolves_multipacks + {DEFAULT_KEY ca_score s_unsigned 300000} + {DEFAULT_KEY pack_size s_unsigned 3} + {DEFAULT_KEY show_pack_number s_bool no} + {DEFAULT_KEY type string Wolf} + [/case] + [case] + value=big_animals + {FILTER_TAG "filter" unit min=1} + {DEFAULT_KEY ca_score s_unsigned 300000} + {FILTER_TAG "filter_location" location ()} + {FILTER_TAG "filter_location_wander" location ()} + {FILTER_TAG "avoid_unit" unit ()} + [/case] + [case] + value=forest_animals + {DEFAULT_KEY ca_score s_unsigned 300000} + {SIMPLE_KEY rabbit_type string} + {SIMPLE_KEY tusker_type string} + {SIMPLE_KEY tusklet_type string} + {SIMPLE_KEY deer_type string} + {FILTER_TAG "filter_location" location ()} + {DEFAULT_KEY rabbit_number s_unsigned 6} + {DEFAULT_KEY rabbit_enemy_distance s_unsigned 3} + {SIMPLE_KEY rabbit_hole_img string} + [/case] + [case] + value=herding + {FILTER_TAG "filter" unit min=1} + {FILTER_TAG "filter_second" unit min=1} + {FILTER_TAG "filter_location" location min=1} + {REQUIRED_KEY herd_x s_unsigned} + {REQUIRED_KEY herd_y s_unsigned} + {DEFAULT_KEY attention_distance s_unsigned 8} + {DEFAULT_KEY attack_distance s_unsigned 4} + {DEFAULT_KEY ca_score s_unsigned 300000} + [/case] + [case] + value=hunter + {FILTER_TAG "filter" unit min=1} + {DEPRECATED_KEY id string} + {REQUIRED_KEY home_x s_unsigned} + {REQUIRED_KEY home_y s_unsigned} + {DEFAULT_KEY ca_score s_unsigned 300000} + {FILTER_TAG "filter_location" location ()} + {DEFAULT_KEY rest_turns s_unsigned 3} + {DEFAULT_KEY show_messages s_bool no} + [/case] + [case] + value=swarm + {DEFAULT_KEY ca_score 300000} + {DEFAULT_KEY enemy_distance s_unsigned 5} + {DEFAULT_KEY scatter_distance s_unsigned 3} + {DEFAULT_KEY vision_distance s_unsigned 12} + [/case] + [case] + value=assassin + {FILTER_TAG "filter" unit min=1} + {FILTER_TAG "filter_second" unit min=1} + {FILTER_TAG "prefer" location ()} + [/case] + [case] + value=bottleneck_defense + {REQUIRED_KEY x range_list} + {REQUIRED_KEY y range_list} + {REQUIRED_KEY enemy_x range_list} + {REQUIRED_KEY enemy_y range_list} + {DEFAULT_KEY active_side_leader s_bool no} + {DEFAULT_KEY ca_score s_unsigned 300000} + {DEFAULT_KEY healer_x range_list} + {DEFAULT_KEY healer_y range_list} + {DEFAULT_KEY leadership_x range_list} + {DEFAULT_KEY leadership_y range_list} + [/case] + [case] + value=fast_ai + {DEFAULT_KEY attack_hidden_enemies s_bool no} + {DEFAULT_KEY dungeon_mode s_bool no} + {DEFAULT_KEY include_occupied_attack_hexes s_bool no} + {DEFAULT_KEY leader_weight s_unsigned 2} + {DEFAULT_KEY leader_additional_threat s_unsigned 1} + {DEFAULT_KEY leader_attack_max_units s_unsigned 3} + {DEFAULT_KEY move_cost_factor s_real 2} + {DEFAULT_KEY weak_units_first s_bool no} + {DEFAULT_KEY skip_combat_ca s_bool no} + {DEFAULT_KEY skip_move_ca s_bool no} + {DEFAULT_KEY threatened_leader_fights s_bool no} + {FILTER_TAG "avoid" location ()} + {FILTER_TAG "filter" unit ()} + {FILTER_TAG "filter_secont" unit ()} + [/case] + [case] + value=goto + {FILTER_TAG "filter_location" location min=1} + {DEFAULT_KEY avoid_enemies s_unsigned 0} + {DEFAULT_KEY ca_score s_unsigned 300000} + {DEFAULT_KEY ignore_enemy_at_goal s_bool no} + {DEFAULT_KEY ignore_units s_bool no} + {DEFAULT_KEY release_unit_at_goal s_bool no} + {DEFAULT_KEY release_all_units_at_goal s_bool no} + {DEFAULT_KEY unique_goals s_bool no} + {DEFAULT_KEY use_straight_line s_bool no} + {FILTER_TAG "filter" unit ()} + [/case] + [case] + value=return_guardian + {FILTER_TAG "filter" unit min=1} + {DEPRECATED_KEY id string} + {SIMPLE_KEY return_x s_unsigned} + {SIMPLE_KEY return_y s_unsigned} + {DEFAULT_KEY ca_score 100100} + [/case] + [case] + value=stationed_guardian + {FILTER_TAG "filter" unit min=1} + {DEPRECATED_KEY id string} + {REQUIRED_KEY distance s_unsigned} + {REQUIRED_KEY station_x s_unsigned} + {REQUIRED_KEY station_y s_unsigned} + {REQUIRED_KEY guard_x s_unsigned} + {REQUIRED_KEY guard_Y s_unsigned} + {DEFAULT_KEY ca_score s_unsigned 300000} + [/case] + [case] + value=coward + {FILTER_TAG "filter" unit min=1} + {DEPRECATED_KEY id string} + {REQUIRED_KEY distance s_unsigned} + {DEFAULT_KEY attack_if_trapped s_bool no} + {SIMPLE_KEY avoid_x s_unsigned} + {SIMPLE_KEY avoid_y s_unsigned} + {SIMPLE_KEY seek_x s_unsigned} + {SIMPLE_KEY seek_y s_unsigned} + {DEFAULT_KEY ca_score s_unsigned 300000} + {FILTER_TAG "filter_second" unit ()} + [/case] + [case] + value=zone_guardian + {FILTER_TAG "filter" unit min=1} + {FILTER_TAG "filter_location" location min=1} + {DEPRECATED_KEY id string} + {DEFAULT_KEY ca_score 300000} + {SIMPLE_KEY station_x s_unsigned} + {SIMPLE_KEY station_y s_unsigned} + {FILTER_TAG "filter_location_enemy" location ()} + [/case] + [case] + value=hang_out + {DEFAULT_KEY ca_score s_unsigned 170000} + {SIMPLE_KEY mobilize_on_gold_less_than s_unsigned} + {FILTER_TAG "avoid" location ()} + {FILTER_TAG "filter" unit ()} + {FILTER_TAG "filter_location" location ()} + [tag] + name="mobilize_condition" + super="$condition_wml" + [/tag] + [/case] + [case] + value=healer_support + {DEFAULT_KEY aggression s_real 1.0} + {DEFAULT_KEY injured_units_only s_bool no} + {DEFAULT_KEY max_threats s_unsigned 9999} + {FILTER_TAG "filter" unit ()} + {FILTER_TAG "filter_second" unit ()} + [/case] + [case] + value=lurkers + {FILTER_TAG "filter" unit min=1} + {FILTER_TAG "filter_location" location min=1} + {FILTER_TAG "filter_location_wander" location ()} + {DEFAULT_KEY ca_score s_unsigned 300000} + {DATA_TAG stationary s_bool no} + [/case] + [case] + value=messenger_escort + {FILTER_TAG "filter" unit min=1} + {DEPRECATED_KEY id string} + {REQUIRED_KEY waypoint_x range_list} + {REQUIRED_KEY waypoint_y range_list} + {DEFAULT_KEY ca_score s_unsigned 300000} + {DEFAULT_KEY enemy_death_chance s_real 0.67} + {DEFAULT_KEY messenger_death_chance s_bool 0.0} + {DEFAULT_KEY invert_order s_bool no} + {FILTER_TAG "filter_second" unit ()} + [/case] + [case] + value=patrol + {FILTER_TAG "filter" unit min=1} + {DEPRECATED_KEY id string} + {REQUIRED_KEY waypoint_x range_list} + {REQUIRED_KEY waypoint_y range_list} + {SIMPLE_KEY attack string_list} + {DEFAULT_KEY ca_score s_unsigned 300000} + {DEFAULT_KEY one_time_only s_bool no} + {DEFAULT_KEY out_and_back s_bool no} + [/case] + [case] + value=protect_unit + [tag] + name="unit" + min=1 + max=infinite + {REQUIRED_KEY id string} + {REQUIRED_KEY goal_x s_unsigned} + {REQUIRED_KEY goal_y s_unsigned} + [/tag] + {DEFAULT_KEY disable_move_leader_to_keep s_bool no} + [/case] + [case] + value=recruit_random + {DEFAULT_KEY ca_score s_unsigned 180000} + {DEFAULT_KEY skip_low_gold_recruit s_bool no} + [tag] + name="probability" + max=infinite + {REQUIRED_KEY type string_list} + {REQUIRED_KEY probability s_real} + [/tag] + [/case] + [case] + value=recruit_rushers + {DEFAULT_KEY ca_score s_unsigned 180000} + {DEFAULT_KEY randomness s_real 0.1} + [/case] + [case] + value=simple_attack + {DEFAULT_KEY ca_score s_unsigned 110000} + {DEFAULT_KEY weapon s_int -1} + {FILTER_TAG "filter" unit ()} + {FILTER_TAG "filter_second" unit ()} + [/case] + [/switch] + [/tag] any_tag=yes [/tag] diff --git a/data/schema/game_config.cfg b/data/schema/game_config.cfg index de1d5826198f..7f7a948584d1 100644 --- a/data/schema/game_config.cfg +++ b/data/schema/game_config.cfg @@ -319,6 +319,10 @@ [/type] [/union] [/type] + [type] + name="micro_ai_action" + value="add|delete|change" + [/type] [tag] name="root" min=1