It is currently 24 Apr 2018, 21:01
   
Text Size

Extension allowing formats to be constrained by card rarity

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Agetian, friarsol, Blacksmith, KrazyTheFox, CCGHQ Admins

Extension allowing formats to be constrained by card rarity

Postby lukegothic » 04 Dec 2017, 21:36

Some people were requesting to be able to filter Pauper legal cards while building their Pauper decks, so I extended the format reader and it is now able to understand a new parameter on the format definitions called Rarities. You can put there any combination of valid rarities separated by commas, for instance:
Code: Select all
Rarities: Common, Uncommon
So, to support Pauper format, you would put this in either res/blockdata/formats.txt or your customformats.txt:
Code: Select all
[Pauper]
Banned:Cloud of Faeries; Cloudpost; Cranial Plating; Empty the Warrens; Frantic Search; Grapeshot; Invigorate; Peregrine Drake; Temporal Fissure; Treasure Cruise; Goblin Grenade; High Tide; Hymn to Tourach; Sinkhole
Rarities:Common
Code-wise, the patch just throws some code into the class GameFormat so it can use this new information, and while filtering cards, if the Rarities parameter is present it adds a new predicate to the filtering function checking for card rarity.

Included patch:
Attachments
supportrarityconstraininformats.zip
(2.12 KiB) Downloaded 16 times
lukegothic
 
Posts: 1
Joined: 01 Dec 2017, 12:53
Has thanked: 0 time
Been thanked: 1 time

Return to Developer's Corner

Who is online

Users browsing this forum: Baidu [Spider] and 4 guests


Who is online

In total there are 5 users online :: 1 registered, 0 hidden and 4 guests (based on users active over the past 10 minutes)
Most users ever online was 279 on 11 Jul 2013, 22:03

Users browsing this forum: Baidu [Spider] and 4 guests

Login Form