Change a craft, new textures for temporarygate (by @Ataron), and add dual delayer object.

This commit is contained in:
palige 2015-08-29 17:31:01 +02:00
parent ab5737f6fe
commit 8e62d892b9
17 changed files with 147 additions and 2 deletions

View File

@ -0,0 +1 @@
mesecons

View File

@ -0,0 +1,82 @@
local function dual_delayer_get_input_rules(node)
local rules = {{x=-1, y=0, z=0}}
for i = 0, node.param2 do
rules = mesecon.rotate_rules_left(rules)
end
return rules
end
local function dual_delayer_get_output_rules(node)
local rules = {{x=0, y=0, z=-1}, {x=0, y=0, z=1}}
for i = 0, node.param2 do
rules = mesecon.rotate_rules_left(rules)
end
return rules
end
local dual_delayer_activate = function(pos, node)
mesecon.receptor_on(pos, {dual_delayer_get_output_rules(node)[1]}) -- Turn on the port 1
minetest.swap_node(pos, {name = "moremesecons_dual_delayer:dual_delayer_10", param2 = node.param2})
minetest.after(0.4, function(pos, node)
mesecon.receptor_on(pos, {dual_delayer_get_output_rules(node)[2]}) -- Turn on the port 2
minetest.swap_node(pos, {name = "moremesecons_dual_delayer:dual_delayer_11", param2 = node.param2})
end, pos, node)
end
local dual_delayer_deactivate = function(pos, node, link)
mesecon.receptor_off(pos, {dual_delayer_get_output_rules(node)[2]}) -- Turn off the port 2
minetest.swap_node(pos, {name = "moremesecons_dual_delayer:dual_delayer_10", param2 = node.param2})
minetest.after(0.4, function(pos, node)
mesecon.receptor_off(pos, {dual_delayer_get_output_rules(node)[1]}) -- Turn off the port 1
minetest.swap_node(pos, {name = "moremesecons_dual_delayer:dual_delayer_00", param2 = node.param2})
end, pos, node)
end
local groups = {}
for i1=0, 1 do
for i2=0, 1 do
if not(i1 == 0 and i2 == 1) then
if i1 == 0 and i2 == 0 then
groups = {dig_immediate = 2}
else
groups = {dig_immediate = 2, not_in_creative_inventory = 1}
end
minetest.register_node("moremesecons_dual_delayer:dual_delayer_"..tostring(i1)..tostring(i2), {
description = "Dual Delayer",
drop = "moremesecons_dual_delayer:dual_delayer_00",
inventory_image = "moremesecons_dual_delayer_00.png",
wield_image = "moremesecons_dual_delayer_00.png",
paramtype = "light",
paramtype2 = "facedir",
drawtype = "nodebox",
node_box = {
type = "fixed",
fixed = {{-6/16, -8/16, -1/16, 6/16, -7/16, 8/16 },
{-8/16, -8/16, 1/16, -6/16, -7/16, -1/16},
{8/16, -8/16, -1/16, 6/16, -7/16, 1/16}}
},
groups = groups,
tiles = {"moremesecons_dual_delayer_"..tostring(i1)..tostring(i2)..".png", "moremesecons_dual_delayer_bottom.png", "moremesecons_dual_delayer_side_left.png", "moremesecons_dual_delayer_side_right.png", "moremesecons_dual_delayer_ends.png", "moremesecons_dual_delayer_ends.png"},
mesecons = {
receptor = {
state = mesecon.state.off,
rules = dual_delayer_get_output_rules
},
effector = {
rules = dual_delayer_get_input_rules,
action_on = dual_delayer_activate,
action_off = dual_delayer_deactivate
}
}
})
end
end
end
minetest.register_craft({
type = "shapeless",
output = "moremesecons_dual_delayer:dual_delayer_00 2",
recipe = {"mesecons_delayer:delayer_off", "mesecons_delayer:delayer_off"}
})

View File

@ -0,0 +1,62 @@
-- The ADJUSTBALE_BLINKY_PLANT
-- File copy on blinky_plant by Jeija
local toggle_timer = function (pos, restart)
local timer = minetest.get_node_timer(pos)
local meta = minetest.get_meta(pos)
if timer:is_started() and not restart then
timer:stop()
else
timer:start(tonumber(meta:get_int("interval")))
end
end
local on_timer = function (pos)
local node = minetest.get_node(pos)
if(mesecon.flipstate(pos, node) == "on") then
mesecon.receptor_on(pos)
else
mesecon.receptor_off(pos)
end
toggle_timer(pos, false)
end
mesecon.register_node("moremesecons_adjustable_blinkyplant:adjustable_blinky_plant", {
description="Adjustable Blinky Plant",
drawtype = "plantlike",
inventory_image = "jeija_blinky_plant_off.png",
paramtype = "light",
walkable = false,
sounds = default.node_sound_leaves_defaults(),
selection_box = {
type = "fixed",
fixed = {-0.3, -0.5, -0.3, 0.3, -0.5+0.7, 0.3},
},
on_timer = on_timer,
on_construct = function(pos)
local meta = minetest.get_meta(pos)
meta:set_string("formspec", "field[interval;interval;${interval}]")
toggle_timer(pos, true)
end,
on_receive_fields = function(pos, formname, fields, sender)
local meta = minetest.get_meta(pos)
if not fields.interval then return end
meta:set_string("interval", fields.interval)
toggle_timer(pos, true)
end,
},{
tiles = {"jeija_blinky_plant_off.png"},
groups = {dig_immediate=3},
mesecons = {receptor = { state = mesecon.state.off }}
},{
tiles = {"jeija_blinky_plant_on.png"},
groups = {dig_immediate=3, not_in_creative_inventory=1},
mesecons = {receptor = { state = mesecon.state.on }},
})
minetest.register_craft({
output = "moremesecons_adjustable_blinkyplant:adjustable_blinky_plant_off 1",
recipe = { {"mesecons_blinkyplant:blinky_plant_off"},
{"default:mese_crystal_fragment"},}
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 179 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 181 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 180 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 177 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 161 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

View File

@ -71,6 +71,6 @@ mesecon.register_node("moremesecons_signalchanger:signalchanger", {
})
minetest.register_craft({
output = "moremesecons_signalchanger_off",
recipte = {{"group:mesecon_conductor_craftable","moremesecons_switchtorch:switchtorch_on","group:mesecon_conductor_craftable"}}
output = "moremesecons_signalchanger:signalchanger_off",
recipe = {{"group:mesecon_conductor_craftable","moremesecons_switchtorch:switchtorch_on","group:mesecon_conductor_craftable"}}
})

Binary file not shown.

Before

Width:  |  Height:  |  Size: 226 B

After

Width:  |  Height:  |  Size: 242 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 228 B

After

Width:  |  Height:  |  Size: 245 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 562 B

After

Width:  |  Height:  |  Size: 533 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 635 B

After

Width:  |  Height:  |  Size: 539 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 229 B

After

Width:  |  Height:  |  Size: 241 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 234 B

After

Width:  |  Height:  |  Size: 243 B