Merge branch 'joe7575:master' into master

This commit is contained in:
wizardofgcc 2022-02-21 21:15:34 +03:00 committed by GitHub
commit a5ca593b02
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 42 additions and 22 deletions

View File

@ -244,6 +244,17 @@ function techage.add_to_set(set, x)
end
end
-- techage.tbl_filter({"a", "b", "c", "d"}, function(v, k, t) return v >= "c" end) --> {"c","d"}
techage.tbl_filter = function(t, filterIter)
local out = {}
for k, v in pairs(t) do
if filterIter(v, k, t) then out[k] = v end
end
return out
end
function techage.get_node_lvm(pos)
local node = minetest.get_node_or_nil(pos)
if node then

View File

@ -46,6 +46,7 @@ local function count_trues(t)
end
local function nucleus(t)
t = techage.tbl_filter(t, function(v, k, t) return type(v) == "table" end)
if #t == 4 then
if vector.equals(t[1], t[2]) and vector.equals(t[3], t[4]) then
return true
@ -69,7 +70,7 @@ sched.register(tSched, CALL_RATE1, 1, function(pos, outdir)
local resp = control.request(pos, Cable, outdir, "con", "test_plasma")
local cnt = count_trues(resp)
if cnt ~= EXPECTED_PLASMA_NUM then
return S("Tokamak shape error")
return S("Plasma ring shape error")
end
return true
end)
@ -98,11 +99,6 @@ sched.register(tSched, CALL_RATE2, 4, function(pos, outdir)
return true
end)
-- function(pos, outdir)
-- local resp = control.request(pos, Cable, outdir, "con", "no_gas")
-- return "no_gas: " .. concentrate(resp)
-- end,
local function can_start(pos, nvm)
local outdir = networks.side_to_outdir(pos, "L")
if not power.power_available(pos, Cable, outdir) then
@ -269,6 +265,12 @@ minetest.register_node("techage:ta5_fr_controller_act", {
sounds = default.node_sound_metal_defaults(),
})
techage.register_node({"techage:ta5_fr_controller_pas", "techage:ta5_fr_controller_act"}, {
on_recv_message = function(pos, src, topic, payload)
return State:on_receive_message(pos, topic, payload)
end,
})
power.register_nodes({"techage:ta5_fr_controller_pas", "techage:ta5_fr_controller_act"}, Cable, "con", {"L", "R"})
minetest.register_craft({
@ -279,3 +281,4 @@ minetest.register_craft({
{'default:steel_ingot', 'default:diamond', 'techage:aluminum'},
},
})

View File

@ -242,9 +242,9 @@ Tube Concentrator=Röhren Konzentrator
Cooling failed=Kühlung ausgefallen
Magnet detection error@n(@1% found / 100% expected)=Magneterkennungsfehler@n(@1% erkannt / 100% erwartet)
Nucleus detection error=Kern nicht erkannt
Plasma ring shape error=Formfehler des Plasmarings
Shell shape error@n(@1% found / 100% expected)=Hüllenformfehler@n(@1% erkannt / 100% erwartet)
TA5 Fusion Reactor Controller=TA5 Fusionsreaktor Controller
Tokamak shape error=Tokamakformfehler
### controller.lua ###
### heatexchanger2.lua ###

View File

@ -242,9 +242,9 @@ Tube Concentrator=
Cooling failed=
Magnet detection error@n(@1% found / 100% expected)=
Nucleus detection error=
Plasma ring shape error=
Shell shape error@n(@1% found / 100% expected)=
TA5 Fusion Reactor Controller=
Tokamak shape error=
### controller.lua ###
### heatexchanger2.lua ###

View File

@ -161,19 +161,21 @@ liquid.register_nodes({"techage:ta5_tele_pipe"}, Pipe, "tank", {"L"}, {
nvm.oil_amount = nvm.oil_amount or 0
if not blocked and techage.is_operational(nvm) then
local rmt_pos = teleport.get_remote_pos(pos)
local rmt_nvm = techage.get_nvm(rmt_pos)
if techage.is_operational(rmt_nvm) then
local pipe_dir = M(rmt_pos):get_int("pipe_dir")
blocked = true
local leftover = liquid.put(rmt_pos, Pipe, pipe_dir, name, amount)
blocked = false
if leftover < amount then
State:keep_running(pos, nvm, COUNTDOWN_TICKS)
State:keep_running(rmt_pos, rmt_nvm, COUNTDOWN_TICKS)
if rmt_pos then
local rmt_nvm = techage.get_nvm(rmt_pos)
if techage.is_operational(rmt_nvm) then
local pipe_dir = M(rmt_pos):get_int("pipe_dir")
blocked = true
local leftover = liquid.put(rmt_pos, Pipe, pipe_dir, name, amount)
blocked = false
if leftover < amount then
State:keep_running(pos, nvm, COUNTDOWN_TICKS)
State:keep_running(rmt_pos, rmt_nvm, COUNTDOWN_TICKS)
end
return leftover
else
State:blocked(pos, nvm, S("Remote block error"))
end
return leftover
else
State:blocked(pos, nvm, S("Remote block error"))
end
end
return amount

View File

@ -21,10 +21,14 @@ minetest.register_node("techage:pillar", {
mesh = "techage_cylinder_07.obj",
selection_box = {
type = "fixed",
fixed = {-8/32, -16/32, -8/32, 8/32, 16/32, 8/32},
fixed = {-10/32, -16/32, -10/32, 10/32, 16/32, 10/32},
},
collision_box = {
type = "fixed",
fixed = {-4/32, -16/32, -4/32, 4/32, 16/32, 4/32},
},
climbable = true,
walkable = false,
walkable = true,
paramtype = "light",
backface_culling = true,
groups = {cracky=1},