mirror of
https://github.com/correl/mage.git
synced 2024-11-15 03:00:16 +00:00
* Fixed that soulbond arrow to paired card was not shown and improved soulbond text on permanent.
This commit is contained in:
parent
014c93e05e
commit
3b19304f64
4 changed files with 10 additions and 11 deletions
|
@ -134,12 +134,6 @@ public final class GuiDisplayUtil {
|
|||
for (String rule : card.getRules()) {
|
||||
textLines.basicTextLength += rule.length();
|
||||
}
|
||||
if (card.getMageObjectType() == MageObjectType.PERMANENT) {
|
||||
if (card.getPairedCard() != null) {
|
||||
textLines.lines.add("<span color='green'><i>Paired with another creature</i></span>");
|
||||
textLines.basicTextLength += 30;
|
||||
}
|
||||
}
|
||||
if (card.getMageObjectType().canHaveCounters()) {
|
||||
ArrayList<CounterView> counters = new ArrayList<>();
|
||||
if (card instanceof PermanentView) {
|
||||
|
|
|
@ -27,6 +27,8 @@
|
|||
*/
|
||||
package mage.view;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
import mage.MageObject;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Abilities;
|
||||
|
@ -51,9 +53,6 @@ import mage.target.Target;
|
|||
import mage.target.Targets;
|
||||
import mage.util.SubTypeList;
|
||||
|
||||
import java.util.*;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
/**
|
||||
* @author BetaSteward_at_googlemail.com
|
||||
*/
|
||||
|
@ -352,12 +351,12 @@ public class CardView extends SimpleCardView {
|
|||
if (game != null) {
|
||||
if (permanent.getCounters(game) != null && !permanent.getCounters(game).isEmpty()) {
|
||||
this.loyalty = Integer.toString(permanent.getCounters(game).getCount(CounterType.LOYALTY));
|
||||
this.pairedCard = permanent.getPairedCard() != null ? permanent.getPairedCard().getSourceId() : null;
|
||||
counters = new ArrayList<>();
|
||||
for (Counter counter : permanent.getCounters(game).values()) {
|
||||
counters.add(new CounterView(counter));
|
||||
}
|
||||
}
|
||||
this.pairedCard = permanent.getPairedCard() != null ? permanent.getPairedCard().getSourceId() : null;
|
||||
if (!permanent.getControllerId().equals(permanent.getOwnerId())) {
|
||||
controlledByOwner = false;
|
||||
}
|
||||
|
|
|
@ -32,7 +32,6 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SetTargetPointer;
|
||||
import mage.constants.TargetController;
|
||||
|
@ -47,6 +46,7 @@ import mage.game.Game;
|
|||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
import mage.util.GameLog;
|
||||
|
||||
/**
|
||||
* 702.94. Soulbond
|
||||
|
@ -168,7 +168,9 @@ class SoulboundEntersSelfEffect extends OneShotEffect {
|
|||
Permanent chosen = game.getPermanent(target.getFirstTarget());
|
||||
if (chosen != null) {
|
||||
chosen.setPairedCard(new MageObjectReference(permanent, game));
|
||||
chosen.addInfo("soulbond", "Soulbond to " + GameLog.getColoredObjectIdNameForTooltip(permanent), game);
|
||||
permanent.setPairedCard(new MageObjectReference(chosen, game));
|
||||
permanent.addInfo("soulbond", "Soulbond to " + GameLog.getColoredObjectIdNameForTooltip(chosen), game);
|
||||
if (!game.isSimulation()) {
|
||||
game.informPlayers(controller.getLogName() + " soulbonds " + permanent.getLogName() + " with " + chosen.getLogName());
|
||||
}
|
||||
|
|
|
@ -1319,6 +1319,10 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
|
|||
@Override
|
||||
public void setPairedCard(MageObjectReference pairedCard) {
|
||||
this.pairedPermanent = pairedCard;
|
||||
if (pairedCard == null) {
|
||||
// remove existing soulbond info text
|
||||
this.addInfo("soulbond", null, null);
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in a new issue