New translation system, part 1: entities

This commit is contained in:
Wuzzy 2019-03-07 20:43:39 +01:00
parent e0418553a6
commit 1217d9fa88
49 changed files with 80 additions and 245 deletions

View file

@ -3,13 +3,9 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
--dofile(minetest.get_modpath("mobs").."/api.lua")
--THIS IS THE MASTER ITEM LIST TO USE WITH DEFAULT
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
local c = mobs_mc.is_item_variable_overridden

View file

@ -3,9 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--maikerumines throwing code
--arrow (weapon)

View file

@ -1,9 +1,7 @@
--MC Heads for minetest
--maikerumine
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
-- Heads system

View file

@ -2,9 +2,7 @@
--################### AGENT
--###################
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:agent", {
type = "npc",

View file

@ -1,8 +1,6 @@
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:bat", {
type = "animal",

View file

@ -3,11 +3,8 @@
-- Model and mobs_blaze.png see https://github.com/22i/minecraft-voxel-blender-models
-- blaze.lua partial copy of mobs_mc/ghast.lua
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### BLAZE
--###################

View file

@ -1,11 +1,6 @@
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### CHICKEN

View file

@ -1,8 +1,6 @@
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
local cow_def = {
type = "animal",

View file

@ -1,11 +1,6 @@
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### CREEPER

View file

@ -8,5 +8,4 @@ mcl_fishing?
bones?
mesecons_materials?
mobs_mc_gameconfig?
intllib?
doc_items?

View file

@ -2,9 +2,7 @@
--################### ENDERDRAGON
--###################
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--[[
mobs:register_mob("mobs_mc:12enderdragon", {

View file

@ -10,12 +10,7 @@
-- and they are provoked by looking directly at them.
-- TODO: Implement MC behaviour.
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### ENDERMAN

View file

@ -2,9 +2,7 @@
--################### ENDERMITE
--###################
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:endermite", {
type = "monster",

View file

@ -3,11 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### GHAST

View file

@ -4,9 +4,7 @@
--################### GUARDIAN
--###################
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:guardian", {
type = "monster",

View file

@ -4,9 +4,7 @@
--################### GUARDIAN
--###################
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:guardian_elder", {
type = "monster",

View file

@ -3,9 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### HORSE

View file

@ -1,45 +0,0 @@
-- 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

View file

@ -3,11 +3,8 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### IRON GOLEM
--###################

View file

@ -1,6 +1,4 @@
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### LLAMA

View file

@ -3,9 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### OCELOT AND CAT

View file

@ -3,12 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### PARROT

View file

@ -1,8 +1,6 @@
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:pig", {
type = "animal",

View file

@ -1,10 +1,6 @@
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### POLARBEAR

View file

@ -1,8 +1,6 @@
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
local rabbit = {
type = "animal",

View file

@ -1,8 +1,6 @@
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### SHEEP

View file

@ -3,11 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### SHULKER

View file

@ -2,9 +2,7 @@
--################### SILVERFISH
--###################
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:silverfish", {
type = "monster",

View file

@ -3,12 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### SKELETON

View file

@ -3,9 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### WITHER SKELETON

View file

@ -1,8 +1,6 @@
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
-- Returns a function that spawns children in a circle around pos.
-- To be used as on_die callback.

View file

@ -3,9 +3,8 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
local snow_trail_frequency = 0.5 -- Time in seconds for checking to add a new snow trail
local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false

View file

@ -3,11 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### SPIDER

View file

@ -4,9 +4,7 @@
--################### SQUID
--###################
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:squid", {
type = "animal",

View file

@ -3,9 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### VEX

View file

@ -19,9 +19,7 @@
-- TODO: Internal inventory, pick up items, trade with other villagers
-- TODO: Farm stuff
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
-- playername-indexed table containing the previously used tradenum
local player_tradenum = {}

View file

@ -3,11 +3,8 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### EVOKER
--###################

View file

@ -3,9 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
mobs:register_mob("mobs_mc:illusioner", {
type = "monster",

View file

@ -3,11 +3,8 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### VINDICATOR
--###################

View file

@ -3,9 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
-- TODO: Turn villagers to zombie villager

View file

@ -3,11 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### WITCH

View file

@ -3,18 +3,12 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### WITHER
--###################
mobs:register_mob("mobs_mc:wither", {
type = "monster",
hp_max = 300,

View file

@ -1,8 +1,6 @@
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
local default_walk_chance = 50

View file

@ -3,12 +3,7 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
--dofile(minetest.get_modpath("mobs").."/api.lua")
local S = minetest.get_translator("mobs_mc")
--###################
--################### ZOMBIE

View file

@ -3,11 +3,8 @@
--made for MC like Survival game
--License for code WTFPL and otherwise stated in readmes
-- intllib
local MP = minetest.get_modpath(minetest.get_current_modname())
local S, NS = dofile(MP.."/intllib.lua")
local S = minetest.get_translator("mobs_mc")
--dofile(minetest.get_modpath("mobs").."/api.lua")
--###################
--################### ZOMBIE PIGMAN
--###################