Changed ISP
parent
d359c7ed1a
commit
0fd742760b
|
@ -34,6 +34,8 @@ of Minetest, improved code and added more visual feedback.
|
|||
player now must punch computer to reboot and mine coins again. MilesDyson
|
||||
04/28/15 added router that can turn on and off, computers now require a router to be within 30 node radius
|
||||
in order to mine bitcoins.
|
||||
04/29/15 added forspec to router to show network information..
|
||||
04/29/15 added form spec to router to show network information..
|
||||
04/30/15 made a few items into nodes to place as deco.. added isp box for router to work..
|
||||
plan to add a pay system for internet. animated the isp box like the router.
|
||||
|
||||
Enjoy!! :D
|
||||
|
|
10
crafts.lua
10
crafts.lua
|
@ -411,7 +411,7 @@ minetest.register_craft({
|
|||
recipe = {
|
||||
{ "default:steel_ingot", "homedecor:ic", "default:steel_ingot", },
|
||||
{ "homedecor:ic", "default:mese", "homedecor:ic", },
|
||||
{ "homedecor:plastic_sheet", "homedecor:plastic_sheet", "homedecor:plastic_sheet", },
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
||||
};
|
||||
});
|
||||
|
||||
|
@ -419,7 +419,7 @@ minetest.register_craft({
|
|||
-- copper wire
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mycoins:copper_ribbonwire 12";
|
||||
output = "mycoins:copper_ribbonwire 9";
|
||||
recipe = {
|
||||
{ "default:copper_ingot", "default:copper_ingot", "default:copper_ingot", },
|
||||
};
|
||||
|
@ -430,7 +430,7 @@ minetest.register_craft({
|
|||
recipe = {
|
||||
{ "dye:red", "dye:green", "dye:yellow", },
|
||||
{ "mycoins:copper_ribbonwire", "mycoins:copper_ribbonwire", "mycoins:copper_ribbonwire", },
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
||||
{ "dye:blue", "homedecor:plastic_sheeting", "dye:violet", },
|
||||
};
|
||||
});
|
||||
|
||||
|
@ -439,8 +439,8 @@ minetest.register_craft({
|
|||
minetest.register_craft({
|
||||
output = "mycoins:isp";
|
||||
recipe = {
|
||||
{ "default:gold_ingot", "mycoins:bitcoin", "default:silver_ingot", },
|
||||
{ "mycoins:ribbonwire", "default:steelblock", "mycoins:ribbonwire", },
|
||||
{ "mycoins:copper_ribbonwire", "homedecor:ic", "default:clay_lump", },
|
||||
{ "mycoins:ribbonwire", "homedecor:ic", "mycoins:ribbonwire", },
|
||||
{ "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", "homedecor:plastic_sheeting", },
|
||||
};
|
||||
});
|
||||
|
|
17
isp.lua
17
isp.lua
|
@ -9,10 +9,20 @@ function default.isp_off_formspec(pos)
|
|||
return formspec
|
||||
end
|
||||
|
||||
function default.isp_on_formspec(pos)
|
||||
function default.isp_on_formspec(pos)
|
||||
local active_computers = minetest.find_nodes_in_area({x=pos.x-30, y=pos.y-30, z=pos.z-30}, {x=pos.x+30, y=pos.y+30, z=pos.z+30}, {"mycoins:home_computer_active","mycoins:game_computer_active","mycoins:alien_computer_active"})
|
||||
local inactive_computers = minetest.find_nodes_in_area({x=pos.x-30, y=pos.y-30, z=pos.z-30}, {x=pos.x+30, y=pos.y+30, z=pos.z+30}, {"mycoins:home_computer","mycoins:game_computer","mycoins:alien_computer"})
|
||||
local active_routers = minetest.find_nodes_in_area({x=pos.x-30, y=pos.y-30, z=pos.z-30}, {x=pos.x+30, y=pos.y+30, z=pos.z+30}, {"mycoins:router_on"})
|
||||
local inactive_routers = minetest.find_nodes_in_area({x=pos.x-30, y=pos.y-30, z=pos.z-30}, {x=pos.x+30, y=pos.y+30, z=pos.z+30}, {"mycoins:router"})
|
||||
local spos = pos.x .. "," .. pos.y .. "," ..pos.z
|
||||
local formspec = "size[10,10]"..
|
||||
"label[2,2;Powered On...]"..
|
||||
"label[1,0;Powered On...]"..
|
||||
"label[2,0.6;Computers:]"..
|
||||
"label[2,0.8;Active: "..#active_computers.."]"..
|
||||
"label[2,1;Inactive: "..#inactive_computers.."]"..
|
||||
"label[4,0.6;Routers:]"..
|
||||
"label[4,0.8;Active: "..#active_routers.."]"..
|
||||
"label[4,1;Inactive: "..#inactive_routers.."]"..
|
||||
"label[1,2.6;Payment:]"..
|
||||
"list[nodemeta:".. spos .. ";main;1,3;1,1;]"..
|
||||
"list[current_player;main;1,6;8,4;]"..
|
||||
|
@ -85,8 +95,7 @@ minetest.register_node("mycoins:isp_on", {
|
|||
"mycoins_isp_rt.png",
|
||||
"mycoins_isp_lt.png",
|
||||
"mycoins_isp_bk.png",
|
||||
"mycoins_isp_ft.png"
|
||||
},
|
||||
{name="mycoins_isp_f_animated.png", animation={type="vertical_frames", aspect_w=32, aspect_h=32, length=1.0}},}, --"mycoins_isp_f.png"},
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
walkable = false,
|
||||
|
|
12
router.lua
12
router.lua
|
@ -8,11 +8,17 @@ end
|
|||
function default.router_formspec(pos)
|
||||
local active_computers = minetest.find_nodes_in_area({x=pos.x-30, y=pos.y-30, z=pos.z-30}, {x=pos.x+30, y=pos.y+30, z=pos.z+30}, {"mycoins:home_computer_active","mycoins:game_computer_active","mycoins:alien_computer_active"})
|
||||
local inactive_computers = minetest.find_nodes_in_area({x=pos.x-30, y=pos.y-30, z=pos.z-30}, {x=pos.x+30, y=pos.y+30, z=pos.z+30}, {"mycoins:home_computer","mycoins:game_computer","mycoins:alien_computer"})
|
||||
local active_isp = minetest.find_nodes_in_area({x=pos.x-30, y=pos.y-30, z=pos.z-30}, {x=pos.x+30, y=pos.y+30, z=pos.z+30}, {"mycoins:isp_on"})
|
||||
local inactive_isp = minetest.find_nodes_in_area({x=pos.x-30, y=pos.y-30, z=pos.z-30}, {x=pos.x+30, y=pos.y+30, z=pos.z+30}, {"mycoins:isp"})
|
||||
local spos = pos.x .. "," .. pos.y .. "," ..pos.z
|
||||
local formspec = "size[10,10]"..
|
||||
"label[2,2;Powered On...]"..
|
||||
"label[2,2.5;Active: "..#active_computers.."]"..
|
||||
"label[2,2.8;Inactive: "..#inactive_computers.."]"..
|
||||
"label[1,0;Powered On...]"..
|
||||
"label[2,0.6;Computers:]"..
|
||||
"label[2,0.8;Active: "..#active_computers.."]"..
|
||||
"label[2,1;Inactive: "..#inactive_computers.."]"..
|
||||
"label[4,0.6;ISP:]"..
|
||||
"label[4,0.8;Active: "..#active_isp.."]"..
|
||||
"label[4,1;Inactive: "..#inactive_isp.."]"..
|
||||
"button_exit[4,7;2,1;exit;Exit]"
|
||||
return formspec
|
||||
end
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 481 B |
Loading…
Reference in New Issue