Fix for Crib Swap
by mtgrares
Moderators: timmermac, Blacksmith, KrazyTheFox, Agetian, friarsol, CCGHQ Admins
Fix for Crib Swap
by 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
1 post
• Page 1 of 1
Who is online
Users browsing this forum: No registered users and 52 guests