Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --#textdomain wesnoth-NX-RPG
- _ = wesnoth.textdomain "wesnoth-NX-RPG"
- wml_actions = wesnoth.wml_actions
- helper = wesnoth.require "lua/helper.lua"
- T = helper.set_wml_tag_metatable {}
- ---
- -- Removes the terrain overlay from every hex matching a given SLF.
- --
- -- [remove_terrain_overlays]
- -- ... SLF ...
- -- [/remove_terrain_overlays]
- ---
- function wesnoth.wml_actions.remove_terrain_overlays(cfg)
- local locs = wesnoth.get_locations(cfg)
- for i, loc in ipairs(locs) do
- local locstr = wesnoth.get_terrain(loc[1], loc[2])
- wesnoth.set_terrain(loc[1], loc[2], string.gsub(locstr, "%^.*$", ""))
- end
- end
- ---
- -- Used to see if a character has been found and developed
- --
- -- [check_for_character]
- -- ... SUF ...
- -- [/check_for_character]
- ---
- wml_actions.check_for_character(cfg)
- local unit_check = assert( side_one_units[i].id == wesnoth.match_units(wesnoth.get_units( { side = 1, id = cfg.id } ), { id = cfg.id } ) )
- if unit_check == "true" then
- if wesnoth.get_variable(target_unit .. ".class") == "none" then
- wml_actions.fire_event("herodevel")
- end
- elseif unit_check == "false" then
- wml_actions.unit(cfg)
- wml_actions.fire_event("herodevel")
- end
- end
Add Comment
Please, Sign In to add comment