diff options
-rw-r--r-- | extranodes/antishroom.lua | 70 | ||||
-rw-r--r-- | extranodes/depends.txt | 1 | ||||
-rw-r--r-- | extranodes/init.lua | 10 | ||||
-rw-r--r-- | extranodes/textures/antishroom.png | bin | 0 -> 333 bytes | |||
-rw-r--r-- | extranodes/textures/antishroom_wield.png | bin | 0 -> 303 bytes | |||
-rw-r--r-- | technic/machines/LV/cnc_nodes.lua | 18 | ||||
-rw-r--r-- | technic/machines/register/extractor_recipes.lua | 5 | ||||
-rw-r--r-- | technic/sounds/technic_spray_painter.ogg | bin | 0 -> 19629 bytes | |||
-rw-r--r-- | technic/textures/technic_paint.png | bin | 0 -> 182 bytes | |||
-rw-r--r-- | technic/textures/technic_paint_palette.png | bin | 0 -> 293 bytes | |||
-rw-r--r-- | technic/textures/technic_spray_painter.png | bin | 0 -> 457 bytes | |||
-rw-r--r-- | technic/tools/init.lua | 2 | ||||
-rw-r--r-- | technic/tools/spray_painter.lua | 190 | ||||
-rw-r--r-- | technic/tools/walking_tractor.lua | 3 |
14 files changed, 288 insertions, 11 deletions
diff --git a/extranodes/antishroom.lua b/extranodes/antishroom.lua new file mode 100644 index 0000000..e3259c1 --- /dev/null +++ b/extranodes/antishroom.lua @@ -0,0 +1,70 @@ +-- a tool to convert a mushroom biome into green forest with thick trees and flowers + +local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end + +minetest.register_craftitem(":technic:antishroom",{ + description = "Mushroom biome converter", + inventory_image = "antishroom.png", + wield_image = "antishroom_wield.png", + on_use = function(itemstack, user, pointed_thing) + + if pointed_thing.type ~= "node" then + return itemstack + end + + local pos = pointed_thing.under + local target = minetest.get_node_or_nil(pos) + + if target and target.name == "ethereal:mushroom_dirt" then + + local start_pos = { + x = pos.x - 10, + z = pos.z - 10, + y = pos.y - 5 + } + + local end_pos = { + x = pos.x + 10, + z = pos.z + 10, + y = pos.y + 15 + } + + local rlist = { + ["ethereal:mushroom_dirt"] = "default:dirt_with_grass", + ["ethereal:mushroom_trunk"] = "default:tree", + ["ethereal:mushroom"] = "default:leaves", + ["ethereal:mushroom_pore"] = "default:apple" + } + + local mlist = {} + for t,r in pairs(rlist) do + table.insert(mlist, t) + end + + local found_mushroom_parts = minetest.find_nodes_in_area(start_pos, end_pos, mlist) + for _, f in ipairs(found_mushroom_parts) do + local node = minetest.get_node(f) + + if not minetest.is_protected(f, user:get_player_name()) then + + minetest.swap_node(f, { name = rlist[node.name] } ) + + if minetest.get_modpath("bonemeal") and node.name == "ethereal:mushroom_dirt" then + if math.random(1,5) > 4 then + bonemeal:on_use(f, 1, nil) + end + end + + end + + end + + itemstack:take_item() + return itemstack + else + return itemstack + end + + + end, +})
\ No newline at end of file diff --git a/extranodes/depends.txt b/extranodes/depends.txt index fa27879..ff994f8 100644 --- a/extranodes/depends.txt +++ b/extranodes/depends.txt @@ -7,3 +7,4 @@ concrete unifieddyes? intllib? moreblocks? +pkarcs? diff --git a/extranodes/init.lua b/extranodes/init.lua index 69cb820..edaa41a 100644 --- a/extranodes/init.lua +++ b/extranodes/init.lua @@ -11,6 +11,10 @@ dofile(path.."/extratubes.lua") dofile(path.."/extramesecons.lua") dofile(path.."/lox.lua") +if minetest.get_modpath("ethereal") and minetest.get_modpath("flowers") then + dofile(path.."/antishroom.lua") +end + if minetest.get_modpath("bakedclay") then -- bring back them sticks minetest.register_craft( { @@ -20,6 +24,12 @@ if minetest.get_modpath("bakedclay") then }) end +-- register procedurally-generated arcs +if minetest.get_modpath("pkarcs") then + pkarcs.register_node("technic:marble") + pkarcs.register_node("technic:granite") +end + if minetest.get_modpath("moreblocks") then -- register stairsplus/circular_saw nodes diff --git a/extranodes/textures/antishroom.png b/extranodes/textures/antishroom.png Binary files differnew file mode 100644 index 0000000..263ccc7 --- /dev/null +++ b/extranodes/textures/antishroom.png diff --git a/extranodes/textures/antishroom_wield.png b/extranodes/textures/antishroom_wield.png Binary files differnew file mode 100644 index 0000000..733f658 --- /dev/null +++ b/extranodes/textures/antishroom_wield.png diff --git a/technic/machines/LV/cnc_nodes.lua b/technic/machines/LV/cnc_nodes.lua index e6c586f..0f40ad5 100644 --- a/technic/machines/LV/cnc_nodes.lua +++ b/technic/machines/LV/cnc_nodes.lua @@ -262,17 +262,6 @@ if minetest.get_modpath("ethereal") then {"glostone.png"}, S("Glo Stone")) -end - - -if minetest.get_modpath("ethereal") then - -- Glostone - ------------ - technic.cnc.register_all("ethereal:glostone", - {cracky=1, not_in_creative_inventory=1, light_source=13}, - {"glostone.png"}, - S("Glo Stone")) - -- Crystal block ---------------- technic.cnc.register_all("ethereal:crystal_block", @@ -389,6 +378,13 @@ if minetest.get_modpath("moreblocks") then end +if minetest.get_modpath("pathv7") then + -- jungle wood already exists (and hence the CNC'd parts would be identical) + technic.cnc.register_all("pathv7:bridgewood", + {snappy=2, choppy=2, oddly_breakable_by_hand=2, not_in_creative_inventory=1}, + {"pathv7_bridgewood.png"}, + S("Bridge Wood")) +end if minetest.get_modpath("maple") then technic.cnc.register_all("maple:maple_wood", diff --git a/technic/machines/register/extractor_recipes.lua b/technic/machines/register/extractor_recipes.lua index 15da6b4..3e82e01 100644 --- a/technic/machines/register/extractor_recipes.lua +++ b/technic/machines/register/extractor_recipes.lua @@ -64,6 +64,11 @@ if minetest.get_modpath("dye") then table.insert(dye_recipes, {"ethereal:crystalgrass", "dye:blue 4"}) end + if minetest.get_modpath("ethereal") and minetest.get_modpath("flowers") then + -- Mushroom biome convertion serum + table.insert(dye_recipes, {"flowers:mushroom_red 3", "technic:antishroom"}) + end + if minetest.get_modpath("bakedclay") then table.insert(dye_recipes, {"bakedclay:delphinium", "dye:cyan 6"}) table.insert(dye_recipes, {"bakedclay:thistle", "dye:magenta 6"}) diff --git a/technic/sounds/technic_spray_painter.ogg b/technic/sounds/technic_spray_painter.ogg Binary files differnew file mode 100644 index 0000000..3541ab9 --- /dev/null +++ b/technic/sounds/technic_spray_painter.ogg diff --git a/technic/textures/technic_paint.png b/technic/textures/technic_paint.png Binary files differnew file mode 100644 index 0000000..b052757 --- /dev/null +++ b/technic/textures/technic_paint.png diff --git a/technic/textures/technic_paint_palette.png b/technic/textures/technic_paint_palette.png Binary files differnew file mode 100644 index 0000000..b4bc32f --- /dev/null +++ b/technic/textures/technic_paint_palette.png diff --git a/technic/textures/technic_spray_painter.png b/technic/textures/technic_spray_painter.png Binary files differnew file mode 100644 index 0000000..99d1f07 --- /dev/null +++ b/technic/textures/technic_spray_painter.png diff --git a/technic/tools/init.lua b/technic/tools/init.lua index db5ac7d..7445dc3 100644 --- a/technic/tools/init.lua +++ b/technic/tools/init.lua @@ -20,6 +20,8 @@ dofile(path.."/lawn_trimmer.lua") dofile(path.."/walking_tractor.lua") dofile(path.."/planter.lua") +dofile(path.."/spray_painter.lua") + if minetest.get_modpath("screwdriver") then -- compatibility alias minetest.register_alias("technic:screwdriver", "screwdriver:screwdriver") diff --git a/technic/tools/spray_painter.lua b/technic/tools/spray_painter.lua new file mode 100644 index 0000000..cea42b4 --- /dev/null +++ b/technic/tools/spray_painter.lua @@ -0,0 +1,190 @@ +-- This is a decorative tool to paint exposed surfaces in some basic colors +-- can be used to cover up unpleasant areas (e.g. cobblestone walls) +-- or to mark areas with colors (colored paths on floors, color lines on walls) +-- Colors are grouped together in 9 modes. The HEX values are taken from the dye +-- textures from dye mod of minetest_game. Within every mode, the colors are cycled from +-- brighter to darker hue on every subsequent application of the tool. + +local S = technic.getter + +local spray_painter_max_charge = 10000 +local spray_painter_cpa = 10 + +local color_modes = { + {name = S("Red"), index = 1, n = 2, ct = {"c91818", "730505"}}, + {name = S("Yellow and Orange"), index = 3, n = 4, ct = {"fcf611", "ffc20b", "e0601a", "b52607"}}, + {name = S("Green and Dark Green"), index = 7, n = 4, ct = {"67eb1c", "4bb71c", "2b7b00", "154f00"}}, + {name = S("Blue and Violet"), index = 11, n = 4, ct = {"00519d", "003376", "480680", "3b0367"}}, + {name = S("Pink and Magenta"), index = 15, n = 4, ct = {"ffa5a5", "ff7272", "d80481", "a90145"}}, + {name = S("Cyan"), index = 19, n = 2, ct = {"00959d", "00676f"}}, + {name = S("Brown"), index = 21, n = 2, ct = {"6c3800", "391a00"}}, + {name = S("White and Grey"), index = 23, n = 4, ct = {"eeeeee", "b8b8b8", "9c9c9c", "5c5c5c"}}, + {name = S("Dark Grey and Black"), index = 27, n = 4, ct = {"494949", "292929", "222222", "1b1b1b"}} -- 2 middle colors are swapped +} + +minetest.register_node ("technic:paint_layer", { + description = S("Paint"), + drawtype = "nodebox", + tiles = {"technic_paint.png"}, + node_box = { + type = "wallmounted", + wall_bottom = {-0.5, -0.5, -0.5, 0.5, -0.499, 0.5}, + wall_top = {-0.5, 0.499, -0.5, 0.5, 0.5, 0.5}, + wall_side = {-0.5, -0.5, -0.5, -0.499, 0.5, 0.5}, + }, + drop = "", + groups = {attached_node = 1, dig_immediate = 2, not_in_creative_inventory = 1}, + paramtype = "light", + paramtype2 = "colorwallmounted", + palette = "technic_paint_palette.png", +}) + + +local function spray_painter_setmode(user, itemstack, meta) + local player_name = user:get_player_name() + + if not meta then + meta = {mode = nil} + end + if not meta.mode then + minetest.chat_send_player(player_name, + S("Use while sneaking to change Spray Painter modes.")) + meta.mode = 0 + end + + meta.mode = meta.mode % 9 + 1 + + minetest.chat_send_player(player_name, + S("Spray Painter: %s"):format(color_modes[meta.mode].name)) + itemstack:set_name("technic:spray_painter_" .. meta.mode); + itemstack:set_metadata(minetest.serialize(meta)) + return itemstack +end + +local function spray_paint(itemstack, user, pointed_thing) + + local meta = minetest.deserialize(itemstack:get_metadata()) + local keys = user:get_player_control() + + if user.get_pos == nil then + -- we are held in a node breaker and it will not work + return itemstack + end + + if not meta or not meta.mode or keys.sneak then + return spray_painter_setmode(user, itemstack, meta) + end + + if not meta or not meta.charge or meta.charge < spray_painter_cpa then + return itemstack + end + + + if pointed_thing.type ~= "node" then + return itemstack + end + + minetest.sound_play("technic_spray_painter", { + pos = pos, + gain = 0.4, + }) + + -- player needs to own both the wall and its surface + if minetest.is_protected(pointed_thing.under, user:get_player_name()) or + minetest.is_protected(pointed_thing.above, user:get_player_name()) then + minetest.record_protection_violation(pointed_thing.under, name) + return itemstack + end + + local target = minetest.get_node_or_nil(pointed_thing.under) + + -- if the tool is pointed at a layer of paint -> cycling colors + + if target and target.name == "technic:paint_layer" then + + local p2 = target.param2 + local orientation = p2 % 8 + local cindex = (p2 - orientation) / 8 + local new_cindex = cindex + 1 + if new_cindex < color_modes[meta.mode].index - 1 then + new_cindex = color_modes[meta.mode].index - 1 + end + if new_cindex > color_modes[meta.mode].index + (color_modes[meta.mode].n - 1) - 1 then + new_cindex = color_modes[meta.mode].index - 1 + end + + minetest.swap_node(pointed_thing.under, { + name = target.name, + param2 = new_cindex*8 + orientation + }) + + if not technic.creative_mode then + meta.charge = meta.charge - spray_painter_cpa + technic.set_RE_wear(itemstack, meta.charge, spray_painter_max_charge) + itemstack:set_metadata(minetest.serialize(meta)) + end + + return itemstack + end + + -- otherwise, spray some paint anew + + target = minetest.get_node_or_nil(pointed_thing.above) + + if not target or target.name ~= "air" then + return itemstack + end + + local diff = vector.subtract(pointed_thing.under, pointed_thing.above) + local wdr = minetest.dir_to_wallmounted(diff) + minetest.swap_node(pointed_thing.above, { + name = "technic:paint_layer", + param2 = (color_modes[meta.mode].index - 1) * 8 + wdr + }) + + if not technic.creative_mode then + meta.charge = meta.charge - spray_painter_cpa + technic.set_RE_wear(itemstack, meta.charge, spray_painter_max_charge) + itemstack:set_metadata(minetest.serialize(meta)) + end + return itemstack + +end + +technic.register_power_tool("technic:spray_painter", spray_painter_max_charge) +minetest.register_tool("technic:spray_painter", { + description = S("Spray Painter"), + inventory_image = "technic_spray_painter.png", + stack_max = 1, + wear_represents = "technic_RE_charge", + on_refill = technic.refill_RE_charge, + on_use = spray_paint, +}) + + +for i = 1, 9 do + technic.register_power_tool("technic:spray_painter_" .. i, spray_painter_max_charge) + minetest.register_tool("technic:spray_painter_" .. i, { + description = S("Spray Painter: %s"):format(color_modes[i].name), + inventory_image = "technic_spray_painter.png^technic_tool_mode" .. i .. ".png", + wield_image = "technic_spray_painter.png", + wear_represents = "technic_RE_charge", + on_refill = technic.refill_RE_charge, + groups = {not_in_creative_inventory = 1}, + on_use = spray_paint, + }) +end + + +-- Provide a crafting recipe +local trigger = minetest.get_modpath("mesecons_button") and "mesecons_button:button_off" + or "default:mese_crystal_fragment" + +minetest.register_craft({ + output = 'technic:spray_painter', + recipe = { + {'pipeworks:tube_1', 'technic:stainless_steel_ingot', 'technic:battery'}, + {'', 'vessels:steel_bottle', trigger}, + {'dye:red', 'dye:green', 'dye:blue'}, + } +})
\ No newline at end of file diff --git a/technic/tools/walking_tractor.lua b/technic/tools/walking_tractor.lua index 2ac61e6..27a8dd3 100644 --- a/technic/tools/walking_tractor.lua +++ b/technic/tools/walking_tractor.lua @@ -57,6 +57,9 @@ local ripe_for_harvest = { -- also doubles as a snow-plough "default:snowblock", "stairs:slab_snowblock", + -- mushrooms + "flowers:mushroom_red", + "flowers:mushroom_brown", } local compatible_soils = { |