Cardfactory bug hunting results
Post MTG Forge Related Programming Questions Here
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Cardfactory bug hunting results
by Sloth » 23 Jun 2009, 20:07
I was watching the development of this game for a while now and decided to follow the example of zerker2000 to start having a look at the Cardfactory code.
Here are two bugs that I found, with my fix suggestions: Both belong to the batch of mass pump spells:
1. Shield Wall didn't work because it it didn't get it's list of targets assigned:
Here are two bugs that I found, with my fix suggestions: Both belong to the batch of mass pump spells:
1. Shield Wall didn't work because it it didn't get it's list of targets assigned:
- Code: Select all
CardList list = new CardList();
if (cardName.equals("Chorus of Woe") || // Creatures "you" Control
cardName.equals("Dance of Shadows") ||
cardName.equals("Desperate Charge") ||
cardName.equals("Kjeldoran War Cry") ||
cardName.equals("Overrun") ||
cardName.equals("Path of Anger's Flame") ||
cardName.equals("Righteous Charge") ||
cardName.equals("Scare Tactics") ||
cardName.equals("Shield Wall") || // was missing
cardName.equals("Solidarity") ||
cardName.equals("Steadfastness") ||
cardName.equals("Virtuous Charge") ||
cardName.equals("Vitalizing Wind") ||
cardName.equals("Warrior's Charge") ||
cardName.equals("Warrior's Honor"))
{
PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController());
list.addAll(play.getCards());
}
- Code: Select all
if(AllZone.GameAction.isCardInPlay(target[0]))
{
target[0].addTempAttackBoost(pboost);
target[0].addTempDefenseBoost(tboost);
if(!kboost.equals("None"))
target[0].addExtrinsicKeyword("Trample"); // must be kboost
AllZone.EndOfTurn.addUntil(untilEOT);
}//if
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Cardfactory bug hunting results
by Rob Cashwalker » 23 Jun 2009, 20:58
One of my next goals is to keyword the multi-pump spells.
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: Cardfactory bug hunting results
by Sloth » 24 Jun 2009, 15:18
That would make adding Titanic Ultimatum quite easy. Most of the other mass pump spells have some special twists.
And don't forget that there are some AI rules hidden in that batch of code.
But while you're at it, you might consider keywording mass shrink effects too (like Infest and Nausea).
And don't forget that there are some AI rules hidden in that batch of code.
But while you're at it, you might consider keywording mass shrink effects too (like Infest and Nausea).
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Cardfactory bug hunting results
by DennisBergkamp » 24 Jun 2009, 15:32
Welcome Sloth
Titanic Ultimatum is actually implemented already... however, I guess it's not in the section of mass pump spells, if that's what you meant.
Titanic Ultimatum is actually implemented already... however, I guess it's not in the section of mass pump spells, if that's what you meant.
-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: Cardfactory bug hunting results
by Rob Cashwalker » 24 Jun 2009, 15:59
If I did make a multi-pump keyword, then it couldn't handle adding more than one keyword, so Titanic Ultimatum still needs its own explicit code.
The Pump keywords theoretically can handle shrink effects too. The problem is that they require a different AI, so it might as well be done separately. Plus, it's not a global effect - pretty much only black gets those effects, so it's not worth as much to the overall effort.
The Pump keywords theoretically can handle shrink effects too. The problem is that they require a different AI, so it might as well be done separately. Plus, it's not a global effect - pretty much only black gets those effects, so it's not worth as much to the overall effort.
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: Cardfactory bug hunting results
by Sloth » 28 Jun 2009, 15:45
Although not a bug in Cardfactory, but in cards.txt i noticed that Forgotten Cave and Secluded Steppe are missing a dot after 'Comes into play tapped', which causes them to malfunction.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Cardfactory bug hunting results
by Sloth » 30 Jun 2009, 12:06
Another thing I found is, that Mawcor doesn't use the keyword 'abDamageCP T:1' in card.txt. The ability is still written in cardfactory.
-
Sloth - Programmer
- Posts: 3498
- Joined: 23 Jun 2009, 19:40
- Has thanked: 125 times
- Been thanked: 507 times
Re: Cardfactory bug hunting results
by DennisBergkamp » 01 Jul 2009, 05:36
I think the main reason Mawcor is separate, because for the AI it's better to attack with it than to use its ability in a lot of cases. But I don't know, what do you guys think?
-
DennisBergkamp - AI Programmer
- Posts: 2602
- Joined: 09 Sep 2008, 15:46
- Has thanked: 0 time
- Been thanked: 0 time
Re: Cardfactory bug hunting results
by Rob Cashwalker » 01 Jul 2009, 11:59
There's a line in the canPlayAI along the lines of if(CreatureDoesAttack) to check if the AI would rather attack with the creature instead of using the ability. If anything, I'd say that this code would need to be improved if you want the AI to not use the ability.DennisBergkamp wrote:I think the main reason Mawcor is separate, because for the AI it's better to attack with it than to use its ability in a lot of cases. But I don't know, what do you guys think?
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
9 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 70 guests