adding achievements! Almost all untested yet.
149
df_achievements/dig.lua
Normal file
@ -0,0 +1,149 @@
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
awards.register_achievement("dfcaverns_destroyed_gas_seep", {
|
||||
title = S("Destroy a Gas Seep"),
|
||||
description = S(""),
|
||||
--icon =,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
node = "mine_gas:gas_seep",
|
||||
target = 1
|
||||
},
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_giant_web", {
|
||||
title = S("Collect Giant Webbing"),
|
||||
description = S(""),
|
||||
--icon =,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
node = "big_webs:webbing",
|
||||
target = 1
|
||||
},
|
||||
})
|
||||
|
||||
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(""),
|
||||
--icon =,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
node = "df_mapitems:cave_pearls",
|
||||
target = 1
|
||||
},
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_castle_coral", {
|
||||
title = S("Collect Castle Coral"),
|
||||
description = S(""),
|
||||
--icon =,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
node = "df_mapitems:castle_coral",
|
||||
target = 1
|
||||
},
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_ruby_crystals", {
|
||||
title = S("Collect Giant Red Crystal"),
|
||||
description = S(""),
|
||||
--icon =,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
node = "group:dfcaverns_big_crystal",
|
||||
target = 1
|
||||
},
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_cave_coral", {
|
||||
title = S("Collect Cave Coral"),
|
||||
description = S(""),
|
||||
--icon =,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
node = "group:dfcaverns_cave_coral",
|
||||
target = 1
|
||||
},
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_flawless_mese", {
|
||||
title = S("Collect Flawless Mese Crystal Block"),
|
||||
description = S(""),
|
||||
--icon =,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
node = "df_mapitems:glow_mese",
|
||||
target = 1
|
||||
},
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_luminous_salt", {
|
||||
title = S("Collect Luminous Salt Crystal"),
|
||||
description = S(""),
|
||||
--icon =,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
node = "df_mapitems:salt_crystal",
|
||||
target = 1
|
||||
},
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_glow_amethyst", {
|
||||
title = S("Collect Glowing Amethyst"),
|
||||
description = S(""),
|
||||
--icon =,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
node = "df_underworld_items:glow_amethyst",
|
||||
target = 1
|
||||
},
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_glow_stone", {
|
||||
title = S('"Collect" Glow Stone'),
|
||||
description = S(""),
|
||||
--icon =,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
node = "df_underworld_items:glowstone",
|
||||
target = 1
|
||||
},
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_prospector", {
|
||||
title = S("Deep Prospector"),
|
||||
description = S(""),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
|
||||
------------------------------------------------------------------
|
||||
|
||||
--"dfcaverns_prospector"
|
||||
local prospector_achievements = {"dfcaverns_castle_coral", "dfcaverns_cave_coral", "dfcaverns_cave_pearls", "dfcaverns_flawless_mese", "dfcaverns_glow_amethyst", "dfcaverns_glow_stone", "dfcaverns_luminous_salt", "dfcaverns_ruby_crystals"}
|
||||
|
||||
local test_list = df_achievements.test_list
|
||||
|
||||
-- name is the player name
|
||||
-- def is the award def.
|
||||
awards.register_on_unlock(function(player_name, def)
|
||||
local player_awards = awards.player(player_name)
|
||||
if not player_awards or not player_awards.unlocked then
|
||||
return
|
||||
end
|
||||
local unlocked = player_awards.unlocked
|
||||
test_list(player_name, "dfcaverns_prospector", unlocked, prospector_achievements)
|
||||
end)
|
104
df_achievements/farming.lua
Normal file
@ -0,0 +1,104 @@
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
local nethercap_name = df_dependencies.nethercap_name
|
||||
|
||||
-- forestry
|
||||
|
||||
local plant_node_achievements =
|
||||
{
|
||||
["df_trees:black_cap_sapling"] = {achievement="dfcaverns_plant_black_cap", title=S("Plant Black Cap"), desc=S(""), icon=""},
|
||||
["df_trees:fungiwood_sapling"] = {achievement="dfcaverns_plant_fungiwood", title=S("Plant Fungiwood"), desc=S(""), icon=""},
|
||||
["df_trees:goblin_cap_sapling"] = {achievement="dfcaverns_plant_goblin_cap", title=S("Plant Goblin Cap"), desc=S(""), icon=""},
|
||||
["df_trees:nether_cap_sapling"] = {achievement="dfcaverns_plant_nethercap", title=S("Plant @1", nethercap_name), desc=S(""), icon=""},
|
||||
["df_trees:spore_tree_sapling"] = {achievement="dfcaverns_plant_spore_tree", title=S("Plant Spore Tree"), desc=S(""), icon=""},
|
||||
["df_trees:tower_cap_sapling"] = {achievement="dfcaverns_plant_tower_cap", title=S("Plant Tower Cap"), desc=S(""), icon=""},
|
||||
["df_trees:tunnel_tube_sapling"] = {achievement="dfcaverns_plant_tunnel_tube", title=S("Plant Tunnel Tube"), desc=S(""), icon=""},
|
||||
["df_trees:torchspine_ember"] = {achievement="dfcaverns_plant_torchspine", title=S("Plant Torchspine"), desc=S(""), icon=""},
|
||||
["df_trees:spindlestem_seedling"] = {achievement="dfcaverns_plant_spindlestem", title=S("Plant Spindlestem"), desc=S(""), icon=""},
|
||||
["df_trees:blood_thorn"] = {achievement="dfcaverns_plant_bloodthorn", title=S("Plant Bloodthorn"), desc=S(""), icon=""},
|
||||
["df_primordial_items:giant_hypha_apical_meristem"] = {achievement="dfcaverns_plant_giant_mycelium", title=S("Plant Primordial Mycelium"), desc=S(""), icon=""},
|
||||
["df_primordial_items:fern_sapling"] = {achievement="dfcaverns_plant_primordial_fern", title=S("Plant Primordial Fern"), desc=S(""), icon=""},
|
||||
["df_primordial_items:jungle_mushroom_sapling"] = {achievement="dfcaverns_plant_primordial_jungle_mushroom", title=S("Plant Primordial Jungle Mushroom"), desc=S(""), icon=""},
|
||||
["df_primordial_items:jungletree_sapling"] = {achievement="dfcaverns_plant_primordial_jungletree", title=S("Plant Primordial Jungle Tree"), desc=S(""), icon=""},
|
||||
["df_primordial_items:mush_sapling"] = {achievement="dfcaverns_plant_primordial_mushroom", title=S("Plant Primordial Mushroom"), desc=S(""), icon=""},
|
||||
["df_farming:cave_wheat_seed"] = {achievement="dfcaverns_plant_cave_wheat", title=S("Plant Cave Wheat"), desc=S(""), icon=""},
|
||||
["df_farming:dimple_cup_seed"] = {achievement="dfcaverns_plant_dimple_cup", title=S("Plant Dimple Cup"), desc=S(""), icon=""},
|
||||
["df_farming:pig_tail_seed"] = {achievement="dfcaverns_plant_pig_tail", title=S("Plant Pig Tail"), desc=S(""), icon=""},
|
||||
["df_farming:plump_helmet_spawn"] = {achievement="dfcaverns_plant_plump_helmet", title=S("Plant Plump Helmet"), desc=S(""), icon=""},
|
||||
["df_farming:quarry_bush_seed"] = {achievement="dfcaverns_plant_quarry_bush", title=S("Plant Quarry Bush"), desc=S(""), icon=""},
|
||||
["df_farming:sweet_pod_seed"] = {achievement="dfcaverns_plant_sweet_pod", title=S("Plant Sweet Pod"), desc=S(""), icon=""},
|
||||
}
|
||||
|
||||
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 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)
|
||||
|
||||
--"dfcaverns_plant_all_farmables",
|
||||
local all_farmable_achievements = {"dfcaverns_plant_cave_wheat", "dfcaverns_plant_dimple_cup", "dfcaverns_plant_pig_tail", "dfcaverns_plant_plump_helmet", "dfcaverns_plant_quarry_bush", "dfcaverns_plant_sweet_pod",}
|
||||
--"dfcaverns_plant_all_primordial",
|
||||
local all_primordial_achievements = {"dfcaverns_plant_giant_mycelium", "dfcaverns_plant_primordial_fern", "dfcaverns_plant_primordial_jungle_mushroom", "dfcaverns_plant_primordial_jungletree", "dfcaverns_plant_primordial_mushroom",}
|
||||
--"dfcaverns_plant_all_underground_trees",
|
||||
local all_underground_trees_achievements = {"dfcaverns_plant_all_upper_trees", "dfcaverns_plant_all_primordial"}
|
||||
--"dfcaverns_plant_all_upper_trees",
|
||||
local all_upper_trees = {"dfcaverns_plant_black_cap", "dfcaverns_plant_fungiwood", "dfcaverns_plant_goblin_cap", "dfcaverns_plant_nethercap", "dfcaverns_plant_spore_tree", "dfcaverns_plant_tower_cap", "dfcaverns_plant_tunnel_tube", "dfcaverns_plant_torchspine","dfcaverns_plant_spindlestem"}
|
||||
|
||||
local test_list = df_achievements.test_list
|
||||
|
||||
-- name is the player name
|
||||
-- def is the award def.
|
||||
awards.register_on_unlock(function(player_name, def)
|
||||
local player_awards = awards.player(player_name)
|
||||
if not player_awards or not player_awards.unlocked then
|
||||
return
|
||||
end
|
||||
local unlocked = player_awards.unlocked
|
||||
test_list(player_name, "dfcaverns_plant_all_farmables", unlocked, all_farmable_achievements)
|
||||
test_list(player_name, "dfcaverns_plant_all_primordial", unlocked, all_primordial_achievements)
|
||||
test_list(player_name, "dfcaverns_plant_all_underground_trees", unlocked, all_underground_trees_achievements)
|
||||
test_list(player_name, "dfcaverns_plant_all_upper_trees", unlocked, all_upper_trees)
|
||||
end)
|
||||
|
||||
for achievement, def in pairs(plant_node_achievements) do
|
||||
awards.register_achievement(achievement, {
|
||||
title = def.title,
|
||||
description = def.desc,
|
||||
--icon = def.icon,
|
||||
})
|
||||
end
|
||||
|
||||
awards.register_achievement("dfcaverns_plant_all_upper_trees", {
|
||||
title = S("Plant All Fungal Tree Types"),
|
||||
description = S(""),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_plant_all_primordial", {
|
||||
title = S("Plant All Primordial Tree Types"),
|
||||
description = S(""),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_plant_all_underground_trees", {
|
||||
title = S("Plant All Underground Tree Types"),
|
||||
description = S(""),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_plant_all_farmables", {
|
||||
title = S("Plant All Farmable Underground Plants"),
|
||||
description = S(""),
|
||||
--icon =,
|
||||
|
||||
})
|
77
df_achievements/food.lua
Normal file
@ -0,0 +1,77 @@
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
local all_meals = {}
|
||||
|
||||
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 = image,
|
||||
trigger = {
|
||||
type = "eat",
|
||||
item = itemname,
|
||||
target = 1
|
||||
},
|
||||
})
|
||||
table.insert(all_meals, "dfcaverns_meal_"..meal_name)
|
||||
end
|
||||
end
|
||||
|
||||
local test_list = df_achievements.test_list
|
||||
-- name is the player name
|
||||
-- def is the award def.
|
||||
awards.register_on_unlock(function(player_name, def)
|
||||
local player_awards = awards.player(player_name)
|
||||
if not player_awards or not player_awards.unlocked then
|
||||
return
|
||||
end
|
||||
local unlocked = player_awards.unlocked
|
||||
test_list(player_name, "dfcaverns_gourmand", unlocked, all_meals)
|
||||
end)
|
||||
|
||||
awards.register_achievement("dfcaverns_gourmand", {
|
||||
title = S("Subterranean Gourmand"),
|
||||
description = S("Eat one of each of the various meals that can be cooked from underground ingredients."),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
if minetest.get_modpath("df_primordial_items") then
|
||||
awards.register_achievement("dfcaverns_primordial_fruit", {
|
||||
title = S("Eat a Primordial Fruit"),
|
||||
description = S(""),
|
||||
--icon =,
|
||||
trigger = {
|
||||
type = "eat",
|
||||
item = "df_primordial_items:primordial_fruit",
|
||||
target = 1
|
||||
},
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_glowtato", {
|
||||
title = S("Eat a Glowtato"),
|
||||
description = S(""),
|
||||
--icon =,
|
||||
trigger = {
|
||||
type = "eat",
|
||||
item = "df_primordial_items:glowtato",
|
||||
target = 1
|
||||
},
|
||||
})
|
||||
|
||||
-- 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
|
32
df_achievements/init.lua
Normal file
@ -0,0 +1,32 @@
|
||||
df_achievements = {}
|
||||
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
local nethercap_name = df_dependencies.nethercap_name
|
||||
|
||||
local modpath = minetest.get_modpath(minetest.get_current_modname())
|
||||
|
||||
-- used in a few places in this mod
|
||||
df_achievements.test_list = function(player_name, target_achievement, unlocked, target_list)
|
||||
if unlocked[target_achievement] == target_achievement then
|
||||
return
|
||||
end
|
||||
local none_missing = true
|
||||
for _, achievement in pairs(target_list) do
|
||||
if unlocked[achievement] ~= achievement then
|
||||
none_missing = false
|
||||
break
|
||||
end
|
||||
end
|
||||
if none_missing then
|
||||
awards.unlock(player_name, target_achievement)
|
||||
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
|
116
df_achievements/locale/template.txt
Normal file
@ -0,0 +1,116 @@
|
||||
# textdomain: df_achievements
|
||||
|
||||
|
||||
### farming.lua ###
|
||||
|
||||
Plant @1=
|
||||
Plant All Farmable Underground Plants=
|
||||
Plant All Fungal Tree Types=
|
||||
Plant All Primordial Tree Types=
|
||||
Plant All Underground Tree Types=
|
||||
Plant Black Cap=
|
||||
Plant Blood Thorn=
|
||||
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=
|
||||
|
||||
### farming.lua ###
|
||||
### init.lua ###
|
||||
|
||||
=
|
||||
|
||||
### init.lua ###
|
||||
|
||||
Capture an Ice Sprite=
|
||||
Collect Cave Pearls=
|
||||
Collect Giant Crystals=
|
||||
Destroy a Gas Seep=
|
||||
Detonate Mine Gas=
|
||||
Discover Castle Coral=
|
||||
Discover Giant Webbing=
|
||||
Get Attacked by an Underworld Guardian=
|
||||
Loot Ancient Warrior Bones=
|
||||
Punch Veinstone=
|
||||
Repair 100 Ancient Lanterns=
|
||||
Repair an Ancient Lantern=
|
||||
Solve a Puzzle Seal=
|
||||
Trigger a Slade Breacher=
|
||||
|
||||
You've captured an ice sprite and placed it in a bottle. It dances and sparkles and sheds light through the frosted glass. Pretty.=
|
||||
|
||||
|
||||
### 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 Underworld Ruins=
|
||||
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 above the foundations of the world.=
|
||||
|
||||
Discover ancient ruins made of slade in the Underworld.=
|
||||
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.=
|
||||
Got Beneath the Slade=
|
||||
|
||||
Somehow get beneath the impenetrable layer of slade that borders the Underworld.=
|
||||
|
95
df_achievements/misc.lua
Normal file
@ -0,0 +1,95 @@
|
||||
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 =,
|
||||
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(""),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
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"),
|
||||
description = S(""),
|
||||
--icon =,
|
||||
})
|
||||
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"),
|
||||
description = S(""),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
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"),
|
||||
description = S(""),
|
||||
--icon =,
|
||||
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"),
|
||||
description = S(""),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
-- 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=awards, df_caverns, df_trees, df_farming, df_mapitems, df_dependencies, pit_caves
|
||||
optional_depends=df_underworld_items, hunter_statue
|
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 |
Before Width: | Height: | Size: 1.0 KiB After Width: | Height: | Size: 1.0 KiB |
Before Width: | Height: | Size: 2.0 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 1.9 KiB After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 1.3 KiB After Width: | Height: | Size: 1.3 KiB |
293
df_achievements/travel.lua
Normal file
@ -0,0 +1,293 @@
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
local nethercap_name = df_dependencies.nethercap_name
|
||||
|
||||
local lava_node = df_dependencies.node_name_lava_source
|
||||
|
||||
local node_types = {}
|
||||
node_types.fungiwood = {"df_trees:fungiwood", "df_trees:fungiwood_shelf"}
|
||||
node_types.towercap = {"df_trees:tower_cap_stem", "df_trees:tower_cap_gills", "df_trees:tower_cap"}
|
||||
node_types.goblincap = {"df_trees:goblin_cap_stem", "df_trees:goblin_cap", "df_trees:goblin_cap_gills"}
|
||||
node_types.sporetree = {"df_trees:spore_tree", "df_trees:spore_tree_hyphae", "df_trees:spore_tree_fruiting_body"}
|
||||
node_types.tunneltube = {"df_trees:tunnel_tube", "df_trees:tunnel_tube_slant_bottom", "df_trees:tunnel_tube_slant_top", "df_trees:tunnel_tube_slant_full", "df_trees:tunnel_tube_fruiting_body"}
|
||||
node_types.nethercap = {"df_mapitems:icicle_1", "df_mapitems:icicle_2", "df_mapitems:icicle_3", "df_mapitems:icicle_4", "ice_sprites:ice_sprite", "ice_sprites:hidden_ice_sprite", "df_trees:nether_cap", "df_trees:nether_cap_gills", "df_trees:nether_cap_stem"}
|
||||
node_types.bloodthorn = {"df_trees:blood_thorn", "df_trees:blood_thorn_spike"}
|
||||
node_types.blackcap = {"df_trees:black_cap", "df_trees:black_cap_stem", "df_trees:black_cap_gills", "df_trees:torchspine_1", "df_trees:torchspine_1_lit", "df_trees:torchspine_2", "df_trees:torchspine_3", "df_trees:torchspine_4"}
|
||||
node_types.primordial_jungle = {"df_primordial_items:giant_fern_leaves", "df_primordial_items:giant_fern_tree", "df_primordial_items:giant_fern_tree_slant_bottom", "df_primordial_items:giant_fern_tree_slant_full", "df_primordial_items:giant_fern_tree_slant_top", "df_primordial_items:jungle_leaves", "df_primordial_items:jungle_leaves_glowing", "df_primordial_items:jungle_mushroom_cap_1", "df_primordial_items:jungle_mushroom_cap_2", "df_primordial_items:jungle_mushroom_trunk", "df_primordial_items:jungle_tree", "df_primordial_items:jungle_tree_glowing", "df_primordial_items:jungle_tree_mossy", "df_primordial_items:packed_roots", "df_primordial_items:plant_matter", }
|
||||
node_types.primordial_fungus = {"df_primordial_items:giant_hypha_root", "df_primordial_items:giant_hypha", "df_primordial_items:mushroom_cap", "df_primordial_items:mushroom_gills", "df_primordial_items:mushroom_gills_glowing", "df_primordial_items:mushroom_trunk", "df_primordial_items:glownode", "df_primordial_items:glownode_stalk",}
|
||||
node_types.other = {"oil:oil", "df_underworld_items:slade", lava_node, "df_underworld_items:glow_amethyst"}
|
||||
|
||||
local all_nodes = {}
|
||||
for _, nodes in pairs(node_types) do
|
||||
for _, node in pairs(nodes) do
|
||||
table.insert(all_nodes, node)
|
||||
end
|
||||
end
|
||||
|
||||
local radius = 6
|
||||
local get_player_data = function(player)
|
||||
-- get head level node at player position
|
||||
local pos = player:get_pos()
|
||||
if not pos then return end
|
||||
|
||||
-- get all set nodes around player
|
||||
local ps, cn = minetest.find_nodes_in_area(
|
||||
{x = pos.x - radius, y = pos.y - radius, z = pos.z - radius},
|
||||
{x = pos.x + radius, y = pos.y + radius, z = pos.z + radius}, all_nodes)
|
||||
|
||||
return {
|
||||
pos = pos,
|
||||
biome = df_caverns.get_biome(pos) or "",
|
||||
totals = cn
|
||||
}
|
||||
end
|
||||
|
||||
local check_nodes = function(nodes, totals)
|
||||
for _, node in pairs(nodes) do
|
||||
if (totals[node] or 0) > 1 then
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local timer = 0
|
||||
minetest.register_globalstep(function(dtime)
|
||||
timer = timer + dtime
|
||||
if timer < 10 then return end
|
||||
timer = 0
|
||||
|
||||
local player_name
|
||||
local player_awards
|
||||
local player_data
|
||||
|
||||
-- loop through players
|
||||
for _, player in pairs(minetest.get_connected_players()) do
|
||||
player_name = player:get_player_name()
|
||||
player_awards = awards.player(player_name)
|
||||
if player_awards.unlocked["dfcaverns_visit_all_caverns"] ~= "dfcaverns_visit_all_caverns" or
|
||||
player_awards.unlocked["dfcaverns_visit_glowing_pit"] ~= "dfcaverns_visit_glowing_pit" or
|
||||
player_awards.unlocked["dfcaverns_visit_underworld_ruins"] ~= "dfcaverns_visit_underworld_ruins" then
|
||||
player_data = get_player_data(player)
|
||||
biome = player_data.biome
|
||||
totals = player_data.totals
|
||||
|
||||
if biome == "towercap" and check_nodes(node_types.towercap, totals) then
|
||||
awards.unlock(player_name, "dfcaverns_visit_tower_cap")
|
||||
elseif biome == "fungiwood" and check_nodes(node_types.fungiwood, totals) then
|
||||
awards.unlock(player_name, "dfcaverns_visit_fungiwood")
|
||||
elseif biome == "goblincap" and check_nodes(node_types.goblincap, totals) then
|
||||
awards.unlock(player_name, "dfcaverns_visit_goblin_cap")
|
||||
elseif biome == "sporetree" and check_nodes(node_types.sporetree, totals) then
|
||||
awards.unlock(player_name, "dfcaverns_visit_spore_tree")
|
||||
elseif biome == "tunneltube" and check_nodes(node_types.tunneltube, totals) then
|
||||
awards.unlock(player_name, "dfcaverns_visit_tunnel_tube")
|
||||
elseif biome == "nethercap" and check_nodes(node_types.nethercap, totals) then
|
||||
awards.unlock(player_name, "dfcaverns_visit_nethercap")
|
||||
elseif biome == "bloodthorn" and check_nodes(node_types.bloodthorn, totals) then
|
||||
awards.unlock(player_name, "dfcaverns_visit_blood_thorn")
|
||||
elseif biome == "blackcap" and check_nodes(node_types.blackcap, totals) then
|
||||
awards.unlock(player_name, "dfcaverns_visit_black_cap")
|
||||
elseif (biome == "fungispore" and (check_nodes(node_types.fungiwood, totals) or check_nodes(node_types.sporetree, totals))) or
|
||||
(biome == "towergoblin" and (check_nodes(node_types.towercap, totals) or check_nodes(node_types.goblincap, totals)))
|
||||
then
|
||||
awards.unlock(player_name, "dfcaverns_visit_sunless_sea")
|
||||
elseif biome == "oil_sea" and (totals["oil:oil"] or 0) > 1 then
|
||||
awards.unlock(player_name, "dfcaverns_visit_oil_sea")
|
||||
elseif biome == "underworld" then
|
||||
if (totals["df_underworld_items:slade"] or 0) > 1 then
|
||||
awards.unlock(player_name, "dfcaverns_visit_underworld")
|
||||
end
|
||||
if (totals["df_underworld_items:glow_amethyst"] or 0) > 1 and
|
||||
player_awards.unlocked["dfcaverns_visit_glowing_pit"] ~= "dfcaverns_visit_glowing_pit" then
|
||||
local player_pos = player:get_pos()
|
||||
local pit = df_caverns.get_nearest_glowing_pit(player_pos)
|
||||
pit.location.y = player_pos.y
|
||||
if vector.distance(player_pos, pit.location) <= pit.radius+10 then
|
||||
awards.unlock(player_name, "dfcaverns_visit_glowing_pit")
|
||||
end
|
||||
end
|
||||
elseif biome == "lava_sea" and (totals[lava_node] or 0) > 1 then
|
||||
awards.unlock(player_name, "dfcaverns_visit_lava_sea")
|
||||
elseif biome == "primordial fungus" and check_nodes(node_types.primordial_fungus, totals) then
|
||||
awards.unlock(player_name, "dfcaverns_visit_primordial_fungal")
|
||||
elseif biome == "primordial jungle" and check_nodes(node_types.primordial_jungle, totals) then
|
||||
awards.unlock(player_name, "dfcaverns_visit_primordial_jungle")
|
||||
elseif biome == "chasm" then
|
||||
awards.unlock(player_name, "dfcaverns_visit_chasm")
|
||||
end
|
||||
end
|
||||
if player_awards.unlocked["dfcaverns_visit_pit"] ~= "dfcaverns_visit_pit" then
|
||||
local pos = player:get_pos()
|
||||
local pos_y = pos.y
|
||||
if pos_y < -30 then -- ignore pits when near the surface
|
||||
local nearest_pit = pit_caves.get_nearest_pit(pos)
|
||||
nearest_pit.location.y = pos_y -- for the distance check
|
||||
if pos_y >= nearest_pit.depth and pos_y <= nearest_pit.top and vector.distance(pos, nearest_pit.location) <= 30 then
|
||||
awards.unlock(player_name, "dfcaverns_visit_pit")
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
local upper_biome_achievements = {"dfcaverns_visit_tower_cap", "dfcaverns_visit_fungiwood", "dfcaverns_visit_goblin_cap", "dfcaverns_visit_spore_tree", "dfcaverns_visit_tunnel_tube", "dfcaverns_visit_nethercap", "dfcaverns_visit_blood_thorn", "dfcaverns_visit_black_cap", "dfcaverns_visit_sunless_sea"}
|
||||
|
||||
local middle_biome_achievements = {"dfcaverns_visit_oil_sea", "dfcaverns_visit_lava_sea", "dfcaverns_visit_underworld"}
|
||||
|
||||
local primordial_biome_achievements = {"dfcaverns_visit_primordial_jungle", "dfcaverns_visit_primordial_fungal"}
|
||||
|
||||
local all_caverns = {"dfcaverns_visit_all_upper_biomes", "dfcaverns_visit_all_middle_biomes", "dfcaverns_visit_all_primordial_biomes", "dfcaverns_visit_chasm", "dfcaverns_visit_pit"}
|
||||
|
||||
local test_list = df_achievements.test_list
|
||||
|
||||
-- name is the player name
|
||||
-- def is the award def.
|
||||
awards.register_on_unlock(function(player_name, def)
|
||||
local player_awards = awards.player(player_name)
|
||||
if not player_awards or not player_awards.unlocked then
|
||||
return
|
||||
end
|
||||
local unlocked = player_awards.unlocked
|
||||
test_list(player_name, "dfcaverns_visit_all_upper_biomes", unlocked, upper_biome_achievements)
|
||||
test_list(player_name, "dfcaverns_visit_all_middle_biomes", unlocked, middle_biome_achievements)
|
||||
test_list(player_name, "dfcaverns_visit_all_primordial_biomes", unlocked, primordial_biome_achievements)
|
||||
test_list(player_name, "dfcaverns_visit_all_caverns", unlocked, all_caverns)
|
||||
end)
|
||||
|
||||
|
||||
--awards.unlock(name, award)
|
||||
-- local data = awards.players[name]
|
||||
-- local awdef = awards.def[award]
|
||||
-- data.unlocked[award] == award
|
||||
|
||||
-- travelogue
|
||||
|
||||
--biomes
|
||||
|
||||
awards.register_achievement("dfcaverns_visit_tower_cap", {
|
||||
title = S("Discover Tower Caps"),
|
||||
description = S("Discover a cavern where Tower Caps grow in the wild."),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_visit_fungiwood", {
|
||||
title = S("Discover Fungiwood"),
|
||||
description = S("Discover a cavern where Fungiwoods grow in the wild."),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_visit_goblin_cap", {
|
||||
title = S("Discover Goblin Caps"),
|
||||
description = S("Discover a cavern where Goblin Caps grow in the wild."),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_visit_spore_tree", {
|
||||
title = S("Discover Spore Trees"),
|
||||
description = S("Discover a cavern where Spore Trees grow in the wild."),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_visit_tunnel_tube", {
|
||||
title = S("Discover Tunnel Tubes"),
|
||||
description = S("Discover a cavern where Tunnel Tubes grow in the wild."),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_visit_nethercap", {
|
||||
title = S("Discover @1s", nethercap_name),
|
||||
description = S("Discover a cavern where @1s grow in the wild.", nethercap_name),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_visit_blood_thorn", {
|
||||
title = S("Discover Bloodthorns"),
|
||||
description = S("Discover a cavern where Bloodthorns grow in the wild."),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_visit_black_cap", {
|
||||
title = S("Discover Black Caps"),
|
||||
description = S("Discover a cavern where Black Caps grow in the wild."),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_visit_sunless_sea", {
|
||||
title = S("Discover the Sunless Sea"),
|
||||
description = S("Discover the giant caverns to which all water from the surface ultimately drain."),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_visit_all_upper_biomes", {
|
||||
title = S("Discover All Fungal Cavern Types"),
|
||||
description = S("Discover examples of all of the fungal cavern biomes."),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_visit_oil_sea", {
|
||||
title = S("Discover the Oil Sea"),
|
||||
description = S("Discover a cavern containing oil deep underground."),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_visit_lava_sea", {
|
||||
title = S("Discover the Magma Sea"),
|
||||
description = S("Discover the sea of magma that volcanoes draw from."),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_visit_underworld", {
|
||||
title = S("Discover the Underworld"),
|
||||
description = S("Discover the ancient caverns at the foundations of the world."),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_visit_all_middle_biomes", {
|
||||
title = S("Discover All Overworld Cavern Types"),
|
||||
description = S("Discover all of the major types of cavern environments between the Sunless Sea and the foundations of the world."),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_visit_primordial_jungle", {
|
||||
title = S("Discover the Primordial Jungle"),
|
||||
description = S("Discover the lost jungles below the foundations of the world."),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_visit_primordial_fungal", {
|
||||
title = S("Discover the Primordial Fungus"),
|
||||
description = S("Discover the fungus-ridden caverns below the foundations of the world."),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_visit_all_primordial_biomes", {
|
||||
title = S("Discover all Primordial Cavern Types"),
|
||||
description = S("Discover all of the major types of cavern below the foundations of the world."),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_visit_chasm", {
|
||||
title = S("Discover a Deep Chasm"),
|
||||
description = S("Discover a gigantic underground natural chasm."),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_visit_pit", {
|
||||
title = S("Discover a Deep Sinkhole"),
|
||||
description = S("Discover a deep natural sinkhole."),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
awards.register_achievement("dfcaverns_visit_all_caverns", {
|
||||
title = S("Discover All Underground Cavern Types"),
|
||||
description = S("Discover all major kinds of giant cavern environment."),
|
||||
--icon =,
|
||||
})
|
||||
|
||||
-- other places
|
||||
|
||||
awards.register_achievement("dfcaverns_visit_glowing_pit", {
|
||||
title = S("Discover a Glowing Pit"),
|
||||
description = S("Discover a glowing pit in the slade foundations of the world."),
|
||||
--icon =,
|
||||
})
|
@ -310,6 +310,8 @@ local get_pit = function(pos)
|
||||
return {location = location, radius = radius, variance = variance, depth = depth}
|
||||
end
|
||||
|
||||
df_caverns.get_nearest_glowing_pit = get_pit
|
||||
|
||||
local perlin_pit = {
|
||||
offset = 0,
|
||||
scale = 1,
|
||||
|
BIN
df_mapitems/sounds/dfcaverns_slow_heartbeat.ogg
Normal file
@ -1,3 +1,5 @@
|
||||
dfcaverns_squish.1.ogg - from https://freesound.org/people/DrMinky/sounds/167074/ by DrMinky under Creative Commons BY 3.0
|
||||
dfcaverns_squish.2.ogg - from https://freesound.org/people/DrMinky/sounds/167075/ by DrMinky under Creative Commons BY 3.0
|
||||
dfcaverns_squish.3.ogg - from https://freesound.org/people/DrMinky/sounds/167073/ by DrMinky under Creative Commons BY 3.0
|
||||
dfcaverns_squish.3.ogg - from https://freesound.org/people/DrMinky/sounds/167073/ by DrMinky under Creative Commons BY 3.0
|
||||
|
||||
slow heartbeat - https://freesound.org/people/daandraait/sounds/249716/ under CC0
|
@ -1,5 +1,9 @@
|
||||
local S = df_mapitems.S
|
||||
|
||||
-- overridden to trigger an achievement, without making achievements a dependency of this mod
|
||||
df_mapitems.on_veinstone_punched = function()
|
||||
end
|
||||
|
||||
minetest.register_node("df_mapitems:veinstone", {
|
||||
description = S("Veinstone"),
|
||||
_doc_items_longdesc = df_mapitems.doc.veinstone_desc,
|
||||
@ -15,6 +19,8 @@ minetest.register_node("df_mapitems:veinstone", {
|
||||
minetest.node_punch(pos, node, puncher, pointed_thing)
|
||||
minetest.swap_node(pos, {name="df_mapitems:veinstone_pulse"})
|
||||
minetest.get_node_timer(pos):start(2)
|
||||
minetest.sound_play({pos = pos}, {name="dfcaverns_slow_heartbeat", gain=0.5})
|
||||
df_mapitems.on_veinstone_punched(pos, node, puncher, pointed_thing)
|
||||
end,
|
||||
_mcl_blast_resistance = 10,
|
||||
_mcl_hardness = 3,
|
||||
@ -42,10 +48,13 @@ minetest.register_node("df_mapitems:veinstone_pulse", {
|
||||
if positions[1] == nil then
|
||||
positions = {[1] = minetest.find_node_near(pos, 4, "df_mapitems:veinstone")}
|
||||
end
|
||||
if (positions[1] ~= nil) then
|
||||
minetest.sound_play({pos = pos}, {name="dfcaverns_slow_heartbeat", gain=0.5})
|
||||
end
|
||||
for _, neighbor_pos in pairs(positions) do
|
||||
minetest.swap_node(neighbor_pos, {name="df_mapitems:veinstone_pulse"})
|
||||
minetest.get_node_timer(neighbor_pos):start(2)
|
||||
end
|
||||
end
|
||||
minetest.swap_node(pos, {name="df_mapitems:veinstone_refractory"})
|
||||
minetest.get_node_timer(pos):start(12)
|
||||
end,
|
||||
|
@ -47,6 +47,9 @@ minetest.register_node("df_trees:blood_thorn", {
|
||||
_mcl_hardness = 1,
|
||||
|
||||
on_construct = function(pos)
|
||||
if not df_trees.blood_thorn_growth_permitted(pos) then
|
||||
return
|
||||
end
|
||||
minetest.get_node_timer(pos):start(math.random(blood_thorn_min_delay, blood_thorn_max_delay))
|
||||
end,
|
||||
on_destruct = function(pos)
|
||||
@ -234,10 +237,6 @@ function df_trees.grow_blood_thorn(pos, node)
|
||||
return
|
||||
end
|
||||
|
||||
if not df_trees.blood_thorn_growth_permitted(pos) then
|
||||
return
|
||||
end
|
||||
|
||||
local height = 0
|
||||
local max_height = max_bloodthorn_height(pos)
|
||||
while node.name == "df_trees:blood_thorn" and height < max_height do
|
||||
|
@ -350,6 +350,7 @@ minetest.register_node("df_trees:tunnel_tube_sapling", {
|
||||
df_trees.config.tunnel_tube_delay_multiplier*df_trees.config.tree_max_growth_delay))
|
||||
end
|
||||
end,
|
||||
|
||||
on_destruct = function(pos)
|
||||
minetest.get_node_timer(pos):stop()
|
||||
end,
|
||||
|
@ -39,6 +39,9 @@ if invulnerable then
|
||||
slade_mcl_hardness = -1
|
||||
end
|
||||
|
||||
-- override this to allow achievements to be recorded without requiring a dependency
|
||||
df_underworld_items.ancient_lantern_fixed = function(pos, player) end
|
||||
|
||||
local punch_fix = function(pos, node, puncher, pointed_thing)
|
||||
local wielded = puncher:get_wielded_item()
|
||||
if wielded:get_name() == mese_crystal_node then
|
||||
|
@ -2,6 +2,10 @@ local S = df_underworld_items.S
|
||||
|
||||
local named_waypoints_path = minetest.get_modpath("named_waypoints")
|
||||
|
||||
-- override these to allow achievements to be recorded without requiring a dependency
|
||||
df_underworld_items.slade_breacher_triggered = function(pos, player) end
|
||||
df_underworld_items.puzzle_seal_solved = function(pos, player) end -- player can be nil
|
||||
|
||||
local invulnerable = df_underworld_items.config.invulnerable_slade and not minetest.settings:get_bool("creative_mode")
|
||||
|
||||
local can_dig
|
||||
@ -82,12 +86,12 @@ local item_represents_number = function(itemname, number)
|
||||
return false
|
||||
end
|
||||
|
||||
local test_key = function(pos)
|
||||
local test_key = function(pos, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
if not meta:contains("key") then
|
||||
return false
|
||||
end
|
||||
|
||||
|
||||
local keystring = meta:get_string("key")
|
||||
local key = minetest.deserialize(keystring)
|
||||
local inv = meta:get_inventory()
|
||||
@ -105,6 +109,7 @@ local test_key = function(pos)
|
||||
if valid then
|
||||
local unlocked = meta:get_int("unlocked")
|
||||
if unlocked == 0 then
|
||||
df_underworld_items.puzzle_seal_solved(pos, player)
|
||||
meta:set_int("unlocked", 1)
|
||||
end
|
||||
return true
|
||||
@ -168,7 +173,7 @@ local get_formspec = function(pos, unlocked)
|
||||
end
|
||||
local refresh_formspec = function(pos, player)
|
||||
local player_name = player:get_player_name()
|
||||
local unlocked = test_key(pos)
|
||||
local unlocked = test_key(pos, player)
|
||||
local formspec = get_formspec(pos, unlocked)
|
||||
minetest.show_formspec(player_name, formspec_prefix..minetest.pos_to_string(pos), formspec)
|
||||
end
|
||||
@ -398,6 +403,7 @@ minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
minetest.set_node(pos, {name="df_underworld_items:digging_seal", param2 = math.random(1,4)-1})
|
||||
minetest.get_node_timer(pos):start(4)
|
||||
minetest.close_formspec(player:get_player_name(), formname)
|
||||
df_underworld_items.slade_breacher_triggered(pos, player)
|
||||
end
|
||||
end)
|
||||
|
||||
|
@ -2,6 +2,9 @@ local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
hunter_statue = {}
|
||||
|
||||
-- override this to allow achievements to be recorded without requiring a dependency
|
||||
hunter_statue.player_punched = function(node_name, pos, player) end
|
||||
|
||||
local statue_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
@ -119,6 +122,7 @@ hunter_statue.register_hunter_statue = function(node_name, statue_def)
|
||||
nearest_player:add_velocity(vector.multiply(vector.direction(pos, nearest_pos), knockback))
|
||||
nearest_player:set_hp(math.max(nearest_player:get_hp() - damage*armour_multiplier, 0))
|
||||
minetest.sound_play({name="hunter_statue_thud"}, {pos = nearest_pos})
|
||||
hunter_statue.player_punched(node_name, pos, nearest_player)
|
||||
return
|
||||
end
|
||||
local player_dir = vector.direction(pos, nearest_pos)
|
||||
|
@ -1,3 +1,5 @@
|
||||
ice_sprites = {}
|
||||
|
||||
local modname = minetest.get_current_modname()
|
||||
local S = minetest.get_translator(modname)
|
||||
|
||||
|
@ -1,3 +1,5 @@
|
||||
pit_caves = {}
|
||||
|
||||
local modpath = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S = minetest.get_translator(minetest.get_current_modname())
|
||||
|
||||
@ -70,6 +72,8 @@ local get_pit = function(pos)
|
||||
return {location = location, depth = depth, top = top}
|
||||
end
|
||||
|
||||
pit_caves.get_nearest_pit = get_pit
|
||||
|
||||
local perlin_params = {
|
||||
offset = 0,
|
||||
scale = 1,
|
||||
@ -224,4 +228,4 @@ minetest.register_chatcommand("find_pit_caves", {
|
||||
return false, S("You need the server privilege to use this command.")
|
||||
end
|
||||
end,
|
||||
})
|
||||
})
|