Merge branch 'master' of github.com:wesnoth/wesnoth

This commit is contained in:
Alexander van Gessel 2014-03-30 18:59:10 +02:00
commit 0170b539ac
36 changed files with 1212 additions and 1347 deletions

View file

@ -13,7 +13,7 @@ Version 1.13.0-dev:
* C++ Engine:
* Purge "human_ai" controller type. This is a fixup of bugfix #18829 below.
* Language and i18n:
* Updated translations: German, Greek, Scottish Gaelic, Slovak
* Updated translations: German, Greek, Hungarian, Scottish Gaelic, Slovak
* Lua API:
* Fix bug #21761: wesnoth.synchronize_choice will now give a warning when
the table returned by the user-specified function is not completely valid,
@ -50,6 +50,9 @@ Version 1.13.0-dev:
* Fix bug #21257: Lagging animations with skip AI animations and fog/shroud.
* Improved unicode handling on windows for characters outside the Basic
Multilingual Plane.
* Fix bug #3856: The turn dialog used in hotseat MP play now applies
a blindfold for the duration of the dialog.
* Petrified units are no longer displayed in the "Damage versus" tooltip.
Version 1.11.11:
* Add-ons server:

View file

@ -485,14 +485,15 @@ function ai_helper.get_closest_location(hex, location_filter, unit)
if (radius == 0) then
loc_filter = {
{ "and", { x = hex[1], y = hex[2], radius = radius } },
{ "and", location_filter }
}
else
loc_filter = {
{ "and", { x = hex[1], y = hex[2], radius = radius } },
{ "not", { x = hex[1], y = hex[2], radius = radius - 1 } },
{ "and", location_filter }
}
end
for k,v in pairs(location_filter) do loc_filter[k] = v end
local locs = wesnoth.get_locations(loc_filter)

View file

@ -4,35 +4,25 @@ local AH = wesnoth.require "ai/lua/ai_helper.lua"
local ca_coward = {}
function ca_coward:evaluation(ai, cfg)
local unit
if cfg.filter then
unit = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", cfg.filter },
formula = '$this_unit.moves > 0' }
)[1]
else
unit = wesnoth.get_units({ id = cfg.id, formula = '$this_unit.moves > 0' })[1]
end
local filter = cfg.filter or { id = cfg.id }
local unit = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", filter },
formula = '$this_unit.moves > 0' }
)[1]
-- Check if unit exists as sticky BCAs are not always removed successfully
if unit then return cfg.ca_score end
return 0
end
-- cfg parameters: id, distance, seek_x, seek_y, avoid_x, avoid_y
function ca_coward:execution(ai, cfg)
--print("Coward exec " .. cfg.id)
local unit
if cfg.filter then
unit = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", cfg.filter },
formula = '$this_unit.moves > 0' }
)[1]
else
unit = wesnoth.get_units({ id = cfg.id, formula = '$this_unit.moves > 0' })[1]
end
local filter = cfg.filter or { id = cfg.id }
local unit = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", filter },
formula = '$this_unit.moves > 0' }
)[1]
local reach = wesnoth.find_reach(unit)
@ -112,10 +102,7 @@ function ca_coward:execution(ai, cfg)
end
--items.place_image(mx, my, "items/ring-gold.png")
-- (mx,my) is the position to move to
if (mx ~= unit.x or my ~= unit.y) then
AH.movefull_stopunit(ai, unit, mx, my)
end
AH.movefull_stopunit(ai, unit, mx, my)
if (not unit) or (not unit.valid) then return end
AH.checked_stopunit_all(ai, unit)

View file

@ -157,7 +157,7 @@ function ca_goto:execution(ai, cfg, self)
-- Add a small penalty for occupied hexes
-- (this mean occupied by an allied unit, as enemies make the hex unreachable)
local unit_in_way = wesnoth.get_unit(l[1], l[2])
if unit_in_way and ((unit_in_way.x ~= u.x) or (unit_in_way.y ~= u.y)) then
if unit_in_way and (unit_in_way ~= u) then
rating = rating - 0.01
end

View file

@ -87,7 +87,7 @@ function ca_healer_move:evaluation(ai, cfg, self)
-- Also, hex must be unoccupied by another unit, of course
local unit_in_way = wesnoth.get_unit(r[1], r[2])
if (not avoid_map:get(r[1], r[2])) then
if (not unit_in_way) or ((unit_in_way.x == h.x) and (unit_in_way.y == h.y)) then
if (not unit_in_way) or (unit_in_way == h) then
for k,u in ipairs(healees) do
if (H.distance_between(u.x, u.y, r[1], r[2]) == 1) then
-- !!!!!!! These ratings have to be positive or the method doesn't work !!!!!!!!!

View file

@ -39,16 +39,12 @@ local function hunter_attack_weakest_adj_enemy(ai, unit)
end
function ca_hunter:evaluation(ai, cfg)
local unit
if cfg.filter then
unit = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", cfg.filter },
formula = '$this_unit.moves > 0' }
)[1]
else
unit = wesnoth.get_units({ id = cfg.id, formula = '$this_unit.moves > 0' })[1]
end
local filter = cfg.filter or { id = cfg.id }
local unit = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", filter },
formula = '$this_unit.moves > 0' }
)[1]
if unit then return cfg.ca_score end
return 0
@ -60,17 +56,12 @@ function ca_hunter:execution(ai, cfg)
-- hunting_ground, then retreats to
-- position given by 'home_x,home_y' for 'rest_turns' turns, or until fully healed
local unit
if cfg.filter then
unit = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", cfg.filter },
formula = '$this_unit.moves > 0' }
)[1]
else
unit = wesnoth.get_units({ id = cfg.id, formula = '$this_unit.moves > 0' })[1]
end
--print('Hunter: ', unit.id)
local filter = cfg.filter or { id = cfg.id }
local unit = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", filter },
formula = '$this_unit.moves > 0' }
)[1]
-- If hunting_status is not set for the unit -> default behavior -> hunting
if (not unit.variables.hunting_status) then

View file

@ -53,7 +53,7 @@ local function messenger_find_enemies_in_way(unit, goal_x, goal_y)
return
end
local function messenger_find_clearing_attack(unit, goal_x, goal_y)
local function messenger_find_clearing_attack(unit, goal_x, goal_y, cfg)
-- Check if an enemy is in the way of the messenger
-- If so, find attack that would "clear" that enemy out of the way
-- unit: proxy table for the messenger unit
@ -68,8 +68,12 @@ local function messenger_find_clearing_attack(unit, goal_x, goal_y)
--print('Finding attacks on',enemy_in_way.name,enemy_in_way.id)
-- Find all units that can attack this enemy
local my_units = wesnoth.get_units{ side = wesnoth.current.side, formula = '$this_unit.attacks_left > 0',
{ "not", { id = unit.id } }
local filter = cfg.filter or { id = cfg.id }
local my_units = wesnoth.get_units {
side = wesnoth.current.side,
formula = '$this_unit.attacks_left > 0',
{ "not", filter },
{ "and", cfg.filter_second }
}
-- Eliminate units without attacks
@ -131,17 +135,14 @@ local function messenger_find_clearing_attack(unit, goal_x, goal_y)
end
function ca_messenger_attack:evaluation(ai, cfg, self)
-- Attack units in the path of the messenger
-- id: id of the messenger unit
-- Attack units in the path of the messengers
-- goal_x, goal_y: coordinates of the goal toward which the messenger moves
local messenger = wesnoth.get_units{ side = wesnoth.current.side, id = cfg.id }[1]
local messenger, x, y = messenger_next_waypoint(cfg)
if (not messenger) then return 0 end
local x, y = messenger_next_waypoint(messenger, cfg, self)
-- See if there's an enemy in the way that should be attacked
local attack = messenger_find_clearing_attack(messenger, x, y)
local attack = messenger_find_clearing_attack(messenger, x, y, cfg)
if attack then
self.data.best_attack = attack

View file

@ -1,61 +1,92 @@
local H = wesnoth.require "lua/helper.lua"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
local LS = wesnoth.require "lua/location_set.lua"
local ca_messenger_escort_move = {}
local messenger_next_waypoint = wesnoth.require "ai/micro_ais/cas/ca_messenger_f_next_waypoint.lua"
function ca_messenger_escort_move:evaluation(ai, cfg)
-- Move escort units close to messenger, and in between messenger and enemies
-- The messenger has moved at this time, so we don't need to exclude him
-- But we check that he exist (not for this scenario, but for others)
local messenger = wesnoth.get_units{ side = wesnoth.current.side, id = cfg.id }[1]
if (not messenger) then return 0 end
-- Move escort units close to messengers, and in between messengers and enemies
-- The messengers have moved at this time, so we don't need to exclude them,
-- but we check that there are messengers left
local my_units = wesnoth.get_units{ side = wesnoth.current.side, formula = '$this_unit.moves > 0' }
local my_units = wesnoth.get_units {
side = wesnoth.current.side,
formula = '$this_unit.moves > 0',
{ "and", cfg.filter_second }
}
if (not my_units[1]) then return 0 end
if my_units[1] then
return cfg.ca_score
end
return 0
local _, _, _, messengers = messenger_next_waypoint(cfg)
if (not messengers) or (not messengers[1]) then return 0 end
return cfg.ca_score
end
function ca_messenger_escort_move:execution(ai, cfg)
local messenger = wesnoth.get_units{ id = cfg.id }[1]
local my_units = wesnoth.get_units{ side = wesnoth.current.side, formula = '$this_unit.moves > 0' }
local my_units = wesnoth.get_units {
side = wesnoth.current.side,
formula = '$this_unit.moves > 0',
{ "and", cfg.filter_second }
}
-- Simply move units one at a time
local next_unit = my_units[1]
local reach = LS.of_pairs(wesnoth.find_reach(next_unit))
-- Distance from messenger for each hex the unit can reach
local dist_messenger = AH.distance_map({messenger}, reach)
local _, _, _, messengers = messenger_next_waypoint(cfg)
local enemies = wesnoth.get_units {
{ "filter_side", {{"enemy_of", {side = wesnoth.current.side} }} }
}
-- Rating (in the end, we pick the _minimum _rating):
-- 1. Minimize distance from enemies
local rating = AH.distance_map(enemies, reach)
-- 2. This one favors hexes in between messenger and enemies
rating:union_merge(dist_messenger, function(x, y, v1, v2)
return v1 + v2*#enemies
end)
-- 3. Strongly prefer hexes close to the messenger
rating:union_merge(dist_messenger, function(x, y, v1, v2)
return v1 + v2^2
end)
--AH.put_labels(rating)
local base_rating_map = LS.create()
local max_rating, best_unit, best_hex = -9e99
for _,unit in ipairs(my_units) do
-- Only considering hexes unoccupied by other units is good enough for this
local reach_map = AH.get_reachable_unocc(unit)
-- Now find hex with minimum value that is unoccupied
min_rating, best_hex = 9e99, {}
rating:iter(function(x, y, r)
local unit_in_way = wesnoth.get_units{ x = x, y = y, { "not", { id = next_unit.id } } }[1]
if (not unit_in_way) and (r < min_rating) then
min_rating, best_hex = r, { x, y }
end
end)
-- and move the unit there
AH.movefull_stopunit(ai, next_unit, best_hex)
-- Minor rating for the fastest and strongest unit to go first
local unit_rating = unit.max_moves / 100. + unit.hitpoints / 1000.
reach_map:iter( function(x, y, v)
-- base rating only needs to be calculated once for each hex
local base_rating = base_rating_map:get(x, y)
if (not base_rating) then
base_rating = 0
-- Distance from messenger is most important; only closest messenger counts for this
-- Give somewhat of a bonus for the messenger that has moved the most through the waypoints
local max_messenger_rating = -9e99
for _,m in ipairs(messengers) do
local messenger_rating = 1. / (H.distance_between(x, y, m.x, m.y) + 2.)
messenger_rating = messenger_rating * 10. * (1. + m.variables.wp_rating * 2.)
if (messenger_rating > max_messenger_rating) then
max_messenger_rating = messenger_rating
end
end
base_rating = base_rating + max_messenger_rating
-- Distance from (sum of) enemies is important too
-- This favors placing escort units between the messenger and close enemies
for _,e in ipairs(enemies) do
base_rating = base_rating + 1. / (H.distance_between(x, y, e.x, e.y) + 2.)
end
base_rating_map:insert(x, y, base_rating)
end
local rating = base_rating + unit_rating
if (rating > max_rating) then
max_rating = rating
best_unit, best_hex = unit, { x, y }
end
end)
end
--AH.put_labels(base_rating_map)
-- This will always find at least the hex the unit is on -> no check necessary
AH.movefull_stopunit(ai, best_unit, best_hex)
end
return ca_messenger_escort_move

View file

@ -1,9 +1,17 @@
local H = wesnoth.require "lua/helper.lua"
local AH = wesnoth.require "ai/lua/ai_helper.lua"
return function(messenger, cfg, self)
-- Variable to store which waypoint to go to next (persistent)
if (not self.data.next_waypoint) then self.data.next_waypoint = 1 end
return function(cfg)
-- Calculate next waypoint and rating for all messengers
-- Return next messenger to move and waypoint toward which it should move
-- Also return the array of all messengers (for escort move evaluation,
-- so that it only needs to be done in one place, in case the syntax is changed some more)
-- Returns nil for first 3 arguments if no messenger has moves left
-- Returns nil for all arguments if there are no messengers on the map
local filter = cfg.filter or { id = cfg.id }
local messengers = wesnoth.get_units { side = wesnoth.current.side, { "and", filter } }
if (not messengers[1]) then return end
local waypoint_x = AH.split(cfg.waypoint_x, ",")
local waypoint_y = AH.split(cfg.waypoint_y, ",")
@ -12,14 +20,41 @@ return function(messenger, cfg, self)
waypoint_y[i] = tonumber(waypoint_y[i])
end
-- If we're within 3 hexes of the next waypoint, we go on to the one after that
-- except if that one's the last one already
local dist_wp = H.distance_between(messenger.x, messenger.y,
waypoint_x[self.data.next_waypoint], waypoint_y[self.data.next_waypoint]
)
if (dist_wp <= 3) and (self.data.next_waypoint < #waypoint_x) then
self.data.next_waypoint = self.data.next_waypoint + 1
-- Set the next waypoint for all messengers
-- Also find those with MP left and return the one to next move, together with the WP to move toward
local max_rating, best_messenger, x, y = -9e99
for i, m in ipairs(messengers) do
-- To avoid code duplication and ensure consistency, we store some pieces of
-- information in the messenger units, even though it could be calculated each time it is needed
local wp_i = m.variables.wp_i or 1
local wp_x, wp_y = waypoint_x[wp_i], waypoint_y[wp_i]
-- If this messenger is within 3 hexes of the next waypoint, we go on to the one after that
-- except if that one's the last one already
local dist_wp = H.distance_between(m.x, m.y, wp_x, wp_y)
if (dist_wp <= 3) and (wp_i < #waypoint_x) then wp_i = wp_i + 1 end
m.variables.wp_i, m.variables.wp_x, m.variables.wp_y = wp_i, wp_x, wp_y
-- Also store the rating for each messenger
-- For now, this is simply a "forward rating"
local rating = wp_i - dist_wp / 1000.
-- If invert_order= key is set, we want to move the rearmost messenger first.
-- We still want to keep the rating value positive (mostly, this is not strict)
-- and of the same order of magnitude.
if cfg.invert_order then
rating = #waypoint_x - rating
end
m.variables.wp_rating = rating
-- Find the messenger with the highest rating that has MP left
if (m.moves > 0) and (rating > max_rating) then
best_messenger, max_rating = m, rating
x, y = wp_x, wp_y
end
end
return waypoint_x[self.data.next_waypoint], waypoint_y[self.data.next_waypoint]
return best_messenger, x, y, messengers
end

View file

@ -6,10 +6,10 @@ local ca_messenger_move = {}
local messenger_next_waypoint = wesnoth.require "ai/micro_ais/cas/ca_messenger_f_next_waypoint.lua"
function ca_messenger_move:evaluation(ai, cfg)
-- Move the messenger (unit with passed id) toward goal, attack adjacent unit if possible
-- Move the messenger toward goal, attack adjacent unit if possible
-- without retaliation or little expected damage with high chance of killing the enemy
local messenger = wesnoth.get_units{ id = cfg.id, formula = '$this_unit.moves > 0' }[1]
local messenger = messenger_next_waypoint(cfg)
if messenger then
return cfg.ca_score
@ -17,25 +17,36 @@ function ca_messenger_move:evaluation(ai, cfg)
return 0
end
function ca_messenger_move:execution(ai, cfg, self)
local messenger = wesnoth.get_units{ id = cfg.id, formula = '$this_unit.moves > 0' }[1]
function ca_messenger_move:execution(ai, cfg)
local messenger, x, y = messenger_next_waypoint(cfg)
local x, y = messenger_next_waypoint(messenger, cfg, self)
if (messenger.x ~= x) or (messenger.y ~= y) then
x, y = wesnoth.find_vacant_tile( x, y, messenger)
local wp = AH.get_closest_location(
{ x, y },
{ { "not", { { "filter", { { "not", { side = wesnoth.current.side } } } } } } },
messenger
)
x, y = wp[1], wp[2]
end
local next_hop = AH.next_hop(messenger, x, y)
local next_hop = AH.next_hop(messenger, x, y, { ignore_own_units = true } )
if (not next_hop) then next_hop = { messenger.x, messenger.y } end
-- Compare this to the "ideal path"
local path, cost = wesnoth.find_path(messenger, x, y, { ignore_units = 'yes' })
local opt_hop, opt_cost = {messenger.x, messenger.y}, 0
local opt_hop, opt_cost = { messenger.x, messenger.y }, 0
for i, p in ipairs(path) do
local sub_path, sub_cost = wesnoth.find_path(messenger, p[1], p[2])
if sub_cost > messenger.moves then
if sub_cost > messenger.moves then
break
else
local unit_in_way = wesnoth.get_unit(p[1], p[2])
if unit_in_way and (unit_in_way.side == messenger.side) then
local reach = AH.get_reachable_unocc(unit_in_way)
if (reach:size() > 1) then unit_in_way = nil end
end
if not unit_in_way then
opt_hop, nh_cost = p, sub_cost
end
@ -45,11 +56,24 @@ function ca_messenger_move:execution(ai, cfg, self)
--print(next_hop[1], next_hop[2], opt_hop[1], opt_hop[2])
-- Now compare how long it would take from the end of both of these options
local x1, y1 = messenger.x, messenger.y
local unit_in_way = wesnoth.get_unit(next_hop[1], next_hop[2])
if (unit_in_way == messenger) then unit_in_way = nil end
if unit_in_way then wesnoth.extract_unit(unit_in_way) end
wesnoth.put_unit(next_hop[1], next_hop[2], messenger)
local tmp, cost1 = wesnoth.find_path(messenger, x, y, {ignore_units = 'yes'})
local unit_in_way2 = wesnoth.get_unit(opt_hop[1], opt_hop[2])
if (unit_in_way2 == messenger) then unit_in_way2 = nil end
if unit_in_way2 then wesnoth.extract_unit(unit_in_way2) end
wesnoth.put_unit(opt_hop[1], opt_hop[2], messenger)
local tmp, cost2 = wesnoth.find_path(messenger, x, y, {ignore_units = 'yes'})
wesnoth.put_unit(x1, y1, messenger)
if unit_in_way then wesnoth.put_unit(unit_in_way) end
if unit_in_way2 then wesnoth.put_unit(unit_in_way2) end
--print(cost1, cost2)
-- If cost2 is significantly less, that means that the other path might overall be faster
@ -58,6 +82,10 @@ function ca_messenger_move:execution(ai, cfg, self)
--print(next_hop[1], next_hop[2])
if next_hop and ((next_hop[1] ~= messenger.x) or (next_hop[2] ~= messenger.y)) then
local unit_in_way = wesnoth.get_unit(next_hop[1], next_hop[2])
if unit_in_way then AH.move_unit_out_of_way(ai, unit_in_way) end
if (not messenger) or (not messenger.valid) then return end
AH.checked_move(ai, messenger, next_hop[1], next_hop[2])
else
AH.checked_stopunit_moves(ai, messenger)
@ -70,7 +98,7 @@ function ca_messenger_move:execution(ai, cfg, self)
local targets = wesnoth.get_units {
{ "filter_side", { {"enemy_of", {side = wesnoth.current.side} } } },
{ "filter_adjacent", { id = cfg.id } }
{ "filter_adjacent", { id = messenger.id } }
}
local max_rating, best_tar, best_weapon = -9e99, {}, -1
@ -111,7 +139,7 @@ function ca_messenger_move:execution(ai, cfg, self)
x = tonumber(waypoint_x[#waypoint_x]),
y = tonumber(waypoint_y[#waypoint_y]),
{ "filter_side", { {"enemy_of", {side = wesnoth.current.side} } } },
{ "filter_adjacent", { id = cfg.id } }
{ "filter_adjacent", { id = messenger.id } }
}[1]
if target then

View file

@ -4,33 +4,24 @@ local AH = wesnoth.require "ai/lua/ai_helper.lua"
local ca_patrol = {}
function ca_patrol:evaluation(ai, cfg)
local patrol
if cfg.filter then
patrol = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", cfg.filter },
formula = '$this_unit.moves > 0' }
)[1]
else
patrol = wesnoth.get_units({ id = cfg.id, formula = '$this_unit.moves > 0' })[1]
end
local filter = cfg.filter or { id = cfg.id }
local patrol = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", filter },
formula = '$this_unit.moves > 0' }
)[1]
-- Check if unit exists as sticky BCAs are not always removed successfully
if patrol then return cfg.ca_score end
return 0
end
function ca_patrol:execution(ai, cfg, self)
local patrol
if cfg.filter then
patrol = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", cfg.filter },
formula = '$this_unit.moves > 0' }
)[1]
else
patrol = wesnoth.get_units({ id = cfg.id, formula = '$this_unit.moves > 0' })[1]
end
function ca_patrol:execution(ai, cfg)
local filter = cfg.filter or { id = cfg.id }
local patrol = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", filter },
formula = '$this_unit.moves > 0' }
)[1]
cfg.waypoint_x = AH.split(cfg.waypoint_x, ",")
cfg.waypoint_y = AH.split(cfg.waypoint_y, ",")
@ -38,9 +29,9 @@ function ca_patrol:execution(ai, cfg, self)
local n_wp = #cfg.waypoint_x -- just for convenience
-- Set up waypoints, taking into account whether 'reverse' is set
-- This works even the first time, when self.data.id_reverse is not set yet
-- This works even the first time, when patrol.variables.patrol_reverse is not set yet
local waypoints = {}
if self.data[patrol.id..'_reverse'] then
if patrol.variables.patrol_reverse then
for i = 1,n_wp do
waypoints[i] = { tonumber(cfg.waypoint_x[n_wp-i+1]), tonumber(cfg.waypoint_y[n_wp-i+1]) }
end
@ -50,12 +41,12 @@ function ca_patrol:execution(ai, cfg, self)
end
end
-- if not set, set next location (first move)
-- If not set, set next location (first move)
-- This needs to be in WML format, so that it persists over save/load cycles
if (not self.data[patrol.id..'_x']) then
self.data[patrol.id..'_x'] = waypoints[1][1]
self.data[patrol.id..'_y'] = waypoints[1][2]
self.data[patrol.id..'_reverse'] = false
if (not patrol.variables.patrol_x) then
patrol.variables.patrol_x = waypoints[1][1]
patrol.variables.patrol_y = waypoints[1][2]
patrol.variables.patrol_reverse = false
end
while patrol.moves > 0 do
@ -70,8 +61,8 @@ function ca_patrol:execution(ai, cfg, self)
-- Also check whether we're next to any unit (enemy or ally) which is on the next waypoint
local unit_on_wp = wesnoth.get_units {
x = self.data[patrol.id..'_x'],
y = self.data[patrol.id..'_y'],
x = patrol.variables.patrol_x,
y = patrol.variables.patrol_y,
{ "filter_adjacent", { id = patrol.id } }
}[1]
@ -84,28 +75,28 @@ function ca_patrol:execution(ai, cfg, self)
-- Move him to the first one (or reverse route), if he's on the last waypoint
-- Unless cfg.one_time_only is set
if cfg.one_time_only then
self.data[patrol.id..'_x'] = waypoints[n_wp][1]
self.data[patrol.id..'_y'] = waypoints[n_wp][2]
patrol.variables.patrol_x = waypoints[n_wp][1]
patrol.variables.patrol_y = waypoints[n_wp][2]
else
-- Go back to first WP or reverse direction
if cfg.out_and_back then
self.data[patrol.id..'_x'] = waypoints[n_wp-1][1]
self.data[patrol.id..'_y'] = waypoints[n_wp-1][2]
patrol.variables.patrol_x = waypoints[n_wp-1][1]
patrol.variables.patrol_y = waypoints[n_wp-1][2]
-- We also need to reverse the waypoints right here, as this might not be the end of the move
self.data[patrol.id..'_reverse'] = not self.data[patrol.id..'_reverse']
patrol.variables.patrol_reverse = not patrol.variables.patrol_reverse
local tmp_wp = {}
for i,wp in ipairs(waypoints) do tmp_wp[n_wp-i+1] = wp end
waypoints = tmp_wp
else
self.data[patrol.id..'_x'] = waypoints[1][1]
self.data[patrol.id..'_y'] = waypoints[1][2]
patrol.variables.patrol_x = waypoints[1][1]
patrol.variables.patrol_y = waypoints[1][2]
end
end
else
-- ... else move him on the next waypoint
self.data[patrol.id..'_x'] = waypoints[i+1][1]
self.data[patrol.id..'_y'] = waypoints[i+1][2]
patrol.variables.patrol_x = waypoints[i+1][1]
patrol.variables.patrol_y = waypoints[i+1][2]
end
end
end
@ -116,7 +107,7 @@ function ca_patrol:execution(ai, cfg, self)
then
AH.checked_stopunit_moves(ai, patrol)
else -- otherwise move toward next WP
local x, y = wesnoth.find_vacant_tile(self.data[patrol.id..'_x'], self.data[patrol.id..'_y'], patrol)
local x, y = wesnoth.find_vacant_tile(patrol.variables.patrol_x, patrol.variables.patrol_y, patrol)
local nh = AH.next_hop(patrol, x, y)
if nh and ((nh[1] ~= patrol.x) or (nh[2] ~= patrol.y)) then
AH.checked_move(ai, patrol, nh[1], nh[2])

View file

@ -3,18 +3,13 @@ local AH = wesnoth.require "ai/lua/ai_helper.lua"
local ca_return_guardian = {}
function ca_return_guardian:evaluation(ai, cfg)
local unit
if cfg.filter then
unit = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", cfg.filter },
formula = '$this_unit.moves > 0' }
)[1]
else
unit = wesnoth.get_units({ id = cfg.id, formula = '$this_unit.moves > 0' })[1]
end
local filter = cfg.filter or { id = cfg.id }
local unit = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", filter },
formula = '$this_unit.moves > 0' }
)[1]
-- Check if unit exists as sticky BCAs are not always removed successfully
if unit then
if ((unit.x ~= cfg.return_x) or (unit.y ~= cfg.return_y)) then
return cfg.ca_score
@ -26,17 +21,12 @@ function ca_return_guardian:evaluation(ai, cfg)
end
function ca_return_guardian:execution(ai, cfg)
local unit
if cfg.filter then
unit = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", cfg.filter },
formula = '$this_unit.moves > 0' }
)[1]
else
unit = wesnoth.get_units({ id = cfg.id, formula = '$this_unit.moves > 0' })[1]
end
--print("Exec guardian move",unit.id)
local filter = cfg.filter or { id = cfg.id }
local unit = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", filter },
formula = '$this_unit.moves > 0' }
)[1]
-- In case the return hex is occupied:
local x, y = cfg.return_x, cfg.return_y
@ -45,9 +35,7 @@ function ca_return_guardian:execution(ai, cfg)
end
local nh = AH.next_hop(unit, x, y)
if unit.moves~=0 then
AH.movefull_stopunit(ai, unit, nh)
end
AH.movefull_stopunit(ai, unit, nh)
end
return ca_return_guardian

View file

@ -4,18 +4,13 @@ local AH = wesnoth.require "ai/lua/ai_helper.lua"
local ca_stationed_guardian = {}
function ca_stationed_guardian:evaluation(ai, cfg)
local unit
if cfg.filter then
unit = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", cfg.filter },
formula = '$this_unit.moves > 0' }
)[1]
else
unit = wesnoth.get_units({ id = cfg.id, formula = '$this_unit.moves > 0' })[1]
end
local filter = cfg.filter or { id = cfg.id }
local unit = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", filter },
formula = '$this_unit.moves > 0' }
)[1]
-- Check if unit exists as sticky BCAs are not always removed successfully
if unit then return cfg.ca_score end
return 0
end
@ -24,16 +19,12 @@ function ca_stationed_guardian:execution(ai, cfg)
-- (s_x,s_y): coordinates where unit is stationed; tries to move here if there is nobody to attack
-- (g_x,g_y): location that the unit guards
local unit
if cfg.filter then
unit = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", cfg.filter },
formula = '$this_unit.moves > 0' }
)[1]
else
unit = wesnoth.get_units({ id = cfg.id, formula = '$this_unit.moves > 0' })[1]
end
local filter = cfg.filter or { id = cfg.id }
local unit = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", filter },
formula = '$this_unit.moves > 0' }
)[1]
-- find if there are enemies within 'distance'
local enemies = wesnoth.get_units {

View file

@ -5,33 +5,24 @@ local LS = wesnoth.require "lua/location_set.lua"
local ca_zone_guardian = {}
function ca_zone_guardian:evaluation(ai, cfg)
local unit
if cfg.filter then
unit = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", cfg.filter },
formula = '$this_unit.moves > 0' }
)[1]
else
unit = wesnoth.get_units({ id = cfg.id, formula = '$this_unit.moves > 0' })[1]
end
local filter = cfg.filter or { id = cfg.id }
local unit = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", filter },
formula = '$this_unit.moves > 0' }
)[1]
-- Check if unit exists as sticky BCAs are not always removed successfully
if unit then return cfg.ca_score end
return 0
end
function ca_zone_guardian:execution(ai, cfg)
local unit
if cfg.filter then
unit = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", cfg.filter },
formula = '$this_unit.moves > 0' }
)[1]
else
unit = wesnoth.get_units({ id = cfg.id, formula = '$this_unit.moves > 0' })[1]
end
local filter = cfg.filter or { id = cfg.id }
local unit = wesnoth.get_units({
side = wesnoth.current.side,
{ "and", filter },
formula = '$this_unit.moves > 0' }
)[1]
local reach = wesnoth.find_reach(unit)
local zone_enemy = cfg.filter_location_enemy or cfg.filter_location

View file

@ -0,0 +1,173 @@
local H = wesnoth.require "lua/helper.lua"
local W = H.set_wml_action_metatable {}
local AH = wesnoth.require("ai/lua/ai_helper.lua")
local micro_ai_helper = {}
function micro_ai_helper.add_CAs(side, CA_parms, CA_cfg)
-- Add the candidate actions defined in 'CA_parms' to the AI of 'side'
-- CA_parms is an array of tables, one for each CA to be added (CA setup parameters)
-- CA_cfg is a table with the parameters passed to the eval/exec functions
--
-- Required keys for CA_parms:
-- - ca_id: is used for CA id/name and the eval/exec function names
-- - score: the evaluation score
for i,parms in ipairs(CA_parms) do
-- Make sure the id/name of each CA are unique.
-- We do this by seeing if a CA by that name exists already.
-- If not, we use the passed id in parms.ca_id
-- If yes, we add a number to the end of parms.ca_id until we find an id that does not exist yet
local ca_id, id_found = parms.ca_id, true
local n = 1
while id_found do -- This is really just a precaution
id_found = false
for ai_tag in H.child_range(wesnoth.sides[side].__cfg, 'ai') do
for stage in H.child_range(ai_tag, 'stage') do
for ca in H.child_range(stage, 'candidate_action') do
if (ca.name == ca_id) then id_found = true end
--print('---> found CA:', ca.name, id_found)
end
end
end
if (id_found) then ca_id = parms.ca_id .. n end
n = n+1
end
-- Always pass the ca_id and ca_score to the eval/exec functions
CA_cfg.ca_id = ca_id
CA_cfg.ca_score = parms.score
local CA = {
engine = "lua",
id = ca_id,
name = ca_id,
max_score = parms.score
}
CA.location = parms.location
local cfg = string.sub(AH.serialize(CA_cfg), 2, -2) -- need to strip surrounding {}
CA.eval_parms = cfg
CA.exec_parms = cfg
W.modify_ai {
side = side,
action = "add",
path = "stage[main_loop].candidate_action",
{ "candidate_action", CA }
}
end
end
function micro_ai_helper.delete_CAs(side, CA_parms)
-- Delete the candidate actions defined in 'CA_parms' from the AI of 'side'
-- CA_parms is an array of tables, one for each CA to be removed
-- We can simply pass the one used for add_CAs(), although only the
-- CA_parms.ca_id field is needed
for i,parms in ipairs(CA_parms) do
local ca_id = parms.ca_id
W.modify_ai {
side = side,
action = "try_delete",
path = "stage[main_loop].candidate_action[" .. ca_id .. "]"
}
end
end
function micro_ai_helper.add_aspects(side, aspect_parms)
-- Add the aspects defined in 'aspect_parms' to the AI of 'side'
-- aspect_parms is an array of tables, one for each aspect to be added
--
-- Required keys for aspect_parms:
-- - aspect: the aspect name (e.g. 'attacks' or 'aggression')
-- - facet: A table describing the facet to be added
--
-- Examples of facets:
-- 1. Simple aspect, e.g. aggression
-- { value = 0.99 }
--
-- 2. Composite aspect, e.g. attacks
-- { name = "ai_default_rca::aspect_attacks",
-- id = "dont_attack",
-- invalidate_on_gamestate_change = "yes",
-- { "filter_own", {
-- type = "Dark Sorcerer"
-- } }
-- }
for i,parms in ipairs(aspect_parms) do
W.modify_ai {
side = side,
action = "add",
path = "aspect[" .. parms.aspect .. "].facet",
{ "facet", parms.facet }
}
end
end
function micro_ai_helper.delete_aspects(side, aspect_parms)
-- Delete the aspects defined in 'aspect_parms' from the AI of 'side'
-- aspect_parms is an array of tables, one for each CA to be removed
-- We can simply pass the one used for add_aspects(), although only the
-- aspect_parms.aspect_id field is needed
for i,parms in ipairs(aspect_parms) do
W.modify_ai {
side = side,
action = "try_delete",
path = "aspect[attacks].facet[" .. parms.aspect_id .. "]"
}
end
end
function micro_ai_helper.micro_ai_setup(cfg, CA_parms, required_keys, optional_keys)
-- If cfg.ca_id is set, it gets added to the ca_id= key of all CAs
-- This allows for selective removal of CAs
if cfg.ca_id then
for i,parms in ipairs(CA_parms) do
-- Need to save eval_id first though
parms.eval_id = parms.ca_id
parms.ca_id = parms.ca_id .. '_' .. cfg.ca_id
end
end
-- If action=delete, we do that and are done
if (cfg.action == 'delete') then
micro_ai_helper.delete_CAs(cfg.side, CA_parms)
return
end
-- Otherwise, set up the cfg table to be passed to the CA eval/exec functions
local CA_cfg = {}
-- Required keys
for k, v in pairs(required_keys) do
local child = H.get_child(cfg, v)
if (not cfg[v]) and (not child) then
H.wml_error("[micro_ai] tag (" .. cfg.ai_type .. ") is missing required parameter: " .. v)
end
CA_cfg[v] = cfg[v]
if child then CA_cfg[v] = child end
end
-- Optional keys
for k, v in pairs(optional_keys) do
CA_cfg[v] = cfg[v]
local child = H.get_child(cfg, v)
if child then CA_cfg[v] = child end
end
-- Finally, set up the candidate actions themselves
if (cfg.action == 'add') then micro_ai_helper.add_CAs(cfg.side, CA_parms, CA_cfg) end
if (cfg.action == 'change') then
micro_ai_helper.delete_CAs(cfg.side, CA_parms, cfg.id)
micro_ai_helper.add_CAs(cfg.side, CA_parms, CA_cfg)
end
end
return micro_ai_helper

View file

@ -1,127 +1,6 @@
local H = wesnoth.require "lua/helper.lua"
local W = H.set_wml_action_metatable {}
local AH = wesnoth.require("ai/lua/ai_helper.lua")
local function add_CAs(side, CA_parms, CA_cfg)
-- Add the candidate actions defined in 'CA_parms' to the AI of 'side'
-- CA_parms is an array of tables, one for each CA to be added (CA setup parameters)
-- CA_cfg is a table with the parameters passed to the eval/exec functions
--
-- Required keys for CA_parms:
-- - ca_id: is used for CA id/name and the eval/exec function names
-- - score: the evaluation score
for i,parms in ipairs(CA_parms) do
-- Make sure the id/name of each CA are unique.
-- We do this by seeing if a CA by that name exists already.
-- If not, we use the passed id in parms.ca_id
-- If yes, we add a number to the end of parms.ca_id until we find an id that does not exist yet
local ca_id, id_found = parms.ca_id, true
local n = 1
while id_found do -- This is really just a precaution
id_found = false
for ai_tag in H.child_range(wesnoth.sides[side].__cfg, 'ai') do
for stage in H.child_range(ai_tag, 'stage') do
for ca in H.child_range(stage, 'candidate_action') do
if (ca.name == ca_id) then id_found = true end
--print('---> found CA:', ca.name, id_found)
end
end
end
if (id_found) then ca_id = parms.ca_id .. n end
n = n+1
end
-- Always pass the ca_id and ca_score to the eval/exec functions
CA_cfg.ca_id = ca_id
CA_cfg.ca_score = parms.score
local CA = {
engine = "lua",
id = ca_id,
name = ca_id,
max_score = parms.score
}
CA.location = parms.location
local cfg = string.sub(AH.serialize(CA_cfg), 2, -2) -- need to strip surrounding {}
CA.eval_parms = cfg
CA.exec_parms = cfg
W.modify_ai {
side = side,
action = "add",
path = "stage[main_loop].candidate_action",
{ "candidate_action", CA }
}
end
end
local function delete_CAs(side, CA_parms)
-- Delete the candidate actions defined in 'CA_parms' from the AI of 'side'
-- CA_parms is an array of tables, one for each CA to be removed
-- We can simply pass the one used for add_CAs(), although only the
-- CA_parms.ca_id field is needed
for i,parms in ipairs(CA_parms) do
local ca_id = parms.ca_id
W.modify_ai {
side = side,
action = "try_delete",
path = "stage[main_loop].candidate_action[" .. ca_id .. "]"
}
end
end
local function add_aspects(side, aspect_parms)
-- Add the aspects defined in 'aspect_parms' to the AI of 'side'
-- aspect_parms is an array of tables, one for each aspect to be added
--
-- Required keys for aspect_parms:
-- - aspect: the aspect name (e.g. 'attacks' or 'aggression')
-- - facet: A table describing the facet to be added
--
-- Examples of facets:
-- 1. Simple aspect, e.g. aggression
-- { value = 0.99 }
--
-- 2. Composite aspect, e.g. attacks
-- { name = "ai_default_rca::aspect_attacks",
-- id = "dont_attack",
-- invalidate_on_gamestate_change = "yes",
-- { "filter_own", {
-- type = "Dark Sorcerer"
-- } }
-- }
for i,parms in ipairs(aspect_parms) do
W.modify_ai {
side = side,
action = "add",
path = "aspect[" .. parms.aspect .. "].facet",
{ "facet", parms.facet }
}
end
end
local function delete_aspects(side, aspect_parms)
-- Delete the aspects defined in 'aspect_parms' from the AI of 'side'
-- aspect_parms is an array of tables, one for each CA to be removed
-- We can simply pass the one used for add_aspects(), although only the
-- aspect_parms.aspect_id field is needed
for i,parms in ipairs(aspect_parms) do
W.modify_ai {
side = side,
action = "try_delete",
path = "aspect[attacks].facet[" .. parms.aspect_id .. "]"
}
end
end
local MAIH = wesnoth.require("ai/micro_ais/micro_ai_helper.lua")
function wesnoth.wml_actions.micro_ai(cfg)
-- Set up the [micro_ai] tag functionality for each Micro AI
@ -178,20 +57,21 @@ function wesnoth.wml_actions.micro_ai(cfg)
-- Set up the configuration tables for the different Micro AIs
local required_keys, optional_keys, CA_parms = {}, {}, {}
local CA_path = 'ai/micro_ais/cas/'
--------- Healer Support Micro AI ------------------------------------
if (cfg.ai_type == 'healer_support') then
optional_keys = { "aggression", "injured_units_only", "max_threats", "filter", "filter_second" }
-- Scores for this AI need to be hard-coded, it does not work otherwise
CA_parms = {
{ ca_id = 'mai_healer_initialize', location = 'ai/micro_ais/cas/ca_healer_initialize.lua', score = 999990 },
{ ca_id = 'mai_healer_move', location = 'ai/micro_ais/cas/ca_healer_move.lua', score = 105000 },
{ ca_id = 'mai_healer_initialize', location = CA_path .. 'ca_healer_initialize.lua', score = 999990 },
{ ca_id = 'mai_healer_move', location = CA_path .. 'ca_healer_move.lua', score = 105000 },
}
-- The healers_can_attack CA is only added to the table if aggression ~= 0
-- But: make sure we always try removal
if (cfg.action == 'delete') or (tonumber(cfg.aggression) ~= 0) then
table.insert(CA_parms, { ca_id = 'mai_healer_may_attack', location = 'ai/micro_ais/cas/ca_healer_may_attack.lua', score = 99990 })
table.insert(CA_parms, { ca_id = 'mai_healer_may_attack', location = CA_path .. 'ca_healer_may_attack.lua', score = 99990 })
end
--------- Bottleneck Defense Micro AI -----------------------------------
@ -200,35 +80,38 @@ function wesnoth.wml_actions.micro_ai(cfg)
optional_keys = { "healer_x", "healer_y", "leadership_x", "leadership_y", "active_side_leader" }
local score = cfg.ca_score or 300000
CA_parms = {
{ ca_id = 'mai_bottleneck_move', location = 'ai/micro_ais/cas/ca_bottleneck_move.lua', score = score },
{ ca_id = 'mai_bottleneck_attack', location = 'ai/micro_ais/cas/ca_bottleneck_attack.lua', score = score - 1 }
{ ca_id = 'mai_bottleneck_move', location = CA_path .. 'ca_bottleneck_move.lua', score = score },
{ ca_id = 'mai_bottleneck_attack', location = CA_path .. 'ca_bottleneck_attack.lua', score = score - 1 }
}
--------- Messenger Escort Micro AI ------------------------------------
elseif (cfg.ai_type == 'messenger_escort') then
required_keys = { "id", "waypoint_x", "waypoint_y" }
optional_keys = { "enemy_death_chance", "messenger_death_chance" }
if (not cfg.id) and (not H.get_child(cfg, "filter")) then
H.wml_error("Messenger [micro_ai] tag requires either id= key or [filter] tag")
end
required_keys = { "waypoint_x", "waypoint_y" }
optional_keys = { "id", "enemy_death_chance", "filter", "filter_second", "invert_order", "messenger_death_chance" }
local score = cfg.ca_score or 300000
CA_parms = {
{ ca_id = 'mai_messenger_attack', location = 'ai/micro_ais/cas/ca_messenger_attack.lua', score = score },
{ ca_id = 'mai_messenger_move', location = 'ai/micro_ais/cas/ca_messenger_move.lua', score = score - 1 },
{ ca_id = 'mai_messenger_escort_move', location = 'ai/micro_ais/cas/ca_messenger_escort_move.lua', score = score - 2 }
{ ca_id = 'mai_messenger_attack', location = CA_path .. 'ca_messenger_attack.lua', score = score },
{ ca_id = 'mai_messenger_move', location = CA_path .. 'ca_messenger_move.lua', score = score - 1 },
{ ca_id = 'mai_messenger_escort_move', location = CA_path .. 'ca_messenger_escort_move.lua', score = score - 2 }
}
--------- Lurkers Micro AI ------------------------------------
elseif (cfg.ai_type == 'lurkers') then
required_keys = { "filter", "filter_location" }
optional_keys = { "stationary", "filter_location_wander" }
CA_parms = { { ca_id = 'mai_lurkers', location = 'ai/micro_ais/cas/ca_lurkers.lua', score = cfg.ca_score or 300000 } }
CA_parms = { { ca_id = 'mai_lurkers', location = CA_path .. 'ca_lurkers.lua', score = cfg.ca_score or 300000 } }
--------- Protect Unit Micro AI ------------------------------------
elseif (cfg.ai_type == 'protect_unit') then
required_keys = { "id", "goal_x", "goal_y" }
-- Scores for this AI need to be hard-coded, it does not work otherwise
CA_parms = {
{ ca_id = 'mai_protect_unit_finish', location = 'ai/micro_ais/cas/ca_protect_unit_finish.lua', score = 300000 },
{ ca_id = 'mai_protect_unit_attack', location = 'ai/micro_ais/cas/ca_protect_unit_attack.lua', score = 95000 },
{ ca_id = 'mai_protect_unit_move', location = 'ai/micro_ais/cas/ca_protect_unit_move.lua', score = 94999 }
{ ca_id = 'mai_protect_unit_finish', location = CA_path .. 'ca_protect_unit_finish.lua', score = 300000 },
{ ca_id = 'mai_protect_unit_attack', location = CA_path .. 'ca_protect_unit_attack.lua', score = 95000 },
{ ca_id = 'mai_protect_unit_move', location = CA_path .. 'ca_protect_unit_move.lua', score = 94999 }
}
-- [unit] tags need to be dealt with separately
@ -286,7 +169,7 @@ function wesnoth.wml_actions.micro_ai(cfg)
}
if (cfg.action == "delete") then
delete_aspects(cfg.side, aspect_parms)
MAIH.delete_aspects(cfg.side, aspect_parms)
-- We also need to add the move_leader_to_keep CA back in
-- This works even if it was not removed, it simply overwrites the existing CA
W.modify_ai {
@ -302,7 +185,7 @@ function wesnoth.wml_actions.micro_ai(cfg)
} }
}
else
add_aspects(cfg.side, aspect_parms)
MAIH.add_aspects(cfg.side, aspect_parms)
end
--------- Micro AI Guardian -----------------------------------
@ -312,7 +195,7 @@ function wesnoth.wml_actions.micro_ai(cfg)
end
required_keys = { "distance", "station_x", "station_y", "guard_x", "guard_y" }
optional_keys = { "id", "filter" }
CA_parms = { { ca_id = 'mai_stationed_guardian', location = 'ai/micro_ais/cas/ca_stationed_guardian.lua', score = cfg.ca_score or 300000 } }
CA_parms = { { ca_id = 'mai_stationed_guardian', location = CA_path .. 'ca_stationed_guardian.lua', score = cfg.ca_score or 300000 } }
elseif (cfg.ai_type == 'zone_guardian') then
if (not cfg.id) and (not H.get_child(cfg, "filter")) then
@ -320,7 +203,7 @@ function wesnoth.wml_actions.micro_ai(cfg)
end
required_keys = { "filter_location" }
optional_keys = { "id", "filter", "filter_location_enemy", "station_x", "station_y" }
CA_parms = { { ca_id = 'mai_zone_guardian', location = 'ai/micro_ais/cas/ca_zone_guardian.lua', score = cfg.ca_score or 300000 } }
CA_parms = { { ca_id = 'mai_zone_guardian', location = CA_path .. 'ca_zone_guardian.lua', score = cfg.ca_score or 300000 } }
elseif (cfg.ai_type == 'return_guardian') then
if (not cfg.id) and (not H.get_child(cfg, "filter")) then
@ -328,7 +211,7 @@ function wesnoth.wml_actions.micro_ai(cfg)
end
required_keys = { "return_x", "return_y" }
optional_keys = { "id", "filter" }
CA_parms = { { ca_id = 'mai_return_guardian', location = 'ai/micro_ais/cas/ca_return_guardian.lua', score = cfg.ca_score or 100010 } }
CA_parms = { { ca_id = 'mai_return_guardian', location = CA_path .. 'ca_return_guardian.lua', score = cfg.ca_score or 100010 } }
elseif (cfg.ai_type == 'coward') then
if (not cfg.id) and (not H.get_child(cfg, "filter")) then
@ -336,21 +219,21 @@ function wesnoth.wml_actions.micro_ai(cfg)
end
required_keys = { "distance" }
optional_keys = { "id", "filter", "filter_second", "seek_x", "seek_y","avoid_x","avoid_y" }
CA_parms = { { ca_id = 'mai_coward', location = 'ai/micro_ais/cas/ca_coward.lua', score = cfg.ca_score or 300000 } }
CA_parms = { { ca_id = 'mai_coward', location = CA_path .. 'ca_coward.lua', score = cfg.ca_score or 300000 } }
--------- Micro AI Animals ------------------------------------
elseif (cfg.ai_type == 'big_animals') then
required_keys = { "filter"}
optional_keys = { "avoid_unit", "filter_location", "filter_location_wander" }
CA_parms = { { ca_id = "mai_big_animals", location = 'ai/micro_ais/cas/ca_big_animals.lua', score = cfg.ca_score or 300000 } }
CA_parms = { { ca_id = "mai_big_animals", location = CA_path .. 'ca_big_animals.lua', score = cfg.ca_score or 300000 } }
elseif (cfg.ai_type == 'wolves') then
required_keys = { "filter", "filter_second" }
optional_keys = { "attack_only_prey", "avoid_type" }
local score = cfg.ca_score or 90000
CA_parms = {
{ ca_id = "mai_wolves_move", location = 'ai/micro_ais/cas/ca_wolves_move.lua', score = score },
{ ca_id = "mai_wolves_wander", location = 'ai/micro_ais/cas/ca_wolves_wander.lua', score = score - 1 }
{ ca_id = "mai_wolves_move", location = CA_path .. 'ca_wolves_move.lua', score = score },
{ ca_id = "mai_wolves_wander", location = CA_path .. 'ca_wolves_wander.lua', score = score - 1 }
}
if cfg.attack_only_prey then
@ -368,9 +251,9 @@ function wesnoth.wml_actions.micro_ai(cfg)
}
}
if (cfg.action == "delete") then
delete_aspects(cfg.side, wolves_aspects)
MAIH.delete_aspects(cfg.side, wolves_aspects)
else
add_aspects(cfg.side, wolves_aspects)
MAIH.add_aspects(cfg.side, wolves_aspects)
end
elseif cfg.avoid_type then
local wolves_aspects = {
@ -389,9 +272,9 @@ function wesnoth.wml_actions.micro_ai(cfg)
}
}
if (cfg.action == "delete") then
delete_aspects(cfg.side, wolves_aspects)
MAIH.delete_aspects(cfg.side, wolves_aspects)
else
add_aspects(cfg.side, wolves_aspects)
MAIH.add_aspects(cfg.side, wolves_aspects)
end
end
@ -400,12 +283,12 @@ function wesnoth.wml_actions.micro_ai(cfg)
optional_keys = { "attention_distance", "attack_distance" }
local score = cfg.ca_score or 300000
CA_parms = {
{ ca_id = "mai_herding_attack_close_enemy", location = 'ai/micro_ais/cas/ca_herding_attack_close_enemy.lua', score = score },
{ ca_id = "mai_herding_sheep_runs_enemy", location = 'ai/micro_ais/cas/ca_herding_sheep_runs_enemy.lua', score = score - 1 },
{ ca_id = "mai_herding_sheep_runs_dog", location = 'ai/micro_ais/cas/ca_herding_sheep_runs_dog.lua', score = score - 2 },
{ ca_id = "mai_herding_herd_sheep", location = 'ai/micro_ais/cas/ca_herding_herd_sheep.lua', score = score - 3 },
{ ca_id = "mai_herding_sheep_move", location = 'ai/micro_ais/cas/ca_herding_sheep_move.lua', score = score - 4 },
{ ca_id = "mai_herding_dog_move", location = 'ai/micro_ais/cas/ca_herding_dog_move.lua', score = score - 5 }
{ ca_id = "mai_herding_attack_close_enemy", location = CA_path .. 'ca_herding_attack_close_enemy.lua', score = score },
{ ca_id = "mai_herding_sheep_runs_enemy", location = CA_path .. 'ca_herding_sheep_runs_enemy.lua', score = score - 1 },
{ ca_id = "mai_herding_sheep_runs_dog", location = CA_path .. 'ca_herding_sheep_runs_dog.lua', score = score - 2 },
{ ca_id = "mai_herding_herd_sheep", location = CA_path .. 'ca_herding_herd_sheep.lua', score = score - 3 },
{ ca_id = "mai_herding_sheep_move", location = CA_path .. 'ca_herding_sheep_move.lua', score = score - 4 },
{ ca_id = "mai_herding_dog_move", location = CA_path .. 'ca_herding_dog_move.lua', score = score - 5 }
}
elseif (cfg.ai_type == 'forest_animals') then
@ -414,26 +297,26 @@ function wesnoth.wml_actions.micro_ai(cfg)
}
local score = cfg.ca_score or 300000
CA_parms = {
{ ca_id = "mai_forest_animals_new_rabbit", location = 'ai/micro_ais/cas/ca_forest_animals_new_rabbit.lua', score = score },
{ ca_id = "mai_forest_animals_tusker_attack", location = 'ai/micro_ais/cas/ca_forest_animals_tusker_attack.lua', score = score - 1 },
{ ca_id = "mai_forest_animals_move", location = 'ai/micro_ais/cas/ca_forest_animals_move.lua', score = score - 2 },
{ ca_id = "mai_forest_animals_tusklet_move", location = 'ai/micro_ais/cas/ca_forest_animals_tusklet_move.lua', score = score - 3 }
{ ca_id = "mai_forest_animals_new_rabbit", location = CA_path .. 'ca_forest_animals_new_rabbit.lua', score = score },
{ ca_id = "mai_forest_animals_tusker_attack", location = CA_path .. 'ca_forest_animals_tusker_attack.lua', score = score - 1 },
{ ca_id = "mai_forest_animals_move", location = CA_path .. 'ca_forest_animals_move.lua', score = score - 2 },
{ ca_id = "mai_forest_animals_tusklet_move", location = CA_path .. 'ca_forest_animals_tusklet_move.lua', score = score - 3 }
}
elseif (cfg.ai_type == 'swarm') then
optional_keys = { "scatter_distance", "vision_distance", "enemy_distance" }
local score = cfg.ca_score or 300000
CA_parms = {
{ ca_id = "mai_swarm_scatter", location = 'ai/micro_ais/cas/ca_swarm_scatter.lua', score = score },
{ ca_id = "mai_swarm_move", location = 'ai/micro_ais/cas/ca_swarm_move.lua', score = score - 1 }
{ ca_id = "mai_swarm_scatter", location = CA_path .. 'ca_swarm_scatter.lua', score = score },
{ ca_id = "mai_swarm_move", location = CA_path .. 'ca_swarm_move.lua', score = score - 1 }
}
elseif (cfg.ai_type == 'wolves_multipacks') then
optional_keys = { "type", "pack_size", "show_pack_number" }
local score = cfg.ca_score or 300000
CA_parms = {
{ ca_id = "mai_wolves_multipacks_attack", location = 'ai/micro_ais/cas/ca_wolves_multipacks_attack.lua', score = score },
{ ca_id = "mai_wolves_multipacks_wander", location = 'ai/micro_ais/cas/ca_wolves_multipacks_wander.lua', score = score - 1 }
{ ca_id = "mai_wolves_multipacks_attack", location = CA_path .. 'ca_wolves_multipacks_attack.lua', score = score },
{ ca_id = "mai_wolves_multipacks_wander", location = CA_path .. 'ca_wolves_multipacks_wander.lua', score = score - 1 }
}
elseif (cfg.ai_type == 'hunter') then
@ -442,7 +325,7 @@ function wesnoth.wml_actions.micro_ai(cfg)
end
required_keys = { "home_x", "home_y" }
optional_keys = { "id", "filter", "filter_location", "rest_turns", "show_messages" }
CA_parms = { { ca_id = "mai_hunter", location = 'ai/micro_ais/cas/ca_hunter.lua', score = cfg.ca_score or 300000 } }
CA_parms = { { ca_id = "mai_hunter", location = CA_path .. 'ca_hunter.lua', score = cfg.ca_score or 300000 } }
--------- Patrol Micro AI ------------------------------------
elseif (cfg.ai_type == 'patrol') then
@ -451,17 +334,17 @@ function wesnoth.wml_actions.micro_ai(cfg)
end
required_keys = { "waypoint_x", "waypoint_y" }
optional_keys = { "id", "filter", "attack", "one_time_only", "out_and_back" }
CA_parms = { { ca_id = "mai_patrol", location = 'ai/micro_ais/cas/ca_patrol.lua', score = cfg.ca_score or 300000 } }
CA_parms = { { ca_id = "mai_patrol", location = CA_path .. 'ca_patrol.lua', score = cfg.ca_score or 300000 } }
--------- Recruiting Micro AI ------------------------------------
elseif (cfg.ai_type == 'recruit_rushers') or (cfg.ai_type == 'recruit_random')then
if (cfg.ai_type == 'recruit_rushers') then
optional_keys = { "randomness" }
CA_parms = { { ca_id = "mai_rusher_recruit", location = 'ai/micro_ais/cas/ca_recruit_rushers.lua', score = cfg.ca_score or 180000 } }
CA_parms = { { ca_id = "mai_rusher_recruit", location = CA_path .. 'ca_recruit_rushers.lua', score = cfg.ca_score or 180000 } }
else
optional_keys = { "skip_low_gold_recruiting", "type", "prob" }
CA_parms = { { ca_id = "mai_random_recruit", location = 'ai/micro_ais/cas/ca_recruit_random.lua', score = cfg.ca_score or 180000 } }
CA_parms = { { ca_id = "mai_random_recruit", location = CA_path .. 'ca_recruit_random.lua', score = cfg.ca_score or 180000 } }
-- The 'probability' tags need to be handled separately here
cfg.type, cfg.prob = {}, {}
@ -508,64 +391,22 @@ function wesnoth.wml_actions.micro_ai(cfg)
"avoid_enemies", "filter", "ignore_units", "ignore_enemy_at_goal",
"release_all_units_at_goal", "release_unit_at_goal", "unique_goals", "use_straight_line"
}
CA_parms = { { ca_id = 'mai_goto', location = 'ai/micro_ais/cas/ca_goto.lua', score = cfg.ca_score or 300000 } }
CA_parms = { { ca_id = 'mai_goto', location = CA_path .. 'ca_goto.lua', score = cfg.ca_score or 300000 } }
--------- Hang Out Micro AI ------------------------------------
elseif (cfg.ai_type == 'hang_out') then
optional_keys = { "filter", "filter_location", "avoid", "mobilize_condition", "mobilize_on_gold_less_than" }
CA_parms = { { ca_id = 'mai_hang_out', location = 'ai/micro_ais/cas/ca_hang_out.lua', score = cfg.ca_score or 170000 } }
CA_parms = { { ca_id = 'mai_hang_out', location = CA_path .. 'ca_hang_out.lua', score = cfg.ca_score or 170000 } }
--------- Simple Attack Micro AI ---------------------------
elseif (cfg.ai_type == 'simple_attack') then
optional_keys = { "filter", "filter_second", "weapon" }
CA_parms = { { ca_id = 'mai_simple_attack', location = 'ai/micro_ais/cas/ca_simple_attack.lua', score = cfg.ca_score or 110000 } }
CA_parms = { { ca_id = 'mai_simple_attack', location = CA_path .. 'ca_simple_attack.lua', score = cfg.ca_score or 110000 } }
-- If we got here, none of the valid ai_types was specified
else
H.wml_error("unknown value for ai_type= in [micro_ai]")
end
--------- Now go on to setting up the CAs ---------------------------------
-- If cfg.ca_id is set, it gets added to the ca_id= key of all CAs
-- This allows for selective removal of CAs
if cfg.ca_id then
for i,parms in ipairs(CA_parms) do
-- Need to save eval_id first though
parms.eval_id = parms.ca_id
parms.ca_id = parms.ca_id .. '_' .. cfg.ca_id
end
end
-- If action=delete, we do that and are done
if (cfg.action == 'delete') then
delete_CAs(cfg.side, CA_parms)
return
end
-- Otherwise, set up the cfg table to be passed to the CA eval/exec functions
local CA_cfg = {}
-- Required keys
for k, v in pairs(required_keys) do
local child = H.get_child(cfg, v)
if (not cfg[v]) and (not child) then
H.wml_error("[micro_ai] tag (" .. cfg.ai_type .. ") is missing required parameter: " .. v)
end
CA_cfg[v] = cfg[v]
if child then CA_cfg[v] = child end
end
-- Optional keys
for k, v in pairs(optional_keys) do
CA_cfg[v] = cfg[v]
local child = H.get_child(cfg, v)
if child then CA_cfg[v] = child end
end
-- Finally, set up the candidate actions themselves
if (cfg.action == 'add') then add_CAs(cfg.side, CA_parms, CA_cfg) end
if (cfg.action == 'change') then
delete_CAs(cfg.side, CA_parms, cfg.id)
add_CAs(cfg.side, CA_parms, CA_cfg)
end
MAIH.micro_ai_setup(cfg, CA_parms, required_keys, optional_keys)
end

View file

@ -8,7 +8,7 @@ Version 1.13.0-dev:
* Rebalanced scenarios 'Invaders', Mages and Drakes' and 'Fear'.
* Language and i18n:
* Updated translations: German, Greek, Scottish Gaelic, Slovak.
* Updated translations: German, Greek, Hungarian, Scottish Gaelic, Slovak.
* Units:
* Increased the experience requirement for the Rami from 32 to 39.
@ -21,6 +21,8 @@ Version 1.13.0-dev:
* Fixed halos glitching through locations that become shrouded after the
halo is rendered for the first time.
* OS X user data directory is now ~/Library/Application Support/Wesnoth_1.13
* Fix bug #3856: The turn dialog used in hotseat MP play now applies
a blindfold for the duration of the dialog.
Version 1.11.11:

View file

@ -794,8 +794,8 @@ msgstr ""
#. [message]: speaker=unit
#: data/ai/micro_ais/scenarios/goto.cfg:603
msgid ""
"$unit.language_name $unit.name from Lieutenant Gadoc's squadron reporting for duty, "
"sir."
"$unit.language_name $unit.name from Lieutenant Gadoc's squadron reporting "
"for duty, sir."
msgstr ""
#. [message]: speaker=fort_commander
@ -811,8 +811,8 @@ msgstr ""
#. [message]: speaker=fort_commander
#: data/ai/micro_ais/scenarios/goto.cfg:631
msgid ""
"Very good, $unit.language_name. Now go help your comrade get rid of that saurian "
"infestation in the swamps."
"Very good, $unit.language_name. Now go help your comrade get rid of that "
"saurian infestation in the swamps."
msgstr ""
#. [message]: speaker=fort_commander

View file

@ -8,7 +8,7 @@ msgstr ""
"Project-Id-Version: Battle for Wesnoth 1.2\n"
"Report-Msgid-Bugs-To: http://bugs.wesnoth.org/\n"
"POT-Creation-Date: 2014-03-02 18:56+0100\n"
"PO-Revision-Date: 2014-03-09 13:13+0100\n"
"PO-Revision-Date: 2014-03-23 22:00+0100\n"
"Last-Translator: aceman <acelists@atlas.sk>\n"
"Language-Team: none\n"
"Language: \n"
@ -147,7 +147,7 @@ msgstr "<ref>dst='..geography' text='Zemepis'</ref>"
#. [topic]: id=caste
#: data/core/encyclopedia/drakes.cfg:7
msgid "Caste"
msgstr ""
msgstr "Kasta"
#. [topic]: id=caste
#: data/core/encyclopedia/drakes.cfg:8
@ -156,11 +156,13 @@ msgid ""
"Clasher' text='Clasher'</ref> or a <ref>dst='unit_Drake Fighter' text='Drake "
"Fighter'</ref>."
msgstr ""
"Jedna z foriem jašterov: buď <ref>dst='unit_Drake Clasher' text='Úderník'</"
"ref> alebo <ref>dst='unit_Drake Fighter' text='Vojak'</ref>."
#. [topic]: id=aerie
#: data/core/encyclopedia/drakes.cfg:13
msgid "Aerie"
msgstr ""
msgstr "Hniezdo"
#. [topic]: id=aerie
#: data/core/encyclopedia/drakes.cfg:14
@ -169,11 +171,14 @@ msgid ""
"text='flight'</ref>. It contains the <ref>dst='breeding_pen' text='breeding "
"pens'</ref>."
msgstr ""
"Veľká štruktúra podobná hradu, ktorá je domovom <ref>dst='flight' "
"text='letky'</ref>. Obsahuje aj <ref>dst='breeding_pen' text='rozmnožovacie "
"ohrady'</ref>."
#. [topic]: id=breeding_pen
#: data/core/encyclopedia/drakes.cfg:19
msgid "Breeding Pen"
msgstr ""
msgstr "Rozmnožovacia ohrada"
#. [topic]: id=breeding_pen
#: data/core/encyclopedia/drakes.cfg:20
@ -182,11 +187,14 @@ msgid ""
"<ref>dst='breeder' text='Breeders'</ref> live under the <ref>dst='dominant' "
"text='Dominant'</ref>s eye."
msgstr ""
"Časť <ref>dst='aerie' text='hniezda'</ref>, kde pod dozorom "
"<ref>dst='dominant' text='Dominanta'</ref> žijú <ref>dst='breeder' "
"text='Nosnice'</ref>."
#. [topic]: id=breeding_cycle
#: data/core/encyclopedia/drakes.cfg:25
msgid "Breeding Cycle"
msgstr ""
msgstr "Rozmnožovací cyklus"
#. [topic]: id=breeding_cycle
#: data/core/encyclopedia/drakes.cfg:26
@ -194,11 +202,13 @@ msgid ""
"The time that passes between one <ref>dst=egg text='egg'</ref> laying to the "
"next."
msgstr ""
"Čas, ktorý uplynie medzi jedným kladením <ref>dst=egg text='vajec'</ref> a "
"ďalším."
#. [topic]: id=world_ocean
#: data/core/encyclopedia/drakes.cfg:31
msgid "World Ocean"
msgstr ""
msgstr "Svetový oceán"
#. [topic]: id=world_ocean
#: data/core/encyclopedia/drakes.cfg:32
@ -207,11 +217,14 @@ msgid ""
"of <ref>dst='morogor' text='Morogor'</ref>. The drakes believe it to end at "
"the <ref>dst='abyss' text='Abyss'</ref>, a vast and deadly waterfall."
msgstr ""
"Svetový oceán je názov otvoreného mora, ktoré obklopuje súostrovie "
"<ref>dst='morogor' text='Morogor'</ref>. Jašteri veria, že končí v "
"<ref>dst='abyss' text='Priepasti'</ref> - obrovskom smrtiacom vodopáde."
#. [topic]: id=new_continent
#: data/core/encyclopedia/drakes.cfg:37
msgid "New Continent"
msgstr ""
msgstr "Nový kontinent"
#. [topic]: id=new_continent
#: data/core/encyclopedia/drakes.cfg:38
@ -219,11 +232,13 @@ msgid ""
"The great continent to the east of <ref>dst='morogor' text='Morogor'</ref>. "
"Its existence is unknown to the drakes until the flight of Galun."
msgstr ""
"Veľký kontinent na východ od <ref>dst='morogor' text='Morogoru'</ref>. Jeho "
"existencia nebola jašterom známa až do letu Galuna."
#. [topic]: id=abyss
#: data/core/encyclopedia/drakes.cfg:43
msgid "Abyss"
msgstr ""
msgstr "Priepasť"
#. [topic]: id=abyss
#: data/core/encyclopedia/drakes.cfg:44
@ -231,11 +246,13 @@ msgid ""
"In the cosmology of the Drakes, a vast and deadly waterfall where the ocean "
"falls off the world-disc."
msgstr ""
"V svetonázore jašterov je to obrovský a smrtiaci vodopád, kde oceán padá "
"dolu zo zemského disku."
#. [topic]: id=spiral_path
#: data/core/encyclopedia/drakes.cfg:49
msgid "Spiral Path"
msgstr ""
msgstr "Špirálová cesta"
#. [topic]: id=spiral_path
#: data/core/encyclopedia/drakes.cfg:50
@ -244,11 +261,14 @@ msgid ""
"Malthusian final war. See also <ref>dst='straight_path' text='Straight "
"Path'</ref>"
msgstr ""
"Polotajná organizácia medzi jaštermi zameraná na zabránenie Malthusovej "
"poslednej vojne. Pozri tiež <ref>dst='straight_path' text='Priama cesta'</"
"ref>"
#. [topic]: id=straight_path
#: data/core/encyclopedia/drakes.cfg:55
msgid "Straight Path"
msgstr ""
msgstr "Priama cesta"
#. [topic]: id=straight_path
#: data/core/encyclopedia/drakes.cfg:56
@ -257,11 +277,14 @@ msgid ""
"mostly used by the members of the <ref>dst='spiral_path' text='Spiral Path'</"
"ref>."
msgstr ""
"Jašteria tradícia opakovaného rozširovania a dobývania. Tento výraz je "
"najčastejšie používaný príslušníkmi <ref>dst='spiral_path' text='Spiral "
"Path'</ref>."
#. [topic]: id=dominant
#: data/core/encyclopedia/drakes.cfg:61
msgid "Dominant"
msgstr ""
msgstr "Dominant"
#. [topic]: id=dominant
#: data/core/encyclopedia/drakes.cfg:62
@ -271,11 +294,15 @@ msgid ""
"<ref>dst='breeder' text='breeders'</ref>. Rarely, he may confer breeding "
"privileges on others."
msgstr ""
"<ref>dst='aspirant' text='Uchádzač'</ref>, ktorý povstane ako vodca "
"jašterov. Jediný jašter v kmeni, ktorý má povolené rozmnožovať sa s "
"<ref>dst='breeder' text='nosnicami'</ref>. Výnimočne môže udeliť právo "
"párenia aj iným."
#. [topic]: id=vulcaniad
#: data/core/encyclopedia/drakes.cfg:67
msgid "Vulcaniad"
msgstr ""
msgstr "Vulkaniáda"
#. [topic]: id=vulcaniad
#: data/core/encyclopedia/drakes.cfg:68
@ -284,11 +311,14 @@ msgid ""
"<ref>dst='mount_morogor' text='Mount Morogor'</ref>. The "
"<ref>dst='long_count' text='Long Count'</ref> calendar is based upon it."
msgstr ""
"(Nepravidelný) cyklus medzi následnými výbuchmi <ref>dst='mount_morogor' "
"text='Hory Morogor'</ref>. Je na ňom založený kalendár <ref>dst='long_count' "
"text='Dlhý letopočet'</ref>."
#. [topic]: id=recorder
#: data/core/encyclopedia/drakes.cfg:73
msgid "Recorder"
msgstr ""
msgstr "Zapisovateľ"
#. [topic]: id=recorder
#: data/core/encyclopedia/drakes.cfg:74
@ -298,17 +328,21 @@ msgid ""
"<ref>dst='caste' text='caste'</ref> of Drake not determined by biology: they "
"recruit their members from all of the other castes."
msgstr ""
"Zapisovateľ je jašterím knihovníkom, ktorý ovláda jašterie "
"<ref>dst='drakish_script' text='písmo'</ref>. Zapisovatelia sú jedinou "
"<ref>dst='caste' text='kastou'</ref> Jašterov, ktorú neurčuje príroda: "
"verbujú členov zo všetkých ostatných kást."
#. [topic]: id=laying
#: data/core/encyclopedia/drakes.cfg:79
msgid "Laying"
msgstr ""
msgstr "Kladenie"
#. [topic]: id=hatching
#. [topic]: id=laying
#: data/core/encyclopedia/drakes.cfg:80 data/core/encyclopedia/drakes.cfg:86
msgid "A portion of the <ref>dst='breeding_cycle' text='breeding cycle'</ref>."
msgstr ""
msgstr "Časť <ref>dst='breeding_cycle' text='rozmnožovacieho cyklu'</ref>."
#. [topic]: id=hatching
#: data/core/encyclopedia/drakes.cfg:85
@ -318,7 +352,7 @@ msgstr "Liahnutie"
#. [topic]: id=hatchling
#: data/core/encyclopedia/drakes.cfg:91
msgid "Hatchling"
msgstr ""
msgstr "Mláďa"
#. [topic]: id=hatchling
#: data/core/encyclopedia/drakes.cfg:92
@ -327,11 +361,13 @@ msgid ""
"the current generation of hatchlings are the most aggressive is the behavior "
"of the <ref>dst='flight' text='flight'</ref>."
msgstr ""
"Malý jašter, ktorý ešte nevidel vyliahnutie ďalšej generácie. "
"<ref>dst='flight' text='letky'</ref>."
#. [topic]: id=fledgling
#: data/core/encyclopedia/drakes.cfg:97
msgid "Fledgling"
msgstr ""
msgstr "Okrídlenec"
#. [topic]: id=fledgling
#: data/core/encyclopedia/drakes.cfg:98
@ -340,11 +376,14 @@ msgid ""
"<ref>dst='flight' text='flight'</ref> can afford the loss of a generation "
"they start the <ref>dst='swarming' text='Swarming'</ref>."
msgstr ""
"Mladý jašter, ktorý videl vyliahnutie ďalšej generácie. Ak si "
"<ref>dst='flight' text='letka'</ref> môže dovoliť stratiť jednu generáciu, "
"môže spustiť <ref>dst='swarming' text='Rojenie'</ref>."
#. [topic]: id=breeder
#: data/core/encyclopedia/drakes.cfg:103
msgid "Breeder"
msgstr ""
msgstr "Nosnica"
#. [topic]: id=breeder
#: data/core/encyclopedia/drakes.cfg:104
@ -355,11 +394,16 @@ msgid ""
"take care of their food for themselves when laying. Drake breeders become "
"fertile after the next <ref>dst='hatching' text='hatching'</ref>."
msgstr ""
"Jašter ženského pohlavia. Sú vzácne, pretože o <ref>dst='egg' text='vajcia'</"
"ref>, ktoré sa stanú nosnicami, je nutné sa mimoriadne starať. Počet nosníc "
"je limitovaný počtom mužských jašterov v okolí, pretože nosnice si nevedia "
"zaobstarať jedlo keď kladú vajcia. Jašterie nosnice začnú byť plodné po "
"ďalšom <ref>dst='hatching' text='liahnutí'</ref>."
#. [topic]: id=egg
#: data/core/encyclopedia/drakes.cfg:109
msgid "Egg, Drake"
msgstr ""
msgstr "Vajce jaštera"
#. [topic]: id=egg
#: data/core/encyclopedia/drakes.cfg:110
@ -368,11 +412,14 @@ msgid ""
"text='Hatchling'</ref> will belongs to is determined by the time it is laid "
"and to some extent the ambient temperature."
msgstr ""
"<ref>dst=caste text='Kasta'</ref> budúceho <ref>dst='hatchling' "
"text='Mláďaťa'</ref> je určená už pri nakladení vajca a čiastočne aj "
"okolitou teplotou."
#. [topic]: id=flight
#: data/core/encyclopedia/drakes.cfg:115
msgid "Flight"
msgstr ""
msgstr "Letka"
#. [topic]: id=flight
#: data/core/encyclopedia/drakes.cfg:116
@ -381,11 +428,14 @@ msgid ""
"controlling a hunting range. Each tribe has one <ref>dst='dominant' "
"text='Dominant'</ref>, who confers mating privileges."
msgstr ""
"Kmeň jašterov, ktorý žije v <ref>dst='aerie' text='Hniezde'</ref> a ovláda "
"lovnú oblasť. Každý kmeň má jedného <ref>dst='dominant' text='Dominanta'</"
"ref>, ktorý udeľuje právo na párenie."
#. [topic]: id=aspirant
#: data/core/encyclopedia/drakes.cfg:121
msgid "Aspirant"
msgstr ""
msgstr "Uchádzač"
#. [topic]: id=aspirant
#: data/core/encyclopedia/drakes.cfg:122
@ -395,22 +445,26 @@ msgid ""
"secretion of the hormone is caused by hunt and combat actions in which the "
"drake is involved."
msgstr ""
"Mužský jašter, ktorý prešiel hormonálnymi zmenami, ktoré mu umožňujú páriť "
"sa s <ref>dst='breeder' text='nosnicami'</ref>. Vylučovanie hormónov je "
"spôsobované lovom a bojom, ktorých sa jašter zúčastnil."
#. [topic]: id=ascendant
#: data/core/encyclopedia/drakes.cfg:127
msgid "Ascendant"
msgstr ""
msgstr "Praotec"
#. [topic]: id=ascendant
#: data/core/encyclopedia/drakes.cfg:128
msgid ""
"The drake name for a true <ref>dst='unit_Fire Dragon' text='dragon'</ref>."
msgstr ""
"Jašterí názov pre skutočného <ref>dst='unit_Fire Dragon' text='draka'</ref>."
#. [topic]: id=intendant
#: data/core/encyclopedia/drakes.cfg:133
msgid "Intendant"
msgstr ""
msgstr "Správca"
#. [topic]: id=intendant
#: data/core/encyclopedia/drakes.cfg:134
@ -422,11 +476,16 @@ msgid ""
"likeliest to be granted mating privileges, especially after a notable "
"service."
msgstr ""
"Jeden z <ref>dst='aspirant' text='Uchádzačov'</ref>, zástupcov "
"<ref>dst='dominant' text='Dominanta'</ref>. Ten má tradične jedného z každej "
"<ref>dst=caste text='kasty'</ref> inej ako jeho vlastná. Ďalší 'Správcovia' "
"sú niekdy určení na zvláštne úlohy. Správcovia majú najväčšiu šancu získať "
"povolenie na párenie, najmä po významnej službe."
#. [topic]: id=swarm
#: data/core/encyclopedia/drakes.cfg:139
msgid "Swarm"
msgstr ""
msgstr "Roj"
#. [topic]: id=swarm
#: data/core/encyclopedia/drakes.cfg:140
@ -434,11 +493,13 @@ msgid ""
"The <ref>dst='swarmlings' text='Swarmlings'</ref> that have left the "
"<ref>dst='aerie' text='aerie'</ref> to found a new one."
msgstr ""
"Kŕdeľ <ref>dst='swarmlings' text='rojacich sa jašterov'</ref>, ktoré "
"opustili <ref>dst='aerie' text='hniezdo'</ref>, aby našli nové."
#. [topic]: id=swarming
#: data/core/encyclopedia/drakes.cfg:145
msgid "Swarming"
msgstr ""
msgstr "Rojenie"
#. [topic]: id=swarming
#: data/core/encyclopedia/drakes.cfg:146
@ -447,21 +508,24 @@ msgid ""
"text='aerie'</ref> that recurs every <ref>dst='breeding_cycle' "
"text='breeding cycle'</ref>. See <ref>dst='swarm' text='Swarm'</ref>"
msgstr ""
" <ref>dst='flight' text='Let'</ref> za novým jašterím <ref>dst='aerie' "
"text='hniezdom'</ref>, ktorý sa opakuje v každom <ref>dst='breeding_cycle' "
"text='rozmnožovacom cykle'</ref>. Pozri <ref>dst='swarm' text='Roj'</ref>"
#. [topic]: id=runners
#: data/core/encyclopedia/drakes.cfg:151
msgid "Runners"
msgstr ""
msgstr "Bežci"
#. [topic]: id=runners
#: data/core/encyclopedia/drakes.cfg:152
msgid "Drakish term for escaped slaves hunted as game."
msgstr ""
msgstr "Jašterí výraz pre uniknutých otrokov, ktorí slúžia ako lovná zver."
#. [topic]: id=mount_morogor
#: data/core/encyclopedia/drakes.cfg:157
msgid "Mount Morogor"
msgstr ""
msgstr "Hora Morogor"
#. [topic]: id=mount_morogor
#: data/core/encyclopedia/drakes.cfg:158
@ -469,11 +533,13 @@ msgid ""
"Volcanic mountain on the central island of the archipelago "
"<ref>dst='morogor' text='Morogor'</ref>."
msgstr ""
"Sopečná hora na centrálnom ostrove súostrovia <ref>dst='morogor' "
"text='Morogor'</ref>."
#. [topic]: id=long_count
#: data/core/encyclopedia/drakes.cfg:163
msgid "Long Count"
msgstr ""
msgstr "Dlhý letopočet"
#. [topic]: id=long_count
#: data/core/encyclopedia/drakes.cfg:164
@ -481,11 +547,13 @@ msgid ""
"The drake calender based on <ref>dst='vulcaniad' text='Vulcaniad'</ref> and "
"<ref>dst=breeding_cycle text='Breeding cycles'</ref>."
msgstr ""
"Jašterí kalendár založený na <ref>dst='vulcaniad' text='Vulkaniáde'</ref> a "
"<ref>dst=breeding_cycle text='Rozmnožovacích cykloch'</ref>."
#. [topic]: id=long_pig
#: data/core/encyclopedia/drakes.cfg:169
msgid "Long Pig"
msgstr ""
msgstr "Dlhé prasa"
#. [topic]: id=long_pig
#: data/core/encyclopedia/drakes.cfg:170
@ -493,11 +561,13 @@ msgid ""
"South Seas pidgin for human meat, used to translate a Drakish word with the "
"same meaning."
msgstr ""
"Výraz z lámaného jazyka južných morí pre ľudské mäso používaný na preklad "
"jašterieho slova s rovnakým významom."
#. [topic]: id=ceramic
#: data/core/encyclopedia/drakes.cfg:175
msgid "Ceramics"
msgstr ""
msgstr "Keramika"
#. [topic]: id=ceramic
#: data/core/encyclopedia/drakes.cfg:176
@ -506,11 +576,14 @@ msgid ""
"ceramics. Only the <ref>dst='unit_Drake Burner' text='burners'</ref> can "
"generate the amount of heat to cure the pieces to full strength."
msgstr ""
"Jašteri spracovávajú kovy, ale ovládajú aj remeslo výroby keramiky. Iba "
"<ref>dst='unit_Drake Burner' text='opekači'</ref> vedia vytvoriť teplo "
"potrebné na vytvrdnutie do plnej pevnosti."
#. [topic]: id=drakish_script
#: data/core/encyclopedia/drakes.cfg:181
msgid "Drakish, script"
msgstr ""
msgstr "Jašterie písmo"
#. [topic]: id=drakish_script
#: data/core/encyclopedia/drakes.cfg:182
@ -519,23 +592,26 @@ msgid ""
"text='ceramic'</ref> tablets by members of the <ref>dst='recorder' "
"text='Recorder'</ref> vocation."
msgstr ""
"Písomný jazyk jašterov. Uchováva sa na <ref>dst='ceramic' "
"text='keramických'</ref> tabuľkách členmi s povolaním <ref>dst='recorder' "
"text='Zapisovateľ'</ref>."
#. [topic]: id=drakish_language
#: data/core/encyclopedia/drakes.cfg:187
msgid "Drakish, language"
msgstr ""
msgstr "Jašterí jazyk"
#. [topic]: id=drakish_language
#: data/core/encyclopedia/drakes.cfg:188
msgid "The language spoken by the drakes."
msgstr ""
msgstr "Jazyk, ktorým hovoria jašteri."
#. [section]: id=geography
#. [topic]: id=..geography
#: data/core/encyclopedia/geography.cfg:11
#: data/core/encyclopedia/geography.cfg:18
msgid "Geography"
msgstr ""
msgstr "Zemepis"
#. [topic]: id=arkan_thoria
#: data/core/encyclopedia/geography.cfg:25
@ -597,11 +673,12 @@ msgstr "Zelený ostrov"
msgid ""
"A bigger island lying in the <ref>dst='great_ocean' text='Great Ocean'</ref>."
msgstr ""
"Väčší ostrov ležiaci vo <ref>dst='great_ocean' text='Veľkom oceáne'</ref>."
#. [topic]: id=old_continent
#: data/core/encyclopedia/geography.cfg:51
msgid "Old Continent"
msgstr ""
msgstr "Starý kontinent"
#. [topic]: id=old_continent
#: data/core/encyclopedia/geography.cfg:52
@ -609,11 +686,13 @@ msgid ""
"Lies to the west of <ref>dst='morogor' text='Morogor'</ref> across the "
"<ref>dst='great_ocean' text='Great Ocean'</ref>."
msgstr ""
"Leží na západ od <ref>dst='morogor' text='Morogoru'</ref> cez "
"<ref>dst='great_ocean' text='Veľký oceán'</ref>."
#. [topic]: id=great_continent
#: data/core/encyclopedia/geography.cfg:57
msgid "Great Continent"
msgstr ""
msgstr "Veľký kontinent"
#. [topic]: id=great_continent
#: data/core/encyclopedia/geography.cfg:58
@ -622,11 +701,14 @@ msgid ""
"Wesnoth'</ref> lies. Its west coast is surrounded by the "
"<ref>dst='great_ocean' text='Great Ocean'</ref>."
msgstr ""
"Kontinent, na ktorom leží <ref>dst='kingdom_wesnoth' text='Kráľovstvo "
"Wesnoth'</ref>. Jeho západné pobrežie obmýva <ref>dst='great_ocean' "
"text='Veľký oceán'</ref>."
#. [topic]: id=irdya
#: data/core/encyclopedia/geography.cfg:63
msgid "Irdya"
msgstr ""
msgstr "Irdya"
#. [topic]: id=irdya
#: data/core/encyclopedia/geography.cfg:64
@ -636,6 +718,10 @@ msgid ""
"rarely used in the era depicted by the main map. People normally just say "
"“the world” or, poetically, “the wide green world”."
msgstr ""
"Názov sveta, v ktorom je umiestnené kráľovstvo <ref>dst='kingdom_wesnoth' "
"text='Wesnoth'</ref> je Irdya. Tento názov sa však v ére zobrazenej na "
"hlavnej mape používa zriedka. Ľudia zvyčajne hovoria len “svet” alebo "
"poeticky “šíry zelený svet”."
#. [topic]: id=kingdom_wesnoth
#: data/core/encyclopedia/geography.cfg:69
@ -4880,6 +4966,13 @@ msgid ""
"ocean. They are typically wary of dry land, as they are awkward and clumsy "
"there and they struggle greatly to move over rough or forested terrain."
msgstr ""
"Morskí ľudia sú záhadnou rasou so spojením rybích a ľudských vlastností. "
"Majú silné chvosty, ktoré im umožňujú rýchly pohyb vo vodnom prostredí a ich "
"šikovné ruky a rozumné mysle umožňujú remeslá a tvorbu nástrojov. Morskí "
"ľudia môžu dýchať ľahko vzduch aj vodu. Môžu prežiť aj na súši, ale vo vode "
"sú rýchlejší a obratnejší, preto ich málokedy vidieť ďaleko od oceánu. "
"Suchej zemi sa vyhýbajú, pretože sú na nej neobratní a namáhavo sa pohybujú "
"po drsnom alebo zalesnenom povrchu."
#. [race]: id=monster
#: data/core/units.cfg:248
@ -4939,6 +5032,18 @@ msgid ""
"themselves at odds with merfolk when their territories overlap, but overall "
"nagas tend to favor swamps and rivers as much as open water."
msgstr ""
"Hadovité tvory, hadí ľudia, sú jednou z najmenej pochopených rás na Veľkom "
"kontinente. Je to čiastočne ich xenofóbnou povahou a čiastočne ich cudzím "
"prostredím. Hadí ľudia sú jedna z mála rás schopných rýchlo sa pohybovať vo "
"vode, čo im otvára priestory nedostupné suchozemcom a zároveň ich to od "
"týchto rás viac vzďaľuje. Nie sú to však morské tvory v pravom zmysle slova, "
"pretože nevedia dýchať pod vodou a preto sa boja hlbiny. Tak sa zdržujú skôr "
"v pobrežných oblastiach, čo im poskytuje únikovú cestu pred obyvateľmi hlbín "
"a zároveň pred tými, čo putujú pešo, na krídlach alebo kopytách. Sú to malé "
"a telesne trochu krehké tvory, ale zvyčajne o dosť vrtkejšie ako súperi. "
"Niekedy sa dostanú do sporu s morskými ľudmi, keď sa ich teritóriá "
"prekrývajú, ale hadí ľudia môžu rovnako ako v otvorenej vode žiť aj v "
"bažinách a riekach."
#. [race]: id=ogre
#: data/core/units.cfg:269
@ -4973,6 +5078,18 @@ msgid ""
"is a sign of cooperation, domestication, or simply mutual opportunism is not "
"known."
msgstr ""
"Ohyzdi sú divoká a necivilizovaná rasa, ktorá obýva divočinu na Veľkom "
"kontinente. Fyzicky pripomínajú ľudí, ale sú väčší a silnejší. Aj ich "
"nedospelí jedinci sú vyrovnaným súperom pre väčšinu ľudí. Ohyzdom v "
"obývaných oblastiach neveria a buď sa im vyhýbajú alebo ich rovno vyženú. "
"Preto sa schovávajú v hornatých oblastiach na okraji civilizácie, kde hladní "
"banditi spomedzi ohyzdov ohrozujú pocestných a karavány. Aj keď ohyzdi nie "
"sú veľmi múdri alebo rýchli, ich odolnosť a fyzická sila ich robí vhodným "
"vkladom do armád iných rás. Sú zvlášť hodnotní pre bezcitných veliteľov, "
"ktorým ohyzdia brutalita neprekáža. O ich biológii a spoločnosti sa vie "
"málo, ak vôbec nejakú majú, pretože zvyknú útočiť po boku vlkov a iných "
"tvorov. Nie je známe, či je to znakom spolupráce, skrotenia či vzájomného "
"prispôsobenia."
#. [race]: id=orc
#: data/core/units.cfg:280

View file

@ -2,16 +2,16 @@ msgid ""
msgstr ""
"Project-Id-Version: wescamp-i 18n\n"
"Report-Msgid-Bugs-To: http://bugs.wesnoth.org/\n"
"POT-Creation-Date: 2014-03-02 10:23+0100\n"
"PO-Revision-Date: 2012-12-06 21:08+0100\n"
"POT-Creation-Date: 2014-03-02 18:56+0100\n"
"PO-Revision-Date: 2014-03-26 21:59+0100\n"
"Last-Translator: Filip Hiadlovský <f.hiadlovsky@gmail.com>\n"
"Language-Team: none\n"
"Language: \n"
"Language: sk_SK\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=3; plural=(n==1) ? 0 : (n>=2 && n<=4) ? 1 : 2;\n"
"X-Generator: Poedit 1.5.4\n"
"X-Generator: Poedit 1.6.4\n"
#. [campaign]: id=LOW, type=hybrid
#: data/campaigns/Legend_of_Wesmere/_main.cfg:61
@ -261,14 +261,8 @@ msgstr "Strata domova"
#. [scenario]: id=01_The_Uprooting
#: data/campaigns/Legend_of_Wesmere/scenarios/chapter1/01_The_Uprooting.cfg:9
#, fuzzy
#| msgid ""
#| "Chapter One,\n"
#| "<i>Flight and fight</i>"
msgid "Chapter One: Flight and Fight"
msgstr ""
"Prvá kapitola\n"
"<i>Let a boj</i>"
msgstr "Prvá kapitola: Let a boj"
#. [part]
#: data/campaigns/Legend_of_Wesmere/scenarios/chapter1/01_The_Uprooting.cfg:30
@ -281,10 +275,6 @@ msgstr ""
#. [part]
#: data/campaigns/Legend_of_Wesmere/scenarios/chapter1/01_The_Uprooting.cfg:34
#, fuzzy
#| msgid ""
#| "Chapter One,\n"
#| "<i>Flight and fight</i>"
msgid ""
"Chapter One,\n"
"<i>Flight and Fight</i>"
@ -696,16 +686,12 @@ msgstr "Budete ich mať, zoženiem ich, len čo ich nájdem a vrátim sa."
#. [message]: id=Landar
#: data/campaigns/Legend_of_Wesmere/scenarios/chapter1/01_The_Uprooting.cfg:503
#, fuzzy
#| msgid ""
#| "Velon has fallen. He counseled weakness, but did not deserved such an "
#| "ugly death. We shall return with swords to avenge him!"
msgid ""
"Velon has fallen. He counseled weakness, but did not deserve such an ugly "
"death. We shall return with swords to avenge him!"
msgstr ""
"Velon padol. Aj keď radil miernosť, takúto hroznú smrť si nezaslúžil. "
"Vrátime sa s mečom, aby sme ho pomstili!"
"Vrátime sa s mečmi, aby sme ho pomstili!"
#. [message]: race=orc
#: data/campaigns/Legend_of_Wesmere/scenarios/chapter1/01_The_Uprooting.cfg:521
@ -1206,14 +1192,8 @@ msgstr "Poklad elfov"
#. [scenario]: id=04_The_Elvish_Treasury
#: data/campaigns/Legend_of_Wesmere/scenarios/chapter2/04_The_Elvish_Treasury.cfg:9
#, fuzzy
#| msgid ""
#| "Chapter Two,\n"
#| "<i>The Treasury</i>"
msgid "Chapter Two: The Treasury"
msgstr ""
"Druhá kapitola\n"
"<i>Pokladnica</i>"
msgstr "Druhá kapitola: Pokladnica"
#. [part]
#: data/campaigns/Legend_of_Wesmere/scenarios/chapter2/04_The_Elvish_Treasury.cfg:31
@ -2417,14 +2397,8 @@ msgstr "Žoldnieri"
#. [scenario]: id=09_Bounty_Hunters
#: data/campaigns/Legend_of_Wesmere/scenarios/chapter3/09_Bounty_Hunters.cfg:9
#, fuzzy
#| msgid ""
#| "Chapter Three,\n"
#| "<i>The Book of Crelanu</i>"
msgid "Chapter Three: The Book of Crelanu"
msgstr ""
"Tretia kapitola\n"
"<i>Kniha Krelanu</i>"
msgstr "Tretia kapitola: Kniha Krelanu"
#. [part]
#: data/campaigns/Legend_of_Wesmere/scenarios/chapter3/09_Bounty_Hunters.cfg:30
@ -3423,14 +3397,8 @@ msgstr "Správy z frontu"
#. [scenario]: id=13_News_from_the_Front
#: data/campaigns/Legend_of_Wesmere/scenarios/chapter4/13_News_from_the_Front.cfg:13
#, fuzzy
#| msgid ""
#| "Chapter Four,\n"
#| "<i>The Alliance</i>"
msgid "Chapter Four: The Alliance"
msgstr ""
"Štvrtá kapitola\n"
"<i>Aliancia</i>"
msgstr "Štvrtá kapitola: Aliancia"
#. [part]
#: data/campaigns/Legend_of_Wesmere/scenarios/chapter4/13_News_from_the_Front.cfg:32
@ -3476,10 +3444,6 @@ msgstr "Eoníhar"
#. [message]: id=Eonihar
#: data/campaigns/Legend_of_Wesmere/scenarios/chapter4/13_News_from_the_Front.cfg:158
#, fuzzy
#| msgid ""
#| "At last I have found, you alive and well! We need you back at once! The "
#| "orcs have attacked the humans."
msgid ""
"At last I have found you, alive and well! We need you back at once! The orcs "
"have attacked the humans."
@ -4178,13 +4142,6 @@ msgstr "neviditeľný"
#. [hides]: id=invisible
#: data/campaigns/Legend_of_Wesmere/scenarios/chapter4/16_The_Chief_Must_Die_utils.cfg:17
#: data/campaigns/Legend_of_Wesmere/scenarios/chapter4/16_The_Chief_Must_Die_utils.cfg:18
#, fuzzy
#| msgid ""
#| "invisible:\n"
#| "Enemy units cannot see this unit, except for wolf-based units who can "
#| "smell it if close enough. Hence except for wolf-based units, enemy units "
#| "will not initiate an attack on this unit. Defense is at 80 percent for "
#| "every terrain except water, where it is 70 percent."
msgid ""
"Enemy units cannot see this unit, except for wolf-based units who can smell "
"it if close enough. Hence except for wolf-based units, enemy units will not "
@ -4195,7 +4152,7 @@ msgstr ""
"Nepriateľské jednotky nedokážu túto jednotku zaregistrovať, s výnimkou "
"vlčích jazdcov, ktorých zvery ju môžu zacítiť. Takže s výnimkou vlčích "
"jazdcov, nepriateľské jednotky túto jednotku nenapadnú ako prvé. "
"Obranyschopnosť tejto jednotky je 90 percent na každom type terénu okrem "
"Obranyschopnosť tejto jednotky je 80 percent na každom type terénu okrem "
"vody, kde je obrana na úrovni 70 percent."
#. [unit]: type=Goblin Pillager, id=Odrun
@ -4574,14 +4531,8 @@ msgstr "Drahá odplata"
#. [scenario]: id=19_Costly_Revenge
#: data/campaigns/Legend_of_Wesmere/scenarios/chapter5/19_Costly_Revenge.cfg:11
#, fuzzy
#| msgid ""
#| "Chapter Five,\n"
#| "<i>Civil War</i>"
msgid "Chapter Five: Civil War"
msgstr ""
"Piata kapitola\n"
"<i>Občianska vojna</i>"
msgstr "Piata kapitola: Občianska vojna"
#. [part]
#: data/campaigns/Legend_of_Wesmere/scenarios/chapter5/19_Costly_Revenge.cfg:35
@ -5352,12 +5303,12 @@ msgstr ""
"činoch, o tých činoch, keď stál voči zlu sám, vyhľadajte príbeh o Veľkom "
"Delfadorovi a páde podlej kráľovnej Aševiéry.\n"
"\n"
"(preklad Martin \"Arðarïeŀ\" Džbor, Dec 2009 a Filip Hiadlovský, 2012)"
"(preklad Martin \"Arðarïeŀ\" Džbor, Dec 2009 a Filip Hiadlovský, Mar 2014)"
#. [unit_type]: id=Elvish Horse Archer
#: data/campaigns/Legend_of_Wesmere/units/Horse_Archer.cfg:13
msgid "This is a stub!"
msgstr ""
msgstr "Toto je len zástupca!"
#. [unit_type]: id=Elvish Horse Archer
#: data/campaigns/Legend_of_Wesmere/units/Horse_Archer.cfg:18
@ -5366,14 +5317,13 @@ msgstr "Elfský jazdec - strelec"
#. [attack]: type=blade
#: data/campaigns/Legend_of_Wesmere/units/Horse_Archer.cfg:22
#, fuzzy
msgid "sword"
msgstr "Šľachtic"
msgstr "meč"
#. [attack]: type=pierce
#: data/campaigns/Legend_of_Wesmere/units/Horse_Archer.cfg:31
msgid "bow"
msgstr ""
msgstr "luk"
#. [leadership]: id=elates_kalenz
#: data/campaigns/Legend_of_Wesmere/utils/abilities.cfg:10
@ -5387,18 +5337,11 @@ msgstr "Povznáša Kalenza"
#. [leadership]: id=elates_kalenz
#: data/campaigns/Legend_of_Wesmere/utils/abilities.cfg:13
#, fuzzy
#| msgid ""
#| "elates Kalenz:\n"
#| "Through the special bond between Kalenz and Cleodil, she elates him to "
#| "fight better.\n"
#| "Adjacent to Cleodil, Kalenz will do 25% more damage in battle."
msgid ""
"Through the special bond between Kalenz and Cleodil, she elates him to fight "
"better.\n"
"Adjacent to Cleodil, Kalenz will do 25% more damage in battle."
msgstr ""
"povznáša Kalenza:\n"
"Prostredníctvom špeciálneho puta medzi Kalenzom a Kleodil z neho Kleodil "
"spravila lepšieho bojovníka.\n"
"Pri Kleodil bude Kalenz spôsobovať v boji o 25% väčšie škody."
@ -5415,18 +5358,11 @@ msgstr "lieči Kalenza +4"
#. [heals]: id=heals_kalenz
#: data/campaigns/Legend_of_Wesmere/utils/abilities.cfg:36
#, fuzzy
#| msgid ""
#| "heals +4:\n"
#| "If a shyde has developed a special bond to a person her healing abilities "
#| "increase for him. This allows Cleodil to give Kalenz extra points of "
#| "healing at the beginning of your turn."
msgid ""
"If a shyde has developed a special bond to a person her healing abilities "
"increase for him. This allows Cleodil to give Kalenz extra points of healing "
"at the beginning of your turn."
msgstr ""
"lieči +4:\n"
"Keď si víla vytvorí zvláštnu väzbu k nejakej osobe, je jej schopnosť liečiť "
"posilnená. To dovoľuje Kleodil vyliečiť Kalenzovi na začiatku tvojho kola "
"viac životov."

View file

@ -131,13 +131,13 @@ msgid ""
"more than a days ride distant, and messengers sent to seek his help did not "
"return."
msgstr ""
"A csontvázak és a zombik leölték az állatokat és felégették a földeket. <i>"
"„Féljetek Mordaktól, a mágustól, és engedelmeskedjetek neki!”</i> kiáltották "
"vészjósló hangon, miközben pusztítottak, amit értek. Az emberek eltűntek az "
"elszigetelt tanyákról. A nők és a férfiak félni kezdtek az éjszakától, a "
"gyerekek még nappal is rettegtek. Ám a legközelebbi helyőrség parancsnoka "
"több mint egy napi lovaglásra volt, a segítséget kérő küldöncök pedig nem "
"tértek vissza."
"A csontvázak és a zombik leölték az állatokat és felégették a földeket. "
"<i>„Féljetek Mordaktól, a mágustól, és engedelmeskedjetek neki!”</i> "
"kiáltották vészjósló hangon, miközben pusztítottak, amit értek. Az emberek "
"eltűntek az elszigetelt tanyákról. A nők és a férfiak félni kezdtek az "
"éjszakától, a gyerekek még nappal is rettegtek. Ám a legközelebbi helyőrség "
"parancsnoka több mint egy napi lovaglásra volt, a segítséget kérő küldöncök "
"pedig nem tértek vissza."
#. [part]
#: data/campaigns/Two_Brothers/scenarios/01_Rooting_Out_a_Mage.cfg:58

View file

@ -1,21 +1,22 @@
# translation of hu-tutorial.po to Hungarian
#
# Kádár-Németh Krisztián <krisztian.kad@gmail.com>, 2007-2009, 2011, 2012.
# Barthalos Márton <barthalosmarton@yahoo.com>, 2008, 2009.
# Kádár-Németh Krisztián <krisztian.kad@gmail.com>, 2007-2009, 2011, 2012, 2014.
# Barthalos Márton <barthalosmarton@yahoo.com>, 2008, 2009, 2014.
# Farkas János <mail.janos.farkas@gmail.com>, 2014.
msgid ""
msgstr ""
"Project-Id-Version: hu-tutorial\n"
"Report-Msgid-Bugs-To: http://bugs.wesnoth.org/\n"
"POT-Creation-Date: 2013-11-16 09:29+0100\n"
"PO-Revision-Date: 2012-03-30 10:17+0200\n"
"Last-Translator: Kádár-Németh Krisztián <krisztian.kad@gmail.com>\n"
"Language-Team: Hungarian <wesnoth-hungtrans@gna.org>\n"
"POT-Creation-Date: 2014-03-02 18:57+0100\n"
"PO-Revision-Date: 2014-03-29 09:21+0100\n"
"Last-Translator: Farkas János <mail.janos.farkas@gmail.com>\n"
"Language-Team: Hungarian <kde-l10n-hu@kde.org>\n"
"Language: hu\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
"X-Generator: Lokalize 1.4\n"
"X-Generator: Lokalize 1.5\n"
#: data/campaigns/tutorial/scenarios/1_Tutorial.cfg:39
msgid ""
@ -805,17 +806,21 @@ msgstr ""
"Ezek a bábuk csak akkor támadnak, ha legfeljebb egy mezőnyi távolságra vagy "
"tőlük. Megfelelő körültekintéssel egyesével bánhatsz el velük."
# A wesnoth fájlban "Küldetés vége" szerepel, egységes használat miatt ezt emelem át
#. [set_menu_item]: id=skip_item
#: data/campaigns/tutorial/scenarios/1_Tutorial.cfg:1134
msgid "End Scenario"
msgstr ""
msgstr "Küldetés vége"
# Előreugró max előugró lehet, de itt a jobb gombbal aktiválható menüre gondolnak.
#. [message]: speaker=narrator
#: data/campaigns/tutorial/scenarios/1_Tutorial.cfg:1147
msgid ""
"Do you want to keep practicing? You can end this scenario at any time by "
"using the <b>End Scenario</b> item in the context menu."
msgstr ""
"Szeretnél még gyakorolni? A jobb gombos menüben a <b>Küldetés vége</b> "
"elemre kattintva bármikor befejezheted a pályát."
#. [option]: speaker=narrator
#: data/campaigns/tutorial/scenarios/1_Tutorial.cfg:1149
@ -1417,28 +1422,21 @@ msgstr ""
msgid "Attack the orc with an Archer"
msgstr "Támadd meg az orkot egy íjásszal"
# /n maradásának oka volt?
#. [event]
#: data/campaigns/tutorial/scenarios/2_Tutorial.cfg:979
#, fuzzy
#| msgid ""
#| "\n"
#| "To review the capabilities of any unit—including an enemy—hover the mouse "
#| "over it, and you will see a unit summary on the right of the screen"
msgid ""
"To review the capabilities of any unit—including an enemy—hover the mouse "
"over it, and you will see a unit summary on the right of the screen"
msgstr ""
"\n"
"Ha át akarod tekinteni egy egység képességeit beleértve az ellenséges "
"katonákat is , vidd az egeret fölé: egy egység összefoglaló fog megjelenni "
"a képernyő jobb oldalán."
#. [event]
#: data/campaigns/tutorial/scenarios/2_Tutorial.cfg:979
#, fuzzy
#| msgid "<big>Unit Summaries</big>"
msgid "Unit Summaries"
msgstr "<big>Egység összefoglalók</big>"
msgstr "Egység összefoglalók"
#. [event]
#: data/campaigns/tutorial/scenarios/2_Tutorial.cfg:987
@ -1480,27 +1478,18 @@ msgstr ""
#. [event]
#: data/campaigns/tutorial/scenarios/2_Tutorial.cfg:1016
#, fuzzy
#| msgid "<big>Long-distance Movement</big>"
msgid "Long-distance Movement"
msgstr "<big>Hosszú távú mozgás</big>"
msgstr "Hosszú távú mozgás"
#. [event]
#: data/campaigns/tutorial/scenarios/2_Tutorial.cfg:1016
#, fuzzy
#| msgid ""
#| "\n"
#| "You can order a unit to move for multiple turns by selecting the unit and "
#| "clicking on the destination. A number will indicate how many turns it "
#| "will take to get there."
msgid ""
"You can order a unit to move for multiple turns by selecting the unit and "
"clicking on the destination. A number will indicate how many turns it will "
"take to get there."
msgstr ""
"\n"
"Egy egység képes több körön keresztül is megállás nélkül menni célja felé: "
"válaszd ki az egységet, azután kattints a célra. A megjelenő szám azt "
"Egy egység képes több körön keresztül is megállás nélkül haladni a célja "
"felé: válaszd ki az egységet, azután kattints a célra. A megjelenő szám azt "
"mutatja, hogy hány körig tart oda az út."
#. [event]
@ -1694,28 +1683,18 @@ msgstr ""
#. [event]
#: data/campaigns/tutorial/scenarios/2_Tutorial.cfg:1238
#, fuzzy
#| msgid ""
#| "\n"
#| "After this dialog, hold the mouse over the landscape image below the "
#| "minimap on the right. This brings up a description of the time of day, "
#| "showing who has the advantage."
msgid ""
"After this dialog, hold the mouse over the landscape image below the minimap "
"on the right. This brings up a description of the time of day, showing who "
"has the advantage."
msgstr ""
"\n"
"Ezután a párbeszédablak után vidd az egered jobbra, a kis térkép alatti, "
"tájat ábrázoló képre, hogy megtekinthesd az adott napszak leírását, és hogy "
"mikor kinek van előnye."
"Ezután a párbeszédablak után vidd az egeret a tájat ábrázoló kis képre jobb "
"oldalt. Ott látható a napszak leírása, hogy mikor kinek van előnye."
#. [event]
#: data/campaigns/tutorial/scenarios/2_Tutorial.cfg:1238
#, fuzzy
#| msgid "<big>Time of Day</big>"
msgid "Time of Day"
msgstr "<big>Napszak</big>"
msgstr "Napszak"
#. [event]
#: data/campaigns/tutorial/scenarios/2_Tutorial.cfg:1245
@ -1744,21 +1723,11 @@ msgstr ""
#. [event]
#: data/campaigns/tutorial/scenarios/2_Tutorial.cfg:1259
#, fuzzy
#| msgid "<big>Tracking Unused Units</big>"
msgid "Tracking Unused Units"
msgstr "<big>Tétlen egységek követése</big>"
msgstr "Tétlen egységek követése"
#. [event]
#: data/campaigns/tutorial/scenarios/2_Tutorial.cfg:1259
#, fuzzy
#| msgid ""
#| "\n"
#| "You can ensure you use all your troops by pressing <b>n</b> to step from "
#| "one unit to the next. If you press <b>space</b>, you can mark the "
#| "currently selected unit as having finished its turn, which stops you "
#| "moving it by accident later on. When <b>n</b> no longer selects a new "
#| "unit, its safe to end your turn."
msgid ""
"You can ensure you use all your troops by pressing <b>n</b> to step from one "
"unit to the next. If you press <b>space</b>, you can mark the currently "
@ -1766,57 +1735,39 @@ msgid ""
"accident later on. When <b>n</b> no longer selects a new unit, its safe to "
"end your turn."
msgstr ""
"\n"
"Meg tudod nézni, hogy minden egységgel léptél-e már a körben: nyomd meg az "
"<b>n</b> gombot a következő egységre ugráshoz, a <b>szóközt</b> pedig, hogy "
"jelezd, ha ezzel a katonával már nem is szándékozol lépni (így megelőzheted, "
"hogy később véletlenül mégis lépj vele). Amikor az </b>n</b> gombot lenyomva "
"nem választ ki újabb egységet, befejezheted a köröd."
"<b>n</b> billentyűt a következő egységre ugráshoz, a <b>szóközt</b> pedig, "
"hogy jelezd, ha ezzel a katonával már nem is szándékozol lépni (így "
"megelőzheted, hogy később véletlenül mégis lépj vele). Amikor az </b>n</b> "
"billentyű nem választ ki újabb egységet, befejezheted a köröd."
#. [event]
#: data/campaigns/tutorial/scenarios/2_Tutorial.cfg:1264
#, fuzzy
#| msgid ""
#| "\n"
#| "In this scenario, you only need to defeat the orc leader to win. (Victory "
#| "conditions for a scenario are given under <b>Scenario Objectives</b> in "
#| "the <b>Main Menu</b>)."
msgid ""
"In this scenario, you only need to defeat the orc leader to win. (Victory "
"conditions for a scenario are given under <b>Scenario Objectives</b> in the "
"<b>Main Menu</b>)."
msgstr ""
"\n"
"Ezen a pályán csak az ork vezért kell megsemmisítened a győzelemhez. Egy "
"adott pálya célkitűzései a <b>Pálya céljai</b> opciónál tekinthetők meg a "
"<b>Menü</b> gombra kattintva."
#. [event]
#: data/campaigns/tutorial/scenarios/2_Tutorial.cfg:1264
#, fuzzy
#| msgid "<big>Victory Conditions</big>"
msgid "Victory Conditions"
msgstr "<big>Győzelmi feltételek</big>"
msgstr "Győzelmi feltételek"
#. [event]
#: data/campaigns/tutorial/scenarios/2_Tutorial.cfg:1269
#, fuzzy
#| msgid "<big>Recruit the Right Unit Types</big>"
msgid "Recruit the Right Unit Types"
msgstr "<big>Megfelelő egységek toborzása</big>"
msgstr "Megfelelő egységek toborzása"
#. [event]
#: data/campaigns/tutorial/scenarios/2_Tutorial.cfg:1269
#, fuzzy
#| msgid ""
#| "\n"
#| "Remember to recruit troops useful for the situation. Archers are "
#| "particularly effective against Grunts, Wolf Riders and the orcish leader."
msgid ""
"Remember to recruit troops useful for the situation. Archers are "
"particularly effective against Grunts, Wolf Riders and the orcish leader."
msgstr ""
"\n"
"Ne felejts el az adott helyzetben hasznos egységeket toborozni: az íjászok "
"kiváltképp hatásosak az ork közkatonákkal, a farkaslovasokkal és a "
"vezérükkel szemben."
@ -1916,29 +1867,20 @@ msgstr ""
#. [then]
#: data/campaigns/tutorial/scenarios/2_Tutorial.cfg:1464
#, fuzzy
#| msgid "<big>Tracking Enemy Movement</big>"
msgid "Tracking Enemy Movement"
msgstr "<big>Ellenséges mozgások követése</big>"
msgstr "Ellenséges mozgások követése"
#. [then]
#: data/campaigns/tutorial/scenarios/2_Tutorial.cfg:1464
#, fuzzy
#| msgid ""
#| "\n"
#| "You can see where an enemy can reach by moving the mouse over them. You "
#| "can see all possible enemy moves at once with the <b>Show Enemy Moves</b> "
#| "command from the <b>Actions</b> menu."
msgid ""
"You can see where an enemy can reach by moving the mouse over them. You can "
"see all possible enemy moves at once with the <b>Show Enemy Moves</b> "
"command from the <b>Actions</b> menu."
msgstr ""
"\n"
"Láthatod, hogy meddig juthat az adott ellenséges egység, ha fölé viszed az "
"egérmutatót. Megnézheted, hogy az ellenséges egységek mindenkit beleszámítva "
"mely területeket tudják elérni, ha a </b>Parancsok</b> menü </b>Ellenséges "
"lépések mutatása</b> opcióját választod."
"egeret. Megnézheted, hogy az ellenséges egységek mely területeket tudják "
"elérni, ha a </b>Parancsok</b> menü </b>Ellenséges lépések mutatása</b> "
"opcióját választod."
#. [else]
#: data/campaigns/tutorial/scenarios/2_Tutorial.cfg:1468

File diff suppressed because it is too large Load diff

View file

@ -24,6 +24,8 @@
<string>????</string>
<key>CFBundleVersion</key>
<string>1.11.11</string>
<key>NSHighResolutionCapable</key>
<false/>
<key>NSMainNibFile</key>
<string>SDLMain</string>
<key>NSPrincipalClass</key>

View file

@ -883,6 +883,8 @@
EC95E50918612BB600F3A9EF /* editor_edit_side.cpp in Sources */ = {isa = PBXBuildFile; fileRef = EC95E50618612BB600F3A9EF /* editor_edit_side.cpp */; };
ECA9E67B17F478B600F5DDC4 /* desktop_util.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ECA9E67917F478B600F5DDC4 /* desktop_util.cpp */; };
ECA9E67E17F478D600F5DDC4 /* game_paths.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ECA9E67C17F478D600F5DDC4 /* game_paths.cpp */; };
ECAA3FE718E0E4EF002E8998 /* unicode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ECAA3FE518E0E4EF002E8998 /* unicode.cpp */; };
ECAA3FE818E0E4EF002E8998 /* unicode.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ECAA3FE518E0E4EF002E8998 /* unicode.cpp */; };
ECC8F41B185FE2E1004AC3BE /* format_time_summary.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ECC8F419185FE2E1004AC3BE /* format_time_summary.cpp */; };
ECF3A0B318AD3E8800DD643A /* wml_error.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ECF3A0B118AD3E8700DD643A /* wml_error.cpp */; };
ECFA82E3184E59F3006782FB /* command_executor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = ECFA82DA184E59F3006782FB /* command_executor.cpp */; };
@ -2020,6 +2022,8 @@
ECA9E67A17F478B600F5DDC4 /* desktop_util.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = desktop_util.hpp; sourceTree = "<group>"; };
ECA9E67C17F478D600F5DDC4 /* game_paths.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = game_paths.cpp; sourceTree = "<group>"; };
ECA9E67D17F478D600F5DDC4 /* game_paths.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = game_paths.hpp; sourceTree = "<group>"; };
ECAA3FE518E0E4EF002E8998 /* unicode.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = unicode.cpp; sourceTree = "<group>"; };
ECAA3FE618E0E4EF002E8998 /* unicode.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = unicode.hpp; sourceTree = "<group>"; };
ECC8F419185FE2E1004AC3BE /* format_time_summary.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = format_time_summary.cpp; sourceTree = "<group>"; };
ECC8F41A185FE2E1004AC3BE /* format_time_summary.hpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.h; path = format_time_summary.hpp; sourceTree = "<group>"; };
ECF3A0B118AD3E8700DD643A /* wml_error.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; name = wml_error.cpp; path = gui/dialogs/wml_error.cpp; sourceTree = "<group>"; };
@ -3142,6 +3146,8 @@
B55999A60EC62181008DD061 /* serialization */ = {
isa = PBXGroup;
children = (
ECAA3FE518E0E4EF002E8998 /* unicode.cpp */,
ECAA3FE618E0E4EF002E8998 /* unicode.hpp */,
F480CD2214034F18007175D6 /* schema_validator.cpp */,
F480CD2A14034FB8007175D6 /* schema_validator.hpp */,
F449349913FF652800DF01D5 /* validator.cpp */,
@ -4164,6 +4170,7 @@
B595EFE2100436C900C10B66 /* game_load.cpp in Sources */,
B5951A8F1013BB0800C10B66 /* resources.cpp in Sources */,
B5951A951013BB3400C10B66 /* game_delete.cpp in Sources */,
ECAA3FE718E0E4EF002E8998 /* unicode.cpp in Sources */,
B5951A9B1013BB5A00C10B66 /* callable_objects.cpp in Sources */,
B5951A9C1013BB5A00C10B66 /* function_table.cpp in Sources */,
B59F96D5103478C900A57C1A /* aspect.cpp in Sources */,
@ -4786,6 +4793,7 @@
B5BB6C900F89448100444FBF /* preprocessor.cpp in Sources */,
B5BB6C910F89448200444FBF /* string_utils.cpp in Sources */,
B5BB6C920F89448300444FBF /* tokenizer.cpp in Sources */,
ECAA3FE818E0E4EF002E8998 /* unicode.cpp in Sources */,
B5BB6C960F8944FB00444FBF /* loadscreen_empty.cpp in Sources */,
B5BB6CD90F89470B00444FBF /* server_main.m in Sources */,
B54AC6800FEA9C4A006F6FBD /* player_network.cpp in Sources */,
@ -4871,7 +4879,6 @@
ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
COPY_PHASE_STRIP = NO;
ENABLE_OPENMP_SUPPORT = NO;
GCC_DYNAMIC_NO_PIC = NO;
GCC_ENABLE_FIX_AND_CONTINUE = NO;
GCC_MODEL_TUNING = G5;
@ -4924,7 +4931,6 @@
ARCHS = "$(ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1)";
ARCHS_STANDARD_32_BIT_PRE_XCODE_3_1 = "ppc i386";
COPY_PHASE_STRIP = NO;
ENABLE_OPENMP_SUPPORT = NO;
FRAMEWORK_SEARCH_PATHS = (
"$(inherited)",
"\"$(SRCROOT)\"",
@ -4989,13 +4995,16 @@
C01FCF4F08A954540054247B /* Debug */ = {
isa = XCBuildConfiguration;
buildSettings = {
ENABLE_OPENMP_SUPPORT = NO;
FRAMEWORK_SEARCH_PATHS = ./lib;
GCC_DYNAMIC_NO_PIC = YES;
GCC_INLINES_ARE_PRIVATE_EXTERN = NO;
GCC_INPUT_FILETYPE = automatic;
GCC_OPTIMIZATION_LEVEL = 0;
GCC_PREPROCESSOR_DEFINITIONS = "LOCALEDIR=\\\"translations\\\"";
GCC_PREPROCESSOR_DEFINITIONS = (
"LOCALEDIR=\\\"translations\\\"",
"LUA_USE_MACOSX=1",
);
GCC_WARN_ABOUT_MISSING_FIELD_INITIALIZERS = YES;
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
GCC_WARN_ABOUT_RETURN_TYPE = YES;
@ -5042,7 +5051,10 @@
FRAMEWORK_SEARCH_PATHS = ./lib;
GCC_DYNAMIC_NO_PIC = YES;
GCC_MODEL_TUNING = G5;
GCC_PREPROCESSOR_DEFINITIONS = "LOCALEDIR=\\\"translations\\\"";
GCC_PREPROCESSOR_DEFINITIONS = (
"LOCALEDIR=\\\"translations\\\"",
"LUA_USE_MACOSX=1",
);
GCC_VERSION = 4.0;
GCC_WARN_UNUSED_VARIABLE = YES;
HEADER_SEARCH_PATHS = (

View file

@ -46,6 +46,9 @@ surface getMinimap(int w, int h, const gamemap &map, const team *vw, const std::
DBG_DP << "creating minimap " << int(map.w()*scale*0.75) << "," << map.h()*scale << "\n";
bool preferences_minimap_draw_terrain = preferences::minimap_draw_terrain();
bool preferences_minimap_terrain_coding = preferences::minimap_terrain_coding();
const size_t map_width = map.w()*scale*3/4;
const size_t map_height = map.h()*scale;
if(map_width == 0 || map_height == 0) {
@ -90,9 +93,9 @@ surface getMinimap(int w, int h, const gamemap &map, const team *vw, const std::
, 0
, 0);
if (preferences::minimap_draw_terrain()) {
if (preferences_minimap_draw_terrain) {
if (!preferences::minimap_terrain_coding()) {
if (!preferences_minimap_terrain_coding) {
surface surf(NULL);

View file

@ -117,6 +117,8 @@ public:
virtual void force_end_turn() = 0;
virtual void force_end_level(LEVEL_RESULT res) = 0;
virtual void check_end_level() = 0;
virtual void on_not_observer() = 0;
/**
* Asks the user whether to continue on an OOS error.
* @throw end_level_exception If the user wants to abort.

View file

@ -52,9 +52,8 @@ playmp_controller::playmp_controller(const config& level,
if ( replay_last_turn_ <= 1)
{
skip_replay_ = false;
blindfold_.unblind();
} else if (blindfold_replay_) {
//blindfold_ = resources::screen->video().lock_updates(true);
}
if (blindfold_replay_) {
LOG_NG << " *** Putting on the blindfold now " << std::endl;
}
}
@ -111,6 +110,19 @@ void playmp_controller::before_human_turn(bool save){
init_turn_data();
}
void playmp_controller::on_not_observer() {
remove_blindfold();
}
void playmp_controller::remove_blindfold() {
if (resources::screen->is_blindfolded()) {
blindfold_.unblind();
LOG_NG << " *** Taking off the blindfold now " << std::endl;
resources::screen->redraw_everything();
}
}
bool playmp_controller::counting_down() {
return beep_warning_time_ > 0;
}
@ -164,11 +176,7 @@ namespace {
void playmp_controller::play_human_turn(){
LOG_NG << "playmp::play_human_turn...\n";
if (resources::screen->is_blindfolded()) {
blindfold_.unblind();
LOG_NG << " *** Taking off the blindfold now " << std::endl;
resources::screen->redraw_everything();
}
remove_blindfold();
command_disabled_resetter reset_commands;
int cur_ticks = SDL_GetTicks();

View file

@ -65,6 +65,10 @@ protected:
int beep_warning_time_;
mutable bool network_processing_stopped_;
virtual void on_not_observer();
void remove_blindfold();
blindfold blindfold_;
private:
void set_end_scenario_button();

View file

@ -741,6 +741,8 @@ void playsingle_controller::before_human_turn(bool save)
void playsingle_controller::show_turn_dialog(){
if(preferences::turn_dialog() && (level_result_ == NONE) ) {
blindfold b(*resources::screen, true); //apply a blindfold for the duration of this dialog
resources::screen->redraw_everything();
std::string message = _("It is now $name|s turn");
utils::string_map symbols;
symbols["name"] = teams_[player_number_ - 1].current_player();

View file

@ -68,6 +68,7 @@ public:
void report_victory(std::ostringstream &report, int player_gold,
int remaining_gold, int finishing_bonus_per_turn,
int turns_left, int finishing_bonus);
virtual void on_not_observer() {}
protected:
virtual void play_turn(bool save);

View file

@ -184,12 +184,14 @@ turn_info::PROCESS_DATA_RESULT turn_info::process_network_data(const config& cfg
if (controller == "human" && !tm.is_human()) {
tm.make_human();
resources::controller->on_not_observer();
} else if (controller == "network" && !tm.is_network_human()) {
tm.make_network();
} else if (controller == "network_ai" && !tm.is_network_ai()) {
tm.make_network_ai();
} else if (controller == "ai" && !tm.is_ai()) {
tm.make_ai();
resources::controller->on_not_observer();
} else if (controller == "idle" && !tm.is_idle()) {
tm.make_idle();
}
@ -236,7 +238,7 @@ turn_info::PROCESS_DATA_RESULT turn_info::process_network_data(const config& cfg
const bool have_leader = leader.valid();
if (controller == "ai"){
tm.make_network_ai();
tm.make_ai();
tm.set_current_player("ai" + side_drop);
if (have_leader) leader->rename("ai" + side_drop);
return restart?PROCESS_RESTART_TURN:PROCESS_CONTINUE;
@ -296,6 +298,7 @@ turn_info::PROCESS_DATA_RESULT turn_info::process_network_data(const config& cfg
switch(action) {
case 0:
tm.make_ai();
resources::controller->on_not_observer();
tm.set_current_player("ai" + side_drop);
if (have_leader) leader->rename("ai" + side_drop);
change_controller(side_drop, "ai");
@ -305,6 +308,7 @@ turn_info::PROCESS_DATA_RESULT turn_info::process_network_data(const config& cfg
case 1:
tm.make_human();
resources::controller->on_not_observer();
tm.set_current_player("human" + side_drop);
if (have_leader) leader->rename("human" + side_drop);
change_controller(side_drop, "human");

View file

@ -50,6 +50,7 @@ public:
virtual void force_end_turn() {}
virtual void force_end_level(LEVEL_RESULT) {}
virtual void check_end_level() {}
virtual void on_not_observer() {}
std::vector<team> teams_start_;

View file

@ -770,6 +770,8 @@ static int attack_info(const attack_type &at, config &res, const unit &u, const
const team &viewing_team = (*resources::teams)[resources::screen->viewing_team()];
BOOST_FOREACH(const unit &enemy, *resources::units)
{
if (enemy.incapacitated()) //we can't attack statues so don't display them in this tooltip
continue;
if (!unit_team.is_enemy(enemy.side()))
continue;
const map_location &loc = enemy.get_location();

View file

@ -16,6 +16,7 @@
#if SDL_VERSION_ATLEAST(2, 0, 0)
#include "SDL_image.h"
#include "sdl/exception.hpp"
#include <cassert>
@ -36,6 +37,28 @@ ttexture::ttexture(SDL_Renderer& renderer,
}
}
ttexture::ttexture(SDL_Renderer& renderer,
const std::string& file)
: reference_count_(new unsigned(1))
, texture_(NULL)
{
SDL_Surface* img;
img = IMG_Load(file.c_str());
if (img == NULL) {
throw texception("Failed to create SDL_Texture object.", true);
} else {
texture_ = SDL_CreateTextureFromSurface(&renderer, img);
if (texture_ == NULL) {
SDL_FreeSurface(img);
throw texception("Failed to create SDL_Texture object.", true);
}
SDL_FreeSurface(img);
}
}
ttexture::~ttexture()
{
assert(reference_count_);

View file

@ -21,6 +21,7 @@
*/
#include <SDL_version.h>
#include <string>
#if SDL_VERSION_ATLEAST(2, 0, 0)
@ -55,6 +56,16 @@ public:
const int w,
const int h);
/**
* Constructor.
*
* Loads image data from @a file and converts it to a texture.
*
* @param renderer The renderer the texture is associated with.
* @param file Path of the file to load the pixels from.
*/
ttexture(SDL_Renderer& renderer, const std::string& file);
~ttexture();
ttexture(const ttexture& texture);