Commit graph

1093 commits

Author SHA1 Message Date
gfgtdf
986550c040 move [teleport] actionwml to lua. 2016-03-14 14:42:05 +01:00
gfgtdf
50a9a25ae7 move [unstore_unit] definition to lua
This also adds a 'color' parameter to wesnoth.float_label. It was already
previously possible to set a labels color using pango markup, but to
implement [unstore_unit] i need to support the color= syntax as given
by [unstore_unit]

This also adds a 'fire_event' parameter to wesnoth.put_unit to specify
whether the 'unit_placed' event is fired, this is needed to implement
fire_events=yes/no in [unstore_unit] but its also generally useful
for the same reason why [unstore_unit] has this parameter.
2016-03-14 14:41:45 +01:00
Charles Dang
b512ad2143 Make [message] use wesnoth.highlight_hex() 2016-03-14 09:42:04 +11:00
Charles Dang
6aa060ed06 Fixed [put_to_recall_list] (bug #24390)
put_recall_unit() already deals with erasing it from the map, rendering
this erase_unit() call redundant and harmful.
2016-03-05 11:55:40 +11:00
ln-zookeeper
93a7f5e599 Fixed the last character of [objectives] note= getting eaten 2016-02-14 02:12:01 +02:00
Celtic Minstrel
1873b38243 Demote [option] deprecated message even further 2016-02-13 18:42:02 -05:00
Celtic Minstrel
d28365730b Demote [option] deprecated message to log 2016-02-13 18:23:07 -05:00
gfgtdf
5caa9dd95b cleanup wml_actions.store_items 2016-02-03 22:58:23 +01:00
gfgtdf
08236f8953 added name= attribute to [item]
name= has no effect but can be used to delete the item. I also changed
[item] to automatically create an id (in case no id was given) and
return that (only usable if called from lua).

I used the id= field from overlay class for this, it was previously only
used by the editor. Not sure if it is a good idea to reuse the id field.
2016-01-31 02:25:46 +01:00
CelticMinstrel
ac77c262bd Merge pull request #578 from CelticMinstrel/fix-message
Fix [message] issues
2016-01-09 00:50:14 -05:00
Celtic Minstrel
4d2e4e2dbc Don't needlessly preparse [message][command]
Fixes bug #24288
2016-01-08 23:14:54 -05:00
Celtic Minstrel
129418e2f9 Outline the speaker's hex in [message]
Unfortunately, this also highlights the speaker's reach.
2016-01-02 22:20:36 -05:00
Celtic Minstrel
2e293fb61d Apply TC to unit sprites in [message] 2016-01-02 20:36:29 -05:00
Celtic Minstrel
fa9a394987 Deselect speaker after [message] 2016-01-02 20:36:27 -05:00
Celtic Minstrel
64ddd50895 Fix [for] loop not iterating the correct number of times
(when the array length changes during the loop)
2015-12-29 23:40:36 -05:00
gfgtdf
571014f374 remove undocumented [wml_action] tag
there is no reason to use this when lua code can easily add a function
to wesnoth.wml_actions directly.
2015-12-21 23:32:47 +01:00
gfgtdf
4c955e7461 don't use __shallow_literal directly
the passed config might not be a vconfig.
2015-12-21 20:53:47 +01:00
gfgtdf
1eefcddc17 use wesnoth.advance_unit to advance units in [harm_unit] 2015-12-21 20:53:45 +01:00
gfgtdf
b4e5f16d74 improve formatting in lua code.
This also fixes a bug in [harm_unit] where a second arument was passed
to wml_actions.animate_unit which was obviously meant to be part of the
first argument.

This also changes harm_unit to use wml_actions.animate_unit instead of
wesnoth.animate_unit becasue the former is better known an thus easier
to understand.
2015-12-21 20:53:44 +01:00
gfgtdf
203f7b0ded clenaup DW scenario9 scorpion placement code. 2015-12-21 13:11:14 +01:00
gfgtdf
3b9a0fdb15 fix bonus=yes/no in [endlevel]
http://gna.org/bugs/?24191
2015-12-17 01:28:46 +01:00
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