782 Commits

Author SHA1 Message Date
gfgtdf
42af4c3378 move [terrain_mask] to lua
and implement it using wesnoth.terrain_mask.

This also fixes an issue where [terrain_mask] would not remove
removed villages from the teams villages list after [terrain_mask].

This also adds an alignment parameter to [terrain_mask].

(cherry-picked from commit 09c56ef2fe40eaec53311918288431256aac63ff)
2018-10-07 03:24:14 +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 045d331da8cc8120e4a5affd639ce389e344bc16)
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 1ea4149a4456ab8713dde4fbfcdd446b5762adcf)
2018-10-07 03:22:57 +00:00
Iris Morelle
e68bdd1b5f Fix Lua errors when failing to set a music track on an empty playlist
Closes #3194.

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

(cherry-picked from commit 051182fa1c6fa75184d991920ff4e8e84831a848)
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 4e37cdc713d054a48b1f31f43cb5511f42626847)
2018-10-07 03:22:15 +00:00
Charles Dang
f68aec177f [remove_sound_source] now accepts a comma-separated ID list
[ci skip]

Lack of this pointed out by @shikadiqueen.
This change will also throw an error if id= is missing. Not sure if it did so before.

(cherry-picked from commit 8d3f54ce7c4647a97efb8ddb8b598d5a1af0f815)
2018-10-07 03:21:36 +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 8ae38ac19fa48ec9c380a9bce49c17dc43be9a05)
2018-10-07 03:21:36 +00:00
Iris Morelle
c1319349b3 Fix [change_theme] crashing when theme= isn't specified
Leaving theme= unspecified ought to have the same effect as providing it
and setting it to an empty string. Without the check for a nil value,
however, it would result in a crash like this:

  20180519 22:31:54 error scripting/lua: lua/wml-tags.lua:922: bad argument #3 to '__newindex' (string expected, got nil)
  stack traceback:
          [C]: in metamethod '__newindex'
          lua/wml-tags.lua:922: in local 'cmd'
          lua/wml-utils.lua:145: in field 'handle_event_commands'
          lua/wml-flow.lua:6: in function <lua/wml-flow.lua:5>

(cherry-picked from commit e82d811ab09ba2b6933fa3d12c9872f56369db51)
2018-10-07 03:21:27 +00:00
Celtic Minstrel
ab36d7b600 Support [break], [continue], and [return] in [random_placement]
(cherry-picked from commit 4a3508f13fea69b5cafdfa2d46a99caec201d6e5)
2018-10-07 03:21:22 +00:00
mattsc
a0decde7b9 Lua code: replace deprecated wesnoth.get_all_vars() calls
(cherry-picked from commit 64f7ad256022426040ef9e13ad7941b6bec789a8)
2018-10-07 03:21:08 +00:00
mattsc
0e017d9f7c Lua code: replace deprecated wesnoth.set_variable() calls
(cherry-picked from commit ce7faae4f41f23f1d1f61d2b4f5ca95d4ce4f89a)
2018-10-07 03:21:07 +00:00
mattsc
76ec65102c Prevent definition of wml.variables to cause deprecation warnings
(cherry-picked from commit 0f157bff27fd4db281695710c059b7898d394e8a)
2018-10-07 03:21:07 +00:00
mattsc
05d5afa6a9 Lua code: replace deprecated wesnoth.get_variable() calls
(cherry-picked from commit f1764d182fe33c4e29c6bd42761be2e946cd0c94)
2018-10-07 03:21:06 +00:00
mattsc
448a20779f Lua code: replace deprecated wesnoth.tovconfig() calls
(cherry-picked from commit 138107c8f6d9cfce6348fc262fbbe4f48d7d7cb8)
2018-10-07 03:21:06 +00:00
mattsc
d1c504c9b3 Lua random map generator: fix off-by-one error in flip transforms
Among other things, this gave HttT S17 (Sceptre of Fire) a 50% chance
of crashing at scenario start.

(cherry-picked from commit 7d0d9e19a5fce052e35f866a1d83584dcd8f20bb)
2018-10-07 03:20:56 +00:00
Celtic Minstrel
131019c18b Support male_voice and female_voice in [message]
(cherry-picked from commit 07e465e57b389f7ebacecbc7511411bb5685614a)
2018-10-07 03:20:00 +00:00
Jyrki Vesterinen
d75a752c06 [heal_unit]: ensure that heal amount is an integer
(cherry-picked from commit 76ed49a45f3679050cf06e2ab6aa5ec072957572)
2018-10-07 03:19:22 +00:00
Jyrki Vesterinen
167ee61d34 Revert "Display amount healed as an integer in [heal_unit]"
This reverts commit 0294bd81b21be27e09f10d812fafa6bae7090002.

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

(cherry-picked from commit f2284e2e79db5432039d0ac0a364d0982c7f9f71)
2018-10-07 03:19:22 +00:00
Celtic Minstrel
017c3ca9cf Display amount healed as an integer in [heal_unit]
(cherry-picked from commit 0294bd81b21be27e09f10d812fafa6bae7090002)
2018-10-07 03:19:21 +00:00
Celtic Minstrel
48123469bc Support location_id in [recall] and [unstore_unit]
(cherry-picked from commit ecc8785edbbcaa814502ccee6b2946da4242f53e)
2018-10-07 03:19:20 +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 b062b19e10c85faecf65246e94ec8dbbad0ad4ed)
2018-10-07 03:19:06 +00:00
Celtic Minstrel
c5b5bdda70 Allow [move_unit]dir= to perform relative movements
(cherry-picked from commit 68b33cf6bd8a44470c7ba8069b6b3502e117b5bd)
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 622db9d08b1e15ba99ccb797b4785ac9df4f49fe)
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 0f756b81899ed9e965eb4f40b67bfeaaa3a1e518)
2018-10-07 03:18:50 +00:00
Celtic Minstrel
5e4b5a56b2 Support location_id in [teleport]
(cherry-picked from commit fed46ec45f37baab8bd4491f4b67492256e42132)
2018-10-07 03:18:45 +00:00
Celtic Minstrel
83a6243fb9 Fix incorrect error message when encountering an unknown persistent tag
(cherry-picked from commit d2a8c5bb3200898a068aa24b7b968e444c7dc851)
2018-10-07 03:18:45 +00:00
Celtic Minstrel
b1e96b08dd Support facing in [role][auto_recall]
(cherry-picked from commit ea0bcec92f021c9e2c1efc838508d5d662803771)
2018-10-07 03:18:40 +00:00
Celtic Minstrel
b35a7f7352 Support root=cube and root=int in [set_variable]
(cherry-picked from commit 7a3d6f958a2f8c89488a7a3d2439c37ae50032c8)
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 15ae9fcb0cc93da52c4ee1100c4422d815b8b28d)
2018-10-07 03:18:39 +00:00
Celtic Minstrel
b5b87ef373 Nicer handling of some Pango formatting attributes in [message]
(cherry-picked from commit c835e5b7e660e0842ab765d6cab7615a8790af2b)
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 2bd2a8b1b6d7bba67b6d1b4eb0e03dca56f5a54a)
2018-10-07 03:18:39 +00:00
Celtic Minstrel
52d3b7bb6a Support [set_variable]round=trunc
(cherry-picked from commit beb5dc75aaa60af30dcfe58074771080b5da3aeb)
2018-10-07 03:18:38 +00:00
Vasya
fa71ab4be0 Lua API: simplify functional.reduce (#2788)
simplify code and remove `indentity or 0` VS `indentity` inconsistency.

(cherry-picked from commit 2b8782923a758eee2e167e5c4097f2803e6e2be6)
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 79bc18fe9522049d1844a99e37d58eab43898941)
2018-10-07 03:18:37 +00:00
Celtic Minstrel
d72612443f Allow percentages in [random_placement]num_items=
(cherry-picked from commit 229d2f04831fc75a154b5b718c7d308fb3d81217)
2018-10-07 03:18:19 +00:00
Celtic Minstrel
0131631220 Allow WFL for [random_placement]num_items=
(cherry-picked from commit e4a2c141776124c4e0b16677265c4623a4a02aad)
2018-10-07 03:18:18 +00:00
Celtic Minstrel
c023f7b222 Fix typo in 1dd411a84eb6a45c81d14359aaaec7af34351a39
(cherry-picked from commit 4427ee19362bc739a51945b9f2b2eec59de7010c)
2018-10-07 03:18:18 +00:00
Celtic Minstrel
02b6987158 Support to_location in [move_unit]
(cherry-picked from commit 1dd411a84eb6a45c81d14359aaaec7af34351a39)
2018-10-07 03:18:13 +00:00
Celtic Minstrel
d2a465a126 Support formula= in [variable] ConditionalWML
(cherry-picked from commit 4e52d62963b10c26f33bccfcbad758c0072da393)
2018-10-07 03:18:12 +00:00
Celtic Minstrel
5008c72a22
Fixup wml.all_variables 2018-03-18 01:38:39 -04:00
Celtic Minstrel
8d74b72031 fixup! Fix missing return in on_event() 2018-03-17 17:21:20 -04:00
Celtic Minstrel
a314876bf2 Use new persistent tags interface for [object] [objectives] [item] 2018-03-17 17:16:23 -04:00
Celtic Minstrel
ddcbb4cb50 Add a more convenient way of registering custom saved game data 2018-03-17 17:16:22 -04:00
Celtic Minstrel
68d545c3be Add a couple more WML utility functions 2018-03-17 16:48:06 -04:00
Celtic Minstrel
d4e08359dd Fix missing return in on_event() 2018-03-17 16:48:04 -04:00
Celtic Minstrel
e776635023 Clear up redundancies in helper compatibility and deprecate the array functions 2018-03-17 16:48:03 -04:00
Celtic Minstrel
4b08a40181 Deprecate wesnoth.set_music 2018-03-17 16:48:02 -04:00
Celtic Minstrel
6e4d09d2a5 Bump up a couple of deprecation levels at @vultraz's request 2018-03-17 16:48:01 -04:00
Celtic Minstrel
08ec9017b5 Lua API: Some tweaks of the experimental wml module 2018-03-17 16:48:00 -04:00