Skip to content

Commit

Permalink
Merge pull request #4636 from NoahTheDuke/master
Browse files Browse the repository at this point in the history
Some Uprising Cards
  • Loading branch information
NoahTheDuke authored Dec 2, 2019
2 parents 429a514 + 735ffff commit d55afd2
Show file tree
Hide file tree
Showing 36 changed files with 3,053 additions and 220 deletions.
1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ jobs:
build:
docker:
- image: circleci/clojure:lein-2.7.1
- image: mongo:3.4.4
environment:
LEIN_ROOT: nbd
JVM_OPTS: -Xmx3200m
Expand Down
13 changes: 1 addition & 12 deletions data/promos.edn
Original file line number Diff line number Diff line change
@@ -1,12 +1 @@
[{:description "Alternate art from a variety of sources.",
:name "Alternate",
:position 0,
:version "alt"}
{:description "Card art from the 2015 World Champion decks.",
:name "World Champion",
:position 1,
:version "wc2015"}
{:description "Card art from the Original Core Set.",
:name "Original Core Set",
:position 2,
:version "core1"}]
[{:description "Alternate art from a variety of sources.", :name "Alternate", :position 0, :version "alt"} {:description "Card art from the 2015 World Champion decks.", :name "World Champion", :position 1, :version "wc2015"} {:description "Card art from the Original Core Set.", :name "Original Core Set", :position 2, :version "core1"}]
24 changes: 18 additions & 6 deletions src/clj/game/cards.clj
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
(in-ns 'game.core)

(defn combine-abilities
"Combines two or more abilities to a single one. Labels are joined together with a period between parts."
([ab-x ab-y]
{:label (str (:label ab-x) ". " (:label ab-y))
:async true
:effect (req (wait-for (resolve-ability state side ab-x card nil)
(continue-ability state side ab-y card nil)))})
([ab-x ab-y & ab-more]
(reduce combine-abilities (combine-abilities ab-x ab-y) ab-more)))

(def trash-program {:prompt "Select a program to trash"
:label "Trash a program"
:msg (msg "trash " (:title target))
Expand Down Expand Up @@ -117,6 +127,7 @@
(unregister-events state side h)
(when (rezzed? h)
(register-events state side newh)))))
(trigger-event state side :swap a-new b-new)
(update-ice-strength state side a-new)
(update-ice-strength state side b-new)))

Expand All @@ -141,7 +152,8 @@
(assoc-in [:host :zone] (:zone newcard)))]
(update! state side newh)
(unregister-events state side h)
(register-events state side newh))))))
(register-events state side newh))))
(trigger-event state side :swap a-new b-new)))

(defn do-net-damage
"Do specified amount of net-damage."
Expand Down Expand Up @@ -227,11 +239,11 @@
(pick-credit-triggers state side eid (rest selected-cards) counter-count message))
(effect-completed state side (make-result eid {:number counter-count :msg message}))))

(defn trigger-stealth-cards
(defn trigger-spend-credits-from-cards
[state side eid cards]
(if (seq cards)
(wait-for (trigger-event-sync state side :spent-stealth-credit (first cards))
(trigger-stealth-cards state side eid (rest cards)))
(wait-for (trigger-event-sync state side :spent-credits-from-card (first cards))
(trigger-spend-credits-from-cards state side eid (rest cards)))
(effect-completed state side eid)))

(defn pick-credit-providing-cards
Expand All @@ -257,8 +269,8 @@
" from their credit pool"))]
(lose state side :credit remainder)
(swap! state update-in [:stats side :spent :credit] (fnil + 0) (- target-count remainder))
(let [cards (filter #(has-subtype? % "Stealth") (map :card (vals selected-cards)))]
(wait-for (trigger-stealth-cards state side cards)
(let [cards (map :card (vals selected-cards))]
(wait-for (trigger-spend-credits-from-cards state side cards)
; Now we trigger all of the :counter-added events we'd neglected previously
(pick-credit-triggers state side eid selected-cards counter-count message))))
(continue-ability
Expand Down
83 changes: 83 additions & 0 deletions src/clj/game/cards/agendas.clj
Original file line number Diff line number Diff line change
Expand Up @@ -241,6 +241,11 @@
:effect arrange-rd}
:interactive (req true)}))

"Bellona"
{:steal-cost-bonus (req [:credit 5])
:effect (req (gain-credits state :corp 5)
(system-msg state side (str "uses " (:title card) " to gain 5 [Credits]")))}

"Better Citizen Program"
(letfn [(ability [kind]
(effect (show-wait-prompt :runner "Corp to use Better Citizen Program")
Expand Down Expand Up @@ -418,6 +423,17 @@
{:events [(assoc ability :event :corp-turn-begins)]
:abilities [ability]})

"Cyberdex Sandbox"
{:effect (effect (continue-ability
{:optional {:prompt "Purge virus counters with Cyberdex Sandbox?"
:yes-ability {:msg (msg "purge virus counters")
:effect (effect (purge))}}}
card nil))
:events [{:event :purge
:once :per-turn
:msg "gain 4 [Credits]"
:effect (req (gain-credits state :corp 4))}]}

"Dedicated Neural Net"
{:events [{:event :successful-run
:interactive (req true)
Expand Down Expand Up @@ -574,6 +590,27 @@
:once :per-turn
:effect (effect (add-prop target :advance-counter 1))}]}

"Flower Sermon"
{:silent (req true)
:effect (effect (add-counter card :agenda 5))
:abilities [{:cost [:agenda 1]
:once :per-turn
:msg (msg "reveal " (:title (first (:deck corp))) " and draw 2 cards")
:async true
:effect (req (reveal state side [(first (:deck corp))])
(show-wait-prompt state :runner (str "Corp to resolve " (:title card)))
(wait-for (draw state side 2 nil)
(continue-ability state side
{:req (req (pos? (count (:hand corp))))
:prompt "Choose a card in HQ to move to the top of R&D"
:msg "add 1 card in HQ to the top of R&D"
:choices {:card #(and (in-hand? %)
(corp? %))}
:effect (effect (move target :deck {:front true})
(clear-wait-prompt :runner)
(effect-completed eid))}
card nil)))}]}

"Fly on the Wall"
{:msg "give the runner 1 tag"
:async true
Expand Down Expand Up @@ -1052,6 +1089,33 @@
(:cid card) {:back true})
(update! (update-in card [:special :kusanagi] #(conj % target))))}]}

"Project Vacheron"
(let [vacheron-ability
{:msg (msg "add 4 agenda counters on " (:title card))
:effect (effect (add-counter (get-card state card) :agenda 4)
(update! (assoc-in (get-card state card) [:special :vacheron] true)))}]
{:agendapoints-runner (req (if (and (get-in card [:special :vacheron])
(zero? (get-counters card :agenda))) 3 0))
:stolen vacheron-ability
:events [(assoc vacheron-ability :event :agenda-stolen :req (req (not= (first (:zone card)) :discard)))
(assoc vacheron-ability :event :as-agenda)
{:event :runner-turn-begins
:req (req (pos? (get-counters card :agenda)))
:msg (msg (str "remove "
(if (= 1 (get-counters card :agenda))
"the final"
"1")
" agenda token from " (:title card)))
:effect (req (when (pos? (get-counters card :agenda))
(add-counter state side card :agenda -1))
(when (= 0 (get-counters (get-card state card) :agenda))
(let [points (get-agenda-points state :runner (assoc-in card [:counter :agenda] 0))]
(system-msg state :runner
(str "gains " (quantify points "agenda point")
" from " (:title card)))
(gain-agenda-point state :runner points))))}]
:flags {:has-events-when-stolen true}})

"Project Vitruvius"
{:silent (req true)
:effect (effect (add-counter card :agenda (- (get-counters card :advancement) 3)))
Expand Down Expand Up @@ -1494,6 +1558,25 @@
card nil))})
card nil))}]}

"Transport Monopoly"
(let [suppress-event {:req (req (and (get-in (get-card state card) [:special :transport-monopoly])
(not (same-card? target card))))}]
{:silent (req true)
:effect (effect (add-counter card :agenda 2))
:abilities [{:cost [:agenda 1]
:req (req run)
:msg "prevent this run from becoming successful"
:effect (effect (update! (assoc-in card [:special :transport-monopoly] true)))}]
:suppress [(assoc suppress-event :event :pre-successful-run)
(assoc suppress-event :event :successful-run)]
:events [{:event :pre-successful-run
:silent (req true)
:req (req (get-in card [:special :transport-monopoly]))
:effect (req (swap! state update-in [:run :run-effect] dissoc :replace-access)
(swap! state update-in [:run] dissoc :successful)
(swap! state update-in [:runner :register :successful-run] #(next %))
(update! state side (dissoc-in card [:special :transport-monopoly])))}]})

"Underway Renovation"
(letfn [(adv4? [s c] (if (>= (get-counters (get-card s c) :advancement) 4) 2 1))]
{:install-state :face-up
Expand Down
75 changes: 75 additions & 0 deletions src/clj/game/cards/assets.clj
Original file line number Diff line number Diff line change
Expand Up @@ -1497,6 +1497,43 @@
agendas (filter agenda? drawn)]
(continue-ability state side (pdhelper agendas 0) card nil)))}]})

"Prāna Condenser" ; Prana Condenser
{:events [{:event :pre-resolve-damage
:async true
:req (req (and (not (get-in card [:special :prana-disabled]))
(= target :net)
(pos? (last targets))))
:effect (req (let [amount (last targets)
damagecard (second targets)]
(swap! state assoc-in [:damage :damage-replace] true)
(show-wait-prompt state :runner (str "Corp to use " (:title card)))
(continue-ability
state side
{:optional
{:prompt (str "Prevent 1 net damage to add power token to " (:title card) "?")
:player :corp
:yes-ability
{:async true
:msg "prevent 1 net damage, place 1 power token, and gain 3 [Credits]"
:effect (req (swap! state update-in [:damage] dissoc :damage-replace)
(clear-wait-prompt state :runner)
(add-counter state side (get-card state card) :power 1)
(gain state side :credit 3)
(update! state side (assoc-in (get-card state card) [:special :prana-disabled] true)) ;temporarily disable prana to not trigger on X-1 net damage
(wait-for (damage state side :net (dec amount) {:card damagecard})
(swap! state assoc-in [:damage :damage-replace] true)
(update! state side (assoc-in (get-card state card) [:special :prana-disabled] false))
(effect-completed state side eid)))}
:no-ability
{:async true
:effect (req (swap! state update-in [:damage] dissoc :damage-replace)
(clear-wait-prompt state :runner)
(effect-completed state side eid))}}}
card nil)))}]
:abilities [{:msg (msg "deal " (get-counters card :power) " net damage")
:cost [[:click 2] [:trash]]
:effect (effect (damage eid :net (get-counters card :power) {:card card}))}]}

"Primary Transmission Dish"
{:recurring 3
:interactions {:pay-credits {:req (req (= :trace (:source-type eid)))
Expand Down Expand Up @@ -2140,6 +2177,44 @@
:async true
:effect (req (as-agenda state :runner eid card 2))}}

"Wall To Wall"
(let [all [{:msg "gain 1 [Credits]"
:effect (effect (gain-credits 1))}
{:msg "draw 1 card"
:async true
:effect (effect (draw eid 1 nil))}
{:label "place 1 advancement token on a piece of ice"
:msg (msg "place 1 advancement token on " (card-str state target))
:prompt "Choose a piece of ice on which to place an advancement"
:async true
:choices {:card #(and (ice? %)
(installed? %))}
:cancel-effect (effect (effect-completed eid))
:effect (effect (add-prop target :advance-counter 1 {:placed true})
(effect-completed eid))}
{:label "add this asset to HQ"
:msg "add it to HQ"
:effect (effect (move card :hand))}
{:msg "done"}]
choice (fn choice [abis n]
{:prompt "Choose an ability to resolve"
:choices (map make-label abis)
:async true
:effect (req (let [chosen (some #(when (= target (make-label %)) %) abis)]
(wait-for
(resolve-ability state side chosen card nil)
(if (and (pos? (dec n)) (not= "done" (:msg chosen)))
(continue-ability state side (choice (remove-once #(= % chosen) abis) (dec n)) card nil)
(effect-completed state side eid)))))})
ability {:async true
:once :per-turn
:effect (effect (continue-ability (choice all (if (< 1 (count (filter asset? (all-active-installed state :corp))))
1
3)) card nil))}]
{:derezzed-events [(assoc corp-rez-toast :event :runner-turn-ends)]
:events [(assoc ability :event :corp-turn-begins)]
:abilities [ability]})

"Warden Fatuma"
(let [new-sub {:label "[Warden Fatuma] Force the Runner to lose 1 [Click], if able"}]
(letfn [(all-rezzed-bios [state]
Expand Down
Loading

0 comments on commit d55afd2

Please sign in to comment.