It is currently 10 May 2025, 13:32
   
Text Size

Fix for Archon of Justice.

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

Fix for Archon of Justice.

Postby jpb » 12 Jan 2009, 09:07

As reported by GandoTheBard Archon of Justice is missing it's "When Archon of Justice is put into a graveyard from play, remove target permanent from the game." To add this ability put the following anywhere in CardFactory.java

Code: Select all
    //*************** START *********** START **************************
    if(cardName.equals("Archon of Justice"))
    {
        final SpellAbility ability = new Ability(card, "0")
        {
          public void resolve()
          {
            if(getTargetCard() != null){
                if(AllZone.GameAction.isCardInPlay(getTargetCard()))
                {
                  PlayerZone play = AllZone.getZone(getTargetCard());
                  play.remove(getTargetCard());
                }
            }
          }
        };
        ability.setStackDescription("Archon of Justice - Remove target permament from the game.");
       
        Command leavesPlay = new Command()
        {
          public void execute()
          {
            if(card.getController().equals(Constant.Player.Human))
              AllZone.InputControl.setInput(CardFactoryUtil.input_targetPermanent(ability));
            else
            {
                //if computer controlled Archon of Justice have it select the best creature, or enchantment, or artifact, whatever the human controllers, and as a last option a card it controls
               
               CardList human_list = new CardList(AllZone.Human_Play.getCards());
               ability.setTargetCard(CardFactoryUtil.AI_getBestCreature(human_list));
               if(ability.getTargetCard() == null){
                  ability.setTargetCard(CardFactoryUtil.AI_getBestEnchantment(human_list));
               }
               if(ability.getTargetCard() == null){
                  ability.setTargetCard(CardFactoryUtil.AI_getBestArtifact(human_list));
               }
               if(ability.getTargetCard() == null){
                  if(human_list.size() == 0){
                     CardList computer_list = new CardList(AllZone.Computer_Play.getCards());
                     if(computer_list.size() == 0){
                        return; //we have nothing in play to destroy.
                     }
                     else{
                        ability.setTargetCard(computer_list.get(0)); //should determine the worst card to destroy, but this case wont be hit much.
                     }
                  }
                  ability.setTargetCard(human_list.get(0));
               }
              AllZone.Stack.add(ability);
            }
          }//execute()
        };//Command
        card.setDestroy(leavesPlay);
    }//*************** END ************ END **************************
This card will require the following fix to CardFactoryUtils.java as well. Replace the current AI_getBestEnchantment and AI_getBestArtifact methods with the following.

Code: Select all
  public static Card AI_getBestEnchantment(CardList list)
  {
    CardList all = list;
    all = all.getType("Enchantment");
    if(all.size() == 0){
       return null;
    }
   
    //get biggest Enchantment
    Card biggest = null;
    biggest = all.get(0);

    for(int i = 0; i < all.size(); i++){
        if(CardUtil.getConvertedManaCost(biggest.getManaCost()) >= CardUtil.getConvertedManaCost(biggest.getManaCost())){
          biggest = all.get(i);
        }
    }

    return biggest;
  }

  //The AI doesn't really pick the best artifact, just the most expensive.
   public static Card AI_getBestArtifact(CardList list)
   {
     CardList all = list;
     all = all.getType("Artifact");
     if(all.size() == 0){
         return null;
      }
     
     //get biggest Artifact
     Card biggest = null;
     biggest = all.get(0);

     for(int i = 0; i < all.size(); i++){
         if(CardUtil.getConvertedManaCost(biggest.getManaCost()) >= CardUtil.getConvertedManaCost(biggest.getManaCost())){
           biggest = all.get(i);
         }
     }

     return biggest;
   }
jpb
 
Posts: 132
Joined: 05 Sep 2008, 13:12
Has thanked: 0 time
Been thanked: 0 time

Re: Fix for Archon of Justice.

Postby GandoTheBard » 12 Jan 2009, 10:03

Hmm looks like you set it to destroy when it is supposed to remove from play.
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: Fix for Archon of Justice.

Postby jpb » 12 Jan 2009, 11:02

Nope. It removes the card from play. Card.setDestroy(Ability) sets the ability to trigger when the card gets destroyed.
jpb
 
Posts: 132
Joined: 05 Sep 2008, 13:12
Has thanked: 0 time
Been thanked: 0 time


Return to Forge

Who is online

Users browsing this forum: No registered users and 28 guests


Who is online

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

Login Form