summaryrefslogtreecommitdiff
path: root/init.lua
diff options
context:
space:
mode:
Diffstat (limited to 'init.lua')
-rw-r--r--init.lua44
1 files changed, 44 insertions, 0 deletions
diff --git a/init.lua b/init.lua
new file mode 100644
index 0000000..f88c74b
--- /dev/null
+++ b/init.lua
@@ -0,0 +1,44 @@
+-- AWARDS
+-- by Rubenwardy, CC-BY-SA
+-------------------------------------------------------
+-- this is the api definition file for the awards mod
+-------------------------------------------------------
+
+-- The global award namespace
+awards={}
+player_data={}
+
+-- A table of award definitions
+awards.def={}
+
+-- Load files
+dofile(minetest.get_modpath("awards").."/triggers.lua")
+
+
+-- API Functions
+function awards.register_achievement(name,data_table)
+ data_table["name"] = name
+ table.insert(awards.def,data_table);
+end
+
+function awards.register_onDig(data)
+ table.insert(awards.onDig,data);
+end
+
+function awards:getNodeCount(nodeName)
+ return self.count[nodeName]
+end
+
+
+-- Example Achievements
+awards.register_achievement("award_mesefind",{
+ title = "First Mese Find",
+ description = "Found some Mese!",
+})
+
+awards.register_onDig({
+ award="",
+ func=function(player)
+
+ end
+}) \ No newline at end of file