* Circle of Affliction - Fixed that the triggered ability was wrongly also applied for damage dealt to other players.

This commit is contained in:
LevelX2 2019-01-03 17:16:03 +01:00
parent dd8ec4d125
commit 367f692194

View file

@ -1,4 +1,3 @@
package mage.cards.c; package mage.cards.c;
import java.util.UUID; import java.util.UUID;
@ -29,7 +28,7 @@ import mage.target.TargetPlayer;
public final class CircleOfAffliction extends CardImpl { public final class CircleOfAffliction extends CardImpl {
public CircleOfAffliction(UUID ownerId, CardSetInfo setInfo) { public CircleOfAffliction(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{B}"); super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{B}");
// As Circle of Affliction enters the battlefield, choose a color. // As Circle of Affliction enters the battlefield, choose a color.
this.addAbility(new AsEntersBattlefieldAbility(new ChooseColorEffect(Outcome.Neutral))); this.addAbility(new AsEntersBattlefieldAbility(new ChooseColorEffect(Outcome.Neutral)));
@ -69,12 +68,12 @@ class CircleOfAfflictionTriggeredAbility extends TriggeredAbilityImpl {
@Override @Override
public boolean checkTrigger(GameEvent event, Game game) { public boolean checkTrigger(GameEvent event, Game game) {
Permanent circleOfAffliction = game.getPermanentOrLKIBattlefield(getSourceId()); Permanent circleOfAffliction = game.getPermanentOrLKIBattlefield(getSourceId());
if (circleOfAffliction != null) { if (circleOfAffliction != null && event.getTargetId().equals(getControllerId())) {
ObjectColor chosenColor = (ObjectColor) game.getState().getValue(circleOfAffliction.getId() + "_color"); ObjectColor chosenColor = (ObjectColor) game.getState().getValue(circleOfAffliction.getId() + "_color");
if (chosenColor != null) { if (chosenColor != null) {
MageObject damageSource = game.getObject(event.getSourceId()); MageObject damageSource = game.getObject(event.getSourceId());
if (damageSource != null) { if (damageSource != null) {
if ( damageSource.getColor(game).shares(chosenColor) ) { if (damageSource.getColor(game).shares(chosenColor)) {
return true; return true;
} }
} }
@ -92,4 +91,4 @@ class CircleOfAfflictionTriggeredAbility extends TriggeredAbilityImpl {
public String getRule() { public String getRule() {
return "Whenever a source of the chosen color deals damage to you, you may pay {1}. If you do, target player loses 1 life and you gain 1 life."; return "Whenever a source of the chosen color deals damage to you, you may pay {1}. If you do, target player loses 1 life and you gain 1 life.";
} }
} }