Commit graph

209 commits

Author SHA1 Message Date
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
gfgtdf
7621b9b63e
fix [modify_unit] cannot set attributes to false #4325 2019-09-08 19:50:56 +02:00
Celtic Minstrel
b08677c678 Fix erroneous comment 2019-08-30 23:23:10 -04:00
gfgtdf
fbdd926e14 improve [modify_unit] [status] implementation 2019-08-24 22:19:58 +02:00
gfgtdf
671f1efc40 formatting 2019-08-24 22:19:58 +02:00
Pentarctagon
93dff47a75 Make [option]'s message and description attributes equivalent.
Also removes the deprecation message for the message attribute.
2019-08-17 15:17:19 -05: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
a50ec3f872 Support location_id in [role][auto_recall] 2019-03-03 11:56:34 -05:00
Celtic Minstrel
9d8d57b16d Fix WFL in [random_placement] not receiving the size variable 2019-03-03 11:56:34 -05:00
gfgtdf
7ea1377945
fix modify_unit optimisation for recall units. 2019-01-13 20:00:25 +01:00
gfgtdf
a32e49e32f
fix [item] z_order being lost after reload 2019-01-01 20:33:39 +01:00
Celtic Minstrel
2f9bca43af
Fix erroneous deprecation 2018-11-15 23:12:55 -05:00
Jyrki Vesterinen
68f3a8e846 Lua fixes 2018-11-16 05:47:28 +02:00
Celtic Minstrel
55a6c16810 Lua API reorganization: interface module deprecations 2018-11-15 21:06:55 -05:00
Celtic Minstrel
e3e80b4a99 Lua API reorganization: interface module 2018-11-15 21:06:55 -05:00
Celtic Minstrel
639787e1c9 Merge pull request #2562 from wesnoth/schema 2018-11-11 13:52:19 -05:00
ProditorMagnus
e3da41335e fix modify_unit split_to_array function 2018-11-11 17:30:28 +01:00
gfgtdf
3c63b1e6de optimize modify_unit
now modify_unit no longer causes the full rebuild of the unit unless it
is really needed, this is not only faster, it also prepares a future
optimisation in reducing the units size in savegame files.
2018-11-10 22:26:59 +01:00
Celtic Minstrel
c4f2e839ab
Fix [random_placement] executing the code for each element twice (fixes #3663) 2018-10-27 13:56:42 -04:00
Celtic Minstrel
96f154716a Fix misleading function name in [endlevel] definition
The name gave the impression that it returns an integer,
which is not guaranteed.
2018-10-23 22:49:18 -04:00
jostephd
e766cdc7cc WML: Support [filter_side] in [item]. (#3533)
* WML: Support [filter_side] in [item].

If [filter_side] is present then "team_name" is ignored.

Fixes #1477.

* WML: Compare [item]team_name to [side]team_name using intersection.

Fixes problems with substrings and when one or the other is a
comma-separated list. See #3533

* WML: Rename [item][filter_side] to [item][filter_team]

* Add changelog entry

(cherry-picked from commit 3a3b752881)
2018-10-07 03:25:20 +00:00
gfgtdf
bc89512a5c add game_config.combat experience
and make [harm_unit] use these values instead of hardcoded 8*level for
killing and level for combat.

(cherry-picked from commit 3591e82586)
2018-10-07 03:25:00 +00:00
newfrenchy83
c1a70068d5 Lua API: implicitly clear animator after playing it (#3536)
This prevents the animator from holding a strong reference to the target unit, which was keeping the unit object alive and thus preventing the unit halo, if any, from disappearing.

(cherry-picked from commit 7d6e2b2a10)
2018-10-07 03:24:59 +00:00
newfrenchy83
98bec00fac [heal_unit]: clear the animation after playing it (#3526)
Fixes another case of unit halo remaining after death.

(cherry-picked from commit 3541629197)
2018-10-07 03:24:56 +00:00
Jyrki Vesterinen
ee3e842cbc [animate_unit]: clear the animation after playing it
This avoids a reference to the unit from being leaked, which prevented the
unit's halo (if any) from disappearing when the unit died.

Fixes #3509. Closes #3520.

(cherry-picked from commit e63bd35f9d)
2018-10-07 03:24:55 +00:00
josteph
a930dc28a9 WML: Don't add a \n before condition=lose objectives if there are no objectives listed before them.
(cherry-picked from commit 045d331da8)
2018-10-07 03:23:12 +00:00
Andras Szell
a2a22ae10b Fix: add redraw to narrator's message so village count is refreshed
Fixes: https://forums.wesnoth.org/viewtopic.php?f=21&t=48370

In the tutorial when we occupy the first village the message tells us the
village count got incremented, but in the old version it was incremented
only afterwards. Non-narrator messages were updated properly. By adding the
redraw, narrator messages triggered by capture event produce the same
result as other speakers.

(cherry-picked from commit 1ea4149a44)
2018-10-07 03:22:57 +00:00
Iris Morelle
7b604c2a89 Fall back to the unit type name for [message] captions for nameless units
Fixes #3211.

(cherry-picked from commit 051182fa1c)
2018-10-07 03:22:17 +00:00
Iris Morelle
5c04fe72d5 Don't allow [kill] animate=yes to scroll to units through fog and shroud
Restores 1.12's behaviour.

(cherry-picked from commit 4e37cdc713)
2018-10-07 03:22:15 +00:00
Iris Morelle
56cba5aacf Do not allow [message] to scroll to units through fog/shroud
This was a regression from 1.12.

(cherry-picked from commit 8ae38ac19f)
2018-10-07 03:21:36 +00:00
Celtic Minstrel
ab36d7b600 Support [break], [continue], and [return] in [random_placement]
(cherry-picked from commit 4a3508f13f)
2018-10-07 03:21:22 +00:00
mattsc
0e017d9f7c Lua code: replace deprecated wesnoth.set_variable() calls
(cherry-picked from commit ce7faae4f4)
2018-10-07 03:21:07 +00:00
mattsc
05d5afa6a9 Lua code: replace deprecated wesnoth.get_variable() calls
(cherry-picked from commit f1764d182f)
2018-10-07 03:21:06 +00:00
mattsc
448a20779f Lua code: replace deprecated wesnoth.tovconfig() calls
(cherry-picked from commit 138107c8f6)
2018-10-07 03:21:06 +00:00
Celtic Minstrel
131019c18b Support male_voice and female_voice in [message]
(cherry-picked from commit 07e465e57b)
2018-10-07 03:20:00 +00:00
Jyrki Vesterinen
d75a752c06 [heal_unit]: ensure that heal amount is an integer
(cherry-picked from commit 76ed49a45f)
2018-10-07 03:19:22 +00:00
Jyrki Vesterinen
167ee61d34 Revert "Display amount healed as an integer in [heal_unit]"
This reverts commit 0294bd81b2.

Changing display is unnecessary when the healed amount itself is forced
to be an integer (next commit).

(cherry-picked from commit f2284e2e79)
2018-10-07 03:19:22 +00:00
Celtic Minstrel
017c3ca9cf Display amount healed as an integer in [heal_unit]
(cherry-picked from commit 0294bd81b2)
2018-10-07 03:19:21 +00:00
Celtic Minstrel
3735b9c4f2 Add [move_unit]clear_shroud= as an attempt to clear shroud as the unit moves (untested)
(cherry-picked from commit b062b19e10)
2018-10-07 03:19:06 +00:00
Celtic Minstrel
c5b5bdda70 Allow [move_unit]dir= to perform relative movements
(cherry-picked from commit 68b33cf6bd)
2018-10-07 03:19:06 +00:00
Celtic Minstrel
4ce00c6b6c Allow [move_unit]to_location to take a list of waypoints
(cherry-picked from commit 622db9d08b)
2018-10-07 03:19:06 +00:00
gfgtdf
59cc2448dc fix [message] side_for= not working for the last side.
fixes #2776

(cherry-picked from commit 0f756b8189)
2018-10-07 03:18:50 +00:00
Celtic Minstrel
b1e96b08dd Support facing in [role][auto_recall]
(cherry-picked from commit ea0bcec92f)
2018-10-07 03:18:40 +00:00
Celtic Minstrel
b35a7f7352 Support root=cube and root=int in [set_variable]
(cherry-picked from commit 7a3d6f958a)
2018-10-07 03:18:39 +00:00
Celtic Minstrel
12ada04b8f Use wesnoth.format instead of string.format for translateable strings in [objectives]
(cherry-picked from commit 15ae9fcb0c)
2018-10-07 03:18:39 +00:00
Celtic Minstrel
b5b87ef373 Nicer handling of some Pango formatting attributes in [message]
(cherry-picked from commit c835e5b7e6)
2018-10-07 03:18:39 +00:00
Celtic Minstrel
05a45b8cd1 Handle speaker=id directly in [message] instead of relying on SUF
(cherry-picked from commit 2bd2a8b1b6)
2018-10-07 03:18:39 +00:00
Celtic Minstrel
52d3b7bb6a Support [set_variable]round=trunc
(cherry-picked from commit beb5dc75aa)
2018-10-07 03:18:38 +00:00
Celtic Minstrel
0d1df0f2d7 Fix unintended change to the semantics of [modify_side]income=
(cherry-picked from commit 79bc18fe95)
2018-10-07 03:18:37 +00:00
Celtic Minstrel
d72612443f Allow percentages in [random_placement]num_items=
(cherry-picked from commit 229d2f0483)
2018-10-07 03:18:19 +00:00