Genericize lens beam emitters
Look for optic_lens_emit group instead of explicit lens_on node, to support multiple lens beam emitting nodes (e.g. glued/unglued) for firestarting, door ablation, etc.
This commit is contained in:
parent
894fab64e1
commit
d37e9e9ace
@ -6,7 +6,6 @@ local minetest, nodecore, pairs, vector
|
||||
local modname = minetest.get_current_modname()
|
||||
|
||||
local dntname = modname .. ":ablation"
|
||||
local lenson = "nc_optics:lens_on"
|
||||
|
||||
local hash = minetest.hash_node_position
|
||||
local cooldowns = {}
|
||||
@ -48,7 +47,7 @@ end
|
||||
|
||||
nodecore.register_dnt({
|
||||
name = dntname,
|
||||
nodenames = {lenson},
|
||||
nodenames = {"group:optic_lens_emit"},
|
||||
time = 2,
|
||||
action = ablation
|
||||
})
|
||||
@ -57,7 +56,7 @@ minetest.register_abm({
|
||||
label = "door ablation",
|
||||
interval = 2,
|
||||
chance = 1,
|
||||
nodenames = {lenson},
|
||||
nodenames = {"group:optic_lens_emit"},
|
||||
neighbors = {"group:door"},
|
||||
action = function(pos)
|
||||
return nodecore.dnt_set(pos, dntname, 2)
|
||||
|
@ -35,7 +35,7 @@ nodecore.register_hint("catapult an item with a hinged panel",
|
||||
|
||||
nodecore.register_hint("propel hinged panel with focused light",
|
||||
"door ablation",
|
||||
{"nc_optics:lens_on", "group:door"}
|
||||
{"group:optic_lens_emit", "group:door"}
|
||||
)
|
||||
|
||||
nodecore.register_hint("place a node with a hinged panel",
|
||||
|
@ -39,7 +39,7 @@ nodecore.register_hint("chop chromatic glass into lenses",
|
||||
)
|
||||
|
||||
nodecore.register_hint("activate a lens",
|
||||
{true, "nc_optics:lens_on", "nc_optics:lens_on_glued"},
|
||||
{true, "group:optic_lens_emit"},
|
||||
"group:silica_lens"
|
||||
)
|
||||
|
||||
@ -50,12 +50,12 @@ nodecore.register_hint("produce light from a lens",
|
||||
|
||||
nodecore.register_hint("activate a prism",
|
||||
{true, "nc_optics:prism_on", "nc_optics:prism_on_glued"},
|
||||
"nc_optics:lens_on"
|
||||
"group:optic_lens_emit"
|
||||
)
|
||||
|
||||
nodecore.register_hint("gate a prism",
|
||||
{true, "nc_optics:prism_gated", "nc_optics:prism_gated_glued"},
|
||||
"nc_optics:lens_on"
|
||||
"group:optic_lens_emit"
|
||||
)
|
||||
|
||||
nodecore.register_hint("stick a lens/prism in place",
|
||||
|
@ -80,7 +80,7 @@ reg("_on", {
|
||||
txr .. "^" .. pinp .. "^" .. pout
|
||||
},
|
||||
light_source = 1,
|
||||
groups = {optic_source = 1},
|
||||
groups = {optic_source = 1, optic_lens_emit = 1},
|
||||
optic_source = function(_, node)
|
||||
return {nodecore.facedirs[node.param2].k}
|
||||
end
|
||||
@ -121,7 +121,7 @@ minetest.register_abm({
|
||||
label = "lens fire start",
|
||||
interval = 2,
|
||||
chance = 2,
|
||||
nodenames = {modname .. ":lens_on"},
|
||||
nodenames = {"group:optic_lens_emit"},
|
||||
action = function(pos, node)
|
||||
local face = nodecore.facedirs[node.param2]
|
||||
local out = vector.add(face.k, pos)
|
||||
|
Loading…
x
Reference in New Issue
Block a user