From 0fd742760bbf5e9541b55289dec342573e3ad1b6 Mon Sep 17 00:00:00 2001 From: DonBatman Date: Thu, 30 Apr 2015 20:37:51 -0700 Subject: [PATCH] Changed ISP --- ReadMe.txt | 4 +++- crafts.lua | 10 +++++----- isp.lua | 17 +++++++++++++---- router.lua | 12 +++++++++--- textures/mycoins_isp_f_animated.png | Bin 0 -> 481 bytes 5 files changed, 30 insertions(+), 13 deletions(-) create mode 100644 textures/mycoins_isp_f_animated.png diff --git a/ReadMe.txt b/ReadMe.txt index adadba7..7467f35 100644 --- a/ReadMe.txt +++ b/ReadMe.txt @@ -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 diff --git a/crafts.lua b/crafts.lua index 40840da..2ed391b 100644 --- a/crafts.lua +++ b/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", }, }; }); diff --git a/isp.lua b/isp.lua index 5b2a1bd..a7a7ce8 100644 --- a/isp.lua +++ b/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, diff --git a/router.lua b/router.lua index fc8cc43..12dc805 100644 --- a/router.lua +++ b/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 diff --git a/textures/mycoins_isp_f_animated.png b/textures/mycoins_isp_f_animated.png new file mode 100644 index 0000000000000000000000000000000000000000..f3626c8f6a3ee46a36bd97fbc1b1a960470ce25d GIT binary patch literal 481 zcmeAS@N?(olHy`uVBq!ia0vp^3JeU43><7g)}@6dWk8B8$=lt9p@88(LvAlu(GH*p zXMsm#F#`j)FbFd;%$g$s6l5>)^mS#w&&tRoCJ^gAcM{N;JWm(LkcwMxZye-2a2>q5&gV6EMHQTo%(jpbk?(6)_kL(LwaiH=d%}&7@XNxYy3HV=8UQ{ zN&hcwd;8%<<-F&C_hWia?s~mz_x|gpvVYfBzEb|t&vGi%WA=e}K`R=#miQ*@zQ4@( zL4}3iosLQB4$P-7TjercKU=v-NhkcFs5cmk&FPZ4V3pSCH3!%~FxDK%`!Tngk#_}y`Vz((26>R!UIuxA9}IQ}ICGDG zV-hXkwpbY5!2f_5D6~NQ0W%X&jm5&VC*mBKO%8BoLbTL4=pSHbv1{Nja0=e|HiGpI zlb;7j14v&Lqn!fKq6XnvU7-x}3mCD=