Implementred Fiery Emancipation

This commit is contained in:
Evan Kranzler 2020-06-11 21:01:52 -04:00
parent 0eaaee0764
commit ca6c6dc8fa
2 changed files with 78 additions and 0 deletions

View file

@ -0,0 +1,77 @@
package mage.cards.f;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.util.CardUtil;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class FieryEmancipation extends CardImpl {
public FieryEmancipation(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}{R}{R}");
// If a source you control would deal damage to a permanent or player, it deals triple that damage to that permanent or player instead.
this.addAbility(new SimpleStaticAbility(new FieryEmancipationEffect()));
}
private FieryEmancipation(final FieryEmancipation card) {
super(card);
}
@Override
public FieryEmancipation copy() {
return new FieryEmancipation(this);
}
}
class FieryEmancipationEffect extends ReplacementEffectImpl {
FieryEmancipationEffect() {
super(Duration.WhileOnBattlefield, Outcome.Damage);
staticText = "If a source you control would deal damage to a permanent or player, " +
"it deals triple that damage to that permanent or player instead";
}
private FieryEmancipationEffect(final FieryEmancipationEffect effect) {
super(effect);
}
@Override
public FieryEmancipationEffect copy() {
return new FieryEmancipationEffect(this);
}
@Override
public boolean checksEventType(GameEvent event, Game game) {
return event.getType().equals(GameEvent.EventType.DAMAGE_PLAYER)
|| event.getType().equals(GameEvent.EventType.DAMAGE_CREATURE)
|| event.getType().equals(GameEvent.EventType.DAMAGE_PLANESWALKER);
}
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
return game.getControllerId(event.getSourceId()).equals(source.getControllerId());
}
@Override
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
event.setAmount(CardUtil.addWithOverflowCheck(
CardUtil.addWithOverflowCheck(
event.getAmount(), event.getAmount()
), event.getAmount()
));
return false;
}
}

View file

@ -62,6 +62,7 @@ public final class CoreSet2021 extends ExpansionSet {
cards.add(new SetCardInfo("Fabled Passage", 246, Rarity.RARE, mage.cards.f.FabledPassage.class));
cards.add(new SetCardInfo("Faith's Fetters", 17, Rarity.UNCOMMON, mage.cards.f.FaithsFetters.class));
cards.add(new SetCardInfo("Fierce Empath", 181, Rarity.UNCOMMON, mage.cards.f.FierceEmpath.class));
cards.add(new SetCardInfo("Fiery Emancipation", 143, Rarity.MYTHIC, mage.cards.f.FieryEmancipation.class));
cards.add(new SetCardInfo("Fungal Rebirth", 182, Rarity.UNCOMMON, mage.cards.f.FungalRebirth.class));
cards.add(new SetCardInfo("Furious Rise", 144, Rarity.UNCOMMON, mage.cards.f.FuriousRise.class));
cards.add(new SetCardInfo("Gadrak, the Crown-Scourge", 146, Rarity.RARE, mage.cards.g.GadrakTheCrownScourge.class));