wesnoth/data/schema/units/modifications.cfg
Celtic Minstrel 0c42cdc038
Enable translation mark validation by the schema (#5800)
- The t_string type is now a schema built-in type and no longer attempts a regex match.
- You can also specify that non-t_string types may be optionally-translatable; this case supports a regex match on the string (but note that the translation mark is not part of the match).
- Error messages involving keys with very large values ( > 128 characters) will now truncate the value.
- To account for occasional cases where the schema is intentionally violated, the --validate command-line option now automatically defines the SCHEMA_VALIDATION preprocessor define.

A key validates as type t_string if one of the following is true:
- The key is not present
- The key has at least one segment with a translation mark
- The key is blank (an empty string)

Any type other than t_string is not allowed to be translatable by default, unless you specify allow_translatable=yes in the [type] tag.

An optionally-translatable string could also be defined as a union of t_string and some other type.
2021-06-14 23:59:52 -04:00

245 lines
5.9 KiB
INI

[tag]
name="base"
{SIMPLE_KEY id string}
{DEFAULT_KEY generate_description bool yes}
[tag]
name="effect"
max=infinite
{REQUIRED_KEY apply_to string}
{DEFAULT_KEY times effect_times 1}
{FILTER_TAG "filter" unit ()}
[switch]
key=apply_to
[case]
value=new_attack
super="units/unit_type~core/attack"
[/case]
[case]
value=remove_attacks
super="$filter_weapon"
[/case]
[case]
value=attack
super="$filter_weapon"
{SIMPLE_KEY set_name string}
{SIMPLE_KEY set_description t_string}
{SIMPLE_KEY set_type string}
{SIMPLE_KEY set_icon string}
{SIMPLE_KEY set_range string}
{SIMPLE_KEY set_damage s_int}
{SIMPLE_KEY set_attacks s_int}
{SIMPLE_KEY set_parry s_int}
{SIMPLE_KEY set_accuracy s_int}
{SIMPLE_KEY set_movement_used s_int}
{SIMPLE_KEY increase_damage s_int_percent}
{SIMPLE_KEY increase_attacks s_int_percent}
{SIMPLE_KEY increase_parry s_int_percent}
{SIMPLE_KEY increase_accuracy s_int_percent}
{SIMPLE_KEY increase_movement_used s_int_percent}
{SIMPLE_KEY attack_weight s_real}
{SIMPLE_KEY defense_weight s_real}
{SIMPLE_KEY remove_specials string_list}
[tag]
name="set_specials"
super="units/unit_type~core/attack/specials"
{DEFAULT_KEY mode effect_set_special_mode replace}
[/tag]
[/case]
[case]
value=movement
{SIMPLE_KEY increase s_int_percent}
{SIMPLE_KEY set s_int}
{DEFAULT_KEY apply_to_vision s_bool yes}
[/case]
[case]
value=vision,jamming,experience,max_experience,recall_cost
{SIMPLE_KEY increase s_int_percent}
{SIMPLE_KEY set s_int}
[/case]
[case]
value=hitpoints
{SIMPLE_KEY increase s_int_percent}
{SIMPLE_KEY set s_int}
{DEFAULT_KEY heal_full s_bool yes}
{SIMPLE_KEY increase_total s_int_percent}
{SIMPLE_KEY set_total s_int}
{DEFAULT_KEY violate_maximum s_bool no}
[/case]
[case]
value=max_attacks
{SIMPLE_KEY increase s_int_percent}
[/case]
[case]
value=loyal
# Nothing allowed here
[/case]
[case]
value=fearless
# Nothing allowed here
[/case]
[case]
value=healthy
# Nothing allowed here
[/case]
[case]
value=movement_costs
{SIMPLE_KEY replace s_bool}
{LINK_TAG "units/movetype/movement_costs"}
[/case]
[case]
value=vision_costs
{SIMPLE_KEY replace s_bool}
{LINK_TAG "units/movetype/vision_costs"}
[/case]
[case]
value=jamming_costs
{SIMPLE_KEY replace s_bool}
{LINK_TAG "units/movetype/jamming_costs"}
[/case]
[case]
value=defense
{SIMPLE_KEY replace s_bool}
{LINK_TAG "units/movetype/defense"}
[/case]
[case]
value=resistance
{SIMPLE_KEY replace s_bool}
{LINK_TAG "units/movetype/resistance"}
[/case]
[case]
value=type,variation
{SIMPLE_KEY name string}
{SIMPLE_KEY heal_full s_bool}
[/case]
[case]
value=status
{SIMPLE_KEY add string_list}
{SIMPLE_KEY remove string_list}
[/case]
[case]
value=zoc
{SIMPLE_KEY value s_bool}
[/case]
[case]
value=profile
{SIMPLE_KEY portrait string}
{SIMPLE_KEY small_portrait string}
{SIMPLE_KEY description t_string}
[tag]
name="special_note"
max="infinite"
{REQUIRED_KEY note t_string}
{SIMPLE_KEY remove bool}
[/tag]
[/case]
[case]
value=new_ability,remove_ability
{LINK_TAG "units/unit_type/abilities"}
[/case]
[case]
value=new_animation
{SIMPLE_KEY id string}
{LINK_TAG "units/unit_type/animation"}
{LINK_TAG "units/unit_type/defend"}
{LINK_TAG "units/unit_type/death"}
{LINK_TAG "units/unit_type/standing_anim"}
{LINK_TAG "units/unit_type/movement_anim"}
{LINK_TAG "units/unit_type/idle_anim"}
{LINK_TAG "units/unit_type/attack_anim"}
{LINK_TAG "units/unit_type/victory_anim"}
{LINK_TAG "units/unit_type/pre_movement_anim"}
{LINK_TAG "units/unit_type/post_movement_anim"}
{LINK_TAG "units/unit_type/draw_weapon_anim"}
{LINK_TAG "units/unit_type/sheath_weapon_anim"}
{LINK_TAG "units/unit_type/leading_anim"}
{LINK_TAG "units/unit_type/recruit_anim"}
{LINK_TAG "units/unit_type/recruiting_anim"}
{LINK_TAG "units/unit_type/healing_anim"}
{LINK_TAG "units/unit_type/extra_anim"}
[/case]
[case]
value=image_mod
{SIMPLE_KEY replace string}
{SIMPLE_KEY add string}
{LINK_TAG "color_range"}
{LINK_TAG "color_palette"}
[/case]
[case]
value=overlay
{SIMPLE_KEY replace string}
{SIMPLE_KEY add string}
{SIMPLE_KEY remove string}
[/case]
[case]
value=ellipse
{SIMPLE_KEY ellipse string}
[/case]
[case]
value=halo
{SIMPLE_KEY halo string}
[/case]
[case]
value=alignment
{SIMPLE_KEY set alignment}
[/case]
[case]
value=new_advancement
{SIMPLE_KEY replace s_bool}
{SIMPLE_KEY types string_list}
{LINK_TAG "units/$modifications/advancement"}
[/case]
[case]
value=remove_advancement
{SIMPLE_KEY types string_list}
{SIMPLE_KEY amlas string_list}
[/case]
[else]
any_tag=yes
{ANY_KEY any}
[/else]
[/switch]
{WML_MERGE_KEYS}
[/tag]
{WML_MERGE_KEYS}
[/tag]
[tag]
name="trait"
max=infinite
super="units/$modifications/base"
{SIMPLE_KEY availability string} # TODO: Make this an enum type
{SIMPLE_KEY name t_string}
{SIMPLE_KEY male_name t_string}
{SIMPLE_KEY female_name t_string}
{SIMPLE_KEY description t_string}
{SIMPLE_KEY help_text t_string}
[/tag]
[tag]
name="advancement"
max=infinite
super="units/$modifications/base"
{SIMPLE_KEY strict_amla bool}
{SIMPLE_KEY major_amla bool} # Not documented
{SIMPLE_KEY exclude_amla string_list}
{SIMPLE_KEY require_amla string_list}
{SIMPLE_KEY max_times int}
{SIMPLE_KEY description t_string}
{SIMPLE_KEY image string}
{SIMPLE_KEY always_display bool} # Not documented
[/tag]
[tag]
name="object"
max=infinite
super="units/$modifications/base"
{SIMPLE_KEY duration object_duration}
{FILTER_TAG "filter" unit ()}
{ANY_KEY any}
[/tag]