Guest User

Untitled

a guest
May 23rd, 2018
97
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.14 KB | None | 0 0
  1. --#textdomain wesnoth-NX-RPG
  2. _ = wesnoth.textdomain "wesnoth-NX-RPG"
  3.  
  4. wml_actions = wesnoth.wml_actions
  5. helper = wesnoth.require "lua/helper.lua"
  6. T = helper.set_wml_tag_metatable {}
  7.  
  8. ---
  9. -- Removes the terrain overlay from every hex matching a given SLF.
  10. --
  11. -- [remove_terrain_overlays]
  12. -- ... SLF ...
  13. -- [/remove_terrain_overlays]
  14. ---
  15. function wesnoth.wml_actions.remove_terrain_overlays(cfg)
  16. local locs = wesnoth.get_locations(cfg)
  17.  
  18. for i, loc in ipairs(locs) do
  19. local locstr = wesnoth.get_terrain(loc[1], loc[2])
  20. wesnoth.set_terrain(loc[1], loc[2], string.gsub(locstr, "%^.*$", ""))
  21. end
  22. end
  23.  
  24. ---
  25. -- Used to see if a character has been found and developed
  26. --
  27. -- [check_for_character]
  28. -- ... SUF ...
  29. -- [/check_for_character]
  30. ---
  31. wml_actions.check_for_character(cfg)
  32. local unit_check = assert( side_one_units[i].id == wesnoth.match_units(wesnoth.get_units( { side = 1, id = cfg.id } ), { id = cfg.id } ) )
  33.  
  34. if unit_check == "true" then
  35. if wesnoth.get_variable(target_unit .. ".class") == "none" then
  36. wml_actions.fire_event("herodevel")
  37. end
  38. elseif unit_check == "false" then
  39. wml_actions.unit(cfg)
  40. wml_actions.fire_event("herodevel")
  41. end
  42. end
Add Comment
Please, Sign In to add comment