From 8d4cf3cf62f0e402cb8356dcd8a8155daf3e5bd8 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Tue, 2 May 2017 23:19:24 -0400 Subject: [PATCH] Shorten requires where possible --- data/ai/lua/ai_helper.lua | 4 +-- data/ai/lua/battle_calcs.lua | 4 +-- data/ai/lua/ca_high_xp_attack.lua | 4 +-- data/ai/lua/generic_recruit_engine.lua | 4 +-- data/ai/lua/generic_rush_engine.lua | 4 +-- data/ai/lua/retreat.lua | 4 +-- data/ai/micro_ais/cas/ca_assassin_move.lua | 4 +-- data/ai/micro_ais/cas/ca_big_animals.lua | 4 +-- .../ai/micro_ais/cas/ca_bottleneck_attack.lua | 2 +- data/ai/micro_ais/cas/ca_bottleneck_move.lua | 4 +-- data/ai/micro_ais/cas/ca_coward.lua | 2 +- .../ai/micro_ais/cas/ca_fast_attack_utils.lua | 4 +-- data/ai/micro_ais/cas/ca_fast_combat.lua | 4 +-- .../micro_ais/cas/ca_fast_combat_leader.lua | 4 +-- data/ai/micro_ais/cas/ca_fast_move.lua | 2 +- .../micro_ais/cas/ca_forest_animals_move.lua | 4 +-- .../cas/ca_forest_animals_new_rabbit.lua | 2 +- .../cas/ca_forest_animals_tusker_attack.lua | 2 +- .../cas/ca_forest_animals_tusklet_move.lua | 2 +- data/ai/micro_ais/cas/ca_goto.lua | 4 +-- data/ai/micro_ais/cas/ca_hang_out.lua | 4 +-- .../ai/micro_ais/cas/ca_healer_initialize.lua | 2 +- .../ai/micro_ais/cas/ca_healer_may_attack.lua | 2 +- data/ai/micro_ais/cas/ca_healer_move.lua | 4 +-- .../cas/ca_herding_attack_close_enemy.lua | 2 +- data/ai/micro_ais/cas/ca_herding_dog_move.lua | 4 +-- .../micro_ais/cas/ca_herding_dog_stopmove.lua | 2 +- .../cas/ca_herding_f_herding_area.lua | 4 +-- .../micro_ais/cas/ca_herding_herd_sheep.lua | 2 +- .../micro_ais/cas/ca_herding_sheep_move.lua | 2 +- .../cas/ca_herding_sheep_runs_dog.lua | 2 +- .../cas/ca_herding_sheep_runs_enemy.lua | 2 +- data/ai/micro_ais/cas/ca_hunter.lua | 2 +- data/ai/micro_ais/cas/ca_lurkers.lua | 4 +-- data/ai/micro_ais/cas/ca_messenger_attack.lua | 2 +- .../cas/ca_messenger_escort_move.lua | 4 +-- .../cas/ca_messenger_f_next_waypoint.lua | 2 +- data/ai/micro_ais/cas/ca_messenger_move.lua | 2 +- data/ai/micro_ais/cas/ca_patrol.lua | 2 +- .../micro_ais/cas/ca_protect_unit_attack.lua | 2 +- .../micro_ais/cas/ca_protect_unit_finish.lua | 2 +- .../ai/micro_ais/cas/ca_protect_unit_move.lua | 4 +-- data/ai/micro_ais/cas/ca_recruit_random.lua | 4 +-- data/ai/micro_ais/cas/ca_return_guardian.lua | 2 +- data/ai/micro_ais/cas/ca_simple_attack.lua | 4 +-- .../micro_ais/cas/ca_stationed_guardian.lua | 2 +- data/ai/micro_ais/cas/ca_swarm_move.lua | 2 +- data/ai/micro_ais/cas/ca_swarm_scatter.lua | 2 +- data/ai/micro_ais/cas/ca_wolves_move.lua | 2 +- .../cas/ca_wolves_multipacks_attack.lua | 2 +- .../cas/ca_wolves_multipacks_functions.lua | 2 +- .../cas/ca_wolves_multipacks_wander.lua | 4 +-- data/ai/micro_ais/cas/ca_wolves_wander.lua | 4 +-- data/ai/micro_ais/cas/ca_zone_guardian.lua | 4 +-- .../engines/priority_target_engine.lua | 2 +- data/ai/micro_ais/mai-defs/animals.lua | 2 +- data/ai/micro_ais/mai-defs/escort.lua | 2 +- data/ai/micro_ais/mai-defs/fast.lua | 2 +- data/ai/micro_ais/mai-defs/guardian.lua | 2 +- data/ai/micro_ais/mai-defs/patrol.lua | 2 +- data/ai/micro_ais/mai-defs/protect.lua | 2 +- data/ai/micro_ais/mai-defs/recruiting.lua | 2 +- data/ai/micro_ais/micro_ai_helper.lua | 2 +- data/ai/micro_ais/micro_ai_self_data.lua | 2 +- data/ai/micro_ais/micro_ai_unit_variables.lua | 2 +- data/ai/micro_ais/micro_ai_wml_tag.lua | 2 +- .../Eastern_Invasion/ai/ca_ogres_flee.lua | 4 +-- .../Eastern_Invasion/lua/bandits.lua | 2 +- .../scenarios/17_Scepter_of_Fire.cfg | 4 +-- .../Legend_of_Wesmere/lua/wml_tags.lua | 2 +- .../Northern_Rebirth/lua/respawn_utils.lua | 2 +- .../scenarios/4_Gathering_Materials.cfg | 2 +- .../ai/ca_transport_S6.lua | 4 +-- .../The_Hammer_of_Thursagan/lua/spawns.lua | 4 +-- .../tutorial/lua/character_selection.lua | 2 +- data/lua/backwards-compatibility.lua | 2 +- data/lua/cave_map_generator.lua | 6 ++-- data/lua/feeding.lua | 4 +-- data/lua/mapgen_helper.lua | 2 +- data/lua/on_event.lua | 2 +- data/lua/wml-flow.lua | 4 +-- data/lua/wml-tags.lua | 32 +++++++++---------- data/lua/wml-utils.lua | 2 +- data/lua/wml/animate_unit.lua | 2 +- data/lua/wml/endlevel.lua | 2 +- data/lua/wml/find_path.lua | 4 +-- data/lua/wml/harm_unit.lua | 4 +-- data/lua/wml/items.lua | 2 +- data/lua/wml/message.lua | 6 ++-- data/lua/wml/modify_unit.lua | 4 +-- data/lua/wml/object.lua | 4 +-- data/lua/wml/objectives.lua | 2 +- data/lua/wml/random_placement.lua | 4 +-- data/multiplayer/eras.lua | 2 +- .../scenarios/2p_Dark_Forecast.lua | 4 +-- data/scenario-test.cfg | 12 +++---- data/test/scenarios/ai/_main.cfg | 2 +- data/test/scenarios/interrupts.cfg | 2 +- 98 files changed, 160 insertions(+), 160 deletions(-) diff --git a/data/ai/lua/ai_helper.lua b/data/ai/lua/ai_helper.lua index 9ddf3669452f..08ff77fa2024 100644 --- a/data/ai/lua/ai_helper.lua +++ b/data/ai/lua/ai_helper.lua @@ -1,6 +1,6 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local W = H.set_wml_action_metatable {} -local LS = wesnoth.require "lua/location_set.lua" +local LS = wesnoth.require "location_set" -- This is a collection of Lua functions used for custom AI development. -- Note that this is still work in progress with significant changes occurring diff --git a/data/ai/lua/battle_calcs.lua b/data/ai/lua/battle_calcs.lua index c3cfbec45b1e..48334a9ef848 100644 --- a/data/ai/lua/battle_calcs.lua +++ b/data/ai/lua/battle_calcs.lua @@ -1,6 +1,6 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" -local LS = wesnoth.require "lua/location_set.lua" +local LS = wesnoth.require "location_set" -- This is a collection of Lua functions used for custom AI development. -- Note that this is still work in progress with significant changes occurring diff --git a/data/ai/lua/ca_high_xp_attack.lua b/data/ai/lua/ca_high_xp_attack.lua index 3b1d517c6c25..0551961e6c62 100644 --- a/data/ai/lua/ca_high_xp_attack.lua +++ b/data/ai/lua/ca_high_xp_attack.lua @@ -1,6 +1,6 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" -local LS = wesnoth.require "lua/location_set.lua" +local LS = wesnoth.require "location_set" -- Evaluation process: -- diff --git a/data/ai/lua/generic_recruit_engine.lua b/data/ai/lua/generic_recruit_engine.lua index a47e40c5aca3..00d920f4ce6d 100644 --- a/data/ai/lua/generic_recruit_engine.lua +++ b/data/ai/lua/generic_recruit_engine.lua @@ -23,10 +23,10 @@ return { end math.randomseed(os.time()) - local H = wesnoth.require "lua/helper.lua" + local H = wesnoth.require "helper" local W = H.set_wml_action_metatable {} local AH = wesnoth.require "ai/lua/ai_helper.lua" - local LS = wesnoth.require "lua/location_set.lua" + local LS = wesnoth.require "location_set" local function print_time(...) if turn_start_time then diff --git a/data/ai/lua/generic_rush_engine.lua b/data/ai/lua/generic_rush_engine.lua index a298fadcb4d7..50f640553886 100644 --- a/data/ai/lua/generic_rush_engine.lua +++ b/data/ai/lua/generic_rush_engine.lua @@ -6,11 +6,11 @@ return { -- More generic grunt rush (and can, in fact, be used with other unit types as well) - local H = wesnoth.require "lua/helper.lua" + local H = wesnoth.require "helper" local W = H.set_wml_action_metatable {} local AH = wesnoth.require "ai/lua/ai_helper.lua" local BC = wesnoth.require "ai/lua/battle_calcs.lua" - local LS = wesnoth.require "lua/location_set.lua" + local LS = wesnoth.require "location_set" local HS = wesnoth.require "ai/micro_ais/cas/ca_healer_move.lua" local R = wesnoth.require "ai/lua/retreat.lua" diff --git a/data/ai/lua/retreat.lua b/data/ai/lua/retreat.lua index 67cececd2da3..65028f116c49 100644 --- a/data/ai/lua/retreat.lua +++ b/data/ai/lua/retreat.lua @@ -2,10 +2,10 @@ Functions to support the retreat of injured units ]=] -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local BC = wesnoth.require "ai/lua/battle_calcs.lua" -local LS = wesnoth.require "lua/location_set.lua" +local LS = wesnoth.require "location_set" local retreat_functions = {} diff --git a/data/ai/micro_ais/cas/ca_assassin_move.lua b/data/ai/micro_ais/cas/ca_assassin_move.lua index 5c53344e6ccd..8bc139057688 100644 --- a/data/ai/micro_ais/cas/ca_assassin_move.lua +++ b/data/ai/micro_ais/cas/ca_assassin_move.lua @@ -1,6 +1,6 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" -local LS = wesnoth.require "lua/location_set.lua" +local LS = wesnoth.require "location_set" local function get_units_target(cfg) local units = AH.get_units_with_moves { diff --git a/data/ai/micro_ais/cas/ca_big_animals.lua b/data/ai/micro_ais/cas/ca_big_animals.lua index 4990fe8dc198..c72e6e9b62e5 100644 --- a/data/ai/micro_ais/cas/ca_big_animals.lua +++ b/data/ai/micro_ais/cas/ca_big_animals.lua @@ -1,6 +1,6 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" -local LS = wesnoth.require "lua/location_set.lua" +local LS = wesnoth.require "location_set" local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua" local function get_big_animals(cfg) diff --git a/data/ai/micro_ais/cas/ca_bottleneck_attack.lua b/data/ai/micro_ais/cas/ca_bottleneck_attack.lua index 8c256f934791..af2214908871 100644 --- a/data/ai/micro_ais/cas/ca_bottleneck_attack.lua +++ b/data/ai/micro_ais/cas/ca_bottleneck_attack.lua @@ -1,5 +1,5 @@ local AH = wesnoth.require "ai/lua/ai_helper.lua" -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local ca_bottleneck_attack = {} diff --git a/data/ai/micro_ais/cas/ca_bottleneck_move.lua b/data/ai/micro_ais/cas/ca_bottleneck_move.lua index 8019c3054f79..cfa4440b05b7 100644 --- a/data/ai/micro_ais/cas/ca_bottleneck_move.lua +++ b/data/ai/micro_ais/cas/ca_bottleneck_move.lua @@ -1,5 +1,5 @@ -local H = wesnoth.require "lua/helper.lua" -local LS = wesnoth.require "lua/location_set.lua" +local H = wesnoth.require "helper" +local LS = wesnoth.require "location_set" local AH = wesnoth.require "ai/lua/ai_helper.lua" local BC = wesnoth.require "ai/lua/battle_calcs.lua" local MAISD = wesnoth.require "ai/micro_ais/micro_ai_self_data.lua" diff --git a/data/ai/micro_ais/cas/ca_coward.lua b/data/ai/micro_ais/cas/ca_coward.lua index 5c29bf2cb0db..82a563a22c09 100644 --- a/data/ai/micro_ais/cas/ca_coward.lua +++ b/data/ai/micro_ais/cas/ca_coward.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local function get_coward(cfg) diff --git a/data/ai/micro_ais/cas/ca_fast_attack_utils.lua b/data/ai/micro_ais/cas/ca_fast_attack_utils.lua index bf0d8be1163e..b5746f44e9a0 100644 --- a/data/ai/micro_ais/cas/ca_fast_attack_utils.lua +++ b/data/ai/micro_ais/cas/ca_fast_attack_utils.lua @@ -1,6 +1,6 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" -local LS = wesnoth.require "lua/location_set.lua" +local LS = wesnoth.require "location_set" local T = H.set_wml_tag_metatable{} -- Functions to perform fast evaluation of attacks and attack combinations. diff --git a/data/ai/micro_ais/cas/ca_fast_combat.lua b/data/ai/micro_ais/cas/ca_fast_combat.lua index b5ca6b223aa7..e8d2e8e4f084 100644 --- a/data/ai/micro_ais/cas/ca_fast_combat.lua +++ b/data/ai/micro_ais/cas/ca_fast_combat.lua @@ -1,7 +1,7 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local FAU = wesnoth.require "ai/micro_ais/cas/ca_fast_attack_utils.lua" -local LS = wesnoth.require "lua/location_set.lua" +local LS = wesnoth.require "location_set" local ca_fast_combat = {} diff --git a/data/ai/micro_ais/cas/ca_fast_combat_leader.lua b/data/ai/micro_ais/cas/ca_fast_combat_leader.lua index 7bdaa1301905..328886d446ac 100644 --- a/data/ai/micro_ais/cas/ca_fast_combat_leader.lua +++ b/data/ai/micro_ais/cas/ca_fast_combat_leader.lua @@ -1,7 +1,7 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local FAU = wesnoth.require "ai/micro_ais/cas/ca_fast_attack_utils.lua" -local LS = wesnoth.require "lua/location_set.lua" +local LS = wesnoth.require "location_set" local ca_fast_combat_leader = {} diff --git a/data/ai/micro_ais/cas/ca_fast_move.lua b/data/ai/micro_ais/cas/ca_fast_move.lua index 5c8434116aab..8597b2dec2f0 100644 --- a/data/ai/micro_ais/cas/ca_fast_move.lua +++ b/data/ai/micro_ais/cas/ca_fast_move.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local FAU = wesnoth.require "ai/micro_ais/cas/ca_fast_attack_utils.lua" diff --git a/data/ai/micro_ais/cas/ca_forest_animals_move.lua b/data/ai/micro_ais/cas/ca_forest_animals_move.lua index a8aa06d64276..a03b4a1accb5 100644 --- a/data/ai/micro_ais/cas/ca_forest_animals_move.lua +++ b/data/ai/micro_ais/cas/ca_forest_animals_move.lua @@ -1,7 +1,7 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local W = H.set_wml_action_metatable {} local AH = wesnoth.require "ai/lua/ai_helper.lua" -local LS = wesnoth.require "lua/location_set.lua" +local LS = wesnoth.require "location_set" local function get_forest_animals(cfg) -- We want the deer/rabbits to move first, tuskers afterward diff --git a/data/ai/micro_ais/cas/ca_forest_animals_new_rabbit.lua b/data/ai/micro_ais/cas/ca_forest_animals_new_rabbit.lua index dc75f6ef3e67..05c8b414951e 100644 --- a/data/ai/micro_ais/cas/ca_forest_animals_new_rabbit.lua +++ b/data/ai/micro_ais/cas/ca_forest_animals_new_rabbit.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local W = H.set_wml_action_metatable {} local AH = wesnoth.require "ai/lua/ai_helper.lua" diff --git a/data/ai/micro_ais/cas/ca_forest_animals_tusker_attack.lua b/data/ai/micro_ais/cas/ca_forest_animals_tusker_attack.lua index 3634b4524ab2..2db2fb590252 100644 --- a/data/ai/micro_ais/cas/ca_forest_animals_tusker_attack.lua +++ b/data/ai/micro_ais/cas/ca_forest_animals_tusker_attack.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local function get_tuskers(cfg) diff --git a/data/ai/micro_ais/cas/ca_forest_animals_tusklet_move.lua b/data/ai/micro_ais/cas/ca_forest_animals_tusklet_move.lua index 92fb45b76370..e1834436582d 100644 --- a/data/ai/micro_ais/cas/ca_forest_animals_tusklet_move.lua +++ b/data/ai/micro_ais/cas/ca_forest_animals_tusklet_move.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local function get_tusklets(cfg) diff --git a/data/ai/micro_ais/cas/ca_goto.lua b/data/ai/micro_ais/cas/ca_goto.lua index 3771df3fe86e..1e8b8b0b2df2 100644 --- a/data/ai/micro_ais/cas/ca_goto.lua +++ b/data/ai/micro_ais/cas/ca_goto.lua @@ -1,7 +1,7 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local BC = wesnoth.require "ai/lua/battle_calcs.lua" -local LS = wesnoth.require "lua/location_set.lua" +local LS = wesnoth.require "location_set" local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua" local MAISD = wesnoth.require "ai/micro_ais/micro_ai_self_data.lua" diff --git a/data/ai/micro_ais/cas/ca_hang_out.lua b/data/ai/micro_ais/cas/ca_hang_out.lua index 01e7f4216acd..e292640e7aca 100644 --- a/data/ai/micro_ais/cas/ca_hang_out.lua +++ b/data/ai/micro_ais/cas/ca_hang_out.lua @@ -1,6 +1,6 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" -local LS = wesnoth.require "lua/location_set.lua" +local LS = wesnoth.require "location_set" local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua" local MAISD = wesnoth.require "ai/micro_ais/micro_ai_self_data.lua" diff --git a/data/ai/micro_ais/cas/ca_healer_initialize.lua b/data/ai/micro_ais/cas/ca_healer_initialize.lua index 2cd96ff266a5..02eae979f0bd 100644 --- a/data/ai/micro_ais/cas/ca_healer_initialize.lua +++ b/data/ai/micro_ais/cas/ca_healer_initialize.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local ca_healer_initialize = {} diff --git a/data/ai/micro_ais/cas/ca_healer_may_attack.lua b/data/ai/micro_ais/cas/ca_healer_may_attack.lua index ea694e92535b..a4cd5142ae8d 100644 --- a/data/ai/micro_ais/cas/ca_healer_may_attack.lua +++ b/data/ai/micro_ais/cas/ca_healer_may_attack.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local ca_healer_may_attack = {} diff --git a/data/ai/micro_ais/cas/ca_healer_move.lua b/data/ai/micro_ais/cas/ca_healer_move.lua index 8e5807015cb2..01bc93f018d6 100644 --- a/data/ai/micro_ais/cas/ca_healer_move.lua +++ b/data/ai/micro_ais/cas/ca_healer_move.lua @@ -1,5 +1,5 @@ -local H = wesnoth.require "lua/helper.lua" -local LS = wesnoth.require "lua/location_set.lua" +local H = wesnoth.require "helper" +local LS = wesnoth.require "location_set" local AH = wesnoth.require "ai/lua/ai_helper.lua" local BC = wesnoth.require "ai/lua/battle_calcs.lua" diff --git a/data/ai/micro_ais/cas/ca_herding_attack_close_enemy.lua b/data/ai/micro_ais/cas/ca_herding_attack_close_enemy.lua index 5ebebd854624..d0ad4c255ade 100644 --- a/data/ai/micro_ais/cas/ca_herding_attack_close_enemy.lua +++ b/data/ai/micro_ais/cas/ca_herding_attack_close_enemy.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local function get_sheep(cfg) diff --git a/data/ai/micro_ais/cas/ca_herding_dog_move.lua b/data/ai/micro_ais/cas/ca_herding_dog_move.lua index 73e8d74e298a..85cdd8fd3b76 100644 --- a/data/ai/micro_ais/cas/ca_herding_dog_move.lua +++ b/data/ai/micro_ais/cas/ca_herding_dog_move.lua @@ -1,6 +1,6 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" -local LS = wesnoth.require "lua/location_set.lua" +local LS = wesnoth.require "location_set" local function get_dog(cfg) local dogs = AH.get_units_with_moves { diff --git a/data/ai/micro_ais/cas/ca_herding_dog_stopmove.lua b/data/ai/micro_ais/cas/ca_herding_dog_stopmove.lua index 48f67e4e79b4..9f86bc6cc93e 100644 --- a/data/ai/micro_ais/cas/ca_herding_dog_stopmove.lua +++ b/data/ai/micro_ais/cas/ca_herding_dog_stopmove.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local function get_dog(cfg) diff --git a/data/ai/micro_ais/cas/ca_herding_f_herding_area.lua b/data/ai/micro_ais/cas/ca_herding_f_herding_area.lua index 98d19d9bd150..1a04ecf2ff22 100644 --- a/data/ai/micro_ais/cas/ca_herding_f_herding_area.lua +++ b/data/ai/micro_ais/cas/ca_herding_f_herding_area.lua @@ -1,5 +1,5 @@ -local H = wesnoth.require "lua/helper.lua" -local LS = wesnoth.require "lua/location_set.lua" +local H = wesnoth.require "helper" +local LS = wesnoth.require "location_set" return function(cfg) -- Find the area that the sheep can occupy diff --git a/data/ai/micro_ais/cas/ca_herding_herd_sheep.lua b/data/ai/micro_ais/cas/ca_herding_herd_sheep.lua index 906224c707aa..3ffc80a48919 100644 --- a/data/ai/micro_ais/cas/ca_herding_herd_sheep.lua +++ b/data/ai/micro_ais/cas/ca_herding_herd_sheep.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local herding_area = wesnoth.require "ai/micro_ais/cas/ca_herding_f_herding_area.lua" diff --git a/data/ai/micro_ais/cas/ca_herding_sheep_move.lua b/data/ai/micro_ais/cas/ca_herding_sheep_move.lua index 3e9e08799592..fa86532da13e 100644 --- a/data/ai/micro_ais/cas/ca_herding_sheep_move.lua +++ b/data/ai/micro_ais/cas/ca_herding_sheep_move.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local herding_area = wesnoth.require "ai/micro_ais/cas/ca_herding_f_herding_area.lua" diff --git a/data/ai/micro_ais/cas/ca_herding_sheep_runs_dog.lua b/data/ai/micro_ais/cas/ca_herding_sheep_runs_dog.lua index 32b6c7d31b49..feb619dc3653 100644 --- a/data/ai/micro_ais/cas/ca_herding_sheep_runs_dog.lua +++ b/data/ai/micro_ais/cas/ca_herding_sheep_runs_dog.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local function get_next_sheep(cfg) diff --git a/data/ai/micro_ais/cas/ca_herding_sheep_runs_enemy.lua b/data/ai/micro_ais/cas/ca_herding_sheep_runs_enemy.lua index 4fce62dc0ba6..952b53ef5191 100644 --- a/data/ai/micro_ais/cas/ca_herding_sheep_runs_enemy.lua +++ b/data/ai/micro_ais/cas/ca_herding_sheep_runs_enemy.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local function get_next_sheep_enemies(cfg) diff --git a/data/ai/micro_ais/cas/ca_hunter.lua b/data/ai/micro_ais/cas/ca_hunter.lua index 67f7e4c0c8e9..b52ac46e9cff 100644 --- a/data/ai/micro_ais/cas/ca_hunter.lua +++ b/data/ai/micro_ais/cas/ca_hunter.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local W = H.set_wml_action_metatable {} local AH = wesnoth.require "ai/lua/ai_helper.lua" local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua" diff --git a/data/ai/micro_ais/cas/ca_lurkers.lua b/data/ai/micro_ais/cas/ca_lurkers.lua index 892b96a1cff9..79d4bfe91b5a 100644 --- a/data/ai/micro_ais/cas/ca_lurkers.lua +++ b/data/ai/micro_ais/cas/ca_lurkers.lua @@ -1,6 +1,6 @@ -local LS = wesnoth.require "lua/location_set.lua" +local LS = wesnoth.require "location_set" local AH = wesnoth.require "ai/lua/ai_helper.lua" -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local function get_lurker(cfg) -- We simply pick the first of the lurkers, they have no strategy diff --git a/data/ai/micro_ais/cas/ca_messenger_attack.lua b/data/ai/micro_ais/cas/ca_messenger_attack.lua index 54d5c8726641..8192c9fe8072 100644 --- a/data/ai/micro_ais/cas/ca_messenger_attack.lua +++ b/data/ai/micro_ais/cas/ca_messenger_attack.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local messenger_next_waypoint = wesnoth.require "ai/micro_ais/cas/ca_messenger_f_next_waypoint.lua" diff --git a/data/ai/micro_ais/cas/ca_messenger_escort_move.lua b/data/ai/micro_ais/cas/ca_messenger_escort_move.lua index 90b4660f8954..96c17ead0a01 100644 --- a/data/ai/micro_ais/cas/ca_messenger_escort_move.lua +++ b/data/ai/micro_ais/cas/ca_messenger_escort_move.lua @@ -1,6 +1,6 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" -local LS = wesnoth.require "lua/location_set.lua" +local LS = wesnoth.require "location_set" local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua" local messenger_next_waypoint = wesnoth.require "ai/micro_ais/cas/ca_messenger_f_next_waypoint.lua" diff --git a/data/ai/micro_ais/cas/ca_messenger_f_next_waypoint.lua b/data/ai/micro_ais/cas/ca_messenger_f_next_waypoint.lua index efec1cc2a4a5..b3e9b1b20d22 100644 --- a/data/ai/micro_ais/cas/ca_messenger_f_next_waypoint.lua +++ b/data/ai/micro_ais/cas/ca_messenger_f_next_waypoint.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua" diff --git a/data/ai/micro_ais/cas/ca_messenger_move.lua b/data/ai/micro_ais/cas/ca_messenger_move.lua index 528bf8ed38b0..813dd4451601 100644 --- a/data/ai/micro_ais/cas/ca_messenger_move.lua +++ b/data/ai/micro_ais/cas/ca_messenger_move.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local messenger_next_waypoint = wesnoth.require "ai/micro_ais/cas/ca_messenger_f_next_waypoint.lua" diff --git a/data/ai/micro_ais/cas/ca_patrol.lua b/data/ai/micro_ais/cas/ca_patrol.lua index 0494421200b6..6e8384f4a1d4 100644 --- a/data/ai/micro_ais/cas/ca_patrol.lua +++ b/data/ai/micro_ais/cas/ca_patrol.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua" diff --git a/data/ai/micro_ais/cas/ca_protect_unit_attack.lua b/data/ai/micro_ais/cas/ca_protect_unit_attack.lua index 4095127bc900..a25accde44ce 100644 --- a/data/ai/micro_ais/cas/ca_protect_unit_attack.lua +++ b/data/ai/micro_ais/cas/ca_protect_unit_attack.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local BC = wesnoth.require "ai/lua/battle_calcs.lua" diff --git a/data/ai/micro_ais/cas/ca_protect_unit_finish.lua b/data/ai/micro_ais/cas/ca_protect_unit_finish.lua index 029dae7ab279..875f3fb55fab 100644 --- a/data/ai/micro_ais/cas/ca_protect_unit_finish.lua +++ b/data/ai/micro_ais/cas/ca_protect_unit_finish.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local ca_protect_unit_finish, PU_unit, PU_goal = {} diff --git a/data/ai/micro_ais/cas/ca_protect_unit_move.lua b/data/ai/micro_ais/cas/ca_protect_unit_move.lua index 6697db43eba5..a424dfc1405a 100644 --- a/data/ai/micro_ais/cas/ca_protect_unit_move.lua +++ b/data/ai/micro_ais/cas/ca_protect_unit_move.lua @@ -1,5 +1,5 @@ -local H = wesnoth.require "lua/helper.lua" -local LS = wesnoth.require "lua/location_set.lua" +local H = wesnoth.require "helper" +local LS = wesnoth.require "location_set" local AH = wesnoth.require "ai/lua/ai_helper.lua" local BC = wesnoth.require "ai/lua/battle_calcs.lua" diff --git a/data/ai/micro_ais/cas/ca_recruit_random.lua b/data/ai/micro_ais/cas/ca_recruit_random.lua index 3bdadd2253f8..88c07e3b35cf 100644 --- a/data/ai/micro_ais/cas/ca_recruit_random.lua +++ b/data/ai/micro_ais/cas/ca_recruit_random.lua @@ -1,6 +1,6 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require("ai/lua/ai_helper.lua") -local LS = wesnoth.require "lua/location_set.lua" +local LS = wesnoth.require "location_set" local recruit_type diff --git a/data/ai/micro_ais/cas/ca_return_guardian.lua b/data/ai/micro_ais/cas/ca_return_guardian.lua index 2ff3f748d551..404dd22fc96e 100644 --- a/data/ai/micro_ais/cas/ca_return_guardian.lua +++ b/data/ai/micro_ais/cas/ca_return_guardian.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local function get_guardian(cfg) diff --git a/data/ai/micro_ais/cas/ca_simple_attack.lua b/data/ai/micro_ais/cas/ca_simple_attack.lua index b3a603d650fd..760d533db174 100644 --- a/data/ai/micro_ais/cas/ca_simple_attack.lua +++ b/data/ai/micro_ais/cas/ca_simple_attack.lua @@ -1,7 +1,7 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local BC = wesnoth.require "ai/lua/battle_calcs.lua" -local LS = wesnoth.require "lua/location_set.lua" +local LS = wesnoth.require "location_set" local ca_simple_attack, best_attack = {} diff --git a/data/ai/micro_ais/cas/ca_stationed_guardian.lua b/data/ai/micro_ais/cas/ca_stationed_guardian.lua index b8d6bcdaa424..bac9e9cb6c8f 100644 --- a/data/ai/micro_ais/cas/ca_stationed_guardian.lua +++ b/data/ai/micro_ais/cas/ca_stationed_guardian.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local function get_guardian(cfg) diff --git a/data/ai/micro_ais/cas/ca_swarm_move.lua b/data/ai/micro_ais/cas/ca_swarm_move.lua index 6630f9963869..06a83c49d95d 100644 --- a/data/ai/micro_ais/cas/ca_swarm_move.lua +++ b/data/ai/micro_ais/cas/ca_swarm_move.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local ca_swarm_move = {} diff --git a/data/ai/micro_ais/cas/ca_swarm_scatter.lua b/data/ai/micro_ais/cas/ca_swarm_scatter.lua index f07f892e976d..7969572f20a9 100644 --- a/data/ai/micro_ais/cas/ca_swarm_scatter.lua +++ b/data/ai/micro_ais/cas/ca_swarm_scatter.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local function get_enemies(cfg) diff --git a/data/ai/micro_ais/cas/ca_wolves_move.lua b/data/ai/micro_ais/cas/ca_wolves_move.lua index 7432cb765002..42d89de542c7 100644 --- a/data/ai/micro_ais/cas/ca_wolves_move.lua +++ b/data/ai/micro_ais/cas/ca_wolves_move.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local BC = wesnoth.require "ai/lua/battle_calcs.lua" diff --git a/data/ai/micro_ais/cas/ca_wolves_multipacks_attack.lua b/data/ai/micro_ais/cas/ca_wolves_multipacks_attack.lua index 97dbb5f09ba4..be4f09d61f89 100644 --- a/data/ai/micro_ais/cas/ca_wolves_multipacks_attack.lua +++ b/data/ai/micro_ais/cas/ca_wolves_multipacks_attack.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua" local WMPF = wesnoth.require "ai/micro_ais/cas/ca_wolves_multipacks_functions.lua" diff --git a/data/ai/micro_ais/cas/ca_wolves_multipacks_functions.lua b/data/ai/micro_ais/cas/ca_wolves_multipacks_functions.lua index f67a20b0c81f..45bd8b5beaf4 100644 --- a/data/ai/micro_ais/cas/ca_wolves_multipacks_functions.lua +++ b/data/ai/micro_ais/cas/ca_wolves_multipacks_functions.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local W = H.set_wml_action_metatable {} local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua" diff --git a/data/ai/micro_ais/cas/ca_wolves_multipacks_wander.lua b/data/ai/micro_ais/cas/ca_wolves_multipacks_wander.lua index ce911356888d..802612ecf0c7 100644 --- a/data/ai/micro_ais/cas/ca_wolves_multipacks_wander.lua +++ b/data/ai/micro_ais/cas/ca_wolves_multipacks_wander.lua @@ -1,7 +1,7 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua" -local LS = wesnoth.require "lua/location_set.lua" +local LS = wesnoth.require "location_set" local WMPF = wesnoth.require "ai/micro_ais/cas/ca_wolves_multipacks_functions.lua" local ca_wolves_multipacks_wander = {} diff --git a/data/ai/micro_ais/cas/ca_wolves_wander.lua b/data/ai/micro_ais/cas/ca_wolves_wander.lua index 2be9874df4f0..f40b81b3f4bc 100644 --- a/data/ai/micro_ais/cas/ca_wolves_wander.lua +++ b/data/ai/micro_ais/cas/ca_wolves_wander.lua @@ -1,7 +1,7 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local BC = wesnoth.require "ai/lua/battle_calcs.lua" -local LS = wesnoth.require "lua/location_set.lua" +local LS = wesnoth.require "location_set" local function get_wolves(cfg) local wolves = AH.get_units_with_moves { diff --git a/data/ai/micro_ais/cas/ca_zone_guardian.lua b/data/ai/micro_ais/cas/ca_zone_guardian.lua index c082c182291e..2edecacb88de 100644 --- a/data/ai/micro_ais/cas/ca_zone_guardian.lua +++ b/data/ai/micro_ais/cas/ca_zone_guardian.lua @@ -1,6 +1,6 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" -local LS = wesnoth.require "lua/location_set.lua" +local LS = wesnoth.require "location_set" local function get_guardian(cfg) local filter = H.get_child(cfg, "filter") or { id = cfg.id } diff --git a/data/ai/micro_ais/engines/priority_target_engine.lua b/data/ai/micro_ais/engines/priority_target_engine.lua index 12749edb1df5..d4d4c39beb8f 100644 --- a/data/ai/micro_ais/engines/priority_target_engine.lua +++ b/data/ai/micro_ais/engines/priority_target_engine.lua @@ -2,7 +2,7 @@ return { init = function() local priority_target = {} - local H = wesnoth.require "lua/helper.lua" + local H = wesnoth.require "helper" local W = H.set_wml_action_metatable {} local AH = wesnoth.require "ai/lua/ai_helper.lua" diff --git a/data/ai/micro_ais/mai-defs/animals.lua b/data/ai/micro_ais/mai-defs/animals.lua index 631a11b34d91..79ad107247c0 100644 --- a/data/ai/micro_ais/mai-defs/animals.lua +++ b/data/ai/micro_ais/mai-defs/animals.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local MAIH = wesnoth.require("ai/micro_ais/micro_ai_helper.lua") function wesnoth.micro_ais.big_animals(cfg) diff --git a/data/ai/micro_ais/mai-defs/escort.lua b/data/ai/micro_ais/mai-defs/escort.lua index f6a597f5fa33..a3dd9beeef71 100644 --- a/data/ai/micro_ais/mai-defs/escort.lua +++ b/data/ai/micro_ais/mai-defs/escort.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" function wesnoth.micro_ais.messenger_escort(cfg) if (cfg.action ~= 'delete') and (not cfg.id) and (not H.get_child(cfg, "filter")) then diff --git a/data/ai/micro_ais/mai-defs/fast.lua b/data/ai/micro_ais/mai-defs/fast.lua index 1f1a59941213..0723598fe83b 100644 --- a/data/ai/micro_ais/mai-defs/fast.lua +++ b/data/ai/micro_ais/mai-defs/fast.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" function wesnoth.micro_ais.fast_ai(cfg) local optional_keys = { diff --git a/data/ai/micro_ais/mai-defs/guardian.lua b/data/ai/micro_ais/mai-defs/guardian.lua index 63d424f1703d..fe8a9d55b2f5 100644 --- a/data/ai/micro_ais/mai-defs/guardian.lua +++ b/data/ai/micro_ais/mai-defs/guardian.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" function wesnoth.micro_ais.stationed_guardian(cfg) if (cfg.action ~= 'delete') and (not cfg.id) and (not H.get_child(cfg, "filter")) then diff --git a/data/ai/micro_ais/mai-defs/patrol.lua b/data/ai/micro_ais/mai-defs/patrol.lua index 806042c68d56..82d9e5a1deb1 100644 --- a/data/ai/micro_ais/mai-defs/patrol.lua +++ b/data/ai/micro_ais/mai-defs/patrol.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" function wesnoth.micro_ais.patrol(cfg) if (cfg.action ~= 'delete') and (not cfg.id) and (not H.get_child(cfg, "filter")) then diff --git a/data/ai/micro_ais/mai-defs/protect.lua b/data/ai/micro_ais/mai-defs/protect.lua index f88a038e8974..6744b0bcdee4 100644 --- a/data/ai/micro_ais/mai-defs/protect.lua +++ b/data/ai/micro_ais/mai-defs/protect.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local MAIH = wesnoth.require("ai/micro_ais/micro_ai_helper.lua") function wesnoth.micro_ais.protect_unit(cfg) diff --git a/data/ai/micro_ais/mai-defs/recruiting.lua b/data/ai/micro_ais/mai-defs/recruiting.lua index cdff152ed698..a3cbed0f9c31 100644 --- a/data/ai/micro_ais/mai-defs/recruiting.lua +++ b/data/ai/micro_ais/mai-defs/recruiting.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local function handle_default_recruitment(cfg) -- Also need to delete/add the default recruitment CA diff --git a/data/ai/micro_ais/micro_ai_helper.lua b/data/ai/micro_ais/micro_ai_helper.lua index 800072745d5a..0957052f4236 100644 --- a/data/ai/micro_ais/micro_ai_helper.lua +++ b/data/ai/micro_ais/micro_ai_helper.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local T = H.set_wml_tag_metatable {} local AH = wesnoth.require("ai/lua/ai_helper.lua") local MAIUV = wesnoth.require "ai/micro_ais/micro_ai_unit_variables.lua" diff --git a/data/ai/micro_ais/micro_ai_self_data.lua b/data/ai/micro_ais/micro_ai_self_data.lua index 2da4bc7df465..12f0f91c51c8 100644 --- a/data/ai/micro_ais/micro_ai_self_data.lua +++ b/data/ai/micro_ais/micro_ai_self_data.lua @@ -13,7 +13,7 @@ -- same side). -- For the time being, we only allow key=value style variables. -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local micro_ai_self_data = {} diff --git a/data/ai/micro_ais/micro_ai_unit_variables.lua b/data/ai/micro_ais/micro_ai_unit_variables.lua index 09db9e395b7d..9fc1393c56f8 100644 --- a/data/ai/micro_ais/micro_ai_unit_variables.lua +++ b/data/ai/micro_ais/micro_ai_unit_variables.lua @@ -9,7 +9,7 @@ -- with different ai_CA values affecting the same unit) -- For the time being, we only allow key=value style variables. -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local micro_ai_unit_variables = {} diff --git a/data/ai/micro_ais/micro_ai_wml_tag.lua b/data/ai/micro_ais/micro_ai_wml_tag.lua index 9c5c4e843231..0fd46b6c1f06 100644 --- a/data/ai/micro_ais/micro_ai_wml_tag.lua +++ b/data/ai/micro_ais/micro_ai_wml_tag.lua @@ -1,4 +1,4 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local W = H.set_wml_action_metatable {} local MAIH = wesnoth.require("ai/micro_ais/micro_ai_helper.lua") diff --git a/data/campaigns/Eastern_Invasion/ai/ca_ogres_flee.lua b/data/campaigns/Eastern_Invasion/ai/ca_ogres_flee.lua index 23a7afce4d9a..18e68feef06f 100644 --- a/data/campaigns/Eastern_Invasion/ai/ca_ogres_flee.lua +++ b/data/campaigns/Eastern_Invasion/ai/ca_ogres_flee.lua @@ -1,7 +1,7 @@ -local H = wesnoth.require "lua/helper.lua" +local H = wesnoth.require "helper" local AH = wesnoth.require "ai/lua/ai_helper.lua" local BC = wesnoth.require "ai/lua/battle_calcs.lua" ---local LS = wesnoth.require "lua/location_set.lua" +--local LS = wesnoth.require "location_set" local ca_ogres_flee = {} diff --git a/data/campaigns/Eastern_Invasion/lua/bandits.lua b/data/campaigns/Eastern_Invasion/lua/bandits.lua index 5efc2b975891..d3fe80d0d566 100644 --- a/data/campaigns/Eastern_Invasion/lua/bandits.lua +++ b/data/campaigns/Eastern_Invasion/lua/bandits.lua @@ -1,7 +1,7 @@ -- Used for the bandit villages in S5. Much more specific than the village spawn implementations elsewhere, -- since there are a lot more specific things needed (mostly the boss mechanics and village spreading) -local helper = wesnoth.require "lua/helper.lua" +local helper = wesnoth.require "helper" local wml_actions = wesnoth.wml_actions local _ = wesnoth.textdomain "wesnoth-ei" local T = helper.set_wml_tag_metatable {} diff --git a/data/campaigns/Heir_To_The_Throne/scenarios/17_Scepter_of_Fire.cfg b/data/campaigns/Heir_To_The_Throne/scenarios/17_Scepter_of_Fire.cfg index a1a3c80c9107..faaa1aaa63e8 100644 --- a/data/campaigns/Heir_To_The_Throne/scenarios/17_Scepter_of_Fire.cfg +++ b/data/campaigns/Heir_To_The_Throne/scenarios/17_Scepter_of_Fire.cfg @@ -7,7 +7,7 @@ [generator] id="cavegen" config_name="Lua Cave Generator" - create_map = << return wesnoth.require("lua/cave_map_generator.lua").generate_map(...) >> + create_map = << return wesnoth.require("cave_map_generator").generate_map(...) >> map_width=50 map_height=70 @@ -654,7 +654,7 @@ # wmllint: markcheck off code= << local ai_helper = wesnoth.require "ai/lua/ai_helper.lua" - local H = wesnoth.require "lua/helper.lua" + local H = wesnoth.require "helper" local W = H.set_wml_action_metatable {} local delf = wesnoth.get_units { id = 'Delfador' }[1] local sceptre_loc= wesnoth.special_locations.sceptre diff --git a/data/campaigns/Legend_of_Wesmere/lua/wml_tags.lua b/data/campaigns/Legend_of_Wesmere/lua/wml_tags.lua index c711feaa9d8b..c03d7a5c71f7 100644 --- a/data/campaigns/Legend_of_Wesmere/lua/wml_tags.lua +++ b/data/campaigns/Legend_of_Wesmere/lua/wml_tags.lua @@ -4,7 +4,7 @@ local labels = {} local wml_label = wesnoth.wml_actions.label local replace_map = wesnoth.wml_actions.replace_map -local helper = wesnoth.require "lua/helper.lua" +local helper = wesnoth.require "helper" local wml_actions = wesnoth.wml_actions local T = helper.set_wml_tag_metatable {} local V = helper.set_wml_var_metatable {} diff --git a/data/campaigns/Northern_Rebirth/lua/respawn_utils.lua b/data/campaigns/Northern_Rebirth/lua/respawn_utils.lua index 833996c41c4e..e975cf3efcd6 100644 --- a/data/campaigns/Northern_Rebirth/lua/respawn_utils.lua +++ b/data/campaigns/Northern_Rebirth/lua/respawn_utils.lua @@ -1,4 +1,4 @@ -local helper = wesnoth.require "lua/helper.lua" +local helper = wesnoth.require "helper" local T = helper.set_wml_tag_metatable {} function wesnoth.wml_actions.find_respawn_point(cfg) diff --git a/data/campaigns/Sceptre_of_Fire/scenarios/4_Gathering_Materials.cfg b/data/campaigns/Sceptre_of_Fire/scenarios/4_Gathering_Materials.cfg index b51d9d213daa..27a75d245080 100644 --- a/data/campaigns/Sceptre_of_Fire/scenarios/4_Gathering_Materials.cfg +++ b/data/campaigns/Sceptre_of_Fire/scenarios/4_Gathering_Materials.cfg @@ -19,7 +19,7 @@ [generator] id="cavegen" config_name="Lua Cave Generator" - create_map = << return wesnoth.require("lua/cave_map_generator.lua").generate_map(...) >> + create_map = << return wesnoth.require("cave_map_generator").generate_map(...) >> map_width=45 map_height=45 diff --git a/data/campaigns/Son_Of_The_Black_Eye/ai/ca_transport_S6.lua b/data/campaigns/Son_Of_The_Black_Eye/ai/ca_transport_S6.lua index a689b5f89d31..254df13bd671 100644 --- a/data/campaigns/Son_Of_The_Black_Eye/ai/ca_transport_S6.lua +++ b/data/campaigns/Son_Of_The_Black_Eye/ai/ca_transport_S6.lua @@ -1,5 +1,5 @@ -local H = wesnoth.require "lua/helper.lua" -local LS = wesnoth.require "lua/location_set.lua" +local H = wesnoth.require "helper" +local LS = wesnoth.require "location_set" local ca_transport = {} diff --git a/data/campaigns/The_Hammer_of_Thursagan/lua/spawns.lua b/data/campaigns/The_Hammer_of_Thursagan/lua/spawns.lua index 06c22268bf85..c94e5b12ae50 100644 --- a/data/campaigns/The_Hammer_of_Thursagan/lua/spawns.lua +++ b/data/campaigns/The_Hammer_of_Thursagan/lua/spawns.lua @@ -1,7 +1,7 @@ -- Used for the bandit spawns in scenario 5 -local helper = wesnoth.require "lua/helper.lua" -local utils = wesnoth.require "lua/wml-utils.lua" +local helper = wesnoth.require "helper" +local utils = wesnoth.require "wml-utils" local wml_actions = wesnoth.wml_actions local T = helper.set_wml_tag_metatable {} diff --git a/data/campaigns/tutorial/lua/character_selection.lua b/data/campaigns/tutorial/lua/character_selection.lua index 580f59d255d4..d4f93e0a71be 100644 --- a/data/campaigns/tutorial/lua/character_selection.lua +++ b/data/campaigns/tutorial/lua/character_selection.lua @@ -3,7 +3,7 @@ -- Allows the player to choose whether they want to play Konrad or Li’sar -- for the tutorial -local helper = wesnoth.require "lua/helper.lua" +local helper = wesnoth.require "helper" local T = helper.set_wml_tag_metatable {} local wml_actions = wesnoth.wml_actions local _ = wesnoth.textdomain "wesnoth-tutorial" diff --git a/data/lua/backwards-compatibility.lua b/data/lua/backwards-compatibility.lua index 20a84ef63d26..742d7f62e14d 100644 --- a/data/lua/backwards-compatibility.lua +++ b/data/lua/backwards-compatibility.lua @@ -2,7 +2,7 @@ -- This file may provide an implementation of Lua functions removed from the engine. -local helper = wesnoth.require "lua/helper.lua" +local helper = wesnoth.require "helper" function wesnoth.set_music(cfg) wesnoth.wml_actions.music(cfg) diff --git a/data/lua/cave_map_generator.lua b/data/lua/cave_map_generator.lua index ad0a138bdb8f..2e6013721271 100644 --- a/data/lua/cave_map_generator.lua +++ b/data/lua/cave_map_generator.lua @@ -1,6 +1,6 @@ -local helper = wesnoth.require "lua/helper.lua" -local MG = wesnoth.require "lua/mapgen_helper.lua" -local LS = wesnoth.require "lua/location_set.lua" +local helper = wesnoth.require "helper" +local MG = wesnoth.require "mapgen_helper" +local LS = wesnoth.require "location_set" local T = helper.set_wml_tag_metatable {} local random = wesnoth.random diff --git a/data/lua/feeding.lua b/data/lua/feeding.lua index 5b29ba453741..f8b2e540d2b2 100644 --- a/data/lua/feeding.lua +++ b/data/lua/feeding.lua @@ -1,8 +1,8 @@ -local helper = wesnoth.require("lua/helper.lua") +local helper = wesnoth.require("helper") local _ = wesnoth.textdomain 'wesnoth-help' local T = helper.set_wml_tag_metatable {} -local on_event = wesnoth.require("lua/on_event.lua") +local on_event = wesnoth.require("on_event") -- The feeding event code on_event("die", function() diff --git a/data/lua/mapgen_helper.lua b/data/lua/mapgen_helper.lua index bb1ee0d597df..ef88d1015983 100644 --- a/data/lua/mapgen_helper.lua +++ b/data/lua/mapgen_helper.lua @@ -1,4 +1,4 @@ -local LS = wesnoth.require "lua/location_set.lua" +local LS = wesnoth.require "location_set" local mapgen_helper, map_mt = {}, {__index = {}} diff --git a/data/lua/on_event.lua b/data/lua/on_event.lua index 204c02db4833..3ef1004df7aa 100644 --- a/data/lua/on_event.lua +++ b/data/lua/on_event.lua @@ -1,4 +1,4 @@ -local utils = wesnoth.require "lua/wml-utils.lua" +local utils = wesnoth.require "wml-utils" -- registers an event handler. note that, like all lua variables this is not persitent in savefiles, -- so you have to call this function from a toplevel lua tag or from a preload event. -- It is also not possible to use this for first_time_only=yes events. diff --git a/data/lua/wml-flow.lua b/data/lua/wml-flow.lua index 1b1806c8068d..1f43f39ee171 100644 --- a/data/lua/wml-flow.lua +++ b/data/lua/wml-flow.lua @@ -1,5 +1,5 @@ -local helper = wesnoth.require "lua/helper.lua" -local utils = wesnoth.require "lua/wml-utils.lua" +local helper = wesnoth.require "helper" +local utils = wesnoth.require "wml-utils" local wml_actions = wesnoth.wml_actions function wml_actions.command(cfg) diff --git a/data/lua/wml-tags.lua b/data/lua/wml-tags.lua index 2bc056633e9b..31afd8971e36 100644 --- a/data/lua/wml-tags.lua +++ b/data/lua/wml-tags.lua @@ -11,21 +11,21 @@ function wesnoth.game_events.on_save() return {} end -wesnoth.require "lua/wml-flow.lua" -wesnoth.require "lua/wml/objectives.lua" -wesnoth.require "lua/wml/animate_unit.lua" -wesnoth.require "lua/wml/items.lua" -wesnoth.require "lua/wml/message.lua" -wesnoth.require "lua/wml/object.lua" -wesnoth.require "lua/wml/modify_unit.lua" -wesnoth.require "lua/wml/harm_unit.lua" -wesnoth.require "lua/wml/find_path.lua" -wesnoth.require "lua/wml/endlevel.lua" -wesnoth.require "lua/wml/random_placement.lua" - -local helper = wesnoth.require "lua/helper.lua" -local location_set = wesnoth.require "lua/location_set.lua" -local utils = wesnoth.require "lua/wml-utils.lua" +wesnoth.require "wml-flow" +wesnoth.require "wml/objectives" +wesnoth.require "wml/animate_unit" +wesnoth.require "wml/items" +wesnoth.require "wml/message" +wesnoth.require "wml/object" +wesnoth.require "wml/modify_unit" +wesnoth.require "wml/harm_unit" +wesnoth.require "wml/find_path" +wesnoth.require "wml/endlevel" +wesnoth.require "wml/random_placement" + +local helper = wesnoth.require "helper" +local location_set = wesnoth.require "location_set" +local utils = wesnoth.require "wml-utils" local wml_actions = wesnoth.wml_actions local T = helper.set_wml_tag_metatable {} @@ -987,7 +987,7 @@ function wml_actions.inspect(cfg) wesnoth.gamestate_inspector(cfg) end -local kill_recursion_preventer = wesnoth.require("lua/location_set.lua").create() +local kill_recursion_preventer = location_set.create() function wml_actions.kill(cfg) local number_killed = 0 local secondary_unit = helper.get_child(cfg, "secondary_unit") diff --git a/data/lua/wml-utils.lua b/data/lua/wml-utils.lua index 6961f373166f..f40ccf0d2676 100644 --- a/data/lua/wml-utils.lua +++ b/data/lua/wml-utils.lua @@ -1,5 +1,5 @@ -local helper = wesnoth.require "lua/helper.lua" +local helper = wesnoth.require "helper" local utils = {vwriter = {}} function utils.trim(s) diff --git a/data/lua/wml/animate_unit.lua b/data/lua/wml/animate_unit.lua index acc73bef9fb5..466286dd2c3c 100644 --- a/data/lua/wml/animate_unit.lua +++ b/data/lua/wml/animate_unit.lua @@ -1,4 +1,4 @@ -local helper = wesnoth.require "lua/helper.lua" +local helper = wesnoth.require "helper" local T = helper.set_wml_tag_metatable{} local function get_fake_attack(unit, cfg) diff --git a/data/lua/wml/endlevel.lua b/data/lua/wml/endlevel.lua index 883b2f0b4c7f..7a5b9bde71ae 100644 --- a/data/lua/wml/endlevel.lua +++ b/data/lua/wml/endlevel.lua @@ -1,4 +1,4 @@ -local helper = wesnoth.require "lua/helper.lua" +local helper = wesnoth.require "helper" local already_ended = false function wesnoth.wml_actions.endlevel(cfg) diff --git a/data/lua/wml/find_path.lua b/data/lua/wml/find_path.lua index 654597c66159..12f8e72db674 100644 --- a/data/lua/wml/find_path.lua +++ b/data/lua/wml/find_path.lua @@ -1,5 +1,5 @@ -local helper = wesnoth.require "lua/helper.lua" -local utils = wesnoth.require "lua/wml-utils.lua" +local helper = wesnoth.require "helper" +local utils = wesnoth.require "wml-utils" function wesnoth.wml_actions.find_path(cfg) local filter_unit = helper.get_child(cfg, "traveler") or helper.wml_error("[find_path] missing required [traveler] tag") diff --git a/data/lua/wml/harm_unit.lua b/data/lua/wml/harm_unit.lua index 9aa609d096ff..736d4e9405bb 100644 --- a/data/lua/wml/harm_unit.lua +++ b/data/lua/wml/harm_unit.lua @@ -1,5 +1,5 @@ -local helper = wesnoth.require "lua/helper.lua" -local utils = wesnoth.require "lua/wml-utils.lua" +local helper = wesnoth.require "helper" +local utils = wesnoth.require "wml-utils" local wml_actions = wesnoth.wml_actions local T = helper.set_wml_tag_metatable {} diff --git a/data/lua/wml/items.lua b/data/lua/wml/items.lua index 8fb1093fd9a5..60c9dcbcece8 100644 --- a/data/lua/wml/items.lua +++ b/data/lua/wml/items.lua @@ -1,4 +1,4 @@ -local helper = wesnoth.require "lua/helper.lua" +local helper = wesnoth.require "helper" local wml_actions = wesnoth.wml_actions local game_events = wesnoth.game_events diff --git a/data/lua/wml/message.lua b/data/lua/wml/message.lua index b96421ff0168..79990886cda8 100644 --- a/data/lua/wml/message.lua +++ b/data/lua/wml/message.lua @@ -1,7 +1,7 @@ -local helper = wesnoth.require "lua/helper.lua" -local utils = wesnoth.require "lua/wml-utils.lua" -local location_set = wesnoth.require "lua/location_set.lua" +local helper = wesnoth.require "helper" +local utils = wesnoth.require "wml-utils" +local location_set = wesnoth.require "location_set" local _ = wesnoth.textdomain "wesnoth" local function log(msg, level) diff --git a/data/lua/wml/modify_unit.lua b/data/lua/wml/modify_unit.lua index 188bb26b2e43..3b35e5ba5c27 100644 --- a/data/lua/wml/modify_unit.lua +++ b/data/lua/wml/modify_unit.lua @@ -1,5 +1,5 @@ -local helper = wesnoth.require "lua/helper.lua" -local utils = wesnoth.require "lua/wml-utils.lua" +local helper = wesnoth.require "helper" +local utils = wesnoth.require "wml-utils" local wml_actions = wesnoth.wml_actions function wml_actions.modify_unit(cfg) diff --git a/data/lua/wml/object.lua b/data/lua/wml/object.lua index 7ff49da8ae2d..b8f86f5723b9 100644 --- a/data/lua/wml/object.lua +++ b/data/lua/wml/object.lua @@ -1,6 +1,6 @@ -local helper = wesnoth.require "lua/helper.lua" -local utils = wesnoth.require "lua/wml-utils.lua" +local helper = wesnoth.require "helper" +local utils = wesnoth.require "wml-utils" local T = helper.set_wml_tag_metatable {} local wml_actions = wesnoth.wml_actions diff --git a/data/lua/wml/objectives.lua b/data/lua/wml/objectives.lua index 07085f010017..26ac6ae3c4a1 100644 --- a/data/lua/wml/objectives.lua +++ b/data/lua/wml/objectives.lua @@ -1,4 +1,4 @@ -local helper = wesnoth.require "lua/helper.lua" +local helper = wesnoth.require "helper" local wml_actions = wesnoth.wml_actions local game_events = wesnoth.game_events diff --git a/data/lua/wml/random_placement.lua b/data/lua/wml/random_placement.lua index cd7e0fbfa7ff..211c07e37ff8 100644 --- a/data/lua/wml/random_placement.lua +++ b/data/lua/wml/random_placement.lua @@ -1,5 +1,5 @@ -local helper = wesnoth.require "lua/helper.lua" -local utils = wesnoth.require "lua/wml-utils.lua" +local helper = wesnoth.require "helper" +local utils = wesnoth.require "wml-utils" wesnoth.wml_actions.random_placement = function(cfg) local parsed = helper.shallow_parsed(cfg) diff --git a/data/multiplayer/eras.lua b/data/multiplayer/eras.lua index 98c012532339..a1866554184c 100644 --- a/data/multiplayer/eras.lua +++ b/data/multiplayer/eras.lua @@ -1,4 +1,4 @@ -local helper = wesnoth.require "lua/helper.lua" +local helper = wesnoth.require "helper" local T = helper.set_wml_tag_metatable {} local res = {} diff --git a/data/multiplayer/scenarios/2p_Dark_Forecast.lua b/data/multiplayer/scenarios/2p_Dark_Forecast.lua index 8c6b6d87d562..a251dc3e89b0 100644 --- a/data/multiplayer/scenarios/2p_Dark_Forecast.lua +++ b/data/multiplayer/scenarios/2p_Dark_Forecast.lua @@ -1,8 +1,8 @@ -local helper = wesnoth.require("lua/helper.lua") +local helper = wesnoth.require("helper") local _ = wesnoth.textdomain 'wesnoth-multiplayer' local T = helper.set_wml_tag_metatable {} -local on_event = wesnoth.require("lua/on_event.lua") +local on_event = wesnoth.require("on_event") local random_spawns = { { diff --git a/data/scenario-test.cfg b/data/scenario-test.cfg index a3c75194d8c6..df007011f0f6 100644 --- a/data/scenario-test.cfg +++ b/data/scenario-test.cfg @@ -1011,7 +1011,7 @@ local types = { "Ancient Lich", "Ancient Wose", "Elvish Avenger" } local result = wesnoth.synchronize_choice(function() -- Human choice - local helper = wesnoth.require "lua/helper.lua" + local helper = wesnoth.require "helper" local T = helper.set_wml_tag_metatable {} local _ = wesnoth.textdomain "wesnoth" local dialog = { @@ -1357,8 +1357,8 @@ My best advancement costs $next_cost gold and I’m $experience|% there." [lua] code=<< - local location_set = wesnoth.require 'lua/location_set.lua' - local items = wesnoth.require 'lua/wml/items.lua' + local location_set = wesnoth.require 'location_set' + local items = wesnoth.require 'wml/items' local locs = location_set.of_wml_var 'unit_reach' locs:iter(function(x, y) items.place_image(x, y, 'misc/waypoint.png~CS(255,-127,-127)') @@ -1397,7 +1397,7 @@ My best advancement costs $next_cost gold and I’m $experience|% there." # The file is not in the repository to allow adding custom stuff to it. [command] [lua] - code=<< wesnoth.dofile("lua/code.lua").main() >> + code=<< wesnoth.dofile("code").main() >> [/lua] [/command] [/set_menu_item] @@ -2214,7 +2214,7 @@ Also, 0..9 = $below_ten, one,two,three = $ascii and the bonus answer is $mixed." code = << local ec = wesnoth.current.event_context wesnoth.message(string.format("Unit moved from %d,%d to %d,%d", ec.x2, ec.y2, ec.x1, ec.y1)) - local helper = wesnoth.require "lua/helper.lua" + local helper = wesnoth.require "helper" local result = helper.get_user_choice( { speaker = "unit", message = "Pick your poison" }, { "&items/potion-red.png=Something red=Take a sip and enjoy", @@ -3654,7 +3654,7 @@ unplagueable: $wml_unit.status.unplagueable" [lua] code = << - local helper = wesnoth.require "lua/helper.lua" + local helper = wesnoth.require "helper" for i, v in ipairs(helper.get_variable_proxy_array "temp_villages_area") do wesnoth.put_unit({ type = "Goblin Spearman", side = 2 }, v.x, v.y) end diff --git a/data/test/scenarios/ai/_main.cfg b/data/test/scenarios/ai/_main.cfg index 2cbb8fb4e45f..fe993729bace 100644 --- a/data/test/scenarios/ai/_main.cfg +++ b/data/test/scenarios/ai/_main.cfg @@ -12,7 +12,7 @@ #define ASPECT_NOTIFICATION << -local H = wesnoth.require('lua/helper.lua') +local H = wesnoth.require('helper') local expected = H.get_variable_array('expected') local aspect = wesnoth.get_variable('test_attribute') if ai.aspects[aspect] ~= expected[wesnoth.current.turn].value then diff --git a/data/test/scenarios/interrupts.cfg b/data/test/scenarios/interrupts.cfg index f80a876d5bc8..ee4198af0588 100644 --- a/data/test/scenarios/interrupts.cfg +++ b/data/test/scenarios/interrupts.cfg @@ -76,7 +76,7 @@ name=start [lua] code=<< - local H = wesnoth.require "lua/helper.lua" + local H = wesnoth.require "helper" local A = H.set_wml_action_metatable{} local function continue() A.continue{}