Skip to content

Commit

Permalink
simplify implementation and remove redundant class
Browse files Browse the repository at this point in the history
  • Loading branch information
xenohedron committed Jun 24, 2023
1 parent 23a6185 commit 7e15ca9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 61 deletions.
24 changes: 11 additions & 13 deletions Mage.Sets/src/mage/cards/s/SithManipulator.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
import mage.abilities.condition.InvertCondition;
import mage.abilities.condition.common.HateCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.common.ReturnTargetToOwnersLibraryPermanentEffect;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.PutOnLibraryTargetEffect;
import mage.abilities.effects.common.ReturnToHandTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
Expand All @@ -31,18 +31,16 @@ public SithManipulator(UUID ownerId, CardSetInfo setInfo) {
this.toughness = new MageInt(2);

// When Sith Manipulator enters the battlefield, return target creature to its owner's hand.
Ability ability = new ConditionalInterveningIfTriggeredAbility(
new EntersBattlefieldTriggeredAbility(new ReturnToHandTargetEffect()),
new InvertCondition(HateCondition.instance),
"When Sith Manipulator enters the battlefield, return target creature to its owner's hand");
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability, new LifeLossOtherFromCombatWatcher());

// <i>Hate</i> &mdash; If opponent lost life from source other than combat damage this turn, put that card on top of its owner's library instead.
ability = new ConditionalInterveningIfTriggeredAbility(
new EntersBattlefieldTriggeredAbility(new ReturnTargetToOwnersLibraryPermanentEffect(true)),
Effect effect = new ConditionalOneShotEffect(
new PutOnLibraryTargetEffect(true),
new ReturnToHandTargetEffect(),
HateCondition.instance,
"<i>Hate</i> &mdash; If opponent lost life from source other than combat damage this turn, put that card on top of its owner's library instead");
"return target creature to its owner's hand." +
"<br><i>Hate</i> &mdash; If opponent lost life from source other than combat damage this turn, " +
"put that card on top of its owner's library instead"
);
Ability ability = new EntersBattlefieldTriggeredAbility(effect);
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability, new LifeLossOtherFromCombatWatcher());

Expand Down

This file was deleted.

0 comments on commit 7e15ca9

Please sign in to comment.