From 5ba9be3253233e3ebaaada642523d4b5ab7ea829 Mon Sep 17 00:00:00 2001 From: Evert Prants Date: Fri, 14 Dec 2018 21:19:37 +0200 Subject: [PATCH] crafting recipes for fusion reactor parts, heavy water accumulator --- elepower_machines/crafting.lua | 23 +++++++- elepower_machines/craftitems.lua | 25 +++++++++ elepower_machines/machines/accumulator.lua | 41 ++++++++++++-- .../textures/elepower_accumulator_filter.png | Bin 0 -> 643 bytes elepower_nuclear/crafting.lua | 50 ++++++++++++++++++ 5 files changed, 134 insertions(+), 5 deletions(-) create mode 100644 elepower_machines/textures/elepower_accumulator_filter.png diff --git a/elepower_machines/crafting.lua b/elepower_machines/crafting.lua index 46105c0..2e92849 100644 --- a/elepower_machines/crafting.lua +++ b/elepower_machines/crafting.lua @@ -376,6 +376,15 @@ minetest.register_craft({ } }) +minetest.register_craft({ + output = "elepower_machines:heavy_filter", + recipe = { + {"elepower_dynamics:steel_plate", "fluid_transfer:fluid_duct", "elepower_dynamics:steel_plate"}, + {"basic_materials:silicon", "elepower_dynamics:servo_valve", "basic_materials:silicon"}, + {"elepower_dynamics:graphite_ingot", "fluid_transfer:fluid_duct", "elepower_dynamics:graphite_ingot"} + } +}) + -- Nodes -- Coal-fired Alloy Furnace @@ -509,7 +518,7 @@ minetest.register_craft({ minetest.register_craft({ output = "elepower_machines:accumulator", recipe = { - {"", "elepower_dynamics:fluid_duct", ""}, + {"", "fluid_transfer:fluid_duct", ""}, {"default:glass", "elepower_machines:machine_block", "default:glass"}, {"elepower_dynamics:steel_gear", "elepower_dynamics:servo_valve", "elepower_dynamics:steel_gear"}, } @@ -520,7 +529,7 @@ minetest.register_craft({ output = "elepower_machines:lava_cooler", recipe = { {"bucket:bucket_water", "elepower_dynamics:control_circuit", "bucket:bucket_lava"}, - {"elepower_dynamics:fluid_duct", "elepower_machines:machine_block", "elepower_dynamics:fluid_duct"}, + {"fluid_transfer:fluid_duct", "elepower_machines:machine_block", "fluid_transfer:fluid_duct"}, {"elepower_dynamics:servo_valve", "elepower_dynamics:tin_gear", "elepower_dynamics:servo_valve"}, }, replacements = { @@ -617,3 +626,13 @@ minetest.register_craft({ {"elepower_dynamics:servo_valve", "elepower_dynamics:wound_copper_coil", "elepower_dynamics:servo_valve"}, } }) + +-- Advanced Machine Block +minetest.register_craft({ + output = "elepower_machines:advanced_machine_block 8", + recipe = { + {"elepower_dynamics:electrum_plate", "elepower_dynamics:lead_ingot", "elepower_dynamics:electrum_plate"}, + {"elepower_dynamics:lead_ingot", "elepower_machines:machine_block", "elepower_dynamics:lead_ingot"}, + {"elepower_dynamics:electrum_plate", "elepower_dynamics:lead_ingot", "elepower_dynamics:electrum_plate"}, + } +}) diff --git a/elepower_machines/craftitems.lua b/elepower_machines/craftitems.lua index 715859b..5d0ece6 100644 --- a/elepower_machines/craftitems.lua +++ b/elepower_machines/craftitems.lua @@ -37,3 +37,28 @@ minetest.register_craftitem("elepower_machines:super_capacitor", { groups = {capacitor = 5, ele_upgrade_component = 1}, inventory_image = "elepower_upgrade_supercapacitor.png" }) + +-- Accumulator filter + +minetest.register_craftitem("elepower_machines:heavy_filter", { + description = "Liquid Weight Filter\nMakes water pumps pump only Heavy Water\nRight-Click to apply to Water Accumulator", + groups = {accumulator_filter = 1}, + inventory_image = "elepower_accumulator_filter.png", + on_place = function (itemstack, placer, pointed_thing) + if not placer or not placer:is_player() then return itemstack end + local pos = pointed_thing.under + if pointed_thing.type ~= "node" or minetest.is_protected(pos, placer:get_player_name()) then return itemstack end + + local node = minetest.get_node(pos) + if node.name ~= "elepower_machines:accumulator" then return itemstack end + + minetest.swap_node(pos, {name = "elepower_machines:accumulator_heavy"}) + + local meta = minetest.get_meta(pos) + meta:set_int("water_fluid_storage", 0) + meta:set_string("water_fluid", "elepower_nuclear:heavy_water_source") + + itemstack:take_item(1) + return itemstack + end +}) diff --git a/elepower_machines/machines/accumulator.lua b/elepower_machines/machines/accumulator.lua index b1e8c7b..18c7692 100644 --- a/elepower_machines/machines/accumulator.lua +++ b/elepower_machines/machines/accumulator.lua @@ -10,7 +10,8 @@ minetest.register_node("elepower_machines:accumulator", { }, fluid_buffers = { water = { - capacity = CAPACITY + capacity = CAPACITY, + drainable = true, } }, on_construct = function ( pos ) @@ -19,8 +20,32 @@ minetest.register_node("elepower_machines:accumulator", { end }) +minetest.register_node("elepower_machines:accumulator_heavy", { + description = "Water Accumulator (Heavy Water)", + groups = {fluid_container = 1, oddly_breakable_by_hand = 1, cracky = 1, not_in_creative_inventory = 1}, + tiles = { + "elepower_machine_top.png^elepower_power_port.png", "elepower_machine_base.png", "elepower_machine_accumulator.png", + "elepower_machine_accumulator.png", "elepower_machine_accumulator.png", "elepower_machine_accumulator.png", + }, + drop = { + max_items = 2, + items = { { items = {"elepower_machines:accumulator", "elepower_machines:heavy_filter"}, rarity = 1 } } + }, + fluid_buffers = { + water = { + capacity = CAPACITY, + drainable = true, + } + }, + on_construct = function ( pos ) + local meta = minetest.get_meta(pos) + meta:set_string("water_fluid", "elepower_nuclear:heavy_water_source") + end, + _heavy = true +}) + minetest.register_abm({ - nodenames = {"elepower_machines:accumulator"}, + nodenames = {"elepower_machines:accumulator", "elepower_machines:accumulator_heavy"}, label = "elefluidAccumulator", interval = 2, chance = 1/5, @@ -49,6 +74,15 @@ minetest.register_abm({ return end + local ndef = minetest.registered_nodes[node.name] + local src = "default:water_source" + if ndef and ndef._heavy then + src = "elepower_nuclear:heavy_water_source" + if amount > 1000 then + amount = math.floor(amount / 8) + end + end + local give = 0 if buffer.amount + amount > buffer.capacity then give = buffer.capacity - buffer.amount @@ -59,9 +93,10 @@ minetest.register_abm({ buffer.amount = buffer.amount + give meta:set_int("water_fluid_storage", buffer.amount) - meta:set_string("water_fluid", "default:water_source") + meta:set_string("water_fluid", src) meta:set_string("infotext", fluid_lib.buffer_to_string(buffer)) end }) fluid_lib.register_node("elepower_machines:accumulator") +fluid_lib.register_node("elepower_machines:accumulator_heavy") diff --git a/elepower_machines/textures/elepower_accumulator_filter.png b/elepower_machines/textures/elepower_accumulator_filter.png new file mode 100644 index 0000000000000000000000000000000000000000..6b1a439a88d950c3818896ee36adfd40cb4a33a9 GIT binary patch literal 643 zcmV-}0(||6P)e zSad^gZEa<4bO1wgWnpw>WFU8GbZ8()Nlj2!fese{00HYsL_t(I%Z-ygYgADXhMzg- zp1WQ*8f1+T42Tw1rcuN$A)9o5fYzz}5hDHr1%HD@DhpAxTNDfy76DNqb&^I`5n~dw zo3nS%j78ivad*L~hQquMXWp3+Gh-kOLy*|*SS8B^ASE^Lo%~xWLjhpGA7L`@y&QZS z3aHoT3!h5^d5gap@Gt90 zA*2x=WEpq54{70;pviJ^25cSN25*WQr{z0a7>ng2Y*Y(BoG|5{@FJYW(hgV)Y!gc@ zUgqbSa!=VdIkeCRHqrBQW|m(euwWlhRlN6@8J$iCfM%HAHyr!_V^Y){Zsak!VQSU> dvh>6w<2R*4;it0+eyacg002ovPDHLkV1iu$0NMZm literal 0 HcmV?d00001 diff --git a/elepower_nuclear/crafting.lua b/elepower_nuclear/crafting.lua index bfcb2bf..31eddb0 100644 --- a/elepower_nuclear/crafting.lua +++ b/elepower_nuclear/crafting.lua @@ -101,6 +101,56 @@ minetest.register_craft({ } }) +-- Fusion Reactor Coil +minetest.register_craft({ + output = "elepower_nuclear:fusion_coil", + recipe = { + {"basic_materials:copper_wire", "elepower_dynamics:graphite_ingot", "basic_materials:copper_wire"}, + {"basic_materials:copper_wire", "elepower_dynamics:copper_plate", "basic_materials:copper_wire"}, + {"basic_materials:copper_wire", "elepower_dynamics:graphite_ingot", "basic_materials:copper_wire"}, + } +}) + +-- Fusion Reactor Controller +minetest.register_craft({ + output = "elepower_nuclear:reactor_controller", + recipe = { + {"elepower_dynamics:electrum_plate", "elepower_dynamics:soc", "elepower_dynamics:electrum_plate"}, + {"elepower_machines:resonant_capacitor", "elepower_machines:advanced_machine_block", "elepower_machines:resonant_capacitor"}, + {"elepower_dynamics:viridisium_plate", "elepower_dynamics:lcd_panel", "elepower_dynamics:viridisium_plate"}, + } +}) + +-- Fusion Reactor Power Port +minetest.register_craft({ + output = "elepower_nuclear:reactor_power", + recipe = { + {"elepower_dynamics:electrum_plate", "elepower_dynamics:soc", "elepower_dynamics:electrum_plate"}, + {"elepower_dynamics:induction_coil_advanced", "elepower_machines:advanced_machine_block", "elepower_dynamics:induction_coil_advanced"}, + {"elepower_dynamics:viridisium_plate", "elepower_machines:resonant_capacitor", "elepower_dynamics:viridisium_plate"}, + } +}) + +-- Fusion Reactor Fluid Port +minetest.register_craft({ + output = "elepower_nuclear:reactor_fluid", + recipe = { + {"elepower_dynamics:electrum_plate", "elepower_dynamics:soc", "elepower_dynamics:electrum_plate"}, + {"fluid_transfer:fluid_duct", "elepower_machines:advanced_machine_block", "elepower_dynamics:servo_valve"}, + {"elepower_dynamics:viridisium_plate", "elepower_dynamics:xycrone_lump", "elepower_dynamics:viridisium_plate"}, + } +}) + +-- Fusion Reactor Fluid Port (Output) +minetest.register_craft({ + output = "elepower_nuclear:reactor_output", + recipe = { + {"elepower_dynamics:electrum_plate", "elepower_dynamics:soc", "elepower_dynamics:electrum_plate"}, + {"elepower_dynamics:servo_valve", "elepower_machines:advanced_machine_block", "fluid_transfer:fluid_duct"}, + {"elepower_dynamics:viridisium_plate", "elepower_dynamics:xycrone_lump", "elepower_dynamics:viridisium_plate"}, + } +}) + ------------------------ -- Enrichment recipes -- ------------------------