mirror of
https://github.com/wesnoth/wesnoth
synced 2025-04-24 10:32:56 +00:00

This attribute, when set to a valid value of lawful|neutral|chaotic|liminal, will assign to the weapon a different alignment than the unit alignment used by default. This alignment is then used when attacking with this weapon. The attribute is not accessible from lua so far since the fallback to unit alignment does not work.
These files can be used to allow Lua linting tools to understand Wesnoth types and functions that are defined in C++. Documentation of the annotations format can be found here.
To enable in Visual Studio Code, install this Lua plugin and add the following settings to your settings.json:
"Lua.runtime.version": "Lua 5.4",
"Lua.type.weakNilCheck": true,
"Lua.type.weakUnionCheck": true,
"Lua.workspace.library": [
"./utils/emmylua"
],
"Lua.runtime.special": {
"wesnoth.require": "require",
"wesnoth.dofile": "dofile"
},
"Lua.runtime.builtin": {
"io": "disable",
"debug": "disable",
"os": "disable",
"package": "disable"
},
"Lua.diagnostics.globals": [
"wesnoth",
"wml",
"gui",
"filesystem",
"unit_test",
"stringx",
"mathx",
"ai"
]