Implement Chamber Sentry

This commit is contained in:
jmharmon 2018-09-19 14:00:47 -07:00 committed by GitHub
parent 958752d8e9
commit 66c152a2e7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -0,0 +1,57 @@
package mage.cards.c;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.ReturnSourceFromGraveyardToHandEffect;
import mage.abilities.keyword.SunburstAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.target.common.TargetAnyTarget;
import java.util.UUID;
/**
*
* @author jmharmon
*/
public final class ChamberSentry extends CardImpl {
public ChamberSentry(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT,CardType.CREATURE}, "{X}");
this.subtype.add(SubType.CONSTRUCT);
this.power = new MageInt(0);
this.toughness = new MageInt(0);
// Chamber Sentry enters the battlefield with a +1/+1 counter on it for each color of mana spent to cast it.
this.addAbility(new SunburstAbility(this));
// {X}, {T}, Remove X +1/+1 counters from Chamber Sentry: It deals X damage to any target.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(new ManacostVariableValue()), new ManaCostsImpl("{X}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetAnyTarget());
this.addAbility(ability);
// {W}{U}{B}{R}{G}: Return Chamber Sentry from your graveyard to your hand.
this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnSourceFromGraveyardToHandEffect(), new ManaCostsImpl("{W}{U}{B}{R}{G}")));
}
public ChamberSentry(final ChamberSentry card) {
super(card);
}
@Override
public ChamberSentry copy() {
return new ChamberSentry(this);
}
}