-
Notifications
You must be signed in to change notification settings - Fork 394
Local Development with Custom Cards
NBKelly edited this page Aug 27, 2024
·
1 revision
Or, "How do I insert cards on a local server"?
For the sake of argument, we're inserting the two unreleased FFG id's (https://ancur.fandom.com/wiki/The_Collective, https://ancur.fandom.com/wiki/Chronos_Protocol,_Haas-Bioroid) as a set, in it's own cycle.
The rough process for inserting cards is as follows:
- Start with a netrunner-data repo (see https://github.com/noahTheDuke/netrunner-data)
- The cards need to be contained in a set. Create a new set in the file
edn/sets.edn
You'll notice that each set references a cycle - that's the cycle of cards that contains it. We're going to call both of theseunreleased
for now.
{:code "unreleased"
;; the cycle that contains this set
:cycle-id "unreleased"
:deluxe false
:id "unreleased" ;;relational id (like in a database)
:name "Unreleased" ;;display name
:position 1 ;;position within the cycle
;;valid types are: campaign, core, data-pack, deluxe, draft, expansion, promo, world-champ
;; these are essentially cosmetic, only used in front-end ui
:set-type :draft
;; number of cards in the set. This can be left as nil and things should still work.
:size 2}
- The set needs to be contained in a cycle. We'll make a new cycle in
edn/cycles.edn
.
{:id "unreleased"
:name "Unreleased"
:position 14 ;;the first two digits of the card code, and the sorting classifier for the frontend. Pick a unique number.
:rotated true ;; we don't want these to be legal
:size 1} ;; there's one set within this cycle
- Now that we have a set and a cycle, we can adjust the cards that are in the set. We'll make a new file,
edn/set-cards/unreleased.edn
. Note that this essentially points to "this printing" of a card, rather than the card itself (a card can be in multiple sets, after all).
[{:card-id "the-collective-williams-wu-et-al"
:code "014001"
:flavor "Peace Through Unity"
:illustrator "Matt Zeilinger"
:position 1
:quantity 1
:set-id "unreleased"}
{:card-id "chronos-protocol-haas-bioroid"
:code "014002"
:illustrator "Emilio Rodriguez"
:position 2
:quantity 1
:set-id "unreleased"}]
- Our set now points to a set of cards that it contains. Now we need to add those cards. We'll make two files,
edn/cards/the-collective-williams-wu-et-al.edn
anded/cards/chronos-protocol-haas-bioroid.edn
;the-collective-williams-wu-et-al.edn
{:base-link 1
:deck-limit 1
:faction :shaper
:id "the-collective-williams-wu-et-al"
:influence-limit 5
:minimum-deck-size 50
:side :runner
:stripped-text "The first time you perform the same action three times in a row each turn, gain [click]."
:stripped-title "The Collective: Williams, Wu, et al."
:subtype [:cybernetic]
:text "The first time you perform the same action three times in a row each turn, gain [click]."
:title "The Collective: Williams, Wu, et al."
:type :identity
:uniqueness false}
;;chronos-protocol-haas-bioroid.edn
{:deck-limit 1
:faction :haas-bioroid
:id "chronos-protocol-haas-bioroid"
:influence-limit 15
:minimum-deck-size 45
:side :corp
:stripped-text "Whenever the Runner trashes a card for brain damage, they remove all copies of that card from the game (installed, in the heap, stack, grip, or any other location). Then, they shuffle their stack."
:stripped-title "Chronos Protocol: Haas-Bioroid"
:subtype [:division]
:text "Whenever the Runner trashes a card for brain damage, they remove all copies of that card from the game (installed, in the heap, stack, grip, or any other location). Then, they shuffle their stack."
:title "Chronos Protocol: Haas-Bioroid"
:type :identity
:uniqueness false}
- We need to combine all of the individual files into one blob that our
jinteki
repo can read. Runclj -X:combine
. - Switch to your jinteki repo
- If you have images for your cards, drop them in
resources/public/img/cards/en/default/stock/[code].png
, where[code]
is the code of the card as seen in it'sset-cards
file. In this case, it will be014001.png
and014002.png
. - Run
lein fetch -l [path/to/netrunner-data]
And you should be done. If you followed the steps, everything should work. If things don't work, then chances are one of the relational :id
keys is wrong or missing, or you're inserted a new feature (like a new subtype) and haven't updated the relevant file.