Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement Recurring and Placed Credits #4262

Merged
merged 44 commits into from
Jun 10, 2019
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
f83bc2b
First approach to implementing a credits prompt
lostgeek May 30, 2019
14baef0
Change to make-eid to reuse fields from old eid
lostgeek May 30, 2019
935a996
pay-credits working with recurring credits
lostgeek May 30, 2019
ab2e911
Structure of :interactions :pay-credits changed
lostgeek Jun 1, 2019
7439330
pick-credit-providing-cards now calling provider-func only once
lostgeek Jun 1, 2019
d96b699
Comparing :cid instead of whole cards
lostgeek Jun 1, 2019
5846ee4
Fixed order of args on pick-virus-counters-to-spend
lostgeek Jun 1, 2019
cd43714
pay-credits now works on paid-abilities
lostgeek Jun 1, 2019
7f95a68
After using pay-credits, rest will now be paid from credit pool
lostgeek Jun 1, 2019
e761a42
I accidentally a verb
lostgeek Jun 1, 2019
5be62e7
Added pay-credits prompts to a bunch of cards
lostgeek Jun 1, 2019
71711f4
pay-credits on playing Events (and Operations)
lostgeek Jun 1, 2019
a17bd01
Reverted eid change in move
lostgeek Jun 1, 2019
c7fa595
Added pay-credits for removing tags
lostgeek Jun 1, 2019
6d95403
Trim whitespace on remove tag message
lostgeek Jun 1, 2019
8db6dd5
Added effect-completed for remove-tag
lostgeek Jun 2, 2019
32c1ed3
Refactor and speed up pick-credit-providing-cards
NoahTheDuke Jun 3, 2019
7b6f089
Merge pull request #1 from NoahTheDuke/lostgeek-pay-credits-prompt
lostgeek Jun 4, 2019
9650c9d
Implemented Noahs comments
lostgeek Jun 4, 2019
45c4381
Added pay-credits prompt to rezzing cards
lostgeek Jun 4, 2019
6fef990
Swapped The Root with Off the Grid to avoid pay-credits prompt
lostgeek Jun 4, 2019
027e3ce
Removed test-refresh...
lostgeek Jun 4, 2019
c48cf98
Added pay-credits prompt to installing corp cards
lostgeek Jun 4, 2019
4bce666
Added pay-credits prompt to advancing cards
lostgeek Jun 5, 2019
2084354
Added pay-credits to Trickster Taka and Cold Read
lostgeek Jun 5, 2019
2abc341
Implemented pay-credits prompt for Flame-out
lostgeek Jun 5, 2019
3e1acd0
Removed unnecessary do
lostgeek Jun 5, 2019
4778e80
Implement pay-credits prompts for trashing accessed cards
NoahTheDuke Jun 6, 2019
534ad1c
Implement pay-credit prompts for traces
NoahTheDuke Jun 6, 2019
ef4a8da
Added pay-credits prompt to Patchwork. Reworked :custom functions
lostgeek Jun 8, 2019
4256ba1
Merge branch 'pay-credits-prompt' into lostgeek-pay-credits-prompt
lostgeek Jun 8, 2019
5592046
Merge pull request #2 from NoahTheDuke/lostgeek-pay-credits-prompt
lostgeek Jun 8, 2019
2a48ca4
Fixed bugs introduced in the merge...
lostgeek Jun 8, 2019
02a8dab
play-ability now works correctly with can-pay?
lostgeek Jun 8, 2019
3889041
Tests for pay-credits prompts on installing cards as Runner and Steal…
lostgeek Jun 8, 2019
231a201
Tests for pay-credits prompts on paid abilities on icebreakers and cr…
lostgeek Jun 9, 2019
2385781
Tests for pay-credits prompt on playing events and removing tags
lostgeek Jun 9, 2019
d9e0005
Tests for pay-credits prompt on rezzing cards. Fixed
lostgeek Jun 9, 2019
51637cd
Fixed previous tests that used `changes-credits`
lostgeek Jun 9, 2019
5777e51
Tests for pay-credits prompts on installing and advancing Corp cards
lostgeek Jun 9, 2019
608e874
Fixed Thunder Art Gallery + Sahasrara + pay-credits interaction
lostgeek Jun 9, 2019
5ed94de
Clean up custom pay-credit effects, cold read
NoahTheDuke Jun 9, 2019
d06167a
Merge pull request #3 from NoahTheDuke/lostgeek-pay-credits-prompt
lostgeek Jun 9, 2019
23a91b5
Net Mercur now shows pay-credits prompt during runs and traces
lostgeek Jun 9, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/clj/game/cards/resources.clj
Original file line number Diff line number Diff line change
Expand Up @@ -561,7 +561,9 @@

"Crash Space"
{:interactions {:prevent [{:type #{:meat}
:req (req true)}]}
:req (req true)}]
:pay-credits {:req (req (= :remove-tag (:source-type eid)))
:type :recurring}}
:recurring 2
:abilities [{:label "Trash to prevent up to 3 meat damage"
:msg "prevent up to 3 meat damage"
Expand Down
9 changes: 5 additions & 4 deletions src/clj/game/core/actions.clj
Original file line number Diff line number Diff line change
Expand Up @@ -574,10 +574,11 @@
"Click to remove a tag."
[state side args]
(let [remove-cost (max 0 (- 2 (get-in @state [:runner :tag-remove-bonus] 0)))]
(when-let [cost-str (pay state side nil :click 1 :credit remove-cost)]
(lose-tags state :runner 1)
(system-msg state side (build-spend-msg cost-str "remove 1 tag" "removes 1 tag"))
(play-sfx state side "click-remove-tag"))))
(wait-for (pay-sync state side (make-eid state {:source :action :source-type :remove-tag}) nil :click 1 :credit remove-cost)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since removing tags is now awaitable, I should test a case of Sahasrara + Thunder Art Gallery to check if all the prompts are handled correctly.

(when-let [cost-str async-result]
(lose-tags state :runner 1)
(system-msg state side (build-spend-msg cost-str "remove 1 tag" "removes 1 tag"))
(play-sfx state side "click-remove-tag")))))

(defn continue
"The runner decides to approach the next ice, or the server itself."
Expand Down