mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 12:52:06 -08:00
Fixed some wrong card numbers of 6th edition cards. Fixed some tooltip bugs.
This commit is contained in:
parent
7644038203
commit
296f71536a
15 changed files with 88 additions and 60 deletions
|
|
@ -30,12 +30,10 @@ package mage.abilities.effects.common;
|
|||
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.TargetController;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.ReplacementEffectImpl;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.FilterStackObject;
|
||||
import mage.filter.predicate.permanent.ControllerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
|
|
@ -51,6 +49,10 @@ public class CantTargetEffect extends ReplacementEffectImpl<CantTargetEffect> {
|
|||
private FilterPermanent filterTarget;
|
||||
private FilterStackObject filterSource;
|
||||
|
||||
public CantTargetEffect(FilterPermanent filterTarget, Duration duration) {
|
||||
this(filterTarget, null, duration);
|
||||
}
|
||||
|
||||
public CantTargetEffect(FilterPermanent filterTarget, FilterStackObject filterSource, Duration duration) {
|
||||
super(duration, Outcome.Benefit);
|
||||
this.filterTarget = filterTarget;
|
||||
|
|
@ -58,16 +60,15 @@ public class CantTargetEffect extends ReplacementEffectImpl<CantTargetEffect> {
|
|||
setText();
|
||||
}
|
||||
|
||||
public CantTargetEffect(FilterPermanent filterTarget, Duration duration) {
|
||||
this(filterTarget, null, duration);
|
||||
}
|
||||
|
||||
public CantTargetEffect(final CantTargetEffect effect) {
|
||||
super(effect);
|
||||
if (effect.filterTarget != null)
|
||||
if (effect.filterTarget != null) {
|
||||
this.filterTarget = effect.filterTarget.copy();
|
||||
if (effect.filterSource != null)
|
||||
}
|
||||
if (effect.filterSource != null) {
|
||||
this.filterSource = effect.filterSource.copy();
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -90,8 +91,9 @@ public class CantTargetEffect extends ReplacementEffectImpl<CantTargetEffect> {
|
|||
if (event.getType() == EventType.TARGET) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent != null && filterTarget.match(permanent, source.getSourceId(), source.getControllerId(), game)) {
|
||||
if (filterSource == null)
|
||||
if (filterSource == null) {
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
StackObject sourceObject = game.getStack().getStackObject(event.getSourceId());
|
||||
if (sourceObject != null && filterSource.match(sourceObject, sourceObject.getSourceId(), game)) {
|
||||
|
|
@ -112,7 +114,9 @@ public class CantTargetEffect extends ReplacementEffectImpl<CantTargetEffect> {
|
|||
else {
|
||||
sb.append("spells");
|
||||
}
|
||||
sb.append(" ").append(duration.toString());
|
||||
if (!duration.toString().isEmpty()) {
|
||||
sb.append(" ").append(duration.toString());
|
||||
}
|
||||
staticText = sb.toString();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ public class DrawDiscardControllerEffect extends OneShotEffect<DrawDiscardContro
|
|||
.append(" card").append(cardsToDraw == 1?" ": "s")
|
||||
.append(", then discard ")
|
||||
.append(cardsToDiscard == 1?"a": CardUtil.numberToText(cardsToDiscard))
|
||||
.append(" card").append(cardsToDiscard == 1?" ": "s").toString();
|
||||
.append(" card").append(cardsToDiscard == 1?"": "s").toString();
|
||||
}
|
||||
|
||||
public DrawDiscardControllerEffect(final DrawDiscardControllerEffect effect) {
|
||||
|
|
|
|||
|
|
@ -5,6 +5,7 @@
|
|||
package mage.abilities.effects.common.continious;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.Mode;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
|
|
@ -12,6 +13,7 @@ import mage.constants.Outcome;
|
|||
import mage.constants.SubLayer;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.Target;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -50,5 +52,27 @@ public class LoseAbilityTargetEffect extends ContinuousEffectImpl<LoseAbilityTar
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
if (staticText != null && !staticText.isEmpty()) {
|
||||
return staticText;
|
||||
}
|
||||
StringBuilder sb = new StringBuilder();
|
||||
Target target = mode.getTargets().get(0);
|
||||
if(target.getNumberOfTargets() > 1){
|
||||
if (target.getNumberOfTargets() < target.getMaxNumberOfTargets()) {
|
||||
sb.append("Up to");
|
||||
}
|
||||
sb.append(target.getMaxNumberOfTargets()).append(" target ").append(target.getTargetName()).append(" loses ");
|
||||
} else {
|
||||
sb.append("Target ").append(target.getTargetName()).append(" loses ");
|
||||
}
|
||||
sb.append(ability.getRule());
|
||||
if (!duration.toString().isEmpty()) {
|
||||
sb.append(" ").append(duration.toString());
|
||||
}
|
||||
return sb.toString();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue