Advertisement
Guest User

Particle blend, glow and animation

a guest
Oct 30th, 2016
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Lua 2.83 KB | None | 0 0
  1. local def1 = {inventory_image = "magic_wand.png",
  2.         description = "Wand 1",
  3.         stack_max = 1,
  4.         groups = {},
  5.         range = 0.0,
  6.         tool_capabilities = {
  7.             full_punch_interval = 1.0,
  8.             max_drop_level = 0,
  9.             groupcaps = {
  10.                 -- For example:
  11.                 choppy = {times = {[1] = 2.50, [2] = 1.40, [3] = 1.00}, uses = 20, maxlevel = 2},
  12.             },
  13.             damage_groups = {groupname = damage},
  14.         },
  15.  
  16.     on_secondary_use = function(stack, player, pointed_thing)
  17.         minetest.add_particle({
  18.             pos = vector.add(vector.new(0,1,0), vector.add(player:getpos(),player:get_look_dir())),
  19.             velocity = {x=0, y=0, z=0},
  20.             acceleration = {x=0, y=0, z=0},
  21.             expirationtime = 10,
  22.             size = 2,
  23.             collisiondetection = false,
  24.             collision_removal = false,
  25.             vertical = false,
  26.             texture = "flame_tongue.png",
  27.             playername = "singleplayer",
  28.         material_type_param = video.pack_texture_blend_func(
  29. video.EBF_SRC_ALPHA, video.EBF_ONE,video.EMFN_MODULATE_1X, video.EAS_TEXTURE + video.EAS_VERTEX_COLOR),
  30.         vertical_frame_num = 16,
  31.         first_frame = 0,
  32.         frame_length = 0.1,
  33.         loop_animation = true,
  34.         glow = "#AAAF"
  35.         })
  36.     end,}
  37.  
  38. local def2 = {inventory_image = "magic_wand.png",
  39.         description = "Wand 2",
  40.         groups = {},
  41.         range = 0.0,
  42.         tool_capabilities = {
  43.             full_punch_interval = 1.0,
  44.             max_drop_level = 0,
  45.             groupcaps = {
  46.                 -- For example:
  47.                 choppy = {times = {[1] = 2.50, [2] = 1.40, [3] = 1.00}, uses = 20, maxlevel = 2},
  48.             },
  49.             damage_groups = {groupname = damage},
  50.         },
  51.  
  52.         stack_max = 1,
  53.     on_secondary_use = function(stack, player, pointed_thing)
  54. minetest.add_particlespawner({
  55.         amount = 100,
  56.         time = 10,
  57.     minpos = vector.add(vector.new(0,1,0), vector.add(player:getpos(),player:get_look_dir())),
  58.         maxpos = vector.add(vector.new(0,1,0), vector.add(player:getpos(),player:get_look_dir())),
  59.         minvel = {x=0, y=0, z=0},
  60.         maxvel = {x=0, y=0.5, z=0},
  61.         minacc = {x=-0.1, y=0.1, z=-0.1},
  62.         maxacc = {x=0.1, y=0.5, z=0.1},
  63.         minexptime = 1,
  64.         maxexptime = 10,
  65.         minsize = 1,
  66.         maxsize = 1,
  67.         collisiondetection = true,
  68.         collision_removal = false,
  69.         vertical = false,
  70.     texture = "flame_tongue.png",
  71.     material_type_param = video.pack_texture_blend_func(
  72. video.EBF_SRC_ALPHA, video.EBF_ONE,video.EMFN_MODULATE_1X, video.EAS_TEXTURE + video.EAS_VERTEX_COLOR),
  73.     vertical_frame_num = 16,
  74.     min_first_frame = 0,
  75.     max_first_frame = 0,
  76.     frame_length = 0.05,
  77.     loop_animation = false,
  78.     glow = "#AAAF"
  79.     })
  80.     end,}
  81.  
  82.  
  83. minetest.register_tool("test_mod:wand1", def1)
  84. minetest.register_tool("test_mod:wand2", def2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement