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

Fix for Crib Swap

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

Fix for Crib Swap

Postby jpb » 12 Jan 2009, 09:09

I've seen a number of people complain about this one. The fix is to make the token's owner and controller the player who controlled the creature which was removed from the game by Crib Swap. Before it was always making whoever cast Crib Swap the Owner and Controller of the token, but putting it into play in the correct zone. To fix this replace the current Crib Swap card with the following in CardFactory.java.

Code: Select all
    //*************** START *********** START **************************
    if(cardName.equals("Crib Swap"))
    {
      SpellAbility spell = new Spell(card)
      {
        public void resolve()
        {
          if(AllZone.GameAction.isCardInPlay(getTargetCard()))
          {
            String player = getTargetCard().getController();
            makeToken(player);

            //remove card from play
            PlayerZone zone = AllZone.getZone(getTargetCard());
            zone.remove(getTargetCard());
          }
        }//resolve()
        public boolean canPlayAI()
        {
          CardList creature = new CardList(AllZone.Human_Play.getCards());
          creature = creature.getType("Creature");
          return creature.size() != 0 && (AllZone.Phase.getTurn() > 4);
        }
        public void chooseTargetAI()
        {
          CardList play = new CardList(AllZone.Human_Play.getCards());
          Card target = CardFactoryUtil.AI_getBestCreature(play);
          setTargetCard(target);
        }
        void makeToken(String player)
        {
          Card c = new Card();

          c.setName("Token");

          c.setOwner(player);
          c.setController(player);

          c.setManaCost("");
          c.setToken(true);

          c.addType("Creature");
          c.addType("Shapeshifter");
          c.setAttack(1);
          c.setDefense(1);

          PlayerZone play = AllZone.getZone(Constant.Zone.Play, player);
          play.add(c);
        }//makeToken()

      };
      spell.setBeforePayMana(CardFactoryUtil.input_targetCreature(spell));

      card.clearSpellAbility();
      card.addSpellAbility(spell);
    }//*************** END ************ END **************************
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 89 guests


Who is online

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

Login Form