Commit graph

1122 commits

Author SHA1 Message Date
gfgtdf
ab1a4629a9 rename [filter] -> [filter_location] in [random_placement] 2015-12-10 01:43:32 +01:00
gfgtdf
442a2292a2 fixup removal of [side]name= 2015-12-08 14:52:20 +01:00
gfgtdf
9d656ad755 update [randon_placement]
removes use_delay: one could easily use [delay] inside [command] so
there is no reason to have that there.
changes 'radius' -> 'min_distance'
removes a debugging message
2015-12-07 22:31:56 +01:00
gfgtdf
5db889eb14 reset variable after [random_placement]
none of the usecases found in mainline or in UMC use that variable
afterwards so there is no reason to keep it.
2015-12-07 21:49:15 +01:00
gfgtdf
dc786dc181 add tag [random_placement]
and use it to implement SCATTER_IMAGE,SCATTER_EMBELLISHMENTS and
SCATTER_UNITS
2015-12-07 21:49:09 +01:00
gfgtdf
d755d3b820 add [endlevel] bonus=number
instead of bonus=yes/no you can also pass a number, so bonus=0.5 will
give you only half of the bonus gold.
2015-11-30 02:49:08 +01:00
gfgtdf
91943451c7 move most of [endlevel] implementation to lua
as a side effect we get read/write fields
side.carryover_bonus/carryover_add/carryover_percentage in lua sides.
2015-11-30 02:49:01 +01:00
gfgtdf
59233ce903 attempt to fix bug in [message]
previously this bug http://i.imgur.com/9B7bquA.png happend in LoW scenario3.
2015-11-27 18:13:07 +01:00
Ignacio R. Morelle
9d85887ed1 Add [remove_time_area] and allow [time_area] remove=yes to take an id list
[remove_time_area] is syntatic sugar but it's used to implement
[time_area] remove=yes now, just like [remove_event]/[event].
2015-11-26 22:38:03 -03:00
Celtic Minstrel
9d3f1e5c9d Fix some issues with [test_condition] 2015-10-06 16:23:55 -04:00
Celtic Minstrel
8a7f71578d Add (male|female)_message to [message] 2015-10-06 15:03:55 -04:00
Celtic Minstrel
f8e897e8dd Change [explain] to [test_condition] 2015-10-06 14:45:29 -04:00
Celtic Minstrel
9724d98d44 string.format blows up on booleans 2015-10-06 14:45:05 -04:00
Celtic Minstrel
5353dfb439 Use return instead of goto in [while] 2015-10-06 13:51:28 -04:00
Celtic Minstrel
aa2e24d1b7 Finally fix all the [for] issues. Probably.
(With unit tests to back it up!)

- Fixes [for]step=0
- Fixes [for]start,stop=0,0
- Fixes [for]start,end,step=0,1,-1
- Probably fixes several other things too
2015-10-06 13:51:28 -04:00
Celtic Minstrel
fd34675dd9 Add an [explain] WML tag
This explains (in the log) why a WML conditional has failed (or succeeded). Currently it is fairly basic, looping through and/or/not and printing out the specific conditional tag that failed as well as, for [variable], the current content of the variable.

It's used in the WML unit tests system, but could also be useful for debugging.

This commit also fixes an issue with passing multiple -a arguments to run_wml_tests.
2015-10-06 13:51:27 -04:00
CelticMinstrel
33385f97b8 Merge pull request #499 from CelticMinstrel/lua-unit
Lua API changes (mainly relating to units)
2015-10-03 21:13:04 -04:00
Celtic Minstrel
74152fc2cb Fix [object] without a filter 2015-10-01 16:13:19 -04:00
Celtic Minstrel
13033270ae Sanity test in [for] for sgn(step) ~= sgn(last-first) 2015-10-01 14:29:47 -04:00
Celtic Minstrel
281f952a08 Fix [for] not working for decreasing ranges 2015-10-01 14:08:42 -04:00
Celtic Minstrel
c0384520ad Fix [for]step= not being honoured 2015-10-01 14:05:29 -04:00
Celtic Minstrel
d5e7be9cef Fix [for]reverse= check 2015-10-01 14:03:27 -04:00
CelticMinstrel
320372d6b8 Merge pull request #507 from CelticMinstrel/lua-vconfig
Lua vconfig iteration
2015-09-30 15:22:53 -04:00
Celtic Minstrel
114b31c90c New syntax for [message][option]message= similar to new [campaign][difficulty] 2015-09-30 02:01:03 -04:00
CelticMinstrel
f31084da84 Remove asserts 2015-09-29 20:56:34 -04:00
Celtic Minstrel
9aa015a57a Fix helper.child_range to work on config and vconfig alike 2015-09-29 20:04:03 -04:00
Celtic Minstrel
2c337d4115 Use ipairs() for helper.child_range 2015-09-29 14:46:41 -04:00
Celtic Minstrel
7fb0831da6 Use ipairs for the helper functions 2015-09-29 12:55:31 -04:00
Celtic Minstrel
03a38c5294 Lua API: More helper functions for configs 2015-09-26 02:43:59 -04:00
Celtic Minstrel
c4bb4c2536 Fix WML unit tests 2015-09-23 22:22:25 -04:00
CelticMinstrel
f07e463882 Merge pull request #493 from CelticMinstrel/foreach
Enhanced looping tags
2015-09-23 00:50:30 -04:00
Celtic Minstrel
7e26e09061 Fix erroneous handling of [break]/[continue] in [elseif] 2015-09-23 00:25:31 -04:00
Celtic Minstrel
33a43990ad Add an explanatory comment to [foreach] 2015-09-22 22:13:36 -04:00
Celtic Minstrel
d5eea2abbf Fix [show_if] in [message][option] 2015-09-22 16:16:08 -04:00
gfgtdf
58512935d4 add [message] wait_description=
the description provided in wait_description is used when other players
wait for this [message] input.
2015-09-21 15:50:14 +02:00
gfgtdf
4c3e00b3bb readd side_for parameter for [message] with input
this was lost when porting the code to lua.
2015-09-21 15:46:00 +02:00
Elvish_Hunter
650f21e582 Fixed [role] not working if type= was not specified 2015-09-21 12:29:13 +02:00
Charles Dang
acdc67fe56 [object] don't show unit reach when highlighting unit 2015-09-21 10:47:21 +11:00
Charles Dang
00d96b3016 Fixed a variable typo pointed out by Elvish_Hunter 2015-09-20 23:49:06 +11:00
Celtic Minstrel
d527ea4740 Fix up loop implementations to reflect recent changes 2015-09-20 01:05:55 -04:00
Celtic Minstrel
2fec74a6ac Add default scope_type to handle_event_commands 2015-09-20 01:01:57 -04:00
Celtic Minstrel
0ffda44b27 Add break/continue support to the new loops 2015-09-20 01:01:52 -04:00
Celtic Minstrel
aec99429c4 Merge branch 'break-continue' into foreach 2015-09-20 00:48:39 -04:00
Celtic Minstrel
3c329408ce Implement [break], [continue], [return] tags (they take no arguments) 2015-09-20 00:47:23 -04:00
Celtic Minstrel
bda61536b0 Use [do] subtags with [repeat] 2015-09-20 00:31:47 -04:00
Celtic Minstrel
d895b18659 [foreach] now raises error if array length changes during iteration 2015-09-20 00:31:28 -04:00
Celtic Minstrel
65263bfc32 Propagate modifications to item_var back into the array 2015-09-20 00:31:09 -04:00
Celtic Minstrel
6c5cf1eb88 Implement [foreach] tag, based on Elvish_Hunter's implementation 2015-09-20 00:30:18 -04:00
Celtic Minstrel
f5bd414b69 New WML tags to replace macro loop constructs
- [for] can replace {FOREACH} ... {NEXT}, but it's really intended for running over an integral range
- [repeat] can replace {REPEAT}
2015-09-20 00:30:08 -04:00
Charles Dang
45aa0d4ae8 Fixup 9ea9c88356 2015-09-20 10:23:34 +11:00