This commit is contained in:
Jeff Wadsworth 2022-03-03 15:33:48 -06:00
parent d8137e7e05
commit 4af54ef196
2 changed files with 47 additions and 10 deletions

View file

@ -21,6 +21,8 @@ import mage.util.GameLog;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.game.stack.StackObject;
import mage.target.Target;
/**
* @author BetaSteward_at_googlemail.com
@ -140,6 +142,24 @@ public class StackAbilityView extends CardView {
HintUtils.appendHints(rules, abilityHints);
}
}
// show target of an ability on the stack if "related objects" is empty
if (!ability.getTargets().isEmpty()
&& names.isEmpty()) {
StackObject stackObjectTarget = null;
for (Target target : ability.getTargets()) {
for (UUID targetId : target.getTargets()) {
MageObject mo = game.getObject(targetId);
if (mo instanceof StackObject) {
stackObjectTarget = (StackObject) mo;
}
if (stackObjectTarget != null) {
this.rules.add("<span color='green'><i>Targeted ability related to this card: " + game.getCard(stackObjectTarget.getSourceId()).getIdName());
}
}
}
}
}
public CardView getSourceCard() {