function disperser.init()

 local max_range = 1/25
 local max_damage = 100
 local max_push = 5

 local gun_bar = load_particle("disperser_gun_bar.obj")
 local gun_cap = load_particle("disperser_gun_cap.obj")


 function disperser.explode(object)
  local x1, y1 = object:pos()
  for player in game_players() do
   local worm = player:worm()
   local x2, y2 = worm:pos()
   local r = vector_distance(x1, y1, x2, y2)*max_range
   if r < 1 and not map_is_blocked(x1, y1, x2, y2) then
    local damage = max_damage * (1-r)
    worm:damage(damage, object:player())
    
    local angle = vector_direction(x1, y1, x2, y2)
    worm:push(angle_vector(angle, (1-r)*max_push))
       
   end
   
  end
 end

 function disperser.gun(worm)
 local dx,dy = angle_vector(worm:angle(),5)
 gun = worm:shoot(gun_bar,1,0,0,0,0,0,140,2)
 gun:set_spd(dx,dy)
 gun = worm:shoot(gun_bar,1,0,0,0,0,0,220,2)
 gun:set_spd(dx,dy)
 local dx,dy = angle_vector(worm:angle(),1.5)
 for i=-4, 4 do
  local gun = worm:shoot(gun_cap,1,0,0,0,0,0,i*4,6)
  gun:set_spd(dx,dy)
 end
 end

end