Commit graph

106 commits

Author SHA1 Message Date
Celtic Minstrel
d090f91bce Alter the special notes syntax in EffectWML so that the note macros can be reused in that context 2019-10-04 23:49:05 -04:00
Severin Glöckner
b593e82cd2 schema: Use same definition as in actionwml 2019-10-02 05:59:58 +02:00
Severin Glöckner
664871bd14 add map_file to schema 2019-10-02 03:50:08 +02:00
Steve Cotton
96ffd65b68 PblWML schema: add the "dependencies" attribute
There's also a "translate" attribute which is missing in the schema,
this commit deliberately omits it as it was for WesCamp.

The commit comment in e6d1595f8 is wrong - the validator does complain
about the error fixed in that commit, I'd missed the --use-schema option.
2019-09-27 18:36:26 +02:00
Steve Cotton
e6d1595f86 Fix missing [/tag] in ServerPBL schema
The schema validator doesn't complain about this, but wmlxgettext does.
2019-09-27 17:47:46 +02:00
newfrenchy83
f6cc138c20 Fix grammatical error 2019-09-17 22:06:04 +11:00
Steve Cotton
af91654e26 Fix the build
Explicitly use t_str() to avoid an ambiguous construction from
7bee8ee157, which made GCC9 error out because it
could alternatively use t_string::t_string(const string &).

Resolve the merge conflict from 26d1ca7a7d
2019-09-15 22:55:05 +02:00
Celtic Minstrel
67ee332bbe Add a schema file for the _server.pbl 2019-09-15 13:40:54 -04:00
Celtic Minstrel
26d1ca7a7d Merge pull request #4351 from wesnoth/special_notes
Update to new special notes syntax in campaigns
2019-09-15 13:39:16 -04:00
Celtic Minstrel
7bee8ee157 Add special note support in [unit] and [effect]. 2019-09-15 13:19:17 -04:00
Celtic Minstrel
15f431785a Add [special_note] tag in [unit_type] as a neater way of specifying special notes for the unit's description 2019-09-12 08:51:05 -04:00
Celtic Minstrel
e1cabedc03 Add [special_note] tag in [unit_type] as a neater way of specifying special notes for the unit's description 2019-09-12 08:50:38 -04:00
Steve Cotton
06dd9a140c Add [find_path] option "nearest_by", and simple_find_path test
Adding this is issue 2 of #4177, changing the behavior when [find_path]
is given a SLF which matches multiple hexes.

The map and tests here should be easy enough for manually editing them. It
duplicates some of the functionality of the existing characterize_pathfinding
tests, however those tests need their expected values to be calculated and
can't be changed by hand.

'''nearest_by''': {DevFeature1.15|2} possible values "movement_cost"
(default), "steps", "hexes". If the [destination] SLF matches multiple hexes,
the one that would need the least movement points to reach may not be the one
that's closest as measured by '''hexes''', or closest as measured by steps,
from the starting point.

Behavior in 1.14 depended on which hex was checked first.
2019-09-11 11:17:56 +02:00
Steve Cotton
9792af39b8 Trigger an L4 deprecation message for [terrain_type]vision_alias=
The feature was never added, a deprecation message saying that it's been
removed is the closest option to the situation. While terrain.cpp itself
supports vision_alias, it was never added to the calculations in movetype.cpp,
therefore it never affected units' vision. It's also not shown in the help
about the terrain.

This doesn't affect the features of units having vision costs different to
movement costs, or of units having a different number of vision points to
movement points, both of which are still supported.

While I'd encourage anyone who wants to implement vision_alias to do so, at the
moment I feel that the still-supported features in the same area haven't been
explored yet, and that vision_alias isn't going to developed before 1.16.0 is
released.
2019-09-10 06:42:21 +02:00
Celtic Minstrel
a127eb07b3 Add a schema for the diff format 2019-08-30 23:36:32 -04:00
Steve Cotton
1c123fb3fa Allow '1-infinity' in ranges, and tighten the schema's validation of ranges
Fixes #4253.

The schema's validation of ranges now rejects negative numbers, because the C++
code doesn't support them (both before and after this commit):
* utils::parse_range("-7") will return {0,0}, because std::stoi("") throws invalid_argument.
* src/map/location.cpp will parse it as -7, but that will never match an on-map coordinate
2019-08-29 22:28:22 +02:00
Wedge009
ff772b1be8 Add game_created sound key
See #4260 for details.

[ci skip]
2019-08-27 13:41:01 +10:00
Steve Cotton
b2cd1cf6c3 Handle unit overlays as modifications, allow [effect] to remove them
Possible fix for #4058, with the following logic:

* If non-empty, [unit]overlay= is handled by adding modifications
* unit::write will always output an empty overlay=
* The Lua API's get_units() will still provide the list of overlays
* [effect]apply_to=overlay can now remove as well as add overlays
* [remove_unit_overlay] is implemented with [effect]apply_to=overlay

Using [object]s with durations hasn't been tested, but expected effects:
* An expired add= followed by a non-expired remove= will simply cause the remove=
    to have no effect when std::remove(overlays_ ...) is called.
* A remove= followed by [remove_unit_overlay] cause the [remove_unit_overlay] to be a no-op,
    and the overlay will reappear when the first remove= expires. This edge case is already
	documented as unsupported on the wiki.
2019-08-10 23:25:04 +02:00
Steve Cotton
0f948f793c Refactoring [movetype] to deprecate the "flies" key, use "flying" instead
This makes [movetype] consistent with [unit]. The code in movetype.cpp is used
for handling both of those tags and so already had support for "flying" in the
merge() and write() functions.

This shouldn't be backported to 1.14. For this reason, it also includes
handling the C++ todos to use C++14's std::make_unique.
2019-08-01 18:58:56 +02:00
sigurdfdragon
6e2fbc7b1a Schema: Fix travis error by allowing additional keys in two situations
1. Allow carryover_percentage & carryover_add with
victory_when_enemies_defeated=no. Code from newfrenchy83

2. Allow use of current_time in [time_area].
2019-07-02 23:19:38 -04:00
gfgtdf
daf054752a support item_name= in [store_items]
we use it in SotA16 to make the scenario more robust against
[modification]s that might add [item]s for decoration.
2019-03-20 20:27:33 +01:00
Celtic Minstrel
bfc997c91e 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.
2019-03-03 11:56:34 -05:00
newfrenchy83
7114174789 Fix #3811 negative value in heals ability
When multiple negative heal abilities are present, the game now
chooses the ability with the lowest value. The leadership ability
now also uses the same get_composite_value function that is also
used by most other abilities
2019-01-02 20:29:52 +01:00
mattsc
cf3be040ca Schema validation: add missing AI aspect 2018-12-03 18:19:44 -08:00
mattsc
f07897cba9 Schema validation: support Micro AI named location keys 2018-12-03 18:19:44 -08:00
mattsc
dca3fe71bb Schema validation: add new AI keys 2018-12-03 18:19:37 -08:00
mattsc
afb394c4b1
Merge pull request #3723 from mattsc/rca_ai_changes
Default AI changes
2018-12-02 08:42:42 -08:00
Celtic Minstrel
ea9fddcd23 Support [disallow_end_turn]reason= and use it in the tutorial 2018-11-24 17:46:29 -05:00
pentarctagon
7034c8f97b Run WML schema validation in travis. Fixes #3709
This adds running the WML schema validation in travis.  It also updates the schema itself and fixes a few WML errors so that core and all campaigns under all difficulties pass the schema validation.
2018-11-24 10:35:22 -06:00
Celtic Minstrel
e7903874ec Add new schema keys for the game config 2018-11-18 00:45:44 -05:00
mattsc
f53e3b9565 Schema validation: remove attack_depth aspect
It's been removed from the AI.
2018-11-16 06:45:40 -08:00
Celtic Minstrel
df4413ae66 Schema: Move list types into a separate config file 2018-11-04 18:37:51 -05:00
Celtic Minstrel
52c4dc0e3d Add a validator subclass specialized for validating WML schemas against the WML schema schema 2018-11-03 17:09:25 -04:00
Celtic Minstrel
4674e97eb6 Schema: Add a macro for links (and make use of it) 2018-10-23 22:49:53 -04:00
Celtic Minstrel
e3b17d3e9f GUI2 Schema: Make use of the key macros 2018-10-23 22:49:52 -04:00
Celtic Minstrel
844b20da40 GUI2 Schema: Use max=infinite instead of max=-1 2018-10-23 22:49:51 -04:00
Celtic Minstrel
e47ace53a9 Schema: Fix a couple more missing details 2018-10-23 22:49:43 -04:00
Celtic Minstrel
68bb024efe Schema: Accept variable substitution in [do_command] 2018-10-23 22:49:42 -04:00
Celtic Minstrel
bf814914e1 Schema: Fix some bugs in the [micro_ai] definition 2018-10-23 22:49:38 -04:00
Celtic Minstrel
a50a3f399b Schema: Accept [set_menu_item]use_hotkey=only 2018-10-23 22:49:35 -04:00
Celtic Minstrel
32a3dc5835 Schema: Accept logger=log as a synonym for logger=info 2018-10-23 22:49:34 -04:00
Celtic Minstrel
d70fee5afc Schema: Fix issue with matching [modify_ai] for attacks aspect 2018-10-23 22:49:32 -04:00
Celtic Minstrel
51764956e3 Schema: Fix typo in [store_unit] 2018-10-23 22:49:31 -04:00
Celtic Minstrel
3a3f0d25af Schema: Accept color ranges/palettes defined in [effect]apply_to=image_mod 2018-10-23 22:49:30 -04:00
Celtic Minstrel
61ee9bcf6b Schema: Don't fail if a map contains trailing or leading whitespace on lines 2018-10-23 22:49:29 -04:00
Celtic Minstrel
bc2054ec10 Schema: Fix some tags being allowed only once instead of unlimited times 2018-10-23 22:49:27 -04:00
Celtic Minstrel
66ae7f3b13 Schema: Accept variable substitution in [set_variable] root= and round= 2018-10-23 22:49:26 -04:00
Celtic Minstrel
ebc6285683 Schema: Allow variable substitution in [label] 2018-10-23 22:49:25 -04:00
Celtic Minstrel
2a5e8c7b41 Schema: side=global is valid in [*_global_variable] 2018-10-23 22:49:23 -04:00
Celtic Minstrel
604a3ec941 Schema: It turns out that [endlevel]bonus= is actually a real number! 2018-10-23 22:49:20 -04:00