Compare commits
	
		
			28 Commits
		
	
	
		
			pit_caves
			...
			bubble-cav
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
| 
						 | 
					476f8a7b89 | ||
| 
						 | 
					dd0468b376 | ||
| 
						 | 
					d804f7fa6d | ||
| 
						 | 
					5ea9ee9de0 | ||
| 
						 | 
					efeae89ab9 | ||
| 
						 | 
					77b990a697 | ||
| 
						 | 
					e82fcf7c87 | ||
| 
						 | 
					52b2cf8ebb | ||
| 
						 | 
					0a0c97b74e | ||
| 
						 | 
					b2ee829c1a | ||
| 
						 | 
					0296f7fb7e | ||
| 
						 | 
					dbc5dd38a3 | ||
| 
						 | 
					f23d4115bd | ||
| 
						 | 
					1b402a2403 | ||
| 
						 | 
					18d2f190e8 | ||
| 
						 | 
					beb89c5a64 | ||
| 
						 | 
					d1620a6f39 | ||
| 
						 | 
					edae8c1104 | ||
| 
						 | 
					a243b613a3 | ||
| 
						 | 
					64063bda36 | ||
| 
						 | 
					1f1b7efb95 | ||
| 
						 | 
					4884f1e51a | ||
| 
						 | 
					c3e3ea0d5d | ||
| 
						 | 
					d4f12d19ec | ||
| 
						 | 
					dbd12b2237 | ||
| 
						 | 
					ca483a6f29 | ||
| 
						 | 
					416fbb4e45 | ||
| 
						 | 
					289c353bb6 | 
@@ -1,7 +1,10 @@
 | 
			
		||||
local modname = minetest.get_current_modname()
 | 
			
		||||
local S = minetest.get_translator(modname)
 | 
			
		||||
 | 
			
		||||
local default_path = minetest.get_modpath("default")
 | 
			
		||||
local sound
 | 
			
		||||
if df_dependencies.sound_leaves then
 | 
			
		||||
	sound = df_dependencies.sound_leaves()
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local get_node_box = function(connector_thickness)
 | 
			
		||||
	return {
 | 
			
		||||
@@ -17,15 +20,17 @@ local get_node_box = function(connector_thickness)
 | 
			
		||||
	}
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local anchor_groups = {"group:soil", "group:stone", "group:tree", "group:wood", "group:webbing", "group:solid"}
 | 
			
		||||
 | 
			
		||||
local in_anchor_group = function(name)
 | 
			
		||||
	return
 | 
			
		||||
		minetest.get_item_group(name, "soil") > 0 or
 | 
			
		||||
		minetest.get_item_group(name, "stone") > 0 or
 | 
			
		||||
		minetest.get_item_group(name, "tree") > 0 or
 | 
			
		||||
		minetest.get_item_group(name, "leaves") > 0 or
 | 
			
		||||
		minetest.get_item_group(name, "sand") > 0 or
 | 
			
		||||
		minetest.get_item_group(name, "wood") > 0 or
 | 
			
		||||
		name == "ignore"
 | 
			
		||||
	for _, group in pairs(anchor_groups) do
 | 
			
		||||
		if minetest.get_item_group(name, string.sub(group, 7)) then
 | 
			
		||||
			return true
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
	if name == "ignore" then
 | 
			
		||||
		return true
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local cardinal_directions = {
 | 
			
		||||
@@ -72,12 +77,6 @@ local get_web_nodes = function(pos, webs, anchors)
 | 
			
		||||
	end	
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local sound
 | 
			
		||||
if default_path then
 | 
			
		||||
	sound = default.node_sound_leaves_defaults()
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
local web_line = function(pos, dir, distance)
 | 
			
		||||
	local anchored
 | 
			
		||||
	local web_spine = {}
 | 
			
		||||
@@ -128,7 +127,7 @@ minetest.register_node("big_webs:webbing", {
 | 
			
		||||
		{name="big_webs.png"},
 | 
			
		||||
	},
 | 
			
		||||
	use_texture_alpha = "blend",
 | 
			
		||||
    connects_to = {"group:soil", "group:stone", "group:tree", "group:leaves", "group:sand", "group:wood", "group:webbing"},
 | 
			
		||||
    connects_to = anchor_groups,
 | 
			
		||||
    connect_sides = { "top", "bottom", "front", "left", "back", "right" },
 | 
			
		||||
	drawtype = "nodebox",
 | 
			
		||||
	node_box = get_node_box(0.0625),
 | 
			
		||||
@@ -138,8 +137,7 @@ minetest.register_node("big_webs:webbing", {
 | 
			
		||||
	paramtype = "light",
 | 
			
		||||
	is_ground_content = false,
 | 
			
		||||
	climbable = true,
 | 
			
		||||
	floodable = true,
 | 
			
		||||
	groups = {snappy = 2, choppy = 2, webbing = 1, flammable=1, fall_damage_add_percent=-100, bouncy=20},
 | 
			
		||||
	groups = {snappy = 2, choppy = 2, webbing = 1, shearsy = 1,  swordy=1, flammable=1, destroy_by_lava_flow=1, fall_damage_add_percent=-100, bouncy=20},
 | 
			
		||||
	sounds = sound,
 | 
			
		||||
	on_construct = function(pos)
 | 
			
		||||
		minetest.get_node_timer(pos):start(30)
 | 
			
		||||
@@ -168,6 +166,8 @@ minetest.register_node("big_webs:webbing", {
 | 
			
		||||
			minetest.get_node_timer(web_pos):stop() -- no need to recheck
 | 
			
		||||
		end	
 | 
			
		||||
	end,
 | 
			
		||||
	_mcl_blast_resistance = 1.0,
 | 
			
		||||
	_mcl_hardness = 0.5,
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
minetest.register_node("big_webs:web_egg", {
 | 
			
		||||
@@ -176,7 +176,7 @@ minetest.register_node("big_webs:web_egg", {
 | 
			
		||||
		{name="big_webs.png"},
 | 
			
		||||
	},
 | 
			
		||||
	use_texture_alpha = "blend",
 | 
			
		||||
    connects_to = {"group:soil", "group:stone", "group:tree", "group:leaves", "group:sand", "group:wood", "group:webbing"},
 | 
			
		||||
    connects_to = anchor_groups,
 | 
			
		||||
    connect_sides = { "top", "bottom", "front", "left", "back", "right" },
 | 
			
		||||
	drawtype = "nodebox",
 | 
			
		||||
	node_box = get_node_box(0.0625),
 | 
			
		||||
@@ -196,4 +196,6 @@ minetest.register_node("big_webs:web_egg", {
 | 
			
		||||
		minetest.set_node(pos, {name="air"})
 | 
			
		||||
		generate_web(pos)
 | 
			
		||||
	end,
 | 
			
		||||
	_mcl_blast_resistance = 1.0,
 | 
			
		||||
	_mcl_hardness = 0.5,
 | 
			
		||||
})
 | 
			
		||||
@@ -1,2 +1,2 @@
 | 
			
		||||
name=big_webs
 | 
			
		||||
optional_depends=default
 | 
			
		||||
optional_depends=df_dependencies
 | 
			
		||||
@@ -4,6 +4,75 @@ local dungeon_loot_path = minetest.get_modpath("dungeon_loot")
 | 
			
		||||
 | 
			
		||||
bones_loot = {}
 | 
			
		||||
 | 
			
		||||
local bones_formspec =
 | 
			
		||||
	"size[8,9]"
 | 
			
		||||
	.."list[current_name;main;0,0.3;8,4;]"
 | 
			
		||||
	.."list[current_player;main;0,4.85;8,1;]"
 | 
			
		||||
	.."list[current_player;main;0,6.08;8,3;8]"
 | 
			
		||||
	.."listring[current_name;main]"
 | 
			
		||||
	.."listring[current_player;main]"
 | 
			
		||||
	..df_dependencies.get_itemslot_bg(0,0.3,8,4)
 | 
			
		||||
	..df_dependencies.get_itemslot_bg(0,4.85,8,1)
 | 
			
		||||
	..df_dependencies.get_itemslot_bg(0,6.08,8,3)
 | 
			
		||||
if minetest.get_modpath("default") then
 | 
			
		||||
	bones_formspec = bones_formspec .. default.get_hotbar_bg(0,4.85)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
if minetest.get_modpath("bones") then
 | 
			
		||||
	df_dependencies.node_name_bones = "bones:bones"
 | 
			
		||||
else
 | 
			
		||||
 | 
			
		||||
	local function drop_item_stack(pos, stack)
 | 
			
		||||
		if not stack or stack:is_empty() then return end
 | 
			
		||||
		local drop_offset = vector.new(math.random() - 0.5, 0, math.random() - 0.5)
 | 
			
		||||
		minetest.add_item(vector.add(pos, drop_offset), stack)
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	minetest.register_node("bones_loot:bones", {
 | 
			
		||||
		description = S("Bones"),
 | 
			
		||||
		tiles = {
 | 
			
		||||
			"bones_top.png^[transform2",
 | 
			
		||||
			"bones_bottom.png",
 | 
			
		||||
			"bones_side.png",
 | 
			
		||||
			"bones_side.png",
 | 
			
		||||
			"bones_rear.png",
 | 
			
		||||
			"bones_front.png"
 | 
			
		||||
		},
 | 
			
		||||
		paramtype2 = "facedir",
 | 
			
		||||
		groups = {oddly_diggable_by_hand=1, handy=1, container=2},
 | 
			
		||||
		sounds = df_dependencies.sound_gravel(),
 | 
			
		||||
		_mcl_hardness = 1.5,
 | 
			
		||||
		_mcl_blast_resistance = 6,
 | 
			
		||||
		can_dig = function(pos, player)
 | 
			
		||||
			local inv = minetest.get_meta(pos):get_inventory()
 | 
			
		||||
			return inv:is_empty("main")
 | 
			
		||||
		end,
 | 
			
		||||
	
 | 
			
		||||
		on_construct = function(pos)
 | 
			
		||||
			local meta = minetest.get_meta(pos)
 | 
			
		||||
			meta:set_string("formspec", bones_formspec)
 | 
			
		||||
			local inv = meta:get_inventory()
 | 
			
		||||
			inv:set_size("main", 8*4)
 | 
			
		||||
		end,
 | 
			
		||||
 | 
			
		||||
		on_blast = function(pos, intensity)
 | 
			
		||||
			local meta = minetest.get_meta(pos)
 | 
			
		||||
			local inv = meta:get_inventory()
 | 
			
		||||
			for i = 1, inv:get_size("main") do
 | 
			
		||||
				drop_item_stack(pos, inv:get_stack("main", i))
 | 
			
		||||
			end
 | 
			
		||||
			meta:from_table()
 | 
			
		||||
			minetest.remove_node(pos)
 | 
			
		||||
			if math.random(1, math.floor((intensity or 1) * 2)) ~= 1 then return end
 | 
			
		||||
			drop_item_stack(pos, "bones_loot:bones")
 | 
			
		||||
		end
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	df_dependencies.node_name_bones = "bones_loot:bones"
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local bones_node = df_dependencies.node_name_bones
 | 
			
		||||
 | 
			
		||||
local local_loot = {}
 | 
			
		||||
local local_loot_register = function(t)
 | 
			
		||||
	if t.name ~= nil then
 | 
			
		||||
@@ -104,19 +173,8 @@ bones_loot.get_loot = function(pos, loot_type, max_stacks, exclusive_loot_type)
 | 
			
		||||
	return items
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local bones_formspec =
 | 
			
		||||
	"size[8,9]" ..
 | 
			
		||||
	"list[current_name;main;0,0.3;8,4;]" ..
 | 
			
		||||
	"list[current_player;main;0,4.85;8,1;]" ..
 | 
			
		||||
	"list[current_player;main;0,6.08;8,3;8]" ..
 | 
			
		||||
	"listring[current_name;main]" ..
 | 
			
		||||
	"listring[current_player;main]"
 | 
			
		||||
if minetest.get_modpath("default") then
 | 
			
		||||
	bones_formspec = bones_formspec .. default.get_hotbar_bg(0,4.85)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
bones_loot.place_bones = function(pos, loot_type, max_stacks, infotext, exclusive_loot_type)
 | 
			
		||||
	minetest.set_node(pos, {name="bones:bones", param2 = math.random(1,4)-1})
 | 
			
		||||
	minetest.set_node(pos, {name=bones_node, param2 = math.random(1,4)-1})
 | 
			
		||||
	local meta = minetest.get_meta(pos)
 | 
			
		||||
	if infotext == nil then
 | 
			
		||||
		infotext = S("Someone's old bones")
 | 
			
		||||
@@ -137,7 +195,7 @@ end
 | 
			
		||||
minetest.register_lbm({
 | 
			
		||||
	label = "Repair underworld bones formspec",
 | 
			
		||||
	name = "bones_loot:repair_underworld_bones_formspec",
 | 
			
		||||
	nodenames = {"bones:bones"},	
 | 
			
		||||
	nodenames = {bones_node},	
 | 
			
		||||
	action = function(pos, node)
 | 
			
		||||
		local meta = minetest.get_meta(pos)
 | 
			
		||||
		if not meta:get("formspec") then
 | 
			
		||||
 
 | 
			
		||||
@@ -3,5 +3,17 @@
 | 
			
		||||
 | 
			
		||||
### init.lua ###
 | 
			
		||||
 | 
			
		||||
# textdomain: bones
 | 
			
		||||
Bones=Knochen
 | 
			
		||||
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
 | 
			
		||||
Someone's old bones=Jemandes alte Knochen
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
##### not used anymore #####
 | 
			
		||||
 | 
			
		||||
@1's old bones=Alte Knochen von @1
 | 
			
		||||
@1 died at @2.=@1 starb bei @2.
 | 
			
		||||
@1 died at @2, and dropped their inventory.=@1 starb bei @2 und ließ das Inventar fallen.
 | 
			
		||||
@1 died at @2, and bones were placed.=@1 starb bei @2 und Knochen wurden platziert.
 | 
			
		||||
@1's fresh bones=Frische Knochen von @1
 | 
			
		||||
@1's bones=Knochen von @1
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										18
									
								
								bones_loot/locale/bones_loot.eo.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,18 @@
 | 
			
		||||
# textdomain: bones_loot
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### init.lua ###
 | 
			
		||||
 | 
			
		||||
# textdomain: bones
 | 
			
		||||
Bones=Ostoj
 | 
			
		||||
Someone's old bones=
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
##### not used anymore #####
 | 
			
		||||
 | 
			
		||||
@1's old bones=La malfreŝaj ostoj de @1
 | 
			
		||||
@1 died at @2.=@1 mortis ĉe @2
 | 
			
		||||
@1 died at @2, and dropped their inventory.=@1 mortis ĉe @2, kaj delasis sian stokon.
 | 
			
		||||
@1 died at @2, and bones were placed.=@1 mortis ĉe @2, kaj ostoj estas demetitaj.
 | 
			
		||||
@1's fresh bones=La freŝaj ostoj de @1
 | 
			
		||||
@1's bones=La ostoj de @1
 | 
			
		||||
							
								
								
									
										18
									
								
								bones_loot/locale/bones_loot.es.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,18 @@
 | 
			
		||||
# textdomain: bones_loot
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### init.lua ###
 | 
			
		||||
 | 
			
		||||
# textdomain: bones
 | 
			
		||||
Bones=Huesos
 | 
			
		||||
Someone's old bones=
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
##### not used anymore #####
 | 
			
		||||
 | 
			
		||||
@1's old bones=Huesos antiguos de @1
 | 
			
		||||
@1 died at @2.=@1 murió en @2.
 | 
			
		||||
@1 died at @2, and dropped their inventory.=@1 murió en @2, y su inventario se desprendió.
 | 
			
		||||
@1 died at @2, and bones were placed.=@1 murió en @2, y sus huesos fueron depositados.
 | 
			
		||||
@1's fresh bones=Huesos recientes de @1
 | 
			
		||||
@1's bones=Huesos de @1
 | 
			
		||||
							
								
								
									
										18
									
								
								bones_loot/locale/bones_loot.fr.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,18 @@
 | 
			
		||||
# textdomain: bones_loot
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### init.lua ###
 | 
			
		||||
 | 
			
		||||
# textdomain: bones
 | 
			
		||||
Bones=Os
 | 
			
		||||
Someone's old bones=
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
##### not used anymore #####
 | 
			
		||||
 | 
			
		||||
@1's old bones=Vieux os de @1
 | 
			
		||||
@1 died at @2.=@1 est mort à @2.
 | 
			
		||||
@1 died at @2, and dropped their inventory.=@1 est mort à @2 et a laissé tomber son inventaire.
 | 
			
		||||
@1 died at @2, and bones were placed.=@1 est mort à @2 et ses os ont été placés.
 | 
			
		||||
@1's fresh bones=Os frais de @1
 | 
			
		||||
@1's bones=Os de @1
 | 
			
		||||
							
								
								
									
										18
									
								
								bones_loot/locale/bones_loot.id.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,18 @@
 | 
			
		||||
# textdomain: bones_loot
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### init.lua ###
 | 
			
		||||
 | 
			
		||||
# textdomain: bones
 | 
			
		||||
Bones=Tulang
 | 
			
		||||
Someone's old bones=
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
##### not used anymore #####
 | 
			
		||||
 | 
			
		||||
@1's old bones=Tulang lama @1
 | 
			
		||||
@1 died at @2.=@1 mati di @2.
 | 
			
		||||
@1 died at @2, and dropped their inventory.=@1 mati di @2 dan meninggalkan barangnya.
 | 
			
		||||
@1 died at @2, and bones were placed.=@1 mati di @2 dan tulangnya diletakkan.
 | 
			
		||||
@1's fresh bones=Tulang segar @1
 | 
			
		||||
@1's bones=Tulang @1
 | 
			
		||||
@@ -3,5 +3,17 @@
 | 
			
		||||
 | 
			
		||||
### init.lua ###
 | 
			
		||||
 | 
			
		||||
# textdomain: bones
 | 
			
		||||
Bones=Ossa
 | 
			
		||||
#WARNING: AUTOTRANSLATED BY GOOGLE TRANSLATE
 | 
			
		||||
Someone's old bones=Le vecchie ossa di qualcuno
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
##### not used anymore #####
 | 
			
		||||
 | 
			
		||||
@1's old bones=Ossa vecchie di @1
 | 
			
		||||
@1 died at @2.=@1 è morto alla posizione @2.
 | 
			
		||||
@1 died at @2, and dropped their inventory.=@1 è morto alla posizione @2, e ha lasciato a terra il contenuto del suo inventario.
 | 
			
		||||
@1 died at @2, and bones were placed.=@1 è morto alla posizione @2, e vi sono state posizionate delle ossa.
 | 
			
		||||
@1's fresh bones=Ossa fresche di @1
 | 
			
		||||
@1's bones=Ossa di @1
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										18
									
								
								bones_loot/locale/bones_loot.ja.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,18 @@
 | 
			
		||||
# textdomain: bones_loot
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### init.lua ###
 | 
			
		||||
 | 
			
		||||
# textdomain: bones
 | 
			
		||||
Bones=骨
 | 
			
		||||
Someone's old bones=
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
##### not used anymore #####
 | 
			
		||||
 | 
			
		||||
@1's old bones=@1の古い骨
 | 
			
		||||
@1 died at @2.=@1は@2で死亡しました。
 | 
			
		||||
@1 died at @2, and dropped their inventory.=@1は@2で死亡して持ち物を落としました。
 | 
			
		||||
@1 died at @2, and bones were placed.=@1は@2で死亡して骨が残されました。
 | 
			
		||||
@1's fresh bones=@1の新鮮な骨
 | 
			
		||||
@1's bones=@1の骨
 | 
			
		||||
							
								
								
									
										18
									
								
								bones_loot/locale/bones_loot.jbo.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,18 @@
 | 
			
		||||
# textdomain: bones_loot
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### init.lua ###
 | 
			
		||||
 | 
			
		||||
# textdomain: bones
 | 
			
		||||
Bones=lo bongu gunma
 | 
			
		||||
Someone's old bones=
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
##### not used anymore #####
 | 
			
		||||
 | 
			
		||||
@1's old bones=.i ti tolci'o ke bongu gunma po'a la'o zo'i.@1.zo'i
 | 
			
		||||
@1 died at @2.=.i la'o zo'i.@1.zo'i  pu morsi di'o lo me zoi pos.@2.pos.
 | 
			
		||||
@1 died at @2, and dropped their inventory.=.i la'o zo'i.@1.zo'i goi ly. pu morsi di'o lo me zoi pos.@2.pos. .ije ly. te farlu lo me le dacti liste po ly.
 | 
			
		||||
@1 died at @2, and bones were placed.=.i la'o zo'i.@1.zo'i goi ly. pu morsi di'o lo me zoi pos.@2.pos. .ije lo bongu gunma pu se punji
 | 
			
		||||
@1's fresh bones=.i ti cnino ke bongu gunma po'a la'o zo'i.@1.zo'i
 | 
			
		||||
@1's bones=.i ti bongu gunma po'a la'o zo'i.@1.zo'i
 | 
			
		||||
							
								
								
									
										18
									
								
								bones_loot/locale/bones_loot.ms.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,18 @@
 | 
			
		||||
# textdomain: bones_loot
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### init.lua ###
 | 
			
		||||
 | 
			
		||||
# textdomain: bones
 | 
			
		||||
Bones=Tulang
 | 
			
		||||
Someone's old bones=
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
##### not used anymore #####
 | 
			
		||||
 | 
			
		||||
@1's old bones=Tulang lama @1
 | 
			
		||||
@1 died at @2.=@1 mati di @2.
 | 
			
		||||
@1 died at @2, and dropped their inventory.=@1 mati di @2, dan menjatuhkan inventorinya.
 | 
			
		||||
@1 died at @2, and bones were placed.=@1 mati di @2, dan tulang diletakkan.
 | 
			
		||||
@1's fresh bones=Tulang segar @1
 | 
			
		||||
@1's bones=Tulang @1
 | 
			
		||||
							
								
								
									
										18
									
								
								bones_loot/locale/bones_loot.pl.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,18 @@
 | 
			
		||||
# textdomain: bones_loot
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### init.lua ###
 | 
			
		||||
 | 
			
		||||
# textdomain: bones
 | 
			
		||||
Bones=Kości
 | 
			
		||||
Someone's old bones=
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
##### not used anymore #####
 | 
			
		||||
 | 
			
		||||
@1's old bones=Stare kości @1
 | 
			
		||||
@1 died at @2.=@1 umarł w @2.
 | 
			
		||||
@1 died at @2, and dropped their inventory.=@1 umarł w @2, i upuścił swój ekwipunek.
 | 
			
		||||
@1 died at @2, and bones were placed.=@1 umarł w @2, kości zostały położone.
 | 
			
		||||
@1's fresh bones=Świeże kości @1
 | 
			
		||||
@1's bones=Kości @1
 | 
			
		||||
							
								
								
									
										18
									
								
								bones_loot/locale/bones_loot.pt_BR.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,18 @@
 | 
			
		||||
# textdomain: bones_loot
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### init.lua ###
 | 
			
		||||
 | 
			
		||||
# textdomain: bones
 | 
			
		||||
Bones=Ossos
 | 
			
		||||
Someone's old bones=
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
##### not used anymore #####
 | 
			
		||||
 | 
			
		||||
@1's old bones=Ossos antigos de @1
 | 
			
		||||
@1 died at @2.=@1 morreu em @2.
 | 
			
		||||
@1 died at @2, and dropped their inventory.=@1 morreu em @2, e seu inventário foi derrubado.
 | 
			
		||||
@1 died at @2, and bones were placed.=@1 morreu em @2, e os ossos foram colocados.
 | 
			
		||||
@1's fresh bones=Ossos recentes de @1
 | 
			
		||||
@1's bones=Ossos de @1
 | 
			
		||||
							
								
								
									
										18
									
								
								bones_loot/locale/bones_loot.ru.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,18 @@
 | 
			
		||||
# textdomain: bones_loot
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### init.lua ###
 | 
			
		||||
 | 
			
		||||
# textdomain: bones
 | 
			
		||||
Bones=Кости
 | 
			
		||||
Someone's old bones=
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
##### not used anymore #####
 | 
			
		||||
 | 
			
		||||
@1's old bones=Старые кости @1
 | 
			
		||||
@1 died at @2.=@1 умер в @2.
 | 
			
		||||
@1 died at @2, and dropped their inventory.=@1 умер в @2 и потерял содержимое своего инвентаря. 
 | 
			
		||||
@1 died at @2, and bones were placed.=@1 умер в @2, помещены кости.
 | 
			
		||||
@1's fresh bones=новые кости @1
 | 
			
		||||
@1's bones=кости @1
 | 
			
		||||
							
								
								
									
										18
									
								
								bones_loot/locale/bones_loot.sk.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,18 @@
 | 
			
		||||
# textdomain: bones_loot
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### init.lua ###
 | 
			
		||||
 | 
			
		||||
# textdomain: bones
 | 
			
		||||
Bones=Kosti
 | 
			
		||||
Someone's old bones=
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
##### not used anymore #####
 | 
			
		||||
 | 
			
		||||
@1's old bones=Staré kosti hráča @1
 | 
			
		||||
@1 died at @2.=@1 zomrel na pozícií @2.
 | 
			
		||||
@1 died at @2, and dropped their inventory.=@1 zomrel na pozícií @2 a vysypal svoj inventár.
 | 
			
		||||
@1 died at @2, and bones were placed.=@1 zomrel na pozícií @2 a ostali po ňom kosti.
 | 
			
		||||
@1's fresh bones=Čerstvé kosti hráča @1
 | 
			
		||||
@1's bones=Kosti hráča  @1
 | 
			
		||||
							
								
								
									
										18
									
								
								bones_loot/locale/bones_loot.sv.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,18 @@
 | 
			
		||||
# textdomain: bones_loot
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### init.lua ###
 | 
			
		||||
 | 
			
		||||
# textdomain: bones
 | 
			
		||||
Bones=Ben
 | 
			
		||||
Someone's old bones=
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
##### not used anymore #####
 | 
			
		||||
 | 
			
		||||
@1's old bones=@1s Gamla ben
 | 
			
		||||
@1 died at @2.=@1 dog på @a.
 | 
			
		||||
@1 died at @2, and dropped their inventory.=@1 dog på @a, och tappade deras saker.
 | 
			
		||||
@1 died at @2, and bones were placed.=@1 dog på @2, och deras ben var placerade.
 | 
			
		||||
@1's fresh bones=@1s färska ben
 | 
			
		||||
@1's bones=@1s ben
 | 
			
		||||
							
								
								
									
										18
									
								
								bones_loot/locale/bones_loot.uk.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,18 @@
 | 
			
		||||
# textdomain: bones_loot
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### init.lua ###
 | 
			
		||||
 | 
			
		||||
# textdomain: bones
 | 
			
		||||
Bones=Кістки
 | 
			
		||||
Someone's old bones=
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
##### not used anymore #####
 | 
			
		||||
 | 
			
		||||
@1's old bones=старі кістки @1
 | 
			
		||||
@1 died at @2.=@1 помер в @2.
 | 
			
		||||
@1 died at @2, and dropped their inventory.=@1 помер в @2, та загубив вміст свого інвентарю.
 | 
			
		||||
@1 died at @2, and bones were placed.=@1 помер в @2, розміщені кістки.
 | 
			
		||||
@1's fresh bones=нові кістки @1
 | 
			
		||||
@1's bones=кістки @1
 | 
			
		||||
							
								
								
									
										18
									
								
								bones_loot/locale/bones_loot.zh_CN.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,18 @@
 | 
			
		||||
# textdomain: bones_loot
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### init.lua ###
 | 
			
		||||
 | 
			
		||||
# textdomain: bones
 | 
			
		||||
Bones=骨骸
 | 
			
		||||
Someone's old bones=
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
##### not used anymore #####
 | 
			
		||||
 | 
			
		||||
@1's old bones=@1的旧骨骸
 | 
			
		||||
@1 died at @2.=@1在@2死亡。
 | 
			
		||||
@1 died at @2, and dropped their inventory.=@1在@2死亡,丢掉了所有物品。
 | 
			
		||||
@1 died at @2, and bones were placed.=@1在@2死亡,已放置骨骸。
 | 
			
		||||
@1's fresh bones=@1的新鲜骨骸
 | 
			
		||||
@1's bones=@1的骨骸
 | 
			
		||||
							
								
								
									
										18
									
								
								bones_loot/locale/bones_loot.zh_TW.tr
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,18 @@
 | 
			
		||||
# textdomain: bones_loot
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### init.lua ###
 | 
			
		||||
 | 
			
		||||
# textdomain: bones
 | 
			
		||||
Bones=骨骸
 | 
			
		||||
Someone's old bones=
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
##### not used anymore #####
 | 
			
		||||
 | 
			
		||||
@1's old bones=@1的舊骨骸
 | 
			
		||||
@1 died at @2.=@1在@2死亡。
 | 
			
		||||
@1 died at @2, and dropped their inventory.=@1在@2死亡,丟掉了物品欄。
 | 
			
		||||
@1 died at @2, and bones were placed.=@1在@2死亡,骨骸被放置。
 | 
			
		||||
@1's fresh bones=@1的新鮮骨骸
 | 
			
		||||
@1's bones=@1的骨骸
 | 
			
		||||
@@ -3,4 +3,6 @@
 | 
			
		||||
 | 
			
		||||
### init.lua ###
 | 
			
		||||
 | 
			
		||||
# textdomain: bones
 | 
			
		||||
Bones=
 | 
			
		||||
Someone's old bones=
 | 
			
		||||
 
 | 
			
		||||
@@ -1,4 +1,4 @@
 | 
			
		||||
name = bones_loot
 | 
			
		||||
description = An API that allows bones to be placed procedurally with randomly generated loot
 | 
			
		||||
depends = bones
 | 
			
		||||
optional_depends = dungeon_loot, default
 | 
			
		||||
depends = df_dependencies
 | 
			
		||||
optional_depends = dungeon_loot, bones
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								bones_loot/textures/bones_bottom.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 349 B  | 
							
								
								
									
										
											BIN
										
									
								
								bones_loot/textures/bones_front.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 339 B  | 
							
								
								
									
										58
									
								
								bones_loot/textures/bones_license.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,58 @@
 | 
			
		||||
License of source code
 | 
			
		||||
----------------------
 | 
			
		||||
 | 
			
		||||
The MIT License (MIT)
 | 
			
		||||
Copyright (C) 2012-2016 PilzAdam
 | 
			
		||||
Copyright (C) 2012-2016 Various Minetest developers and contributors
 | 
			
		||||
 | 
			
		||||
Permission is hereby granted, free of charge, to any person obtaining a copy of this
 | 
			
		||||
software and associated documentation files (the "Software"), to deal in the Software
 | 
			
		||||
without restriction, including without limitation the rights to use, copy, modify, merge,
 | 
			
		||||
publish, distribute, sublicense, and/or sell copies of the Software, and to permit
 | 
			
		||||
persons to whom the Software is furnished to do so, subject to the following conditions:
 | 
			
		||||
 | 
			
		||||
The above copyright notice and this permission notice shall be included in all copies or
 | 
			
		||||
substantial portions of the Software.
 | 
			
		||||
 | 
			
		||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
 | 
			
		||||
INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 | 
			
		||||
PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE
 | 
			
		||||
FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR
 | 
			
		||||
OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
 | 
			
		||||
DEALINGS IN THE SOFTWARE.
 | 
			
		||||
 | 
			
		||||
For more details:
 | 
			
		||||
https://opensource.org/licenses/MIT
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
Licenses of media (textures)
 | 
			
		||||
----------------------------
 | 
			
		||||
 | 
			
		||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
 | 
			
		||||
Copyright (C) 2016 paramat
 | 
			
		||||
 | 
			
		||||
You are free to:
 | 
			
		||||
Share — copy and redistribute the material in any medium or format.
 | 
			
		||||
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
 | 
			
		||||
The licensor cannot revoke these freedoms as long as you follow the license terms.
 | 
			
		||||
 | 
			
		||||
Under the following terms:
 | 
			
		||||
 | 
			
		||||
Attribution — You must give appropriate credit, provide a link to the license, and
 | 
			
		||||
indicate if changes were made. You may do so in any reasonable manner, but not in any way
 | 
			
		||||
that suggests the licensor endorses you or your use.
 | 
			
		||||
 | 
			
		||||
ShareAlike — If you remix, transform, or build upon the material, you must distribute
 | 
			
		||||
your contributions under the same license as the original.
 | 
			
		||||
 | 
			
		||||
No additional restrictions — You may not apply legal terms or technological measures that
 | 
			
		||||
legally restrict others from doing anything the license permits.
 | 
			
		||||
 | 
			
		||||
Notices:
 | 
			
		||||
 | 
			
		||||
You do not have to comply with the license for elements of the material in the public
 | 
			
		||||
domain or where your use is permitted by an applicable exception or limitation.
 | 
			
		||||
No warranties are given. The license may not give you all of the permissions necessary
 | 
			
		||||
for your intended use. For example, other rights such as publicity, privacy, or moral
 | 
			
		||||
rights may limit how you use the material.
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								bones_loot/textures/bones_rear.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 341 B  | 
							
								
								
									
										
											BIN
										
									
								
								bones_loot/textures/bones_side.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 338 B  | 
							
								
								
									
										
											BIN
										
									
								
								bones_loot/textures/bones_top.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 333 B  | 
							
								
								
									
										144
									
								
								bubble_caves/init.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,144 @@
 | 
			
		||||
local modpath = minetest.get_modpath(minetest.get_current_modname())
 | 
			
		||||
local mapgen_test_path = minetest.get_modpath("mapgen_test")
 | 
			
		||||
--local S = minetest.get_translator(minetest.get_current_modname())
 | 
			
		||||
local c_air = minetest.get_content_id("air")
 | 
			
		||||
 | 
			
		||||
local c_glow
 | 
			
		||||
if minetest.get_modpath("df_underworld_items") then
 | 
			
		||||
	c_glow = minetest.get_content_id("df_underworld_items:glowstone")
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local perlin_params = {
 | 
			
		||||
	offset = 0,
 | 
			
		||||
	scale = 1,
 | 
			
		||||
	spread = {x=1000, y=500, z=1000},
 | 
			
		||||
	seed = 501221,
 | 
			
		||||
	octaves = 3,
 | 
			
		||||
	persist = 0.67
 | 
			
		||||
}
 | 
			
		||||
local data = {}
 | 
			
		||||
local light_data = {}
 | 
			
		||||
local light = 15 + (15 * 16)
 | 
			
		||||
 | 
			
		||||
local max_depth = -5000
 | 
			
		||||
local min_depth = -6000
 | 
			
		||||
 | 
			
		||||
local noise_obj
 | 
			
		||||
 | 
			
		||||
local block_size = 80
 | 
			
		||||
local cube_inside = 1/math.sqrt(3) -- https://www.quora.com/What-is-the-largest-volume-of-a-cube-that-can-be-enclosed-in-a-sphere-of-diameter-2
 | 
			
		||||
 | 
			
		||||
local get_bubbles = function(pos)
 | 
			
		||||
	noise_obj = noise_obj or minetest.get_perlin(perlin_params)
 | 
			
		||||
	local bubbles = {}
 | 
			
		||||
	local next_seed = math.random(1000000)
 | 
			
		||||
	for block_x = -1, 1 do
 | 
			
		||||
		for block_y = -1, 1 do
 | 
			
		||||
			for block_z = -1, 1 do
 | 
			
		||||
				local this_pos = vector.add(pos, {x=block_x*block_size, y=block_y*block_size, z=block_z*block_size})
 | 
			
		||||
				math.randomseed(this_pos.x + this_pos.y*8 + this_pos.z*16)
 | 
			
		||||
				this_pos.x = this_pos.x + math.floor(math.random()*block_size - block_size/2)
 | 
			
		||||
				this_pos.y = this_pos.y + math.floor(math.random()*block_size - block_size/2)
 | 
			
		||||
				this_pos.z = this_pos.z + math.floor(math.random()*block_size - block_size/2)
 | 
			
		||||
				local noise_val = math.min(noise_obj:get_3d(this_pos), 1.0)
 | 
			
		||||
				if noise_val > 0 then
 | 
			
		||||
					local radius = noise_val*block_size*math.random()+5
 | 
			
		||||
					local y = this_pos.y
 | 
			
		||||
					if y + radius < max_depth  and y - radius > min_depth then -- make sure bubbles remain within the layer
 | 
			
		||||
						if mapgen_test_path then
 | 
			
		||||
							if noise_val < 0.1 then
 | 
			
		||||
								mapgen_test.record_first_location("bubble cave sparse", this_pos, "a bubble cave in a sparsely populated region")
 | 
			
		||||
							elseif noise_val < 0.55 and noise_val > 0.45 then
 | 
			
		||||
								mapgen_test.record_first_location("bubble cave middle", this_pos, "a bubble cave in a middlingly populated region")
 | 
			
		||||
							elseif noise_val > 0.9 then
 | 
			
		||||
								mapgen_test.record_first_location("bubble cave dense", this_pos, "a bubble cave in a densely populated region")
 | 
			
		||||
							end
 | 
			
		||||
						end
 | 
			
		||||
						table.insert(bubbles, {loc=this_pos, radius=radius})
 | 
			
		||||
					end
 | 
			
		||||
				end
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
	math.randomseed(next_seed)
 | 
			
		||||
	return bubbles
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
if mapgen_test_path then
 | 
			
		||||
	mapgen_test.log_time_settings("bubble_caves")
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
minetest.register_on_generated(function(minp, maxp, seed)
 | 
			
		||||
	if minp.y > max_depth or maxp.y < min_depth then
 | 
			
		||||
		return
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	local nearby_bubbles = get_bubbles({x=minp.x+block_size/2, y=minp.y+block_size/2, z=minp.z+block_size/2})
 | 
			
		||||
	if not next(nearby_bubbles) then
 | 
			
		||||
		return
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	if mapgen_test_path then
 | 
			
		||||
		mapgen_test.log_time_start("bubble_caves")
 | 
			
		||||
	end
 | 
			
		||||
	
 | 
			
		||||
	local vm, emin, emax = minetest.get_mapgen_object("voxelmanip")
 | 
			
		||||
	local area = VoxelArea:new{MinEdge=emin, MaxEdge=emax}
 | 
			
		||||
	vm:get_data(data)
 | 
			
		||||
	vm:set_lighting({day = 0, night = 0})
 | 
			
		||||
	vm:get_light_data(light_data)
 | 
			
		||||
	
 | 
			
		||||
	for vi, x, y, z in area:iterp_xyz(emin, emax) do
 | 
			
		||||
		for _, bubble in pairs(nearby_bubbles) do
 | 
			
		||||
			if data[vi] ~= c_air then
 | 
			
		||||
				local loc = bubble.loc
 | 
			
		||||
				local loc_x = loc.x
 | 
			
		||||
				local loc_y = loc.y
 | 
			
		||||
				local loc_z = loc.z
 | 
			
		||||
				local radius = bubble.radius
 | 
			
		||||
				-- check outer bounding box first, faster than true distance
 | 
			
		||||
				if x <= loc_x + radius and x >= loc_x - radius and y <= loc_y + radius and y >= loc_y - radius and z <= loc_z + radius and z >= loc_z - radius then
 | 
			
		||||
					local inner_box = radius * cube_inside
 | 
			
		||||
					if (x <= loc_x + inner_box and x >= loc_x - inner_box and y <= loc_y + inner_box and y >= loc_y - inner_box and z <= loc_z + inner_box and z >= loc_z - inner_box)
 | 
			
		||||
						or vector.distance({x=x, y=y, z=z}, loc) < radius+math.random()/2 then
 | 
			
		||||
						data[vi] = c_air
 | 
			
		||||
						light_data[vi] = light
 | 
			
		||||
					end
 | 
			
		||||
				end
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
	
 | 
			
		||||
	if c_glow then
 | 
			
		||||
		for _, bubble in pairs(nearby_bubbles) do
 | 
			
		||||
			local loc = bubble.loc
 | 
			
		||||
			if area:containsp(loc) then
 | 
			
		||||
				local vol = math.floor(bubble.radius / 20)
 | 
			
		||||
				if vol > 0 then
 | 
			
		||||
					for vi in area:iter(loc.x-vol, loc.y-vol, loc.z-vol, loc.x+vol, loc.y+vol, loc.z+vol) do
 | 
			
		||||
						if area:containsi(vi) then
 | 
			
		||||
							data[vi] = c_glow
 | 
			
		||||
						end
 | 
			
		||||
					end
 | 
			
		||||
				else
 | 
			
		||||
					data[area:indexp(loc)] = c_glow
 | 
			
		||||
				end
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
	
 | 
			
		||||
	--send data back to voxelmanip
 | 
			
		||||
	vm:set_data(data)
 | 
			
		||||
	--calc lighting
 | 
			
		||||
	vm:set_light_data(light_data)
 | 
			
		||||
	vm:calc_lighting()
 | 
			
		||||
	vm:update_liquids()
 | 
			
		||||
	--write it to world
 | 
			
		||||
	vm:write_to_map()
 | 
			
		||||
	
 | 
			
		||||
	if mapgen_test_path then
 | 
			
		||||
		mapgen_test.log_time_stop("bubble_caves")
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
end)
 | 
			
		||||
							
								
								
									
										4
									
								
								bubble_caves/mod.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,4 @@
 | 
			
		||||
name = bubble_caves
 | 
			
		||||
description = Inserts foamy spherical bubble caves in a layer underground
 | 
			
		||||
depends = mapgen_helper
 | 
			
		||||
optional_depends = mapgen_test, df_underworld_items
 | 
			
		||||
@@ -78,6 +78,11 @@ end
 | 
			
		||||
local c_air = minetest.get_content_id("air")
 | 
			
		||||
local c_web
 | 
			
		||||
 | 
			
		||||
local log_location
 | 
			
		||||
if mapgen_helper.log_location_enabled then
 | 
			
		||||
	log_location = mapgen_helper.log_first_location
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local big_webs_path = minetest.get_modpath("big_webs")
 | 
			
		||||
if big_webs_path then
 | 
			
		||||
	c_web = minetest.get_content_id("big_webs:webbing")
 | 
			
		||||
@@ -145,13 +150,16 @@ minetest.register_on_generated(function(minp, maxp, seed)
 | 
			
		||||
					webs = webs or calculate_web_array(minp, maxp) -- only calculate webs when we know we're in a chasm
 | 
			
		||||
					if webs[y + z*z_displace] and math.random() < 0.85 then -- random holes in the web
 | 
			
		||||
						data[i] = c_web
 | 
			
		||||
						minetest.get_node_timer({x=x,y=y,z=z}):start(1) -- this timer will check for unsupported webs
 | 
			
		||||
						local web_pos = vector.new(x,y,z)
 | 
			
		||||
						minetest.get_node_timer(web_pos):start(1) -- this timer will check for unsupported webs
 | 
			
		||||
						if log_location then log_location("chasm_web", web_pos) end
 | 
			
		||||
					else
 | 
			
		||||
						data[i] = c_air
 | 
			
		||||
					end
 | 
			
		||||
				else
 | 
			
		||||
					data[i] = c_air
 | 
			
		||||
				end
 | 
			
		||||
				if log_location then log_location("chasm", vector.new(x,y,z)) end
 | 
			
		||||
			end
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
 
 | 
			
		||||
							
								
								
									
										164
									
								
								df_achievements/dig.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,164 @@
 | 
			
		||||
local S = minetest.get_translator(minetest.get_current_modname())
 | 
			
		||||
 | 
			
		||||
local steel_pick = df_dependencies.texture_tool_steelpick
 | 
			
		||||
local steel_shovel = df_dependencies.texture_tool_steelshovel
 | 
			
		||||
 | 
			
		||||
local crossed_pick_and_shovel = "((("..steel_shovel.."^[transformFX)^"..steel_pick..")^[resize:32x32)"
 | 
			
		||||
 | 
			
		||||
local gas_seep = "(("..df_dependencies.texture_stone.."^"..df_dependencies.texture_mineral_coal.."^[combine:16x80:0,-16=crack_anylength.png)^[resize:32x32)"
 | 
			
		||||
 | 
			
		||||
awards.register_achievement("dfcaverns_destroyed_gas_seep", {
 | 
			
		||||
	title = S("Destroy a Gas Seep"),
 | 
			
		||||
	description = S("Plug a crack that mine gas is seeping out of to make the caves just a little bit safer."),
 | 
			
		||||
	icon = "dfcaverns_awards_backgroundx32.png^" .. gas_seep .."^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
	difficulty = 2,
 | 
			
		||||
	trigger = {
 | 
			
		||||
		type = "dig",
 | 
			
		||||
		node = "mine_gas:gas_seep",
 | 
			
		||||
		target = 1
 | 
			
		||||
	},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
awards.register_achievement("dfcaverns_giant_web", {
 | 
			
		||||
	title = S("Collect Giant Webbing"),
 | 
			
		||||
	description = S("Collect a piece of giant webbing found in a cave."),
 | 
			
		||||
	icon ="dfcaverns_awards_backgroundx32.png^big_webs_item.png^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
	difficulty = 1,
 | 
			
		||||
	trigger = {
 | 
			
		||||
		type = "dig",
 | 
			
		||||
		node = "big_webs:webbing",
 | 
			
		||||
		target = 1
 | 
			
		||||
	},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
-- too common
 | 
			
		||||
--awards.register_achievement("dfcaverns_glow_worms", {
 | 
			
		||||
--	title = S("Collect Glow Worms"),
 | 
			
		||||
--	description = S(""),
 | 
			
		||||
--	icon =,
 | 
			
		||||
--	trigger = {
 | 
			
		||||
--		type = "dig",
 | 
			
		||||
--		node = "df_mapitems:glow_worm",
 | 
			
		||||
--		target = 1
 | 
			
		||||
--	},
 | 
			
		||||
--})
 | 
			
		||||
 | 
			
		||||
---------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
awards.register_achievement("dfcaverns_cave_pearls", {
 | 
			
		||||
	title = S("Collect Cave Pearls"),
 | 
			
		||||
	description = S("Collect some cave pearls from the wall of a cave."),
 | 
			
		||||
	icon = "dfcaverns_awards_backgroundx32.png^dfcaverns_cave_pearls_achievement.png^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
	difficulty = 1,
 | 
			
		||||
	trigger = {
 | 
			
		||||
		type = "dig",
 | 
			
		||||
		node = "df_mapitems:cave_pearls",
 | 
			
		||||
		target = 1
 | 
			
		||||
	},
 | 
			
		||||
	_dfcaverns_achievements = {"dfcaverns_prospector"},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
awards.register_achievement("dfcaverns_castle_coral", {
 | 
			
		||||
	title = S("Collect Castle Coral"),
 | 
			
		||||
	description = S("Collect a piece of Castle Coral from the Sunless Sea."),
 | 
			
		||||
	icon ="dfcaverns_awards_backgroundx32.png^dfcaverns_castle_coral_achievement.png^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
	trigger = {
 | 
			
		||||
		type = "dig",
 | 
			
		||||
		node = "df_mapitems:castle_coral",
 | 
			
		||||
		target = 1
 | 
			
		||||
	},
 | 
			
		||||
	difficulty = 2,
 | 
			
		||||
	_dfcaverns_achievements = {"dfcaverns_prospector"},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
awards.register_achievement("dfcaverns_ruby_crystals", {
 | 
			
		||||
	title = S("Collect Giant Red Crystal"),
 | 
			
		||||
	description = S("Collect one of the giant red crystals found in large barren caverns."),
 | 
			
		||||
	icon ="dfcaverns_awards_backgroundx32.png^dfcaverns_big_red_crystal_achievement.png^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
	trigger = {
 | 
			
		||||
		type = "dig",
 | 
			
		||||
		node = "group:dfcaverns_big_crystal",
 | 
			
		||||
		target = 1
 | 
			
		||||
	},
 | 
			
		||||
	difficulty = 1,
 | 
			
		||||
	_dfcaverns_achievements = {"dfcaverns_prospector"},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
awards.register_achievement("dfcaverns_cave_coral", {
 | 
			
		||||
	title = S("Collect Cave Coral"),
 | 
			
		||||
	description = S("Collect a piece of Cave Coral from the Sunless Sea."),
 | 
			
		||||
	icon ="dfcaverns_awards_backgroundx32.png^dfcaverns_cave_coral_achievement.png^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
	trigger = {
 | 
			
		||||
		type = "dig",
 | 
			
		||||
		node = "group:dfcaverns_cave_coral",
 | 
			
		||||
		target = 1
 | 
			
		||||
	},
 | 
			
		||||
	difficulty = 1,
 | 
			
		||||
	_dfcaverns_achievements = {"dfcaverns_prospector"},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
awards.register_achievement("dfcaverns_flawless_mese", {
 | 
			
		||||
	title = S("Collect Flawless Mese Crystal Block"),
 | 
			
		||||
	description = S("Collect a flawless Mese crystal block from the Magma Sea."),
 | 
			
		||||
	icon ="dfcaverns_awards_backgroundx32.png^dfcaverns_glowmese_achievement.png^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
	trigger = {
 | 
			
		||||
		type = "dig",
 | 
			
		||||
		node = "df_mapitems:glow_mese",
 | 
			
		||||
		target = 1
 | 
			
		||||
	},
 | 
			
		||||
	difficulty = 3,
 | 
			
		||||
	_dfcaverns_achievements = {"dfcaverns_prospector"},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
awards.register_achievement("dfcaverns_luminous_salt", {
 | 
			
		||||
	title = S("Collect Luminous Salt Crystal"),
 | 
			
		||||
	description = S("Collect a luminous salt crystal from the dry caverns where Bloodthorns live."),
 | 
			
		||||
	icon ="dfcaverns_awards_backgroundx32.png^dfcaverns_salt_achievement.png^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
	trigger = {
 | 
			
		||||
		type = "dig",
 | 
			
		||||
		node = "df_mapitems:salt_crystal",
 | 
			
		||||
		target = 1
 | 
			
		||||
	},
 | 
			
		||||
	difficulty = 1,
 | 
			
		||||
	_dfcaverns_achievements = {"dfcaverns_prospector"},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
awards.register_achievement("dfcaverns_glow_amethyst", {
 | 
			
		||||
	title = S("Collect Glowing Amethyst"),
 | 
			
		||||
	description = S("Collect a block of glowing amethyst crystal from the Underworld."),
 | 
			
		||||
	icon ="dfcaverns_awards_backgroundx32.png^dfcaverns_amethyst_achievement.png^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
	trigger = {
 | 
			
		||||
		type = "dig",
 | 
			
		||||
		node = "df_underworld_items:glow_amethyst",
 | 
			
		||||
		target = 1
 | 
			
		||||
	},
 | 
			
		||||
	difficulty = 2,
 | 
			
		||||
	_dfcaverns_achievements = {"dfcaverns_prospector"},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
awards.register_achievement("dfcaverns_glow_stone", {
 | 
			
		||||
	title = S('"Collect" Lightseam Stone'),
 | 
			
		||||
	description = S("Attempt to collect a piece of Lightseam, a strange glowing mineral found deep underground."),
 | 
			
		||||
	icon ="dfcaverns_awards_backgroundx32.png^dfcaverns_glowstone_achievement.png^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
	trigger = {
 | 
			
		||||
		type = "dig",
 | 
			
		||||
		node = "df_underworld_items:glowstone",
 | 
			
		||||
		target = 1
 | 
			
		||||
	},
 | 
			
		||||
	difficulty = 2,
 | 
			
		||||
	_dfcaverns_achievements = {"dfcaverns_prospector"},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
------------------------------------------------------------------
 | 
			
		||||
 | 
			
		||||
awards.register_achievement("dfcaverns_prospector", {
 | 
			
		||||
	title = S("Deep Prospector"),
 | 
			
		||||
	description = S("Collect various different exotic items from various caverns."),
 | 
			
		||||
	icon = "dfcaverns_awards_backgroundx32.png^"..crossed_pick_and_shovel.."^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
	difficulty = 3 / df_achievements.get_child_achievement_count("dfcaverns_prospector"),
 | 
			
		||||
	trigger = {
 | 
			
		||||
		type="dfcaverns_achievements",
 | 
			
		||||
		achievement_name="dfcaverns_prospector",
 | 
			
		||||
		target=df_achievements.get_child_achievement_count("dfcaverns_prospector"),
 | 
			
		||||
	},
 | 
			
		||||
})
 | 
			
		||||
							
								
								
									
										153
									
								
								df_achievements/farming.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,153 @@
 | 
			
		||||
local S = minetest.get_translator(minetest.get_current_modname())
 | 
			
		||||
local nethercap_name = df_dependencies.nethercap_name
 | 
			
		||||
 | 
			
		||||
local hoe_texture = df_dependencies.texture_tool_steelhoe
 | 
			
		||||
local soil_texture = df_dependencies.texture_farming_soil
 | 
			
		||||
local ice_texture = df_dependencies.texture_ice
 | 
			
		||||
local coal_ore = "(".. df_dependencies.texture_stone .."^".. df_dependencies.texture_mineral_coal ..")"
 | 
			
		||||
 | 
			
		||||
local make_texture = function(plant_texture, bg_tex)
 | 
			
		||||
	bg_tex = bg_tex or soil_texture
 | 
			
		||||
	return "dfcaverns_awards_backgroundx32.png^[combine:32x32:3,4="..bg_tex.."^[combine:32x32:3,2="..plant_texture.."^[combine:32x32:14,13="..hoe_texture.."^dfcaverns_awards_foregroundx32.png"
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
-- forestry
 | 
			
		||||
 | 
			
		||||
local plant_node_achievements =
 | 
			
		||||
{
 | 
			
		||||
	["df_trees:black_cap_sapling"] = {achievement="dfcaverns_plant_black_cap",
 | 
			
		||||
		title=S("Plant Black Cap"), icon=make_texture("dfcaverns_black_cap_sapling.png", coal_ore), _dfcaverns_achievements={"dfcaverns_plant_all_upper_trees", "dfcaverns_plant_all_underground_trees"}, difficulty = 1,},
 | 
			
		||||
	["df_trees:fungiwood_sapling"] = {achievement="dfcaverns_plant_fungiwood",
 | 
			
		||||
		title=S("Plant Fungiwood"), icon=make_texture("dfcaverns_fungiwood_sapling.png"), _dfcaverns_achievements={"dfcaverns_plant_all_upper_trees", "dfcaverns_plant_all_underground_trees"}, difficulty = 1,},
 | 
			
		||||
	["df_trees:goblin_cap_sapling"] = {achievement="dfcaverns_plant_goblin_cap",
 | 
			
		||||
		title=S("Plant Goblin Cap"), icon=make_texture("dfcaverns_goblin_cap_sapling.png"), _dfcaverns_achievements={"dfcaverns_plant_all_upper_trees", "dfcaverns_plant_all_underground_trees"}, difficulty = 1,},
 | 
			
		||||
	["df_trees:nether_cap_sapling"] = {achievement="dfcaverns_plant_nethercap",
 | 
			
		||||
		title=S("Plant @1", nethercap_name), icon=make_texture("dfcaverns_nether_cap_sapling.png", ice_texture), _dfcaverns_achievements={"dfcaverns_plant_all_upper_trees", "dfcaverns_plant_all_underground_trees"}, difficulty = 1,},
 | 
			
		||||
	["df_trees:spore_tree_sapling"] = {achievement="dfcaverns_plant_spore_tree",
 | 
			
		||||
		title=S("Plant Spore Tree"), icon=make_texture("dfcaverns_spore_tree_sapling.png"), _dfcaverns_achievements={"dfcaverns_plant_all_upper_trees", "dfcaverns_plant_all_underground_trees"}, difficulty = 1,},
 | 
			
		||||
	["df_trees:tower_cap_sapling"] = {achievement="dfcaverns_plant_tower_cap",
 | 
			
		||||
		title=S("Plant Tower Cap"), icon=make_texture("dfcaverns_tower_cap_sapling.png"), _dfcaverns_achievements={"dfcaverns_plant_all_upper_trees", "dfcaverns_plant_all_underground_trees"}, difficulty = 1,},
 | 
			
		||||
	["df_trees:tunnel_tube_sapling"] = {achievement="dfcaverns_plant_tunnel_tube",
 | 
			
		||||
		title=S("Plant Tunnel Tube"), icon=make_texture("dfcaverns_tunnel_tube_sapling.png"), _dfcaverns_achievements={"dfcaverns_plant_all_upper_trees", "dfcaverns_plant_all_underground_trees"}, difficulty = 1,},
 | 
			
		||||
	["df_trees:torchspine_ember"] = {achievement="dfcaverns_plant_torchspine",
 | 
			
		||||
		title=S("Plant Torchspine"), icon=make_texture("dfcaverns_torchspine_achievement.png", coal_ore), _dfcaverns_achievements={"dfcaverns_plant_all_upper_trees", "dfcaverns_plant_all_underground_trees"}, difficulty = 1,},
 | 
			
		||||
	["df_trees:spindlestem_seedling"] = {achievement="dfcaverns_plant_spindlestem",
 | 
			
		||||
		title=S("Plant Spindlestem"), icon=make_texture("dfcaverns_spindlestem_achievement.png"), _dfcaverns_achievements={"dfcaverns_plant_all_upper_trees", "dfcaverns_plant_all_underground_trees"}, difficulty = 1,},
 | 
			
		||||
	["df_trees:blood_thorn"] = {achievement="dfcaverns_plant_bloodthorn",
 | 
			
		||||
		title=S("Plant Bloodthorn"), icon=make_texture("dfcaverns_bloodthorn_achievement.png"), _dfcaverns_achievements={"dfcaverns_plant_all_upper_trees", "dfcaverns_plant_all_underground_trees"}, difficulty = 1,},
 | 
			
		||||
	["df_primordial_items:giant_hypha_apical_meristem"] = {achievement="dfcaverns_plant_giant_mycelium",
 | 
			
		||||
		title=S("Plant Primordial Mycelium"), icon=make_texture("dfcaverns_mush_soil.png"), secret = true, _dfcaverns_achievements={"dfcaverns_plant_all_primordial", "dfcaverns_plant_all_underground_trees"}, difficulty = 3,},
 | 
			
		||||
	["df_primordial_items:fern_sapling"] = {achievement="dfcaverns_plant_primordial_fern",
 | 
			
		||||
		title=S("Plant Primordial Fern"), icon=make_texture("dfcaverns_jungle_fern_03.png"), secret = true, _dfcaverns_achievements={"dfcaverns_plant_all_primordial", "dfcaverns_plant_all_underground_trees"}, difficulty = 3,},
 | 
			
		||||
	["df_primordial_items:jungle_mushroom_sapling"] = {achievement="dfcaverns_plant_primordial_jungle_mushroom",
 | 
			
		||||
		title=S("Plant Primordial Jungle Mushroom"), icon=make_texture("dfcaverns_jungle_mushroom_02.png"), secret = true, _dfcaverns_achievements={"dfcaverns_plant_all_primordial", "dfcaverns_plant_all_underground_trees"}, difficulty = 3,},
 | 
			
		||||
	["df_primordial_items:jungletree_sapling"] = {achievement="dfcaverns_plant_primordial_jungletree",
 | 
			
		||||
		title=S("Plant Primordial Jungle Tree"), icon=make_texture("dfcaverns_jungle_sapling.png"), secret = true, _dfcaverns_achievements={"dfcaverns_plant_all_primordial", "dfcaverns_plant_all_underground_trees"}, difficulty = 3,},
 | 
			
		||||
	["df_primordial_items:mush_sapling"] = {achievement="dfcaverns_plant_primordial_mushroom",
 | 
			
		||||
		title=S("Plant Primordial Mushroom"), icon=make_texture("dfcaverns_mush_sapling.png"), secret = true, _dfcaverns_achievements={"dfcaverns_plant_all_primordial", "dfcaverns_plant_all_underground_trees"}, difficulty = 3,},
 | 
			
		||||
	["df_farming:cave_wheat_seed"] = {achievement="dfcaverns_plant_cave_wheat",
 | 
			
		||||
		title=S("Plant Cave Wheat"), icon=make_texture("dfcaverns_cave_wheat_8.png"), _dfcaverns_achievements={"dfcaverns_plant_all_farmables"}, difficulty = 1,},
 | 
			
		||||
	["df_farming:dimple_cup_seed"] = {achievement="dfcaverns_plant_dimple_cup",
 | 
			
		||||
		title=S("Plant Dimple Cup"), icon=make_texture("dfcaverns_dimple_cup_4.png"), _dfcaverns_achievements={"dfcaverns_plant_all_farmables"}, difficulty = 1,},
 | 
			
		||||
	["df_farming:pig_tail_seed"] = {achievement="dfcaverns_plant_pig_tail",
 | 
			
		||||
		title=S("Plant Pig Tail"), icon=make_texture("dfcaverns_pig_tail_8.png"), _dfcaverns_achievements={"dfcaverns_plant_all_farmables"}, difficulty = 1,},
 | 
			
		||||
	["df_farming:plump_helmet_spawn"] = {achievement="dfcaverns_plant_plump_helmet",
 | 
			
		||||
		title=S("Plant Plump Helmet"), icon=make_texture("dfcaverns_plump_helmet_achievement.png"), _dfcaverns_achievements={"dfcaverns_plant_all_farmables"}, difficulty = 1,},
 | 
			
		||||
	["df_farming:quarry_bush_seed"] = {achievement="dfcaverns_plant_quarry_bush",
 | 
			
		||||
		title=S("Plant Quarry Bush"), icon=make_texture("dfcaverns_quarry_bush_5.png"), _dfcaverns_achievements={"dfcaverns_plant_all_farmables"}, difficulty = 1,},
 | 
			
		||||
	["df_farming:sweet_pod_seed"] = {achievement="dfcaverns_plant_sweet_pod",
 | 
			
		||||
		title=S("Plant Sweet Pod"), icon=make_texture("dfcaverns_sweet_pod_6.png"), _dfcaverns_achievements={"dfcaverns_plant_all_farmables"}, difficulty = 1,},
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
minetest.register_on_placenode(function(pos, newnode, placer, oldnode, itemstack, pointed_thing)
 | 
			
		||||
	local player_name = placer:get_player_name()
 | 
			
		||||
	if player_name == nil then return end
 | 
			
		||||
	local player_awards = awards.player(player_name)
 | 
			
		||||
	local achievement = plant_node_achievements[newnode.name]
 | 
			
		||||
	if not achievement then return end
 | 
			
		||||
	local achievement_name = achievement.achievement
 | 
			
		||||
	if not player_awards.unlocked or player_awards.unlocked[achievement_name] ~= achievement_name then
 | 
			
		||||
		-- all of the growable plants in DFCaverns are timer-based. If you place
 | 
			
		||||
		-- a seedling or seed and the resulting node has a timer running, then
 | 
			
		||||
		-- it's passed the checks to see if it was placed in a growable area.
 | 
			
		||||
		if minetest.get_node_timer(pos):is_started() then
 | 
			
		||||
			awards.unlock(player_name, achievement_name)
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
end)
 | 
			
		||||
 | 
			
		||||
for seed_item, def in pairs(plant_node_achievements) do
 | 
			
		||||
	awards.register_achievement(def.achievement, {
 | 
			
		||||
		title = def.title,
 | 
			
		||||
		description = S("Plant a @1 in a place where it can grow.", minetest.registered_items[seed_item].description),
 | 
			
		||||
		icon = def.icon,
 | 
			
		||||
		secret = def.secret,
 | 
			
		||||
		_dfcaverns_achievements = def._dfcaverns_achievements,
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
awards.register_achievement("dfcaverns_plant_all_upper_trees", {
 | 
			
		||||
	title = S("Fungal Arborist"),
 | 
			
		||||
	description = S("Plant one of every kind of 'tree' found in the caverns above the Sunless Sea."),
 | 
			
		||||
	icon = "dfcaverns_awards_backgroundx32.png^"
 | 
			
		||||
		.."(dfcaverns_awards_cavern_towercapx32.png^dfcaverns_awards_cavern_fungiwoodx32.png^dfcaverns_awards_cavern_goblincapx32.png)^[transformFX"
 | 
			
		||||
		.."^[combine:32x32:16,15="..hoe_texture.."^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
	difficulty = 1 / df_achievements.get_child_achievement_count("dfcaverns_plant_all_upper_trees"),
 | 
			
		||||
	trigger = {
 | 
			
		||||
		type="dfcaverns_achievements",
 | 
			
		||||
		achievement_name="dfcaverns_plant_all_upper_trees",
 | 
			
		||||
		target=df_achievements.get_child_achievement_count("dfcaverns_plant_all_upper_trees"),
 | 
			
		||||
	},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
awards.register_achievement("dfcaverns_plant_all_primordial", {
 | 
			
		||||
	title = S("Primordial Arborist"),
 | 
			
		||||
	description = S("Plant one of every kind of 'tree' from the Primordial caverns."),
 | 
			
		||||
	icon = "dfcaverns_awards_backgroundx32.png^"
 | 
			
		||||
		.."(dfcaverns_awards_cavern_primordial_mushx32.png^dfcaverns_awards_cavern_junglex32.png)^[transformFX"
 | 
			
		||||
		.."^[combine:32x32:16,15="..hoe_texture.."^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
	secret = true,
 | 
			
		||||
	difficulty = 3 / df_achievements.get_child_achievement_count("dfcaverns_plant_all_primordial"),
 | 
			
		||||
	trigger = {
 | 
			
		||||
		type="dfcaverns_achievements",
 | 
			
		||||
		achievement_name="dfcaverns_plant_all_primordial",
 | 
			
		||||
		target=df_achievements.get_child_achievement_count("dfcaverns_plant_all_primordial"),
 | 
			
		||||
	},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
awards.register_achievement("dfcaverns_plant_all_underground_trees", {
 | 
			
		||||
	title = S("Underground Arborist"),
 | 
			
		||||
	description = S("Plant one of every kind of 'tree' found in the caverns beneath the surface."),
 | 
			
		||||
	icon = "dfcaverns_awards_backgroundx32.png^"
 | 
			
		||||
		.."(dfcaverns_awards_cavern_towercapx32.png^dfcaverns_awards_cavern_fungiwoodx32.png^dfcaverns_awards_cavern_goblincapx32.png)^[transformFX"
 | 
			
		||||
		.. "^dfcaverns_awards_cavern_primordial_mushx32.png^dfcaverns_awards_cavern_junglex32.png"
 | 
			
		||||
		.."^[combine:32x32:16,15="..hoe_texture.."^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
	difficulty = 4 / df_achievements.get_child_achievement_count("dfcaverns_plant_all_underground_trees"),
 | 
			
		||||
	trigger = {
 | 
			
		||||
		type="dfcaverns_achievements",
 | 
			
		||||
		achievement_name="dfcaverns_plant_all_underground_trees",
 | 
			
		||||
		target=df_achievements.get_child_achievement_count("dfcaverns_plant_all_underground_trees"),
 | 
			
		||||
	},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
awards.register_achievement("dfcaverns_plant_all_farmables", {
 | 
			
		||||
	title = S("Underground Farmer"),
 | 
			
		||||
	description = S("Plant one of every kind of small farmable plant found in the caverns beneath the surface."),
 | 
			
		||||
	icon = "dfcaverns_awards_backgroundx32.png"
 | 
			
		||||
		.."^[combine:32x32:0,0="..soil_texture
 | 
			
		||||
		.."^[combine:32x32:0,16="..soil_texture
 | 
			
		||||
		.."^[combine:32x32:16,0="..soil_texture
 | 
			
		||||
		.."^[combine:32x32:16,16="..soil_texture
 | 
			
		||||
		.."^[combine:32x32:0,0=dfcaverns_cave_wheat_8.png"
 | 
			
		||||
		.."^[combine:32x32:16,0=dfcaverns_dimple_cup_4.png"
 | 
			
		||||
		.."^[combine:32x32:8,8=dfcaverns_plump_helmet_achievement.png"
 | 
			
		||||
		.."^[combine:32x32:0,16=dfcaverns_sweet_pod_6.png"
 | 
			
		||||
		.."^[combine:32x32:16,16=dfcaverns_quarry_bush_5.png"		
 | 
			
		||||
		.."^[combine:32x32:16,15="..hoe_texture.."^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
	difficulty = 1 / df_achievements.get_child_achievement_count("dfcaverns_plant_all_farmables"),
 | 
			
		||||
	trigger = {
 | 
			
		||||
		type="dfcaverns_achievements",
 | 
			
		||||
		achievement_name="dfcaverns_plant_all_farmables",
 | 
			
		||||
		target=df_achievements.get_child_achievement_count("dfcaverns_plant_all_farmables"),
 | 
			
		||||
	},
 | 
			
		||||
})
 | 
			
		||||
							
								
								
									
										88
									
								
								df_achievements/food.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,88 @@
 | 
			
		||||
local S = minetest.get_translator(minetest.get_current_modname())
 | 
			
		||||
 | 
			
		||||
for itemname, def in pairs(minetest.registered_items) do
 | 
			
		||||
	--"df_farming:"..item_name.."_"..recipe_type.name.."_meal"
 | 
			
		||||
	if string.sub(itemname, 1, 11) == "df_farming:" and string.sub(itemname, -5, -1) == "_meal" then
 | 
			
		||||
		local meal_name = string.sub(itemname, 12, -1)
 | 
			
		||||
		local meal_desc = def.description
 | 
			
		||||
		local image = string.sub(def.inventory_image, 1, -7) .. "32.png"
 | 
			
		||||
	
 | 
			
		||||
		awards.register_achievement("dfcaverns_meal_"..meal_name, {
 | 
			
		||||
			title = S("Eat @1", meal_desc),
 | 
			
		||||
			description = S("One of the many delights that can be crafted only from fungal growths found deep underground."),
 | 
			
		||||
			icon = "dfcaverns_awards_backgroundx32.png^" .. image .. "^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
			trigger = {
 | 
			
		||||
				type = "eat",
 | 
			
		||||
				item = itemname,
 | 
			
		||||
				target = 1
 | 
			
		||||
			},
 | 
			
		||||
			difficulty = 2,
 | 
			
		||||
			_dfcaverns_achievements = {"dfcaverns_gourmand"},
 | 
			
		||||
		})
 | 
			
		||||
	end
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local bread_def = minetest.registered_items["df_farming:cave_bread"]
 | 
			
		||||
awards.register_achievement("dfcaverns_meal_dwarven_bread", {
 | 
			
		||||
	title = S("Eat @1", bread_def.description),
 | 
			
		||||
	description = S("It's a basic staple of the underground, but at least it's not Plump Helmet."),
 | 
			
		||||
	icon = "dfcaverns_awards_backgroundx32.png^dfcaverns_prepared_food13x32.png^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
	trigger = {
 | 
			
		||||
		type = "eat",
 | 
			
		||||
		item = "df_farming:cave_bread",
 | 
			
		||||
		target = 1,
 | 
			
		||||
	},
 | 
			
		||||
	difficulty = 1,
 | 
			
		||||
	_dfcaverns_achievements = {"dfcaverns_gourmand"},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
awards.register_achievement("dfcaverns_gourmand", {
 | 
			
		||||
	title = S("Dwarven Gourmand"),
 | 
			
		||||
	description = S("Eat one of each of the various meals that can be cooked or crafted from underground ingredients."),
 | 
			
		||||
	icon ="dfcaverns_awards_backgroundx32.png^dfcaverns_prepared_food28x32.png^dfcaverns_gourmand_achievement.png^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
	difficulty = 2 / df_achievements.get_child_achievement_count("dfcaverns_gourmand"),
 | 
			
		||||
	trigger = {
 | 
			
		||||
		type="dfcaverns_achievements",
 | 
			
		||||
		achievement_name="dfcaverns_gourmand",
 | 
			
		||||
		target=df_achievements.get_child_achievement_count("dfcaverns_gourmand"),
 | 
			
		||||
	},
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
if minetest.get_modpath("df_primordial_items") then
 | 
			
		||||
	awards.register_achievement("dfcaverns_primordial_fruit", {
 | 
			
		||||
		title = S("Eat a Primordial Fruit"),
 | 
			
		||||
		description = S("Eat one of the strange fruits found only deep underground in the Primordial caverns."),
 | 
			
		||||
		icon ="dfcaverns_awards_backgroundx32.png^dfcaverns_primordial_fruit.png^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
		difficulty = 3,
 | 
			
		||||
		trigger = {
 | 
			
		||||
			type = "eat",
 | 
			
		||||
			item = "df_primordial_items:primordial_fruit",
 | 
			
		||||
			target = 1
 | 
			
		||||
		},
 | 
			
		||||
		secret = true,
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
	awards.register_achievement("dfcaverns_glowtato", {
 | 
			
		||||
		title = S("Eat a Glowtato"),
 | 
			
		||||
		description = S("Slightly less prestigious than the Primordial Fruit, but still rare and exotic compared to surface world fare."),
 | 
			
		||||
		icon ="dfcaverns_awards_backgroundx32.png^dfcaverns_glowtato.png^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
		difficulty = 3,
 | 
			
		||||
		trigger = {
 | 
			
		||||
			type = "eat",
 | 
			
		||||
			item = "df_primordial_items:glowtato",
 | 
			
		||||
			target = 1
 | 
			
		||||
		},
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
-- too mundane compared to the other achievements
 | 
			
		||||
--	awards.register_achievement("dfcaverns_diced_mushroom", {
 | 
			
		||||
--		title = S("Eat Diced Mushroom"),
 | 
			
		||||
--		description = S(""),
 | 
			
		||||
--		icon =,
 | 
			
		||||
--		trigger = {
 | 
			
		||||
--			type = "eat",
 | 
			
		||||
--			item = "df_primordial_items:diced_mushroom",
 | 
			
		||||
--			target = 1
 | 
			
		||||
--		},
 | 
			
		||||
--	})
 | 
			
		||||
end
 | 
			
		||||
							
								
								
									
										102
									
								
								df_achievements/init.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,102 @@
 | 
			
		||||
if not minetest.get_modpath("awards") then
 | 
			
		||||
	minetest.log("warning", "[df_achievements] the df_achievements mod was installed but the [awards] mod was not."
 | 
			
		||||
		.. " df_achievements depends on awards, but it is listed as an optional dependency so that installing the"
 | 
			
		||||
		.. " dfcaverns modpack won't automatically enable it. If you want df_achievements to function please"
 | 
			
		||||
		.. " install awards as well, otherwise you should disable df_achievements.")
 | 
			
		||||
	return
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
df_achievements = {}
 | 
			
		||||
 | 
			
		||||
local old_awards_version = false
 | 
			
		||||
if awards.run_trigger_callbacks then
 | 
			
		||||
	-- older versions of awards crash when attempting to use newer versions of triggers
 | 
			
		||||
	-- this "run_trigger_callbacks" API call is present in those older versions, so using that
 | 
			
		||||
	-- as a fingerprint to discover them
 | 
			
		||||
	old_awards_version = true
 | 
			
		||||
	
 | 
			
		||||
	minetest.register_on_dignode(function(pos, oldnode, digger)
 | 
			
		||||
		-- the old version of awards doesn't handle groups when triggering dug nodes, use this to hack around that
 | 
			
		||||
		local node_name = oldnode.name
 | 
			
		||||
		if minetest.get_item_group(node_name, "dfcaverns_big_crystal") > 0 then
 | 
			
		||||
			awards.unlock(digger:get_player_name(), "dfcaverns_ruby_crystals")
 | 
			
		||||
		elseif minetest.get_item_group(node_name, "dfcaverns_cave_coral") > 0 then
 | 
			
		||||
			awards.unlock(digger:get_player_name(), "dfcaverns_cave_coral")
 | 
			
		||||
		end
 | 
			
		||||
	end)	
 | 
			
		||||
else
 | 
			
		||||
	-- used to track the progress of achievements that are based off of other achievements
 | 
			
		||||
	awards.register_trigger("dfcaverns_achievements", {
 | 
			
		||||
		type="counted_key",
 | 
			
		||||
		progress = "@1/@2", -- awards seems to use a conflicting syntax with internationalization, ick. Avoid words here.
 | 
			
		||||
		get_key = function(self, def)
 | 
			
		||||
			return def.trigger.achievement_name
 | 
			
		||||
		end,
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
local achievement_parents = {}
 | 
			
		||||
df_achievements.get_child_achievement_count = function(parent_achievement)
 | 
			
		||||
	return #achievement_parents[parent_achievement]
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local register_achievement_old = awards.register_achievement
 | 
			
		||||
awards.register_achievement = function(achievement_name, achievement_def, ...)
 | 
			
		||||
	if old_awards_version and achievement_def.trigger and achievement_def.trigger.type=="dfcaverns_achievements" then
 | 
			
		||||
		-- there's a significant difference between how triggers work
 | 
			
		||||
		-- in older versions of the awards mod. The new version of the trigger doesn't
 | 
			
		||||
		-- work with the old. Rather than do a bunch of work to support old versions, strip them out.
 | 
			
		||||
		achievement_def.trigger = nil
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	-- The achievement being registered has "parent" achievements that progress when it is unlocked,
 | 
			
		||||
	-- track that here
 | 
			
		||||
	if achievement_def._dfcaverns_achievements then
 | 
			
		||||
		for _, parent_achievement in pairs(achievement_def._dfcaverns_achievements) do
 | 
			
		||||
			local parent_source_list = achievement_parents[parent_achievement] or {}
 | 
			
		||||
			achievement_parents[parent_achievement] = parent_source_list
 | 
			
		||||
			table.insert(parent_source_list, achievement_name)
 | 
			
		||||
		end
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	register_achievement_old(achievement_name, achievement_def, ...)
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
local modpath = minetest.get_modpath(minetest.get_current_modname())
 | 
			
		||||
 | 
			
		||||
awards.register_on_unlock(function(player_name, def)
 | 
			
		||||
	local def_dfcaverns_achievements = def._dfcaverns_achievements
 | 
			
		||||
	if not def_dfcaverns_achievements then return end
 | 
			
		||||
	local player_awards = awards.player(player_name)
 | 
			
		||||
	if not player_awards then return end	
 | 
			
		||||
	local unlocked = player_awards.unlocked
 | 
			
		||||
	if not unlocked 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
 | 
			
		||||
		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)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
dofile(modpath.."/travel.lua")
 | 
			
		||||
dofile(modpath.."/farming.lua")
 | 
			
		||||
dofile(modpath.."/dig.lua")
 | 
			
		||||
dofile(modpath.."/food.lua")
 | 
			
		||||
dofile(modpath.."/misc.lua")
 | 
			
		||||
 | 
			
		||||
-- not used outside this mod
 | 
			
		||||
df_achievements.test_list = nil
 | 
			
		||||
							
								
								
									
										180
									
								
								df_achievements/locale/template.txt
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,180 @@
 | 
			
		||||
# textdomain: df_achievements
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### dig.lua ###
 | 
			
		||||
 | 
			
		||||
"Collect" Lightseam Stone=
 | 
			
		||||
 | 
			
		||||
Attempt to collect a piece of Lightseam, a strange glowing mineral found deep underground.=
 | 
			
		||||
 | 
			
		||||
Collect Castle Coral=
 | 
			
		||||
Collect Cave Coral=
 | 
			
		||||
Collect Cave Pearls=
 | 
			
		||||
Collect Flawless Mese Crystal Block=
 | 
			
		||||
Collect Giant Red Crystal=
 | 
			
		||||
Collect Giant Webbing=
 | 
			
		||||
Collect Glow Worms=
 | 
			
		||||
Collect Glowing Amethyst=
 | 
			
		||||
Collect Luminous Salt Crystal=
 | 
			
		||||
 | 
			
		||||
Collect a block of glowing amethyst crystal from the Underworld.=
 | 
			
		||||
 | 
			
		||||
Collect a flawless Mese crystal block from the Magma Sea.=
 | 
			
		||||
 | 
			
		||||
Collect a luminous salt crystal from the dry caverns where Bloodthorns live.=
 | 
			
		||||
 | 
			
		||||
Collect a piece of Castle Coral from the Sunless Sea.=
 | 
			
		||||
Collect a piece of Cave Coral from the Sunless Sea.=
 | 
			
		||||
Collect a piece of giant webbing found in a cave.=
 | 
			
		||||
 | 
			
		||||
Collect one of the giant red crystals found in large barren caverns.=
 | 
			
		||||
 | 
			
		||||
Collect some cave pearls from the wall of a cave.=
 | 
			
		||||
Collect various different exotic items from various caverns.=
 | 
			
		||||
Deep Prospector=
 | 
			
		||||
Destroy a Gas Seep=
 | 
			
		||||
 | 
			
		||||
Plug a crack that mine gas is seeping out of to make the caves just a little bit safer.=
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### dig.lua ###
 | 
			
		||||
### food.lua ###
 | 
			
		||||
### misc.lua ###
 | 
			
		||||
 | 
			
		||||
=
 | 
			
		||||
 | 
			
		||||
### farming.lua ###
 | 
			
		||||
 | 
			
		||||
Fungal Arborist=
 | 
			
		||||
Plant @1=
 | 
			
		||||
Plant Black Cap=
 | 
			
		||||
Plant Bloodthorn=
 | 
			
		||||
Plant Cave Wheat=
 | 
			
		||||
Plant Dimple Cup=
 | 
			
		||||
Plant Fungiwood=
 | 
			
		||||
Plant Goblin Cap=
 | 
			
		||||
Plant Pig Tail=
 | 
			
		||||
Plant Plump Helmet=
 | 
			
		||||
Plant Primordial Fern=
 | 
			
		||||
Plant Primordial Jungle Mushroom=
 | 
			
		||||
Plant Primordial Jungle Tree=
 | 
			
		||||
Plant Primordial Mushroom=
 | 
			
		||||
Plant Primordial Mycelium=
 | 
			
		||||
Plant Quarry Bush=
 | 
			
		||||
Plant Spindlestem=
 | 
			
		||||
Plant Spore Tree=
 | 
			
		||||
Plant Sweet Pod=
 | 
			
		||||
Plant Torchspine=
 | 
			
		||||
Plant Tower Cap=
 | 
			
		||||
Plant Tunnel Tube=
 | 
			
		||||
Plant a @1 in a place where it can grow.=
 | 
			
		||||
 | 
			
		||||
Plant one of every kind of 'tree' found in the caverns above the Sunless Sea.=
 | 
			
		||||
 | 
			
		||||
Plant one of every kind of 'tree' found in the caverns beneath the surface.=
 | 
			
		||||
 | 
			
		||||
Plant one of every kind of 'tree' from the Primordial caverns.=
 | 
			
		||||
 | 
			
		||||
Plant one of every kind of small farmable plant found in the caverns beneath the surface.=
 | 
			
		||||
 | 
			
		||||
Primordial Arborist=
 | 
			
		||||
Underground Arborist=
 | 
			
		||||
Underground Farmer=
 | 
			
		||||
 | 
			
		||||
### food.lua ###
 | 
			
		||||
 | 
			
		||||
Dwarven Gourmand=
 | 
			
		||||
Eat @1=
 | 
			
		||||
Eat Diced Mushroom=
 | 
			
		||||
Eat a Glowtato=
 | 
			
		||||
Eat a Primordial Fruit=
 | 
			
		||||
 | 
			
		||||
Eat one of each of the various meals that can be cooked or crafted from underground ingredients.=
 | 
			
		||||
 | 
			
		||||
Eat one of the strange fruits found only deep underground in the Primordial caverns.=
 | 
			
		||||
 | 
			
		||||
It's a basic staple of the underground, but at least it's not Plump Helmet.=
 | 
			
		||||
 | 
			
		||||
One of the many delights that can be crafted only from fungal growths found deep underground.=
 | 
			
		||||
 | 
			
		||||
Slightly less prestigious than the Primordial Fruit, but still rare and exotic compared to surface world fare.=
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### misc.lua ###
 | 
			
		||||
 | 
			
		||||
Activating a puzzle seal has produced a breach in the slade foundations of the world.=
 | 
			
		||||
 | 
			
		||||
Capture an Ice Sprite=
 | 
			
		||||
Decipher the code of the ancients. Do you dare turn the key?=
 | 
			
		||||
Detonate Mine Gas=
 | 
			
		||||
Get Attacked by an Underworld Guardian=
 | 
			
		||||
Loot 100 Ancient Warrior Bones=
 | 
			
		||||
Loot Ancient Warrior Bones=
 | 
			
		||||
Punch Veinstone=
 | 
			
		||||
Punch a vein to hear the heartbeat of the stone.=
 | 
			
		||||
Repair 100 Ancient Lanterns=
 | 
			
		||||
Repair an Ancient Lantern=
 | 
			
		||||
Solve a Puzzle Seal=
 | 
			
		||||
Trigger a Slade Breacher=
 | 
			
		||||
 | 
			
		||||
You may not be able to build new ones, but at least you can get the old ones shining brightly again.=
 | 
			
		||||
 | 
			
		||||
You've captured an ice sprite and placed it in a bottle. It dances and sparkles and sheds light through the frosted glass while making a faint tinkling sound. Pretty.=
 | 
			
		||||
 | 
			
		||||
You've discovered something important about those mysterious slade statues in the Underworld.=
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
### travel.lua ###
 | 
			
		||||
 | 
			
		||||
Discover @1s=
 | 
			
		||||
Discover All Fungal Cavern Types=
 | 
			
		||||
Discover All Overworld Cavern Types=
 | 
			
		||||
Discover All Underground Cavern Types=
 | 
			
		||||
Discover Black Caps=
 | 
			
		||||
Discover Bloodthorns=
 | 
			
		||||
Discover Fungiwood=
 | 
			
		||||
Discover Goblin Caps=
 | 
			
		||||
Discover Spore Trees=
 | 
			
		||||
Discover Tower Caps=
 | 
			
		||||
Discover Tunnel Tubes=
 | 
			
		||||
Discover a Deep Chasm=
 | 
			
		||||
Discover a Deep Sinkhole=
 | 
			
		||||
Discover a Glowing Pit=
 | 
			
		||||
Discover a cavern containing oil deep underground.=
 | 
			
		||||
Discover a cavern where @1s grow in the wild.=
 | 
			
		||||
Discover a cavern where Black Caps grow in the wild.=
 | 
			
		||||
Discover a cavern where Bloodthorns grow in the wild.=
 | 
			
		||||
Discover a cavern where Fungiwoods grow in the wild.=
 | 
			
		||||
Discover a cavern where Goblin Caps grow in the wild.=
 | 
			
		||||
Discover a cavern where Spore Trees grow in the wild.=
 | 
			
		||||
Discover a cavern where Tower Caps grow in the wild.=
 | 
			
		||||
Discover a cavern where Tunnel Tubes grow in the wild.=
 | 
			
		||||
Discover a deep natural sinkhole.=
 | 
			
		||||
Discover a gigantic underground natural chasm.=
 | 
			
		||||
 | 
			
		||||
Discover a glowing pit in the slade foundations of the world.=
 | 
			
		||||
 | 
			
		||||
Discover all Primordial Cavern Types=
 | 
			
		||||
Discover all major kinds of giant cavern environment.=
 | 
			
		||||
 | 
			
		||||
Discover all of the major types of cavern below the foundations of the world.=
 | 
			
		||||
 | 
			
		||||
Discover all of the major types of cavern environments between the Sunless Sea and the foundations of the world.=
 | 
			
		||||
 | 
			
		||||
Discover examples of all of the fungal cavern biomes.=
 | 
			
		||||
Discover the Magma Sea=
 | 
			
		||||
Discover the Oil Sea=
 | 
			
		||||
Discover the Primordial Fungus=
 | 
			
		||||
Discover the Primordial Jungle=
 | 
			
		||||
Discover the Sunless Sea=
 | 
			
		||||
Discover the Underworld=
 | 
			
		||||
 | 
			
		||||
Discover the ancient caverns at the foundations of the world.=
 | 
			
		||||
 | 
			
		||||
Discover the fungus-ridden caverns below the foundations of the world.=
 | 
			
		||||
 | 
			
		||||
Discover the giant caverns to which all water from the surface ultimately drain.=
 | 
			
		||||
 | 
			
		||||
Discover the lost jungles below the foundations of the world.=
 | 
			
		||||
 | 
			
		||||
Discover the sea of magma that volcanoes draw from.=
 | 
			
		||||
							
								
								
									
										103
									
								
								df_achievements/misc.lua
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +1,103 @@
 | 
			
		||||
local S = minetest.get_translator(minetest.get_current_modname())
 | 
			
		||||
 | 
			
		||||
-- misc
 | 
			
		||||
if df_dependencies.node_name_glass_bottle then
 | 
			
		||||
	awards.register_achievement("dfcaverns_captured_ice_sprite", {
 | 
			
		||||
		title = S("Capture an Ice Sprite"),
 | 
			
		||||
		description = S("You've captured an ice sprite and placed it in a bottle. It dances and sparkles and sheds light through the frosted glass while making a faint tinkling sound. Pretty."),
 | 
			
		||||
		icon = "dfcaverns_awards_backgroundx32.png^ice_sprites_bottle.png^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
		difficulty = 2,
 | 
			
		||||
		trigger = {
 | 
			
		||||
			type = "craft",
 | 
			
		||||
			item = "ice_sprites:ice_sprite_bottle",
 | 
			
		||||
			target = 1,
 | 
			
		||||
		},
 | 
			
		||||
	})
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
df_mapitems.on_veinstone_punched = function(pos, node, puncher, pointed_thing)
 | 
			
		||||
	awards.unlock(puncher:get_player_name(), "dfcaverns_punched_veinstone")
 | 
			
		||||
end
 | 
			
		||||
awards.register_achievement("dfcaverns_punched_veinstone", {
 | 
			
		||||
	title = S("Punch Veinstone"),
 | 
			
		||||
	description = S("Punch a vein to hear the heartbeat of the stone."),
 | 
			
		||||
	difficulty = 2,
 | 
			
		||||
	icon = "dfcaverns_awards_backgroundx32.png^((".. df_dependencies.texture_stone .. "^dfcaverns_veins.png)^[resize:32x32)^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
})
 | 
			
		||||
 | 
			
		||||
if minetest.get_modpath("df_underworld_items") then
 | 
			
		||||
 | 
			
		||||
	if minetest.get_modpath("hunter_statue") then
 | 
			
		||||
		hunter_statue.player_punched = function(node_name, pos, player)
 | 
			
		||||
			if node_name ~= "df_underworld_items:hunter_statue" then return end
 | 
			
		||||
			awards.unlock(player:get_player_name(), "dfcaverns_attacked_by_guardian_statue")
 | 
			
		||||
		end
 | 
			
		||||
		awards.register_achievement("dfcaverns_attacked_by_guardian_statue", {
 | 
			
		||||
			title = S("Get Attacked by an Underworld Guardian"),
 | 
			
		||||
			difficulty = 2,
 | 
			
		||||
			description = S("You've discovered something important about those mysterious slade statues in the Underworld."),
 | 
			
		||||
			icon = "dfcaverns_awards_backgroundx32.png^dfcaverns_guardian_achievement.png^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
			secret=true,
 | 
			
		||||
		})
 | 
			
		||||
	end
 | 
			
		||||
 | 
			
		||||
	df_underworld_items.puzzle_seal_solved = function(pos, player)
 | 
			
		||||
		if player == nil then return end
 | 
			
		||||
		awards.unlock(player:get_player_name(), "dfcaverns_solved_puzzle_seal")
 | 
			
		||||
	end 
 | 
			
		||||
	awards.register_achievement("dfcaverns_solved_puzzle_seal", {
 | 
			
		||||
		title = S("Solve a Puzzle Seal"),
 | 
			
		||||
		difficulty = 4,
 | 
			
		||||
		description = S("Decipher the code of the ancients. Do you dare turn the key?"),
 | 
			
		||||
		icon = "dfcaverns_puzzle_seal_solvedx32.png^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
	})
 | 
			
		||||
	
 | 
			
		||||
	df_underworld_items.slade_breacher_triggered = function(pos, player)
 | 
			
		||||
		awards.unlock(player:get_player_name(), "dfcaverns_triggered_slade_breacher")
 | 
			
		||||
	end
 | 
			
		||||
	awards.register_achievement("dfcaverns_triggered_slade_breacher", {
 | 
			
		||||
		title = S("Trigger a Slade Breacher"),
 | 
			
		||||
		difficulty = 1,
 | 
			
		||||
		description = S("Activating a puzzle seal has produced a breach in the slade foundations of the world."),
 | 
			
		||||
		icon = "dfcaverns_puzzle_seal_activex32.png^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
		secret=true,
 | 
			
		||||
	})
 | 
			
		||||
	
 | 
			
		||||
	df_underworld_items.ancient_lantern_fixed = function(pos, player)
 | 
			
		||||
		awards.unlock(player:get_player_name(), "dfcaverns_repaired_lantern")
 | 
			
		||||
	end
 | 
			
		||||
	awards.register_achievement("dfcaverns_repaired_lantern", {
 | 
			
		||||
		title = S("Repair an Ancient Lantern"),
 | 
			
		||||
		difficulty = 2,
 | 
			
		||||
		description = S("You may not be able to build new ones, but at least you can get the old ones shining brightly again."),
 | 
			
		||||
		icon = "dfcaverns_awards_backgroundx32.png^((dfcaverns_slade_brick.png^(" .. df_dependencies.texture_meselamp .. "^[mask:dfcaverns_lantern_mask.png))^[resize:32x32)^dfcaverns_awards_foregroundx32.png",
 | 
			
		||||
		secret=true,
 | 
			
		||||
	})
 | 
			
		||||
 | 
			
		||||
--	awards.register_achievement("dfcaverns_repaired_100_lanterns", {
 | 
			
		||||
--		title = S("Repair 100 Ancient Lanterns"),
 | 
			
		||||
--		description = S(""),
 | 
			
		||||
--		icon =,
 | 
			
		||||
--	})
 | 
			
		||||
 | 
			
		||||
end
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
-- can't think of an easy way to detect these
 | 
			
		||||
--awards.register_achievement("dfcaverns_torch_detonated_mine_gas", {
 | 
			
		||||
--	title = S("Detonate Mine Gas"),
 | 
			
		||||
--	description = S(""),
 | 
			
		||||
--	icon =,
 | 
			
		||||
--})
 | 
			
		||||
 | 
			
		||||
--awards.register_achievement("dfcaverns_looted_underworld_bones", {
 | 
			
		||||
--	title = S("Loot Ancient Warrior Bones"),
 | 
			
		||||
--	description = S(""),
 | 
			
		||||
--	icon =,
 | 
			
		||||
--})
 | 
			
		||||
--
 | 
			
		||||
--awards.register_achievement("dfcaverns_looted_100_underworld_bones", {
 | 
			
		||||
--	title = S("Loot 100 Ancient Warrior Bones"),
 | 
			
		||||
--	description = S(""),
 | 
			
		||||
--	icon =,
 | 
			
		||||
--})
 | 
			
		||||
							
								
								
									
										4
									
								
								df_achievements/mod.conf
									
									
									
									
									
										Normal file
									
								
							
							
						
						@@ -0,0 +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
 | 
			
		||||
							
								
								
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_amethyst_achievement.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 1.8 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_awards_backgroundx32.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 83 B  | 
| 
		 After Width: | Height: | Size: 400 B  | 
| 
		 After Width: | Height: | Size: 676 B  | 
| 
		 After Width: | Height: | Size: 1023 B  | 
							
								
								
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_awards_cavern_blackcapx32.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 140 B  | 
| 
		 After Width: | Height: | Size: 204 B  | 
							
								
								
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_awards_cavern_chasmx32.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 335 B  | 
							
								
								
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_awards_cavern_fungalx32.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 269 B  | 
| 
		 After Width: | Height: | Size: 174 B  | 
| 
		 After Width: | Height: | Size: 201 B  | 
							
								
								
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_awards_cavern_junglex32.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 240 B  | 
							
								
								
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_awards_cavern_lavax32.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 742 B  | 
| 
		 After Width: | Height: | Size: 152 B  | 
							
								
								
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_awards_cavern_oilx32.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 255 B  | 
							
								
								
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_awards_cavern_pitx32.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 249 B  | 
| 
		 After Width: | Height: | Size: 184 B  | 
							
								
								
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_awards_cavern_seax32.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 104 B  | 
| 
		 After Width: | Height: | Size: 154 B  | 
							
								
								
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_awards_cavern_towercapx32.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 190 B  | 
| 
		 After Width: | Height: | Size: 164 B  | 
| 
		 After Width: | Height: | Size: 1.1 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_awards_foregroundx32.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 116 B  | 
| 
		 After Width: | Height: | Size: 1.7 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_bloodthorn_achievement.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 600 B  | 
							
								
								
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_castle_coral_achievement.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 2.2 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_cave_coral_achievement.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 1.9 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_cave_pearls_achievement.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 885 B  | 
							
								
								
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_glowmese_achievement.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 1.7 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_glowstone_achievement.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 2.2 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_gourmand_achievement.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 1.5 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_guardian_achievement.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 1.5 KiB  | 
							
								
								
									
										
											BIN
										
									
								
								df_achievements/textures/dfcaverns_plump_helmet_achievement.png
									
									
									
									
									
										Normal file
									
								
							
							
						
						| 
		 After Width: | Height: | Size: 405 B  | 
| 
		 Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB  | 
| 
		 Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB  | 
| 
		 Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB  | 
| 
		 Before Width: | Height: | Size: 2.5 KiB After Width: | Height: | Size: 2.5 KiB  | 
| 
		 Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB  | 
| 
		 Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB  | 
| 
		 Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB  | 
| 
		 Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB  | 
| 
		 Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB  | 
| 
		 Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB  | 
| 
		 Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB  | 
| 
		 Before Width: | Height: | Size: 2.1 KiB After Width: | Height: | Size: 2.1 KiB  | 
| 
		 Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB  | 
| 
		 Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB  | 
| 
		 Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.4 KiB  | 
| 
		 Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB  | 
| 
		 Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB  | 
| 
		 Before Width: | Height: | Size: 978 B After Width: | Height: | Size: 978 B  | 
| 
		 Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB  | 
| 
		 Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB  | 
| 
		 Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB  | 
| 
		 Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB  | 
| 
		 Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.8 KiB  | 
| 
		 Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB  | 
| 
		 Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 2.2 KiB  | 
| 
		 Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB  | 
| 
		 Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB  | 
| 
		 Before Width: | Height: | Size: 1.1 KiB After Width: | Height: | Size: 1.1 KiB  | 
| 
		 Before Width: | Height: | Size: 1.7 KiB After Width: | Height: | Size: 1.7 KiB  |