mirror of
https://github.com/magefree/mage.git
synced 2025-12-25 04:52:07 -08:00
[KLD] Added 7 blue cards.
This commit is contained in:
parent
18cce84694
commit
5244363081
14 changed files with 647 additions and 22 deletions
|
|
@ -0,0 +1,59 @@
|
|||
/*
|
||||
* To change this license header, choose License Headers in Project Properties.
|
||||
* To change this template file, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
package mage.abilities.condition.common;
|
||||
|
||||
import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
public class ControlsPermanentGreatestCMCCondition implements Condition {
|
||||
|
||||
private final FilterPermanent filter;
|
||||
|
||||
public ControlsPermanentGreatestCMCCondition() {
|
||||
this(new FilterPermanent());
|
||||
}
|
||||
|
||||
public ControlsPermanentGreatestCMCCondition(FilterPermanent filter) {
|
||||
super();
|
||||
this.filter = filter;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Set<UUID> controllers = new HashSet<>();
|
||||
Integer maxCMC = null;
|
||||
|
||||
List<Permanent> permanents = game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game);
|
||||
for (Permanent permanent : permanents) {
|
||||
int cmc = permanent.getManaCost().convertedManaCost();
|
||||
if (maxCMC == null || cmc > maxCMC) {
|
||||
maxCMC = cmc;
|
||||
controllers.clear();
|
||||
}
|
||||
if (cmc == maxCMC) {
|
||||
controllers.add(permanent.getControllerId());
|
||||
}
|
||||
}
|
||||
return controllers.contains(source.getControllerId());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "you control the " + filter.getMessage() + " with the highest converted mana cost or tied for the highest converted mana cost";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
@ -30,10 +30,8 @@ public class MayTapOrUntapTargetEffect extends OneShotEffect {
|
|||
if (player.chooseUse(Outcome.Untap, "Untap that permanent?", source, game)) {
|
||||
target.untap(game);
|
||||
}
|
||||
} else {
|
||||
if (player.chooseUse(Outcome.Tap, "Tap that permanent?", source, game)) {
|
||||
target.tap(game);
|
||||
}
|
||||
} else if (player.chooseUse(Outcome.Tap, "Tap that permanent?", source, game)) {
|
||||
target.tap(game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
@ -47,6 +45,9 @@ public class MayTapOrUntapTargetEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
if (!staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
if (mode.getTargets().isEmpty()) {
|
||||
return "you may tap or untap it";
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -66,6 +66,7 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect {
|
|||
private final int tokenPower;
|
||||
private final int tokenToughness;
|
||||
private boolean gainsFlying;
|
||||
private boolean becomesArtifact;
|
||||
|
||||
public PutTokenOntoBattlefieldCopyTargetEffect() {
|
||||
super(Outcome.PutCreatureInPlay);
|
||||
|
|
@ -78,6 +79,7 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect {
|
|||
this.tokenPower = Integer.MIN_VALUE;
|
||||
this.tokenToughness = Integer.MIN_VALUE;
|
||||
this.gainsFlying = false;
|
||||
this.becomesArtifact = false;
|
||||
}
|
||||
|
||||
public PutTokenOntoBattlefieldCopyTargetEffect(UUID playerId) {
|
||||
|
|
@ -139,6 +141,11 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect {
|
|||
this.tokenPower = effect.tokenPower;
|
||||
this.tokenToughness = effect.tokenToughness;
|
||||
this.gainsFlying = effect.gainsFlying;
|
||||
this.becomesArtifact = effect.becomesArtifact;
|
||||
}
|
||||
|
||||
public void setBecomesArtifact(boolean becomesArtifact) {
|
||||
this.becomesArtifact = becomesArtifact;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -182,7 +189,9 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect {
|
|||
EmptyToken token = new EmptyToken();
|
||||
CardUtil.copyTo(token).from(copyFrom); // needed so that entersBattlefied triggered abilities see the attributes (e.g. Master Biomancer)
|
||||
applier.apply(game, token);
|
||||
|
||||
if (becomesArtifact) {
|
||||
token.getCardType().add(CardType.ARTIFACT);
|
||||
}
|
||||
if (additionalCardType != null && !token.getCardType().contains(additionalCardType)) {
|
||||
token.getCardType().add(additionalCardType);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,12 +39,13 @@ import mage.game.Game;
|
|||
*
|
||||
* @author LevelX2
|
||||
*/
|
||||
|
||||
public class CanAttackAsThoughItDidntHaveDefenderSourceEffect extends AsThoughEffectImpl {
|
||||
|
||||
public CanAttackAsThoughItDidntHaveDefenderSourceEffect(Duration duration) {
|
||||
super(AsThoughEffectType.ATTACK, duration, Outcome.Benefit);
|
||||
staticText = "{this} can attack as though it didn't have defender";
|
||||
staticText = "{this} can attack "
|
||||
+ (duration.equals(Duration.EndOfTurn) ? "this turn " : "")
|
||||
+ "as though it didn't have defender";
|
||||
}
|
||||
|
||||
public CanAttackAsThoughItDidntHaveDefenderSourceEffect(final CanAttackAsThoughItDidntHaveDefenderSourceEffect effect) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue