It is currently 19 Apr 2024, 03:37
   
Text Size

Cardfactory bug hunting results

Post MTG Forge Related Programming Questions Here

Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins

Cardfactory bug hunting results

Postby 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:

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());
            }
2. Dance of Shadows gave your creatures Trample instead of Fear because the String variable kboost wasn't really used when adding keywords to your creatures:

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
keep up the great work!
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Cardfactory bug hunting results

Postby 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.
User avatar
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

Postby 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).
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Cardfactory bug hunting results

Postby 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.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Cardfactory bug hunting results

Postby 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 Force will be with you, Always.
User avatar
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

Postby 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.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Cardfactory bug hunting results

Postby 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.
User avatar
Sloth
Programmer
 
Posts: 3498
Joined: 23 Jun 2009, 19:40
Has thanked: 125 times
Been thanked: 507 times

Re: Cardfactory bug hunting results

Postby 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?
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Cardfactory bug hunting results

Postby Rob Cashwalker » 01 Jul 2009, 11:59

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?
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.
The Force will be with you, Always.
User avatar
Rob Cashwalker
Programmer
 
Posts: 2167
Joined: 09 Sep 2008, 15:09
Location: New York
Has thanked: 5 times
Been thanked: 40 times


Return to Developer's Corner

Who is online

Users browsing this forum: No registered users and 44 guests


Who is online

In total there are 44 users online :: 0 registered, 0 hidden and 44 guests (based on users active over the past 10 minutes)
Most users ever online was 4143 on 23 Jan 2024, 08:21

Users browsing this forum: No registered users and 44 guests

Login Form