From 0ef2e01643c6a5afa12e13d31308e4375db01dc7 Mon Sep 17 00:00:00 2001 From: Der1248 <1248.kontakt@gmail.com> Date: Tue, 21 Dec 2021 05:37:19 +0100 Subject: [PATCH] Stella 0.4.0 upload --- menu/icon.png | Bin 535 -> 4187 bytes mods/stella/functions.lua | 61 ++ mods/stella/global_step.lua | 129 +++ mods/stella/hexagon_nodes.lua | 60 ++ mods/stella/init.lua | 851 ++---------------- mods/stella/inv.lua | 242 +++++ .../models/{resource_2.mtl => pick1.mtl} | 2 +- mods/stella/models/pick1.obj | 256 ++++++ mods/stella/models/resource_4.mtl | 12 - mods/stella/models/resource_5.mtl | 12 - mods/stella/models/resource_6.mtl | 12 - .../models/{resource_3.mtl => shop1.mtl} | 2 +- mods/stella/models/shop1.obj | 256 ++++++ .../stella/models/{timber1.mtl => smith1.mtl} | 0 mods/stella/models/smith1.obj | 256 ++++++ mods/stella/nodebox.lua | 122 +++ mods/stella/nodes.lua | 176 ++++ mods/stella/on_join.lua | 58 ++ mods/stella/on_new.lua | 16 + mods/stella/receive_fields.lua | 53 ++ mods/stella/schems/sector_1_g_1.mts | Bin 160 -> 160 bytes mods/stella/schems/sector_2_2_1.mts | Bin 0 -> 160 bytes mods/stella/schems/sector_2_2_2.mts | Bin 0 -> 163 bytes mods/stella/schems/sector_2_2_3.mts | Bin 0 -> 78 bytes mods/stella/schems/sector_2_4_1.mts | Bin 0 -> 160 bytes mods/stella/schems/sector_2_4_2.mts | Bin 0 -> 163 bytes mods/stella/schems/sector_2_4_3.mts | Bin 0 -> 78 bytes mods/stella/schems/sector_2_6_1.mts | Bin 0 -> 160 bytes mods/stella/schems/sector_2_6_2.mts | Bin 0 -> 163 bytes mods/stella/schems/sector_2_6_3.mts | Bin 0 -> 78 bytes mods/stella/schems/sector_2_g_1.mts | Bin 0 -> 160 bytes mods/stella/schems/sector_2_g_2.mts | Bin 0 -> 163 bytes mods/stella/schems/sector_2_g_3.mts | Bin 0 -> 78 bytes mods/stella/set_hexagon.lua | 79 ++ .../textures/stella_character_chest.png | Bin 0 -> 1609 bytes .../textures/stella_character_smith.png | Bin 0 -> 3221 bytes .../textures/stella_character_timber.png | Bin 0 -> 3176 bytes mods/stella/textures/stella_resource2.png | Bin 0 -> 144 bytes mods/stella/textures/stella_resource4.png | Bin 0 -> 144 bytes mods/stella/textures/stella_sector2.png | Bin 0 -> 144 bytes mods/stella/tools.lua | 9 + mods/stella/untitled.mtl | 12 - mods/stella/update_tasks.lua | 52 ++ 43 files changed, 1884 insertions(+), 844 deletions(-) create mode 100644 mods/stella/functions.lua create mode 100644 mods/stella/global_step.lua create mode 100644 mods/stella/hexagon_nodes.lua create mode 100644 mods/stella/inv.lua rename mods/stella/models/{resource_2.mtl => pick1.mtl} (90%) create mode 100644 mods/stella/models/pick1.obj delete mode 100644 mods/stella/models/resource_4.mtl delete mode 100644 mods/stella/models/resource_5.mtl delete mode 100644 mods/stella/models/resource_6.mtl rename mods/stella/models/{resource_3.mtl => shop1.mtl} (90%) create mode 100644 mods/stella/models/shop1.obj rename mods/stella/models/{timber1.mtl => smith1.mtl} (100%) create mode 100644 mods/stella/models/smith1.obj create mode 100644 mods/stella/nodebox.lua create mode 100644 mods/stella/nodes.lua create mode 100644 mods/stella/on_join.lua create mode 100644 mods/stella/on_new.lua create mode 100644 mods/stella/receive_fields.lua create mode 100644 mods/stella/schems/sector_2_2_1.mts create mode 100644 mods/stella/schems/sector_2_2_2.mts create mode 100644 mods/stella/schems/sector_2_2_3.mts create mode 100644 mods/stella/schems/sector_2_4_1.mts create mode 100644 mods/stella/schems/sector_2_4_2.mts create mode 100644 mods/stella/schems/sector_2_4_3.mts create mode 100644 mods/stella/schems/sector_2_6_1.mts create mode 100644 mods/stella/schems/sector_2_6_2.mts create mode 100644 mods/stella/schems/sector_2_6_3.mts create mode 100644 mods/stella/schems/sector_2_g_1.mts create mode 100644 mods/stella/schems/sector_2_g_2.mts create mode 100644 mods/stella/schems/sector_2_g_3.mts create mode 100644 mods/stella/set_hexagon.lua create mode 100644 mods/stella/textures/stella_character_chest.png create mode 100644 mods/stella/textures/stella_character_smith.png create mode 100644 mods/stella/textures/stella_character_timber.png create mode 100644 mods/stella/textures/stella_resource2.png create mode 100644 mods/stella/textures/stella_resource4.png create mode 100644 mods/stella/textures/stella_sector2.png create mode 100644 mods/stella/tools.lua delete mode 100644 mods/stella/untitled.mtl create mode 100644 mods/stella/update_tasks.lua diff --git a/menu/icon.png b/menu/icon.png index 3ff7b2e19fd4cc2e8800eb31b34450a8c071f323..ea095f6ecdf8590ac90e84638e14c69c0bea9d6d 100644 GIT binary patch literal 4187 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 literal 535 zcmV+y0_gpTP)uJ12Um&sDYVccSO|ikonWJtmVOpXJ8c9TQM48m#P+^`jfispAa~j1k~h0qi;aQQ z-ZaC^^A0obJkJD6d*DR{eb+=|BR{q6>(~PqhAO4RrqbM7j{^jF=ylag>xV@w!A8~u zCL@Na{`B~4Hi#aiO_(!W1B1>3v3 zYx&Phe>NOm&IDm_<9Y?fa=YU^U-F-U%}xhQCzG|p-es{69(hw0rV4Q-D2PU&V^1Nj z;#5x}HE}9vN*Y?2+D)&3^LQj^+Di9pLB(3)JK4T65@WPb+R17>z|-!>YC4{4XiC!h zh+?dj*UnN^Rhf*Z5~+=>sj4b*yzt8X5dQt;i4PT=`=h0;t#6?;Gg_T-Lrd;=O|$0# Z{sP7jty!k$W2^uG002ovPDHLkV1iik?YaN} diff --git a/mods/stella/functions.lua b/mods/stella/functions.lua new file mode 100644 index 0000000..c8369b8 --- /dev/null +++ b/mods/stella/functions.lua @@ -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 \ No newline at end of file diff --git a/mods/stella/global_step.lua b/mods/stella/global_step.lua new file mode 100644 index 0000000..acd0e21 --- /dev/null +++ b/mods/stella/global_step.lua @@ -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) \ No newline at end of file diff --git a/mods/stella/hexagon_nodes.lua b/mods/stella/hexagon_nodes.lua new file mode 100644 index 0000000..84943f8 --- /dev/null +++ b/mods/stella/hexagon_nodes.lua @@ -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 \ No newline at end of file diff --git a/mods/stella/init.lua b/mods/stella/init.lua index 13634d2..11fb375 100644 --- a/mods/stella/init.lua +++ b/mods/stella/init.lua @@ -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") diff --git a/mods/stella/inv.lua b/mods/stella/inv.lua new file mode 100644 index 0000000..b94e3ce --- /dev/null +++ b/mods/stella/inv.lua @@ -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 \ No newline at end of file diff --git a/mods/stella/models/resource_2.mtl b/mods/stella/models/pick1.mtl similarity index 90% rename from mods/stella/models/resource_2.mtl rename to mods/stella/models/pick1.mtl index 50e3cd9..6e7ae6a 100644 --- a/mods/stella/models/resource_2.mtl +++ b/mods/stella/models/pick1.mtl @@ -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 diff --git a/mods/stella/models/pick1.obj b/mods/stella/models/pick1.obj new file mode 100644 index 0000000..28f4e5f --- /dev/null +++ b/mods/stella/models/pick1.obj @@ -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 diff --git a/mods/stella/models/resource_4.mtl b/mods/stella/models/resource_4.mtl deleted file mode 100644 index 50e3cd9..0000000 --- a/mods/stella/models/resource_4.mtl +++ /dev/null @@ -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 diff --git a/mods/stella/models/resource_5.mtl b/mods/stella/models/resource_5.mtl deleted file mode 100644 index 50e3cd9..0000000 --- a/mods/stella/models/resource_5.mtl +++ /dev/null @@ -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 diff --git a/mods/stella/models/resource_6.mtl b/mods/stella/models/resource_6.mtl deleted file mode 100644 index 50e3cd9..0000000 --- a/mods/stella/models/resource_6.mtl +++ /dev/null @@ -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 diff --git a/mods/stella/models/resource_3.mtl b/mods/stella/models/shop1.mtl similarity index 90% rename from mods/stella/models/resource_3.mtl rename to mods/stella/models/shop1.mtl index 50e3cd9..d9424d0 100644 --- a/mods/stella/models/resource_3.mtl +++ b/mods/stella/models/shop1.mtl @@ -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 diff --git a/mods/stella/models/shop1.obj b/mods/stella/models/shop1.obj new file mode 100644 index 0000000..1ae182e --- /dev/null +++ b/mods/stella/models/shop1.obj @@ -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 diff --git a/mods/stella/models/timber1.mtl b/mods/stella/models/smith1.mtl similarity index 100% rename from mods/stella/models/timber1.mtl rename to mods/stella/models/smith1.mtl diff --git a/mods/stella/models/smith1.obj b/mods/stella/models/smith1.obj new file mode 100644 index 0000000..68229aa --- /dev/null +++ b/mods/stella/models/smith1.obj @@ -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 diff --git a/mods/stella/nodebox.lua b/mods/stella/nodebox.lua new file mode 100644 index 0000000..7db7150 --- /dev/null +++ b/mods/stella/nodebox.lua @@ -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 \ No newline at end of file diff --git a/mods/stella/nodes.lua b/mods/stella/nodes.lua new file mode 100644 index 0000000..8e5a583 --- /dev/null +++ b/mods/stella/nodes.lua @@ -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 + diff --git a/mods/stella/on_join.lua b/mods/stella/on_join.lua new file mode 100644 index 0000000..c234d8c --- /dev/null +++ b/mods/stella/on_join.lua @@ -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) \ No newline at end of file diff --git a/mods/stella/on_new.lua b/mods/stella/on_new.lua new file mode 100644 index 0000000..03f2c4d --- /dev/null +++ b/mods/stella/on_new.lua @@ -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) \ No newline at end of file diff --git a/mods/stella/receive_fields.lua b/mods/stella/receive_fields.lua new file mode 100644 index 0000000..b7836dd --- /dev/null +++ b/mods/stella/receive_fields.lua @@ -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) \ No newline at end of file diff --git a/mods/stella/schems/sector_1_g_1.mts b/mods/stella/schems/sector_1_g_1.mts index 9e0c6c2ff39dc8b0813ac6269f92902f4f4a8aaf..dff43d7132538bdfb5c31cad422e2d51e503e5ea 100644 GIT binary patch delta 61 zcmZ3$xPX!0Hze4XfrWvYfsui!o`G#*y!u2hk%>wojAj$P)ul`-<|HR1B%~xHC8Q-J RCah&=PBUO&knLoa0RX!}4=n%y delta 61 zcmZ3$xPX!0Hze4XfrWvIfsui^o`G$mxjLiCL}m4fMIsZGM5N3r<|HR1B%~xHC8Q-J RCah&=W;0-5ko98b0syaW4paaD diff --git a/mods/stella/schems/sector_2_2_1.mts b/mods/stella/schems/sector_2_2_1.mts new file mode 100644 index 0000000000000000000000000000000000000000..f73960577f2be484b565d4e247d466fb8a2b8574 GIT binary patch literal 160 zcmeYb3HD`RVPIxpWMHaiU}F#}E=kSFNwiAJ$xqIXHv&RqEMi7j#0;^BnPCw##Uf@> dF()}8At5CpDIqN(F<~t`bD9AIgKQ_W3;?u7FzNsR literal 0 HcmV?d00001 diff --git a/mods/stella/schems/sector_2_2_2.mts b/mods/stella/schems/sector_2_2_2.mts new file mode 100644 index 0000000000000000000000000000000000000000..03af4c62403e45b56a2ff1046dd900ef835e4bcb GIT binary patch literal 163 zcmeYb3HD`RVPIxpWMHaiU}F#}E=kSFNwiAJ$xqIXHv&RSEMgW|#LO9lG4vW5VG}gO gCTLJGCpjS@AtfOxAuS;>VJ$mzngIiYY$vk}06l6kh5!Hn literal 0 HcmV?d00001 diff --git a/mods/stella/schems/sector_2_2_3.mts b/mods/stella/schems/sector_2_2_3.mts new file mode 100644 index 0000000000000000000000000000000000000000..edf017a35ce41038c10b483dceb09ea6e46f859e GIT binary patch literal 78 zcmeYb3HD`RVPIllWMHZXQo_Y0sW~}`R!KSe$=UHnKxk-!P0+YvPI5v*0*g~yl|n*F MS_&HjuL2W0028Pc7ytkO literal 0 HcmV?d00001 diff --git a/mods/stella/schems/sector_2_4_1.mts b/mods/stella/schems/sector_2_4_1.mts new file mode 100644 index 0000000000000000000000000000000000000000..9d45ea23aad3fcdb09b6d95f712865d7603f4a80 GIT binary patch literal 160 zcmeYb3HD`RVPIxpWMHaiU}F#}E=kSFNwiAJ$xqIXH;OljH^w4nghk8{iEvNNX{Ffhn=GRpt}x9%|Z literal 0 HcmV?d00001 diff --git a/mods/stella/schems/sector_2_4_2.mts b/mods/stella/schems/sector_2_4_2.mts new file mode 100644 index 0000000000000000000000000000000000000000..72985578d7e745362c7d9f6981bcdd69b1155764 GIT binary patch literal 163 zcmeYb3HD`RVPIxpWMHaiU}F#}E=kSFNwiAJ$xqIXH;Oljx5Of5fkn)mK^Q}?p%FGg iLu`Tu6?2jk5)x7pk`mGq5);<4Gp89aFvxZ?%K!jDFfoz< literal 0 HcmV?d00001 diff --git a/mods/stella/schems/sector_2_4_3.mts b/mods/stella/schems/sector_2_4_3.mts new file mode 100644 index 0000000000000000000000000000000000000000..9506008909515974c25e455b87bd1d57c4a3579b GIT binary patch literal 78 zcmeYb3HD`RVPIllWMHZXQo_Y0sW~}`R!KSe$=UHn@h0(xCfEdxE9N98BqXpnwN)u3 Oq@<;=G4Ludu>$}UHWeHI literal 0 HcmV?d00001 diff --git a/mods/stella/schems/sector_2_6_1.mts b/mods/stella/schems/sector_2_6_1.mts new file mode 100644 index 0000000000000000000000000000000000000000..50e62a7165c31390e4256432dbef5f24f50e1a68 GIT binary patch literal 160 zcmeYb3HD`RVPIxpWMHaiU}F#}E=kSFNwiAJ$xqIXH;OllH^w4nghk8{iEvNNX{Ffhn=GRpt}yOuEm literal 0 HcmV?d00001 diff --git a/mods/stella/schems/sector_2_6_2.mts b/mods/stella/schems/sector_2_6_2.mts new file mode 100644 index 0000000000000000000000000000000000000000..aa868e97dde29143ce8513e6bf3eafba6c81e4c8 GIT binary patch literal 163 zcmeYb3HD`RVPIxpWMHaiU}F#}E=kSFNwiAJ$xqIXH;Ollx5Of5fkn)mK^Q}?p%FGg iLu`Tu6?2jk5)x7pk`mGq5);<4Gp89aFvxZ?%K!jG_A#CS literal 0 HcmV?d00001 diff --git a/mods/stella/schems/sector_2_6_3.mts b/mods/stella/schems/sector_2_6_3.mts new file mode 100644 index 0000000000000000000000000000000000000000..71e9772adcbccf21e2ed0561ad23384655592414 GIT binary patch literal 78 zcmeYb3HD`RVPIllWMHZXQo_Y0sW~}`R!KSe$=UHn@n-RcCfEdxE9N98BqXpnwN)u3 Oq@<;=G4Ludu>$}U#1$X_ literal 0 HcmV?d00001 diff --git a/mods/stella/schems/sector_2_g_1.mts b/mods/stella/schems/sector_2_g_1.mts new file mode 100644 index 0000000000000000000000000000000000000000..a0aad187734fdce76ab63be6331ae126cb6faf2d GIT binary patch literal 160 zcmeYb3HD`RVPIxpWMHaiU}F#}E=kSFNwiAJ$xqIXH;PY>H^w4nghk8{iEvNNX{Ffhn=GRpt}6*)2} literal 0 HcmV?d00001 diff --git a/mods/stella/schems/sector_2_g_2.mts b/mods/stella/schems/sector_2_g_2.mts new file mode 100644 index 0000000000000000000000000000000000000000..ff7d38204ed793916c09ae439413f114d56012b1 GIT binary patch literal 163 zcmeYb3HD`RVPIxpWMHaiU}F#}E=kSFNwiAJ$xqIXH;PY>x5Of5fkn)mK^Q}?p%FGg iLu`Tu6?2jk5)x7pk`mGq5);<4Gp89aFvxZ?%K!kOX)?qB literal 0 HcmV?d00001 diff --git a/mods/stella/schems/sector_2_g_3.mts b/mods/stella/schems/sector_2_g_3.mts new file mode 100644 index 0000000000000000000000000000000000000000..467e42c82f757084c6442f53a85c09e9dc1ab98b GIT binary patch literal 78 zcmeYb3HD`RVPIllWMHZXQo_Y0sW~}`R!KSe$=UHn@#*n~CfEdxE9N98BqXpnwN)u3 Oq@<;=G4Ludu>$}iTNQ!; literal 0 HcmV?d00001 diff --git a/mods/stella/set_hexagon.lua b/mods/stella/set_hexagon.lua new file mode 100644 index 0000000..b20e0c6 --- /dev/null +++ b/mods/stella/set_hexagon.lua @@ -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 \ No newline at end of file diff --git a/mods/stella/textures/stella_character_chest.png b/mods/stella/textures/stella_character_chest.png new file mode 100644 index 0000000000000000000000000000000000000000..77d9e31add717a54787d222b2462a662aa06556e GIT binary patch literal 1609 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 O0000SILSRYU!gQu&X%Q~loCIA!ABXj@& literal 0 HcmV?d00001 diff --git a/mods/stella/textures/stella_resource4.png b/mods/stella/textures/stella_resource4.png new file mode 100644 index 0000000000000000000000000000000000000000..85a7e26851568521c6da98a72828adb997c48891 GIT binary patch literal 144 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP#kBGRm{MyF4LqH)}PZ!4!i_^(-Zhv}h&&=A;+2~}D ibzlYKVm2NzW`=85nXRG?TFQV589ZJ6T-G@yGywo+hb6@T literal 0 HcmV?d00001 diff --git a/mods/stella/textures/stella_sector2.png b/mods/stella/textures/stella_sector2.png new file mode 100644 index 0000000000000000000000000000000000000000..06a4f748e18f2c3aefbb57b9d972e47d10268983 GIT binary patch literal 144 zcmeAS@N?(olHy`uVBq!ia0vp^0wB!61|;P_|4#%`Y)RhkE)4%caKYZ?lYt_f1s;*b z3=G`DAk4@xYmNj^kiEpy*OmP#kFcPT?7YcG_<%yPo-U3d7N?VKg6932-^g^}h=Zbp iX~LC;KxVdXMusOlnfCwtejy5|kipZ{&t;ucLK6UHxF=Kq literal 0 HcmV?d00001 diff --git a/mods/stella/tools.lua b/mods/stella/tools.lua new file mode 100644 index 0000000..580c78a --- /dev/null +++ b/mods/stella/tools.lua @@ -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", +}) \ No newline at end of file diff --git a/mods/stella/untitled.mtl b/mods/stella/untitled.mtl deleted file mode 100644 index 379df14..0000000 --- a/mods/stella/untitled.mtl +++ /dev/null @@ -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 diff --git a/mods/stella/update_tasks.lua b/mods/stella/update_tasks.lua new file mode 100644 index 0000000..93f8bc5 --- /dev/null +++ b/mods/stella/update_tasks.lua @@ -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 \ No newline at end of file