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
since the recent changes to overlays= in particular 1a7724e547,
e71033374c and b2cd1cf6c [unit]overlays= is no longer the
recommended way to add an overlay and the use of the
apply_to=overlay effect is reccomended instead, so adding it
to the [trait] is the most natural option here.
this in particular fixes#4058 . Also people simply forgetting the
IS_LOYAL macro was a not-so-uncommon cause of bugs.
In some cases people want to give the LOYAL trait without giving the
loyal overlays for those cases i added a optional OVERLAY parameter to
the {TRAIT_LOYAL} macro, also heroes should now use {TRAIT_LOYAL_HERO}
instead which uses the hero overlay. The IS_LOYAL and IS_HERO macros are
no longer needed in combination with those traits.
In Caves of the Basilisk, give the monsters names so their descriptions
would show in-game. The descriptions show in the tooltip, so
a non-empty name is required in order for players to be able to summon
th tooltip.
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.
Ideally we would replace it with a more effective and intuitive version at some point, but currently we do not know how to set up AI behavior that both makes sense and is usable in a general setting (without consisting of unit-level control).
According to po comments in S1, Baldras is Harper's mother's brother.
Also change "mom"/"dad" to "mother"/"father" to match the general
medieval setting of dialogs.
(cherry-picked from commit bcb6153b89)
Side 3 was composed by enemy reinforcements. Since they were
spawned on the right corner of the map, and since side 2
was blocked inside Halstead by and [avoid] tag, it was
necessary to add a new hidden side which could move freely
on the map.
If we upgrade the AI, removing the [avoid] tag, this hidden
side becomes unnecessary.
(cherry-picked from commit f32dfaa917)
All sides will now head to the central fortress. Orcs
should now be a bit smarter, and they should not suicide
during the morning or the afternoon. The humans in Halstead
will initially remain inside their fortress, until the enemy
arrival.
(cherry-picked from commit e63a15fc91)
Instead of checking whether there are no enemy units left
every time one of them dies, use the "enemies defeated"
event.
(cherry-picked from commit 4ced6c7526)
He's been a silver-crowned hero until this scenario, and in
the final scenario he's still loyal with dialogue if he dies,
so make him easily visible to the player.
@zookeeper pointed out to me that spelling event names with spaces is the
standard in WML, especially when setting up event listeners. Thus, changing
spelling of the names of the events fired from WML made the codebase more
inconsistent, not less.
Follow-up of 3cbf249b. This commit changes event names to be written with
underscores everywhere where events are fired (or every place I found in a
quick search, anyway).