Commit graph

1093 commits

Author SHA1 Message Date
Celtic Minstrel
010acd870d Properly port [animate_unit] to Lua 2016-12-11 18:08:08 -05:00
Celtic Minstrel
c58e2d0095 wesnoth.scroll_to_tile can now skip if onscreen 2016-12-11 18:07:46 -05:00
Celtic Minstrel
bf9581cce4 Properly port [heal_unit] to Lua 2016-12-11 18:07:44 -05:00
Celtic Minstrel
37368c3654 Properly port [modify_ai] to Lua 2016-12-11 18:07:40 -05:00
Celtic Minstrel
e0d07e854e Properly port [modify_side] to Lua 2016-12-11 18:07:36 -05:00
Celtic Minstrel
5fdb73b92f Fix an error in [for] if step not specified 2016-12-11 18:06:51 -05:00
gfgtdf
a53090d648 wml cleanups, add terrain= attribute to [random_placement] loc
replacing some [while] with [repeat] or [random_placement]

Adding  terrain= attribute to the variable generated by [random_placement] this mkaes it easier to use [random_placement] as a replacement for [store_locations] + [while] since [store_locations] also generates the [terrain] attribute:
2016-12-10 14:07:13 +01:00
Celtic Minstrel
1e2d6b6586 Add color= to [floating_text] 2016-11-27 12:36:19 -05:00
ln-zookeeper
63b5ac21fd Undeprecate [event]remove= 2016-11-13 20:03:07 +02:00
Celtic Minstrel
35a581c9e7 Deprecate [event]remove=
[ci skip]
2016-11-13 12:31:06 -05:00
Celtic Minstrel
26a1eb34e0 Lua mapgen bugfixes: size/jagged ignored for chamber
And wrong function name in scenario generation.
2016-10-31 18:23:50 -04:00
Celtic Minstrel
2dee1e5f96 Lua Cave Mapgen: Use stable iteration of location sets 2016-10-27 14:20:42 -04:00
Celtic Minstrel
0166235d99 Lua Cave Mapgen: Support flip_xy transform 2016-10-27 14:20:31 -04:00
Celtic Minstrel
495a5c681f Lua Cave Mapgen: Support scenario generation
The syntax is mostly the same as the old cave generator - a [scenario]
tag for general scenario data, and an [items] subtag of [chamber] for
chamber-specific data. However, the generator assumes that map locations
(from [item_location]) will be used and thus does not support
same_location_as_previous=yes in moveto events within [items].
2016-10-27 14:20:26 -04:00
Celtic Minstrel
510dfd65df Lua Cave Mapgen: Support random chance of flipping the map
This has a similar effect to the flipx_chance and flipy_chance in the old
cave generator, except only one flip will be applied.
2016-10-27 14:20:21 -04:00
Celtic Minstrel
7c715130d4 Lua Cave Mapgen: Support [chamber]chance=
The older cave generator supported it, so the new one should too.
2016-10-27 14:20:20 -04:00
Celtic Minstrel
46e31cb462 Refactor Lua cave map generator
This accomplishes two main things:
- Creates a mapgen_helper.lua module containing functions useful for Lua map generators
- Paves the way for allowing the cave generator to produce scenarios and accept user configuration
2016-10-27 14:20:18 -04:00
Celtic Minstrel
293151687c Fix number-nil comparison in [for] 2016-10-26 15:15:47 -04:00
Elvish_Hunter
63ac16702d [set_variable]: added support for abs=, root= and power= keys
root= currently supports only one value, "square" (returns the square root).
2016-10-26 20:20:05 +02:00
Gregory A Lundberg
36ab1f9a5c wesnoth.show_message_dialog: Don't expose has_input flag to Lua
Adjustment of PR 841 (as PR #843)
2016-10-26 00:51:38 -04:00
Gregory A Lundberg
a441fc97a2 Fix bug: Slow narrator (Partial 25186)
No need to deselect when it was already done.

While this is the fix for the specific complaint, it does not address the larger issue of [message] being generally slow.
2016-10-25 04:53:45 -05:00
Gregory A Lundberg
9d08723236 [text_input] Fix bug 25173
Added an internal flag to indicate [text_input] appeared so we no longer require label= to be present.
2016-10-24 21:58:26 -05:00
Gregory A Lundberg
edacf922fb Lua upgrade: integer indices
As of version 5.3, Lua converts a number which as an integer value to add ".0" to the end.

Updating mainline to avoid the issue.
2016-10-21 23:09:51 -05:00
Gregory A Lundberg
fc6774289e Upgrade deprecated Lua
loadstring was removed, load does the same thing.
atan2 was remvoed, atan works instead
2016-10-17 10:34:43 -05:00
Celtic Minstrel
79647ff9d9 helper.lua: set __metatable field to guard against external access to metatables 2016-10-10 17:41:23 -04:00
gfgtdf
c90f598c48 use wesnoth.fire_event instead of wesnoth.fire_event_by_name 2016-10-09 19:58:11 +02:00
Pentarctagon
9df77488e3 Update message.lua 2016-10-01 14:28:50 -05:00
Pentarctagon
05cf2ba6cf Add ability to display two portraits at once
Adds the keys: mirror, second_image, second_mirror.  These allow a portrait to be displayed on the right and left of a message simultaneously as well as to mirror them.
2016-10-01 14:28:12 -05:00
Celtic Minstrel
b563d8d8cd Put fixed passability check on separate line 2016-09-29 10:23:56 -04:00
ln-zookeeper
9dbb917b7b Fixed bug #25131: [move_unit] check_passability=no doesn't work 2016-09-29 10:28:28 +03:00
Gregory A Lundberg
3809a69a42 Fix bug: Lua harm_unit
Missing local T.

cf https://forums.wesnoth.org/viewtopic.php?f=21&t=44567
2016-09-19 17:40:41 -05:00
gfgtdf
60d114b606 finish moving cavegen (cave_map_generator.cpp) to lua.
This map generator is used in HttT 17 and SoF 4. which needed to be updated aswell.

With this we finally have a lua generator that is used in mainline and that
can be used an an example by wml authors who want to write other map generators.

Unfortunateley there are still umc add ons in 1.12 that use
scenario_generation=cave so i didn't remove the cpp implementation yet.
2016-09-17 20:52:49 +02:00
Gregory A Lundberg
6af699fdf3 Fix bug: 'text' is nil 2016-09-10 14:20:04 -05:00
Gregory A Lundberg
65134d6f0f [role] always error on missing role= 2016-09-01 20:14:15 -05:00
Celtic Minstrel
742b4b0be3 Fix an issue with translatable strings that included a possible plural 2016-08-31 21:01:17 -04:00
Celtic Minstrel
3f7db7f878 Give error on missing role= in [role] without [auto_recall] 2016-08-31 20:59:58 -04:00
Gregory A Lundberg
fcbb72d8d0 Fix bug [role] missing role=
Missing role for [role] caused runtime errors. Do NOT report an error on this; using an empty string is intentional. It allows type-prioritized recalls!

"I want to recall the two highest-level bowmen and, if needed, will recruit them. They don't have a role, and won't need one later."

        [repeat]
            times=2
            [do]
                [role]
                    search_recall_list=only
                    type=Master Bowman,Longbowman,Bowman
                    [auto_recall][/auto_recall]
                    [else]
                        [unit]
                            placement=leader
                            side=1
                            type=Bowman
                        [/unit]
                    [/else]
                [/role]
            [/do]
        [/repeat]
2016-08-31 12:51:00 -05:00
Celtic Minstrel
b24fdbcbe1 Merge pull request #759 from GregoryLundberg/GL_modify_unit_mode
Add mode=replace to [modify_unit]
2016-08-30 12:31:23 -04:00
Charles Dang
ae6b8f97f2 Temporary fix for broken Objective dialog formatting (f866039e81) 2016-08-30 18:55:17 +11:00
Celtic Minstrel
f866039e81 Add support for gettext plurals to Lua API 2016-08-29 16:47:17 -04:00
Gregory A Lundberg
82c3b0114d Add mode=replace to [modify_unit]
When specified, replace rather than merge the [unit] sub-tags. Does not effect [object], [trait], [effect] or [advancement].

For example:
    [modify_unit]
        [filter]
            id=Deoran
        [/filter]
        mode=replace

        [filter_recall]
            [not]
                id="Sir Gerrick"
            [/not]
        [/filter_recall]
    [/modify_unit]

will replace the current contents of [filter_recall] with the given contents. Without mode=replace, the contents would be appended to the previous contents.
2016-08-24 19:35:06 -05:00
Charles Dang
30fe0cecd8 Fixed bug in [unstore_unit] when unstoring from variable 2016-08-24 23:42:02 +11:00
Gregory A Lundberg
e1c39430de Remove dead code
Tested with just cfg.message and it comes out as info/wml which seems just fine.
2016-08-22 09:24:09 -05:00
Gregory A Lundberg
9d44a45f88 Fix bug with gender-specific messages in [message] 2016-08-19 20:43:50 -05:00
Gregory A Lundberg
f0ad540001 Add result variable to [message] tag
If [message] includes one or more [option] choices, store the choice index in the result variable.
2016-08-14 00:19:11 -05:00
Gregory A Lundberg
5f9a711dab Fix the fix (#746)
I have SO got to check I pressed Save before I press Commit! This time it bit me because it got merged so quickly.
2016-08-12 14:32:55 -04:00
Gregory A Lundberg
652c5b9b0d Do not select unit in silent object
This causes, for example, units the player does not control to be selected at the start of HttT S08, S11 and S16.
2016-08-12 13:16:07 -05:00
Celtic Minstrel
f4ac23a3c5 Allow [endlevel] to be used in victory or defeat events 2016-08-08 04:09:32 -04:00
fendrin
b9d2ec4409 Renamed [foreach] variable= to array= and item_var= to variable= 2016-08-06 06:20:41 +02:00
Charles Dang
7b22051c3c Merge pull request #721 from GregoryLundberg/GL_lua_objectives
objectives.lua show_turn_counter in white
2016-08-05 21:00:56 +11:00