mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 12:18:00 +00:00
Changes to RTR/GTC guild sealed: now there's only 1 guild booster, both promos are inside.
File format for cubes adjusted
This commit is contained in:
11
.gitattributes
vendored
11
.gitattributes
vendored
@@ -13432,21 +13432,11 @@ res/sealed/GtcGuildDimir.sealed -text
|
||||
res/sealed/GtcGuildGruul.sealed -text
|
||||
res/sealed/GtcGuildOrzhov.sealed -text
|
||||
res/sealed/GtcGuildSimic.sealed -text
|
||||
res/sealed/GtcPromoBoros.sealed -text
|
||||
res/sealed/GtcPromoDimir.sealed -text
|
||||
res/sealed/GtcPromoGruul.sealed -text
|
||||
res/sealed/GtcPromoOrzhov.sealed -text
|
||||
res/sealed/GtcPromoSimic.sealed -text
|
||||
res/sealed/RtRGuildAzorius.sealed -text
|
||||
res/sealed/RtRGuildGolgari.sealed -text
|
||||
res/sealed/RtRGuildIzzet.sealed -text
|
||||
res/sealed/RtRGuildRakdos.sealed -text
|
||||
res/sealed/RtRGuildSelesnya.sealed -text
|
||||
res/sealed/RtRPromoAzorius.sealed -text
|
||||
res/sealed/RtRPromoGolgari.sealed -text
|
||||
res/sealed/RtRPromoIzzet.sealed -text
|
||||
res/sealed/RtRPromoRakdos.sealed -text
|
||||
res/sealed/RtRPromoSelesnya.sealed -text
|
||||
res/sealed/juzamjedi.sealed -text
|
||||
res/skins/dark_ascension/bg_match.jpg -text
|
||||
res/skins/dark_ascension/bg_splash.png -text
|
||||
@@ -13578,6 +13568,7 @@ src/main/java/forge/card/FormatCollection.java -text
|
||||
src/main/java/forge/card/ICardCharacteristics.java -text
|
||||
src/main/java/forge/card/ICardFace.java -text
|
||||
src/main/java/forge/card/ICardRawAbilites.java -text
|
||||
src/main/java/forge/card/IUnOpenedProduct.java -text
|
||||
src/main/java/forge/card/MagicColor.java -text
|
||||
src/main/java/forge/card/MetaSet.java -text
|
||||
src/main/java/forge/card/TriggerReplacementBase.java -text
|
||||
|
||||
@@ -1,53 +1,50 @@
|
||||
Set0:LEA|Name:Alpha|DraftPacks:3|LandSetCode:LEA|SealedPacks:6
|
||||
Set0:LEB|Name:Beta|DraftPacks:3|LandSetCode:LEB|SealedPacks:6
|
||||
Set0:2ED|Name:Unlimited|DraftPacks:3|LandSetCode:2ED|SealedPacks:6
|
||||
Set0:ARN|Name:Arabian Nights|DraftPacks:5|LandSetCode:2ED|SealedPacks:9
|
||||
Set0:ATQ|Name:Antiquities|DraftPacks:5|LandSetCode:2ED|SealedPacks:9
|
||||
Set0:3ED|Name:Revised|DraftPacks:3|LandSetCode:3ED|SealedPacks:6
|
||||
Set0:LEG|Name:Legends|DraftPacks:3|LandSetCode:3ED|SealedPacks:6
|
||||
Set0:DRK|Name:The Dark|DraftPacks:5|LandSetCode:3ED|SealedPacks:9
|
||||
Set0:FEM|Name:Fallen Empires|DraftPacks:5|LandSetCode:3ED|SealedPacks:9
|
||||
Set0:4ED|Name:Fourth Edition|DraftPacks:3|LandSetCode:4ED|SealedPacks:6
|
||||
|
||||
Set0:ICE|Set1:ALL|Set2:CSP|Name:Ice Age|DraftPacks:3|LandSetCode:ICE|SealedPacks:6
|
||||
Set0:HML|Name:Homelands|DraftPacks:5|LandSetCode:4ED|SealedPacks:9
|
||||
Set0:MIR|Set1:VIS|Set2:WTH|Name:Mirage|DraftPacks:3|LandSetCode:MIR|SealedPacks:6
|
||||
Set0:5ED|Name:Fifth Edition|DraftPacks:3|LandSetCode:5ED|SealedPacks:6
|
||||
Set0:POR|Name:Portal|DraftPacks:3|LandSetCode:POR|SealedPacks:6
|
||||
Set0:TMP|Set1:STH|Set2:EXO|Name:Tempest|DraftPacks:3|LandSetCode:TMP|SealedPacks:6
|
||||
Set0:PO2|Name:Portal Second Age|DraftPacks:3|LandSetCode:PO2|SealedPacks:6
|
||||
Set0:USG|Set1:ULG|Set2:UDS|Name:Urza|DraftPacks:3|LandSetCode:USG|SealedPacks:6
|
||||
Set0:6ED|Name:Sixth Edition|DraftPacks:3|LandSetCode:6ED|SealedPacks:6
|
||||
Set0:PTK|Name:Portal Three Kingdoms|DraftPacks:5|LandSetCode:PTK|SealedPacks:9
|
||||
|
||||
Set0:MMQ|Set1:NMS|Set2:PCY|Name:Masques|DraftPacks:3|LandSetCode:MMQ|SealedPacks:6
|
||||
Set0:INV|Set1:PLS|Set2:APC|Name:Invasion|DraftPacks:3|LandSetCode:INV|SealedPacks:6
|
||||
Set0:7ED|Name:Seventh Edition|DraftPacks:3|LandSetCode:7ED|SealedPacks:6
|
||||
Set0:ODY|Set1:TOR|Set2:JUD|Name:Odyssey|DraftPacks:3|LandSetCode:ODY|SealedPacks:6
|
||||
Set0:ONS|Set1:LGN|Set2:SCG|Name:Onslaught|DraftPacks:3|LandSetCode:ONS|SealedPacks:6
|
||||
Set0:8ED|Name:Eighth Edition|DraftPacks:3|LandSetCode:8ED|SealedPacks:6
|
||||
Set0:MRD|Set1:DST|Set2:5DN|Name:Mirrodin|DraftPacks:3|LandSetCode:MRD|SealedPacks:6
|
||||
Set0:CHK|Set1:BOK|Set2:SOK|Name:Kamigawa|DraftPacks:3|LandSetCode:CHK|SealedPacks:6
|
||||
Set0:9ED|Name:Ninth Edition|DraftPacks:3|LandSetCode:9ED|SealedPacks:6
|
||||
Set0:RAV|Set1:GPT|Set2:DIS|Name:Ravnica|DraftPacks:3|LandSetCode:RAV|SealedPacks:6
|
||||
|
||||
Set0:CSP|Name:Coldsnap|DraftPacks:3|LandSetCode:9ED|SealedPacks:6
|
||||
Set0:TSP|Set1:PLC|Set2:FUT|Name:Time Spiral|DraftPacks:3|LandSetCode:TSP|SealedPacks:6
|
||||
Set0:10E|Name:Tenth Edition|DraftPacks:3|LandSetCode:10E|SealedPacks:6
|
||||
Set0:LRW|Set1:MOR|Name:Lorwyn|DraftPacks:3|LandSetCode:LRW|SealedPacks:6
|
||||
Set0:SHM|Set1:EVE|Name:Shadowmoor|DraftPacks:3|LandSetCode:SHM|SealedPacks:6
|
||||
Set0:ALA|Set1:CFX|Set2:ARB|Name:Shards of Alara|DraftPacks:3|LandSetCode:ALA|SealedPacks:6
|
||||
Set0:M10|Name:Magic 2010|DraftPacks:3|LandSetCode:M10|SealedPacks:6
|
||||
Set0:ZEN|Set1:WWK|Name:Zendikar|DraftPacks:3|LandSetCode:ZEN|SealedPacks:6
|
||||
Set0:ROE|Name:Rise of the Eldrazi|DraftPacks:3|LandSetCode:ROE|SealedPacks:6
|
||||
Set0:M11|Name:Magic 2011|DraftPacks:3|LandSetCode:M11|SealedPacks:6
|
||||
|
||||
Set0:SOM|Set1:MBS|Set2:NPH|Name:Scars of Mirrodin|DraftPacks:3|LandSetCode:SOM|SealedPacks:6
|
||||
Set0:M12|Name:Magic 2012|DraftPacks:3|LandSetCode:M12|SealedPacks:6
|
||||
Set0:ISD|Set1:DKA|Name:Innistrad|DraftPacks:3|LandSetCode:ISD|SealedPacks:6
|
||||
Set0:AVR|Name:Avacyn Restored|DraftPacks:3|LandSetCode:AVR|SealedPacks:6
|
||||
Set0:M13|Name:Magic 2013|DraftPacks:3|LandSetCode:M13|SealedPacks:6
|
||||
Set0:RTR|Name:Return to Ravnica|DraftPacks:3|LandSetCode:RTR|SealedPacks:6
|
||||
Set0:RTR|Set1:RTR|Set2:RTR|Set3:RTR|Set4:RTR|Meta0:CHOOSE1/CUBE/RtRGuildAzorius/Azorius Guild;CUBE/RtRGuildIzzet/Izzet Guild;CUBE/RtRGuildRakdos/Rakdos Guild;CUBE/RtRGuildGolgari/Golgari Guild;CUBE/RtRGuildSelesnya/Selesnya Guild/GUILD|Meta1:CHOOSE1/CUBE/RtRPromoAzorius/Azorius Guild;CUBE/RtRPromoIzzet/Izzet Guild;CUBE/RtRPromoRakdos/Rakdos Guild;CUBE/RtRPromoGolgari/Golgari Guild;CUBE/RtRPromoSelesnya/Selesnya Guild/PROMO|Name:Return to Ravnica Guild Sealed|DraftPacks:3|LandSetCode:RTR|SealedPacks:7
|
||||
Set0:GTC|Name:Gatecrash|DraftPacks:3|LandSetCode:RTR|SealedPacks:6
|
||||
Set0:GTC|Set1:GTC|Set2:GTC|Set3:GTC|Set4:GTC|Meta0:CHOOSE1/CUBE/GtcGuildBoros/Boros Guild;CUBE/GtcGuildDimir/Dimir Guild;CUBE/GtcGuildGruul/Gruul Guild;CUBE/GtcGuildOrzhov/Orzhov Guild;CUBE/GtcGuildSimic/Simic Guild/GUILD|Meta1:CHOOSE1/CUBE/GtcPromoBoros/Boros Guild;CUBE/GtcPromoDimir/Dimir Guild;CUBE/GtcPromoGruul/Gruul Guild;CUBE/GtcPromoOrzhov/Orzhov Guild;CUBE/GtcPromoSimic/Simic Guild/PROMO|Name:Gatecrash Guild Sealed|DraftPacks:3|LandSetCode:RTR|SealedPacks:7
|
||||
# Name, Draft/Sealed/Lands, All sets and metas
|
||||
Alpha, 3/6/LEA, LEA
|
||||
Beta, 3/6/LEB, LEB
|
||||
Unlimited, 3/6/2ED, 2ED
|
||||
Arabian Nights, 5/9/2ED, ARN
|
||||
Antiquities, 5/9/2ED, ATQ
|
||||
Revised, 3/6/3ED, 3ED
|
||||
Legends, 3/6/3ED, LEG
|
||||
The Dark, 5/9/3ED, DRK
|
||||
Fallen Empires, 5/9/3ED, FEM
|
||||
Fourth Edition, 3/6/4ED, 4ED
|
||||
Ice Age, 3/6/ICE, ICE ALL CSP
|
||||
Homelands, 5/9/4ED, HML
|
||||
Mirage, 3/6/MIR, MIR VIS WTH
|
||||
Fifth Edition, 3/6/5ED, 5ED
|
||||
Portal, 3/6/POR, POR
|
||||
Tempest, 3/6/TMP, TMP STH EXO
|
||||
Portal Second Age, 3/6/PO2, PO2
|
||||
Urza, 3/6/USG, USG ULG UDS
|
||||
Sixth Edition, 3/6/6ED, 6ED
|
||||
Portal Three Kingdoms, 5/9/PTK, PTK
|
||||
Masques, 3/6/MMQ, MMQ NMS PCY
|
||||
Invasion, 3/6/INV, INV PLS APC
|
||||
Seventh Edition, 3/6/7ED, 7ED
|
||||
Odyssey, 3/6/ODY, ODY TOR JUD
|
||||
Onslaught, 3/6/ONS, ONS LGN SCG
|
||||
Eighth Edition, 3/6/8ED, 8ED
|
||||
Mirrodin, 3/6/MRD, MRD DST 5DN
|
||||
Kamigawa, 3/6/CHK, CHK BOK SOK
|
||||
Ninth Edition, 3/6/9ED, 9ED
|
||||
Ravnica, 3/6/RAV, RAV GPT DIS
|
||||
Coldsnap, 3/6/9ED, CSP
|
||||
Time Spiral, 3/6/TSP, TSP PLC FUT
|
||||
Tenth Edition, 3/6/10E, 10E
|
||||
Lorwyn, 3/6/LRW, LRW MOR
|
||||
Shadowmoor, 3/6/SHM, SHM EVE
|
||||
Shards of Alara, 3/6/ALA, ALA CFX ARB
|
||||
Magic 2010, 3/6/M10, M10
|
||||
Zendikar, 3/6/ZEN, ZEN WWK
|
||||
Rise of the Eldrazi, 3/6/ROE, ROE
|
||||
Magic 2011, 3/6/M11, M11
|
||||
Scars of Mirrodin, 3/6/SOM, SOM MBS NPH
|
||||
Magic 2012, 3/6/M12, M12
|
||||
Innistrad, 3/6/ISD, ISD DKA
|
||||
Avacyn Restored, 3/6/AVR, AVR
|
||||
Magic 2013, 3/6/M13, M13
|
||||
Return to Ravnica, 3/6/RTR, RTR
|
||||
Return to Ravnica Guild Sealed, 3/6/RTR, RTR RTR RTR RTR RTR Meta-Choose(Cube(RtRGuildAzorius)Azorius Guild;Cube(RtRGuildIzzet)Izzet Guild;Cube(RtRGuildRakdos)Rakdos Guild;Cube(RtRGuildGolgari)Golgari Guild;Cube(RtRGuildSelesnya)Selesnya Guild)GUILD
|
||||
Gatecrash, 3/6/RTR, GTC
|
||||
Gatecrash Guild Sealed, 3/6/RTR, GTC GTC GTC GTC Meta-Choose(Cube(GtcGuildBoros)Boros Guild;Cube(GtcGuildDimir)Dimir Guild;Cube(GtcGuildGruul)Gruul Guild;Cube(GtcGuildOrzhov)Orzhov Guild;Cube(GtcGuildSimic)Simic Guild)GUILD
|
||||
@@ -1,29 +1,29 @@
|
||||
Index:0|Set0:ICE|Set1:ARN|Set2:LEG|Name:(3) Arabian Ice Age|DraftPacks:3|LandSetCode:ICE|SealedPacks:6
|
||||
Index:1|Set0:2ED|Set1:ARN|Set2:LEG|Name:(3) Unlimited Power|DraftPacks:3|LandSetCode:2ED|SealedPacks:6
|
||||
Index:2|Set0:DRK|Set1:FEM|Set2:HML|Name:(3) Dark Empires|DraftPacks:3|LandSetCode:3ED|SealedPacks:6
|
||||
Index:3|Set0:MIR|Set1:TMP|Set2:USG|Name:(3) Urza's Tempest Mirage|DraftPacks:3|LandSetCode:5ED|SealedPacks:6
|
||||
Index:4|Set0:INV|Set1:ODY|Set2:ONS|Name:(3) Twilight of an Era|DraftPacks:3|LandSetCode:7ED|SealedPacks:6
|
||||
Index:5|Set0:MRD|Set1:CHK|Set2:RAV|Name:(3) New Dawn|DraftPacks:3|LandSetCode:9ED|SealedPacks:6
|
||||
Index:6|Set0:2ED|Set1:ARN|Set2:ATQ|Set3:LEG|Set4:DRK|Set5:FEM|Name:(5-6) Chronicles 01 - Origins|DraftPacks:3|LandSetCode:2ED|SealedPacks:6
|
||||
Index:7|Set0:ICE|Set1:HML|Set2:ALL|Set3:MIR|Set4:VIS|Set5:WTH|Name:(5-6) Chronicles 02 - Icy Mirage|DraftPacks:3|LandSetCode:5ED|SealedPacks:6
|
||||
Index:8|Set0:TMP|Set1:USG|Set2:STH|Set3:ULG|Set4:EXO|Set5:UDS|Name:(5-6) Chronicles 03 - Urza's Tempest|DraftPacks:3|LandSetCode:6ED|SealedPacks:6
|
||||
Index:9|Set0:MMQ|Set1:INV|Set2:NMS|Set3:PLS|Set4:PCY|Set5:APC|Name:(5-6) Chronicles 04 - Mercadian Invasion|DraftPacks:3|LandSetCode:7ED|SealedPacks:6
|
||||
Index:10|Set0:ODY|Set1:ONS|Set2:TOR|Set3:LGN|Set4:JUD|Set5:SCG|Name:(5-6) Chronicles 05 - Onslaught Odyssey|DraftPacks:3|LandSetCode:8ED|SealedPacks:6
|
||||
Index:11|Set0:MRD|Set1:CHK|Set2:DST|Set3:BOK|Set4:5DN|Set5:SOK|Name:(5-6) Chronicles 06 - Champions of Mirrodin|DraftPacks:3|LandSetCode:9ED|SealedPacks:6
|
||||
Index:12|Set0:RAV|Set1:TSP|Set2:GPT|Set3:PLC|Set4:DIS|Set5:FUT|Name:(5-6) Chronicles 07 - Ravnica Spiral|DraftPacks:3|LandSetCode:9ED|SealedPacks:6
|
||||
Index:13|Set0:LRW|Set1:SHM|Set2:MOR|Set3:EVE|Set3:CSP|Name:(5-6) Chronicles 08 - Cold Lorwynmoor (5 only)|DraftPacks:3|LandSetCode:10E|SealedPacks:6
|
||||
Index:14|Set0:ALA|Set1:ZEN|Set2:CFX|Set3:WWK|Set4:ARB|Set5:ROE|Name:(5-6) Chronicles 09 - Shards of Zendikar|DraftPacks:3|LandSetCode:M11|SealedPacks:6
|
||||
Index:15|Set0:SOM|Set1:ISD|Set2:MBS|Set3:DKA|Set4:NPH|Set5:AVR|Name:(5-6) Chronicles 10 - Scars of Innistrad|DraftPacks:3|LandSetCode:M11|SealedPacks:6
|
||||
Index:16|Set0:ARN|Set1:MIR|Set2:VIS|Set3:WTH|Name:(4) Arabian Africa|DraftPacks:3|LandSetCode:MIR|SealedPacks:6
|
||||
Index:17|Set0:MIR|Set1:CHK|Set2:VIS|Set3:BOK|Set4:WTH|Set5:SOK|Name:(6) Africa-Asia|DraftPacks:3|LandSetCode:MIR|SealedPacks:6
|
||||
Index:18|Set0:2ED|Set1:3ED|Set2:4ED|Set3:5ED|Set4:6ED|Set5:7ED|Name:(6-7)Cores 1 (2,3,4,5,6,7)|DraftPacks:3|LandSetCode:4ED|SealedPacks:6
|
||||
Index:19|Set0:8ED|Set1:9ED|Set2:10E|Set3:M10|Set4:M11|Set5:M12|Set6:M13|Name:(6-7)Cores 2 (8,9,10,M10,M11,M12,M13)|DraftPacks:3|LandSetCode:9ED|SealedPacks:7
|
||||
Index:20|Set0:ICE|Set1:ALL|Set2:CSP|Set3:HML|Name:(4) Ice Age Extended|DraftPacks:3|LandSetCode:ICE|SealedPacks:6
|
||||
Index:21|Set0:2ED|Set1:ICE|Set2:HML|Set3:LEG|Set4:DRK|Set5:FEM|Name:(6) Sample 6-pack|DraftPacks:3|LandSetCode:2ED|SealedPacks:6
|
||||
Index:22|Set0:4ED|Set1:ALL|Set2:ICE|Set3:HML|Set4:LEG|Set5:DRK|Set6:FEM|Name:(7) Sample 7-pack|DraftPacks:3|LandSetCode:4ED|SealedPacks:7
|
||||
Index:23|Set0:4ED|Set1:ALL|Set2:ICE|Set3:HML|Set4:LEG|Set5:DRK|Set6:FEM|Set7:CHR|Name:(8) Sample 8-pack|DraftPacks:3|LandSetCode:4ED|SealedPacks:8
|
||||
Index:24|Set0:2ED|Set1:ALL|Set2:ICE|Set3:HML|Set4:LEG|Set5:DRK|Set6:FEM|Set7:ATQ|Set8:ARN|Name:(9) Sample 9-pack|DraftPacks:3|LandSetCode:2ED|SealedPacks:9
|
||||
Index:25|Set0:2ED|Set1:ATQ|Set2:ARN|Set3:DRK|Set4:LEG|Set5:FEM|Set6:ICE|Set7:HML|Set8:ALL|Name:(9) MtG Encyclopedia|DraftPacks:3|LandSetCode:2ED|SealedPacks:9
|
||||
Index:26|Meta0:CUBE/ArabianExtended/ARAB|Meta1:META/ISD,DKA,AVR,M13/M13-ISD|Meta2:FULL/*/*|Name:(3) Metaset Sample|DraftPacks:3|LandSetCode:2ED|SealedPacks:6
|
||||
Index:27|Meta0:CHOOSE1/CUBE/ArabianExtended/ArabianExtended;FULL/*/*;META/ICE,ALL,HML,CSP/IceAgeBlockExtended;BOOSTER/2ED/Unlimited;PACK/4ED/4th Edition /CHOOSE|Meta1:RANDOM1/FULL/*/*;META/CHK,BOK,SOK/KAMI;BOOSTER/8ED/8ED/RANDOM|Meta2:COMBO/CUBE/juzamjedi/JZJEDI;META/USG,ULG,UDS/URZA;PACK/M13/M13;BOOSTER/TSB/TimeShift/COMBO|Name:(3) Metaset Sample 2|DraftPacks:3|LandSetCode:2ED|SealedPacks:6
|
||||
|
||||
# Name, Draft/Sealed/Lands, All sets and metas
|
||||
(3) Arabian Ice Age, 3/6/ICE, ICE ARN LEG
|
||||
(3) Unlimited Power, 3/6/2ED, 2ED ARN LEG
|
||||
(3) Dark Empires, 3/6/3ED, DRK FEM HML
|
||||
(3) Urza's Tempest Mirage, 3/6/5ED, MIR TMP USG
|
||||
(3) Twilight of an Era, 3/6/7ED, INV ODY ONS
|
||||
(3) New Dawn, 3/6/9ED, MRD CHK RAV
|
||||
(5-6) Chronicles 01 - Origins, 3/6/2ED, 2ED ARN ATQ LEG DRK FEM
|
||||
(5-6) Chronicles 02 - Icy Mirage, 3/6/5ED, ICE HML ALL MIR VIS WTH
|
||||
(5-6) Chronicles 03 - Urza's Tempest, 3/6/6ED, TMP USG STH ULG EXO UDS
|
||||
(5-6) Chronicles 04 - Mercadian Invasion, 3/6/7ED, MMQ INV NMS PLS PCY APC
|
||||
(5-6) Chronicles 05 - Onslaught Odyssey, 3/6/8ED, ODY ONS TOR LGN JUD SCG
|
||||
(5-6) Chronicles 06 - Champions of Mirrodin, 3/6/9ED, MRD CHK DST BOK 5DN SOK
|
||||
(5-6) Chronicles 07 - Ravnica Spiral, 3/6/9ED, RAV TSP GPT PLC DIS FUT
|
||||
(5-6) Chronicles 08 - Cold Lorwynmoor (5 only), 3/6/10E, LRW SHM MOR EVE CSP
|
||||
(5-6) Chronicles 09 - Shards of Zendikar, 3/6/M11, ALA ZEN CFX WWK ARB ROE
|
||||
(5-6) Chronicles 10 - Scars of Innistrad, 3/6/M11, SOM ISD MBS DKA NPH AVR
|
||||
(4) Arabian Africa, 3/6/MIR, ARN MIR VIS WTH
|
||||
(6) Africa-Asia, 3/6/MIR, MIR CHK VIS BOK WTH SOK
|
||||
(6-7)Cores 1 (2,3,4,5,6,7), 3/6/4ED, 2ED 3ED 4ED 5ED 6ED 7ED
|
||||
(6-7)Cores 2 (8,9,10,M10,M11,M12,M13), 3/7/10E, 8ED 9ED 10E M10 M11 M12 M13
|
||||
(4) Ice Age Extended, 3/6/ICE, ICE ALL CSP HML
|
||||
(6) Sample 6-pack, 3/6/2ED, 2ED ICE HML LEG DRK FEM
|
||||
(7) Sample 7-pack, 3/7/4ED, 4ED ALL ICE HML LEG DRK FEM
|
||||
(8) Sample 8-pack, 3/8/4ED, 4ED ALL ICE HML LEG DRK FEM CHR
|
||||
(9) Sample 9-pack, 3/9/2ED, 2ED ALL ICE HML LEG DRK FEM ATQ ARN
|
||||
(9) MtG Encyclopedia, 3/9/2ED, 2ED ATQ ARN DRK LEG FEM ICE HML ALL
|
||||
(3) Metaset Sample, 3/6/2ED, Meta-Cube(ArabianExtended)ARAB Meta-JoinedSet(ISD DKA AVR M13)M13-ISD Meta-Full()
|
||||
(3) Metaset Sample 2, 3/6/2ED, Meta-Choose(CUBE(ArabianExtended)Arabian Extended;FULL()*;JoinedSet(ICE ALL HML CSP)Ice Age Block Extended;Booster(2ED)Unlimited booster;Pack(4ED)4th Edition Tournament)CHOOSE Meta-Random(Full()*;JoinedSet(CHK BOK SOK)KAMI;Booster(8ED)8ED)RANDOM
|
||||
@@ -1,5 +0,0 @@
|
||||
[metadata]
|
||||
Name=GtcPromoBoros
|
||||
[Main]
|
||||
1 Boros Guildgate|GTC
|
||||
1 Foundry Champion|GTC
|
||||
@@ -1,5 +0,0 @@
|
||||
[metadata]
|
||||
Name=GtcPromoDimir
|
||||
[Main]
|
||||
1 Consuming Aberration|GTC
|
||||
1 Dimir Guildgate|GTC
|
||||
@@ -1,5 +0,0 @@
|
||||
[metadata]
|
||||
Name=GtcPromoGruul
|
||||
[Main]
|
||||
1 Gruul Guildgate|GTC
|
||||
1 Rubblehulk|GTC
|
||||
@@ -1,5 +0,0 @@
|
||||
[metadata]
|
||||
Name=GtcPromoOrzhov
|
||||
[Main]
|
||||
1 Orzhov Guildgate|GTC
|
||||
1 Treasury Thrull|GTC
|
||||
@@ -1,5 +0,0 @@
|
||||
[metadata]
|
||||
Name=GtcPromoSimic
|
||||
[Main]
|
||||
1 Fathom Mage|GTC
|
||||
1 Simic Guildgate|GTC
|
||||
@@ -1,6 +0,0 @@
|
||||
[metadata]
|
||||
Name=RtRPromoAzorius
|
||||
[main]
|
||||
1 Archon of the Triumvirate|RTR
|
||||
1 Azorius Guildgate|RTR
|
||||
[sideboard]
|
||||
@@ -1,6 +0,0 @@
|
||||
[metadata]
|
||||
Name=RtRPromoGolgari
|
||||
[main]
|
||||
1 Corpsejack Menace|RTR
|
||||
1 Golgari Guildgate|RTR
|
||||
[sideboard]
|
||||
@@ -1,6 +0,0 @@
|
||||
[metadata]
|
||||
Name=RtRPromoIzzet
|
||||
[main]
|
||||
1 Hypersonic Dragon|RTR
|
||||
1 Izzet Guildgate|RTR
|
||||
[sideboard]
|
||||
@@ -1,6 +0,0 @@
|
||||
[metadata]
|
||||
Name=RtRPromoRakdos
|
||||
[main]
|
||||
1 Carnival Hellsteed|RTR
|
||||
1 Rakdos Guildgate|RTR
|
||||
[sideboard]
|
||||
@@ -1,6 +0,0 @@
|
||||
[metadata]
|
||||
Name=RtRPromoSelesnya
|
||||
[main]
|
||||
1 Grove of the Guardian|RTR
|
||||
1 Selesnya Guildgate|RTR
|
||||
[sideboard]
|
||||
@@ -2,11 +2,6 @@ Name:ArabianExtended
|
||||
DeckFile:ArabianExtended
|
||||
IgnoreRarity:False
|
||||
LandSetCode:2ED
|
||||
|
||||
NumCards:15
|
||||
NumSpecials:0
|
||||
NumMythics:1
|
||||
NumRares:1
|
||||
NumUncommons:3
|
||||
NumCommons:11
|
||||
|
||||
Booster: 1 Rare, 11 Common, 3 Uncommon
|
||||
NumPacks:3
|
||||
@@ -2,11 +2,6 @@ Name:GtcGuildBoros
|
||||
DeckFile:GtcGuildBoros
|
||||
IgnoreRarity:False
|
||||
LandSetCode:M13
|
||||
|
||||
NumCards:14
|
||||
NumSpecials:0
|
||||
NumMythics:0
|
||||
NumRares:1
|
||||
NumUncommons:3
|
||||
NumCommons:10
|
||||
|
||||
Booster:10 Common, 3 Uncommon, 1 Rare, 2 promo("Boros Guildgate|GTC","Foundry Champion|GTC")
|
||||
NumPacks:1
|
||||
|
||||
@@ -2,11 +2,6 @@ Name:GtcGuildDimir
|
||||
DeckFile:GtcGuildDimir
|
||||
IgnoreRarity:False
|
||||
LandSetCode:M13
|
||||
|
||||
NumCards:14
|
||||
NumSpecials:0
|
||||
NumMythics:0
|
||||
NumRares:1
|
||||
NumUncommons:3
|
||||
NumCommons:10
|
||||
|
||||
Booster:10 Common, 3 Uncommon, 1 Rare, 2 promo("Dimir Guildgate|GTC","Consuming Aberration|GTC")
|
||||
NumPacks:1
|
||||
|
||||
@@ -3,10 +3,5 @@ DeckFile:GtcGuildGruul
|
||||
IgnoreRarity:False
|
||||
LandSetCode:M13
|
||||
|
||||
NumCards:14
|
||||
NumSpecials:0
|
||||
NumMythics:0
|
||||
NumRares:1
|
||||
NumUncommons:3
|
||||
NumCommons:10
|
||||
Booster:10 Common, 3 Uncommon, 1 Rare, 2 promo("Gruul Guildgate|GTC","Rubblehulk|GTC")
|
||||
NumPacks:1
|
||||
|
||||
@@ -1,12 +1,6 @@
|
||||
Name:GtcGuildOrzhov
|
||||
DeckFile:GtcGuildOrzhov
|
||||
IgnoreRarity:False
|
||||
LandSetCode:M13
|
||||
|
||||
NumCards:14
|
||||
NumSpecials:0
|
||||
NumMythics:0
|
||||
NumRares:1
|
||||
NumUncommons:3
|
||||
NumCommons:10
|
||||
Booster:10 Common, 3 Uncommon, 1 Rare, 2 promo("Orzhov Guildgate|GTC","Treasury Thrull|GTC")
|
||||
NumPacks:1
|
||||
|
||||
@@ -2,11 +2,6 @@ Name:GtcGuildSimic
|
||||
DeckFile:GtcGuildSimic
|
||||
IgnoreRarity:False
|
||||
LandSetCode:M13
|
||||
|
||||
NumCards:14
|
||||
NumSpecials:0
|
||||
NumMythics:0
|
||||
NumRares:1
|
||||
NumUncommons:3
|
||||
NumCommons:10
|
||||
|
||||
Booster:10 Common, 3 Uncommon, 1 Rare, 2 promo("Simic Guildgate|GTC","Fathom Mage|GTC")
|
||||
NumPacks:1
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
Name:GtcPromoBoros
|
||||
DeckFile:GtcPromoBoros
|
||||
IgnoreRarity:False
|
||||
LandSetCode:M13
|
||||
|
||||
NumCards:2
|
||||
NumSpecials:0
|
||||
NumMythics:0
|
||||
NumRares:1
|
||||
NumUncommons:0
|
||||
NumCommons:1
|
||||
NumPacks:1
|
||||
@@ -1,12 +0,0 @@
|
||||
Name:GtcPromoDimir
|
||||
DeckFile:GtcPromoDimir
|
||||
IgnoreRarity:False
|
||||
LandSetCode:M13
|
||||
|
||||
NumCards:2
|
||||
NumSpecials:0
|
||||
NumMythics:0
|
||||
NumRares:1
|
||||
NumUncommons:0
|
||||
NumCommons:1
|
||||
NumPacks:1
|
||||
@@ -1,12 +0,0 @@
|
||||
Name:GtcPromoGruul
|
||||
DeckFile:GtcPromoGruul
|
||||
IgnoreRarity:False
|
||||
LandSetCode:M13
|
||||
|
||||
NumCards:2
|
||||
NumSpecials:0
|
||||
NumMythics:0
|
||||
NumRares:1
|
||||
NumUncommons:0
|
||||
NumCommons:1
|
||||
NumPacks:1
|
||||
@@ -1,12 +0,0 @@
|
||||
Name:GtcPromoOrzhov
|
||||
DeckFile:GtcPromoOrzhov
|
||||
IgnoreRarity:False
|
||||
LandSetCode:M13
|
||||
|
||||
NumCards:2
|
||||
NumSpecials:0
|
||||
NumMythics:0
|
||||
NumRares:1
|
||||
NumUncommons:0
|
||||
NumCommons:1
|
||||
NumPacks:1
|
||||
@@ -1,12 +0,0 @@
|
||||
Name:GtcPromoSimic
|
||||
DeckFile:GtcPromoSimic
|
||||
IgnoreRarity:False
|
||||
LandSetCode:M13
|
||||
|
||||
NumCards:2
|
||||
NumSpecials:0
|
||||
NumMythics:0
|
||||
NumRares:1
|
||||
NumUncommons:0
|
||||
NumCommons:1
|
||||
NumPacks:1
|
||||
@@ -2,11 +2,6 @@ Name:RtRGuildAzorius
|
||||
DeckFile:RtRGuildAzorius
|
||||
IgnoreRarity:False
|
||||
LandSetCode:M13
|
||||
|
||||
NumCards:14
|
||||
NumSpecials:0
|
||||
NumMythics:0
|
||||
NumRares:1
|
||||
NumUncommons:3
|
||||
NumCommons:10
|
||||
|
||||
Booster:10 Common, 3 Uncommon, 1 Rare, 2 promo("Azorius Guildgate|RTR","Archon of the Triumvirate|RTR")
|
||||
NumPacks:1
|
||||
|
||||
@@ -3,10 +3,5 @@ DeckFile:RtRGuildGolgari
|
||||
IgnoreRarity:False
|
||||
LandSetCode:M13
|
||||
|
||||
NumCards:14
|
||||
NumSpecials:0
|
||||
NumMythics:0
|
||||
NumRares:1
|
||||
NumUncommons:3
|
||||
NumCommons:10
|
||||
Booster:10 Common, 3 Uncommon, 1 Rare, 2 promo("Golgari Guildgate|RTR","Corpsejack Menace|RTR")
|
||||
NumPacks:1
|
||||
|
||||
@@ -3,10 +3,5 @@ DeckFile:RtRGuildIzzet
|
||||
IgnoreRarity:False
|
||||
LandSetCode:M13
|
||||
|
||||
NumCards:14
|
||||
NumSpecials:0
|
||||
NumMythics:0
|
||||
NumRares:1
|
||||
NumUncommons:3
|
||||
NumCommons:10
|
||||
Booster:10 Common, 3 Uncommon, 1 Rare, 2 promo("Izzet Guildgate|RTR","Hypersonic Dragon|RTR")
|
||||
NumPacks:1
|
||||
|
||||
@@ -2,11 +2,6 @@ Name:RtRGuildRakdos
|
||||
DeckFile:RtRGuildRakdos
|
||||
IgnoreRarity:False
|
||||
LandSetCode:M13
|
||||
|
||||
NumCards:14
|
||||
NumSpecials:0
|
||||
NumMythics:0
|
||||
NumRares:1
|
||||
NumUncommons:3
|
||||
NumCommons:10
|
||||
NumPacks:1
|
||||
|
||||
Booster:10 Common, 3 Uncommon, 1 Rare, 2 promo("Rakdos Guildgate|RTR","Corpsejack Menace|RTR")
|
||||
NumPacks:1
|
||||
@@ -2,11 +2,6 @@ Name:RtRGuildSelesnya
|
||||
DeckFile:RtRGuildSelesnya
|
||||
IgnoreRarity:False
|
||||
LandSetCode:M13
|
||||
|
||||
NumCards:14
|
||||
NumSpecials:1
|
||||
NumMythics:0
|
||||
NumRares:1
|
||||
NumUncommons:3
|
||||
NumCommons:10
|
||||
NumPacks:1
|
||||
|
||||
Booster:10 Common, 3 Uncommon, 1 Rare, 2 promo("Selesnya Guildgate|RTR","Grove of the Guardian|RTR")
|
||||
NumPacks:1
|
||||
@@ -1,12 +0,0 @@
|
||||
Name:RtRPromoAzorius
|
||||
DeckFile:RtRPromoAzorius
|
||||
IgnoreRarity:False
|
||||
LandSetCode:M13
|
||||
|
||||
NumCards:2
|
||||
NumSpecials:0
|
||||
NumMythics:0
|
||||
NumRares:1
|
||||
NumUncommons:0
|
||||
NumCommons:1
|
||||
NumPacks:1
|
||||
@@ -1,12 +0,0 @@
|
||||
Name:RtRPromoGolgari
|
||||
DeckFile:RtRPromoGolgari
|
||||
IgnoreRarity:False
|
||||
LandSetCode:M13
|
||||
|
||||
NumCards:2
|
||||
NumSpecials:0
|
||||
NumMythics:0
|
||||
NumRares:1
|
||||
NumUncommons:0
|
||||
NumCommons:1
|
||||
NumPacks:1
|
||||
@@ -1,12 +0,0 @@
|
||||
Name:RtRPromoIzzet
|
||||
DeckFile:RtRPromoIzzet
|
||||
IgnoreRarity:False
|
||||
LandSetCode:M13
|
||||
|
||||
NumCards:2
|
||||
NumSpecials:0
|
||||
NumMythics:0
|
||||
NumRares:1
|
||||
NumUncommons:0
|
||||
NumCommons:1
|
||||
NumPacks:1
|
||||
@@ -1,12 +0,0 @@
|
||||
Name:RtRPromoRakdos
|
||||
DeckFile:RtRPromoRakdos
|
||||
IgnoreRarity:False
|
||||
LandSetCode:M13
|
||||
|
||||
NumCards:2
|
||||
NumSpecials:0
|
||||
NumMythics:0
|
||||
NumRares:1
|
||||
NumUncommons:0
|
||||
NumCommons:1
|
||||
NumPacks:1
|
||||
@@ -1,12 +0,0 @@
|
||||
Name:RtRPromoSelesnya
|
||||
DeckFile:RtRPromoSelesnya
|
||||
IgnoreRarity:False
|
||||
LandSetCode:M13
|
||||
|
||||
NumCards:2
|
||||
NumSpecials:0
|
||||
NumMythics:0
|
||||
NumRares:1
|
||||
NumUncommons:0
|
||||
NumCommons:1
|
||||
NumPacks:1
|
||||
@@ -2,11 +2,6 @@ Name:JuzamjediCube
|
||||
DeckFile:JuzamjediCube
|
||||
IgnoreRarity:True
|
||||
LandSetCode:M11
|
||||
|
||||
NumCards:15
|
||||
NumSpecials:0
|
||||
NumMythics:1
|
||||
NumRares:5
|
||||
NumUncommons:5
|
||||
NumCommons:5
|
||||
|
||||
Booster: 5 Common, 5 Uncommon, 5 RareNotMythic, 1 Mythic
|
||||
NumPacks:3
|
||||
@@ -78,10 +78,7 @@ public class BoosterGenerator {
|
||||
String slotType = slot.getLeft(); // add expansion symbol here?
|
||||
int numCards = slot.getRight().intValue();
|
||||
|
||||
String[] sType = TextUtil.splitWithParenthesis(slotType, ' ', '(', ')');
|
||||
String sheetKey = sType.length == 1 ? slotType.trim() + " " + booster.getEdition() : slotType.trim();
|
||||
|
||||
PrintSheet ps = makeSheet(sheetKey, sourcePool);
|
||||
PrintSheet ps = makeSheet(slotType, sourcePool);
|
||||
result.addAll(ps.random(numCards, true));
|
||||
}
|
||||
return result;
|
||||
@@ -98,11 +95,17 @@ public class BoosterGenerator {
|
||||
if(mainCode.endsWith("s"))
|
||||
mainCode = mainCode.substring(0, mainCode.length()-1);
|
||||
|
||||
String sets = sKey[1];
|
||||
Predicate<CardPrinted> setPred = IPaperCard.Predicates.printedInSets(sets.split(" "));
|
||||
Predicate<CardPrinted> setPred = (Predicate<CardPrinted>) (sKey.length > 1 ? IPaperCard.Predicates.printedInSets(sKey[1].split(" ")) : Predicates.alwaysTrue());
|
||||
|
||||
// Pre-defined sheets:
|
||||
if( mainCode.equalsIgnoreCase("any") ) {
|
||||
if (mainCode.startsWith("promo(")) { // get exactly the named cards, nevermind any restrictions
|
||||
String list = StringUtils.strip(mainCode.substring(5), "() ");
|
||||
String[] cardNames = TextUtil.splitWithParenthesis(list, ',', '"', '"');
|
||||
for(String cardName: cardNames) {
|
||||
ps.add(CardDb.instance().getCard(cardName));
|
||||
}
|
||||
|
||||
} else if( mainCode.equalsIgnoreCase("any") ) { // no restriction on rarity
|
||||
Predicate<CardPrinted> predicate = Predicates.and(setPred, extraPred);
|
||||
ps.addAll(Iterables.filter(src, predicate));
|
||||
|
||||
|
||||
@@ -19,11 +19,16 @@ package forge.card;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import com.google.common.base.Function;
|
||||
import com.google.common.base.Predicate;
|
||||
|
||||
import forge.Singletons;
|
||||
import forge.item.CardPrinted;
|
||||
import forge.item.IPaperCard;
|
||||
import forge.util.TextUtil;
|
||||
import forge.util.storage.StorageReaderFile;
|
||||
|
||||
// import forge.deck.Deck;
|
||||
@@ -37,7 +42,7 @@ public final class CardBlock implements Comparable<CardBlock> {
|
||||
private final int orderNum;
|
||||
private final String name;
|
||||
private final CardEdition[] sets;
|
||||
private final ArrayList<MetaSet> metaSets;
|
||||
private final Map<String, MetaSet> metaSets = new TreeMap<String, MetaSet>();
|
||||
private final CardEdition landSet;
|
||||
private final int cntBoostersDraft;
|
||||
private final int cntBoostersSealed;
|
||||
@@ -61,12 +66,14 @@ public final class CardBlock implements Comparable<CardBlock> {
|
||||
* @param cntBoostersSealed
|
||||
* the cnt boosters sealed
|
||||
*/
|
||||
public CardBlock(final int index, final String name, final List<CardEdition> sets, final ArrayList<MetaSet> metas,
|
||||
public CardBlock(final int index, final String name, final List<CardEdition> sets, final List<MetaSet> metas,
|
||||
final CardEdition landSet, final int cntBoostersDraft, final int cntBoostersSealed) {
|
||||
this.orderNum = index;
|
||||
this.name = name;
|
||||
this.sets = sets.toArray(CardBlock.EMPTY_SET_ARRAY);
|
||||
this.metaSets = metas;
|
||||
for(MetaSet m : metas) {
|
||||
this.metaSets.put(m.getCode(), m);
|
||||
}
|
||||
this.landSet = landSet;
|
||||
this.cntBoostersDraft = cntBoostersDraft;
|
||||
this.cntBoostersSealed = cntBoostersSealed;
|
||||
@@ -195,9 +202,9 @@ public final class CardBlock implements Comparable<CardBlock> {
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
if (this.getNumberMetaSets() + this.getNumberSets() < 1) {
|
||||
if (this.metaSets.isEmpty() && this.sets.length < 1) {
|
||||
return this.name + " (empty)";
|
||||
} else if (this.getNumberMetaSets() + this.getNumberSets() < 2) {
|
||||
} else if (this.metaSets.size() + this.getNumberSets() < 2) {
|
||||
return this.name + " (set)";
|
||||
}
|
||||
return this.name + " (block)";
|
||||
@@ -229,39 +236,30 @@ public final class CardBlock implements Comparable<CardBlock> {
|
||||
*/
|
||||
@Override
|
||||
protected CardBlock read(String line, int i) {
|
||||
final String[] sParts = line.trim().split("\\|");
|
||||
final String[] sParts = TextUtil.splitWithParenthesis(line.trim(), ',', '(', ')', 3);
|
||||
String name = sParts[0];
|
||||
|
||||
String name = null;
|
||||
int index = 1+i;
|
||||
final List<CardEdition> sets = new ArrayList<CardEdition>(9); // add support for up to 9 different sets in a block!
|
||||
final ArrayList<MetaSet> metas = new ArrayList<MetaSet>();
|
||||
CardEdition landSet = null;
|
||||
int draftBoosters = 3;
|
||||
int sealedBoosters = 6;
|
||||
String[] numbers = sParts[1].trim().split("/");
|
||||
int draftBoosters = Integer.parseInt(numbers[0]);
|
||||
int sealedBoosters = Integer.parseInt(numbers[1]);
|
||||
CardEdition landSet = editions.getEditionByCodeOrThrow(numbers[2]);
|
||||
|
||||
for (final String sPart : sParts) {
|
||||
final String[] kv = sPart.split(":", 2);
|
||||
final String key = kv[0].toLowerCase();
|
||||
if ("name".equals(key)) {
|
||||
name = kv[1];
|
||||
} else if ("set0".equals(key) || "set1".equals(key) || "set2".equals(key) || "set3".equals(key)
|
||||
|| "set4".equals(key) || "set5".equals(key) || "set6".equals(key) || "set7".equals(key)
|
||||
|| "set8".equals(key)) {
|
||||
sets.add(editions.getEditionByCodeOrThrow(kv[1]));
|
||||
} else if ("meta0".equals(key) || "meta1".equals(key) || "meta2".equals(key) || "meta3".equals(key)
|
||||
|| "meta4".equals(key) || "meta5".equals(key) || "meta6".equals(key) || "meta7".equals(key)
|
||||
|| "meta8".equals(key)) {
|
||||
metas.add(new MetaSet(kv[1]));
|
||||
} else if ("landsetcode".equals(key)) {
|
||||
landSet = editions.getEditionByCodeOrThrow(kv[1]);
|
||||
} else if ("draftpacks".equals(key)) {
|
||||
draftBoosters = Integer.parseInt(kv[1]);
|
||||
} else if ("sealedpacks".equals(key)) {
|
||||
sealedBoosters = Integer.parseInt(kv[1]);
|
||||
List<CardEdition> sets = new ArrayList<CardEdition>();
|
||||
List<MetaSet> metas = new ArrayList<MetaSet>();
|
||||
|
||||
String[] setNames = TextUtil.splitWithParenthesis(sParts[2], ' ', '(', ')' );
|
||||
for(final String set : setNames ) {
|
||||
if(set.startsWith("Meta-")) {
|
||||
String metaSpec = set.substring(5);
|
||||
boolean noDraft = metaSpec.startsWith("NoDraft-");
|
||||
if( noDraft ) metaSpec = metaSpec.substring(8);
|
||||
metas.add(new MetaSet(metaSpec, noDraft));
|
||||
} else {
|
||||
sets.add(editions.getEditionByCodeOrThrow(set));
|
||||
}
|
||||
|
||||
}
|
||||
return new CardBlock(index, name, sets, metas, landSet, draftBoosters, sealedBoosters);
|
||||
|
||||
return new CardBlock(i+1, name, sets, metas, landSet, draftBoosters, sealedBoosters);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -280,56 +278,15 @@ public final class CardBlock implements Comparable<CardBlock> {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The number of meta-sets in the block.
|
||||
*
|
||||
* @return int, number of meta-sets.
|
||||
*/
|
||||
public int getNumberMetaSets() {
|
||||
if (metaSets == null || metaSets.size() < 1) {
|
||||
return 0;
|
||||
}
|
||||
else {
|
||||
return metaSets.size();
|
||||
}
|
||||
public Iterable<String> getMetaSetNames() {
|
||||
return metaSets.keySet();
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the requested meta-set.
|
||||
*
|
||||
* @param index
|
||||
* int, the requested index
|
||||
* @return MetaSet, the requested meta-set.
|
||||
*/
|
||||
public MetaSet getMetaSet(final int index) {
|
||||
if (index < 0 || index > this.getNumberMetaSets() - 1) {
|
||||
throw new RuntimeException("Illegal MetaSet requested: " + index);
|
||||
}
|
||||
else {
|
||||
return metaSets.get(index);
|
||||
}
|
||||
|
||||
public MetaSet getMetaSet(String key) {
|
||||
return metaSets.get(key);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if there is a meta-set of the requested type.
|
||||
*
|
||||
* @param compare
|
||||
* String, the requested the requested type
|
||||
* @return boolean, the requsted type was found
|
||||
*/
|
||||
public boolean hasMetaSetType(final String compare) {
|
||||
|
||||
if (this.getNumberMetaSets() < 1) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (MetaSet mSet : metaSets) {
|
||||
if (mSet.getType().equalsIgnoreCase(compare)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Tries to create a booster for the selected meta-set code.
|
||||
@@ -338,18 +295,8 @@ public final class CardBlock implements Comparable<CardBlock> {
|
||||
* String, the MetaSet code
|
||||
* @return UnOpenedProduct, the created booster.
|
||||
*/
|
||||
public UnOpenedProduct getBooster(final String code) {
|
||||
|
||||
if (this.getNumberMetaSets() < 1) {
|
||||
throw new RuntimeException("Attempted to get a booster pack for empty metasets.");
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < this.getNumberMetaSets(); i++) {
|
||||
if (code.equals(metaSets.get(i).getCode())) {
|
||||
return metaSets.get(i).getBooster();
|
||||
}
|
||||
}
|
||||
throw new RuntimeException("Could not find metaset " + code + " for booster generation.");
|
||||
}
|
||||
public IUnOpenedProduct getBooster(final String code) {
|
||||
MetaSet ms = metaSets.get(code);
|
||||
return ms == null ? new UnOpenedProduct(Singletons.getModel().getBoosters().get(code)) : ms.getBooster();
|
||||
}
|
||||
}
|
||||
|
||||
16
src/main/java/forge/card/IUnOpenedProduct.java
Normal file
16
src/main/java/forge/card/IUnOpenedProduct.java
Normal file
@@ -0,0 +1,16 @@
|
||||
package forge.card;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Supplier;
|
||||
|
||||
import forge.item.CardPrinted;
|
||||
|
||||
/**
|
||||
* TODO: Write javadoc for this type.
|
||||
*
|
||||
*/
|
||||
|
||||
public interface IUnOpenedProduct extends Supplier<List<CardPrinted>> {
|
||||
public List<CardPrinted> get();
|
||||
}
|
||||
@@ -19,14 +19,16 @@
|
||||
package forge.card;
|
||||
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
import com.google.common.collect.Iterables;
|
||||
|
||||
import forge.Singletons;
|
||||
import forge.game.limited.CustomLimited;
|
||||
import forge.item.CardDb;
|
||||
import forge.item.CardPrinted;
|
||||
import forge.item.ItemPool;
|
||||
import forge.item.IPaperCard;
|
||||
import forge.util.FileUtil;
|
||||
|
||||
/**
|
||||
@@ -90,10 +92,21 @@ import forge.util.FileUtil;
|
||||
*
|
||||
*/
|
||||
public class MetaSet {
|
||||
|
||||
private enum MetaSetType {
|
||||
Full,
|
||||
Cube,
|
||||
JoinedSet,
|
||||
Choose,
|
||||
Random,
|
||||
Booster,
|
||||
Pack
|
||||
}
|
||||
|
||||
private final String type;
|
||||
private final MetaSetType type;
|
||||
private final String data;
|
||||
private final String code;
|
||||
private final boolean draftable;
|
||||
// private BoosterGenerator boosterGen;
|
||||
|
||||
/**
|
||||
@@ -103,48 +116,26 @@ public class MetaSet {
|
||||
* @param creationString
|
||||
* a {@link java.lang.String} object.
|
||||
*/
|
||||
public MetaSet(final String creationString) {
|
||||
public MetaSet(final String creationString, boolean canDraft) {
|
||||
int idxFirstPar = creationString.indexOf('(');
|
||||
int idxLastPar = creationString.lastIndexOf(')');
|
||||
|
||||
draftable = canDraft;
|
||||
type = MetaSetType.valueOf(creationString.substring(0, idxFirstPar).trim());
|
||||
data = creationString.substring(idxFirstPar + 1, idxLastPar);
|
||||
String description = creationString.substring(idxLastPar + 1);
|
||||
|
||||
String[] kv = new String [3];
|
||||
kv[0] = creationString.substring(0, creationString.indexOf('/'));
|
||||
kv[1] = creationString.substring(creationString.indexOf('/') + 1, creationString.lastIndexOf('/'));
|
||||
kv[2] = creationString.substring(creationString.lastIndexOf('/') + 1);
|
||||
// Display the parse results:
|
||||
// System.out.println("KV = '" + kv[0] + "', '" + kv[1] + "', '" + kv[2] + "'");
|
||||
switch (type) {
|
||||
case Cube: code = "*C:" + description; break;
|
||||
case Full: code = "*FULL"; break;
|
||||
case JoinedSet: code = "*B:" + description; break;
|
||||
case Choose: code = "*!:" + description; break;
|
||||
case Random: code = "*?:" + description; break;
|
||||
case Booster: code = "*" + description; break;
|
||||
case Pack: code = "*" + description + "(S)"; break;
|
||||
|
||||
type = kv[0];
|
||||
data = kv[1];
|
||||
|
||||
if ("cube".equalsIgnoreCase(type)) {
|
||||
code = "*C:" + kv[2];
|
||||
default: throw new RuntimeException("Invalid MetaSet type: " + type);
|
||||
}
|
||||
else if ("full".equalsIgnoreCase(type)) {
|
||||
code = "*FULL";
|
||||
}
|
||||
else if ("meta".equalsIgnoreCase(type)) {
|
||||
code = "*B:" + kv[2];
|
||||
}
|
||||
else if ("choose1".equalsIgnoreCase(type)) {
|
||||
code = "*!:" + kv[2];
|
||||
}
|
||||
else if ("random1".equalsIgnoreCase(type)) {
|
||||
code = "*?:" + kv[2];
|
||||
}
|
||||
else if ("combo".equalsIgnoreCase(type)) {
|
||||
code = "*+:" + kv[2];
|
||||
}
|
||||
else if ("booster".equalsIgnoreCase(type)) {
|
||||
code = "*" + kv[2];
|
||||
}
|
||||
else if ("pack".equalsIgnoreCase(type)) {
|
||||
code = "*" + kv[2] + "(S)";
|
||||
}
|
||||
else {
|
||||
code = null;
|
||||
throw new RuntimeException("Invalid MetaSet type: " + type);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -157,152 +148,57 @@ public class MetaSet {
|
||||
return code;
|
||||
}
|
||||
|
||||
/**
|
||||
* Return the type.
|
||||
*
|
||||
* @return
|
||||
* String, type
|
||||
*/
|
||||
public final String getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* Attempt to get a booster.
|
||||
*
|
||||
* @return UnOpenedProduct, the generated booster.
|
||||
*/
|
||||
public UnOpenedProduct getBooster() {
|
||||
public IUnOpenedProduct getBooster() {
|
||||
|
||||
ItemPool<CardPrinted> cardPool = null;
|
||||
switch(type) {
|
||||
case Full:
|
||||
return new UnOpenedProduct(BoosterTemplate.genericBooster);
|
||||
|
||||
if ("meta".equalsIgnoreCase(type) || "choose1".equalsIgnoreCase(type)
|
||||
|| "random1".equalsIgnoreCase(type) || "combo".equalsIgnoreCase(type)) {
|
||||
cardPool = new ItemPool<CardPrinted>(CardPrinted.class);
|
||||
}
|
||||
case Booster:
|
||||
return new UnOpenedProduct(Singletons.getModel().getBoosters().get(data));
|
||||
|
||||
if ("cube".equalsIgnoreCase(type)) {
|
||||
case Pack:
|
||||
return new UnOpenedProduct(Singletons.getModel().getTournamentPacks().get(data));
|
||||
|
||||
final File dFolder = new File("res/sealed/");
|
||||
case JoinedSet:
|
||||
Predicate<CardPrinted> predicate = IPaperCard.Predicates.printedInSets(data.split(" "));
|
||||
Iterable<CardPrinted> pool = Iterables.filter(CardDb.instance().getAllCards(), predicate);
|
||||
return new UnOpenedProduct(BoosterTemplate.genericBooster, pool);
|
||||
|
||||
if (!dFolder.exists()) {
|
||||
throw new RuntimeException("GenerateSealed : folder not found -- folder is " + dFolder.getAbsolutePath());
|
||||
}
|
||||
case Choose:
|
||||
return new UnOpenedMeta(data, true);
|
||||
|
||||
if (!dFolder.isDirectory()) {
|
||||
throw new RuntimeException("GenerateSealed : not a folder -- " + dFolder.getAbsolutePath());
|
||||
}
|
||||
case Random:
|
||||
return new UnOpenedMeta(data, false);
|
||||
|
||||
List<String> dfData = FileUtil.readFile("res/sealed/" + data + ".sealed");
|
||||
final CustomLimited myCube = CustomLimited.parse(dfData, Singletons.getModel().getDecks().getCubes());
|
||||
|
||||
SealedProductTemplate fnPick = myCube.getIgnoreRarity() ? myCube.getSealedProductTemplate() : BoosterTemplate.genericBooster;
|
||||
return new UnOpenedProduct(fnPick, myCube.getCardPool());
|
||||
}
|
||||
else if ("full".equalsIgnoreCase(type)) {
|
||||
return new UnOpenedProduct(BoosterTemplate.genericBooster);
|
||||
}
|
||||
else if ("meta".equalsIgnoreCase(type)) {
|
||||
|
||||
// NOTE: The following code is far from ideal in a number of ways. If someone can
|
||||
// think of a way to improve it, please do so. --BBU
|
||||
// ItemPool<CardPrinted> cardPool = new ItemPool<CardPrinted>(CardPrinted.class);
|
||||
for (CardPrinted aCard : CardDb.instance().getAllCards()) {
|
||||
if (data.indexOf(aCard.getEdition()) > -1) {
|
||||
cardPool.add(aCard);
|
||||
// System.out.println("Added card" + aCard.getName());
|
||||
}
|
||||
}
|
||||
return new UnOpenedProduct(BoosterTemplate.genericBooster, cardPool);
|
||||
} else if ("booster".equalsIgnoreCase(type)) {
|
||||
return new UnOpenedProduct(Singletons.getModel().getBoosters().get(data));
|
||||
} else if ("pack".equalsIgnoreCase(type)) {
|
||||
return new UnOpenedProduct(Singletons.getModel().getTournamentPacks().get(data));
|
||||
} else if ("choose1".equalsIgnoreCase(type)) {
|
||||
return new UnOpenedMeta(data, true);
|
||||
} else if ("random1".equalsIgnoreCase(type)) {
|
||||
return new UnOpenedMeta(data, false);
|
||||
} else if ("combo".equalsIgnoreCase(type)) {
|
||||
final BoosterGenerator bpSets = new BoosterGenerator();
|
||||
return new UnOpenedProduct(BoosterTemplate.genericBooster, buildPool(data));
|
||||
}
|
||||
else {
|
||||
throw new RuntimeException("Cannot initialize boosters for: " + type);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build a cardpool for the 'combo' special MetaSet type.
|
||||
*
|
||||
* @param creationString
|
||||
* the data that contains a collection of semicolon-separated metaset definitions
|
||||
* @return ItemPool<CardPrinted>
|
||||
* the collection of cards
|
||||
*
|
||||
*/
|
||||
private ItemPool<CardPrinted> buildPool(final String creationString) {
|
||||
|
||||
ItemPool<CardPrinted> cardPool = new ItemPool<CardPrinted>(CardPrinted.class);
|
||||
|
||||
List<MetaSet> metaSets = new ArrayList<MetaSet>();
|
||||
final String[] metas = creationString.split(";");
|
||||
|
||||
for (int i = 0; i < metas.length; i++) {
|
||||
|
||||
final String [] typeTest = metas[i].split("/");
|
||||
if (typeTest[0].equalsIgnoreCase("choose1") || typeTest[0].equalsIgnoreCase("random1")
|
||||
|| typeTest[0].equalsIgnoreCase("combo")) {
|
||||
System.out.println("WARNING - MetaSet type '" + typeTest[0] + "' ignored in pool creation.");
|
||||
}
|
||||
else if (typeTest[0].equalsIgnoreCase("full")) {
|
||||
for (CardPrinted aCard : CardDb.instance().getUniqueCards()) {
|
||||
cardPool.add(aCard);
|
||||
}
|
||||
return cardPool;
|
||||
}
|
||||
final MetaSet addMeta = new MetaSet(metas[i]);
|
||||
metaSets.add(addMeta);
|
||||
}
|
||||
|
||||
if (metaSets.size() < 1) {
|
||||
return null;
|
||||
}
|
||||
|
||||
for (MetaSet mSet : metaSets) {
|
||||
if (mSet.type.equalsIgnoreCase("meta") || mSet.type.equalsIgnoreCase("booster")
|
||||
|| mSet.type.equalsIgnoreCase("pack")) {
|
||||
final String mData = new String(mSet.data);
|
||||
for (CardPrinted aCard : CardDb.instance().getAllCards()) {
|
||||
if (mData.indexOf(aCard.getEdition()) > -1) {
|
||||
if (!cardPool.contains(aCard)) {
|
||||
cardPool.add(aCard);
|
||||
// System.out.println(mSet.type + " " + mData + ": Added card: " + aCard.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (mSet.type.equalsIgnoreCase("cube")) {
|
||||
case Cube:
|
||||
final File dFolder = new File("res/sealed/");
|
||||
|
||||
if (!dFolder.exists()) {
|
||||
throw new RuntimeException("GenerateSealed : folder not found -- folder is "
|
||||
+ dFolder.getAbsolutePath());
|
||||
throw new RuntimeException("GenerateSealed : folder not found -- folder is " + dFolder.getAbsolutePath());
|
||||
}
|
||||
|
||||
if (!dFolder.isDirectory()) {
|
||||
throw new RuntimeException("GenerateSealed : not a folder -- " + dFolder.getAbsolutePath());
|
||||
}
|
||||
|
||||
List<String> dfData = FileUtil.readFile("res/sealed/" + mSet.data + ".sealed");
|
||||
List<String> dfData = FileUtil.readFile("res/sealed/" + data + ".sealed");
|
||||
final CustomLimited myCube = CustomLimited.parse(dfData, Singletons.getModel().getDecks().getCubes());
|
||||
for (CardPrinted aCard : myCube.getCardPool().toFlatList()) {
|
||||
if (!cardPool.contains(aCard)) {
|
||||
cardPool.add(aCard);
|
||||
// System.out.println(mSet.type + " " + mSet.data + ": Added card: " + aCard.getName());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SealedProductTemplate fnPick = myCube.getSealedProductTemplate();
|
||||
return new UnOpenedProduct(fnPick, myCube.getCardPool());
|
||||
|
||||
default: return null;
|
||||
}
|
||||
return cardPool;
|
||||
}
|
||||
|
||||
public boolean isDraftable() {
|
||||
return draftable;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Random;
|
||||
|
||||
import forge.Singletons;
|
||||
import forge.gui.GuiChoose;
|
||||
import forge.item.CardPrinted;
|
||||
import forge.util.MyRandom;
|
||||
@@ -30,14 +29,12 @@ import forge.util.MyRandom;
|
||||
/**
|
||||
* This type extends UnOpenedProduct to support booster choice or random boosters
|
||||
* in sealed deck games. See MetaSet.java for further information.
|
||||
*
|
||||
*/
|
||||
public class UnOpenedMeta extends UnOpenedProduct {
|
||||
|
||||
public class UnOpenedMeta implements IUnOpenedProduct {
|
||||
|
||||
private final ArrayList<MetaSet> metaSets;
|
||||
private final boolean choice;
|
||||
private List<String> partiality;
|
||||
private final int partialityPreference = 100; // Otherwise guild sealed will result in silly combinations
|
||||
private final boolean canChoose;
|
||||
private final Random generator = MyRandom.getRandom();
|
||||
|
||||
/**
|
||||
@@ -48,60 +45,23 @@ public class UnOpenedMeta extends UnOpenedProduct {
|
||||
* sets the random/choice status.
|
||||
*/
|
||||
public UnOpenedMeta(final String creationString, final boolean choose) {
|
||||
// NOTE: we need to call the super constructor with something non-null,
|
||||
// but it doesn't matter with what exactly, since we are overriding it
|
||||
// in open() anyway. I'm using Portal because that makes it easier to
|
||||
// spot if the code is misbehaving in certain ways. --BBU
|
||||
super(Singletons.getModel().getBoosters().get("POR"));
|
||||
metaSets = new ArrayList<MetaSet>();
|
||||
choice = choose;
|
||||
final String[] metas = creationString.split(";");
|
||||
partiality = null;
|
||||
for (int i = 0; i < metas.length; i++) {
|
||||
final MetaSet addMeta = new MetaSet(metas[i]);
|
||||
metaSets.add(addMeta);
|
||||
canChoose = choose;
|
||||
|
||||
|
||||
for(String m : creationString.split(";")) {
|
||||
metaSets.add(new MetaSet(m, true));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Adds to partiality info.
|
||||
* @param addString
|
||||
* String, add partiality for this String.
|
||||
*/
|
||||
private void addPartiality(final String addString) {
|
||||
if (!hasPartiality(addString)) {
|
||||
partiality.add(addString);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the AI has a partiality for this set.
|
||||
* @param partialString
|
||||
* String, check partiality for this.
|
||||
*/
|
||||
private boolean hasPartiality(final String partialString) {
|
||||
|
||||
if (partiality.isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (final String cmp : partiality) {
|
||||
if (partialString.equals(cmp)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Open the booster pack, return contents.
|
||||
* @return List, list of cards.
|
||||
*/
|
||||
@Override
|
||||
public List<CardPrinted> get() {
|
||||
return this.open(true, null);
|
||||
return this.open(true);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -113,14 +73,13 @@ public class UnOpenedMeta extends UnOpenedProduct {
|
||||
* @return List, list of cards.
|
||||
*/
|
||||
|
||||
public List<CardPrinted> open(final boolean isHuman, List<String> partialities) {
|
||||
public List<CardPrinted> open(final boolean isHuman) {
|
||||
|
||||
if (metaSets.size() < 1) {
|
||||
throw new RuntimeException("Empty UnOpenedMetaset, cannot generate booster.");
|
||||
}
|
||||
|
||||
if (choice) {
|
||||
|
||||
if (canChoose) {
|
||||
if (isHuman) {
|
||||
final List<String> choices = new ArrayList<String>();
|
||||
|
||||
@@ -131,7 +90,7 @@ public class UnOpenedMeta extends UnOpenedProduct {
|
||||
|
||||
for (int i = 0; i < metaSets.size(); i++) {
|
||||
if (o.toString().equals(metaSets.get(i).getCode())) {
|
||||
final UnOpenedProduct newBooster = metaSets.get(i).getBooster();
|
||||
final IUnOpenedProduct newBooster = metaSets.get(i).getBooster();
|
||||
return newBooster.get();
|
||||
}
|
||||
}
|
||||
@@ -139,50 +98,14 @@ public class UnOpenedMeta extends UnOpenedProduct {
|
||||
throw new RuntimeException("Could not find MetaSet " + o.toString());
|
||||
}
|
||||
else {
|
||||
partiality = partialities;
|
||||
int selected = -1;
|
||||
|
||||
if (partiality == null || partiality.isEmpty()) {
|
||||
// System.out.println("No partiality yet");
|
||||
selected = generator.nextInt(metaSets.size());
|
||||
// System.out.println("AI randomly chose " + metaSets.get(selected).getCode());
|
||||
if (partiality != null) {
|
||||
addPartiality(metaSets.get(selected).getCode());
|
||||
}
|
||||
}
|
||||
else {
|
||||
for (int i = 0; i < metaSets.size(); i++) {
|
||||
if (hasPartiality(metaSets.get(i).getCode()) && MyRandom.percentTrue(partialityPreference)) {
|
||||
// System.out.println("AI chose " + metaSets.get(i).getCode() + " because of partiality.");
|
||||
selected = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (selected == -1) {
|
||||
selected = generator.nextInt(metaSets.size());
|
||||
if (partiality != null) {
|
||||
addPartiality(metaSets.get(selected).getCode());
|
||||
}
|
||||
// System.out.println("AI chose " + metaSets.get(selected).getCode() + " because partiality not established or failed percentage test.");
|
||||
}
|
||||
final UnOpenedProduct newBooster = metaSets.get(selected).getBooster();
|
||||
int selected = generator.nextInt(metaSets.size());
|
||||
final IUnOpenedProduct newBooster = metaSets.get(selected).getBooster();
|
||||
return newBooster.get();
|
||||
}
|
||||
}
|
||||
else {
|
||||
int selected = generator.nextInt(metaSets.size());
|
||||
// System.out.println("RANDOMLY got " + metaSets.get(selected).getCode());
|
||||
|
||||
// It may actually seem slightly unfair to allow the computer change its partialities based
|
||||
// on the random sets it gets since the player can't do the same...but, OTOH, this could also
|
||||
// work against the computer, if this results in a bad partiality choice. --BBU
|
||||
if (!isHuman && partiality != null && MyRandom.percentTrue(partialityPreference)) {
|
||||
addPartiality(metaSets.get(selected).getCode());
|
||||
// System.out.println("AI decided to add " + metaSets.get(selected).getCode() + " to partialities.");
|
||||
}
|
||||
final UnOpenedProduct newBooster = metaSets.get(selected).getBooster();
|
||||
final IUnOpenedProduct newBooster = metaSets.get(selected).getBooster();
|
||||
return newBooster.get();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,16 +2,11 @@ package forge.card;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Supplier;
|
||||
|
||||
import forge.item.CardPrinted;
|
||||
import forge.item.ItemPoolView;
|
||||
|
||||
/**
|
||||
* TODO: Write javadoc for this type.
|
||||
*
|
||||
*/
|
||||
public class UnOpenedProduct implements Supplier<List<CardPrinted>> {
|
||||
public class UnOpenedProduct implements IUnOpenedProduct {
|
||||
|
||||
private final ItemPoolView<CardPrinted> cards;
|
||||
private final Iterable<CardPrinted> cardPoolFlat;
|
||||
|
||||
@@ -19,19 +19,13 @@ package forge.card.cardfactory;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.HashMap;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import com.google.common.collect.Iterables;
|
||||
|
||||
import forge.Card;
|
||||
import forge.CardLists;
|
||||
import forge.CardPredicates;
|
||||
import forge.FThreads;
|
||||
import forge.CardPredicates.Presets;
|
||||
import forge.Constant;
|
||||
import forge.card.CardType;
|
||||
import forge.card.cost.Cost;
|
||||
import forge.card.mana.ManaCost;
|
||||
import forge.card.spellability.Spell;
|
||||
|
||||
@@ -24,10 +24,13 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.NoSuchElementException;
|
||||
import java.util.Stack;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
|
||||
import com.google.common.base.Supplier;
|
||||
|
||||
import forge.Card;
|
||||
@@ -37,6 +40,7 @@ import forge.card.BoosterGenerator;
|
||||
import forge.card.BoosterTemplate;
|
||||
import forge.card.CardBlock;
|
||||
import forge.card.CardEdition;
|
||||
import forge.card.IUnOpenedProduct;
|
||||
import forge.card.SealedProductTemplate;
|
||||
import forge.card.UnOpenedProduct;
|
||||
import forge.deck.Deck;
|
||||
@@ -96,63 +100,37 @@ public final class BoosterDraft implements IBoosterDraft {
|
||||
case Block: case FantasyBlock: // Draft from cards by block or set
|
||||
|
||||
List<CardBlock> blocks = new ArrayList<CardBlock>();
|
||||
|
||||
IStorageView<CardBlock> storage = draftType == CardPoolLimitation.Block
|
||||
? Singletons.getModel().getBlocks() : Singletons.getModel().getFantasyBlocks();
|
||||
|
||||
for (CardBlock b : storage) {
|
||||
if (b.hasMetaSetType("choose1") || b.hasMetaSetType("random1")) {
|
||||
System.out.println("Ignoring block " + b.getName() + " because its MetaSet types are not supported in Draft.");
|
||||
} else {
|
||||
blocks.add(b);
|
||||
}
|
||||
blocks.add(b);
|
||||
}
|
||||
|
||||
|
||||
final CardBlock block = GuiChoose.one("Choose Block", blocks);
|
||||
|
||||
final CardEdition[] cardSets = block.getSets();
|
||||
final String[] sets = new String[cardSets.length + block.getNumberMetaSets()];
|
||||
final Stack<String> sets = new Stack<String>();
|
||||
for (int k = cardSets.length - 1; k >= 0; --k) {
|
||||
sets[k] = cardSets[k].getCode();
|
||||
sets.add(cardSets[k].getCode());
|
||||
}
|
||||
|
||||
if (block.getNumberMetaSets() > 0) {
|
||||
|
||||
int j = cardSets.length;
|
||||
|
||||
for (int k = 0; k < block.getNumberMetaSets(); k++) {
|
||||
sets[j + k] = block.getMetaSet(k).getCode();
|
||||
}
|
||||
for(String setCode : block.getMetaSetNames() ) {
|
||||
if ( block.getMetaSet(setCode).isDraftable() )
|
||||
sets.push(setCode); // to the beginning
|
||||
}
|
||||
|
||||
final int nPacks = block.getCntBoostersDraft();
|
||||
final List<String> setCombos = getSetCombos(sets);
|
||||
|
||||
while (setCombos == null) {
|
||||
throw new RuntimeException("Unsupported amount of packs (" + nPacks + ") in a Draft block!");
|
||||
}
|
||||
|
||||
if (sets.length > 1) {
|
||||
final Object p = GuiChoose.one("Choose Set Combination", setCombos);
|
||||
if (sets.size() > 1) {
|
||||
final Object p = GuiChoose.one("Choose Set Combination", getSetCombos(sets));
|
||||
final String[] pp = p.toString().split("/");
|
||||
for (int i = 0; i < nPacks; i++) {
|
||||
if (pp[i].charAt(0) == '*') {
|
||||
this.product.add(block.getBooster(pp[i]));
|
||||
}
|
||||
else {
|
||||
this.product.add(
|
||||
new UnOpenedProduct(Singletons.getModel().getBoosters().get(pp[i])));
|
||||
}
|
||||
this.product.add(block.getBooster(pp[i]));
|
||||
}
|
||||
} else {
|
||||
UnOpenedProduct product1;
|
||||
if (sets[0].charAt(0) == '*') {
|
||||
product1 = block.getBooster(sets[0]);
|
||||
}
|
||||
else {
|
||||
product1 = new UnOpenedProduct(Singletons.getModel().getBoosters().get(sets[0]));
|
||||
}
|
||||
IUnOpenedProduct product1 = block.getBooster(sets.get(0));
|
||||
|
||||
for (int i = 0; i < nPacks; i++) {
|
||||
this.product.add(product1);
|
||||
}
|
||||
@@ -368,8 +346,9 @@ public final class BoosterDraft implements IBoosterDraft {
|
||||
HttpUtil.upload(NewConstants.URL_DRAFT_UPLOAD + "?fmt=" + draftFormat, outDraftData);
|
||||
}
|
||||
|
||||
private ArrayList<String> getSetCombos(final String[] sets) {
|
||||
ArrayList<String> setCombos = new ArrayList<String>();
|
||||
private List<String> getSetCombos(final List<String> setz) {
|
||||
String[] sets = setz.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
|
||||
List<String> setCombos = new ArrayList<String>();
|
||||
if (sets.length >= 2) {
|
||||
setCombos.add(String.format("%s/%s/%s", sets[0], sets[0], sets[0]));
|
||||
setCombos.add(String.format("%s/%s/%s", sets[0], sets[0], sets[1]));
|
||||
|
||||
@@ -60,13 +60,6 @@ public class CustomLimited extends DeckBase {
|
||||
|
||||
private static final long serialVersionUID = 7435640939026612173L;
|
||||
|
||||
/** The Ignore rarity. */
|
||||
private boolean ignoreRarity;
|
||||
|
||||
/** The Singleton. */
|
||||
private boolean singleton = false;
|
||||
|
||||
|
||||
/** The Num packs. */
|
||||
private int numPacks = 3;
|
||||
|
||||
@@ -109,8 +102,6 @@ public class CustomLimited extends DeckBase {
|
||||
slots = BoosterTemplate.genericBooster.getSlots();
|
||||
|
||||
final CustomLimited cd = new CustomLimited(data.get("Name"), slots);
|
||||
cd.setIgnoreRarity(data.getBoolean("IgnoreRarity"));
|
||||
cd.setSingleton(data.getBoolean("Singleton"));
|
||||
cd.landSetCode = data.get("LandSetCode");
|
||||
cd.numPacks = data.getInt("NumPacks");
|
||||
final Deck deckCube = cubes.get(data.get("DeckFile"));
|
||||
@@ -140,44 +131,6 @@ public class CustomLimited extends DeckBase {
|
||||
this.numPacks = numPacksIn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the singleton.
|
||||
*
|
||||
* @return the singleton
|
||||
*/
|
||||
public boolean getSingleton() {
|
||||
return this.singleton;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the singleton.
|
||||
*
|
||||
* @param singletonIn
|
||||
* the singleton to set
|
||||
*/
|
||||
public void setSingleton(final boolean singletonIn) {
|
||||
this.singleton = singletonIn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the ignore rarity.
|
||||
*
|
||||
* @return the ignoreRarity
|
||||
*/
|
||||
public boolean getIgnoreRarity() {
|
||||
return this.ignoreRarity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the ignore rarity.
|
||||
*
|
||||
* @param ignoreRarityIn
|
||||
* the ignoreRarity to set
|
||||
*/
|
||||
public void setIgnoreRarity(final boolean ignoreRarityIn) {
|
||||
this.ignoreRarity = ignoreRarityIn;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the land set code.
|
||||
*
|
||||
|
||||
@@ -20,13 +20,17 @@ package forge.game.limited;
|
||||
import java.io.File;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Stack;
|
||||
|
||||
import javax.swing.JOptionPane;
|
||||
|
||||
import org.apache.commons.lang.ArrayUtils;
|
||||
|
||||
import forge.Singletons;
|
||||
import forge.card.BoosterTemplate;
|
||||
import forge.card.CardBlock;
|
||||
import forge.card.CardEdition;
|
||||
import forge.card.IUnOpenedProduct;
|
||||
import forge.card.UnOpenedMeta;
|
||||
import forge.card.UnOpenedProduct;
|
||||
import forge.gui.GuiChoose;
|
||||
@@ -45,8 +49,7 @@ import forge.util.FileUtil;
|
||||
* @since 1.0.15
|
||||
*/
|
||||
public class SealedDeckFormat {
|
||||
private final ArrayList<UnOpenedProduct> product = new ArrayList<UnOpenedProduct>();
|
||||
private List<String> partiality;
|
||||
private final ArrayList<IUnOpenedProduct> product = new ArrayList<IUnOpenedProduct>();
|
||||
|
||||
/** The Land set code. */
|
||||
private String[] landSetCode = { "" };
|
||||
@@ -60,9 +63,6 @@ public class SealedDeckFormat {
|
||||
* a {@link java.lang.String} object.
|
||||
*/
|
||||
public SealedDeckFormat(final String sealedType) {
|
||||
|
||||
partiality = new ArrayList<String>();
|
||||
|
||||
if (sealedType.equals("Full")) {
|
||||
// Choose number of boosters
|
||||
final Integer[] integers = new Integer[10];
|
||||
@@ -96,20 +96,16 @@ public class SealedDeckFormat {
|
||||
final CardBlock block = GuiChoose.one("Choose Block", blocks);
|
||||
|
||||
final CardEdition[] cardSets = block.getSets();
|
||||
final String[] sets = new String[cardSets.length + block.getNumberMetaSets()];
|
||||
final Stack<String> sets = new Stack<String>();
|
||||
|
||||
for (int k = cardSets.length - 1; k >= 0; --k) {
|
||||
sets[k] = cardSets[k].getCode();
|
||||
sets.add(cardSets[k].getCode());
|
||||
}
|
||||
|
||||
final int nPacks = block.getCntBoostersSealed();
|
||||
|
||||
if (block.getNumberMetaSets() > 0) {
|
||||
|
||||
int j = cardSets.length;
|
||||
|
||||
for (int k = 0; k < block.getNumberMetaSets(); k++) {
|
||||
sets[j + k] = block.getMetaSet(k).getCode();
|
||||
}
|
||||
for(String ms : block.getMetaSetNames()) {
|
||||
sets.push(ms);
|
||||
}
|
||||
|
||||
final List<String> setCombos = getSetCombos(sets, nPacks);
|
||||
@@ -118,7 +114,7 @@ public class SealedDeckFormat {
|
||||
throw new RuntimeException("Unsupported amount of packs (" + nPacks + ") in a Sealed Deck block!");
|
||||
}
|
||||
|
||||
if (sets.length > 1) {
|
||||
if (sets.size() > 1) {
|
||||
final Object p = GuiChoose.one("Choose Set Combination", setCombos);
|
||||
|
||||
final String[] pp = p.toString().split("/");
|
||||
@@ -210,13 +206,8 @@ public class SealedDeckFormat {
|
||||
}
|
||||
}
|
||||
} else {
|
||||
UnOpenedProduct product1;
|
||||
if (sets[0].charAt(0) == '*') {
|
||||
product1 = block.getBooster(sets[0]);
|
||||
}
|
||||
else {
|
||||
product1 = new UnOpenedProduct(Singletons.getModel().getBoosters().get(sets[0]));
|
||||
}
|
||||
IUnOpenedProduct product1;
|
||||
product1 = block.getBooster(sets.get(0));
|
||||
|
||||
// Choose number of boosters
|
||||
final Integer[] integers = new Integer[10];
|
||||
@@ -296,7 +287,8 @@ public class SealedDeckFormat {
|
||||
*
|
||||
* @return an ArrayList of the set choices.
|
||||
*/
|
||||
private ArrayList<String> getSetCombos(final String[] sets, final int nPacks) {
|
||||
private ArrayList<String> getSetCombos(final List<String> setz, final int nPacks) {
|
||||
String[] sets = setz.toArray(ArrayUtils.EMPTY_STRING_ARRAY);
|
||||
ArrayList<String> setCombos = new ArrayList<String>();
|
||||
|
||||
if (nPacks == 3) {
|
||||
@@ -398,24 +390,24 @@ public class SealedDeckFormat {
|
||||
setCombos.add(String.format("%s/%s/%s/%s/%s/%s/%s/%s/%s", sets[0], sets[0], sets[0], sets[0], sets[0], sets[0], sets[0], sets[0], sets[0]));
|
||||
}
|
||||
else { // Default to 6 packs
|
||||
if (sets.length >= 2) {
|
||||
setCombos.add(String.format("%s/%s/%s/%s/%s/%s", sets[0], sets[0], sets[0], sets[0], sets[0], sets[0]));
|
||||
setCombos.add(String.format("%s/%s/%s/%s/%s/%s", sets[1], sets[1], sets[0], sets[0], sets[0], sets[0]));
|
||||
setCombos.add(String.format("%s/%s/%s/%s/%s/%s", sets[1], sets[1], sets[1], sets[0], sets[0], sets[0]));
|
||||
if (sets.length >= 6) {
|
||||
setCombos.add(String.format("%s/%s/%s/%s/%s/%s", sets[5], sets[4], sets[3], sets[2], sets[1], sets[0]));
|
||||
}
|
||||
if (sets.length >= 3) {
|
||||
setCombos.add(String.format("%s/%s/%s/%s/%s/%s", sets[2], sets[2], sets[2], sets[0], sets[0], sets[0]));
|
||||
setCombos.add(String.format("%s/%s/%s/%s/%s/%s", sets[2], sets[2], sets[1], sets[1], sets[0], sets[0]));
|
||||
if (sets.length >= 5) {
|
||||
setCombos.add(String.format("%s/%s/%s/%s/%s/%s", sets[4], sets[3], sets[2], sets[1], sets[0], sets[0]));
|
||||
}
|
||||
if (sets.length >= 4) {
|
||||
setCombos.add(String.format("%s/%s/%s/%s/%s/%s", sets[3], sets[2], sets[1], sets[0], sets[0], sets[0]));
|
||||
setCombos.add(String.format("%s/%s/%s/%s/%s/%s", sets[3], sets[2], sets[1], sets[1], sets[0], sets[0]));
|
||||
}
|
||||
if (sets.length >= 5) {
|
||||
setCombos.add(String.format("%s/%s/%s/%s/%s/%s", sets[4], sets[3], sets[2], sets[1], sets[0], sets[0]));
|
||||
if (sets.length >= 3) {
|
||||
setCombos.add(String.format("%s/%s/%s/%s/%s/%s", sets[2], sets[2], sets[2], sets[0], sets[0], sets[0]));
|
||||
setCombos.add(String.format("%s/%s/%s/%s/%s/%s", sets[2], sets[2], sets[1], sets[1], sets[0], sets[0]));
|
||||
}
|
||||
if (sets.length >= 6) {
|
||||
setCombos.add(String.format("%s/%s/%s/%s/%s/%s", sets[5], sets[4], sets[3], sets[2], sets[1], sets[0]));
|
||||
if (sets.length >= 2) {
|
||||
setCombos.add(String.format("%s/%s/%s/%s/%s/%s", sets[1], sets[1], sets[1], sets[0], sets[0], sets[0]));
|
||||
setCombos.add(String.format("%s/%s/%s/%s/%s/%s", sets[1], sets[1], sets[0], sets[0], sets[0], sets[0]));
|
||||
setCombos.add(String.format("%s/%s/%s/%s/%s/%s", sets[0], sets[0], sets[0], sets[0], sets[0], sets[0]));
|
||||
}
|
||||
}
|
||||
return setCombos;
|
||||
@@ -443,16 +435,12 @@ public class SealedDeckFormat {
|
||||
*/
|
||||
public ItemPool<CardPrinted> getCardpool(final boolean isHuman) {
|
||||
|
||||
if (!isHuman) {
|
||||
if (!partiality.isEmpty()) {
|
||||
partiality.clear();
|
||||
}
|
||||
}
|
||||
|
||||
final ItemPool<CardPrinted> pool = new ItemPool<CardPrinted>(CardPrinted.class);
|
||||
|
||||
for (UnOpenedProduct prod : product) {
|
||||
for (IUnOpenedProduct prod : product) {
|
||||
if( prod instanceof UnOpenedMeta )
|
||||
pool.addAllFlat(((UnOpenedMeta) prod).open(isHuman, partiality));
|
||||
pool.addAllFlat(((UnOpenedMeta) prod).open(isHuman));
|
||||
else
|
||||
pool.addAllFlat(prod.get());
|
||||
}
|
||||
|
||||
@@ -150,27 +150,6 @@ public class HumanPlayer extends Player {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean payManaCostIfNeeded(final SpellAbility sa) {
|
||||
final ManaCostBeingPaid manaCost;
|
||||
if (sa.getSourceCard().isCopiedSpell() && sa.isSpell()) {
|
||||
manaCost = new ManaCostBeingPaid(ManaCost.ZERO);
|
||||
} else {
|
||||
manaCost = new ManaCostBeingPaid(sa.getPayCosts().getTotalMana());
|
||||
manaCost.applySpellCostChange(sa);
|
||||
}
|
||||
|
||||
boolean isPaid = manaCost.isPaid();
|
||||
|
||||
if( !isPaid ) {
|
||||
InputPayManaBase inputPay = new InputPayManaSimple(game, sa, manaCost);
|
||||
FThreads.setInputAndWait(inputPay);
|
||||
isPaid = inputPay.isPaid();
|
||||
}
|
||||
return isPaid;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* playSpellAbility_NoStack.
|
||||
@@ -199,6 +178,25 @@ public class HumanPlayer extends Player {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean payManaCostIfNeeded(final SpellAbility sa) {
|
||||
final ManaCostBeingPaid manaCost;
|
||||
if (sa.getSourceCard().isCopiedSpell() && sa.isSpell()) {
|
||||
manaCost = new ManaCostBeingPaid(ManaCost.ZERO);
|
||||
} else {
|
||||
manaCost = new ManaCostBeingPaid(sa.getPayCosts().getTotalMana());
|
||||
manaCost.applySpellCostChange(sa);
|
||||
}
|
||||
|
||||
boolean isPaid = manaCost.isPaid();
|
||||
|
||||
if( !isPaid ) {
|
||||
InputPayManaBase inputPay = new InputPayManaSimple(game, sa, manaCost);
|
||||
FThreads.setInputAndWait(inputPay);
|
||||
isPaid = inputPay.isPaid();
|
||||
}
|
||||
return isPaid;
|
||||
}
|
||||
|
||||
/**
|
||||
* choose optional additional costs. For HUMAN only
|
||||
* @param activator
|
||||
|
||||
Reference in New Issue
Block a user