[DMU] Implemented all currently previewed cards (#9304)

This commit is contained in:
Evan Kranzler 2022-08-14 21:02:16 -04:00 committed by GitHub
parent d392cfba0b
commit 6cfefeea95
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 630 additions and 0 deletions

View file

@ -0,0 +1,61 @@
package mage.game.command.emblems;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.common.SpellCastControllerTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.constants.Outcome;
import mage.filter.FilterSpell;
import mage.filter.common.FilterInstantOrSorcerySpell;
import mage.filter.predicate.mageobject.ColorPredicate;
import mage.game.Game;
import mage.game.command.Emblem;
import mage.game.stack.Spell;
/**
* @author TheElk801
*/
public final class JayaFieryNegotiatorEmblem extends Emblem {
private static final FilterSpell filter = new FilterInstantOrSorcerySpell("a red instant or sorcery spell");
static {
filter.add(new ColorPredicate(ObjectColor.RED));
}
// 8: You get an emblem with "Whenever you cast a red instant or sorcery spell, copy it twice. You may choose new targets for the copies."
public JayaFieryNegotiatorEmblem() {
this.setName("Emblem Jaya");
this.setExpansionSetCodeForImage("DMU");
this.getAbilities().add(new SpellCastControllerTriggeredAbility(
new JayaFieryNegotiatorEmblemEffect(), filter, false
));
}
}
class JayaFieryNegotiatorEmblemEffect extends OneShotEffect {
JayaFieryNegotiatorEmblemEffect() {
super(Outcome.Benefit);
staticText = "copy it twice. You may choose new targets for the copies";
}
private JayaFieryNegotiatorEmblemEffect(final JayaFieryNegotiatorEmblemEffect effect) {
super(effect);
}
@Override
public JayaFieryNegotiatorEmblemEffect copy() {
return new JayaFieryNegotiatorEmblemEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Spell spell = (Spell) getValue("spellCast");
if (spell == null) {
return false;
}
spell.createCopyOnStack(game, source, source.getControllerId(), true, 2);
return true;
}
}