mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
merge latest trunk
This commit is contained in:
2
.gitattributes
vendored
2
.gitattributes
vendored
@@ -553,6 +553,7 @@ res/cardsfolder/a/aspect_of_wolf.txt svneol=native#text/plain
|
|||||||
res/cardsfolder/a/assassinate.txt svneol=native#text/plain
|
res/cardsfolder/a/assassinate.txt svneol=native#text/plain
|
||||||
res/cardsfolder/a/assassins_blade.txt svneol=native#text/plain
|
res/cardsfolder/a/assassins_blade.txt svneol=native#text/plain
|
||||||
res/cardsfolder/a/assassins_strike.txt -text
|
res/cardsfolder/a/assassins_strike.txt -text
|
||||||
|
res/cardsfolder/a/assault__battery.txt -text
|
||||||
res/cardsfolder/a/assault_griffin.txt svneol=native#text/plain
|
res/cardsfolder/a/assault_griffin.txt svneol=native#text/plain
|
||||||
res/cardsfolder/a/assault_strobe.txt svneol=native#text/plain
|
res/cardsfolder/a/assault_strobe.txt svneol=native#text/plain
|
||||||
res/cardsfolder/a/assault_zeppelid.txt svneol=native#text/plain
|
res/cardsfolder/a/assault_zeppelid.txt svneol=native#text/plain
|
||||||
@@ -3604,6 +3605,7 @@ res/cardsfolder/f/fire_dragon.txt svneol=native#text/plain
|
|||||||
res/cardsfolder/f/fire_drake.txt svneol=native#text/plain
|
res/cardsfolder/f/fire_drake.txt svneol=native#text/plain
|
||||||
res/cardsfolder/f/fire_elemental.txt svneol=native#text/plain
|
res/cardsfolder/f/fire_elemental.txt svneol=native#text/plain
|
||||||
res/cardsfolder/f/fire_field_ogre.txt svneol=native#text/plain
|
res/cardsfolder/f/fire_field_ogre.txt svneol=native#text/plain
|
||||||
|
res/cardsfolder/f/fire_ice.txt -text
|
||||||
res/cardsfolder/f/fire_imp.txt svneol=native#text/plain
|
res/cardsfolder/f/fire_imp.txt svneol=native#text/plain
|
||||||
res/cardsfolder/f/fire_juggler.txt -text
|
res/cardsfolder/f/fire_juggler.txt -text
|
||||||
res/cardsfolder/f/fire_lit_thicket.txt svneol=native#text/plain
|
res/cardsfolder/f/fire_lit_thicket.txt svneol=native#text/plain
|
||||||
|
|||||||
18
res/cardsfolder/a/assault__battery.txt
Normal file
18
res/cardsfolder/a/assault__battery.txt
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
Name:Assault
|
||||||
|
ManaCost:R
|
||||||
|
AlternateMode: Split
|
||||||
|
Types:Sorcery
|
||||||
|
A:SP$ DealDamage | Cost$ R | NumDmg$ 2 | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | SpellDescription$ Assault deals 2 damage to target creature or player.
|
||||||
|
SetInfo:INV Uncommon
|
||||||
|
SetInfo:TSB Uncommon
|
||||||
|
SetInfo:HOP Uncommon
|
||||||
|
Oracle:Assault deals 2 damage to target creature or player.
|
||||||
|
|
||||||
|
ALTERNATE
|
||||||
|
|
||||||
|
Name:Battery
|
||||||
|
ManaCost:3 G
|
||||||
|
Types:Sorcery
|
||||||
|
A:SP$ Token | Cost$ 3 G | TokenAmount$ 1 | TokenName$ Elephant| TokenTypes$ Creature,Elephant| TokenOwner$ You | TokenColors$ Green | TokenPower$ 3 | TokenToughness$ 3 | TokenImage$ g 3 3 elephant | SpellDescription$ Put a 3/3 green Elephant creature token onto the battlefield.
|
||||||
|
Oracle:Put a 3/3 green Elephant creature token onto the battlefield.
|
||||||
|
End
|
||||||
@@ -2,8 +2,9 @@ Name:Conjurer's Closet
|
|||||||
ManaCost:5
|
ManaCost:5
|
||||||
Types:Artifact
|
Types:Artifact
|
||||||
T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ ConjurerExile | OptionalDecider$ You | TriggerDescription$ At the beginning of your end step, you may exile target creature you control, then return it to the battlefield under your control.
|
T:Mode$ Phase | Phase$ End of Turn | ValidPlayer$ You | TriggerZones$ Battlefield | Execute$ ConjurerExile | OptionalDecider$ You | TriggerDescription$ At the beginning of your end step, you may exile target creature you control, then return it to the battlefield under your control.
|
||||||
SVar:ConjurerExile:AB$ChangeZone | Cost$ 0 | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control to flicker | Origin$ Battlefield | Destination$ Exile | SubAbility$ ConjurerReturn
|
SVar:ConjurerExile:AB$ ChangeZone | Cost$ 0 | ValidTgts$ Creature.YouCtrl | TgtPrompt$ Select target creature you control to flicker | Origin$ Battlefield | Destination$ Exile | RememberChanged$ True | SubAbility$ ConjurerReturn
|
||||||
SVar:ConjurerReturn:DB$ChangeZone | Defined$ Targeted | Origin$ Exile | Destination$ Battlefield | GainControl$ True
|
SVar:ConjurerReturn:DB$ ChangeZone | Defined$ Remembered | Origin$ Exile | Destination$ Battlefield | GainControl$ True | SubAbility$ DBCleanup
|
||||||
|
SVar:DBCleanup:DB$Cleanup | ClearRemembered$ True
|
||||||
SVar:RemAIDeck:True
|
SVar:RemAIDeck:True
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/conjurers_closet.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/conjurers_closet.jpg
|
||||||
Oracle:At the beginning of your end step, you may exile target creature you control, then return that card to the battlefield under your control.
|
Oracle:At the beginning of your end step, you may exile target creature you control, then return that card to the battlefield under your control.
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
Name:Covenant of Minds
|
Name:Covenant of Minds
|
||||||
ManaCost:4 U
|
ManaCost:4 U
|
||||||
Types:Sorcery
|
Types:Sorcery
|
||||||
A:SP$ Dig | Cost$ 2 B | DigNum$ 3 | NoMove$ True | Reveal$ True | DestinationZone$ Library | LibraryPosition$ 0 | LibraryPosition2$ 0 | SubAbility$ DBChoice | RememberRevealed$ True | SpellDescription$ Reveal the top three cards of your library. Target opponent may choose to put those cards into your hand. If he or she doesn't, put those cards into your graveyard and draw five cards.
|
A:SP$ Dig | Cost$ 4 U | DigNum$ 3 | NoMove$ True | Reveal$ True | DestinationZone$ Library | LibraryPosition$ 0 | LibraryPosition2$ 0 | SubAbility$ DBChoice | RememberRevealed$ True | SpellDescription$ Reveal the top three cards of your library. Target opponent may choose to put those cards into your hand. If he or she doesn't, put those cards into your graveyard and draw five cards.
|
||||||
SVar:DBChoice:DB$ GenericChoice | ValidTgts$ Opponent | Choices$ CovenantDraw,CovenantMillDraw
|
SVar:DBChoice:DB$ GenericChoice | ValidTgts$ Opponent | Choices$ CovenantDraw,CovenantMillDraw
|
||||||
SVar:CovenantDraw:DB$ Draw | Defined$ SourceController | NumCards$ X | References$ X | ChoiceDescription$ You may choose to put those cards into that player's hand.
|
SVar:CovenantDraw:DB$ Draw | Defined$ SourceController | NumCards$ X | References$ X | ChoiceDescription$ You may choose to put those cards into that player's hand.
|
||||||
SVar:CovenantMillDraw:DB$ Mill | Defined$ SourceController | NumCards$ X | References$ X | SubAbility$ DBDraw | ChoiceDescription$ If you don't, put those cards into that player's graveyard and that player draws five cards.
|
SVar:CovenantMillDraw:DB$ Mill | Defined$ SourceController | NumCards$ X | References$ X | SubAbility$ DBDraw | ChoiceDescription$ If you don't, put those cards into that player's graveyard and that player draws five cards.
|
||||||
|
|||||||
19
res/cardsfolder/f/fire_ice.txt
Normal file
19
res/cardsfolder/f/fire_ice.txt
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
Name:Fire
|
||||||
|
ManaCost:1 R
|
||||||
|
AlternateMode: Split
|
||||||
|
Types:Instant
|
||||||
|
A:SP$ DealDamage | Cost$ 1 R | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player to distribute damage to | NumDmg$ 2 | TargetMin$ 1 | TargetMax$ 2 | DividedAsYouChoose$ 2 | SpellDescription$ Fire deals 2 damage divided as you choose among one or two target creatures and/or players.
|
||||||
|
SetInfo:APC Uncommon
|
||||||
|
SetInfo:COM Uncommon
|
||||||
|
SetInfo:DDJ Uncommon
|
||||||
|
Oracle:Fire deals 2 damage divided as you choose among one or two target creatures and/or players.
|
||||||
|
|
||||||
|
ALTERNATE
|
||||||
|
|
||||||
|
Name:Ice
|
||||||
|
ManaCost:1 U
|
||||||
|
Types:Instant
|
||||||
|
A:SP$ Tap | Cost$ 1 U | ValidTgts$ Permanent | TgtPrompt$ Select target permanent | SubAbility$ DBDraw | SpellDescription$ Tap target permanent. Draw a card.
|
||||||
|
SVar:DBDraw:DB$ Draw | NumCards$ 1
|
||||||
|
Oracle:Tap target permanent.\nDraw a card.
|
||||||
|
End
|
||||||
@@ -4,7 +4,7 @@ Types:Instant
|
|||||||
K:Cycling:5 R B G
|
K:Cycling:5 R B G
|
||||||
A:SP$ DealDamage | Cost$ 2 R | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ 3 | SpellDescription$ CARDNAME deals 3 damage to target creature or player.
|
A:SP$ DealDamage | Cost$ 2 R | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ 3 | SpellDescription$ CARDNAME deals 3 damage to target creature or player.
|
||||||
T:Mode$ Cycled | ValidCard$ Card.Self | Execute$ TrigDamage | TriggerDescription$ When you cycle CARDNAME, it deals 6 damage to target creature or player.
|
T:Mode$ Cycled | ValidCard$ Card.Self | Execute$ TrigDamage | TriggerDescription$ When you cycle CARDNAME, it deals 6 damage to target creature or player.
|
||||||
SVar:TrigDamage:SP$DealDamage | Cost$ 0 | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ 6
|
SVar:TrigDamage:AB$ DealDamage | Cost$ 0 | ValidTgts$ Creature,Player | TgtPrompt$ Select target creature or player | NumDmg$ 6
|
||||||
SVar:Picture:http://www.wizards.com/global/images/magic/general/resounding_thunder.jpg
|
SVar:Picture:http://www.wizards.com/global/images/magic/general/resounding_thunder.jpg
|
||||||
Oracle:Resounding Thunder deals 3 damage to target creature or player.\nCycling {5}{B}{R}{G} ({5}{B}{R}{G}, Discard this card: Draw a card.)\nWhen you cycle Resounding Thunder, it deals 6 damage to target creature or player.
|
Oracle:Resounding Thunder deals 3 damage to target creature or player.\nCycling {5}{B}{R}{G} ({5}{B}{R}{G}, Discard this card: Draw a card.)\nWhen you cycle Resounding Thunder, it deals 6 damage to target creature or player.
|
||||||
SetInfo:ALA Common
|
SetInfo:ALA Common
|
||||||
@@ -1,41 +1,41 @@
|
|||||||
[duel]
|
[duel]
|
||||||
[metadata]
|
[metadata]
|
||||||
Name=Bart Simpson 2
|
Name=Bart Simpson 2
|
||||||
Title=Bart Simpson
|
Title=Bart Simpson
|
||||||
Difficulty=medium
|
Difficulty=medium
|
||||||
Description=WUG deck with Minister of Impediments and Paralyzing Grasp
|
Description=WUG Tap deck with Minister of Impediments and Paralyzing Grasp
|
||||||
Icon=Bart Simpson.jpg
|
Icon=Bart Simpson.jpg
|
||||||
Deck Type=constructed
|
Deck Type=constructed
|
||||||
[main]
|
[main]
|
||||||
4 Plains|M12
|
4 Plains|M12
|
||||||
4 Forest|M12
|
4 Forest|M12
|
||||||
3 Island|M12
|
3 Island|M12
|
||||||
4 Tropical Island
|
4 Tropical Island
|
||||||
4 Tundra
|
4 Tundra
|
||||||
4 Savannah
|
4 Savannah
|
||||||
1 Aura Gnarlid
|
1 Aura Gnarlid
|
||||||
1 Harrier Griffin
|
1 Harrier Griffin
|
||||||
1 Alaborn Cavalier
|
1 Alaborn Cavalier
|
||||||
1 Seasoned Marshal
|
1 Seasoned Marshal
|
||||||
1 Trained Armodon
|
1 Trained Armodon
|
||||||
1 Serra Angel
|
1 Serra Angel
|
||||||
1 Messenger Falcons
|
1 Messenger Falcons
|
||||||
1 Rhox War Monk
|
1 Rhox War Monk
|
||||||
3 Minister of Impediments
|
3 Minister of Impediments
|
||||||
1 Yavimaya Enchantress
|
1 Yavimaya Enchantress
|
||||||
1 White Knight
|
1 White Knight
|
||||||
1 Moorish Cavalry
|
1 Moorish Cavalry
|
||||||
2 Wall of Blossoms
|
2 Wall of Blossoms
|
||||||
2 Squall Drifter
|
2 Squall Drifter
|
||||||
1 Master Decoy
|
1 Master Decoy
|
||||||
1 Fruition
|
1 Fruition
|
||||||
1 Theft of Dreams
|
1 Theft of Dreams
|
||||||
1 Kismet
|
1 Kismet
|
||||||
1 Roots
|
1 Roots
|
||||||
1 Mystic Restraints
|
1 Mystic Restraints
|
||||||
1 Thirst
|
1 Thirst
|
||||||
1 Entangling Vines
|
1 Entangling Vines
|
||||||
3 Dehydration
|
3 Dehydration
|
||||||
4 Glimmerdust Nap
|
4 Glimmerdust Nap
|
||||||
4 Paralyzing Grasp
|
4 Paralyzing Grasp
|
||||||
[sideboard]
|
[sideboard]
|
||||||
|
|||||||
@@ -1,44 +1,44 @@
|
|||||||
[duel]
|
[duel]
|
||||||
[metadata]
|
[metadata]
|
||||||
Name=Bart Simpson 3
|
Name=Bart Simpson 3
|
||||||
Title=Bart Simpson
|
Title=Bart Simpson
|
||||||
Difficulty=hard
|
Difficulty=hard
|
||||||
Description=WUG deck with Harrier Griffin and Entangling Vines
|
Description=WUG Tap deck with Harrier Griffin and Entangling Vines
|
||||||
Icon=Bart Simpson.jpg
|
Icon=Bart Simpson.jpg
|
||||||
Deck Type=constructed
|
Deck Type=constructed
|
||||||
[main]
|
[main]
|
||||||
2 Island|M10
|
2 Island|M10
|
||||||
3 Plains|M10
|
3 Plains|M10
|
||||||
2 Forest|M10
|
2 Forest|M10
|
||||||
4 Tropical Island
|
4 Tropical Island
|
||||||
4 Savannah
|
4 Savannah
|
||||||
4 Tundra
|
4 Tundra
|
||||||
1 Mox Emerald
|
1 Mox Emerald
|
||||||
1 Mox Pearl
|
1 Mox Pearl
|
||||||
1 Mox Sapphire
|
1 Mox Sapphire
|
||||||
2 Harrier Griffin
|
2 Harrier Griffin
|
||||||
1 Rhox War Monk
|
1 Rhox War Monk
|
||||||
1 Yavimaya Enchantress
|
1 Yavimaya Enchantress
|
||||||
1 Seasoned Marshal
|
1 Seasoned Marshal
|
||||||
1 Alaborn Cavalier
|
1 Alaborn Cavalier
|
||||||
1 Jenara, Asura of War
|
1 Jenara, Asura of War
|
||||||
1 Flanking Troops
|
1 Flanking Troops
|
||||||
1 Watchwolf
|
1 Watchwolf
|
||||||
1 Aura Gnarlid
|
1 Aura Gnarlid
|
||||||
1 Whipcorder
|
1 Whipcorder
|
||||||
3 Minister of Impediments
|
3 Minister of Impediments
|
||||||
1 Squall Drifter
|
1 Squall Drifter
|
||||||
1 Stormscape Apprentice
|
1 Stormscape Apprentice
|
||||||
1 Thornscape Apprentice
|
1 Thornscape Apprentice
|
||||||
1 Ancestral Recall
|
1 Ancestral Recall
|
||||||
1 Time Walk
|
1 Time Walk
|
||||||
1 Theft of Dreams
|
1 Theft of Dreams
|
||||||
1 Kismet
|
1 Kismet
|
||||||
1 Frozen AEther
|
1 Frozen AEther
|
||||||
3 Mystic Restraints
|
3 Mystic Restraints
|
||||||
1 Thirst
|
1 Thirst
|
||||||
4 Paralyzing Grasp
|
4 Paralyzing Grasp
|
||||||
3 Entangling Vines
|
3 Entangling Vines
|
||||||
1 Dehydration
|
1 Dehydration
|
||||||
4 Glimmerdust Nap
|
4 Glimmerdust Nap
|
||||||
[sideboard]
|
[sideboard]
|
||||||
|
|||||||
@@ -1,40 +1,40 @@
|
|||||||
[duel]
|
[duel]
|
||||||
[metadata]
|
[metadata]
|
||||||
Name=King Kong 1
|
Name=King Kong 1
|
||||||
Title=King Kong
|
Title=King Kong
|
||||||
Difficulty=easy
|
Difficulty=easy
|
||||||
Description=WBG Squirrel deck with tokens, changelings, Deranged Hermit and curse type auras
|
Description=WBG Squirrel deck with tokens, changelings, Deranged Hermit and curse type auras
|
||||||
Icon=King Kong.jpg
|
Icon=King Kong.jpg
|
||||||
Deck Type=constructed
|
Deck Type=constructed
|
||||||
[main]
|
[main]
|
||||||
4 Gilt-Leaf Palace
|
4 Gilt-Leaf Palace
|
||||||
2 Arctic Flats
|
2 Arctic Flats
|
||||||
2 Elfhame Palace
|
2 Elfhame Palace
|
||||||
2 Evolving Wilds
|
2 Evolving Wilds
|
||||||
2 Terramorphic Expanse
|
2 Terramorphic Expanse
|
||||||
8 Forest|M12
|
8 Forest|M12
|
||||||
2 Plains|M12
|
2 Plains|M12
|
||||||
2 Swamp|M12
|
2 Swamp|M12
|
||||||
2 Deranged Hermit
|
2 Deranged Hermit
|
||||||
3 Chatter of the Squirrel
|
3 Chatter of the Squirrel
|
||||||
3 Squirrel Nest
|
3 Squirrel Nest
|
||||||
3 Acorn Harvest
|
3 Acorn Harvest
|
||||||
1 Nut Collector
|
1 Nut Collector
|
||||||
1 Krosan Beast
|
1 Krosan Beast
|
||||||
1 Changeling Hero
|
1 Changeling Hero
|
||||||
1 Moonglove Changeling
|
1 Moonglove Changeling
|
||||||
3 Avian Changeling
|
3 Avian Changeling
|
||||||
2 Ghostly Changeling
|
2 Ghostly Changeling
|
||||||
2 Skeletal Changeling
|
2 Skeletal Changeling
|
||||||
1 Enfeeblement
|
1 Enfeeblement
|
||||||
1 Cessation
|
1 Cessation
|
||||||
1 Darksteel Ingot
|
1 Manalith
|
||||||
1 Despondency
|
1 Despondency
|
||||||
1 Greel's Caress
|
1 Greel's Caress
|
||||||
2 Druid's Call
|
2 Druid's Call
|
||||||
3 Kodama's Reach
|
3 Kodama's Reach
|
||||||
1 Bound in Silence
|
1 Bound in Silence
|
||||||
1 Clinging Darkness
|
1 Clinging Darkness
|
||||||
1 Pacifism
|
1 Pacifism
|
||||||
1 Feebleness
|
1 Feebleness
|
||||||
[sideboard]
|
[sideboard]
|
||||||
|
|||||||
@@ -1,31 +1,32 @@
|
|||||||
[duel]
|
[duel]
|
||||||
[metadata]
|
[metadata]
|
||||||
Name=Neo 3
|
Name=Neo 3
|
||||||
Title=Neo
|
Title=Neo
|
||||||
Difficulty=hard
|
Difficulty=hard
|
||||||
Description=RG deck with Boartusk Liege, Jund Hackblade and Naya Hushblade
|
Description=RG deck with Boartusk Liege, Jund Hackblade and Naya Hushblade
|
||||||
Icon=Neo.jpg
|
Icon=Neo.jpg
|
||||||
Deck Type=constructed
|
Deck Type=constructed
|
||||||
[main]
|
[main]
|
||||||
4 Taiga
|
4 Taiga
|
||||||
4 Wooded Foothills
|
4 Wooded Foothills
|
||||||
4 Copperline Gorge
|
4 Copperline Gorge
|
||||||
1 Raging Ravine
|
1 Raging Ravine
|
||||||
4 Forest|SOM
|
4 Forest|SOM
|
||||||
4 Mountain|SOM
|
4 Mountain|SOM
|
||||||
1 Mox Emerald
|
1 Mox Emerald
|
||||||
1 Mox Ruby
|
1 Mox Ruby
|
||||||
4 Jund Hackblade
|
4 Jund Hackblade
|
||||||
4 Naya Hushblade
|
4 Naya Hushblade
|
||||||
2 Rip-Clan Crasher
|
2 Rip-Clan Crasher
|
||||||
4 Boggart Ram-Gang
|
4 Boggart Ram-Gang
|
||||||
2 Tattermunge Duo
|
2 Tattermunge Duo
|
||||||
3 Vithian Renegades
|
3 Vithian Renegades
|
||||||
4 Boartusk Liege
|
4 Boartusk Liege
|
||||||
4 Bloodbraid Elf
|
4 Bloodbraid Elf
|
||||||
2 Rumbling Slum
|
1 Rumbling Slum
|
||||||
2 Spellbreaker Behemoth
|
2 Spellbreaker Behemoth
|
||||||
1 Sarkhan Vol
|
1 Sarkhan Vol
|
||||||
3 Runes of the Deus
|
3 Runes of the Deus
|
||||||
2 Deus of Calamity
|
2 Deus of Calamity
|
||||||
[sideboard]
|
1 Ghor-Clan Rampager
|
||||||
|
[sideboard]
|
||||||
|
|||||||
@@ -1,42 +1,42 @@
|
|||||||
[duel]
|
[duel]
|
||||||
[metadata]
|
[metadata]
|
||||||
Name=Rocky 1
|
Name=Rocky 1
|
||||||
Title=Rocky
|
Title=Rocky
|
||||||
Difficulty=easy
|
Difficulty=easy
|
||||||
Description=WUR Pro red deck with Flamebreak, Tremor, Pyroclasm
|
Description=WUR Pro red deck with Flamebreak, Tremor, Pyroclasm
|
||||||
Icon=Rocky.jpg
|
Icon=Rocky.jpg
|
||||||
Deck Type=constructed
|
Deck Type=constructed
|
||||||
[main]
|
[main]
|
||||||
4 Jungle Shrine
|
4 Jungle Shrine
|
||||||
2 Beasts of Bogardan
|
2 Beasts of Bogardan
|
||||||
1 Air Elemental
|
1 Air Elemental
|
||||||
3 Plains|M11
|
3 Plains|M11
|
||||||
2 Darksteel Ingot
|
2 Manalith
|
||||||
3 Island|M11
|
3 Island|M11
|
||||||
1 Threaten
|
1 Threaten
|
||||||
2 Oraxid
|
2 Oraxid
|
||||||
3 Repentant Blacksmith
|
3 Repentant Blacksmith
|
||||||
2 Galina's Knight
|
2 Galina's Knight
|
||||||
2 Disciple of Law
|
2 Disciple of Law
|
||||||
2 Talon Trooper
|
2 Talon Trooper
|
||||||
1 Shield Wall
|
1 Shield Wall
|
||||||
1 Guided Strike
|
1 Guided Strike
|
||||||
3 Freewind Falcon
|
3 Freewind Falcon
|
||||||
4 Coastal Tower
|
4 Coastal Tower
|
||||||
4 Crumbling Necropolis
|
4 Crumbling Necropolis
|
||||||
1 Vulshok Refugee
|
1 Vulshok Refugee
|
||||||
4 Mountain|M11
|
4 Mountain|M11
|
||||||
2 Vedalken Outlander
|
2 Vedalken Outlander
|
||||||
2 Hazerider Drake
|
2 Hazerider Drake
|
||||||
1 Defender of Law
|
1 Defender of Law
|
||||||
1 Volcanic Fallout
|
1 Volcanic Fallout
|
||||||
1 Pyroclasm
|
1 Pyroclasm
|
||||||
1 Tremor
|
1 Tremor
|
||||||
1 Flamebreak
|
1 Flamebreak
|
||||||
1 Desert Sandstorm
|
1 Desert Sandstorm
|
||||||
1 Devastate
|
1 Devastate
|
||||||
1 Whipflare
|
1 Whipflare
|
||||||
1 Steam Blast
|
1 Steam Blast
|
||||||
1 Hindering Light
|
1 Hindering Light
|
||||||
1 Orcish Mine
|
1 Orcish Mine
|
||||||
[sideboard]
|
[sideboard]
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ import forge.CardPredicates.Presets;
|
|||||||
import forge.card.CardCharacteristics;
|
import forge.card.CardCharacteristics;
|
||||||
import forge.card.CardRarity;
|
import forge.card.CardRarity;
|
||||||
import forge.card.CardRules;
|
import forge.card.CardRules;
|
||||||
|
import forge.card.CardSplitType;
|
||||||
import forge.card.ability.AbilityUtils;
|
import forge.card.ability.AbilityUtils;
|
||||||
import forge.card.ability.ApiType;
|
import forge.card.ability.ApiType;
|
||||||
import forge.card.cardfactory.CardFactoryUtil;
|
import forge.card.cardfactory.CardFactoryUtil;
|
||||||
@@ -233,7 +234,13 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
// Soulbond pairing card
|
// Soulbond pairing card
|
||||||
private Card pairedWith = null;
|
private Card pairedWith = null;
|
||||||
|
|
||||||
|
// Enumeration for CMC request types
|
||||||
|
public enum SplitCMCMode {
|
||||||
|
CurrentSideCMC,
|
||||||
|
CombinedCMC,
|
||||||
|
LeftSplitCMC,
|
||||||
|
RightSplitCMC
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new card.
|
* Instantiates a new card.
|
||||||
@@ -7051,15 +7058,29 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
} else if (property.startsWith("greatestCMC")) {
|
} else if (property.startsWith("greatestCMC")) {
|
||||||
final List<Card> list = CardLists.filter(Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield), Presets.CREATURES);
|
final List<Card> list = CardLists.filter(Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield), Presets.CREATURES);
|
||||||
for (final Card crd : list) {
|
for (final Card crd : list) {
|
||||||
if (crd.getCMC() > this.getCMC()) {
|
if (crd.getRules() != null && crd.getRules().getSplitType() == CardSplitType.Split) {
|
||||||
return false;
|
if (crd.getCMC(Card.SplitCMCMode.LeftSplitCMC) > this.getCMC() || crd.getCMC(Card.SplitCMCMode.RightSplitCMC) > this.getCMC()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (crd.getCMC() > this.getCMC()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (property.startsWith("lowestCMC")) {
|
} else if (property.startsWith("lowestCMC")) {
|
||||||
final List<Card> list = Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield);
|
final List<Card> list = Singletons.getModel().getGame().getCardsIn(ZoneType.Battlefield);
|
||||||
for (final Card crd : list) {
|
for (final Card crd : list) {
|
||||||
if (!crd.isLand() && !crd.isImmutable() && (crd.getCMC() < this.getCMC())) {
|
if (!crd.isLand() && !crd.isImmutable()) {
|
||||||
return false;
|
if (crd.getRules() != null && crd.getRules().getSplitType() == CardSplitType.Split) {
|
||||||
|
if (crd.getCMC(Card.SplitCMCMode.LeftSplitCMC) < this.getCMC() || crd.getCMC(Card.SplitCMCMode.RightSplitCMC) < this.getCMC()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (crd.getCMC() < this.getCMC()) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (property.startsWith("enchanted")) {
|
} else if (property.startsWith("enchanted")) {
|
||||||
@@ -7110,6 +7131,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
|| property.startsWith("cmc") || property.startsWith("totalPT")) {
|
|| property.startsWith("cmc") || property.startsWith("totalPT")) {
|
||||||
int x = 0;
|
int x = 0;
|
||||||
int y = 0;
|
int y = 0;
|
||||||
|
int y2 = -1; // alternative value for the second split face of a split card
|
||||||
String rhs = "";
|
String rhs = "";
|
||||||
|
|
||||||
if (property.startsWith("power")) {
|
if (property.startsWith("power")) {
|
||||||
@@ -7120,7 +7142,12 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
y = this.getNetDefense();
|
y = this.getNetDefense();
|
||||||
} else if (property.startsWith("cmc")) {
|
} else if (property.startsWith("cmc")) {
|
||||||
rhs = property.substring(5);
|
rhs = property.substring(5);
|
||||||
y = getCMC();
|
if (getRules() != null && getRules().getSplitType() == CardSplitType.Split && getCurState() == CardCharacteristicName.Original) {
|
||||||
|
y = getState(CardCharacteristicName.LeftSplit).getManaCost().getCMC();
|
||||||
|
y2 = getState(CardCharacteristicName.RightSplit).getManaCost().getCMC();
|
||||||
|
} else {
|
||||||
|
y = getCMC();
|
||||||
|
}
|
||||||
} else if (property.startsWith("totalPT")) {
|
} else if (property.startsWith("totalPT")) {
|
||||||
rhs = property.substring(10);
|
rhs = property.substring(10);
|
||||||
y = this.getNetAttack() + this.getNetDefense();
|
y = this.getNetAttack() + this.getNetDefense();
|
||||||
@@ -7131,8 +7158,14 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
x = CardFactoryUtil.xCount(source, source.getSVar(rhs));
|
x = CardFactoryUtil.xCount(source, source.getSVar(rhs));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!Expressions.compare(y, property, x)) {
|
if (y2 == -1) {
|
||||||
return false;
|
if (!Expressions.compare(y, property, x)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
if (!Expressions.compare(y, property, x) || !Expressions.compare(y2, property, x)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -9110,6 +9143,10 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
* @return a int.
|
* @return a int.
|
||||||
*/
|
*/
|
||||||
public int getCMC() {
|
public int getCMC() {
|
||||||
|
return getCMC(SplitCMCMode.CurrentSideCMC);
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCMC(SplitCMCMode mode) {
|
||||||
if (isToken() && !isCopiedToken()) {
|
if (isToken() && !isCopiedToken()) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
@@ -9120,7 +9157,35 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
if (Singletons.getModel().getGame().getCardsIn(ZoneType.Stack).contains(this) && getManaCost() != null) {
|
if (Singletons.getModel().getGame().getCardsIn(ZoneType.Stack).contains(this) && getManaCost() != null) {
|
||||||
xPaid = getXManaCostPaid() * getManaCost().countX();
|
xPaid = getXManaCostPaid() * getManaCost().countX();
|
||||||
}
|
}
|
||||||
return getManaCost().getCMC() + xPaid;
|
|
||||||
|
int requestedCMC = 0;
|
||||||
|
|
||||||
|
if (getRules().getSplitType() == CardSplitType.Split) {
|
||||||
|
switch(mode) {
|
||||||
|
case CurrentSideCMC:
|
||||||
|
// TODO: test if this returns combined CMC for the full face (then get rid of CombinedCMC mode?)
|
||||||
|
requestedCMC = getManaCost().getCMC() + xPaid;
|
||||||
|
break;
|
||||||
|
case LeftSplitCMC:
|
||||||
|
requestedCMC = getState(CardCharacteristicName.LeftSplit).getManaCost().getCMC() + xPaid;
|
||||||
|
break;
|
||||||
|
case RightSplitCMC:
|
||||||
|
requestedCMC = getState(CardCharacteristicName.RightSplit).getManaCost().getCMC() + xPaid;
|
||||||
|
break;
|
||||||
|
case CombinedCMC:
|
||||||
|
requestedCMC += getState(CardCharacteristicName.LeftSplit).getManaCost().getCMC();
|
||||||
|
requestedCMC += getState(CardCharacteristicName.RightSplit).getManaCost().getCMC();
|
||||||
|
requestedCMC += xPaid;
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
System.out.println(String.format("Illegal Split Card CMC mode %s passed to getCMC!", mode.toString()));
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
requestedCMC = getManaCost().getCMC() + xPaid;
|
||||||
|
}
|
||||||
|
|
||||||
|
return requestedCMC;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean canBeSacrificedBy(final SpellAbility source)
|
public final boolean canBeSacrificedBy(final SpellAbility source)
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package forge.card;
|
package forge.card;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
|
||||||
import com.google.common.base.Predicate;
|
import com.google.common.base.Predicate;
|
||||||
|
|
||||||
import forge.item.CardPrinted;
|
import forge.item.CardPrinted;
|
||||||
@@ -8,44 +7,15 @@ import forge.item.IPaperCard;
|
|||||||
import forge.util.FileSection;
|
import forge.util.FileSection;
|
||||||
import forge.util.storage.StorageReaderFile;
|
import forge.util.storage.StorageReaderFile;
|
||||||
|
|
||||||
|
public class BoosterData extends PackData {
|
||||||
/**
|
|
||||||
* The Class BoosterData.
|
|
||||||
*/
|
|
||||||
public class BoosterData {
|
|
||||||
private final String edition;
|
|
||||||
public final String getEdition() {
|
|
||||||
return edition;
|
|
||||||
}
|
|
||||||
private final String landEdition;
|
|
||||||
public final String getLandEdition() {
|
|
||||||
return landEdition;
|
|
||||||
}
|
|
||||||
|
|
||||||
private final int nCommon;
|
private final int nCommon;
|
||||||
private final int nUncommon;
|
private final int nUncommon;
|
||||||
private final int nRare;
|
private final int nRare;
|
||||||
private final int nSpecial;
|
private final int nSpecial;
|
||||||
private final int nDoubleFaced;
|
private final int nDoubleFaced;
|
||||||
private final int nLand;
|
|
||||||
private final int foilRate;
|
private final int foilRate;
|
||||||
private static final int CARDS_PER_BOOSTER = 15;
|
private static final int CARDS_PER_BOOSTER = 15;
|
||||||
|
|
||||||
// private final String landCode;
|
|
||||||
/**
|
|
||||||
* Instantiates a new booster data.
|
|
||||||
*
|
|
||||||
* @param nC
|
|
||||||
* the n c
|
|
||||||
* @param nU
|
|
||||||
* the n u
|
|
||||||
* @param nR
|
|
||||||
* the n r
|
|
||||||
* @param nS
|
|
||||||
* the n s
|
|
||||||
* @param nDF
|
|
||||||
* the n df
|
|
||||||
*/
|
|
||||||
public BoosterData(final String edition, final String editionLand, final int nC, final int nU, final int nR, final int nS, final int nDF) {
|
public BoosterData(final String edition, final String editionLand, final int nC, final int nU, final int nR, final int nS, final int nDF) {
|
||||||
// if this booster has more that 10 cards, there must be a land in
|
// if this booster has more that 10 cards, there must be a land in
|
||||||
// 15th slot unless it's already taken
|
// 15th slot unless it's already taken
|
||||||
@@ -53,132 +23,116 @@ public class BoosterData {
|
|||||||
- nS - nDF : 0, 68);
|
- nS - nDF : 0, 68);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Instantiates a new booster data.
|
|
||||||
*
|
|
||||||
* @param nC
|
|
||||||
* the n c
|
|
||||||
* @param nU
|
|
||||||
* the n u
|
|
||||||
* @param nR
|
|
||||||
* the n r
|
|
||||||
* @param nS
|
|
||||||
* the n s
|
|
||||||
* @param nDF
|
|
||||||
* the n df
|
|
||||||
* @param nL
|
|
||||||
* the n l
|
|
||||||
* @param oneFoilPer
|
|
||||||
* the one foil per
|
|
||||||
*/
|
|
||||||
public BoosterData(final String edition0, final String editionLand, final int nC, final int nU, final int nR, final int nS, final int nDF, final int nL,
|
public BoosterData(final String edition0, final String editionLand, final int nC, final int nU, final int nR, final int nS, final int nDF, final int nL,
|
||||||
final int oneFoilPer) {
|
final int oneFoilPer) {
|
||||||
|
super(edition0, editionLand, nL > 0 ? nL : 0);
|
||||||
this.nCommon = nC;
|
this.nCommon = nC;
|
||||||
this.nUncommon = nU;
|
this.nUncommon = nU;
|
||||||
this.nRare = nR;
|
this.nRare = nR;
|
||||||
this.nSpecial = nS;
|
this.nSpecial = nS;
|
||||||
this.nDoubleFaced = nDF;
|
this.nDoubleFaced = nDF;
|
||||||
this.nLand = nL > 0 ? nL : 0;
|
|
||||||
this.foilRate = oneFoilPer;
|
this.foilRate = oneFoilPer;
|
||||||
this.edition = edition0;
|
|
||||||
this.landEdition = editionLand;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the common.
|
|
||||||
*
|
|
||||||
* @return the common
|
|
||||||
*/
|
|
||||||
public final int getCommon() {
|
public final int getCommon() {
|
||||||
return this.nCommon;
|
return this.nCommon;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final Predicate<CardPrinted> getEditionFilter() {
|
public final Predicate<CardPrinted> getEditionFilter() {
|
||||||
return IPaperCard.Predicates.printedInSets(edition);
|
return IPaperCard.Predicates.printedInSets(getEdition());
|
||||||
}
|
}
|
||||||
public final Predicate<CardPrinted> getLandEditionFilter() {
|
public final Predicate<CardPrinted> getLandEditionFilter() {
|
||||||
return IPaperCard.Predicates.printedInSets(landEdition);
|
return IPaperCard.Predicates.printedInSets(getLandEdition());
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* Gets the uncommon.
|
|
||||||
*
|
|
||||||
* @return the uncommon
|
|
||||||
*/
|
|
||||||
public final int getUncommon() {
|
public final int getUncommon() {
|
||||||
return this.nUncommon;
|
return this.nUncommon;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the rare.
|
|
||||||
*
|
|
||||||
* @return the rare
|
|
||||||
*/
|
|
||||||
public final int getRare() {
|
public final int getRare() {
|
||||||
return this.nRare;
|
return this.nRare;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the special.
|
|
||||||
*
|
|
||||||
* @return the special
|
|
||||||
*/
|
|
||||||
public final int getSpecial() {
|
public final int getSpecial() {
|
||||||
return this.nSpecial;
|
return this.nSpecial;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the double faced.
|
|
||||||
*
|
|
||||||
* @return the double faced
|
|
||||||
*/
|
|
||||||
public final int getDoubleFaced() {
|
public final int getDoubleFaced() {
|
||||||
return this.nDoubleFaced;
|
return this.nDoubleFaced;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the land.
|
|
||||||
*
|
|
||||||
* @return the land
|
|
||||||
*/
|
|
||||||
public final int getLand() {
|
|
||||||
return this.nLand;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the total.
|
|
||||||
*
|
|
||||||
* @return the total
|
|
||||||
*/
|
|
||||||
public final int getTotal() {
|
public final int getTotal() {
|
||||||
return this.nCommon + this.nUncommon + this.nRare + this.nSpecial + this.nDoubleFaced + this.nLand;
|
return this.nCommon + this.nUncommon + this.nRare + this.nSpecial + this.nDoubleFaced + getCntLands();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the foil chance.
|
|
||||||
*
|
|
||||||
* @return the foil chance
|
|
||||||
*/
|
|
||||||
public final int getFoilChance() {
|
public final int getFoilChance() {
|
||||||
return this.foilRate;
|
return this.foilRate;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Function<BoosterData, String> FN_GET_CODE = new Function<BoosterData, String>() {
|
private void _append(StringBuilder s, int val, String name) {
|
||||||
|
if (0 >= val) {
|
||||||
@Override
|
return;
|
||||||
public String apply(BoosterData arg1) {
|
|
||||||
return arg1.edition;
|
|
||||||
}
|
}
|
||||||
};
|
s.append(val).append(' ').append(name);
|
||||||
|
if (1 < val) {
|
||||||
|
s.append('s');
|
||||||
|
}
|
||||||
|
s.append(", ");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
int total = getTotal();
|
||||||
|
|
||||||
|
if (0 >= total) {
|
||||||
|
return "no cards";
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder s = new StringBuilder();
|
||||||
|
|
||||||
|
_append(s, total, "card");
|
||||||
|
if (0 < total) {
|
||||||
|
// remove comma
|
||||||
|
s.deleteCharAt(s.length() - 2);
|
||||||
|
}
|
||||||
|
|
||||||
|
s.append("consisting of ");
|
||||||
|
_append(s, nSpecial, "special");
|
||||||
|
_append(s, nDoubleFaced, "double faced card");
|
||||||
|
_append(s, nRare, "rare");
|
||||||
|
_append(s, nUncommon, "uncommon");
|
||||||
|
_append(s, nCommon, "common");
|
||||||
|
if (getEdition().equalsIgnoreCase(getLandEdition())) {
|
||||||
|
_append(s, getCntLands(), "land");
|
||||||
|
} else if (0 < getCntLands()) {
|
||||||
|
s.append(getCntLands()).append("land");
|
||||||
|
if (1 < getCntLands()) {
|
||||||
|
s.append("s");
|
||||||
|
}
|
||||||
|
s.append("from edition: ").append(getLandEdition()).append(", ");
|
||||||
|
}
|
||||||
|
|
||||||
|
// trim the last comma and space
|
||||||
|
s.replace(s.length() - 2, s.length(), "");
|
||||||
|
|
||||||
|
// put an 'and' before the previous comma
|
||||||
|
int lastCommaIdx = s.lastIndexOf(",");
|
||||||
|
if (0 < lastCommaIdx) {
|
||||||
|
s.replace(lastCommaIdx+1, lastCommaIdx+1, " and");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (0 < foilRate) {
|
||||||
|
s.append(", with a foil rate of 1 in ").append(foilRate);
|
||||||
|
}
|
||||||
|
|
||||||
|
return s.toString();
|
||||||
|
}
|
||||||
|
|
||||||
public static final class Reader extends StorageReaderFile<BoosterData> {
|
public static final class Reader extends StorageReaderFile<BoosterData> {
|
||||||
|
|
||||||
public Reader(String pathname) {
|
public Reader(String pathname) {
|
||||||
super(pathname, BoosterData.FN_GET_CODE);
|
super(pathname, BoosterData.FN_GET_CODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see forge.util.StorageReaderFile#read(java.lang.String)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected BoosterData read(String line, int i) {
|
protected BoosterData read(String line, int i) {
|
||||||
final FileSection section = FileSection.parse(line, ":", "|");
|
final FileSection section = FileSection.parse(line, ":", "|");
|
||||||
@@ -194,6 +148,7 @@ public class BoosterData {
|
|||||||
if (editionLand == null) {
|
if (editionLand == null) {
|
||||||
editionLand = edition;
|
editionLand = edition;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new BoosterData(edition, editionLand, nC, nU, nR, nS, nDf, nLand, nFoilRate);
|
return new BoosterData(edition, editionLand, nC, nU, nR, nS, nDf, nLand, nFoilRate);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -213,7 +213,7 @@ public class BoosterGenerator {
|
|||||||
*/
|
*/
|
||||||
public final List<CardPrinted> getBoosterPack(BoosterData booster) {
|
public final List<CardPrinted> getBoosterPack(BoosterData booster) {
|
||||||
return this.getBoosterPack(booster.getCommon(), booster.getUncommon(), booster.getRare(), 0, 0, booster.getSpecial(),
|
return this.getBoosterPack(booster.getCommon(), booster.getUncommon(), booster.getRare(), 0, 0, booster.getSpecial(),
|
||||||
booster.getDoubleFaced(), 0, booster.getLand());
|
booster.getDoubleFaced(), 0, booster.getCntLands());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,7 +1,5 @@
|
|||||||
package forge.card;
|
package forge.card;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
|
||||||
|
|
||||||
import forge.util.FileSection;
|
import forge.util.FileSection;
|
||||||
import forge.util.storage.StorageReaderFile;
|
import forge.util.storage.StorageReaderFile;
|
||||||
|
|
||||||
@@ -9,53 +7,23 @@ import forge.util.storage.StorageReaderFile;
|
|||||||
* TODO: Write javadoc for this type.
|
* TODO: Write javadoc for this type.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public class FatPackData {
|
public class FatPackData extends PackData {
|
||||||
private final String edition;
|
private final int cntBoosters;
|
||||||
public final String getEdition() {
|
|
||||||
return edition;
|
|
||||||
}
|
|
||||||
|
|
||||||
private final String landsEdition;
|
|
||||||
public final String getLandsEdition() {
|
|
||||||
return landsEdition == null ? edition : landsEdition;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getCntBoosters() {
|
public int getCntBoosters() {
|
||||||
return cntBoosters;
|
return cntBoosters;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getCntLands() {
|
public FatPackData(String edition0, String landEdition0, int nBoosters, int nBasicLands)
|
||||||
return cntLands;
|
|
||||||
}
|
|
||||||
|
|
||||||
private final int cntBoosters;
|
|
||||||
private final int cntLands;
|
|
||||||
|
|
||||||
public FatPackData(String edition0, String landsEdition0, int nBoosters, int nBasicLands)
|
|
||||||
{
|
{
|
||||||
|
super(edition0, landEdition0, nBasicLands);
|
||||||
cntBoosters = nBoosters;
|
cntBoosters = nBoosters;
|
||||||
cntLands = nBasicLands;
|
|
||||||
edition = edition0;
|
|
||||||
landsEdition = landsEdition0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static final Function<FatPackData, String> FN_GET_CODE = new Function<FatPackData, String>() {
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public String apply(FatPackData arg1) {
|
|
||||||
return arg1.edition;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
public static final class Reader extends StorageReaderFile<FatPackData> {
|
public static final class Reader extends StorageReaderFile<FatPackData> {
|
||||||
|
|
||||||
public Reader(String pathname) {
|
public Reader(String pathname) {
|
||||||
super(pathname, FatPackData.FN_GET_CODE);
|
super(pathname, PackData.FN_GET_CODE);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see forge.util.StorageReaderFile#read(java.lang.String)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
protected FatPackData read(String line, int i) {
|
protected FatPackData read(String line, int i) {
|
||||||
final FileSection section = FileSection.parse(line, ":", "|");
|
final FileSection section = FileSection.parse(line, ":", "|");
|
||||||
@@ -64,4 +32,34 @@ public class FatPackData {
|
|||||||
return new FatPackData(section.get("Set"), section.get("LandSet"), nBoosters, nLand);
|
return new FatPackData(section.get("Set"), section.get("LandSet"), nBoosters, nLand);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
if (0 >= cntBoosters) {
|
||||||
|
return "no cards";
|
||||||
|
}
|
||||||
|
|
||||||
|
StringBuilder s = new StringBuilder();
|
||||||
|
|
||||||
|
if (0 < getCntLands()) {
|
||||||
|
s.append(getCntLands()).append(" land");
|
||||||
|
if (1 < getCntLands()) {
|
||||||
|
s.append("s");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!getEdition().equalsIgnoreCase(getLandEdition())) {
|
||||||
|
s.append(" from edition: ").append(getLandEdition());
|
||||||
|
}
|
||||||
|
|
||||||
|
if (0 < cntBoosters) {
|
||||||
|
s.append(" and ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (0 < cntBoosters) {
|
||||||
|
s.append(cntBoosters).append(" booster packs, each containing ");
|
||||||
|
}
|
||||||
|
|
||||||
|
return s.toString();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
52
src/main/java/forge/card/PackData.java
Normal file
52
src/main/java/forge/card/PackData.java
Normal file
@@ -0,0 +1,52 @@
|
|||||||
|
/*
|
||||||
|
* Forge: Play Magic: the Gathering.
|
||||||
|
* Copyright (C) 2011 Forge Team
|
||||||
|
*
|
||||||
|
* 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.card;
|
||||||
|
|
||||||
|
import com.google.common.base.Function;
|
||||||
|
|
||||||
|
public class PackData {
|
||||||
|
private final String edition;
|
||||||
|
public final String getEdition() {
|
||||||
|
return edition;
|
||||||
|
}
|
||||||
|
|
||||||
|
private final String landEdition;
|
||||||
|
public final String getLandEdition() {
|
||||||
|
return landEdition == null ? edition : landEdition;
|
||||||
|
}
|
||||||
|
|
||||||
|
private final int cntLands;
|
||||||
|
public int getCntLands() {
|
||||||
|
return cntLands;
|
||||||
|
}
|
||||||
|
|
||||||
|
public PackData(String edition0, String landEdition0, int nBasicLands)
|
||||||
|
{
|
||||||
|
edition = edition0;
|
||||||
|
landEdition = landEdition0;
|
||||||
|
cntLands = nBasicLands;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static final Function<? super PackData, String> FN_GET_CODE = new Function<PackData, String>() {
|
||||||
|
@Override
|
||||||
|
public String apply(PackData arg1) {
|
||||||
|
return arg1.edition;
|
||||||
|
}
|
||||||
|
};
|
||||||
|
}
|
||||||
@@ -31,7 +31,9 @@ import forge.Color;
|
|||||||
import forge.card.CardRules;
|
import forge.card.CardRules;
|
||||||
import forge.card.CardSplitType;
|
import forge.card.CardSplitType;
|
||||||
import forge.card.ICardFace;
|
import forge.card.ICardFace;
|
||||||
|
import forge.card.ability.AbilityFactory;
|
||||||
import forge.card.cost.Cost;
|
import forge.card.cost.Cost;
|
||||||
|
import forge.card.mana.ManaCost;
|
||||||
import forge.card.replacement.ReplacementHandler;
|
import forge.card.replacement.ReplacementHandler;
|
||||||
import forge.card.spellability.AbilityActivated;
|
import forge.card.spellability.AbilityActivated;
|
||||||
import forge.card.spellability.AbilitySub;
|
import forge.card.spellability.AbilitySub;
|
||||||
@@ -313,6 +315,11 @@ public class CardFactory {
|
|||||||
card.addStaticAbility(stAbs.get(i));
|
card.addStaticAbility(stAbs.get(i));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( state == CardCharacteristicName.LeftSplit || state == CardCharacteristicName.RightSplit )
|
||||||
|
{
|
||||||
|
card.getState(CardCharacteristicName.Original).getSpellAbility().addAll(card.getCharacteristics().getSpellAbility());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
card.setState(CardCharacteristicName.Original);
|
card.setState(CardCharacteristicName.Original);
|
||||||
@@ -367,9 +374,30 @@ public class CardFactory {
|
|||||||
if (card.isInAlternateState()) {
|
if (card.isInAlternateState()) {
|
||||||
card.setState(CardCharacteristicName.Original);
|
card.setState(CardCharacteristicName.Original);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( st == CardSplitType.Split ) {
|
if ( st == CardSplitType.Split ) {
|
||||||
card.setName(rules.getName());
|
card.setName(rules.getName());
|
||||||
// BUILD COMBINED 'Original' SIDE HERE
|
|
||||||
|
// Combined mana cost
|
||||||
|
ManaCost combinedManaCost = ManaCost.combine(rules.getMainPart().getManaCost(), rules.getOtherPart().getManaCost());
|
||||||
|
card.setManaCost(combinedManaCost);
|
||||||
|
|
||||||
|
// Combined card color
|
||||||
|
CardColor combinedCardColor = new CardColor(card);
|
||||||
|
combinedCardColor.addToCardColor(Color.fromColorSet(rules.getMainPart().getColor()));
|
||||||
|
combinedCardColor.addToCardColor(Color.fromColorSet(rules.getOtherPart().getColor()));
|
||||||
|
ArrayList<CardColor> combinedCardColorArr = new ArrayList<CardColor>();
|
||||||
|
combinedCardColorArr.add(combinedCardColor);
|
||||||
|
card.setColor(combinedCardColorArr);
|
||||||
|
|
||||||
|
// Super and 'middle' types should use enums.
|
||||||
|
List<String> coreTypes = rules.getType().getTypesBeforeDash();
|
||||||
|
coreTypes.addAll(rules.getType().getSubTypes());
|
||||||
|
card.setType(coreTypes);
|
||||||
|
|
||||||
|
// Combined text based on Oracle text - might not be necessary, temporarily disabled.
|
||||||
|
//String combinedText = String.format("%s: %s\n%s: %s", rules.getMainPart().getName(), rules.getMainPart().getOracleText(), rules.getOtherPart().getName(), rules.getOtherPart().getOracleText());
|
||||||
|
//card.setText(combinedText);
|
||||||
}
|
}
|
||||||
|
|
||||||
return card;
|
return card;
|
||||||
|
|||||||
@@ -2796,16 +2796,15 @@ public class CardFactoryUtil {
|
|||||||
// **************************************************
|
// **************************************************
|
||||||
// AbilityFactory cards
|
// AbilityFactory cards
|
||||||
final ArrayList<String> ia = card.getIntrinsicAbilities();
|
final ArrayList<String> ia = card.getIntrinsicAbilities();
|
||||||
if (ia.size() > 0) {
|
for (int i = 0; i < ia.size(); i++) {
|
||||||
for (int i = 0; i < ia.size(); i++) {
|
// System.out.println(cardName);
|
||||||
// System.out.println(cardName);
|
final SpellAbility sa = AbilityFactory.getAbility(ia.get(i), card);
|
||||||
final SpellAbility sa = AbilityFactory.getAbility(ia.get(i), card);
|
if (sa.hasParam("SetAsKicked")) {
|
||||||
if (sa.hasParam("SetAsKicked")) {
|
sa.addOptionalAdditionalCosts("Kicker");
|
||||||
sa.addOptionalAdditionalCosts("Kicker");
|
|
||||||
}
|
|
||||||
card.addSpellAbility(sa);
|
|
||||||
}
|
}
|
||||||
|
card.addSpellAbility(sa);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -20,7 +20,9 @@ package forge.card.spellability;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import forge.Card;
|
import forge.Card;
|
||||||
|
import forge.CardCharacteristicName;
|
||||||
import forge.Singletons;
|
import forge.Singletons;
|
||||||
|
import forge.card.CardSplitType;
|
||||||
import forge.card.ability.AbilityUtils;
|
import forge.card.ability.AbilityUtils;
|
||||||
import forge.card.cost.CostPayment;
|
import forge.card.cost.CostPayment;
|
||||||
import forge.game.zone.Zone;
|
import forge.game.zone.Zone;
|
||||||
@@ -149,6 +151,14 @@ public class SpellAbilityRequirements {
|
|||||||
if (this.select.isCanceled()) {
|
if (this.select.isCanceled()) {
|
||||||
// cancel ability during target choosing
|
// cancel ability during target choosing
|
||||||
final Card c = this.ability.getSourceCard();
|
final Card c = this.ability.getSourceCard();
|
||||||
|
|
||||||
|
// split cards transform back to full form if targeting is canceled
|
||||||
|
if (c.getRules() != null) {
|
||||||
|
if (c.getRules().getSplitType() == CardSplitType.Split) {
|
||||||
|
c.setState(CardCharacteristicName.Original);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this.bCasting && !c.isCopiedSpell()) { // and not a copy
|
if (this.bCasting && !c.isCopiedSpell()) { // and not a copy
|
||||||
// add back to where it came from
|
// add back to where it came from
|
||||||
Singletons.getModel().getGame().getAction().moveTo(this.fromZone, c, this.zonePosition);
|
Singletons.getModel().getGame().getAction().moveTo(this.fromZone, c, this.zonePosition);
|
||||||
@@ -203,6 +213,14 @@ public class SpellAbilityRequirements {
|
|||||||
Singletons.getModel().getGame().getAction().checkStateEffects();
|
Singletons.getModel().getGame().getAction().checkStateEffects();
|
||||||
} else if (this.payment.isCanceled()) {
|
} else if (this.payment.isCanceled()) {
|
||||||
final Card c = this.ability.getSourceCard();
|
final Card c = this.ability.getSourceCard();
|
||||||
|
|
||||||
|
// split cards transform back to full form if mana cost is not paid
|
||||||
|
if (c.getRules() != null) {
|
||||||
|
if (c.getRules().getSplitType() == CardSplitType.Split) {
|
||||||
|
c.setState(CardCharacteristicName.Original);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (this.bCasting && !c.isCopiedSpell()) { // and not a copy
|
if (this.bCasting && !c.isCopiedSpell()) { // and not a copy
|
||||||
// add back to Previous Zone
|
// add back to Previous Zone
|
||||||
Singletons.getModel().getGame().getAction().moveTo(this.fromZone, c, this.zonePosition);
|
Singletons.getModel().getGame().getAction().moveTo(this.fromZone, c, this.zonePosition);
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ import forge.CardUtil;
|
|||||||
import forge.Command;
|
import forge.Command;
|
||||||
import forge.CounterType;
|
import forge.CounterType;
|
||||||
import forge.GameEntity;
|
import forge.GameEntity;
|
||||||
|
import forge.card.CardSplitType;
|
||||||
import forge.card.CardType;
|
import forge.card.CardType;
|
||||||
import forge.card.ability.effects.AttachEffect;
|
import forge.card.ability.effects.AttachEffect;
|
||||||
import forge.card.cost.Cost;
|
import forge.card.cost.Cost;
|
||||||
@@ -339,6 +340,13 @@ public class GameAction {
|
|||||||
* @return a {@link forge.Card} object.
|
* @return a {@link forge.Card} object.
|
||||||
*/
|
*/
|
||||||
public final Card moveTo(final Zone zoneTo, Card c) {
|
public final Card moveTo(final Zone zoneTo, Card c) {
|
||||||
|
// if a split card is moved, convert it back to its full form before moving (unless moving to stack)
|
||||||
|
if (c.getRules() != null) {
|
||||||
|
if ((c.getRules().getSplitType() == CardSplitType.Split) && (zoneTo != game.getStackZone())) {
|
||||||
|
c.setState(CardCharacteristicName.Original);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return moveTo(zoneTo, c, null);
|
return moveTo(zoneTo, c, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -704,6 +712,7 @@ public class GameAction {
|
|||||||
return c;
|
return c;
|
||||||
}
|
}
|
||||||
final PlayerZone removed = c.getOwner().getZone(ZoneType.Exile);
|
final PlayerZone removed = c.getOwner().getZone(ZoneType.Exile);
|
||||||
|
|
||||||
return moveTo(removed, c);
|
return moveTo(removed, c);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,9 +6,11 @@ import java.util.List;
|
|||||||
import com.google.common.collect.Lists;
|
import com.google.common.collect.Lists;
|
||||||
|
|
||||||
import forge.Card;
|
import forge.Card;
|
||||||
|
import forge.CardCharacteristicName;
|
||||||
import forge.CardColor;
|
import forge.CardColor;
|
||||||
import forge.CardLists;
|
import forge.CardLists;
|
||||||
import forge.CardPredicates;
|
import forge.CardPredicates;
|
||||||
|
import forge.card.CardSplitType;
|
||||||
import forge.card.MagicColor;
|
import forge.card.MagicColor;
|
||||||
import forge.card.ability.AbilityUtils;
|
import forge.card.ability.AbilityUtils;
|
||||||
import forge.card.ability.ApiType;
|
import forge.card.ability.ApiType;
|
||||||
@@ -363,6 +365,11 @@ public class GameActionPlay {
|
|||||||
public final void playSpellAbility(SpellAbility sa, Player activator) {
|
public final void playSpellAbility(SpellAbility sa, Player activator) {
|
||||||
sa.setActivatingPlayer(activator);
|
sa.setActivatingPlayer(activator);
|
||||||
|
|
||||||
|
final Card source = sa.getSourceCard();
|
||||||
|
|
||||||
|
// Split card support
|
||||||
|
setSplitCardState(source, sa);
|
||||||
|
|
||||||
if (sa.getApi() == ApiType.Charm && !sa.isWrapper()) {
|
if (sa.getApi() == ApiType.Charm && !sa.isWrapper()) {
|
||||||
CharmEffect.makeChoices(sa);
|
CharmEffect.makeChoices(sa);
|
||||||
}
|
}
|
||||||
@@ -402,7 +409,6 @@ public class GameActionPlay {
|
|||||||
manaCost = this.getSpellCostChange(sa, new ManaCostBeingPaid(sa.getManaCost()));
|
manaCost = this.getSpellCostChange(sa, new ManaCostBeingPaid(sa.getManaCost()));
|
||||||
}
|
}
|
||||||
if (manaCost.isPaid() && (sa.getBeforePayMana() == null)) {
|
if (manaCost.isPaid() && (sa.getBeforePayMana() == null)) {
|
||||||
final Card source = sa.getSourceCard();
|
|
||||||
if (sa.isSpell() && !source.isCopiedSpell()) {
|
if (sa.isSpell() && !source.isCopiedSpell()) {
|
||||||
sa.setSourceCard(game.getAction().moveToStack(source));
|
sa.setSourceCard(game.getAction().moveToStack(source));
|
||||||
}
|
}
|
||||||
@@ -532,4 +538,26 @@ public class GameActionPlay {
|
|||||||
|
|
||||||
return usableColors;
|
return usableColors;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void setSplitCardState(final Card source, SpellAbility sa) {
|
||||||
|
// Split card support
|
||||||
|
if (source.getRules() != null) {
|
||||||
|
if (source.getRules().getSplitType() == CardSplitType.Split) {
|
||||||
|
List<SpellAbility> leftSplitAbilities = source.getState(CardCharacteristicName.LeftSplit).getSpellAbility();
|
||||||
|
List<SpellAbility> rightSplitAbilities = source.getState(CardCharacteristicName.RightSplit).getSpellAbility();
|
||||||
|
for (SpellAbility a : leftSplitAbilities) {
|
||||||
|
if (sa == a || sa.getDescription().equals(String.format("%s (without paying its mana cost)", a.getDescription()))) {
|
||||||
|
source.setState(CardCharacteristicName.LeftSplit);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (SpellAbility a : rightSplitAbilities) {
|
||||||
|
if (sa == a || sa.getDescription().equals(String.format("%s (without paying its mana cost)", a.getDescription()))) {
|
||||||
|
source.setState(CardCharacteristicName.RightSplit);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,6 +33,8 @@ import javax.swing.SwingUtilities;
|
|||||||
import javax.swing.border.EmptyBorder;
|
import javax.swing.border.EmptyBorder;
|
||||||
import javax.swing.border.EtchedBorder;
|
import javax.swing.border.EtchedBorder;
|
||||||
|
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
|
||||||
import forge.Card;
|
import forge.Card;
|
||||||
import forge.CounterType;
|
import forge.CounterType;
|
||||||
import forge.GameEntity;
|
import forge.GameEntity;
|
||||||
@@ -45,6 +47,7 @@ import forge.gui.toolbox.FPanel;
|
|||||||
import forge.gui.toolbox.FScrollPane;
|
import forge.gui.toolbox.FScrollPane;
|
||||||
import forge.gui.toolbox.FSkin;
|
import forge.gui.toolbox.FSkin;
|
||||||
import forge.gui.toolbox.FTextArea;
|
import forge.gui.toolbox.FTextArea;
|
||||||
|
import forge.item.InventoryItemFromSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The class CardDetailPanel. Shows the details of a card.
|
* The class CardDetailPanel. Shows the details of a card.
|
||||||
@@ -66,18 +69,11 @@ public class CardDetailPanel extends FPanel {
|
|||||||
private final FTextArea cdArea;
|
private final FTextArea cdArea;
|
||||||
private final FScrollPane scrArea;
|
private final FScrollPane scrArea;
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* Constructor for CardDetailPanel.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param card
|
|
||||||
* a {@link forge.Card} object.
|
|
||||||
*/
|
|
||||||
public CardDetailPanel(final Card card) {
|
public CardDetailPanel(final Card card) {
|
||||||
super();
|
super();
|
||||||
this.setLayout(new GridBagLayout());
|
this.setLayout(new GridBagLayout());
|
||||||
this.setBorder(new EtchedBorder());
|
this.setBorder(new EtchedBorder());
|
||||||
|
this.setBorderToggle(false);
|
||||||
|
|
||||||
GridBagConstraints labelConstrains = new GridBagConstraints();
|
GridBagConstraints labelConstrains = new GridBagConstraints();
|
||||||
labelConstrains.fill = GridBagConstraints.BOTH;
|
labelConstrains.fill = GridBagConstraints.BOTH;
|
||||||
@@ -126,6 +122,9 @@ public class CardDetailPanel extends FPanel {
|
|||||||
|
|
||||||
//4, 12
|
//4, 12
|
||||||
this.cdArea = new FTextArea();
|
this.cdArea = new FTextArea();
|
||||||
|
this.cdArea.setFont(new java.awt.Font("Dialog", 0, 14));
|
||||||
|
this.cdArea.setBorder(new EmptyBorder(4, 4, 4, 4));
|
||||||
|
this.cdArea.setOpaque(false);
|
||||||
this.scrArea = new FScrollPane(this.cdArea);
|
this.scrArea = new FScrollPane(this.cdArea);
|
||||||
|
|
||||||
GridBagConstraints areaConstraints = new GridBagConstraints();
|
GridBagConstraints areaConstraints = new GridBagConstraints();
|
||||||
@@ -135,10 +134,6 @@ public class CardDetailPanel extends FPanel {
|
|||||||
areaConstraints.weightx = 1.0;
|
areaConstraints.weightx = 1.0;
|
||||||
areaConstraints.weighty = 1.0;
|
areaConstraints.weighty = 1.0;
|
||||||
this.add(scrArea, areaConstraints);
|
this.add(scrArea, areaConstraints);
|
||||||
this.cdArea.setLineWrap(true);
|
|
||||||
this.cdArea.setWrapStyleWord(true);
|
|
||||||
this.cdArea.setEditable(false);
|
|
||||||
this.cdArea.setBorder(new EmptyBorder(4, 4, 4, 4));
|
|
||||||
|
|
||||||
this.nameCostLabel.setFont(new java.awt.Font("Dialog", 0, 14));
|
this.nameCostLabel.setFont(new java.awt.Font("Dialog", 0, 14));
|
||||||
this.typeLabel.setFont(new java.awt.Font("Dialog", 0, 14));
|
this.typeLabel.setFont(new java.awt.Font("Dialog", 0, 14));
|
||||||
@@ -149,15 +144,49 @@ public class CardDetailPanel extends FPanel {
|
|||||||
f = f.deriveFont(java.awt.Font.BOLD);
|
f = f.deriveFont(java.awt.Font.BOLD);
|
||||||
this.setInfoLabel.setFont(f);
|
this.setInfoLabel.setFont(f);
|
||||||
|
|
||||||
this.cdArea.setFont(new java.awt.Font("Dialog", 0, 14));
|
|
||||||
|
|
||||||
this.setCard(card);
|
this.setCard(card);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final void setItem(InventoryItemFromSet item) {
|
||||||
|
nameCostLabel.setText(item.getName());
|
||||||
|
typeLabel.setVisible(false);
|
||||||
|
powerToughnessLabel.setVisible(false);
|
||||||
|
idLabel.setText(null);
|
||||||
|
cdArea.setText(item.getDescription());
|
||||||
|
setBorder(GuiDisplayUtil.getBorder(null));
|
||||||
|
|
||||||
|
String set = item.getEdition();
|
||||||
|
setInfoLabel.setText(set);
|
||||||
|
setInfoLabel.setToolTipText("");
|
||||||
|
if (StringUtils.isEmpty(set)) {
|
||||||
|
setInfoLabel.setOpaque(false);
|
||||||
|
setInfoLabel.setBorder(null);
|
||||||
|
} else {
|
||||||
|
CardEdition edition = Singletons.getModel().getEditions().get(set);
|
||||||
|
if (null != edition) {
|
||||||
|
setInfoLabel.setToolTipText(edition.getName());
|
||||||
|
}
|
||||||
|
|
||||||
|
this.setInfoLabel.setOpaque(true);
|
||||||
|
this.setInfoLabel.setBackground(Color.BLACK);
|
||||||
|
this.setInfoLabel.setForeground(Color.WHITE);
|
||||||
|
this.setInfoLabel.setBorder(BorderFactory.createLineBorder(Color.WHITE));
|
||||||
|
}
|
||||||
|
|
||||||
|
SwingUtilities.invokeLater(new Runnable() {
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
scrArea.getVerticalScrollBar().setValue(scrArea.getVerticalScrollBar().getMinimum());
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
/** {@inheritDoc} */
|
/** {@inheritDoc} */
|
||||||
public final void setCard(final Card card) {
|
public final void setCard(final Card card) {
|
||||||
this.nameCostLabel.setText("");
|
this.nameCostLabel.setText("");
|
||||||
|
this.typeLabel.setVisible(true);
|
||||||
this.typeLabel.setText("");
|
this.typeLabel.setText("");
|
||||||
|
this.powerToughnessLabel.setVisible(true);
|
||||||
this.powerToughnessLabel.setText("");
|
this.powerToughnessLabel.setText("");
|
||||||
this.idLabel.setText("");
|
this.idLabel.setText("");
|
||||||
this.setInfoLabel.setText("");
|
this.setInfoLabel.setText("");
|
||||||
@@ -167,8 +196,9 @@ public class CardDetailPanel extends FPanel {
|
|||||||
this.cdArea.setText("");
|
this.cdArea.setText("");
|
||||||
this.setBorder(GuiDisplayUtil.getBorder(card));
|
this.setBorder(GuiDisplayUtil.getBorder(card));
|
||||||
|
|
||||||
if ( null == card )
|
if (null == card) {
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
final boolean canShowThis = card.canBeShownTo(Singletons.getControl().getPlayer());
|
final boolean canShowThis = card.canBeShownTo(Singletons.getControl().getPlayer());
|
||||||
if (canShowThis) {
|
if (canShowThis) {
|
||||||
|
|||||||
@@ -26,6 +26,7 @@ import forge.gui.framework.ICDoc;
|
|||||||
import forge.gui.match.views.VDetail;
|
import forge.gui.match.views.VDetail;
|
||||||
import forge.item.IPaperCard;
|
import forge.item.IPaperCard;
|
||||||
import forge.item.InventoryItem;
|
import forge.item.InventoryItem;
|
||||||
|
import forge.item.InventoryItemFromSet;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
@@ -38,7 +39,6 @@ public enum CDetail implements ICDoc {
|
|||||||
SINGLETON_INSTANCE;
|
SINGLETON_INSTANCE;
|
||||||
|
|
||||||
private VDetail view = VDetail.SINGLETON_INSTANCE;
|
private VDetail view = VDetail.SINGLETON_INSTANCE;
|
||||||
//private InventoryItem item = null;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Shows card details and/or picture in sidebar cardview tabber.
|
* Shows card details and/or picture in sidebar cardview tabber.
|
||||||
@@ -52,16 +52,15 @@ public enum CDetail implements ICDoc {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public void showCard(InventoryItem item) {
|
public void showCard(InventoryItem item) {
|
||||||
if ( item instanceof IPaperCard ) {
|
if (item instanceof IPaperCard) {
|
||||||
showCard(((IPaperCard)item).getMatchingForgeCard());
|
showCard(((IPaperCard)item).getMatchingForgeCard());
|
||||||
return;
|
} else if (item instanceof InventoryItemFromSet) {
|
||||||
|
view.getLblFlipcard().setVisible(false);
|
||||||
|
view.getPnlDetail().setItem((InventoryItemFromSet)item);
|
||||||
|
view.getParentCell().repaintSelf();
|
||||||
|
} else {
|
||||||
|
showCard((Card)null);
|
||||||
}
|
}
|
||||||
|
|
||||||
// TODO If we want to display an Items Written Text in the Detail Panel we need to add something into CardDetailPanel
|
|
||||||
//this.item = item;
|
|
||||||
view.getLblFlipcard().setVisible(false);
|
|
||||||
view.getPnlDetail().setCard(null);
|
|
||||||
view.getParentCell().repaintSelf();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
/* (non-Javadoc)
|
||||||
|
|||||||
@@ -15,8 +15,8 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
package forge.item;
|
|
||||||
|
|
||||||
|
package forge.item;
|
||||||
|
|
||||||
import com.google.common.base.Function;
|
import com.google.common.base.Function;
|
||||||
|
|
||||||
@@ -25,13 +25,7 @@ import forge.Singletons;
|
|||||||
import forge.card.BoosterData;
|
import forge.card.BoosterData;
|
||||||
import forge.card.CardEdition;
|
import forge.card.CardEdition;
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO Write javadoc for this type.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class BoosterPack extends OpenablePack {
|
public class BoosterPack extends OpenablePack {
|
||||||
|
|
||||||
/** The Constant fnFromSet. */
|
|
||||||
public static final Function<CardEdition, BoosterPack> FN_FROM_SET = new Function<CardEdition, BoosterPack>() {
|
public static final Function<CardEdition, BoosterPack> FN_FROM_SET = new Function<CardEdition, BoosterPack>() {
|
||||||
@Override
|
@Override
|
||||||
public BoosterPack apply(final CardEdition arg1) {
|
public BoosterPack apply(final CardEdition arg1) {
|
||||||
@@ -40,26 +34,10 @@ public class BoosterPack extends OpenablePack {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
|
||||||
* Instantiates a new booster pack.
|
|
||||||
*
|
|
||||||
* @param set
|
|
||||||
* the set
|
|
||||||
*/
|
|
||||||
public BoosterPack(final String name0, final BoosterData boosterData) {
|
public BoosterPack(final String name0, final BoosterData boosterData) {
|
||||||
super(name0, boosterData);
|
super(name0, boosterData);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see forge.item.InventoryItemFromSet#getImageFilename()
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Gets the image filename.
|
|
||||||
*
|
|
||||||
* @return String
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public final String getImageFilename() {
|
public final String getImageFilename() {
|
||||||
return ImageCache.SEALED_PRODUCT + "booster/" + this.contents.getEdition() + ".png";
|
return ImageCache.SEALED_PRODUCT + "booster/" + this.contents.getEdition() + ".png";
|
||||||
@@ -70,20 +48,8 @@ public class BoosterPack extends OpenablePack {
|
|||||||
return "Booster Pack";
|
return "Booster Pack";
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#clone()
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Clone.
|
|
||||||
*
|
|
||||||
* @return Object
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public final Object clone() {
|
public final Object clone() {
|
||||||
return new BoosterPack(name, contents);
|
return new BoosterPack(name, contents);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -69,6 +69,11 @@ public final class CardPrinted implements Comparable<IPaperCard>, InventoryItemF
|
|||||||
public String getName() {
|
public String getName() {
|
||||||
return this.name;
|
return this.name;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return name;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
|||||||
@@ -23,6 +23,8 @@ public class CardToken implements InventoryItemFromSet, IPaperCard {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override public String getName() { return name; }
|
@Override public String getName() { return name; }
|
||||||
|
@Override public String getDescription() { return name; }
|
||||||
|
|
||||||
@Override public String getEdition() { return edition; }
|
@Override public String getEdition() { return edition; }
|
||||||
|
|
||||||
@Override public int getArtIndex() { return 0; } // This might change however
|
@Override public int getArtIndex() { return 0; } // This might change however
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package forge.item;
|
package forge.item;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
@@ -27,10 +28,6 @@ import forge.Singletons;
|
|||||||
import forge.card.CardEdition;
|
import forge.card.CardEdition;
|
||||||
import forge.card.FatPackData;
|
import forge.card.FatPackData;
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO Write javadoc for this type.
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
public class FatPack extends OpenablePack {
|
public class FatPack extends OpenablePack {
|
||||||
|
|
||||||
/** The Constant fnFromSet. */
|
/** The Constant fnFromSet. */
|
||||||
@@ -44,17 +41,15 @@ public class FatPack extends OpenablePack {
|
|||||||
|
|
||||||
private final FatPackData fpData;
|
private final FatPackData fpData;
|
||||||
|
|
||||||
/**
|
|
||||||
* Instantiates a new booster pack.
|
|
||||||
*
|
|
||||||
* @param set
|
|
||||||
* the set
|
|
||||||
*/
|
|
||||||
public FatPack(final String name0, final FatPackData fpData0) {
|
public FatPack(final String name0, final FatPackData fpData0) {
|
||||||
super(name0, Singletons.getModel().getBoosters().get(fpData0.getEdition()));
|
super(name0, Singletons.getModel().getBoosters().get(fpData0.getEdition()));
|
||||||
fpData = fpData0;
|
fpData = fpData0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getDescription() {
|
||||||
|
return fpData.toString() + contents.toString();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final String getImageFilename() {
|
public final String getImageFilename() {
|
||||||
@@ -73,20 +68,10 @@ public class FatPack extends OpenablePack {
|
|||||||
for (int i = 0; i < fpData.getCntBoosters(); i++) {
|
for (int i = 0; i < fpData.getCntBoosters(); i++) {
|
||||||
result.addAll(super.generate());
|
result.addAll(super.generate());
|
||||||
}
|
}
|
||||||
result.addAll(getRandomBasicLands(fpData.getLandsEdition(), fpData.getCntLands()));
|
result.addAll(getRandomBasicLands(fpData.getLandEdition(), fpData.getCntLands()));
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#clone()
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Clone.
|
|
||||||
*
|
|
||||||
* @return Object
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public final Object clone() {
|
public final Object clone() {
|
||||||
return new FatPack(name, fpData);
|
return new FatPack(name, fpData);
|
||||||
@@ -96,6 +81,4 @@ public class FatPack extends OpenablePack {
|
|||||||
public int getTotalCards() {
|
public int getTotalCards() {
|
||||||
return super.getTotalCards() * fpData.getCntBoosters() + fpData.getCntLands();
|
return super.getTotalCards() * fpData.getCntBoosters() + fpData.getCntLands();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,22 +22,10 @@ package forge.item;
|
|||||||
* CardPrinted, Booster, Pets, Plants... etc
|
* CardPrinted, Booster, Pets, Plants... etc
|
||||||
*/
|
*/
|
||||||
public interface InventoryItemFromSet extends InventoryItem {
|
public interface InventoryItemFromSet extends InventoryItem {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An inventory item has to provide a name.
|
* The description to display for the item
|
||||||
*
|
|
||||||
* @return the name
|
|
||||||
*/
|
*/
|
||||||
@Override
|
String getDescription();
|
||||||
String getName();
|
|
||||||
|
|
||||||
/**
|
|
||||||
* An inventory item has to provide a picture.
|
|
||||||
*
|
|
||||||
* @return the image filename
|
|
||||||
*/
|
|
||||||
@Override
|
|
||||||
String getImageFilename();
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* An item belonging to a set should return its set as well.
|
* An item belonging to a set should return its set as well.
|
||||||
|
|||||||
@@ -15,6 +15,7 @@
|
|||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package forge.item;
|
package forge.item;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -28,73 +29,46 @@ import forge.card.BoosterGenerator;
|
|||||||
import forge.card.CardRulesPredicates;
|
import forge.card.CardRulesPredicates;
|
||||||
import forge.util.Aggregates;
|
import forge.util.Aggregates;
|
||||||
|
|
||||||
/**
|
|
||||||
* TODO: Write javadoc for this type.
|
|
||||||
*/
|
|
||||||
public abstract class OpenablePack implements InventoryItemFromSet {
|
public abstract class OpenablePack implements InventoryItemFromSet {
|
||||||
|
|
||||||
/** The contents. */
|
|
||||||
protected final BoosterData contents;
|
protected final BoosterData contents;
|
||||||
|
|
||||||
/** The name. */
|
|
||||||
protected final String name;
|
protected final String name;
|
||||||
private List<CardPrinted> cards = null;
|
private List<CardPrinted> cards = null;
|
||||||
|
|
||||||
private BoosterGenerator generator = null;
|
private BoosterGenerator generator = null;
|
||||||
|
|
||||||
/**
|
|
||||||
* Instantiates a new openable pack.
|
|
||||||
*
|
|
||||||
* @param name0 the name0
|
|
||||||
* @param boosterData the booster data
|
|
||||||
*/
|
|
||||||
public OpenablePack(final String name0, final BoosterData boosterData) {
|
public OpenablePack(final String name0, final BoosterData boosterData) {
|
||||||
this.contents = boosterData;
|
this.contents = boosterData;
|
||||||
this.name = name0;
|
this.name = name0;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
|
||||||
* @see forge.item.InventoryItemFromSet#getName()
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public final String getName() {
|
public final String getName() {
|
||||||
return this.name + " " + this.getItemType();
|
return this.name + " " + this.getItemType();
|
||||||
}
|
}
|
||||||
|
|
||||||
/* (non-Javadoc)
|
@Override
|
||||||
* @see forge.item.InventoryItemFromSet#getEdition()
|
public String getDescription() {
|
||||||
*/
|
return contents.toString();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public final String getEdition() {
|
public final String getEdition() {
|
||||||
return this.contents.getEdition();
|
return this.contents.getEdition();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the cards.
|
|
||||||
*
|
|
||||||
* @return the cards
|
|
||||||
*/
|
|
||||||
public final List<CardPrinted> getCards() {
|
public final List<CardPrinted> getCards() {
|
||||||
if (null == this.cards) {
|
if (null == this.cards) {
|
||||||
this.cards = this.generate();
|
this.cards = this.generate();
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.cards;
|
return this.cards;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the total cards.
|
|
||||||
*
|
|
||||||
* @return the total cards
|
|
||||||
*/
|
|
||||||
public int getTotalCards() {
|
public int getTotalCards() {
|
||||||
return this.contents.getTotal();
|
return this.contents.getTotal();
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#equals(java.lang.Object)
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public final boolean equals(final Object obj) {
|
public final boolean equals(final Object obj) {
|
||||||
if (this == obj) {
|
if (this == obj) {
|
||||||
@@ -117,16 +91,6 @@ public abstract class OpenablePack implements InventoryItemFromSet {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
|
||||||
* (non-Javadoc)
|
|
||||||
*
|
|
||||||
* @see java.lang.Object#hashCode()
|
|
||||||
*/
|
|
||||||
/**
|
|
||||||
* Hash code.
|
|
||||||
*
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
@Override
|
@Override
|
||||||
public final int hashCode() {
|
public final int hashCode() {
|
||||||
final int prime = 31;
|
final int prime = 31;
|
||||||
@@ -135,47 +99,27 @@ public abstract class OpenablePack implements InventoryItemFromSet {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Generate.
|
|
||||||
*
|
|
||||||
* @return the list
|
|
||||||
*/
|
|
||||||
protected List<CardPrinted> generate() {
|
protected List<CardPrinted> generate() {
|
||||||
if (null == this.generator) {
|
if (null == this.generator) {
|
||||||
this.generator = new BoosterGenerator(this.contents.getEditionFilter());
|
this.generator = new BoosterGenerator(this.contents.getEditionFilter());
|
||||||
}
|
}
|
||||||
final List<CardPrinted> myCards = this.generator.getBoosterPack(this.contents);
|
final List<CardPrinted> myCards = this.generator.getBoosterPack(this.contents);
|
||||||
|
|
||||||
final int cntLands = this.contents.getLand();
|
final int cntLands = this.contents.getCntLands();
|
||||||
if (cntLands > 0) {
|
if (cntLands > 0) {
|
||||||
myCards.add(this.getRandomBasicLand(this.contents.getLandEdition()));
|
myCards.add(this.getRandomBasicLand(this.contents.getLandEdition()));
|
||||||
}
|
}
|
||||||
return myCards;
|
return myCards;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the random basic land.
|
|
||||||
*
|
|
||||||
* @param set the set
|
|
||||||
* @return the random basic land
|
|
||||||
*/
|
|
||||||
protected CardPrinted getRandomBasicLand(final String setCode) {
|
protected CardPrinted getRandomBasicLand(final String setCode) {
|
||||||
return this.getRandomBasicLands(setCode, 1).get(0);
|
return this.getRandomBasicLands(setCode, 1).get(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Gets the random basic lands.
|
|
||||||
*
|
|
||||||
* @param set the set
|
|
||||||
* @param count the count
|
|
||||||
* @return the random basic lands
|
|
||||||
*/
|
|
||||||
protected List<CardPrinted> getRandomBasicLands(final String setCode, final int count) {
|
protected List<CardPrinted> getRandomBasicLands(final String setCode, final int count) {
|
||||||
Predicate<CardPrinted> cardsRule = Predicates.and(
|
Predicate<CardPrinted> cardsRule = Predicates.and(
|
||||||
IPaperCard.Predicates.printedInSets(setCode),
|
IPaperCard.Predicates.printedInSets(setCode),
|
||||||
Predicates.compose(CardRulesPredicates.Presets.IS_BASIC_LAND, CardPrinted.FN_GET_RULES));
|
Predicates.compose(CardRulesPredicates.Presets.IS_BASIC_LAND, CardPrinted.FN_GET_RULES));
|
||||||
return Aggregates.random(Iterables.filter(CardDb.instance().getAllCards(), cardsRule), count);
|
return Aggregates.random(Iterables.filter(CardDb.instance().getAllCards(), cardsRule), count);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -133,6 +133,7 @@ public class PreconDeck implements InventoryItemFromSet {
|
|||||||
*
|
*
|
||||||
* @return the description
|
* @return the description
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public final String getDescription() {
|
public final String getDescription() {
|
||||||
return this.description;
|
return this.description;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ import forge.util.IItemReader;
|
|||||||
public abstract class StorageReaderFile<T> implements IItemReader<T> {
|
public abstract class StorageReaderFile<T> implements IItemReader<T> {
|
||||||
|
|
||||||
private final File file;
|
private final File file;
|
||||||
private final Function<T, String> keySelector;
|
private final Function<? super T, String> keySelector;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Instantiates a new storage reader file.
|
* Instantiates a new storage reader file.
|
||||||
@@ -48,7 +48,7 @@ public abstract class StorageReaderFile<T> implements IItemReader<T> {
|
|||||||
* @param pathname the pathname
|
* @param pathname the pathname
|
||||||
* @param keySelector0 the key selector0
|
* @param keySelector0 the key selector0
|
||||||
*/
|
*/
|
||||||
public StorageReaderFile(final String pathname, final Function<T, String> keySelector0) {
|
public StorageReaderFile(final String pathname, final Function<? super T, String> keySelector0) {
|
||||||
this(new File(pathname), keySelector0);
|
this(new File(pathname), keySelector0);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +58,7 @@ public abstract class StorageReaderFile<T> implements IItemReader<T> {
|
|||||||
* @param file0 the file0
|
* @param file0 the file0
|
||||||
* @param keySelector0 the key selector0
|
* @param keySelector0 the key selector0
|
||||||
*/
|
*/
|
||||||
public StorageReaderFile(final File file0, final Function<T, String> keySelector0) {
|
public StorageReaderFile(final File file0, final Function<? super T, String> keySelector0) {
|
||||||
this.file = file0;
|
this.file = file0;
|
||||||
this.keySelector = keySelector0;
|
this.keySelector = keySelector0;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user