Fix Orim's Chant (#13130)

This commit is contained in:
Steven Knipe 2024-12-10 15:46:23 -08:00
parent 15a1e618fa
commit 8f809cab3c

View file

@ -5,6 +5,7 @@ import mage.abilities.Ability;
import mage.abilities.condition.common.KickedCondition;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.abilities.keyword.KickerAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -32,15 +33,15 @@ public final class OrimsThunder extends CardImpl {
this.addAbility(new KickerAbility("{R}"));
// Destroy target artifact or enchantment. If Orim's Thunder was kicked, it deals damage equal to that permanent's converted mana cost to target creature.
this.getSpellAbility().addEffect(new OrimsThunderEffect());
this.getSpellAbility().addEffect(new DestroyTargetEffect());
this.getSpellAbility().addTarget(new TargetPermanent(StaticFilters.FILTER_PERMANENT_ARTIFACT_OR_ENCHANTMENT));
this.getSpellAbility().addEffect(new ConditionalOneShotEffect(
new OrimsThunderEffect2(),
new OrimsThunderDamageEffect(),
KickedCondition.ONCE,
"If this spell was kicked, it deals damage equal to that permanent's mana value to target creature")
);
this.getSpellAbility().setTargetAdjuster(new ConditionalTargetAdjuster(KickedCondition.ONCE,
new TargetCreaturePermanent()));
this.getSpellAbility().setTargetAdjuster(new ConditionalTargetAdjuster(
KickedCondition.ONCE, true, new TargetCreaturePermanent()));
}
private OrimsThunder(final OrimsThunder card) {
@ -53,13 +54,13 @@ public final class OrimsThunder extends CardImpl {
}
}
class OrimsThunderEffect2 extends OneShotEffect {
class OrimsThunderDamageEffect extends OneShotEffect {
OrimsThunderEffect2() {
OrimsThunderDamageEffect() {
super(Outcome.Damage);
}
private OrimsThunderEffect2(final OrimsThunderEffect2 effect) {
private OrimsThunderDamageEffect(final OrimsThunderDamageEffect effect) {
super(effect);
}
@ -80,33 +81,7 @@ class OrimsThunderEffect2 extends OneShotEffect {
}
@Override
public OrimsThunderEffect2 copy() {
return new OrimsThunderEffect2(this);
public OrimsThunderDamageEffect copy() {
return new OrimsThunderDamageEffect(this);
}
}
class OrimsThunderEffect extends OneShotEffect {
OrimsThunderEffect() {
super(Outcome.DestroyPermanent);
staticText = "Destroy target artifact or enchantment";
}
private OrimsThunderEffect(final OrimsThunderEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
Permanent target = game.getPermanent(source.getFirstTarget());
if (target != null) {
return target.destroy(source, game, false);
}
return false;
}
@Override
public OrimsThunderEffect copy() {
return new OrimsThunderEffect(this);
}
}