Menu

Submission for Crown of Empires

203

Comment

tested in magarena 1.43

Config

name=Crown of Empires
url=http://magiccards.info/m12/en/203.html
image=http://magiccards.info/scans/en/m12/203.jpg
value=3.214
rarity=U
type=Artifact
cost={2}
timing=artifact
requires_groovy_code

Script

[
	new MagicPermanentActivation(
        new MagicActivationHints(MagicTiming.Tapping),
        "Tap"
    ) {

        @Override
        public Iterable<MagicEvent> getCostEvent(final MagicPermanent source) {
            return [
                new MagicPayManaCostTapEvent(source, "{3}")
            ];
        }

        @Override
        public MagicEvent getPermanentEvent(final MagicPermanent source, final MagicPayedCost payedCost) {
            return new MagicEvent(
                source,
                MagicTargetChoice.NEG_TARGET_CREATURE,
				MagicTapTargetPicker.Tap,
                this,
                "Tap target creature\$. Gain control of that creature instead " + 
				"if you control artifacts named Scepter of Empires and Throne of Empires."
            );
        }

        @Override
        public void executeEvent(final MagicGame game, final MagicEvent event) {
			final MagicTargetFilter<MagicPermanent> throne = new MagicTargetFilter.NameTargetFilter("Throne of Empires");
			final MagicTargetFilter<MagicPermanent> scepter = new MagicTargetFilter.NameTargetFilter("Scepter of Empires");
			final MagicSource source = event.getSource();
			final MagicPlayer player = source.getController();
			if(player.controlsPermanent(throne) && player.controlsPermanent(scepter)){
				event.processTargetPermanent(game, {
					final MagicPermanent perm ->
					game.doAction(new MagicGainControlAction(
						player,
						perm
					));
				} as MagicPermanentAction);
			}else{
				event.processTargetPermanent(game, new MagicPermanentAction() {
					public void doAction(final MagicPermanent creature) {
						game.addEvent(new MagicTapEvent(creature));
					}
				});
			}
        }
    }
]
Pushed