mirror of
https://github.com/correl/mage.git
synced 2024-12-26 11:09:27 +00:00
Merge pull request #7255 from weirddan455/absorb-identity
[KHM] Implemented Absorb Identity
This commit is contained in:
commit
9532eb2802
2 changed files with 83 additions and 0 deletions
82
Mage.Sets/src/mage/cards/a/AbsorbIdentity.java
Normal file
82
Mage.Sets/src/mage/cards/a/AbsorbIdentity.java
Normal file
|
@ -0,0 +1,82 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.ReturnToHandTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.util.functions.EmptyApplyToPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author weirddan455
|
||||
*/
|
||||
public final class AbsorbIdentity extends CardImpl {
|
||||
|
||||
public AbsorbIdentity(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{U}");
|
||||
|
||||
// Return target creature to its owner's hand.
|
||||
this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
|
||||
|
||||
// You may have Shapeshifters you control become copies of that creature until end of turn.
|
||||
this.getSpellAbility().addEffect(new AbsorbIdentityEffect());
|
||||
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
}
|
||||
|
||||
private AbsorbIdentity(final AbsorbIdentity card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbsorbIdentity copy() {
|
||||
return new AbsorbIdentity(this);
|
||||
}
|
||||
}
|
||||
|
||||
class AbsorbIdentityEffect extends OneShotEffect {
|
||||
|
||||
public AbsorbIdentityEffect() {
|
||||
super(Outcome.Copy);
|
||||
this.staticText = "You may have Shapeshifters you control become copies of that creature until end of turn.";
|
||||
}
|
||||
|
||||
public AbsorbIdentityEffect(final AbsorbIdentityEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AbsorbIdentityEffect copy() {
|
||||
return new AbsorbIdentityEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent copyFrom = game.getPermanentOrLKIBattlefield(source.getFirstTarget());
|
||||
if (controller == null || copyFrom == null) {
|
||||
return false;
|
||||
}
|
||||
if (controller.chooseUse(outcome, "Have Shapeshifters you control become copies of "
|
||||
+ copyFrom.getLogName() + " until end of turn?", source, game)) {
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("shapeshifter");
|
||||
filter.add(SubType.SHAPESHIFTER.getPredicate());
|
||||
for (Permanent copyTo : game.getBattlefield().getAllActivePermanents(filter, controller.getId(), game)) {
|
||||
game.copyPermanent(Duration.EndOfTurn, copyFrom, copyTo.getId(), source, new EmptyApplyToPermanent());
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -28,6 +28,7 @@ public final class Kaldheim extends ExpansionSet {
|
|||
this.numBoosterDoubleFaced = 1;
|
||||
this.maxCardNumberInBooster = 285;
|
||||
|
||||
cards.add(new SetCardInfo("Absorb Identity", 383, Rarity.UNCOMMON, mage.cards.a.AbsorbIdentity.class));
|
||||
cards.add(new SetCardInfo("Barkchannel Pathway", 251, Rarity.RARE, mage.cards.b.BarkchannelPathway.class));
|
||||
cards.add(new SetCardInfo("Bearded Axe", 388, Rarity.UNCOMMON, mage.cards.b.BeardedAxe.class));
|
||||
cards.add(new SetCardInfo("Blightstep Pathway", 252, Rarity.RARE, mage.cards.b.BlightstepPathway.class));
|
||||
|
|
Loading…
Reference in a new issue