mesecons receptor step
This commit is contained in:
parent
32332d2148
commit
afb4c3acc4
@ -17,5 +17,6 @@ read_globals = {
|
||||
"dump", "VoxelArea",
|
||||
|
||||
-- Deps
|
||||
"unified_inventory", "default", "xp_redo"
|
||||
"unified_inventory", "default", "xp_redo",
|
||||
"mesecon"
|
||||
}
|
||||
|
@ -9,7 +9,11 @@ minetest.register_node("missions:mission", {
|
||||
"default_gold_block.png^default_paper.png^missions_m_overlay.png",
|
||||
"default_gold_block.png^default_paper.png^missions_m_overlay.png"
|
||||
},
|
||||
groups = {cracky=3,oddly_breakable_by_hand=3},
|
||||
groups = {
|
||||
cracky = 3,
|
||||
oddly_breakable_by_hand = 3,
|
||||
mesecon_needs_receiver = 1
|
||||
},
|
||||
sounds = default.node_sound_glass_defaults(),
|
||||
|
||||
after_place_node = function(pos, placer)
|
||||
|
@ -11,3 +11,5 @@ mobs_crocs?
|
||||
mobs_jellyfish?
|
||||
mobs_sharks?
|
||||
mobs_turtles?
|
||||
mesecons?
|
||||
|
||||
|
@ -113,7 +113,8 @@ local update_mission = function(mission, player)
|
||||
step = step,
|
||||
on_success = on_success,
|
||||
on_failed = on_failed,
|
||||
block_meta=block_meta
|
||||
block_meta = block_meta,
|
||||
block_pos = block_pos
|
||||
})
|
||||
end
|
||||
step.initialized = true
|
||||
|
5
init.lua
5
init.lua
@ -1,6 +1,7 @@
|
||||
local has_xp_redo_mod = minetest.get_modpath("xp_redo")
|
||||
local has_mobs_mod = minetest.get_modpath("mobs")
|
||||
local has_unified_inv = minetest.get_modpath("unified_inventory")
|
||||
local has_mesecons = minetest.get_modpath("mesecons")
|
||||
|
||||
local MP = minetest.get_modpath("missions")
|
||||
|
||||
@ -69,6 +70,10 @@ dofile(MP.."/steps/checkpriv.lua")
|
||||
dofile(MP.."/steps/limitedtries.lua")
|
||||
-- dofile(MP.."/steps/followup.lua")
|
||||
|
||||
if has_mesecons then
|
||||
dofile(MP.."/steps/mesecons_receptor_on.lua")
|
||||
end
|
||||
|
||||
if has_xp_redo_mod then
|
||||
dofile(MP.."/steps/checkxp.lua")
|
||||
dofile(MP.."/steps/givexp.lua")
|
||||
|
19
steps/mesecons_receptor_on.lua
Normal file
19
steps/mesecons_receptor_on.lua
Normal file
@ -0,0 +1,19 @@
|
||||
|
||||
missions.register_step({
|
||||
|
||||
type = "mesecons_receptor_on",
|
||||
name = "Emit mesecons signal",
|
||||
|
||||
on_step_enter = function(ctx)
|
||||
mesecon.receptor_on(ctx.block_pos)
|
||||
|
||||
minetest.after(1, function()
|
||||
mesecon.receptor_off(ctx.block_pos)
|
||||
end)
|
||||
|
||||
ctx.on_success()
|
||||
end
|
||||
|
||||
})
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user