1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-04-02 03:18:09 -09:00

[ONE] Implement Myr Custodian ()

This commit is contained in:
Merlingilb 2023-02-20 20:19:45 +01:00 committed by GitHub
parent e8b458fc30
commit 3305f3c8cd
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 69 additions and 0 deletions
Mage.Sets/src/mage

View file

@ -0,0 +1,68 @@
package mage.cards.m;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.keyword.ScryEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.game.Game;
import mage.players.Player;
import java.util.UUID;
public class MyrCustodian extends CardImpl {
public MyrCustodian(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}");
this.addSubType(SubType.MYR);
this.power = new MageInt(2);
this.toughness = new MageInt(3);
//When Myr Custodian enters the battlefield, scry 2. Then each opponent may scry 1.
EntersBattlefieldTriggeredAbility entersBattlefieldTriggeredAbility =
new EntersBattlefieldTriggeredAbility(new ScryEffect(2,false));
entersBattlefieldTriggeredAbility.addEffect(new MyrCustodianScryEffect());
this.addAbility(entersBattlefieldTriggeredAbility);
}
private MyrCustodian(final MyrCustodian card) {
super(card);
}
@Override
public MyrCustodian copy() {
return new MyrCustodian(this);
}
}
class MyrCustodianScryEffect extends OneShotEffect {
MyrCustodianScryEffect() {
super(Outcome.Benefit);
staticText = "Then each opponent may scry 1";
}
private MyrCustodianScryEffect(final MyrCustodianScryEffect effect) {
super(effect);
}
@Override
public MyrCustodianScryEffect copy() {
return new MyrCustodianScryEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
for (UUID opponentId : game.getOpponents(source.getControllerId())) {
Player player = game.getPlayer(opponentId);
if (player != null && player.chooseUse(outcome, "Scry 1?", source, game)) {
player.scry(1, source, game);
}
}
return true;
}
}

View file

@ -149,6 +149,7 @@ public final class PhyrexiaAllWillBeOne extends ExpansionSet {
cards.add(new SetCardInfo("Monument to Perfection", 233, Rarity.RARE, mage.cards.m.MonumentToPerfection.class));
cards.add(new SetCardInfo("Mountain", 275, Rarity.LAND, mage.cards.basiclands.Mountain.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Myr Convert", 234, Rarity.UNCOMMON, mage.cards.m.MyrConvert.class));
cards.add(new SetCardInfo("Myr Custodian", 235, Rarity.COMMON, mage.cards.m.MyrCustodian.class));
cards.add(new SetCardInfo("Myr Kinsmith", 236, Rarity.COMMON, mage.cards.m.MyrKinsmith.class));
cards.add(new SetCardInfo("Necrogen Communion", 99, Rarity.UNCOMMON, mage.cards.n.NecrogenCommunion.class));
cards.add(new SetCardInfo("Necrogen Rotpriest", 212, Rarity.UNCOMMON, mage.cards.n.NecrogenRotpriest.class));