mirror of
https://github.com/magefree/mage.git
synced 2025-12-21 11:02:00 -08:00
[LCC] Implement Sunfrill Imitator (#11591)
This commit is contained in:
parent
068f5db976
commit
7efbccd7d5
2 changed files with 110 additions and 0 deletions
109
Mage.Sets/src/mage/cards/s/SunfrillImitator.java
Normal file
109
Mage.Sets/src/mage/cards/s/SunfrillImitator.java
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.AttacksTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.*;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.mageobject.AnotherPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
import mage.util.functions.CopyApplier;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author jimga150
|
||||
*/
|
||||
public final class SunfrillImitator extends CardImpl {
|
||||
|
||||
public SunfrillImitator(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}");
|
||||
|
||||
this.subtype.add(SubType.DINOSAUR);
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Whenever Sunfrill Imitator attacks, you may have it become a copy of another target Dinosaur you control,
|
||||
// except its name is Sunfrill Imitator and it has this ability.
|
||||
this.addAbility(new SunfrillImitatorAbility());
|
||||
}
|
||||
|
||||
private SunfrillImitator(final SunfrillImitator card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SunfrillImitator copy() {
|
||||
return new SunfrillImitator(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SunfrillImitatorAbility extends AttacksTriggeredAbility {
|
||||
|
||||
private static final FilterControlledPermanent dino_filter = new FilterControlledPermanent(SubType.DINOSAUR, "Dinosaur");
|
||||
|
||||
static {
|
||||
dino_filter.add(AnotherPredicate.instance);
|
||||
}
|
||||
|
||||
public SunfrillImitatorAbility() {
|
||||
super(new SunfrillImitatorEffect(), true);
|
||||
this.addTarget(new TargetControlledPermanent(dino_filter));
|
||||
}
|
||||
|
||||
private SunfrillImitatorAbility(final SunfrillImitatorAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SunfrillImitatorAbility copy() {
|
||||
return new SunfrillImitatorAbility(this);
|
||||
}
|
||||
}
|
||||
|
||||
class SunfrillImitatorEffect extends OneShotEffect {
|
||||
|
||||
private static final CopyApplier copyApplier = new CopyApplier() {
|
||||
@Override
|
||||
public boolean apply(Game game, MageObject blueprint, Ability source, UUID targetObjectId) {
|
||||
blueprint.setName("Sunfrill Imitator");
|
||||
// Permanent also keeps this copy ability
|
||||
blueprint.getAbilities().add(new SunfrillImitatorAbility());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
public SunfrillImitatorEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "you may have it become a copy of another target Dinosaur you control, " +
|
||||
"except its name is Sunfrill Imitator and it has this ability.";
|
||||
}
|
||||
|
||||
private SunfrillImitatorEffect(final SunfrillImitatorEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
// The following is based on Identity Thief and Cephalid Facetaker
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent targetPermanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||
Permanent sourcePermanent = game.getPermanentOrLKIBattlefield(source.getSourceId());
|
||||
if (targetPermanent != null && sourcePermanent != null) {
|
||||
game.copyPermanent(Duration.EndOfGame, targetPermanent, sourcePermanent.getId(), source, copyApplier);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SunfrillImitatorEffect copy() {
|
||||
return new SunfrillImitatorEffect(this);
|
||||
}
|
||||
}
|
||||
|
|
@ -253,6 +253,7 @@ public final class LostCavernsOfIxalanCommander extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Storm Fleet Negotiator", 78, Rarity.RARE, mage.cards.s.StormFleetNegotiator.class));
|
||||
cards.add(new SetCardInfo("Strionic Resonator", 116, Rarity.RARE, mage.cards.s.StrionicResonator.class));
|
||||
cards.add(new SetCardInfo("Sulfur Falls", 354, Rarity.RARE, mage.cards.s.SulfurFalls.class));
|
||||
cards.add(new SetCardInfo("Sunfrill Imitator", 94, Rarity.RARE, mage.cards.s.SunfrillImitator.class));
|
||||
cards.add(new SetCardInfo("Sunken Hollow", 355, Rarity.RARE, mage.cards.s.SunkenHollow.class));
|
||||
cards.add(new SetCardInfo("Surgespanner", 174, Rarity.RARE, mage.cards.s.Surgespanner.class));
|
||||
cards.add(new SetCardInfo("Svyelun of Sea and Sky", 175, Rarity.MYTHIC, mage.cards.s.SvyelunOfSeaAndSky.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue