Skip to content

Commit

Permalink
Fix Orim's Chant (#13130)
Browse files Browse the repository at this point in the history
  • Loading branch information
ssk97 committed Dec 10, 2024
1 parent 15a1e61 commit 8f809ca
Showing 1 changed file with 10 additions and 35 deletions.
45 changes: 10 additions & 35 deletions Mage.Sets/src/mage/cards/o/OrimsThunder.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
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;
Expand Down Expand Up @@ -32,15 +33,15 @@ public OrimsThunder(UUID ownerId, CardSetInfo setInfo) {
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) {
Expand All @@ -53,13 +54,13 @@ public OrimsThunder copy() {
}
}

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);
}

Expand All @@ -80,33 +81,7 @@ public boolean apply(Game game, Ability source) {
}

@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);
}
}

0 comments on commit 8f809ca

Please sign in to comment.