Restructure default (4/x)

master
BlockMen 2015-10-21 20:21:58 +02:00
parent 8618241d91
commit 40ada9f1c2
8 changed files with 267 additions and 216 deletions

25
mods/default/gui.lua Normal file
View File

@ -0,0 +1,25 @@
-- Default formspec appearance
default.gui_bg = "bgcolor[#080808BB;true]"
default.gui_bg_img = "background[5,5;1,1;gui_formbg.png;true]"
default.gui_slots = "listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]"
function default.get_hotbar_bg(x, y)
local out = ""
for i = 0, 7 do
out = out .."image[" .. x + i .. "," .. y .. ";1,1;gui_hb_bg.png]"
end
return out
end
default.gui_survival_form = "size[8,8.5]" ..
default.gui_bg ..
default.gui_bg_img ..
default.gui_slots ..
"list[current_player;main;0,4.25;8,1;]" ..
"list[current_player;main;0,5.5;8,3;8]" ..
"list[current_player;craft;1.75,0.5;3,3;]" ..
"list[current_player;craftpreview;5.75,1.5;1,1;]" ..
"image[4.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]" ..
"listring[current_player;main]" ..
"listring[current_player;craft]" ..
default.get_hotbar_bg(0, 4.25)

View File

@ -5,52 +5,50 @@
-- Definitions made by this mod that other mods can use too
default = {}
default.LIGHT_MAX = 14
-- GUI related stuff
default.gui_bg = "bgcolor[#080808BB;true]"
default.gui_bg_img = "background[5,5;1,1;gui_formbg.png;true]"
default.gui_slots = "listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF]"
function default.get_hotbar_bg(x,y)
local out = ""
for i=0,7,1 do
out = out .."image["..x+i..","..y..";1,1;gui_hb_bg.png]"
end
return out
end
default.gui_survival_form = "size[8,8.5]"..
default.gui_bg..
default.gui_bg_img..
default.gui_slots..
"list[current_player;main;0,4.25;8,1;]"..
"list[current_player;main;0,5.5;8,3;8]"..
"list[current_player;craft;1.75,0.5;3,3;]"..
"list[current_player;craftpreview;5.75,1.5;1,1;]"..
"image[4.75,1.5;1,1;gui_furnace_arrow_bg.png^[transformR270]"..
"listring[current_player;main]"..
"listring[current_player;craft]"..
default.get_hotbar_bg(0,4.25)
-- The hand
minetest.register_item(":", {
type = "none",
wield_image = "wieldhand.png",
wield_scale = {x = 1, y = 1, z = 2.5},
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level = 0,
groupcaps = {
crumbly = {times={[2] = 3.00, [3] = 0.70}, uses = 0, maxlevel = 1},
snappy = {times={[3] = 0.40}, uses = 0, maxlevel = 1},
oddly_breakable_by_hand = {times={[1] = 3.50, [2] = 2.00, [3] = 0.70}, uses = 0}
},
damage_groups = {fleshy = 1},
}
})
-- Load files
local modpath = minetest.get_modpath("default")
local mg_name = minetest.get_mapgen_params().mgname or ""
dofile(modpath .. "/gui.lua")
dofile(modpath .. "/functions.lua")
dofile(modpath .. "/environment.lua")
dofile(modpath .. "/nodes.lua")
dofile(modpath .. "/tools.lua")
dofile(modpath .. "/craftitems.lua")
-- loads files in ./nodes/
dofile(modpath .. "/items.lua")
-- loads files in ./items/
dofile(modpath .. "/crafting.lua")
dofile(modpath .. "/mapgen.lua")
if mg_name == "v6" then
dofile(modpath .. "/mapgenv6.lua")
elseif mg_name == "v5" or mg_name == "v7" then
dofile(modpath .. "/mapgenv57.lua")
end
dofile(modpath .. "/player.lua")
dofile(modpath .. "/trees.lua")
dofile(modpath .. "/player.lua")
dofile(modpath .. "/aliases.lua")
dofile(modpath .. "/legacy.lua")

8
mods/default/items.lua Normal file
View File

@ -0,0 +1,8 @@
local modpath = minetest.get_modpath("default")
dofile(modpath .. "/items/tools.lua")
dofile(modpath .. "/items/weapons.lua")
dofile(modpath .. "/items/books.lua")
dofile(modpath .. "/items/materials.lua")
dofile(modpath .. "/items/misc.lua")

View File

@ -1,17 +1,3 @@
-- mods/default/craftitems.lua
minetest.register_craftitem("default:stick", {
description = "Stick",
inventory_image = "default_stick.png",
groups = {stick=1,fuel=1},
})
minetest.register_craftitem("default:paper", {
description = "Paper",
inventory_image = "default_paper.png",
groups = {fuel=1},
})
local function book_on_use(itemstack, user, pointed_thing)
local player_name = user:get_player_name()
local data = minetest.deserialize(itemstack:get_metadata())
@ -87,74 +73,3 @@ minetest.register_craftitem("default:book_written", {
stack_max = 1,
on_use = book_on_use,
})
minetest.register_craftitem("default:coal_lump", {
description = "Coal Lump",
inventory_image = "default_coal_lump.png",
groups = {coal = 1, fuel = 40}
})
minetest.register_craftitem("default:iron_lump", {
description = "Iron Lump",
inventory_image = "default_iron_lump.png",
})
minetest.register_craftitem("default:copper_lump", {
description = "Copper Lump",
inventory_image = "default_copper_lump.png",
})
minetest.register_craftitem("default:mese_crystal", {
description = "Mese Crystal",
inventory_image = "default_mese_crystal.png",
})
minetest.register_craftitem("default:gold_lump", {
description = "Gold Lump",
inventory_image = "default_gold_lump.png",
})
minetest.register_craftitem("default:diamond", {
description = "Diamond",
inventory_image = "default_diamond.png",
})
minetest.register_craftitem("default:clay_lump", {
description = "Clay Lump",
inventory_image = "default_clay_lump.png",
})
minetest.register_craftitem("default:steel_ingot", {
description = "Steel Ingot",
inventory_image = "default_steel_ingot.png",
})
minetest.register_craftitem("default:copper_ingot", {
description = "Copper Ingot",
inventory_image = "default_copper_ingot.png",
})
minetest.register_craftitem("default:bronze_ingot", {
description = "Bronze Ingot",
inventory_image = "default_bronze_ingot.png",
})
minetest.register_craftitem("default:gold_ingot", {
description = "Gold Ingot",
inventory_image = "default_gold_ingot.png"
})
minetest.register_craftitem("default:mese_crystal_fragment", {
description = "Mese Crystal Fragment",
inventory_image = "default_mese_crystal_fragment.png",
})
minetest.register_craftitem("default:clay_brick", {
description = "Clay Brick",
inventory_image = "default_clay_brick.png",
})
minetest.register_craftitem("default:obsidian_shard", {
description = "Obsidian Shard",
inventory_image = "default_obsidian_shard.png",
})

View File

@ -0,0 +1,63 @@
-- Mese
minetest.register_craftitem("default:mese_crystal", {
description = "Mese Crystal",
inventory_image = "default_mese_crystal.png",
})
minetest.register_craftitem("default:mese_crystal_fragment", {
description = "Mese Crystal Fragment",
inventory_image = "default_mese_crystal_fragment.png",
})
-- Minerals
minetest.register_craftitem("default:coal_lump", {
description = "Coal Lump",
inventory_image = "default_coal_lump.png",
groups = {coal = 1, fuel = 40}
})
minetest.register_craftitem("default:iron_lump", {
description = "Iron Lump",
inventory_image = "default_iron_lump.png",
})
minetest.register_craftitem("default:copper_lump", {
description = "Copper Lump",
inventory_image = "default_copper_lump.png",
})
minetest.register_craftitem("default:gold_lump", {
description = "Gold Lump",
inventory_image = "default_gold_lump.png",
})
minetest.register_craftitem("default:diamond", {
description = "Diamond",
inventory_image = "default_diamond.png",
})
-- Ingots
minetest.register_craftitem("default:steel_ingot", {
description = "Steel Ingot",
inventory_image = "default_steel_ingot.png",
})
minetest.register_craftitem("default:copper_ingot", {
description = "Copper Ingot",
inventory_image = "default_copper_ingot.png",
})
minetest.register_craftitem("default:bronze_ingot", {
description = "Bronze Ingot",
inventory_image = "default_bronze_ingot.png",
})
minetest.register_craftitem("default:gold_ingot", {
description = "Gold Ingot",
inventory_image = "default_gold_ingot.png"
})

View File

@ -0,0 +1,26 @@
minetest.register_craftitem("default:stick", {
description = "Stick",
inventory_image = "default_stick.png",
groups = {stick = 1, fuel = 1},
})
minetest.register_craftitem("default:paper", {
description = "Paper",
inventory_image = "default_paper.png",
groups = {fuel = 1},
})
minetest.register_craftitem("default:clay_lump", {
description = "Clay Lump",
inventory_image = "default_clay_lump.png",
})
minetest.register_craftitem("default:clay_brick", {
description = "Clay Brick",
inventory_image = "default_clay_brick.png",
})
minetest.register_craftitem("default:obsidian_shard", {
description = "Obsidian Shard",
inventory_image = "default_obsidian_shard.png",
})

View File

@ -1,29 +1,9 @@
-- mods/default/tools.lua
-- The hand
minetest.register_item(":", {
type = "none",
wield_image = "wieldhand.png",
wield_scale = {x=1,y=1,z=2.5},
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level = 0,
groupcaps = {
crumbly = {times={[2]=3.00, [3]=0.70}, uses=0, maxlevel=1},
snappy = {times={[3]=0.40}, uses=0, maxlevel=1},
oddly_breakable_by_hand = {times={[1]=3.50,[2]=2.00,[3]=0.70}, uses=0}
},
damage_groups = {fleshy=1},
}
})
--
-- Picks
--
minetest.register_tool("default:pick_wood", {
description = "Wooden Pickaxe",
inventory_image = "default_tool_woodpick.png",
wield_scale = {x = 1.32, y = 1.55, z = 1.1},
tool_capabilities = {
full_punch_interval = 1.2,
max_drop_level=0,
@ -33,9 +13,11 @@ minetest.register_tool("default:pick_wood", {
damage_groups = {fleshy=2},
},
})
minetest.register_tool("default:pick_stone", {
description = "Stone Pickaxe",
inventory_image = "default_tool_stonepick.png",
wield_scale = {x = 1.32, y = 1.55, z = 1.1},
tool_capabilities = {
full_punch_interval = 1.3,
max_drop_level=0,
@ -45,9 +27,11 @@ minetest.register_tool("default:pick_stone", {
damage_groups = {fleshy=3},
},
})
minetest.register_tool("default:pick_steel", {
description = "Steel Pickaxe",
inventory_image = "default_tool_steelpick.png",
wield_scale = {x = 1.32, y = 1.55, z = 1.1},
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
@ -57,9 +41,11 @@ minetest.register_tool("default:pick_steel", {
damage_groups = {fleshy=4},
},
})
minetest.register_tool("default:pick_bronze", {
description = "Bronze Pickaxe",
inventory_image = "default_tool_bronzepick.png",
wield_scale = {x = 1.32, y = 1.55, z = 1.1},
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
@ -69,9 +55,11 @@ minetest.register_tool("default:pick_bronze", {
damage_groups = {fleshy=4},
},
})
minetest.register_tool("default:pick_mese", {
description = "Mese Pickaxe",
inventory_image = "default_tool_mesepick.png",
wield_scale = {x = 1.32, y = 1.55, z = 1.1},
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level=3,
@ -81,9 +69,11 @@ minetest.register_tool("default:pick_mese", {
damage_groups = {fleshy=5},
},
})
minetest.register_tool("default:pick_diamond", {
description = "Diamond Pickaxe",
inventory_image = "default_tool_diamondpick.png",
wield_scale = {x = 1.32, y = 1.55, z = 1.1},
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level=3,
@ -94,9 +84,8 @@ minetest.register_tool("default:pick_diamond", {
},
})
--
-- Shovels
--
minetest.register_tool("default:shovel_wood", {
description = "Wooden Shovel",
@ -111,10 +100,12 @@ minetest.register_tool("default:shovel_wood", {
damage_groups = {fleshy=2},
},
})
minetest.register_tool("default:shovel_stone", {
description = "Stone Shovel",
inventory_image = "default_tool_stoneshovel.png",
wield_image = "default_tool_stoneshovel.png^[transformR90",
wield_scale = {x = 1.75, y = 1.55, z = 1},
tool_capabilities = {
full_punch_interval = 1.4,
max_drop_level=0,
@ -124,10 +115,12 @@ minetest.register_tool("default:shovel_stone", {
damage_groups = {fleshy=2},
},
})
minetest.register_tool("default:shovel_steel", {
description = "Steel Shovel",
inventory_image = "default_tool_steelshovel.png",
wield_image = "default_tool_steelshovel.png^[transformR90",
wield_scale = {x = 1.75, y = 1.55, z = 1},
tool_capabilities = {
full_punch_interval = 1.1,
max_drop_level=1,
@ -137,10 +130,12 @@ minetest.register_tool("default:shovel_steel", {
damage_groups = {fleshy=3},
},
})
minetest.register_tool("default:shovel_bronze", {
description = "Bronze Shovel",
inventory_image = "default_tool_bronzeshovel.png",
wield_image = "default_tool_bronzeshovel.png^[transformR90",
wield_scale = {x = 1.75, y = 1.55, z = 1},
tool_capabilities = {
full_punch_interval = 1.1,
max_drop_level=1,
@ -150,10 +145,12 @@ minetest.register_tool("default:shovel_bronze", {
damage_groups = {fleshy=3},
},
})
minetest.register_tool("default:shovel_mese", {
description = "Mese Shovel",
inventory_image = "default_tool_meseshovel.png",
wield_image = "default_tool_meseshovel.png^[transformR90",
wield_scale = {x = 1.75, y = 1.55, z = 1},
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=3,
@ -163,10 +160,12 @@ minetest.register_tool("default:shovel_mese", {
damage_groups = {fleshy=4},
},
})
minetest.register_tool("default:shovel_diamond", {
description = "Diamond Shovel",
inventory_image = "default_tool_diamondshovel.png",
wield_image = "default_tool_diamondshovel.png^[transformR90",
wield_scale = {x = 1.75, y = 1.55, z = 1},
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
@ -177,13 +176,13 @@ minetest.register_tool("default:shovel_diamond", {
},
})
--
-- Axes
--
minetest.register_tool("default:axe_wood", {
description = "Wooden Axe",
inventory_image = "default_tool_woodaxe.png",
wield_scale = {x = 1.5, y = 1.5, z = 1},
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=0,
@ -193,9 +192,11 @@ minetest.register_tool("default:axe_wood", {
damage_groups = {fleshy=2},
},
})
minetest.register_tool("default:axe_stone", {
description = "Stone Axe",
inventory_image = "default_tool_stoneaxe.png",
wield_scale = {x = 1.5, y = 1.5, z = 1},
tool_capabilities = {
full_punch_interval = 1.2,
max_drop_level=0,
@ -205,9 +206,11 @@ minetest.register_tool("default:axe_stone", {
damage_groups = {fleshy=3},
},
})
minetest.register_tool("default:axe_steel", {
description = "Steel Axe",
inventory_image = "default_tool_steelaxe.png",
wield_scale = {x = 1.5, y = 1.5, z = 1},
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
@ -217,9 +220,11 @@ minetest.register_tool("default:axe_steel", {
damage_groups = {fleshy=4},
},
})
minetest.register_tool("default:axe_bronze", {
description = "Bronze Axe",
inventory_image = "default_tool_bronzeaxe.png",
wield_scale = {x = 1.5, y = 1.5, z = 1},
tool_capabilities = {
full_punch_interval = 1.0,
max_drop_level=1,
@ -229,9 +234,11 @@ minetest.register_tool("default:axe_bronze", {
damage_groups = {fleshy=4},
},
})
minetest.register_tool("default:axe_mese", {
description = "Mese Axe",
inventory_image = "default_tool_meseaxe.png",
wield_scale = {x = 1.5, y = 1.5, z = 1},
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level=1,
@ -241,9 +248,11 @@ minetest.register_tool("default:axe_mese", {
damage_groups = {fleshy=6},
},
})
minetest.register_tool("default:axe_diamond", {
description = "Diamond Axe",
inventory_image = "default_tool_diamondaxe.png",
wield_scale = {x = 1.5, y = 1.5, z = 1},
tool_capabilities = {
full_punch_interval = 0.9,
max_drop_level=1,
@ -253,80 +262,3 @@ minetest.register_tool("default:axe_diamond", {
damage_groups = {fleshy=7},
},
})
--
-- Swords
--
minetest.register_tool("default:sword_wood", {
description = "Wooden Sword",
inventory_image = "default_tool_woodsword.png",
tool_capabilities = {
full_punch_interval = 1,
max_drop_level=0,
groupcaps={
snappy={times={[2]=1.6, [3]=0.40}, uses=10, maxlevel=1},
},
damage_groups = {fleshy=2},
}
})
minetest.register_tool("default:sword_stone", {
description = "Stone Sword",
inventory_image = "default_tool_stonesword.png",
tool_capabilities = {
full_punch_interval = 1.2,
max_drop_level=0,
groupcaps={
snappy={times={[2]=1.4, [3]=0.40}, uses=20, maxlevel=1},
},
damage_groups = {fleshy=4},
}
})
minetest.register_tool("default:sword_steel", {
description = "Steel Sword",
inventory_image = "default_tool_steelsword.png",
tool_capabilities = {
full_punch_interval = 0.8,
max_drop_level=1,
groupcaps={
snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=6},
}
})
minetest.register_tool("default:sword_bronze", {
description = "Bronze Sword",
inventory_image = "default_tool_bronzesword.png",
tool_capabilities = {
full_punch_interval = 0.8,
max_drop_level=1,
groupcaps={
snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=40, maxlevel=2},
},
damage_groups = {fleshy=6},
}
})
minetest.register_tool("default:sword_mese", {
description = "Mese Sword",
inventory_image = "default_tool_mesesword.png",
tool_capabilities = {
full_punch_interval = 0.7,
max_drop_level=1,
groupcaps={
snappy={times={[1]=2.0, [2]=1.00, [3]=0.35}, uses=30, maxlevel=3},
},
damage_groups = {fleshy=7},
}
})
minetest.register_tool("default:sword_diamond", {
description = "Diamond Sword",
inventory_image = "default_tool_diamondsword.png",
tool_capabilities = {
full_punch_interval = 0.7,
max_drop_level=1,
groupcaps={
snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=40, maxlevel=3},
},
damage_groups = {fleshy=8},
}
})

View File

@ -0,0 +1,84 @@
-- Swords
minetest.register_tool("default:sword_wood", {
description = "Wooden Sword",
inventory_image = "default_tool_woodsword.png",
wield_scale = {x = 1.25, y = 1.25, z = 1},
tool_capabilities = {
full_punch_interval = 1,
max_drop_level=0,
groupcaps={
snappy={times={[2]=1.6, [3]=0.40}, uses=10, maxlevel=1},
},
damage_groups = {fleshy=2},
}
})
minetest.register_tool("default:sword_stone", {
description = "Stone Sword",
inventory_image = "default_tool_stonesword.png",
wield_scale = {x = 1.3, y = 1.3, z = 1},
tool_capabilities = {
full_punch_interval = 1.2,
max_drop_level=0,
groupcaps={
snappy={times={[2]=1.4, [3]=0.40}, uses=20, maxlevel=1},
},
damage_groups = {fleshy=4},
}
})
minetest.register_tool("default:sword_steel", {
description = "Steel Sword",
inventory_image = "default_tool_steelsword.png",
wield_scale = {x = 1.5, y = 1.5, z = 1},
tool_capabilities = {
full_punch_interval = 0.8,
max_drop_level=1,
groupcaps={
snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=6},
}
})
minetest.register_tool("default:sword_bronze", {
description = "Bronze Sword",
inventory_image = "default_tool_bronzesword.png",
wield_scale = {x = 1.5, y = 1.5, z = 1},
tool_capabilities = {
full_punch_interval = 0.8,
max_drop_level=1,
groupcaps={
snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=40, maxlevel=2},
},
damage_groups = {fleshy=6},
}
})
minetest.register_tool("default:sword_mese", {
description = "Mese Sword",
inventory_image = "default_tool_mesesword.png",
wield_scale = {x = 1.5, y = 1.5, z = 1},
tool_capabilities = {
full_punch_interval = 0.7,
max_drop_level=1,
groupcaps={
snappy={times={[1]=2.0, [2]=1.00, [3]=0.35}, uses=30, maxlevel=3},
},
damage_groups = {fleshy=7},
}
})
minetest.register_tool("default:sword_diamond", {
description = "Diamond Sword",
inventory_image = "default_tool_diamondsword.png",
wield_scale = {x = 1.5, y = 1.5, z = 1},
tool_capabilities = {
full_punch_interval = 0.7,
max_drop_level=1,
groupcaps={
snappy={times={[1]=1.90, [2]=0.90, [3]=0.30}, uses=40, maxlevel=3},
},
damage_groups = {fleshy=8},
}
})