[LTR] Implement Fear, Fire, Foes!

This commit is contained in:
theelk801 2023-06-09 19:18:23 -04:00
parent 7143be4f01
commit 1723252f7a
2 changed files with 81 additions and 0 deletions

View file

@ -0,0 +1,80 @@
package mage.cards.f;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DamageAllEffect;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.continuous.DamageCantBePreventedEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.MageObjectReferencePredicate;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class FearFireFoes extends CardImpl {
public FearFireFoes(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{X}{R}");
// Damage can't be prevented this turn. Fear, Fire, Foes! deals X damage to target creature and 1 damage to each other creature with the same controller.
this.getSpellAbility().addEffect(new DamageCantBePreventedEffect(
Duration.EndOfTurn, "Damage can't be prevented this turn",
true, false
));
this.getSpellAbility().addEffect(new DamageTargetEffect(ManacostVariableValue.REGULAR));
this.getSpellAbility().addEffect(new FearFireFoesEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}
private FearFireFoes(final FearFireFoes card) {
super(card);
}
@Override
public FearFireFoes copy() {
return new FearFireFoes(this);
}
}
class FearFireFoesEffect extends OneShotEffect {
FearFireFoesEffect() {
super(Outcome.Benefit);
staticText = "and 1 damage to each other creature with the same controller";
}
private FearFireFoesEffect(final FearFireFoesEffect effect) {
super(effect);
}
@Override
public FearFireFoesEffect copy() {
return new FearFireFoesEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
if (permanent == null) {
return false;
}
FilterPermanent filter = new FilterCreaturePermanent();
filter.add(Predicates.not(new MageObjectReferencePredicate(permanent, game)));
filter.add(new ControllerIdPredicate(permanent.getControllerId()));
return new DamageAllEffect(1, filter).apply(game, source);
}
}

View file

@ -57,6 +57,7 @@ public final class TheLordOfTheRingsTalesOfMiddleEarth extends ExpansionSet {
cards.add(new SetCardInfo("Fall of Cair Andros", 124, Rarity.RARE, mage.cards.f.FallOfCairAndros.class));
cards.add(new SetCardInfo("Fall of Gil-galad", 165, Rarity.RARE, mage.cards.f.FallOfGilGalad.class));
cards.add(new SetCardInfo("Fangorn, Tree Shepherd", 166, Rarity.RARE, mage.cards.f.FangornTreeShepherd.class));
cards.add(new SetCardInfo("Fear, Fire, Foes!", 125, Rarity.UNCOMMON, mage.cards.f.FearFireFoes.class));
cards.add(new SetCardInfo("Fiery Inscription", 126, Rarity.UNCOMMON, mage.cards.f.FieryInscription.class));
cards.add(new SetCardInfo("Fire of Orthanc", 127, Rarity.COMMON, mage.cards.f.FireOfOrthanc.class));
cards.add(new SetCardInfo("Flame of Anor", 203, Rarity.RARE, mage.cards.f.FlameOfAnor.class));