It is currently 25 Apr 2024, 21:34
   
Text Size

Zur The Enchanter

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

Zur The Enchanter

Postby GandoTheBard » 22 Oct 2008, 18:20

This card has several bugs.

1) It shows you a list of enchantments, not your deck. And I suspect if you have one enchantment card in your deck you dont even see that.
2) If you choose an enchantment aura the aura targets nothing.
3) if you have a Shadowmage Infiltrator attacking at the same time Zur's ability triggers twice.
visit my personal homepage here: http://outofthebrokensky.com

Listen to my podcast with famed AJ_Impy "Freed from the Real" on http://puremtgo.com
User avatar
GandoTheBard
Tester
 
Posts: 1043
Joined: 06 Sep 2008, 18:43
Has thanked: 0 time
Been thanked: 0 time

Re: Zur The Enchanter

Postby DennisBergkamp » 22 Oct 2008, 18:56

Whoa, I'll look into those. Especially the Shadowmage Infiltrator bug seems strange.
Thanks for pointing them out :)

EDIT: It's not just Shadowmage Infiltrator that causes it to trigger twice, but any other creature that gets added as an attacker after Zur the Enchanter attacks. I'll fix this. The same problem occurs with Yore-Tiller Nephilim. I have to put a variable in the Card.java class that keeps track of whether a "trigger on attack" has already happened or not, then reset it next turn.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Zur The Enchanter

Postby GandoTheBard » 22 Oct 2008, 20:12

When you do fix it post the fixed exe or jar file please :) oh and might as well include your version of cards.txt
visit my personal homepage here: http://outofthebrokensky.com

Listen to my podcast with famed AJ_Impy "Freed from the Real" on http://puremtgo.com
User avatar
GandoTheBard
Tester
 
Posts: 1043
Joined: 06 Sep 2008, 18:43
Has thanked: 0 time
Been thanked: 0 time

Re: Zur The Enchanter

Postby DennisBergkamp » 22 Oct 2008, 20:46

I fixed #3, I'll look into #2... by the way, which auras did you have problems with?
#1 I could do several ways: either just show the whole library and whenever a non-enchantment card is picked, nothing happens. Or first show the whole library, then when the user clicks ok, I'll show a new list with enchantments cheaper or equal to a converted manacost of 3. What do you guys think?

I haven't been able to create JARs / executables yet... it generates a million warnings whenever I try compiling any of the source. I'm only able to just run directly from Eclipse.
I think jpb managed to compile his stuff and create a JAR file, maybe I'll gather all the updates posted here since 10-18, add everything into one big new version and either submit it to him, or try my luck creating a JAR again.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Zur The Enchanter

Postby GandoTheBard » 22 Oct 2008, 21:32

the "Aura" I had a problem with is Oblivion Ring which is really not an Aura I guess but it acts like one in some ways. Though am certain I would have this problem with any aura or enchantment with targets.
visit my personal homepage here: http://outofthebrokensky.com

Listen to my podcast with famed AJ_Impy "Freed from the Real" on http://puremtgo.com
User avatar
GandoTheBard
Tester
 
Posts: 1043
Joined: 06 Sep 2008, 18:43
Has thanked: 0 time
Been thanked: 0 time

Re: Zur The Enchanter

Postby DennisBergkamp » 23 Oct 2008, 14:40

I'm not 100% sure about this, but it looks like Oblivion Ring is the culprit in this case. I looked a bit at the code for it, and the way it works is that it wants you to select a target before paying the manacost.
What it really should do is let you select a target as it's coming into play. If that's how it was implemented, then it would trigger on Zur the Enchanter attacking.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time

Re: Zur The Enchanter

Postby DennisBergkamp » 26 Oct 2008, 17:53

Here's the fix #3 for creatures attacking after Zur the Enchanter, oh and it also adds Yore-Tiller Nephilim:

In Card.java:

Code: Select all
private boolean creatureAttackedThisTurn = false;
public void setCreatureAttackedThisTurn(boolean b) { creatureAttackedThisTurn = b; }
public boolean getCreatureAttackedThisTurn() { return creatureAttackedThisTurn; }
In combatUtil.java:

Code: Select all
private static void checkDeclareAttackers(Card c) //this method checks triggered effects of attacking creatures, right before defending player declares blockers
  { 
     if (AllZone.Phase.getPhase().equals("Declare Attackers"))
     {
        if(c.getName().equals("Zur the Enchanter") && !c.getCreatureAttackedThisTurn())
        {
           PlayerZone library = AllZone.getZone(Constant.Zone.Library, c.getController());
           PlayerZone play = AllZone.getZone(Constant.Zone.Play, c.getController());
          
             CardList enchantments = new CardList(library.getCards());
             enchantments = enchantments.getType("Enchantment");         
            
             if (enchantments.size() > 0) {
                for(int i=0;i < enchantments.size();i++)
                {
                   Card c1 = enchantments.get(i);
                   if (CardUtil.getConvertedManaCost(c1.getManaCost()) > 3)
                      enchantments.remove(c1); // get rid of all enchantments with a converted manacost higher than 3
                  
                }
            
                if (c.getController().equals("Human"))
                {
                   Object o = AllZone.Display.getChoiceOptional("Pick an enchantment to put into play", enchantments.toArray());
                   if(o != null)
                   {
                      library.remove(o);
                      play.add((Card)o);
                      AllZone.GameAction.shuffle(c.getController());
                      //we have to have cards like glorious anthem take effect immediately:
                      GameActionUtil.executeCardStateEffects();
                     
                   }
                }
                else if (c.getController().equals("Computer"))
                {
                   Card card = enchantments.get(0);
                   library.remove(card);
                   play.add(card);
                   AllZone.GameAction.shuffle(c.getController());
                   //we have to have cards like glorious anthem take effect immediately:
                   GameActionUtil.executeCardStateEffects();
                }
             } //enchantments.size > 0
             c.setCreatureAttackedThisTurn(true);
        }//Zur the enchanter
       
        else if(c.getName().equals("Yore-Tiller Nephilim") && !c.getCreatureAttackedThisTurn())
        {
           PlayerZone grave  = AllZone.getZone(Constant.Zone.Graveyard, c.getController());
           PlayerZone play  = AllZone.getZone(Constant.Zone.Play, c.getController());
          
           CardList creatures = new CardList(grave.getCards());
             creatures = creatures.getType("Creature");         
            
             if (creatures.size() > 0) {
                if (c.getController().equals("Human"))
                {
                   Object o = AllZone.Display.getChoiceOptional("Pick a creature to put into play", creatures.toArray());
                   if(o != null)
                   {
                      Card card = (Card)o;
                      grave.remove(card);
                      play.add(card);
                     
                      card.tap();
                      AllZone.Combat.addAttacker(card);
                      //the card that gets put into play tapped and attacking might trigger another ability:
                      checkDeclareAttackers(card);
                   }
                }
                else if (c.getController().equals("Computer"))
                {
                   Card card = creatures.get(0);
                   grave.remove(card);
                   play.add(card);
                  
                   card.tap();
                   AllZone.Combat.addAttacker(card);
                   checkDeclareAttackers(card);
                }
               
             } //if (creatures.size() > 0)
             c.setCreatureAttackedThisTurn(true);
        }//Yore-Tiller Nephilim
     }
  }//checkDeclareAttackers
cards.txt:

Code: Select all
Yore-Tiller Nephilim
W U B R
Creature Nephilim
Whenever Yore-Tiller Nephilim attacks, return target creature card from your graveyard to play tapped and attacking.
2/2
EDIT: "c.setCreatureAttackedThisTurn(true);" I should probably put in Combat.java or CombatUtil.java instead, since there might be other instances where we can use this.
User avatar
DennisBergkamp
AI Programmer
 
Posts: 2602
Joined: 09 Sep 2008, 15:46
Has thanked: 0 time
Been thanked: 0 time


Return to Forge

Who is online

Users browsing this forum: No registered users and 153 guests


Who is online

In total there are 153 users online :: 0 registered, 0 hidden and 153 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 153 guests

Login Form