further change to new config

master
A. Demant 2018-11-07 19:30:09 +01:00
parent c430bad342
commit 8ed6b1907b
5 changed files with 53 additions and 30 deletions

40
api.lua
View File

@ -38,9 +38,9 @@ minerdream.register_armor = function(adef,tier_definition)
local modname=minetest.get_current_modname()
local arm_trans={helmet="armor_head",chestplate="armor_torso",leggings="armor_legs",
boots="armor_feet",shield="armor_shield"}
print(dump(adef))
-- print(dump(adef))
for _,arm in ipairs({"helmet","chestplate","leggings","boots","shield"}) do
print(arm.."_fleshy")
-- print(arm.."_fleshy")
if adef[arm.."_fleshy"] then
local armdef={name=modname..":"..arm.."_"..adef.name,
desc_name=adef.name.." "..arm,
@ -51,50 +51,58 @@ minerdream.register_armor = function(adef,tier_definition)
damage_groups=damage_groups,
}
armdef.groups[arm_trans[arm]] = 1
print(dump(armdef))
-- print(dump(armdef))
local hdesc=""..core.colorize(tdef.color,adef.name.." "..arm.."\n")..desc
print(hdesc)
-- print(hdesc)
local_register_armor(hdesc,armdef)
end
end
end
local time_scaled={[1]=1,[2]=0.4,[3]=0.16,[4]=2.4,[5]=3.2,[6]=4.8}
local tool_punch_intervall={
local tool_punch_interval={
pick = 1, sword = 0.75, shovel = 1, axe = 1}
local tool_damage_groups = {
pick = 1, sword = 1.2, shovel = 0.7, axe = 1.1}
minerdream.register_tool = function(tdef,tier_definition)
local trdef=tier_definition[tdef.tier]
local modname=minetest.get_current_modname()
local modname=tdef.modname
for _,tool in pairs({"pick","sword","shovel","axe"}) do
print(tool)
if tdef[tool] then
print("pong")
if tdef.groups[tool] then
print(dump(tdef))
local lpi=tdef.full_punch_intervall * tool_punch_interval[tool]
local ldg = tdef.tool_fleshy * tool_damage_groups[tool]
tool_def={name=modname..":"..tool.."_"..tdef.name,
desc_name=tdef.name.." "..tool,
inventory_image=modname.."_"..arm.."_"..tdef.name..".png",
description = "".. core.colorize("#00FF00", tdef.name.." "..tool.."\n")
..core.colorize("#A0A0A0", "tier: "..tdef.tier.." ("..trdef.desc..")\n")
..core.colorize("#A0A0A0", "mele damage: "..ldg.."\n")
..core.colorize("#A0A0A0", "range: "..tdef.tool_range.."\n")
..core.colorize("#A0A0A0", "attack interval: "..lpi),
inventory_image=modname.."_"..tool.."_"..tdef.name..".png",
wield_scale = {x=tdef.wield_scale,y=tdef.wield_scale,z=tdef.wield_scale},
range = tdef.tool_range,
tool_capabilities = {
full_punch_interval = tdef.full_punch_intervall * tool_punch_interval[tool],
full_punch_interval = lpi,
max_drop_level = 1,
groupcaps = {
},
damage_goups = {fleshy = tdef.tool_fleshy * tool_damage_groups[tool]},
damage_goups = {fleshy = ldg},
}
}
for tg in pairs({"cracky","crumbly","choppy","snappy"}) do
if line[tool.."_"..tg.."_times"] then
if tdef[tool.."_"..tg.."_times"] then
tool_def.tool_capabilities.groupcaps[tg]={}
for ind=1,tdef[tool] do
tool_def.tool_capabilities.groupcaps[tg][ind]=line[tool.."_"..tg.."_times"] * time_scaled[ind]
for ind=1,tdef.groups[tool] do
tool_def.tool_capabilities.groupcaps[tg][ind]=tdef[tool.."_"..tg.."_times"] * time_scaled[ind]
end
end
end
print(dump(tool_def))
-- print(dump(tool_def))
minetest.register_tool(tool_def.name,tool_def)
end
end
end

View File

@ -159,7 +159,7 @@ ore_register("ruthenium",4,true,true)
ore_register("cobalt",4,true,true)
ore_register("platinum",1,true,true)
if not minetest.get_modpath("aluminium") then
ore_register("aluminium",1,true,true)
ore_register("aluminum",1,true,true)
end
ore_register("zinc",1,true,true)
--ore_register("lead",2,true,true)

View File

@ -15,18 +15,33 @@ end
local ores_cols={
col_num={"clust_num_ores","clust_size","ymin","ymax","clust_scarcity",
"cooktime","tier","heal","use","jump","speed","gravity",
"helmet_fleshy","chestplate_fleshy","leggings_fleshy","boots_fleshy","shield_fleshy"},
groups_num={"crack","dust","block","desert"}
"helmet_fleshy","chestplate_fleshy","leggings_fleshy","boots_fleshy","shield_fleshy","tool_range",
"full_punch_intervall","wield_scale","pick_cracky_times","tool_uses","tool_maxlevel",
"pick_crumbly_times","tool_fleshy","axe_choppy_times","axe_fleshy","sword_snappy",
"sword_fleshy","shovel_crumbly_times","shovel_fleshy"},
groups_num={"crack","dust","block","desert","pick","axe","sword","shovel"}
}
local ores_definition = minerdream.import_csv(minerdream.path.."/config.txt",ores_cols)
for _,line in pairs(ores_definition) do
if line.lump then
minerdream.register_item(line,tier_definition,"lump")
local modname=minetest.get_current_modname()
line.modname=minetest.get_current_modname()
if line.override then
line.modname = ":"..line.override
end
if line.bar then
minerdream.register_item(line,tier_definition,"bar")
if line.check_mods then
if not minetest.get_modpath(line.check_mods) then
if line.lump then
minerdream.register_item(line,tier_definition,"lump")
end
if line.bar then
minerdream.register_item(line,tier_definition,"bar")
end
else
modname=line.check_mods
line.modname=line.check_mods
end
end
if minetest.global_exists("armor") and armor.elements then
if line.heal then

View File

@ -1,11 +1,11 @@
name,lump,bar,pick,axe,sword,shovel,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,chestplate_fleshy,leggings_fleshy,boots_fleshy,shield_fleshy,tool_range,full_pull_intervall,wield_scale,pick_cracky_times,tool_uses,tool_maxlevel,pick_crumbly_times,tool_fleshy,axe_choppy_times,axe_fleshy,sword_snappy,sword_fleshy,sword_full_punch_interval,shovel_crumbly_times,shovel_fleshy
name,lump,bar,pick,axe,sword,shovel,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,chestplate_fleshy,leggings_fleshy,boots_fleshy,shield_fleshy,tool_range,full_punch_intervall,wield_scale,pick_cracky_times,tool_uses,tool_maxlevel,pick_crumbly_times,tool_fleshy,axe_choppy_times,axe_fleshy,sword_snappy,sword_fleshy,sword_full_punch_interval,shovel_crumbly_times,shovel_fleshy
rhodium,1,1,6,3,3,,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,5,0.8,1.55,1.25,105,3,0.6,12,1.2,12,1.25,14,0.6,,
calcium,1,1,,,,,5,1,1,,,,5,2,-31000,420,12 * 12 * 12,2,,,,,,,,,,,,,,,,,,,,,,,,,,
tantalum,1,1,6,3,3,,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,5,0.8,1.55,1.25,105,3,0.6,12,1.2,12,1.25,14,0.6,,
ruthenium,1,1,6,3,3,3,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,4.65,0.8,1.4,1.5,80,3,,10,1.5,11,1.5,11,0.65,0.8,9
cobalt,1,1,6,3,3,3,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,4.65,0.7,1.4,1.5,80,3,,9,1.5,10,1.5,10,0.55,0.8,8
platinum,1,1,6,3,3,3,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,4.5,0.8,1.3,1.7,60,3,,8,1.7,8,1.5,9,0.65,0.8,7
aluminium,1,1,6,3,3,3,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,4.5,0.65,1.3,1.85,60,3,,7,1.85,7,1.65,8,0.5,0.95,5
aluminum,,,6,3,3,3,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,4.5,0.65,1.3,1.85,60,3,,7,1.85,7,1.65,8,0.5,0.95,5
stainlesssteel,,1,3,3,3,3,,,,,,,,,,,,,2,6,175,0.01,,0.01,10,15,15,10,10,4.25,0.95,1.1,3.6,100,2,,4.75,3.6,4.75,2.35,6.25,0.75,1.35,3.25
zinc,1,1,,,,,1,1,1,,,,7,3,-31000,-50,14 * 14 * 14,4,,,,,,,,,,,,,,,,,,,,,,,,,,
potassium,1,1,,,,,3,1,1,,,,7,3,-31000,420,13 * 13 * 13,2,,,,,,,,,,,,,,,,,,,,,,,,,,
@ -18,7 +18,7 @@ silver,1,1,3,3,3,3,3,,,,,moreores,3,2,-31000,-64,14 * 14 * 14,8,3,7.5,300,0.02,0
lead,1,1,3,3,3,3,2,,,,,technic,7,3,-31000,-70,13 * 13 * 13,4,3,0,600,,-0.01,0.04,11,16,16,11,11,4.3,1.6,1.15,2.4,5,3,,9,2.4,9,2,10,1.5,1.2,7
spinel,,,,,,,5,,,,,,1,1,-31000,-1700,15 * 15 * 15,,,,,,,,,,,,,,,,,,,,,,,,,,,
garnet,,,,,,,4,,,,,,1,1,-31000,-650,15 * 15 * 15,,,,,,,,,,,,,,,,,,,,,,,,,,,
bituminous_coal,1,1,,,,,4,,,,,,10,3,-31000,-500,13 * 13 * 13,,,,,,,,,,,,,,,,,,,,,,,,,,,
bituminous_coal,,1,,,,,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,,,,,,,,,,,,,,,,,,,,,,,,,,,
@ -28,5 +28,5 @@ 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,,,,,,,,,,,,,,,
gold,,,3,3,3,3,,,,,,,,,,,,,,,,,,,,,,,,4.3,1.1,1.15,2.4,5,3,,5.5,2.2,6,2,7,0.975,1.2,4
flint,,,3,3,,3,,,,,,,,,,,,,,,,,,,,,,,,4.15,1.1,1,4.15,20,2,,4,2.65,5,,,,2.65,5
gold,,,3,3,3,3,,,,,,,,,,,,,3,,,,,,,,,,,4.3,1.1,1.15,2.4,5,3,,5.5,2.2,6,2,7,0.975,1.2,4
flint,,,3,3,,3,,,,,,,,,,,,,2,,,,,,,,,,,4.15,1.1,1,4.15,20,2,,4,2.65,5,,,,2.65,5

View File

@ -5,7 +5,7 @@ dofile(minerdream.path .. "/functions.lua")
dofile(minerdream.path .. "/api.lua")
dofile(minerdream.path .. "/config.lua")
dofile(minerdream.path .. "/items.lua")
dofile(minerdream.path .. "/tools.lua")
--dofile(minerdream.path .. "/tools.lua")
dofile(minerdream.path .. "/overrides.lua")
dofile(minerdream.path .. "/blocks.lua")
dofile(minerdream.path .. "/generation.lua")
@ -14,5 +14,5 @@ dofile(minerdream.path .. "/weapons.lua")
dofile(minerdream.path .. "/armor.lua")
dofile(minerdream.path .. "/treasure.lua")
dofile(minerdream.path .. "/experiments.lua")
dofile(minerdream.path .. "/mobs.lua")
--dofile(minerdream.path .. "/mobs.lua")
dofile(minerdream.path .. "/awards.lua")