    (morph-ice "Sentry" "Code Gate" trash-program)
 
    "Mamba"
-   {:abilities [(do-net-damage 1)
-                {:msg "do 1 net damage using 1 power counter"
-                 :counter-cost 1 :effect (effect (damage :net 1 {:card card}))}
+   {:abilities [(power-counter-ability (do-net-damage 1))
+                (do-net-damage 1)
                 {:msg "start a Psi game"
-                 :psi {:not-equal {:msg "add 1 power counter"
-                                   :effect (effect (add-prop :runner card :counter 1))}}}]}
+                 :psi {:not-equal add-power-counter}}]}
 
    "Markus 1.0"
    {:abilities [trash-installed end-the-run]}


   "Data Raven"
   {:abilities [give-tag
                {:msg "give the Runner 1 tag using 1 power counter"
                 :counter-cost 1
                 :effect (effect (tag-runner 1))}
                (trace-ability 3 {:label "Add 1 power counter"
                                  :msg "add 1 power counter"
                                  :effect (effect (add-prop card :counter 1))})]}

   "Dracō"
   {:prompt "How many power counters?"

  {:label (str "Gain " credits " [Credits]")
   :msg (str "gain " credits " [Credits]")
   :effect (effect (gain :credit credits))})

(defn power-counter-ability
  "Does specified ability using a power counter."
  [{:keys [label msg] :as ability}]
  (assoc ability :label (str "Hosted power counter: " label)
                 :msg (str msg " using 1 power counter")
                 :counter-cost 1))


;;; For Advanceable ICE
