 
 (defn can-be-repaired? [db game unit]
   (< (:unit/count unit) (:game/max-count-per-unit game)))
+
+(defn compatible-armor-types-for-repair?
+  ([db game repairer wounded]
+   (let [possible-repair-types (get-in repairer [:unit/type :unit-type/can-repair])
+         goal-repair-type (get-in wounded [:unit/type :unit-type/armor-type])]
+     (contains? possible-repair-types goal-repair-type))))
 
 (defn repair-tx
   "Returns a transaction that increments unit count and sets the unit repaired

  (check-unit-current db game unit)
  (when (:unit/capturing unit)
    (throw (unit-ex "Unit cannot make repairs while capturing" unit)))
  (when-not (get-in unit [:unit/type :unit-type/can-repair])
    (throw (unit-ex "Unit cannot repair other units" unit)))
  (checked-next-state db unit :action.type/repair-other-unit))


         :unit/state (e new-state)}])))
  ([db game q1 r1 q2 r2]
   (let [repairer (checked-unit-at db game q1 r1)
         wounded (checked-unit-at db game q2 r2)]
     (repair-other-tx db game repairer wounded))))

(defn repair! [conn game-id q r]
