Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local def1 = {inventory_image = "magic_wand.png",
- description = "Wand 1",
- stack_max = 1,
- groups = {},
- range = 0.0,
- tool_capabilities = {
- full_punch_interval = 1.0,
- max_drop_level = 0,
- groupcaps = {
- -- For example:
- choppy = {times = {[1] = 2.50, [2] = 1.40, [3] = 1.00}, uses = 20, maxlevel = 2},
- },
- damage_groups = {groupname = damage},
- },
- on_secondary_use = function(stack, player, pointed_thing)
- minetest.add_particle({
- pos = vector.add(vector.new(0,1,0), vector.add(player:getpos(),player:get_look_dir())),
- velocity = {x=0, y=0, z=0},
- acceleration = {x=0, y=0, z=0},
- expirationtime = 10,
- size = 2,
- collisiondetection = false,
- collision_removal = false,
- vertical = false,
- texture = "flame_tongue.png",
- playername = "singleplayer",
- material_type_param = video.pack_texture_blend_func(
- video.EBF_SRC_ALPHA, video.EBF_ONE,video.EMFN_MODULATE_1X, video.EAS_TEXTURE + video.EAS_VERTEX_COLOR),
- vertical_frame_num = 16,
- first_frame = 0,
- frame_length = 0.1,
- loop_animation = true,
- glow = "#AAAF"
- })
- end,}
- local def2 = {inventory_image = "magic_wand.png",
- description = "Wand 2",
- groups = {},
- range = 0.0,
- tool_capabilities = {
- full_punch_interval = 1.0,
- max_drop_level = 0,
- groupcaps = {
- -- For example:
- choppy = {times = {[1] = 2.50, [2] = 1.40, [3] = 1.00}, uses = 20, maxlevel = 2},
- },
- damage_groups = {groupname = damage},
- },
- stack_max = 1,
- on_secondary_use = function(stack, player, pointed_thing)
- minetest.add_particlespawner({
- amount = 100,
- time = 10,
- minpos = vector.add(vector.new(0,1,0), vector.add(player:getpos(),player:get_look_dir())),
- maxpos = vector.add(vector.new(0,1,0), vector.add(player:getpos(),player:get_look_dir())),
- minvel = {x=0, y=0, z=0},
- maxvel = {x=0, y=0.5, z=0},
- minacc = {x=-0.1, y=0.1, z=-0.1},
- maxacc = {x=0.1, y=0.5, z=0.1},
- minexptime = 1,
- maxexptime = 10,
- minsize = 1,
- maxsize = 1,
- collisiondetection = true,
- collision_removal = false,
- vertical = false,
- texture = "flame_tongue.png",
- material_type_param = video.pack_texture_blend_func(
- video.EBF_SRC_ALPHA, video.EBF_ONE,video.EMFN_MODULATE_1X, video.EAS_TEXTURE + video.EAS_VERTEX_COLOR),
- vertical_frame_num = 16,
- min_first_frame = 0,
- max_first_frame = 0,
- frame_length = 0.05,
- loop_animation = false,
- glow = "#AAAF"
- })
- end,}
- minetest.register_tool("test_mod:wand1", def1)
- minetest.register_tool("test_mod:wand2", def2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement