Forge Mod--Get 3 cards from defeated enemies
by mtgrares
Moderators: timmermac, friarsol, Blacksmith, KrazyTheFox, Agetian, CCGHQ Admins
Forge Mod--Get 3 cards from defeated enemies
by lerkspikes » 01 Aug 2010, 01:57
I modded the QuestData and Gui_WinLose files to make 2 changes:
1 - about 15x as much money per victory (150 + 5*wins, instead of 10 + .3*wins)
2 - Whenever you defeat an opponent, you get 3 unique cards from their deck, which do not include basic lands. (it picks 3 cards from the deck, does not pick basic lands, and won't pick the same card twice). It displays these 3 cards the same way it displays a random rare when you win one of those.
3 - When you start the game, there are a lot more cards in your deck. I increased the number of commons more than I increased the number of uncommon/rare cards, so it's not like you start with an epic deck full of great rares, but you get enough cards that you can choose 1-3 colors and make a deck out of it.
I've been using it for about a week now, and it works without problems.
I like how it changes the game. I have more dual lands and more moxen, because the computer opponents have lots of those things. It also encourages you to fight against specific opponents if you like the cards in their deck. Also, you get lots of money for normal wins, so you don't have to do silly things like try to mill your opponents to death every time just to get a couple of bucks.
You can install the mod by editing the forge .jar file with 7-zip. You open up the .jar with 7-zip, open the "Forge" folder, and then copy the two modded files into the .jar, overwriting the vanilla versions.
However, I made this mod based on source code I downloaded from the repository. It's not compatible with the previous normal release of Forge. It may or may not be compatible with the version of Forge you download from the repository, because the repository keeps changing.
Therefore, I'm not ready to distribute the modded files yet. If there is interest, I could distribute them to be compatible with the next release of Forge, when that occurs. Please let me know what you think.
1 - about 15x as much money per victory (150 + 5*wins, instead of 10 + .3*wins)
2 - Whenever you defeat an opponent, you get 3 unique cards from their deck, which do not include basic lands. (it picks 3 cards from the deck, does not pick basic lands, and won't pick the same card twice). It displays these 3 cards the same way it displays a random rare when you win one of those.
3 - When you start the game, there are a lot more cards in your deck. I increased the number of commons more than I increased the number of uncommon/rare cards, so it's not like you start with an epic deck full of great rares, but you get enough cards that you can choose 1-3 colors and make a deck out of it.
I've been using it for about a week now, and it works without problems.
I like how it changes the game. I have more dual lands and more moxen, because the computer opponents have lots of those things. It also encourages you to fight against specific opponents if you like the cards in their deck. Also, you get lots of money for normal wins, so you don't have to do silly things like try to mill your opponents to death every time just to get a couple of bucks.
You can install the mod by editing the forge .jar file with 7-zip. You open up the .jar with 7-zip, open the "Forge" folder, and then copy the two modded files into the .jar, overwriting the vanilla versions.
However, I made this mod based on source code I downloaded from the repository. It's not compatible with the previous normal release of Forge. It may or may not be compatible with the version of Forge you download from the repository, because the repository keeps changing.
Therefore, I'm not ready to distribute the modded files yet. If there is interest, I could distribute them to be compatible with the next release of Forge, when that occurs. Please let me know what you think.
- lerkspikes
- Posts: 4
- Joined: 26 Jul 2010, 01:40
- Has thanked: 0 time
- Been thanked: 0 time
Re: Forge Mod--Get 3 cards from defeated enemies
by DennisBergkamp » 01 Aug 2010, 21:24
Whoa, this is pretty cool... it basically makes for a much faster quest.
-

DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: Forge Mod--Get 3 cards from defeated enemies
by friarsol » 02 Aug 2010, 01:07
If there's a lot of interest in this we can probably pull those numbers from the code and have them in a data file that's read when the game loads. This way you wouldn't need a full mod of the code, it would just be a data file that gets tweaked.
Lerk, you want to post your code changes? We can add them into the SVN and use them if a flag in that same data file is turned on. It'd be off for the default cases.
Lerk, you want to post your code changes? We can add them into the SVN and use them if a flag in that same data file is turned on. It'd be off for the default cases.
- friarsol
- Global Moderator
- Posts: 7575
- Joined: 15 May 2010, 04:20
- Has thanked: 242 times
- Been thanked: 956 times
Re: Forge Mod--Get 3 cards from defeated enemies
by Rob Cashwalker » 02 Aug 2010, 02:34
In our current quest environment, I think it would be better to implement this as a skill to be purchased at the bazaar.
Eventually, the map-mode quest will likely allow for this as one of a few types of rewards for killing the opponent.
Eventually, the map-mode quest will likely allow for this as one of a few types of rewards for killing the opponent.
The Force will be with you, Always.
-

Rob Cashwalker - Programmer
- Posts: 2167
- Joined: 09 Sep 2008, 15:09
- Location: New York
- Has thanked: 5 times
- Been thanked: 40 times
Re: Forge Mod--Get 3 cards from defeated enemies
by lerkspikes » 02 Aug 2010, 03:23
//The money mod is very easy, you only have to change one line of QuestData:
long creds = (long) (10 + (.3 * win)); //this is the old version
long creds = (long) (150 + (5 * win)); //this is the new version
//The win-cards-from-opponents mod is more complicated.
//First, when you've chosen your opponent, before the match starts,
//it picks three cards. To do this, I changed the method ai_getDeckNewFormat,
//and added a new helper method called reserveOppoCard.
public Deck ai_getDeckNewFormat(String deckName) {
DeckIO deckIO = new NewDeckIO(ForgeProps.getFile(QUEST.DECKS), true);
Deck aiDeck = deckIO.readDeck(deckName);
reserveOppoCard.clear();
for(int i = 0; i < 3; i++) //the "3" here indicates that the computer will reserve 3 cards.
{
reserveOppoCard(aiDeck);
}
return aiDeck;
}
//if the computer ever had a deck with only 1 or 2 cards that were not basic lands, this would go into an infinite loop
//since that shouldn't happen, I'm not worried about this
//it would be easy to put in a counter so that it only tries 100 times to find a card before giving up.
//that would be something to include in any final version
private void reserveOppoCard(final Deck d)
{
final int index = (int)(Math.random() * d.countMain());
final String c = d.getMain().get(index);
if(!basicLands.contains(c) && !reserveOppoCard.contains(c))
{
reserveOppoCard.add(c);
}
else
{
reserveOppoCard(d);
}
}
//i added a variable called "reserveOppoCard" which is an ArrayList<String>
//i also created a variable called "basicLands" which is an ArrayList<String> as well.
//As you might expect, it contains the names of the ten basic lands.
//I modified the constructor so it would set this up for me to use later.
public QuestData() {
basicLands = new ArrayList<String>(10);
basicLands.add("Forest");
basicLands.add("Mountain");
basicLands.add("Swamp");
basicLands.add("Island");
basicLands.add("Plains");
basicLands.add("Snow-Covered Forest");
basicLands.add("Snow-Covered Mountain");
basicLands.add("Snow-Covered Swamp");
basicLands.add("Snow-Covered Island");
basicLands.add("Snow-Covered Plains");
for(int i = 0; i < 20; i++) {
cardPool.addAll(basicLands);
}//for
}//QuestData
//finally, i created a method called "addOppoCard" which the Gui_WinLose class will call.
//Each time this method is called, it adds one of the reserved cards, and sends back info so Gui_WinLose can display the card.
//here is the code in QuestData
//a return value of "null" indicates there are no more reserved cards to add
public String addOppoCard()
{
if(reserveOppoCard.isEmpty())
{
return null;
}
final String c = reserveOppoCard.remove(0);
this.cardPool.add(c);
this.newCardList.add(c);
return GuiDisplayUtil.cleanString(c);
}
//here is the code in Gui_WinLose
//this code goes inside the "if (wonMatch){" block.
String fileName1 = quest.addOppoCard();
while(fileName1 != null)
{
ImageIcon icon1 = getCardIcon(fileName1 + ".jpg");
JOptionPane.showMessageDialog(null, "", "You have won an opponent's card.", 1, icon1);
fileName1 = quest.addOppoCard();
}
// to change the number of starting cards, I added multipliers to this code in QuestData:
list.addAll(boosterPack.getCommon(totals[n][0] * 3));
list.addAll(boosterPack.getUncommon(totals[n][1] * 5));
list.addAll(boosterPack.getRare(totals[n][2] * 7));
long creds = (long) (10 + (.3 * win)); //this is the old version
long creds = (long) (150 + (5 * win)); //this is the new version
//The win-cards-from-opponents mod is more complicated.
//First, when you've chosen your opponent, before the match starts,
//it picks three cards. To do this, I changed the method ai_getDeckNewFormat,
//and added a new helper method called reserveOppoCard.
public Deck ai_getDeckNewFormat(String deckName) {
DeckIO deckIO = new NewDeckIO(ForgeProps.getFile(QUEST.DECKS), true);
Deck aiDeck = deckIO.readDeck(deckName);
reserveOppoCard.clear();
for(int i = 0; i < 3; i++) //the "3" here indicates that the computer will reserve 3 cards.
{
reserveOppoCard(aiDeck);
}
return aiDeck;
}
//if the computer ever had a deck with only 1 or 2 cards that were not basic lands, this would go into an infinite loop
//since that shouldn't happen, I'm not worried about this
//it would be easy to put in a counter so that it only tries 100 times to find a card before giving up.
//that would be something to include in any final version
private void reserveOppoCard(final Deck d)
{
final int index = (int)(Math.random() * d.countMain());
final String c = d.getMain().get(index);
if(!basicLands.contains(c) && !reserveOppoCard.contains(c))
{
reserveOppoCard.add(c);
}
else
{
reserveOppoCard(d);
}
}
//i added a variable called "reserveOppoCard" which is an ArrayList<String>
//i also created a variable called "basicLands" which is an ArrayList<String> as well.
//As you might expect, it contains the names of the ten basic lands.
//I modified the constructor so it would set this up for me to use later.
public QuestData() {
basicLands = new ArrayList<String>(10);
basicLands.add("Forest");
basicLands.add("Mountain");
basicLands.add("Swamp");
basicLands.add("Island");
basicLands.add("Plains");
basicLands.add("Snow-Covered Forest");
basicLands.add("Snow-Covered Mountain");
basicLands.add("Snow-Covered Swamp");
basicLands.add("Snow-Covered Island");
basicLands.add("Snow-Covered Plains");
for(int i = 0; i < 20; i++) {
cardPool.addAll(basicLands);
}//for
}//QuestData
//finally, i created a method called "addOppoCard" which the Gui_WinLose class will call.
//Each time this method is called, it adds one of the reserved cards, and sends back info so Gui_WinLose can display the card.
//here is the code in QuestData
//a return value of "null" indicates there are no more reserved cards to add
public String addOppoCard()
{
if(reserveOppoCard.isEmpty())
{
return null;
}
final String c = reserveOppoCard.remove(0);
this.cardPool.add(c);
this.newCardList.add(c);
return GuiDisplayUtil.cleanString(c);
}
//here is the code in Gui_WinLose
//this code goes inside the "if (wonMatch){" block.
String fileName1 = quest.addOppoCard();
while(fileName1 != null)
{
ImageIcon icon1 = getCardIcon(fileName1 + ".jpg");
JOptionPane.showMessageDialog(null, "", "You have won an opponent's card.", 1, icon1);
fileName1 = quest.addOppoCard();
}
// to change the number of starting cards, I added multipliers to this code in QuestData:
list.addAll(boosterPack.getCommon(totals[n][0] * 3));
list.addAll(boosterPack.getUncommon(totals[n][1] * 5));
list.addAll(boosterPack.getRare(totals[n][2] * 7));
- lerkspikes
- Posts: 4
- Joined: 26 Jul 2010, 01:40
- Has thanked: 0 time
- Been thanked: 0 time
Re: Forge Mod--Get 3 cards from defeated enemies
by lerkspikes » 02 Aug 2010, 06:27
In response to Mr. Cashwalker:
It seems like there isn't much difference between "easy" and "very hard" quests, except that the very hard quest gives you more opportunity to play against easy opponents. So in a way, the "very hard" quest is easier than the easy quest, especially when you can win cards from opponents and win more money per match.
In my opinion, instead of the difficulty level controlling the number of matches you have to play to advance, it should all be what is currently "very hard." Instead, the difficulty level should have a large effect on how many cards you start with, and how good your rewards are for winning matches.
Better players may appreciate the challenge of building a deck from limited cards (on harder settings), while others might want to get lots of high-powered cards to make fun decks with (on easier settings).
Regarding purchasing an ability at the bazaar, you could set it up so that the cards players win are limited by their money value. You could set it up so that until an upgrade is purchased from the bazaar, players could only win cards costing less than 25, and progressively allow the player to increase the money-value ceiling until they were able to win moxen and other very-expensive cards. Alternatively, the upgrades could limit players to winning common, uncommon, and rare cards from the decks.
It seems like there isn't much difference between "easy" and "very hard" quests, except that the very hard quest gives you more opportunity to play against easy opponents. So in a way, the "very hard" quest is easier than the easy quest, especially when you can win cards from opponents and win more money per match.
In my opinion, instead of the difficulty level controlling the number of matches you have to play to advance, it should all be what is currently "very hard." Instead, the difficulty level should have a large effect on how many cards you start with, and how good your rewards are for winning matches.
Better players may appreciate the challenge of building a deck from limited cards (on harder settings), while others might want to get lots of high-powered cards to make fun decks with (on easier settings).
Regarding purchasing an ability at the bazaar, you could set it up so that the cards players win are limited by their money value. You could set it up so that until an upgrade is purchased from the bazaar, players could only win cards costing less than 25, and progressively allow the player to increase the money-value ceiling until they were able to win moxen and other very-expensive cards. Alternatively, the upgrades could limit players to winning common, uncommon, and rare cards from the decks.
- lerkspikes
- Posts: 4
- Joined: 26 Jul 2010, 01:40
- Has thanked: 0 time
- Been thanked: 0 time
Re: Forge Mod--Get 3 cards from defeated enemies
by mtgrares » 02 Aug 2010, 21:23
I created the "difficultly" settings awhile ago. The hard quest are "hard" just because they are longer. And you are right, "So in a way, the "very hard" quest is easier than the easy quest, especially when you can win cards from opponents and win more money per match." I have no real idea how to make the easy mode "easy" and the hard mode "hard" (except with the great AI decks that are divided into easy, medium, and hard.)lerkspikes wrote:It seems like there isn't much difference between "easy" and "very hard" quests, except that the very hard quest gives you more opportunity to play against easy opponents. So in a way, the "very hard" quest is easier than the easy quest, especially when you can win cards from opponents and win more money per match.
The quest mode was just a quick hack that has grown. (Well that is true for Forge also, ha.)
- mtgrares
- DEVELOPER
- Posts: 1352
- Joined: 08 Sep 2008, 22:10
- Has thanked: 3 times
- Been thanked: 12 times
Re: Forge Mod--Get 3 cards from defeated enemies
by Chris H. » 02 Aug 2010, 21:56
`mtgrares wrote:I created the "difficultly" settings awhile ago. The hard quest are "hard" just because they are longer. And you are right, "So in a way, the "very hard" quest is easier than the easy quest, especially when you can win cards from opponents and win more money per match." I have no real idea how to make the easy mode "easy" and the hard mode "hard" (except with the great AI decks that are divided into easy, medium, and hard.)
In fantasy mode we have a card shop and credits. We might want to consider adjusting the credits won depending on the difficulty setting?
-

Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Forge Mod--Get 3 cards from defeated enemies
by Chris H. » 03 Aug 2010, 01:13
`Chris H. wrote:In fantasy mode we have a card shop and credits. We might want to consider adjusting the credits won depending on the difficulty setting?
I had a few more thoughts on the fantasy quest mode. LerkSpikes brought up a couple of issues.
What if the realistic mode was always 30 or 40 games long for each of the 4 difficulty settings. This way, the Easy setting would have you play against more easy opponent decks than the Very Hard setting.
Dennis also at one point suggested that it might be nice to have an ante option to win cards from the opponent decks. Winning 3 cards from the opponent decks might be viewed by some people as being excessive. May want the ante option to only happen vs hard decks and even then it can only happen as a percentage chance. Like 25% to start and this can go up slightly with bazaar upgrades.
We might also want to consider a slight increase in the size of the starting card pool based on the difficulty setting.
Easy = 275 cards + 2 booster pack
Medium = 275 cards + 1 booster pack
Hard = 275 cards
Very Hard = 275 cards - 1 booster pack
-

Chris H. - Forge Moderator
- Posts: 6320
- Joined: 04 Nov 2008, 12:11
- Location: Mac OS X Yosemite
- Has thanked: 644 times
- Been thanked: 643 times
Re: Forge Mod--Get 3 cards from defeated enemies
by lerkspikes » 04 Aug 2010, 15:00
Re: Chris H., I think there should be a lot more difference between the difficulty levels. Easy (or "Very Easy") should allow noobs enough cards to put a deck together, whereas "Very Hard" should be like a challenge/puzzle for experienced players ("how can I make a deck out of these random cards and start winning games?").
- lerkspikes
- Posts: 4
- Joined: 26 Jul 2010, 01:40
- Has thanked: 0 time
- Been thanked: 0 time
Re: Forge Mod--Get 3 cards from defeated enemies
by friarsol » 04 Aug 2010, 15:55
The way this was solved in Shandalar was that a color was chosen by the player along with a difficulty.lerkspikes wrote:Re: Chris H., I think there should be a lot more difference between the difficulty levels. Easy (or "Very Easy") should allow noobs enough cards to put a deck together, whereas "Very Hard" should be like a challenge/puzzle for experienced players ("how can I make a deck out of these random cards and start winning games?").
On Easy, you got 80% primary color 20% one friendly color.
Medium, 70% primary, 15% each friendly color.
Hard, 60% primary, 15% each friendly color, 10% one enemy color.
Very Hard, 50% primary, 15% each friendly color, 10% each enemy color.
These percentages weren't hard values, so you can start Shandalar games without any land of one color on Very Hard, even if you have cards of that color.
- friarsol
- Global Moderator
- Posts: 7575
- Joined: 15 May 2010, 04:20
- Has thanked: 242 times
- Been thanked: 956 times
11 posts
• Page 1 of 1
Who is online
Users browsing this forum: Google [Bot] and 11 guests
