Remove all references to Wesnoth Lua Pack dbms debug function.

They were all commented out, but better to remove them altogether.
This commit is contained in:
Matthias Schoeck 2012-12-29 20:20:56 +00:00
parent b138e47184
commit 93ba347695
2 changed files with 0 additions and 17 deletions

View file

@ -305,7 +305,6 @@ function ai_helper.get_closest_location(hex, location_filter, unit)
}
end
for k,v in pairs(location_filter) do loc_filter[k] = v end
--DBG.dbms(loc_filter)
local locs = wesnoth.get_locations(loc_filter)

View file

@ -1,7 +1,6 @@
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 DBG = wesnoth.require "ai/lua/debug.lua"
local battle_calcs = {}
@ -353,7 +352,6 @@ function battle_calcs.battle_outcome_coefficients(cfg, cache)
-- Get the hit/miss counts for the battle
local hit_miss_counts = {}
battle_calcs.add_next_strike(cfg, hit_miss_counts)
--DBG.dbms(hit_miss_counts)
-- We first calculate the coefficients for the defender HP distribution
-- so this is sorted by the number of hits the attacker lands
@ -374,7 +372,6 @@ function battle_calcs.battle_outcome_coefficients(cfg, cache)
if not counts[i1][i2][i3] then counts[i1][i2][i3] = {} end
counts[i1][i2][i3][i4] = (counts[i1][i2][i3][i4] or 0) + 1
end
--DBG.dbms(counts)
local coeffs_def = {}
for am,v1 in pairs(counts) do -- attacker miss count
@ -424,7 +421,6 @@ function battle_calcs.battle_outcome_coefficients(cfg, cache)
end
end
end
--DBG.dbms(coeffs_def)
-- Now we do the same for the HP distribution of the attacker,
-- which means everything needs to be sorted by defender hits
@ -439,7 +435,6 @@ function battle_calcs.battle_outcome_coefficients(cfg, cache)
if not counts[i1][i2][i3] then counts[i1][i2][i3] = {} end
counts[i1][i2][i3][i4] = (counts[i1][i2][i3][i4] or 0) + 1
end
--DBG.dbms(counts)
local coeffs_att = {}
for dm,v1 in pairs(counts) do -- defender miss count
@ -511,7 +506,6 @@ function battle_calcs.battle_outcome_coefficients(cfg, cache)
end
end
coeffs_def[biggest_equation].skip = true
--DBG.dbms(coeffs_def)
-- If we're caching, add this to 'cache'
if cache then cache[cind] = { coeffs_att = coeffs_att, coeffs_def = coeffs_def } end
@ -725,8 +719,6 @@ function battle_calcs.battle_outcome(attacker, defender, cfg, cache)
-- Note that att_hit_prob, def_hit_prob need to be in that order for both calls
local att_stats = battle_calcs.hp_distribution(att_coeffs, att_hit_prob, def_hit_prob, attacker.hitpoints, def_damage, def_attack)
local def_stats = battle_calcs.hp_distribution(def_coeffs, att_hit_prob, def_hit_prob, defender.hitpoints, att_damage, att_attack)
--DBG.dbms(att_stats)
--DBG.dbms(def_stats)
return att_stats, def_stats
end
@ -1021,7 +1013,6 @@ function battle_calcs.attack_combo_stats(tmp_attackers, tmp_dsts, defender, cach
tmp_attacker_ratings[i] = att_rating
tmp_att_stats[i], tmp_def_stats[i] = att_stats, def_stats
--print('rating:', base_rating, def_rating, att_rating, att_rating_av)
--DBG.dbms(att_stats)
-- But for combos, also want units with highest attack outcome uncertainties to go early
-- So that we can change our mind in case of unfavorable outcome
@ -1091,9 +1082,6 @@ function battle_calcs.attack_combo_stats(tmp_attackers, tmp_dsts, defender, cach
-- Just making sure that everything worked:
--print(#attackers, #dsts, #att_stats, #def_stats)
--for i,a in ipairs(attackers) do print(i, a.id) end
--DBG.dbms(dsts)
--DBG.dbms(att_stats)
--DBG.dbms(def_stats)
-- Then we go through all the other attacks and calculate the outcomes
-- based on all the possible outcomes of the previous attacks
@ -1140,8 +1128,6 @@ function battle_calcs.attack_combo_stats(tmp_attackers, tmp_dsts, defender, cach
for hp,p in pairs(def_stats[i].hp_chance) do av_hp = av_hp + hp*p end
def_stats[i].average_hp = av_hp
end
--DBG.dbms(att_stats)
--DBG.dbms(def_stats)
--print('Defender CTK:', def_stats[#attackers].hp_chance[0])
-- Get the total rating for this attack combo:
@ -1282,7 +1268,6 @@ function battle_calcs.relative_damage_map(units, enemies, cache)
end
unit_ratings[i] = { rating = max_rating, unit_id = u.id, enemy_id = best_enemy.id }
end
--DBG.dbms(unit_ratings)
-- Then we want the same thing for all of the enemy units (for the counter attack on enemy turn)
local enemy_ratings = {}
@ -1300,7 +1285,6 @@ function battle_calcs.relative_damage_map(units, enemies, cache)
end
enemy_ratings[i] = { rating = max_rating, unit_id = best_unit.id, enemy_id = e.id }
end
--DBG.dbms(enemy_ratings)
-- The damage map is now the sum of these ratings for each unit that can attack a given hex,
-- counting own-unit ratings as positive, enemy ratings as negative