Add multi-signal doors, basic device deployment, and a target trigger.
This commit is contained in:
parent
1b2199705b
commit
9acd605c86
35 changed files with 660 additions and 75 deletions
37
mods/artifact_devices/init.lua
Normal file
37
mods/artifact_devices/init.lua
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
|
||||
|
||||
minetest.register_entity(":artifact:device_block", {
|
||||
initial_properties = {
|
||||
visual = "cube",
|
||||
textures = {"artifact_device_block.png", "artifact_device_block.png", "artifact_device_block.png", "artifact_device_block.png", "artifact_device_block.png", "artifact_device_block.png"},
|
||||
use_texture_alpha = true,
|
||||
glow = 8,
|
||||
static_save = false,
|
||||
},
|
||||
_grabbable = true,
|
||||
on_activate = function(e)
|
||||
e.object:set_armor_groups{immortal = 1}
|
||||
end,
|
||||
on_hit = function(e, m)
|
||||
artifact.grab_device(m, e)
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
function artifact.grab_device(m, e)
|
||||
e._no_interact = true
|
||||
m._grabbed_item = e.object
|
||||
m._on_ungrab = function()
|
||||
e._no_interact = nil
|
||||
end
|
||||
end
|
||||
|
||||
function artifact.summon_device(m, device)
|
||||
local e
|
||||
if device == "block" then
|
||||
e = minetest.add_entity(m.pos, "artifact:device_block"):get_luaentity()
|
||||
end
|
||||
if e then
|
||||
artifact.grab_device(m, e)
|
||||
end
|
||||
end
|
||||
Loading…
Add table
Add a link
Reference in a new issue