mirror of
https://gitlab.com/rubenwardy/awards.git
synced 2025-06-28 22:26:17 +02:00
Compare commits
31 Commits
Author | SHA1 | Date | |
---|---|---|---|
c6151abbe9 | |||
c27d527cfc | |||
37082d1186 | |||
6dc91cf893 | |||
9c74a3f85a | |||
b4a4a1fd74 | |||
8702b6cdd8 | |||
4e8d175714 | |||
c7b60be880 | |||
ce58720493 | |||
d542042a50 | |||
7e3064ef93 | |||
9d98f950b8 | |||
8a34ea8055 | |||
baf79bf9bf | |||
da3d9b3980 | |||
8f46d5b37d | |||
4f5260da5f | |||
89d4a93f3b | |||
cae2c1ee3b | |||
54db6ce0c0 | |||
1ffa8f10ac | |||
fb1670abc6 | |||
38b7d9aa91 | |||
805720b4af | |||
29a1b97b38 | |||
b856aea54d | |||
570fd3a206 | |||
417ac0fe46 | |||
1ab08d68c9 | |||
32150bdd66 |
95
README.md
95
README.md
@ -7,25 +7,6 @@ With thanks to Wuzzy, kaeza, and MrIbby.
|
||||
|
||||
Majority of awards are back ported from Calinou's old fork in Carbone, under same license.
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
# Introduction
|
||||
|
||||
@ -56,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", {
|
||||
@ -141,9 +123,13 @@ Here's an example.
|
||||
|
||||
```lua
|
||||
awards.register_trigger("foo", {
|
||||
type = "counted",
|
||||
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()
|
||||
@ -187,34 +173,65 @@ end
|
||||
|
||||
# API
|
||||
|
||||
* awards.register_award(name, def), the def table has the following fields:
|
||||
* `description` - the title of the award. Required.
|
||||
## 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).
|
||||
* `requires` - list of awards that need to be unlocked before this one
|
||||
is visible.
|
||||
* `prizes` - list of items to give when you earn the award
|
||||
* `secret` - boolean if this award is secret (i.e. showed on awards list)
|
||||
* `sound` - `SimpleSoundSpec` table to play on unlock.
|
||||
`false` to disable unlock sound.
|
||||
* `image` - the icon image, use default otherwise.
|
||||
* `background` - the background image, use default otherwise.
|
||||
* `icon` - the icon image. Defaults to `awards_unknown.png`.
|
||||
* `hud_background` - the background image used in the HUD to contain the text and icon.
|
||||
Defaults to `awards_bg_default.png`.
|
||||
* `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 from appearing.
|
||||
* `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
|
||||
|
||||
@ -267,7 +284,7 @@ trigger = {
|
||||
```lua
|
||||
trigger = {
|
||||
type = "craft",
|
||||
node = "default:dirt", -- item, alias, or group
|
||||
item = "default:dirt", -- item, alias, or group
|
||||
target = 50,
|
||||
}
|
||||
```
|
||||
|
529
api.lua
529
api.lua
@ -1,529 +0,0 @@
|
||||
-- Copyright (c) 2013-18 rubenwardy. MIT.
|
||||
|
||||
local S, NS = awards.gettext, awards.ngettext
|
||||
|
||||
awards.registered_awards = {}
|
||||
awards.on = {}
|
||||
awards.on_unlock = {}
|
||||
|
||||
local storage = minetest.get_mod_storage()
|
||||
|
||||
-- Table Save Load Functions
|
||||
function awards.save()
|
||||
storage:set_string("player_data", minetest.write_json(awards.players))
|
||||
end
|
||||
|
||||
local function convert_data()
|
||||
minetest.log("warning", "Importing awards data from previous version")
|
||||
|
||||
local old_players = awards.players
|
||||
awards.players = {}
|
||||
for name, data in pairs(old_players) do
|
||||
while name.name do
|
||||
name = name.name
|
||||
end
|
||||
data.name = name
|
||||
print("Converting data for " .. name)
|
||||
|
||||
-- Just rename counted
|
||||
local counted = {
|
||||
chats = "chat",
|
||||
deaths = "death",
|
||||
joins = "join",
|
||||
}
|
||||
for from, to in pairs(counted) do
|
||||
data[to] = data[from]
|
||||
data[from] = nil
|
||||
end
|
||||
|
||||
data.death = {
|
||||
unknown = data.death,
|
||||
__total = data.death,
|
||||
}
|
||||
|
||||
-- Convert item db to new format
|
||||
local counted_items = {
|
||||
count = "dig",
|
||||
place = "place",
|
||||
craft = "craft",
|
||||
}
|
||||
for from, to in pairs(counted_items) do
|
||||
local ret = {}
|
||||
|
||||
local count = 0
|
||||
if data[from] then
|
||||
for modname, items in pairs(data[from]) do
|
||||
for itemname, value in pairs(items) do
|
||||
itemname = modname .. ":" .. itemname
|
||||
local key = minetest.registered_aliases[itemname] or itemname
|
||||
ret[key] = value
|
||||
count = count + value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ret.__total = count
|
||||
data[from] = nil
|
||||
data[to] = ret
|
||||
end
|
||||
|
||||
awards.players[name] = data
|
||||
end
|
||||
end
|
||||
|
||||
function awards.load()
|
||||
local old_save_path = minetest.get_worldpath().."/awards.txt"
|
||||
local file = io.open(old_save_path, "r")
|
||||
if file then
|
||||
local table = minetest.deserialize(file:read("*all"))
|
||||
if type(table) == "table" then
|
||||
awards.players = table
|
||||
convert_data()
|
||||
else
|
||||
awards.players = {}
|
||||
end
|
||||
file:close()
|
||||
os.rename(old_save_path, minetest.get_worldpath().."/awards.bk.txt")
|
||||
awards.save()
|
||||
else
|
||||
awards.players = minetest.parse_json(storage:get_string("player_data")) or {}
|
||||
end
|
||||
end
|
||||
|
||||
function awards.player(name)
|
||||
assert(type(name) == "string")
|
||||
local data = awards.players[name] or {}
|
||||
awards.players[name] = data
|
||||
data.name = data.name or name
|
||||
data.unlocked = data.unlocked or {}
|
||||
return data
|
||||
end
|
||||
|
||||
function awards.player_or_nil(name)
|
||||
return awards.players[name]
|
||||
end
|
||||
|
||||
local default_def = {}
|
||||
|
||||
function default_def:run_callbacks(player, data, table_func)
|
||||
for i = 1, #self.on do
|
||||
local res = nil
|
||||
local entry = self.on[i]
|
||||
if type(entry) == "function" then
|
||||
res = entry(player, data)
|
||||
elseif type(entry) == "table" and entry.award then
|
||||
res = table_func(entry)
|
||||
end
|
||||
|
||||
if res then
|
||||
awards.unlock(player:get_player_name(), res)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function awards.register_trigger(tname, tdef)
|
||||
assert(type(tdef) == "table",
|
||||
"Passing a callback to register_trigger is not supported in 3.0")
|
||||
|
||||
tdef.name = tname
|
||||
for key, value in pairs(default_def) do
|
||||
tdef[key] = value
|
||||
end
|
||||
|
||||
if tdef.type == "counted" then
|
||||
local old_reg = tdef.on_register
|
||||
|
||||
function tdef:on_register(def)
|
||||
local tmp = {
|
||||
award = def.name,
|
||||
target = def.trigger.target,
|
||||
}
|
||||
tdef.register(tmp)
|
||||
|
||||
function def.getProgress(_, data)
|
||||
local done = data[tname] or 0
|
||||
return {
|
||||
perc = done / tmp.target,
|
||||
label = S(tdef.progress, done, tmp.target),
|
||||
}
|
||||
end
|
||||
|
||||
function def.getDefaultDescription(_)
|
||||
local n = def.trigger.target
|
||||
return NS(tdef.auto_description[1], tdef.auto_description[2], n, n)
|
||||
end
|
||||
|
||||
if old_reg then
|
||||
return old_reg(tdef, def)
|
||||
end
|
||||
end
|
||||
|
||||
function tdef.notify(player)
|
||||
assert(player and player.is_player and player:is_player())
|
||||
local name = player:get_player_name()
|
||||
local data = awards.player(name)
|
||||
|
||||
-- Increment counter
|
||||
local currentVal = (data[tname] or 0) + 1
|
||||
data[tname] = currentVal
|
||||
|
||||
tdef:run_callbacks(player, data, function(entry)
|
||||
if entry.target and entry.award and currentVal and
|
||||
currentVal >= entry.target then
|
||||
return entry.award
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
awards["notify_" .. tname] = tdef.notify
|
||||
|
||||
elseif tdef.type == "counted_key" then
|
||||
if tdef.key_is_item then
|
||||
tdef.watched_groups = {}
|
||||
end
|
||||
|
||||
-- On award register
|
||||
local old_reg = tdef.on_register
|
||||
function tdef:on_register(def)
|
||||
-- Register trigger
|
||||
local tmp = {
|
||||
award = def.name,
|
||||
key = tdef:get_key(def),
|
||||
target = def.trigger.target,
|
||||
}
|
||||
tdef.register(tmp)
|
||||
|
||||
-- If group, add it to watch list
|
||||
if tdef.key_is_item and tmp.key and tmp.key:sub(1, 6) == "group:" then
|
||||
tdef.watched_groups[tmp.key:sub(7, #tmp.key)] = true
|
||||
end
|
||||
|
||||
-- Called to get progress values and labels
|
||||
function def.getProgress(_, data)
|
||||
local done
|
||||
data[tname] = data[tname] or {}
|
||||
if tmp.key then
|
||||
done = data[tname][tmp.key] or 0
|
||||
else
|
||||
done = data[tname].__total or 0
|
||||
end
|
||||
return {
|
||||
perc = done / tmp.target,
|
||||
label = S(tdef.progress, done, tmp.target),
|
||||
}
|
||||
end
|
||||
|
||||
-- Build description if none is specificed by the award
|
||||
function def.getDefaultDescription(_)
|
||||
local n = def.trigger.target
|
||||
if tmp.key then
|
||||
local nname = tmp.key
|
||||
return NS(tdef.auto_description[1],
|
||||
tdef.auto_description[2], n, n, nname)
|
||||
else
|
||||
return NS(tdef.auto_description_total[1],
|
||||
tdef.auto_description_total[2], n, n)
|
||||
end
|
||||
end
|
||||
|
||||
-- Call on_register in trigger type definition
|
||||
if old_reg then
|
||||
return old_reg(tdef, def)
|
||||
end
|
||||
end
|
||||
|
||||
function tdef.notify(player, key, n)
|
||||
n = n or 1
|
||||
|
||||
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
|
||||
tdef.notify(player, "group:" .. groupname, n)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
assert(player and player.is_player and player:is_player() and key)
|
||||
local name = player:get_player_name()
|
||||
local data = awards.player(name)
|
||||
|
||||
-- Increment counter
|
||||
data[tname] = data[tname] or {}
|
||||
local currentVal = (data[tname][key] or 0) + n
|
||||
data[tname][key] = currentVal
|
||||
if key:sub(1, 6) ~= "group:" then
|
||||
data[tname].__total = (data[tname].__total or 0) + n
|
||||
end
|
||||
|
||||
tdef:run_callbacks(player, data, function(entry)
|
||||
local current
|
||||
if entry.key == key then
|
||||
current = currentVal
|
||||
elseif entry.key == nil then
|
||||
current = data[tname].__total
|
||||
else
|
||||
return
|
||||
end
|
||||
|
||||
if current >= entry.target then
|
||||
return entry.award
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
awards["notify_" .. tname] = tdef.notify
|
||||
|
||||
elseif tdef.type and tdef.type ~= "custom" then
|
||||
error("Unrecognised trigger type " .. tdef.type)
|
||||
end
|
||||
|
||||
awards.registered_triggers[tname] = tdef
|
||||
|
||||
tdef.on = {}
|
||||
tdef.register = function(func)
|
||||
table.insert(tdef.on, func)
|
||||
end
|
||||
|
||||
-- Backwards compat
|
||||
awards.on[tname] = tdef.on
|
||||
awards['register_on_' .. tname] = tdef.register
|
||||
return tdef
|
||||
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
|
||||
end
|
||||
|
||||
function awards.get_item_count(data, field, itemname)
|
||||
itemname = minetest.registered_aliases[itemname] or itemname
|
||||
return data[field][itemname] or 0
|
||||
end
|
||||
|
||||
function awards.get_total_keyed_count(data, field)
|
||||
return data[field].__total or 0
|
||||
end
|
||||
|
||||
function awards.register_on_unlock(func)
|
||||
table.insert(awards.on_unlock, func)
|
||||
end
|
||||
|
||||
function awards.register_award(name, def)
|
||||
def.name = name
|
||||
|
||||
-- Add Triggers
|
||||
if def.trigger and def.trigger.type then
|
||||
local tdef = awards.registered_triggers[def.trigger.type]
|
||||
assert(tdef, "Trigger not found: " .. def.trigger.type)
|
||||
tdef:on_register(def)
|
||||
end
|
||||
|
||||
function def:can_unlock(data)
|
||||
if not self.requires then
|
||||
return true
|
||||
end
|
||||
|
||||
for i=1, #self.requires do
|
||||
if not data.unlocked[self.requires[i]] then
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
-- Add Award
|
||||
awards.registered_awards[name] = def
|
||||
|
||||
local tdef = awards.registered_awards[name]
|
||||
if def.description == nil and tdef.getDefaultDescription then
|
||||
def.description = tdef:getDefaultDescription()
|
||||
end
|
||||
end
|
||||
|
||||
function awards.enable(name)
|
||||
local data = awards.player(name)
|
||||
if data then
|
||||
data.disabled = nil
|
||||
end
|
||||
end
|
||||
|
||||
function awards.disable(name)
|
||||
local data = awards.player(name)
|
||||
if data then
|
||||
data.disabled = true
|
||||
end
|
||||
end
|
||||
|
||||
function awards.clear_player(name)
|
||||
awards.players[name] = {}
|
||||
end
|
||||
|
||||
-- This function is called whenever a target condition is met.
|
||||
-- It checks if a player already has that award, and if they do not,
|
||||
-- it gives it to them
|
||||
----------------------------------------------
|
||||
--awards.unlock(name, award)
|
||||
-- name - the name of the player
|
||||
-- award - the name of the award to give
|
||||
function awards.unlock(name, award)
|
||||
-- Access Player Data
|
||||
local data = awards.player(name)
|
||||
local awdef = awards.registered_awards[award]
|
||||
assert(awdef, "Unable to unlock an award which doesn't exist!")
|
||||
|
||||
if data.disabled or
|
||||
(data.unlocked[award] and data.unlocked[award] == award) then
|
||||
return
|
||||
end
|
||||
|
||||
if not awdef:can_unlock(data) then
|
||||
minetest.log("warning", "can_unlock returned false in unlock of " ..
|
||||
award .. " for " .. name)
|
||||
return
|
||||
end
|
||||
|
||||
-- Unlock Award
|
||||
minetest.log("action", name.." has unlocked award "..name)
|
||||
data.unlocked[award] = award
|
||||
awards.save()
|
||||
|
||||
-- Give Prizes
|
||||
if awdef and awdef.prizes then
|
||||
for i = 1, #awdef.prizes do
|
||||
local itemstack = ItemStack(awdef.prizes[i])
|
||||
if not itemstack:is_empty() then
|
||||
local receiverref = minetest.get_player_by_name(name)
|
||||
if receiverref then
|
||||
receiverref:get_inventory():add_item("main", itemstack)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Run callbacks
|
||||
if awdef.on_unlock and awdef.on_unlock(name, awdef) then
|
||||
return
|
||||
end
|
||||
for _, callback in pairs(awards.on_unlock) do
|
||||
if callback(name, awdef) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
-- Get Notification Settings
|
||||
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 sound = awdef.sound
|
||||
if sound == nil then
|
||||
-- Explicit check for nil because sound could be `false` to disable it
|
||||
sound = {name="awards_got_generic", gain=0.25}
|
||||
end
|
||||
|
||||
-- Do Notification
|
||||
if sound then
|
||||
-- Enforce sound delay to prevent sound spamming
|
||||
local lastsound = data.lastsound
|
||||
if lastsound == nil or os.difftime(os.time(), lastsound) >= 1 then
|
||||
minetest.sound_play(sound, {to_player=name})
|
||||
data.lastsound = os.time()
|
||||
end
|
||||
end
|
||||
|
||||
if awards.show_mode == "chat" then
|
||||
local chat_announce
|
||||
if awdef.secret then
|
||||
chat_announce = S("Secret Award Unlocked: %s")
|
||||
else
|
||||
chat_announce = S("Award Unlocked: %s")
|
||||
end
|
||||
-- use the chat console to send it
|
||||
minetest.chat_send_player(name, string.format(chat_announce, title))
|
||||
if desc~="" then
|
||||
minetest.chat_send_player(name, desc)
|
||||
end
|
||||
else
|
||||
local player = minetest.get_player_by_name(name)
|
||||
local one = player:hud_add({
|
||||
hud_elem_type = "image",
|
||||
name = "award_bg",
|
||||
scale = {x = 2, y = 1},
|
||||
text = background,
|
||||
position = {x = 0.5, y = 0.05},
|
||||
offset = {x = 0, y = 138},
|
||||
alignment = {x = 0, y = -1}
|
||||
})
|
||||
local hud_announce
|
||||
if awdef.secret then
|
||||
hud_announce = S("Secret Award Unlocked!")
|
||||
else
|
||||
hud_announce = S("Award Unlocked!")
|
||||
end
|
||||
local two = player:hud_add({
|
||||
hud_elem_type = "text",
|
||||
name = "award_au",
|
||||
number = 0xFFFFFF,
|
||||
scale = {x = 100, y = 20},
|
||||
text = hud_announce,
|
||||
position = {x = 0.5, y = 0.05},
|
||||
offset = {x = 0, y = 45},
|
||||
alignment = {x = 0, y = -1}
|
||||
})
|
||||
local three = player:hud_add({
|
||||
hud_elem_type = "text",
|
||||
name = "award_title",
|
||||
number = 0xFFFFFF,
|
||||
scale = {x = 100, y = 20},
|
||||
text = title,
|
||||
position = {x = 0.5, y = 0.05},
|
||||
offset = {x = 0, y = 100},
|
||||
alignment = {x = 0, y = -1}
|
||||
})
|
||||
local four = player:hud_add({
|
||||
hud_elem_type = "image",
|
||||
name = "award_icon",
|
||||
scale = {x = 4, y = 4},
|
||||
text = icon,
|
||||
position = {x = 0.5, y = 0.05},
|
||||
offset = {x = -200.5, y = 126},
|
||||
alignment = {x = 0, y = -1}
|
||||
})
|
||||
minetest.after(4, function()
|
||||
local player2 = minetest.get_player_by_name(name)
|
||||
if player2 then
|
||||
player2:hud_remove(one)
|
||||
player2:hud_remove(two)
|
||||
player2:hud_remove(three)
|
||||
player2:hud_remove(four)
|
||||
end
|
||||
end)
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
if formname ~= "awards:awards" then
|
||||
return false
|
||||
end
|
||||
if fields.quit then
|
||||
return true
|
||||
end
|
||||
local name = player:get_player_name()
|
||||
if fields.awards then
|
||||
local event = minetest.explode_textlist_event(fields.awards)
|
||||
if event.type == "CHG" then
|
||||
awards.show_to(name, name, event.index, false)
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end)
|
||||
|
||||
awards.load()
|
||||
|
||||
minetest.register_on_shutdown(function()
|
||||
awards.save()
|
||||
end)
|
@ -1,61 +0,0 @@
|
||||
-- Copyright (c) 2013-18 rubenwardy. MIT.
|
||||
|
||||
local S = awards.gettext
|
||||
|
||||
minetest.register_chatcommand("awards", {
|
||||
params = S("[c|clear|disable|enable]"),
|
||||
description = S("Show, clear, disable or enable your awards"),
|
||||
func = function(name, param)
|
||||
if param == "clear" then
|
||||
awards.clear_player(name)
|
||||
minetest.chat_send_player(name,
|
||||
S("All your awards and statistics have been cleared. You can now start again."))
|
||||
elseif param == "disable" then
|
||||
awards.disable(name)
|
||||
minetest.chat_send_player(name, S("You have disabled awards."))
|
||||
elseif param == "enable" then
|
||||
awards.enable(name)
|
||||
minetest.chat_send_player(name, S("You have enabled awards."))
|
||||
elseif param == "c" then
|
||||
awards.show_to(name, name, nil, true)
|
||||
else
|
||||
awards.show_to(name, name, nil, false)
|
||||
end
|
||||
|
||||
if (param == "disable" or param == "enable") and minetest.global_exists("sfinv") then
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if player then
|
||||
sfinv.set_player_inventory_formspec(player)
|
||||
end
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("awd", {
|
||||
params = S("<award ID>"),
|
||||
description = S("Show details of an award"),
|
||||
func = function(name, param)
|
||||
local def = awards.registered_awards[param]
|
||||
if def then
|
||||
minetest.chat_send_player(name, string.format(S("%s: %s"), def.title, def.description))
|
||||
else
|
||||
minetest.chat_send_player(name, S("Award not found."))
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("awpl", {
|
||||
privs = {
|
||||
server = true
|
||||
},
|
||||
params = S("<name>"),
|
||||
description = S("Get the awards statistics for the given player or yourself"),
|
||||
func = function(name, param)
|
||||
if not param or param == "" then
|
||||
param = name
|
||||
end
|
||||
minetest.chat_send_player(name, param)
|
||||
local player = awards.player(param)
|
||||
minetest.chat_send_player(name, dump(player))
|
||||
end
|
||||
})
|
24
init.lua
24
init.lua
@ -3,18 +3,30 @@
|
||||
-- The global award namespace
|
||||
awards = {
|
||||
show_mode = "hud",
|
||||
registered_awards = {},
|
||||
registered_triggers = {},
|
||||
on_unlock = {},
|
||||
}
|
||||
|
||||
-- Internationalization support.
|
||||
awards.gettext, awards.ngettext = dofile(minetest.get_modpath("awards").."/intllib.lua")
|
||||
awards.gettext, awards.ngettext = dofile(minetest.get_modpath("awards").."/src/intllib.lua")
|
||||
|
||||
-- Load files
|
||||
dofile(minetest.get_modpath("awards").."/api.lua")
|
||||
dofile(minetest.get_modpath("awards").."/chat_commands.lua")
|
||||
dofile(minetest.get_modpath("awards").."/gui.lua")
|
||||
dofile(minetest.get_modpath("awards").."/triggers.lua")
|
||||
dofile(minetest.get_modpath("awards").."/awards.lua")
|
||||
dofile(minetest.get_modpath("awards").."/src/data.lua")
|
||||
dofile(minetest.get_modpath("awards").."/src/api_awards.lua")
|
||||
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")
|
||||
|
||||
-- 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)
|
||||
|
||||
|
||||
-- Backwards compatibility
|
||||
awards.give_achievement = awards.unlock
|
||||
|
14
locale/de.po
14
locale/de.po
@ -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"
|
||||
|
819
locale/pt.po
Normal file
819
locale/pt.po
Normal file
@ -0,0 +1,819 @@
|
||||
# Portuguese translations for Awards package.
|
||||
# Copyright (C) 2018
|
||||
# This file is distributed under the same license as the Awards package.
|
||||
# FIRST AUTHOR borgesdossantosbruno@gmail.com, 2018.
|
||||
# BrunoMine, 2018
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-02-21 05:50-0300\n"
|
||||
"PO-Revision-Date: 2018-08-01 16:16-0300\n"
|
||||
"Language-Team: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
"X-Generator: Poedit 2.0.6\n"
|
||||
"Last-Translator: BrunoMine\n"
|
||||
"Language: pt\n"
|
||||
|
||||
#: api.lua
|
||||
msgid "Secret Achievement Unlocked:"
|
||||
msgstr "Conquista Secreta Desbloqueada:"
|
||||
|
||||
#: api.lua
|
||||
msgid "Achievement Unlocked:"
|
||||
msgstr "Conquista Desbloqueada:"
|
||||
|
||||
#: api.lua
|
||||
#, lua-format
|
||||
msgid "Secret Achievement Unlocked: %s"
|
||||
msgstr "Conquista Secreta Desbloqueada: %s"
|
||||
|
||||
#: api.lua
|
||||
#, lua-format
|
||||
msgid "Achievement Unlocked: %s"
|
||||
msgstr "Conquista Desbloqueada: %s"
|
||||
|
||||
#: api.lua
|
||||
msgid "Secret Achievement Unlocked!"
|
||||
msgstr "Conquista Secreta Desbloqueada!"
|
||||
|
||||
#: api.lua
|
||||
msgid "Achievement Unlocked!"
|
||||
msgstr "Conquista Desbloqueada!"
|
||||
|
||||
#: api.lua
|
||||
msgid "Error: No awards available."
|
||||
msgstr "Erro: Nenhuma conquista encontrada."
|
||||
|
||||
#: api.lua
|
||||
msgid "OK"
|
||||
msgstr "OK"
|
||||
|
||||
#: api.lua
|
||||
msgid "(Secret Award)"
|
||||
msgstr "(Conquista Secreta)"
|
||||
|
||||
#: api.lua
|
||||
msgid "Unlock this award to find out what it is."
|
||||
msgstr "Desbloqueie essa conquista para descobrir o que significa."
|
||||
|
||||
#: api.lua
|
||||
#, lua-format
|
||||
msgid "%s (got)"
|
||||
msgstr "%s (obtido)"
|
||||
|
||||
#: api.lua
|
||||
msgid "You've disabled awards. Type /awards enable to reenable."
|
||||
msgstr "Desabilitaste as conquistas. Digite /awards enable para reabilitar."
|
||||
|
||||
#: api.lua
|
||||
msgid "You have not unlocked any awards."
|
||||
msgstr "Nenhuma conquista desbloqueada ainda."
|
||||
|
||||
#: api.lua
|
||||
#, lua-format
|
||||
msgid "%s’s awards:"
|
||||
msgstr "%s das conquistas:"
|
||||
|
||||
#: api.lua chat_commands.lua
|
||||
#, lua-format
|
||||
msgid "%s: %s"
|
||||
msgstr "%s: %s"
|
||||
|
||||
#: sfinv.lua unified_inventory.lua
|
||||
msgid "Awards"
|
||||
msgstr "Conquistas"
|
||||
|
||||
#: triggers.lua
|
||||
msgid "@1/@2 dug"
|
||||
msgstr "@1 de @2 obtidos"
|
||||
|
||||
#. Translators: @1 is count, @2 is description.
|
||||
#: triggers.lua
|
||||
msgid "Mine: @2"
|
||||
msgid_plural "Mine: @1×@2"
|
||||
msgstr[0] "Cavar: @2"
|
||||
msgstr[1] "Minar: @1×@2"
|
||||
|
||||
#: triggers.lua
|
||||
msgid "Mine @1 block."
|
||||
msgid_plural "Mine @1 blocks."
|
||||
msgstr[0] "Cavar um bloco."
|
||||
msgstr[1] "Cavar @1 blocos."
|
||||
|
||||
#: triggers.lua
|
||||
msgid "@1/@2 placed"
|
||||
msgstr "@1 de @2 colocados"
|
||||
|
||||
#. Translators: @1 is count, @2 is description.
|
||||
#: triggers.lua
|
||||
msgid "Place: @2"
|
||||
msgid_plural "Place: @1×@2"
|
||||
msgstr[0] "Colocar: @2"
|
||||
msgstr[1] "Place: @1×@2"
|
||||
|
||||
#: triggers.lua
|
||||
msgid "Place a block."
|
||||
msgid_plural "Place @1 blocks."
|
||||
msgstr[0] "Colocar um bloco."
|
||||
msgstr[1] "Colocar @1 blocos."
|
||||
|
||||
#: triggers.lua
|
||||
msgid "@1/@2 eaten"
|
||||
msgstr "@1 de @2 consumidos"
|
||||
|
||||
#. Translators: @1 is count, @2 is description.
|
||||
#: triggers.lua
|
||||
msgid "Eat: @2"
|
||||
msgid_plural "Eat: @1×@2"
|
||||
msgstr[0] "Consumir: @2"
|
||||
msgstr[1] "Consumir: @1×@2"
|
||||
|
||||
#: triggers.lua
|
||||
msgid "Eat an item."
|
||||
msgid_plural "Eat @1 items."
|
||||
msgstr[0] "Consumir um item."
|
||||
msgstr[1] "Consumir @1 itens."
|
||||
|
||||
#: triggers.lua
|
||||
msgid "@1/@2 deaths"
|
||||
msgstr "@1 de @2 mortes"
|
||||
|
||||
#: triggers.lua
|
||||
msgid "Die."
|
||||
msgid_plural "Die @1 times."
|
||||
msgstr[0] "Morrer."
|
||||
msgstr[1] "Morrer @1 vezes."
|
||||
|
||||
#: triggers.lua
|
||||
msgid "@1/@2 chat messages"
|
||||
msgstr "@1 de @2"
|
||||
|
||||
#: triggers.lua
|
||||
msgid "Write something in chat."
|
||||
msgid_plural "Write @1 chat messages."
|
||||
msgstr[0] "Escrever algo no bate papo."
|
||||
msgstr[1] "Escrever @1 mensagens no bate papo."
|
||||
|
||||
#: triggers.lua
|
||||
msgid "@1/@2 game joins"
|
||||
msgstr "@1 de @2"
|
||||
|
||||
#: triggers.lua
|
||||
msgid "Join the game."
|
||||
msgid_plural "Join the game @1 times."
|
||||
msgstr[0] "Entre no jogo."
|
||||
msgstr[1] "Entre no jogo @1 vezes."
|
||||
|
||||
#: triggers.lua
|
||||
msgid "@1/@2 crafted"
|
||||
msgstr "@1 de @2 feitos"
|
||||
|
||||
#. Translators: @1 is count, @2 is description.
|
||||
#: triggers.lua
|
||||
msgid "Craft: @2"
|
||||
msgid_plural "Craft: @1×@2"
|
||||
msgstr[0] "Fazer @2"
|
||||
msgstr[1] "Montar @2 @1 vezes"
|
||||
|
||||
#: triggers.lua
|
||||
msgid "Craft an item."
|
||||
msgid_plural "Craft @1 items."
|
||||
msgstr[0] "Fazer um item."
|
||||
msgstr[1] "Fazer @1 itens."
|
||||
|
||||
#: init.lua
|
||||
msgid "Saint-Maclou"
|
||||
msgstr "Saint-Maclou"
|
||||
|
||||
#: init.lua
|
||||
msgid "Place 20 coal checkers."
|
||||
msgstr ""
|
||||
|
||||
#: init.lua
|
||||
msgid "Castorama"
|
||||
msgstr ""
|
||||
|
||||
#: init.lua
|
||||
msgid "Place 20 iron checkers."
|
||||
msgstr ""
|
||||
|
||||
#: init.lua
|
||||
msgid "Sam the Trapper"
|
||||
msgstr ""
|
||||
|
||||
#: init.lua
|
||||
msgid "Place 2 trap stones."
|
||||
msgstr ""
|
||||
|
||||
#: init.lua
|
||||
msgid "Backpacker"
|
||||
msgstr ""
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 4 large bags."
|
||||
msgstr ""
|
||||
|
||||
#: init.lua
|
||||
msgid "Pyromaniac"
|
||||
msgstr "Piromaníaco"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 8 times flint and steel."
|
||||
msgstr "Montar acendedor de Ferro e Pederneira 8 vezes."
|
||||
|
||||
#: init.lua
|
||||
msgid "Firefighter"
|
||||
msgstr "Bombeiro"
|
||||
|
||||
#: init.lua
|
||||
msgid "Put out 1000 fires."
|
||||
msgstr "Apagar fogo 1000 vezes."
|
||||
|
||||
#: init.lua
|
||||
msgid "Light It Up"
|
||||
msgstr "Ilumine Isso"
|
||||
|
||||
#: init.lua
|
||||
msgid "Place 100 torches."
|
||||
msgstr "Colocar 100 tochas."
|
||||
|
||||
#: init.lua
|
||||
msgid "Well Lit"
|
||||
msgstr "Bem Iluminado"
|
||||
|
||||
#: init.lua
|
||||
msgid "Place 1,000 torches."
|
||||
msgstr "Colocar 1.000 tochas."
|
||||
|
||||
#: init.lua
|
||||
msgid "Really Well Lit"
|
||||
msgstr "Realmente Bem Iluminado"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 10 mese lamps."
|
||||
msgstr "Fazer 10 lâmpadas de mese."
|
||||
|
||||
#: init.lua
|
||||
msgid "Outpost"
|
||||
msgstr "Posto Avançado"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 200 stone bricks."
|
||||
msgstr "Fazer 200 tijolos de pedra."
|
||||
|
||||
#: init.lua
|
||||
msgid "Watchtower"
|
||||
msgstr "Sentinela"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 800 stone bricks."
|
||||
msgstr "Fazer 800 tijolos de pedra."
|
||||
|
||||
#: init.lua
|
||||
msgid "Fortress"
|
||||
msgstr "Fortaleza"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 3,200 stone bricks."
|
||||
msgstr "Fazer 3.200 tijolos de pedra."
|
||||
|
||||
#: init.lua
|
||||
msgid "Desert Dweller"
|
||||
msgstr "Morador do Deserto"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 400 desert stone bricks."
|
||||
msgstr "Fazer 400 Tijolos de pedra do deserto."
|
||||
|
||||
#: init.lua
|
||||
msgid "Pharaoh"
|
||||
msgstr "Faraó"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 100 sandstone bricks."
|
||||
msgstr "Fazer 100 tijolos de arenito."
|
||||
|
||||
#: init.lua
|
||||
msgid "Little Library"
|
||||
msgstr "Pequena Biblioteca"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 7 bookshelves."
|
||||
msgstr "Fazer 7 estantes de livros."
|
||||
|
||||
#: init.lua
|
||||
msgid "Lava and Water"
|
||||
msgstr "Lava e Água"
|
||||
|
||||
#: init.lua
|
||||
msgid "Mine your first obsidian."
|
||||
msgstr "Cavar sua primeira obsidiana."
|
||||
|
||||
#: init.lua
|
||||
msgid "Obsessed with Obsidian"
|
||||
msgstr "Obcecado por Obsidiana"
|
||||
|
||||
#: init.lua
|
||||
msgid "Mine 50 obsidian."
|
||||
msgstr "Minerar 50 obsidianas."
|
||||
|
||||
#: init.lua
|
||||
msgid "Lava Miner"
|
||||
msgstr "Minerador de Lava"
|
||||
|
||||
#: init.lua
|
||||
msgid "Mine any block while being very close to lava."
|
||||
msgstr "Minerar qualquer bloco enquanto estiver mergulhado em lava."
|
||||
|
||||
#: init.lua
|
||||
msgid "On The Way"
|
||||
msgstr "No Caminho"
|
||||
|
||||
#: init.lua
|
||||
msgid "Place 100 rails."
|
||||
msgstr "Colocar 100 trilhos."
|
||||
|
||||
#: init.lua
|
||||
msgid "First Day in the Woods"
|
||||
msgstr "Primeiro dia na Floresta"
|
||||
|
||||
#: init.lua
|
||||
msgid "Dig 6 tree blocks."
|
||||
msgstr "Cortar 6 blocos de árvore."
|
||||
|
||||
#: init.lua
|
||||
msgid "Lumberjack"
|
||||
msgstr "Lenhador"
|
||||
|
||||
#: init.lua
|
||||
msgid "Dig 36 tree blocks."
|
||||
msgstr "Cortar 36 blocos de árvore."
|
||||
|
||||
#: init.lua
|
||||
msgid "Semi-pro Lumberjack"
|
||||
msgstr "Lenhador Semi-Profissional"
|
||||
|
||||
#: init.lua
|
||||
msgid "Dig 216 tree blocks."
|
||||
msgstr "Cortar 216 blocos de árvore."
|
||||
|
||||
#: init.lua
|
||||
msgid "Professional Lumberjack"
|
||||
msgstr "Lenhador Profissional"
|
||||
|
||||
#: init.lua
|
||||
msgid "Dig 1,296 tree blocks."
|
||||
msgstr "Cortar 1.296 blocos de árvore."
|
||||
|
||||
#: init.lua
|
||||
msgid "Junglebaby"
|
||||
msgstr "Bebê Selvagem"
|
||||
|
||||
#: init.lua
|
||||
msgid "Dig 100 jungle tree blocks."
|
||||
msgstr "Cortar 100 blocos de árvore selvagem."
|
||||
|
||||
#: init.lua
|
||||
msgid "Jungleman"
|
||||
msgstr "Homem Selvagem"
|
||||
|
||||
#: init.lua
|
||||
msgid "Dig 1,000 jungle tree blocks."
|
||||
msgstr "Cortar 1.000 blocos de árvore selvagem."
|
||||
|
||||
#: init.lua
|
||||
msgid "First Mese Find"
|
||||
msgstr "Primeiro Mese"
|
||||
|
||||
#: init.lua
|
||||
msgid "Mine your first mese ore."
|
||||
msgstr "Cavar seu primeiro mese."
|
||||
|
||||
#: init.lua
|
||||
msgid "Mese Mastery"
|
||||
msgstr "Mestre do Mese"
|
||||
|
||||
#: init.lua
|
||||
msgid "Mine a mese block."
|
||||
msgstr "Cavar um bloco de mese."
|
||||
|
||||
#: init.lua
|
||||
msgid "You’re a copper"
|
||||
msgstr "Sou um Cobre"
|
||||
|
||||
#: init.lua
|
||||
msgid "Dig 1,000 copper ores."
|
||||
msgstr "Minerar 1.000 cobres."
|
||||
|
||||
#: init.lua
|
||||
msgid "A Cat in a Pop-Tart?!"
|
||||
msgstr "Um Gato em um Pop-Tart?!"
|
||||
|
||||
#: init.lua
|
||||
msgid "Mine a nyan cat."
|
||||
msgstr "Capturar um gato nyan."
|
||||
|
||||
#: init.lua
|
||||
msgid "Mini Miner"
|
||||
msgstr "Mini Minerador"
|
||||
|
||||
#: init.lua
|
||||
msgid "Dig 100 stone blocks."
|
||||
msgstr "Minerar 100 blocos de pedra."
|
||||
|
||||
#: init.lua
|
||||
msgid "Hardened Miner"
|
||||
msgstr "Minerador Avançado"
|
||||
|
||||
#: init.lua
|
||||
msgid "Dig 1,000 stone blocks."
|
||||
msgstr "Minerar 1.000 blocos de pedra."
|
||||
|
||||
#: init.lua
|
||||
msgid "Master Miner"
|
||||
msgstr "Minerador Mestre"
|
||||
|
||||
#: init.lua
|
||||
msgid "Dig 10,000 stone blocks."
|
||||
msgstr "Minerar 10.000 blocos de pedra."
|
||||
|
||||
#: init.lua
|
||||
msgid "Marchand De Sable"
|
||||
msgstr "Vendedor de Areia"
|
||||
|
||||
#: init.lua
|
||||
msgid "Dig 1,000 sand."
|
||||
msgstr "Cavar 1.000 blocos de areia."
|
||||
|
||||
#: init.lua
|
||||
msgid "Crafter of Sticks"
|
||||
msgstr "Rachador de Lenha"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 100 sticks."
|
||||
msgstr "Lenhar 100 gravetos."
|
||||
|
||||
#: init.lua
|
||||
msgid "Jungle Discoverer"
|
||||
msgstr "Desbravador Selvagem"
|
||||
|
||||
#: init.lua
|
||||
msgid "Mine your first jungle grass."
|
||||
msgstr "Cortar seu primeiro mato selvagem."
|
||||
|
||||
#: init.lua
|
||||
msgid "Grasslands Discoverer"
|
||||
msgstr "Descobridor do Gramado"
|
||||
|
||||
#: init.lua
|
||||
msgid "Mine some grass."
|
||||
msgstr "Minerar algum mato"
|
||||
|
||||
#: init.lua
|
||||
msgid "Savannah Discoverer"
|
||||
msgstr "Descobridor da Savana"
|
||||
|
||||
#: init.lua
|
||||
msgid "Mine some dry grass."
|
||||
msgstr "Minerar algum mato seco."
|
||||
|
||||
#: init.lua
|
||||
msgid "Desert Discoverer"
|
||||
msgstr "Descobridor do Deserto"
|
||||
|
||||
#: init.lua
|
||||
msgid "Mine your first cactus."
|
||||
msgstr "Cortar seu primeiro cacto."
|
||||
|
||||
#: init.lua
|
||||
msgid "Far Lands"
|
||||
msgstr "Terras Distantes"
|
||||
|
||||
#: init.lua
|
||||
msgid "Mine your first dry shrub."
|
||||
msgstr "Minerar seu primeiro arbusto seco."
|
||||
|
||||
#: init.lua
|
||||
msgid "Glacier Discoverer"
|
||||
msgstr "Descobridor Glacial"
|
||||
|
||||
#: init.lua
|
||||
msgid "Mine your first ice."
|
||||
msgstr "Quebrar seu primeiro bloco de gelo."
|
||||
|
||||
#: init.lua
|
||||
msgid "Very Simple Snow Man"
|
||||
msgstr "Homem de Neve Muito Simples"
|
||||
|
||||
#: init.lua
|
||||
msgid "Place two snow blocks."
|
||||
msgstr "Colocar 2 blocos de neve."
|
||||
|
||||
#: init.lua
|
||||
msgid "First Gold Find"
|
||||
msgstr "Achei Ouro"
|
||||
|
||||
#: init.lua
|
||||
msgid "Mine your first gold ore."
|
||||
msgstr "Minerar sua primeira de ouro."
|
||||
|
||||
#: init.lua
|
||||
msgid "Gold Rush"
|
||||
msgstr "Corriga do Ouro"
|
||||
|
||||
#: init.lua
|
||||
msgid "Mine 45 gold ores."
|
||||
msgstr "Minerar 45 de ouro."
|
||||
|
||||
#: init.lua
|
||||
msgid "Wow, I am Diamonds!"
|
||||
msgstr "Uau, Diamante!"
|
||||
|
||||
#: init.lua
|
||||
msgid "Mine your first diamond ore."
|
||||
msgstr "Minerar seu primeiro diamante."
|
||||
|
||||
#: init.lua
|
||||
msgid "Girl's Best Friend"
|
||||
msgstr "Melhor Amigo da Menina"
|
||||
|
||||
#: init.lua
|
||||
msgid "Mine 18 diamond ores."
|
||||
msgstr "Minere 18 diamantes."
|
||||
|
||||
#: init.lua
|
||||
msgid "Hardest Block on Earth"
|
||||
msgstr "O Bloco mais Duro da Terra"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft a diamond block."
|
||||
msgstr "Montar um bloco de diamante."
|
||||
|
||||
#: init.lua
|
||||
msgid "In the Dungeon"
|
||||
msgstr "Na Masmorra"
|
||||
|
||||
#: init.lua
|
||||
msgid "Mine a mossy cobblestone."
|
||||
msgstr "Minerar um pedregulho com musgo."
|
||||
|
||||
#: init.lua
|
||||
msgid "Smelter"
|
||||
msgstr "Fundidor"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 10 furnaces."
|
||||
msgstr "Montar 10 fornos."
|
||||
|
||||
#: init.lua
|
||||
msgid "Treasurer"
|
||||
msgstr "Tesoureiro"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 15 chests."
|
||||
msgstr "Montar 10 baús."
|
||||
|
||||
#: init.lua
|
||||
msgid "Bankier"
|
||||
msgstr "Banqueiro"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 30 locked chests."
|
||||
msgstr "Montar 30 baús trancados."
|
||||
|
||||
#: init.lua
|
||||
msgid "Bricker"
|
||||
msgstr "Tijoleiro"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 200 brick blocks."
|
||||
msgstr "Fazer 200 blocos de tijolo."
|
||||
|
||||
#: init.lua
|
||||
msgid "House of Obsidian"
|
||||
msgstr "Casa de Obsidiana"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 100 obsidian bricks."
|
||||
msgstr "Montar 100 tijolos de obsidiana."
|
||||
|
||||
#: init.lua
|
||||
msgid "Build a Cave"
|
||||
msgstr "Montar uma Caverna"
|
||||
|
||||
#: init.lua
|
||||
msgid "Place 100 stone."
|
||||
msgstr "Colocar 100 pedras."
|
||||
|
||||
#: init.lua
|
||||
msgid "Long Ladder"
|
||||
msgstr "Longa Escadaria"
|
||||
|
||||
#: init.lua
|
||||
msgid "Place 400 wooden ladders."
|
||||
msgstr "Colocar 400 escadas de madeira."
|
||||
|
||||
#: init.lua
|
||||
msgid "Industrial Age"
|
||||
msgstr "Era Industrial"
|
||||
|
||||
#: init.lua
|
||||
msgid "Place 40 steel ladders."
|
||||
msgstr "Colocar 40 escadas de ferro."
|
||||
|
||||
#: init.lua
|
||||
msgid "Yummy!"
|
||||
msgstr "Humm!"
|
||||
|
||||
#: init.lua
|
||||
msgid "Eat 80 apples."
|
||||
msgstr "Comer 80 maçãs."
|
||||
|
||||
#: init.lua
|
||||
msgid "Glasser"
|
||||
msgstr "Vidraceiro"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 14 vessels shelves."
|
||||
msgstr "Montar 14 estantes de frascos."
|
||||
|
||||
#: init.lua
|
||||
msgid "Farming Skills Acquired"
|
||||
msgstr "Conhecimento de Cultivo Adquirido"
|
||||
|
||||
#: init.lua
|
||||
msgid "Harvest a fully grown wheat plant."
|
||||
msgstr "Colher um trigo totalmente crescido."
|
||||
|
||||
#: init.lua
|
||||
msgid "Field Worker"
|
||||
msgstr "Trabalhador do Campo"
|
||||
|
||||
#: init.lua
|
||||
msgid "Harvest 25 fully grown wheat plants."
|
||||
msgstr "Colher 25 plantas trigos totalmente crescidos."
|
||||
|
||||
#: init.lua
|
||||
msgid "Aspiring Farmer"
|
||||
msgstr "Fazendeiro Aspirante"
|
||||
|
||||
#: init.lua
|
||||
msgid "Harvest 125 fully grown wheat plants."
|
||||
msgstr "Colher 125 plantas trigos totalmente crescidos."
|
||||
|
||||
#: init.lua
|
||||
msgid "Wheat Magnate"
|
||||
msgstr "Magnata do Trigo"
|
||||
|
||||
#: init.lua
|
||||
msgid "Harvest 625 fully grown wheat plants."
|
||||
msgstr "Colher 625 plantas trigos totalmente crescidos."
|
||||
|
||||
#: init.lua
|
||||
msgid "Baker"
|
||||
msgstr "Padeiro"
|
||||
|
||||
#: init.lua
|
||||
msgid "Eat 10 loaves of bread."
|
||||
msgstr "Comer 10 pães."
|
||||
|
||||
#: init.lua
|
||||
msgid "Wool Over Your Eyes"
|
||||
msgstr "Lã Sobre Meus Olhos"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 250 white wool."
|
||||
msgstr "Tecer 250 lãs branca."
|
||||
|
||||
#: init.lua
|
||||
msgid "Hotelier"
|
||||
msgstr "Hoteleiro"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 15 fancy beds."
|
||||
msgstr "Montar 15 camas chiques."
|
||||
|
||||
#: init.lua
|
||||
msgid "Filthy Rich"
|
||||
msgstr "Muito Rico"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 24 gold block stairs."
|
||||
msgstr "Montar 24 escadas de bloco de ouro."
|
||||
|
||||
#: init.lua
|
||||
msgid "Roses Are Red"
|
||||
msgstr "Rosas São Vermelhas"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 400 red dyes."
|
||||
msgstr "Fazer 400 tintas vermelhas."
|
||||
|
||||
#: init.lua
|
||||
msgid "Dandelions are Yellow"
|
||||
msgstr "Dentes-de-Leões são Amarelos"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 400 yellow dyes."
|
||||
msgstr "Fazer 400 tintas amarelas."
|
||||
|
||||
#: init.lua
|
||||
msgid "Geraniums are Blue"
|
||||
msgstr "Gerânios são Azuis"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 400 blue dyes."
|
||||
msgstr "Fazer 400 tintas azuis."
|
||||
|
||||
#: init.lua
|
||||
msgid "White Color Stock"
|
||||
msgstr "Estoque de Cor Branca"
|
||||
|
||||
#: init.lua
|
||||
msgid "Craft 100 white dyes."
|
||||
msgstr "Fazer 100 tintas brancas."
|
||||
|
||||
#: init.lua
|
||||
msgid "Tasty Mushrooms"
|
||||
msgstr "Cogumelos Deliciosos"
|
||||
|
||||
#: init.lua
|
||||
msgid "Eat 3 brown mushrooms."
|
||||
msgstr "Comer 3 cogumelos marrons."
|
||||
|
||||
#: init.lua
|
||||
msgid "Mushroom Lover"
|
||||
msgstr "Amante de Cogumelo"
|
||||
|
||||
#: init.lua
|
||||
msgid "Eat 33 brown mushrooms."
|
||||
msgstr "Comer 33 cogumelos marrons."
|
||||
|
||||
#: init.lua
|
||||
msgid "Underground Mushroom Farmer"
|
||||
msgstr "Fazendeiro Subterrâneo de Cogumelos"
|
||||
|
||||
#: init.lua
|
||||
msgid "Eat 333 brown mushrooms."
|
||||
msgstr "Comer 333 cogumelos marrons."
|
||||
|
||||
#: init.lua
|
||||
msgid "Builder"
|
||||
msgstr "Construtor"
|
||||
|
||||
#: init.lua
|
||||
msgid "Constructor"
|
||||
msgstr "Empreiteiro"
|
||||
|
||||
#: init.lua
|
||||
msgid "Architect"
|
||||
msgstr "Arquiteto"
|
||||
|
||||
#: init.lua
|
||||
msgid "Master Architect"
|
||||
msgstr "Arquiteto Mestre"
|
||||
|
||||
#: chat_commands.lua
|
||||
msgid "[c|clear|disable|enable]"
|
||||
msgstr "[c|clear|disable|enable]"
|
||||
|
||||
#: chat_commands.lua
|
||||
msgid "Show, clear, disable or enable your achievements"
|
||||
msgstr "Exibir, limpar, desabilitar ou habilitar suas conquistas"
|
||||
|
||||
#: chat_commands.lua
|
||||
msgid "All your awards and statistics have been cleared. You can now start again."
|
||||
msgstr "Todas as suas conquistas e estatísticas foram limpas. Agora podes iniciar novamente."
|
||||
|
||||
#: chat_commands.lua
|
||||
msgid "You have disabled your achievements."
|
||||
msgstr "Suas conquistas foram desabilitadas."
|
||||
|
||||
#: chat_commands.lua
|
||||
msgid "You have enabled your achievements."
|
||||
msgstr "Suas conquistas foram habilitadas."
|
||||
|
||||
#: chat_commands.lua
|
||||
msgid "<achievement ID>"
|
||||
msgstr "<ID da conquista>"
|
||||
|
||||
#: chat_commands.lua
|
||||
msgid "Show details of an achievement"
|
||||
msgstr "Mostra detalhes de uma conquista"
|
||||
|
||||
#: chat_commands.lua
|
||||
msgid "Achievement not found."
|
||||
msgstr "Conquista não encontrada."
|
||||
|
||||
#: chat_commands.lua
|
||||
msgid "<name>"
|
||||
msgstr "<jogador>"
|
||||
|
||||
#: chat_commands.lua
|
||||
msgid "Get the achievements statistics for the given player or yourself"
|
||||
msgstr "Ver as estatísticas de conquistas de um jogador ou suas próprias"
|
2
settingtypes.txt
Normal file
2
settingtypes.txt
Normal file
@ -0,0 +1,2 @@
|
||||
# Add default achievements from the awards mod
|
||||
awards.add_defaults (Add Default Achievements) bool true
|
255
src/api_awards.lua
Normal file
255
src/api_awards.lua
Normal file
@ -0,0 +1,255 @@
|
||||
-- Copyright (c) 2013-18 rubenwardy. MIT.
|
||||
|
||||
local S = awards.gettext
|
||||
|
||||
function awards.register_award(name, def)
|
||||
def.name = name
|
||||
|
||||
-- Add Triggers
|
||||
if def.trigger and def.trigger.type then
|
||||
local tdef = awards.registered_triggers[def.trigger.type]
|
||||
assert(tdef, "Trigger not found: " .. def.trigger.type)
|
||||
tdef:on_register(def)
|
||||
end
|
||||
|
||||
function def:can_unlock(data)
|
||||
if not self.requires then
|
||||
return true
|
||||
end
|
||||
|
||||
for i=1, #self.requires do
|
||||
if not data.unlocked[self.requires[i]] then
|
||||
return false
|
||||
end
|
||||
end
|
||||
return true
|
||||
end
|
||||
|
||||
-- Add Award
|
||||
awards.registered_awards[name] = def
|
||||
|
||||
local tdef = awards.registered_awards[name]
|
||||
if def.description == nil and tdef.getDefaultDescription then
|
||||
def.description = tdef:getDefaultDescription()
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
-- This function is called whenever a target condition is met.
|
||||
-- It checks if a player already has that award, and if they do not,
|
||||
-- it gives it to them
|
||||
----------------------------------------------
|
||||
--awards.unlock(name, award)
|
||||
-- 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]
|
||||
assert(awdef, "Unable to unlock an award which doesn't exist!")
|
||||
|
||||
if data.disabled or
|
||||
(data.unlocked[award] and data.unlocked[award] == award) then
|
||||
return
|
||||
end
|
||||
|
||||
if not awdef:can_unlock(data) then
|
||||
minetest.log("warning", "can_unlock returned false in unlock of " ..
|
||||
award .. " for " .. name)
|
||||
return
|
||||
end
|
||||
|
||||
-- Unlock Award
|
||||
minetest.log("action", name.." has unlocked award "..award)
|
||||
data.unlocked[award] = award
|
||||
awards.save()
|
||||
|
||||
-- Give Prizes
|
||||
if awdef and awdef.prizes then
|
||||
for i = 1, #awdef.prizes do
|
||||
local itemstack = ItemStack(awdef.prizes[i])
|
||||
if not itemstack:is_empty() then
|
||||
local receiverref = minetest.get_player_by_name(name)
|
||||
if receiverref then
|
||||
receiverref:get_inventory():add_item("main", itemstack)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Run callbacks
|
||||
if awdef.on_unlock and awdef.on_unlock(name, awdef) then
|
||||
return
|
||||
end
|
||||
for _, callback in pairs(awards.on_unlock) do
|
||||
if callback(name, awdef) then
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
-- Get Notification Settings
|
||||
local title = awdef.title or award
|
||||
local desc = awdef.description or ""
|
||||
local background = awdef.hud_background or awdef.background or "awards_bg_default.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
|
||||
sound = {name="awards_got_generic", gain=0.25}
|
||||
end
|
||||
|
||||
-- Do Notification
|
||||
if sound then
|
||||
-- Enforce sound delay to prevent sound spamming
|
||||
local lastsound = data.lastsound
|
||||
if lastsound == nil or os.difftime(os.time(), lastsound) >= 1 then
|
||||
minetest.sound_play(sound, {to_player=name})
|
||||
data.lastsound = os.time()
|
||||
end
|
||||
end
|
||||
|
||||
if awards.show_mode == "chat" then
|
||||
local chat_announce
|
||||
if awdef.secret then
|
||||
chat_announce = S("Secret Award Unlocked: %s")
|
||||
else
|
||||
chat_announce = S("Award Unlocked: %s")
|
||||
end
|
||||
-- use the chat console to send it
|
||||
minetest.chat_send_player(name, string.format(chat_announce, title))
|
||||
if desc~="" then
|
||||
minetest.chat_send_player(name, desc)
|
||||
end
|
||||
else
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if not (player and player.is_player and player:is_player()) then
|
||||
return
|
||||
end
|
||||
local one = player:hud_add({
|
||||
hud_elem_type = "image",
|
||||
name = "award_bg",
|
||||
scale = {x = 2, y = 1},
|
||||
text = background,
|
||||
position = {x = 0.5, y = 0.05},
|
||||
offset = {x = 0, y = 138},
|
||||
alignment = {x = 0, y = -1}
|
||||
})
|
||||
local hud_announce
|
||||
if awdef.secret then
|
||||
hud_announce = S("Secret Award Unlocked!")
|
||||
else
|
||||
hud_announce = S("Award Unlocked!")
|
||||
end
|
||||
local two = player:hud_add({
|
||||
hud_elem_type = "text",
|
||||
name = "award_au",
|
||||
number = 0xFFFFFF,
|
||||
scale = {x = 100, y = 20},
|
||||
text = hud_announce,
|
||||
position = {x = 0.5, y = 0.05},
|
||||
offset = {x = 0, y = 45},
|
||||
alignment = {x = 0, y = -1}
|
||||
})
|
||||
local three = player:hud_add({
|
||||
hud_elem_type = "text",
|
||||
name = "award_title",
|
||||
number = 0xFFFFFF,
|
||||
scale = {x = 100, y = 20},
|
||||
text = title,
|
||||
position = {x = 0.5, y = 0.05},
|
||||
offset = {x = 0, y = 100},
|
||||
alignment = {x = 0, y = -1}
|
||||
})
|
||||
local four = player:hud_add({
|
||||
hud_elem_type = "image",
|
||||
name = "award_icon",
|
||||
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},
|
||||
alignment = {x = 0, y = -1}
|
||||
})
|
||||
minetest.after(4, function()
|
||||
local player2 = minetest.get_player_by_name(name)
|
||||
if player2 then
|
||||
player2:hud_remove(one)
|
||||
player2:hud_remove(two)
|
||||
player2:hud_remove(three)
|
||||
player2:hud_remove(four)
|
||||
end
|
||||
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
|
218
src/api_triggers.lua
Normal file
218
src/api_triggers.lua
Normal file
@ -0,0 +1,218 @@
|
||||
-- Copyright (c) 2013-18 rubenwardy. MIT.
|
||||
|
||||
local S, NS = awards.gettext, awards.ngettext
|
||||
|
||||
awards.on = {}
|
||||
|
||||
local default_def = {}
|
||||
|
||||
function default_def:run_callbacks(player, data, table_func)
|
||||
for i = 1, #self.on do
|
||||
local res = nil
|
||||
local entry = self.on[i]
|
||||
if type(entry) == "function" then
|
||||
res = entry(player, data)
|
||||
elseif type(entry) == "table" and entry.award then
|
||||
res = table_func(entry)
|
||||
end
|
||||
|
||||
if res then
|
||||
awards.unlock(player:get_player_name(), res)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function awards.register_trigger(tname, tdef)
|
||||
assert(type(tdef) == "table",
|
||||
"Passing a callback to register_trigger is not supported in 3.0")
|
||||
|
||||
tdef.name = tname
|
||||
for key, value in pairs(default_def) do
|
||||
tdef[key] = value
|
||||
end
|
||||
|
||||
if tdef.type == "counted" then
|
||||
local old_reg = tdef.on_register
|
||||
|
||||
function tdef:on_register(def)
|
||||
local tmp = {
|
||||
award = def.name,
|
||||
target = def.trigger.target,
|
||||
}
|
||||
tdef.register(tmp)
|
||||
|
||||
function def.get_progress(_, data)
|
||||
local current = math.min(data[tname] or 0, tmp.target)
|
||||
return {
|
||||
current = current,
|
||||
target = tmp.target,
|
||||
label = S(tdef.progress, current, tmp.target),
|
||||
}
|
||||
end
|
||||
|
||||
function def.getDefaultDescription(_)
|
||||
local n = def.trigger.target
|
||||
return NS(tdef.auto_description[1], tdef.auto_description[2], n, n)
|
||||
end
|
||||
|
||||
if old_reg then
|
||||
return old_reg(tdef, def)
|
||||
end
|
||||
end
|
||||
|
||||
function tdef.notify(player)
|
||||
assert(player and player.is_player and player:is_player())
|
||||
local name = player:get_player_name()
|
||||
local data = awards.player(name)
|
||||
|
||||
-- Increment counter
|
||||
local currentVal = (data[tname] or 0) + 1
|
||||
data[tname] = currentVal
|
||||
|
||||
tdef:run_callbacks(player, data, function(entry)
|
||||
if entry.target and entry.award and currentVal and
|
||||
currentVal >= entry.target then
|
||||
return entry.award
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
awards["notify_" .. tname] = tdef.notify
|
||||
|
||||
elseif tdef.type == "counted_key" then
|
||||
if tdef.key_is_item then
|
||||
tdef.watched_groups = {}
|
||||
end
|
||||
|
||||
-- On award register
|
||||
local old_reg = tdef.on_register
|
||||
function tdef:on_register(def)
|
||||
-- Register trigger
|
||||
local tmp = {
|
||||
award = def.name,
|
||||
key = tdef:get_key(def),
|
||||
target = def.trigger.target,
|
||||
}
|
||||
tdef.register(tmp)
|
||||
|
||||
-- If group, add it to watch list
|
||||
if tdef.key_is_item and tmp.key and tmp.key:sub(1, 6) == "group:" then
|
||||
tdef.watched_groups[tmp.key:sub(7, #tmp.key)] = true
|
||||
end
|
||||
|
||||
-- Called to get progress values and labels
|
||||
function def.get_progress(_, data)
|
||||
data[tname] = data[tname] or {}
|
||||
|
||||
local done
|
||||
if tmp.key then
|
||||
done = data[tname][tmp.key] or 0
|
||||
else
|
||||
done = data[tname].__total or 0
|
||||
end
|
||||
done = math.min(done, tmp.target)
|
||||
|
||||
return {
|
||||
current = done,
|
||||
target = tmp.target,
|
||||
label = S(tdef.progress, done, tmp.target),
|
||||
}
|
||||
end
|
||||
|
||||
-- Build description if none is specificed by the award
|
||||
function def.getDefaultDescription(_)
|
||||
local n = def.trigger.target
|
||||
if tmp.key then
|
||||
local nname = tmp.key
|
||||
return NS(tdef.auto_description[1],
|
||||
tdef.auto_description[2], n, n, nname)
|
||||
else
|
||||
return NS(tdef.auto_description_total[1],
|
||||
tdef.auto_description_total[2], n, n)
|
||||
end
|
||||
end
|
||||
|
||||
-- Call on_register in trigger type definition
|
||||
if old_reg then
|
||||
return old_reg(tdef, def)
|
||||
end
|
||||
end
|
||||
|
||||
function tdef.notify(player, key, n)
|
||||
n = n or 1
|
||||
|
||||
if tdef.key_is_item and key:sub(1, 6) ~= "group:" then
|
||||
local itemdef = minetest.registered_items[key]
|
||||
if itemdef 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
|
||||
end
|
||||
end
|
||||
|
||||
assert(player and player.is_player and player:is_player() and key)
|
||||
local name = player:get_player_name()
|
||||
local data = awards.player(name)
|
||||
|
||||
-- Increment counter
|
||||
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 + n
|
||||
end
|
||||
|
||||
tdef:run_callbacks(player, data, function(entry)
|
||||
local current
|
||||
if entry.key == key then
|
||||
current = currentVal
|
||||
elseif entry.key == nil then
|
||||
current = data[tname].__total
|
||||
else
|
||||
return
|
||||
end
|
||||
if current >= entry.target then
|
||||
return entry.award
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
awards["notify_" .. tname] = tdef.notify
|
||||
|
||||
elseif tdef.type and tdef.type ~= "custom" then
|
||||
error("Unrecognised trigger type " .. tdef.type)
|
||||
end
|
||||
|
||||
awards.registered_triggers[tname] = tdef
|
||||
|
||||
tdef.on = {}
|
||||
tdef.register = function(func)
|
||||
table.insert(tdef.on, func)
|
||||
end
|
||||
|
||||
-- Backwards compat
|
||||
awards.on[tname] = tdef.on
|
||||
awards['register_on_' .. tname] = tdef.register
|
||||
return tdef
|
||||
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) + (count or 1)
|
||||
end
|
||||
|
||||
function awards.get_item_count(data, field, itemname)
|
||||
itemname = minetest.registered_aliases[itemname] or itemname
|
||||
return data[field][itemname] or 0
|
||||
end
|
||||
|
||||
function awards.get_total_keyed_count(data, field)
|
||||
return data[field].__total or 0
|
||||
end
|
||||
|
||||
function awards.register_on_unlock(func)
|
||||
table.insert(awards.on_unlock, func)
|
||||
end
|
@ -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,8 +250,8 @@ 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",
|
||||
background = "awards_bg_mining.png",
|
||||
icon = "awards_lava_and_water.png^awards_level1.png",
|
||||
hud_background = "awards_bg_mining.png",
|
||||
difficulty = 1.5,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
@ -209,8 +264,8 @@ 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",
|
||||
background = "awards_bg_mining.png",
|
||||
icon = "awards_obsessed_with_obsidian.png^awards_level2.png",
|
||||
hud_background = "awards_bg_mining.png",
|
||||
difficulty = 1.5,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
@ -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."),
|
||||
background = "awards_bg_mining.png",
|
||||
icon = "default_lava.png",
|
||||
icon = "awards_lava_miner.png",
|
||||
hud_background = "awards_bg_mining.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,8 +385,8 @@ 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",
|
||||
background = "awards_bg_mining.png",
|
||||
icon = "awards_first_mese_find.png",
|
||||
hud_background = "awards_bg_mining.png",
|
||||
difficulty = 1,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
@ -345,8 +400,8 @@ if minetest.get_modpath("default") then
|
||||
secret = true,
|
||||
title = S("Mese Mastery"),
|
||||
description = S("Mine a mese block."),
|
||||
icon = "default_mese_block.png",
|
||||
background = "awards_bg_mining.png",
|
||||
icon = "awards_mese_mastery.png",
|
||||
hud_background = "awards_bg_mining.png",
|
||||
difficulty = 1.1,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
@ -359,8 +414,8 @@ 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",
|
||||
background = "awards_bg_mining.png",
|
||||
icon = "awards_youre_a_copper.png",
|
||||
hud_background = "awards_bg_mining.png",
|
||||
difficulty = 0.2,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
@ -373,8 +428,8 @@ 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",
|
||||
background = "awards_bg_mining.png",
|
||||
icon = "awards_mini_miner.png^awards_level1.png",
|
||||
hud_background = "awards_bg_mining.png",
|
||||
difficulty = 0.02,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
@ -387,8 +442,8 @@ 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",
|
||||
background = "awards_bg_mining.png",
|
||||
icon = "awards_hardened_miner.png^awards_level2.png",
|
||||
hud_background = "awards_bg_mining.png",
|
||||
difficulty = 0.02,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
@ -401,8 +456,8 @@ 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",
|
||||
background = "awards_bg_mining.png",
|
||||
icon = "awards_master_miner.png^awards_level3.png",
|
||||
hud_background = "awards_bg_mining.png",
|
||||
difficulty = 0.02,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
@ -415,8 +470,8 @@ 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",
|
||||
background = "awards_bg_mining.png",
|
||||
icon = "awards_marchand_de_sable.png",
|
||||
hud_background = "awards_bg_mining.png",
|
||||
difficulty = 0.05,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
@ -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,8 +580,8 @@ 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",
|
||||
background = "awards_bg_mining.png",
|
||||
icon = "awards_first_gold_find.png^awards_level1.png",
|
||||
hud_background = "awards_bg_mining.png",
|
||||
difficulty = 0.9,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
@ -538,8 +593,8 @@ 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",
|
||||
background = "awards_bg_mining.png",
|
||||
icon = "awards_gold_rush.png^awards_level2.png",
|
||||
hud_background = "awards_bg_mining.png",
|
||||
difficulty = 0.9,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
@ -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,8 +618,8 @@ 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",
|
||||
background = "awards_bg_mining.png",
|
||||
icon = "awards_girls_best_friend.png^awards_level2.png",
|
||||
hud_background = "awards_bg_mining.png",
|
||||
difficulty = 1,
|
||||
trigger = {
|
||||
type = "dig",
|
||||
@ -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
|
72
src/chat_commands.lua
Normal file
72
src/chat_commands.lua
Normal file
@ -0,0 +1,72 @@
|
||||
-- Copyright (c) 2013-18 rubenwardy. MIT.
|
||||
|
||||
local S = awards.gettext
|
||||
|
||||
minetest.register_privilege("awards_admin", { description = "Can manage awards of given player" })
|
||||
|
||||
minetest.register_chatcommand("awards", {
|
||||
params = "[c|clear|disable|enable] [player_name]",
|
||||
description = "Show, clear, disable or enable player's awards",
|
||||
func = function(name, param)
|
||||
if not minetest.check_player_privs(name, { awards_admin = true }) then
|
||||
return false, "You need awards_admin privilege!"
|
||||
end
|
||||
local action, playern = param:split(" ")[1], param:split(" ")[2] or name
|
||||
if action == "clear" then
|
||||
awards.clear_player(playern)
|
||||
minetest.chat_send_player(playern,
|
||||
S("All your awards and statistics have been cleared. You can now start again."))
|
||||
minetest.chat_send_player(name, "All awards and statistics of "..playern.." have been cleared.")
|
||||
elseif action == "disable" then
|
||||
awards.disable(playern)
|
||||
minetest.chat_send_player(playern, "Your awards are disabled.")
|
||||
minetest.chat_send_player(name, "You have disabled awards of "..playern..".")
|
||||
elseif action == "enable" then
|
||||
awards.enable(playern)
|
||||
minetest.chat_send_player(playern, "Your awards are enabled.")
|
||||
minetest.chat_send_player(name, "You have enabled awards of "..playern..".")
|
||||
elseif action == "c" then
|
||||
awards.show_to(playern, name, nil, true)
|
||||
elseif not action then
|
||||
awards.show_to(name, name, nil, false)
|
||||
else
|
||||
awards.show_to(action, name, nil, true)
|
||||
end
|
||||
|
||||
if (action == "disable" or action == "enable") and minetest.global_exists("sfinv") and not minetest.get_modpath("unified_inventory") then
|
||||
local player = minetest.get_player_by_name(playern)
|
||||
if player then
|
||||
sfinv.set_player_inventory_formspec(player)
|
||||
end
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("awd", {
|
||||
params = S("<award ID>"),
|
||||
description = S("Show details of an award"),
|
||||
func = function(name, param)
|
||||
local def = awards.registered_awards[param]
|
||||
if def then
|
||||
minetest.chat_send_player(name, string.format(S("%s: %s"), def.title, def.description))
|
||||
else
|
||||
minetest.chat_send_player(name, S("Award not found."))
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
minetest.register_chatcommand("awpl", {
|
||||
privs = {
|
||||
server = true
|
||||
},
|
||||
params = S("<name>"),
|
||||
description = S("Get the awards statistics for the given player or yourself"),
|
||||
func = function(name, param)
|
||||
if not param or param == "" then
|
||||
param = name
|
||||
end
|
||||
minetest.chat_send_player(name, param)
|
||||
local player = awards.player(param)
|
||||
minetest.chat_send_player(name, dump(player))
|
||||
end
|
||||
})
|
112
src/data.lua
Normal file
112
src/data.lua
Normal file
@ -0,0 +1,112 @@
|
||||
|
||||
local storage = minetest.get_mod_storage()
|
||||
local __player_data
|
||||
|
||||
-- Table Save Load Functions
|
||||
function awards.save()
|
||||
storage:set_string("player_data", minetest.write_json(__player_data))
|
||||
end
|
||||
|
||||
local function convert_data()
|
||||
minetest.log("warning", "Importing awards data from previous version")
|
||||
|
||||
local old_players = __player_data
|
||||
__player_data = {}
|
||||
for name, data in pairs(old_players) do
|
||||
while name.name do
|
||||
name = name.name
|
||||
end
|
||||
data.name = name
|
||||
print("Converting data for " .. name)
|
||||
|
||||
-- Just rename counted
|
||||
local counted = {
|
||||
chats = "chat",
|
||||
deaths = "death",
|
||||
joins = "join",
|
||||
}
|
||||
for from, to in pairs(counted) do
|
||||
data[to] = data[from]
|
||||
data[from] = nil
|
||||
end
|
||||
|
||||
data.death = {
|
||||
unknown = data.death,
|
||||
__total = data.death,
|
||||
}
|
||||
|
||||
-- Convert item db to new format
|
||||
local counted_items = {
|
||||
count = "dig",
|
||||
place = "place",
|
||||
craft = "craft",
|
||||
}
|
||||
for from, to in pairs(counted_items) do
|
||||
local ret = {}
|
||||
|
||||
local count = 0
|
||||
if data[from] then
|
||||
for modname, items in pairs(data[from]) do
|
||||
for itemname, value in pairs(items) do
|
||||
itemname = modname .. ":" .. itemname
|
||||
local key = minetest.registered_aliases[itemname] or itemname
|
||||
ret[key] = value
|
||||
count = count + value
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
ret.__total = count
|
||||
data[from] = nil
|
||||
data[to] = ret
|
||||
end
|
||||
|
||||
__player_data[name] = data
|
||||
end
|
||||
end
|
||||
|
||||
function awards.load()
|
||||
local old_save_path = minetest.get_worldpath().."/awards.txt"
|
||||
local file = io.open(old_save_path, "r")
|
||||
if file then
|
||||
local table = minetest.deserialize(file:read("*all"))
|
||||
if type(table) == "table" then
|
||||
__player_data = table
|
||||
convert_data()
|
||||
else
|
||||
__player_data = {}
|
||||
end
|
||||
file:close()
|
||||
os.rename(old_save_path, minetest.get_worldpath().."/awards.bk.txt")
|
||||
awards.save()
|
||||
else
|
||||
local json = storage:get("player_data")
|
||||
__player_data = json and minetest.parse_json(json) or {}
|
||||
end
|
||||
end
|
||||
|
||||
function awards.player(name)
|
||||
assert(type(name) == "string")
|
||||
local data = __player_data[name] or {}
|
||||
__player_data[name] = data
|
||||
|
||||
data.name = data.name or name
|
||||
data.unlocked = data.unlocked or {}
|
||||
return data
|
||||
end
|
||||
|
||||
function awards.player_or_nil(name)
|
||||
return __player_data[name]
|
||||
end
|
||||
|
||||
function awards.enable(name)
|
||||
awards.player(name).disabled = nil
|
||||
end
|
||||
|
||||
function awards.disable(name)
|
||||
awards.player(name).disabled = true
|
||||
end
|
||||
|
||||
function awards.clear_player(name)
|
||||
__player_data[name] = {}
|
||||
end
|
@ -2,137 +2,70 @@
|
||||
|
||||
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.")).."]"
|
||||
formspec = formspec .. "button_exit[4.2,2.3;3,1;close;"..minetest.formspec_escape(S("OK")).."]"
|
||||
return formspec
|
||||
end
|
||||
sid = awards_list[sid] and sid or 1
|
||||
|
||||
-- Sidebar
|
||||
if sid then
|
||||
local item = awards_list[sid+0]
|
||||
local def = item.def
|
||||
local sitem = awards_list[sid]
|
||||
local sdef = sitem.def
|
||||
if sdef and sdef.secret and not sitem.unlocked then
|
||||
formspec = formspec .. "label[1,2.75;"..
|
||||
minetest.formspec_escape(S("(Secret Award)")).."]"..
|
||||
"image[1,0;3,3;awards_unknown.png]"
|
||||
if sdef and sdef.description then
|
||||
formspec = formspec .. "textarea[0.25,3.25;4.8,1.7;;"..
|
||||
minetest.formspec_escape(
|
||||
S("Unlock this award to find out what it is."))..";]"
|
||||
end
|
||||
else
|
||||
local title = sitem.name
|
||||
if sdef and sdef.title then
|
||||
title = sdef.title
|
||||
end
|
||||
local status = "%s"
|
||||
if sitem.unlocked then
|
||||
status = S("%s (unlocked)")
|
||||
end
|
||||
|
||||
if def and def.secret and not item.unlocked then
|
||||
formspec = formspec .. "label[1,2.75;"..
|
||||
minetest.formspec_escape(S("(Secret Award)")).."]"..
|
||||
"image[1,0;3,3;awards_unknown.png]"
|
||||
if def and def.description then
|
||||
formspec = formspec .. "textarea[0.25,3.25;4.8,1.7;;"..
|
||||
minetest.formspec_escape(
|
||||
S("Unlock this award to find out what it is."))..";]"
|
||||
end
|
||||
else
|
||||
local title = item.name
|
||||
if def and def.title then
|
||||
title = def.title
|
||||
end
|
||||
local status = "%s"
|
||||
if item.unlocked then
|
||||
status = S("%s (unlocked)")
|
||||
end
|
||||
formspec = formspec .. "textarea[0.5,3.1;4.8,1.45;;" ..
|
||||
string.format(status, minetest.formspec_escape(title)) ..
|
||||
";]"
|
||||
|
||||
formspec = formspec .. "textarea[0.5,2.7;4.8,1.45;;" ..
|
||||
string.format(status, minetest.formspec_escape(title)) ..
|
||||
";]"
|
||||
if sdef and sdef.icon then
|
||||
formspec = formspec .. "image[0.45,0;3.5,3.5;" .. sdef.icon .. "]" -- adjusted values from 0.6,0;3,3
|
||||
end
|
||||
|
||||
if def and def.icon then
|
||||
formspec = formspec .. "image[1,0;3,3;" .. def.icon .. "]"
|
||||
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
|
||||
local barwidth = 4.6
|
||||
local perc = nil
|
||||
local label = nil
|
||||
if def.getProgress and data then
|
||||
local res = def:getProgress(data)
|
||||
perc = res.perc
|
||||
label = res.label
|
||||
end
|
||||
if perc then
|
||||
if perc > 1 then
|
||||
perc = 1
|
||||
end
|
||||
formspec = formspec .. "background[0,4.80;" .. barwidth ..",0.25;awards_progress_gray.png;false]"
|
||||
formspec = formspec .. "background[0,4.80;" .. (barwidth * perc) ..",0.25;awards_progress_green.png;false]"
|
||||
if label then
|
||||
formspec = formspec .. "label[1.75,4.63;" .. minetest.formspec_escape(label) .. "]"
|
||||
end
|
||||
end
|
||||
if def and def.description then
|
||||
formspec = formspec .. "textarea[0.25,3.75;4.8,1.7;;"..minetest.formspec_escape(def.description)..";]"
|
||||
formspec = formspec .. "background[0,8.24;" .. barwidth ..",0.4;awards_progress_gray.png;false]"
|
||||
formspec = formspec .. "background[0,8.24;" .. (barwidth * perc) ..",0.4;awards_progress_green.png;false]"
|
||||
if label then
|
||||
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;;" ..
|
||||
minetest.formspec_escape(sdef.description) .. ";]"
|
||||
end
|
||||
end
|
||||
|
||||
-- Create list box
|
||||
formspec = formspec .. "textlist[4.75,0;6,5;awards;"
|
||||
formspec = formspec .. "textlist[4,0;3.8,8.6;awards;"
|
||||
local first = true
|
||||
for _, award in pairs(awards_list) do
|
||||
local def = award.def
|
||||
@ -168,13 +101,13 @@ function awards.show_to(name, to, sid, text)
|
||||
if name == "" or name == nil then
|
||||
name = to
|
||||
end
|
||||
local data = awards.player(to)
|
||||
local data = awards.player(name)
|
||||
if name == to and data.disabled then
|
||||
minetest.chat_send_player(name, S("You've disabled awards. Type /awards enable to reenable."))
|
||||
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
|
||||
@ -199,20 +132,35 @@ function awards.show_to(name, to, sid, text)
|
||||
end
|
||||
end
|
||||
else
|
||||
if sid == nil or sid < 1 then
|
||||
sid = 1
|
||||
end
|
||||
local deco = ""
|
||||
if minetest.global_exists("default") then
|
||||
deco = default.gui_bg .. default.gui_bg_img
|
||||
end
|
||||
-- Show formspec to user
|
||||
minetest.show_formspec(to,"awards:awards",
|
||||
"size[11,5]" .. deco ..
|
||||
"size[8,8.6]" .. deco ..
|
||||
awards.get_formspec(name, to, sid))
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_on_player_receive_fields(function(player, formname, fields)
|
||||
if formname ~= "awards:awards" then
|
||||
return false
|
||||
end
|
||||
if fields.quit then
|
||||
return true
|
||||
end
|
||||
local name = player:get_player_name()
|
||||
if fields.awards then
|
||||
local event = minetest.explode_textlist_event(fields.awards)
|
||||
if event.type == "CHG" then
|
||||
awards.show_to(name, name, event.index, false)
|
||||
end
|
||||
end
|
||||
|
||||
return true
|
||||
end)
|
||||
|
||||
if minetest.get_modpath("sfinv") then
|
||||
sfinv.register_page("awards:awards", {
|
||||
title = S("Awards"),
|
||||
@ -226,8 +174,8 @@ if minetest.get_modpath("sfinv") then
|
||||
get = function(self, player, context)
|
||||
local name = player:get_player_name()
|
||||
return sfinv.make_formspec(player, context,
|
||||
awards.get_formspec(name, name, context.awards_idx or 1),
|
||||
false, "size[11,5]")
|
||||
awards.get_formspec(name, name, context.awards_idx),
|
||||
false)
|
||||
end,
|
||||
on_player_receive_fields = function(self, player, context, fields)
|
||||
if fields.awards then
|
||||
@ -239,6 +187,22 @@ if minetest.get_modpath("sfinv") then
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
local function check_and_reshow(name)
|
||||
local player = minetest.get_player_by_name(name)
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
|
||||
local context = sfinv.get_or_create_context(player)
|
||||
if context.page ~= "awards:awards" then
|
||||
return
|
||||
end
|
||||
|
||||
sfinv.set_player_inventory_formspec(player, context)
|
||||
end
|
||||
|
||||
awards.register_on_unlock(check_and_reshow)
|
||||
end
|
||||
|
||||
if minetest.get_modpath("unified_inventory") ~= nil then
|
@ -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,12 +93,16 @@ 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
|
||||
|
||||
local node_name = node.name
|
||||
node_name = minetest.registered_aliases[node_name] or node_name
|
||||
|
||||
if string.match(node_name, "default:torch_") then -- NALC: fix torch name change on wall place
|
||||
node_name = "default:torch"
|
||||
end
|
||||
awards.notify_place(player, node_name)
|
||||
end)
|
||||
|
||||
@ -109,15 +117,15 @@ awards.register_trigger("craft", {
|
||||
end,
|
||||
key_is_item = true,
|
||||
})
|
||||
minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv)
|
||||
if not 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())
|
||||
end)
|
||||
--minetest.register_on_craft(function(itemstack, player, old_craft_grid, craft_inv)
|
||||
-- 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())
|
||||
--end)
|
||||
|
||||
|
||||
awards.register_trigger("eat", {
|
||||
@ -131,11 +139,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)
|
BIN
textures/_Gimp/awards_Pyromaniac.xcf
Normal file
BIN
textures/_Gimp/awards_Pyromaniac.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_a_cat_in_a_pop_tart.xcf
Normal file
BIN
textures/_Gimp/awards_a_cat_in_a_pop_tart.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_architect.xcf
Normal file
BIN
textures/_Gimp/awards_architect.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_aspiring_farmer.xcf
Normal file
BIN
textures/_Gimp/awards_aspiring_farmer.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_backpacker.xcf
Normal file
BIN
textures/_Gimp/awards_backpacker.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_baker.xcf
Normal file
BIN
textures/_Gimp/awards_baker.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_banker.xcf
Normal file
BIN
textures/_Gimp/awards_banker.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_bricker.xcf
Normal file
BIN
textures/_Gimp/awards_bricker.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_build_a_cave.xcf
Normal file
BIN
textures/_Gimp/awards_build_a_cave.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_builder.xcf
Normal file
BIN
textures/_Gimp/awards_builder.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_castorama.xcf
Normal file
BIN
textures/_Gimp/awards_castorama.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_crafter_of_sticks.xcf
Normal file
BIN
textures/_Gimp/awards_crafter_of_sticks.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_dandelions_are_yellow.xcf
Normal file
BIN
textures/_Gimp/awards_dandelions_are_yellow.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_desert_discoverer.xcf
Normal file
BIN
textures/_Gimp/awards_desert_discoverer.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_desert_dweller.xcf
Normal file
BIN
textures/_Gimp/awards_desert_dweller.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_engineer.xcf
Normal file
BIN
textures/_Gimp/awards_engineer.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_far_lands.xcf
Normal file
BIN
textures/_Gimp/awards_far_lands.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_farming_skills_acquired.xcf
Normal file
BIN
textures/_Gimp/awards_farming_skills_acquired.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_field_worker.xcf
Normal file
BIN
textures/_Gimp/awards_field_worker.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_filthy_rich.xcf
Normal file
BIN
textures/_Gimp/awards_filthy_rich.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_firefighter.xcf
Normal file
BIN
textures/_Gimp/awards_firefighter.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_first_day_in_the_woods.xcf
Normal file
BIN
textures/_Gimp/awards_first_day_in_the_woods.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_first_gold_find.xcf
Normal file
BIN
textures/_Gimp/awards_first_gold_find.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_first_mese_find.xcf
Normal file
BIN
textures/_Gimp/awards_first_mese_find.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_fortress.xcf
Normal file
BIN
textures/_Gimp/awards_fortress.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_geraniums_are_blue.xcf
Normal file
BIN
textures/_Gimp/awards_geraniums_are_blue.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_girls_best_friend.xcf
Normal file
BIN
textures/_Gimp/awards_girls_best_friend.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_glacier_discoverer.xcf
Normal file
BIN
textures/_Gimp/awards_glacier_discoverer.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_glasser.xcf
Normal file
BIN
textures/_Gimp/awards_glasser.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_gold_rush.xcf
Normal file
BIN
textures/_Gimp/awards_gold_rush.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_grasslands_discoverer.xcf
Normal file
BIN
textures/_Gimp/awards_grasslands_discoverer.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_hardened_miner.xcf
Normal file
BIN
textures/_Gimp/awards_hardened_miner.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_hardest_block_on_earth.xcf
Normal file
BIN
textures/_Gimp/awards_hardest_block_on_earth.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_hotelier.xcf
Normal file
BIN
textures/_Gimp/awards_hotelier.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_house_of_obsidian.xcf
Normal file
BIN
textures/_Gimp/awards_house_of_obsidian.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_in_the_dungeon.xcf
Normal file
BIN
textures/_Gimp/awards_in_the_dungeon.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_industrial_age.xcf
Normal file
BIN
textures/_Gimp/awards_industrial_age.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_jungle_discoverer.xcf
Normal file
BIN
textures/_Gimp/awards_jungle_discoverer.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_junglebaby.xcf
Normal file
BIN
textures/_Gimp/awards_junglebaby.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_jungleman.xcf
Normal file
BIN
textures/_Gimp/awards_jungleman.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_lava_and_water.xcf
Normal file
BIN
textures/_Gimp/awards_lava_and_water.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_lava_miner.xcf
Normal file
BIN
textures/_Gimp/awards_lava_miner.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_level1.xcf
Normal file
BIN
textures/_Gimp/awards_level1.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_level2.xcf
Normal file
BIN
textures/_Gimp/awards_level2.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_level3.xcf
Normal file
BIN
textures/_Gimp/awards_level3.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_level4.xcf
Normal file
BIN
textures/_Gimp/awards_level4.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_level5.xcf
Normal file
BIN
textures/_Gimp/awards_level5.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_level6.xcf
Normal file
BIN
textures/_Gimp/awards_level6.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_level7.xcf
Normal file
BIN
textures/_Gimp/awards_level7.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_light_it_up.xcf
Normal file
BIN
textures/_Gimp/awards_light_it_up.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_little_library.xcf
Normal file
BIN
textures/_Gimp/awards_little_library.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_long_ladder.xcf
Normal file
BIN
textures/_Gimp/awards_long_ladder.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_lumberjack.xcf
Normal file
BIN
textures/_Gimp/awards_lumberjack.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_marchand_de_sable.xcf
Normal file
BIN
textures/_Gimp/awards_marchand_de_sable.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_master_architect.xcf
Normal file
BIN
textures/_Gimp/awards_master_architect.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_master_miner.xcf
Normal file
BIN
textures/_Gimp/awards_master_miner.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_mese_mastery.xcf
Normal file
BIN
textures/_Gimp/awards_mese_mastery.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_mini_miner.xcf
Normal file
BIN
textures/_Gimp/awards_mini_miner.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_mushroom_lover.xcf
Normal file
BIN
textures/_Gimp/awards_mushroom_lover.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_obsessed_with_obsidian.xcf
Normal file
BIN
textures/_Gimp/awards_obsessed_with_obsidian.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_on_the_way.xcf
Normal file
BIN
textures/_Gimp/awards_on_the_way.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_outpost.xcf
Normal file
BIN
textures/_Gimp/awards_outpost.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_pharaoh.xcf
Normal file
BIN
textures/_Gimp/awards_pharaoh.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_professional_lumberjack.xcf
Normal file
BIN
textures/_Gimp/awards_professional_lumberjack.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_really_well_lit.xcf
Normal file
BIN
textures/_Gimp/awards_really_well_lit.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_roses_are_red.xcf
Normal file
BIN
textures/_Gimp/awards_roses_are_red.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_saint_maclou.xcf
Normal file
BIN
textures/_Gimp/awards_saint_maclou.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_sam_the_trapper.xcf
Normal file
BIN
textures/_Gimp/awards_sam_the_trapper.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_savannah_discoverer.xcf
Normal file
BIN
textures/_Gimp/awards_savannah_discoverer.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_semi_pro_lumberjack.xcf
Normal file
BIN
textures/_Gimp/awards_semi_pro_lumberjack.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_smelter.xcf
Normal file
BIN
textures/_Gimp/awards_smelter.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_tasty_mushrooms.xcf
Normal file
BIN
textures/_Gimp/awards_tasty_mushrooms.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_template.xcf
Normal file
BIN
textures/_Gimp/awards_template.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_treasurer.xcf
Normal file
BIN
textures/_Gimp/awards_treasurer.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_ui_icon.xcf
Normal file
BIN
textures/_Gimp/awards_ui_icon.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_underground_mushroom_farmer.xcf
Normal file
BIN
textures/_Gimp/awards_underground_mushroom_farmer.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_unknown.xcf
Normal file
BIN
textures/_Gimp/awards_unknown.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_very_simple_snow_man.xcf
Normal file
BIN
textures/_Gimp/awards_very_simple_snow_man.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_watchtower.xcf
Normal file
BIN
textures/_Gimp/awards_watchtower.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_well_lit.xcf
Normal file
BIN
textures/_Gimp/awards_well_lit.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_wheat_magnate.xcf
Normal file
BIN
textures/_Gimp/awards_wheat_magnate.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_white_color_stock.xcf
Normal file
BIN
textures/_Gimp/awards_white_color_stock.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_wool_over_your_eyes.xcf
Normal file
BIN
textures/_Gimp/awards_wool_over_your_eyes.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_wow_i_am_diamonds.xcf
Normal file
BIN
textures/_Gimp/awards_wow_i_am_diamonds.xcf
Normal file
Binary file not shown.
BIN
textures/_Gimp/awards_youre_a_copper.xcf
Normal file
BIN
textures/_Gimp/awards_youre_a_copper.xcf
Normal file
Binary file not shown.
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user