forked from Mirrorlandia_minetest/portalgun
_
This commit is contained in:
parent
ddf946f58a
commit
f37dfa90df
Binary file not shown.
Binary file not shown.
BIN
models/tureta.b3d
Normal file
BIN
models/tureta.b3d
Normal file
Binary file not shown.
BIN
models/tureta.blend
Normal file
BIN
models/tureta.blend
Normal file
Binary file not shown.
BIN
models/tureta.blend1
Normal file
BIN
models/tureta.blend1
Normal file
Binary file not shown.
@ -412,11 +412,6 @@ minetest.register_craftitem(
|
||||
range = 100,
|
||||
inventory_image = "portalgun_gun0_rndr.png",
|
||||
wield_image = "portalgun_gun0_rndr.png",
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 0.5,
|
||||
max_drop_level = 3,
|
||||
damage_groups = {fleshy = 1}
|
||||
},
|
||||
on_place = function(itemstack, user, pointed_thing)
|
||||
local node = minetest.get_node(pointed_thing.under)
|
||||
if node.name == "portalgun:button" then
|
||||
@ -428,10 +423,6 @@ minetest.register_craftitem(
|
||||
return itemstack
|
||||
end,
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
--if pointing at turret then start breaking it
|
||||
if pointed_thing.type == "node" then
|
||||
local node = minetest.get_node(pointed_thing.under)
|
||||
end
|
||||
portalgun_onuse(itemstack, user, pointed_thing, 1)
|
||||
return itemstack
|
||||
end
|
||||
@ -442,12 +433,13 @@ local function rnd(r)
|
||||
return math.floor(r + 0.5)
|
||||
end
|
||||
|
||||
minetest.register_privilege("allblocksportal", "Can use place portals everywhere")
|
||||
|
||||
function portalgun_onuse(itemstack, user, pointed_thing, mode) -- using the gun
|
||||
if pointed_thing.type == "object" then
|
||||
portalgun_gravity(itemstack, user, pointed_thing)
|
||||
return itemstack
|
||||
end
|
||||
|
||||
local pos = user:get_pos()
|
||||
local dir = user:get_look_dir()
|
||||
local key = user:get_player_control()
|
||||
@ -493,10 +485,14 @@ function portalgun_onuse(itemstack, user, pointed_thing, mode) -- using the gun
|
||||
if minetest.registered_nodes[nname].walkable then
|
||||
portalgun_portal[name].lifelime = portalgun_lifelime
|
||||
|
||||
if minetest.get_node_group(nname, "antiportal") > 0 then
|
||||
minetest.sound_play("portalgun_error", {pos = pos, max_hear_distance = 5, gain = 3})
|
||||
return itemstack
|
||||
elseif minetest.get_node_group(nname, "proportal") == 0 then
|
||||
-- if minetest.get_node_group(nname, "antiportal") > 0 then
|
||||
-- minetest.sound_play("portalgun_error", {pos = pos, max_hear_distance = 5, gain = 3})
|
||||
-- return itemstack
|
||||
-- end
|
||||
--check if the name doesnt start with portalgun:testblock or if has priv allblocksportal
|
||||
local allplace = minetest.check_player_privs(user:get_player_name(), {allblocksportal = true})
|
||||
local istestblock = string.find(nname, "portalgun:testblock", 1)
|
||||
if not istestblock and not allplace then
|
||||
minetest.sound_play("portalgun_error", {pos = pos, max_hear_distance = 5, gain = 3})
|
||||
return itemstack
|
||||
end
|
||||
|
Binary file not shown.
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 15 KiB |
BIN
textures/portalgun_turreta.png
Normal file
BIN
textures/portalgun_turreta.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 8.2 KiB |
Loading…
Reference in New Issue
Block a user