Commit graph

273 commits

Author SHA1 Message Date
Lukas Jox
6dd916283c add modify_unit tags added in 1.15.3 to schema validation 2020-05-20 14:16:58 +02:00
Glen Whitney
f3a472ab96 Modify GUI2 config files to scale font size with screen pixel pitch
These changes to the data/gui subdirectories make it so that above a certain
  screen pixel dimensions (currently 1200x900), text font sizes will be scaled
  with the pixel pitch of the SDL video device. In addition, several dialogues
  (such as the unit recall window, for example) are allowed to take on larger
  pixel dimensions to accommodate the larger (in pixel size) fonts.
2020-05-16 15:01:01 -05:00
newfrenchy83
3a62c923f4
adding resistance_anim to shema validation (#4617)
* add resistance anim to shema validation

If a day, a resistance abilities applied to adjacent unit is added in the core, with a proper animation, it can be validated.
2020-04-19 21:31:22 -05:00
Pentarctagon
9a0b95f9a0 Separate unit test results from scenario victory/defeat.
This adds an additional `test_result` attribute to [endlevel], intended for use with the automated unit tests. This allows for the unit tests to differentiate a pass/fail result separately from scenario victory or defeat, which allows for more accurately determining the outcome of a test as well as addresses the potential, for example, for a scenario to be expect to pass because of the {SUCCEED} macro but instead passes because the scenario ended as a victory through some other method.

Additional unit tests which were the original motivation for this change are also added as part of this.  They test, as much as possible, that events are executed at all, and are then also executed in the expected order.
2020-04-07 16:45:34 -05:00
gfgtdf
0de2070461 schema updae for [modify_unit_type] 2020-03-12 19:15:17 +01:00
newfrenchy83
ce4fb82173 Filter weapon in [filter student/opponent/etc] rework (pr #4678)
All weapon specials can now be used in [abilities] to effect all weapons of the unit that pass the filter given in [filter_student][filter_weapon].

Explanation: filter_student filters on the unit that is  under the effect of the ability (which is usually the unit itself, but not always if [affect_adjacent] is used).  [filter_student][filter_weapon] filters on the active weapon of that unit (the student) in a specific combat.

[filter_weapon] is now supported in all filter_opponent, filter_student, filter_attacker, filter_defender

Note that constructs like [filter_student][or][filter_weapon] are not suported, [filter_weapon] must be a direct subtag of the four just mentioned tags.
 
[filter_second_weapon] is no longer used for abilities that come from weapon specials.

implements #4629 , #4475 , #4389

Co-authored-by: gfgtdf <daniel.gfgtdf@gmail.com>
2020-01-05 00:27:55 +01:00
Celtic Minstrel
3303be6c91 Restore the dir+count test for move_unit and add the syntax to the schema 2019-12-14 11:28:37 -05:00
newfrenchy83
fdf98757e3 Schema: attempt to fix specials used as abilities 2019-11-11 17:19:13 +11:00
Iris Morelle
3beefca899 gui2/text_box: Add hover effect
This gives GUI2 textboxes (and password boxes since they are a subclass)
a simple hover effect by extending the canvas definitions for the widget
accordingly.
2019-11-11 17:16:39 +11:00
Celtic Minstrel
bbebd1eb91 Update schema and changelog 2019-11-10 17:22:04 -05:00
Steve Cotton
17940cb98f Replace the [tutorial] tag with [scenario]
The title screen's "tutorial" button will use the tag name from game_classification,
as would anything else that calls game_launcher::set_tutorial().
2019-11-04 17:09:10 +11:00
nemaara
c726eb72f6 Schema: allow variables in heal_amount 2019-11-01 00:02:01 -04:00
nemaara
ac6873769d Schema: attempt to fix specials used as abilities 2019-10-31 23:57:58 -04:00
nemaara
fcf4974381 Schema: fix some value types 2019-10-31 23:51:51 -04:00
Gunter Labes
97a999a2f5
Update schema to use correct types 2019-10-30 13:52:27 +01:00
Celtic Minstrel
f8c7455928
Fix schema rejecting top-level color range/palette tags (#4487) 2019-10-18 22:18:17 -04:00
newfrenchy83
a87be48307 WML: Add separate special_id and special_type checks to weapon filtering
PR #4424, fixes #3915.
2019-10-16 02:55:13 +00:00
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