Stella 0.4.0 upload

Game-5.4.x
Der1248 2021-12-21 05:37:19 +01:00
parent 077a1cf106
commit 0ef2e01643
43 changed files with 1884 additions and 844 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 535 B

After

Width:  |  Height:  |  Size: 4.1 KiB

61
mods/stella/functions.lua Normal file
View File

@ -0,0 +1,61 @@
function sort_inventory(inv,list) --from technic_chests mod
local inlist = inv:get_list(list)
local typecnt = {}
local typekeys = {}
for _, st in ipairs(inlist) do
if not st:is_empty() then
local n = st:get_name()
local w = st:get_wear()
local m = st:get_metadata()
local k = string.format("%s %05d %s", n, w, m)
if not typecnt[k] then
typecnt[k] = {
name = n,
wear = w,
metadata = m,
stack_max = st:get_stack_max(),
count = 0,
}
table.insert(typekeys, k)
end
typecnt[k].count = typecnt[k].count + st:get_count()
end
end
table.sort(typekeys)
local outlist = {}
for _, k in ipairs(typekeys) do
local tc = typecnt[k]
while tc.count > 0 do
local c = math.min(tc.count, tc.stack_max)
table.insert(outlist, ItemStack({
name = tc.name,
wear = tc.wear,
metadata = tc.metadata,
count = c,
}))
tc.count = tc.count - c
end
end
if #outlist > #inlist then return end
while #outlist < #inlist do
table.insert(outlist, ItemStack(nil))
end
inv:set_list(list, outlist)
end
function distance(a, b)
local x = a.x - b.x
local y = a.y - b.y
local z = a.z - b.z
return math.hypot(x, math.hypot(y, z))
end
function file_check(file_name)
local file_found=io.open(file_name, "r")
if file_found==nil then
file_found=false
else
file_found=true
end
return file_found
end

129
mods/stella/global_step.lua Normal file
View File

@ -0,0 +1,129 @@
local timer = 0
local timer2 = 0
local timer3 = 0
minetest.register_globalstep(function(dtime)
timer = timer + dtime
timer2 = timer2 + dtime
timer3 = timer3 + dtime
local players = minetest.get_connected_players()
for _,player in ipairs(players) do
local keys = player:get_player_control()
if keys["LMB"] == true and player:get_attribute("LMB") then
if tonumber(player:get_attribute("LMB")) > 0.5 then
player:set_attribute("LMB", 0)
end
if tonumber(player:get_attribute("LMB")) == 0 then
local tool_level = tonumber(string.match(player:get_wielded_item():get_name():sub(8), "%d+"))
local tool = player:get_wielded_item():get_name():sub(8):gsub("%d+", "")
for resource = 1, #stella.resources do
local all_objects = minetest.get_objects_inside_radius(player:get_pos(), 2.2)
for k, obj in pairs(all_objects) do
if obj:get_luaentity() ~= nil then
if string.sub(obj:get_luaentity().name,1,18) == "stella:resource_"..stella.resources[resource][1].."_" then -- ID > 10
if tool == stella.resources[resource][2] and tool_level >= stella.resources[resource][3] then
if obj:get_hp() > 1 then
local hp = obj:get_hp()
local pos = obj:get_pos()
local max_items = stella.resources[resource][4]
local needed_level = stella.resources[resource][5]
local textures = stella.resources[resource][6]
local new_mesh = 1+math.floor((max_items*needed_level+2-obj:get_hp())*(textures-1)/(max_items*needed_level))
obj:remove()
local obj2 = minetest.env:add_entity(pos,"stella:resource_"..stella.resources[resource][1].."_"..new_mesh) -- ID > 10
obj2:set_hp(hp-1)
local count = math.floor(((max_items*needed_level)-obj2:get_hp()+1)/needed_level) - math.floor(((max_items*needed_level)-obj2:get_hp())/needed_level)
local player_inv = player:get_inventory()
player_inv:add_item("inv", "stella:resource_"..stella.resources[resource][1].." "..count)
sort_inventory(player_inv, "inv")
player:set_inventory_formspec(stella.invget_formspec(player))
end
end
end
end
end
end
end
player:set_attribute("LMB", tonumber(player:get_attribute("LMB"))+dtime)
elseif keys["LMB"] == false and player:get_attribute("LMB") then
player:set_attribute("LMB", tonumber(player:get_attribute("LMB"))+dtime)
else
player:set_attribute("LMB", 0)
end
end
if timer >= 0.2 then
timer = 0
set_hexagon("1.1.1.0", player,false)
for _,player in ipairs(players) do
local player_inv = player:get_inventory()
player:hud_set_hotbar_image("stella_gui_hotbar.png")
local activ = minetest.deserialize(player:get_attribute("activ_task"))
for activCount = 1, #activ do
for tasksCount = 1, #stella.tasks do
if stella.tasks[tasksCount][1] == activ[activCount][1] and distance(stella.tasks[tasksCount][3], player:get_pos()) < 1 then
if activ[activCount][2] < stella.tasks[tasksCount][6][1] then
if player_inv:contains_item("inv",stella.tasks[tasksCount][4][1]) then
player_inv:remove_item("inv",stella.tasks[tasksCount][4][1])
activ[activCount][2] = activ[activCount][2] + 1
end
end
if activ[activCount][3] < stella.tasks[tasksCount][6][2] then
if player_inv:contains_item("inv",stella.tasks[tasksCount][4][2]) then
player_inv:remove_item("inv",stella.tasks[tasksCount][4][2])
activ[activCount][3] = activ[activCount][3] + 1
end
end
if activ[activCount][4] < stella.tasks[tasksCount][6][3] then
if player_inv:contains_item("inv",stella.tasks[tasksCount][4][3]) then
player_inv:remove_item("inv",stella.tasks[tasksCount][4][3])
activ[activCount][4] = activ[activCount][4] + 1
end
end
if activ[activCount][5] < stella.tasks[tasksCount][6][4] then
if player_inv:contains_item("inv",stella.tasks[tasksCount][4][4]) then
player_inv:remove_item("inv",stella.tasks[tasksCount][4][4])
activ[activCount][5] = activ[activCount][5] + 1
end
end
player:set_inventory_formspec(stella.invget_formspec(player))
player:set_attribute("activ_task", minetest.serialize(activ))
update_tasks(player)
activ = minetest.deserialize(player:get_attribute("activ_task"))
sort_inventory(player_inv, "inv")
return
end
end
end
end
end
if timer2 >= 1.5 then
timer2 = 0
for _,player in ipairs(players) do
local player_inv = player:get_inventory()
if player_inv:contains_item("t1_from", "stella:resource_1") then
stella.stella_inv:remove_item("t1_from", "stella:resource_1 3")
player_inv:remove_item("t1_from", "stella:resource_1 3")
player_inv:add_item("inv", "stella:resource_3")
stella.stella_inv:add_item("inv", "stella:resource_3")
player:set_inventory_formspec(stella.invget_formspec(player))
sort_inventory(player_inv, "inv")
sort_inventory(stella.stella_inv, "inv")
end
end
end
if timer3 >= 3 then
timer3 = 0
for _,player in ipairs(players) do
local player_inv = player:get_inventory()
if player_inv:contains_item("s1_from", "stella:resource_2") then
stella.stella_inv:remove_item("s1_from", "stella:resource_2 5")
player_inv:remove_item("s1_from", "stella:resource_2 5")
player_inv:add_item("inv", "stella:resource_4")
stella.stella_inv:add_item("inv", "stella:resource_4")
player:set_inventory_formspec(stella.invget_formspec(player))
sort_inventory(player_inv, "inv")
sort_inventory(stella.stella_inv, "inv")
end
end
end
end)

View File

@ -0,0 +1,60 @@
local box2 = get_nodebox()[1]
local box4 = get_nodebox()[2]
local box6 = get_nodebox()[3]
local boxg = get_nodebox()[4]
for j=1,2 do
for i=1,14 do
minetest.register_node(minetest.get_current_modname()..":block_"..j.."_2_"..i,{
description = "Sector "..j.." Block 2."..i,
tiles = {"stella_sector"..j..".png"},
mesh = "block_2_"..i..".obj",
drawtype = "mesh",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky=2},
selection_box = {type = "fixed",fixed = {}
},
collision_box = {type = "fixed",fixed = box2[i]
},
})
minetest.register_node(minetest.get_current_modname()..":block_"..j.."_4_"..i,{
description = "Sector "..j.." Block 4."..i,
tiles = {"stella_sector"..j..".png"},
mesh = "block_4_"..i..".obj",
drawtype = "mesh",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky=2},
selection_box = {type = "fixed",fixed = {}
},
collision_box = {type = "fixed",fixed = box4[i]
},
})
minetest.register_node(minetest.get_current_modname()..":block_"..j.."_6_"..i,{
description = "Sector "..j.." Block 6."..i,
tiles = {"stella_sector"..j..".png"},
mesh = "block_6_"..i..".obj",
drawtype = "mesh",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky=2},
selection_box = {type = "fixed",fixed = {}
},
collision_box = {type = "fixed",fixed = box6[i]
},
})
minetest.register_node(minetest.get_current_modname()..":block_"..j.."_g_"..i,{
description = "Sector "..j.." Block Ground."..i,
tiles = {"stella_sector"..j..".png"},
mesh = "block_6_"..i..".obj",
drawtype = "mesh",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky=2},
selection_box = {type = "fixed",fixed = {}
},
collision_box = {type = "fixed",fixed = boxg[i]
},
})
end
end

View File

@ -1,6 +1,3 @@
local hud = {}
minetest.register_on_joinplayer(function(player)
local name = player:get_player_name()
player:hud_add({
@ -17,265 +14,44 @@ minetest.register_on_joinplayer(function(player)
offset = {x=0, y=30},
alignment = {x=1, y=0},
number = 0xFFFFFF ,
text = "Game Version : 0.3.0",
})
hud["1"] = player:hud_add({
hud_elem_type = "waypoint",
number = 0xFFFFFF ,
world_pos = {x=0, y=0, z=0},
precision = 0,
name = "",
})
hud["2"] = player:hud_add({
hud_elem_type = "waypoint",
number = 0xFFFFFF ,
world_pos = {x=0, y=0, z=0},
precision = 0,
name = "",
})
hud["3"] = player:hud_add({
hud_elem_type = "waypoint",
number = 0xFFFFFF ,
world_pos = {x=0, y=0, z=0},
precision = 0,
name = "",
})
hud["4"] = player:hud_add({
hud_elem_type = "waypoint",
number = 0xFFFFFF ,
world_pos = {x=0, y=0, z=0},
precision = 0,
name = "",
})
hud["5"] = player:hud_add({
hud_elem_type = "waypoint",
number = 0xFFFFFF ,
world_pos = {x=0, y=0, z=0},
precision = 0,
name = "",
text = "Game Version : 0.4.0",
})
end)
function distance(a, b)
local x = a.x - b.x
local y = a.y - b.y
local z = a.z - b.z
return math.hypot(x, math.hypot(y, z))
end
function nextrange(x, max)
x = x + 1
if x > max then
x = 0
end
return x
end
function screwdriver_handler(user, pointed_thing, mode)
if pointed_thing.type ~= "node" then
return
end
local pos = pointed_thing.under
local keys = user:get_player_control()
local player_name = user:get_player_name()
if minetest.is_protected(pos, user:get_player_name()) then
minetest.record_protection_violation(pos, user:get_player_name())
return
end
local node = minetest.get_node(pos)
local ndef = minetest.registered_nodes[node.name]
if not ndef or not ndef.paramtype2 == "facedir" or
(ndef.drawtype == "nodebox" and
not ndef.node_box.type == "fixed") or
node.param2 == nil then
return
end
local n = node.param2
local axisdir = math.floor(n / 4)
local rotation = n - axisdir * 4
if mode == 1 then
n = axisdir * 4 + nextrange(rotation, 3)
elseif mode == 3 then
n = nextrange(axisdir, 5) * 4
end
node.param2 = n
minetest.swap_node(pos, node)
end
local inv = {}
inv.get_formspec = function(player, pos)
if player == nil then
return
end
local player_inv = player:get_inventory()
local stella_inv = minetest.create_detached_inventory(player:get_player_name().."_stella_inv",{
allow_put = function(inv, listname, index, stack, player)
return 0
end,
allow_take = function(inv, listname, index, stack, player)
return 0
end,
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
return 0
end,
})
stella_inv:set_size("tool", 3)
player_inv:set_size("tool", 3)
stella_inv:set_size("armor", 2)
player_inv:set_size("armor", 2)
stella_inv:set_size("inv", 40)
player_inv:set_size("inv", 40)
for i=1, 3 do
local stack = player_inv:get_stack("main", i)
stella_inv:set_stack("tool", i, stack)
end
for i=1, 2 do
local stack = player_inv:get_stack("armor", i)
stella_inv:set_stack("armor", i, stack)
end
for i=1, 40 do
local stack = player_inv:get_stack("inv", i)
stella_inv:set_stack("inv", i, stack)
end
formspec = "size[8,7.5]"
.."list[detached:"..player:get_player_name().."_stella_inv;tool;2.5,0.5;5,1]"
.."list[detached:"..player:get_player_name().."_stella_inv;armor;1,1;1,1]"
.."list[detached:"..player:get_player_name().."_stella_inv;armor;6,1;1,1;1]"
.."list[detached:"..player:get_player_name().."_stella_inv;inv;0,2.7;8,5]"
return formspec
end
stella = stella or {}
local stella_inv2 = minetest.create_detached_inventory("singleplayer_stella_inv2",{
allow_put = function(inv, listname, index, stack, player)
return 0
end,
allow_take = function(inv, listname, index, stack, player)
return 0
end,
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
return 0
end,
})
local timber1 = {}
timber1.get_formspec = function(player, pos)
if player == nil then
return
end
local player_inv = player:get_inventory()
stella_inv2:set_size("inv", 40)
player_inv:set_size("inv", 40)
stella_inv2:set_size("t1_from1", 1)
stella_inv2:set_size("t1_from2", 1)
stella_inv2:set_size("t1_from", 1)
stella_inv2:set_size("t1_to1", 1)
stella_inv2:set_size("t1_to2", 1)
player_inv:set_size("t1_from", 1)
for i=1, 40 do
local stack = player_inv:get_stack("inv", i)
stella_inv2:set_stack("inv", i, stack)
end
local stack = player_inv:get_stack("t1_from", 1)
stella_inv2:set_stack("t1_from", 1, stack)
local purple = player_inv:get_stack("inv", 1):get_count()
if purple > 2 and player_inv:get_stack("inv", 1):get_name() == "stella:resource_1" then
stella_inv2:set_stack("t1_from1", 1, "stella:resource_1 3")
stella_inv2:set_stack("t1_to1", 1, "stella:resource_3")
else
stella_inv2:set_stack("t1_from1", 1, "")
stella_inv2:set_stack("t1_to1", 1, "")
end
if purple > 2 and player_inv:get_stack("inv", 1):get_name() == "stella:resource_1" then
stella_inv2:set_stack("t1_from2", 1, "stella:resource_1 "..math.floor(purple/3)*3)
stella_inv2:set_stack("t1_to2", 1, "stella:resource_3 "..math.floor(purple/3))
else
stella_inv2:set_stack("t1_from2", 1, "")
stella_inv2:set_stack("t1_to2", 1, "")
end
formspec = "size[8,7.5]"
.."list[detached:"..player:get_player_name().."_stella_inv2;t1_from1;1,0;1,1]"
.."list[detached:"..player:get_player_name().."_stella_inv2;t1_from2;1,1;1,1]"
.."list[detached:"..player:get_player_name().."_stella_inv2;t1_from;6,0.5;1,1]"
.."list[detached:"..player:get_player_name().."_stella_inv2;t1_to1;4,0;1,1]"
.."list[detached:"..player:get_player_name().."_stella_inv2;t1_to2;4,1;1,1]"
.."button[2,0;2,1;timber1_1;-->]"
.."button[2,1;2,1;timber1_2;-->]"
.."list[detached:"..player:get_player_name().."_stella_inv2;inv;0,2.7;8,5]"
return formspec
end
minetest.register_on_player_receive_fields(function(player, formname, fields)
local player_inv = player:get_inventory()
local meta = player:get_meta()
if fields.timber1_1 then
local purple = player_inv:get_stack("inv", 1):get_count()
if purple > 2 and player_inv:get_stack("inv", 1):get_name() == "stella:resource_1" then
player_inv:remove_item("inv", "stella:resource_1 3")
stella_inv2:remove_item("inv", "stella:resource_1 3")
stella_inv2:add_item("t1_from", "stella:resource_1 3")
player_inv:add_item("t1_from", "stella:resource_1 3")
minetest.show_formspec(player:get_player_name(), "timber1" , timber1.get_formspec(player))
end
end
if fields.timber1_2 then
local purple = player_inv:get_stack("inv", 1):get_count()
if purple > 2 and player_inv:get_stack("inv", 1):get_name() == "stella:resource_1" then
player_inv:remove_item("inv", "stella:resource_1 "..math.floor(purple/3)*3)
stella_inv2:remove_item("inv", "stella:resource_1 "..math.floor(purple/3)*3)
stella_inv2:add_item("t1_from", "stella:resource_1 "..math.floor(purple/3)*3)
player_inv:add_item("t1_from", "stella:resource_1 "..math.floor(purple/3)*3)
minetest.show_formspec(player:get_player_name(), "timber1" , timber1.get_formspec(player))
end
end
end)
minetest.register_craftitem("stella:pick1", {
description = "Pick 1",
inventory_image = "stella_pick1.png",
})
minetest.register_craftitem("stella:axe1", {
description = "Axe 1",
inventory_image = "stella_axe1.png",
})
local resources = { --to do
--ID tool tool level max items needed level textures respawn time
stella.resources = { --to do
--ID tool min level max items needed level textures respawn time
{"1", "axe", 1, 6, 1, 6, 10},
{"2", "pick", 1, 3, 2, 6, 11},
}
for resource = 1, #resources do
for i=1,resources[resource][6] do
minetest.register_entity("stella:resource_1_"..i, {
physical = true,
visual_size = {x=10, y=10},
collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5},
visual = "mesh",
mesh = "resource_"..i..".obj",
textures = {"stella_resource"..resources[resource][1]..".png"},
selectionbox = {0, 0, 0, 0, 0, 0},
hp_max = resources[resource][4]+1,
})
end
end
local tasks = {
stella.tasks = {
{"1.1.1.1","1.1.1.0",{x=6.5, y=2, z=3},{"stella:resource_1","","",""}, {"Purple Resource","","",""}, {10,0,0,0}},
{"1.1.1.2","1.1.1.1",{x=9.5, y=2, z=4.75},{"stella:resource_1","","",""}, {"Purple Resource","","",""}, {25,0,0,0}},
{"1.1.1.3","1.1.1.2",{x=9.5, y=2, z=8.25},{"stella:resource_1","","",""}, {"Purple Resource","","",""}, {25,0,0,0}},
{"1.1.1.4","1.1.1.3",{x=11, y=2, z=3.875},{"stella:resource_1","","",""}, {"Purple Resource","","",""}, {10,0,0,0}},
{"1.1.1.5","1.1.1.3",{x=3.5, y=2, z=-2.25},{"stella:resource_3","","",""}, {"Orange Resource","","",""}, {0,0,0,0}},
{"1.1.1.5","1.1.1.3",{x=3.5, y=2, z=-2.25},{"stella:resource_3","","",""}, {"Orange Resource","","",""}, {10,0,0,0}},
{"1.1.2.1","1.1.1.5",{x=2, y=2, z=-4.875},{"stella:resource_2","","",""}, {"Gray Resource","","",""}, {6,0,0,0}},
{"1.1.2.2","1.1.2.1",{x=2, y=2, z=-6.625},{"stella:resource_2","","",""}, {"Gray Resource","","",""}, {9,0,0,0}},
{"1.1.2.3","1.1.2.2",{x=2, y=2, z=-8.375},{"stella:resource_2","","",""}, {"Gray Resource","","",""}, {9,0,0,0}},
{"1.1.2.4","1.1.2.3",{x=2, y=2, z=-10.125},{"stella:resource_2","","",""}, {"Gray Resource","","",""}, {25,0,0,0}},
{"1.1.2.5","1.1.2.3",{x=-1, y=2, z=-8.375},{"stella:resource_4","stella:resource_3","",""}, {"Silver Resource","Orange Resource","",""}, {0,0,0,0}},
{"1.1.2.6","1.1.2.4",{x=5, y=2, z=-11.875},{"stella:resource_2","","",""}, {"Gray Resource","","",""}, {30,0,0,0}},
{"1.1.2.7","1.1.2.6",{x=8, y=2, z=-11.875},{"stella:resource_2","","",""}, {"Gray Resource","","",""}, {50,0,0,0}},
{"1.1.2.8","1.1.2.7",{x=5, y=2, z=-10.125},{"stella:resource_2","","",""}, {"Gray Resource","","",""}, {40,0,0,0}},
{"1.1.1.6","1.1.2.8",{x=6.5, y=2, z=-0.5},{"stella:resource_1","","",""}, {"Purple Resource","","",""}, {25,0,0,0}},
{"1.1.1.7","1.1.1.6",{x=6.5, y=2, z=-4},{"stella:resource_2","","",""}, {"Gray Resource","","",""}, {20,0,0,0}},
{"1.1.1.8","1.1.1.7",{x=8, y=2, z=-3.125},{"stella:resource_1","","",""}, {"Purple Resource","","",""}, {15,0,0,0}},
{"1.1.1.9","1.1.1.7",{x=3.5, y=2, z=4.75},{"stella:resource_1","","",""}, {"Purple Resource","","",""}, {20,0,0,0}},
{"1.1.1.10","1.1.1.8",{x=11, y=2, z=-3.125},{"stella:resource_1","","",""}, {"Purple Resource","","",""}, {20,0,0,0}},
{"1.1.1.11","1.1.1.10",{x=14, y=2, z=-1.375},{"stella:resource_1","","",""}, {"Purple Resource","","",""}, {30,0,0,0}},
{"1.1.1.12","1.1.1.11",{x=12.5, y=2, z=-0.5},{"stella:resource_1","","",""}, {"Purple Resource","","",""}, {10,0,0,0}},
{"1.1.1.13","1.1.1.9",{x=5, y=2, z=7.375},{"stella:resource_1","","",""}, {"Purple Resource","","",""}, {20,0,0,0}},
{"1.1.1.14","1.1.1.13",{x=6.5, y=2, z=10},{"stella:resource_1","","",""}, {"Purple Resource","","",""}, {20,0,0,0}},
{"1.1.1.15","1.1.1.14",{x=5, y=2, z=9.125},{"stella:resource_1","","",""}, {"Purple Resource","","",""}, {0,0,0,0}},--30 Purple Resource
}
local hexagons = {
stella.hexagons = {
--ID need ID pos num Height Sector Spawn Blocks
{"1.1.1.1", "1.1.1.0", {x=0, y=2, z=0}, 1, 2, "1", "", {}},
{"1.1.1.2", "1.1.1.0", {x=3, y=2, z=2}, 3, 2, "1", "", {}},
@ -286,549 +62,36 @@ local hexagons = {
{"1.1.1.7", "1.1.1.1", {x=6, y=2, z=4}, 2, 4, "1", "", {"","","","","1_1","","1_1","","1_1","","1_1","","1_1"}},
{"1.1.1.8", "1.1.1.2", {x=9, y=2, z=6}, 4, 2, "1", "", {}},
{"1.1.1.9", "1.1.1.3", {x=9, y=2, z=9}, 3, 2, "1", "", {"","","","","","","","","","","","","timber1"}},
{"1.1.1.10","1.1.1.4", {x=12, y=2, z=4}, 2, 2, "1", "", {"","","","","","","","1_1","","1_1","","","1_1"}},
{"1.1.1.10","1.1.1.4", {x=12, y=2, z=4}, 2, 2, "1", "", {"","","","","","","","1_1","","1_1","","","1_1"}},
{"1.1.2.1", "1.1.1.5", {x=3, y=2, z=-5}, 3, 4, "2", "", {"","","","","","","","","2_1","","2_1","",""}},
{"1.1.2.2", "1.1.2.1", {x=0, y=2, z=-7}, 1, 4, "2", "", {"","","2_1","","2_1","","","","","","","","2_1"}},
{"1.1.2.3", "1.1.2.2", {x=3, y=2, z=-8}, 4, 6, "2", "", {"","","","","","","2_1","","2_1","","2_1","",""}},
{"1.1.2.4", "1.1.2.3", {x=0, y=2, z=-10}, 2, 4, "2", "", {"","","","","","","","","","","","",""}},
{"1.1.2.5", "1.1.2.4", {x=3, y=2, z=-12}, 3, 6, "2", "", {"","","","","","","","","","","","",""}},
{"1.1.2.6", "1.1.2.6", {x=6, y=2, z=-14}, 1, 8, "2", "", {"","","","","","","","","","2_1","","2_1",""}},
{"1.1.2.7", "1.1.2.7", {x=9, y=2, z=-12}, 3, 10, "2", "", {"","","","","","","","","","","","","smith1"}},
{"1.1.2.8", "1.1.2.8", {x=6, y=2, z=-10}, 2, 6, "2", "", {"2_1","","","2_1","","","2_1","","2_1","","2_1","","2_1"}},
{"1.1.1.11", "1.1.1.6", {x=6, y=2, z=-3}, 2, 2, "1", "", {"","","","","","","","","","","","",""}},
{"1.1.1.12", "1.1.1.7", {x=6, y=2, z=-7}, 1, 2, "1", "", {"","","","","","","","","","","","","pick1"}},
{"1.1.1.13", "1.1.1.8", {x=9, y=2, z=-5}, 3, 2, "1", "", {"","","","","","","","","","","","",""}},
{"1.1.1.14", "1.1.1.10",{x=12, y=2, z=-3}, 2, 2, "1", "", {"","","","","","","","","","","","",""}},
{"1.1.1.15", "1.1.1.11",{x=15, y=2, z=-1}, 4, 2, "1", "", {"","","","","","","","","","","","","shop1"}},
{"1.1.1.16", "1.1.1.12",{x=12, y=2, z=0}, 1, 2, "1", "", {"","","","","","","","","","","","",""}},
{"1.1.1.17", "1.1.1.9", {x=3, y=2, z=6}, 4, 4, "1", "", {"","","","","","","","","","","","",""}},
{"1.1.1.18", "1.1.1.13",{x=6, y=2, z=7}, 1, 4, "1", "", {"","","","","","","","","","","","",""}},
{"1.1.1.19", "1.1.1.14",{x=6, y=2, z=11}, 2, 4, "1", "", {"","","","","1_1","","","","","","","",""}},
}
minetest.register_on_joinplayer(function(player)
player:set_attribute("1.1.1.0", "y")
if player:get_player_name() == "singleplayer" then
else
minetest.kick_player(player:get_player_name(), "you can play stella only as 'singleplayer'")
end
update_tasks(player)
player:hud_set_hotbar_itemcount(3)
player:hud_set_hotbar_image("stella_gui_hotbar.png")
player:hud_set_hotbar_selected_image("stella_gui_hotbar_selected.png")
local formspec = "bgcolor[#080808BB;true]"
.."listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF] "
.. "background9[5,5;1,1;stella_gui_formbg.png;true;10]"
player:set_formspec_prepend(formspec)
player:set_inventory_formspec(inv.get_formspec(player))
stella_inv2:set_size("inv", 40)
end)
minetest.register_on_newplayer(function(player)
local activ = {{"1.1.1.1",0,0,0,0}}
player:set_attribute("activ_task", minetest.serialize(activ))
player:set_pos({x=0.5, y=2, z=1.25})
local player_inv = player:get_inventory()
player_inv:set_stack("main", 1, "stella:axe1")
player_inv:set_stack("main", 2, "stella:pick1")
set_hexagon("1.1.1.0", player, true)
player:set_attribute("LMB", 0)
end)
local timer = 0
local timer2 = 0
minetest.register_globalstep(function(dtime)
timer = timer + dtime
timer2 = timer2 + dtime
local players = minetest.get_connected_players()
for _,player in ipairs(players) do
local keys = player:get_player_control()
if keys["LMB"] == true then
if tonumber(player:get_attribute("LMB")) > 0.5 then
player:set_attribute("LMB", 0)
end
if tonumber(player:get_attribute("LMB")) == 0 then
local all_objects = minetest.get_objects_inside_radius(player:get_pos(), 2.2)
for k, obj in pairs(all_objects) do
if obj:get_luaentity() ~= nil then
local tool_level = tonumber(string.match(player:get_wielded_item():get_name():sub(8), "%d+"))
local tool = player:get_wielded_item():get_name():sub(8):gsub("%d+", "")
for resource = 1, #resources do
if string.sub(obj:get_luaentity().name,1,18) == "stella:resource_"..resources[resource][1].."_" then -- ID > 10
if tool == resources[resource][2] and tool_level >= resources[resource][3] then
if obj:get_hp() > 1 then
local hp = obj:get_hp()
local pos = obj:get_pos()
local new_mesh = 1+math.floor((resources[resource][4]+2-obj:get_hp())*(resources[resource][6]-1)/resources[resource][4])
obj:remove()
local obj2 = minetest.env:add_entity(pos,"stella:resource_"..resources[resource][1].."_"..new_mesh) -- ID > 10
obj2:set_hp(hp-1) --needed level
if obj2:get_hp() == 1 then
minetest.after(resources[resource][7], function()
obj2:remove()
minetest.env:add_entity(pos,"stella:resource_"..resources[resource][1].."_1")
end)
end
local player_inv = player:get_inventory()
player_inv:add_item("inv", "stella:resource_"..resources[resource][1])
sort_inventory(player_inv, "inv")
player:set_inventory_formspec(inv.get_formspec(player))
end
end
end
end
end
end
end
player:set_attribute("LMB", tonumber(player:get_attribute("LMB"))+dtime)
elseif keys["LMB"] == false then
player:set_attribute("LMB", tonumber(player:get_attribute("LMB"))+dtime)
end
end
if timer >= 0.2 then
timer = 0
set_hexagon("1.1.1.0", player,false)
for _,player in ipairs(players) do
local player_inv = player:get_inventory()
player:hud_set_hotbar_image("stella_gui_hotbar.png")
local activ = minetest.deserialize(player:get_attribute("activ_task"))
for activCount = 1, #activ do
for tasksCount = 1, #tasks do
if tasks[tasksCount][1] == activ[activCount][1] and distance(tasks[tasksCount][3], player:get_pos()) < 1 then
if activ[activCount][2] < tasks[tasksCount][6][1] then
if player_inv:contains_item("inv",tasks[tasksCount][4][1]) then
player_inv:remove_item("inv",tasks[tasksCount][4][1])
activ[activCount][2] = activ[activCount][2] + 1
end
end
if activ[activCount][3] < tasks[tasksCount][6][2] then
if player_inv:contains_item("inv",tasks[tasksCount][4][2]) then
player_inv:remove_item("inv",tasks[tasksCount][4][2])
activ[activCount][3] = activ[activCount][3] + 1
end
end
if activ[activCount][4] < tasks[tasksCount][6][3] then
if player_inv:contains_item("inv",tasks[tasksCount][4][3]) then
player_inv:remove_item("inv",tasks[tasksCount][4][3])
activ[activCount][4] = activ[activCount][4] + 1
end
end
if activ[activCount][5] < tasks[tasksCount][6][4] then
if player_inv:contains_item("inv",tasks[tasksCount][4][4]) then
player_inv:remove_item("inv",tasks[tasksCount][4][4])
activ[activCount][5] = activ[activCount][5] + 1
end
end
player:set_inventory_formspec(inv.get_formspec(player))
player:set_attribute("activ_task", minetest.serialize(activ))
update_tasks(player)
activ = minetest.deserialize(player:get_attribute("activ_task"))
sort_inventory(player_inv, "inv")
return
end
end
end
end
end
if timer2 >= 1.5 then
timer2 = 0
for _,player in ipairs(players) do
local player_inv = player:get_inventory()
if player_inv:contains_item("t1_from", "stella:resource_1") then
stella_inv2:remove_item("t1_from", "stella:resource_1 3")
player_inv:remove_item("t1_from", "stella:resource_1 3")
player_inv:add_item("inv", "stella:resource_3")
stella_inv2:add_item("inv", "stella:resource_3")
player:set_inventory_formspec(inv.get_formspec(player))
sort_inventory(player_inv, "inv")
sort_inventory(stella_inv2, "inv")
end
end
end
end)
function update_tasks(player)
local activ = minetest.deserialize(player:get_attribute("activ_task"))
for activCount = 1, #activ do
for tasksCount = 1, #tasks do
if tasks[tasksCount][1] == activ[activCount][1] then
player:hud_change(hud[""..activCount], 'world_pos', tasks[tasksCount][3])
local name = ""
if tasks[tasksCount][6][3] ~= 0 then
name = activ[activCount][2].."/"..tasks[tasksCount][6][1].." "..tasks[tasksCount][5][1].."\n"..activ[activCount][3].."/"..tasks[tasksCount][6][2].." "..tasks[tasksCount][5][2].."\n"..activ[activCount][4].."/"..tasks[tasksCount][6][3].." "..tasks[tasksCount][5][3]
elseif tasks[tasksCount][6][2] ~= 0 then
name = activ[activCount][2].."/"..tasks[tasksCount][6][1].." "..tasks[tasksCount][5][1].."\n"..activ[activCount][3].."/"..tasks[tasksCount][6][2].." "..tasks[tasksCount][5][2]
elseif tasks[tasksCount][6][1] ~= 0 then
name = activ[activCount][2].."/"..tasks[tasksCount][6][1].." "..tasks[tasksCount][5][1]
else
name = "comming soon"
end
player:hud_change(hud[""..activCount], 'name', name)
if tasks[tasksCount][6][1] ~= 0 and activ[activCount][2] == tasks[tasksCount][6][1] and activ[activCount][3] == tasks[tasksCount][6][2] and activ[activCount][4] == tasks[tasksCount][6][3] and activ[activCount][5] == tasks[tasksCount][6][4] then
player:set_attribute(""..activ[activCount][1], "y")
table.remove(activ, activCount)
set_hexagon(tasks[tasksCount][1],player, true)
for tasksCount2 = 1, #tasks do
if tasks[tasksCount2][2] == tasks[tasksCount][1] then
table.insert(activ,{tasks[tasksCount2][1],0,0,0,0})
end
end
player:set_attribute("activ_task", minetest.serialize(activ))
player:hud_change(hud["1"], 'name', "")
player:hud_change(hud["2"], 'name', "")
player:hud_change(hud["3"], 'name', "")
player:hud_change(hud["4"], 'name', "")
player:hud_change(hud["5"], 'name', "")
update_tasks(player)
return
end
end
end
end
end
function sort_inventory(inv,list)
local inlist = inv:get_list(list)
local typecnt = {}
local typekeys = {}
for _, st in ipairs(inlist) do
if not st:is_empty() then
local n = st:get_name()
local w = st:get_wear()
local m = st:get_metadata()
local k = string.format("%s %05d %s", n, w, m)
if not typecnt[k] then
typecnt[k] = {
name = n,
wear = w,
metadata = m,
stack_max = st:get_stack_max(),
count = 0,
}
table.insert(typekeys, k)
end
typecnt[k].count = typecnt[k].count + st:get_count()
end
end
table.sort(typekeys)
local outlist = {}
for _, k in ipairs(typekeys) do
local tc = typecnt[k]
while tc.count > 0 do
local c = math.min(tc.count, tc.stack_max)
table.insert(outlist, ItemStack({
name = tc.name,
wear = tc.wear,
metadata = tc.metadata,
count = c,
}))
tc.count = tc.count - c
end
end
if #outlist > #inlist then return end
while #outlist < #inlist do
table.insert(outlist, ItemStack(nil))
end
inv:set_list(list, outlist)
end
function set_hexagon(id, player, blocks)
for hexagonsCount = 1, #hexagons do
if hexagons[hexagonsCount][2] == id then
local pos = hexagons[hexagonsCount][3]
local y_pos = 2.5+0.16666666*hexagons[hexagonsCount][5]
local block2 = {
{{}, {x=pos.x-0.21, y=y_pos, z=pos.z-0.5}, {}, {x=pos.x-0.21, y=y_pos, z=pos.z-0.75}},
{{}, {x=pos.x-0.57, y=y_pos, z=pos.z+0.13}, {}, {x=pos.x-0.57, y=y_pos, z=pos.z-0.12}},
{{}, {x=pos.x-0.92, y=y_pos, z=pos.z+0.75}, {}, {x=pos.x-0.92, y=y_pos, z=pos.z+0.5}},
{{}, {x=pos.x-0.57, y=y_pos, z=pos.z+1.37}, {}, {x=pos.x-0.57, y=y_pos, z=pos.z+1.12}},
{{}, {x=pos.x-0.21, y=y_pos, z=pos.z+2.0}, {}, {x=pos.x-0.21, y=y_pos, z=pos.z+1.75}},
{{}, {x=pos.x+0.5, y=y_pos, z=pos.z+2.0}, {}, {x=pos.x+0.5, y=y_pos, z=pos.z+1.75}},
{{}, {x=pos.x+1.21, y=y_pos, z=pos.z+2.0}, {}, {x=pos.x+1.21, y=y_pos, z=pos.z+1.75}},
{{}, {x=pos.x+1.57, y=y_pos, z=pos.z+1.37}, {}, {x=pos.x+1.57, y=y_pos, z=pos.z+1.12}},
{{}, {x=pos.x+1.92, y=y_pos, z=pos.z+0.75}, {}, {x=pos.x+1.92, y=y_pos, z=pos.z+0.5}},
{{}, {x=pos.x+1.57, y=y_pos, z=pos.z+0.13}, {}, {x=pos.x+1.57, y=y_pos, z=pos.z-0.12}},
{{}, {x=pos.x+1.21, y=y_pos, z=pos.z-0.5}, {}, {x=pos.x+1.21, y=y_pos, z=pos.z-0.75}},
{{}, {x=pos.x+0.5, y=y_pos, z=pos.z-0.5}, {}, {x=pos.x+0.5, y=y_pos, z=pos.z-0.75}},
{{}, {x=pos.x+0.5, y=y_pos, z=pos.z+0.75}, {}, {x=pos.x+0.5, y=y_pos, z=pos.z+0.5}}
}
if hexagons[hexagonsCount][4] == 1 then
minetest.place_schematic({x=pos.x, y=pos.y, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..hexagons[hexagonsCount][6].."_"..hexagons[hexagonsCount][5].."_1.mts","90")
minetest.place_schematic({x=pos.x, y=pos.y-1, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..hexagons[hexagonsCount][6].."_g_1.mts","0")
minetest.place_schematic({x=pos.x, y=pos.y-2, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..hexagons[hexagonsCount][6].."_g_1.mts","0")
minetest.place_schematic({x=pos.x, y=pos.y-3, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..hexagons[hexagonsCount][6].."_g_1.mts","0")
elseif hexagons[hexagonsCount][4] == 3 then
minetest.place_schematic({x=pos.x, y=pos.y, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..hexagons[hexagonsCount][6].."_"..hexagons[hexagonsCount][5].."_2.mts","90")
minetest.place_schematic({x=pos.x, y=pos.y-1, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..hexagons[hexagonsCount][6].."_g_2.mts","90")
minetest.place_schematic({x=pos.x, y=pos.y-2, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..hexagons[hexagonsCount][6].."_g_2.mts","90")
minetest.place_schematic({x=pos.x, y=pos.y-3, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..hexagons[hexagonsCount][6].."_g_2.mts","90")
elseif hexagons[hexagonsCount][4] == 4 then
minetest.place_schematic({x=pos.x, y=pos.y, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..hexagons[hexagonsCount][6].."_"..hexagons[hexagonsCount][5].."_3.mts","90")
minetest.place_schematic({x=pos.x, y=pos.y-1, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..hexagons[hexagonsCount][6].."_g_3.mts","90")
minetest.place_schematic({x=pos.x, y=pos.y-2, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..hexagons[hexagonsCount][6].."_g_3.mts","90")
minetest.place_schematic({x=pos.x, y=pos.y-3, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..hexagons[hexagonsCount][6].."_g_3.mts","90")
elseif hexagons[hexagonsCount][4] == 2 then
minetest.place_schematic({x=pos.x, y=pos.y, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..hexagons[hexagonsCount][6].."_"..hexagons[hexagonsCount][5].."_1.mts","270")
minetest.place_schematic({x=pos.x, y=pos.y-1, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..hexagons[hexagonsCount][6].."_g_1.mts","180")
minetest.place_schematic({x=pos.x, y=pos.y-2, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..hexagons[hexagonsCount][6].."_g_1.mts","180")
minetest.place_schematic({x=pos.x, y=pos.y-3, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..hexagons[hexagonsCount][6].."_g_1.mts","180")
end
if blocks then
for i = 1, 13 do
if hexagons[hexagonsCount][8][i] then
if hexagons[hexagonsCount][8][i] ~= "" and hexagons[hexagonsCount][8][i] ~= "timber1" then
minetest.env:add_entity(block2[i][hexagons[hexagonsCount][4]],"stella:resource_"..hexagons[hexagonsCount][8][i])
elseif hexagons[hexagonsCount][8][i] == "timber1" then
minetest.set_node({x=pos.x, y=pos.y+1, z=pos.z+1}, {name="stella:timber1"})
end
end
end
end
end
end
end
minetest.register_node(minetest.get_current_modname()..":ground",{
description = "Ground",
tiles = {"stella_ground.png"},
selection_box = {type = "fixed",fixed = {}--{-0.5, -0.5, -0.5, 0.5, -0.16667, 0.5}
},
})
minetest.register_node(minetest.get_current_modname()..":resource_1",{
description = "Purple Resource",
tiles = {"stella_resource1.png"},
stack_max = 99999,
})
minetest.register_node(minetest.get_current_modname()..":resource_3",{
description = "Orange Resource",
tiles = {"stella_resource3.png"},
stack_max = 99999,
})
local box2 = {}
local box4 = {}
local box6 = {}
local boxg = {}
for i=1,18 do
box2[i] = {}
box4[i] = {}
box6[i] = {}
boxg[i] = {}
end
for i=1,10 do
table.insert(box2[1], {-0.5-0.2*i/3.5, -0.5, -0.6+0.1*i, 0.5, -0.16667, -0.5+0.1*i})
table.insert(box2[4], {-0.5, -0.5, -0.6+0.1*i, 0.5+0.2*i/3.5, -0.16667, -0.5+0.1*i})
table.insert(box2[7], {-0.5-0.2*i/3.5, -0.5, -0.85+0.1*i, 0.5, -0.16667, -0.75+0.1*i})
table.insert(box2[10], {-0.5, -0.5, -0.85+0.1*i, 0.5+0.2*i/3.5, -0.16667, -0.75+0.1*i})
table.insert(box4[1], {-0.5-0.2*i/3.5, -0.5, -0.6+0.1*i, 0.5, 0.16667, -0.5+0.1*i})
table.insert(box4[4], {-0.5, -0.5, -0.6+0.1*i, 0.5+0.2*i/3.5, 0.16667, -0.5+0.1*i})
table.insert(box4[7], {-0.5-0.2*i/3.5, -0.5, -0.85+0.1*i, 0.5, 0.16667, -0.75+0.1*i})
table.insert(box4[10], {-0.5, -0.5, -0.85+0.1*i, 0.5+0.2*i/3.5, 0.16667, -0.75+0.1*i})
table.insert(box6[1], {-0.5-0.2*i/3.5, -0.5, -0.6+0.1*i, 0.5, 0.5, -0.5+0.1*i})
table.insert(box6[4], {-0.5, -0.5, -0.6+0.1*i, 0.5+0.2*i/3.5, 0.5, -0.5+0.1*i})
table.insert(box6[7], {-0.5-0.2*i/3.5, -0.5, -0.85+0.1*i, 0.5, 0.5, -0.75+0.1*i})
table.insert(box6[10], {-0.5, -0.5, -0.85+0.1*i, 0.5+0.2*i/3.5, 0.5, -0.75+0.1*i})
end
for i=1,17 do
table.insert(box2[13], {-0.5-0.2*i/3.5, -0.5, -1.35+0.1*i, 0.5, -0.16667, -1.25+0.1*i})
table.insert(box2[14], {-0.5, -0.5, -1.35+0.1*i, 0.5+0.2*i/3.5, -0.16667, -1.25+0.1*i})
table.insert(box4[13], {-0.5-0.2*i/3.5, -0.5, -1.35+0.1*i, 0.5, 0.16667, -1.25+0.1*i})
table.insert(box4[14], {-0.5, -0.5, -1.35+0.1*i, 0.5+0.2*i/3.5, 0.16667, -1.25+0.1*i})
table.insert(box6[13], {-0.5-0.2*i/3.5, -0.5, -1.35+0.1*i, 0.5, 0.5, -1.25+0.1*i})
table.insert(box6[14], {-0.5, -0.5, -1.35+0.1*i, 0.5+0.2*i/3.5, 0.5, -1.25+0.1*i})
end
table.insert(box2[13], {-0.5-0.2*17.5/3.5, -0.5, -1.3+0.1*17.5, 0.5, -0.16667, -1.25+0.1*17.5})
table.insert(box2[14], {-0.5, -0.5, -1.3+0.1*17.5, 0.5+0.2*17.5/3.5, -0.16667, -1.25+0.1*17.5})
table.insert(box4[13], {-0.5-0.2*17.5/3.5, -0.5, -1.3+0.1*17.5, 0.5, 0.16667, -1.25+0.1*17.5})
table.insert(box4[14], {-0.5, -0.5, -1.3+0.1*17.5, 0.5+0.2*17.5/3.5, 0.16667, -1.25+0.1*17.5})
table.insert(box6[13], {-0.5-0.2*17.5/3.5, -0.5, -1.3+0.1*17.5, 0.5, 0.5, -1.25+0.1*17.5})
table.insert(box6[14], {-0.5, -0.5, -1.3+0.1*17.5, 0.5+0.2*17.5/3.5, 0.5, -1.25+0.1*17.5})
for i=1,18 do
table.insert(boxg[13], {-0.5-0.2*i/3.5, -0.5, -1.45+0.1*i, 0.5, 0.5, -1.35+0.1*i})
table.insert(boxg[14], {-0.5, -0.5, -1.45+0.1*i, 0.5+0.2*i/3.5, 0.5, -1.35+0.1*i})
end
table.insert(boxg[13], {-0.5-0.2*18.5/3.5, -0.5, -1.3+0.1*17.5, 0.5, 0.5, -1.25+0.1*17.5})
table.insert(boxg[14], {-0.5, -0.5, -1.3+0.1*17.5, 0.5+0.2*18.5/3.5, 0.5, -1.25+0.1*17.5})
for i=1,11 do
table.insert(boxg[1], {-0.5-0.2*i/3.5, -0.5, -0.7+0.1*i, 0.5, 0.5, -0.6+0.1*i})
table.insert(boxg[4], {-0.5, -0.5, -0.7+0.1*i, 0.5+0.2*i/3.5, 0.5, -0.6+0.1*i})
table.insert(boxg[7], {-0.5-0.2*i/3.5, -0.5, -0.95+0.1*i, 0.5, 0.5, -0.85+0.1*i})
table.insert(boxg[10], {-0.5, -0.5, -0.95+0.1*i, 0.5+0.2*i/3.5, 0.5, -0.85+0.1*i})
end
for i=1,8 do
table.insert(box2[2], {-0.5-0.2*(i+10)/3.5, -0.5, -0.6+0.1*i, 0.5, -0.16667, -0.5+0.1*i})
table.insert(box2[5], {-0.5, -0.5, -0.6+0.1*i, 0.5+0.2*(i+10)/3.5, -0.16667, -0.5+0.1*i})
table.insert(box2[8], {-0.5-0.2*(i+10)/3.5, -0.5, -0.85+0.1*i, 0.5, -0.16667, -0.75+0.1*i})
table.insert(box2[11], {-0.5, -0.5, -0.85+0.1*i, 0.5+0.2*(i+10)/3.5, -0.16667, -0.75+0.1*i})
table.insert(box4[2], {-0.5-0.2*(i+10)/3.5, -0.5, -0.6+0.1*i, 0.5, 0.16667, -0.5+0.1*i})
table.insert(box4[5], {-0.5, -0.5, -0.6+0.1*i, 0.5+0.2*(i+10)/3.5, 0.16667, -0.5+0.1*i})
table.insert(box4[8], {-0.5-0.2*(i+10)/3.5, -0.5, -0.85+0.1*i, 0.5, 0.16667, -0.75+0.1*i})
table.insert(box4[11], {-0.5, -0.5, -0.85+0.1*i, 0.5+0.2*(i+10)/3.5, 0.16667, -0.75+0.1*i})
table.insert(box6[2], {-0.5-0.2*(i+10)/3.5, -0.5, -0.6+0.1*i, 0.5, 0.5, -0.5+0.1*i})
table.insert(box6[5], {-0.5, -0.5, -0.6+0.1*i, 0.5+0.2*(i+10)/3.5, 0.5, -0.5+0.1*i})
table.insert(box6[8], {-0.5-0.2*(i+10)/3.5, -0.5, -0.85+0.1*i, 0.5, 0.5, -0.75+0.1*i})
table.insert(box6[11], {-0.5, -0.5, -0.85+0.1*i, 0.5+0.2*(i+10)/3.5, 0.5, -0.75+0.1*i})
end
for i=1,9 do
table.insert(boxg[2], {-0.5-0.2*(i+10)/3.5, -0.5, -0.7+0.1*i, 0.5, 0.5, -0.6+0.1*i})
table.insert(boxg[5], {-0.5, -0.5, -0.7+0.1*i, 0.5+0.2*(i+10)/3.5, 0.5, -0.6+0.1*i})
table.insert(boxg[8], {-0.5-0.2*(i+10)/3.5, -0.5, -0.95+0.1*i, 0.5, 0.5, -0.85+0.1*i})
table.insert(boxg[11], {-0.5, -0.5, -0.95+0.1*i, 0.5+0.2*(i+10)/3.5, 0.5, -0.85+0.1*i})
end
for i=6,7 do
table.insert(box2[2], {-0.5-0.2*(i+10)/3.5, -0.5, 1.1-0.1*i, 0.5, -0.16667, 1.0-0.1*i})
table.insert(box2[5], {-0.5, -0.5, 1.1-0.1*i, 0.5+0.2*(i+10)/3.5, -0.16667, 1.0-0.1*i})
table.insert(box2[8], {-0.5-0.2*(i+10)/3.5, -0.5, 0.85-0.1*i, 0.5, -0.16667, 0.75-0.1*i})
table.insert(box2[11], {-0.5, -0.5, 0.85-0.1*i, 0.5+0.2*(i+10)/3.5, -0.16667, 0.75-0.1*i})
table.insert(box4[2], {-0.5-0.2*(i+10)/3.5, -0.5, 1.1-0.1*i, 0.5, 0.16667, 1.0-0.1*i})
table.insert(box4[5], {-0.5, -0.5, 1.1-0.1*i, 0.5+0.2*(i+10)/3.5, 0.16667, 1.0-0.1*i})
table.insert(box4[8], {-0.5-0.2*(i+10)/3.5, -0.5, 0.85-0.1*i, 0.5, 0.16667, 0.75-0.1*i})
table.insert(box4[11], {-0.5, -0.5, 0.85-0.1*i, 0.5+0.2*(i+10)/3.5, 0.16667, 0.75-0.1*i})
table.insert(box6[2], {-0.5-0.2*(i+10)/3.5, -0.5, 1.1-0.1*i, 0.5, 0.5, 1.0-0.1*i})
table.insert(box6[5], {-0.5, -0.5, 1.1-0.1*i, 0.5+0.2*(i+10)/3.5, 0.5, 1.0-0.1*i})
table.insert(box6[8], {-0.5-0.2*(i+10)/3.5, -0.5, 0.85-0.1*i, 0.5, 0.5, 0.75-0.1*i})
table.insert(box6[11], {-0.5, -0.5, 0.85-0.1*i, 0.5+0.2*(i+10)/3.5, 0.5, 0.75-0.1*i})
end
for i=6,8 do
table.insert(boxg[2], {-0.5-0.2*(i+10)/3.5, -0.5, 1.2-0.1*i, 0.5, 0.5, 1.1-0.1*i})
table.insert(boxg[5], {-0.5, -0.5, 1.2-0.1*i, 0.5+0.2*(i+10)/3.5, 0.5, 1.1-0.1*i})
table.insert(boxg[8], {-0.5-0.2*(i+10)/3.5, -0.5, 0.95-0.1*i, 0.5, 0.5, 0.85-0.1*i})
table.insert(boxg[11], {-0.5, -0.5, 0.95-0.1*i, 0.5+0.2*(i+10)/3.5, 0.5, 0.85-0.1*i})
end
for i=1,15 do
table.insert(box2[3], {-0.5-0.2*i/3.5, -0.5, 1.1-0.1*i, 0.5, -0.16667, 1.0-0.1*i})
table.insert(box2[6], {-0.5, -0.5, 1.1-0.1*i, 0.5+0.2*i/3.5, -0.16667, 1.0-0.1*i})
table.insert(box2[9], {-0.5-0.2*i/3.5, -0.5, 0.85-0.1*i, 0.5, -0.16667, 0.75-0.1*i})
table.insert(box2[12], {-0.5, -0.5, 0.85-0.1*i, 0.5+0.2*i/3.5, -0.16667, 0.75-0.1*i})
table.insert(box4[3], {-0.5-0.2*i/3.5, -0.5, 1.1-0.1*i, 0.5, 0.16667, 1.0-0.1*i})
table.insert(box4[6], {-0.5, -0.5, 1.1-0.1*i, 0.5+0.2*i/3.5, 0.16667, 1.0-0.1*i})
table.insert(box4[9], {-0.5-0.2*i/3.5, -0.5, 0.85-0.1*i, 0.5, 0.16667, 0.75-0.1*i})
table.insert(box4[12], {-0.5, -0.5, 0.85-0.1*i, 0.5+0.2*i/3.5, 0.16667, 0.75-0.1*i})
table.insert(box6[3], {-0.5-0.2*i/3.5, -0.5, 1.1-0.1*i, 0.5, 0.5, 1.0-0.1*i})
table.insert(box6[6], {-0.5, -0.5, 1.1-0.1*i, 0.5+0.2*i/3.5, 0.5, 1.0-0.1*i})
table.insert(box6[9], {-0.5-0.2*i/3.5, -0.5, 0.85-0.1*i, 0.5, 0.5, 0.75-0.1*i})
table.insert(box6[12], {-0.5, -0.5, 0.85-0.1*i, 0.5+0.2*i/3.5, 0.5, 0.75-0.1*i})
end
for i=1,16 do
table.insert(boxg[3], {-0.5-0.2*i/3.5, -0.5, 1.2-0.1*i, 0.5, 0.5, 1.1-0.1*i})
table.insert(boxg[6], {-0.5, -0.5, 1.2-0.1*i, 0.5+0.2*i/3.5, 0.5, 1.1-0.1*i})
table.insert(boxg[9], {-0.5-0.2*i/3.5, -0.5, 0.95-0.1*i, 0.5, 0.5, 0.85-0.1*i})
table.insert(boxg[12], {-0.5, -0.5, 0.95-0.1*i, 0.5+0.2*i/3.5, 0.5, 0.85-0.1*i})
end
for i=1,14 do
minetest.register_node(minetest.get_current_modname()..":block_1_2_"..i,{
description = "Sector 1 Block 2."..i,
tiles = {"stella_sector1.png"},
mesh = "block_2_"..i..".obj",
drawtype = "mesh",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky=2},
selection_box = {type = "fixed",fixed = {}
},
collision_box = {type = "fixed",fixed = box2[i]
},
})
minetest.register_node(minetest.get_current_modname()..":block_1_4_"..i,{
description = "Sector 1 Block 4."..i,
tiles = {"stella_sector1.png"},
mesh = "block_4_"..i..".obj",
drawtype = "mesh",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky=2},
selection_box = {type = "fixed",fixed = {}
},
collision_box = {type = "fixed",fixed = box4[i]
},
})
minetest.register_node(minetest.get_current_modname()..":block_1_6_"..i,{
description = "Sector 1 Block 6."..i,
tiles = {"stella_sector1.png"},
mesh = "block_6_"..i..".obj",
drawtype = "mesh",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky=2},
selection_box = {type = "fixed",fixed = {}
},
collision_box = {type = "fixed",fixed = box6[i]
},
})
minetest.register_node(minetest.get_current_modname()..":block_1_g_"..i,{
description = "Sector 1 Block Ground."..i,
tiles = {"stella_sector1.png"},
mesh = "block_6_"..i..".obj",
drawtype = "mesh",
paramtype = "light",
paramtype2 = "facedir",
groups = {cracky=2},
selection_box = {type = "fixed",fixed = {}
},
collision_box = {type = "fixed",fixed = boxg[i]
},
})
end
minetest.register_node("stella:timber1", {
description = "Timber lv.1",
drawtype = "mesh",
mesh = "timber1.obj",
tiles = {"stella_character.png"},
paramtype = "light",
paramtype2 = "facedir",
selection_box = {type = "fixed",fixed =
{0, -1.16667, -0.5, 1, 0.83333, 0.5}
},
collision_box = {type = "fixed",fixed =
{}
},
on_punch = function(pos, node, player, pointed_thing)
minetest.show_formspec(player:get_player_name(), "timber1" , timber1.get_formspec(player))
end,
})
minetest.register_node("stella:water", {
description = "Water",
drawtype = "liquid",
waving = 3,
tiles = {
{
name = "stella_water.png",
backface_culling = false,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 2.0,
},
},
{
name = "stella_water.png",
backface_culling = true,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 2.0,
},
},
},
use_texture_alpha = "blend",
paramtype = "light",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
drop = "",
drowning = 1,
liquidtype = "source",
liquid_viscosity = 1,
post_effect_color = {a = 103, r = 30, g = 60, b = 90},
})
dofile(minetest.get_modpath("stella").."/functions.lua")
dofile(minetest.get_modpath("stella").."/nodebox.lua")
dofile(minetest.get_modpath("stella").."/hexagon_nodes.lua")
dofile(minetest.get_modpath("stella").."/inv.lua")
dofile(minetest.get_modpath("stella").."/nodes.lua")
dofile(minetest.get_modpath("stella").."/on_join.lua")
dofile(minetest.get_modpath("stella").."/on_new.lua")
dofile(minetest.get_modpath("stella").."/receive_fields.lua")
dofile(minetest.get_modpath("stella").."/set_hexagon.lua")
dofile(minetest.get_modpath("stella").."/tools.lua")
dofile(minetest.get_modpath("stella").."/update_tasks.lua")
dofile(minetest.get_modpath("stella").."/global_step.lua")

242
mods/stella/inv.lua Normal file
View File

@ -0,0 +1,242 @@
stella.stella_inv = minetest.create_detached_inventory("singleplayer_stella_inv",{
allow_put = function(inv, listname, index, stack, player)
return 0
end,
allow_take = function(inv, listname, index, stack, player)
return 0
end,
allow_move = function(inv, from_list, from_index, to_list, to_index, count, player)
return 0
end,
})
stella.invget_formspec = function(player, pos)
if player == nil then
return
end
local player_inv = player:get_inventory()
stella.stella_inv:set_size("tool", 3)
player_inv:set_size("tool", 3)
stella.stella_inv:set_size("armor", 2)
player_inv:set_size("armor", 2)
stella.stella_inv:set_size("inv", 40)
player_inv:set_size("inv", 40)
for i=1, 3 do
local stack = player_inv:get_stack("main", i)
stella.stella_inv:set_stack("tool", i, stack)
end
for i=1, 2 do
local stack = player_inv:get_stack("armor", i)
stella.stella_inv:set_stack("armor", i, stack)
end
for i=1, 40 do
local stack = player_inv:get_stack("inv", i)
stella.stella_inv:set_stack("inv", i, stack)
end
formspec = "size[8,7.5]"
.."list[detached:singleplayer_stella_inv;tool;2.5,0.5;5,1]"
.."list[detached:singleplayer_stella_inv;armor;1,1;1,1]"
.."list[detached:singleplayer_stella_inv;armor;6,1;1,1;1]"
.."list[detached:singleplayer_stella_inv;inv;0,2.7;8,5]"
return formspec
end
stella.timber1get_formspec = function(player, pos)
if player == nil then
return
end
local player_inv = player:get_inventory()
stella.stella_inv:set_size("inv", 40)
player_inv:set_size("inv", 40)
stella.stella_inv:set_size("t1_from1", 1)
stella.stella_inv:set_size("t1_from2", 1)
stella.stella_inv:set_size("t1_from", 1)
stella.stella_inv:set_size("t1_to1", 1)
stella.stella_inv:set_size("t1_to2", 1)
player_inv:set_size("t1_from", 1)
for i=1, 40 do
local stack = player_inv:get_stack("inv", i)
stella.stella_inv:set_stack("inv", i, stack)
end
local stack = player_inv:get_stack("t1_from", 1)
stella.stella_inv:set_stack("t1_from", 1, stack)
local purple = player_inv:get_stack("inv", 1):get_count()
if purple > 2 and player_inv:get_stack("inv", 1):get_name() == "stella:resource_1" then
stella.stella_inv:set_stack("t1_from1", 1, "stella:resource_1 3")
stella.stella_inv:set_stack("t1_to1", 1, "stella:resource_3")
else
stella.stella_inv:set_stack("t1_from1", 1, "")
stella.stella_inv:set_stack("t1_to1", 1, "")
end
if purple > 2 and player_inv:get_stack("inv", 1):get_name() == "stella:resource_1" then
stella.stella_inv:set_stack("t1_from2", 1, "stella:resource_1 "..math.floor(purple/3)*3)
stella.stella_inv:set_stack("t1_to2", 1, "stella:resource_3 "..math.floor(purple/3))
else
stella.stella_inv:set_stack("t1_from2", 1, "")
stella.stella_inv:set_stack("t1_to2", 1, "")
end
formspec = "size[8,7.5]"
.."list[detached:singleplayer_stella_inv;t1_from1;1,0;1,1]"
.."list[detached:singleplayer_stella_inv;t1_from2;1,1;1,1]"
.."list[detached:singleplayer_stella_inv;t1_from;6,0.5;1,1]"
.."list[detached:singleplayer_stella_inv;t1_to1;4,0;1,1]"
.."list[detached:singleplayer_stella_inv;t1_to2;4,1;1,1]"
.."button[2,0;2,1;timber1_1;-->]"
.."button[2,1;2,1;timber1_2;-->]"
.."list[detached:singleplayer_stella_inv;inv;0,2.7;8,5]"
return formspec
end
stella.smith1get_formspec = function(player, pos)
if player == nil then
return
end
local player_inv = player:get_inventory()
stella.stella_inv:set_size("inv", 40)
player_inv:set_size("inv", 40)
stella.stella_inv:set_size("s1_from1", 1)
stella.stella_inv:set_size("s1_from2", 1)
stella.stella_inv:set_size("s1_from", 1)
stella.stella_inv:set_size("s1_to1", 1)
stella.stella_inv:set_size("s1_to2", 1)
player_inv:set_size("s1_from", 1)
for i=1, 40 do
local stack = player_inv:get_stack("inv", i)
stella.stella_inv:set_stack("inv", i, stack)
end
local stack = player_inv:get_stack("s1_from", 1)
stella.stella_inv:set_stack("s1_from", 1, stack)
local gray = player_inv:get_stack("inv", 1):get_count()
local gray2 = player_inv:get_stack("inv", 2):get_count()
if gray > 4 and player_inv:get_stack("inv", 1):get_name() == "stella:resource_2" then
stella.stella_inv:set_stack("s1_from1", 1, "stella:resource_2 5")
stella.stella_inv:set_stack("s1_to1", 1, "stella:resource_4")
elseif gray2 > 4 and player_inv:get_stack("inv", 2):get_name() == "stella:resource_2" then
stella.stella_inv:set_stack("s1_from1", 1, "stella:resource_2 5")
stella.stella_inv:set_stack("s1_to1", 1, "stella:resource_4")
else
stella.stella_inv:set_stack("s1_from1", 1, "")
stella.stella_inv:set_stack("s1_to1", 1, "")
end
if gray > 4 and player_inv:get_stack("inv", 1):get_name() == "stella:resource_2" then
stella.stella_inv:set_stack("s1_from2", 1, "stella:resource_2 "..math.floor(gray/5)*5)
stella.stella_inv:set_stack("s1_to2", 1, "stella:resource_4 "..math.floor(gray/5))
elseif gray2 > 4 and player_inv:get_stack("inv", 2):get_name() == "stella:resource_2" then
stella.stella_inv:set_stack("s1_from2", 1, "stella:resource_2 "..math.floor(gray2/5)*5)
stella.stella_inv:set_stack("s1_to2", 1, "stella:resource_4 "..math.floor(gray2/5))
else
stella.stella_inv:set_stack("s1_from2", 1, "")
stella.stella_inv:set_stack("s1_to2", 1, "")
end
formspec = "size[8,7.5]"
.."list[detached:singleplayer_stella_inv;s1_from1;1,0;1,1]"
.."list[detached:singleplayer_stella_inv;s1_from2;1,1;1,1]"
.."list[detached:singleplayer_stella_inv;s1_from;6,0.5;1,1]"
.."list[detached:singleplayer_stella_inv;s1_to1;4,0;1,1]"
.."list[detached:singleplayer_stella_inv;s1_to2;4,1;1,1]"
.."button[2,0;2,1;smith1_1;-->]"
.."button[2,1;2,1;smith1_2;-->]"
.."list[detached:singleplayer_stella_inv;inv;0,2.7;8,5]"
return formspec
end
stella.shop1get_formspec = function(player, pos)
if player == nil then
return
end
local player_inv = player:get_inventory()
stella.stella_inv:set_size("inv", 40)
player_inv:set_size("inv", 40)
for i=1, 40 do
local stack = player_inv:get_stack("inv", i)
stella.stella_inv:set_stack("inv", i, stack)
end
formspec = "size[8,7.5]"
.."label[3.2,1;comming soon]"
.."list[detached:singleplayer_stella_inv;inv;0,2.7;8,5]"
return formspec
end
stella.info1 = function(player, pos)
if player == nil then
return
end
formspec = "size[7,3.5]"
.."label[0,0;Welcome to stella, my newest game for Minetest.]"
.."label[0,0.3;I originally made this game for the 2021 Minetest GAME JAM.]"
.."label[0,0.9;Let's get started:]"
.."label[0,1.2;You are on a small island in the sea and you have to enlarge it.]"
.."label[0,1.5;For that you have an axe and a pickaxe.]"
.."label[0,1.8;Go to the purple pillars first. You can mine them with your axe.]"
.."label[0,2.1;Collect 10 purple resources, go to the first task and expand the island.]"
.."label[0,2.7;have a good time]"
.."label[0,3;your 1248]"
return formspec
end
stella.info2 = function(player, pos)
if player == nil then
return
end
formspec = "size[7,0.8]"
.."label[0,0;Well done!]"
.."label[0,0.3;Now collect more purple resources and expand the island further.]"
return formspec
end
stella.info3 = function(player, pos)
if player == nil then
return
end
formspec = "size[7,1.7]"
.."label[0,0;Nice you made a new friend!]"
.."label[0,0.3;He can make an orange resource out of 3 purple resources.]"
.."label[0,0.6;Hit him and you can choose whether you want to convert three]"
.."label[0,0.9;or all of your purple resources into orange resources.]"
.."label[0,1.2;After a while, the resources will automatically be added to your inventory.]"
return formspec
end
stella.info4 = function(player, pos)
if player == nil then
return
end
formspec = "size[7,0.8]"
.."label[0,0;You have unlocked another sector of the island!]"
.."label[0,0.3;You can mine gray resources with your pickaxe.]"
return formspec
end
stella.info5 = function(player, pos)
if player == nil then
return
end
formspec = "size[7,0.8]"
.."label[0,0;Another new friend!]"
.."label[0,0.3;He can make a silver resource out of 5 gray resources.]"
return formspec
end
stella.info6 = function(player, pos)
if player == nil then
return
end
formspec = "size[7,1.3]"
.."label[0,0;A third friend!]"
.."label[0,0.3;If you give him the necessary resources he will improve your pickaxe.]"
.."label[0,0.8;Unfortunately, you will only be able to use this function after the next update.]"
return formspec
end
stella.info7 = function(player, pos)
if player == nil then
return
end
formspec = "size[7,1.3]"
.."label[0,0;And a fourth friend!]"
.."label[0,0.3;He immediately exchanges fifty purple resources for ten yellow resources]"
.."label[0,0.8;Unfortunately, you will only be able to use this function after the next update.]"
return formspec
end

View File

@ -1,7 +1,7 @@
# Blender MTL File: 'None'
# Material Count: 1
newmtl None
newmtl Character.001
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000

View File

@ -0,0 +1,256 @@
# Blender v2.79 (sub 0) OBJ File: ''
# www.blender.org
mtllib pick1.mtl
o Player_Cube.001
v -0.700005 0.193536 0.179036
v -0.300005 0.193536 0.179010
v -0.300005 -0.486565 0.179010
v -0.700005 -0.486565 0.179036
v -0.299992 0.193536 0.380519
v -0.299992 -0.486565 0.380519
v -0.699992 0.193536 0.380545
v -0.699992 -0.486565 0.380545
v -0.499992 -0.486565 0.380532
v -0.499992 -1.166667 0.380532
v -0.500005 -1.166667 0.179023
v -0.500005 -0.486565 0.179023
v -0.300005 0.193538 0.179010
v -0.100005 0.193538 0.178997
v -0.100005 -0.486564 0.178997
v -0.300005 -0.486564 0.179010
v -0.299992 0.193538 0.380519
v -0.299992 -0.486564 0.380519
v -0.499992 -1.166667 0.380532
v -0.500005 -1.166667 0.179023
v -0.300005 -1.166667 0.179010
v -0.299992 -1.166667 0.380519
v -0.300005 -0.486565 0.179010
v -0.299992 -0.486565 0.380519
v -0.700012 0.596560 0.078281
v -0.300012 0.596560 0.078255
v -0.300012 0.193536 0.078255
v -0.700012 0.193536 0.078281
v -0.299986 0.596560 0.481274
v -0.299986 0.193536 0.481274
v -0.699986 0.596560 0.481300
v -0.699986 0.193536 0.481300
v -0.500005 -0.486565 0.179023
v -0.699992 -0.486565 0.380545
v -0.699992 -1.166667 0.380545
v -0.499992 -0.486565 0.380532
v -0.699992 -0.486564 0.380545
v -0.899992 -0.486564 0.380558
v -0.900005 -0.486564 0.179049
v -0.700005 -0.486564 0.179036
v -0.899992 0.193538 0.380558
v -0.699992 0.193538 0.380545
v -0.700005 0.193538 0.179036
v -0.900005 0.193538 0.179049
v -0.700005 -1.166667 0.179036
v -0.700005 -0.486565 0.179036
v -0.099992 0.193538 0.380506
v -0.099992 -0.486564 0.380506
v -0.720013 0.617012 0.058131
v -0.280013 0.617012 0.058103
v -0.280013 0.173687 0.058103
v -0.720013 0.173687 0.058131
v -0.279984 0.617012 0.501423
v -0.279984 0.173687 0.501423
v -0.719984 0.617012 0.501451
v -0.719984 0.173687 0.501451
v -0.700008 0.193536 0.142321
v -0.300008 0.193536 0.142295
v -0.300008 -0.486565 0.142295
v -0.700008 -0.486565 0.142321
v -0.700005 0.193536 0.179036
v -0.700005 -0.486565 0.179036
v -0.300005 -0.486565 0.179010
v -0.300005 0.193536 0.179010
vt 0.625000 0.375000
vt 0.500000 0.375000
vt 0.500000 0.000000
vt 0.625000 0.000000
vt 0.437500 0.375000
vt 0.437500 0.000000
vt 0.312500 0.375000
vt 0.312500 0.000000
vt 0.562500 0.375000
vt 0.562500 0.500000
vt 0.437500 0.500000
vt 0.437500 0.375000
vt 0.437500 0.500000
vt 0.312500 0.500000
vt 0.125000 0.375000
vt 0.125000 0.000000
vt 0.187500 0.000000
vt 0.187500 0.375000
vt 0.812500 0.375000
vt 0.875000 0.375000
vt 0.875000 0.000000
vt 0.812500 0.000000
vt 0.750000 0.375000
vt 0.750000 0.000000
vt 0.187500 0.375000
vt 0.187500 0.500000
vt 0.125000 0.500000
vt 0.125000 0.375000
vt 0.000000 0.375000
vt 0.062500 0.375000
vt 0.062500 0.000000
vt 0.000000 0.000000
vt 0.500000 0.750000
vt 0.375000 0.750000
vt 0.375000 0.500000
vt 0.500000 0.500000
vt 0.250000 0.750000
vt 0.250000 0.500000
vt 0.125000 0.750000
vt 0.125000 0.500000
vt 0.375000 0.750000
vt 0.375000 1.000000
vt 0.250000 1.000000
vt 0.250000 0.750000
vt 0.250000 1.000000
vt 0.125000 1.000000
vt 0.187500 0.375000
vt 0.250000 0.375000
vt 0.250000 0.000000
vt 0.187500 0.000000
vt 0.062500 0.375000
vt 0.062500 0.000000
vt 0.125000 0.375000
vt 0.125000 0.000000
vt 0.750000 0.375000
vt 0.812500 0.375000
vt 0.812500 0.500000
vt 0.750000 0.500000
vt 0.687500 0.375000
vt 0.750000 0.375000
vt 0.750000 0.500000
vt 0.687500 0.500000
vt 0.250000 0.000000
vt 0.250000 0.375000
vt 0.000000 0.375000
vt 0.000000 0.000000
vt 0.250000 0.375000
vt 0.250000 0.000000
vt 0.000000 0.750000
vt 0.000000 0.500000
vt 0.125000 0.375000
vt 0.125000 0.500000
vt 0.062500 0.500000
vt 0.062500 0.375000
vt 0.687500 0.375000
vt 0.687500 0.000000
vt 0.625000 0.375000
vt 0.625000 0.000000
vt 0.625000 0.375000
vt 0.625000 0.000000
vt 0.687500 0.000000
vt 0.687500 0.500000
vt 0.750000 0.500000
vt 0.750000 0.000000
vt 0.187500 0.375000
vt 0.125000 0.375000
vt 0.125000 0.500000
vt 0.187500 0.500000
vt 0.812500 0.000000
vt 0.812500 0.375000
vt 0.750000 0.375000
vt 0.750000 0.500000
vt 0.812500 0.500000
vt 0.812500 0.375000
vt 0.875000 0.000000
vt 0.875000 0.375000
vt 0.125000 0.375000
vt 0.062500 0.375000
vt 0.062500 0.500000
vt 0.125000 0.500000
vt 1.000000 0.750000
vt 0.875000 0.750000
vt 0.875000 0.500000
vt 1.000000 0.500000
vt 0.750000 0.750000
vt 0.750000 0.500000
vt 0.625000 0.750000
vt 0.625000 0.500000
vt 0.875000 0.750000
vt 0.875000 1.000000
vt 0.750000 1.000000
vt 0.750000 0.750000
vt 0.750000 1.000000
vt 0.625000 1.000000
vt 0.500000 0.750000
vt 0.500000 0.500000
vt 1.000000 0.375000
vt 0.875000 0.375000
vt 0.875000 0.000000
vt 1.000000 0.000000
vt 1.000000 0.375000
vt 1.000000 0.000000
vt 0.875000 0.000000
vt 0.875000 0.375000
vt 1.000000 0.343750
vt 0.875000 0.343750
vt 0.984375 0.000000
vt 0.984375 0.375000
vt 0.890625 0.375000
vt 0.890625 0.000000
vt 0.875000 0.031250
vt 1.000000 0.031250
vn -0.0001 -0.0000 -1.0000
vn 1.0000 0.0000 -0.0001
vn 0.0001 0.0000 1.0000
vn 0.0000 -1.0000 0.0000
vn -0.0000 1.0000 -0.0000
vn -1.0000 0.0000 0.0001
usemtl Character.001
s 1
f 1/1/1 2/2/1 3/3/1 4/4/1
f 2/2/2 5/5/2 6/6/2 3/3/2
f 5/5/3 7/7/3 8/8/3 6/6/3
f 8/9/4 4/10/4 3/11/4 6/12/4
f 5/5/5 2/13/5 1/14/5 7/7/5
f 9/15/2 10/16/2 11/17/2 12/18/2
f 13/19/1 14/20/1 15/21/1 16/22/1
f 17/23/6 13/19/6 16/22/6 18/24/6
f 19/25/4 20/26/4 21/27/4 22/28/4
f 23/29/2 24/30/2 22/31/2 21/32/2
f 25/33/1 26/34/1 27/35/1 28/36/1
f 26/34/2 29/37/2 30/38/2 27/35/2
f 29/37/3 31/39/3 32/40/3 30/38/3
f 32/41/4 28/42/4 27/43/4 30/44/4
f 29/37/5 26/45/5 25/46/5 31/39/5
f 33/47/1 23/48/1 21/49/1 20/50/1
f 34/51/3 35/52/3 10/16/3 9/15/3
f 24/30/3 36/53/3 19/54/3 22/31/3
f 37/55/4 38/56/4 39/57/4 40/58/4
f 41/59/5 42/60/5 43/61/5 44/62/5
f 12/18/1 11/17/1 45/63/1 46/64/1
f 36/53/6 33/47/6 20/50/6 19/54/6
f 46/65/6 45/66/6 35/52/6 34/51/6
f 1/67/6 4/68/6 8/8/6 7/7/6
f 25/69/6 28/70/6 32/40/6 31/39/6
f 24/71/5 23/72/5 33/73/5 36/74/5
f 47/75/3 17/23/3 18/24/3 48/76/3
f 14/77/2 47/75/2 48/76/2 15/78/2
f 44/79/6 39/80/6 38/81/6 41/59/6
f 47/75/5 14/82/5 13/83/5 17/23/5
f 41/59/3 38/81/3 37/84/3 42/60/3
f 10/85/4 35/86/4 45/87/4 11/88/4
f 42/60/2 37/84/2 40/89/2 43/90/2
f 18/91/4 16/92/4 15/93/4 48/94/4
f 43/90/1 40/89/1 39/95/1 44/96/1
f 34/97/5 9/98/5 12/99/5 46/100/5
f 49/101/1 50/102/1 51/103/1 52/104/1
f 50/102/2 53/105/2 54/106/2 51/103/2
f 53/105/3 55/107/3 56/108/3 54/106/3
f 56/109/4 52/110/4 51/111/4 54/112/4
f 53/105/5 50/113/5 49/114/5 55/107/5
f 49/115/6 52/116/6 56/108/6 55/107/6
f 57/117/1 58/118/1 59/119/1 60/120/1
f 61/121/3 62/122/3 63/123/3 64/124/3
f 58/118/5 57/117/5 61/125/5 64/126/5
f 57/117/6 60/120/6 62/127/6 61/128/6
f 59/119/2 58/118/2 64/129/2 63/130/2
f 60/120/4 59/119/4 63/131/4 62/132/4

View File

@ -1,12 +0,0 @@
# Blender MTL File: 'None'
# Material Count: 1
newmtl None
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

View File

@ -1,12 +0,0 @@
# Blender MTL File: 'None'
# Material Count: 1
newmtl None
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

View File

@ -1,12 +0,0 @@
# Blender MTL File: 'None'
# Material Count: 1
newmtl None
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

View File

@ -1,7 +1,7 @@
# Blender MTL File: 'None'
# Material Count: 1
newmtl None
newmtl Character.002
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000

View File

@ -0,0 +1,256 @@
# Blender v2.79 (sub 0) OBJ File: ''
# www.blender.org
mtllib shop1.mtl
o Player_Cube.002
v -0.586002 0.193536 -0.285170
v -0.585729 0.193536 -0.685170
v -0.585729 -0.486565 -0.685170
v -0.586001 -0.486565 -0.285170
v -0.384220 0.193536 -0.685033
v -0.384220 -0.486565 -0.685033
v -0.384493 0.193536 -0.285033
v -0.384492 -0.486565 -0.285033
v -0.384356 -0.486565 -0.485033
v -0.384356 -1.166667 -0.485033
v -0.585865 -1.166667 -0.485170
v -0.585865 -0.486565 -0.485170
v -0.585729 0.193538 -0.685170
v -0.585593 0.193538 -0.885170
v -0.585593 -0.486564 -0.885170
v -0.585729 -0.486564 -0.685170
v -0.384220 0.193538 -0.685033
v -0.384220 -0.486564 -0.685033
v -0.384356 -1.166667 -0.485033
v -0.585865 -1.166667 -0.485170
v -0.585729 -1.166667 -0.685170
v -0.384220 -1.166667 -0.685033
v -0.585729 -0.486565 -0.685170
v -0.384220 -0.486565 -0.685033
v -0.686757 0.596560 -0.285239
v -0.686484 0.596560 -0.685239
v -0.686484 0.193536 -0.685239
v -0.686757 0.193536 -0.285239
v -0.283465 0.596560 -0.684964
v -0.283465 0.193536 -0.684964
v -0.283738 0.596560 -0.284964
v -0.283738 0.193536 -0.284964
v -0.585865 -0.486565 -0.485170
v -0.384492 -0.486565 -0.285033
v -0.384492 -1.166667 -0.285033
v -0.384356 -0.486565 -0.485033
v -0.384492 -0.486564 -0.285033
v -0.384629 -0.486564 -0.085033
v -0.586138 -0.486564 -0.085170
v -0.586001 -0.486564 -0.285170
v -0.384629 0.193538 -0.085033
v -0.384493 0.193538 -0.285033
v -0.586002 0.193538 -0.285170
v -0.586138 0.193538 -0.085170
v -0.586001 -1.166667 -0.285170
v -0.586001 -0.486565 -0.285170
v -0.384084 0.193538 -0.885033
v -0.384084 -0.486564 -0.885033
v -0.706921 0.617012 -0.265252
v -0.706622 0.617012 -0.705252
v -0.706622 0.173687 -0.705252
v -0.706921 0.173687 -0.265252
v -0.263302 0.617012 -0.704950
v -0.263302 0.173687 -0.704950
v -0.263601 0.617012 -0.264951
v -0.263601 0.173687 -0.264951
v -0.622717 0.193536 -0.285195
v -0.622444 0.193536 -0.685195
v -0.622444 -0.486565 -0.685195
v -0.622716 -0.486565 -0.285195
v -0.586002 0.193536 -0.285170
v -0.586001 -0.486565 -0.285170
v -0.585729 -0.486565 -0.685170
v -0.585729 0.193536 -0.685170
vt 0.625000 0.375000
vt 0.500000 0.375000
vt 0.500000 0.000000
vt 0.625000 0.000000
vt 0.437500 0.375000
vt 0.437500 0.000000
vt 0.312500 0.375000
vt 0.312500 0.000000
vt 0.562500 0.375000
vt 0.562500 0.500000
vt 0.437500 0.500000
vt 0.437500 0.375000
vt 0.437500 0.500000
vt 0.312500 0.500000
vt 0.125000 0.375000
vt 0.125000 0.000000
vt 0.187500 0.000000
vt 0.187500 0.375000
vt 0.812500 0.375000
vt 0.875000 0.375000
vt 0.875000 0.000000
vt 0.812500 0.000000
vt 0.750000 0.375000
vt 0.750000 0.000000
vt 0.187500 0.375000
vt 0.187500 0.500000
vt 0.125000 0.500000
vt 0.125000 0.375000
vt 0.000000 0.375000
vt 0.062500 0.375000
vt 0.062500 0.000000
vt 0.000000 0.000000
vt 0.500000 0.750000
vt 0.375000 0.750000
vt 0.375000 0.500000
vt 0.500000 0.500000
vt 0.250000 0.750000
vt 0.250000 0.500000
vt 0.125000 0.750000
vt 0.125000 0.500000
vt 0.375000 0.750000
vt 0.375000 1.000000
vt 0.250000 1.000000
vt 0.250000 0.750000
vt 0.250000 1.000000
vt 0.125000 1.000000
vt 0.187500 0.375000
vt 0.250000 0.375000
vt 0.250000 0.000000
vt 0.187500 0.000000
vt 0.062500 0.375000
vt 0.062500 0.000000
vt 0.125000 0.375000
vt 0.125000 0.000000
vt 0.750000 0.375000
vt 0.812500 0.375000
vt 0.812500 0.500000
vt 0.750000 0.500000
vt 0.687500 0.375000
vt 0.750000 0.375000
vt 0.750000 0.500000
vt 0.687500 0.500000
vt 0.250000 0.000000
vt 0.250000 0.375000
vt 0.000000 0.375000
vt 0.000000 0.000000
vt 0.250000 0.375000
vt 0.250000 0.000000
vt 0.000000 0.750000
vt 0.000000 0.500000
vt 0.125000 0.375000
vt 0.125000 0.500000
vt 0.062500 0.500000
vt 0.062500 0.375000
vt 0.687500 0.375000
vt 0.687500 0.000000
vt 0.625000 0.375000
vt 0.625000 0.000000
vt 0.625000 0.375000
vt 0.625000 0.000000
vt 0.687500 0.000000
vt 0.687500 0.500000
vt 0.750000 0.500000
vt 0.750000 0.000000
vt 0.187500 0.375000
vt 0.125000 0.375000
vt 0.125000 0.500000
vt 0.187500 0.500000
vt 0.812500 0.000000
vt 0.812500 0.375000
vt 0.750000 0.375000
vt 0.750000 0.500000
vt 0.812500 0.500000
vt 0.812500 0.375000
vt 0.875000 0.000000
vt 0.875000 0.375000
vt 0.125000 0.375000
vt 0.062500 0.375000
vt 0.062500 0.500000
vt 0.125000 0.500000
vt 1.000000 0.750000
vt 0.875000 0.750000
vt 0.875000 0.500000
vt 1.000000 0.500000
vt 0.750000 0.750000
vt 0.750000 0.500000
vt 0.625000 0.750000
vt 0.625000 0.500000
vt 0.875000 0.750000
vt 0.875000 1.000000
vt 0.750000 1.000000
vt 0.750000 0.750000
vt 0.750000 1.000000
vt 0.625000 1.000000
vt 0.500000 0.750000
vt 0.500000 0.500000
vt 1.000000 0.375000
vt 0.875000 0.375000
vt 0.875000 0.000000
vt 1.000000 0.000000
vt 1.000000 0.375000
vt 1.000000 0.000000
vt 0.875000 0.000000
vt 0.875000 0.375000
vt 1.000000 0.343750
vt 0.875000 0.343750
vt 0.984375 0.000000
vt 0.984375 0.375000
vt 0.890625 0.375000
vt 0.890625 0.000000
vt 0.875000 0.031250
vt 1.000000 0.031250
vn -1.0000 -0.0000 -0.0007
vn 0.0007 0.0000 -1.0000
vn 1.0000 0.0000 0.0007
vn 0.0000 -1.0000 0.0000
vn -0.0000 1.0000 0.0000
vn -0.0007 -0.0000 1.0000
usemtl Character.002
s 1
f 1/1/1 2/2/1 3/3/1 4/4/1
f 2/2/2 5/5/2 6/6/2 3/3/2
f 5/5/3 7/7/3 8/8/3 6/6/3
f 8/9/4 4/10/4 3/11/4 6/12/4
f 5/5/5 2/13/5 1/14/5 7/7/5
f 9/15/2 10/16/2 11/17/2 12/18/2
f 13/19/1 14/20/1 15/21/1 16/22/1
f 17/23/6 13/19/6 16/22/6 18/24/6
f 19/25/4 20/26/4 21/27/4 22/28/4
f 23/29/2 24/30/2 22/31/2 21/32/2
f 25/33/1 26/34/1 27/35/1 28/36/1
f 26/34/2 29/37/2 30/38/2 27/35/2
f 29/37/3 31/39/3 32/40/3 30/38/3
f 32/41/4 28/42/4 27/43/4 30/44/4
f 29/37/5 26/45/5 25/46/5 31/39/5
f 33/47/1 23/48/1 21/49/1 20/50/1
f 34/51/3 35/52/3 10/16/3 9/15/3
f 24/30/3 36/53/3 19/54/3 22/31/3
f 37/55/4 38/56/4 39/57/4 40/58/4
f 41/59/5 42/60/5 43/61/5 44/62/5
f 12/18/1 11/17/1 45/63/1 46/64/1
f 36/53/6 33/47/6 20/50/6 19/54/6
f 46/65/6 45/66/6 35/52/6 34/51/6
f 1/67/6 4/68/6 8/8/6 7/7/6
f 25/69/6 28/70/6 32/40/6 31/39/6
f 24/71/5 23/72/5 33/73/5 36/74/5
f 47/75/3 17/23/3 18/24/3 48/76/3
f 14/77/2 47/75/2 48/76/2 15/78/2
f 44/79/6 39/80/6 38/81/6 41/59/6
f 47/75/5 14/82/5 13/83/5 17/23/5
f 41/59/3 38/81/3 37/84/3 42/60/3
f 10/85/4 35/86/4 45/87/4 11/88/4
f 42/60/2 37/84/2 40/89/2 43/90/2
f 18/91/4 16/92/4 15/93/4 48/94/4
f 43/90/1 40/89/1 39/95/1 44/96/1
f 34/97/5 9/98/5 12/99/5 46/100/5
f 49/101/1 50/102/1 51/103/1 52/104/1
f 50/102/2 53/105/2 54/106/2 51/103/2
f 53/105/3 55/107/3 56/108/3 54/106/3
f 56/109/4 52/110/4 51/111/4 54/112/4
f 53/105/5 50/113/5 49/114/5 55/107/5
f 49/115/6 52/116/6 56/108/6 55/107/6
f 57/117/1 58/118/1 59/119/1 60/120/1
f 61/121/3 62/122/3 63/123/3 64/124/3
f 58/118/5 57/117/5 61/125/5 64/126/5
f 57/117/6 60/120/6 62/127/6 61/128/6
f 59/119/2 58/118/2 64/129/2 63/130/2
f 60/120/4 59/119/4 63/131/4 62/132/4

View File

@ -0,0 +1,256 @@
# Blender v2.79 (sub 0) OBJ File: ''
# www.blender.org
mtllib smith1.mtl
o Player_Cube
v -0.477414 0.525831 0.225964
v -0.674576 0.524466 -0.122067
v -0.673375 -0.155631 -0.120080
v -0.476214 -0.154266 0.227951
v -0.499246 0.524485 -0.221392
v -0.498045 -0.155612 -0.219405
v -0.302085 0.525850 0.126639
v -0.300884 -0.154247 0.128626
v -0.399465 -0.154930 -0.045389
v -0.398264 -0.835028 -0.043403
v -0.573594 -0.835047 0.055923
v -0.574794 -0.154949 0.053936
v -0.674576 0.524468 -0.122067
v -0.773156 0.523785 -0.296082
v -0.771956 -0.156313 -0.294095
v -0.673375 -0.155630 -0.120080
v -0.499246 0.524487 -0.221392
v -0.498045 -0.155611 -0.219405
v -0.398264 -0.835028 -0.043403
v -0.573594 -0.835047 0.055923
v -0.672174 -0.835729 -0.118093
v -0.496845 -0.835710 -0.217418
v -0.673375 -0.155631 -0.120080
v -0.498045 -0.155612 -0.219405
v -0.565791 0.928843 0.274449
v -0.762952 0.927478 -0.073581
v -0.762241 0.524456 -0.072404
v -0.565079 0.525821 0.275627
v -0.412292 0.927516 -0.272232
v -0.411581 0.524495 -0.271055
v -0.215131 0.928881 0.075799
v -0.214420 0.525860 0.076976
v -0.574794 -0.154949 0.053936
v -0.300884 -0.154247 0.128626
v -0.299684 -0.834345 0.130613
v -0.399465 -0.154930 -0.045389
v -0.300884 -0.154246 0.128626
v -0.202304 -0.153564 0.302642
v -0.377633 -0.153583 0.401967
v -0.476214 -0.154265 0.227951
v -0.203504 0.526534 0.300655
v -0.302085 0.525852 0.126639
v -0.477414 0.525833 0.225964
v -0.378834 0.526515 0.399980
v -0.475013 -0.834365 0.229938
v -0.476214 -0.154266 0.227951
v -0.597827 0.523805 -0.395407
v -0.596626 -0.156293 -0.393420
v -0.573502 0.949361 0.301724
v -0.790379 0.947860 -0.081110
v -0.789597 0.504537 -0.079815
v -0.572719 0.506038 0.303019
v -0.404654 0.947902 -0.299626
v -0.403872 0.504580 -0.298330
v -0.187777 0.949403 0.083209
v -0.186994 0.506081 0.084504
v -0.509359 0.525827 0.244061
v -0.706521 0.524462 -0.103970
v -0.705320 -0.155635 -0.101983
v -0.508159 -0.154270 0.246048
v -0.477414 0.525831 0.225964
v -0.476214 -0.154266 0.227951
v -0.673375 -0.155631 -0.120080
v -0.674576 0.524466 -0.122067
vt 0.625000 0.375000
vt 0.500000 0.375000
vt 0.500000 0.000000
vt 0.625000 0.000000
vt 0.437500 0.375000
vt 0.437500 0.000000
vt 0.312500 0.375000
vt 0.312500 0.000000
vt 0.562500 0.375000
vt 0.562500 0.500000
vt 0.437500 0.500000
vt 0.437500 0.375000
vt 0.437500 0.500000
vt 0.312500 0.500000
vt 0.125000 0.375000
vt 0.125000 0.000000
vt 0.187500 0.000000
vt 0.187500 0.375000
vt 0.812500 0.375000
vt 0.875000 0.375000
vt 0.875000 0.000000
vt 0.812500 0.000000
vt 0.750000 0.375000
vt 0.750000 0.000000
vt 0.187500 0.375000
vt 0.187500 0.500000
vt 0.125000 0.500000
vt 0.125000 0.375000
vt 0.000000 0.375000
vt 0.062500 0.375000
vt 0.062500 0.000000
vt 0.000000 0.000000
vt 0.500000 0.750000
vt 0.375000 0.750000
vt 0.375000 0.500000
vt 0.500000 0.500000
vt 0.250000 0.750000
vt 0.250000 0.500000
vt 0.125000 0.750000
vt 0.125000 0.500000
vt 0.375000 0.750000
vt 0.375000 1.000000
vt 0.250000 1.000000
vt 0.250000 0.750000
vt 0.250000 1.000000
vt 0.125000 1.000000
vt 0.187500 0.375000
vt 0.250000 0.375000
vt 0.250000 0.000000
vt 0.187500 0.000000
vt 0.062500 0.375000
vt 0.062500 0.000000
vt 0.125000 0.375000
vt 0.125000 0.000000
vt 0.750000 0.375000
vt 0.812500 0.375000
vt 0.812500 0.500000
vt 0.750000 0.500000
vt 0.687500 0.375000
vt 0.750000 0.375000
vt 0.750000 0.500000
vt 0.687500 0.500000
vt 0.250000 0.000000
vt 0.250000 0.375000
vt 0.000000 0.375000
vt 0.000000 0.000000
vt 0.250000 0.375000
vt 0.250000 0.000000
vt 0.000000 0.750000
vt 0.000000 0.500000
vt 0.125000 0.375000
vt 0.125000 0.500000
vt 0.062500 0.500000
vt 0.062500 0.375000
vt 0.687500 0.375000
vt 0.687500 0.000000
vt 0.625000 0.375000
vt 0.625000 0.000000
vt 0.625000 0.375000
vt 0.625000 0.000000
vt 0.687500 0.000000
vt 0.687500 0.500000
vt 0.750000 0.500000
vt 0.750000 0.000000
vt 0.187500 0.375000
vt 0.125000 0.375000
vt 0.125000 0.500000
vt 0.187500 0.500000
vt 0.812500 0.000000
vt 0.812500 0.375000
vt 0.750000 0.375000
vt 0.750000 0.500000
vt 0.812500 0.500000
vt 0.812500 0.375000
vt 0.875000 0.000000
vt 0.875000 0.375000
vt 0.125000 0.375000
vt 0.062500 0.375000
vt 0.062500 0.500000
vt 0.125000 0.500000
vt 1.000000 0.750000
vt 0.875000 0.750000
vt 0.875000 0.500000
vt 1.000000 0.500000
vt 0.750000 0.750000
vt 0.750000 0.500000
vt 0.625000 0.750000
vt 0.625000 0.500000
vt 0.875000 0.750000
vt 0.875000 1.000000
vt 0.750000 1.000000
vt 0.750000 0.750000
vt 0.750000 1.000000
vt 0.625000 1.000000
vt 0.500000 0.750000
vt 0.500000 0.500000
vt 1.000000 0.375000
vt 0.875000 0.375000
vt 0.875000 0.000000
vt 1.000000 0.000000
vt 1.000000 0.375000
vt 1.000000 0.000000
vt 0.875000 0.000000
vt 0.875000 0.375000
vt 1.000000 0.343750
vt 0.875000 0.343750
vt 0.984375 0.000000
vt 0.984375 0.375000
vt 0.890625 0.375000
vt 0.890625 0.000000
vt 0.875000 0.031250
vt 1.000000 0.031250
vn -0.8701 -0.0001 0.4929
vn -0.4929 -0.0034 -0.8701
vn 0.8701 0.0001 -0.4929
vn 0.0018 -1.0000 0.0029
vn -0.0018 1.0000 -0.0029
vn 0.4929 0.0034 0.8701
usemtl Character
s 1
f 1/1/1 2/2/1 3/3/1 4/4/1
f 2/2/2 5/5/2 6/6/2 3/3/2
f 5/5/3 7/7/3 8/8/3 6/6/3
f 8/9/4 4/10/4 3/11/4 6/12/4
f 5/5/5 2/13/5 1/14/5 7/7/5
f 9/15/2 10/16/2 11/17/2 12/18/2
f 13/19/1 14/20/1 15/21/1 16/22/1
f 17/23/6 13/19/6 16/22/6 18/24/6
f 19/25/4 20/26/4 21/27/4 22/28/4
f 23/29/2 24/30/2 22/31/2 21/32/2
f 25/33/1 26/34/1 27/35/1 28/36/1
f 26/34/2 29/37/2 30/38/2 27/35/2
f 29/37/3 31/39/3 32/40/3 30/38/3
f 32/41/4 28/42/4 27/43/4 30/44/4
f 29/37/5 26/45/5 25/46/5 31/39/5
f 33/47/1 23/48/1 21/49/1 20/50/1
f 34/51/3 35/52/3 10/16/3 9/15/3
f 24/30/3 36/53/3 19/54/3 22/31/3
f 37/55/4 38/56/4 39/57/4 40/58/4
f 41/59/5 42/60/5 43/61/5 44/62/5
f 12/18/1 11/17/1 45/63/1 46/64/1
f 36/53/6 33/47/6 20/50/6 19/54/6
f 46/65/6 45/66/6 35/52/6 34/51/6
f 1/67/6 4/68/6 8/8/6 7/7/6
f 25/69/6 28/70/6 32/40/6 31/39/6
f 24/71/5 23/72/5 33/73/5 36/74/5
f 47/75/3 17/23/3 18/24/3 48/76/3
f 14/77/2 47/75/2 48/76/2 15/78/2
f 44/79/6 39/80/6 38/81/6 41/59/6
f 47/75/5 14/82/5 13/83/5 17/23/5
f 41/59/3 38/81/3 37/84/3 42/60/3
f 10/85/4 35/86/4 45/87/4 11/88/4
f 42/60/2 37/84/2 40/89/2 43/90/2
f 18/91/4 16/92/4 15/93/4 48/94/4
f 43/90/1 40/89/1 39/95/1 44/96/1
f 34/97/5 9/98/5 12/99/5 46/100/5
f 49/101/1 50/102/1 51/103/1 52/104/1
f 50/102/2 53/105/2 54/106/2 51/103/2
f 53/105/3 55/107/3 56/108/3 54/106/3
f 56/109/4 52/110/4 51/111/4 54/112/4
f 53/105/5 50/113/5 49/114/5 55/107/5
f 49/115/6 52/116/6 56/108/6 55/107/6
f 57/117/1 58/118/1 59/119/1 60/120/1
f 61/121/3 62/122/3 63/123/3 64/124/3
f 58/118/5 57/117/5 61/125/5 64/126/5
f 57/117/6 60/120/6 62/127/6 61/128/6
f 59/119/2 58/118/2 64/129/2 63/130/2
f 60/120/4 59/119/4 63/131/4 62/132/4

122
mods/stella/nodebox.lua Normal file
View File

@ -0,0 +1,122 @@
function get_nodebox()
local box2 = {}
local box4 = {}
local box6 = {}
local boxg = {}
for i=1,18 do
box2[i] = {}
box4[i] = {}
box6[i] = {}
boxg[i] = {}
end
for i=1,10 do
table.insert(box2[1], {-0.5-0.2*i/3.5, -0.5, -0.6+0.1*i, 0.5, -0.16667, -0.5+0.1*i})
table.insert(box2[4], {-0.5, -0.5, -0.6+0.1*i, 0.5+0.2*i/3.5, -0.16667, -0.5+0.1*i})
table.insert(box2[7], {-0.5-0.2*i/3.5, -0.5, -0.85+0.1*i, 0.5, -0.16667, -0.75+0.1*i})
table.insert(box2[10], {-0.5, -0.5, -0.85+0.1*i, 0.5+0.2*i/3.5, -0.16667, -0.75+0.1*i})
table.insert(box4[1], {-0.5-0.2*i/3.5, -0.5, -0.6+0.1*i, 0.5, 0.16667, -0.5+0.1*i})
table.insert(box4[4], {-0.5, -0.5, -0.6+0.1*i, 0.5+0.2*i/3.5, 0.16667, -0.5+0.1*i})
table.insert(box4[7], {-0.5-0.2*i/3.5, -0.5, -0.85+0.1*i, 0.5, 0.16667, -0.75+0.1*i})
table.insert(box4[10], {-0.5, -0.5, -0.85+0.1*i, 0.5+0.2*i/3.5, 0.16667, -0.75+0.1*i})
table.insert(box6[1], {-0.5-0.2*i/3.5, -0.5, -0.6+0.1*i, 0.5, 0.5, -0.5+0.1*i})
table.insert(box6[4], {-0.5, -0.5, -0.6+0.1*i, 0.5+0.2*i/3.5, 0.5, -0.5+0.1*i})
table.insert(box6[7], {-0.5-0.2*i/3.5, -0.5, -0.85+0.1*i, 0.5, 0.5, -0.75+0.1*i})
table.insert(box6[10], {-0.5, -0.5, -0.85+0.1*i, 0.5+0.2*i/3.5, 0.5, -0.75+0.1*i})
end
for i=1,17 do
table.insert(box2[13], {-0.5-0.2*i/3.5, -0.5, -1.35+0.1*i, 0.5, -0.16667, -1.25+0.1*i})
table.insert(box2[14], {-0.5, -0.5, -1.35+0.1*i, 0.5+0.2*i/3.5, -0.16667, -1.25+0.1*i})
table.insert(box4[13], {-0.5-0.2*i/3.5, -0.5, -1.35+0.1*i, 0.5, 0.16667, -1.25+0.1*i})
table.insert(box4[14], {-0.5, -0.5, -1.35+0.1*i, 0.5+0.2*i/3.5, 0.16667, -1.25+0.1*i})
table.insert(box6[13], {-0.5-0.2*i/3.5, -0.5, -1.35+0.1*i, 0.5, 0.5, -1.25+0.1*i})
table.insert(box6[14], {-0.5, -0.5, -1.35+0.1*i, 0.5+0.2*i/3.5, 0.5, -1.25+0.1*i})
end
table.insert(box2[13], {-0.5-0.2*17.5/3.5, -0.5, -1.3+0.1*17.5, 0.5, -0.16667, -1.25+0.1*17.5})
table.insert(box2[14], {-0.5, -0.5, -1.3+0.1*17.5, 0.5+0.2*17.5/3.5, -0.16667, -1.25+0.1*17.5})
table.insert(box4[13], {-0.5-0.2*17.5/3.5, -0.5, -1.3+0.1*17.5, 0.5, 0.16667, -1.25+0.1*17.5})
table.insert(box4[14], {-0.5, -0.5, -1.3+0.1*17.5, 0.5+0.2*17.5/3.5, 0.16667, -1.25+0.1*17.5})
table.insert(box6[13], {-0.5-0.2*17.5/3.5, -0.5, -1.3+0.1*17.5, 0.5, 0.5, -1.25+0.1*17.5})
table.insert(box6[14], {-0.5, -0.5, -1.3+0.1*17.5, 0.5+0.2*17.5/3.5, 0.5, -1.25+0.1*17.5})
for i=1,18 do
table.insert(boxg[13], {-0.5-0.2*i/3.5, -0.5, -1.45+0.1*i, 0.5, 0.5, -1.35+0.1*i})
table.insert(boxg[14], {-0.5, -0.5, -1.45+0.1*i, 0.5+0.2*i/3.5, 0.5, -1.35+0.1*i})
end
table.insert(boxg[13], {-0.5-0.2*18.5/3.5, -0.5, -1.3+0.1*17.5, 0.5, 0.5, -1.25+0.1*17.5})
table.insert(boxg[14], {-0.5, -0.5, -1.3+0.1*17.5, 0.5+0.2*18.5/3.5, 0.5, -1.25+0.1*17.5})
for i=1,11 do
table.insert(boxg[1], {-0.5-0.2*i/3.5, -0.5, -0.7+0.1*i, 0.5, 0.5, -0.6+0.1*i})
table.insert(boxg[4], {-0.5, -0.5, -0.7+0.1*i, 0.5+0.2*i/3.5, 0.5, -0.6+0.1*i})
table.insert(boxg[7], {-0.5-0.2*i/3.5, -0.5, -0.95+0.1*i, 0.5, 0.5, -0.85+0.1*i})
table.insert(boxg[10], {-0.5, -0.5, -0.95+0.1*i, 0.5+0.2*i/3.5, 0.5, -0.85+0.1*i})
end
for i=1,8 do
table.insert(box2[2], {-0.5-0.2*(i+10)/3.5, -0.5, -0.6+0.1*i, 0.5, -0.16667, -0.5+0.1*i})
table.insert(box2[5], {-0.5, -0.5, -0.6+0.1*i, 0.5+0.2*(i+10)/3.5, -0.16667, -0.5+0.1*i})
table.insert(box2[8], {-0.5-0.2*(i+10)/3.5, -0.5, -0.85+0.1*i, 0.5, -0.16667, -0.75+0.1*i})
table.insert(box2[11], {-0.5, -0.5, -0.85+0.1*i, 0.5+0.2*(i+10)/3.5, -0.16667, -0.75+0.1*i})
table.insert(box4[2], {-0.5-0.2*(i+10)/3.5, -0.5, -0.6+0.1*i, 0.5, 0.16667, -0.5+0.1*i})
table.insert(box4[5], {-0.5, -0.5, -0.6+0.1*i, 0.5+0.2*(i+10)/3.5, 0.16667, -0.5+0.1*i})
table.insert(box4[8], {-0.5-0.2*(i+10)/3.5, -0.5, -0.85+0.1*i, 0.5, 0.16667, -0.75+0.1*i})
table.insert(box4[11], {-0.5, -0.5, -0.85+0.1*i, 0.5+0.2*(i+10)/3.5, 0.16667, -0.75+0.1*i})
table.insert(box6[2], {-0.5-0.2*(i+10)/3.5, -0.5, -0.6+0.1*i, 0.5, 0.5, -0.5+0.1*i})
table.insert(box6[5], {-0.5, -0.5, -0.6+0.1*i, 0.5+0.2*(i+10)/3.5, 0.5, -0.5+0.1*i})
table.insert(box6[8], {-0.5-0.2*(i+10)/3.5, -0.5, -0.85+0.1*i, 0.5, 0.5, -0.75+0.1*i})
table.insert(box6[11], {-0.5, -0.5, -0.85+0.1*i, 0.5+0.2*(i+10)/3.5, 0.5, -0.75+0.1*i})
end
for i=1,9 do
table.insert(boxg[2], {-0.5-0.2*(i+10)/3.5, -0.5, -0.7+0.1*i, 0.5, 0.5, -0.6+0.1*i})
table.insert(boxg[5], {-0.5, -0.5, -0.7+0.1*i, 0.5+0.2*(i+10)/3.5, 0.5, -0.6+0.1*i})
table.insert(boxg[8], {-0.5-0.2*(i+10)/3.5, -0.5, -0.95+0.1*i, 0.5, 0.5, -0.85+0.1*i})
table.insert(boxg[11], {-0.5, -0.5, -0.95+0.1*i, 0.5+0.2*(i+10)/3.5, 0.5, -0.85+0.1*i})
end
for i=6,7 do
table.insert(box2[2], {-0.5-0.2*(i+10)/3.5, -0.5, 1.1-0.1*i, 0.5, -0.16667, 1.0-0.1*i})
table.insert(box2[5], {-0.5, -0.5, 1.1-0.1*i, 0.5+0.2*(i+10)/3.5, -0.16667, 1.0-0.1*i})
table.insert(box2[8], {-0.5-0.2*(i+10)/3.5, -0.5, 0.85-0.1*i, 0.5, -0.16667, 0.75-0.1*i})
table.insert(box2[11], {-0.5, -0.5, 0.85-0.1*i, 0.5+0.2*(i+10)/3.5, -0.16667, 0.75-0.1*i})
table.insert(box4[2], {-0.5-0.2*(i+10)/3.5, -0.5, 1.1-0.1*i, 0.5, 0.16667, 1.0-0.1*i})
table.insert(box4[5], {-0.5, -0.5, 1.1-0.1*i, 0.5+0.2*(i+10)/3.5, 0.16667, 1.0-0.1*i})
table.insert(box4[8], {-0.5-0.2*(i+10)/3.5, -0.5, 0.85-0.1*i, 0.5, 0.16667, 0.75-0.1*i})
table.insert(box4[11], {-0.5, -0.5, 0.85-0.1*i, 0.5+0.2*(i+10)/3.5, 0.16667, 0.75-0.1*i})
table.insert(box6[2], {-0.5-0.2*(i+10)/3.5, -0.5, 1.1-0.1*i, 0.5, 0.5, 1.0-0.1*i})
table.insert(box6[5], {-0.5, -0.5, 1.1-0.1*i, 0.5+0.2*(i+10)/3.5, 0.5, 1.0-0.1*i})
table.insert(box6[8], {-0.5-0.2*(i+10)/3.5, -0.5, 0.85-0.1*i, 0.5, 0.5, 0.75-0.1*i})
table.insert(box6[11], {-0.5, -0.5, 0.85-0.1*i, 0.5+0.2*(i+10)/3.5, 0.5, 0.75-0.1*i})
end
for i=6,8 do
table.insert(boxg[2], {-0.5-0.2*(i+10)/3.5, -0.5, 1.2-0.1*i, 0.5, 0.5, 1.1-0.1*i})
table.insert(boxg[5], {-0.5, -0.5, 1.2-0.1*i, 0.5+0.2*(i+10)/3.5, 0.5, 1.1-0.1*i})
table.insert(boxg[8], {-0.5-0.2*(i+10)/3.5, -0.5, 0.95-0.1*i, 0.5, 0.5, 0.85-0.1*i})
table.insert(boxg[11], {-0.5, -0.5, 0.95-0.1*i, 0.5+0.2*(i+10)/3.5, 0.5, 0.85-0.1*i})
end
for i=1,15 do
table.insert(box2[3], {-0.5-0.2*i/3.5, -0.5, 1.1-0.1*i, 0.5, -0.16667, 1.0-0.1*i})
table.insert(box2[6], {-0.5, -0.5, 1.1-0.1*i, 0.5+0.2*i/3.5, -0.16667, 1.0-0.1*i})
table.insert(box2[9], {-0.5-0.2*i/3.5, -0.5, 0.85-0.1*i, 0.5, -0.16667, 0.75-0.1*i})
table.insert(box2[12], {-0.5, -0.5, 0.85-0.1*i, 0.5+0.2*i/3.5, -0.16667, 0.75-0.1*i})
table.insert(box4[3], {-0.5-0.2*i/3.5, -0.5, 1.1-0.1*i, 0.5, 0.16667, 1.0-0.1*i})
table.insert(box4[6], {-0.5, -0.5, 1.1-0.1*i, 0.5+0.2*i/3.5, 0.16667, 1.0-0.1*i})
table.insert(box4[9], {-0.5-0.2*i/3.5, -0.5, 0.85-0.1*i, 0.5, 0.16667, 0.75-0.1*i})
table.insert(box4[12], {-0.5, -0.5, 0.85-0.1*i, 0.5+0.2*i/3.5, 0.16667, 0.75-0.1*i})
table.insert(box6[3], {-0.5-0.2*i/3.5, -0.5, 1.1-0.1*i, 0.5, 0.5, 1.0-0.1*i})
table.insert(box6[6], {-0.5, -0.5, 1.1-0.1*i, 0.5+0.2*i/3.5, 0.5, 1.0-0.1*i})
table.insert(box6[9], {-0.5-0.2*i/3.5, -0.5, 0.85-0.1*i, 0.5, 0.5, 0.75-0.1*i})
table.insert(box6[12], {-0.5, -0.5, 0.85-0.1*i, 0.5+0.2*i/3.5, 0.5, 0.75-0.1*i})
end
for i=1,16 do
table.insert(boxg[3], {-0.5-0.2*i/3.5, -0.5, 1.2-0.1*i, 0.5, 0.5, 1.1-0.1*i})
table.insert(boxg[6], {-0.5, -0.5, 1.2-0.1*i, 0.5+0.2*i/3.5, 0.5, 1.1-0.1*i})
table.insert(boxg[9], {-0.5-0.2*i/3.5, -0.5, 0.95-0.1*i, 0.5, 0.5, 0.85-0.1*i})
table.insert(boxg[12], {-0.5, -0.5, 0.95-0.1*i, 0.5+0.2*i/3.5, 0.5, 0.85-0.1*i})
end
return {box2,box4,box6,boxg}
end

176
mods/stella/nodes.lua Normal file
View File

@ -0,0 +1,176 @@
minetest.register_node(minetest.get_current_modname()..":ground",{
description = "Ground",
tiles = {"stella_ground.png"},
selection_box = {type = "fixed",fixed = {}--{-0.5, -0.5, -0.5, 0.5, -0.16667, 0.5}
},
})
minetest.register_node("stella:water", {
description = "Water",
drawtype = "liquid",
waving = 3,
tiles = {
{
name = "stella_water.png",
backface_culling = false,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 2.0,
},
},
{
name = "stella_water.png",
backface_culling = true,
animation = {
type = "vertical_frames",
aspect_w = 16,
aspect_h = 16,
length = 2.0,
},
},
},
use_texture_alpha = "blend",
paramtype = "light",
walkable = false,
pointable = false,
diggable = false,
buildable_to = true,
is_ground_content = false,
drop = "",
drowning = 1,
liquidtype = "source",
liquid_viscosity = 1,
post_effect_color = {a = 103, r = 30, g = 60, b = 90},
})
minetest.register_node("stella:timber1", {
description = "Timber lv.1",
drawtype = "mesh",
mesh = "timber1.obj",
tiles = {"stella_character_timber.png"},
paramtype = "light",
paramtype2 = "facedir",
selection_box = {type = "fixed",fixed =
{0, -1.16667, -0.5, 1, 0.83333, 0.5}
},
collision_box = {type = "fixed",fixed =
{}
},
on_punch = function(pos, node, player, pointed_thing)
minetest.show_formspec(player:get_player_name(), "timber1" , stella.timber1get_formspec(player))
end,
})
minetest.register_node("stella:pick_1", {
description = "Pickshop lv.1",
drawtype = "mesh",
mesh = "pick1.obj",
tiles = {"stella_character.png"},
paramtype = "light",
paramtype2 = "facedir",
selection_box = {type = "fixed",fixed =
{0, -1.16667, -0.25, 1, 0.83333, 0.75}
},
collision_box = {type = "fixed",fixed =
{}
},
on_punch = function(pos, node, player, pointed_thing)
minetest.show_formspec(player:get_player_name(), "pick1" , stella.shop1get_formspec(player))
end,
})
minetest.register_node("stella:shop1", {
description = "Shop Nr.1",
drawtype = "mesh",
mesh = "shop1.obj",
tiles = {"stella_character.png"},
paramtype = "light",
paramtype2 = "facedir",
selection_box = {type = "fixed",fixed =
{0, -1.16667, -1, 1, 0.83333, 0}
},
collision_box = {type = "fixed",fixed =
{}
},
on_punch = function(pos, node, player, pointed_thing)
minetest.show_formspec(player:get_player_name(), "shop1" , stella.shop1get_formspec(player))
end,
})
minetest.register_node("stella:smith1", {
description = "Smith lv.1",
drawtype = "mesh",
mesh = "smith1.obj",
tiles = {"stella_character_smith.png"},
paramtype = "light",
paramtype2 = "facedir",
selection_box = {type = "fixed",fixed =
{0, -0.83333, -0.5, 1, 1.16667, 0.5}
},
collision_box = {type = "fixed",fixed =
{}
},
on_punch = function(pos, node, player, pointed_thing)
minetest.show_formspec(player:get_player_name(), "smith1" , stella.smith1get_formspec(player))
end,
})
minetest.register_node(minetest.get_current_modname()..":resource_1",{
description = "Purple Resource",
tiles = {"stella_resource1.png"},
stack_max = 99999,
})
minetest.register_node(minetest.get_current_modname()..":resource_2",{
description = "Gray Resource",
tiles = {"stella_resource2.png"},
stack_max = 99999,
})
minetest.register_node(minetest.get_current_modname()..":resource_3",{
description = "Orange Resource",
tiles = {"stella_resource3.png"},
stack_max = 99999,
})
minetest.register_node(minetest.get_current_modname()..":resource_4",{
description = "Silver Resource",
tiles = {"stella_resource4.png"},
stack_max = 99999,
})
for resource = 1, #stella.resources do
for i=1,stella.resources[resource][6]-1 do
minetest.register_entity("stella:resource_"..stella.resources[resource][1].."_"..i, {
physical = true,
visual_size = {x=10, y=10},
collisionbox = {-0.5,-0.5,-0.5, 0.5,0.5,0.5},
visual = "mesh",
mesh = "resource_"..i..".obj",
textures = {"stella_resource"..stella.resources[resource][1]..".png"},
selectionbox = {0, 0, 0, 0, 0, 0},
hp_max = (stella.resources[resource][4]*stella.resources[resource][5])+1,
})
end
minetest.register_entity("stella:resource_"..stella.resources[resource][1].."_"..stella.resources[resource][6], {
physical = true,
visual_size = {x=10, y=10},
collisionbox = {0, 0, 0, 0, 0, 0},
visual = "mesh",
mesh = "resource_"..stella.resources[resource][6]..".obj",
textures = {"stella_resource"..stella.resources[resource][1]..".png"},
selectionbox = {0, 0, 0, 0, 0, 0},
hp_max = 1,
timer = 0,
on_step = function(self, dtime)
self.timer = self.timer + dtime
if self.timer > stella.resources[resource][7] then
minetest.env:add_entity(self.object:get_pos(),"stella:resource_"..stella.resources[resource][1].."_1")
self.object:remove()
end
end,
})
end

58
mods/stella/on_join.lua Normal file
View File

@ -0,0 +1,58 @@
stella.hud = {}
minetest.register_on_joinplayer(function(player)
player:set_attribute("1.1.1.0", "y")
if player:get_player_name() == "singleplayer" then
else
minetest.kick_player(player:get_player_name(), "you can play stella only as 'singleplayer'")
end
player:hud_set_hotbar_itemcount(3)
player:hud_set_hotbar_image("stella_gui_hotbar.png")
player:hud_set_hotbar_selected_image("stella_gui_hotbar_selected.png")
local formspec = "bgcolor[#080808BB;true]"
.."listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF] "
.. "background9[5,5;1,1;stella_gui_formbg.png;true;10]"
player:set_formspec_prepend(formspec)
player:set_inventory_formspec(stella.invget_formspec(player))
stella.stella_inv:set_size("inv", 40)
stella.hud["1"] = player:hud_add({
hud_elem_type = "waypoint",
number = 0xFFFFFF ,
world_pos = {x=0, y=0, z=0},
precision = 0,
name = "",
})
stella.hud["2"] = player:hud_add({
hud_elem_type = "waypoint",
number = 0xFFFFFF ,
world_pos = {x=0, y=0, z=0},
precision = 0,
name = "",
})
stella.hud["3"] = player:hud_add({
hud_elem_type = "waypoint",
number = 0xFFFFFF ,
world_pos = {x=0, y=0, z=0},
precision = 0,
name = "",
})
stella.hud["4"] = player:hud_add({
hud_elem_type = "waypoint",
number = 0xFFFFFF ,
world_pos = {x=0, y=0, z=0},
precision = 0,
name = "",
})
stella.hud["5"] = player:hud_add({
hud_elem_type = "waypoint",
number = 0xFFFFFF ,
world_pos = {x=0, y=0, z=0},
precision = 0,
name = "",
})
update_tasks(player)
if file_check(minetest.get_worldpath().."/Map_Version.txt") == false then
file = io.open(minetest.get_worldpath().."/Map_Version.txt", "w")
file:write("1")
file:close()
end
end)

16
mods/stella/on_new.lua Normal file
View File

@ -0,0 +1,16 @@
minetest.register_on_newplayer(function(player)
local activ = {{"1.1.1.1",0,0,0,0}}
player:set_attribute("activ_task", minetest.serialize(activ))
player:set_pos({x=0.5, y=2, z=1.25})
local player_inv = player:get_inventory()
player_inv:set_stack("main", 1, "stella:axe1")
player_inv:set_stack("main", 2, "stella:pick1")
set_hexagon("1.1.1.0", player, true)
player:set_attribute("LMB", 0)
local formspec = "bgcolor[#080808BB;true]"
.."listcolors[#00000069;#5A5A5A;#141318;#30434C;#FFF] "
.. "background9[5,5;1,1;stella_gui_formbg.png;true;10]"
player:set_formspec_prepend(formspec)
player:set_inventory_formspec(stella.invget_formspec(player))
minetest.show_formspec(player:get_player_name(), "info1" , stella.info1(player))
end)

View File

@ -0,0 +1,53 @@
minetest.register_on_player_receive_fields(function(player, formname, fields)
local player_inv = player:get_inventory()
local meta = player:get_meta()
if fields.timber1_1 then
local purple = player_inv:get_stack("inv", 1):get_count()
if purple > 2 and player_inv:get_stack("inv", 1):get_name() == "stella:resource_1" then
player_inv:remove_item("inv", "stella:resource_1 3")
stella.stella_inv:remove_item("inv", "stella:resource_1 3")
stella.stella_inv:add_item("t1_from", "stella:resource_1 3")
player_inv:add_item("t1_from", "stella:resource_1 3")
minetest.show_formspec(player:get_player_name(), "timber1" , stella.timber1get_formspec(player))
end
end
if fields.timber1_2 then
local purple = player_inv:get_stack("inv", 1):get_count()
if purple > 2 and player_inv:get_stack("inv", 1):get_name() == "stella:resource_1" then
player_inv:remove_item("inv", "stella:resource_1 "..math.floor(purple/3)*3)
stella.stella_inv:remove_item("inv", "stella:resource_1 "..math.floor(purple/3)*3)
stella.stella_inv:add_item("t1_from", "stella:resource_1 "..math.floor(purple/3)*3)
player_inv:add_item("t1_from", "stella:resource_1 "..math.floor(purple/3)*3)
minetest.show_formspec(player:get_player_name(), "timber1" , stella.timber1get_formspec(player))
end
end
if fields.smith1_1 then
local gray = player_inv:get_stack("inv", 1):get_count()
local gray2 = player_inv:get_stack("inv", 2):get_count()
if (gray > 4 and player_inv:get_stack("inv", 1):get_name() == "stella:resource_2") or (gray2 > 4 and player_inv:get_stack("inv", 2):get_name() == "stella:resource_2") then
player_inv:remove_item("inv", "stella:resource_2 5")
stella.stella_inv:remove_item("inv", "stella:resource_2 5")
stella.stella_inv:add_item("s1_from", "stella:resource_2 5")
player_inv:add_item("s1_from", "stella:resource_2 5")
minetest.show_formspec(player:get_player_name(), "smith1" , stella.smith1get_formspec(player))
end
end
if fields.smith1_2 then
local gray = player_inv:get_stack("inv", 1):get_count()
local gray2 = player_inv:get_stack("inv", 2):get_count()
if gray > 4 and player_inv:get_stack("inv", 1):get_name() == "stella:resource_2" then
player_inv:remove_item("inv", "stella:resource_2 "..math.floor(gray/5)*35)
stella.stella_inv:remove_item("inv", "stella:resource_2 "..math.floor(gray/5)*5)
stella.stella_inv:add_item("s1_from", "stella:resource_2 "..math.floor(gray/5)*5)
player_inv:add_item("s1_from", "stella:resource_2 "..math.floor(gray/5)*5)
minetest.show_formspec(player:get_player_name(), "smith1" , stella.smith1get_formspec(player))
end
if gray2 > 4 and player_inv:get_stack("inv", 2):get_name() == "stella:resource_2" then
player_inv:remove_item("inv", "stella:resource_2 "..math.floor(gray2/5)*5)
stella.stella_inv:remove_item("inv", "stella:resource_2 "..math.floor(gray2/5)*5)
stella.stella_inv:add_item("s1_from", "stella:resource_2 "..math.floor(gray2/5)*5)
player_inv:add_item("s1_from", "stella:resource_2 "..math.floor(gray2/5)*5)
minetest.show_formspec(player:get_player_name(), "smith1" , stella.smith1get_formspec(player))
end
end
end)

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -0,0 +1,79 @@
function set_hexagon(id, player, blocks)
for hexagonsCount = 1, #stella.hexagons do
if stella.hexagons[hexagonsCount][2] == id then
local pos = stella.hexagons[hexagonsCount][3]
local y_pos = 2.5+0.16666666*stella.hexagons[hexagonsCount][5]
local block2 = {
{{x=pos.x-0.21, y=y_pos, z=pos.z}, {x=pos.x-0.21, y=y_pos, z=pos.z-0.5}, {x=pos.x-0.21, y=y_pos, z=pos.z-0.25}, {x=pos.x-0.21, y=y_pos, z=pos.z-0.75}},
{{x=pos.x-0.57, y=y_pos, z=pos.z+0.63}, {x=pos.x-0.57, y=y_pos, z=pos.z+0.13}, {x=pos.x-0.57, y=y_pos, z=pos.z+0.38}, {x=pos.x-0.57, y=y_pos, z=pos.z-0.12}},
{{x=pos.x-0.92, y=y_pos, z=pos.z+1.25}, {x=pos.x-0.92, y=y_pos, z=pos.z+0.75}, {x=pos.x-0.92, y=y_pos, z=pos.z+1}, {x=pos.x-0.92, y=y_pos, z=pos.z+0.5}},
{{x=pos.x-0.57, y=y_pos, z=pos.z+1.87}, {x=pos.x-0.57, y=y_pos, z=pos.z+1.37}, {x=pos.x-0.57, y=y_pos, z=pos.z+1.62}, {x=pos.x-0.57, y=y_pos, z=pos.z+1.12}},
{{x=pos.x-0.21, y=y_pos, z=pos.z+2.5}, {x=pos.x-0.21, y=y_pos, z=pos.z+2.0}, {x=pos.x-0.21, y=y_pos, z=pos.z+2.25}, {x=pos.x-0.21, y=y_pos, z=pos.z+1.75}},
{{x=pos.x+0.5, y=y_pos, z=pos.z+2.5}, {x=pos.x+0.5, y=y_pos, z=pos.z+2.0}, {x=pos.x+0.5, y=y_pos, z=pos.z+2.25}, {x=pos.x+0.5, y=y_pos, z=pos.z+1.75}},
{{x=pos.x+1.21, y=y_pos, z=pos.z+2.5}, {x=pos.x+1.21, y=y_pos, z=pos.z+2.0}, {x=pos.x+1.21, y=y_pos, z=pos.z+2.25}, {x=pos.x+1.21, y=y_pos, z=pos.z+1.75}},
{{x=pos.x+1.57, y=y_pos, z=pos.z+1.87}, {x=pos.x+1.57, y=y_pos, z=pos.z+1.37}, {x=pos.x+1.57, y=y_pos, z=pos.z+1.62}, {x=pos.x+1.57, y=y_pos, z=pos.z+1.12}},
{{x=pos.x+1.92, y=y_pos, z=pos.z+1.25}, {x=pos.x+1.92, y=y_pos, z=pos.z+0.75}, {x=pos.x+1.92, y=y_pos, z=pos.z+1}, {x=pos.x+1.92, y=y_pos, z=pos.z+0.5}},
{{x=pos.x+1.57, y=y_pos, z=pos.z+0.63}, {x=pos.x+1.57, y=y_pos, z=pos.z+0.13}, {x=pos.x+1.57, y=y_pos, z=pos.z+0.38}, {x=pos.x+1.57, y=y_pos, z=pos.z-0.12}},
{{x=pos.x+1.21, y=y_pos, z=pos.z}, {x=pos.x+1.21, y=y_pos, z=pos.z-0.5}, {x=pos.x+1.21, y=y_pos, z=pos.z-0.25}, {x=pos.x+1.21, y=y_pos, z=pos.z-0.75}},
{{x=pos.x+0.5, y=y_pos, z=pos.z}, {x=pos.x+0.5, y=y_pos, z=pos.z-0.5}, {x=pos.x+0.5, y=y_pos, z=pos.z-0.25}, {x=pos.x+0.5, y=y_pos, z=pos.z-0.75}},
{{x=pos.x+0.5, y=y_pos, z=pos.z+1.25}, {x=pos.x+0.5, y=y_pos, z=pos.z+0.75}, {x=pos.x+0.5, y=y_pos, z=pos.z+1}, {x=pos.x+0.5, y=y_pos, z=pos.z+0.5}}
}
local height = stella.hexagons[hexagonsCount][5]
local ground_height = 0
if stella.hexagons[hexagonsCount][5] > 6 then
height = height-6
ground_height = 1
end
if stella.hexagons[hexagonsCount][4] == 1 then
minetest.place_schematic({x=pos.x, y=pos.y+ground_height, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..stella.hexagons[hexagonsCount][6].."_"..height.."_1.mts","90")
minetest.place_schematic({x=pos.x, y=pos.y-1, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..stella.hexagons[hexagonsCount][6].."_g_1.mts","90")
minetest.place_schematic({x=pos.x, y=pos.y-2, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..stella.hexagons[hexagonsCount][6].."_g_1.mts","90")
minetest.place_schematic({x=pos.x, y=pos.y-3, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..stella.hexagons[hexagonsCount][6].."_g_1.mts","90")
if ground_height == 1 then
minetest.place_schematic({x=pos.x, y=pos.y, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..stella.hexagons[hexagonsCount][6].."_6_1.mts","90")
end
elseif stella.hexagons[hexagonsCount][4] == 3 then
minetest.place_schematic({x=pos.x, y=pos.y+ground_height, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..stella.hexagons[hexagonsCount][6].."_"..height.."_2.mts","90")
minetest.place_schematic({x=pos.x, y=pos.y-1, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..stella.hexagons[hexagonsCount][6].."_g_2.mts","90")
minetest.place_schematic({x=pos.x, y=pos.y-2, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..stella.hexagons[hexagonsCount][6].."_g_2.mts","90")
minetest.place_schematic({x=pos.x, y=pos.y-3, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..stella.hexagons[hexagonsCount][6].."_g_2.mts","90")
if ground_height == 1 then
minetest.place_schematic({x=pos.x, y=pos.y, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..stella.hexagons[hexagonsCount][6].."_6_2.mts","90")
end
elseif stella.hexagons[hexagonsCount][4] == 4 then
minetest.place_schematic({x=pos.x, y=pos.y+ground_height, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..stella.hexagons[hexagonsCount][6].."_"..height.."_3.mts","90")
minetest.place_schematic({x=pos.x, y=pos.y-1, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..stella.hexagons[hexagonsCount][6].."_g_3.mts","90")
minetest.place_schematic({x=pos.x, y=pos.y-2, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..stella.hexagons[hexagonsCount][6].."_g_3.mts","90")
minetest.place_schematic({x=pos.x, y=pos.y-3, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..stella.hexagons[hexagonsCount][6].."_g_3.mts","90")
if ground_height == 1 then
minetest.place_schematic({x=pos.x, y=pos.y, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..stella.hexagons[hexagonsCount][6].."_6_3.mts","90")
end
elseif stella.hexagons[hexagonsCount][4] == 2 then
minetest.place_schematic({x=pos.x, y=pos.y+ground_height, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..stella.hexagons[hexagonsCount][6].."_"..height.."_1.mts","270")
minetest.place_schematic({x=pos.x, y=pos.y-1, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..stella.hexagons[hexagonsCount][6].."_g_1.mts","270")
minetest.place_schematic({x=pos.x, y=pos.y-2, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..stella.hexagons[hexagonsCount][6].."_g_1.mts","270")
minetest.place_schematic({x=pos.x, y=pos.y-3, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..stella.hexagons[hexagonsCount][6].."_g_1.mts","270")
if ground_height == 1 then
minetest.place_schematic({x=pos.x, y=pos.y, z=pos.z}, minetest.get_modpath("stella").."/schems/sector_"..stella.hexagons[hexagonsCount][6].."_6_1.mts","270")
end
end
if blocks then
for i = 1, 13 do
if stella.hexagons[hexagonsCount][8][i] then
if stella.hexagons[hexagonsCount][8][i] ~= "" and stella.hexagons[hexagonsCount][8][i] ~= "timber1" and stella.hexagons[hexagonsCount][8][i] ~= "smith1" and stella.hexagons[hexagonsCount][8][i] ~= "pick1" and stella.hexagons[hexagonsCount][8][i] ~= "shop1" then
minetest.env:add_entity(block2[i][stella.hexagons[hexagonsCount][4]],"stella:resource_"..stella.hexagons[hexagonsCount][8][i])
elseif stella.hexagons[hexagonsCount][8][i] == "timber1" then
minetest.set_node({x=pos.x, y=pos.y+1, z=pos.z+1}, {name="stella:timber1"})
elseif stella.hexagons[hexagonsCount][8][i] == "smith1" then
minetest.set_node({x=pos.x, y=pos.y+2, z=pos.z+1}, {name="stella:smith1"})
elseif stella.hexagons[hexagonsCount][8][i] == "pick1" then
minetest.set_node({x=pos.x, y=pos.y+1, z=pos.z+1}, {name="stella:pick_1"})
elseif stella.hexagons[hexagonsCount][8][i] == "shop1" then
minetest.set_node({x=pos.x, y=pos.y+1, z=pos.z+1}, {name="stella:shop1"})
end
end
end
end
end
end
end

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 144 B

9
mods/stella/tools.lua Normal file
View File

@ -0,0 +1,9 @@
minetest.register_craftitem("stella:pick1", {
description = "Pick lv.1\nPower: 1",
inventory_image = "stella_pick1.png",
})
minetest.register_craftitem("stella:axe1", {
description = "Axe lv.1\nPower: 1",
inventory_image = "stella_axe1.png",
})

View File

@ -1,12 +0,0 @@
# Blender MTL File: 'None'
# Material Count: 1
newmtl Material
Ns 96.078431
Ka 1.000000 1.000000 1.000000
Kd 0.640000 0.640000 0.640000
Ks 0.500000 0.500000 0.500000
Ke 0.000000 0.000000 0.000000
Ni 1.000000
d 1.000000
illum 2

View File

@ -0,0 +1,52 @@
function update_tasks(player)
local activ = minetest.deserialize(player:get_attribute("activ_task"))
for activCount = 1, #activ do
for tasksCount = 1, #stella.tasks do
if stella.tasks[tasksCount][1] == activ[activCount][1] then
player:hud_change(stella.hud[""..activCount], 'world_pos', stella.tasks[tasksCount][3])
local name = ""
if stella.tasks[tasksCount][6][3] ~= 0 then
name = activ[activCount][2].."/"..stella.tasks[tasksCount][6][1].." "..stella.tasks[tasksCount][5][1].."\n"..activ[activCount][3].."/"..stella.tasks[tasksCount][6][2].." "..stella.tasks[tasksCount][5][2].."\n"..activ[activCount][4].."/"..stella.tasks[tasksCount][6][3].." "..stella.tasks[tasksCount][5][3]
elseif stella.tasks[tasksCount][6][2] ~= 0 then
name = activ[activCount][2].."/"..stella.tasks[tasksCount][6][1].." "..stella.tasks[tasksCount][5][1].."\n"..activ[activCount][3].."/"..stella.tasks[tasksCount][6][2].." "..stella.tasks[tasksCount][5][2]
elseif stella.tasks[tasksCount][6][1] ~= 0 then
name = activ[activCount][2].."/"..stella.tasks[tasksCount][6][1].." "..stella.tasks[tasksCount][5][1]
else
name = "comming soon"
end
player:hud_change(stella.hud[""..activCount], 'name', name)
if stella.tasks[tasksCount][6][1] ~= 0 and activ[activCount][2] == stella.tasks[tasksCount][6][1] and activ[activCount][3] == stella.tasks[tasksCount][6][2] and activ[activCount][4] == stella.tasks[tasksCount][6][3] and activ[activCount][5] == stella.tasks[tasksCount][6][4] then
player:set_attribute(""..activ[activCount][1], "y")
table.remove(activ, activCount)
set_hexagon(stella.tasks[tasksCount][1],player, true)
for tasksCount2 = 1, #stella.tasks do
if stella.tasks[tasksCount2][2] == stella.tasks[tasksCount][1] then
table.insert(activ,{stella.tasks[tasksCount2][1],0,0,0,0})
end
end
player:set_attribute("activ_task", minetest.serialize(activ))
player:hud_change(stella.hud["1"], 'name', "")
player:hud_change(stella.hud["2"], 'name', "")
player:hud_change(stella.hud["3"], 'name', "")
player:hud_change(stella.hud["4"], 'name', "")
player:hud_change(stella.hud["5"], 'name', "")
if stella.tasks[tasksCount][1] == "1.1.1.1" then
minetest.show_formspec(player:get_player_name(), "info2" , stella.info2(player))
elseif stella.tasks[tasksCount][1] == "1.1.1.3" then
minetest.show_formspec(player:get_player_name(), "info3" , stella.info3(player))
elseif stella.tasks[tasksCount][1] == "1.1.1.5" then
minetest.show_formspec(player:get_player_name(), "info4" , stella.info4(player))
elseif stella.tasks[tasksCount][1] == "1.1.2.7" then
minetest.show_formspec(player:get_player_name(), "info5" , stella.info5(player))
elseif stella.tasks[tasksCount][1] == "1.1.1.7" then
minetest.show_formspec(player:get_player_name(), "info6" , stella.info6(player))
elseif stella.tasks[tasksCount][1] == "1.1.1.11" then
minetest.show_formspec(player:get_player_name(), "info7" , stella.info7(player))
end
update_tasks(player)
return
end
end
end
end
end