|
@ -18,7 +18,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
|
|||
* [privs][] ([CC0][lic.cc0])
|
||||
* [spectator_mode][] ([WTFPL][lic.spectator_mode]) -- version: [7d68bec Git][ver.spectator_mode] *2017-03-30*
|
||||
* [whitelist][] ([CC0][lic.cc0]) -- version [0.1 (b813b19 Git)][ver.whitelist] *2017-08-18*
|
||||
* [awards][] ([MIT][lic.awards]) -- version: [3.3.0][ver.awards] *2018-09-14* ***UNSTABLE UPDATES***
|
||||
* [awards][] ([MIT][lic.awards]) -- version: [3.4.0][ver.awards] *2021-01-10*
|
||||
* [antum][] ([MIT][lic.antum]) -- version: [69b39a4 Git][ver.antum] *2017-08-30*
|
||||
* buildings/
|
||||
* [bridges][] ([GPL][lic.gpl3.0]) -- version: [5b5f475 Git][ver.bridges] *2015-08-23* ([patched][patch.bridges])
|
||||
|
@ -391,7 +391,7 @@ The game includes the mods from the default [minetest_game](https://github.com/m
|
|||
[ver.animals_aggressive]: https://github.com/AntumMT/mp-animals_aggressive/tree/4eede4d
|
||||
[ver.animals_harmless]: https://github.com/AntumMT/mp-animals_harmless/tree/e9b02a8
|
||||
[ver.antum]: https://github.com/AntumMT/mp-antum/tree/69b39a4
|
||||
[ver.awards]: https://github.com/rubenwardy/awards/tree/v3.3.0
|
||||
[ver.awards]: https://github.com/rubenwardy/awards/tree/v3.4.0
|
||||
[ver.away]: https://github.com/kahrl/minetest-mod-away/tree/4c1e5a9
|
||||
[ver.bags]: https://github.com/cornernote/minetest-bags/tree/bc87b45
|
||||
[ver.basic_materials]: https://gitlab.com/VanessaE/basic_materials/-/tags/2021-01-30
|
||||
|
|
|
@ -0,0 +1,14 @@
|
|||
unused_args = false
|
||||
allow_defined_top = true
|
||||
|
||||
globals = {
|
||||
"minetest", "awards",
|
||||
}
|
||||
|
||||
read_globals = {
|
||||
string = {fields = {"split"}},
|
||||
table = {fields = {"copy", "getn"}},
|
||||
"vector", "default", "ItemStack",
|
||||
"dump", "sfinv", "intllib",
|
||||
"unified_inventory",
|
||||
}
|
|
@ -37,10 +37,11 @@ awards.register_award("mymod:award", {
|
|||
|
||||
The above trigger type is an example of a counted_key trigger:
|
||||
rather than a single counter there's a counter per key - in this
|
||||
case the key is the value of the `node` field. If you leave out
|
||||
the key in a `counted_key` trigger, then the total will be used
|
||||
instead. For example, here is an award which unlocks after you've
|
||||
placed 10 nodes of any type:
|
||||
case the key is the value of the `node` field.
|
||||
|
||||
If you leave out the key in a `counted_key` trigger, then the total will be used
|
||||
instead. For example, here is an award which unlocks after you've placed 10
|
||||
nodes of any type:
|
||||
|
||||
```lua
|
||||
awards.register_award("mymod:award", {
|
||||
|
@ -125,6 +126,10 @@ awards.register_trigger("foo", {
|
|||
type = "custom",
|
||||
progress = "@1/@2 foos",
|
||||
auto_description = { "Do a foo", "Foo @1 times" },
|
||||
|
||||
on_register = function(self, award)
|
||||
print(award.name .. " was registered with foo trigger type")
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_on_foo(function()
|
||||
|
@ -168,7 +173,9 @@ end
|
|||
|
||||
# API
|
||||
|
||||
* awards.register_award(name, def), the def table has the following fields:
|
||||
## Awards
|
||||
|
||||
* `awards.register_award(name, def)`, the def table has the following fields:
|
||||
* `title` - title of the award (defaults to name)
|
||||
* `description` - longer description of the award, displayed in Awards tab
|
||||
* `difficulty` - see [Award Difficulty](#award-difficulty).
|
||||
|
@ -182,23 +189,48 @@ end
|
|||
* `background` - the background image, use default otherwise.
|
||||
* `trigger` - trigger definition, see [Builtin Trigger Types](#builtin-trigger-types).
|
||||
* `on_unlock(name, def)` - callback on unlock.
|
||||
* awards.register_trigger(name, def), the def table has the following fields:
|
||||
* `type` - see [Trigger Types](#trigger-types).
|
||||
* `awards.registered_awards` - table of award name to definition.
|
||||
* `awards.register_on_unlock(func(name, def))`
|
||||
* `name` is the player name
|
||||
* `def` is the award def.
|
||||
* return true to cancel HUD
|
||||
* `awards.unlock(player_name, award_name)`
|
||||
* gives an award to a player
|
||||
* `awards.get_award_states(player_name)`
|
||||
* Returns list of tables, sorted by `score`, each having the fields:
|
||||
|
||||
```lua
|
||||
{
|
||||
name = "mymod:awardname",
|
||||
def = {}, -- Award definition
|
||||
unlocked = true, -- Whether award has been unlocked
|
||||
started = true, -- Whether any progress has been made
|
||||
score = 0, -- Score used in sorting
|
||||
|
||||
-- Either a table or nil
|
||||
-- Will be nil if progress is indeterminable or
|
||||
-- if the award is unlocked
|
||||
progress = {
|
||||
current = 5,
|
||||
target = 10,
|
||||
label = "label", -- Label to show over progress bar
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
## Triggers
|
||||
|
||||
* `awards.register_trigger(name, def)`, the def table has the following fields:
|
||||
* `type` - see trigger type types in [Trigger Types](#trigger-types).
|
||||
* `progress` - used to format progress, defaults to "%1/%2".
|
||||
* `auto_description` - a table of two elements. Each element is a format string. Element 1 is singular, element 2 is plural. Used for the award description (not title) if none is given.
|
||||
* `on_register(award_def)` - called when an award registers with this type.
|
||||
* `on_register(self, award_def)` - called when an award registers with this type.
|
||||
* "counted_key" only:
|
||||
* `auto_description_total` - Used if the trigger is for the total.
|
||||
* `get_key(self, def)` - get key for particular award, return nil for a total.
|
||||
* `key_is_item` - true if the key is an item name. On notify(),
|
||||
any watched groups will also be notified as `group:groupname` keys.
|
||||
* awards.register_on_unlock(func(name, def))
|
||||
* name is the player name
|
||||
* def is the award def.
|
||||
* return true to cancel HUD
|
||||
* awards.unlock(name, award)
|
||||
* gives an award to a player
|
||||
* name is the player name
|
||||
* `awards.registered_triggers` - table of trigger name to definition.
|
||||
|
||||
## Builtin Trigger Types
|
||||
|
||||
|
|
|
@ -3,7 +3,9 @@
|
|||
-- The global award namespace
|
||||
awards = {
|
||||
show_mode = "hud",
|
||||
registered_awards = {},
|
||||
registered_triggers = {},
|
||||
on_unlock = {},
|
||||
}
|
||||
|
||||
-- Internationalization support.
|
||||
|
@ -16,7 +18,11 @@ dofile(minetest.get_modpath("awards").."/src/api_triggers.lua")
|
|||
dofile(minetest.get_modpath("awards").."/src/chat_commands.lua")
|
||||
dofile(minetest.get_modpath("awards").."/src/gui.lua")
|
||||
dofile(minetest.get_modpath("awards").."/src/triggers.lua")
|
||||
dofile(minetest.get_modpath("awards").."/src/awards.lua")
|
||||
|
||||
-- Optionally add default awards.
|
||||
if minetest.settings:get_bool("awards.add_defaults", true) then
|
||||
dofile(minetest.get_modpath("awards").."/src/awards.lua")
|
||||
end
|
||||
|
||||
awards.load()
|
||||
minetest.register_on_shutdown(awards.save)
|
||||
|
|
|
@ -102,8 +102,8 @@ msgstr[1] "Bauen Sie Blöcke ab: @1×@2"
|
|||
#: triggers.lua
|
||||
msgid "Mine @1 block."
|
||||
msgid_plural "Mine @1 blocks."
|
||||
msgstr[0] ""
|
||||
msgstr[1] ""
|
||||
msgstr[0] "Bauen Sie einen @1 Block ab."
|
||||
msgstr[1] "Bauen Sie @1 Blöcke ab."
|
||||
|
||||
#: triggers.lua
|
||||
msgid "@1/@2 placed"
|
||||
|
@ -119,8 +119,8 @@ msgstr[1] "Platzieren Sie Blöcke: @1×@2"
|
|||
#: triggers.lua
|
||||
msgid "Place a block."
|
||||
msgid_plural "Place @1 blocks."
|
||||
msgstr[0] ""
|
||||
msgstr[1] ""
|
||||
msgstr[0] "Platzieren Sie einen Block."
|
||||
msgstr[1] "Platzieren Sie @1 Blöcke."
|
||||
|
||||
#: triggers.lua
|
||||
msgid "@1/@2 eaten"
|
||||
|
@ -151,13 +151,13 @@ msgstr[1] "Sterben Sie @1 mal."
|
|||
|
||||
#: triggers.lua
|
||||
msgid "@1/@2 chat messages"
|
||||
msgstr ""
|
||||
msgstr "@1/@2 Chatnachrichten"
|
||||
|
||||
#: triggers.lua
|
||||
msgid "Write something in chat."
|
||||
msgid_plural "Write @1 chat messages."
|
||||
msgstr[0] ""
|
||||
msgstr[1] ""
|
||||
msgstr[0] "Schreiben Sie etwas im Chat."
|
||||
msgstr[1] "Schreiben Sie @1 Chatnachrichten."
|
||||
|
||||
#: triggers.lua
|
||||
msgid "@1/@2 game joins"
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
# Add default achievements from the awards mod
|
||||
awards.add_defaults (Add Default Achievements) bool true
|
|
@ -43,6 +43,11 @@ end
|
|||
-- name - the name of the player
|
||||
-- award - the name of the award to give
|
||||
function awards.unlock(name, award)
|
||||
-- Ensure the player is online.
|
||||
if not minetest.get_player_by_name(name) then
|
||||
return
|
||||
end
|
||||
|
||||
-- Access Player Data
|
||||
local data = awards.player(name)
|
||||
local awdef = awards.registered_awards[award]
|
||||
|
@ -60,7 +65,7 @@ function awards.unlock(name, award)
|
|||
end
|
||||
|
||||
-- Unlock Award
|
||||
minetest.log("action", name.." has unlocked award "..name)
|
||||
minetest.log("action", name.." has unlocked award "..award)
|
||||
data.unlocked[award] = award
|
||||
awards.save()
|
||||
|
||||
|
@ -91,7 +96,7 @@ function awards.unlock(name, award)
|
|||
local title = awdef.title or award
|
||||
local desc = awdef.description or ""
|
||||
local background = awdef.background or "awards_bg_default.png"
|
||||
local icon = awdef.icon or "awards_unknown.png"
|
||||
local icon = (awdef.icon or "awards_unknown.png") .. "^[resize:32x32"
|
||||
local sound = awdef.sound
|
||||
if sound == nil then
|
||||
-- Explicit check for nil because sound could be `false` to disable it
|
||||
|
@ -160,7 +165,7 @@ function awards.unlock(name, award)
|
|||
local four = player:hud_add({
|
||||
hud_elem_type = "image",
|
||||
name = "award_icon",
|
||||
scale = {x = 4, y = 4},
|
||||
scale = {x = 2, y = 2}, -- adjusted for 32x32 from x/y = 4
|
||||
text = icon,
|
||||
position = {x = 0.5, y = 0.05},
|
||||
offset = {x = -200.5, y = 126},
|
||||
|
@ -177,3 +182,71 @@ function awards.unlock(name, award)
|
|||
end)
|
||||
end
|
||||
end
|
||||
|
||||
function awards.get_award_states(name)
|
||||
local hash_is_unlocked = {}
|
||||
local retval = {}
|
||||
|
||||
-- Add all unlocked awards
|
||||
local data = awards.player(name)
|
||||
if data and data.unlocked then
|
||||
for awardname, _ in pairs(data.unlocked) do
|
||||
local def = awards.registered_awards[awardname]
|
||||
if def then
|
||||
hash_is_unlocked[awardname] = true
|
||||
local score = -100000
|
||||
|
||||
local difficulty = def.difficulty or 1
|
||||
if def.trigger and def.trigger.target then
|
||||
difficulty = difficulty * def.trigger.target
|
||||
end
|
||||
score = score + difficulty
|
||||
|
||||
retval[#retval + 1] = {
|
||||
name = awardname,
|
||||
def = def,
|
||||
unlocked = true,
|
||||
started = true,
|
||||
score = score,
|
||||
progress = nil,
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Add all locked awards
|
||||
for _, def in pairs(awards.registered_awards) do
|
||||
if not hash_is_unlocked[def.name] and def:can_unlock(data) then
|
||||
local progress = def.get_progress and def:get_progress(data)
|
||||
local started = false
|
||||
local score = def.difficulty or 1
|
||||
if def.secret then
|
||||
score = 1000000
|
||||
elseif def.trigger and def.trigger.target and progress then
|
||||
local perc = progress.current / progress.target
|
||||
score = score * (1 - perc) * def.trigger.target
|
||||
if perc < 0.001 then
|
||||
score = score + 100
|
||||
else
|
||||
started = true
|
||||
end
|
||||
else
|
||||
score = 100
|
||||
end
|
||||
|
||||
retval[#retval + 1] = {
|
||||
name = def.name,
|
||||
def = def,
|
||||
unlocked = false,
|
||||
started = started,
|
||||
score = score,
|
||||
progress = progress,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
table.sort(retval, function(a, b)
|
||||
return a.score < b.score
|
||||
end)
|
||||
return retval
|
||||
end
|
||||
|
|
|
@ -2,9 +2,7 @@
|
|||
|
||||
local S, NS = awards.gettext, awards.ngettext
|
||||
|
||||
awards.registered_awards = {}
|
||||
awards.on = {}
|
||||
awards.on_unlock = {}
|
||||
|
||||
local default_def = {}
|
||||
|
||||
|
@ -43,11 +41,12 @@ function awards.register_trigger(tname, tdef)
|
|||
}
|
||||
tdef.register(tmp)
|
||||
|
||||
function def.getProgress(_, data)
|
||||
local done = math.min(data[tname] or 0, tmp.target)
|
||||
function def.get_progress(_, data)
|
||||
local current = math.min(data[tname] or 0, tmp.target)
|
||||
return {
|
||||
perc = done / tmp.target,
|
||||
label = S(tdef.progress, done, tmp.target),
|
||||
current = current,
|
||||
target = tmp.target,
|
||||
label = S(tdef.progress, current, tmp.target),
|
||||
}
|
||||
end
|
||||
|
||||
|
@ -102,7 +101,7 @@ function awards.register_trigger(tname, tdef)
|
|||
end
|
||||
|
||||
-- Called to get progress values and labels
|
||||
function def.getProgress(_, data)
|
||||
function def.get_progress(_, data)
|
||||
data[tname] = data[tname] or {}
|
||||
|
||||
local done
|
||||
|
@ -114,7 +113,8 @@ function awards.register_trigger(tname, tdef)
|
|||
done = math.min(done, tmp.target)
|
||||
|
||||
return {
|
||||
perc = done / tmp.target,
|
||||
current = done,
|
||||
target = tmp.target,
|
||||
label = S(tdef.progress, done, tmp.target),
|
||||
}
|
||||
end
|
||||
|
@ -144,8 +144,8 @@ function awards.register_trigger(tname, tdef)
|
|||
if tdef.key_is_item and key:sub(1, 6) ~= "group:" then
|
||||
local itemdef = minetest.registered_items[key]
|
||||
if itemdef then
|
||||
for groupname, _ in pairs(itemdef.groups or {}) do
|
||||
if tdef.watched_groups[groupname] then
|
||||
for groupname,rating in pairs(itemdef.groups or {}) do
|
||||
if rating ~= 0 and tdef.watched_groups[groupname] then
|
||||
tdef.notify(player, "group:" .. groupname, n)
|
||||
end
|
||||
end
|
||||
|
@ -160,8 +160,9 @@ function awards.register_trigger(tname, tdef)
|
|||
data[tname] = data[tname] or {}
|
||||
local currentVal = (data[tname][key] or 0) + n
|
||||
data[tname][key] = currentVal
|
||||
data[tname].__total = (data[tname].__total or 0)
|
||||
if key:sub(1, 6) ~= "group:" then
|
||||
data[tname].__total = (data[tname].__total or 0) + n
|
||||
data[tname].__total = data[tname].__total + n
|
||||
end
|
||||
|
||||
tdef:run_callbacks(player, data, function(entry)
|
||||
|
@ -173,7 +174,6 @@ function awards.register_trigger(tname, tdef)
|
|||
else
|
||||
return
|
||||
end
|
||||
|
||||
if current >= entry.target then
|
||||
return entry.award
|
||||
end
|
||||
|
@ -201,7 +201,7 @@ end
|
|||
|
||||
function awards.increment_item_counter(data, field, itemname, count)
|
||||
itemname = minetest.registered_aliases[itemname] or itemname
|
||||
data[field][itemname] = (data[field][itemname] or 0) + 1
|
||||
data[field][itemname] = (data[field][itemname] or 0) + (count or 1)
|
||||
end
|
||||
|
||||
function awards.get_item_count(data, field, itemname)
|
||||
|
|
|
@ -2,12 +2,13 @@
|
|||
|
||||
local S = awards.gettext
|
||||
|
||||
|
||||
-- Saint-Maclou
|
||||
if minetest.get_modpath("moreblocks") then
|
||||
awards.register_award("award_saint_maclou",{
|
||||
title = S("Saint-Maclou"),
|
||||
description = S("Place 20 coal checkers."),
|
||||
icon = "awards_novicebuilder.png",
|
||||
icon = "awards_saint_maclou.png",
|
||||
trigger = {
|
||||
type = "place",
|
||||
node = "moreblocks:coal_checker",
|
||||
|
@ -19,7 +20,7 @@ if minetest.get_modpath("moreblocks") then
|
|||
awards.register_award("award_castorama",{
|
||||
title = S("Castorama"),
|
||||
description = S("Place 20 iron checkers."),
|
||||
icon = "awards_novicebuilder.png",
|
||||
icon = "awards_castorama.png",
|
||||
trigger = {
|
||||
type = "place",
|
||||
node = "moreblocks:iron_checker",
|
||||
|
@ -31,7 +32,7 @@ if minetest.get_modpath("moreblocks") then
|
|||
awards.register_award("award_sam_the_trapper",{
|
||||
title = S("Sam the Trapper"),
|
||||
description = S("Place 2 trap stones."),
|
||||
icon = "awards_novicebuilder.png",
|
||||
icon = "awards_sam_the_trapper.png",
|
||||
trigger = {
|
||||
type = "place",
|
||||
node = "moreblocks:trap_stone",
|
||||
|
@ -46,7 +47,7 @@ if minetest.get_modpath("unified_inventory") then
|
|||
awards.register_award("awards_ui_bags", {
|
||||
title = S("Backpacker"),
|
||||
description = S("Craft 4 large bags."),
|
||||
icon = "awards_ui_bags.png",
|
||||
icon = "awards_backpacker.png",
|
||||
trigger = {
|
||||
type = "craft",
|
||||
item = "unified_inventory:bag_large",
|
||||
|
@ -60,7 +61,7 @@ if minetest.get_modpath("fire") then
|
|||
awards.register_award("awards_pyro", {
|
||||
title = S("Pyromaniac"),
|
||||
description = S("Craft 8 times flint and steel."),
|
||||
icon = "fire_flint_steel.png",
|
||||
icon = "awards_pyromaniac.png",
|
||||
trigger = {
|
||||
type = "craft",
|
||||
item = "fire:flint_and_steel",
|
||||
|
@ -79,14 +80,68 @@ if minetest.get_modpath("fire") then
|
|||
}
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
-- Burned to death
|
||||
awards.register_award("award_burn", {
|
||||
title = S("You're a witch!"),
|
||||
description = S("Burn to death in a fire."),
|
||||
secret = true,
|
||||
})
|
||||
awards.register_on_death(function(player,data)
|
||||
local pos = player:get_pos()
|
||||
if pos and minetest.find_node_near(pos, 2, "fire:basic_flame") ~= nil then
|
||||
return "award_burn"
|
||||
end
|
||||
return nil
|
||||
end)
|
||||
end
|
||||
|
||||
-- You Suck!
|
||||
awards.register_award("award_you_suck", {
|
||||
title = S("You Suck!"),
|
||||
description = S("Die 100 times."),
|
||||
trigger = {
|
||||
type = "death",
|
||||
target = 100
|
||||
},
|
||||
secret = true,
|
||||
})
|
||||
|
||||
-- Die hi
|
||||
awards.register_award("award_deep_down", {
|
||||
title = S("Death in the Deeps"),
|
||||
description = S("Die below -10000"),
|
||||
secret = true,
|
||||
})
|
||||
awards.register_on_death(function(player,data)
|
||||
local pos = player:get_pos()
|
||||
if pos and pos.y < -10000 then
|
||||
return "award_deep_down"
|
||||
end
|
||||
return nil
|
||||
end)
|
||||
|
||||
-- Die near diamond ore
|
||||
awards.register_award("award_no_screen", {
|
||||
title = S("In space, no one can hear you scream"),
|
||||
description = S("Die above 10000"),
|
||||
secret = true,
|
||||
})
|
||||
awards.register_on_death(function(player,data)
|
||||
local pos = player:get_pos()
|
||||
if pos and pos.y > 10000 then
|
||||
return "award_no_screen"
|
||||
end
|
||||
return nil
|
||||
end)
|
||||
|
||||
if minetest.get_modpath("default") then
|
||||
-- Light it up
|
||||
awards.register_award("award_lightitup",{
|
||||
title = S("Light It Up"),
|
||||
description = S("Place 100 torches."),
|
||||
icon = "awards_novicebuilder.png^awards_level1.png",
|
||||
icon = "awards_light_it_up.png^awards_level1.png",
|
||||
difficulty = 0.01,
|
||||
trigger = {
|
||||
type = "place",
|
||||
|
@ -98,7 +153,7 @@ if minetest.get_modpath("default") then
|
|||
-- Light ALL the things!
|
||||
awards.register_award("award_well_lit",{
|
||||
title = S("Well Lit"),
|
||||
icon = "awards_novicebuilder.png^awards_level2.png",
|
||||
icon = "awards_well_lit.png^awards_level2.png",
|
||||
description = S("Place 1,000 torches."),
|
||||
difficulty = 0.01,
|
||||
trigger = {
|
||||
|
@ -111,7 +166,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_meselamp",{
|
||||
title = S("Really Well Lit"),
|
||||
description = S("Craft 10 mese lamps."),
|
||||
icon = "default_meselamp.png",
|
||||
icon = "awards_really_well_lit.png",
|
||||
difficulty = 0.2,
|
||||
trigger = {
|
||||
type = "craft",
|
||||
|
@ -123,7 +178,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("awards_stonebrick", {
|
||||
title = S("Outpost"),
|
||||
description = S("Craft 200 stone bricks."),
|
||||
icon = "default_stone_brick.png^awards_level1.png",
|
||||
icon = "awards_outpost.png^awards_level1.png",
|
||||
difficulty = 0.08,
|
||||
trigger = {
|
||||
type = "craft",
|
||||
|
@ -135,7 +190,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("awards_stonebrick2", {
|
||||
title = S("Watchtower"),
|
||||
description = S("Craft 800 stone bricks."),
|
||||
icon = "default_stone_brick.png^awards_level2.png",
|
||||
icon = "awards_watchtower.png^awards_level2.png",
|
||||
difficulty = 0.08,
|
||||
trigger = {
|
||||
type = "craft",
|
||||
|
@ -147,7 +202,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("awards_stonebrick3", {
|
||||
title = S("Fortress"),
|
||||
description = S("Craft 3,200 stone bricks."),
|
||||
icon = "default_stone_brick.png^awards_level3.png",
|
||||
icon = "awards_fortress.png^awards_level3.png",
|
||||
difficulty = 0.08,
|
||||
trigger = {
|
||||
type = "craft",
|
||||
|
@ -159,7 +214,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("awards_desert_stonebrick", {
|
||||
title = S("Desert Dweller"),
|
||||
description = S("Craft 400 desert stone bricks."),
|
||||
icon = "default_desert_stone_brick.png",
|
||||
icon = "awards_desert_dweller.png",
|
||||
difficulty = 0.09,
|
||||
trigger = {
|
||||
type = "craft",
|
||||
|
@ -171,7 +226,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("awards_desertstonebrick", {
|
||||
title = S("Pharaoh"),
|
||||
description = S("Craft 100 sandstone bricks."),
|
||||
icon = "default_sandstone_brick.png",
|
||||
icon = "awards_pharaoh.png",
|
||||
difficulty = 0.09,
|
||||
trigger = {
|
||||
type = "craft",
|
||||
|
@ -183,7 +238,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("awards_bookshelf", {
|
||||
title = S("Little Library"),
|
||||
description = S("Craft 7 bookshelves."),
|
||||
icon = "default_bookshelf.png",
|
||||
icon = "awards_little_library.png",
|
||||
difficulty = 0.2,
|
||||
trigger = {
|
||||
type = "craft",
|
||||
|
@ -195,7 +250,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("awards_obsidian", {
|
||||
title = S("Lava and Water"),
|
||||
description = S("Mine your first obsidian."),
|
||||
icon = "default_obsidian.png^awards_level1.png",
|
||||
icon = "awards_lava_and_water.png^awards_level1.png",
|
||||
background = "awards_bg_mining.png",
|
||||
difficulty = 1.5,
|
||||
trigger = {
|
||||
|
@ -209,7 +264,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_obsessed_with_obsidian",{
|
||||
title = S("Obsessed with Obsidian"),
|
||||
description = S("Mine 50 obsidian."),
|
||||
icon = "default_obsidian.png^awards_level2.png",
|
||||
icon = "awards_obsessed_with_obsidian.png^awards_level2.png",
|
||||
background = "awards_bg_mining.png",
|
||||
difficulty = 1.5,
|
||||
trigger = {
|
||||
|
@ -223,8 +278,8 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_lavaminer",{
|
||||
title = S("Lava Miner"),
|
||||
description = S("Mine any block while being very close to lava."),
|
||||
icon = "awards_lava_miner.png",
|
||||
background = "awards_bg_mining.png",
|
||||
icon = "default_lava.png",
|
||||
difficulty = 1,
|
||||
})
|
||||
awards.register_on_dig(function(player,data)
|
||||
|
@ -240,7 +295,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_on_the_way", {
|
||||
title = S("On The Way"),
|
||||
description = S("Place 100 rails."),
|
||||
icon = "carts_rail_straight.png",
|
||||
icon = "awards_on_the_way.png",
|
||||
difficulty = 0.1,
|
||||
trigger = {
|
||||
type = "place",
|
||||
|
@ -252,7 +307,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_lumberjack_firstday", {
|
||||
title = S("First Day in the Woods"),
|
||||
description = S("Dig 6 tree blocks."),
|
||||
icon = "default_tree.png^awards_level1.png",
|
||||
icon = "awards_first_day_in_the_woods.png^awards_level1.png",
|
||||
difficulty = 0.03,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
|
@ -265,7 +320,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_lumberjack", {
|
||||
title = S("Lumberjack"),
|
||||
description = S("Dig 36 tree blocks."),
|
||||
icon = "default_tree.png^awards_level2.png",
|
||||
icon = "awards_lumberjack.png^awards_level2.png",
|
||||
difficulty = 0.03,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
|
@ -278,7 +333,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_lumberjack_semipro", {
|
||||
title = S("Semi-pro Lumberjack"),
|
||||
description = S("Dig 216 tree blocks."),
|
||||
icon = "default_tree.png^awards_level3.png",
|
||||
icon = "awards_semi_pro_lumberjack.png^awards_level3.png",
|
||||
difficulty = 0.03,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
|
@ -291,7 +346,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_lumberjack_professional", {
|
||||
title = S("Professional Lumberjack"),
|
||||
description = S("Dig 1,296 tree blocks."),
|
||||
icon = "default_tree.png^awards_level4.png",
|
||||
icon = "awards_professional_lumberjack.png^awards_level4.png",
|
||||
difficulty = 0.03,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
|
@ -304,7 +359,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_junglebaby", {
|
||||
title = S("Junglebaby"),
|
||||
description = S("Dig 100 jungle tree blocks."),
|
||||
icon = "default_jungletree.png^awards_level1.png",
|
||||
icon = "awards_junglebaby.png^awards_level1.png",
|
||||
difficulty = 0.05,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
|
@ -317,7 +372,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_jungleman", {
|
||||
title = S("Jungleman"),
|
||||
description = S("Dig 1,000 jungle tree blocks."),
|
||||
icon = "default_jungletree.png^awards_level2.png",
|
||||
icon = "awards_jungleman.png^awards_level2.png",
|
||||
difficulty = 0.05,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
|
@ -330,7 +385,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_mesefind", {
|
||||
title = S("First Mese Find"),
|
||||
description = S("Mine your first mese ore."),
|
||||
icon = "default_stone.png^default_mineral_mese.png",
|
||||
icon = "awards_first_mese_find.png",
|
||||
background = "awards_bg_mining.png",
|
||||
difficulty = 1,
|
||||
trigger = {
|
||||
|
@ -345,7 +400,7 @@ if minetest.get_modpath("default") then
|
|||
secret = true,
|
||||
title = S("Mese Mastery"),
|
||||
description = S("Mine a mese block."),
|
||||
icon = "default_mese_block.png",
|
||||
icon = "awards_mese_mastery.png",
|
||||
background = "awards_bg_mining.png",
|
||||
difficulty = 1.1,
|
||||
trigger = {
|
||||
|
@ -359,7 +414,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_youre_a_copper", {
|
||||
title = S("You’re a copper"),
|
||||
description = S("Dig 1,000 copper ores."),
|
||||
icon = "default_stone.png^default_mineral_copper.png",
|
||||
icon = "awards_youre_a_copper.png",
|
||||
background = "awards_bg_mining.png",
|
||||
difficulty = 0.2,
|
||||
trigger = {
|
||||
|
@ -373,7 +428,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_mine2", {
|
||||
title = S("Mini Miner"),
|
||||
description = S("Dig 100 stone blocks."),
|
||||
icon = "awards_miniminer.png^awards_level1.png",
|
||||
icon = "awards_mini_miner.png^awards_level1.png",
|
||||
background = "awards_bg_mining.png",
|
||||
difficulty = 0.02,
|
||||
trigger = {
|
||||
|
@ -387,7 +442,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_mine3", {
|
||||
title = S("Hardened Miner"),
|
||||
description = S("Dig 1,000 stone blocks."),
|
||||
icon = "awards_miniminer.png^awards_level2.png",
|
||||
icon = "awards_hardened_miner.png^awards_level2.png",
|
||||
background = "awards_bg_mining.png",
|
||||
difficulty = 0.02,
|
||||
trigger = {
|
||||
|
@ -401,7 +456,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_mine4", {
|
||||
title = S("Master Miner"),
|
||||
description = S("Dig 10,000 stone blocks."),
|
||||
icon = "awards_miniminer.png^awards_level3.png",
|
||||
icon = "awards_master_miner.png^awards_level3.png",
|
||||
background = "awards_bg_mining.png",
|
||||
difficulty = 0.02,
|
||||
trigger = {
|
||||
|
@ -415,7 +470,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_marchand_de_sable", {
|
||||
title = S("Marchand De Sable"),
|
||||
description = S("Dig 1,000 sand."),
|
||||
icon = "default_sand.png",
|
||||
icon = "awards_marchand_de_sable.png",
|
||||
background = "awards_bg_mining.png",
|
||||
difficulty = 0.05,
|
||||
trigger = {
|
||||
|
@ -428,7 +483,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("awards_crafter_of_sticks", {
|
||||
title = S("Crafter of Sticks"),
|
||||
description = S("Craft 100 sticks."),
|
||||
icon = "default_stick.png",
|
||||
icon = "awards_crafter_of_sticks.png",
|
||||
difficulty = 0.01,
|
||||
trigger = {
|
||||
type = "craft",
|
||||
|
@ -440,7 +495,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("awards_junglegrass", {
|
||||
title = S("Jungle Discoverer"),
|
||||
description = S("Mine your first jungle grass."),
|
||||
icon = "default_junglegrass.png",
|
||||
icon = "awards_jungle_discoverer.png",
|
||||
difficulty = 0.009,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
|
@ -452,7 +507,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("awards_grass", {
|
||||
title = S("Grasslands Discoverer"),
|
||||
description = S("Mine some grass."),
|
||||
icon = "default_grass_3.png",
|
||||
icon = "awards_grasslands_discoverer.png",
|
||||
difficulty = 0.009,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
|
@ -464,7 +519,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("awards_dry_grass", {
|
||||
title = S("Savannah Discoverer"),
|
||||
description = S("Mine some dry grass."),
|
||||
icon = "default_dry_grass_3.png",
|
||||
icon = "awards_savannah_discoverer.png",
|
||||
difficulty = 0.009,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
|
@ -476,7 +531,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("awards_cactus", {
|
||||
title = S("Desert Discoverer"),
|
||||
description = S("Mine your first cactus."),
|
||||
icon = "default_cactus_side.png",
|
||||
icon = "awards_desert_discoverer.png",
|
||||
difficulty = 0.03,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
|
@ -488,7 +543,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("awards_dry_shrub", {
|
||||
title = S("Far Lands"),
|
||||
description = S("Mine your first dry shrub."),
|
||||
icon = "default_dry_shrub.png",
|
||||
icon = "awards_far_lands.png",
|
||||
difficulty = 0.009,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
|
@ -500,7 +555,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("awards_ice", {
|
||||
title = S("Glacier Discoverer"),
|
||||
description = S("Mine your first ice."),
|
||||
icon = "default_ice.png",
|
||||
icon = "awards_glacier_discoverer.png",
|
||||
difficulty = 0.02,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
|
@ -513,7 +568,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("awards_snowblock", {
|
||||
title = S("Very Simple Snow Man"),
|
||||
description = S("Place two snow blocks."),
|
||||
icon = "default_snow.png",
|
||||
icon = "awards_very_simple_snow_man.png",
|
||||
difficulty = 0.02,
|
||||
trigger = {
|
||||
type = "place",
|
||||
|
@ -525,7 +580,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("awards_gold_ore", {
|
||||
title = S("First Gold Find"),
|
||||
description = S("Mine your first gold ore."),
|
||||
icon = "default_stone.png^default_mineral_gold.png^awards_level1.png",
|
||||
icon = "awards_first_gold_find.png^awards_level1.png",
|
||||
background = "awards_bg_mining.png",
|
||||
difficulty = 0.9,
|
||||
trigger = {
|
||||
|
@ -538,7 +593,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("awards_gold_rush", {
|
||||
title = S("Gold Rush"),
|
||||
description = S("Mine 45 gold ores."),
|
||||
icon = "default_stone.png^default_mineral_gold.png^awards_level2.png",
|
||||
icon = "awards_gold_rush.png^awards_level2.png",
|
||||
background = "awards_bg_mining.png",
|
||||
difficulty = 0.9,
|
||||
trigger = {
|
||||
|
@ -551,7 +606,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("awards_diamond_ore", {
|
||||
title = S("Wow, I am Diamonds!"),
|
||||
description = S("Mine your first diamond ore."),
|
||||
icon = "default_stone.png^default_mineral_diamond.png^awards_level1.png",
|
||||
icon = "awards_wow_i_am_diamonds.png^awards_level1.png",
|
||||
difficulty = 1,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
|
@ -563,7 +618,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("awards_diamond_rush", {
|
||||
title = S("Girl's Best Friend"),
|
||||
description = S("Mine 18 diamond ores."),
|
||||
icon = "default_stone.png^default_mineral_diamond.png^awards_level2.png",
|
||||
icon = "awards_girls_best_friend.png^awards_level2.png",
|
||||
background = "awards_bg_mining.png",
|
||||
difficulty = 1,
|
||||
trigger = {
|
||||
|
@ -576,7 +631,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("awards_diamondblock", {
|
||||
title = S("Hardest Block on Earth"),
|
||||
description = S("Craft a diamond block."),
|
||||
icon = "default_diamond_block.png",
|
||||
icon = "awards_hardest_block_on_earth.png",
|
||||
difficulty = 1.1,
|
||||
trigger = {
|
||||
type = "craft",
|
||||
|
@ -588,7 +643,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("awards_mossycobble", {
|
||||
title = S("In the Dungeon"),
|
||||
description = S("Mine a mossy cobblestone."),
|
||||
icon = "default_mossycobble.png",
|
||||
icon = "awards_in_the_dungeon.png",
|
||||
difficulty = 0.9,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
|
@ -600,7 +655,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_furnace", {
|
||||
title = S("Smelter"),
|
||||
description = S("Craft 10 furnaces."),
|
||||
icon = "default_furnace_front.png",
|
||||
icon = "awards_smelter.png",
|
||||
difficulty = 0.08,
|
||||
trigger = {
|
||||
type = "craft",
|
||||
|
@ -612,7 +667,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_chest", {
|
||||
title = S("Treasurer"),
|
||||
description = S("Craft 15 chests."),
|
||||
icon = "default_chest_front.png",
|
||||
icon = "awards_treasurer.png",
|
||||
difficulty = 0.08,
|
||||
trigger = {
|
||||
type = "craft",
|
||||
|
@ -622,9 +677,9 @@ if minetest.get_modpath("default") then
|
|||
})
|
||||
|
||||
awards.register_award("award_chest2", {
|
||||
title = S("Bankier"),
|
||||
title = S("Banker"),
|
||||
description = S("Craft 30 locked chests."),
|
||||
icon = "default_chest_lock.png",
|
||||
icon = "awards_banker.png",
|
||||
difficulty = 0.08,
|
||||
trigger = {
|
||||
type = "craft",
|
||||
|
@ -636,7 +691,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_brick", {
|
||||
title = S("Bricker"),
|
||||
description = S("Craft 200 brick blocks."),
|
||||
icon = "default_brick.png",
|
||||
icon = "awards_bricker.png",
|
||||
difficulty = 0.03,
|
||||
trigger = {
|
||||
type = "craft",
|
||||
|
@ -648,7 +703,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_obsidianbrick", {
|
||||
title = S("House of Obsidian"),
|
||||
description = S("Craft 100 obsidian bricks."),
|
||||
icon = "default_obsidian_brick.png",
|
||||
icon = "awards_house_of_obsidian.png",
|
||||
difficulty = 0.4,
|
||||
trigger = {
|
||||
type = "craft",
|
||||
|
@ -660,7 +715,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_placestone", {
|
||||
title = S("Build a Cave"),
|
||||
description = S("Place 100 stone."),
|
||||
icon = "default_stone.png",
|
||||
icon = "awards_build_a_cave.png",
|
||||
difficulty = 0.1,
|
||||
trigger = {
|
||||
type = "place",
|
||||
|
@ -672,7 +727,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_woodladder", {
|
||||
title = S("Long Ladder"),
|
||||
description = S("Place 400 wooden ladders."),
|
||||
icon = "default_ladder_wood.png",
|
||||
icon = "awards_long_ladder.png",
|
||||
difficulty = 0.1,
|
||||
trigger = {
|
||||
type = "place",
|
||||
|
@ -684,7 +739,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_steelladder", {
|
||||
title = S("Industrial Age"),
|
||||
description = S("Place 40 steel ladders."),
|
||||
icon = "default_ladder_steel.png",
|
||||
icon = "awards_industrial_age.png",
|
||||
difficulty = 1,
|
||||
trigger = {
|
||||
type = "place",
|
||||
|
@ -696,7 +751,7 @@ if minetest.get_modpath("default") then
|
|||
awards.register_award("award_apples", {
|
||||
title = S("Yummy!"),
|
||||
description = S("Eat 80 apples."),
|
||||
icon = "default_apple.png",
|
||||
icon = "awards_yummy.png",
|
||||
difficulty = 0.1,
|
||||
trigger = {
|
||||
type = "eat",
|
||||
|
@ -704,12 +759,57 @@ if minetest.get_modpath("default") then
|
|||
target = 80
|
||||
}
|
||||
})
|
||||
|
||||
-- Died in flowing lava
|
||||
awards.register_award("award_in_the_flow", {
|
||||
title = S("In the Flow"),
|
||||
description = S("Die in flowing lava."),
|
||||
secret = true,
|
||||
})
|
||||
awards.register_on_death(function(player,data)
|
||||
local pos = player:get_pos()
|
||||
if pos and (minetest.find_node_near(pos, 2, "default:lava_flowing") ~= nil or
|
||||
minetest.find_node_near(pos, 2, "default:lava_source") ~= nil) then
|
||||
return "award_in_the_flow"
|
||||
end
|
||||
return nil
|
||||
end)
|
||||
|
||||
-- Die near diamond ore
|
||||
awards.register_award("award_this_is_sad", {
|
||||
title = S("This is Sad"),
|
||||
description = S("Die near diamond ore."),
|
||||
secret = true,
|
||||
})
|
||||
awards.register_on_death(function(player,data)
|
||||
local pos = player:get_pos()
|
||||
if pos and minetest.find_node_near(pos, 5, "default:stone_with_diamond") ~= nil then
|
||||
return "award_this_is_sad"
|
||||
end
|
||||
return nil
|
||||
end)
|
||||
end
|
||||
|
||||
if minetest.get_modpath("bones") then
|
||||
-- Die near bones
|
||||
awards.register_award("award_the_stack", {
|
||||
title = S("Graveyard"),
|
||||
description = S("Die near bones."),
|
||||
secret = true,
|
||||
})
|
||||
awards.register_on_death(function(player,data)
|
||||
local pos = player:get_pos()
|
||||
if pos and minetest.find_node_near(pos, 5, "bones:bones") ~= nil then
|
||||
return "award_the_stack"
|
||||
end
|
||||
return nil
|
||||
end)
|
||||
end
|
||||
|
||||
if minetest.get_modpath("vessels") then
|
||||
awards.register_award("award_vessels_shelf", {
|
||||
title = S("Glasser"),
|
||||
icon = "vessels_shelf.png",
|
||||
icon = "awards_glasser.png",
|
||||
description = S("Craft 14 vessels shelves."),
|
||||
trigger = {
|
||||
type = "craft",
|
||||
|
@ -723,7 +823,7 @@ if minetest.get_modpath("farming") then
|
|||
awards.register_award("awards_farmer", {
|
||||
title = S("Farming Skills Acquired"),
|
||||
description = S("Harvest a fully grown wheat plant."),
|
||||
icon = "farming_wheat_8.png^awards_level1.png",
|
||||
icon = "awards_farming_skills_acquired.png^awards_level1.png",
|
||||
trigger = {
|
||||
type = "dig",
|
||||
node = "farming:wheat_8",
|
||||
|
@ -733,7 +833,7 @@ if minetest.get_modpath("farming") then
|
|||
awards.register_award("awards_farmer2", {
|
||||
title = S("Field Worker"),
|
||||
description = S("Harvest 25 fully grown wheat plants."),
|
||||
icon = "farming_wheat_8.png^awards_level2.png",
|
||||
icon = "awards_field_worker.png^awards_level2.png",
|
||||
trigger = {
|
||||
type = "dig",
|
||||
node = "farming:wheat_8",
|
||||
|
@ -744,7 +844,7 @@ if minetest.get_modpath("farming") then
|
|||
awards.register_award("awards_farmer3", {
|
||||
title = S("Aspiring Farmer"),
|
||||
description = S("Harvest 125 fully grown wheat plants."),
|
||||
icon = "farming_wheat_8.png^awards_level3.png",
|
||||
icon = "awards_aspiring_farmer.png^awards_level3.png",
|
||||
trigger = {
|
||||
type = "dig",
|
||||
node = "farming:wheat_8",
|
||||
|
@ -755,7 +855,7 @@ if minetest.get_modpath("farming") then
|
|||
awards.register_award("awards_farmer4", {
|
||||
title = S("Wheat Magnate"),
|
||||
description = S("Harvest 625 fully grown wheat plants."),
|
||||
icon = "farming_wheat_8.png^awards_level4.png",
|
||||
icon = "awards_wheat_magnate.png^awards_level4.png",
|
||||
trigger = {
|
||||
type = "dig",
|
||||
node = "farming:wheat_8",
|
||||
|
@ -766,7 +866,7 @@ if minetest.get_modpath("farming") then
|
|||
awards.register_award("award_bread", {
|
||||
title = S("Baker"),
|
||||
description = S("Eat 10 loaves of bread."),
|
||||
icon = "farming_bread.png",
|
||||
icon = "awards_baker.png",
|
||||
trigger = {
|
||||
type = "eat",
|
||||
item = "farming:bread",
|
||||
|
@ -780,7 +880,7 @@ if minetest.get_modpath("wool") and minetest.get_modpath("farming") then
|
|||
awards.register_award("awards_wool", {
|
||||
title = S("Wool Over Your Eyes"),
|
||||
description = S("Craft 250 white wool."),
|
||||
icon = "wool_white.png",
|
||||
icon = "awards_wool_over_your_eyes.png",
|
||||
trigger = {
|
||||
type = "craft",
|
||||
item = "wool:white",
|
||||
|
@ -793,7 +893,7 @@ if minetest.get_modpath("beds") then
|
|||
awards.register_award("award_bed", {
|
||||
title = S("Hotelier"),
|
||||
description = S("Craft 15 fancy beds."),
|
||||
icon = "beds_bed_fancy.png",
|
||||
icon = "awards_hotelier.png",
|
||||
trigger = {
|
||||
type = "craft",
|
||||
item= "beds:fancy_bed_bottom",
|
||||
|
@ -806,7 +906,7 @@ if minetest.get_modpath("stairs") then
|
|||
awards.register_award("award_stairs_goldblock", {
|
||||
title = S("Filthy Rich"),
|
||||
description = S("Craft 24 gold block stairs."),
|
||||
icon = "default_gold_block.png",
|
||||
icon = "awards_filthy_rich.png",
|
||||
trigger = {
|
||||
type = "craft",
|
||||
item= "stairs:stair_goldblock",
|
||||
|
@ -819,7 +919,7 @@ if minetest.get_modpath("dye") then
|
|||
awards.register_award("awards_dye_red", {
|
||||
title = S("Roses Are Red"),
|
||||
description = S("Craft 400 red dyes."),
|
||||
icon = "dye_red.png",
|
||||
icon = "awards_roses_are_red.png",
|
||||
trigger = {
|
||||
type = "craft",
|
||||
item = "dye:red",
|
||||
|
@ -830,7 +930,7 @@ if minetest.get_modpath("dye") then
|
|||
awards.register_award("awards_dye_yellow", {
|
||||
title = S("Dandelions are Yellow"),
|
||||
description = S("Craft 400 yellow dyes."),
|
||||
icon = "dye_yellow.png",
|
||||
icon = "awards_dandelions_are_yellow.png",
|
||||
trigger = {
|
||||
type = "craft",
|
||||
item = "dye:yellow",
|
||||
|
@ -841,7 +941,7 @@ if minetest.get_modpath("dye") then
|
|||
awards.register_award("awards_dye_blue", {
|
||||
title = S("Geraniums are Blue"),
|
||||
description = S("Craft 400 blue dyes."),
|
||||
icon = "dye_blue.png",
|
||||
icon = "awards_geraniums_are_blue.png",
|
||||
trigger = {
|
||||
type = "craft",
|
||||
item= "dye:blue",
|
||||
|
@ -852,7 +952,7 @@ if minetest.get_modpath("dye") then
|
|||
awards.register_award("awards_dye_white", {
|
||||
title = S("White Color Stock"),
|
||||
description = S("Craft 100 white dyes."),
|
||||
icon = "dye_white.png",
|
||||
icon = "awards_white_color_stock.png",
|
||||
trigger = {
|
||||
type = "craft",
|
||||
item= "dye:white",
|
||||
|
@ -865,7 +965,7 @@ if minetest.get_modpath("flowers") then
|
|||
awards.register_award("awards_brown_mushroom1", {
|
||||
title = S("Tasty Mushrooms"),
|
||||
description = S("Eat 3 brown mushrooms."),
|
||||
icon = "flowers_mushroom_brown.png^awards_level1.png",
|
||||
icon = "awards_tasty_mushrooms.png^awards_level1.png",
|
||||
trigger = {
|
||||
type = "eat",
|
||||
item= "flowers:mushroom_brown",
|
||||
|
@ -875,7 +975,7 @@ if minetest.get_modpath("flowers") then
|
|||
awards.register_award("awards_brown_mushroom2", {
|
||||
title = S("Mushroom Lover"),
|
||||
description = S("Eat 33 brown mushrooms."),
|
||||
icon = "flowers_mushroom_brown.png^awards_level2.png",
|
||||
icon = "awards_mushroom_lover.png^awards_level2.png",
|
||||
trigger = {
|
||||
type = "eat",
|
||||
item= "flowers:mushroom_brown",
|
||||
|
@ -885,7 +985,7 @@ if minetest.get_modpath("flowers") then
|
|||
awards.register_award("awards_brown_mushroom3", {
|
||||
title = S("Underground Mushroom Farmer"),
|
||||
description = S("Eat 333 brown mushrooms."),
|
||||
icon = "flowers_mushroom_brown.png^awards_level3.png",
|
||||
icon = "awards_underground_mushroom_farmer.png^awards_level3.png",
|
||||
trigger = {
|
||||
type = "eat",
|
||||
item= "flowers:mushroom_brown",
|
||||
|
@ -912,15 +1012,15 @@ minetest.after(0, function()
|
|||
|
||||
awards.register_award("awards_builder1", {
|
||||
title = S("Builder"),
|
||||
icon = "awards_house.png^awards_level1.png",
|
||||
icon = "awards_builder.png^awards_level1.png",
|
||||
trigger = {
|
||||
type = "place",
|
||||
target = 1000,
|
||||
},
|
||||
})
|
||||
awards.register_award("awards_builder2", {
|
||||
title = S("Constructor"),
|
||||
icon = "awards_house.png^awards_level2.png",
|
||||
title = S("Engineer"),
|
||||
icon = "awards_engineer.png^awards_level2.png",
|
||||
trigger = {
|
||||
type = "place",
|
||||
target = 5000,
|
||||
|
@ -928,7 +1028,7 @@ minetest.after(0, function()
|
|||
})
|
||||
awards.register_award("awards_builder3", {
|
||||
title = S("Architect"),
|
||||
icon = "awards_house.png^awards_level3.png",
|
||||
icon = "awards_architect.png^awards_level3.png",
|
||||
trigger = {
|
||||
type = "place",
|
||||
target = 10000,
|
||||
|
@ -936,7 +1036,7 @@ minetest.after(0, function()
|
|||
})
|
||||
awards.register_award("awards_builder4", {
|
||||
title = S("Master Architect"),
|
||||
icon = "awards_house.png^awards_level4.png",
|
||||
icon = "awards_master_architect.png^awards_level4.png",
|
||||
trigger = {
|
||||
type = "place",
|
||||
target = 25000,
|
||||
|
@ -950,7 +1050,7 @@ if minetest.get_modpath("nyancat") then
|
|||
secret = true,
|
||||
title = S("A Cat in a Pop-Tart?!"),
|
||||
description = S("Mine a nyan cat."),
|
||||
icon = "nyancat_front.png",
|
||||
icon = "awards_a_cat_in_a_pop_tart.png",
|
||||
trigger = {
|
||||
type = "dig",
|
||||
node = "nyancat:nyancat",
|
||||
|
@ -958,3 +1058,53 @@ if minetest.get_modpath("nyancat") then
|
|||
}
|
||||
})
|
||||
end
|
||||
|
||||
if minetest.get_modpath("pipeworks") then
|
||||
awards.register_award("award_pipeworks_transporter", {
|
||||
title = S("Item transporter"),
|
||||
description = S("Place 10000 tubes."),
|
||||
difficulty = 0.05,
|
||||
trigger = {
|
||||
type = "place",
|
||||
node = "pipeworks:tube_1",
|
||||
target = 2000,
|
||||
}
|
||||
})
|
||||
|
||||
awards.register_award("award_pipeworks_automator", {
|
||||
title = S("Factory"),
|
||||
description = S("Place 5 autocrafters."),
|
||||
difficulty = 3,
|
||||
trigger = {
|
||||
type = "place",
|
||||
node = "pipeworks:autocrafter",
|
||||
target = 5,
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
if minetest.get_modpath("mesecons") then
|
||||
awards.register_award("awards_mesecons", {
|
||||
title = S("Electical Engineer"),
|
||||
description = S("Place 500 mesecon wires."),
|
||||
difficulty = 0.2,
|
||||
trigger = {
|
||||
type = "place",
|
||||
node = "mesecons:wire_00000000_off",
|
||||
target = 500,
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
if minetest.get_modpath("basic_materials") then
|
||||
awards.register_award("awards_oil", {
|
||||
title = S("Oil Typhoon"),
|
||||
description = S("Craft 500 times oil extract."),
|
||||
|
||||
trigger = {
|
||||
type = "craft",
|
||||
item = "basic_materials:oil_extract",
|
||||
target = 500,
|
||||
}
|
||||
})
|
||||
end
|
||||
|
|
|
@ -2,73 +2,9 @@
|
|||
|
||||
local S = awards.gettext
|
||||
|
||||
local function order_awards(name)
|
||||
local hash_is_unlocked = {}
|
||||
local retval = {}
|
||||
|
||||
local data = awards.player(name)
|
||||
if data and data.unlocked then
|
||||
for awardname, _ in pairs(data.unlocked) do
|
||||
local def = awards.registered_awards[awardname]
|
||||
if def then
|
||||
hash_is_unlocked[awardname] = true
|
||||
local score = -100000
|
||||
|
||||
local difficulty = def.difficulty or 1
|
||||
if def.trigger and def.trigger.target then
|
||||
difficulty = difficulty * def.trigger.target
|
||||
end
|
||||
score = score + difficulty
|
||||
|
||||
retval[#retval + 1] = {
|
||||
name = awardname,
|
||||
def = def,
|
||||
unlocked = true,
|
||||
started = true,
|
||||
score = score,
|
||||
}
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
for _, def in pairs(awards.registered_awards) do
|
||||
if not hash_is_unlocked[def.name] and def:can_unlock(data) then
|
||||
local started = false
|
||||
local score = def.difficulty or 1
|
||||
if def.secret then
|
||||
score = 1000000
|
||||
elseif def.trigger and def.trigger.target and def.getProgress then
|
||||
local progress = def:getProgress(data).perc
|
||||
score = score * (1 - progress) * def.trigger.target
|
||||
if progress < 0.001 then
|
||||
score = score + 100
|
||||
else
|
||||
started = true
|
||||
end
|
||||
else
|
||||
score = 100
|
||||
end
|
||||
|
||||
retval[#retval + 1] = {
|
||||
name = def.name,
|
||||
def = def,
|
||||
unlocked = false,
|
||||
started = started,
|
||||
score = score,
|
||||
}
|
||||
end
|
||||
end
|
||||
|
||||
table.sort(retval, function(a, b)
|
||||
return a.score < b.score
|
||||
end)
|
||||
return retval
|
||||
end
|
||||
|
||||
function awards.get_formspec(name, to, sid)
|
||||
local formspec = ""
|
||||
local awards_list = order_awards(name)
|
||||
local data = awards.player(name)
|
||||
local awards_list = awards.get_award_states(name)
|
||||
|
||||
if #awards_list == 0 then
|
||||
formspec = formspec .. "label[3.9,1.5;"..minetest.formspec_escape(S("Error: No achivements available.")).."]"
|
||||
|
@ -104,17 +40,13 @@ function awards.get_formspec(name, to, sid)
|
|||
";]"
|
||||
|
||||
if sdef and sdef.icon then
|
||||
formspec = formspec .. "image[0.6,0;3,3;" .. sdef.icon .. "]"
|
||||
formspec = formspec .. "image[0.45,0;3.5,3.5;" .. sdef.icon .. "]" -- adjusted values from 0.6,0;3,3
|
||||
end
|
||||
local barwidth = 3.95
|
||||
local perc = nil
|
||||
local label = nil
|
||||
if sdef.getProgress and data then
|
||||
local res = sdef:getProgress(data)
|
||||
perc = res.perc
|
||||
label = res.label
|
||||
end
|
||||
if perc then
|
||||
|
||||
if sitem.progress then
|
||||
local barwidth = 3.95
|
||||
local perc = sitem.progress.current / sitem.progress.target
|
||||
local label = sitem.progress.label
|
||||
if perc > 1 then
|
||||
perc = 1
|
||||
end
|
||||
|
@ -124,6 +56,7 @@ function awards.get_formspec(name, to, sid)
|
|||
formspec = formspec .. "label[1.6,8.15;" .. minetest.formspec_escape(label) .. "]"
|
||||
end
|
||||
end
|
||||
|
||||
if sdef and sdef.description then
|
||||
formspec = formspec .. "box[-0.05,3.75;3.9,4.2;#000]"
|
||||
formspec = formspec .. "textarea[0.25,3.75;3.9,4.2;;" ..
|
||||
|
@ -174,7 +107,7 @@ function awards.show_to(name, to, sid, text)
|
|||
return
|
||||
end
|
||||
if text then
|
||||
local awards_list = order_awards(name)
|
||||
local awards_list = awards.get_award_states(name)
|
||||
if #awards_list == 0 then
|
||||
minetest.chat_send_player(to, S("Error: No award available."))
|
||||
return
|
||||
|
|
|
@ -14,6 +14,10 @@
|
|||
-- 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
|
||||
--
|
||||
|
||||
-- Check if a player object is valid for awards.
|
||||
local function player_ok(player)
|
||||
return player and player.is_player and player:is_player() and not player.is_fake_player
|
||||
end
|
||||
|
||||
awards.register_trigger("chat", {
|
||||
type = "counted",
|
||||
|
@ -22,7 +26,7 @@ awards.register_trigger("chat", {
|
|||
})
|
||||
minetest.register_on_chat_message(function(name, message)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if not player or string.find(message, "/") then
|
||||
if not player_ok(player) or string.find(message, "/") then
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -68,7 +72,7 @@ awards.register_trigger("dig", {
|
|||
key_is_item = true,
|
||||
})
|
||||
minetest.register_on_dignode(function(pos, node, player)
|
||||
if not player or not pos or not node then
|
||||
if not player_ok(player) or not pos or not node then
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -89,7 +93,7 @@ awards.register_trigger("place", {
|
|||
key_is_item = true,
|
||||
})
|
||||
minetest.register_on_placenode(function(pos, node, player)
|
||||
if not player or not pos or not node then
|
||||
if not player_ok(player) or not pos or not node then
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -110,7 +114,7 @@ awards.register_trigger("craft", {
|
|||
key_is_item = true,
|
||||
})
|
||||
minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv)
|
||||
if not player or itemstack:is_empty() then
|
||||
if not player_ok(player) or itemstack:is_empty() then
|
||||
return
|
||||
end
|
||||
|
||||
|
@ -131,11 +135,11 @@ awards.register_trigger("eat", {
|
|||
key_is_item = true,
|
||||
})
|
||||
minetest.register_on_item_eat(function(_, _, itemstack, player, _)
|
||||
if not player or itemstack:is_empty() then
|
||||
if not player_ok(player) or itemstack:is_empty() then
|
||||
return
|
||||
end
|
||||
|
||||
local itemname = itemstack:get_name()
|
||||
itemname = minetest.registered_aliases[itemname] or itemname
|
||||
awards.notify_craft(player, itemname, itemstack:get_count())
|
||||
awards.notify_eat(player, itemname)
|
||||
end)
|
||||
|
|
After Width: | Height: | Size: 45 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 993 B |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 486 B After Width: | Height: | Size: 967 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 591 B |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 2.0 KiB |
After Width: | Height: | Size: 1.9 KiB |
After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 195 B After Width: | Height: | Size: 201 B |
Before Width: | Height: | Size: 194 B After Width: | Height: | Size: 202 B |
Before Width: | Height: | Size: 193 B After Width: | Height: | Size: 202 B |
Before Width: | Height: | Size: 175 B After Width: | Height: | Size: 202 B |
Before Width: | Height: | Size: 177 B After Width: | Height: | Size: 202 B |
Before Width: | Height: | Size: 191 B After Width: | Height: | Size: 202 B |
Before Width: | Height: | Size: 178 B After Width: | Height: | Size: 188 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.5 KiB |
Before Width: | Height: | Size: 564 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 455 B |
After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 374 B |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.5 KiB |
After Width: | Height: | Size: 1.8 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 887 B |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 916 B |
After Width: | Height: | Size: 2.2 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.2 KiB |
After Width: | Height: | Size: 1.3 KiB |
Before Width: | Height: | Size: 322 B After Width: | Height: | Size: 394 B |
After Width: | Height: | Size: 1.9 KiB |
Before Width: | Height: | Size: 612 B |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 322 B After Width: | Height: | Size: 1.0 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.4 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.6 KiB |
After Width: | Height: | Size: 1.7 KiB |
After Width: | Height: | Size: 1.4 KiB |