[CMR] Implemented Sakashima of a Thousand Faces

This commit is contained in:
Evan Kranzler 2020-11-04 20:23:38 -05:00
parent c447c2118c
commit 549e959928
2 changed files with 102 additions and 0 deletions

View file

@ -0,0 +1,101 @@
package mage.cards.s;
import mage.MageInt;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
import mage.abilities.effects.common.CopyPermanentEffect;
import mage.abilities.keyword.PartnerAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import mage.util.functions.ApplyToPermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class SakashimaOfAThousandFaces extends CardImpl {
public SakashimaOfAThousandFaces(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.ROGUE);
this.power = new MageInt(3);
this.toughness = new MageInt(1);
// You may have Sakashima of a Thousand Faces enter the battlefield as a copy of another creature you control, except it has Sakashima of a Thousand Faces's other abilities.
this.addAbility(new EntersBattlefieldAbility(new CopyPermanentEffect(
StaticFilters.FILTER_CONTROLLED_A_CREATURE, new SakashimaOfAThousandFacesApplier()
).setText("as a copy of another creature you control, except it has {this}'s other abilities"), true));
// The "legend rule" doesn't apply to permanents you control.
this.addAbility(new SimpleStaticAbility(new SakashimaOfAThousandFacesEffect()));
// Partner
this.addAbility(PartnerAbility.getInstance());
}
private SakashimaOfAThousandFaces(final SakashimaOfAThousandFaces card) {
super(card);
}
@Override
public SakashimaOfAThousandFaces copy() {
return new SakashimaOfAThousandFaces(this);
}
}
class SakashimaOfAThousandFacesApplier extends ApplyToPermanent {
@Override
public boolean apply(Game game, Permanent permanent, Ability source, UUID targetObjectId) {
permanent.addAbility(new SimpleStaticAbility(new SakashimaOfAThousandFacesEffect()));
permanent.addAbility(PartnerAbility.getInstance());
return true;
}
@Override
public boolean apply(Game game, MageObject mageObject, Ability source, UUID targetObjectId) {
mageObject.getAbilities().add(new SimpleStaticAbility(new SakashimaOfAThousandFacesEffect()));
mageObject.getAbilities().add(PartnerAbility.getInstance());
return true;
}
}
class SakashimaOfAThousandFacesEffect extends ContinuousRuleModifyingEffectImpl {
SakashimaOfAThousandFacesEffect() {
super(Duration.WhileOnBattlefield, Outcome.Detriment, false, false);
staticText = "the \"legend rule\" doesn't apply to permanents you control";
}
private SakashimaOfAThousandFacesEffect(final SakashimaOfAThousandFacesEffect effect) {
super(effect);
}
@Override
public SakashimaOfAThousandFacesEffect copy() {
return new SakashimaOfAThousandFacesEffect(this);
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.DESTROY_PERMANENT_BY_LEGENDARY_RULE;
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
Permanent permanent = game.getPermanent(event.getTargetId());
return permanent != null && permanent.isControlledBy(source.getControllerId());
}
}

View file

@ -220,6 +220,7 @@ public final class CommanderLegends extends ExpansionSet {
cards.add(new SetCardInfo("Rings of Brighthearth", 335, Rarity.RARE, mage.cards.r.RingsOfBrighthearth.class));
cards.add(new SetCardInfo("Rograkh, Son of Rohgahh", 197, Rarity.UNCOMMON, mage.cards.r.RograkhSonOfRohgahh.class));
cards.add(new SetCardInfo("Run Away Together", 87, Rarity.COMMON, mage.cards.r.RunAwayTogether.class));
cards.add(new SetCardInfo("Sakashima of a Thousand Faces", 89, Rarity.MYTHIC, mage.cards.s.SakashimaOfAThousandFaces.class));
cards.add(new SetCardInfo("Sakashima's Protege", 90, Rarity.RARE, mage.cards.s.SakashimasProtege.class));
cards.add(new SetCardInfo("Sandstone Oracle", 336, Rarity.UNCOMMON, mage.cards.s.SandstoneOracle.class));
cards.add(new SetCardInfo("Sanitarium Skeleton", 148, Rarity.COMMON, mage.cards.s.SanitariumSkeleton.class));