Non-deck meta removed from quest dck files. Meta now reads

Name=
Display Name=
Icon=
Deck Type=
Comment=

All quest-related information is fully stored in quests.txt, including AI and human extra cards at match start.

ReadQuest_Assignment assembles all quest information from this file.
Quest_Assignment has getters and setters to handle all information.

QuestUtil updated, most importantly deprecating SetupQuest, which previously held a lot of hard-coded data.
This commit is contained in:
Doublestrike
2011-09-11 04:54:11 +00:00
parent 46a8d9ff4a
commit e5c6d749b8
28 changed files with 674 additions and 1133 deletions

1
.gitattributes vendored
View File

@@ -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/Life.png -text svneol=unset#image/png
res/pics/icons/MapIcon.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/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/ZeppelinIcon.png -text svneol=unset#image/png
res/pics/icons/notesIcon.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 res/pics_link/card-pictures_a.txt svneol=native#text/plain

BIN
res/pics/icons/Unknown.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 24 KiB

View File

@@ -1,15 +1,7 @@
[metadata] [metadata]
ID=1
Name=quest1 Name=quest1
DisplayName=Dungeon Crawling (White) 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 Icon=Dungeon Crawling White.jpg
AILife=25
Deck Type=constructed Deck Type=constructed
Comment= Comment=
[main] [main]
@@ -50,7 +42,4 @@ Comment=
1 Rebuff the Wicked 1 Rebuff the Wicked
1 Retribution of the Meek 1 Retribution of the Meek
1 Sunlance 1 Sunlance
[sideboard] [sideboard]
[human_extra_cards]
[ai_extra_cards]
1 Divine Presence

View File

@@ -1,15 +1,7 @@
[metadata] [metadata]
ID=10
Name=quest10 Name=quest10
DisplayName=Zombie Attack! 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 Icon=Zombie Attack.jpg
AILife=30
Deck Type=constructed Deck Type=constructed
Comment= Comment=
[main] [main]
@@ -37,12 +29,4 @@ Comment=
4 Mass of Ghouls 4 Mass of Ghouls
1 Warpath Ghoul 1 Warpath Ghoul
1 Viscera Dragger 1 Viscera Dragger
[sideboard] [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

View File

@@ -1,15 +1,7 @@
[metadata] [metadata]
ID=11
Name=quest11 Name=quest11
DisplayName=The King's Contest 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 Icon=The Kings Contest.jpg
AILife=30
Deck Type=constructed Deck Type=constructed
Comment= Comment=
[main] [main]
@@ -57,8 +49,4 @@ Comment=
1 Kongming, "Sleeping Dragon" 1 Kongming, "Sleeping Dragon"
3 Mountain 3 Mountain
1 Tuknir Deathlock 1 Tuknir Deathlock
[sideboard] [sideboard]
[human_extra_cards]
Seal of Cleansing
[ai_extra_cards]
Loyal Retainers

View File

@@ -1,15 +1,7 @@
[metadata] [metadata]
ID=12
Name=quest12 Name=quest12
DisplayName=Barroom Brawl 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 Icon=Barroom Brawl.jpg
AILife=30
Deck Type=constructed Deck Type=constructed
Comment= Comment=
[main] [main]
@@ -34,10 +26,4 @@ Comment=
1 Quietus Spike 1 Quietus Spike
4 Savannah 4 Savannah
4 Wasteland 4 Wasteland
[sideboard] [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

View File

@@ -1,15 +1,7 @@
[metadata] [metadata]
ID=13
Name=quest13 Name=quest13
DisplayName=The Court Jester 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 Icon=The Court Jester.jpg
AILife=30
Deck Type=constructed Deck Type=constructed
Comment= Comment=
[main] [main]
@@ -35,8 +27,4 @@ Comment=
2 Cruel Ultimatum 2 Cruel Ultimatum
1 Mox Jet 1 Mox Jet
2 Mountain 2 Mountain
[sideboard] [sideboard]
[human_extra_cards]
Sensei's Divining Top
[ai_extra_cards]
Teferi's Puzzle Box

View File

@@ -1,15 +1,7 @@
[metadata] [metadata]
ID=14
Name=quest14 Name=quest14
DisplayName=Ancient Battlefield 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 Icon=Ancient Battlefield.jpg
AILife=30
Deck Type=constructed Deck Type=constructed
Comment= Comment=
[main] [main]
@@ -31,10 +23,4 @@ Comment=
4 Vengevine 4 Vengevine
1 Mox Jet 1 Mox Jet
4 Essence Warden 4 Essence Warden
[sideboard] [sideboard]
[human_extra_cards]
Glasses of Urza
Blight Sickle
[ai_extra_cards]
Bad Moon
Wall of Brambles

View File

@@ -1,15 +1,7 @@
[metadata] [metadata]
ID=15
Name=quest15 Name=quest15
DisplayName=Don't Play With Matches 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 Icon=Dont Play With Matches.jpg
AILife=30
Deck Type=constructed Deck Type=constructed
Comment= Comment=
[main] [main]
@@ -32,11 +24,4 @@ Comment=
3 Keen-Eyed Archers 3 Keen-Eyed Archers
4 Elvish Harbinger 4 Elvish Harbinger
4 Llanowar Elves 4 Llanowar Elves
[sideboard] [sideboard]
[human_extra_cards]
1 Mudbutton Torchrunner
1 Scuzzback Scrapper
[ai_extra_cards]
1 Heedless One
1 Norwood Archers
1 Wildslayer Elves

View File

@@ -1,15 +1,7 @@
[metadata] [metadata]
ID=16
Name=quest16 Name=quest16
DisplayName=Mines of Kazum Durl 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 Icon=Mines of Kazum Durl.jpg
AILife=30
Deck Type=constructed Deck Type=constructed
Comment= Comment=
[main] [main]
@@ -36,15 +28,4 @@ Comment=
4 Savannah 4 Savannah
1 Doubling Season 1 Doubling Season
3 Thelonite Hermit 3 Thelonite Hermit
[sideboard] [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

View File

@@ -1,15 +1,7 @@
[metadata] [metadata]
ID=17
Name=quest17 Name=quest17
DisplayName=House Party 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 Icon=House Party.jpg
AILife=30
Deck Type=constructed Deck Type=constructed
Comment= Comment=
[main] [main]
@@ -36,11 +28,4 @@ Comment=
1 Mox Jet 1 Mox Jet
4 Sprouting Thrinax 4 Sprouting Thrinax
1 Mountain 1 Mountain
[sideboard] [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

View File

@@ -1,15 +1,7 @@
[metadata] [metadata]
ID=18
Name=quest18 Name=quest18
DisplayName=Crows in the Field 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 Icon=Crows in the Field.jpg
AILife=30
Deck Type=constructed Deck Type=constructed
Comment= Comment=
[main] [main]
@@ -33,13 +25,4 @@ Comment=
4 Noble Hierarch 4 Noble Hierarch
4 Savannah 4 Savannah
2 Eldrazi Conscription 2 Eldrazi Conscription
[sideboard] [sideboard]
[human_extra_cards]
Straw Soldiers
Femeref Archers
Moonglove Extract
[ai_extra_cards]
Defiant Falcon
Soulcatcher
Storm Crow
Hypnotic Specter

View File

@@ -1,15 +1,7 @@
[metadata] [metadata]
ID=19
Name=quest19 Name=quest19
DisplayName=The Desert Caravan 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 Icon=The Desert Caravan.jpg
AILife=30
Deck Type=constructed Deck Type=constructed
Comment= Comment=
[main] [main]
@@ -30,10 +22,4 @@ Comment=
1 Mox Pearl 1 Mox Pearl
4 Eladamri's Call 4 Eladamri's Call
4 Savannah 4 Savannah
[sideboard] [sideboard]
[human_extra_cards]
Spidersilk Net
Dromad Purebred
[ai_extra_cards]
4 Ambush Party
Gnat Alley Creeper

View File

@@ -1,15 +1,7 @@
[metadata] [metadata]
ID=2
Name=quest2 Name=quest2
DisplayName=Dungeon Crawling (Blue) 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 Icon=Dungeon Crawling Blue.jpg
AILife=25
Deck Type=constructed Deck Type=constructed
Comment= Comment=
[main] [main]
@@ -37,8 +29,4 @@ Comment=
1 Merfolk of the Pearl Trident 1 Merfolk of the Pearl Trident
1 Fugitive Wizard 1 Fugitive Wizard
1 Grayscaled Gharial 1 Grayscaled Gharial
[sideboard] [sideboard]
[human_extra_cards]
1 Quest for Ancient Secrets
[ai_extra_cards]
1 Forced Fruition

View File

@@ -1,15 +1,7 @@
[metadata] [metadata]
ID=20
Name=quest20 Name=quest20
DisplayName=Blood Oath 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 Icon=Blood Oath.jpg
AILife=30
Deck Type=constructed Deck Type=constructed
Comment= Comment=
[main] [main]
@@ -42,12 +34,4 @@ Comment=
4 Counterspell 4 Counterspell
1 Thoughtseize 1 Thoughtseize
1 Emrakul, the Aeons Torn 1 Emrakul, the Aeons Torn
[sideboard] [sideboard]
[human_extra_cards]
Counterbalance
Hatching Plans
Ley Druid
[ai_extra_cards]
Ior Ruin Expedition
Oversold Cemetery
Trapjaw Kelpie

View File

@@ -1,15 +1,7 @@
[metadata] [metadata]
ID=21
Name=quest21 Name=quest21
DisplayName=Private Domain 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 Icon=Private Domain.jpg
AILife=50
Deck Type=constructed Deck Type=constructed
Comment= Comment=
[main] [main]
@@ -39,12 +31,4 @@ Comment=
1 Legacy Weapon 1 Legacy Weapon
1 Mountain 1 Mountain
2 Wandering Stream 2 Wandering Stream
[sideboard] [sideboard]
[human_extra_cards]
Strip Mine
[ai_extra_cards]
Plains
Island
Mountain
Swamp
Forest

View File

@@ -1,15 +1,7 @@
[metadata] [metadata]
ID=22
Name=quest22 Name=quest22
DisplayName=The Pied Piper 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 Icon=The Pied Piper.jpg
AILife=30
Deck Type=constructed Deck Type=constructed
Comment= Comment=
[main] [main]
@@ -22,12 +14,4 @@ Comment=
1 Mystical Tutor 1 Mystical Tutor
4 Thrumming Stone 4 Thrumming Stone
29 Relentless Rats 29 Relentless Rats
[sideboard] [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

View File

@@ -1,15 +1,7 @@
[metadata] [metadata]
ID=3
Name=quest3 Name=quest3
DisplayName=Dungeon Crawling (Black) 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 Icon=Dungeon Crawling Black.jpg
AILife=25
Deck Type=constructed Deck Type=constructed
Comment= Comment=
[main] [main]
@@ -40,7 +32,4 @@ Comment=
2 Pennon Blade 2 Pennon Blade
1 Beacon of Unrest 1 Beacon of Unrest
1 Zombify 1 Zombify
[sideboard] [sideboard]
[human_extra_cards]
[ai_extra_cards]
Infernal Genesis

View File

@@ -1,15 +1,7 @@
[metadata] [metadata]
ID=4
Name=quest4 Name=quest4
DisplayName=Dungeon Crawling (Red) 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 Icon=Dungeon Crawling Red.jpg
AILife=25
Deck Type=constructed Deck Type=constructed
Comment= Comment=
[main] [main]
@@ -95,7 +87,4 @@ Comment=
1 Sudden Shock 1 Sudden Shock
1 Tarfire 1 Tarfire
1 Volcanic Hammer 1 Volcanic Hammer
[sideboard] [sideboard]
[human_extra_cards]
[ai_extra_cards]
Furnace of Rath

View File

@@ -1,15 +1,7 @@
[metadata] [metadata]
ID=5
Name=quest5 Name=quest5
DisplayName=Dungeon Crawling (Green) 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 Icon=Dungeon Crawling Green.jpg
AILife=25
Deck Type=constructed Deck Type=constructed
Comment= Comment=
[main] [main]
@@ -75,9 +67,4 @@ Comment=
1 Whiptail Wurm 1 Whiptail Wurm
1 Woodfall Primus 1 Woodfall Primus
1 Yavimaya Wurm 1 Yavimaya Wurm
[sideboard] [sideboard]
[human_extra_cards]
Defense of the Heart
[ai_extra_cards]
Eladamri's Vineyard
Upwelling

View File

@@ -1,15 +1,7 @@
[metadata] [metadata]
ID=6
Name=quest6 Name=quest6
DisplayName=Dungeon Crawling (Colorless) 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 Icon=Dungeon Crawling Colorless.jpg
AILife=30
Deck Type=constructed Deck Type=constructed
Comment= Comment=
[main] [main]
@@ -84,7 +76,4 @@ Comment=
1 Waning Wurm 1 Waning Wurm
1 Whipstitched Zombie 1 Whipstitched Zombie
1 Yawgmoth Demon 1 Yawgmoth Demon
[sideboard] [sideboard]
[human_extra_cards]
[ai_extra_cards]
3 Eon Hub

View File

@@ -1,15 +1,7 @@
[metadata] [metadata]
ID=7
Name=quest7 Name=quest7
DisplayName=Dungeon Crawling (Gold) 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 Icon=Dungeon Crawling Gold.jpg
AILife=30
Deck Type=constructed Deck Type=constructed
Comment= Comment=
[main] [main]
@@ -47,7 +39,4 @@ Comment=
2 Dragon Arch 2 Dragon Arch
1 Conflux 1 Conflux
1 Maelstrom Nexus 1 Maelstrom Nexus
[sideboard] [sideboard]
[human_extra_cards]
[ai_extra_cards]
Darksteel Ingot

View File

@@ -1,15 +1,7 @@
[metadata] [metadata]
ID=8
Name=quest8 Name=quest8
DisplayName=A Wolf in Sheep's Clothing 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 Icon=A Wolf in Sheeps Clothing.jpg
AILife=25
Deck Type=constructed Deck Type=constructed
Comment= Comment=
[main] [main]
@@ -30,9 +22,4 @@ Comment=
1 Bestial Menace 1 Bestial Menace
4 Tundra Wolves 4 Tundra Wolves
4 Savannah 4 Savannah
[sideboard] [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]

View File

@@ -1,15 +1,7 @@
[metadata] [metadata]
ID=9
Name=quest9 Name=quest9
DisplayName=Bushwhacked! 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 Icon=Bushwhacked.jpg
AILife=30
Deck Type=constructed Deck Type=constructed
Comment= Comment=
[main] [main]
@@ -31,8 +23,4 @@ Comment=
4 Wall of Blossoms 4 Wall of Blossoms
4 Vine Trellis 4 Vine Trellis
1 Overbeing of Myth 1 Overbeing of Myth
[sideboard] [sideboard]
[human_extra_cards]
Trusty Machete
[ai_extra_cards]
3 Wall of Wood

View File

@@ -1,221 +1,315 @@
1 Notes
Dungeon Crawling (White) - A [quest] line triggers a new quest object.
This realm is guarded by a divine entity laying his protecting hand on each living being. - Properties can be in any order
Medium - IDs are mandatory, and must be sequential.
Repeatable - Any other property, if empty, will use a default value.
20 - Both AI and human can have extra legal cards and/or tokens at match start.
Three white rares
100
Dungeon Crawling White.jpg
2 [quest]
Dungeon Crawling (Blue) id=1
This realm holds knowledge so vast it can overburden the unwary. Icon=Dungeon Crawling White.jpg
Medium Title=Dungeon Crawling (White)
Repeatable Desc=This realm is guarded by a divine entity laying his protecting hand on each living being.
20 Diff=Medium
Three blue rares AILife=25
100 Repeat=true
Dungeon Crawling Blue.jpg Wins=20
Card Reward=3 white rares
Credit Reward=100
HumanExtras=
AIExtras=Divine Presence
3 [quest]
Dungeon Crawling (Black) id=2
Guarded by black creatures. Icon=Dungeon Crawling Blue.jpg
Medium Title=Dungeon Crawling (Blue)
Repeatable Desc=This realm holds knowledge so vast it can overburden the unwary.
20 Diff=Medium
Three black rares AILife=25
100 Repeat=true
Dungeon Crawling Black.jpg Wins=20
Card Reward=3 blue rares
Credit Reward=100
HumanExtras=Quest for Ancient Secrets
AIExtras=Forced Fruition
4 [quest]
Dungeon Crawling (Red) id=3
Guarded by red creatures. Icon=Dungeon Crawling Black.jpg
Medium Title=Dungeon Crawling (Black)
Repeatable Desc=The dead cannot be silenced, and want you to join their ranks.
20 Diff=Medium
Three red rares AILife=25
100 Repeat=true
Dungeon Crawling Red.jpg Wins=20
Card Reward=3 black rares
Credit Reward=100
HumanExtras=
AIExtras=Infernal Genesis
5 [quest]
Dungeon Crawling (Green) id=4
Guarded by green creatures. Icon=Dungeon Crawling Red.jpg
Medium Title=Dungeon Crawling (Red)
Repeatable Desc=Untold treasure awaits you, should you successfully dodge the lightning and lava.
20 Diff=Medium
Three green rares AILife=25
100 Repeat=true
Dungeon Crawling Green.jpg Wins=20
Card Reward=3 red rares
Credit Reward=100
HumanExtras=
AIExtras=Furnace of Rath
6 [quest]
Dungeon Crawling (Colorless) id=5
The inhabitants of this plane tread with a light step. Icon=Dungeon Crawling Green.jpg
Hard Title=Dungeon Crawling (Green)
Repeatable Desc=Gnarled, twisting, sinister growths slowly rend the walls in twain and try to silence all who cross their path.
28 Diff=Medium
Three colorless rares AILife=25
150 Repeat=true
Dungeon Crawling Colorless.jpg Wins=20
Card Reward=3 green rares
Credit Reward=100
HumanExtras=Defense of the Heart
AIExtras=Eladamri's Vineyard|Upwelling
7 [quest]
Dungeon Crawling (Gold) id=6
Guarded by gold creatures. Icon=Dungeon Crawling Colorless.jpg
Hard Title=Dungeon Crawling (Colorless)
Repeatable Desc=The inhabitants of this plane tread with a light step.
28 Diff=Hard
Three multi-colored rares AILife=30
150 Repeat=true
Dungeon Crawling Gold.jpg Wins=28
Card Reward=3 colorless rares
Credit Reward=150
HumanExtras=
AIExtras=Eon Hub|Eon Hub|Eon Hub
8 [quest]
A Wolf in Sheep's Clothing id=7
The local sheep farm is under attack by a pack of wolves. Kill the wolves, save the sheep! Icon=Dungeon Crawling Gold.jpg
Medium Title=Dungeon Crawling (Gold)
Not Repeatable Desc=Clever sorcerers draw energy from countless sources - can you outwit them?
28 Diff=Hard
Three random rares AILife=30
200 Repeat=true
A Wolf in Sheeps Clothing.jpg Wins=28
Card Reward=3 multi-colored rares
Credit Reward=150
HumanExtras=
AIExtras=Darksteel Ingot
9 [quest]
Bushwhacked! id=8
You find yourself surrounded by carnivorous plants and poisonous vines. Cut your way out of this foresty mess and make it home safe. Icon=A Wolf in Sheeps Clothing.jpg
Hard Title=A Wolf in Sheep's Clothing
Not Repeatable Desc=The local sheep farm is under attack by a pack of wolves. Kill the wolves, save the sheep!
40 Diff=Medium
Four green rares AILife=25
225 Repeat=false
Bushwhacked.jpg 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 [quest]
Zombie Attack! id=9
The village of Haven is getting attacked by the Zombie horde! Protect the village. Icon=Bushwhacked.jpg
Hard Title=Bushwhacked!
Not Repeatable Desc=You find yourself surrounded by carnivorous plants and poisonous vines. Cut your way out of this foresty mess and make it home safe.
40 Diff=Hard
Four black rares AILife=30
200 Repeat=false
Zombie Attack.jpg Wins=40
Card Reward=4 green rares
Credit Reward=225
HumanExtras=Trusty Machete
AIExtras=Wall of Wood|Wall of Wood|Wall of Wood
11 [quest]
The King's Contest id=10
The king is holding a contest. You are invited to participate and compete against other legends of this era. Icon=Zombie Attack.jpg
Hard Title=Zombie Attack!
Not Repeatable Desc=The village of Haven is getting attacked by the Zombie horde! Protect the village.
40 Diff=Hard
Three random rares AILife=30
150 Repeat=false
The Kings Contest.jpg 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 [quest]
Barroom Brawl id=11
A drunken giant of a man takes a swing at you, your brew spills and a fight breaks out. Icon=The Kings Contest.jpg
Hard Title=The King's Contest
Not Repeatable Desc=The king is holding a contest. You are invited to participate and compete against other legends of this era.
64 Diff=Hard
Four random rares AILife=30
250 Repeat=false
Barroom Brawl.jpg Wins=40
Card Reward=3 random rares
Credit Reward=150
HumanExtras=Seal of Cleansing
AIExtras=Loyal Retainers
13 [quest]
The Court Jester id=12
The Court Jester pulls a prank on you. Will you laugh it off or pay him back? Icon=Barroom Brawl.jpg
Hard Title=Barroom Brawl
Not Repeatable Desc=A drunken giant of a man takes a swing at you, your brew spills and a fight breaks out.
52 Diff=Hard
Four multi-colored rares AILife=30
300 Repeat=false
The Court Jester.jpg 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 [quest]
Ancient Battlefield id=13
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. Icon=The Court Jester.jpg
Hard Title=The Court Jester
Not Repeatable Desc=The Court Jester pulls a prank on you. Will you laugh it off or pay him back?
64 Diff=Hard
Four random rares AILife=30
250 Repeat=false
Ancient Battlefield.jpg Wins=52
Card Reward=4 multi-colored rares
Credit Reward=300
HumanExtras=Sensei's Divining Top
AIExtras=Teferi's Puzzle Box
15 [quest]
Don't Play With Matches id=14
The goblins are battling the elves. Those pesky elves, will they ever learn. Do not play with fire! Title=Ancient Battlefield
Hard 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.
Not Repeatable Diff=Hard
52 AILife=30
Four red rares Repeat=false
200 Wins=64
Dont Play With Matches.jpg 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 [quest]
Mines of Kazum Durl id=15
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. Title=Don't Play With Matches
Hard Desc=The goblins are battling the elves. Those pesky elves, will they ever learn. Do not play with fire!
Not Repeatable Diff=Hard
52 AILife=30
Four green rares Repeat=false
250 Wins=52
Mines of Kazum Durl.jpg 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 [quest]
House Party id=16
Your friends decide to hold a house party at your home tonight. Later that night uninvited guests show up and disrupt the party. Title=Mines of Kazum Durl
Hard 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.
Not Repeatable Diff=Hard
64 AILife=30
Four colorless rares Repeat=false
250 Wins=52
House Party.jpg 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 [quest]
Crows in the Field id=17
Crows are eating the seed planted in the local farm fields. The farmers are scared. Those crows are big, you will need some help. Title=House Party
Hard Desc=Your friends decide to hold a house party at your home tonight. Later that night uninvited guests show up and disrupt the party.
Not Repeatable Diff=Hard
64 AILife=30
Five random rares Repeat=false
300 Wins=64
Crows in the Field.jpg 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 [quest]
The Desert Caravan id=18
A caravan is transporting silk across the desert. While setting up camp for the night you are attacked by thieves. Defend yourself. Title=Crows in the Field
Hard 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.
Not Repeatable Diff=Hard
80 AILife=30
Five random rares Repeat=false
300 Wins=64
The Desert Caravan.jpg 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 [quest]
Blood Oath id=19
A druid saves your life and the two of you take a blood oath. It is now time to fulfill your oath. Title=The Desert Caravan
Hard Desc=A caravan is transporting silk across the desert. While setting up camp for the night you are attacked by thieves. Defend yourself.
Not Repeatable Diff=Hard
80 AILife=30
Five colorless rares Repeat=false
300 Wins=80
Blood Oath.jpg 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 [quest]
The Pied Piper id=20
A mysterious man threatens to flood the land with a relentless stream of hungry rats. Cross his plan before it's too late. Title=Blood Oath
Hard Desc=A druid saves your life and the two of you take a blood oath. It is now time to fulfill your oath.
Not Repeatable Diff=Hard
32 AILife=30
three random rares Repeat=false
150 Wins=80
The Pied Piper.jpg 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 [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

View File

@@ -11,25 +11,25 @@ import forge.card.CardPrinted;
* @version $Id$ * @version $Id$
*/ */
public class Quest_Assignment { public class Quest_Assignment {
private int id; // ID (default -1, should be explicitly set at later time.)
private int requiredNumberWins; private int id = -1;
private int computerLife;
// Default vals if none provided for this ID in quests.txt.
private long creditsReward; private int requiredNumberWins = 20;
private int computerLife = 25;
private String name; private long creditsReward = 100;
private String desc; private String name = "Mystery Quest";
private String difficulty; private String desc = "";
private String cardReward; private String difficulty = "Medium";
private String iconName; private String cardReward = "1 colorless rare";
private String iconName = "Unknown.jpg";
private boolean repeatable; private boolean repeatable = false;
private ArrayList<CardPrinted> cardRewardList = new ArrayList<CardPrinted>();
private CardList human = new CardList();
private ArrayList<String> compy = new ArrayList<String>();
// Other cards used in assignment: starting, and reward.
private CardList humanExtraCards = new CardList();
private CardList aiExtraCards = new CardList();
private ArrayList<CardPrinted> cardRewardList = new ArrayList<CardPrinted>();
/** /**
* <p>Setter for the field <code>id</code>.</p> * <p>Setter for the field <code>id</code>.</p>
* *
@@ -211,58 +211,50 @@ public class Quest_Assignment {
} }
/** /**
* <p>Setter for the field <code>human</code>.</p> * <p>Setter for the field <code>humanExtraCards</code>.</p>
* *
* @param humanIn a {@link forge.CardList} object. * @param s a CardList object.
*/ */
public final void setHuman(final CardList humanIn) { public final void setHumanExtraCards(final CardList cl) {
this.human = humanIn; this.humanExtraCards = cl;
} }
/** /**
* <p>Getter for the field <code>human</code>.</p> * <p>Getter for the field <code>humanExtraCards</code>.</p>
* *
* @return a {@link forge.CardList} object. * @return a {@link forge.CardList} object.
*/ */
public final CardList getHuman() { public final CardList getHumanExtraCards() {
return human; return humanExtraCards;
} }
/** /**
* <p>addCompy.</p> * <p>Setter for the field <code>aiExtraCards</code>.</p>
* *
* @param s a {@link java.lang.String} object. * @param s a CardList object.
*/ */
public final void addCompy(final String s) { public final void setAIExtraCards(final CardList cl) {
this.compy.add(s); this.aiExtraCards = cl;
} }
/**
* <p>clearCompy.</p>
*/
public final void clearCompy() {
this.compy.clear();
}
/** /**
* <p>Getter for the field <code>compy</code>.</p> * <p>Getter for the field <code>compy</code>.</p>
* *
* @return a {@link java.util.ArrayList} object. * @return a {@link java.util.ArrayList} object.
*/ */
public final ArrayList<String> getCompy() { public final CardList getAIExtraCards() {
return compy; return aiExtraCards;
} }
/** /**
* <p>Setter for the field <code>cardRewardList</code>.</p> * <p>Setter for the field <code>cardRewardList</code>.</p>
* *
* @param cardRewardListIn a {@link java.util.ArrayList} object. * @return a {@link java.util.ArrayList} object.
*/ */
public final void setCardRewardList(final ArrayList<CardPrinted> cardRewardListIn) { public void setCardRewardList(final ArrayList<CardPrinted> cp) {
this.cardRewardList = cardRewardListIn; this.cardRewardList = cp;
} }
/** /**
* <p>Getter for the field <code>cardRewardList</code>.</p> * <p>Getter for the field <code>cardRewardList</code>.</p>
* *
@@ -271,4 +263,5 @@ public class Quest_Assignment {
public final ArrayList<CardPrinted> getCardRewardList() { public final ArrayList<CardPrinted> getCardRewardList() {
return cardRewardList; return cardRewardList;
} }
} }

View File

@@ -2,14 +2,15 @@ package forge;
import forge.error.ErrorViewer; import forge.error.ErrorViewer;
import forge.properties.NewConstants; import forge.properties.NewConstants;
import forge.quest.data.QuestUtil;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.File; import java.io.File;
import java.io.FileReader; import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.List; import java.util.List;
/** /**
* <p>ReadQuest_Assignment class.</p> * <p>ReadQuest_Assignment class.</p>
* *
@@ -17,60 +18,31 @@ import java.util.List;
* @version $Id$ * @version $Id$
*/ */
public class ReadQuest_Assignment implements Runnable, NewConstants { public class ReadQuest_Assignment implements Runnable, NewConstants {
private BufferedReader in;
ArrayList<Quest_Assignment> allQuests = new ArrayList<Quest_Assignment>(); ArrayList<Quest_Assignment> allQuests = new ArrayList<Quest_Assignment>();
private ArrayList<Integer> ids = new ArrayList<Integer>();
private int totalWins; private BufferedReader br;
private List<Integer> completedQuests = new ArrayList<Integer>(); private int totalWins;
private List<Integer> completedQuests = new ArrayList<Integer>();
/**
* <p>getQuests.</p> // Constants, tied to properties in the quests.txt file.
* private static final String ID = "id";
* @return a {@link java.util.List} object. private static final String ICON = "Icon";
*/ private static final String TITLE = "Title";
public List<Quest_Assignment> getQuests() { private static final String DESC = "Desc";
return new ArrayList<Quest_Assignment>(allQuests); private static final String DIFF = "Diff";
} private static final String AILIFE = "AILife";
private static final String REPEAT = "Repeat";
/** private static final String WINS = "Wins";
* <p>getQuestsByIds.</p> private static final String CARDS = "Card Reward";
* private static final String CREDITS = "Credit Reward";
* @param availableQuestIds a {@link java.util.List} object. private static final String HUMANEXTRAS = "HumanExtras";
* @return a {@link java.util.List} object. private static final String AIEXTRAS = "AIExtras";
*/
public List<Quest_Assignment> getQuestsByIds(List<Integer> availableQuestIds) {
List<Quest_Assignment> quests = new ArrayList<Quest_Assignment>();
for (Quest_Assignment qa : allQuests) {
if (availableQuestIds.contains(qa.getId()))
quests.add(qa);
}
return quests;
}
/**
* <p>getQuestById.</p>
*
* @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);
}
*/
/** /**
* <p>Constructor for ReadQuest_Assignment.</p> * <p>Constructor for ReadQuest_Assignment.</p>
* Sets parameters for available quests and prepares buffered reader for quests.txt.
* *
* @param filename a {@link java.lang.String} object. * @param filename a {@link java.lang.String} object.
* @param questData a {@link forge.quest.data.QuestData} object. * @param questData a {@link forge.quest.data.QuestData} object.
@@ -81,128 +53,226 @@ public class ReadQuest_Assignment implements Runnable, NewConstants {
/** /**
* <p>Constructor for ReadQuest_Assignment.</p> * <p>Constructor for ReadQuest_Assignment.</p>
* Sets parameters for available quests and prepares buffered reader for quests.txt.
* *
* @param file a {@link java.io.File} object. * @param file a {@link java.io.File} object.
* @param questData a {@link forge.quest.data.QuestData} object. * @param questData a {@link forge.quest.data.QuestData} object.
*/ */
public ReadQuest_Assignment(File file, forge.quest.data.QuestData questData) { public ReadQuest_Assignment(File file, forge.quest.data.QuestData questData) {
if (questData != null) { if (questData != null) {
totalWins = questData.getWin(); totalWins = questData.getWin();
if (questData.getCompletedQuests() != null) if (questData.getCompletedQuests() != null) {
completedQuests = questData.getCompletedQuests(); completedQuests = questData.getCompletedQuests();
else }
else {
completedQuests = new ArrayList<Integer>(); completedQuests = new ArrayList<Integer>();
}
} }
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 { try {
in = new BufferedReader(new FileReader(file)); br = new BufferedReader(new FileReader(file));
} catch (Exception ex) { } catch (Exception ex) {
ErrorViewer.showError(ex, "File \"%s\" not found", file.getAbsolutePath()); ErrorViewer.showError(ex, "File \"%s\" not found", file.getAbsolutePath());
throw new RuntimeException("ReadQuest_Assignment : constructor error -- file not found -- filename is " throw new RuntimeException("ReadQuest_Assignment > constructor error: "+
+ file.getPath()); "BufferedReader failed, '"+file.getAbsolutePath()+"' not found.");
} }
}//ReadCard() } // ReadQuest_Assignment()
/**
* <p>getQuests.</p>
* Returns list of currently available quest objects.
*
* @return a {@link java.util.List} object.
*/
public List<Quest_Assignment> getQuests() {
ArrayList<Quest_Assignment> availableQuests = new ArrayList<Quest_Assignment>();
for(Quest_Assignment qa : allQuests) {
if (qa.getRequiredNumberWins() <= totalWins && !completedQuests.contains(qa.getId())) {
availableQuests.add(qa);
}
}
return availableQuests;
}
/**
* <p>getQuests.</p>
* Returns complete list of all quest objects.
*
* @return a {@link java.util.List} object.
*/
public List<Quest_Assignment> getAllQuests() {
return allQuests;
}
/* id /**
* name * <p>getQuestsByIds.</p>
* desc *
* difficulty * @param availableQuestIds a {@link java.util.List} object.
* repeatable * @return a {@link java.util.List} object.
* numberWinsRequired */
* cardReward public List<Quest_Assignment> getQuestsByIds(List<Integer> availableQuestIds) {
* creditsReward List<Quest_Assignment> q = new ArrayList<Quest_Assignment>();
*/
for (Quest_Assignment qa : allQuests) {
if (availableQuestIds.contains(qa.getId())) {
q.add(qa);
}
}
return q;
}
/**
* <p>getQuestById.</p>
*
* @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);
}
/** /**
* <p>run.</p> * <p>run.</p>
* Assembles Quest_Assignment instances into allQuests.
*/ */
public void run() { public void run() {
Quest_Assignment qa; Quest_Assignment qa = null;
String s = readLine(); String line;
ArrayList<Integer> ids = new ArrayList<Integer>(); int i;
String[] linedata;
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()
/**
* <p>readLine.</p>
*
* @return a {@link java.lang.String} object.
*/
private String readLine() {
//makes the checked exception, into an unchecked runtime exception
try { try {
String s = in.readLine(); while ((line = br.readLine()) != null) {
if (s != null) s = s.trim(); if(line.equals("[quest]")) {
return s; qa = new Quest_Assignment();
} catch (Exception ex) { allQuests.add(qa);
ErrorViewer.showError(ex); }
throw new RuntimeException("ReadQuest_Assignment: readLine(Quest_Assignment) error"); 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()
} }

View File

@@ -1,6 +1,10 @@
package forge.quest.data; 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 forge.card.CardRarity;
import java.util.ArrayList; import java.util.ArrayList;
@@ -25,6 +29,7 @@ public class QuestUtil {
/** /**
* <p>getComputerCreatures.</p> * <p>getComputerCreatures.</p>
* Returns extra AI cards in play at start of quest.
* *
* @param qd a {@link forge.quest.data.QuestData} object. * @param qd a {@link forge.quest.data.QuestData} object.
* @param qa a {@link forge.Quest_Assignment} 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) { public static CardList getComputerCreatures(final QuestData qd, Quest_Assignment qa) {
CardList list = new CardList(); CardList list = new CardList();
if (qa != null) { if (qa != null) {
ArrayList<String> compCards = qa.getCompy(); list.addAll(qa.getAIExtraCards());
for (String s : compCards) {
Card c = AllZone.getCardFactory().getCard(s, AllZone.getComputerPlayer());
c.setCurSetCode(c.getMostRecentSet());
c.setImageFilename(CardUtil.buildFilename(c));
list.add(c);
}
} }
return list; return list;
} }
/** /**
* <p>getHumanPlantAndPet.</p> * <p>getHumanPlantAndPet.</p>
* Returns list of current plant/pet configuration.
* *
* @param qd a {@link forge.quest.data.QuestData} object. * @param qd a {@link forge.quest.data.QuestData} object.
* @return a {@link forge.CardList} object. * @return a {@link forge.CardList} object.
@@ -69,6 +67,8 @@ public class QuestUtil {
/** /**
* <p>getHumanPlantAndPet.</p> * <p>getHumanPlantAndPet.</p>
* 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 qd a {@link forge.quest.data.QuestData} object.
* @param qa a {@link forge.Quest_Assignment} 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) { public static CardList getHumanPlantAndPet(final QuestData qd, Quest_Assignment qa) {
CardList list = getHumanPlantAndPet(qd); CardList list = getHumanPlantAndPet(qd);
if (qa != null) { if (qa != null) {
list.addAll(qa.getHuman()); list.addAll(qa.getHumanExtraCards());
} }
return list; return list;
} }
/**
* <p>createToken.</p>
* 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;
}
/**
* <p>generateCardRewardList.</p>
* 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<CardPrinted> 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);
}
/** /**
* <p>setupQuest.</p> * <p>setupQuest.</p>
* * Assembled hard-coded quest options.
* @param qa a {@link forge.Quest_Assignment} object. * All non-deck-specific handling now takes place in quests.txt.
*
* @deprecated
* @param qa
*/ */
public static void setupQuest(Quest_Assignment 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 } //QuestUtil