     "left-down"  [ 1  0]
     "right-down" [ 0  1]))
 
+(defn length [[ax ay] [bx by]]
+  (js/Math.sqrt
+   (+ (js/Math.pow (- ax bx) 2)
+      (js/Math.pow (- ay by) 2))))
+
+(defn get-weapon [player weapon]
+  (first
+   (drop-while (comp (partial not= weapon) :name)
+               (select-keys player
+                            [:primary-weapon
+                             :secondary-weapon]))))
+
 (defmulti handle-action :type)
 
 (defmethod handle-action "laser"
-  [{:keys [from stop] :as action}]
-  (swap! state assoc :action
-         (assoc action
-           :start (:position (player! from))
-           :stop (parse-coords stop))))
+  [{:keys [from stop direction] :as action}]
+  (let [player (player! from)
+        level (:level (get-weapon player "laser"))]
+    (swap! state assoc :action
+           (assoc action
+             :start (:position player)
+             :stop (parse-coords stop)
+             :dmg (+ 16 (* 2 (dec level)))))))
 
 (defmethod handle-action "droid"
-  [{:keys [sequence] :as action}]
-  (swap! state assoc :action
-         (assoc action
-           :sequence (mapv direction->coord
-                           sequence))))
+  [{:keys [sequence from] :as action}]
+  (let [level (:level (get-weapon (player! from) "droid"))]
+    (swap! state assoc :action
+           (assoc action
+             :sequence (mapv direction->coord
+                             sequence)
+             :dmg (+ 20 (* 2 level))))))
 
 (defmethod handle-action "mortar"
-  [{:keys [from coordinates]}]
+  [{:keys [from coordinates :as action]}]
   (let [player (player! from)
-        mortar (first
-                (drop-while (comp (partial not= "mortar") :name)
-                            (select-keys player
-                                         [:primary-weapon
-                                          :secondary-weapon])))]
+        level (->> (select-keys player [:primary-weapon
+                                        :secondary-weapon])
+                   (drop-while (comp (partial not= "mortar") :name))
+                   first
+                   :level)]
     (swap! state assoc :action
-           {:coord (mapv +
-                         (:position player)
-                         (parse-coords coordinates))
-            :radius (inc
-                     (:level mortar))})))
+           (assoc action
+             :coord (mapv +
+                          (:position player)
+                          (parse-coords coordinates))
+             :radius (inc level)
+             :dmg (if (= 3 level) 25 20)))))
 
 (defmethod handle-action "move"
   [{:keys [direction from]}]

                      :cy y
                      :r (/ TILE-SIZE 3)}]]))
        (om/build mortar-shot {:coord explosion
                               :radius 1})))))

(defmulti action-view
  (fn [action _] (:type action)))

(defmethod handle-message! "gamestate"
  [gamestate]
  (let [new-state (update-in gamestate [:players]
                             (comp (partial sort-by :name)
                                   (partial map parse-position)))]
    (reset! state new-state)
    (timeout 0)))

