Add files via upload

master
AiTechEye 2018-08-13 18:29:14 +02:00 committed by GitHub
parent dd22e2bc54
commit 925f2245e7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 22 additions and 22 deletions

View File

@ -38,7 +38,7 @@ vexcazer.registry_mode({
local dir = minetest.dir_to_facedir(user:get_look_dir())
local count=user:get_inventory():get_stack("main", input.index-1):get_count()
if count==0 then return false end
minetest.sound_play("vexcazer_dig", {pos = user:getpos(), gain = 1.0, max_hear_distance = 5,})
minetest.sound_play("vexcazer_dig", {pos = user:get_pos(), gain = 1.0, max_hear_distance = 5,})
for i=1,input.max_amount,1 do
if count>0 then
if vexcazer.dig(pos,input)==false then
@ -85,9 +85,9 @@ vexcazer.registry_mode({
node.name=input.lazer
count=input.max_amount
lazer=true
minetest.sound_play("vexcazer_lazer", {pos =user:getpos(), gain = 1.0, max_hear_distance = 5,})
minetest.sound_play("vexcazer_lazer", {pos =user:get_pos(), gain = 1.0, max_hear_distance = 5,})
else
minetest.sound_play("vexcazer_place", {pos =user:getpos(), gain = 1.0, max_hear_distance = 5,})
minetest.sound_play("vexcazer_place", {pos =user:get_pos(), gain = 1.0, max_hear_distance = 5,})
end
for i=1,input.max_amount,1 do
if lazer then
@ -130,16 +130,16 @@ local replace=function(itemstack, user, pointed_thing,input)
replace=input.lazer
replace_count=input.max_amount
lazer=true
minetest.sound_play("vexcazer_lazer", {pos = user:getpos(), gain = 1.0, max_hear_distance = 5,})
minetest.sound_play("vexcazer_lazer", {pos = user:get_pos(), gain = 1.0, max_hear_distance = 5,})
end
if input.on_place then
invert=true
if lazer==false then minetest.sound_play("vexcazer_dig", {pos = user:getpos(), gain = 1.0, max_hear_distance =5,}) end
if lazer==false then minetest.sound_play("vexcazer_dig", {pos = user:get_pos(), gain = 1.0, max_hear_distance =5,}) end
else
if lazer==false then minetest.sound_play("vexcazer_place", {pos = user:getpos(), gain = 1.0, max_hear_distance =5,}) end
if lazer==false then minetest.sound_play("vexcazer_place", {pos = user:get_pos(), gain = 1.0, max_hear_distance =5,}) end
end
if ((replace_count<stack_count and replace_count<input.max_amount)) and input.admin==false then
minetest.chat_send_player(input.user:get_player_name(),"You need more to repalce with (or empty slot = air)")
@ -183,13 +183,13 @@ vexcazer.registry_mode({
on_place=function(itemstack, user, pointed_thing,input)
if pointed_thing.type~="node" then return itemstack end
local pos=pointed_thing.under
minetest.sound_play("diplazer_dig", {pos = input.user:getpos(), gain = 1.0, max_hear_distance = 5,})
minetest.sound_play("diplazer_dig", {pos = input.user:get_pos(), gain = 1.0, max_hear_distance = 5,})
local stack_count=user:get_inventory():get_stack("main",input.index-1):get_count()
local plus=-1
if pointed_thing.above.y<pointed_thing.under.y then
plus=1
end
minetest.sound_play("vexcazer_dig", {pos = user:getpos(), gain = 1.0, max_hear_distance =5,})
minetest.sound_play("vexcazer_dig", {pos = user:get_pos(), gain = 1.0, max_hear_distance =5,})
for i=1,input.max_amount,1 do
if stack_count<=0 then return false end
if vexcazer.dig(pos,input)==true then
@ -218,9 +218,9 @@ vexcazer.registry_mode({
stack=input.lazer
stack_count=input.max_amount
lazer=true
minetest.sound_play("vexcazer_lazer", {pos =user:getpos(), gain = 1.0, max_hear_distance = 5,})
minetest.sound_play("vexcazer_lazer", {pos =user:get_pos(), gain = 1.0, max_hear_distance = 5,})
else
minetest.sound_play("vexcazer_place", {pos = user:getpos(), gain = 1.0, max_hear_distance =5,})
minetest.sound_play("vexcazer_place", {pos = user:get_pos(), gain = 1.0, max_hear_distance =5,})
end
if pointed_thing.under.y>pointed_thing.above.y then
plus=-1
@ -257,7 +257,7 @@ vexcazer.registry_mode({
local dir = minetest.dir_to_facedir(user:get_look_dir())
local plus=1
local minus=-1
minetest.sound_play("vexcazer_place", {pos = user:getpos(), gain = 1.0, max_hear_distance =5,})
minetest.sound_play("vexcazer_place", {pos = user:get_pos(), gain = 1.0, max_hear_distance =5,})
if minetest.registered_nodes[minetest.get_node(pointed_thing.under).name].walkable==false and minetest.get_node(pointed_thing.under).name~="air" then
pos=pointed_thing.under
end
@ -292,4 +292,4 @@ vexcazer.registry_mode({
end
return true
end
})
})

View File

@ -45,7 +45,7 @@ vexcazer.use=function(itemstack, user, pointed_thing,input)
if user:get_luaentity() then
local dir=user:get_look_dir()
local pos=user:getpos()
local pos=user:get_pos()
pos={x=pos.x+(dir.x)*2,y=pos.y+(dir.y)*2,z=pos.z+(dir.z)*2}
vexcazer.bot_use(itemstack, user, pos,dir,input)
return itemstack
@ -124,14 +124,14 @@ vexcazer.use=function(itemstack, user, pointed_thing,input)
ob:set_hp(0)
ob:punch(user,1,{full_punch_interval=1,damage_groups={fleshy=9999}})
end
minetest.sound_play("vexcazer_lazer", {pos =ob:getpos(), gain = 1.0, max_hear_distance = 7,})
minetest.sound_play("vexcazer_lazer", {pos =ob:get_pos(), gain = 1.0, max_hear_distance = 7,})
end
else
if input.mod or input.default then
ob:punch(ob,1,{full_punch_interval=1,damage_groups={fleshy=10}})
minetest.sound_play("vexcazer_lazer", {pos =ob:getpos(), gain = 1.0, max_hear_distance = 7,})
minetest.sound_play("vexcazer_lazer", {pos =ob:get_pos(), gain = 1.0, max_hear_distance = 7,})
else
minetest.sound_play("vexcazer_lazer", {pos =ob:getpos(), gain = 1.0, max_hear_distance = 10,})
minetest.sound_play("vexcazer_lazer", {pos =ob:get_pos(), gain = 1.0, max_hear_distance = 10,})
ob:set_hp(0)
ob:punch(ob,1,{full_punch_interval=1,damage_groups={fleshy=9999}})
end
@ -145,7 +145,7 @@ vexcazer.use=function(itemstack, user, pointed_thing,input)
end
if key.LMB and key.RMB and (input.admin or input.mod) then
local pos=user:getpos()
local pos=user:get_pos()
pointed_thing.under={x=pos.x,y=pos.y-1,z=pos.z}
pointed_thing.above={x=pos.x,y=pos.y-0.5,z=pos.z}
pointed_thing.type="node"
@ -199,7 +199,7 @@ vexcazer.set_mode=function(input,itstack) -- {user,add,set,index}
item.metadata=minetest.serialize(meta)
item.meta=minetest.serialize(meta)
item.wear=wear
minetest.sound_play("vexcazer_mode", {pos=input.user:getpos(), gain = 2.0, max_hear_distance = 3,})
minetest.sound_play("vexcazer_mode", {pos=input.user:get_pos(), gain = 2.0, max_hear_distance = 3,})
minetest.chat_send_player(input.user:get_player_name(),"Mode" .. mode ..": " .. vexcazer.registry_modes[mode].name)
if itstack then
itstack:replace(item)
@ -503,4 +503,4 @@ dofile(minetest.get_modpath("vexcazer") .. "/craft.lua")
minetest.register_alias("vex_ad", "vexcazer:admin")
minetest.register_alias("vex_mod", "vexcazer:mod")
minetest.register_alias("vex_def", "vexcazer:default")
minetest.register_alias("vex_con", "vexcazer:controler")
minetest.register_alias("vex_con", "vexcazer:controler")

View File

@ -55,7 +55,7 @@ minetest.register_tool("vexcazer:default", {
if not vexcazer.enable_default then
itemstack:replace(nil)
minetest.chat_send_player(user:get_player_name(),"<vexcazer> The tool is disabled")
minetest.sound_play("vexcazer_error", {pos = user:getpos(), gain = 1.0, max_hear_distance = 15})
minetest.sound_play("vexcazer_error", {pos = user:get_pos(), gain = 1.0, max_hear_distance = 15})
return itemstack
end
vexcazer.use(itemstack, user, pointed_thing,{
@ -76,7 +76,7 @@ minetest.register_tool("vexcazer:default", {
if not vexcazer.enable_default then
itemstack:replace(nil)
minetest.chat_send_player(user:get_player_name(),"<vexcazer> The tool is disabled")
minetest.sound_play("vexcazer_error", {pos = user:getpos(), gain = 1.0, max_hear_distance = 15})
minetest.sound_play("vexcazer_error", {pos = user:get_pos(), gain = 1.0, max_hear_distance = 15})
return itemstack
end
vexcazer.use(itemstack, user, pointed_thing,{
@ -193,4 +193,4 @@ minetest.register_tool("vexcazer:controler", {
end
return itemstack
end,
})
})