Commit graph

1093 commits

Author SHA1 Message Date
Celtic Minstrel
53828a01b9 New [remove_object] WML tag 2016-08-02 00:52:52 -04:00
Celtic Minstrel
6dab777f66 Accept [effect] in [modify_unit] 2016-08-02 00:01:48 -04:00
Gregory A Lundberg
ee8778a6d7 objectives.lua show_turn_counter in white
This matches the style used for OBJECTIVE_FOOTNOTE and makes the turn count more apparent.
2016-08-01 20:22:15 -05:00
Celtic Minstrel
dc3d22a5e4 Merge pull request #710 from spixi/call_events_by_id
Allow firing an event by id instead of name.
2016-07-30 01:21:12 -04:00
Gregory A Lundberg
b064328102 New features for [role]
Add search_recall_list=only to search the recall list, but not the map
This is intended as a more clear way of doing 'x,y=recall,recall' and omitting search_recall_list. Note that search_recall_list=no with x,y=recall,recall produces a useless [role] which only runs the [else] block(s).

Add reassign attribute
Optional attribute, default 'yes'. If 'no' then do not re-assign the role if a unit already has the role. If 'no' and no unit has the role, the role is still assigned.

Refactor auto_recall as a sub-tag
Instead of a yes|no attribute, if there is an [auto_recall] sub-tag then recall the unit from the recall list. This acts as a [recall] tag without any StandardUnitFilterto which we add id=$unit.id and issue the recall.
2016-07-29 18:18:53 -05:00
Spixi
5588642c81 Allow firing an event by id instead of name. 2016-07-23 12:23:19 +02:00
Bär Halberkamp
1d8d843a80 move set_variable.rand's logic to helper.rand 2016-07-19 13:48:31 -04:00
Celtic Minstrel
36eeed413c Comment fixup 2016-07-17 19:51:09 -04:00
Bär Halberkamp
0a83e2e6b6 Fix [message]s without an image not working 2016-07-17 19:49:29 -04:00
gfgtdf
1d168bce9a fixup on_event.lua 2016-07-16 20:34:33 +02:00
Celtic Minstrel
6abd7a6941 Add [message]image_pos=left|right
This is meant to replace ~RIGHT() and also the newer ~LEFT(),
with one exception: ~RIGHT() will still be the standard way to
make a unit's portrait go on the right by default.
2016-07-15 17:35:51 -04:00
gfgtdf
ceea75cf0a replace some victory with scenario_end events.
victory is an unsynced event to its potentially unsafe to change the
gamestate in it, this mostly effects LoW (which can be played as a mp
campaign) where i replaced most victory events.

But it also effects sp becasue it can casue bugs to create units in
unsynced events which are used later (here: in later scenarios), so i
replaced also all sp victory events that do that.

Note that the 'scenario_end event'+'proceed_to_next_scenario filter' has
a slightly different meaning than 'victory event': the second gets fired
when there is a local human side who won the scneario while the first
gets fired if there is any human side who on the scenario. In sp this
is the same since there are no remote human sides, but in mp this is the
reason why the first is synced and the second is not.

We could add a seperate event for this case ("before next scenario" or
similar) for easier use, but i didn't find a good name for
that yet.
2016-07-14 22:15:33 +02:00
Celtic Minstrel
d4b8fec953 New features in [role] WML tag
- search_recall_list=yes|no (default yes)
- [else] tag which is run if no unit matches
- auto_recall=yes|no (default no) which recalls the unit if it's on the recall list
2016-07-11 20:13:57 -04:00
ln-zookeeper
937df219c9 Don't issue a warning when no unit found for [role] 2016-07-11 23:41:33 +03:00
gfgtdf
d73d32e8e2 fixup on_event.lua 2016-07-11 15:12:12 +02:00
gfgtdf
9a5eabb207 fixup on_event.lua 2016-07-11 15:09:25 +02:00
gfgtdf
ac717f70b8 improve on_event.lua
Added some features:
1) on_event now supports a comma separated list of event names in its first parameter

2) on_event now supports a number as second parameter that specifies in which order the event handlers are called.

3) on_event now passes wesnoth.current.event_context to the handler function, since the handler function will most likeley need it.
2016-07-11 14:01:04 +02:00
gfgtdf
16014a9795 fix [set_variable] rand= 2016-07-09 21:42:10 +02:00
gfgtdf
40ff1ec986 make utils.split return empty set on nil values
previously it returned a "nil" string
2016-07-09 21:01:35 +02:00
Charles Dang
240b940618 Fixed [teleport] not working 2016-07-03 04:34:54 +11:00
Pentarctagon
d22b15b19b Add color=value to [message] (#651)
Add support for the pango attributes as keys in [message]
This is equivalent to surrounding the entire string in a span with the specified attribtues.
2016-06-06 12:50:49 -04:00
Celtic Minstrel
3715c194c2 Merge pull request #642 from Elvish-Hunter/set_variable_lua
Ported [set_variable] to Lua
2016-06-06 12:47:15 -04:00
Charles Dang
7c299ce418 Fixed [lift_fog] (bug #24680)
Firstly, there was a typo in the parse_fog_cfg utility function.

Secondly, wesnoth.get_sides returns a table of side proxy tables, not a
list of side numbers. I changed [lift_fog] and [reset_fog] to iterate through
the table returned by parse_fog_cfg.
2016-05-28 03:29:14 +11:00
dorng
2e5fb7cda7 fix [transform_unit] 2016-05-27 10:26:59 +02:00
Elvish_Hunter
8b82fb3248 [set_variable]: do not iterate through all the elements of a random range 2016-05-22 22:46:38 +02:00
gfgtdf
9757ab4158 fix [teleport] 2016-05-22 19:42:07 +02:00
gfgtdf
2fa8bc0350 cleanup lua feeding implementation. 2016-05-22 19:41:54 +02:00
gfgtdf
5de1d9b046 optimise [random_placement]
the cases distance=0 and distance = -1 now dont loop thougth all
possible locations anymore when removing a used location.
2016-05-20 14:42:49 +02:00
gfgtdf
2ba7ad5c43 move feedung event to lua
this has 2 advantages:
1) It decreased savefile size since the event is no longer sotred in
each savefile.
2) The ABILITY_FEEDING no longer assumes its used from within
[abilities]
2016-05-20 14:42:49 +02:00
Celtic Minstrel
af58b33aca [modify_unit] now supports dvs for modifications
This means [object], [advancement], and [trait] tags within [modify_unit]
can now use delayed_variable_substitution=yes.

This is currently needed for adding teleport, backstab, and leadership abilities.
2016-05-18 20:48:48 -04:00
Celtic Minstrel
15ec939fe0 Suppress deprecation messages unless in debug mode 2016-05-11 14:12:11 -04:00
Elvish_Hunter
00525c340b Implemented random ranges by using tables 2016-04-27 22:21:35 +02:00
Elvish_Hunter
5eb1784195 Re-evalutate the content of the variable in each operation 2016-04-13 22:35:45 +02:00
Elvish_Hunter
a61d3704e9 Fixed a misplaced end 2016-04-13 17:32:48 +02:00
Elvish_Hunter
3c6d3e93d7 Merged upstream/master 2016-04-13 17:27:14 +02:00
Elvish_Hunter
66ee214544 Allow executing multiple operations in the same [set_variable] tag 2016-04-13 15:49:37 +02:00
Elvish_Hunter
d6308cc6f7 Used helper.shallow_literal instead of cfg.__shallow_literal 2016-04-13 15:46:20 +02:00
Celtic Minstrel
73739a1989 Attempt to fix Travis build... again 2016-04-05 10:08:14 -04:00
Celtic Minstrel
7ee37b6f84 Attempt to fix Travis build 2016-04-05 03:19:26 -04:00
Celtic Minstrel
5cf12798ce Port "trivial" WML tags to Lua
This is more about adding Lua API for things that should have it than porting WML tags to Lua.
The following new Lua API functions have been added to the wesnoth table:
- add_fog, remove_fog
- add_sound_source, remove_sound_source, get_sound_source
- log
2016-04-05 02:24:42 -04:00
Celtic Minstrel
a275f22ebe Fix potential "image is nil" error in [message] 2016-04-04 20:55:45 -04:00
Celtic Minstrel
d3374d3670 WML tags fixup 2016-04-04 20:10:52 -04:00
Celtic Minstrel
a791909544 Split the more complicated WML tags into separate Lua files 2016-04-04 17:03:38 -04:00
Elvish_Hunter
d6747f5098 Ported [set_variable] to Lua 2016-04-04 21:23:00 +02:00
Celtic Minstrel
7c37ad57bd Two new [message] features
- ~LEFT() does the opposite of ~RIGHT(), but takes higher priority;
  use it to force an image to the left that's normally on the right
  (eg female silver mage)
- image=~RIGHT() means "use normal portrait, but on the right"
2016-04-02 15:15:31 -04:00
Celtic Minstrel
1c27cafa74 Add highlight=yes|no to [scroll_to], [scroll_to_unit], [message]
Defaults to no in the first two cases, yes in the third
If yes, the target hex is outlined.
2016-03-20 02:55:12 -04:00
mattsc
bce1fae063 Fix portrait missing in [message] with empty image= key
This is mostly important for use of the MESSAGE macro.  Use image=none
if no image/portrait is supposed to be shown.
2016-03-19 14:25:28 -07:00
Celtic Minstrel
2e6ad2bee3 Add wesnoth.select_unit(), deprecate wesnoth.select_hex()
wesnoth.select_unit() is also callable as u:select() where u is a unit
2016-03-16 12:51:31 -04:00
Celtic Minstrel
ecb3dc6c46 Error if looping tags lack [do] 2016-03-14 13:15:04 -04:00
Celtic Minstrel
c1b6060e4b Fix cleanup of [foreach] scope 2016-03-14 13:15:03 -04:00