Add files via upload
parent
49ae172c01
commit
769f0604ac
|
@ -0,0 +1,14 @@
|
|||
|
||||
--API object.
|
||||
|
||||
game.api.path = game.path_mod .. "/api"
|
||||
game.path_api = game.api.path
|
||||
|
||||
game.api.ver_maj = 0
|
||||
game.api.ver_min = 0
|
||||
game.api.ver_rev = 1
|
||||
|
||||
|
||||
|
||||
dofile(game.api.path .. "/api_schematics.lua")
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
|
||||
--library object.
|
||||
|
||||
game.library.path = game.path_mod .. "/lib"
|
||||
game.path_lib = game.library.path
|
||||
|
||||
game.library.ver_maj = 0
|
||||
game.library.ver_min = 0
|
||||
game.library.ver_rev = 1
|
||||
|
||||
|
||||
|
||||
dofile(game.library.path .. "/lib_csv.lua")
|
||||
|
|
@ -0,0 +1,51 @@
|
|||
|
||||
game = {}
|
||||
game.version = "1.0"
|
||||
game.path_mod = minetest.get_modpath(minetest.get_current_modname())
|
||||
game.path_world = minetest.get_worldpath()
|
||||
|
||||
-- Intllib
|
||||
local S
|
||||
local NS
|
||||
if minetest.get_modpath("intllib") then
|
||||
S = intllib.Getter()
|
||||
else
|
||||
S, NS = dofile(game.path_mod.."/intllib.lua")
|
||||
end
|
||||
game.intllib = S
|
||||
|
||||
minetest.log(S("[MOD] game: Loading..."))
|
||||
|
||||
--game.world_type = minetest.settings:get("game_world_type")
|
||||
--minetest.log(S("[MOD]: game: Using world type " .. tostring(game.world_type)))
|
||||
|
||||
|
||||
game.api = {} --provides hooks for accessing the installed APIs
|
||||
game.library = {} --Provides access to libraries functions called JIT.
|
||||
game.players = {} --controls all aspects of player. Sets the definition of and controls attributes of(avatar and game stats)
|
||||
game.rules = {} --Provides a library of functions for creating the "rules" of a game based on the type of game chosen.
|
||||
game.world = {} --Provides general world data during runtime
|
||||
|
||||
|
||||
|
||||
dofile(game.path_mod .. "/game_api.lua")
|
||||
dofile(game.path_mod .. "/game_lib.lua")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
--API functionality. This is concept, not official. May not even possilble.
|
||||
--game.register_library
|
||||
--game.register_api = function(name, def)
|
||||
--game.register_player = function(player, def)
|
||||
--game.register_ruleset = function(ruleset, def)
|
||||
|
||||
--game.callbacks = function(name, callbacks)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
minetest.log(S("[MOD] game: Successfully loaded."))
|
||||
|
|
@ -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,4 @@
|
|||
name = game
|
||||
description = A drop in replacement for the most fundemental aspects of default. Will provide access to APIs, item registration, basic mapgen defs, player API, and Rules API.
|
||||
depends =
|
||||
optional_depends =
|
|
@ -0,0 +1,5 @@
|
|||
#game settings
|
||||
|
||||
#Selects world type. Options are Default = 0, Valleys = 1, Continental = 2, Continental_v2 = 3, Islands = 4, Islands_x2 = 5, Islands_x25 = 6, Islands_x3 = 7, Archipelago = 8, Floatworld = 9
|
||||
|
||||
game_world_type (World Type - Options are Default = 0, Valleys = 1, Continental = 2, Continental_v2 = 3, Islands = 4, Islands_x2 = 5, Islands_x25 = 6, Islands_x3 = 7, Archipelago = 8, Floatworld = 9) int 2
|
Loading…
Reference in New Issue