mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 21:12:04 -08:00
fixing tokens exiled at end of combat - not at end step
This commit is contained in:
parent
746fed4032
commit
57efb10003
4 changed files with 15 additions and 3 deletions
|
|
@ -31,6 +31,7 @@ import java.util.ArrayList;
|
|||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
|
||||
import mage.abilities.common.delayed.AtTheEndOfCombatDelayedTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.StaticValue;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
|
|
@ -124,6 +125,17 @@ public class CreateTokenEffect extends OneShotEffect {
|
|||
}
|
||||
}
|
||||
|
||||
public void exileTokensCreatedAtEndOfCombat(Game game, Ability source) {
|
||||
for (UUID tokenId : this.getLastAddedTokenIds()) {
|
||||
Permanent tokenPermanent = game.getPermanent(tokenId);
|
||||
if (tokenPermanent != null) {
|
||||
ExileTargetEffect exileEffect = new ExileTargetEffect(null, "", Zone.BATTLEFIELD);
|
||||
exileEffect.setTargetPointer(new FixedTarget(tokenPermanent, game));
|
||||
game.addDelayedTriggeredAbility(new AtTheEndOfCombatDelayedTriggeredAbility(exileEffect), source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void setText() {
|
||||
StringBuilder sb = new StringBuilder("create ");
|
||||
if (amount.toString().equals("1")) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue