mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
Merge pull request #3015 from drmDev/bug/tokens-exile-end-combat
fixing tokens exiled at end of combat - not at end step
This commit is contained in:
commit
f3ff01fcdf
4 changed files with 15 additions and 3 deletions
|
@ -89,7 +89,7 @@ class GeistOfSaintTraftEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
|
||||
if (controller != null && effect.apply(game, source)) {
|
||||
effect.exileTokensCreatedAtNextEndStep(game, source);
|
||||
effect.exileTokensCreatedAtEndOfCombat(game, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -97,7 +97,7 @@ class InvocationOfSaintTraftEffect extends OneShotEffect {
|
|||
CreateTokenEffect effect = new CreateTokenEffect(new AngelToken(), 1, true, true);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && (effect.apply(game, source))) {
|
||||
effect.exileTokensCreatedAtNextEndStep(game, source);
|
||||
effect.exileTokensCreatedAtEndOfCombat(game, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -94,7 +94,7 @@ class KariZevSkyshipRaiderEffect extends OneShotEffect {
|
|||
CreateTokenEffect effect = new CreateTokenEffect(new RagavanToken(), 1, true, true);
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null && effect.apply(game, source)) {
|
||||
effect.exileTokensCreatedAtNextEndStep(game, source);
|
||||
effect.exileTokensCreatedAtEndOfCombat(game, source);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -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…
Reference in a new issue