@Override public DamagePlayersEffect copy() { return new DamagePlayersEffect(this); }
HallarTheFirefletcherTriggeredAbility() { super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.P1P1.createInstance()).setText("put a +1/+1 counter on {this}"), true); this.addEffect(new DamagePlayersEffect(Outcome.Benefit, new CountersSourceCount(CounterType.P1P1), TargetController.OPPONENT) .setText("then {this} deals damage equal to the number of +1/+1 counters on it to each opponent") ); }
new DamagePlayersEffect(6, TargetController.OPPONENT).apply(game, source);
public DamagePlayersEffect(Outcome outcome, DynamicValue amount, TargetController controller) { super(outcome); this.amount = amount; this.controller = controller; setText(); }
@Override public boolean apply(Game game, Ability source) { Player controller = game.getPlayer(source.getControllerId()); MageObject sourceObject = source.getSourceObject(game); if (controller != null && sourceObject != null && controller.getLibrary().hasCards()) { Library library = controller.getLibrary(); Card card = library.getFromTop(game); if (card != null) { boolean exiledCardWasCast = false; controller.moveCardsToExile(card, source, game, true, source.getSourceId(), sourceObject.getIdName()); if (!card.getManaCost().isEmpty() && !card.isLand()) { if (controller.chooseUse(Outcome.Benefit, "Cast " + card.getName() + "? (You still pay the costs)", source, game)) { exiledCardWasCast = controller.cast(card.getSpellAbility(), game, false, new MageObjectReference(sourceObject, game)); } } if (!exiledCardWasCast) { new DamagePlayersEffect(Outcome.Damage, new StaticValue(2), TargetController.OPPONENT).apply(game, source); } } return true; } return false; } }
public DamagePlayersEffect(int amount, TargetController controller, String whoDealDamageName) { this(Outcome.Damage, new StaticValue(amount), controller); this.sourceName = whoDealDamageName; setText(); // TODO: replace to @Override public String getText() }
public ZhurTaaDruidAbility() { super(Zone.BATTLEFIELD, new DamagePlayersEffect(1, TargetController.OPPONENT)); }
public CabalPaladin(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.KNIGHT); this.power = new MageInt(4); this.toughness = new MageInt(2); // Whenever you cast a historic spell, Cabal Paladin deals 2 damage to each opponent. this.addAbility(new SpellCastControllerTriggeredAbility( new DamagePlayersEffect(Outcome.Damage, new StaticValue(2), TargetController.OPPONENT) .setText("{this} deals 2 damage to each opponent. <i>(Artifacts, legendaries, and Sagas are historic.)</i>"), new FilterHistoricSpell("a historic spell"), false )); }
public BreathOfMalfegor(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.INSTANT},"{3}{B}{R}"); // Breath of Malfegor deals 5 damage to each opponent. this.getSpellAbility().addEffect(new DamagePlayersEffect(5, TargetController.OPPONENT)); }
public SarkhansUnsealing(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}"); // Whenever you cast a creature spell with power 4, 5, or 6, Sarkhan's Unsealing deals 4 damage to any target. Ability ability = new SpellCastControllerTriggeredAbility( new DamageTargetEffect(4), filter, false ); ability.addTarget(new TargetAnyTarget()); this.addAbility(ability); // Whenever you cast a creature spell with power 7 or greater, Sarkhan's Unsealing deals 4 damage to each opponent and each creature and planeswalker they control. ability = new SpellCastControllerTriggeredAbility( new DamagePlayersEffect(4, TargetController.OPPONENT) .setText("{this} deals 4 damage to each opponent"), filter2, false ); ability.addEffect( new DamageAllEffect(4, filter3) .setText("and each creature and planeswalker they control") ); this.addAbility(ability); }
public Sizzle(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{2}{R}"); // Sizzle deals 3 damage to each opponent. this.getSpellAbility().addEffect(new DamagePlayersEffect(3, TargetController.OPPONENT)); }
public GoblinChainwhirler(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{R}{R}{R}"); this.subtype.add(SubType.GOBLIN); this.subtype.add(SubType.WARRIOR); this.power = new MageInt(3); this.toughness = new MageInt(3); // First strike this.addAbility(FirstStrikeAbility.getInstance()); // When Goblin Chainwhirler enters the battlefield, it deals 1 damage to each opponent and each creature and planeswalker they control. DamagePlayersEffect effect1 = new DamagePlayersEffect(1, TargetController.OPPONENT); effect1.setText("it deals 1 damage to each opponent"); DamageAllEffect effect2 = new DamageAllEffect(1, filter); effect2.setText("and each creature and planeswalker they control"); Ability ability = new EntersBattlefieldTriggeredAbility(effect1); ability.addEffect(effect2); this.addAbility(ability); }
public FlameRift(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{1}{R}"); // Flame Rift deals 4 damage to each player. this.getSpellAbility().addEffect(new DamagePlayersEffect(4, TargetController.ANY)); }
public ArmageddonClock(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{6}"); // At the beginning of your upkeep, put a doom counter on Armageddon Clock. this.addAbility(new BeginningOfUpkeepTriggeredAbility(new AddCountersSourceEffect(CounterType.DOOM.createInstance(), new StaticValue(1), true), TargetController.YOU, false)); // At the beginning of your draw step, Armageddon Clock deals damage equal to the number of doom counters on it to each player. this.addAbility(new BeginningOfDrawTriggeredAbility(new DamagePlayersEffect(Outcome.Damage, new CountersSourceCount(CounterType.DOOM)) .setText("{this} deals damage equal to the number of doom counters on it to each player"), TargetController.YOU, false)); // {4}: Remove a doom counter from Armageddon Clock. Any player may activate this ability but only during any upkeep step. ActivatedAbilityImpl ability = new ConditionalActivatedAbility(Zone.BATTLEFIELD, new RemoveCounterSourceEffect(CounterType.DOOM.createInstance()), new ManaCostsImpl("{4}"), new IsStepCondition(PhaseStep.UPKEEP, false), "Remove a doom counter from {this}. Any player may activate this ability but only during any upkeep step"); ability.setMayActivate(TargetController.ANY); this.addAbility(ability); }
public OgrePainbringer(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{R}{R}"); this.subtype.add(SubType.OGRE); this.power = new MageInt(7); this.toughness = new MageInt(3); // When Ogre Painbringer enters the battlefield, it deals 3 damage to each player. this.addAbility(new EntersBattlefieldTriggeredAbility(new DamagePlayersEffect(3, TargetController.ANY, "it"))); }
public TunnelingGeopede(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}"); this.subtype.add(SubType.INSECT); this.power = new MageInt(3); this.toughness = new MageInt(2); // <i>Landfall</i> — Whenever a land enters the battlefield under your control, Tunneling Geopede deals 1 damage to each opponent. this.addAbility(new LandfallAbility(new DamagePlayersEffect(1, TargetController.OPPONENT), false)); }
public CreepingChillAbility() { super( Zone.LIBRARY, Zone.GRAVEYARD, new DoIfCostPaid( new DamagePlayersEffect(3, TargetController.OPPONENT), new ExileSourceFromGraveCost() ).addEffect(new GainLifeEffect(3)), "", true ); }
public SpiresideInfiltrator(UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.ROGUE); this.power = new MageInt(3); this.toughness = new MageInt(2); // Whenever Spireside Infiltrator becomes tapped, it deals one damage to each opponent. this.addAbility(new BecomesTappedSourceTriggeredAbility(new DamagePlayersEffect(1, TargetController.OPPONENT, "it"))); }
public FirebrandArcher(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{R}"); this.subtype.add(SubType.HUMAN); this.subtype.add(SubType.ARCHER); this.power = new MageInt(2); this.toughness = new MageInt(1); // Whenever you cast a noncreature spell, Firebrand Archer deals 1 damage to each opponent. addAbility(new SpellCastControllerTriggeredAbility(new DamagePlayersEffect(1, TargetController.OPPONENT), filter, false)); }
public Guttersnipe (UUID ownerId, CardSetInfo setInfo) { super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{R}"); this.subtype.add(SubType.GOBLIN); this.subtype.add(SubType.SHAMAN); this.power = new MageInt(2); this.toughness = new MageInt(2); // Whenever you cast an instant or sorcery spell, Guttersnipe deals 2 damage to each opponent. this.addAbility(new SpellCastControllerTriggeredAbility(new DamagePlayersEffect(2, TargetController.OPPONENT), filter, false)); }