mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 19:58:00 +00:00
- Merge the latest trunk into Splitcards.
This commit is contained in:
7
.gitattributes
vendored
7
.gitattributes
vendored
@@ -2611,6 +2611,7 @@ res/cardsfolder/d/diamond_valley.txt svneol=native#text/plain
|
||||
res/cardsfolder/d/didgeridoo.txt svneol=native#text/plain
|
||||
res/cardsfolder/d/diligent_farmhand.txt svneol=native#text/plain
|
||||
res/cardsfolder/d/diluvian_primordial.txt -text
|
||||
res/cardsfolder/d/dimensional_breach.txt -text
|
||||
res/cardsfolder/d/diminish.txt svneol=native#text/plain
|
||||
res/cardsfolder/d/diminishing_returns.txt svneol=native#text/plain
|
||||
res/cardsfolder/d/dimir_aqueduct.txt svneol=native#text/plain
|
||||
@@ -3299,6 +3300,7 @@ res/cardsfolder/e/ethersworn_canonist.txt -text
|
||||
res/cardsfolder/e/ethersworn_shieldmage.txt -text
|
||||
res/cardsfolder/e/etherwrought_page.txt -text svneol=unset#text/plain
|
||||
res/cardsfolder/e/eunuchs_intrigues.txt -text
|
||||
res/cardsfolder/e/eureka.txt -text
|
||||
res/cardsfolder/e/evacuation.txt svneol=native#text/plain
|
||||
res/cardsfolder/e/evaporate.txt svneol=native#text/plain
|
||||
res/cardsfolder/e/evasive_action.txt svneol=native#text/plain
|
||||
@@ -3491,6 +3493,7 @@ res/cardsfolder/f/feed_the_pack.txt -text
|
||||
res/cardsfolder/f/feedback.txt svneol=native#text/plain
|
||||
res/cardsfolder/f/feedback_bolt.txt svneol=native#text/plain
|
||||
res/cardsfolder/f/feeding_frenzy.txt svneol=native#text/plain
|
||||
res/cardsfolder/f/feeding_grounds.txt -text
|
||||
res/cardsfolder/f/feeling_of_dread.txt -text
|
||||
res/cardsfolder/f/feint.txt -text
|
||||
res/cardsfolder/f/feldons_cane.txt svneol=native#text/plain
|
||||
@@ -4946,6 +4949,7 @@ res/cardsfolder/h/hope_charm.txt svneol=native#text/plain
|
||||
res/cardsfolder/h/hopping_automaton.txt svneol=native#text/plain
|
||||
res/cardsfolder/h/horde_of_boggarts.txt -text
|
||||
res/cardsfolder/h/horde_of_notions.txt svneol=native#text/plain
|
||||
res/cardsfolder/h/horizon_boughs.txt -text
|
||||
res/cardsfolder/h/horizon_canopy.txt svneol=native#text/plain
|
||||
res/cardsfolder/h/horizon_drake.txt svneol=native#text/plain
|
||||
res/cardsfolder/h/horizon_seed.txt -text
|
||||
@@ -5049,6 +5053,7 @@ res/cardsfolder/h/hydrosurge.txt -text
|
||||
res/cardsfolder/h/hyena_umbra.txt svneol=native#text/plain
|
||||
res/cardsfolder/h/hymn_of_rebirth.txt svneol=native#text/plain
|
||||
res/cardsfolder/h/hymn_to_tourach.txt svneol=native#text/plain
|
||||
res/cardsfolder/h/hypergenesis.txt -text
|
||||
res/cardsfolder/h/hyperion_blacksmith.txt svneol=native#text/plain
|
||||
res/cardsfolder/h/hypersonic_dragon.txt -text
|
||||
res/cardsfolder/h/hypervolt_grasp.txt svneol=native#text/plain
|
||||
@@ -6037,6 +6042,7 @@ res/cardsfolder/l/lim_dul_the_necromancer.txt svneol=native#text/plain
|
||||
res/cardsfolder/l/lim_duls_cohort.txt svneol=native#text/plain
|
||||
res/cardsfolder/l/lim_duls_high_guard.txt svneol=native#text/plain
|
||||
res/cardsfolder/l/lim_duls_paladin.txt -text
|
||||
res/cardsfolder/l/lim_duls_vault.txt -text
|
||||
res/cardsfolder/l/limestone_golem.txt svneol=native#text/plain
|
||||
res/cardsfolder/l/limited_resources.txt -text
|
||||
res/cardsfolder/l/lin_sivvi_defiant_hero.txt svneol=native#text/plain
|
||||
@@ -14530,7 +14536,6 @@ src/main/java/forge/view/arcane/package-info.java svneol=native#text/plain
|
||||
src/main/java/forge/view/arcane/util/Animation.java svneol=native#text/plain
|
||||
src/main/java/forge/view/arcane/util/CardPanelMouseListener.java svneol=native#text/plain
|
||||
src/main/java/forge/view/arcane/util/GlowText.java svneol=native#text/plain
|
||||
src/main/java/forge/view/arcane/util/UI.java svneol=native#text/plain
|
||||
src/main/java/forge/view/arcane/util/package-info.java svneol=native#text/plain
|
||||
src/main/java/forge/view/package-info.java svneol=native#text/plain
|
||||
src/main/resources/proxy-template.ftl -text
|
||||
|
||||
@@ -1,53 +1,53 @@
|
||||
Index:0|Set0:LEA|Name:Alpha|DraftPacks:3|LandSetCode:LEA|SealedPacks:6
|
||||
Index:1|Set0:LEB|Name:Beta|DraftPacks:3|LandSetCode:LEB|SealedPacks:6
|
||||
Index:2|Set0:2ED|Name:Unlimited|DraftPacks:3|LandSetCode:2ED|SealedPacks:6
|
||||
Index:3|Set0:ARN|Name:Arabian Nights|DraftPacks:5|LandSetCode:2ED|SealedPacks:9
|
||||
Index:4|Set0:ATQ|Name:Antiquities|DraftPacks:5|LandSetCode:2ED|SealedPacks:9
|
||||
Index:5|Set0:3ED|Name:Revised|DraftPacks:3|LandSetCode:3ED|SealedPacks:6
|
||||
Index:6|Set0:LEG|Name:Legends|DraftPacks:3|LandSetCode:3ED|SealedPacks:6
|
||||
Index:7|Set0:DRK|Name:The Dark|DraftPacks:5|LandSetCode:3ED|SealedPacks:9
|
||||
Index:8|Set0:FEM|Name:Fallen Empires|DraftPacks:5|LandSetCode:3ED|SealedPacks:9
|
||||
Index:9|Set0:4ED|Name:Fourth Edition|DraftPacks:3|LandSetCode:4ED|SealedPacks:6
|
||||
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
|
||||
|
||||
Index:10|Set0:ICE|Set1:ALL|Set2:CSP|Name:Ice Age|DraftPacks:3|LandSetCode:ICE|SealedPacks:6
|
||||
Index:11|Set0:HML|Name:Homelands|DraftPacks:5|LandSetCode:4ED|SealedPacks:9
|
||||
Index:12|Set0:MIR|Set1:VIS|Set2:WTH|Name:Mirage|DraftPacks:3|LandSetCode:MIR|SealedPacks:6
|
||||
Index:13|Set0:5ED|Name:Fifth Edition|DraftPacks:3|LandSetCode:5ED|SealedPacks:6
|
||||
Index:14|Set0:POR|Name:Portal|DraftPacks:3|LandSetCode:POR|SealedPacks:6
|
||||
Index:15|Set0:TMP|Set1:STH|Set2:EXO|Name:Tempest|DraftPacks:3|LandSetCode:TMP|SealedPacks:6
|
||||
Index:16|Set0:PO2|Name:Portal Second Age|DraftPacks:3|LandSetCode:PO2|SealedPacks:6
|
||||
Index:17|Set0:USG|Set1:ULG|Set2:UDS|Name:Urza|DraftPacks:3|LandSetCode:USG|SealedPacks:6
|
||||
Index:18|Set0:6ED|Name:Sixth Edition|DraftPacks:3|LandSetCode:6ED|SealedPacks:6
|
||||
Index:19|Set0:PTK|Name:Portal Three Kingdoms|DraftPacks:5|LandSetCode:PTK|SealedPacks:9
|
||||
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
|
||||
|
||||
Index:20|Set0:MMQ|Set1:NMS|Set2:PCY|Name:Masques|DraftPacks:3|LandSetCode:MMQ|SealedPacks:6
|
||||
Index:21|Set0:INV|Set1:PLS|Set2:APC|Name:Invasion|DraftPacks:3|LandSetCode:INV|SealedPacks:6
|
||||
Index:22|Set0:7ED|Name:Seventh Edition|DraftPacks:3|LandSetCode:7ED|SealedPacks:6
|
||||
Index:23|Set0:ODY|Set1:TOR|Set2:JUD|Name:Odyssey|DraftPacks:3|LandSetCode:ODY|SealedPacks:6
|
||||
Index:24|Set0:ONS|Set1:LGN|Set2:SCG|Name:Onslaught|DraftPacks:3|LandSetCode:ONS|SealedPacks:6
|
||||
Index:25|Set0:8ED|Name:Eighth Edition|DraftPacks:3|LandSetCode:8ED|SealedPacks:6
|
||||
Index:26|Set0:MRD|Set1:DST|Set2:5DN|Name:Mirrodin|DraftPacks:3|LandSetCode:MRD|SealedPacks:6
|
||||
Index:27|Set0:CHK|Set1:BOK|Set2:SOK|Name:Kamigawa|DraftPacks:3|LandSetCode:CHK|SealedPacks:6
|
||||
Index:28|Set0:9ED|Name:Ninth Edition|DraftPacks:3|LandSetCode:9ED|SealedPacks:6
|
||||
Index:29|Set0:RAV|Set1:GPT|Set2:DIS|Name:Ravnica|DraftPacks:3|LandSetCode:RAV|SealedPacks:6
|
||||
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
|
||||
|
||||
Index:30|Set0:CSP|Name:Coldsnap|DraftPacks:3|LandSetCode:9ED|SealedPacks:6
|
||||
Index:31|Set0:TSP|Set1:PLC|Set2:FUT|Name:Time Spiral|DraftPacks:3|LandSetCode:TSP|SealedPacks:6
|
||||
Index:32|Set0:10E|Name:Tenth Edition|DraftPacks:3|LandSetCode:10E|SealedPacks:6
|
||||
Index:33|Set0:LRW|Set1:MOR|Name:Lorwyn|DraftPacks:3|LandSetCode:LRW|SealedPacks:6
|
||||
Index:34|Set0:SHM|Set1:EVE|Name:Shadowmoor|DraftPacks:3|LandSetCode:SHM|SealedPacks:6
|
||||
Index:35|Set0:ALA|Set1:CFX|Set2:ARB|Name:Shards of Alara|DraftPacks:3|LandSetCode:ALA|SealedPacks:6
|
||||
Index:36|Set0:M10|Name:Magic 2010|DraftPacks:3|LandSetCode:M10|SealedPacks:6
|
||||
Index:37|Set0:ZEN|Set1:WWK|Name:Zendikar|DraftPacks:3|LandSetCode:ZEN|SealedPacks:6
|
||||
Index:38|Set0:ROE|Name:Rise of the Eldrazi|DraftPacks:3|LandSetCode:ROE|SealedPacks:6
|
||||
Index:39|Set0:M11|Name:Magic 2011|DraftPacks:3|LandSetCode:M11|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
|
||||
|
||||
Index:40|Set0:SOM|Set1:MBS|Set2:NPH|Name:Scars of Mirrodin|DraftPacks:3|LandSetCode:SOM|SealedPacks:6
|
||||
Index:41|Set0:M12|Name:Magic 2012|DraftPacks:3|LandSetCode:M12|SealedPacks:6
|
||||
Index:42|Set0:ISD|Set1:DKA|Name:Innistrad|DraftPacks:3|LandSetCode:ISD|SealedPacks:6
|
||||
Index:43|Set0:AVR|Name:Avacyn Restored|DraftPacks:3|LandSetCode:AVR|SealedPacks:6
|
||||
Index:44|Set0:M13|Name:Magic 2013|DraftPacks:3|LandSetCode:M13|SealedPacks:6
|
||||
Index:45|Set0:RTR|Name:Return to Ravnica|DraftPacks:3|LandSetCode:RTR|SealedPacks:6
|
||||
Index:46|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
|
||||
Index:47|Set0:GTC|Name:Gatecrash|DraftPacks:3|LandSetCode:RTR|SealedPacks:6
|
||||
Index:48|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
|
||||
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
|
||||
|
||||
@@ -1,97 +1,97 @@
|
||||
Index:0|Code2:MBP|Code3:MBP|Type:Other|Name:Media Insert Promo|Alias:PRO
|
||||
Index:1|Code2:A|Code3:LEA|Type:Core|Name:Limited Edition Alpha
|
||||
Index:2|Code2:B|Code3:LEB|Type:Core|Name:Limited Edition Beta
|
||||
Index:3|Code2:U|Code3:2ED|Type:Core|Border:White|Name:Unlimited Edition
|
||||
Index:4|Code2:AN|Code3:ARN|Type:Expansion|Name:Arabian Nights
|
||||
Index:5|Code2:AQ|Code3:ATQ|Type:Expansion|Name:Antiquities
|
||||
Index:6|Code2:R|Code3:3ED|Type:Core|Border:White|Name:Revised Edition
|
||||
Index:7|Code2:LG|Code3:LEG|Type:Expansion|Name:Legends
|
||||
Index:8|Code2:DK|Code3:DRK|Type:Expansion|Name:The Dark
|
||||
Index:9|Code2:FE|Code3:FEM|Type:Expansion|Name:Fallen Empires
|
||||
Code2:MBP|Code3:MBP|Type:Other|Name:Media Insert Promo|Alias:PRO
|
||||
Code2:A|Code3:LEA|Type:Core|Name:Limited Edition Alpha
|
||||
Code2:B|Code3:LEB|Type:Core|Name:Limited Edition Beta
|
||||
Code2:U|Code3:2ED|Type:Core|Border:White|Name:Unlimited Edition
|
||||
Code2:AN|Code3:ARN|Type:Expansion|Name:Arabian Nights
|
||||
Code2:AQ|Code3:ATQ|Type:Expansion|Name:Antiquities
|
||||
Code2:R|Code3:3ED|Type:Core|Border:White|Name:Revised Edition
|
||||
Code2:LG|Code3:LEG|Type:Expansion|Name:Legends
|
||||
Code2:DK|Code3:DRK|Type:Expansion|Name:The Dark
|
||||
Code2:FE|Code3:FEM|Type:Expansion|Name:Fallen Empires
|
||||
|
||||
Index:10|Code2:4E|Code3:4ED|Type:Core|Border:White|Name:Fourth Edition
|
||||
Index:11|Code2:IA|Code3:ICE|Type:Expansion|Name:Ice Age
|
||||
Index:12|Code2:CH|Code3:CHR|Type:Reprint|Border:White|Name:Chronicles
|
||||
Index:13|Code2:HL|Code3:HML|Type:Expansion|Name:Homelands
|
||||
Index:14|Code2:AL|Code3:ALL|Type:Expansion|Name:Alliances
|
||||
Index:15|Code2:MI|Code3:MIR|Type:Expansion|Name:Mirage
|
||||
Index:16|Code2:VI|Code3:VIS|Type:Expansion|Name:Visions
|
||||
Index:17|Code2:5E|Code3:5ED|Type:Core|Border:White|Name:Fifth Edition
|
||||
Index:18|Code2:PT|Code3:POR|Type:Starter|Name:Portal
|
||||
Index:19|Code2:WL|Code3:WTH|Type:Expansion|Name:Weatherlight
|
||||
Code2:4E|Code3:4ED|Type:Core|Border:White|Name:Fourth Edition
|
||||
Code2:IA|Code3:ICE|Type:Expansion|Name:Ice Age
|
||||
Code2:CH|Code3:CHR|Type:Reprint|Border:White|Name:Chronicles
|
||||
Code2:HL|Code3:HML|Type:Expansion|Name:Homelands
|
||||
Code2:AL|Code3:ALL|Type:Expansion|Name:Alliances
|
||||
Code2:MI|Code3:MIR|Type:Expansion|Name:Mirage
|
||||
Code2:VI|Code3:VIS|Type:Expansion|Name:Visions
|
||||
Code2:5E|Code3:5ED|Type:Core|Border:White|Name:Fifth Edition
|
||||
Code2:PT|Code3:POR|Type:Starter|Name:Portal
|
||||
Code2:WL|Code3:WTH|Type:Expansion|Name:Weatherlight
|
||||
|
||||
Index:20|Code2:TE|Code3:TMP|Type:Expansion|Name:Tempest
|
||||
Index:21|Code2:SH|Code3:STH|Type:Expansion|Name:Stronghold
|
||||
Index:22|Code2:EX|Code3:EXO|Type:Expansion|Name:Exodus
|
||||
Index:23|Code2:P2|Code3:PO2|Type:Starter|Name:Portal Second Age|Alias:P02
|
||||
Index:24|Code2:US|Code3:USG|Type:Expansion|Name:Urza's Saga
|
||||
Index:25|Code2:UL|Code3:ULG|Type:Expansion|Name:Urza's Legacy
|
||||
Index:26|Code2:6E|Code3:6ED|Type:Core|Border:White|Name:Classic (Sixth Edition)
|
||||
Index:27|Code2:UD|Code3:UDS|Type:Expansion|Name:Urza's Destiny
|
||||
Index:28|Code2:P3|Code3:PTK|Type:Starter|Border:White|Name:Portal Three Kingdoms
|
||||
Index:29|Code2:ST|Code3:S99|Type:Starter|Border:White|Name:Starter 1999
|
||||
Code2:TE|Code3:TMP|Type:Expansion|Name:Tempest
|
||||
Code2:SH|Code3:STH|Type:Expansion|Name:Stronghold
|
||||
Code2:EX|Code3:EXO|Type:Expansion|Name:Exodus
|
||||
Code2:P2|Code3:PO2|Type:Starter|Name:Portal Second Age|Alias:P02
|
||||
Code2:US|Code3:USG|Type:Expansion|Name:Urza's Saga
|
||||
Code2:UL|Code3:ULG|Type:Expansion|Name:Urza's Legacy
|
||||
Code2:6E|Code3:6ED|Type:Core|Border:White|Name:Classic (Sixth Edition)
|
||||
Code2:UD|Code3:UDS|Type:Expansion|Name:Urza's Destiny
|
||||
Code2:P3|Code3:PTK|Type:Starter|Border:White|Name:Portal Three Kingdoms
|
||||
Code2:ST|Code3:S99|Type:Starter|Border:White|Name:Starter 1999
|
||||
|
||||
Index:30|Code2:MM|Code3:MMQ|Type:Expansion|Name:Mercadian Masques
|
||||
Index:31|Code2:NE|Code3:NMS|Type:Expansion|Name:Nemesis|Alias:NEM
|
||||
Index:32|Code2:S2K|Code3:S00|Type:Starter|Border:White|Name:Starter 2000
|
||||
Index:33|Code2:PY|Code3:PCY|Type:Expansion|Name:Prophecy
|
||||
Index:34|Code2:IN|Code3:INV|Type:Expansion|Name:Invasion
|
||||
Index:35|Code2:PS|Code3:PLS|Type:Expansion|Name:Planeshift
|
||||
Index:36|Code2:7E|Code3:7ED|Type:Core|Border:White|Name:Seventh Edition
|
||||
Index:37|Code2:AP|Code3:APC|Type:Expansion|Name:Apocalypse
|
||||
Index:38|Code2:OD|Code3:ODY|Type:Expansion|Name:Odyssey
|
||||
Index:39|Code2:TO|Code3:TOR|Type:Expansion|Name:Torment
|
||||
Code2:MM|Code3:MMQ|Type:Expansion|Name:Mercadian Masques
|
||||
Code2:NE|Code3:NMS|Type:Expansion|Name:Nemesis|Alias:NEM
|
||||
Code2:S2K|Code3:S00|Type:Starter|Border:White|Name:Starter 2000
|
||||
Code2:PY|Code3:PCY|Type:Expansion|Name:Prophecy
|
||||
Code2:IN|Code3:INV|Type:Expansion|Name:Invasion
|
||||
Code2:PS|Code3:PLS|Type:Expansion|Name:Planeshift
|
||||
Code2:7E|Code3:7ED|Type:Core|Border:White|Name:Seventh Edition
|
||||
Code2:AP|Code3:APC|Type:Expansion|Name:Apocalypse
|
||||
Code2:OD|Code3:ODY|Type:Expansion|Name:Odyssey
|
||||
Code2:TO|Code3:TOR|Type:Expansion|Name:Torment
|
||||
|
||||
Index:40|Code2:JU|Code3:JUD|Type:Expansion|Name:Judgment
|
||||
Index:41|Code2:ON|Code3:ONS|Type:Expansion|Name:Onslaught
|
||||
Index:42|Code2:LE|Code3:LGN|Type:Expansion|Name:Legions
|
||||
Index:43|Code2:SC|Code3:SCG|Type:Expansion|Name:Scourge
|
||||
Index:44|Code2:8E|Code3:8ED|Type:Core|Border:White|Name:Core Set - Eighth Edition
|
||||
Index:45|Code2:MR|Code3:MRD|Type:Expansion|Name:Mirrodin
|
||||
Index:46|Code2:DS|Code3:DST|Type:Expansion|Name:Darksteel
|
||||
Index:47|Code2:FD|Code3:5DN|Type:Expansion|Name:Fifth Dawn
|
||||
Index:48|Code2:CHK|Code3:CHK|Type:Expansion|Name:Champions of Kamigawa
|
||||
Index:49|Code2:BOK|Code3:BOK|Type:Expansion|Name:Betrayers of Kamigawa
|
||||
Code2:JU|Code3:JUD|Type:Expansion|Name:Judgment
|
||||
Code2:ON|Code3:ONS|Type:Expansion|Name:Onslaught
|
||||
Code2:LE|Code3:LGN|Type:Expansion|Name:Legions
|
||||
Code2:SC|Code3:SCG|Type:Expansion|Name:Scourge
|
||||
Code2:8E|Code3:8ED|Type:Core|Border:White|Name:Core Set - Eighth Edition
|
||||
Code2:MR|Code3:MRD|Type:Expansion|Name:Mirrodin
|
||||
Code2:DS|Code3:DST|Type:Expansion|Name:Darksteel
|
||||
Code2:FD|Code3:5DN|Type:Expansion|Name:Fifth Dawn
|
||||
Code2:CHK|Code3:CHK|Type:Expansion|Name:Champions of Kamigawa
|
||||
Code2:BOK|Code3:BOK|Type:Expansion|Name:Betrayers of Kamigawa
|
||||
|
||||
Index:50|Code2:SOK|Code3:SOK|Type:Expansion|Name:Saviors of Kamigawa
|
||||
Index:51|Code2:9E|Code3:9ED|Type:Core|Border:White|Name:Core Set - Ninth Edition
|
||||
Index:52|Code2:RAV|Code3:RAV|Type:Expansion|Name:Ravnica: City of Guilds
|
||||
Index:53|Code2:GP|Code3:GPT|Type:Expansion|Name:Guildpact
|
||||
Index:54|Code2:DIS|Code3:DIS|Type:Expansion|Name:Dissension
|
||||
Index:55|Code2:CS|Code3:CSP|Type:Expansion|Name:Coldsnap
|
||||
Index:56|Code2:TSP|Code3:TSP|Type:Expansion|Name:Time Spiral
|
||||
Index:57|Code2:TSB|Code3:TSB|Type:Expansion|Name:Time Spiral Timeshifted
|
||||
Index:58|Code2:PLC|Code3:PLC|Type:Expansion|Name:Planar Chaos
|
||||
Index:59|Code2:FUT|Code3:FUT|Type:Expansion|Name:Future Sight
|
||||
Code2:SOK|Code3:SOK|Type:Expansion|Name:Saviors of Kamigawa
|
||||
Code2:9E|Code3:9ED|Type:Core|Border:White|Name:Core Set - Ninth Edition
|
||||
Code2:RAV|Code3:RAV|Type:Expansion|Name:Ravnica: City of Guilds
|
||||
Code2:GP|Code3:GPT|Type:Expansion|Name:Guildpact
|
||||
Code2:DIS|Code3:DIS|Type:Expansion|Name:Dissension
|
||||
Code2:CS|Code3:CSP|Type:Expansion|Name:Coldsnap
|
||||
Code2:TSP|Code3:TSP|Type:Expansion|Name:Time Spiral
|
||||
Code2:TSB|Code3:TSB|Type:Expansion|Name:Time Spiral Timeshifted
|
||||
Code2:PLC|Code3:PLC|Type:Expansion|Name:Planar Chaos
|
||||
Code2:FUT|Code3:FUT|Type:Expansion|Name:Future Sight
|
||||
|
||||
Index:60|Code2:10E|Code3:10E|Type:Core|Name:Core Set - Tenth Edition
|
||||
Index:61|Code2:LRW|Code3:LRW|Type:Expansion|Name:Lorwyn
|
||||
Index:62|Code2:MOR|Code3:MOR|Type:Expansion|Name:Morningtide
|
||||
Index:63|Code2:SHM|Code3:SHM|Type:Expansion|Name:Shadowmoor
|
||||
Index:64|Code2:EVE|Code3:EVE|Type:Expansion|Name:Eventide|Alias:EVT
|
||||
Index:65|Code2:ALA|Code3:ALA|Type:Expansion|Name:Shards of Alara
|
||||
Index:66|Code2:CFX|Code3:CFX|Type:Expansion|Name:Conflux|Alias:CON
|
||||
Index:67|Code2:ARB|Code3:ARB|Type:Expansion|Name:Alara Reborn
|
||||
Index:68|Code2:M10|Code3:M10|Type:Core|Name:Magic 2010
|
||||
Index:69|Code2:ZEN|Code3:ZEN|Type:Expansion|Name:Zendikar
|
||||
Code2:10E|Code3:10E|Type:Core|Name:Core Set - Tenth Edition
|
||||
Code2:LRW|Code3:LRW|Type:Expansion|Name:Lorwyn
|
||||
Code2:MOR|Code3:MOR|Type:Expansion|Name:Morningtide
|
||||
Code2:SHM|Code3:SHM|Type:Expansion|Name:Shadowmoor
|
||||
Code2:EVE|Code3:EVE|Type:Expansion|Name:Eventide|Alias:EVT
|
||||
Code2:ALA|Code3:ALA|Type:Expansion|Name:Shards of Alara
|
||||
Code2:CFX|Code3:CFX|Type:Expansion|Name:Conflux|Alias:CON
|
||||
Code2:ARB|Code3:ARB|Type:Expansion|Name:Alara Reborn
|
||||
Code2:M10|Code3:M10|Type:Core|Name:Magic 2010
|
||||
Code2:ZEN|Code3:ZEN|Type:Expansion|Name:Zendikar
|
||||
|
||||
Index:70|Code2:WWK|Code3:WWK|Type:Expansion|Name:Worldwake
|
||||
Index:71|Code2:ROE|Code3:ROE|Type:Expansion|Name:Rise of the Eldrazi
|
||||
Index:72|Code2:M11|Code3:M11|Type:Core|Name:Magic 2011
|
||||
Index:73|Code2:SOM|Code3:SOM|Type:Expansion|Name:Scars of Mirrodin
|
||||
Index:74|Code2:MBS|Code3:MBS|Type:Expansion|Name:Mirrodin Besieged
|
||||
Index:75|Code2:NPH|Code3:NPH|Type:Expansion|Name:New Phyrexia
|
||||
Index:76|Code2:COM|Code3:COM|Type:Other|Name:Commander
|
||||
Index:77|Code2:M12|Code3:M12|Type:Core|Name:Magic 2012
|
||||
Index:78|Code2:ISD|Code3:ISD|Type:Expansion|Name:Innistrad
|
||||
Index:79|Code2:DKA|Code3:DKA|Type:Expansion|Name:Dark Ascension
|
||||
Code2:WWK|Code3:WWK|Type:Expansion|Name:Worldwake
|
||||
Code2:ROE|Code3:ROE|Type:Expansion|Name:Rise of the Eldrazi
|
||||
Code2:M11|Code3:M11|Type:Core|Name:Magic 2011
|
||||
Code2:SOM|Code3:SOM|Type:Expansion|Name:Scars of Mirrodin
|
||||
Code2:MBS|Code3:MBS|Type:Expansion|Name:Mirrodin Besieged
|
||||
Code2:NPH|Code3:NPH|Type:Expansion|Name:New Phyrexia
|
||||
Code2:COM|Code3:COM|Type:Other|Name:Commander
|
||||
Code2:M12|Code3:M12|Type:Core|Name:Magic 2012
|
||||
Code2:ISD|Code3:ISD|Type:Expansion|Name:Innistrad
|
||||
Code2:DKA|Code3:DKA|Type:Expansion|Name:Dark Ascension
|
||||
|
||||
Index:80|Code2:AVR|Code3:AVR|Type:Expansion|Name:Avacyn Restored
|
||||
Index:81|Code2:PC2|Code3:PC2|Type:Other|Name:Planechase 2012 Edition
|
||||
Index:82|Code2:M13|Code3:M13|Type:Core|Name:Magic 2013
|
||||
Index:83|Code2:RTR|Code3:RTR|Type:Expansion|Name:Return to Ravnica
|
||||
Index:84|Code2:GTC|Code3:GTC|Type:Expansion|Name:Gatecrash
|
||||
Code2:AVR|Code3:AVR|Type:Expansion|Name:Avacyn Restored
|
||||
Code2:PC2|Code3:PC2|Type:Other|Name:Planechase 2012 Edition
|
||||
Code2:M13|Code3:M13|Type:Core|Name:Magic 2013
|
||||
Code2:RTR|Code3:RTR|Type:Expansion|Name:Return to Ravnica
|
||||
Code2:GTC|Code3:GTC|Type:Expansion|Name:Gatecrash
|
||||
|
||||
Index:86|Code2:VAN|Code3:VAN|Type:Other|Name:Vanguard
|
||||
Index:87|Code2:ARC|Code3:ARC|Type:Other|Name:Archenemy
|
||||
Index:88|Code2:HOP|Code3:HOP|Type:Other|Name:Planechase
|
||||
Code2:VAN|Code3:VAN|Type:Other|Name:Vanguard
|
||||
Code2:ARC|Code3:ARC|Type:Other|Name:Archenemy
|
||||
Code2:HOP|Code3:HOP|Type:Other|Name:Planechase
|
||||
|
||||
16
res/cardsfolder/d/dimensional_breach.txt
Normal file
16
res/cardsfolder/d/dimensional_breach.txt
Normal file
@@ -0,0 +1,16 @@
|
||||
Name:Dimensional Breach
|
||||
ManaCost:5 W W
|
||||
Types:Sorcery
|
||||
A:SP$ ChangeZoneAll | Cost$ 5 W W | ChangeType$ Permanent | Origin$ Battlefield | Destination$ Exile | RememberChanged$ True | SubAbility$ DBEffect | SpellDescription$ Exile all permanents. For as long as any of those cards remain exiled, at the beginning of each player's upkeep, that player returns one of the exiled cards he or she owns to the battlefield.
|
||||
SVar:DBEffect:DB$ Effect | Name$ Dimensional Breach Effect | Triggers$ TrigUpkeep,TrigCleanup | SVars$ BreachReturn,BreachCleanup,MoveChosen,BreachX | RememberObjects$ Remembered | Duration$ Permanent | SubAbility$ DBCleanup
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
SVar:TrigUpkeep:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ Player | Execute$ BreachReturn | TriggerZones$ Command | TriggerController$ TriggeredPlayer | CheckSVar$ BreachX | SVarCompare$ GE1 | TriggerDescription$ At the beginning of each player's upkeep, that player returns one of the exiled cards he or she owns to the battlefield.
|
||||
SVar:BreachReturn:AB$ ChooseCard | Cost$ 0 | Defined$ TriggeredPlayer | Amount$ 1 | Mandatory$ True | ChoiceTitle$ Choose a card to return to the battlefield | Choices$ Card.IsRemembered+ActivePlayerCtrl | ChoiceZone$ Exile | SubAbility$ MoveChosen
|
||||
SVar:MoveChosen:DB$ ChangeZone | Origin$ Exile | Destination$ Battlefield | Defined$ ChosenCard | ForgetChanged$ True
|
||||
SVar:TrigCleanup:Mode$ Always | CheckSVar$ BreachX | SVarCompare$ EQ0 | Static$ True | Execute$ BreachCleanup | TriggerZones$ Command
|
||||
SVar:BreachCleanup:DB$ ChangeZone | Defined$ Self | Origin$ Command | Destination$ Exile
|
||||
SVar:BreachX:Count$ValidExile Card.IsRemembered
|
||||
SVar:Rarity:Rare
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/dimensional_breach.jpg
|
||||
SetInfo:SCG|Rare|http://magiccards.info/scans/en/sc/9.jpg
|
||||
Oracle:Exile all permanents. For as long as any of those cards remain exiled, at the beginning of each player's upkeep, that player returns one of the exiled cards he or she owns to the battlefield.
|
||||
21
res/cardsfolder/e/eureka.txt
Normal file
21
res/cardsfolder/e/eureka.txt
Normal file
@@ -0,0 +1,21 @@
|
||||
Name:Eureka
|
||||
ManaCost:2 G G
|
||||
Types:Sorcery
|
||||
A:SP$ Repeat | Cost$ 2 G G | RepeatSubAbility$ ResetCheck | RepeatCheckSVar$ NumPlayerGiveup | RepeatSVarCompare$ LTTotalPlayer | SubAbility$ DBChangeZoneAll | StackDescription$ SpellDescription | SpellDescription$ Starting with you, each player may put a permanent card from his or her hand onto the battlefield. Repeat this process until no one puts a card onto the battlefield.
|
||||
SVar:ResetCheck:DB$ StoreSVar | SVar$ NumPlayerGiveup | Type$ Number | Expression$ 0 | SubAbility$ DBRepeatChoice
|
||||
SVar:DBRepeatChoice:DB$ RepeatEach | RepeatSubAbility$ DBChoice | RepeatPlayers$ Player
|
||||
SVar:DBChoice:DB$ GenericChoice | Choices$ DBCheckHand,DBNoChange | Defined$ Player.IsRemembered
|
||||
SVar:DBCheckHand:DB$ StoreSVar | SVar$ NumPlayerGiveup | Type$ CountSVar | Expression$ NumPlayerGiveup/Plus.1 | ConditionCheckSVar$ CheckHand | ConditionSVarCompare$ EQ0 | SubAbility$ DBChoose | ChoiceDescription$ Choose a permanent to put onto the battlefield
|
||||
SVar:DBChoose:DB$ ChooseCard | Defined$ Player.IsRemembered | Choices$ Permanent.IsNotRemembered+RememberedPlayerCtrl | ChoiceZone$ Hand | Amount$ 1 | RememberChosen$ True | Mandatory$ True | ConditionCheckSVar$ CheckHand | ConditionSVarCompare$ GE1
|
||||
SVar:DBNoChange:DB$ StoreSVar | SVar$ NumPlayerGiveup | Type$ CountSVar | Expression$ NumPlayerGiveup/Plus.1 | ChoiceDescription$ Do not put a permanent onto the battlefield
|
||||
SVar:DBChangeZoneAll:DB$ ChangeZoneAll | Origin$ Hand | Destination$ Battlefield | ChangeType$ Card.IsRemembered | SubAbility$ FinalReset
|
||||
SVar:FinalReset:DB$ StoreSVar | SVar$ NumPlayerGiveup | Type$ Number | Expression$ 0 | SubAbility$ DBCleanup
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
SVar:NumPlayerGiveup:Number$0
|
||||
SVar:TotalPlayer:PlayerCountPlayers$Amount
|
||||
SVar:CheckHand:Count$ValidHand Permanent.IsNotRemembered+RememberedPlayerCtrl
|
||||
SVar:RemAIDeck:True
|
||||
SVar:RemRandomDeck:True
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/eureka.jpg
|
||||
SetInfo:LEG|Rare|http://magiccards.info/scans/en/lg/99.jpg
|
||||
Oracle:Starting with you, each player may put a permanent card from his or her hand onto the battlefield. Repeat this process until no one puts a card onto the battlefield.
|
||||
13
res/cardsfolder/f/feeding_grounds.txt
Normal file
13
res/cardsfolder/f/feeding_grounds.txt
Normal file
@@ -0,0 +1,13 @@
|
||||
Name:Feeding Grounds
|
||||
ManaCost:no cost
|
||||
Types:Plane Muraganda
|
||||
S:Mode$ ReduceCost | EffectZone$ Command | ValidCard$ Card.Green | Type$ Spell | Amount$ 1 | Description$ Green spells cost 1 less to cast.
|
||||
S:Mode$ ReduceCost | EffectZone$ Command | ValidCard$ Card.Red | Type$ Spell | Amount$ 1 | Description$ Red spells cost 1 less to cast.
|
||||
T:Mode$ PlanarDice | Result$ Chaos | TriggerZones$ Command | Execute$ DBPutCounter | TriggerDescription$ Whenever you roll Chaos, put X +1/+1 counters on target creature, where X is that creature's converted mana cost.
|
||||
T:Mode$ PlanarDice | Result$ Planeswalk | TriggerZones$ Command | Execute$ RolledWalk | Secondary$ True | TriggerDescription$ Whenever you roll Planeswalk, put this card on the bottom of its owner's planar deck face down, then move the top card of your planar deck off that planar deck and turn it face up
|
||||
SVar:RolledWalk:AB$ Planeswalk | Cost$ 0
|
||||
SVar:DBPutCounter:DB$PutCounter | ValidTgts$ Creature | TgtPrompt$ Select target creature | CounterType$ P1P1 | CounterNum$ X
|
||||
SVar:X:Targeted$CardManaCost
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/feeding_grounds.jpg
|
||||
SetInfo:HOP|Common|http://magiccards.info/extras/plane/planechase/feeding-grounds.jpg
|
||||
Oracle:Red spells cost {1} less to cast.\nGreen spells cost {1} less to cast.\nWhenever you roll {C}, put X +1/+1 counters on target creature, where X is that creature's converted mana cost.
|
||||
@@ -4,7 +4,6 @@ Types:Instant
|
||||
A:SP$ Destroy | Cost$ 2 B B | ValidTgts$ Creature.nonArtifact | TgtPrompt$ Select target nonartifact creature | SubAbility$ DBMill | SpellDescription$ Destroy target nonartifact creature. Its controller puts a number of cards equal to that creature's power from the top of his or her library into his or her graveyard.
|
||||
SVar:DBMill:DB$ Mill | NumCards$ X | Defined$ TargetedController | References$ X
|
||||
SVar:X:Targeted$CardPower
|
||||
SVar:RemAIDeck:True
|
||||
SVar:Rarity:Common
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/grisly_spectacle.jpg
|
||||
SetInfo:GTC|Common|http://magiccards.info/scans/en/gtc/66.jpg
|
||||
|
||||
@@ -8,6 +8,8 @@ SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
SVar:X:Remembered$Amount
|
||||
A:AB$ DealDamage | Cost$ tapXType<1/Swamp> | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ 1 | SpellDescription$ CARDNAME deals 1 damage to target creature or player.
|
||||
SVar:RemAIDeck:True
|
||||
SVar:NeedsToPlayVar:Creats GE4
|
||||
SVar:Creats:Count$Valid Creature.YouCtrl
|
||||
SVar:Rarity:Rare
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/hecatomb.jpg
|
||||
SetInfo:5ED|Rare|http://magiccards.info/scans/en/5e/29.jpg
|
||||
|
||||
11
res/cardsfolder/h/horizon_boughs.txt
Normal file
11
res/cardsfolder/h/horizon_boughs.txt
Normal file
@@ -0,0 +1,11 @@
|
||||
Name:Horizon Boughs
|
||||
ManaCost:no cost
|
||||
Types:Plane Pyrulea
|
||||
S:Mode$ Continuous | EffectZone$ Command | Affected$ Permanent | AddHiddenKeyword$ CARDNAME untaps during each other player's untap step. | Description$ All permanents untap during each player's untap step.
|
||||
T:Mode$ PlanarDice | Result$ Chaos | TriggerZones$ Command | Execute$ DBFetch | TriggerDescription$ Whenever you roll Chaos, you may search your library for up to three basic land cards, put them onto the battlefield tapped, then shuffle your library.
|
||||
T:Mode$ PlanarDice | Result$ Planeswalk | TriggerZones$ Command | Execute$ RolledWalk | Secondary$ True | TriggerDescription$ Whenever you roll Planeswalk, put this card on the bottom of its owner's planar deck face down, then move the top card of your planar deck off that planar deck and turn it face up
|
||||
SVar:RolledWalk:AB$ Planeswalk | Cost$ 0
|
||||
SVar:DBFetch:DB$ChangeZone | Origin$ Library | Destination$ Battlefield | Tapped$ True | ChangeType$ Land.Basic | ChangeNum$ 3
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/horizon_boughs.jpg
|
||||
SetInfo:HOP|Common|http://magiccards.info/extras/plane/planechase/horizon-boughs.jpg
|
||||
Oracle:All permanents untap during each player's untap step.\nWhenever you roll {C}, you may search your library for up to three basic land cards, put them onto the battlefield tapped, then shuffle your library.
|
||||
23
res/cardsfolder/h/hypergenesis.txt
Normal file
23
res/cardsfolder/h/hypergenesis.txt
Normal file
@@ -0,0 +1,23 @@
|
||||
Name:Hypergenesis
|
||||
ManaCost:no cost
|
||||
Types:Sorcery
|
||||
Colors:green
|
||||
K:Suspend:3:1 G G
|
||||
A:SP$ Repeat | Cost$ 0 | RepeatSubAbility$ ResetCheck | RepeatCheckSVar$ NumPlayerGiveup | RepeatSVarCompare$ LTTotalPlayer | SubAbility$ DBChangeZoneAll | StackDescription$ SpellDescription | SpellDescription$ Starting with you, each player may put an artifact, creature, enchantment, or land card from his or her hand onto the battlefield. Repeat this process until no one puts a card onto the battlefield.
|
||||
SVar:ResetCheck:DB$ StoreSVar | SVar$ NumPlayerGiveup | Type$ Number | Expression$ 0 | SubAbility$ DBRepeatChoice
|
||||
SVar:DBRepeatChoice:DB$ RepeatEach | RepeatSubAbility$ DBChoice | RepeatPlayers$ Player
|
||||
SVar:DBChoice:DB$ GenericChoice | Choices$ DBCheckHand,DBNoChange | Defined$ Player.IsRemembered
|
||||
SVar:DBCheckHand:DB$ StoreSVar | SVar$ NumPlayerGiveup | Type$ CountSVar | Expression$ NumPlayerGiveup/Plus.1 | ConditionCheckSVar$ CheckHand | ConditionSVarCompare$ EQ0 | SubAbility$ DBChoose | ChoiceDescription$ Choose an artifact, creature, enchantment, or land card from your hand onto the battlefield
|
||||
SVar:DBChoose:DB$ ChooseCard | Defined$ Player.IsRemembered | Choices$ Artifact.IsNotRemembered+RememberedPlayerCtrl,Creature.IsNotRemembered+RememberedPlayerCtrl,Enchantment.IsNotRemembered+RememberedPlayerCtrl,Land.IsNotRemembered+RememberedPlayerCtrl | ChoiceZone$ Hand | Amount$ 1 | RememberChosen$ True | Mandatory$ True | ConditionCheckSVar$ CheckHand | ConditionSVarCompare$ GE1
|
||||
SVar:DBNoChange:DB$ StoreSVar | SVar$ NumPlayerGiveup | Type$ CountSVar | Expression$ NumPlayerGiveup/Plus.1 | ChoiceDescription$ Do not put an artifact, creature, enchantment, or land card from your hand onto the battlefield
|
||||
SVar:DBChangeZoneAll:DB$ ChangeZoneAll | Origin$ Hand | Destination$ Battlefield | ChangeType$ Card.IsRemembered | SubAbility$ FinalReset
|
||||
SVar:FinalReset:DB$ StoreSVar | SVar$ NumPlayerGiveup | Type$ Number | Expression$ 0 | SubAbility$ DBCleanup
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
SVar:NumPlayerGiveup:Number$0
|
||||
SVar:TotalPlayer:PlayerCountPlayers$Amount
|
||||
SVar:CheckHand:Count$ValidHand Artifact.IsNotRemembered+RememberedPlayerCtrl,Creature.IsNotRemembered+RememberedPlayerCtrl,Enchantment.IsNotRemembered+RememberedPlayerCtrl,Land.IsNotRemembered+RememberedPlayerCtrl
|
||||
SVar:RemRandomDeck:True
|
||||
SVar:RemAIDeck:True
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/hypergenesis.jpg
|
||||
SetInfo:TSP|Rare|http://magiccards.info/scans/en/ts/201.jpg
|
||||
Oracle:Sorcery\nSuspend 3- {1}{G}{G} (Rather than cast this card from your hand, pay {1}{G}{G} and exile it with three time counters on it. At the beginning of your upkeep, remove a time counter. When the last is removed, cast it without paying its mana cost.)\nStarting with you, each player may put an artifact, creature, enchantment, or land card from his or her hand onto the battlefield. Repeat this process until no one puts a card onto the battlefield.
|
||||
17
res/cardsfolder/l/lim_duls_vault.txt
Normal file
17
res/cardsfolder/l/lim_duls_vault.txt
Normal file
@@ -0,0 +1,17 @@
|
||||
Name:Lim-Dul's Vault
|
||||
ManaCost:U B
|
||||
Types:Instant
|
||||
A:SP$ Dig | Cost$ U B | DigNum$ 5 | NoMove$ True | SubAbility$ DBRepeat | RememberRevealed$ True | StackDescription$ SpellDescription | SpellDescription$ Look at the top five cards of your library. As many times as you choose, you may pay 1 life, put those cards on the bottom of your library in any order, then look at the top five cards of your library. Then shuffle your library and put the last cards you looked at this way on top of it in any order.
|
||||
SVar:DBRepeat:DB$ Repeat | RepeatSubAbility$ CheckLifePaid | RepeatCheckSVar$ LifePaid | RepeatSVarCompare$ EQ0 | SubAbility$ DBShuffle | StackDescription$ None
|
||||
SVar:CheckLifePaid:DB$ StoreSVar | SVar$ LifePaid | Type$ Number | Expression$ 1 | UnlessPayer$ You | UnlessCost$ PayLife<1> | UnlessResolveSubs$ WhenPaid | UnlessAI$ Never | SubAbility$ DBResetRem | StackDescription$ No move
|
||||
SVar:DBResetRem:DB$ Cleanup | ClearRemembered$ True | SubAbility$ GoToBottom
|
||||
SVar:GoToBottom:DB$ Dig | DigNum$ 5 | ChangeNum$ All | DestinationZone$ Library | LibraryPosition$ -1 | NoLooking$ True | SubAbility$ DBLookAgain | StackDescription$ None
|
||||
SVar:DBLookAgain:DB$ Dig | DigNum$ 5 | NoMove$ True | RememberRevealed$ True | StackDescription$ None
|
||||
SVar:DBShuffle:DB$ ChangeZone | Origin$ Library | Destination$ Library | LibraryPosition$ 0 | ChangeType$ Card.IsRemembered | ChangeNum$ 5 | SubAbility$ DBReset | Hidden$ True | SelectPrompt$ Pick 1 on the top of library | Mandatory$ True | NoReveal$ True | StackDescription$ None
|
||||
SVar:DBReset:DB$ StoreSVar | SVar$ LifePaid | Type$ Number | Expression$ 0 | SubAbility$ DBCleanup
|
||||
SVar:DBCleanup:DB$ Cleanup | ClearRemembered$ True
|
||||
SVar:LifePaid:Number$0
|
||||
SVar:RemAIDeck:True
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/lim_duls_vault.jpg
|
||||
SetInfo:ALL|Uncommon|http://magiccards.info/scans/en/ai/190.jpg
|
||||
Oracle:Look at the top five cards of your library. As many times as you choose, you may pay 1 life, put those cards on the bottom of your library in any order, then look at the top five cards of your library. Then shuffle your library and put the last cards you looked at this way on top of it in any order.
|
||||
@@ -6,7 +6,6 @@ PT:4/4
|
||||
K:Fear
|
||||
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | TriggerZones$ Battlefield | OptionalDecider$ You | Execute$ TrigChange | TriggerDescription$ At the beginning of your upkeep, you may search your library for a Rat card, reveal it, and put it into your hand. If you do, shuffle your library.
|
||||
SVar:TrigChange:AB$ChangeZone | Cost$ 0 | Origin$ Library | Destination$ Hand | ChangeType$ Card.Rat | ChangeNum$ 1
|
||||
SVar:RemRandomDeck:True
|
||||
SVar:Rarity:Rare
|
||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/ratcatcher.jpg
|
||||
SetInfo:DIS|Rare|http://magiccards.info/scans/en/di/52.jpg
|
||||
|
||||
@@ -4,7 +4,7 @@ Types:Artifact Creature Golem
|
||||
PT:5/3
|
||||
K:CARDNAME doesn't untap during your untap step.
|
||||
T:Mode$ Phase | Phase$ Upkeep | ValidPlayer$ You | OptionalDecider$ You | Execute$ TrigUntap | TriggerZones$ Battlefield | TriggerDescription$ At the beginning of your upkeep, you may untap target tapped creature an opponent controls. If you do, untap CARDNAME.
|
||||
SVar:TrigUntap:AB$ Untap | Cost$ 0 | ValidTgts$ Creature.| SubAbility$ DBCleanup+tapped | TgtPrompt$ Select target tapped creature an opponent controls | SubAbility$ DBUntap
|
||||
SVar:TrigUntap:AB$ Untap | Cost$ 0 | ValidTgts$ Creature.OppCtrl+tapped | TgtPrompt$ Select target tapped creature an opponent controls | SubAbility$ DBUntap
|
||||
SVar:DBUntap:DB$ Untap | Defined$ Self
|
||||
SVar:RemAIDeck:True
|
||||
SVar:Rarity:Uncommon
|
||||
|
||||
@@ -180,7 +180,7 @@ public class BoosterData {
|
||||
* @see forge.util.StorageReaderFile#read(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
protected BoosterData read(String line) {
|
||||
protected BoosterData read(String line, int i) {
|
||||
final FileSection section = FileSection.parse(line, ":", "|");
|
||||
int nC = section.getInt("Commons", 0);
|
||||
int nU = section.getInt("Uncommons", 0);
|
||||
|
||||
@@ -229,11 +229,11 @@ public final class CardBlock implements Comparable<CardBlock> {
|
||||
* @see forge.util.StorageReaderFile#read(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
protected CardBlock read(String line) {
|
||||
protected CardBlock read(String line, int i) {
|
||||
final String[] sParts = line.trim().split("\\|");
|
||||
|
||||
String name = null;
|
||||
int index = -1;
|
||||
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;
|
||||
@@ -245,8 +245,6 @@ public final class CardBlock implements Comparable<CardBlock> {
|
||||
final String key = kv[0].toLowerCase();
|
||||
if ("name".equals(key)) {
|
||||
name = kv[1];
|
||||
} else if ("index".equals(key)) {
|
||||
index = Integer.parseInt(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)) {
|
||||
|
||||
@@ -208,9 +208,9 @@ public final class CardEdition implements Comparable<CardEdition> { // immutable
|
||||
}
|
||||
|
||||
@Override
|
||||
protected CardEdition read(String line) {
|
||||
protected CardEdition read(String line, int i) {
|
||||
FileSection section = FileSection.parse(line, ":", "|");
|
||||
int index = section.getInt("index", -1);
|
||||
int index = 1+i;
|
||||
String code2 = section.get("code2");
|
||||
String code = section.get("code3");
|
||||
String type = section.get("type");
|
||||
|
||||
@@ -57,7 +57,7 @@ public class FatPackData {
|
||||
* @see forge.util.StorageReaderFile#read(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
protected FatPackData read(String line) {
|
||||
protected FatPackData read(String line, int i) {
|
||||
final FileSection section = FileSection.parse(line, ":", "|");
|
||||
int nBoosters = section.getInt("Boosters", 0);
|
||||
int nLand = section.getInt("BasicLands", 0);
|
||||
|
||||
@@ -93,7 +93,7 @@ public final class FormatCollection extends StorageView<GameFormat> {
|
||||
* @see forge.util.StorageReaderFile#read(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
protected GameFormat read(String line) {
|
||||
protected GameFormat read(String line, int i) {
|
||||
final List<String> sets = new ArrayList<String>(); // default: all sets allowed
|
||||
final List<String> bannedCards = new ArrayList<String>(); // default:
|
||||
// nothing
|
||||
@@ -101,7 +101,7 @@ public final class FormatCollection extends StorageView<GameFormat> {
|
||||
|
||||
FileSection section = FileSection.parse(line, ":", "|");
|
||||
String name = section.get("name");
|
||||
int index = section.getInt("index", 0);
|
||||
int index = 1 + i;
|
||||
String strSets = section.get("sets");
|
||||
if ( null != strSets ) {
|
||||
sets.addAll(Arrays.asList(strSets.split(", ")));
|
||||
|
||||
@@ -1319,8 +1319,9 @@ public class ChangeZoneAi extends SpellAbilityAi {
|
||||
player.shuffle();
|
||||
}
|
||||
|
||||
if ((!ZoneType.Battlefield.equals(destination) && !"Card".equals(type) && !defined)
|
||||
|| (sa.hasParam("Reveal") && !fetched.isEmpty())) {
|
||||
if (((!ZoneType.Battlefield.equals(destination) && !"Card".equals(type) && !defined)
|
||||
|| (sa.hasParam("Reveal") && !fetched.isEmpty()))
|
||||
&& !sa.hasParam("NoReveal")) {
|
||||
final String picked = player + " picked:";
|
||||
if (fetched.size() > 0) {
|
||||
GuiChoose.one(picked, fetched);
|
||||
|
||||
@@ -143,7 +143,7 @@ public class DigEffect extends SpellAbilityEffect {
|
||||
}
|
||||
// Singletons.getModel().getGameAction().revealToCopmuter(top.toArray());
|
||||
// - for when it exists
|
||||
} else if (choser.isHuman()) {
|
||||
} else if (choser.isHuman() && !sa.hasParam("NoLooking")) {
|
||||
// show the user the revealed cards
|
||||
GuiChoose.one("Looking at cards from library", top);
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ import forge.card.spellability.AbilityActivated;
|
||||
import forge.card.spellability.Target;
|
||||
import forge.control.input.Input;
|
||||
import forge.control.input.InputSelectManyCards;
|
||||
import forge.game.ai.ComputerUtil;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.zone.PlayerZone;
|
||||
import forge.game.zone.Zone;
|
||||
@@ -54,8 +53,10 @@ class CardFactoryArtifacts {
|
||||
@Override
|
||||
public boolean canPlayAI() {
|
||||
this.getTarget().resetTargets();
|
||||
final List<Card> libList = getActivatingPlayer().getOpponent().getCardsIn(ZoneType.Library);
|
||||
return !libList.isEmpty() && ComputerUtil.targetHumanAI(this);
|
||||
Player human = getActivatingPlayer().getOpponent();
|
||||
final List<Card> libList = human.getCardsIn(ZoneType.Library);
|
||||
this.getTarget().addTarget(human);
|
||||
return !libList.isEmpty() && canTarget(human);
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -98,6 +99,7 @@ class CardFactoryArtifacts {
|
||||
sb.append("Put the top two cards of target player's library into that player's graveyard. ");
|
||||
sb.append("If both cards share a color, repeat this process.");
|
||||
ab1.setDescription(sb.toString());
|
||||
ab1.setStackDescription(sb.toString());
|
||||
card.addSpellAbility(ab1);
|
||||
} // *************** END ************ END **************************
|
||||
|
||||
|
||||
@@ -78,7 +78,7 @@ public class Cost {
|
||||
* @return a boolean.
|
||||
*/
|
||||
public final boolean hasNoManaCost() {
|
||||
return this.getTotalMana().toString().equals(ManaCost.ZERO.toString());
|
||||
return this.getTotalMana().isZero();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -183,6 +183,10 @@ public final class ManaCost implements Comparable<ManaCost> {
|
||||
return this.shards.isEmpty() && !this.isNoCost();
|
||||
}
|
||||
|
||||
public boolean isZero() {
|
||||
return genericCost == 0 && isPureGeneric();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
|
||||
@@ -51,7 +51,6 @@ public abstract class SpellAbility implements ISpellAbility {
|
||||
|
||||
// choices for constructor isPermanent argument
|
||||
private String description = "";
|
||||
private Player targetPlayer = null;
|
||||
private String stackDescription = "";
|
||||
private ManaCost manaCost = null;
|
||||
private ManaCost multiKickerManaCost = null;
|
||||
@@ -1111,7 +1110,6 @@ public abstract class SpellAbility implements ISpellAbility {
|
||||
if (tgt != null) {
|
||||
tgt.addTarget(card);
|
||||
} else {
|
||||
this.targetPlayer = null; // reset setTargetPlayer()
|
||||
this.targetCard = card;
|
||||
}
|
||||
String desc = "";
|
||||
@@ -1124,74 +1122,6 @@ public abstract class SpellAbility implements ISpellAbility {
|
||||
this.setStackDescription(desc);
|
||||
}
|
||||
|
||||
// /**
|
||||
// * <p>
|
||||
// * Getter for the field <code>targetList</code>.
|
||||
// * </p>
|
||||
// *
|
||||
// * @return a {@link forge.CardList} object.
|
||||
// */
|
||||
// public List<Card> getTargetList() {
|
||||
// return this.targetList;
|
||||
// }
|
||||
|
||||
// /**
|
||||
// * <p>
|
||||
// * Setter for the field <code>targetList</code>.
|
||||
// * </p>
|
||||
// *
|
||||
// * @param list
|
||||
// * a {@link forge.CardList} object.
|
||||
// */
|
||||
// public void setTargetList(final List<Card> list) {
|
||||
// // The line below started to create a null error at
|
||||
// // forge.CardFactoryUtil.canBeTargetedBy(CardFactoryUtil.java:3329)
|
||||
// // after ForgeSVN r2699. I hope that commenting out the line below will
|
||||
// // not result in other bugs. :)
|
||||
// // targetPlayer = null;//reset setTargetPlayer()
|
||||
//
|
||||
// this.targetList = list;
|
||||
// final StringBuilder sb = new StringBuilder();
|
||||
// sb.append(this.getSourceCard().getName()).append(" - targeting ");
|
||||
// for (int i = 0; i < this.targetList.size(); i++) {
|
||||
//
|
||||
// if (!this.targetList.get(i).isFaceDown()) {
|
||||
// sb.append(this.targetList.get(i));
|
||||
// } else {
|
||||
// sb.append("Morph(").append(this.targetList.get(i).getUniqueNumber()).append(")");
|
||||
// }
|
||||
//
|
||||
// if (i < (this.targetList.size() - 1)) {
|
||||
// sb.append(", ");
|
||||
// }
|
||||
// }
|
||||
// this.setStackDescription(sb.toString());
|
||||
// }
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Setter for the field <code>targetPlayer</code>.
|
||||
* </p>
|
||||
*
|
||||
* @param p
|
||||
* a {@link forge.game.player.Player} object.
|
||||
*/
|
||||
public void setTargetPlayer(final Player p) {
|
||||
if (p == null) {
|
||||
throw new RuntimeException("SpellAbility : setTargetPlayer() error, argument is " + p + " source card is "
|
||||
+ this.getSourceCard());
|
||||
}
|
||||
|
||||
final Target tgt = this.getTarget();
|
||||
if (tgt != null) {
|
||||
tgt.addTarget(p);
|
||||
} else {
|
||||
this.targetCard = null; // reset setTargetCard()
|
||||
this.targetPlayer = p;
|
||||
}
|
||||
this.setStackDescription(this.getSourceCard().getName() + " - targeting " + p);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Getter for the field <code>targetPlayer</code>.
|
||||
@@ -1200,7 +1130,6 @@ public abstract class SpellAbility implements ISpellAbility {
|
||||
* @return a {@link forge.game.player.Player} object.
|
||||
*/
|
||||
public Player getTargetPlayer() {
|
||||
if (this.targetPlayer == null) {
|
||||
final Target tgt = this.getTarget();
|
||||
if (tgt != null) {
|
||||
final ArrayList<Player> list = tgt.getTargetPlayers();
|
||||
@@ -1211,8 +1140,6 @@ public abstract class SpellAbility implements ISpellAbility {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
return this.targetPlayer;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
||||
@@ -340,16 +340,6 @@ public class WrappedAbility extends Ability implements ISpellAbility {
|
||||
sa.setTargetCard(card);
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public void setTargetList(final List<Card> list) {
|
||||
// sa.setTargetList(list);
|
||||
// }
|
||||
|
||||
@Override
|
||||
public void setTargetPlayer(final Player p) {
|
||||
sa.setTargetPlayer(p);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setType(final String s) {
|
||||
sa.setType(s);
|
||||
|
||||
@@ -106,6 +106,7 @@ public class InputBlock extends Input {
|
||||
currentAttacker = null;
|
||||
allBlocking.clear();
|
||||
|
||||
stop();
|
||||
FControl.SINGLETON_INSTANCE.getPlayer().getController().passPriority();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ public class InputCleanup extends Input {
|
||||
// goes to the next phase
|
||||
if (active.isUnlimitedHandSize() || n <= max || n <= 0 || active != turnOwner) {
|
||||
active.getController().passPriority();
|
||||
stop();
|
||||
return;
|
||||
}
|
||||
ButtonUtil.disableAll();
|
||||
|
||||
@@ -179,6 +179,7 @@ public class InputMulligan extends Input {
|
||||
SDisplayUtil.showTab(nextField);
|
||||
|
||||
game.getPhaseHandler().nextPhase();
|
||||
stop();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -75,6 +75,7 @@ public class InputPassPriority extends Input {
|
||||
@Override
|
||||
public final void selectButtonOK() {
|
||||
FControl.SINGLETON_INSTANCE.getPlayer().getController().passPriority();
|
||||
stop();
|
||||
}
|
||||
|
||||
/** {@inheritDoc} */
|
||||
|
||||
@@ -19,6 +19,7 @@ package forge.deck;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map.Entry;
|
||||
import java.util.NoSuchElementException;
|
||||
|
||||
import forge.Card;
|
||||
|
||||
@@ -139,7 +140,7 @@ public class CardPool extends ItemPool<CardPrinted> {
|
||||
if ( cp != null)
|
||||
this.add(cp);
|
||||
else
|
||||
throw new RuntimeException(String.format("Card %s is not supported by Forge, as it's neither a known common card nor one of casual variants' card.", cardName));
|
||||
throw new NoSuchElementException(String.format("Card %s is not supported by Forge, as it's neither a known common card nor one of casual variants' card.", cardName));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -46,7 +46,7 @@ import freemarker.template.Template;
|
||||
import freemarker.template.TemplateException;
|
||||
|
||||
/**
|
||||
* TODO: Write javadoc for this type.
|
||||
* This class knows how to make a file out of a deck object and vice versa.
|
||||
*
|
||||
*/
|
||||
public class DeckSerializer extends StorageReaderFolder<Deck> implements IItemSerializer<Deck> {
|
||||
|
||||
@@ -108,6 +108,7 @@ public class AiInputCommon extends Input {
|
||||
}
|
||||
}
|
||||
player.getController().passPriority();
|
||||
stop();
|
||||
} // getMessage();
|
||||
|
||||
/**
|
||||
|
||||
@@ -945,19 +945,6 @@ public class ComputerUtil {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
public static boolean targetHumanAI(final SpellAbility sa) {
|
||||
if (sa == null || sa.getActivatingPlayer() == null) {
|
||||
return false;
|
||||
}
|
||||
Player human = sa.getActivatingPlayer().getOpponent();
|
||||
if (!sa.canTarget(human)) {
|
||||
return false;
|
||||
}
|
||||
sa.setTargetPlayer(human);
|
||||
return true;
|
||||
}
|
||||
|
||||
// returns true if it's better to wait until blockers are declared
|
||||
/**
|
||||
* <p>
|
||||
|
||||
@@ -30,24 +30,6 @@ import forge.Card;
|
||||
* @version $Id$
|
||||
*/
|
||||
interface IZone {
|
||||
/**
|
||||
* <p>
|
||||
* setUpdate.
|
||||
* </p>
|
||||
*
|
||||
* @param b
|
||||
* a boolean.
|
||||
*/
|
||||
void setUpdate(boolean b);
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* getUpdate.
|
||||
* </p>
|
||||
*
|
||||
* @return a boolean.
|
||||
*/
|
||||
boolean getUpdate();
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -101,7 +83,7 @@ interface IZone {
|
||||
* @param o
|
||||
* a {@link java.lang.Object} object.
|
||||
*/
|
||||
void remove(Object o);
|
||||
void remove(Card o);
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
||||
@@ -680,7 +680,7 @@ public class MagicStack extends MyObservable {
|
||||
// Create a new object, since the triggers aren't happening right away
|
||||
runParams = new HashMap<String, Object>();
|
||||
runParams.put("SourceSA", sp);
|
||||
if (chosenTargets.size() > 0) {
|
||||
if (!chosenTargets.isEmpty()) {
|
||||
HashSet<Object> distinctObjects = new HashSet<Object>();
|
||||
for (final TargetChoices tc : chosenTargets) {
|
||||
if ((tc != null) && (tc.getTargetCards() != null)) {
|
||||
@@ -704,10 +704,6 @@ public class MagicStack extends MyObservable {
|
||||
else if (sp.getTargetCard() != null) {
|
||||
runParams.put("Target", sp.getTargetCard());
|
||||
|
||||
game.getTriggerHandler().runTrigger(TriggerType.BecomesTarget, runParams, false);
|
||||
} else if (sp.getTargetPlayer() != null) {
|
||||
runParams.put("Target", sp.getTargetPlayer());
|
||||
|
||||
game.getTriggerHandler().runTrigger(TriggerType.BecomesTarget, runParams, false);
|
||||
}
|
||||
}
|
||||
@@ -1075,9 +1071,6 @@ public class MagicStack extends MyObservable {
|
||||
else if (sa.getTargetCard() != null) {
|
||||
fizzle = !CardFactoryUtil.isTargetStillValid(sa, sa.getTargetCard());
|
||||
}
|
||||
else if (sa.getTargetPlayer() != null) {
|
||||
fizzle = !sa.getTargetPlayer().canBeTargetedBy(sa);
|
||||
}
|
||||
else {
|
||||
// Set fizzle to the same as the parent if there's no target info
|
||||
fizzle = parentFizzled;
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
*/
|
||||
package forge.game.zone;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
import com.google.common.base.Predicate;
|
||||
@@ -181,7 +180,7 @@ public class PlayerZoneBattlefield extends PlayerZone {
|
||||
|
||||
/** {@inheritDoc} */
|
||||
@Override
|
||||
public final void remove(final Object o) {
|
||||
public final void remove(final Card o) {
|
||||
|
||||
super.remove(o);
|
||||
|
||||
@@ -244,30 +243,6 @@ public class PlayerZoneBattlefield extends PlayerZone {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Setter for the field <code>trigger</code>.
|
||||
* </p>
|
||||
*
|
||||
* @param b
|
||||
* a boolean.
|
||||
*/
|
||||
public final void setTrigger(final boolean b) {
|
||||
this.trigger = b;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Setter for the field <code>leavesTrigger</code>.
|
||||
* </p>
|
||||
*
|
||||
* @param b
|
||||
* a boolean.
|
||||
*/
|
||||
public final void setLeavesTrigger(final boolean b) {
|
||||
this.leavesTrigger = b;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* setTriggers.
|
||||
@@ -300,7 +275,7 @@ public class PlayerZoneBattlefield extends PlayerZone {
|
||||
// getCards(false) to get Phased Out cards
|
||||
|
||||
if (!filter) {
|
||||
return new ArrayList<Card>(cardList);
|
||||
return super.getCards(false);
|
||||
}
|
||||
return Lists.newArrayList(Iterables.filter(cardList, isNotPhased));
|
||||
|
||||
|
||||
@@ -66,6 +66,8 @@ public class Zone extends MyObservable implements IZone, Observer, java.io.Seria
|
||||
public Zone(final ZoneType zone) {
|
||||
this.zoneName = zone;
|
||||
this.roCardList = Collections.unmodifiableList(cardList);
|
||||
|
||||
//System.out.println(zoneName + " (ct) " + Integer.toHexString(System.identityHashCode(roCardList)));
|
||||
}
|
||||
|
||||
// ************ BEGIN - these methods fire updateObservers() *************
|
||||
@@ -191,7 +193,7 @@ public class Zone extends MyObservable implements IZone, Observer, java.io.Seria
|
||||
* an Object
|
||||
*/
|
||||
@Override
|
||||
public void remove(final Object c) {
|
||||
public void remove(final Card c) {
|
||||
this.cardList.remove(c);
|
||||
this.update();
|
||||
}
|
||||
@@ -287,6 +289,7 @@ public class Zone extends MyObservable implements IZone, Observer, java.io.Seria
|
||||
*/
|
||||
@Override
|
||||
public final List<Card> getCards() {
|
||||
//System.out.println(zoneName + ": " + Integer.toHexString(System.identityHashCode(roCardList)));
|
||||
return this.getCards(true);
|
||||
}
|
||||
|
||||
@@ -322,29 +325,6 @@ public class Zone extends MyObservable implements IZone, Observer, java.io.Seria
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the update.
|
||||
*
|
||||
* @param b
|
||||
* a boolean.
|
||||
*/
|
||||
@Override
|
||||
public final void setUpdate(final boolean b) {
|
||||
this.update = b;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Getter for the field <code>update</code>.
|
||||
* </p>
|
||||
*
|
||||
* @return a boolean.
|
||||
*/
|
||||
@Override
|
||||
public final boolean getUpdate() {
|
||||
return this.update;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* toString.
|
||||
|
||||
@@ -18,7 +18,6 @@
|
||||
package forge.gui;
|
||||
|
||||
import java.awt.Color;
|
||||
import java.awt.Rectangle;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.DataInputStream;
|
||||
import java.io.FileInputStream;
|
||||
@@ -61,8 +60,6 @@ import forge.game.zone.ZoneType;
|
||||
import forge.item.CardDb;
|
||||
import forge.item.CardPrinted;
|
||||
import forge.item.IPaperCard;
|
||||
import forge.view.arcane.PlayArea;
|
||||
import forge.view.arcane.util.Animation;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -255,91 +252,6 @@ public final class GuiDisplayUtil {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* setupPlayZone.
|
||||
* </p>
|
||||
*
|
||||
* @param p
|
||||
* a {@link forge.view.arcane.PlayArea} object.
|
||||
* @param c
|
||||
* an array of {@link forge.Card} objects.
|
||||
*/
|
||||
public static void setupPlayZone(final PlayArea p, final List<Card> c) {
|
||||
List<Card> tmp, diff;
|
||||
tmp = new ArrayList<Card>();
|
||||
for (final forge.view.arcane.CardPanel cpa : p.getCardPanels()) {
|
||||
tmp.add(cpa.getGameCard());
|
||||
}
|
||||
diff = new ArrayList<Card>(tmp);
|
||||
diff.removeAll(c);
|
||||
if (diff.size() == p.getCardPanels().size()) {
|
||||
p.clear();
|
||||
} else {
|
||||
for (final Card card : diff) {
|
||||
p.removeCardPanel(p.getCardPanel(card.getUniqueNumber()));
|
||||
}
|
||||
}
|
||||
diff = new ArrayList<Card>(c);
|
||||
diff.removeAll(tmp);
|
||||
|
||||
List<forge.view.arcane.CardPanel> panelList = new ArrayList<forge.view.arcane.CardPanel>();
|
||||
for (final Card card : diff) {
|
||||
panelList.add(p.addCard(card));
|
||||
}
|
||||
if (!diff.isEmpty()) {
|
||||
p.doLayout();
|
||||
}
|
||||
for (final forge.view.arcane.CardPanel toPanel : panelList) {
|
||||
p.scrollRectToVisible(new Rectangle(toPanel.getCardX(), toPanel.getCardY(), toPanel
|
||||
.getCardWidth(), toPanel.getCardHeight()));
|
||||
Animation.moveCard(toPanel);
|
||||
}
|
||||
|
||||
for (final Card card : c) {
|
||||
final forge.view.arcane.CardPanel toPanel = p.getCardPanel(card.getUniqueNumber());
|
||||
if (card.isTapped()) {
|
||||
toPanel.setTapped(true);
|
||||
toPanel.setTappedAngle(forge.view.arcane.CardPanel.TAPPED_ANGLE);
|
||||
} else {
|
||||
toPanel.setTapped(false);
|
||||
toPanel.setTappedAngle(0);
|
||||
}
|
||||
toPanel.getAttachedPanels().clear();
|
||||
if (card.isEnchanted()) {
|
||||
final ArrayList<Card> enchants = card.getEnchantedBy();
|
||||
for (final Card e : enchants) {
|
||||
final forge.view.arcane.CardPanel cardE = p.getCardPanel(e.getUniqueNumber());
|
||||
if (cardE != null) {
|
||||
toPanel.getAttachedPanels().add(cardE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (card.isEquipped()) {
|
||||
final ArrayList<Card> enchants = card.getEquippedBy();
|
||||
for (final Card e : enchants) {
|
||||
final forge.view.arcane.CardPanel cardE = p.getCardPanel(e.getUniqueNumber());
|
||||
if (cardE != null) {
|
||||
toPanel.getAttachedPanels().add(cardE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (card.isEnchantingCard()) {
|
||||
toPanel.setAttachedToPanel(p.getCardPanel(card.getEnchantingCard().getUniqueNumber()));
|
||||
} else if (card.isEquipping()) {
|
||||
toPanel.setAttachedToPanel(p.getCardPanel(card.getEquipping().get(0).getUniqueNumber()));
|
||||
} else {
|
||||
toPanel.setAttachedToPanel(null);
|
||||
}
|
||||
|
||||
toPanel.setCard(toPanel.getGameCard());
|
||||
}
|
||||
p.invalidate();
|
||||
p.repaint();
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* updateGUI.
|
||||
|
||||
@@ -29,9 +29,7 @@ import forge.Card;
|
||||
|
||||
import forge.Command;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.zone.PlayerZone;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.gui.GuiDisplayUtil;
|
||||
import forge.gui.framework.ICDoc;
|
||||
import forge.gui.match.CMatchUI;
|
||||
import forge.gui.match.controllers.CMessage;
|
||||
@@ -55,8 +53,7 @@ public class CCommand implements ICDoc {
|
||||
private final Observer observerPlay = new Observer() {
|
||||
@Override
|
||||
public void update(final Observable a, final Object b) {
|
||||
final PlayerZone pZone = (PlayerZone) a;
|
||||
GuiDisplayUtil.setupPlayZone(CCommand.this.view.getTabletop(), pZone.getCards(false));
|
||||
CCommand.this.view.getTabletop().setupPlayZone();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -118,7 +115,7 @@ public class CCommand implements ICDoc {
|
||||
|
||||
if (c != null && c.isInZone(ZoneType.Command)) {
|
||||
//TODO: Cast commander/activate avatar/roll planar dice here.
|
||||
CMessage.SINGLETON_INSTANCE.getInputControl().getInput().selectCard(c);
|
||||
CMessage.SINGLETON_INSTANCE.getInputControl().selectCard(c, player.getZone(ZoneType.Command));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -50,7 +50,6 @@ import forge.game.zone.PlayerZone;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.gui.ForgeAction;
|
||||
import forge.gui.GuiChoose;
|
||||
import forge.gui.GuiDisplayUtil;
|
||||
import forge.gui.framework.ICDoc;
|
||||
import forge.gui.match.CMatchUI;
|
||||
import forge.gui.match.controllers.CMessage;
|
||||
@@ -147,8 +146,7 @@ public class CField implements ICDoc {
|
||||
private final Observer observerPlay = new Observer() {
|
||||
@Override
|
||||
public void update(final Observable a, final Object b) {
|
||||
final PlayerZone pZone = (PlayerZone) a;
|
||||
GuiDisplayUtil.setupPlayZone(CField.this.view.getTabletop(), pZone.getCards(false));
|
||||
CField.this.view.getTabletop().setupPlayZone();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
@@ -23,6 +23,7 @@ import javax.swing.border.MatteBorder;
|
||||
|
||||
import net.miginfocom.swing.MigLayout;
|
||||
import forge.game.player.Player;
|
||||
import forge.game.zone.ZoneType;
|
||||
import forge.gui.framework.DragCell;
|
||||
import forge.gui.framework.DragTab;
|
||||
import forge.gui.framework.EDocID;
|
||||
@@ -66,7 +67,7 @@ public class VCommand implements IVDoc<CCommand> {
|
||||
|
||||
// TODO player is hard-coded into tabletop...should be dynamic
|
||||
// (haven't looked into it too deeply). Doublestrike 12-04-12
|
||||
tabletop = new PlayArea(scroller, id0 == EDocID.COMMAND_0);
|
||||
tabletop = new PlayArea(scroller, id0 == EDocID.COMMAND_0, player.getZone(ZoneType.Command).getCards(false));
|
||||
|
||||
control = new CCommand(player, this);
|
||||
|
||||
|
||||
@@ -121,7 +121,7 @@ public class VField implements IVDoc<CField> {
|
||||
|
||||
// TODO player is hard-coded into tabletop...should be dynamic
|
||||
// (haven't looked into it too deeply). Doublestrike 12-04-12
|
||||
tabletop = new PlayArea(scroller, id0 == EDocID.FIELD_1);
|
||||
tabletop = new PlayArea(scroller, id0 == EDocID.FIELD_1, player.getZone(ZoneType.Battlefield).getCards(false));
|
||||
|
||||
control = new CField(player, this, playerViewer);
|
||||
|
||||
|
||||
@@ -29,7 +29,6 @@ import com.esotericsoftware.minlog.Log;
|
||||
|
||||
import forge.card.mana.ManaCostShard;
|
||||
import forge.card.mana.ManaCost;
|
||||
import forge.view.arcane.util.UI;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
@@ -167,11 +166,11 @@ public class CardFaceSymbols {
|
||||
* @param w an int
|
||||
* @param h and int
|
||||
*/
|
||||
public static void draw(final Graphics g, String s, int x, final int y, final int w, final int h) {
|
||||
public static void drawOther(final Graphics g, String s, int x, final int y, final int w, final int h) {
|
||||
if (s.length() == 0) {
|
||||
return;
|
||||
}
|
||||
s = UI.getDisplayManaCost(s);
|
||||
|
||||
StringTokenizer tok = new StringTokenizer(s, " ");
|
||||
while (tok.hasMoreTokens()) {
|
||||
String symbol = tok.nextToken();
|
||||
|
||||
@@ -24,6 +24,7 @@ import java.util.List;
|
||||
import com.google.common.base.Function;
|
||||
|
||||
import forge.quest.data.GameFormatQuest;
|
||||
import forge.util.FileSection;
|
||||
import forge.util.storage.StorageReaderFile;
|
||||
|
||||
/**
|
||||
@@ -121,7 +122,7 @@ public class QuestWorld implements Comparable<QuestWorld>{
|
||||
* @see forge.util.StorageReaderFile#read(java.lang.String)
|
||||
*/
|
||||
@Override
|
||||
protected QuestWorld read(String line) {
|
||||
protected QuestWorld read(String line, int i) {
|
||||
String useName = null;
|
||||
String useDir = null;
|
||||
GameFormatQuest useFormat = null;
|
||||
@@ -129,9 +130,13 @@ public class QuestWorld implements Comparable<QuestWorld>{
|
||||
final List<String> sets = new ArrayList<String>();
|
||||
final List<String> bannedCards = new ArrayList<String>(); // if both empty, no format
|
||||
|
||||
// This is what you need to use here =>
|
||||
// FileSection.parse(line, ":", "|");
|
||||
|
||||
final String[] sParts = line.trim().split("\\|");
|
||||
|
||||
for (final String sPart : sParts) {
|
||||
|
||||
final String[] kv = sPart.split(":", 2);
|
||||
final String key = kv[0].toLowerCase();
|
||||
if ("name".equals(key)) {
|
||||
|
||||
@@ -70,12 +70,13 @@ public abstract class StorageReaderFile<T> implements IItemReader<T> {
|
||||
public Map<String, T> readAll() {
|
||||
final Map<String, T> result = new TreeMap<String, T>();
|
||||
|
||||
int idx = 0;
|
||||
for (final String s : FileUtil.readFile(this.file)) {
|
||||
if (!this.lineContainsObject(s)) {
|
||||
continue;
|
||||
}
|
||||
|
||||
final T item = this.read(s);
|
||||
final T item = this.read(s, idx);
|
||||
if (null == item) {
|
||||
final String msg = "An object stored in " + this.file.getPath()
|
||||
+ " failed to load.\nPlease submit this as a bug with the mentioned file attached.";
|
||||
@@ -83,6 +84,7 @@ public abstract class StorageReaderFile<T> implements IItemReader<T> {
|
||||
continue;
|
||||
}
|
||||
|
||||
idx++;
|
||||
result.put(this.keySelector.apply(item), item);
|
||||
}
|
||||
|
||||
@@ -96,7 +98,7 @@ public abstract class StorageReaderFile<T> implements IItemReader<T> {
|
||||
* the line
|
||||
* @return the t
|
||||
*/
|
||||
protected abstract T read(String line);
|
||||
protected abstract T read(String line, int idx);
|
||||
|
||||
/**
|
||||
* Line contains object.
|
||||
|
||||
@@ -415,7 +415,7 @@ public class CardPanel extends JPanel implements CardContainer {
|
||||
if (this.getCard() != null && this.getGameCard().getFoil() > 0) {
|
||||
final String fl = String.format("foil%02d", this.getCard().getFoil());
|
||||
final int z = Math.round(this.cardWidth * CardPanel.BLACK_BORDER_SIZE);
|
||||
CardFaceSymbols.draw(g, fl, this.cardXOffset + z, this.cardYOffset + z, this.cardWidth - (2 * z),
|
||||
CardFaceSymbols.drawOther(g, fl, this.cardXOffset + z, this.cardYOffset + z, this.cardWidth - (2 * z),
|
||||
this.cardHeight - (2 * z));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,10 +18,12 @@
|
||||
package forge.view.arcane;
|
||||
|
||||
import java.awt.Dimension;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.Rectangle;
|
||||
import java.awt.event.MouseAdapter;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseMotionListener;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
|
||||
@@ -33,7 +35,6 @@ import forge.Card;
|
||||
import forge.Constant;
|
||||
import forge.gui.match.CMatchUI;
|
||||
import forge.view.arcane.util.CardPanelMouseListener;
|
||||
import forge.view.arcane.util.UI;
|
||||
|
||||
/**
|
||||
* Manages mouse events and common functionality for CardPanel containing
|
||||
@@ -296,7 +297,7 @@ public abstract class CardPanelContainer extends JPanel {
|
||||
* a {@link forge.view.arcane.CardPanel} object.
|
||||
*/
|
||||
public final void removeCardPanel(final CardPanel fromPanel) {
|
||||
UI.invokeAndWait(new Runnable() {
|
||||
CardPanelContainer.invokeAndWait(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (CardPanelContainer.this.getMouseDragPanel() != null) {
|
||||
@@ -321,7 +322,7 @@ public abstract class CardPanelContainer extends JPanel {
|
||||
* </p>
|
||||
*/
|
||||
public final void clear() {
|
||||
UI.invokeAndWait(new Runnable() {
|
||||
CardPanelContainer.invokeAndWait(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
CardPanelContainer.this.getCardPanels().clear();
|
||||
@@ -623,4 +624,25 @@ public abstract class CardPanelContainer extends JPanel {
|
||||
public void setMouseDragPanel(final CardPanel mouseDragPanel0) {
|
||||
this.mouseDragPanel = mouseDragPanel0;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* invokeAndWait.
|
||||
* </p>
|
||||
*
|
||||
* @param runnable
|
||||
* a {@link java.lang.Runnable} object.
|
||||
*/
|
||||
public static void invokeAndWait(final Runnable runnable) {
|
||||
if (EventQueue.isDispatchThread()) {
|
||||
runnable.run();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
EventQueue.invokeAndWait(runnable);
|
||||
} catch (InterruptedException ex) {
|
||||
} catch (InvocationTargetException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,12 +23,11 @@ import java.awt.Rectangle;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collection;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
|
||||
import javax.swing.JScrollPane;
|
||||
|
||||
import forge.Card;
|
||||
import forge.view.arcane.util.Animation;
|
||||
import forge.view.arcane.util.CardPanelMouseListener;
|
||||
|
||||
/**
|
||||
@@ -67,6 +66,8 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
||||
private int extraCardSpacingX, cardSpacingX, cardSpacingY;
|
||||
private int stackSpacingX, stackSpacingY;
|
||||
|
||||
private List<Card> model;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* Constructor for PlayArea.
|
||||
@@ -76,11 +77,13 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
||||
* a {@link javax.swing.JScrollPane} object.
|
||||
* @param mirror
|
||||
* a boolean.
|
||||
* @param modelRef
|
||||
*/
|
||||
public PlayArea(final JScrollPane scrollPane, final boolean mirror) {
|
||||
public PlayArea(final JScrollPane scrollPane, final boolean mirror, List<Card> modelRef) {
|
||||
super(scrollPane);
|
||||
this.setBackground(Color.white);
|
||||
this.mirror = mirror;
|
||||
this.model = modelRef;
|
||||
}
|
||||
|
||||
private final CardStackRow collectAllLands() {
|
||||
@@ -196,46 +199,40 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
||||
this.playAreaWidth = rect.width;
|
||||
this.playAreaHeight = rect.height;
|
||||
|
||||
final CardStackRow allLands = collectAllLands();
|
||||
final CardStackRow allTokens = collectAllTokens();
|
||||
final CardStackRow allCreatures = new CardStackRow(this.getCardPanels(), RowType.creatureNonToken);
|
||||
final CardStackRow allOthers = new CardStackRow(this.getCardPanels(), RowType.other);
|
||||
final CardStackRow lands = collectAllLands();
|
||||
final CardStackRow tokens = collectAllTokens();
|
||||
final CardStackRow creatures = new CardStackRow(this.getCardPanels(), RowType.CreatureNonToken);
|
||||
final CardStackRow others = new CardStackRow(this.getCardPanels(), RowType.Other);
|
||||
|
||||
// should find an appropriate width of card
|
||||
this.cardWidth = this.getCardWidthMax();
|
||||
int maxCardWidth = this.getCardWidthMax();
|
||||
setCardWidth(maxCardWidth);
|
||||
int minCardWidth = this.getCardWidthMin();
|
||||
int lastGoodCardWidth = minCardWidth;
|
||||
int deltaCardWidth = (maxCardWidth - minCardWidth) / 2;
|
||||
boolean workedLastTime = false;
|
||||
//boolean isFirstRun = true;
|
||||
List<CardStackRow> lastTemplate = null;
|
||||
|
||||
while (deltaCardWidth > 0) {
|
||||
final CardStackRow creatures = (CardStackRow) allCreatures.clone();
|
||||
final CardStackRow tokens = (CardStackRow) allTokens.clone();
|
||||
final CardStackRow lands = (CardStackRow) allLands.clone();
|
||||
CardStackRow others = (CardStackRow) allOthers.clone();
|
||||
workedLastTime = canAdjustWidth(lands, tokens, creatures, others);
|
||||
List<CardStackRow> template = tryArrangePilesOfWidth(lands, tokens, creatures, others);
|
||||
|
||||
deltaCardWidth = (cardWidth - lastGoodCardWidth) / 2;
|
||||
if (workedLastTime) {
|
||||
lastGoodCardWidth = cardWidth;
|
||||
cardWidth += deltaCardWidth;
|
||||
deltaCardWidth = (getCardWidth() - lastGoodCardWidth) / 2;
|
||||
if (template != null) {
|
||||
lastTemplate = template;
|
||||
lastGoodCardWidth = getCardWidth();
|
||||
setCardWidth(getCardWidth() + deltaCardWidth);
|
||||
if (lastGoodCardWidth == maxCardWidth) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
cardWidth -= deltaCardWidth;
|
||||
setCardWidth(getCardWidth() - deltaCardWidth);
|
||||
}
|
||||
}
|
||||
cardWidth = lastGoodCardWidth;
|
||||
final CardStackRow creatures = (CardStackRow) allCreatures.clone();
|
||||
final CardStackRow tokens = (CardStackRow) allTokens.clone();
|
||||
final CardStackRow lands = (CardStackRow) allLands.clone();
|
||||
CardStackRow others = (CardStackRow) allOthers.clone();
|
||||
workedLastTime = canAdjustWidth(lands, tokens, creatures, others);
|
||||
setCardWidth(lastGoodCardWidth);
|
||||
if ( null == lastTemplate )
|
||||
lastTemplate = tryArrangePilesOfWidth(lands, tokens, creatures, others);
|
||||
|
||||
this.rows = lastTemplate;
|
||||
// Get size of all the rows.
|
||||
int x, y = PlayArea.GUTTER_Y;
|
||||
int maxRowWidth = 0;
|
||||
@@ -252,25 +249,26 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
||||
}
|
||||
this.setPreferredSize(new Dimension(maxRowWidth - this.cardSpacingX, y - this.cardSpacingY));
|
||||
this.revalidate();
|
||||
positionAllCards();
|
||||
positionAllCards(lastTemplate);
|
||||
}
|
||||
|
||||
private void positionAllCards() {
|
||||
private void positionAllCards(List<CardStackRow> template) {
|
||||
|
||||
// Position all card panels.
|
||||
int x = 0;
|
||||
int y = PlayArea.GUTTER_Y;
|
||||
|
||||
for (final CardStackRow row : this.rows) {
|
||||
for (final CardStackRow row : template) {
|
||||
int rowBottom = 0;
|
||||
x = PlayArea.GUTTER_X;
|
||||
for (int stackIndex = 0, stackCount = row.size(); stackIndex < stackCount; stackIndex++) {
|
||||
final CardStack stack = row.get(stackIndex);
|
||||
// Align others to the right.
|
||||
if (RowType.other.isType(stack.get(0).getGameCard())) {
|
||||
if (RowType.Other.isGoodFor(stack.get(0).getGameCard())) {
|
||||
x = (this.playAreaWidth - PlayArea.GUTTER_X) + this.extraCardSpacingX;
|
||||
for (int i = stackIndex, n = row.size(); i < n; i++) {
|
||||
x -= row.get(i).getWidth();
|
||||
CardStack r = row.get(i);
|
||||
x -= r.getWidth();
|
||||
}
|
||||
}
|
||||
for (int panelIndex = 0, panelCount = stack.size(); panelIndex < panelCount; panelIndex++) {
|
||||
@@ -279,68 +277,62 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
||||
this.setComponentZOrder(panel, panelIndex);
|
||||
final int panelX = x + (stackPosition * this.stackSpacingX);
|
||||
final int panelY = y + (stackPosition * this.stackSpacingY);
|
||||
panel.setCardBounds(panelX, panelY, this.cardWidth, this.cardHeight);
|
||||
panel.setCardBounds(panelX, panelY, this.getCardWidth(), this.cardHeight);
|
||||
}
|
||||
rowBottom = Math.max(rowBottom, y + stack.getHeight());
|
||||
x += stack.getWidth();
|
||||
x += stack.getWidth() + cardSpacingX;
|
||||
}
|
||||
y = rowBottom;
|
||||
}
|
||||
}
|
||||
|
||||
private boolean canAdjustWidth(final CardStackRow lands, final CardStackRow tokens, final CardStackRow creatures, CardStackRow others) {
|
||||
this.rows.clear();
|
||||
this.cardHeight = Math.round(this.cardWidth * CardPanel.ASPECT_RATIO);
|
||||
this.extraCardSpacingX = Math.round(this.cardWidth * PlayArea.EXTRA_CARD_SPACING_X);
|
||||
this.cardSpacingX = (this.cardHeight - this.cardWidth) + this.extraCardSpacingX;
|
||||
this.cardSpacingY = Math.round(this.cardHeight * PlayArea.CARD_SPACING_Y);
|
||||
this.stackSpacingX = Math.round(this.cardWidth * PlayArea.STACK_SPACING_X);
|
||||
this.stackSpacingY = Math.round(this.cardHeight * PlayArea.STACK_SPACING_Y);
|
||||
private List<CardStackRow> tryArrangePilesOfWidth(final CardStackRow lands, final CardStackRow tokens, final CardStackRow creatures, CardStackRow others) {
|
||||
List<CardStackRow> template = new ArrayList<PlayArea.CardStackRow>();
|
||||
|
||||
int afterFirstRow;
|
||||
|
||||
boolean landsFit, tokensFit, creaturesFit;
|
||||
if (this.mirror) {
|
||||
// Wrap all creatures and lands.
|
||||
this.wrap(lands, this.rows, -1);
|
||||
afterFirstRow = this.rows.size();
|
||||
this.wrap(tokens, this.rows, afterFirstRow);
|
||||
this.wrap(creatures, this.rows, this.rows.size());
|
||||
landsFit = this.planRow(lands, template, -1);
|
||||
afterFirstRow = template.size();
|
||||
tokensFit = this.planRow(tokens, template, afterFirstRow);
|
||||
creaturesFit = this.planRow(creatures, template, template.size());
|
||||
} else {
|
||||
// Wrap all creatures and lands.
|
||||
this.wrap(creatures, this.rows, -1);
|
||||
afterFirstRow = this.rows.size();
|
||||
this.wrap(tokens, this.rows, afterFirstRow);
|
||||
this.wrap(lands, this.rows, this.rows.size());
|
||||
creaturesFit = this.planRow(creatures, template, -1);
|
||||
afterFirstRow = template.size();
|
||||
tokensFit = this.planRow(tokens, template, afterFirstRow);
|
||||
landsFit = this.planRow(lands, template, template.size());
|
||||
}
|
||||
// Store the current rows and others.
|
||||
final List<CardStackRow> storedRows = new ArrayList<CardStackRow>(this.rows.size());
|
||||
for (final CardStackRow row : this.rows) {
|
||||
try {
|
||||
storedRows.add((CardStackRow) row.clone());
|
||||
|
||||
if ( !landsFit || !creaturesFit || !tokensFit )
|
||||
return null;
|
||||
|
||||
// Other cards may be stored at end of usual rows or on their own row.
|
||||
int cntOthers = others.size();
|
||||
|
||||
// Copy the template for the case 1st approach won't work
|
||||
final List<CardStackRow> templateCopy = new ArrayList<CardStackRow>(template.size());
|
||||
for (final CardStackRow row : template) {
|
||||
templateCopy.add((CardStackRow) row.clone());
|
||||
}
|
||||
catch (NullPointerException e) {
|
||||
System.out.println("Null pointer exception in Row Spacing. Possibly also part of the issue.");
|
||||
}
|
||||
}
|
||||
final CardStackRow storedOthers = (CardStackRow) others.clone();
|
||||
|
||||
// Fill in all rows with others.
|
||||
for (final CardStackRow row : this.rows) {
|
||||
this.fillRow(others, this.rows, row);
|
||||
int nextOther = 0;
|
||||
for (final CardStackRow row : template) {
|
||||
nextOther = this.planOthersRow(others, nextOther, template, row);
|
||||
if ( nextOther == cntOthers )
|
||||
return template; // everything was successfully placed
|
||||
}
|
||||
// Stop if everything fits, otherwise revert back to the stored
|
||||
// values.
|
||||
if (creatures.isEmpty() && tokens.isEmpty() && lands.isEmpty() && others.isEmpty()) {
|
||||
return true;
|
||||
}
|
||||
this.rows = storedRows;
|
||||
others = storedOthers;
|
||||
// Try to put others on their own row(s) and fill in the rest.
|
||||
this.wrap(others, this.rows, afterFirstRow);
|
||||
for (final CardStackRow row : this.rows) {
|
||||
this.fillRow(others, this.rows, row);
|
||||
}
|
||||
// If that still doesn't fit, scale down.
|
||||
return creatures.isEmpty() && tokens.isEmpty() && lands.isEmpty() && others.isEmpty();
|
||||
|
||||
template = templateCopy;
|
||||
// Try to put others on their own row(s)
|
||||
if ( this.planRow(others, template, afterFirstRow) )
|
||||
return template;
|
||||
|
||||
|
||||
return null; // Cannot fit everything with that width;
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -350,69 +342,53 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
||||
*
|
||||
* @param sourceRow
|
||||
* a {@link forge.view.arcane.PlayArea.CardStackRow} object.
|
||||
* @param rows
|
||||
* @param template
|
||||
* a {@link java.util.List} object.
|
||||
* @param insertIndex
|
||||
* a int.
|
||||
* @return a int.
|
||||
*/
|
||||
// private int cntRepaints = 0;
|
||||
private int wrap(final CardStackRow sourceRow, final List<CardStackRow> rows, final int insertIndex) {
|
||||
// Won't modify the first parameter
|
||||
private boolean planRow(final CardStackRow sourceRow, final List<CardStackRow> template, final int insertIndex) {
|
||||
// The cards are sure to fit (with vertical scrolling) at the minimum
|
||||
// card width.
|
||||
final boolean allowHeightOverflow = this.cardWidth == this.getCardWidthMin();
|
||||
final boolean isMinimalSize = this.getCardWidth() == this.getCardWidthMin();
|
||||
|
||||
// System.err.format("[%d] @ %d - Repaint playarea - %s %n", new Date().getTime(), cntRepaints++, mirror ? "MIRROR" : "DIRECT");
|
||||
|
||||
CardStackRow currentRow = new CardStackRow();
|
||||
for (int i = 0, n = sourceRow.size() - 1; i <= n; i++) {
|
||||
final CardStack stack = sourceRow.get(i);
|
||||
// If the row is not empty and this stack doesn't fit, add the row.
|
||||
for (final CardStack stack : sourceRow) {
|
||||
final int rowWidth = currentRow.getWidth();
|
||||
if (!currentRow.isEmpty() && ((rowWidth + stack.getWidth()) > this.playAreaWidth)) {
|
||||
// If the row is not empty and this stack doesn't fit, add the row.
|
||||
if (rowWidth + stack.getWidth() > this.playAreaWidth && !currentRow.isEmpty() ) {
|
||||
|
||||
// Stop processing if the row is too wide or tall.
|
||||
if (!allowHeightOverflow && (rowWidth > this.playAreaWidth)) {
|
||||
break;
|
||||
}
|
||||
if (!allowHeightOverflow && ((this.getRowsHeight(rows) + sourceRow.getHeight()) > this.playAreaHeight)) {
|
||||
break;
|
||||
}
|
||||
try {
|
||||
rows.add(insertIndex == -1 ? rows.size() : insertIndex, currentRow);
|
||||
}
|
||||
catch (ArrayIndexOutOfBoundsException e) {
|
||||
System.out.println("ArrayIndex Out of Bounds when trying to add row in PlayArea. Someone fix this logic, "
|
||||
+ " I believe it causes the no cards loading in issue we've noticed.");
|
||||
// TODO: There's a crash here, maybe when rows == [null] and currentRow == [[Plant Wall]] and insertIndex is 0
|
||||
if (rowWidth > this.playAreaWidth || this.getRowsHeight(template) + sourceRow.getHeight() > this.playAreaHeight) {
|
||||
if ( !isMinimalSize )
|
||||
return false;
|
||||
}
|
||||
|
||||
if ( insertIndex == -1)
|
||||
template.add(currentRow);
|
||||
else
|
||||
template.add(insertIndex, currentRow);
|
||||
|
||||
currentRow = new CardStackRow();
|
||||
}
|
||||
|
||||
currentRow.add(stack);
|
||||
}
|
||||
// Add the last row if it is not empty and it fits.
|
||||
if (!currentRow.isEmpty()) {
|
||||
final int rowWidth = currentRow.getWidth();
|
||||
if (allowHeightOverflow
|
||||
|| (rowWidth <= this.playAreaWidth)
|
||||
&& (allowHeightOverflow || ((this.getRowsHeight(rows) + sourceRow.getHeight()) <= this.playAreaHeight))) {
|
||||
try {
|
||||
rows.add(insertIndex == -1 ? rows.size() : insertIndex, currentRow);
|
||||
if (isMinimalSize || rowWidth <= this.playAreaWidth && this.getRowsHeight(template) + sourceRow.getHeight() <= this.playAreaHeight) {
|
||||
if ( insertIndex == -1)
|
||||
template.add(currentRow);
|
||||
else
|
||||
template.add(insertIndex, currentRow);
|
||||
} else return false;
|
||||
}
|
||||
catch (ArrayIndexOutOfBoundsException e) {
|
||||
System.out.println("ArrayIndex Out of Bounds when trying to add row in PlayArea. Someone fix this logic, "
|
||||
+ " I believe it causes the no cards loading in issue we've noticed.");
|
||||
// TODO: There's a crash here, maybe when rows == [null] and currentRow == [[Plant Wall]] and insertIndex is 0
|
||||
}
|
||||
}
|
||||
}
|
||||
// Remove the wrapped stacks from the source row.
|
||||
for (int iRow = 0; iRow < rows.size(); iRow++) {
|
||||
CardStackRow row = rows.get(iRow);
|
||||
if (row != null) {
|
||||
sourceRow.removeAll(row);
|
||||
}
|
||||
}
|
||||
return insertIndex;
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -423,32 +399,30 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
||||
*
|
||||
* @param sourceRow
|
||||
* a {@link forge.view.arcane.PlayArea.CardStackRow} object.
|
||||
* @param rows
|
||||
* @param template
|
||||
* a {@link java.util.List} object.
|
||||
* @param rows
|
||||
* @param template
|
||||
* a {@link java.util.List} object.
|
||||
* @param row
|
||||
* @param rowToFill
|
||||
* a {@link forge.view.arcane.PlayArea.CardStackRow} object.
|
||||
*/
|
||||
private void fillRow(final CardStackRow sourceRow, final List<CardStackRow> rows, final CardStackRow row) {
|
||||
int rowWidth = row.getWidth();
|
||||
private int planOthersRow(final List<CardStack> sourceRow, final int firstPile, final List<CardStackRow> template, final CardStackRow rowToFill) {
|
||||
int rowWidth = rowToFill.getWidth();
|
||||
|
||||
final Iterator<CardStack> itr = sourceRow.iterator();
|
||||
|
||||
while (itr.hasNext()) {
|
||||
final CardStack stack = itr.next();
|
||||
for (int i = firstPile; i < sourceRow.size(); i++ ) {
|
||||
CardStack stack = sourceRow.get(i);
|
||||
|
||||
rowWidth += stack.getWidth();
|
||||
if (rowWidth > this.playAreaWidth) {
|
||||
break;
|
||||
if (rowWidth > this.playAreaWidth) return i; // cannot add any more piles in a row
|
||||
|
||||
if (stack.getHeight() > rowToFill.getHeight()) { // if row becomes taller
|
||||
int newAllRowsHeight = this.getRowsHeight(template) - rowToFill.getHeight() + stack.getHeight();
|
||||
if ( newAllRowsHeight > this.playAreaHeight)
|
||||
return i; // refuse to add here because it won't fit in height
|
||||
}
|
||||
if (stack.getHeight() > row.getHeight()
|
||||
&& (((this.getRowsHeight(rows) - row.getHeight()) + stack.getHeight()) > this.playAreaHeight)) {
|
||||
break;
|
||||
}
|
||||
row.add(stack);
|
||||
itr.remove();
|
||||
rowToFill.add(stack);
|
||||
}
|
||||
return sourceRow.size();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -508,21 +482,102 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
||||
super.mouseLeftClicked(panel, evt);
|
||||
}
|
||||
|
||||
private static enum RowType {
|
||||
land, creature, creatureNonToken, other;
|
||||
/**
|
||||
* <p>
|
||||
* setupPlayZone.
|
||||
* </p>
|
||||
*
|
||||
* @param newList
|
||||
* an array of {@link forge.Card} objects.
|
||||
*/
|
||||
public void setupPlayZone() {
|
||||
List<Card> oldCards, toDelete;
|
||||
oldCards = new ArrayList<Card>();
|
||||
for (final CardPanel cpa : getCardPanels()) {
|
||||
oldCards.add(cpa.getGameCard());
|
||||
}
|
||||
toDelete = new ArrayList<Card>(oldCards);
|
||||
toDelete.removeAll(model);
|
||||
if (toDelete.size() == getCardPanels().size()) {
|
||||
clear();
|
||||
} else {
|
||||
for (final Card card : toDelete) {
|
||||
removeCardPanel(getCardPanel(card.getUniqueNumber()));
|
||||
}
|
||||
}
|
||||
|
||||
public boolean isType(final Card card) {
|
||||
List<Card> toAdd = new ArrayList<Card>(model);
|
||||
toAdd.removeAll(oldCards);
|
||||
|
||||
List<CardPanel> newPanels = new ArrayList<CardPanel>();
|
||||
for (final Card card : toAdd) {
|
||||
newPanels.add(addCard(card));
|
||||
}
|
||||
if (!toAdd.isEmpty()) {
|
||||
doLayout();
|
||||
}
|
||||
for (final CardPanel toPanel : newPanels) {
|
||||
scrollRectToVisible(new Rectangle(toPanel.getCardX(), toPanel.getCardY(), toPanel.getCardWidth(), toPanel.getCardHeight()));
|
||||
Animation.moveCard(toPanel);
|
||||
}
|
||||
|
||||
for (final Card card : model) {
|
||||
final CardPanel toPanel = getCardPanel(card.getUniqueNumber());
|
||||
if (card.isTapped()) {
|
||||
toPanel.setTapped(true);
|
||||
toPanel.setTappedAngle(forge.view.arcane.CardPanel.TAPPED_ANGLE);
|
||||
} else {
|
||||
toPanel.setTapped(false);
|
||||
toPanel.setTappedAngle(0);
|
||||
}
|
||||
toPanel.getAttachedPanels().clear();
|
||||
if (card.isEnchanted()) {
|
||||
final ArrayList<Card> enchants = card.getEnchantedBy();
|
||||
for (final Card e : enchants) {
|
||||
final forge.view.arcane.CardPanel cardE = getCardPanel(e.getUniqueNumber());
|
||||
if (cardE != null) {
|
||||
toPanel.getAttachedPanels().add(cardE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (card.isEquipped()) {
|
||||
final ArrayList<Card> enchants = card.getEquippedBy();
|
||||
for (final Card e : enchants) {
|
||||
final forge.view.arcane.CardPanel cardE = getCardPanel(e.getUniqueNumber());
|
||||
if (cardE != null) {
|
||||
toPanel.getAttachedPanels().add(cardE);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (card.isEnchantingCard()) {
|
||||
toPanel.setAttachedToPanel(getCardPanel(card.getEnchantingCard().getUniqueNumber()));
|
||||
} else if (card.isEquipping()) {
|
||||
toPanel.setAttachedToPanel(getCardPanel(card.getEquipping().get(0).getUniqueNumber()));
|
||||
} else {
|
||||
toPanel.setAttachedToPanel(null);
|
||||
}
|
||||
|
||||
toPanel.setCard(toPanel.getGameCard());
|
||||
}
|
||||
invalidate();
|
||||
repaint();
|
||||
}
|
||||
|
||||
private static enum RowType {
|
||||
Land,
|
||||
Creature,
|
||||
CreatureNonToken,
|
||||
Other;
|
||||
|
||||
public boolean isGoodFor(final Card card) {
|
||||
switch (this) {
|
||||
case land:
|
||||
return card.isLand();
|
||||
case creature:
|
||||
return card.isCreature();
|
||||
case creatureNonToken:
|
||||
return card.isCreature() && !card.isToken();
|
||||
case other:
|
||||
return !card.isLand() && !card.isCreature();
|
||||
default:
|
||||
throw new RuntimeException("Unhandled type: " + this);
|
||||
case Land: return card.isLand();
|
||||
case Creature: return card.isCreature();
|
||||
case CreatureNonToken: return card.isCreature() && !card.isToken();
|
||||
case Other: return !card.isLand() && !card.isCreature();
|
||||
default: throw new RuntimeException("Unhandled type: " + this);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -541,7 +596,7 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
||||
|
||||
private void addAll(final List<CardPanel> cardPanels, final RowType type) {
|
||||
for (final CardPanel panel : cardPanels) {
|
||||
if (!type.isType(panel.getGameCard()) || (panel.getAttachedToPanel() != null)) {
|
||||
if (!type.isGoodFor(panel.getGameCard()) || (panel.getAttachedToPanel() != null)) {
|
||||
continue;
|
||||
}
|
||||
final CardStack stack = new CardStack();
|
||||
@@ -606,4 +661,17 @@ public class PlayArea extends CardPanelContainer implements CardPanelMouseListen
|
||||
+ PlayArea.this.cardSpacingY;
|
||||
}
|
||||
}
|
||||
private int getCardWidth() {
|
||||
return cardWidth;
|
||||
}
|
||||
|
||||
private void setCardWidth(int cardWidth0) {
|
||||
this.cardWidth = cardWidth0;
|
||||
this.cardHeight = Math.round(this.cardWidth * CardPanel.ASPECT_RATIO);
|
||||
this.extraCardSpacingX = Math.round(this.cardWidth * PlayArea.EXTRA_CARD_SPACING_X);
|
||||
this.cardSpacingX = (this.cardHeight - this.cardWidth) + this.extraCardSpacingX;
|
||||
this.cardSpacingY = Math.round(this.cardHeight * PlayArea.CARD_SPACING_Y);
|
||||
this.stackSpacingX = Math.round(this.cardWidth * PlayArea.STACK_SPACING_X);
|
||||
this.stackSpacingY = Math.round(this.cardHeight * PlayArea.STACK_SPACING_Y);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -140,6 +140,18 @@ public abstract class Animation {
|
||||
protected void end() {
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* invokeLater.
|
||||
* </p>
|
||||
*
|
||||
* @param runnable
|
||||
* a {@link java.lang.Runnable} object.
|
||||
*/
|
||||
public static void invokeLater(final Runnable runnable) {
|
||||
EventQueue.invokeLater(runnable);
|
||||
}
|
||||
|
||||
/**
|
||||
* Uses averaging of the time between the past few frames to provide smooth
|
||||
* animation.
|
||||
@@ -248,7 +260,7 @@ public abstract class Animation {
|
||||
public static void moveCardToPlay(final int startX, final int startY, final int startWidth, final int endX,
|
||||
final int endY, final int endWidth, final CardPanel animationPanel, final CardPanel placeholder,
|
||||
final JLayeredPane layeredPane, final int speed) {
|
||||
UI.invokeLater(new Runnable() {
|
||||
Animation.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final int startHeight = Math.round(startWidth * CardPanel.ASPECT_RATIO);
|
||||
@@ -343,7 +355,7 @@ public abstract class Animation {
|
||||
public static void moveCard(final int startX, final int startY, final int startWidth, final int endX,
|
||||
final int endY, final int endWidth, final CardPanel animationPanel, final CardPanel placeholder,
|
||||
final JLayeredPane layeredPane, final int speed) {
|
||||
UI.invokeLater(new Runnable() {
|
||||
Animation.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
final int startHeight = Math.round(startWidth * CardPanel.ASPECT_RATIO);
|
||||
@@ -397,10 +409,7 @@ public abstract class Animation {
|
||||
* a {@link forge.view.arcane.CardPanel} object.
|
||||
*/
|
||||
public static void moveCard(final CardPanel placeholder) {
|
||||
UI.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
EventQueue.invokeLater(new Runnable() {
|
||||
Animation.invokeLater(new Runnable() {
|
||||
@Override
|
||||
public void run() {
|
||||
if (placeholder != null) {
|
||||
@@ -411,8 +420,6 @@ public abstract class Animation {
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
||||
@@ -1,326 +0,0 @@
|
||||
/*
|
||||
* Forge: Play Magic: the Gathering.
|
||||
* Copyright (C) 2011 Nate
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package forge.view.arcane.util;
|
||||
|
||||
import java.awt.Component;
|
||||
import java.awt.Container;
|
||||
import java.awt.Dimension;
|
||||
import java.awt.EventQueue;
|
||||
import java.awt.Font;
|
||||
import java.awt.Image;
|
||||
import java.awt.Insets;
|
||||
import java.awt.Point;
|
||||
import java.awt.Toolkit;
|
||||
import java.io.File;
|
||||
import java.io.FileInputStream;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStream;
|
||||
import java.lang.reflect.InvocationTargetException;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URI;
|
||||
import java.net.URISyntaxException;
|
||||
import java.net.URL;
|
||||
import java.util.Collections;
|
||||
import java.util.concurrent.ConcurrentMap;
|
||||
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.ImageIcon;
|
||||
import javax.swing.JButton;
|
||||
import javax.swing.JEditorPane;
|
||||
import javax.swing.JPanel;
|
||||
import javax.swing.JScrollPane;
|
||||
import javax.swing.JToggleButton;
|
||||
import javax.swing.JViewport;
|
||||
import javax.swing.ScrollPaneConstants;
|
||||
import javax.swing.UIManager;
|
||||
import javax.swing.ViewportLayout;
|
||||
import javax.swing.border.Border;
|
||||
import javax.swing.border.TitledBorder;
|
||||
import javax.swing.text.Element;
|
||||
import javax.swing.text.StyleConstants;
|
||||
import javax.swing.text.View;
|
||||
import javax.swing.text.ViewFactory;
|
||||
import javax.swing.text.html.HTML;
|
||||
import javax.swing.text.html.HTMLEditorKit;
|
||||
import javax.swing.text.html.ImageView;
|
||||
|
||||
import com.google.common.collect.MapMaker;
|
||||
|
||||
/**
|
||||
* UI utility functions.
|
||||
*
|
||||
* @author Forge
|
||||
* @version $Id$
|
||||
*/
|
||||
public class UI {
|
||||
/** Constant <code>imageCache</code>. */
|
||||
private static ConcurrentMap<URI, Image> imageCache = new MapMaker().softValues().makeMap();
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* getToggleButton.
|
||||
* </p>
|
||||
*
|
||||
* @return a {@link javax.swing.JToggleButton} object.
|
||||
*/
|
||||
public static JToggleButton getToggleButton() {
|
||||
JToggleButton button = new JToggleButton();
|
||||
button.setMargin(new Insets(2, 4, 2, 4));
|
||||
return button;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* getButton.
|
||||
* </p>
|
||||
*
|
||||
* @return a {@link javax.swing.JButton} object.
|
||||
*/
|
||||
public static JButton getButton() {
|
||||
JButton button = new JButton();
|
||||
button.setMargin(new Insets(2, 4, 2, 4));
|
||||
return button;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* setTitle.
|
||||
* </p>
|
||||
*
|
||||
* @param panel
|
||||
* a {@link javax.swing.JPanel} object.
|
||||
* @param title
|
||||
* a {@link java.lang.String} object.
|
||||
*/
|
||||
public static void setTitle(final JPanel panel, final String title) {
|
||||
Border border = panel.getBorder();
|
||||
if (border instanceof TitledBorder) {
|
||||
((TitledBorder) panel.getBorder()).setTitle(title);
|
||||
panel.repaint();
|
||||
} else {
|
||||
panel.setBorder(BorderFactory.createTitledBorder(title));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* getFileURL.
|
||||
* </p>
|
||||
*
|
||||
* @param path
|
||||
* a {@link java.lang.String} object.
|
||||
* @return a {@link java.net.URL} object.
|
||||
*/
|
||||
public static URL getFileURL(final String path) {
|
||||
File file = new File(path);
|
||||
if (file.exists()) {
|
||||
try {
|
||||
return file.toURI().toURL();
|
||||
} catch (MalformedURLException ignored) {
|
||||
}
|
||||
}
|
||||
return UI.class.getResource(path);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* getImageIcon.
|
||||
* </p>
|
||||
*
|
||||
* @param path
|
||||
* a {@link java.lang.String} object.
|
||||
* @return a {@link javax.swing.ImageIcon} object.
|
||||
*/
|
||||
public static ImageIcon getImageIcon(final String path) {
|
||||
InputStream stream = null;
|
||||
try {
|
||||
try {
|
||||
stream = UI.class.getResourceAsStream(path);
|
||||
if (stream == null && new File(path).exists()) {
|
||||
stream = new FileInputStream(path);
|
||||
}
|
||||
if (stream == null) {
|
||||
throw new RuntimeException("Image not found: " + path);
|
||||
}
|
||||
byte[] data = new byte[stream.available()];
|
||||
stream.read(data);
|
||||
return new ImageIcon(data);
|
||||
} finally {
|
||||
if (stream != null) {
|
||||
stream.close();
|
||||
}
|
||||
}
|
||||
} catch (IOException ex) {
|
||||
throw new RuntimeException("Error reading image: " + path);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* setHTMLEditorKit.
|
||||
* </p>
|
||||
*
|
||||
* @param editorPane
|
||||
* a {@link javax.swing.JEditorPane} object.
|
||||
*/
|
||||
public static void setHTMLEditorKit(final JEditorPane editorPane) {
|
||||
editorPane.getDocument().putProperty("imageCache", imageCache); // Read
|
||||
// internally
|
||||
// by
|
||||
// ImageView,
|
||||
// but
|
||||
// never
|
||||
// written.
|
||||
// Extend all this shit to cache images.
|
||||
editorPane.setEditorKit(new HTMLEditorKit() {
|
||||
private static final long serialVersionUID = -562969765076450440L;
|
||||
|
||||
@Override
|
||||
public ViewFactory getViewFactory() {
|
||||
return new HTMLFactory() {
|
||||
@Override
|
||||
public View create(final Element elem) {
|
||||
Object o = elem.getAttributes().getAttribute(StyleConstants.NameAttribute);
|
||||
if (o instanceof HTML.Tag) {
|
||||
HTML.Tag kind = (HTML.Tag) o;
|
||||
if (kind == HTML.Tag.IMG) {
|
||||
return new ImageView(elem) {
|
||||
@Override
|
||||
public URL getImageURL() {
|
||||
URL url = super.getImageURL();
|
||||
// Put an image into the cache to be
|
||||
// read by other ImageView methods.
|
||||
if (url != null && imageCache.get(url) == null) {
|
||||
try {
|
||||
imageCache.put(url.toURI(), Toolkit.getDefaultToolkit()
|
||||
.createImage(url));
|
||||
} catch (URISyntaxException e) {
|
||||
}
|
||||
}
|
||||
return url;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
return super.create(elem);
|
||||
}
|
||||
};
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* setVerticalScrollingView.
|
||||
* </p>
|
||||
*
|
||||
* @param scrollPane
|
||||
* a {@link javax.swing.JScrollPane} object.
|
||||
* @param view
|
||||
* a {@link java.awt.Component} object.
|
||||
*/
|
||||
public static void setVerticalScrollingView(final JScrollPane scrollPane, final Component view) {
|
||||
final JViewport viewport = new JViewport();
|
||||
viewport.setLayout(new ViewportLayout() {
|
||||
private static final long serialVersionUID = -4436977380450713628L;
|
||||
|
||||
@Override
|
||||
public void layoutContainer(final Container parent) {
|
||||
viewport.setViewPosition(new Point(0, 0));
|
||||
Dimension viewportSize = viewport.getSize();
|
||||
int width = viewportSize.width;
|
||||
int height = Math.max(view.getPreferredSize().height, viewportSize.height);
|
||||
viewport.setViewSize(new Dimension(width, height));
|
||||
}
|
||||
});
|
||||
viewport.setView(view);
|
||||
scrollPane.setHorizontalScrollBarPolicy(ScrollPaneConstants.HORIZONTAL_SCROLLBAR_NEVER);
|
||||
scrollPane.setViewport(viewport);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* getDisplayManaCost.
|
||||
* </p>
|
||||
*
|
||||
* @param manaCost
|
||||
* a {@link java.lang.String} object.
|
||||
* @return a {@link java.lang.String} object.
|
||||
*/
|
||||
public static String getDisplayManaCost(String manaCost) {
|
||||
manaCost = manaCost.replace("/", "");
|
||||
manaCost = manaCost.replace("X 0", "X");
|
||||
// A pipe in the cost means
|
||||
// "process left of the pipe as the card color, but display right of the pipe as the cost".
|
||||
int pipePosition = manaCost.indexOf("{|}");
|
||||
if (pipePosition != -1) {
|
||||
manaCost = manaCost.substring(pipePosition + 3);
|
||||
}
|
||||
return manaCost;
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* invokeLater.
|
||||
* </p>
|
||||
*
|
||||
* @param runnable
|
||||
* a {@link java.lang.Runnable} object.
|
||||
*/
|
||||
public static void invokeLater(final Runnable runnable) {
|
||||
EventQueue.invokeLater(runnable);
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* invokeAndWait.
|
||||
* </p>
|
||||
*
|
||||
* @param runnable
|
||||
* a {@link java.lang.Runnable} object.
|
||||
*/
|
||||
public static void invokeAndWait(final Runnable runnable) {
|
||||
if (EventQueue.isDispatchThread()) {
|
||||
runnable.run();
|
||||
return;
|
||||
}
|
||||
try {
|
||||
EventQueue.invokeAndWait(runnable);
|
||||
} catch (InterruptedException ex) {
|
||||
} catch (InvocationTargetException ex) {
|
||||
throw new RuntimeException(ex);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* <p>
|
||||
* setDefaultFont.
|
||||
* </p>
|
||||
*
|
||||
* @param font
|
||||
* a {@link java.awt.Font} object.
|
||||
*/
|
||||
public static void setDefaultFont(final Font font) {
|
||||
for (Object key : Collections.list(UIManager.getDefaults().keys())) {
|
||||
Object value = UIManager.get(key);
|
||||
if (value instanceof javax.swing.plaf.FontUIResource) {
|
||||
UIManager.put(key, font);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user