start new config #1

master
ademant 2018-11-05 14:46:21 +01:00
parent e94bf8a6bb
commit 76273010d1
10 changed files with 146 additions and 15 deletions

20
api.lua Normal file
View File

@ -0,0 +1,20 @@
minerdream.register_lump = function(ldef)
local tier=1
if ldef.tier then
tier = ldef.tier
end
tdef=tier_definition[tier]
local stack_max=minerdream.max_stack
if ldef.max_stack then
stack_max=ldef.max_stack
end
lump_def={
name=minetest.get_current_modname()..":"..ldef.name.."_lump",
description=""..core.colorize(tdef.color,ldef.name.." lump\n")..core.colorize("#A0A0A0","tier: "..tier.." ("..tdef.desc..")")
inventory_image=minetest.get_current_modname().."_"..ldef.name.."_lump.png",
stack_max=stack_max,
}
minetest.register_craftitem(lump_def.name,lump_def)
end

16
config.lua Normal file
View File

@ -0,0 +1,16 @@
minerdream.max_stack = 999
local has_value = minerdream.has_value
local tier_cols={
col_num={"tier"},
}
local tier_definition = minerdream.import_csv(minerdream.path.."/tiers.txt",tier_cols)
local ores_cols={
col_num={"clust_num_ores","clust_size","ymin","ymax","clust_scarcity",
"cooktime","tier","heal","use","jump","speed","gravity",
"helmet_fleshy","chest_fleshy","legging_fleshy","boot_fleshy","shield_fleshy"},
groups_num={"crack","dust","block","desert"}
}
local ores_definition = minerdream.import_csv(minerdream.path.."/config.txt",ores_cols)

30
config.txt Normal file
View File

@ -0,0 +1,30 @@
name,crack,dust,block,desert,check_mods,override,clust_num_ores,clust_size,ymin,ymax,clust_scarcity,cooktime,tier,heal,use,jump,speed,gravity,helmet_fleshy,chest_fleshy,legging_fleshy,boot_fleshy,shield_fleshy
rhodium,5,1,1,,,,3,3,-31000,-1500,16 * 16 * 16,64,6,8.35,60,0.09,0.12,-0.08,15,20,20,15,15
calcium,5,1,1,,,,5,2,-31000,420,12 * 12 * 12,2,,,,,,,,,,,
tantalum,5,1,1,,,,3,3,-31000,-1500,16 * 16 * 16,64,6,8.2,60,0.1,0.16,-0.09,14.5,19.5,19.5,14.5,14.5
ruthenium,4,1,1,,,,3,3,-31000,-500,15 * 15 * 15,32,5,8,80,0.08,0.08,-0.08,13.75,18.75,18.75,13.75,13.75
cobalt,4,1,1,,,,3,3,-31000,-300,14 * 14 * 14,32,5,8.25,80,0.09,0.09,-0.09,13.5,18.5,18.5,13.5,13.5
platinum,1,1,1,,,,4,3,-31000,-300,14 * 14 * 14,16,4,7.75,100,0.03,0.03,-0.03,13.5,18.5,18.5,13.5,13.5
aluminium,1,1,1,,aluminium,,4,3,-31000,-250,14 * 14 * 14,32,4,7.5,100,0.06,0.06,-0.06,13,18,18,13,13
stainlesssteel,,,,,,,,,,,,,2,6,175,0.01,,0.01,10,15,15,10,10
zinc,1,1,1,,,,7,3,-31000,-50,14 * 14 * 14,4,,,,,,,,,,,
potassium,3,1,1,,,,7,3,-31000,420,13 * 13 * 13,2,,,,,,,,,,,
nickel,2,1,1,,,,7,3,-31000,-40,13 * 13 * 13,4,2,5,350,,-0.01,0.01,11,16,16,11,11
coal,3,,,1,,,,,,,,,,,,,,,,,,,
sulfur,3,1,,1,,,,,,,,,,,,,,,,,,,
lapislazuli,3,,,1,,,,,,,,,,,,,,,,,,,
saltpeter,3,1,1,1,,,,,,,,,,,,,,,,,,,
silver,3,,,,,moreores,3,2,-31000,-64,14 * 14 * 14,8,3,7.5,300,0.02,0.02,-0.02,11,16,16,11,11
lead,2,,,,,technic,7,3,-31000,-70,13 * 13 * 13,4,3,0,600,,-0.01,0.04,11,16,16,11,11
spinel,5,,,,,,1,1,-31000,-1700,15 * 15 * 15,,,,,,,,,,,,
garnet,4,,,,,,1,1,-31000,-650,15 * 15 * 15,,,,,,,,,,,,
bituminous_coal,4,,,,,,10,3,-31000,-500,13 * 13 * 13,,,,,,,,,,,,
topaz,4,,,,,,1,1,-31000,-1700,15 * 15 * 15,,,,,,,,,,,,
jade,4,,,,,,1,1,-31000,-650,15 * 15 * 15,,,,,,,,,,,,
aquamarine,4,,,,,,1,1,-31000,-1700,16 * 16 * 16,,,,,,,,,,,,
amethyst,4,,,,,,1,1,-31000,-650,15 * 15 * 15,,,,,,,,,,,,
onyx,4,,,,,,1,1,-31000,-1700,16 * 16 * 16,,,,,,,,,,,,
defender,,,,,,,,,,,,,5,8,80,0.08,0.08,-0.08,14.25,19.25,19.25,14.25,14.25
scout,,,,,,,,,,,,,5,8.75,80,0.1,0.13,-0.1,13.5,18.5,18.5,13.5,13.5
shadow,,,,,,,,,,,,,6,9,50,0.1,0.25,-0.1,14.5,19.5,19.5,14.5,14.5
knight,,,,,,,,,,,,,6,8.5,60,0.1,0.13,-0.09,15.25,20.25,20.25,15.25,15.25

60
functions.lua Normal file
View File

@ -0,0 +1,60 @@
minerdream.has_value = function(tab, val)
-- test if val is in tab
for index, value in ipairs(tab) do
if value == val then
return true
end
end
return false
end
local has_value=minerdream.has_value
-- read table "infile" where in "def" is defined, which cols are numbers and which belongs to a group
minerdream.import_csv = function(infile,def)
local file = io.open(infile, "r")
local outdata = {}
-- reading header with column names
local splitchar=","
if def.seperator then
splitchar=def.seperator
end
local header = file:read():gsub("\r",""):split(splitchar,true)
-- read each line, split in separat fields and stores in array
-- by header the value is stored as numeric, in the group environment or as text
for line in file:lines() do
local attribs = line:gsub("\r",""):split(splitchar,true)
local nrow={groups={}}
for i,d in ipairs(attribs) do
if d ~= "" then
local th=header[i]
local dsaved = false
if def.col_num then
if has_value(def.col_num,th) then
nrow[th] = tonumber(d)
dsaved = true
end
end
if def.groups_num then
if has_value(def.groups_num,th) then
nrow.groups[th]=tonumber(d)
dsaved = true
end
end
if not dsaved then
nrow[th]=d
end
end
end
if nrow.name then
outdata[nrow.name] = nrow
else
outdata[#outdata+1] = nrow
end
end
file:close()
return outdata
end

View File

@ -1,6 +1,8 @@
minerdream = {}
minerdream.path = minetest.get_modpath("minerdream")
dofile(minerdream.path .. "/functions.lua")
dofile(minerdream.path .. "/config.lua")
dofile(minerdream.path .. "/items.lua")
dofile(minerdream.path .. "/tools.lua")
dofile(minerdream.path .. "/overrides.lua")
@ -12,4 +14,4 @@ dofile(minerdream.path .. "/armor.lua")
dofile(minerdream.path .. "/treasure.lua")
dofile(minerdream.path .. "/experiments.lua")
dofile(minerdream.path .. "/mobs.lua")
dofile(minerdream.path .. "/awards.lua")
dofile(minerdream.path .. "/awards.lua")

2
nohup.out Normal file
View File

@ -0,0 +1,2 @@
(geany:3132): dbind-WARNING **: 08:30:45.601: Error retrieving accessibility bus address: org.freedesktop.DBus.Error.ServiceUnknown: The name org.a11y.Bus was not provided by any .service files

Binary file not shown.

Before

Width:  |  Height:  |  Size: 174 B

After

Width:  |  Height:  |  Size: 148 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 245 B

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 180 B

View File

@ -1,14 +1,15 @@
1 FFFFFF common
2 BFFFFF uncommon
3 00FFFF almost rare
4 40FF80 rare
5 0040FF extra rare
6 00FF00 epic
7 00BF00 royal
8 8000BF heroic
9 FF40BF unreal
10 FF0000 mythic
11 FF8000 legendary
12 FFBF00 impossible
13 FFFF00 god-like
14 000000 ultimate
name,color,desc
1,FFFFFF,common
2,BFFFFF,uncommon
3,00FFFF,almost rare
4,40FF80,rare
5,0040FF,extra rare
6,00FF00,epic
7,00BF00,royal
8,8000BF,heroic
9,FF40BF,unreal
10,FF0000,mythic
11,FF8000,legendary
12,FFBF00,impossible
13,FFFF00,god-like
14,000000,ultimate