Merge pull request 'New Advancements' (#2303) from PrairieAstronomer/MineClone2:PrairieWind_advancements into master

Reviewed-on: MineClone2/MineClone2#2303
This commit is contained in:
cora 2022-06-12 01:30:57 +00:00
commit 00e94c81c4
7 changed files with 66 additions and 2 deletions

View File

@ -985,6 +985,11 @@ local trade_inventory = {
elseif listname == "output" then elseif listname == "output" then
if not trader_exists(player:get_player_name()) then if not trader_exists(player:get_player_name()) then
return 0 return 0
-- Begin Award Code
-- May need to be moved if award gets unlocked in the wrong cases.
elseif trader_exists(player:get_player_name()) then
awards.unlock(player:get_player_name(), "mcl:whatAdeal")
-- End Award Code
end end
-- Only allow taking full stack -- Only allow taking full stack
local count = stack:get_count() local count = stack:get_count()

View File

@ -101,6 +101,17 @@ awards.register_achievement("mcl:bookcase", {
} }
}) })
awards.register_achievement("mcl:buildIronPickaxe", {
title = S("Isn't It Iron Pick"),
description = S("Craft a iron pickaxe using sticks and iron."),
icon = "default_tool_steelpick.png",
trigger = {
type = "craft",
item = "mcl_tools:pick_iron",
target = 1
}
})
-- Item pickup achievements: These are awarded when picking up a certain item. -- Item pickup achievements: These are awarded when picking up a certain item.
-- The achivements are manually given in the mod mcl_item_entity. -- The achivements are manually given in the mod mcl_item_entity.
awards.register_achievement("mcl:diamonds", { awards.register_achievement("mcl:diamonds", {
@ -163,6 +174,47 @@ awards.register_achievement("mcl:buildNetherPortal", {
icon = "default_obsidian.png", icon = "default_obsidian.png",
}) })
awards.register_achievement("mcl:enterEndPortal", {
title = S("The End?"),
description = S("Or the beginning?\nHint: Enter an end portal."),
icon = "mcl_end_end_stone.png",
})
-- Triggered in mcl_totems
awards.register_achievement("mcl:postMortal", {
title = S("Postmortal"),
description = S("Use a Totem of Undying to cheat death."),
icon = "mcl_totems_totem.png",
})
-- Triggered in mcl_beds
awards.register_achievement("mcl:sweetDreams", {
title = S("Sweet Dreams"),
description = S("Sleep in a bed to change your respawn point."),
icon = "mcl_beds_bed_red.png",
})
-- Triggered in mobs_mc
awards.register_achievement("mcl:whatAdeal", {
title = S("What A Deal!"),
description = S("Successfully trade with a Villager."),
icon = "mcl_core_emerald.png",
})
-- Triggered in mcl_fishing
awards.register_achievement("mcl:fishyBusiness", {
title = S("Fishy Business"),
description = S("Catch a fish. \nHint: Catch a fish, salmon, clownfish, or pufferfish."),
icon = "mcl_fishing_fishing_rod.png",
})
-- Triggered in mcl_compass
awards.register_achievement("mcl:countryLode", {
title = S("Country Lode,\nTake Me Home"),
description = S("Use a compass on a Lodestone."),
icon = "lodestone_side4.png",
})
-- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.) -- NON-PC ACHIEVEMENTS (XBox, Pocket Edition, etc.)
if non_pc_achievements then if non_pc_achievements then

View File

@ -76,6 +76,7 @@ local function lay_down(player, pos, bed_pos, state, skip)
-- save respawn position when entering bed -- save respawn position when entering bed
if spawn_mod and mcl_spawn.set_spawn_pos(player, bed_pos, nil) then if spawn_mod and mcl_spawn.set_spawn_pos(player, bed_pos, nil) then
minetest.chat_send_player(name, S("New respawn position set!")) minetest.chat_send_player(name, S("New respawn position set!"))
awards.unlock(player:get_player_name(), "mcl:sweetDreams")
end end
-- No sleeping if too far away -- No sleeping if too far away

View File

@ -189,6 +189,7 @@ minetest.register_globalstep(function(dtime)
if string_find(stack:get_name(), "_lodestone") then if string_find(stack:get_name(), "_lodestone") then
stack:set_name("mcl_compass:" .. compass_frame .. "_lodestone") stack:set_name("mcl_compass:" .. compass_frame .. "_lodestone")
awards.unlock(player:get_player_name(), "mcl:countryLode")
else else
stack:set_name("mcl_compass:" .. compass_frame) stack:set_name("mcl_compass:" .. compass_frame)
end end

View File

@ -75,6 +75,7 @@ local fish = function(itemstack, player, pointed_thing)
stacks_min = 1, stacks_min = 1,
stacks_max = 1, stacks_max = 1,
}, pr) }, pr)
awards.unlock(player:get_player_name(), "mcl:fishyBusiness")
elseif r <= junk_value then elseif r <= junk_value then
-- Junk -- Junk
items = mcl_loot.get_loot({ items = mcl_loot.get_loot({
@ -124,6 +125,9 @@ local fish = function(itemstack, player, pointed_thing)
local inv = player:get_inventory() local inv = player:get_inventory()
if inv:room_for_item("main", item) then if inv:room_for_item("main", item) then
inv:add_item("main", item) inv:add_item("main", item)
if item:get_name() == "mcl_mobitems:leather" then
awards.unlock(player:get_player_name(), "mcl:killCow")
end
else else
minetest.add_item(pos, item) minetest.add_item(pos, item)
end end

View File

@ -241,7 +241,7 @@ function mcl_portals.end_portal_teleport(pos, node)
end end
mcl_portals.end_teleport(obj, objpos) mcl_portals.end_teleport(obj, objpos)
awards.unlock(obj:get_player_name(), "mcl:enterEndPortal")
end end
end end
end end

View File

@ -51,6 +51,7 @@ mcl_damage.register_modifier(function(obj, damage, reason)
obj:set_wielded_item(wield) obj:set_wielded_item(wield)
end end
end end
awards.unlock(obj:get_player_name(), "mcl:postMortal")
-- Effects -- Effects
minetest.sound_play({name = "mcl_totems_totem", gain = 1}, {pos=ppos, max_hear_distance = 16}, true) minetest.sound_play({name = "mcl_totems_totem", gain = 1}, {pos=ppos, max_hear_distance = 16}, true)