mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
- Fixed #6033
This commit is contained in:
parent
75b82018e1
commit
8b8d21d4ad
1 changed files with 40 additions and 17 deletions
|
@ -18,7 +18,10 @@ import mage.cards.Cards;
|
|||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
import static mage.constants.Layer.TypeChangingEffects_4;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubLayer;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
|
@ -98,25 +101,29 @@ class TezzeretCruelMachinistEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
Cards cardsToMove = new CardsImpl();
|
||||
|
||||
for (UUID cardId : target.getTargets()) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card == null) {
|
||||
continue;
|
||||
}
|
||||
cardsToMove.add(card);
|
||||
ContinuousEffect effect = new TezzeretCruelMachinistCardTypeEffect();
|
||||
effect.setTargetPointer(new FixedTarget(
|
||||
|
||||
ContinuousEffect effectCardType = new TezzeretCruelMachinistCardTypeEffect();
|
||||
effectCardType.setTargetPointer(new FixedTarget(
|
||||
card.getId(),
|
||||
card.getZoneChangeCounter(game) + 1
|
||||
));
|
||||
game.addEffect(effect, source);
|
||||
effect = new TezzeretCruelMachinistPowerToughnessEffect();
|
||||
effect.setTargetPointer(new FixedTarget(
|
||||
game.addEffect(effectCardType, source);
|
||||
|
||||
ContinuousEffect effectPowerToughness = new TezzeretCruelMachinistPowerToughnessEffect();
|
||||
effectPowerToughness.setTargetPointer(new FixedTarget(
|
||||
card.getId(),
|
||||
card.getZoneChangeCounter(game) + 1
|
||||
));
|
||||
game.addEffect(effect, source);
|
||||
game.addEffect(effectPowerToughness, source);
|
||||
}
|
||||
|
||||
return player.moveCards(cardsToMove.getCards(game), Zone.BATTLEFIELD, source, game, false, true, true, null);
|
||||
}
|
||||
}
|
||||
|
@ -137,13 +144,24 @@ class TezzeretCruelMachinistCardTypeEffect extends AddCardTypeTargetEffect {
|
|||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent == null || !permanent.isFaceDown(game)) {
|
||||
this.discard();
|
||||
return false;
|
||||
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
||||
for (UUID targetId : targetPointer.getTargets(game, source)) {
|
||||
Permanent target = game.getPermanent(targetId);
|
||||
if (target != null
|
||||
&& target.isFaceDown(game)) {
|
||||
switch (layer) {
|
||||
case TypeChangingEffects_4:
|
||||
target.getSuperType().clear();
|
||||
target.getCardType().clear();
|
||||
target.getSubtype(game).clear();
|
||||
target.addCardType(CardType.ARTIFACT);
|
||||
target.addCardType(CardType.CREATURE);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return super.apply(game, source);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -164,11 +182,16 @@ class TezzeretCruelMachinistPowerToughnessEffect extends SetPowerToughnessTarget
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getFirstTarget());
|
||||
if (permanent == null || !permanent.isFaceDown(game)) {
|
||||
this.discard();
|
||||
return false;
|
||||
for (UUID targetId : this.getTargetPointer().getTargets(game, source)) {
|
||||
Permanent target = game.getPermanent(targetId);
|
||||
if (target != null
|
||||
&& target.isFaceDown(game)) {
|
||||
target.getPower().setValue(5);
|
||||
target.getToughness().setValue(5);
|
||||
break;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return super.apply(game, source);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue