19 Commits

Author SHA1 Message Date
Pentarctagon
370d03ccb7 Fix luacheck warnings and add to CI.
Note the `exclude_files` in .luacheckrc should be deleted once the eventual Ubuntu 22.04 base image has an updated luacheck that supports lua 5.4.
2021-11-28 14:26:02 -06:00
Celtic Minstrel
1f62eae3ce Replace uses of wesnoth.find_path 2021-06-19 15:43:33 -04:00
Celtic Minstrel
1dccc3ad76 Update mainline content to use the mathx module 2021-05-08 17:20:49 -04:00
Celtic Minstrel
a019edb26c
Fix cave map generator producing passages along the map border
Maps are 0-indexed even in Lua (so that 1 ends up as the lowest passable coordinate), so subtract 1 here

Closes #5407
2021-02-16 13:46:01 -05:00
Celtic Minstrel
438b661494 Avoid map borders in cave generator
Addresses #5407
2021-02-15 18:35:54 -05:00
Celtic Minstrel
732b7942bb Replace all references to deprecated functions in the helper module
(and remove the require if this meant it was no longer used)
2019-12-02 01:10:34 -05:00
Charles Dang
0103959c36 Cleaned up deprecated API usage in core Lua
[ci skip]
2018-03-13 16:55:36 +11:00
Charles Dang
471c9e876a Addressed a large chunk of the whitespace issues from #2613
[ci skip]
2018-03-09 11:37:00 +11:00
vgaming
8ba6e5f40e fix code problems found by luacheck (#2380)
actual bugs found:
* backwards_compatibility.lua (undeclared global "helper")
* core.lua (use of undeclared global "helper")
* wml_tags.transform_unit had wrong code to deal with recall_cost
* wrong variable name in cave_map_generator
2018-01-20 23:05:58 -05:00
Celtic Minstrel
37f1c490a5 Lua: Use the second argument to error() where appropriate 2017-05-10 17:40:13 -04:00
Celtic Minstrel
8d4cf3cf62 Shorten requires where possible 2017-05-03 02:42:25 -04: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
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