mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 11:48:02 +00:00
- Kiki-Jiki, Mirror Breaker should work correctly now with Doubling Season.
This commit is contained in:
@@ -672,72 +672,88 @@ public class CardFactory_Creatures {
|
|||||||
&& getTargetCard().getController().equals(card.getController())
|
&& getTargetCard().getController().equals(card.getController())
|
||||||
&& CardFactoryUtil.canTarget(card, getTargetCard())) {
|
&& CardFactoryUtil.canTarget(card, getTargetCard())) {
|
||||||
|
|
||||||
Card copy;
|
int multiplier = 1;
|
||||||
if(!getTargetCard().isToken()) {
|
int doublingSeasons = CardFactoryUtil.getCards("Doubling Season", card.getController()).size();
|
||||||
//CardFactory cf = new CardFactory("cards.txt");
|
if(doublingSeasons > 0) multiplier = (int) Math.pow(2, doublingSeasons);
|
||||||
|
Card[] crds = new Card[multiplier];
|
||||||
|
|
||||||
//copy creature and put it into play
|
for (int i=0;i<multiplier;i++)
|
||||||
//copy = getCard(getTargetCard(), getTargetCard().getName(), card.getController());
|
{
|
||||||
copy = cfact.getCard(getTargetCard().getName(), getTargetCard().getOwner());
|
|
||||||
|
|
||||||
//when copying something stolen:
|
Card copy;
|
||||||
copy.setController(getTargetCard().getController());
|
if(!getTargetCard().isToken()) {
|
||||||
|
//CardFactory cf = new CardFactory("cards.txt");
|
||||||
copy.setToken(true);
|
|
||||||
copy.setCopiedToken(true);
|
|
||||||
|
//copy creature and put it into play
|
||||||
if(getTargetCard().isFaceDown()) {
|
//copy = getCard(getTargetCard(), getTargetCard().getName(), card.getController());
|
||||||
copy.setIsFaceDown(true);
|
copy = cfact.getCard(getTargetCard().getName(), getTargetCard().getOwner());
|
||||||
copy.setManaCost("");
|
|
||||||
copy.setBaseAttack(2);
|
//when copying something stolen:
|
||||||
copy.setBaseDefense(2);
|
copy.setController(getTargetCard().getController());
|
||||||
copy.setIntrinsicKeyword(new ArrayList<String>()); //remove all keywords
|
|
||||||
copy.setType(new ArrayList<String>()); //remove all types
|
copy.setToken(true);
|
||||||
copy.addType("Creature");
|
copy.setCopiedToken(true);
|
||||||
copy.clearSpellAbility(); //disallow "morph_up"
|
|
||||||
}
|
if(getTargetCard().isFaceDown()) {
|
||||||
copy.addIntrinsicKeyword("Haste");
|
copy.setIsFaceDown(true);
|
||||||
} else //isToken()
|
copy.setManaCost("");
|
||||||
{
|
copy.setBaseAttack(2);
|
||||||
Card c = getTargetCard();
|
copy.setBaseDefense(2);
|
||||||
|
copy.setIntrinsicKeyword(new ArrayList<String>()); //remove all keywords
|
||||||
copy = new Card();
|
copy.setType(new ArrayList<String>()); //remove all types
|
||||||
|
copy.addType("Creature");
|
||||||
copy.setName(c.getName());
|
copy.clearSpellAbility(); //disallow "morph_up"
|
||||||
copy.setImageName(c.getImageName());
|
}
|
||||||
|
copy.addIntrinsicKeyword("Haste");
|
||||||
copy.setOwner(c.getController());
|
} else //isToken()
|
||||||
copy.setController(c.getController());
|
{
|
||||||
|
Card c = getTargetCard();
|
||||||
copy.setManaCost(c.getManaCost());
|
|
||||||
copy.setToken(true);
|
copy = new Card();
|
||||||
|
|
||||||
copy.setType(c.getType());
|
copy.setName(c.getName());
|
||||||
|
copy.setImageName(c.getImageName());
|
||||||
copy.setBaseAttack(c.getBaseAttack());
|
|
||||||
copy.setBaseDefense(c.getBaseDefense());
|
copy.setOwner(c.getController());
|
||||||
copy.addIntrinsicKeyword("Haste");
|
copy.setController(c.getController());
|
||||||
}
|
|
||||||
|
copy.setManaCost(c.getManaCost());
|
||||||
PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController());
|
copy.setToken(true);
|
||||||
play.add(copy);
|
|
||||||
|
copy.setType(c.getType());
|
||||||
|
|
||||||
|
copy.setBaseAttack(c.getBaseAttack());
|
||||||
|
copy.setBaseDefense(c.getBaseDefense());
|
||||||
|
copy.addIntrinsicKeyword("Haste");
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
PlayerZone play = AllZone.getZone(Constant.Zone.Play, card.getController());
|
||||||
|
play.add(copy);
|
||||||
|
crds[i] = copy;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
//have to do this since getTargetCard() might change
|
//have to do this since getTargetCard() might change
|
||||||
//if Kiki-Jiki somehow gets untapped again
|
//if Kiki-Jiki somehow gets untapped again
|
||||||
final Card[] target = new Card[1];
|
final Card[] target = new Card[multiplier];
|
||||||
target[0] = copy;
|
for (int i=0;i<multiplier;i++) {
|
||||||
Command atEOT = new Command() {
|
final int index = i;
|
||||||
private static final long serialVersionUID = 7803915905490565557L;
|
target[i] = crds[i];
|
||||||
|
Command atEOT = new Command() {
|
||||||
public void execute() {
|
private static final long serialVersionUID = 7803915905490565557L;
|
||||||
//technically your opponent could steal the token
|
|
||||||
//and the token shouldn't be sacrificed
|
public void execute() {
|
||||||
if(AllZone.GameAction.isCardInPlay(target[0])) AllZone.GameAction.sacrifice(target[0]); //maybe do a setSacrificeAtEOT, but probably not.
|
//technically your opponent could steal the token
|
||||||
}
|
//and the token shouldn't be sacrificed
|
||||||
};//Command
|
if(AllZone.GameAction.isCardInPlay(target[index])) AllZone.GameAction.sacrifice(target[index]); //maybe do a setSacrificeAtEOT, but probably not.
|
||||||
AllZone.EndOfTurn.addAt(atEOT);
|
}
|
||||||
|
};//Command
|
||||||
|
AllZone.EndOfTurn.addAt(atEOT);
|
||||||
|
}
|
||||||
}//is card in play?
|
}//is card in play?
|
||||||
}//resolve()
|
}//resolve()
|
||||||
};//SpellAbility
|
};//SpellAbility
|
||||||
|
|||||||
Reference in New Issue
Block a user