Compare commits
5 Commits
d3488b1c43
...
84711c1c6b
Author | SHA1 | Date |
---|---|---|
A. Demant | 84711c1c6b | |
ademant | 83783fb92c | |
ademant | 58e3ecd68a | |
ademant | cd314fcd95 | |
ademant | 8104945480 |
|
@ -1,18 +1,21 @@
|
||||||
Minetest Game mod: Statistic Farming
|
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
|
||||||
==========================
|
# Minetest Game mod: Statistic Farming
|
||||||
|
|
||||||
See license.txt for license information.
|
See license.txt for license information.
|
||||||
|
|
||||||
|
## Description
|
||||||
Mod with several awards based on statistical data from mod xpfw:
|
Mod with several awards based on statistical data from mod xpfw:
|
||||||
- Hiker: For walking miles and miles and miles....
|
- Hiker: For walking miles and miles and miles....
|
||||||
- Swimmer: For swimming quite long
|
- Swimmer: For swimming quite long
|
||||||
- Crafter: For crafting nice things
|
- Crafter: For crafting nice things
|
||||||
|
- Death: For dying always and respawning
|
||||||
|
|
||||||
|
## Authors of source code
|
||||||
|
|
||||||
Authors of source code
|
|
||||||
----------------------
|
|
||||||
Originally by ademant (MIT)
|
Originally by ademant (MIT)
|
||||||
|
|
||||||
Authors of media (textures)
|
## Authors of media (textures)
|
||||||
---------------------------
|
|
||||||
Created by ademant (CC BY 3.0):
|
Created by ademant (CC BY 3.0):
|
||||||
statistic_awards_hiker based on Art by Joel Lee
|
statistic_awards_hiker based on Art by Joel Lee
|
||||||
statistic_awards_death based on illustration by Paul Kidby
|
statistic_awards_death based on illustration by Paul Kidby
|
3
abm.lua
3
abm.lua
|
@ -1,5 +1,5 @@
|
||||||
|
|
||||||
statistic_awards.globaltimer=0
|
statistic_awards.globaltimer=tonumber(minetest.settings:get("statistic_awards.globaltime")) or 1
|
||||||
|
|
||||||
minetest.register_globalstep(function(dtime)
|
minetest.register_globalstep(function(dtime)
|
||||||
statistic_awards.globaltimer=statistic_awards.globaltimer+dtime
|
statistic_awards.globaltimer=statistic_awards.globaltimer+dtime
|
||||||
|
@ -9,7 +9,6 @@ minetest.register_globalstep(function(dtime)
|
||||||
for i=1, #players do
|
for i=1, #players do
|
||||||
local player=players[i]
|
local player=players[i]
|
||||||
local player_awards=awards.player(player:get_player_name())
|
local player_awards=awards.player(player:get_player_name())
|
||||||
-- print(dump2(player_awards))
|
|
||||||
local player_walked=xpfw.player_get_attribute(player,"walked")
|
local player_walked=xpfw.player_get_attribute(player,"walked")
|
||||||
local hike_award=statistic_awards.hiking[1]
|
local hike_award=statistic_awards.hiking[1]
|
||||||
if player_walked ~= nil then
|
if player_walked ~= nil then
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
if minetest.get_modpath("awards") and minetest.get_modpath("xpfw") then
|
if rawget(_G, "awards") and rawget(_G, "xpfw") then
|
||||||
|
|
||||||
for i,aw_def in ipairs(statistic_awards.hiking) do
|
for i,aw_def in ipairs(statistic_awards.hiking) do
|
||||||
local awdef={
|
local awdef={
|
||||||
|
|
32
config.lua
32
config.lua
|
@ -1,36 +1,38 @@
|
||||||
|
local S=physio_stress.intllib
|
||||||
|
|
||||||
statistic_awards.hiking={
|
statistic_awards.hiking={
|
||||||
{basename="statisticawards_hiking",
|
{basename="statisticawards_hiking",
|
||||||
level=1,
|
level=1,
|
||||||
title="Walked 1000 miles",
|
title="Walked 1000 miles",
|
||||||
description="You walked quite far. Keep going.",
|
description=S("You walked quite far. Keep going."),
|
||||||
baseicon = "statistic_awards_hiking.png",
|
baseicon = "statistic_awards_hiking.png",
|
||||||
threshold=1000,
|
threshold=1000,
|
||||||
difficulty=0.001,},
|
difficulty=0.001,},
|
||||||
{basename="statisticawards_hiking",
|
{basename="statisticawards_hiking",
|
||||||
level=2,
|
level=2,
|
||||||
title="Walked 10000 miles",
|
title="Walked 10000 miles",
|
||||||
description="You walked quite far. Keep going.",
|
description=S("You walked quite far. Keep going."),
|
||||||
baseicon = "statistic_awards_hiking.png",
|
baseicon = "statistic_awards_hiking.png",
|
||||||
threshold=10000,
|
threshold=10000,
|
||||||
difficulty=0.005,},
|
difficulty=0.005,},
|
||||||
{basename="statisticawards_hiking",
|
{basename="statisticawards_hiking",
|
||||||
level=3,
|
level=3,
|
||||||
title="Walked 50000 miles",
|
title="Walked 50000 miles",
|
||||||
description="You walked quite far. Keep going.",
|
description=S("You walked quite far. Keep going."),
|
||||||
baseicon = "statistic_awards_hiking.png",
|
baseicon = "statistic_awards_hiking.png",
|
||||||
threshold=50000,
|
threshold=50000,
|
||||||
difficulty=0.01,},
|
difficulty=0.01,},
|
||||||
{basename="statisticawards_hiking",
|
{basename="statisticawards_hiking",
|
||||||
level=4,
|
level=4,
|
||||||
title="Walked 100000 miles",
|
title="Walked 100000 miles",
|
||||||
description="You walked quite far. Keep going.",
|
description=S("You walked quite far. Keep going."),
|
||||||
baseicon = "statistic_awards_hiking.png",
|
baseicon = "statistic_awards_hiking.png",
|
||||||
threshold=100000,
|
threshold=100000,
|
||||||
difficulty=0.1,},
|
difficulty=0.1,},
|
||||||
{basename="statisticawards_hiking",
|
{basename="statisticawards_hiking",
|
||||||
level=5,
|
level=5,
|
||||||
title="Walked 500000 miles",
|
title="Walked 500000 miles",
|
||||||
description="You walked quite far. Keep going.",
|
description=S("You walked quite far. Keep going."),
|
||||||
baseicon = "statistic_awards_hiking.png",
|
baseicon = "statistic_awards_hiking.png",
|
||||||
threshold=500000,
|
threshold=500000,
|
||||||
difficulty=1,},
|
difficulty=1,},
|
||||||
|
@ -39,21 +41,21 @@ statistic_awards.crafting={
|
||||||
{basename="statisticawards_crafting",
|
{basename="statisticawards_crafting",
|
||||||
level=1,
|
level=1,
|
||||||
title="crafted 100 items",
|
title="crafted 100 items",
|
||||||
description="You crafted quite far. Keep going.",
|
description=S("You crafted quite much. Keep going."),
|
||||||
baseicon = "statistic_awards_crafting.png",
|
baseicon = "statistic_awards_crafting.png",
|
||||||
threshold=100,
|
threshold=100,
|
||||||
difficulty=0.001,},
|
difficulty=0.001,},
|
||||||
{basename="statisticawards_crafting",
|
{basename="statisticawards_crafting",
|
||||||
level=2,
|
level=2,
|
||||||
title="Crafted 1000 items",
|
title="Crafted 1000 items",
|
||||||
description="You crafted quite far. Keep going.",
|
description=S("You crafted quite much. Keep going."),
|
||||||
baseicon = "statistic_awards_crafting.png",
|
baseicon = "statistic_awards_crafting.png",
|
||||||
threshold=1000,
|
threshold=1000,
|
||||||
difficulty=0.005,},
|
difficulty=0.005,},
|
||||||
{basename="statisticawards_crafting",
|
{basename="statisticawards_crafting",
|
||||||
level=3,
|
level=3,
|
||||||
title="Crafted 5000 items",
|
title="Crafted 5000 items",
|
||||||
description="You crafted quite far. Keep going.",
|
description=S("You crafted quite much. Keep going."),
|
||||||
baseicon = "statistic_awards_crafting.png",
|
baseicon = "statistic_awards_crafting.png",
|
||||||
threshold=5000,
|
threshold=5000,
|
||||||
difficulty=0.01,},
|
difficulty=0.01,},
|
||||||
|
@ -62,14 +64,14 @@ statistic_awards.swimming={
|
||||||
{basename="statisticawards_swimming",
|
{basename="statisticawards_swimming",
|
||||||
level=1,
|
level=1,
|
||||||
title="Swam 100 miles",
|
title="Swam 100 miles",
|
||||||
description="You swam quite far. Keep going.",
|
description=S("You swam quite far. Keep going."),
|
||||||
baseicon = "statistic_awards_swimming.png",
|
baseicon = "statistic_awards_swimming.png",
|
||||||
threshold=100,
|
threshold=100,
|
||||||
difficulty=0.001,},
|
difficulty=0.001,},
|
||||||
{basename="statisticawards_swimming",
|
{basename="statisticawards_swimming",
|
||||||
level=2,
|
level=2,
|
||||||
title="Swam 1000 miles",
|
title="Swam 1000 miles",
|
||||||
description="You swam quite far. Keep going.",
|
description=S("You swam quite far. Keep going."),
|
||||||
baseicon = "statistic_awards_swimming.png",
|
baseicon = "statistic_awards_swimming.png",
|
||||||
threshold=1000,
|
threshold=1000,
|
||||||
difficulty=0.005,},
|
difficulty=0.005,},
|
||||||
|
@ -83,14 +85,14 @@ statistic_awards.swimming={
|
||||||
{basename="statisticawards_swimming",
|
{basename="statisticawards_swimming",
|
||||||
level=4,
|
level=4,
|
||||||
title="Swam 10000 miles",
|
title="Swam 10000 miles",
|
||||||
description="You swam quite far. Keep going.",
|
description=S("You swam quite far. Keep going."),
|
||||||
baseicon = "statistic_awards_swimming.png",
|
baseicon = "statistic_awards_swimming.png",
|
||||||
threshold=10000,
|
threshold=10000,
|
||||||
difficulty=0.1,},
|
difficulty=0.1,},
|
||||||
{basename="statisticawards_swimming",
|
{basename="statisticawards_swimming",
|
||||||
level=5,
|
level=5,
|
||||||
title="Swam 50000 miles",
|
title="Swam 50000 miles",
|
||||||
description="You swam quite far. Keep going.",
|
description=S("You swam quite far. Keep going."),
|
||||||
baseicon = "statistic_awards_swimming.png",
|
baseicon = "statistic_awards_swimming.png",
|
||||||
threshold=50000,
|
threshold=50000,
|
||||||
difficulty=1,},
|
difficulty=1,},
|
||||||
|
@ -100,7 +102,7 @@ statistic_awards.deaths={
|
||||||
{basename="statisticawards_deaths",
|
{basename="statisticawards_deaths",
|
||||||
level=1,
|
level=1,
|
||||||
title="Died 7 times",
|
title="Died 7 times",
|
||||||
description="You're cat is jealous about you.",
|
description=S("You're cat is jealous about you."),
|
||||||
baseicon = "statistic_awards_death.png",
|
baseicon = "statistic_awards_death.png",
|
||||||
threshold=7,
|
threshold=7,
|
||||||
difficulty=0.001,},
|
difficulty=0.001,},
|
||||||
|
@ -114,14 +116,14 @@ statistic_awards.deaths={
|
||||||
{basename="statisticawards_deaths",
|
{basename="statisticawards_deaths",
|
||||||
level=3,
|
level=3,
|
||||||
title="Died 1000 times",
|
title="Died 1000 times",
|
||||||
description="Expert in death",
|
description=S("Expert in death"),
|
||||||
baseicon = "statistic_awards_death.png",
|
baseicon = "statistic_awards_death.png",
|
||||||
threshold=1000,
|
threshold=1000,
|
||||||
difficulty=0.1,},
|
difficulty=0.1,},
|
||||||
{basename="statisticawards_deaths",
|
{basename="statisticawards_deaths",
|
||||||
level=4,
|
level=4,
|
||||||
title="Died 5000 times",
|
title="Died 5000 times",
|
||||||
description="Life is boring?",
|
description=S("Life is boring?"),
|
||||||
baseicon = "statistic_awards_death.png",
|
baseicon = "statistic_awards_death.png",
|
||||||
threshold=5000,
|
threshold=5000,
|
||||||
difficulty=1,},
|
difficulty=1,},
|
||||||
|
|
|
@ -0,0 +1,4 @@
|
||||||
|
default
|
||||||
|
awards
|
||||||
|
xpfw
|
||||||
|
basic_functions
|
2
init.lua
2
init.lua
|
@ -1,6 +1,8 @@
|
||||||
statistic_awards = {}
|
statistic_awards = {}
|
||||||
statistic_awards.path = minetest.get_modpath("statistic_awards")
|
statistic_awards.path = minetest.get_modpath("statistic_awards")
|
||||||
statistic_awards.modname = minetest.get_current_modname()
|
statistic_awards.modname = minetest.get_current_modname()
|
||||||
|
local S = dofile(statistic_awards.path .. "/intllib.lua")
|
||||||
|
statistic_awards.intllib = S
|
||||||
|
|
||||||
-- import settingtypes.txt
|
-- import settingtypes.txt
|
||||||
basic_functions.import_settingtype(statistic_awards.path .. "/settingtypes.txt")
|
basic_functions.import_settingtype(statistic_awards.path .. "/settingtypes.txt")
|
||||||
|
|
|
@ -0,0 +1,45 @@
|
||||||
|
|
||||||
|
-- Fallback functions for when `intllib` is not installed.
|
||||||
|
-- Code released under Unlicense <http://unlicense.org>.
|
||||||
|
|
||||||
|
-- Get the latest version of this file at:
|
||||||
|
-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
|
||||||
|
|
||||||
|
local function format(str, ...)
|
||||||
|
local args = { ... }
|
||||||
|
local function repl(escape, open, num, close)
|
||||||
|
if escape == "" then
|
||||||
|
local replacement = tostring(args[tonumber(num)])
|
||||||
|
if open == "" then
|
||||||
|
replacement = replacement..close
|
||||||
|
end
|
||||||
|
return replacement
|
||||||
|
else
|
||||||
|
return "@"..open..num..close
|
||||||
|
end
|
||||||
|
end
|
||||||
|
return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
|
||||||
|
end
|
||||||
|
|
||||||
|
local gettext, ngettext
|
||||||
|
if minetest.get_modpath("intllib") then
|
||||||
|
if intllib.make_gettext_pair then
|
||||||
|
-- New method using gettext.
|
||||||
|
gettext, ngettext = intllib.make_gettext_pair()
|
||||||
|
else
|
||||||
|
-- Old method using text files.
|
||||||
|
gettext = intllib.Getter()
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
-- Fill in missing functions.
|
||||||
|
|
||||||
|
gettext = gettext or function(msgid, ...)
|
||||||
|
return format(msgid, ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
ngettext = ngettext or function(msgid, msgid_plural, n, ...)
|
||||||
|
return format(n==1 and msgid or msgid_plural, ...)
|
||||||
|
end
|
||||||
|
|
||||||
|
return gettext, ngettext
|
|
@ -0,0 +1,39 @@
|
||||||
|
# German Translation for statistic_awards mod.
|
||||||
|
# Copyright (C) 2019
|
||||||
|
# This file is distributed under the same license as the farming package.
|
||||||
|
# Xanthin.
|
||||||
|
#
|
||||||
|
#, fuzzy
|
||||||
|
msgid ""
|
||||||
|
msgstr ""
|
||||||
|
"Project-Id-Version: 1.27\n"
|
||||||
|
"Report-Msgid-Bugs-To: \n"
|
||||||
|
"POT-Creation-Date: 2019-02-14 HO:MI+ZONE\n"
|
||||||
|
"PO-Revision-Date: 2019-02-14 HO:MI+ZONE\n"
|
||||||
|
"Last-Translator: ademant\n"
|
||||||
|
"Language-Team: \n"
|
||||||
|
"Language: German \n"
|
||||||
|
"MIME-Version: 1.0\n"
|
||||||
|
"Content-Type: text/plain; charset=UTF-8\n"
|
||||||
|
"Content-Transfer-Encoding: 8bit\n"
|
||||||
|
|
||||||
|
msgid "You walked quite far. Keep going."
|
||||||
|
msgstr "Du bist schon weit gekommen. Weiter so."
|
||||||
|
|
||||||
|
msgid "You crafted quite much. Keep going."
|
||||||
|
msgstr "Du hast schon viel hergestellt. Weiter so."
|
||||||
|
|
||||||
|
msgid "You swam quite far. Keep going."
|
||||||
|
msgstr "Du bist schon weit geschwommen. Weiter so."
|
||||||
|
|
||||||
|
msgid "You're cat is jealous about you."
|
||||||
|
msgstr "Deine Katze wird eifersüchtig."
|
||||||
|
|
||||||
|
msgid "You like the danger."
|
||||||
|
msgstr "Du liebst wohl die Gefahr."
|
||||||
|
|
||||||
|
msgid "Expert in death"
|
||||||
|
msgstr "Experte im Geschäft mit dem Tod"
|
||||||
|
|
||||||
|
msgid "Life is boring?"
|
||||||
|
msgstr "Ist das Leben langweilig?"
|
|
@ -1 +1 @@
|
||||||
|
statistic_awards.globaltime (Global time step for checking awards) float 1.5
|
||||||
|
|
Binary file not shown.
Before Width: | Height: | Size: 148 KiB After Width: | Height: | Size: 148 KiB |
Loading…
Reference in New Issue