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,6 +672,15 @@ public class CardFactory_Creatures {
|
||||
&& getTargetCard().getController().equals(card.getController())
|
||||
&& CardFactoryUtil.canTarget(card, getTargetCard())) {
|
||||
|
||||
int multiplier = 1;
|
||||
int doublingSeasons = CardFactoryUtil.getCards("Doubling Season", card.getController()).size();
|
||||
if(doublingSeasons > 0) multiplier = (int) Math.pow(2, doublingSeasons);
|
||||
Card[] crds = new Card[multiplier];
|
||||
|
||||
for (int i=0;i<multiplier;i++)
|
||||
{
|
||||
|
||||
|
||||
Card copy;
|
||||
if(!getTargetCard().isToken()) {
|
||||
//CardFactory cf = new CardFactory("cards.txt");
|
||||
@@ -720,24 +729,31 @@ public class CardFactory_Creatures {
|
||||
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
|
||||
//if Kiki-Jiki somehow gets untapped again
|
||||
final Card[] target = new Card[1];
|
||||
target[0] = copy;
|
||||
final Card[] target = new Card[multiplier];
|
||||
for (int i=0;i<multiplier;i++) {
|
||||
final int index = i;
|
||||
target[i] = crds[i];
|
||||
Command atEOT = new Command() {
|
||||
private static final long serialVersionUID = 7803915905490565557L;
|
||||
|
||||
public void execute() {
|
||||
//technically your opponent could steal the token
|
||||
//and the token shouldn't be sacrificed
|
||||
if(AllZone.GameAction.isCardInPlay(target[0])) AllZone.GameAction.sacrifice(target[0]); //maybe do a setSacrificeAtEOT, but probably not.
|
||||
if(AllZone.GameAction.isCardInPlay(target[index])) AllZone.GameAction.sacrifice(target[index]); //maybe do a setSacrificeAtEOT, but probably not.
|
||||
}
|
||||
};//Command
|
||||
AllZone.EndOfTurn.addAt(atEOT);
|
||||
}
|
||||
}//is card in play?
|
||||
}//resolve()
|
||||
};//SpellAbility
|
||||
|
||||
Reference in New Issue
Block a user