diff --git a/.gitattributes b/.gitattributes index e969f02de01..3631e12c2db 100644 --- a/.gitattributes +++ b/.gitattributes @@ -9112,6 +9112,7 @@ res/pics/icons/LeafIconSmall.png -text svneol=unset#image/png res/pics/icons/Life.png -text svneol=unset#image/png res/pics/icons/MapIcon.png -text svneol=unset#image/png res/pics/icons/MapIconLarge.png -text svneol=unset#image/png +res/pics/icons/Unknown.jpg -text res/pics/icons/ZeppelinIcon.png -text svneol=unset#image/png res/pics/icons/notesIcon.png -text svneol=unset#image/png res/pics_link/card-pictures_a.txt svneol=native#text/plain diff --git a/res/pics/icons/Unknown.jpg b/res/pics/icons/Unknown.jpg new file mode 100644 index 00000000000..8be5956d10b Binary files /dev/null and b/res/pics/icons/Unknown.jpg differ diff --git a/res/quest/decks/quest1.dck b/res/quest/decks/quest1.dck index 2595ae05aca..8418f2b943b 100644 --- a/res/quest/decks/quest1.dck +++ b/res/quest/decks/quest1.dck @@ -1,15 +1,7 @@ [metadata] -ID=1 Name=quest1 DisplayName=Dungeon Crawling (White) -Difficulty=Medium -Description=This realm is guarded by a divine entity laying his protecting hand on each living being. -Repeatable=true -NumberWinsRequired=20 -CardReward=3 white rares -CreditsReward=100 Icon=Dungeon Crawling White.jpg -AILife=25 Deck Type=constructed Comment= [main] @@ -50,7 +42,4 @@ Comment= 1 Rebuff the Wicked 1 Retribution of the Meek 1 Sunlance -[sideboard] -[human_extra_cards] -[ai_extra_cards] -1 Divine Presence \ No newline at end of file +[sideboard] \ No newline at end of file diff --git a/res/quest/decks/quest10.dck b/res/quest/decks/quest10.dck index 47c32055eef..0db8dbd903a 100644 --- a/res/quest/decks/quest10.dck +++ b/res/quest/decks/quest10.dck @@ -1,15 +1,7 @@ [metadata] -ID=10 Name=quest10 DisplayName=Zombie Attack! -Difficulty=Hard -Description=The village of Haven is getting attacked by the Zombie horde! Protect the village. -Repeatable=false -NumberWinsRequired=40 -CardReward=4 black rares -CreditsReward=200 Icon=Zombie Attack.jpg -AILife=30 Deck Type=constructed Comment= [main] @@ -37,12 +29,4 @@ Comment= 4 Mass of Ghouls 1 Warpath Ghoul 1 Viscera Dragger -[sideboard] -[human_extra_cards] -TOKEN|W|1|1|citizen|creature -TOKEN|W|1|1|citizen|creature -TOKEN|W|1|1|citizen|creature -Wall of Spears -[ai_extra_cards] -Scathe Zombies -Mass of Ghouls \ No newline at end of file +[sideboard] \ No newline at end of file diff --git a/res/quest/decks/quest11.dck b/res/quest/decks/quest11.dck index 25c71bc3148..ed6131faa27 100644 --- a/res/quest/decks/quest11.dck +++ b/res/quest/decks/quest11.dck @@ -1,15 +1,7 @@ [metadata] -ID=11 Name=quest11 DisplayName=The King's Contest -Difficulty=Hard -Description=The king is holding a contest. You are invited to participate and compete against other legends of this era. -Repeatable=false -NumberWinsRequired=40 -CardReward=3 random rares -CreditsReward=150 Icon=The Kings Contest.jpg -AILife=30 Deck Type=constructed Comment= [main] @@ -57,8 +49,4 @@ Comment= 1 Kongming, "Sleeping Dragon" 3 Mountain 1 Tuknir Deathlock -[sideboard] -[human_extra_cards] -Seal of Cleansing -[ai_extra_cards] -Loyal Retainers \ No newline at end of file +[sideboard] \ No newline at end of file diff --git a/res/quest/decks/quest12.dck b/res/quest/decks/quest12.dck index 7cfecdba3e9..a611d8766d2 100644 --- a/res/quest/decks/quest12.dck +++ b/res/quest/decks/quest12.dck @@ -1,15 +1,7 @@ [metadata] -ID=12 Name=quest12 DisplayName=Barroom Brawl -Difficulty=Hard -Description=A drunken giant of a man takes a swing at you, your brew spills and a fight breaks out. -Repeatable=false -NumberWinsRequired=64 -CardReward=4 random rares -CreditsReward=250 Icon=Barroom Brawl.jpg -AILife=30 Deck Type=constructed Comment= [main] @@ -34,10 +26,4 @@ Comment= 1 Quietus Spike 4 Savannah 4 Wasteland -[sideboard] -[human_extra_cards] -TOKEN|W|1|1|soldier ally|creature|soldier|ally -TOKEN|W|1|1|soldier ally|creature|soldier|ally -TOKEN|W|1|1|soldier ally|creature|soldier|ally -[ai_extra_cards] -Lowland Giant \ No newline at end of file +[sideboard] \ No newline at end of file diff --git a/res/quest/decks/quest13.dck b/res/quest/decks/quest13.dck index 4f755357b46..eab9666e30d 100644 --- a/res/quest/decks/quest13.dck +++ b/res/quest/decks/quest13.dck @@ -1,15 +1,7 @@ [metadata] -ID=13 Name=quest13 DisplayName=The Court Jester -Difficulty=Hard -Description=The Court Jester pulls a prank on you. Will you laugh it off or pay him back? -Repeatable=false -NumberWinsRequired=52 -CardReward=4 multi-colored rares -CreditsReward=300 Icon=The Court Jester.jpg -AILife=30 Deck Type=constructed Comment= [main] @@ -35,8 +27,4 @@ Comment= 2 Cruel Ultimatum 1 Mox Jet 2 Mountain -[sideboard] -[human_extra_cards] -Sensei's Divining Top -[ai_extra_cards] -Teferi's Puzzle Box \ No newline at end of file +[sideboard] \ No newline at end of file diff --git a/res/quest/decks/quest14.dck b/res/quest/decks/quest14.dck index 622de5daf5d..696e32c06d1 100644 --- a/res/quest/decks/quest14.dck +++ b/res/quest/decks/quest14.dck @@ -1,15 +1,7 @@ [metadata] -ID=14 Name=quest14 DisplayName=Ancient Battlefield -Difficulty=Hard -Description=You visit an ancient battlefield at midnight. It is overgrown and dark. You trip on a root, utter a curse and wish that you could see. -Repeatable=false -NumberWinsRequired=64 -CardReward=4 random rares -CreditsReward=250 Icon=Ancient Battlefield.jpg -AILife=30 Deck Type=constructed Comment= [main] @@ -31,10 +23,4 @@ Comment= 4 Vengevine 1 Mox Jet 4 Essence Warden -[sideboard] -[human_extra_cards] -Glasses of Urza -Blight Sickle -[ai_extra_cards] -Bad Moon -Wall of Brambles \ No newline at end of file +[sideboard] \ No newline at end of file diff --git a/res/quest/decks/quest15.dck b/res/quest/decks/quest15.dck index 234a89f183f..fa8fcd70d7b 100644 --- a/res/quest/decks/quest15.dck +++ b/res/quest/decks/quest15.dck @@ -1,15 +1,7 @@ [metadata] -ID=15 Name=quest15 DisplayName=Don't Play With Matches -Difficulty=Hard -Description=The goblins are battling the elves. Those pesky elves, will they ever learn. Do not play with fire! -Repeatable=false -NumberWinsRequired=52 -CardReward=4 red rares -CreditsReward=200 Icon=Dont Play With Matches.jpg -AILife=30 Deck Type=constructed Comment= [main] @@ -32,11 +24,4 @@ Comment= 3 Keen-Eyed Archers 4 Elvish Harbinger 4 Llanowar Elves -[sideboard] -[human_extra_cards] -1 Mudbutton Torchrunner -1 Scuzzback Scrapper -[ai_extra_cards] -1 Heedless One -1 Norwood Archers -1 Wildslayer Elves \ No newline at end of file +[sideboard] \ No newline at end of file diff --git a/res/quest/decks/quest16.dck b/res/quest/decks/quest16.dck index 3209425a6f7..1c37c61e4b4 100644 --- a/res/quest/decks/quest16.dck +++ b/res/quest/decks/quest16.dck @@ -1,15 +1,7 @@ [metadata] -ID=16 Name=quest16 DisplayName=Mines of Kazum Durl -Difficulty=Hard -Description=While exploring a mine with a group of dwarves the mine caves in. You start to dig out and then realize that your group is not alone. -Repeatable=false -NumberWinsRequired=52 -CardReward=4 green rares -CreditsReward=250 Icon=Mines of Kazum Durl.jpg -AILife=30 Deck Type=constructed Comment= [main] @@ -36,15 +28,4 @@ Comment= 4 Savannah 1 Doubling Season 3 Thelonite Hermit -[sideboard] -[human_extra_cards] -Dwarven Demolition Team -Dwarven Pony -Dwarven Trader -[ai_extra_cards] -Wall of Earth -Wall of Air -Wall of Ice -Wall of Light -Carrion Wall -Steel Wall \ No newline at end of file +[sideboard] \ No newline at end of file diff --git a/res/quest/decks/quest17.dck b/res/quest/decks/quest17.dck index 9e26a1d950f..50f2436cdc3 100644 --- a/res/quest/decks/quest17.dck +++ b/res/quest/decks/quest17.dck @@ -1,15 +1,7 @@ [metadata] -ID=17 Name=quest17 DisplayName=House Party -Difficulty=Hard -Description=Your friends decide to hold a house party at your home tonight. Later that night uninvited guests show up and disrupt the party. -Repeatable=false -NumberWinsRequired=64 -CardReward=4 colorless rares -CreditsReward=250 Icon=House Party.jpg -AILife=30 Deck Type=constructed Comment= [main] @@ -36,11 +28,4 @@ Comment= 1 Mox Jet 4 Sprouting Thrinax 1 Mountain -[sideboard] -[human_extra_cards] -Hopping Automaton -Honden of Life's Web -Forbidden Orchard -[ai_extra_cards] -Honden of Infinite Rage -Mikokoro, Center of the Sea \ No newline at end of file +[sideboard] \ No newline at end of file diff --git a/res/quest/decks/quest18.dck b/res/quest/decks/quest18.dck index 8ab89db2a5b..39aba08fa3f 100644 --- a/res/quest/decks/quest18.dck +++ b/res/quest/decks/quest18.dck @@ -1,15 +1,7 @@ [metadata] -ID=18 Name=quest18 DisplayName=Crows in the Field -Difficulty=Hard -Description=Crows are eating the seed planted in the local farm fields. The farmers are scared. Those crows are big, you will need some help. -Repeatable=false -NumberWinsRequired=64 -CardReward=5 random rares -CreditsReward=300 Icon=Crows in the Field.jpg -AILife=30 Deck Type=constructed Comment= [main] @@ -33,13 +25,4 @@ Comment= 4 Noble Hierarch 4 Savannah 2 Eldrazi Conscription -[sideboard] -[human_extra_cards] -Straw Soldiers -Femeref Archers -Moonglove Extract -[ai_extra_cards] -Defiant Falcon -Soulcatcher -Storm Crow -Hypnotic Specter \ No newline at end of file +[sideboard] \ No newline at end of file diff --git a/res/quest/decks/quest19.dck b/res/quest/decks/quest19.dck index ad1d425ec45..6a2597965fa 100644 --- a/res/quest/decks/quest19.dck +++ b/res/quest/decks/quest19.dck @@ -1,15 +1,7 @@ [metadata] -ID=19 Name=quest19 DisplayName=The Desert Caravan -Difficulty=Hard -Description=A caravan is transporting silk across the desert. While setting up camp for the night you are attacked by thieves. Defend yourself. -Repeatable=false -NumberWinsRequired=80 -CardReward=5 random rares -CreditsReward=300 Icon=The Desert Caravan.jpg -AILife=30 Deck Type=constructed Comment= [main] @@ -30,10 +22,4 @@ Comment= 1 Mox Pearl 4 Eladamri's Call 4 Savannah -[sideboard] -[human_extra_cards] -Spidersilk Net -Dromad Purebred -[ai_extra_cards] -4 Ambush Party -Gnat Alley Creeper +[sideboard] \ No newline at end of file diff --git a/res/quest/decks/quest2.dck b/res/quest/decks/quest2.dck index c441c50006c..3c7b60ad674 100644 --- a/res/quest/decks/quest2.dck +++ b/res/quest/decks/quest2.dck @@ -1,15 +1,7 @@ [metadata] -ID=2 Name=quest2 DisplayName=Dungeon Crawling (Blue) -Difficulty=Medium -Description=This realm holds knowledge so vast it can overburden the unwary. -Repeatable=true -NumberWinsRequired=20 -CardReward=3 blue rares -CreditsReward=100 Icon=Dungeon Crawling Blue.jpg -AILife=25 Deck Type=constructed Comment= [main] @@ -37,8 +29,4 @@ Comment= 1 Merfolk of the Pearl Trident 1 Fugitive Wizard 1 Grayscaled Gharial -[sideboard] -[human_extra_cards] -1 Quest for Ancient Secrets -[ai_extra_cards] -1 Forced Fruition \ No newline at end of file +[sideboard] \ No newline at end of file diff --git a/res/quest/decks/quest20.dck b/res/quest/decks/quest20.dck index 760b796215e..7b787c1db41 100644 --- a/res/quest/decks/quest20.dck +++ b/res/quest/decks/quest20.dck @@ -1,15 +1,7 @@ [metadata] -ID=20 Name=quest20 DisplayName=Blood Oath -Difficulty=Hard -Description=A druid saves your life and the two of you take a blood oath. It is now time to fulfill your oath. -Repeatable=false -NumberWinsRequired=80 -CardReward=5 colorless rares -CreditsReward=300 Icon=Blood Oath.jpg -AILife=30 Deck Type=constructed Comment= [main] @@ -42,12 +34,4 @@ Comment= 4 Counterspell 1 Thoughtseize 1 Emrakul, the Aeons Torn -[sideboard] -[human_extra_cards] -Counterbalance -Hatching Plans -Ley Druid -[ai_extra_cards] -Ior Ruin Expedition -Oversold Cemetery -Trapjaw Kelpie \ No newline at end of file +[sideboard] \ No newline at end of file diff --git a/res/quest/decks/quest21.dck b/res/quest/decks/quest21.dck index ebd53ee54d2..2b042fed2e2 100644 --- a/res/quest/decks/quest21.dck +++ b/res/quest/decks/quest21.dck @@ -1,15 +1,7 @@ [metadata] -ID=21 Name=quest21 DisplayName=Private Domain -Difficulty=Expert -Description=During your travels, you accidentally stumble upon the domain of an evil, powerful wizard. A fight to the death ensues. -Repeatable=false -NumberWinsRequired=96 -CardReward=6 random rares -CreditsReward=500 Icon=Private Domain.jpg -AILife=50 Deck Type=constructed Comment= [main] @@ -39,12 +31,4 @@ Comment= 1 Legacy Weapon 1 Mountain 2 Wandering Stream -[sideboard] -[human_extra_cards] -Strip Mine -[ai_extra_cards] -Plains -Island -Mountain -Swamp -Forest +[sideboard] \ No newline at end of file diff --git a/res/quest/decks/quest22.dck b/res/quest/decks/quest22.dck index e33e6b1fca7..bf9bd0da26f 100644 --- a/res/quest/decks/quest22.dck +++ b/res/quest/decks/quest22.dck @@ -1,15 +1,7 @@ [metadata] -ID=22 Name=quest22 DisplayName=The Pied Piper -Difficulty=Hard -Description=A mysterious man threatens to flood the land with a relentless stream of hungry rats. Cross his plan before it's too late. -Repeatable=false -NumberWinsRequired=32 -CardReward=3 random rares -CreditsReward=150 Icon=The Pied Piper.jpg -AILife=30 Deck Type=constructed Comment= [main] @@ -22,12 +14,4 @@ Comment= 1 Mystical Tutor 4 Thrumming Stone 29 Relentless Rats -[sideboard] -[human_extra_cards] -1 Volunteer Militia -1 Land Tax -1 Elvish Farmer -1 An-Havva Township -[ai_extra_cards] -1 Darksteel Citadel -1 Relentless Rats \ No newline at end of file +[sideboard] \ No newline at end of file diff --git a/res/quest/decks/quest3.dck b/res/quest/decks/quest3.dck index f331c0864f2..026e82e9ea6 100644 --- a/res/quest/decks/quest3.dck +++ b/res/quest/decks/quest3.dck @@ -1,15 +1,7 @@ [metadata] -ID=3 Name=quest3 DisplayName=Dungeon Crawling (Black) -Difficulty=Medium -Description=Guarded by black creatures. -Repeatable=true -NumberWinsRequired=20 -CardReward=3 black rares -CreditsReward=100 Icon=Dungeon Crawling Black.jpg -AILife=25 Deck Type=constructed Comment= [main] @@ -40,7 +32,4 @@ Comment= 2 Pennon Blade 1 Beacon of Unrest 1 Zombify -[sideboard] -[human_extra_cards] -[ai_extra_cards] -Infernal Genesis \ No newline at end of file +[sideboard] \ No newline at end of file diff --git a/res/quest/decks/quest4.dck b/res/quest/decks/quest4.dck index 06a93cc8478..d2c85543025 100644 --- a/res/quest/decks/quest4.dck +++ b/res/quest/decks/quest4.dck @@ -1,15 +1,7 @@ [metadata] -ID=4 Name=quest4 DisplayName=Dungeon Crawling (Red) -Difficulty=Medium -Description=Guarded by red creatures. -Repeatable=true -NumberWinsRequired=20 -CardReward=3 red rares -CreditsReward=100 Icon=Dungeon Crawling Red.jpg -AILife=25 Deck Type=constructed Comment= [main] @@ -95,7 +87,4 @@ Comment= 1 Sudden Shock 1 Tarfire 1 Volcanic Hammer -[sideboard] -[human_extra_cards] -[ai_extra_cards] -Furnace of Rath \ No newline at end of file +[sideboard] \ No newline at end of file diff --git a/res/quest/decks/quest5.dck b/res/quest/decks/quest5.dck index 81b8e7b65ad..55f73df2614 100644 --- a/res/quest/decks/quest5.dck +++ b/res/quest/decks/quest5.dck @@ -1,15 +1,7 @@ [metadata] -ID=5 Name=quest5 DisplayName=Dungeon Crawling (Green) -Difficulty=Medium -Description=Guarded by green creatures. -Repeatable=true -NumberWinsRequired=20 -CardReward=3 green rares -CreditsReward=100 Icon=Dungeon Crawling Green.jpg -AILife=25 Deck Type=constructed Comment= [main] @@ -75,9 +67,4 @@ Comment= 1 Whiptail Wurm 1 Woodfall Primus 1 Yavimaya Wurm -[sideboard] -[human_extra_cards] -Defense of the Heart -[ai_extra_cards] -Eladamri's Vineyard -Upwelling \ No newline at end of file +[sideboard] \ No newline at end of file diff --git a/res/quest/decks/quest6.dck b/res/quest/decks/quest6.dck index 76242092e62..23331c4af1e 100644 --- a/res/quest/decks/quest6.dck +++ b/res/quest/decks/quest6.dck @@ -1,15 +1,7 @@ [metadata] -ID=6 Name=quest6 DisplayName=Dungeon Crawling (Colorless) -Difficulty=Hard -Description=The inhabitants of this plane tread with a light step. -Repeatable=true -NumberWinsRequired=28 -CardReward=3 colorless rares -CreditsReward=150 Icon=Dungeon Crawling Colorless.jpg -AILife=30 Deck Type=constructed Comment= [main] @@ -84,7 +76,4 @@ Comment= 1 Waning Wurm 1 Whipstitched Zombie 1 Yawgmoth Demon -[sideboard] -[human_extra_cards] -[ai_extra_cards] -3 Eon Hub \ No newline at end of file +[sideboard] \ No newline at end of file diff --git a/res/quest/decks/quest7.dck b/res/quest/decks/quest7.dck index 2fc207e569e..6adea039ddc 100644 --- a/res/quest/decks/quest7.dck +++ b/res/quest/decks/quest7.dck @@ -1,15 +1,7 @@ [metadata] -ID=7 Name=quest7 DisplayName=Dungeon Crawling (Gold) -Difficulty=Hard -Description=Guarded by gold creatures. -Repeatable=true -NumberWinsRequired=28 -CardReward=3 multi-colored rares -CreditsReward=150 Icon=Dungeon Crawling Gold.jpg -AILife=30 Deck Type=constructed Comment= [main] @@ -47,7 +39,4 @@ Comment= 2 Dragon Arch 1 Conflux 1 Maelstrom Nexus -[sideboard] -[human_extra_cards] -[ai_extra_cards] -Darksteel Ingot \ No newline at end of file +[sideboard] \ No newline at end of file diff --git a/res/quest/decks/quest8.dck b/res/quest/decks/quest8.dck index 8bab6103fc9..7580ece4d21 100644 --- a/res/quest/decks/quest8.dck +++ b/res/quest/decks/quest8.dck @@ -1,15 +1,7 @@ [metadata] -ID=8 Name=quest8 DisplayName=A Wolf in Sheep's Clothing -Difficulty=Medium -Description=The local sheep farm is under attack by a pack of wolves. Kill the wolves, save the sheep! -Repeatable=false -NumberWinsRequired=28 -CardReward=3 random rares -CreditsReward=200 Icon=A Wolf in Sheeps Clothing.jpg -AILife=25 Deck Type=constructed Comment= [main] @@ -30,9 +22,4 @@ Comment= 1 Bestial Menace 4 Tundra Wolves 4 Savannah -[sideboard] -[human_extra_cards] -TOKEN|G|0|1|sheep|creature|sheep -TOKEN|G|0|1|sheep|creature|sheep -TOKEN|G|0|1|sheep|creature|sheep -[ai_extra_cards] \ No newline at end of file +[sideboard] \ No newline at end of file diff --git a/res/quest/decks/quest9.dck b/res/quest/decks/quest9.dck index 6916e106766..d0fa2ccf681 100644 --- a/res/quest/decks/quest9.dck +++ b/res/quest/decks/quest9.dck @@ -1,15 +1,7 @@ [metadata] -ID=9 Name=quest9 DisplayName=Bushwhacked! -Difficulty=Hard -Description=You find yourself surrounded by carnivorous plants and poisonous vines. Cut your way out of this foresty mess and make it home safe. -Repeatable=false -NumberWinsRequired=40 -CardReward=4 green rares -CreditsReward=225 Icon=Bushwhacked.jpg -AILife=30 Deck Type=constructed Comment= [main] @@ -31,8 +23,4 @@ Comment= 4 Wall of Blossoms 4 Vine Trellis 1 Overbeing of Myth -[sideboard] -[human_extra_cards] -Trusty Machete -[ai_extra_cards] -3 Wall of Wood \ No newline at end of file +[sideboard] \ No newline at end of file diff --git a/res/quest/quests.txt b/res/quest/quests.txt index 97aaf6a261e..74873c6ed41 100644 --- a/res/quest/quests.txt +++ b/res/quest/quests.txt @@ -1,221 +1,315 @@ -1 -Dungeon Crawling (White) -This realm is guarded by a divine entity laying his protecting hand on each living being. -Medium -Repeatable -20 -Three white rares -100 -Dungeon Crawling White.jpg +Notes +- A [quest] line triggers a new quest object. +- Properties can be in any order +- IDs are mandatory, and must be sequential. +- Any other property, if empty, will use a default value. +- Both AI and human can have extra legal cards and/or tokens at match start. -2 -Dungeon Crawling (Blue) -This realm holds knowledge so vast it can overburden the unwary. -Medium -Repeatable -20 -Three blue rares -100 -Dungeon Crawling Blue.jpg +[quest] +id=1 +Icon=Dungeon Crawling White.jpg +Title=Dungeon Crawling (White) +Desc=This realm is guarded by a divine entity laying his protecting hand on each living being. +Diff=Medium +AILife=25 +Repeat=true +Wins=20 +Card Reward=3 white rares +Credit Reward=100 +HumanExtras= +AIExtras=Divine Presence -3 -Dungeon Crawling (Black) -Guarded by black creatures. -Medium -Repeatable -20 -Three black rares -100 -Dungeon Crawling Black.jpg +[quest] +id=2 +Icon=Dungeon Crawling Blue.jpg +Title=Dungeon Crawling (Blue) +Desc=This realm holds knowledge so vast it can overburden the unwary. +Diff=Medium +AILife=25 +Repeat=true +Wins=20 +Card Reward=3 blue rares +Credit Reward=100 +HumanExtras=Quest for Ancient Secrets +AIExtras=Forced Fruition -4 -Dungeon Crawling (Red) -Guarded by red creatures. -Medium -Repeatable -20 -Three red rares -100 -Dungeon Crawling Red.jpg +[quest] +id=3 +Icon=Dungeon Crawling Black.jpg +Title=Dungeon Crawling (Black) +Desc=The dead cannot be silenced, and want you to join their ranks. +Diff=Medium +AILife=25 +Repeat=true +Wins=20 +Card Reward=3 black rares +Credit Reward=100 +HumanExtras= +AIExtras=Infernal Genesis -5 -Dungeon Crawling (Green) -Guarded by green creatures. -Medium -Repeatable -20 -Three green rares -100 -Dungeon Crawling Green.jpg +[quest] +id=4 +Icon=Dungeon Crawling Red.jpg +Title=Dungeon Crawling (Red) +Desc=Untold treasure awaits you, should you successfully dodge the lightning and lava. +Diff=Medium +AILife=25 +Repeat=true +Wins=20 +Card Reward=3 red rares +Credit Reward=100 +HumanExtras= +AIExtras=Furnace of Rath -6 -Dungeon Crawling (Colorless) -The inhabitants of this plane tread with a light step. -Hard -Repeatable -28 -Three colorless rares -150 -Dungeon Crawling Colorless.jpg +[quest] +id=5 +Icon=Dungeon Crawling Green.jpg +Title=Dungeon Crawling (Green) +Desc=Gnarled, twisting, sinister growths slowly rend the walls in twain and try to silence all who cross their path. +Diff=Medium +AILife=25 +Repeat=true +Wins=20 +Card Reward=3 green rares +Credit Reward=100 +HumanExtras=Defense of the Heart +AIExtras=Eladamri's Vineyard|Upwelling -7 -Dungeon Crawling (Gold) -Guarded by gold creatures. -Hard -Repeatable -28 -Three multi-colored rares -150 -Dungeon Crawling Gold.jpg +[quest] +id=6 +Icon=Dungeon Crawling Colorless.jpg +Title=Dungeon Crawling (Colorless) +Desc=The inhabitants of this plane tread with a light step. +Diff=Hard +AILife=30 +Repeat=true +Wins=28 +Card Reward=3 colorless rares +Credit Reward=150 +HumanExtras= +AIExtras=Eon Hub|Eon Hub|Eon Hub -8 -A Wolf in Sheep's Clothing -The local sheep farm is under attack by a pack of wolves. Kill the wolves, save the sheep! -Medium -Not Repeatable -28 -Three random rares -200 -A Wolf in Sheeps Clothing.jpg +[quest] +id=7 +Icon=Dungeon Crawling Gold.jpg +Title=Dungeon Crawling (Gold) +Desc=Clever sorcerers draw energy from countless sources - can you outwit them? +Diff=Hard +AILife=30 +Repeat=true +Wins=28 +Card Reward=3 multi-colored rares +Credit Reward=150 +HumanExtras= +AIExtras=Darksteel Ingot -9 -Bushwhacked! -You find yourself surrounded by carnivorous plants and poisonous vines. Cut your way out of this foresty mess and make it home safe. -Hard -Not Repeatable -40 -Four green rares -225 -Bushwhacked.jpg +[quest] +id=8 +Icon=A Wolf in Sheeps Clothing.jpg +Title=A Wolf in Sheep's Clothing +Desc=The local sheep farm is under attack by a pack of wolves. Kill the wolves, save the sheep! +Diff=Medium +AILife=25 +Repeat=false +Wins=28 +Card Reward=3 random rares +Credit Reward=200 +HumanExtras=TOKEN;G;0;1;Sheep;Creature;Sheep|TOKEN;G;0;1;Sheep;Creature;Sheep|TOKEN;G;0;1;Sheep;Creature;Sheep +AIExtras= -10 -Zombie Attack! -The village of Haven is getting attacked by the Zombie horde! Protect the village. -Hard -Not Repeatable -40 -Four black rares -200 -Zombie Attack.jpg +[quest] +id=9 +Icon=Bushwhacked.jpg +Title=Bushwhacked! +Desc=You find yourself surrounded by carnivorous plants and poisonous vines. Cut your way out of this foresty mess and make it home safe. +Diff=Hard +AILife=30 +Repeat=false +Wins=40 +Card Reward=4 green rares +Credit Reward=225 +HumanExtras=Trusty Machete +AIExtras=Wall of Wood|Wall of Wood|Wall of Wood -11 -The King's Contest -The king is holding a contest. You are invited to participate and compete against other legends of this era. -Hard -Not Repeatable -40 -Three random rares -150 -The Kings Contest.jpg +[quest] +id=10 +Icon=Zombie Attack.jpg +Title=Zombie Attack! +Desc=The village of Haven is getting attacked by the Zombie horde! Protect the village. +Diff=Hard +AILife=30 +Repeat=false +Wins=40 +Card Reward=4 black rares +Credit Reward=200 +HumanExtras=TOKEN;W;1;1;Citizen;Creature|TOKEN;W;1;1;Citizen;Creature|TOKEN;W;1;1;Citizen;Creature|Wall of Spears +AIExtras=Scathe Zombies|Mass of Ghouls -12 -Barroom Brawl -A drunken giant of a man takes a swing at you, your brew spills and a fight breaks out. -Hard -Not Repeatable -64 -Four random rares -250 -Barroom Brawl.jpg +[quest] +id=11 +Icon=The Kings Contest.jpg +Title=The King's Contest +Desc=The king is holding a contest. You are invited to participate and compete against other legends of this era. +Diff=Hard +AILife=30 +Repeat=false +Wins=40 +Card Reward=3 random rares +Credit Reward=150 +HumanExtras=Seal of Cleansing +AIExtras=Loyal Retainers -13 -The Court Jester -The Court Jester pulls a prank on you. Will you laugh it off or pay him back? -Hard -Not Repeatable -52 -Four multi-colored rares -300 -The Court Jester.jpg +[quest] +id=12 +Icon=Barroom Brawl.jpg +Title=Barroom Brawl +Desc=A drunken giant of a man takes a swing at you, your brew spills and a fight breaks out. +Diff=Hard +AILife=30 +Repeat=false +Wins=64 +Card Reward=4 random rares +Credit Reward=250 +HumanExtras=TOKEN;W;1;1;Soldier Ally;Creature;Soldier;Ally|TOKEN;W;1;1;Soldier Ally;Creature;Soldier;Ally|TOKEN;W;1;1;Soldier Ally;Creature;Soldier;Ally +AIExtras=Lowland Giant -14 -Ancient Battlefield -You visit an ancient battlefield at midnight. It is overgrown and dark. You trip on a root, utter a curse and wish that you could see. -Hard -Not Repeatable -64 -Four random rares -250 -Ancient Battlefield.jpg +[quest] +id=13 +Icon=The Court Jester.jpg +Title=The Court Jester +Desc=The Court Jester pulls a prank on you. Will you laugh it off or pay him back? +Diff=Hard +AILife=30 +Repeat=false +Wins=52 +Card Reward=4 multi-colored rares +Credit Reward=300 +HumanExtras=Sensei's Divining Top +AIExtras=Teferi's Puzzle Box -15 -Don't Play With Matches -The goblins are battling the elves. Those pesky elves, will they ever learn. Do not play with fire! -Hard -Not Repeatable -52 -Four red rares -200 -Dont Play With Matches.jpg +[quest] +id=14 +Title=Ancient Battlefield +Desc=You visit an ancient battlefield at midnight. It is overgrown and dark. You trip on a root, utter a curse and wish that you could see. +Diff=Hard +AILife=30 +Repeat=false +Wins=64 +Card Reward=4 random rares +Credit Reward=250 +Icon=Ancient Battlefield.jpg +HumanExtras=Glasses of Urza|Blight Sickle +AIExtras=Bad Moon|Wall of Brambles -16 -Mines of Kazum Durl -While exploring a mine with a group of dwarves the mine caves in. You start to dig out and then realize that your group is not alone. -Hard -Not Repeatable -52 -Four green rares -250 -Mines of Kazum Durl.jpg +[quest] +id=15 +Title=Don't Play With Matches +Desc=The goblins are battling the elves. Those pesky elves, will they ever learn. Do not play with fire! +Diff=Hard +AILife=30 +Repeat=false +Wins=52 +Card Reward=4 red rares +Credit Reward=200 +Icon=Dont Play With Matches.jpg +HumanExtras=Mudbutton Torchrunner|Scuzzback Scrapper +AIExtras=Heedless One|Norwood Archers|Wildslayer Elves -17 -House Party -Your friends decide to hold a house party at your home tonight. Later that night uninvited guests show up and disrupt the party. -Hard -Not Repeatable -64 -Four colorless rares -250 -House Party.jpg +[quest] +id=16 +Title=Mines of Kazum Durl +Desc=While exploring a mine with a group of dwarves the mine caves in. You start to dig out and then realize that your group is not alone. +Diff=Hard +AILife=30 +Repeat=false +Wins=52 +Card Reward=4 green rares +Credit Reward=250 +Icon=Mines of Kazum Durl.jpg +HumanExtras=Dwarven Demolition Team|Dwarven Pony|Dwarven Trader +AIExtras=Wall of Earth|Wall of Air|Wall of Ice|Wall of Light|Carrion Wall|Steel Wall -18 -Crows in the Field -Crows are eating the seed planted in the local farm fields. The farmers are scared. Those crows are big, you will need some help. -Hard -Not Repeatable -64 -Five random rares -300 -Crows in the Field.jpg +[quest] +id=17 +Title=House Party +Desc=Your friends decide to hold a house party at your home tonight. Later that night uninvited guests show up and disrupt the party. +Diff=Hard +AILife=30 +Repeat=false +Wins=64 +Card Reward=4 colorless rares +Credit Reward=250 +Icon=House Party.jpg +HumanExtras=Hopping Automaton|Honden of Life's Web|Forbidden Orchard +AIExtras=Honden of Infinite Rage|Mikokoro, Center of the Sea -19 -The Desert Caravan -A caravan is transporting silk across the desert. While setting up camp for the night you are attacked by thieves. Defend yourself. -Hard -Not Repeatable -80 -Five random rares -300 -The Desert Caravan.jpg +[quest] +id=18 +Title=Crows in the Field +Desc=Crows are eating the seed planted in the local farm fields. The farmers are scared. Those crows are big, you will need some help. +Diff=Hard +AILife=30 +Repeat=false +Wins=64 +Card Reward=5 random rares +Credit Reward=300 +Icon=Crows in the Field.jpg +HumanExtras=Straw Soldiers|Femeref Archers|Moonglove Extract +AIExtras=Defiant Falcon|Soulcatcher|Storm Crow|Hypnotic Specter -20 -Blood Oath -A druid saves your life and the two of you take a blood oath. It is now time to fulfill your oath. -Hard -Not Repeatable -80 -Five colorless rares -300 -Blood Oath.jpg +[quest] +id=19 +Title=The Desert Caravan +Desc=A caravan is transporting silk across the desert. While setting up camp for the night you are attacked by thieves. Defend yourself. +Diff=Hard +AILife=30 +Repeat=false +Wins=80 +Card Reward=5 random rares +Credit Reward=300 +Icon=The Desert Caravan.jpg +HumanExtras=Spidersilk Net|Dromad Purebred +AIExtras=Ambush Party|Ambush Party|Ambush Party|Ambush Party|Gnat Alley Creeper -21 -Private Domain -During your travels, you accidentally stumble upon the domain of an evil, powerful wizard. A fight to the death ensues. -Expert -Not Repeatable -96 -Six random rares -500 -Private Domain.jpg -22 -The Pied Piper -A mysterious man threatens to flood the land with a relentless stream of hungry rats. Cross his plan before it's too late. -Hard -Not Repeatable -32 -three random rares -150 -The Pied Piper.jpg +[quest] +id=20 +Title=Blood Oath +Desc=A druid saves your life and the two of you take a blood oath. It is now time to fulfill your oath. +Diff=Hard +AILife=30 +Repeat=false +Wins=80 +Card Reward=5 colorless rares +Credit Reward=300 +Icon=Blood Oath.jpg +HumanExtras=Counterbalance|Hatching Plans|Ley Druid +AIExtras=Ior Ruin Expedition|Oversold Cemetery|Trapjaw Kelpie -End \ No newline at end of file +[quest] +id=21 +Title=Private Domain +Desc=During your travels, you accidentally stumble upon the domain of an evil, powerful wizard. A fight to the death ensues. +Diff=Expert +AILife=50 +Repeat=false +Wins=96 +Card Reward=6 random rares +Credit Reward=500 +Icon=Private Domain.jpg +HumanExtras=Strip Mine +AIExtras=Plains|Island|Mountain|Swamp|Forest + +[quest] +id=22 +Title=The Pied Piper +Desc=A mysterious man threatens to flood the land with a relentless stream of hungry rats. Cross his plan before it's too late. +Diff=Hard +AILife=30 +Repeat=false +Wins=32 +Card Reward=3 random rares +Credit Reward=150 +Icon=The Pied Piper.jpg +HumanExtras=Volunteer Militia|Land Tax|Elvish Farmer|An-Havva Township +AIExtras=Darksteel Citadel|Relentless Rats \ No newline at end of file diff --git a/src/main/java/forge/Quest_Assignment.java b/src/main/java/forge/Quest_Assignment.java index 1b8f04e1c54..3234301f9b0 100644 --- a/src/main/java/forge/Quest_Assignment.java +++ b/src/main/java/forge/Quest_Assignment.java @@ -11,25 +11,25 @@ import forge.card.CardPrinted; * @version $Id$ */ public class Quest_Assignment { - private int id; - private int requiredNumberWins; - private int computerLife; - - private long creditsReward; - - private String name; - private String desc; - private String difficulty; - private String cardReward; - private String iconName; - - private boolean repeatable; - - private ArrayList cardRewardList = new ArrayList(); - - private CardList human = new CardList(); - private ArrayList compy = new ArrayList(); + // ID (default -1, should be explicitly set at later time.) + private int id = -1; + + // Default vals if none provided for this ID in quests.txt. + private int requiredNumberWins = 20; + private int computerLife = 25; + private long creditsReward = 100; + private String name = "Mystery Quest"; + private String desc = ""; + private String difficulty = "Medium"; + private String cardReward = "1 colorless rare"; + private String iconName = "Unknown.jpg"; + private boolean repeatable = false; + // Other cards used in assignment: starting, and reward. + private CardList humanExtraCards = new CardList(); + private CardList aiExtraCards = new CardList(); + private ArrayList cardRewardList = new ArrayList(); + /** *

Setter for the field id.

* @@ -211,58 +211,50 @@ public class Quest_Assignment { } /** - *

Setter for the field human.

+ *

Setter for the field humanExtraCards.

* - * @param humanIn a {@link forge.CardList} object. + * @param s a CardList object. */ - public final void setHuman(final CardList humanIn) { - this.human = humanIn; + public final void setHumanExtraCards(final CardList cl) { + this.humanExtraCards = cl; } - + /** - *

Getter for the field human.

+ *

Getter for the field humanExtraCards.

* * @return a {@link forge.CardList} object. */ - public final CardList getHuman() { - return human; + public final CardList getHumanExtraCards() { + return humanExtraCards; } /** - *

addCompy.

+ *

Setter for the field aiExtraCards.

* - * @param s a {@link java.lang.String} object. + * @param s a CardList object. */ - public final void addCompy(final String s) { - this.compy.add(s); + public final void setAIExtraCards(final CardList cl) { + this.aiExtraCards = cl; } - - /** - *

clearCompy.

- */ - public final void clearCompy() { - this.compy.clear(); - } - - + /** *

Getter for the field compy.

* * @return a {@link java.util.ArrayList} object. */ - public final ArrayList getCompy() { - return compy; + public final CardList getAIExtraCards() { + return aiExtraCards; } /** *

Setter for the field cardRewardList.

* - * @param cardRewardListIn a {@link java.util.ArrayList} object. + * @return a {@link java.util.ArrayList} object. */ - public final void setCardRewardList(final ArrayList cardRewardListIn) { - this.cardRewardList = cardRewardListIn; + public void setCardRewardList(final ArrayList cp) { + this.cardRewardList = cp; } - + /** *

Getter for the field cardRewardList.

* @@ -271,4 +263,5 @@ public class Quest_Assignment { public final ArrayList getCardRewardList() { return cardRewardList; } + } diff --git a/src/main/java/forge/ReadQuest_Assignment.java b/src/main/java/forge/ReadQuest_Assignment.java index 36052280111..a8d70f1acfc 100644 --- a/src/main/java/forge/ReadQuest_Assignment.java +++ b/src/main/java/forge/ReadQuest_Assignment.java @@ -2,14 +2,15 @@ package forge; import forge.error.ErrorViewer; import forge.properties.NewConstants; +import forge.quest.data.QuestUtil; import java.io.BufferedReader; import java.io.File; import java.io.FileReader; +import java.io.IOException; import java.util.ArrayList; import java.util.List; - /** *

ReadQuest_Assignment class.

* @@ -17,60 +18,31 @@ import java.util.List; * @version $Id$ */ public class ReadQuest_Assignment implements Runnable, NewConstants { - private BufferedReader in; - ArrayList allQuests = new ArrayList(); + + ArrayList allQuests = new ArrayList(); + private ArrayList ids = new ArrayList(); - private int totalWins; - private List completedQuests = new ArrayList(); - - /** - *

getQuests.

- * - * @return a {@link java.util.List} object. - */ - public List getQuests() { - return new ArrayList(allQuests); - } - - /** - *

getQuestsByIds.

- * - * @param availableQuestIds a {@link java.util.List} object. - * @return a {@link java.util.List} object. - */ - public List getQuestsByIds(List availableQuestIds) { - List quests = new ArrayList(); - - for (Quest_Assignment qa : allQuests) { - if (availableQuestIds.contains(qa.getId())) - quests.add(qa); - } - - return quests; - } - - /** - *

getQuestById.

- * - * @param i a int. - * @return a {@link forge.Quest_Assignment} object. - */ - public Quest_Assignment getQuestById(int i) { - for (Quest_Assignment qa : allQuests) { - if (qa.getId() == i) - return qa; - } - return null; - } - - /* - public Quest_Assignment getQuestById(int id) { - return allQuests.get(id); - } - */ + private BufferedReader br; + private int totalWins; + private List completedQuests = new ArrayList(); + + // Constants, tied to properties in the quests.txt file. + private static final String ID = "id"; + private static final String ICON = "Icon"; + private static final String TITLE = "Title"; + private static final String DESC = "Desc"; + private static final String DIFF = "Diff"; + private static final String AILIFE = "AILife"; + private static final String REPEAT = "Repeat"; + private static final String WINS = "Wins"; + private static final String CARDS = "Card Reward"; + private static final String CREDITS = "Credit Reward"; + private static final String HUMANEXTRAS = "HumanExtras"; + private static final String AIEXTRAS = "AIExtras"; /** *

Constructor for ReadQuest_Assignment.

+ * Sets parameters for available quests and prepares buffered reader for quests.txt. * * @param filename a {@link java.lang.String} object. * @param questData a {@link forge.quest.data.QuestData} object. @@ -81,128 +53,226 @@ public class ReadQuest_Assignment implements Runnable, NewConstants { /** *

Constructor for ReadQuest_Assignment.

+ * Sets parameters for available quests and prepares buffered reader for quests.txt. * * @param file a {@link java.io.File} object. * @param questData a {@link forge.quest.data.QuestData} object. */ public ReadQuest_Assignment(File file, forge.quest.data.QuestData questData) { - if (questData != null) { totalWins = questData.getWin(); - if (questData.getCompletedQuests() != null) + if (questData.getCompletedQuests() != null) { completedQuests = questData.getCompletedQuests(); - else + } + else { completedQuests = new ArrayList(); + } } - if (!file.exists()) - throw new RuntimeException("ReadQuest_Assignment : constructor error -- file not found -- filename is " - + file.getAbsolutePath()); - - //makes the checked exception, into an unchecked runtime exception try { - in = new BufferedReader(new FileReader(file)); + br = new BufferedReader(new FileReader(file)); } catch (Exception ex) { ErrorViewer.showError(ex, "File \"%s\" not found", file.getAbsolutePath()); - throw new RuntimeException("ReadQuest_Assignment : constructor error -- file not found -- filename is " - + file.getPath()); + throw new RuntimeException("ReadQuest_Assignment > constructor error: "+ + "BufferedReader failed, '"+file.getAbsolutePath()+"' not found."); } - }//ReadCard() + } // ReadQuest_Assignment() + + /** + *

getQuests.

+ * Returns list of currently available quest objects. + * + * @return a {@link java.util.List} object. + */ + public List getQuests() { + ArrayList availableQuests = new ArrayList(); + + for(Quest_Assignment qa : allQuests) { + if (qa.getRequiredNumberWins() <= totalWins && !completedQuests.contains(qa.getId())) { + availableQuests.add(qa); + } + } + + return availableQuests; + } + + /** + *

getQuests.

+ * Returns complete list of all quest objects. + * + * @return a {@link java.util.List} object. + */ + public List getAllQuests() { + return allQuests; + } - /* id - * name - * desc - * difficulty - * repeatable - * numberWinsRequired - * cardReward - * creditsReward - */ + /** + *

getQuestsByIds.

+ * + * @param availableQuestIds a {@link java.util.List} object. + * @return a {@link java.util.List} object. + */ + public List getQuestsByIds(List availableQuestIds) { + List q = new ArrayList(); + + for (Quest_Assignment qa : allQuests) { + if (availableQuestIds.contains(qa.getId())) { + q.add(qa); + } + } + + return q; + } + + /** + *

getQuestById.

+ * + * @param i a int. + * @return a {@link forge.Quest_Assignment} object. + */ + public Quest_Assignment getQuestById(int id) { + // Error handling for OOB ID? + return allQuests.get(id); + } /** *

run.

+ * Assembles Quest_Assignment instances into allQuests. */ public void run() { - Quest_Assignment qa; - String s = readLine(); - ArrayList ids = new ArrayList(); - - while (!s.equals("End")) { - qa = new Quest_Assignment(); - if (s.equals("")) throw new RuntimeException("ReadQuest_Assignment : run() reading error, id is blank"); - int id = Integer.parseInt(s); - qa.setId(id); - - s = readLine(); - qa.setName(s); - - s = readLine(); - qa.setDesc(s); - - - s = readLine(); - qa.setDifficulty(s); - if (qa.getDifficulty().equals("Medium")) - qa.setComputerLife(25); - else if (qa.getDifficulty().equals("Hard")) - qa.setComputerLife(30); - else if (qa.getDifficulty().equals("Very Hard")) - qa.setComputerLife(35); - else if (qa.getDifficulty().equals("Expert")) - qa.setComputerLife(50); - else if (qa.getDifficulty().equals("Insane")) - qa.setComputerLife(100); - - s = readLine(); - qa.setRepeatable(s.equals("Repeatable")); - - s = readLine(); - int wins = Integer.valueOf(s); - qa.setRequiredNumberWins(wins); - - s = readLine(); - qa.setCardReward(s); - - s = readLine(); - long reward = Long.parseLong(s.trim()); - qa.setCreditsReward(reward); - - s = readLine(); - qa.setIconName(s); - - //s = readLine(); - s = readLine(); - - if (ids.contains(qa.getId())) { - System.out.println("ReadQuest_Assignment:run() error - duplicate card name: " + qa.getId()); - throw new RuntimeException("ReadQuest_Assignment:run() error - duplicate card name: " + qa.getId()); - } - - ids.add(qa.getId()); - if (qa.getRequiredNumberWins() <= totalWins && !completedQuests.contains(qa.getId())) { - forge.quest.data.QuestUtil.setupQuest(qa); - allQuests.add(qa); - } - - //id: - s = readLine(); - } - }//run() - - /** - *

readLine.

- * - * @return a {@link java.lang.String} object. - */ - private String readLine() { - //makes the checked exception, into an unchecked runtime exception + Quest_Assignment qa = null; + String line; + int i; + String[] linedata; + try { - String s = in.readLine(); - if (s != null) s = s.trim(); - return s; - } catch (Exception ex) { - ErrorViewer.showError(ex); - throw new RuntimeException("ReadQuest_Assignment: readLine(Quest_Assignment) error"); + while ((line = br.readLine()) != null) { + if(line.equals("[quest]")) { + qa = new Quest_Assignment(); + allQuests.add(qa); + } + else if(!line.equals("") && qa != null) { + linedata = line.split("=", 2); + linedata[1] = linedata[1].trim(); + + // If empty data, ignore the line (assignment will use default). + if(linedata[1].equals("")) { + continue; + } + + // Data OK. + if(linedata[0].equals(ID)) { + i = Integer.parseInt(linedata[1]); + + // Duplicate ID check + if(ids.contains(i)) { + throw new RuntimeException("ReadQuest_Assignment > run() error: duplicate quest ID ("+i+")"); + } + // Non-sequential ID check + else if(i != allQuests.size()) { + throw new RuntimeException("ReadQuest_Assignment > run() error: non-sequential quest ID ("+i+")"); + } + // ID OK. + else { + ids.add(i); + qa.setId(i); + } + } + else if(linedata[0].equals(ICON)) { + qa.setIconName(linedata[1]); + } + else if(linedata[0].equals(TITLE)) { + qa.setName(linedata[1]); + } + else if(linedata[0].equals(DESC)) { + qa.setDesc(linedata[1]); + } + else if(linedata[0].equals(DIFF)) { + qa.setDifficulty(linedata[1]); + } + else if(linedata[0].equals(REPEAT)) { + qa.setRepeatable(Boolean.parseBoolean(linedata[1])); + } + else if(linedata[0].equals(AILIFE)) { + qa.setComputerLife(Integer.parseInt(linedata[1])); + } + else if(linedata[0].equals(WINS)) { + qa.setRequiredNumberWins(Integer.parseInt(linedata[1])); + } + else if(linedata[0].equals(CREDITS)) { + qa.setCreditsReward(Integer.parseInt(linedata[1])); + } + // Card reward list assembled here. + else if(linedata[0].equals(CARDS)) { + qa.setCardReward(linedata[1]); + qa.setCardRewardList(QuestUtil.generateCardRewardList(linedata[1])); + } + // Human extra card list assembled here. + else if(linedata[0].equals(HUMANEXTRAS)) { + String[] names = linedata[1].split("\\|"); + CardList templist = new CardList(); + Card tempcard; + + for(String s : names) { + // Token card creation + if(s.substring(0,5).equals("TOKEN")) { + tempcard = QuestUtil.createToken(s); + tempcard.addController(AllZone.getHumanPlayer()); + tempcard.setOwner(AllZone.getHumanPlayer()); + templist.add(tempcard); + } + // Standard card creation + else { + tempcard = AllZone.getCardFactory().getCard(s, AllZone.getHumanPlayer()); + tempcard.setCurSetCode(tempcard.getMostRecentSet()); + tempcard.setImageFilename(CardUtil.buildFilename(tempcard)); + templist.add(tempcard); + } + } + + qa.setHumanExtraCards(templist); + } + // AI extra card list assembled here. + else if(linedata[0].equals(AIEXTRAS)) { + String[] names = linedata[1].split("\\|"); + CardList templist = new CardList(); + Card tempcard; + + for(String s : names) { + // Token card creation + if(s.substring(0,5).equals("TOKEN")) { + tempcard = QuestUtil.createToken(s); + tempcard.addController(AllZone.getComputerPlayer()); + tempcard.setOwner(AllZone.getComputerPlayer()); + templist.add(tempcard); + } + // Standard card creation + else { + tempcard = AllZone.getCardFactory().getCard(s, AllZone.getComputerPlayer()); + tempcard.setCurSetCode(tempcard.getMostRecentSet()); + tempcard.setImageFilename(CardUtil.buildFilename(tempcard)); + templist.add(tempcard); + } + } + + qa.setAIExtraCards(templist); + } + } // else if() + } // while() + + br.close(); + } + catch (IOException e) { + e.printStackTrace(); } - }//readLine(Quest_Assignment) + + // Confirm that all quests have IDs. + for(Quest_Assignment q : allQuests) { + if(q.getId()==-1) { + throw new RuntimeException("ReadQuest_Assignment > getQuests() error: "+ + "Quest ID missing for '"+q.getName()+"'."); + } + } + + } // run() } diff --git a/src/main/java/forge/quest/data/QuestUtil.java b/src/main/java/forge/quest/data/QuestUtil.java index 7a885a75ce7..12bd6a3cfcd 100644 --- a/src/main/java/forge/quest/data/QuestUtil.java +++ b/src/main/java/forge/quest/data/QuestUtil.java @@ -1,6 +1,10 @@ package forge.quest.data; -import forge.*; +import forge.Card; +import forge.CardList; +import forge.Constant; +import forge.Quest_Assignment; +import forge.card.CardPrinted; import forge.card.CardRarity; import java.util.ArrayList; @@ -25,6 +29,7 @@ public class QuestUtil { /** *

getComputerCreatures.

+ * Returns extra AI cards in play at start of quest. * * @param qd a {@link forge.quest.data.QuestData} object. * @param qa a {@link forge.Quest_Assignment} object. @@ -32,23 +37,16 @@ public class QuestUtil { */ public static CardList getComputerCreatures(final QuestData qd, Quest_Assignment qa) { CardList list = new CardList(); + if (qa != null) { - ArrayList compCards = qa.getCompy(); - - for (String s : compCards) { - Card c = AllZone.getCardFactory().getCard(s, AllZone.getComputerPlayer()); - - c.setCurSetCode(c.getMostRecentSet()); - c.setImageFilename(CardUtil.buildFilename(c)); - - list.add(c); - } + list.addAll(qa.getAIExtraCards()); } return list; } /** *

getHumanPlantAndPet.

+ * Returns list of current plant/pet configuration. * * @param qd a {@link forge.quest.data.QuestData} object. * @return a {@link forge.CardList} object. @@ -69,6 +67,8 @@ public class QuestUtil { /** *

getHumanPlantAndPet.

+ * Returns extra human cards, including current plant/pet configuration, + * and cards in play at start of quest. * * @param qd a {@link forge.quest.data.QuestData} object. * @param qa a {@link forge.Quest_Assignment} object. @@ -76,420 +76,104 @@ public class QuestUtil { */ public static CardList getHumanPlantAndPet(final QuestData qd, Quest_Assignment qa) { CardList list = getHumanPlantAndPet(qd); - + if (qa != null) { - list.addAll(qa.getHuman()); + list.addAll(qa.getHumanExtraCards()); } return list; } + + /** + *

createToken.

+ * Creates a card instance for token defined by property string. + * + * @param s Properties string of token (TOKEN;W;1;1;sheep;type;type;type...) + * @return token Card + */ + public static Card createToken(String s) { + String[] properties = s.split(";");; + + Card c = new Card(); + c.setToken(true); + + //c.setManaCost(properties[1]); + c.addColor(properties[1]); + c.setBaseAttack(Integer.parseInt(properties[2])); + c.setBaseDefense(Integer.parseInt(properties[3])); + c.setName(properties[4]); + + c.setImageName( + properties[1]+" "+ + properties[2]+" "+ + properties[3]+" "+ + properties[4] + ); + int x = 5; + while(x != properties.length) { + c.addType(properties[x++]); + } + return c; + } + + /** + *

generateCardRewardList.

+ * Takes a reward list string, parses, and returns list of cards rewarded. + * + * @param s Properties string of reward (97 multicolor rares) + * @return CardList + */ + public static ArrayList generateCardRewardList(String s) { + QuestBoosterPack pack = new QuestBoosterPack(); + String[] temp = s.split(" "); + + int qty = Integer.parseInt(temp[0]); + + // Determine rarity + CardRarity rar = CardRarity.Uncommon; + if(temp[1].equals("rare") || temp[1].equals("rares")) { + rar = CardRarity.Rare; + } + + // Determine color ("random" defaults to null color) + String col = null; + if(temp[2].toLowerCase().equals("black")) { + col = Constant.Color.Black; + } + else if(temp[2].toLowerCase().equals("blue")) { + col = Constant.Color.Blue; + } + else if(temp[2].toLowerCase().equals("colorless")) { + col = Constant.Color.Colorless; + } + else if(temp[2].toLowerCase().equals("green")) { + col = Constant.Color.Green; + } + else if(temp[2].toLowerCase().equals("multicolor")) { + col = "Multicolor"; // Note: No constant color for this?? + } + else if(temp[2].toLowerCase().equals("red")) { + col = Constant.Color.Red; + } + else if(temp[2].toLowerCase().equals("white")) { + col = Constant.Color.White; + } + + return pack.generateCards(qty, rar, col); + } + /** *

setupQuest.

- * - * @param qa a {@link forge.Quest_Assignment} object. + * Assembled hard-coded quest options. + * All non-deck-specific handling now takes place in quests.txt. + * + * @deprecated + * @param qa */ public static void setupQuest(Quest_Assignment qa) { - QuestBoosterPack pack = new QuestBoosterPack(); - qa.clearCompy(); - - int id = qa.getId(); - - if (id == 1) //White Dungeon - { - qa.addCompy("Divine Presence"); - - qa.setCardRewardList(pack.generateCards(3, CardRarity.Rare, Constant.Color.White)); - } else if (id == 2) //Blue Dungeon - { - CardList humanList = new CardList(); - Card c = AllZone.getCardFactory().getCard("Quest for Ancient Secrets", AllZone.getHumanPlayer()); - - c.setCurSetCode(c.getMostRecentSet()); - c.setImageFilename(CardUtil.buildFilename(c)); - - humanList.add(c); - - qa.setHuman(humanList); - - qa.addCompy("Forced Fruition"); - - qa.setCardRewardList(pack.generateCards(3, CardRarity.Rare, Constant.Color.Blue)); - } else if (id == 3) //Black Dungeon - { - qa.addCompy("Infernal Genesis"); - - qa.setCardRewardList(pack.generateCards(3, CardRarity.Rare, Constant.Color.Black)); - } else if (id == 4) //Red Dungeon - { - qa.addCompy("Furnace of Rath"); - - qa.setCardRewardList(pack.generateCards(3, CardRarity.Rare, Constant.Color.Red)); - } else if (id == 5) //Green Dungeon - { - CardList humanList = new CardList(); - Card c = AllZone.getCardFactory().getCard("Defense of the Heart", AllZone.getHumanPlayer()); - - c.setCurSetCode(c.getMostRecentSet()); - c.setImageFilename(CardUtil.buildFilename(c)); - - humanList.add(c); - - qa.setHuman(humanList); - - qa.addCompy("Eladamri's Vineyard"); - qa.addCompy("Upwelling"); - - qa.setCardRewardList(pack.generateCards(3, CardRarity.Rare, Constant.Color.Green)); - } else if (id == 6) //Colorless Dungeon - { - for (int i = 0; i < 3; i++) - qa.addCompy("Eon Hub"); - qa.setCardRewardList(pack.generateCards(3, CardRarity.Rare, Constant.Color.Colorless)); - } else if (id == 7) //Gold Dungeon - { - qa.addCompy("Darksteel Ingot"); - - qa.setCardRewardList(pack.generateCards(3, CardRarity.Rare, "Multicolor")); - } else if (id == 8) { - CardList humanList = new CardList(); - for (int i = 0; i < 3; i++) { - //CANNOT use makeToken because of WheneverKeyword - Card c = new Card(); - c.setName("Sheep"); - c.setImageName("G 0 1 Sheep"); - - c.addController(AllZone.getHumanPlayer()); - c.setOwner(AllZone.getHumanPlayer()); - - //c.setManaCost("G"); - c.addColor("G"); - c.setToken(true); - - c.addType("Creature"); - c.addType("Sheep"); - - c.setBaseAttack(0); - c.setBaseDefense(1); - - humanList.add(c); - } - qa.setHuman(humanList); - qa.setCardRewardList(pack.generateCards(3, CardRarity.Rare, null)); - } else if (id == 9) { - CardList humanList = new CardList(); - Card c = AllZone.getCardFactory().getCard("Trusty Machete", AllZone.getHumanPlayer()); - - c.setCurSetCode(c.getMostRecentSet()); - c.setImageFilename(CardUtil.buildFilename(c)); - - humanList.add(c); - - qa.setHuman(humanList); - - for (int i = 0; i < 3; i++) - qa.addCompy("Wall of Wood"); - - qa.setCardRewardList(pack.generateCards(4, CardRarity.Rare, Constant.Color.Green)); - } else if (id == 10) { - CardList humanList = new CardList(); - - Card crd = AllZone.getCardFactory().getCard("Wall of Spears", AllZone.getHumanPlayer()); - - crd.setCurSetCode(crd.getMostRecentSet()); - crd.setImageFilename(CardUtil.buildFilename(crd)); - - humanList.add(crd); - - for (int i = 0; i < 3; i++) { - Card c = new Card(); - c.setName("Citizen"); - c.setImageName("W 1 1 Citizen"); - - c.addController(AllZone.getHumanPlayer()); - c.setOwner(AllZone.getHumanPlayer()); - - c.setManaCost("W"); - c.addColor("W"); - c.setToken(true); - - c.addType("Creature"); - c.addType("Citizen"); - - c.setBaseAttack(1); - c.setBaseDefense(1); - - humanList.add(c); - } - - qa.setHuman(humanList); - - for (int i = 0; i < 3; i++) - qa.addCompy("Scathe Zombies"); - qa.addCompy("Mass of Ghouls"); - - qa.setCardRewardList(pack.generateCards(4, CardRarity.Rare, Constant.Color.Black)); - } else if (id == 11) // The King's Contest - { - CardList humanList = new CardList(); - Card c = AllZone.getCardFactory().getCard("Seal of Cleansing", AllZone.getHumanPlayer()); - - c.setCurSetCode(c.getMostRecentSet()); - c.setImageFilename(CardUtil.buildFilename(c)); - - humanList.add(c); - - qa.setHuman(humanList); - - qa.addCompy("Loyal Retainers"); - - qa.setCardRewardList(pack.generateCards(3, CardRarity.Rare, null)); - } else if (id == 12) // Barroom Brawl - { - CardList humanList = new CardList(); - for (int i = 0; i < 3; i++) { - Card c = new Card(); - c.setName("Soldier Ally"); - c.setImageName("W 1 1 Soldier Ally"); - - c.addController(AllZone.getHumanPlayer()); - c.setOwner(AllZone.getHumanPlayer()); - - c.setManaCost("W"); - c.addColor("W"); - c.setToken(true); - - c.addType("Creature"); - c.addType("Soldier"); - c.addType("Ally"); - - c.setBaseAttack(1); - c.setBaseDefense(1); - - - humanList.add(c); - } - qa.setHuman(humanList); - - - qa.addCompy("Lowland Giant"); - - qa.setCardRewardList(pack.generateCards(4, CardRarity.Rare, null)); - } else if (id == 13) // The Court Jester - { - CardList humanList = new CardList(); - Card c = AllZone.getCardFactory().getCard("Sensei's Divining Top", AllZone.getHumanPlayer()); - - c.setCurSetCode(c.getMostRecentSet()); - c.setImageFilename(CardUtil.buildFilename(c)); - - humanList.add(c); - - qa.setHuman(humanList); - - qa.addCompy("Teferi's Puzzle Box"); - - qa.setCardRewardList(pack.generateCards(4, CardRarity.Rare, "Multicolor")); - } else if (id == 14) // Ancient Battlefield - { - CardList humanList = new CardList(); - String humanSetupCards[] = {"Glasses of Urza", "Blight Sickle"}; - - for (int i = 0; i < 2; i++) { - Card c = AllZone.getCardFactory().getCard(humanSetupCards[i], AllZone.getHumanPlayer()); - - c.setCurSetCode(c.getMostRecentSet()); - c.setImageFilename(CardUtil.buildFilename(c)); - - humanList.add(c); - } - qa.setHuman(humanList); - - String compySetupCards[] = {"Bad Moon", "Wall of Brambles"}; - - for (int i = 0; i < 2; i++) { - qa.addCompy(compySetupCards[i]); - } - - qa.setCardRewardList(pack.generateCards(4, CardRarity.Rare, null)); - } else if (id == 15) // Don't Play With Matches - { - CardList humanList = new CardList(); - String humanSetupCards[] = {"Mudbutton Torchrunner", "Scuzzback Scrapper"}; - - for (int i = 0; i < 2; i++) { - Card c = AllZone.getCardFactory().getCard(humanSetupCards[i], AllZone.getHumanPlayer()); - - c.setCurSetCode(c.getMostRecentSet()); - c.setImageFilename(CardUtil.buildFilename(c)); - - humanList.add(c); - } - qa.setHuman(humanList); - - String compySetupCards[] = {"Heedless One", "Norwood Archers", "Wildslayer Elves"}; - - for (int i = 0; i < 3; i++) { - qa.addCompy(compySetupCards[i]); - } - - qa.setCardRewardList(pack.generateCards(4, CardRarity.Rare, Constant.Color.Red)); - } else if (id == 16) // Mines of Kazum Durl - { - CardList humanList = new CardList(); - String[] humanSetupCards = {"Dwarven Demolition Team", "Dwarven Pony", "Dwarven Trader"}; - - for (int i = 0; i < 3; i++) { - Card c = AllZone.getCardFactory().getCard(humanSetupCards[i], AllZone.getHumanPlayer()); - - c.setCurSetCode(c.getMostRecentSet()); - c.setImageFilename(CardUtil.buildFilename(c)); - - humanList.add(c); - } - qa.setHuman(humanList); - - String[] compySetupCards = - {"Wall of Earth", "Wall of Air", "Wall of Ice", "Wall of Light", "Carrion Wall", "Steel Wall"}; - - for (int i = 0; i < 6; i++) { - qa.addCompy(compySetupCards[i]); - } - - qa.setCardRewardList(pack.generateCards(4, CardRarity.Rare, Constant.Color.Green)); - } else if (id == 17) // House Party - { - CardList humanList = new CardList(); - String[] humanSetupCards = {"Hopping Automaton", "Honden of Life's Web", "Forbidden Orchard"}; - - for (int i = 0; i < 3; i++) { - Card c = AllZone.getCardFactory().getCard(humanSetupCards[i], AllZone.getHumanPlayer()); - - c.setCurSetCode(c.getMostRecentSet()); - c.setImageFilename(CardUtil.buildFilename(c)); - - humanList.add(c); - } - qa.setHuman(humanList); - - String[] compySetupCards = {"Honden of Infinite Rage", "Mikokoro, Center of the Sea", "Tidehollow Strix"}; - - for (int i = 0; i < 3; i++) { - qa.addCompy(compySetupCards[i]); - } - - qa.setCardRewardList(pack.generateCards(4, CardRarity.Rare, Constant.Color.Colorless)); - } else if (id == 18) // Crows in the Field - { - CardList humanList = new CardList(); - String[] humanSetupCards = {"Straw Soldiers", "Femeref Archers", "Moonglove Extract"}; - - for (int i = 0; i < 3; i++) { - Card c = AllZone.getCardFactory().getCard(humanSetupCards[i], AllZone.getHumanPlayer()); - - c.setCurSetCode(c.getMostRecentSet()); - c.setImageFilename(CardUtil.buildFilename(c)); - - humanList.add(c); - } - qa.setHuman(humanList); - - String[] compySetupCards = {"Defiant Falcon", "Soulcatcher", "Storm Crow", "Hypnotic Specter"}; - - for (int i = 0; i < 4; i++) { - qa.addCompy(compySetupCards[i]); - } - - qa.setCardRewardList(pack.generateCards(5, CardRarity.Rare, null)); - } else if (id == 19) // The Desert Caravan - { - CardList humanList = new CardList(); - String[] humanSetupCards = {"Spidersilk Net", "Dromad Purebred"}; - - for (int i = 0; i < 2; i++) { - Card c = AllZone.getCardFactory().getCard(humanSetupCards[i], AllZone.getHumanPlayer()); - - c.setCurSetCode(c.getMostRecentSet()); - c.setImageFilename(CardUtil.buildFilename(c)); - - humanList.add(c); - } - qa.setHuman(humanList); - - String[] compySetupCards = {"Ambush Party", "Ambush Party", "Gnat Alley Creeper", "Ambush Party", "Ambush Party"}; - - for (int i = 0; i < 5; i++) { - qa.addCompy(compySetupCards[i]); - } - - qa.setCardRewardList(pack.generateCards(5, CardRarity.Rare, null)); - } else if (id == 20) // Blood Oath - { - CardList humanList = new CardList(); - String[] humanSetupCards = {"Counterbalance", "Hatching Plans", "Ley Druid"}; - - for (int i = 0; i < 3; i++) { - Card c = AllZone.getCardFactory().getCard(humanSetupCards[i], AllZone.getHumanPlayer()); - - c.setCurSetCode(c.getMostRecentSet()); - c.setImageFilename(CardUtil.buildFilename(c)); - - humanList.add(c); - } - qa.setHuman(humanList); - - String[] compySetupCards = {"Ior Ruin Expedition", "Oversold Cemetery", "Trapjaw Kelpie"}; - - for (int i = 0; i < 3; i++) { - qa.addCompy(compySetupCards[i]); - } - - qa.setCardRewardList(pack.generateCards(5, CardRarity.Rare, Constant.Color.Colorless)); - } else if (id == 21) // Private Domain - { - CardList humanList = new CardList(); - - Card c = AllZone.getCardFactory().getCard("Strip Mine", AllZone.getHumanPlayer()); - - c.setCurSetCode(c.getMostRecentSet()); - c.setImageFilename(CardUtil.buildFilename(c)); - - humanList.add(c); - - qa.setHuman(humanList); - - String[] compySetupCards = {"Plains", "Island", "Swamp", "Mountain", "Forest"}; - - for (int i = 0; i < 5; i++) { - qa.addCompy(compySetupCards[i]); - } - - qa.setCardRewardList(pack.generateCards(6, CardRarity.Rare, null)); - } else if (id == 22) // Pied Piper - { - CardList humanList = new CardList(); - String[] humanSetupCards = {"Volunteer Militia", "Land Tax", "Elvish Farmer", "An-Havva Township"}; - - for (int i = 0; i < 4; i++) { - Card c = AllZone.getCardFactory().getCard(humanSetupCards[i], AllZone.getHumanPlayer()); - - c.setCurSetCode(c.getMostRecentSet()); - c.setImageFilename(CardUtil.buildFilename(c)); - - humanList.add(c); - } - qa.setHuman(humanList); - - String[] compySetupCards = {"Darksteel Citadel", "Relentless Rats"}; - - for (int i = 0; i < 2; i++) { - qa.addCompy(compySetupCards[i]); - } - - qa.setCardRewardList(pack.generateCards(3, CardRarity.Rare, null)); - } - + } } //QuestUtil