Add files via upload
parent
016b715999
commit
61acaa9e8f
|
@ -1,4 +1,14 @@
|
|||
vexcazer={enable_default=false,gui="",auto_ad_mod=false,max_amount={default=10,mod=15,admin=30,world=99},wear_use=65535/1000,range={default=10,mod=15,admin=15},registry_modes={},creative=minetest.settings:get("creative_mode"),pvp=minetest.settings:get_bool("enable_pvp")}
|
||||
vexcazer={
|
||||
enable_default=false,gui="",
|
||||
auto_ad_mod=false,
|
||||
max_amount={default=10,mod=15,admin=30,world=99},
|
||||
wear_use=65535/1000,
|
||||
range={default=10,mod=15,admin=15},
|
||||
registry_modes={},
|
||||
creative=minetest.settings:get("creative_mode"),
|
||||
pvp=minetest.settings:get_bool("enable_pvp"),
|
||||
gui_user={},
|
||||
}
|
||||
|
||||
--if minetest.PLAYER_MAX_HP_DEFAULT then
|
||||
-- minetest.PLAYER_MAX_HP_DEFAULT=100
|
||||
|
@ -42,8 +52,9 @@ vexcazer.registry_mode=function(a)
|
|||
end
|
||||
|
||||
vexcazer.use=function(itemstack, user, pointed_thing,input)
|
||||
|
||||
if user:get_luaentity() then
|
||||
if type(user)~="userdata" then
|
||||
return itemstack
|
||||
elseif user:get_luaentity() then
|
||||
local dir=user:get_look_dir()
|
||||
local pos=user:get_pos()
|
||||
pos={x=pos.x+(dir.x)*2,y=pos.y+(dir.y)*2,z=pos.z+(dir.z)*2}
|
||||
|
@ -96,6 +107,7 @@ vexcazer.use=function(itemstack, user, pointed_thing,input)
|
|||
input.mode=vexcazer.set_mode({user=user,add=1,index=input.index,get_mode=true})
|
||||
if input.mode==0 then key.sneak=true end
|
||||
if key.aux1 then
|
||||
vexcazer.gui_user[input.user_name]={user=user,input=input}
|
||||
vexcazer.form_update(user,input.index)
|
||||
return itemstack
|
||||
elseif key.sneak and input.on_use then
|
||||
|
@ -283,7 +295,6 @@ vexcazer.form_update=function(user,index,info)
|
|||
pre="\nPLACE+USE = use even if you pointing at nothing"
|
||||
end
|
||||
|
||||
|
||||
if item1c==0 then item1c="" end
|
||||
if item2c==0 then item2c="" end
|
||||
if info=="" then info=item1 .." " .. item1c .. "\n" .. item2 .." " .. item2c .. "\n\nIf you have a kayboard:\nSNEAK+USE = change modes frontwards\nSNEAK+PLACE = Change modes backwards\nRUN/AUX1+USE = Open this gui" .. pre .."\n\nThe controler is also a powerbank\nPut it in a power generator --> top slot to load it,\nput it under to load a vexcazer" end
|
||||
|
@ -323,16 +334,28 @@ vexcazer.form_update=function(user,index,info)
|
|||
end
|
||||
end
|
||||
end
|
||||
minetest.after(0.1, function(gui)
|
||||
minetest.after(0.1, function(name,gui)
|
||||
return minetest.show_formspec(name, "vexcazer_gui",gui)
|
||||
end, gui)
|
||||
end,name, gui)
|
||||
end
|
||||
|
||||
minetest.register_on_player_receive_fields(function(player, form, pressed)
|
||||
if form=="vexcazer_gui" then
|
||||
|
||||
if pressed.quit then
|
||||
minetest.after(0.1, function(player)
|
||||
vexcazer.gui_user[player:get_player_name()]=nil
|
||||
end,player)
|
||||
end
|
||||
|
||||
local index=tonumber(pressed.index)
|
||||
for i=1,20,1 do
|
||||
for i=1,30,1 do
|
||||
if pressed["m" .. i]~=nil then
|
||||
if vexcazer.registry_modes[i].on_button then
|
||||
local input=(vexcazer.gui_user[player:get_player_name()] and vexcazer.gui_user[player:get_player_name()].input) or nil
|
||||
vexcazer.registry_modes[i].on_button(player,input)
|
||||
return
|
||||
end
|
||||
return vexcazer.set_mode({index=index,user=player,add=0,set=i})
|
||||
end
|
||||
if pressed["m" .. i .."info"]~=nil then
|
||||
|
@ -340,9 +363,13 @@ minetest.register_on_player_receive_fields(function(player, form, pressed)
|
|||
local adinf=""
|
||||
local deinf=""
|
||||
local item=player:get_inventory():get_stack("main",index):get_name()
|
||||
if item=="vexcazer:mod" and vexcazer.registry_modes[i].info_mod~="" then moinf="\n" .. vexcazer.registry_modes[i].info_mod
|
||||
elseif item=="vexcazer:admin" and vexcazer.registry_modes[i].info_admin~="" then adinf="\n" ..vexcazer.registry_modes[i].info_admin
|
||||
elseif item=="vexcazer:default" and vexcazer.registry_modes[i].info_default~="" then deinf="\n" ..vexcazer.registry_modes[i].info_default end
|
||||
if item=="vexcazer:mod" and vexcazer.registry_modes[i].info_mod~="" then
|
||||
moinf="\n" .. vexcazer.registry_modes[i].info_mod
|
||||
elseif item=="vexcazer:admin" and vexcazer.registry_modes[i].info_admin~="" then
|
||||
adinf="\n" ..vexcazer.registry_modes[i].info_admin
|
||||
elseif item=="vexcazer:default" and vexcazer.registry_modes[i].info_default~="" then
|
||||
deinf="\n" ..vexcazer.registry_modes[i].info_default
|
||||
end
|
||||
return vexcazer.form_update(player,index,vexcazer.registry_modes[i].info .. deinf.. moinf .. adinf)
|
||||
end
|
||||
end
|
||||
|
@ -361,9 +388,6 @@ vexcazer.dig=function(pos,input,nolazer)-- pos,input
|
|||
if input.default and def~=nil and (def.drop=="" or def.unbreakable) then return false end
|
||||
if input.admin==false then
|
||||
minetest.node_dig(pos,node,input.user)
|
||||
|
||||
|
||||
|
||||
if vexcazer.def(pos,"walkable")==false then
|
||||
if nolazer then
|
||||
minetest.set_node(pos, {name="air"})
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 126 B |
|
@ -33,7 +33,7 @@ vexcazer.registry_mode({
|
|||
disallow_damage_on_use=true,
|
||||
hide_mode_default=true,
|
||||
hide_mode_mod=true,
|
||||
on_use=function(itemstack, user, pointed_thing,input)
|
||||
on_button=function(user,input)
|
||||
local inv=user:get_inventory()
|
||||
for i=0,32,1 do
|
||||
if inv:get_stack("main",i):get_name()=="vexcazer_adpick:pick" then
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
mesecons
|
||||
default?
|
|
@ -0,0 +1,225 @@
|
|||
vexcazer_extras={
|
||||
nodes={},
|
||||
}
|
||||
|
||||
for i,v in ipairs({"FFFFFF","FF0000","ff009c","ff7700","00cbff","00FF00","0000FF","000000","8bb9f9"}) do
|
||||
minetest.register_node("vexcazer_extras:glowing_" ..v, {
|
||||
description = "Glowing block",
|
||||
drawtype="glasslike",
|
||||
tiles = {"gui_hb_bg.png^[colorize:#" .. v},
|
||||
light_source = 14,
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
groups={cracky=3},
|
||||
})
|
||||
|
||||
table.insert(vexcazer_extras.nodes,"vexcazer_extras:unbreakable_glowing_" ..v)
|
||||
minetest.register_node("vexcazer_extras:unbreakable_glowing_" ..v, {
|
||||
description = "Unbreakable Glowing block",
|
||||
stack_max=1000,
|
||||
drop="",
|
||||
drawtype="glasslike",
|
||||
tiles = {"gui_hb_bg.png^[colorize:#" .. v},
|
||||
light_source = 14,
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
groups={not_in_creative_inventory=1,unbreakable=1},
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
for i,v in pairs(minetest.registered_nodes) do
|
||||
local def=minetest.registered_nodes[i]
|
||||
if def and def.mod_origin=="default" and (def.drawtype=="normal" or def.drawtype=="glasslike_framed_optional" or def.drawtype=="glasslike") then
|
||||
local newdef=table.copy(def)
|
||||
local name="vexcazer_extras:unbreakable_" .. v.name:sub(v.name:find(":")+1,v.name:len())
|
||||
newdef.description="Unbreakable " .. def.description
|
||||
newdef.drop=""
|
||||
newdef.groups = {not_in_creative_inventory=1,unbreakable=1}
|
||||
newdef.stack_max=1000
|
||||
minetest.register_node(name, newdef)
|
||||
table.insert(vexcazer_extras.nodes,name)
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
vexcazer.registry_mode({
|
||||
name="Unbreakable",
|
||||
info="Unbreakable blocks",
|
||||
disallow_damage_on_use=true,
|
||||
hide_mode_default=true,
|
||||
hide_mode_mod=true,
|
||||
on_button=function(user,input)
|
||||
local gui="size[20,10]"
|
||||
local x=0
|
||||
local y=0
|
||||
for i,name in pairs(vexcazer_extras.nodes) do
|
||||
gui=gui .. "item_image_button[" .. x.. ",".. y..";1,1;" .. name ..";" .. name .. ";]"
|
||||
x=x+1
|
||||
if x>19 then
|
||||
y=y+1
|
||||
x=0
|
||||
end
|
||||
end
|
||||
minetest.after(0.1, function()
|
||||
return minetest.show_formspec(user:get_player_name(), "vexcazer_extras:unbreakable",gui)
|
||||
end)
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_on_player_receive_fields(function(player, form, pressed)
|
||||
if form=="vexcazer_extras:unbreakable" and not pressed.quit then
|
||||
local name=""
|
||||
for k,v in pairs(pressed) do
|
||||
name=k
|
||||
break
|
||||
end
|
||||
player:get_inventory():add_item("main", name .." 100")
|
||||
end
|
||||
end)
|
||||
|
||||
table.insert(vexcazer_extras.nodes,"vexcazer_extras:black")
|
||||
minetest.register_node("vexcazer_extras:black", {
|
||||
description = "Black",
|
||||
stack_max=1000,
|
||||
drawtype="glasslike",
|
||||
tiles = {"gui_hb_bg.png^[colorize:#000000"},
|
||||
drop="",
|
||||
walkable=false,
|
||||
damage_per_second=100,
|
||||
groups = {not_in_creative_inventory=1},
|
||||
})
|
||||
table.insert(vexcazer_extras.nodes,"vexcazer_extras:collision")
|
||||
minetest.register_node("vexcazer_extras:collision", {
|
||||
description = "Collision",
|
||||
stack_max=1000,
|
||||
drawtype="airlike",
|
||||
drop="",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
pointable=false,
|
||||
groups = {not_in_creative_inventory=1},
|
||||
})
|
||||
|
||||
if minetest.get_modpath("mesecons") then
|
||||
table.insert(vexcazer_extras.nodes,"vexcazer_extras:collision_mese")
|
||||
minetest.register_node("vexcazer_extras:collision_mese", {
|
||||
description = "Collision mesecon effected",
|
||||
stack_max=1000,
|
||||
inventory_image="default_mese_block.png",
|
||||
drawtype="airlike",
|
||||
drop="",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
pointable=false,
|
||||
groups = {not_in_creative_inventory=1},
|
||||
mesecons = {conductor = {
|
||||
state = mesecon.state.off,
|
||||
onstate = "vexcazer_extras:collision_mese_off",
|
||||
rules={{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=1,z=0},{x=0,y=-1,z=0},{x=0,y=0,z=1},{x=0,y=0,z=-1}}
|
||||
}}
|
||||
})
|
||||
minetest.register_node("vexcazer_extras:collision_mese_off", {
|
||||
drawtype="airlike",
|
||||
drop="",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
pointable=false,
|
||||
walkable=false,
|
||||
groups = {not_in_creative_inventory=1},
|
||||
mesecons = {conductor = {
|
||||
state = mesecon.state.on,
|
||||
offstate = "vexcazer_extras:collision_mese",
|
||||
rules={{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=1,z=0},{x=0,y=-1,z=0},{x=0,y=0,z=1},{x=0,y=0,z=-1}}
|
||||
}}
|
||||
})
|
||||
table.insert(vexcazer_extras.nodes,"vexcazer_extras:collision_mese_pointable")
|
||||
minetest.register_node("vexcazer_extras:collision_mese_pointable", {
|
||||
description = "Collision mesecon effected pointable",
|
||||
stack_max=1000,
|
||||
inventory_image="default_mese_block.png",
|
||||
drawtype="airlike",
|
||||
drop="",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
groups = {not_in_creative_inventory=1},
|
||||
mesecons = {conductor = {
|
||||
state = mesecon.state.off,
|
||||
onstate = "vexcazer_extras:collision_mese_off_pointable",
|
||||
rules={{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=1,z=0},{x=0,y=-1,z=0},{x=0,y=0,z=1},{x=0,y=0,z=-1}}
|
||||
}}
|
||||
})
|
||||
minetest.register_node("vexcazer_extras:collision_mese_off_pointable", {
|
||||
drawtype="airlike",
|
||||
drop="",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
pointable=false,
|
||||
walkable=false,
|
||||
groups = {not_in_creative_inventory=1},
|
||||
mesecons = {conductor = {
|
||||
state = mesecon.state.on,
|
||||
offstate = "vexcazer_extras:collision_mese_pointable",
|
||||
rules={{x=1,y=0,z=0},{x=-1,y=0,z=0},{x=0,y=1,z=0},{x=0,y=-1,z=0},{x=0,y=0,z=1},{x=0,y=0,z=-1}}
|
||||
}}
|
||||
})
|
||||
|
||||
end
|
||||
table.insert(vexcazer_extras.nodes,"vexcazer_extras:shadow")
|
||||
minetest.register_node("vexcazer_extras:shadow", {
|
||||
description = "Shadow",
|
||||
stack_max=1000,
|
||||
inventory_image="gui_formbg.png",
|
||||
drawtype="airlike",
|
||||
drop="",
|
||||
walkable=false,
|
||||
pointable=false,
|
||||
groups = {not_in_creative_inventory=1},
|
||||
})
|
||||
table.insert(vexcazer_extras.nodes,"vexcazer_extras:kill")
|
||||
minetest.register_node("vexcazer_extras:kill", {
|
||||
description = "Kill",
|
||||
stack_max=1000,
|
||||
inventory_image="default_lava.png",
|
||||
drawtype="airlike",
|
||||
drop="",
|
||||
paramtype = "light",
|
||||
walkable=false,
|
||||
sunlight_propagates = true,
|
||||
damage_per_second=100,
|
||||
pointable=false,
|
||||
groups = {not_in_creative_inventory=1},
|
||||
})
|
||||
table.insert(vexcazer_extras.nodes,"vexcazer_extras:damage")
|
||||
minetest.register_node("vexcazer_extras:damage", {
|
||||
description = "Damage",
|
||||
stack_max=1000,
|
||||
inventory_image="default_lava.png",
|
||||
drawtype="airlike",
|
||||
drop="",
|
||||
paramtype = "light",
|
||||
walkable=false,
|
||||
sunlight_propagates = true,
|
||||
damage_per_second=1,
|
||||
pointable=false,
|
||||
groups = {not_in_creative_inventory=1},
|
||||
})
|
||||
|
||||
table.insert(vexcazer_extras.nodes,"vexcazer_extras:sourceblocking")
|
||||
minetest.register_node("vexcazer_extras:sourceblocking", {
|
||||
description = "Sourceblocking",
|
||||
stack_max=1000,
|
||||
drawtype="nodebox",
|
||||
node_box={
|
||||
type="fixed",
|
||||
node_box={0,0,0,0,0,0},
|
||||
},
|
||||
drop="",
|
||||
paramtype = "light",
|
||||
--walkable=false,
|
||||
sunlight_propagates = true,
|
||||
pointable=false,
|
||||
groups = {not_in_creative_inventory=1},
|
||||
})
|
Loading…
Reference in New Issue