 (in-ns 'test.core)
+
+(deftest adjusted-chronotype
+  "Ensure adjusted chronotype gains only 1 click when 2 clicks are lost"
+  (do-game
+   (new-game (default-corp) (default-runner [(qty "Adjusted Chronotype" 1) (qty "Beach Party" 2)]))
+   (take-credits state :corp)
+   (play-from-hand state :runner "Adjusted Chronotype")
+   (play-from-hand state :runner "Beach Party")
+   (take-credits state :runner)
+   (take-credits state :corp)
+   (is (= 4 (:click (get-runner))) "Should have lost 1 click and gained 1 click")
+   (play-from-hand state :runner "Beach Party")
+   (take-credits state :runner)
+   (take-credits state :corp)
+   (is (= 3 (:click (get-runner))) "Should have lost 2 clicks and gained 1 click")))
+
+(deftest adjusted-chronotype-gcs
+  "Ensure adjusted chronotype gains 2 clicks when 2 clicks are lost and GCS is installed"
+  (do-game
+   (new-game (default-corp) (default-runner [(qty "Adjusted Chronotype" 1) (qty "Beach Party" 3) (qty "Gene Conditioning Shoppe" 1)]))
+   (take-credits state :corp)
+   (play-from-hand state :runner "Adjusted Chronotype")
+   (play-from-hand state :runner "Beach Party")
+   (take-credits state :runner)
+   (take-credits state :corp)
+   (is (= 4 (:click (get-runner))) "Should have lost 1 click and gained 1 click")
+   (play-from-hand state :runner "Beach Party")
+   (play-from-hand state :runner "Gene Conditioning Shoppe")
+   (take-credits state :runner)
+   (take-credits state :corp)
+   (is (= 4 (:click (get-runner))) "Should have lost 2 clicks and gained 2 clicks")
+   (play-from-hand state :runner "Beach Party")
+   (take-credits state :runner)
+   (take-credits state :corp)
+   (is (= 3 (:click (get-runner))) "Should have lost 3 clicks and gained 2 clicks")))
 
 (deftest daily-casts
   "Play and tick through all turns of daily casts"

    (core/click-draw state :runner nil)
    (is (= 4 (:credit (get-runner))) "No credit gained from second click spent to draw")))

(deftest the-supplier-ability
  "The Supplier - Ability"
  (do-game

      (card-ability state :runner fc 1)
      (is (= 1 (count (:scored (get-runner)))) "Agenda added to runner scored")
      (is (= 3 (count (:hand (get-runner)))) "No damage dealt"))))

(deftest gene-conditioning-shoppe
  "Gene Conditioning Shoppe - set :genetics-trigger-twice flag"
  (do-game
   (new-game (default-corp [(qty "Hedge Fund" 3)])
             (default-runner [(qty "Gene Conditioning Shoppe" 1) (qty "Adjusted Chronotype" 1)]))
   (take-credits state :corp)
   (play-from-hand state :runner "Adjusted Chronotype")
   (let [adjusted-chronotype (get-in @state [:runner :rig :resource 0])]
     (is (not (core/persistent-flag? state :runner adjusted-chronotype :triggers-twice)))
     (play-from-hand state :runner "Gene Conditioning Shoppe")
     (is (core/persistent-flag? state :runner adjusted-chronotype :triggers-twice))
     (core/trash state :runner (get-in @state [:runner :rig :resource 1]))
     (is (not (core/persistent-flag? state :runner adjusted-chronotype :triggers-twice))))))

(deftest gene-conditioning-shoppe-redundancy
  "Gene Conditioning Shoppe - set :genetics-trigger-twice flag - ensure redundant copies work"
  (do-game
   (new-game (default-corp [(qty "Hedge Fund" 3)])
             (default-runner [(qty "Gene Conditioning Shoppe" 2) (qty "Adjusted Chronotype" 1)]))
   (take-credits state :corp)
   (take-credits state :runner)
   (take-credits state :corp)
   (play-from-hand state :runner "Adjusted Chronotype")
   (let [adjusted-chronotype (get-in @state [:runner :rig :resource 0])]
     (is (not (core/persistent-flag? state :runner adjusted-chronotype :triggers-twice)))
     (play-from-hand state :runner "Gene Conditioning Shoppe")
     (play-from-hand state :runner "Gene Conditioning Shoppe")
     (let [gcs1 (get-in @state [:runner :rig :resource 1])
           gcs2 (get-in @state [:runner :rig :resource 2])]
       (is (core/persistent-flag? state :runner adjusted-chronotype :triggers-twice))
       (core/trash state :runner gcs1)
       (is (core/persistent-flag? state :runner adjusted-chronotype :triggers-twice))
       (core/trash state :runner gcs2)
       (is (not (core/persistent-flag? state :runner adjusted-chronotype :triggers-twice)))))))

(deftest ice-carver
  "Ice Carver - lower ice strength on encounter"
