It is currently 19 Apr 2024, 06:41
   
Text Size

Fix for control magic

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

Fix for control magic

Postby jpb » 15 Jan 2009, 07:09

Almost_Clever reported that Control Magic was buggy. The bug was that the card control magic targets would keep it's controller and just change zones. Here is the fix. Replace the current Control Magic card in CardFactory with the following.

Code: Select all
    //*************** START *********** START **************************
    if(cardName.equals("Control Magic"))
    {
      final SpellAbility spell = new Spell(card)
      {
        public boolean canPlayAI()
        {
          CardList c = CardFactoryUtil.AI_getHumanCreature();
          CardListUtil.sortAttack(c);
          CardListUtil.sortFlying(c);

          if(c.isEmpty())
            return false;

          if(2 <= c.get(0).getAttack() && c.get(0).getKeyword().contains("Flying"))
          {
            setTargetCard(c.get(0));
            return true;
          }

          CardListUtil.sortAttack(c);
          if(4 <= c.get(0).getAttack())
          {
            setTargetCard(c.get(0));
            return true;
          }

          return false;
        }//canPlayAI()
        public void resolve()
        {
          Card c = getTargetCard();
          if(AllZone.GameAction.isCardInPlay(c))
          {
           //set summoning sickness
            if(c.getKeyword().contains("Haste")){
              c.setSickness(false);
            }
            else{
              c.setSickness(true);
            }
            
            ((PlayerZone_ComesIntoPlay)AllZone.Human_Play).setTrigger(false);
            ((PlayerZone_ComesIntoPlay)AllZone.Computer_Play).setTrigger(false);

            PlayerZone from = AllZone.getZone(c);
            from.remove(c);
           
            c.setController(card.getController());

            PlayerZone to = AllZone.getZone(Constant.Zone.Play, card.getController());
            to.add(c);

            ((PlayerZone_ComesIntoPlay)AllZone.Human_Play).setTrigger(true);
            ((PlayerZone_ComesIntoPlay)AllZone.Computer_Play).setTrigger(true);
          }
        }//resolve()
      };//SpellAbility
      card.clearSpellAbility();
      card.addSpellAbility(spell);

      spell.setBeforePayMana(CardFactoryUtil.input_targetCreature(spell));
    }//*************** END ************ END **************************
jpb
 
Posts: 132
Joined: 05 Sep 2008, 13:12
Has thanked: 0 time
Been thanked: 0 time

Re: Fix for control magic

Postby mtgrares » 15 Jan 2009, 20:03

Thanks for the bug fixes.
mtgrares
DEVELOPER
 
Posts: 1352
Joined: 08 Sep 2008, 22:10
Has thanked: 3 times
Been thanked: 12 times


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