mirror of
				https://github.com/FaceDeer/dfcaverns.git
				synced 2025-11-04 01:55:28 +01:00 
			
		
		
		
	add an achievement for collecting all lorebooks
This commit is contained in:
		@@ -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 ###
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -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", {
 | 
			
		||||
 
 | 
			
		||||
@@ -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
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_awards_lore_cairnsx32.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_awards_lore_cairnsx32.png
									
									
									
									
									
										Normal file
									
								
							
										
											Binary file not shown.
										
									
								
							| 
		 After Width: | Height: | Size: 1.8 KiB  | 
		Reference in New Issue
	
	Block a user