diff options
author | root <root@linuxworks.belug.de> | 2018-04-02 10:26:01 +0200 |
---|---|---|
committer | root <root@linuxworks.belug.de> | 2018-04-02 10:26:01 +0200 |
commit | af8767dd8631a3774988305b01315a772e72fce4 (patch) | |
tree | c0dbdc47580617d25f97e9413ed9c3c542c209e9 | |
parent | 44e544f507a8eea038cda3d64994b4aaa144f669 (diff) | |
parent | 083c0a0befee5a770d9c8724cedaa770939be040 (diff) |
Merge https://github.com/h-v-smacker/technic
16 files changed, 285 insertions, 123 deletions
diff --git a/extranodes/aspirin.lua b/extranodes/aspirin.lua new file mode 100644 index 0000000..a9ddad8 --- /dev/null +++ b/extranodes/aspirin.lua @@ -0,0 +1,41 @@ +-- aspirin + +-- makes any sence only when there is hunger as a separate status of the player +-- also it uses willow twigs - ethereal dependency +-- A bottle of aspirin pills heals the player immediately. + +local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end + +if minetest.get_modpath("hunger") and minetest.get_modpath("ethereal") then + + minetest.register_craftitem(":technic:aspirin_pill", { + description = S("Aspirin pill"), + inventory_image = "technic_aspirin_pill.png", + on_use = function(itemstack, user, pointed_thing) + user:set_hp(user:get_hp() + 2) + itemstack:take_item() + return itemstack + end + }) + + minetest.register_craftitem(":technic:aspirin_bottle", { + description = S("Aspirin pills"), + inventory_image = "technic_aspirin_bottle.png", + on_use = function(itemstack, user, pointed_thing) + user:set_hp(20) + itemstack:take_item() + return itemstack + end + }) + + minetest.register_craft({ + type = "shapeless", + output = "technic:aspirin_bottle", + recipe = {"technic:aspirin_pill", "technic:aspirin_pill", + "technic:aspirin_pill", "technic:aspirin_pill", + "technic:aspirin_pill", "technic:aspirin_pill", + "technic:aspirin_pill", "vessels:glass_bottle"} + }) + +end + diff --git a/extranodes/depends.txt b/extranodes/depends.txt index 15b9ef5..2ded643 100644 --- a/extranodes/depends.txt +++ b/extranodes/depends.txt @@ -1,4 +1,6 @@ default +technic? +pipeworks? technic_worldgen concrete unifieddyes? diff --git a/extranodes/extratubes.lua b/extranodes/extratubes.lua new file mode 100644 index 0000000..67be208 --- /dev/null +++ b/extranodes/extratubes.lua @@ -0,0 +1,139 @@ +-- EXTRATUBES +-- This files add some new tube types, to widen the pipeworks mod assortment of +-- available parts in order to better meet the needs of expansive automation +local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end + +if minetest.get_modpath("pipeworks") then + + -- straight-only pipe + -- does not connect side-wise, allows items in both directions + -- a counterpart to straight-only pipe, and a cheap alternative + -- to one-way tube for long segments of parallel pipes + + minetest.register_node(":pipeworks:straight_tube", { + description = S("Straight-only Tube"), + tiles = {"pipeworks_straight_tube_side.png", + "pipeworks_straight_tube_side.png", + "pipeworks_straight_tube_output.png", + "pipeworks_straight_tube_input.png", + "pipeworks_straight_tube_side.png", + "pipeworks_straight_tube_side.png"}, + paramtype2 = "facedir", + drawtype = "nodebox", + paramtype = "light", + node_box = {type = "fixed", + fixed = {{-1/2, -9/64, -9/64, 1/2, 9/64, 9/64}}}, + groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1}, + sounds = default.node_sound_wood_defaults(), + tube = { + connect_sides = {left = 1, right = 1}, + can_go = function(pos, node, velocity, stack) + return {velocity} + end, + can_insert = function(pos, node, stack, direction) + local dir = pipeworks.facedir_to_right_dir(node.param2) + local opdir = vector.multiply(dir, -1) + return vector.equals(dir, direction) or vector.equals(opdir, direction) + end, + priority = 60 -- Higher than normal tubes, but lower than one-way tubes + }, + after_place_node = pipeworks.after_place, + after_dig_node = pipeworks.after_dig, + }) + + minetest.register_craft({ + output = "pipeworks:straight_tube 3", + recipe = { + { "pipeworks:tube_1", "pipeworks:tube_1", "pipeworks:tube_1" }, + }, + }) + + -- conducting one-way tube - to stop making those ugly shunting wires + + if pipeworks.enable_one_way_tube and pipeworks.enable_conductor_tube then + minetest.register_node(":pipeworks:conductor_one_way_tube_on", { + description = S("One-way Conducting Tube"), + tiles = {"pipeworks_conductor_one_way_tube_top_on.png", + "pipeworks_conductor_one_way_tube_top_on.png", + "pipeworks_conductor_one_way_tube_output_on.png", + "pipeworks_conductor_one_way_tube_input_on.png", + "pipeworks_conductor_one_way_tube_side_on.png", + "pipeworks_conductor_one_way_tube_top_on.png"}, + paramtype2 = "facedir", + drawtype = "nodebox", + paramtype = "light", + node_box = {type = "fixed", + fixed = {{-1/2, -9/64, -9/64, 1/2, 9/64, 9/64}}}, + groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1, mesecon = 2, not_in_creative_inventory = 1}, + sounds = default.node_sound_wood_defaults(), + tube = { + connect_sides = {left = 1, right = 1}, + can_go = function(pos, node, velocity, stack) + return {velocity} + end, + can_insert = function(pos, node, stack, direction) + local dir = pipeworks.facedir_to_right_dir(node.param2) + return vector.equals(dir, direction) + end, + priority = 75 -- Higher than normal tubes, but lower than receivers + }, + after_place_node = pipeworks.after_place, + after_dig_node = pipeworks.after_dig, + mesecons = { + conductor = {state = mesecon.state.on, + rules = pipeworks.mesecons_rules, + onstate = "pipeworks:conductor_one_way_tube_on", + offstate = "pipeworks:conductor_one_way_tube_off" + } + }, + drop = "pipeworks:conductor_one_way_tube_off", + }) + + minetest.register_node(":pipeworks:conductor_one_way_tube_off", { + description = S("One-way Conducting Tube"), + tiles = {"pipeworks_conductor_one_way_tube_top_off.png", + "pipeworks_conductor_one_way_tube_top_off.png", + "pipeworks_conductor_one_way_tube_output_off.png", + "pipeworks_conductor_one_way_tube_input_off.png", + "pipeworks_conductor_one_way_tube_side_off.png", + "pipeworks_conductor_one_way_tube_top_off.png"}, + paramtype2 = "facedir", + drawtype = "nodebox", + paramtype = "light", + node_box = {type = "fixed", + fixed = {{-1/2, -9/64, -9/64, 1/2, 9/64, 9/64}}}, + groups = {snappy = 2, choppy = 2, oddly_breakable_by_hand = 2, tubedevice = 1, mesecon = 2}, + sounds = default.node_sound_wood_defaults(), + tube = { + connect_sides = {left = 1, right = 1}, + can_go = function(pos, node, velocity, stack) + return {velocity} + end, + can_insert = function(pos, node, stack, direction) + local dir = pipeworks.facedir_to_right_dir(node.param2) + return vector.equals(dir, direction) + end, + priority = 75 -- Higher than normal tubes, but lower than receivers + }, + after_place_node = pipeworks.after_place, + after_dig_node = pipeworks.after_dig, + mesecons = { + conductor = {state = mesecon.state.off, + rules = pipeworks.mesecons_rules, + onstate = "pipeworks:conductor_one_way_tube_on", + offstate = "pipeworks:conductor_one_way_tube_off" + } + }, + drop = "pipeworks:conductor_one_way_tube_off", + }) + + minetest.register_craft({ + output = "pipeworks:conductor_one_way_tube_off", + recipe = { + { "pipeworks:one_way_tube", "mesecons:wire_00000000_off"} + }, + }) + end + + +end
\ No newline at end of file diff --git a/extranodes/init.lua b/extranodes/init.lua index ccecbaa..0ae99c8 100644 --- a/extranodes/init.lua +++ b/extranodes/init.lua @@ -3,6 +3,12 @@ -- Boilerplate to support localized strings if intllib mod is installed. local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end +-- some extras to the extras +local path = string.gsub(technic.modpath, "technic/technic", "technic/extranodes") +dofile(path.."/aspirin.lua") +dofile(path.."/trampoline.lua") +dofile(path.."/extratubes.lua") + if minetest.get_modpath("moreblocks") then -- register stairsplus/circular_saw nodes @@ -187,8 +193,10 @@ minetest.register_craft({ } }) +-- Artificial diamonds + minetest.register_craftitem(":technic:diamond_seed", { - description = "Diamond Seed", + description = S("Diamond Seed"), inventory_image = "technic_diamond_seed.png", }) @@ -199,126 +207,4 @@ minetest.register_craft({ }) --- bouncy-bouncy - -minetest.register_craftitem(":technic:latex_foam", { - description = "Latex Foam", - inventory_image = "technic_latex_foam.png", -}) - -minetest.register_node(":technic:fall_dampener_50", { - description = S("Fall Dampener 50%"), - drawtype = "nodebox", - node_box = { - type = "fixed", - fixed = {-0.5,-0.5,-0.5,0.5,0,0.5} - }, - collision_box = { - type = "fixed", - fixed = {-0.5,-0.5,-0.5,0.5,0,0.5} - }, - selection_box = { - type = "fixed", - fixed = {-0.5,-0.5,-0.5,0.5,0,0.5} - }, - tiles = { "technic_fall_dampener_top.png", - "technic_fall_dampener_bottom.png", - "technic_fall_dampener_side.png", - "technic_fall_dampener_side.png", - "technic_fall_dampener_side.png", - "technic_fall_dampener_side.png"}, - groups = {crumbly = 3, fall_damage_add_percent = -50}, - sounds = default.node_sound_dirt_defaults(), -}) - -minetest.register_node(":technic:fall_dampener_100", { - description = S("Fall Dampener 100%"), - drawtype = "normal", - tiles = {"technic_fall_dampener_top.png", - "technic_fall_dampener_bottom.png", - "technic_fall_dampener_side.png", - "technic_fall_dampener_side.png", - "technic_fall_dampener_side.png", - "technic_fall_dampener_side.png"}, - groups = {crumbly = 3, fall_damage_add_percent = -100}, - sounds = default.node_sound_dirt_defaults(), -}) - -minetest.register_node(":technic:trampoline", { - drawtype = "normal", - tiles = {"technic_trampoline_top.png", - "technic_fall_dampener_bottom.png", -- cost cuts - "technic_trampoline_side.png", - "technic_trampoline_side.png", - "technic_trampoline_side.png", - "technic_trampoline_side.png"}, - description = S("Trampoline"), - groups = {crumbly = 3, bouncy = 100, fall_damage_add_percent = -100}, - sounds = {footstep = {name = "trampoline_boing", gain = 1.0}} -}) - -minetest.register_craft({ - output = "technic:fall_dampener_50", - recipe = { - { "", "", ""}, - { "technic:raw_latex", "technic:raw_latex", "technic:raw_latex"}, - { "technic:latex_foam", "technic:latex_foam", "technic:latex_foam"}, - } -}) - -minetest.register_craft({ - output = "technic:fall_dampener_100", - recipe = { - { "technic:raw_latex", "technic:raw_latex", "technic:raw_latex"}, - { "technic:latex_foam", "technic:latex_foam", "technic:latex_foam"}, - { "technic:latex_foam", "technic:latex_foam", "technic:latex_foam"}, - } -}) - -minetest.register_craft({ - output = "technic:trampoline", - recipe = { - { "dye:green", "dye:green", "dye:green"}, - { "technic:rubber", "technic:rubber", "technic:rubber"}, - { "technic:rubber", "technic:rubber", "technic:rubber"}, - } -}) - --- aspirin - --- makes any sence only when there is hunger as a separate status of the player --- also it uses willow twigs - ethereal dependency - -if minetest.get_modpath("hunger") and minetest.get_modpath("ethereal") then - - minetest.register_craftitem(":technic:aspirin_pill", { - description = "Aspirin pill", - inventory_image = "technic_aspirin_pill.png", - on_use = function(itemstack, user, pointed_thing) - user:set_hp(user:get_hp() + 2) - itemstack:take_item() - return itemstack - end - }) - - minetest.register_craftitem(":technic:aspirin_bottle", { - description = "Aspirin pills", - inventory_image = "technic_aspirin_bottle.png", - on_use = function(itemstack, user, pointed_thing) - user:set_hp(20) - itemstack:take_item() - return itemstack - end - }) - - minetest.register_craft({ - type = "shapeless", - output = "technic:aspirin_bottle", - recipe = {"technic:aspirin_pill", "technic:aspirin_pill", - "technic:aspirin_pill", "technic:aspirin_pill", - "technic:aspirin_pill", "technic:aspirin_pill", - "technic:aspirin_pill", "vessels:glass_bottle"} - }) - -end diff --git a/extranodes/textures/pipeworks_conductor_one_way_tube_input_off.png b/extranodes/textures/pipeworks_conductor_one_way_tube_input_off.png Binary files differnew file mode 100644 index 0000000..8f77487 --- /dev/null +++ b/extranodes/textures/pipeworks_conductor_one_way_tube_input_off.png diff --git a/extranodes/textures/pipeworks_conductor_one_way_tube_input_on.png b/extranodes/textures/pipeworks_conductor_one_way_tube_input_on.png Binary files differnew file mode 100644 index 0000000..85b20aa --- /dev/null +++ b/extranodes/textures/pipeworks_conductor_one_way_tube_input_on.png diff --git a/extranodes/textures/pipeworks_conductor_one_way_tube_output_off.png b/extranodes/textures/pipeworks_conductor_one_way_tube_output_off.png Binary files differnew file mode 100644 index 0000000..8f77487 --- /dev/null +++ b/extranodes/textures/pipeworks_conductor_one_way_tube_output_off.png diff --git a/extranodes/textures/pipeworks_conductor_one_way_tube_output_on.png b/extranodes/textures/pipeworks_conductor_one_way_tube_output_on.png Binary files differnew file mode 100644 index 0000000..85b20aa --- /dev/null +++ b/extranodes/textures/pipeworks_conductor_one_way_tube_output_on.png diff --git a/extranodes/textures/pipeworks_conductor_one_way_tube_side_off.png b/extranodes/textures/pipeworks_conductor_one_way_tube_side_off.png Binary files differnew file mode 100644 index 0000000..beab600 --- /dev/null +++ b/extranodes/textures/pipeworks_conductor_one_way_tube_side_off.png diff --git a/extranodes/textures/pipeworks_conductor_one_way_tube_side_on.png b/extranodes/textures/pipeworks_conductor_one_way_tube_side_on.png Binary files differnew file mode 100644 index 0000000..c0150e2 --- /dev/null +++ b/extranodes/textures/pipeworks_conductor_one_way_tube_side_on.png diff --git a/extranodes/textures/pipeworks_conductor_one_way_tube_top_off.png b/extranodes/textures/pipeworks_conductor_one_way_tube_top_off.png Binary files differnew file mode 100644 index 0000000..36c7684 --- /dev/null +++ b/extranodes/textures/pipeworks_conductor_one_way_tube_top_off.png diff --git a/extranodes/textures/pipeworks_conductor_one_way_tube_top_on.png b/extranodes/textures/pipeworks_conductor_one_way_tube_top_on.png Binary files differnew file mode 100644 index 0000000..080c09c --- /dev/null +++ b/extranodes/textures/pipeworks_conductor_one_way_tube_top_on.png diff --git a/extranodes/textures/pipeworks_straight_tube_input.png b/extranodes/textures/pipeworks_straight_tube_input.png Binary files differnew file mode 100644 index 0000000..8490858 --- /dev/null +++ b/extranodes/textures/pipeworks_straight_tube_input.png diff --git a/extranodes/textures/pipeworks_straight_tube_output.png b/extranodes/textures/pipeworks_straight_tube_output.png Binary files differnew file mode 100644 index 0000000..8490858 --- /dev/null +++ b/extranodes/textures/pipeworks_straight_tube_output.png diff --git a/extranodes/textures/pipeworks_straight_tube_side.png b/extranodes/textures/pipeworks_straight_tube_side.png Binary files differnew file mode 100644 index 0000000..b746911 --- /dev/null +++ b/extranodes/textures/pipeworks_straight_tube_side.png diff --git a/extranodes/trampoline.lua b/extranodes/trampoline.lua new file mode 100644 index 0000000..d36e356 --- /dev/null +++ b/extranodes/trampoline.lua @@ -0,0 +1,94 @@ +-- bouncy-bouncy +-- this adds two useful kinds of nodes. Two fall damage dampeners (50% and 100%) +-- and a trampoline. Unlike on the mushroom spores from ethereal, players can +-- freely jump on the dampeners. +-- The latex foam adds use to sulphur, and may be employed for something else later. + +local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end + + +minetest.register_craftitem(":technic:latex_foam", { + description = S("Latex Foam"), + inventory_image = "technic_latex_foam.png", +}) + +minetest.register_node(":technic:fall_dampener_50", { + description = S("Fall Dampener 50%"), + drawtype = "nodebox", + node_box = { + type = "fixed", + fixed = {-0.5,-0.5,-0.5,0.5,0,0.5} + }, + collision_box = { + type = "fixed", + fixed = {-0.5,-0.5,-0.5,0.5,0,0.5} + }, + selection_box = { + type = "fixed", + fixed = {-0.5,-0.5,-0.5,0.5,0,0.5} + }, + tiles = { "technic_fall_dampener_top.png", + "technic_fall_dampener_bottom.png", + "technic_fall_dampener_side.png", + "technic_fall_dampener_side.png", + "technic_fall_dampener_side.png", + "technic_fall_dampener_side.png"}, + groups = {crumbly = 3, fall_damage_add_percent = -50}, + sounds = default.node_sound_dirt_defaults(), +}) + +minetest.register_node(":technic:fall_dampener_100", { + description = S("Fall Dampener 100%"), + drawtype = "normal", + tiles = {"technic_fall_dampener_top.png", + "technic_fall_dampener_bottom.png", + "technic_fall_dampener_side.png", + "technic_fall_dampener_side.png", + "technic_fall_dampener_side.png", + "technic_fall_dampener_side.png"}, + groups = {crumbly = 3, fall_damage_add_percent = -100}, + sounds = default.node_sound_dirt_defaults(), +}) + +minetest.register_node(":technic:trampoline", { + description = S("Trampoline"), + drawtype = "normal", + tiles = {"technic_trampoline_top.png", + "technic_fall_dampener_bottom.png", -- cost cuts + "technic_trampoline_side.png", + "technic_trampoline_side.png", + "technic_trampoline_side.png", + "technic_trampoline_side.png"}, + groups = {crumbly = 3, bouncy = 100, fall_damage_add_percent = -100}, + sounds = {footstep = {name = "trampoline_boing", gain = 1.0}} +}) + + +minetest.register_craft({ + output = "technic:fall_dampener_50", + recipe = { + { "", "", ""}, + { "technic:raw_latex", "technic:raw_latex", "technic:raw_latex"}, + { "technic:latex_foam", "technic:latex_foam", "technic:latex_foam"}, + } +}) + +minetest.register_craft({ + output = "technic:fall_dampener_100", + recipe = { + { "technic:raw_latex", "technic:raw_latex", "technic:raw_latex"}, + { "technic:latex_foam", "technic:latex_foam", "technic:latex_foam"}, + { "technic:latex_foam", "technic:latex_foam", "technic:latex_foam"}, + } +}) + +minetest.register_craft({ + output = "technic:trampoline", + recipe = { + { "dye:green", "dye:green", "dye:green"}, + { "technic:rubber", "technic:rubber", "technic:rubber"}, + { "technic:rubber", "technic:rubber", "technic:rubber"}, + } +}) + + |