- Added the missing code block for Take Possession to CardFactory_Sorceries.

This commit is contained in:
jendave
2011-08-06 05:59:26 +00:00
parent 0e56d645ac
commit 77c168271e

View File

@@ -8359,6 +8359,50 @@ public class CardFactory_Sorceries {
}//*************** END ************ END ************************** }//*************** END ************ END **************************
//*************** START *********** START **************************
else if(cardName.equals("Take Possession")) {
final SpellAbility spell = new Spell(card) {
private static final long serialVersionUID = -7359291736123492910L;
@Override
public boolean canPlayAI() {
return 0 < CardFactoryUtil.AI_getHumanCreature(card, true).size();
}
@Override
public void chooseTargetAI() {
Card best = CardFactoryUtil.AI_getBestCreature(CardFactoryUtil.AI_getHumanCreature(card, true));
setTargetCard(best);
}
@Override
public void resolve() {
Card c = getTargetCard();
c.setController(card.getController());
((PlayerZone_ComesIntoPlay) AllZone.Human_Play).setTriggers(false);
((PlayerZone_ComesIntoPlay) AllZone.Computer_Play).setTriggers(false);
PlayerZone from = AllZone.getZone(c);
PlayerZone to = AllZone.getZone(Constant.Zone.Play, card.getController());
from.remove(c);
to.add(c);
((PlayerZone_ComesIntoPlay) AllZone.Human_Play).setTriggers(true);
((PlayerZone_ComesIntoPlay) AllZone.Computer_Play).setTriggers(true);
}//resolve()
};
card.clearSpellAbility();
spell.setBeforePayMana(CardFactoryUtil.input_targetType(spell, "All"));
card.addSpellAbility(spell);
card.setSVar("PlayMain1", "TRUE");
}//*************** END ************ END **************************
// -1 means keyword "Cycling" not found // -1 means keyword "Cycling" not found
if(hasKeyword(card, "Cycling") != -1) { if(hasKeyword(card, "Cycling") != -1) {
int n = hasKeyword(card, "Cycling"); int n = hasKeyword(card, "Cycling");