mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
[CLB] Implemented Myrkul, Lord of Bones
This commit is contained in:
parent
80e8e27b42
commit
c600bfcd6b
3 changed files with 131 additions and 2 deletions
|
|
@ -18,6 +18,7 @@ import mage.counters.CounterType;
|
|||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.token.EmptyToken;
|
||||
import mage.game.permanent.token.Token;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.target.targetpointer.FixedTargets;
|
||||
import mage.util.CardUtil;
|
||||
|
|
@ -31,6 +32,11 @@ import java.util.*;
|
|||
*/
|
||||
public class CreateTokenCopyTargetEffect extends OneShotEffect {
|
||||
|
||||
@FunctionalInterface
|
||||
public interface PermanentModifier {
|
||||
void apply(Token token, Game game);
|
||||
}
|
||||
|
||||
private final Set<Class<? extends Ability>> abilityClazzesToRemove;
|
||||
private final List<Permanent> addedTokenPermanents;
|
||||
private final List<Ability> additionalAbilities;
|
||||
|
|
@ -54,7 +60,7 @@ public class CreateTokenCopyTargetEffect extends OneShotEffect {
|
|||
private final int tokenPower;
|
||||
private final int tokenToughness;
|
||||
private boolean useLKI = false;
|
||||
|
||||
private PermanentModifier permanentModifier = null;
|
||||
|
||||
public CreateTokenCopyTargetEffect(boolean useLKI) {
|
||||
this();
|
||||
|
|
@ -235,6 +241,9 @@ public class CreateTokenCopyTargetEffect extends OneShotEffect {
|
|||
token.getColor().setColor(color);
|
||||
}
|
||||
additionalAbilities.stream().forEach(token::addAbility);
|
||||
if (permanentModifier != null) {
|
||||
permanentModifier.apply(token, game);
|
||||
}
|
||||
|
||||
if (!this.abilityClazzesToRemove.isEmpty()) {
|
||||
List<Ability> abilitiesToRemoveTmp = new ArrayList<>();
|
||||
|
|
@ -364,7 +373,8 @@ public class CreateTokenCopyTargetEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
public CreateTokenCopyTargetEffect addAbilityClassesToRemoveFromTokens(Class<? extends Ability> clazz) {
|
||||
this.abilityClazzesToRemove.add(clazz);return this;
|
||||
this.abilityClazzesToRemove.add(clazz);
|
||||
return this;
|
||||
}
|
||||
|
||||
public CreateTokenCopyTargetEffect addAdditionalAbilities(Ability... abilities) {
|
||||
|
|
@ -378,6 +388,11 @@ public class CreateTokenCopyTargetEffect extends OneShotEffect {
|
|||
return this;
|
||||
}
|
||||
|
||||
public CreateTokenCopyTargetEffect setPermanentModifier(PermanentModifier permanentModifier) {
|
||||
this.permanentModifier = permanentModifier;
|
||||
return this;
|
||||
}
|
||||
|
||||
public void sacrificeTokensCreatedAtNextEndStep(Game game, Ability source) {
|
||||
this.removeTokensCreatedAtEndOf(game, source, PhaseStep.END_TURN, false);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue