add an achievement for collecting all lorebooks

This commit is contained in:
FaceDeer
2023-02-12 15:45:26 -07:00
parent fc1a6d754e
commit e186037f2b
11 changed files with 87 additions and 11 deletions

View File

@ -107,6 +107,7 @@ Slightly less prestigious than the Primordial Fruit, but still rare and exotic c
Activating a puzzle seal has produced a breach in the slade foundations of the world.=
Capture an Ice Sprite=
Collect All Lore=
Decipher the code of the ancients. Do you dare turn the key?=
Detonate Mine Gas=
Get Attacked by an Underworld Guardian=
@ -125,6 +126,8 @@ You've captured an ice sprite and placed it in a bottle. It dances and sparkles
You've discovered something important about those mysterious slade statues in the Underworld.=
You've searched the world top to bottom for cairns containing lore and your collection is now complete.=
### travel.lua ###

View File

@ -82,6 +82,23 @@ if minetest.get_modpath("df_underworld_items") then
end
if minetest.get_modpath("df_lorebooks") then
collectible_lore.register_on_collected(function(player_name, id, state, collected)
local count = 0
for id, val in pairs(collected) do
if val then count = count + 1 end
end
if count >= #(collectible_lore.lorebooks) then
awards.unlock(player_name, "dfcaverns_all_lorebooks_found")
end
end)
awards.register_achievement("dfcaverns_all_lorebooks_found", {
title = S("Collect All Lore"),
difficulty = 4,
description = S("You've searched the world top to bottom for cairns containing lore and your collection is now complete."),
icon = "dfcaverns_awards_backgroundx32.png^dfcaverns_awards_lore_cairnsx32.png^dfcaverns_awards_foregroundx32.png",
})
end
-- can't think of an easy way to detect these
--awards.register_achievement("dfcaverns_torch_detonated_mine_gas", {

View File

@ -1,4 +1,4 @@
name=df_achievements
description=Achievements for DFCaverns
depends=df_caverns, df_trees, df_farming, df_mapitems, df_dependencies, pit_caves
optional_depends=df_underworld_items, hunter_statue, awards, big_webs, bubblesponge
optional_depends=df_underworld_items, hunter_statue, awards, big_webs, bubblesponge, df_lorebooks

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB