Commit Graph

332 Commits

Author SHA1 Message Date
ebbit1q
7c1b4aca2e
change occult epiphany to use x (#191)
Co-authored-by: github-actions <github-actions@github.com>
2022-12-03 14:25:19 +01:00
tooomm
f3d956033d
Update check_links.yml (#189) 2022-11-30 03:27:06 +01:00
ebbit1q
d56eddda0c
sort sets and cards (#165)
* use proper set code for fnm 2012 token

* change order of each set using script

some sets were not properly sorted
the release date of SLD might be contestable but the script seems to
have found 27 real discrepancies
the release date is as shown in scryfall, eg SLD has a date of 2019-12-02

bash is a real programming language and I can put it on my resume,
don't tell me otherwise:
set -eo pipefail
mapfile -t sets < <(LC_ALL=C curl -L 'https://mtgjson.com/api/v5/SetList.json' | jq -r '.data[]|.releaseDate,.code' | sed 'N;s/\n/ /' | sort -r | sed 's/.* //')
setrx="<set[^>]*>([^<]+)</set>"
list=()
while IFS= read -r line; do
  if [[ $line =~ $setrx ]]; then
    code="${BASH_REMATCH[1]}"
    list+=("$code" "$line")
  elif [[ $code ]]; then
    for set_ in "${sets[@]}"; do
      for (( i=0; i<${#list[@]}; i+=2 )); do
        code="${list[$i]}"
        if [[ $set_ == "$code" ]]; then
          echo "${list[$i+1]}"
        fi
      done
    done
    code=""
    list=()
    echo "$line"
  else
    echo "$line"
  fi
done <tokens.xml | sponge tokens.xml

* sort all cards using script

actually there was only one discrepancy in the file before " Token" was
added to a lot of entries (Wasp)
however the addition has changed the sort order for many cards,
eg "Bird Token" vs "Bird Soldier Token"
cards after the last normal token have not been included (Zombie Wizard)

still using bash of course:
last="Zombie Wizard Token"
startrx=" -->"
namerx="<name>([^<]*)</name>"
endrx="</card>"
declare -A list # associative array
{
while IFS= read -r line; do
  echo "$line"
  if [[ $line =~ $startrx ]]; then # eat first comment
    break
  fi
done
while
  while
    IFS= read -r line || exit 2
    card+="$line
"
    [[ ! $line =~ $namerx ]]
  do :; done
  name="${BASH_REMATCH[1]}"
  while
    IFS= read -r line || exit 3
    card+="$line
"
    [[ ! $line =~ $endrx ]]
  do :; done
  list[ "$name"]="$card"
  keys+="
$name"
  card=""
  [[ $name != "$last" ]]
do :; done
<<<"${keys:1}" LC_ALL=C sort --ignore-case | while IFS= read -r key; do
  echo -n "${list[ $key]}"
done
cat
} <tokens.xml | sponge tokens.xml

* sort reverse-related tags again

slightly changed script from 6ca51e5

tag="reverse-related"
relationrx="<$tag([^>]*)>([^<]*)</$tag>"
declare -A list # associative array
while IFS= read -r line; do
  if [[ $line =~ $relationrx ]]; then
    yes=1
    name="${BASH_REMATCH[2]}"
    args="${BASH_REMATCH[1]}"
    key="$name	$(printf "%03d" "${#args}")$args"
    list["$key"]="$line"
    keys+="
$key"
  elif [[ $yes ]]; then
    # LC_ALL=C determines the sort behavior!
    <<<"${keys:1}" LC_ALL=C sort --ignore-case | while read -r; do
      echo "${list[$REPLY]}"
    done
    yes=""
    list=()
    keys=""
    echo "$line"
  else
    echo "$line"
  fi
done <tokens.xml | sponge tokens.xml

* update version
2022-11-10 00:25:31 +01:00
SlightlyCircuitous
9afb95f720
Add BRO Tokens (#187)
* Add BRO Tokens

*Adds 6 new tokens and 1 new emblem
*Adds art lines for 4 reprints

* Add exclude to Urza's command

* Add Exclude to Ashnod, Flesh Mechanist

* Update tokens.xml

Co-authored-by: ebbit1q <ebbit1q@gmail.com>

* Add Saheeli to Thopter reverse-related

* Update tokens.xml

Co-authored-by: ebbit1q <ebbit1q@gmail.com>

* Update tokens.xml

Co-authored-by: ebbit1q <ebbit1q@gmail.com>

* Update tokens.xml

Co-authored-by: ebbit1q <ebbit1q@gmail.com>

* Update tokens.xml

Co-authored-by: ebbit1q <ebbit1q@gmail.com>

* Update tokens.xml

Co-authored-by: ebbit1q <ebbit1q@gmail.com>

* Update tokens.xml

Co-authored-by: ebbit1q <ebbit1q@gmail.com>

* update version

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-11-09 17:59:17 +01:00
SlightlyCircuitous
757b619c0c
Add BOT tokens (#186)
* Add BOT tokens

*Adds 2 new tokens

* Update tokens.xml

* update version

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-11-09 16:42:31 +01:00
SlightlyCircuitous
711dcec236
Add UNF tokens (#185)
* Add UNF tokens

*Adds 7 new tokens and art line for 4 reprints
*Only adds art for the front of Contortionist since the back is probably not useful in digital space

* fixes

* update version

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-11-09 16:32:06 +01:00
SlightlyCircuitous
328b73c20d
Add 40K Tokens (#183)
* Add 40K Tokens

*Adds 21 new token entries and set/reverse-related lines for 2 reprints
*Corrects Hazezon, Shaper of Sand's exclude from count="x" to count="x=2" to better reflect token creation logic

* Update tokens.xml

Co-authored-by: ebbit1q <ebbit1q@gmail.com>

* Update tokens.xml

Co-authored-by: ebbit1q <ebbit1q@gmail.com>

* update tokens

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-09-28 17:52:23 +02:00
SlightlyCircuitous
af4f9b2af0
Add DMC Tokens (#182)
* Add DMC Tokens

*Adds 2 new tokens and art for 10 reprinted tokens
*Removes several unneeded empty tags
*Adds '0' to empty cmc tags (seems to be the prevailing pattern)
*Fix typo in pirate token

* corrections

we don't add additional count=x relations for on cast triggers
names have to be unique across all datasets, take care with named tokens
changed some set tags

* update version

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-09-27 00:11:50 +02:00
SlightlyCircuitous
f406b1abcb
Fix typos in DMU tokens (#181)
* Fix typos in DMU tokens

broke a couple of tags by accident

* update version

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-09-26 22:15:36 +02:00
SlightlyCircuitous
3e64f0d0f4
Add Tokens from DMU (#179)
* Add Tokens from DMU

*Adds entries for 12 new tokens and art lines for 14 reprinted tokens
*Replaces Sand Warrior token art from blog with official print.

* update version

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-09-26 22:05:01 +02:00
tooomm
265a474130
fix workflow issue
we want to see  if there are issues on the run
2022-09-12 15:01:08 +02:00
tooomm
cb37bdf540
CI: Check image links (#131) 2022-09-12 14:13:36 +02:00
mainman879
6ce8f96a55
Adds Foretell maintype of State (#176)
* Adds Foretell maintype

* update version

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-08-17 00:32:27 +02:00
SlightlyCircuitous
dede5505a5
Split Challenge Decks and Heros By Set (#173)
* Organizes the horde cards into their three challenge decks (FTH, BTH, DAG)
* Organizes the Hero cards and equipment into their three Hero's Path sets (HP1,HP2,HP3), as per Scryfall
* Puts Garruk the Slayer in PPC1 instead of M15, as per Scryfall
* Updates all URLs to Scryfall large
2022-08-10 14:51:15 +02:00
SlightlyCircuitous
77e04724cb
Add RNA Guildkit (GK1+GK2) Tokens (#172)
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
2022-08-07 16:15:38 +02:00
tooomm
5ead6f9148
Fix ISD Ooze token picture (#174)
Co-authored-by: github-actions <github-actions@github.com>
2022-08-07 15:36:12 +02:00
SlightlyCircuitous
0ba6681d1c
Add VOC and UMA Tokens (#171)
* Add VOC and UMA Tokens

* Replaces several fanmade tokens with official prints from VOC or UMA while adding the rest of the tokens from those sets

*Moves Unicorn Token out of the Emblem section and up into the Tokens section

*Moves Zariel Emblem to alphabetize

* update version

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-07-11 14:04:27 +02:00
tooomm
5903f6ea17
imgur --> scryfall (#168)
* more scryfall links

* update version to 20220707b

Co-authored-by: github-actions <github-actions@github.com>
2022-07-07 10:50:31 +02:00
tooomm
beecf68502
Fix Undercity image (#167)
* fix Undercity image

* update version to 20220707

Co-authored-by: github-actions <github-actions@github.com>
2022-07-07 02:33:35 +02:00
SlightlyCircuitous
3ccf8b40fd
Add Un-Set Tokens (#166)
* Adds Un-Set Tokens

*Adds novel tokens from UND, UST and UGL (UNH has no tokens on scryfall) to go with their related cards
--Acorn Stash, Beeble, Brainiac, Dragon (Gold), Giant Teddy Bear, Faerie Spy, Rogue (w/ Menace), Storm Crow, Sheep (2/2)
  --Dragon and Giant Teddy Bear are Gold and Pink, respectively, so I have left them as colorless (in line with scryfall) with a comment in case someone is curious about them in the future

*Adds new art for Construct, Gnome Goat, Goblin, Pegasus, Soldier, Squirrel, and Zombie to their existing entries
--In the case of Gnome, I have replaced the gnome token art with this one since it seemed to be a homemade placeholder. Happy to revert it if y'all prefer a black bordered token for the main art or if I misjudged its officialness

* Apply suggestions from code review

Co-authored-by: ebbit1q <ebbit1q@gmail.com>

* Update tokens.xml

* Address Second Round of Comments

*Changed 'card' to 'token' in Dragon Token and Giant Teddy Bear Token text.

*Moved Acorn Stash to be just above Energy Reserve (the Counter holder tokens seem to be alphabetized) and changed its type and Maintype to 'Counter'.

* Add exclude to Acorn Stash

That seems to be the tradition for any card listed under a Counter-holder type token.

* update version

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-07-04 23:43:25 +02:00
mainman879
6228a90011
Adds NCC Tokens (#164)
* Update tokens.xml

* sort

* fixes

* add missing relation

* Master of Ceremonies Suggestion

Co-authored-by: ebbit1q <ebbit1q@gmail.com>

* Adding excluded x counts

* update version

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-07-04 00:11:00 +02:00
SlightlyCircuitous
a150a9c000
De-Gather all Remaining Links (#163)
* De-Gather all Remaining Links

*Updates all token links (including emblems) still using Gatherer links to Scryfall Large links
--Links updated algorithmically; see pull request for algorithms

* update version

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-07-02 15:31:19 +02:00
ebbit1q
589b2788bf
remove unused token relations (#160)
* search for unused relations

reverse-related is assumed to only be used for external references to
the xml
related tags should be used for internal links to make this easier and
to avoid certain errors eg the Phyrexian Insect here

the following lazy bash has been used to find these:
\#!/bin/bash
relationrx='<reverse-related([^>]*)>([^<]*)</reverse-related>'
while read -r line; do
  if [[ $line =~ $relationrx ]]; then
    name="${BASH_REMATCH[2]}"
    #args="${BASH_REMATCH[1]}"
    if ! grep -F "$name" "$HOME/.local/share/Cockatrice/Cockatrice/cards.xml" -q; then
      echo "$name"
    fi
  fi
done <tokens.xml

the following relations are affected:
Domri, Chaos Bringer (Emblem) is related internally, moved
Ajani, Adversary of Tyrants (Emblem) is related internally, moved
Chief Jim Hopper became Sophina, Spearsage Deserter, moved
Max, the Daredevil became Elmar, Ulvenwald Informant, moved
Will the Wise became Wernog, Rider's Chaplain, moved
"Big Boy Forest Crusher" was a spoiler placeholder, deleted
"Destoroyah, Perfect Lifeform" is called Everquill Phoenix, deleted
"What's Kraken" was a spoiler placeholder, deleted
Liliana, the Last Hope (Emblem) is related internally, moved
Insect Token has been renamed to Phyrexian Insect token before and had its Poison Counter relationship lost, moved
`Snake Token ` is related internally, moved
Obsessed Astronomer was probably a spoiler placeholder?, deleted
"Obosh, With The Leggies" was a spoiler placeholder, deleted
"Gigan, Cyberclaw Terror" is called Gyruda, Doom of Depths, deleted

* sort all reverse-related tags

less lazy script but still bash:
\#!/bin/bash
tag="reverse-related"
relationrx="<$tag([^>]*)>([^<]*)</$tag>"
numberrx='[0-9]+'
declare -A list # associative array
while IFS= read -r line; do
  if [[ $line =~ $relationrx ]]; then
    yes=1
    name="${BASH_REMATCH[2]}"
    args="${BASH_REMATCH[1]}"
    if [[ $args =~ $numberrx ]]; then
      args="$(printf "%03d" "${BASH_REMATCH[0]}")$args"
    fi
    list[ "$name$args"]="$line"
    keys+="
$name$args"
  elif [[ $yes ]]; then
    # LC_ALL=C determines the sort behavior!
    <<<"${keys:1}" LC_ALL=C sort --ignore-case | while read -r key; do
      echo "${list[ $key]}"
    done
    yes=""
    list=()
    keys=""
    echo "$line"
  else
    echo "$line"
  fi
done <tokens.xml | sponge tokens.xml

* remove duplicate entry

this also needed a script, because why not:
\#!/bin/bash
while IFS= read -r line; do
  if [[ $line == "$last" ]]; then
    echo "$line"
  fi
  last="$line"
done <tokens.xml

* update version
2022-07-01 20:24:20 +02:00
SlightlyCircuitous
664c60f987
Update Gatherer token links that need special care to Scryfall (#162)
* Update multiple-art token links to Scryfall

*Manually updated tokens with multiple printings in the same set from Gatherer to Scryfall as per https://github.com/Cockatrice/Magic-Token/issues/149
--Also did a blue Thopter (C18) and Copy (SNC) since they were easy to locate while looking

*Moved */* Zombie Token (EMN) from the 2/2 block to the */* block (hopefully it has the right priority)

* Removed duplicate token art

* Re-add duplicates

*Reverses previous commit removing duplicates (and replaces a gatherer link for some knights with multiple artwork that I missed before)

*Replaces gatherer art for 'Phyrexian' tokens, UST double tokens (backs only), Morph, Manifest, the State cards (The Initiative, Foretell, etc), Companion, and Copy with Scryfall large links (and also a plant because it was flagged by my script for some unknown reason)

* update version

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-07-01 20:18:15 +02:00
SlightlyCircuitous
18c28f80a1
Move MH2 Construct Token image to Proper Card (#159)
* Move MH2 Construct Token image to Proper Card

*Move MH2 Construct Token to the 0/0 Construct card block as that one is a 0/0 not a 6/12
--Link is now a scryfall large as per https://github.com/Cockatrice/Magic-Token/issues/149

*Changed two 'The' to 'the'  to be in line with Oracle text (Tuktuk the Returned and Negan, the Cold-Blooded)

* update version

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-06-15 20:39:19 +02:00
SlightlyCircuitous
82fedcad01
Modernize Custom Tokens and Add 2 More (#158)
* Modernize Custom Tokens and Add 2 More

*Updates custom tokens created by Broken Visage, Wall of Kelp, and Jungle Patrol (previously added in https://github.com/Cockatrice/Magic-Token/pull/156) to more modern card frames and (likely) higher quality images.

*Adds token art for the Wolves of the Hunt token created by Master of the Hunt and the Unicorn Token created by Blessed Sanctuary as asked for in https://github.com/Cockatrice/Magic-Token/issues/85. Supersedes the Unicorn token proposed in https://github.com/Cockatrice/Magic-Token/pull/155 as the card frame is more modern and the image should be higher quality.

* Update tokens.xml

* Public Links

Made the repo I have the images in public and re-added the links just in case they changed.

* update version

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-06-11 19:32:53 +02:00
ebbit1q
96553e567a
move book of exalted deeds token to the white angel entry (#157)
* move book of exalted deeds token to the white angel entry

add a comment, maybe it helps

* abcdefghijklmnopqrstuvwxyz

* remove comment

* update version to 20220611

Co-authored-by: github-actions <github-actions@github.com>
2022-06-11 16:01:53 +02:00
SlightlyCircuitous
ff9ed4169c
Add art for 3 missing tokens (#156)
* Add art for 3 missing tokens

Add custom art tokens for Broken Visage, Wall of Kelp, and Jungle Patrol.

* update version

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-06-07 02:37:20 +02:00
mainman879
b150f580c5
CLB Tokens (#147)
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
2022-06-02 23:24:50 +02:00
tooomm
6a6c9b9f45
Improve Readme (#154)
* add token count

* Update README.md

* Update README.md

* Update README.md

* Update README.md

* discard other changes

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-06-02 22:39:18 +02:00
tooomm
3ac22d8413
Fix wrong picture for 4/4 elemental token (#152)
* fix image link

* update version to 20220602b

Co-authored-by: github-actions <github-actions@github.com>
2022-06-02 21:20:42 +02:00
ebbit1q
e54b3aa136
remove misspellings of picURL (#150)
* remove misspellings of picURL

* update version to 20220602

Co-authored-by: github-actions <github-actions@github.com>
2022-06-02 11:09:01 +02:00
tooomm
591392e9c4
Fix all scryfall links (#148)
* new scryfall links

* update version to 20220531

Co-authored-by: github-actions <github-actions@github.com>
2022-06-01 00:07:10 +02:00
tooomm
690097be50
Add CC2 zombie token (#146)
* Add CC2 zombie token

* update version to 20220516b

Co-authored-by: github-actions <github-actions@github.com>
2022-05-17 01:10:36 +02:00
tooomm
17736838bd
Fix set for snake token (#144)
* fix set

* update version to 20220516

Co-authored-by: github-actions <github-actions@github.com>
2022-05-16 18:56:56 +02:00
mainman879
9441cca678
Fixes 2 snake tokens (#143)
* Fixes 2 snake tokens

https://github.com/Cockatrice/Magic-Token/issues/140 Ophiomancer didn't have an official token until now so this adds that. The snake for Hapatra Vizier of Poisons had a broken link so this also fixes that.

* Fix wrong link

* update version

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-05-09 04:12:51 +02:00
ebbit1q
09b759f64e
set kaito's ninjas to be 1/1 instead of */* (#142)
* set kaito's ninjas to be 1/1 instead of */*

* update version to 20220428

Co-authored-by: github-actions <github-actions@github.com>
2022-04-28 11:48:19 +02:00
Psithief
7773be02f1
Streets of New Capenna tokens (#141)
* Streets of New Capenna tokens

* Fixed the ordering of space vs. hyphen

* the alphabet goes like this:

/SNC^M/related^MV/token^Mk:norm ^dt>$p^M:'<,'>sort^M:'<,'>norm ^2f<d$^P^M

* add extra entries for stimulus package and join the maestros

* remove count=x on stimulus package

* update version to 20220423

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
Co-authored-by: github-actions <github-actions@github.com>
2022-04-23 20:22:36 +02:00
Zach H
5e676f8477
Merge pull request #139 from Cockatrice/legends-snake-generator
change set of the serpent generator token to legends
2022-03-27 17:52:05 -04:00
ebbit1q
d73e66c21e
change set of the serpent generator token to legends
for some reason this used to be med which probably wasn't even an existing set code when we added the token?
2022-03-27 23:04:36 +02:00
ebbit1q
22a15ace59
full token compleation (#138)
* full token compleation

add phyrexian version of each token
move grist insect token art to correct entry

* update version to 20220228

Co-authored-by: github-actions <github-actions@github.com>
2022-02-28 03:28:54 +01:00
skwerlman
084cb7a3db
fix conflict with Unquenchable Fury from NEO (#137) 2022-02-16 21:14:11 +01:00
mainman879
03ee2b8c8b
Kamigawa Tokens (#134)
* Initial Tokens

* All NEO and some NEC tokens

No images yet for anything besides Mechtitan.

* Initial Tokens

* All NEO and some NEC tokens

No images yet for anything besides Mechtitan.

* add picUrl=""

* run linter

* Update tokens.xml

* update version

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-02-15 02:59:15 +01:00
ebbit1q
2666cee318
add workflow for updating the version on pr approval (#135)
* add workflow for updating the version on pr approval

* split into script

* apply pressure

* github parameter replacement uses double braces

* remove checks and fix repo url

* change merge behavior to merge master into the pr instead

this means it will not be required to force push when we're behind on
master

* add option to use workflow on comments

* grab correct ref from comments

* get full pr info from comment

* remove shell script

* correctly deal with having a different upstream

* prettyfy
2022-02-14 22:35:46 +01:00
ebbit1q
c69a6d4115
ranger class makes only one token (#136)
Co-authored-by: tooomm <tooomm@users.noreply.github.com>
2022-02-11 14:23:06 +01:00
tooomm
4afcfebb13 bump version 2022-02-07 00:30:16 +01:00
tooomm
3b56dc1824
fix order 2022-02-07 00:23:50 +01:00
tooomm
f3074c4dba
Add Mowu token (#132)
* Update tokens.xml

* Update tokens.xml

* fix type

* Update tokens.xml

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-02-06 00:00:36 +01:00
tooomm
b44a2bdd2a
Remove x=0 values (#101)
* remove x=0

* fix scute swarm

* Revert "fix scute swarm"

This reverts commit 58a1053d45.

* bump version

* test

Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2022-02-05 23:55:27 +01:00
tooomm
cfead3340e
Add missing BBD token (#123) 2022-02-05 23:02:34 +01:00