[RIX] Fix Curious Obsession so it actually follows the conditional-intervening-if rules

This commit is contained in:
Alex W. Jackson 2022-07-31 12:03:11 -04:00
parent 6499f8c614
commit 8c71c86d78

View file

@ -1,16 +1,17 @@
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.common.BeginningOfYourEndStepTriggeredAbility;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.AttackedThisTurnCondition;
import mage.abilities.condition.InvertCondition;
import mage.abilities.condition.common.ControllerAttackedThisTurnCondition;
import mage.abilities.decorator.ConditionalInterveningIfTriggeredAbility;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.SacrificeSourceUnlessConditionEffect;
import mage.abilities.effects.common.SacrificeSourceEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.abilities.keyword.EnchantAbility;
@ -21,15 +22,13 @@ import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.watchers.common.AttackedThisTurnWatcher;
/**
*
* @author LevelX2
* @author awjackson
*/
public final class CuriousObsession extends CardImpl {
@ -46,7 +45,7 @@ public final class CuriousObsession extends CardImpl {
this.addAbility(ability);
// Enchanted creature gets +1/+1 and has "Whenever this creature deals combat damage to a player, you may draw a card.
ability = new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield));
ability = new SimpleStaticAbility(new BoostEnchantedEffect(1, 1, Duration.WhileOnBattlefield));
Ability gainedAbility = new DealsCombatDamageToAPlayerTriggeredAbility(new DrawCardSourceControllerEffect(1), true);
Effect effect = new GainAbilityAttachedEffect(gainedAbility, AttachmentType.AURA);
effect.setText("and has \"Whenever this creature deals combat damage to a player, you may draw a card.\"");
@ -54,10 +53,10 @@ public final class CuriousObsession extends CardImpl {
this.addAbility(ability);
// At the beginning of your end step, if you didn't attack with a creature this turn sacrifice Curious Obsession.
this.addAbility(new BeginningOfEndStepTriggeredAbility(new SacrificeSourceUnlessConditionEffect(AttackedThisTurnCondition.instance)
.setText("if you didn't attack with a creature this turn sacrifice {this}"),
TargetController.YOU, false), new AttackedThisTurnWatcher());
this.addAbility(new ConditionalInterveningIfTriggeredAbility(
new BeginningOfYourEndStepTriggeredAbility(new SacrificeSourceEffect(), false),
new InvertCondition(ControllerAttackedThisTurnCondition.instance),
"At the beginning of your end step, if you didn't attack with a creature this turn, sacrifice {this}."), new AttackedThisTurnWatcher());
}
private CuriousObsession(final CuriousObsession card) {