add achievements to almost everything and fixed some bugs and features
This commit is contained in:
parent
f167fd2851
commit
c8e0dbfe68
@ -38,6 +38,8 @@ drop_items_on_die = true
|
|||||||
|
|
||||||
# mob stuff
|
# mob stuff
|
||||||
mobs_enable_blood = false
|
mobs_enable_blood = false
|
||||||
|
# if mobs don't attack within 256 nodes of the staic_spawn_point; disabled in singleplayer
|
||||||
|
mobs_safe_spawn = true
|
||||||
|
|
||||||
# if beds can be slept in
|
# if beds can be slept in
|
||||||
bed_enabled = true
|
bed_enabled = true
|
||||||
|
@ -138,8 +138,8 @@ minetest.register_on_dignode(on_dig)
|
|||||||
minetest.register_on_placenode(on_place)
|
minetest.register_on_placenode(on_place)
|
||||||
|
|
||||||
local form = default.ui.get_page("core")
|
local form = default.ui.get_page("core")
|
||||||
form = form .. "tableoptions[background=#88888840]"
|
form = form .. "tableoptions[background=#DDDDDD30]"
|
||||||
form = form .. "tablecolumns[text,align=left;text,align=left]"
|
form = form .. "tablecolumns[text,align=left,width=11;text,align=left,width=28;text,align=left,width=5]"
|
||||||
default.ui.register_page("core_achievements", form)
|
default.ui.register_page("core_achievements", form)
|
||||||
|
|
||||||
function achievements.get_formspec(name, row)
|
function achievements.get_formspec(name, row)
|
||||||
@ -147,45 +147,56 @@ function achievements.get_formspec(name, row)
|
|||||||
|
|
||||||
local achievement_list = ""
|
local achievement_list = ""
|
||||||
|
|
||||||
|
local amt_gotten = 0
|
||||||
|
local amt_progress = 0
|
||||||
|
|
||||||
for _, aname in ipairs(achievements.registered_achievements_list) do
|
for _, aname in ipairs(achievements.registered_achievements_list) do
|
||||||
local def = achievements.registered_achievements[aname]
|
local def = achievements.registered_achievements[aname]
|
||||||
|
|
||||||
local amt = ""
|
local progress = ""
|
||||||
if achievements.achievements[name][aname] then
|
if achievements.achievements[name][aname] then
|
||||||
if achievements.achievements[name][aname] == -1 then
|
if achievements.achievements[name][aname] == -1 then
|
||||||
amt = " (Gotten)"
|
progress = "Gotten"
|
||||||
|
amt_gotten = amt_gotten + 1
|
||||||
else
|
else
|
||||||
amt = " (" .. achievements.achievements[name][aname] .. "/" .. def.times .. ")"
|
progress = achievements.achievements[name][aname] .. "/" .. def.times
|
||||||
|
amt_progress = amt_progress + 1
|
||||||
end
|
end
|
||||||
|
else
|
||||||
|
progress = "Missing"
|
||||||
end
|
end
|
||||||
|
|
||||||
if achievement_list == "" then
|
if achievement_list ~= "" then
|
||||||
achievement_list = achievement_list .. minetest.formspec_escape(def.title .. amt) .. "," .. minetest.formspec_escape(def.description)
|
achievement_list = achievement_list .. ","
|
||||||
else
|
|
||||||
achievement_list = achievement_list .. "," .. minetest.formspec_escape(def.title .. amt) .. "," .. minetest.formspec_escape(def.description)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
achievement_list = achievement_list .. minetest.formspec_escape(def.title) .. ","
|
||||||
|
achievement_list = achievement_list .. minetest.formspec_escape(def.description) .. ","
|
||||||
|
achievement_list = achievement_list .. progress
|
||||||
end
|
end
|
||||||
|
|
||||||
local form = default.ui.get_page("core_achievements")
|
local form = default.ui.get_page("core_achievements")
|
||||||
|
|
||||||
form = form .. "table[0.25,3;7.75,5.5;achievement_list;" .. achievement_list .. ";" .. row .. "]"
|
form = form .. "table[0.25,2.5;7.75,5.5;achievement_list;" .. achievement_list .. ";" .. row .. "]"
|
||||||
|
|
||||||
local aname = achievements.registered_achievements_list[row]
|
local aname = achievements.registered_achievements_list[row]
|
||||||
local def = achievements.registered_achievements[aname]
|
local def = achievements.registered_achievements[aname]
|
||||||
|
|
||||||
local amt = ""
|
local progress = ""
|
||||||
if achievements.achievements[name][aname] then
|
if achievements.achievements[name][aname] then
|
||||||
if achievements.achievements[name][aname] == -1 then
|
if achievements.achievements[name][aname] == -1 then
|
||||||
amt = "Gotten"
|
progress = "Gotten"
|
||||||
else
|
else
|
||||||
amt = achievements.achievements[name][aname] .. "/" .. def.times
|
progress = achievements.achievements[name][aname] .. "/" .. def.times
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
amt = "Missing"
|
progress = "Missing"
|
||||||
end
|
end
|
||||||
|
|
||||||
|
form = form .. "label[0.25,8.15;" .. minetest.formspec_escape(amt_gotten .. " of " .. #achievements.registered_achievements_list .. " achievements gotten, " .. amt_progress .. " in progress") .. "]"
|
||||||
|
|
||||||
form = form .. "label[0.25,0.25;" .. minetest.formspec_escape(def.title) .. "]"
|
form = form .. "label[0.25,0.25;" .. minetest.formspec_escape(def.title) .. "]"
|
||||||
form = form .. "label[7.25,0.25;" .. minetest.formspec_escape(amt) .. "]"
|
form = form .. "label[7.25,0.25;" .. minetest.formspec_escape(progress) .. "]"
|
||||||
|
|
||||||
form = form .. "label[0.5,0.75;" .. minetest.formspec_escape(def.description) .. "]"
|
form = form .. "label[0.5,0.75;" .. minetest.formspec_escape(def.description) .. "]"
|
||||||
|
|
||||||
@ -215,7 +226,12 @@ end
|
|||||||
minetest.register_on_player_receive_fields(receive_fields)
|
minetest.register_on_player_receive_fields(receive_fields)
|
||||||
|
|
||||||
|
|
||||||
-- below is the default achievements
|
--
|
||||||
|
-- Below is the default achievements
|
||||||
|
--
|
||||||
|
|
||||||
|
-- Joining
|
||||||
|
|
||||||
achievements.register_achievement(
|
achievements.register_achievement(
|
||||||
"firstjoin",
|
"firstjoin",
|
||||||
{
|
{
|
||||||
@ -232,6 +248,8 @@ achievements.register_achievement(
|
|||||||
times = 100,
|
times = 100,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Dying
|
||||||
|
|
||||||
achievements.register_achievement(
|
achievements.register_achievement(
|
||||||
"killathon",
|
"killathon",
|
||||||
{
|
{
|
||||||
@ -240,31 +258,122 @@ achievements.register_achievement(
|
|||||||
times = 10,
|
times = 10,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Crafting a broadsword
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"off_to_battle",
|
||||||
|
{
|
||||||
|
title = "Off to Battle",
|
||||||
|
description = "Craft a Broadsword",
|
||||||
|
times = 1,
|
||||||
|
craftitem = "default:broadsword",
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Placing planks
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"plunks",
|
||||||
|
{
|
||||||
|
title = "Plunks",
|
||||||
|
description = "Place 10 planks",
|
||||||
|
times = 10,
|
||||||
|
placenode = "group:planks",
|
||||||
|
})
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"carpenter",
|
||||||
|
{
|
||||||
|
title = "Carpenter",
|
||||||
|
description = "Place 100 planks",
|
||||||
|
times = 100,
|
||||||
|
placenode = "group:planks",
|
||||||
|
})
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"master_carpenter",
|
||||||
|
{
|
||||||
|
title = "Master Carpenter",
|
||||||
|
description = "Place 500 planks",
|
||||||
|
times = 500,
|
||||||
|
placenode = "group:planks",
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Digging stone
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"mineority",
|
||||||
|
{
|
||||||
|
title = "Mineority",
|
||||||
|
description = "Mine 20 stone",
|
||||||
|
times = 20,
|
||||||
|
dignode = "group:stone",
|
||||||
|
})
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"rockin'",
|
||||||
|
{
|
||||||
|
title = "Rockin'",
|
||||||
|
description = "Mine 200 stone",
|
||||||
|
times = 200,
|
||||||
|
dignode = "group:stone",
|
||||||
|
})
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"rocksolid",
|
||||||
|
{
|
||||||
|
title = "Rock Solid",
|
||||||
|
description = "Mine 1000 stone",
|
||||||
|
times = 1000,
|
||||||
|
dignode = "group:stone",
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Digging wood
|
||||||
|
|
||||||
achievements.register_achievement(
|
achievements.register_achievement(
|
||||||
"timber",
|
"timber",
|
||||||
{
|
{
|
||||||
title = "Timber!",
|
title = "Timber",
|
||||||
description = "Dig 10 tree trunks.",
|
description = "Dig 10 tree trunks.",
|
||||||
times = 10,
|
times = 10,
|
||||||
dignode = "group:tree",
|
dignode = "group:tree",
|
||||||
})
|
})
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"timberer",
|
||||||
|
{
|
||||||
|
title = "Timberer",
|
||||||
|
description = "Dig 100 tree trunks.",
|
||||||
|
times = 100,
|
||||||
|
dignode = "group:tree",
|
||||||
|
})
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"timbererest",
|
||||||
|
{
|
||||||
|
title = "Timbererest",
|
||||||
|
description = "Dig 500 tree trunks.",
|
||||||
|
times = 500,
|
||||||
|
dignode = "group:tree",
|
||||||
|
})
|
||||||
|
|
||||||
|
-- Planting flowers
|
||||||
|
|
||||||
achievements.register_achievement(
|
achievements.register_achievement(
|
||||||
"gardener",
|
"gardener",
|
||||||
{
|
{
|
||||||
title = "Gardener",
|
title = "Gardener",
|
||||||
description = "Place 10 flowers.",
|
description = "Plant 10 flowers.",
|
||||||
times = 10,
|
times = 10,
|
||||||
placenode = "default:flower",
|
placenode = "default:flower",
|
||||||
})
|
})
|
||||||
|
|
||||||
achievements.register_achievement(
|
achievements.register_achievement(
|
||||||
"your_pick",
|
"master_gardener",
|
||||||
{
|
{
|
||||||
title = "Your pick",
|
title = "Master Gardener",
|
||||||
description = "Craft yourself a new wooden pickaxe.",
|
description = "Plant 100 flowers.",
|
||||||
times = 1,
|
times = 100,
|
||||||
craftitem = "default:pick_wood",
|
placenode = "default:flower",
|
||||||
})
|
})
|
||||||
|
|
||||||
local function on_dieplayer(player)
|
local function on_dieplayer(player)
|
||||||
|
2
mods/armor/depends.txt
Normal file
2
mods/armor/depends.txt
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
default
|
||||||
|
achievements
|
@ -290,4 +290,26 @@ form_armor = form_armor .. "list[current_player;armor_helmet;2.25,0.75;1,1;]"
|
|||||||
form_armor = form_armor .. "listring[current_player;armor_helmet]"
|
form_armor = form_armor .. "listring[current_player;armor_helmet]"
|
||||||
form_armor = form_armor .. default.ui.get_itemslot_bg(2.25, 0.75, 1, 1)
|
form_armor = form_armor .. default.ui.get_itemslot_bg(2.25, 0.75, 1, 1)
|
||||||
|
|
||||||
default.ui.register_page("core_armor", form_armor)
|
default.ui.register_page("core_armor", form_armor)
|
||||||
|
|
||||||
|
-- Achievements
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"armored",
|
||||||
|
{
|
||||||
|
title = "Armored",
|
||||||
|
description = "Craft a piece of armor",
|
||||||
|
times = 1,
|
||||||
|
craftitem = "group:is_armor",
|
||||||
|
})
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"warrior",
|
||||||
|
{
|
||||||
|
title = "Warrior",
|
||||||
|
description = "Craft 10 piece of armor",
|
||||||
|
times = 10,
|
||||||
|
craftitem = "group:is_armor",
|
||||||
|
})
|
||||||
|
|
||||||
|
default.log("mod:armor", "loaded")
|
@ -1,3 +1,4 @@
|
|||||||
default
|
default
|
||||||
player_effects
|
player_effects
|
||||||
|
achievements
|
||||||
farming?
|
farming?
|
||||||
|
@ -201,4 +201,15 @@ minetest.register_on_leaveplayer(
|
|||||||
players_in_bed[player:get_player_name()] = nil
|
players_in_bed[player:get_player_name()] = nil
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- Achievements
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"bedtime",
|
||||||
|
{
|
||||||
|
title = "Bed Time",
|
||||||
|
description = "Craft a bed",
|
||||||
|
times = 1,
|
||||||
|
craftitem = "bed:bed",
|
||||||
|
})
|
||||||
|
|
||||||
default.log("mod:bed", "loaded")
|
default.log("mod:bed", "loaded")
|
||||||
|
@ -1 +1,2 @@
|
|||||||
default
|
default
|
||||||
|
achievements
|
||||||
|
@ -44,4 +44,17 @@ minetest.register_on_player_receive_fields(
|
|||||||
|
|
||||||
itemstack:set_metadata(minetest.serialize(data))
|
itemstack:set_metadata(minetest.serialize(data))
|
||||||
player:set_wielded_item(itemstack)
|
player:set_wielded_item(itemstack)
|
||||||
end)
|
end)
|
||||||
|
|
||||||
|
-- Achievements
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"scribe",
|
||||||
|
{
|
||||||
|
title = "Scribe",
|
||||||
|
description = "Craft a book",
|
||||||
|
times = 1,
|
||||||
|
placenode = "default:book",
|
||||||
|
})
|
||||||
|
|
||||||
|
default.log("mod:book", "loaded")
|
@ -1 +1,2 @@
|
|||||||
default
|
default
|
||||||
|
achievements
|
||||||
|
@ -314,4 +314,15 @@ minetest.register_craft(
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Achievements
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"adoorable",
|
||||||
|
{
|
||||||
|
title = "Adoorable",
|
||||||
|
description = "Craft a door",
|
||||||
|
times = 1,
|
||||||
|
craftitem = "group:door",
|
||||||
|
})
|
||||||
|
|
||||||
default.log("mod:door", "loaded")
|
default.log("mod:door", "loaded")
|
@ -1,2 +1,3 @@
|
|||||||
default
|
default
|
||||||
weather
|
weather
|
||||||
|
achievements
|
||||||
|
@ -20,4 +20,42 @@ farming.register_plant(
|
|||||||
light_max = 15,
|
light_max = 15,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Achievements
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"farmer",
|
||||||
|
{
|
||||||
|
title = "Farmer",
|
||||||
|
description = "Plant 20 wheat seeds",
|
||||||
|
times = 20,
|
||||||
|
placenode = "farming:wheat_1",
|
||||||
|
})
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"master_farmer",
|
||||||
|
{
|
||||||
|
title = "Master Farmer",
|
||||||
|
description = "Plant 200 wheat seeds",
|
||||||
|
times = 200,
|
||||||
|
placenode = "farming:wheat_1",
|
||||||
|
})
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"cotton_farmer",
|
||||||
|
{
|
||||||
|
title = "Cotton Farmer",
|
||||||
|
description = "Plant 10 cotton seeds",
|
||||||
|
times = 10,
|
||||||
|
placenode = "farming:cotton_1",
|
||||||
|
})
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"master_cotton_farmer",
|
||||||
|
{
|
||||||
|
title = "Master Cotton Farmer",
|
||||||
|
description = "Plant 100 cotton seeds",
|
||||||
|
times = 100,
|
||||||
|
placenode = "farming:cotton_1",
|
||||||
|
})
|
||||||
|
|
||||||
default.log("plants", "loaded")
|
default.log("plants", "loaded")
|
@ -1 +1,2 @@
|
|||||||
default
|
default
|
||||||
|
achievements
|
||||||
|
@ -167,6 +167,9 @@ minetest.register_node(
|
|||||||
inv:set_stack("main", 1, ItemStack(jewels.get_jeweled(itemname)))
|
inv:set_stack("main", 1, ItemStack(jewels.get_jeweled(itemname)))
|
||||||
|
|
||||||
itemstack:take_item()
|
itemstack:take_item()
|
||||||
|
|
||||||
|
achievements.trigger_achievement(player, "jeweler")
|
||||||
|
achievements.trigger_achievement(player, "master_jeweler")
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@ -223,4 +226,22 @@ minetest.register_ore(
|
|||||||
|
|
||||||
dofile(minetest.get_modpath("jewels").."/jewels.lua")
|
dofile(minetest.get_modpath("jewels").."/jewels.lua")
|
||||||
|
|
||||||
|
-- Achievements
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"jeweler",
|
||||||
|
{
|
||||||
|
title = "Jeweler",
|
||||||
|
description = "Jewel a tool",
|
||||||
|
times = 1,
|
||||||
|
})
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"master_jeweler",
|
||||||
|
{
|
||||||
|
title = "Master Jeweler",
|
||||||
|
description = "Jewel 10 tools",
|
||||||
|
times = 10,
|
||||||
|
})
|
||||||
|
|
||||||
default.log("mod:jewels", "loaded")
|
default.log("mod:jewels", "loaded")
|
||||||
|
@ -1 +1,2 @@
|
|||||||
default
|
default
|
||||||
|
achievements
|
||||||
|
@ -197,4 +197,24 @@ minetest.register_craft(
|
|||||||
recipe = {"default:chest", "locks:lock"},
|
recipe = {"default:chest", "locks:lock"},
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Achievements
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"locksmith",
|
||||||
|
{
|
||||||
|
title = "Locksmith",
|
||||||
|
description = "Craft a lock",
|
||||||
|
times = 1,
|
||||||
|
craftitem = "locks:lock",
|
||||||
|
})
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"burglar",
|
||||||
|
{
|
||||||
|
title = "Burglar",
|
||||||
|
description = "Craft a lock pick",
|
||||||
|
times = 1,
|
||||||
|
craftitem = "locks:pick",
|
||||||
|
})
|
||||||
|
|
||||||
default.log("mod:locks", "loaded")
|
default.log("mod:locks", "loaded")
|
@ -10,8 +10,12 @@ mobs.protected = tonumber(minetest.setting_get("mobs_spawn_protected")) or 0
|
|||||||
mobs.remove = minetest.setting_getbool("remove_far_mobs") or false
|
mobs.remove = minetest.setting_getbool("remove_far_mobs") or false
|
||||||
|
|
||||||
local function is_too_near_spawn(pos)
|
local function is_too_near_spawn(pos)
|
||||||
local sp = minetest.settting_getbool("static_spawn_point") or {x = 0, y = 0, z = 0}
|
if minetest.is_singleplayer() or (not minetest.setting_getbool("mobs_safe_spawn")) then
|
||||||
local rad = minetest.settting_getbool("static_spawn_radius") or 256
|
return false
|
||||||
|
end
|
||||||
|
|
||||||
|
local sp = minetest.setting_getbool("static_spawn_point") or {x = 0, y = 0, z = 0}
|
||||||
|
local rad = minetest.setting_getbool("static_spawn_radius") or 256
|
||||||
|
|
||||||
return (vector.distance(pos, sp) < rad)
|
return (vector.distance(pos, sp) < rad)
|
||||||
end
|
end
|
||||||
|
@ -139,4 +139,15 @@ function step(dtime)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
minetest.register_globalstep(step)
|
minetest.register_globalstep(step)
|
||||||
|
|
||||||
|
-- Achievements
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"true_navigator",
|
||||||
|
{
|
||||||
|
title = "True Navigator",
|
||||||
|
description = "Craft a compass",
|
||||||
|
times = 1,
|
||||||
|
craftitem = "nav:compass_3",
|
||||||
|
})
|
@ -1,2 +1,3 @@
|
|||||||
default
|
default
|
||||||
util
|
util
|
||||||
|
achievements
|
||||||
|
@ -157,4 +157,15 @@ minetest.register_craft(
|
|||||||
minetest.register_on_joinplayer(on_joinplayer)
|
minetest.register_on_joinplayer(on_joinplayer)
|
||||||
minetest.register_on_leaveplayer(on_leaveplayer)
|
minetest.register_on_leaveplayer(on_leaveplayer)
|
||||||
minetest.register_globalstep(step)
|
minetest.register_globalstep(step)
|
||||||
minetest.register_on_player_receive_fields(recieve_fields)
|
minetest.register_on_player_receive_fields(recieve_fields)
|
||||||
|
|
||||||
|
-- Achievements
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"navigator",
|
||||||
|
{
|
||||||
|
title = "Navigator",
|
||||||
|
description = "Craft a map",
|
||||||
|
times = 1,
|
||||||
|
craftitem = "nav:map",
|
||||||
|
})
|
@ -118,33 +118,27 @@ function player_effects.remove_effect(player, ename)
|
|||||||
end
|
end
|
||||||
|
|
||||||
function player_effects.refresh_effects(player)
|
function player_effects.refresh_effects(player)
|
||||||
local function check(ename)
|
local phys = {speed = 1, jump = 1, gravity = 1}
|
||||||
local phys = {speed = 1, jump = 1, gravity = 1}
|
|
||||||
|
|
||||||
for en, _ in pairs(player_effects.effects[player:get_player_name()]) do
|
for en, _ in pairs(player_effects.effects[player:get_player_name()]) do
|
||||||
if en ~= ename then
|
if en ~= ename then
|
||||||
local effect = player_effects.get_registered_effect(en)
|
local effect = player_effects.get_registered_effect(en)
|
||||||
|
|
||||||
if effect.physics.speed ~= nil then
|
if effect.physics.speed ~= nil then
|
||||||
phys.speed = phys.speed * effect.physics.speed
|
phys.speed = phys.speed * effect.physics.speed
|
||||||
end
|
end
|
||||||
|
|
||||||
if effect.physics.jump ~= nil then
|
if effect.physics.jump ~= nil then
|
||||||
phys.jump = phys.jump * effect.physics.jump
|
phys.jump = phys.jump * effect.physics.jump
|
||||||
end
|
end
|
||||||
|
|
||||||
if effect.physics.gravity ~= nil then
|
if effect.physics.gravity ~= nil then
|
||||||
phys.gravity = phys.gravity * effect.physics.gravity
|
phys.gravity = phys.gravity * effect.physics.gravity
|
||||||
end
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
player:set_physics_override(phys)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
for ename, endtime in pairs(player_effects.effects[player:get_player_name()]) do
|
player:set_physics_override(phys)
|
||||||
check(ename)
|
|
||||||
end
|
|
||||||
|
|
||||||
save_effects()
|
save_effects()
|
||||||
end
|
end
|
||||||
|
@ -1,2 +1,2 @@
|
|||||||
default
|
default
|
||||||
|
achievements
|
||||||
|
@ -268,4 +268,15 @@ minetest.register_craft(
|
|||||||
burntime = 13,
|
burntime = 13,
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Achievements
|
||||||
|
|
||||||
|
achievements.register_achievement(
|
||||||
|
"boom",
|
||||||
|
{
|
||||||
|
title = "Boom!",
|
||||||
|
description = "Craft TNT",
|
||||||
|
times = 1,
|
||||||
|
craftitem = "tnt:tnt",
|
||||||
|
})
|
||||||
|
|
||||||
default.log("mod:tnt", "loaded")
|
default.log("mod:tnt", "loaded")
|
Loading…
Reference in New Issue
Block a user