update todo
[QuestHelper.git] / Development / build2 / compile_achievement.lua
blobef6db122f5e5170764237d428e6c10afaec52859
2 require "compile_achievement_db"
4 local valid_crits_proto = {0, 43, 54, 68, 70, 72, 109, 110}
5 local valid_crits = {}
6 for _, v in ipairs(valid_crits_proto) do
7 valid_crits[v] = true
8 end
10 local achievements_out = {achievements = {}, monsters = {}}
11 achievements_out.achievements[868] = {unify = true}
13 for _, v in pairs(achievements) do
14 for achid, data in pairs(v) do
15 local allowed_crits = 0
16 local denied_crits = 0
17 local semiallowed_crits = 0
19 for _, dat in ipairs(data) do
20 if dat.type == 0 then
21 semiallowed_crits = semiallowed_crits + 1
22 elseif valid_crits[dat.type] then
23 allowed_crits = allowed_crits + 1
24 else
25 denied_crits = denied_crits + 1
26 end
27 end
29 if #data == 0 then continue end
30 if denied_crits ~= 0 then continue end
31 --print(data.name, allowed_crits, denied_crits)
33 if allowed_crits > 0 and not achievements_out.achievements[achid] then
34 achievements_out.achievements[achid] = {}
35 end
37 for _, dat in ipairs(data) do
38 if dat.type == 0 then
39 achievements_out.monsters[dat.asset] = true
40 end
41 end
42 end
43 end
45 achievements = achievements_out