mirror of
https://github.com/FaceDeer/dfcaverns.git
synced 2025-01-24 17:20:19 +01:00
removing leftovers
This commit is contained in:
parent
a9e0a4a887
commit
dd962f04a1
@ -57,27 +57,21 @@ awards.register_on_unlock(function(player_name, def)
|
||||
if not player_awards then return end
|
||||
local unlocked = player_awards.unlocked
|
||||
if not unlocked then return end
|
||||
--local player = minetest.get_player_by_name(player_name)
|
||||
--if not player then return end
|
||||
|
||||
-- the achievement that just got unlocked had one or more "parent" achievements associated with it.
|
||||
for _, achievement_parent in pairs(def_dfcaverns_achievements) do
|
||||
minetest.debug("updating achievement type " .. achievement_parent)
|
||||
--if unlocked[achievement_parent] ~= achievement_parent then -- this should theoretically never fail
|
||||
player_awards.dfcaverns_achievements = player_awards.dfcaverns_achievements or {}
|
||||
local source_list = achievement_parents[achievement_parent]
|
||||
local total = #source_list
|
||||
local count = 0
|
||||
for _, source_achievement in pairs(source_list) do
|
||||
if unlocked[source_achievement] == source_achievement then count = count + 1 end
|
||||
end
|
||||
player_awards.dfcaverns_achievements[achievement_parent] = count
|
||||
minetest.debug(dump(player_awards))
|
||||
awards.save()
|
||||
if count >= total then
|
||||
minetest.after(4, awards.unlock, player_name, achievement_parent)
|
||||
end
|
||||
--end
|
||||
player_awards.dfcaverns_achievements = player_awards.dfcaverns_achievements or {}
|
||||
local source_list = achievement_parents[achievement_parent]
|
||||
local total = #source_list
|
||||
local count = 0
|
||||
for _, source_achievement in pairs(source_list) do
|
||||
if unlocked[source_achievement] == source_achievement then count = count + 1 end
|
||||
end
|
||||
player_awards.dfcaverns_achievements[achievement_parent] = count
|
||||
awards.save()
|
||||
if count >= total then
|
||||
minetest.after(4, awards.unlock, player_name, achievement_parent)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
|
@ -139,36 +139,6 @@ minetest.register_globalstep(function(dtime)
|
||||
end
|
||||
end)
|
||||
|
||||
local upper_biome_achievements = {"dfcaverns_visit_tower_cap", "dfcaverns_visit_fungiwood", "dfcaverns_visit_goblin_cap", "dfcaverns_visit_spore_tree", "dfcaverns_visit_tunnel_tube", "dfcaverns_visit_nethercap", "dfcaverns_visit_blood_thorn", "dfcaverns_visit_black_cap", "dfcaverns_visit_sunless_sea"}
|
||||
|
||||
local middle_biome_achievements = {"dfcaverns_visit_oil_sea", "dfcaverns_visit_lava_sea", "dfcaverns_visit_underworld"}
|
||||
|
||||
local primordial_biome_achievements = {"dfcaverns_visit_primordial_jungle", "dfcaverns_visit_primordial_fungal"}
|
||||
|
||||
local all_caverns = {"dfcaverns_visit_all_upper_biomes", "dfcaverns_visit_all_middle_biomes", "dfcaverns_visit_all_primordial_biomes", "dfcaverns_visit_chasm", "dfcaverns_visit_pit"}
|
||||
|
||||
local test_list = df_achievements.test_list
|
||||
|
||||
-- name is the player name
|
||||
-- def is the award def.
|
||||
awards.register_on_unlock(function(player_name, def)
|
||||
local player_awards = awards.player(player_name)
|
||||
if not player_awards or not player_awards.unlocked then
|
||||
return
|
||||
end
|
||||
local unlocked = player_awards.unlocked
|
||||
test_list(player_name, "dfcaverns_visit_all_upper_biomes", unlocked, upper_biome_achievements)
|
||||
test_list(player_name, "dfcaverns_visit_all_middle_biomes", unlocked, middle_biome_achievements)
|
||||
test_list(player_name, "dfcaverns_visit_all_primordial_biomes", unlocked, primordial_biome_achievements)
|
||||
test_list(player_name, "dfcaverns_visit_all_caverns", unlocked, all_caverns)
|
||||
end)
|
||||
|
||||
|
||||
--awards.unlock(name, award)
|
||||
-- local data = awards.players[name]
|
||||
-- local awdef = awards.def[award]
|
||||
-- data.unlocked[award] == award
|
||||
|
||||
-- travelogue
|
||||
|
||||
--biomes
|
||||
|
Loading…
Reference in New Issue
Block a user