diff options
-rw-r--r-- | extranodes/init.lua | 1 | ||||
-rw-r--r-- | extranodes/lox.lua | 78 | ||||
-rw-r--r-- | extranodes/textures/technic_lox.png | bin | 0 -> 352 bytes | |||
-rw-r--r-- | technic/machines/register/compressor_recipes.lua | 1 | ||||
-rw-r--r-- | technic/machines/register/extractor_recipes.lua | 16 |
5 files changed, 96 insertions, 0 deletions
diff --git a/extranodes/init.lua b/extranodes/init.lua index 8ef074d..44d3dc1 100644 --- a/extranodes/init.lua +++ b/extranodes/init.lua @@ -8,6 +8,7 @@ local path = string.gsub(technic.modpath, "technic/technic", "technic/extranodes dofile(path.."/aspirin.lua") dofile(path.."/trampoline.lua") dofile(path.."/extratubes.lua") +dofile(path.."/lox.lua") if minetest.get_modpath("moreblocks") then diff --git a/extranodes/lox.lua b/extranodes/lox.lua new file mode 100644 index 0000000..f3c7d00 --- /dev/null +++ b/extranodes/lox.lua @@ -0,0 +1,78 @@ +local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end + +local freezing_rules = { + ["default:water_source"] = "default:ice", + ["default:water_flowing"] = "default:snowblock", + ["default:river_water_source"] = "default:ice", + ["default:river_water_flowing"] = "default:snowblock", + ["default:lava_source"] = "default:obsidian", + ["default:lava_flowing"] = "default:stone", + ["fire:basic_flame"] = "air", + ["default:dirt"] = "default:dirt_with_snow", +} + +minetest.register_craftitem(":technic:lox", { + description = S("Liquid Oxygen"), + drawtype = "plantlike", + tiles = {"technic_lox.png"}, + inventory_image = "technic_lox.png", + wield_image = "technic_lox.png", + paramtype = "light", + is_ground_content = false, + walkable = false, + selection_box = { + type = "fixed", + fixed = {-0.25, -0.5, -0.25, 0.25, 0.3, 0.25} + }, + groups = {vessel = 1, dig_immediate = 3, attached_node = 1}, + sounds = default.node_sound_defaults(), + on_use = function(itemstack, user, pointed_thing) + if pointed_thing.type ~= "node" then + return itemstack + end + + if minetest.is_protected(pointed_thing.under, user:get_player_name()) then + minetest.record_protection_violation(pointed_thing.under, user:get_player_name()) + return + end + + local pos = pointed_thing.under + + local loc = {} + local wrk = false + for y=0,2,1 do + for x=-2,2,1 do + for z = -2,2,1 do + loc = {x = pos.x - x, y = pos.y - y, z = pos.z - z} + if freezing_rules[minetest.get_node(loc).name] then + wrk = true + minetest.swap_node(loc, {name = freezing_rules[minetest.get_node(loc).name]}) + end + if math.random(1,5) == 5 then + if minetest.get_node({x = loc.x, y = loc.y+1, z = loc.z}).name == "air" + and minetest.get_node(loc).name ~= "air" + and minetest.get_node(loc).name ~= "stairs:slab_snowblock" then + minetest.set_node({x = loc.x, y = loc.y+1, z = loc.z}, {name = "stairs:slab_snowblock"}) + end + end + end + end + end + + if wrk then + minetest.sound_play("default_cool_lava", {gain = 1, pos = pos}) + end + + itemstack:take_item() + local uinv = user:get_inventory() + if uinv:room_for_item("main", "vessels:steel_bottle 1") then + uinv:add_item("main", "vessels:steel_bottle 1") + else + minetest.item_drop(ItemStack("vessels:steel_bottle 1"), user, user:getpos()) + end + + user:set_hp(user:get_hp() - 1) + + return itemstack + end +}) diff --git a/extranodes/textures/technic_lox.png b/extranodes/textures/technic_lox.png Binary files differnew file mode 100644 index 0000000..341cba3 --- /dev/null +++ b/extranodes/textures/technic_lox.png diff --git a/technic/machines/register/compressor_recipes.lua b/technic/machines/register/compressor_recipes.lua index 8f8358f..b59478b 100644 --- a/technic/machines/register/compressor_recipes.lua +++ b/technic/machines/register/compressor_recipes.lua @@ -48,6 +48,7 @@ if minetest.get_modpath("ethereal") then end +table.insert(recipes, {"vessels:steel_bottle", "technic:lox"}) -- defuse the default sandstone recipe, since we have the compressor to take over in a more realistic manner minetest.clear_craft({ diff --git a/technic/machines/register/extractor_recipes.lua b/technic/machines/register/extractor_recipes.lua index c05f049..e602adb 100644 --- a/technic/machines/register/extractor_recipes.lua +++ b/technic/machines/register/extractor_recipes.lua @@ -37,6 +37,22 @@ if minetest.get_modpath("dye") then -- cottonseed oil: a fuel and a potent fertilizer (irl: pesticide) -- hemp oil calls for 8 seeds, but extractor recipes are normally twice as potent table.insert(dye_recipes, {"farming:seed_cotton 4", "technic:cottonseed_oil"}) + -- Himalayan rhubarb root can give yellow dye + table.insert(dye_recipes, {"farming:rhubarb", "dye:yellow 4"}) + table.insert(dye_recipes, {"farming:blueberries", "dye:blue 4"}) + table.insert(dye_recipes, {"farming:raspberries", "dye:red 4"}) + table.insert(dye_recipes, {"farming:onion", "dye:yellow 4"}) + end + + if minetest.get_modpath("ethereal") then + table.insert(dye_recipes, {"ethereal:fern", "dye:dark_green 4"}) + table.insert(dye_recipes, {"ethereal:snowygrass", "dye:grey 4"}) + table.insert(dye_recipes, {"ethereal:crystalgrass", "dye:blue 4"}) + end + + if minetest.get_modpath("bonemeal") then + table.insert(dye_recipes, {"bonemeal:bone", "dye:white 8"}) + table.insert(dye_recipes, {"bonemeal:bonemeal", "dye:white 4"}) end for _, data in ipairs(dye_recipes) do |