Fix for control magic
by mtgrares
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Fix for control magic
by 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
- mtgrares
- DEVELOPER
- Posts: 1352
- Joined: 08 Sep 2008, 22:10
- Has thanked: 3 times
- Been thanked: 12 times
2 posts
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 45 guests