How to use BBC tags for Magic content

Started by Den, 2008-Oct-24 09:10

Previous topic - Next topic

Den

I added some useful BBC tags for Magic cards, symbols, and decks.

When you are writing a message, you can see three rows of BBC tags above the text box. The third row is for Magic. The icons in order are (1) card, (2) mana symbol, and (3) deck.


CARD LINK
The first icon with the Magic card back is for creating a link to autocard. The code for a single card is
[card]cardname[/card]

So for example
[card]zap[/card]
will create
[card]zap[/card]

If you want to type an alternate name, put the alias inside the opening brackets, like so
[card=Finkel]shadowmage infiltrator[/card]
will create
[card=Finkel]shadowmage infiltrator[/card]


MANA SYMBOLS
The second icon is for mana symbols and other symbols; it has all five colored mana symbols in a circle. The code for inserting symbols is
[mana]CC[/mana]

Put the entire cost inside, like so
[mana]1RG[/mana]
and it comes out
[mana]1RG[/mana]

Hybrids halves should be separated by a slash '/', in any order. Both of these work:
[mana]R/G[/mana]
[mana]G/R[/mana]
[mana]g/r[/mana][mana]r/g[/mana]

The monocolor hybrids use the digit 2 in place of a color, in any order. Both of these work:
[mana]2/w[/mana]
[mana]w/2[/mana]
[mana]2/w[/mana][mana]w/2[/mana]

Put a space between the numbers if you have two consecutively, but want them to show up separately. For instance, a number and a monocolor hybrid should be separated by a space.
[mana]4 2/w[/mana]
[mana]4 2/w[/mana]
[mana]2 4[/mana]
[mana]2 4[/mana]

These are the valid letters, numbers, and hybrids that can be used within the mana tags:
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 i
[mana]0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 i[/mana]
w u b r g c x y z s t q p k
[mana]w u b r g c x y z s t q p k[/mana]
w/u u/w u/b b/u b/r r/b r/g g/r w/b b/w u/r r/u b/g g/b r/w w/r g/u u/g
[mana]w/u u/w u/b b/u b/r r/b r/g g/r w/b b/w u/r r/u b/g g/b r/w w/r g/u u/g[/mana]
2/w w/2 2/u u/2 2/b b/2 2/r r/2 2/g g/2
[mana]2/w w/2 2/u u/2 2/b b/2 2/r r/2 2/g g/2[/mana]
p/w w/p p/u u/p p/b b/p p/r r/p p/g g/p p/c c/p
[mana]p/w w/p p/u u/p p/b b/p p/r r/p p/g g/p p/c c/p[/mana]
p/w/u p/w/b p/u/b p/u/r p/b/r p/b/g p/r/g p/r/w p/g/w p/g/u
[mana]p/w/u p/w/b p/u/b p/u/r p/b/r p/b/g p/r/g p/r/w p/g/w p/g/u[/mana]



SMILEYS
Alternatively, you can use the 'smiley' mana icons, listed after the more familiar smileys. Just click the ones you need and the mana symbols will be added right at the text cursor. The codes for the Magic smileys all start with :m followed by the number or letter of the color(s). For instance,
:m4 :mw
produces
:m4 :mw

Hybrid mana use the order of the color or number in the top left half, then the bottom right half. For instance,
:m2w
makes
:m2w

Phyrexian hybrid mana use mphC, where C is the color. For instance,
:mphw
makes
:mphw

Smiley code for Planeswalk and Chaos/Planechase symbol are

:mpw
:mpc

:mpw :mpc



DECKLIST
The third icon turns a list of cards into a deck listing with autocards. The code to produce a deck list formatting is
[deck=decktitle]decklist[/deck]

The deck title is optional. If you want to leave it blank, then use the simpler code
[deck]decklist[/deck]

If you have a sideboard, simply put the word "sideboard" on its own line, then the cards below it.

Comments can come after a card if they are put inside curly brackets or after double dash, e.g.:
3 Healing Salve {comment }
1 Flash -- restricted


For example, using the following code to create a decklist

[deck=Merfish]
--Lands
4 Wanderwine Hub
4 Adarkar Wastes
2 Horizon Canopy
4 Terramorphic Expanse
3 Gemstone Mine
2 Faerie Conclave
3 Snow-Covered Island
1 Snow-Covered Plains
1 Snow-Covered Forest

--Creatures
4 Silvergill Adept
4 Riptide Pilferer
4 Lord of Atlantis --[b]my namesake on other forums[/b]
4 Merrow Reejerey
3 Tarmogoyf --[mana]1g[/mana]

--Spells
4Ponder
3Psionic Blast
3 Unstable Mutation
4 Bound in Silence
3 Ajani Goldmane {should be [card]Reveillark[/card]}

--sideboard
4 Unsummon
4 Rune Snag
4 Oblivion Ring
3 Disenchant
[/deck]


will produce a nicely formatted deck listing:
[deck=Merfish]
--Lands
4 Wanderwine Hub
4 Adarkar Wastes
2 Horizon Canopy
4 Terramorphic Expanse
3 Gemstone Mine
2 Faerie Conclave
3 Snow-Covered Island
1 Snow-Covered Plains
1 Snow-Covered Forest

--Creatures
4 Silvergill Adept
4 Riptide Pilferer
4 Lord of Atlantis --my namesake on other forums
4 Merrow Reejerey
3 Tarmogoyf --[mana]1g[/mana]

--Spells
4Ponder
3Psionic Blast
3 Unstable Mutation
4 Bound in Silence
3 Ajani Goldmane {should be [card]Reveillark[/card]}

--sideboard
4 Unsummon
4 Rune Snag
4 Oblivion Ring
3 Disenchant
[/deck]

Note: If you input a deck list from Magic WorkStation or wizards forums, our script is smart enough to ignore the set IDs and count separators. This way, you can simply cut and paste; don't worry about editing the text just so autocard will come up correctly. For instance, if you have something like this:
[deck]
{MWS set tags}
4 [EVE] Archon of Justice

{wizards forums}
4*Ballynock Trapper {input}
4 x Cenn's Enlistment {output}

{other ways to count card}
x4 Zap
4x Flare
Xira Arien
[/deck]


all the set IDs are simply ignored, giving a cleaner look:
[deck]
{MWS set tags}
4 [EVE] Archon of Justice

{wizards forums}
4*Ballynock Trapper {input}
4 x Cenn's Enlistment {output}

{other ways to count card}
x4 Zap
4x Flare
Xira Arien
[/deck]

[deck]
--range of numbers
1-2 Frogmite
3-4 Eternal Witness
[/deck]

FYI: the regex pattern I use is /^\s*(\/\/.*|SB: )?(?:x?(?=\d))?(\d+(?=\s*)?\-?(?=\s*)?\d*)?\s*(\s?x |\*|\[\w+?])?\s*([^{]*?)\s*?({.*}|--.*)?\s*$/


DISCLAIMER
This site is NOT affiliated with Magic's creators, Wizards of the Coast. All card images and mana symbols are copyright Wizards of the Coast. Code modifications to the forum software, SMF, are made by me and are in the public domain. The SMF mod can be downloaded at http://custom.simplemachines.org/mods/index.php?mod=2364
Support me on Patreon

I saw. I conquered. I came.

Apidea

Great mod, Is It possible install to smf 1.1.12?

Den

I don't have 1.1.2 forum, so I wouldn't be able to test it. However, you can download the mod and extract the source code. Mainly you need the new functions and new BBC codes inserted into the array. Pay attention to the global variables which might be different between 1.x and 2.x; i.e. $modSettings, $settings, $context, etc..
Support me on Patreon

I saw. I conquered. I came.

ADMIN

#3
Phyrexian Hybrid Mana Symbols (in SMF Package v1.3)

[mana]p/C[/mana] [mana]C/p[/mana]
e.g. [mana]p/w[/mana] [mana]w/p[/mana]

[mana]p/w[/mana] [mana]w/p[/mana]
[mana]p/u[/mana] [mana]u/p[/mana]
[mana]p/b[/mana] [mana]b/p[/mana]
[mana]p/r[/mana] [mana]r/p[/mana]
[mana]p/g[/mana] [mana]g/p[/mana]
[mana]p/c[/mana] [mana]c/p[/mana]

:mphC
e.g. :mphw

:mphw
:mphu
:mphb
:mphr
:mphg
:mphc

ADMIN

Magic Workstation (MWS)

[deck]
// Lands
    3 [R] Tropical Island
    2 [R] Bayou
    1 [R] Underground Sea
    1 [FUT] Dryad Arbor
    1 [SH] Volrath's Stronghold
    1 [TE] Wasteland
    4 [ZEN] Misty Rainforest
    3 [ON] Polluted Delta
    1 [ZEN] Verdant Catacombs
    1 [CS] Snow-Covered Island
    1 [CS] Snow-Covered Forest
    1 [CS] Snow-Covered Swamp

// Creatures
    4 [CFX] Noble Hierarch
    3 [FUT] Tarmogoyf
    2 [FD] Eternal Witness
    1 [CFX] Progenitus

// Spells
    3 [WWK] Jace, the Mind Sculptor
    3 [VI] Natural Order
    3 [MBS] Green Sun's Zenith
    4 [AL] Force of Will
    4 [NPH] Mental Misstep
    4 [IA] Brainstorm
    2 [TE] Intuition
    1 [RAV] Life from the Loam
    3 [NPH] Dismember
    2 [MBS] Go for the Throat
    1 [ARB] Maelstrom Pulse

// Sideboard
SB: 3 [AP] Pernicious Deed
SB: 4 [PLC] Extirpate
SB: 2 [ZEN] Spell Pierce
SB: 3 [TSP] Krosan Grip
SB: 3 [MR] Damping Matrix
[/deck]

ADMIN

v1.8
added colorless (diamond) mana, using letter c
added infinite mana, using letter i
changed chaos letter to k

ADMIN

#6

v1.9
new default MTGAutocard_URL : scryfall
fixed deprecated PHP functions, SMF vars
card tag, switch data, now [card=alias]cardname[/card]
v2.0
database add smiley codes for mana symbols
v2.1
new default MTG Autocard URL: https://ieants.cc/magic/scry.php?name=
fix deck export