mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 12:22:10 -08:00
Merge branch 'master' of https://github.com/magefree/mage.git
This commit is contained in:
commit
61c7e87cea
14 changed files with 716 additions and 82 deletions
|
|
@ -80,7 +80,11 @@ public class GainLifeEffect extends OneShotEffect<GainLifeEffect> {
|
|||
StringBuilder sb = new StringBuilder();
|
||||
String message = life.getMessage();
|
||||
|
||||
sb.append("you gain ");
|
||||
if (sb.length() > 0) {
|
||||
sb.append("you gain ");
|
||||
} else {
|
||||
sb.append("You gain ");
|
||||
}
|
||||
if (message.isEmpty() || !message.equals("1")) {
|
||||
sb.append(life).append(" ");
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ import mage.watchers.Watcher;
|
|||
public abstract class SplitCard<T extends SplitCard<T>> extends CardImpl<T> {
|
||||
|
||||
public enum ActiveCardHalf {
|
||||
NONE, LEFT, RIGHT
|
||||
NONE, LEFT, RIGHT, BOTH
|
||||
}
|
||||
private Card leftHalfCard;
|
||||
private Card rightHalfCard;
|
||||
|
|
@ -67,8 +67,8 @@ public abstract class SplitCard<T extends SplitCard<T>> extends CardImpl<T> {
|
|||
|
||||
public SplitCard(SplitCard card) {
|
||||
super(card);
|
||||
this.leftHalfCard = card.leftHalfCard;
|
||||
this.rightHalfCard = card.rightHalfCard;
|
||||
this.leftHalfCard = card.leftHalfCard.copy();
|
||||
this.rightHalfCard = card.rightHalfCard.copy();
|
||||
this.activeCardHalf = card.activeCardHalf;
|
||||
}
|
||||
|
||||
|
|
@ -104,16 +104,19 @@ public abstract class SplitCard<T extends SplitCard<T>> extends CardImpl<T> {
|
|||
|
||||
@Override
|
||||
public boolean cast(Game game, Constants.Zone fromZone, SpellAbility ability, UUID controllerId) {
|
||||
if (this.getAbilities().contains(ability)) {
|
||||
activeCardHalf = ActiveCardHalf.BOTH;
|
||||
} else if (leftHalfCard.getAbilities().contains(ability)) {
|
||||
activeCardHalf = ActiveCardHalf.LEFT;
|
||||
} else if (rightHalfCard.getAbilities().contains(ability)) {
|
||||
activeCardHalf = ActiveCardHalf.RIGHT;
|
||||
} else {
|
||||
activeCardHalf = ActiveCardHalf.NONE;
|
||||
}
|
||||
if (super.cast(game, fromZone, ability, controllerId)) {
|
||||
if (leftHalfCard.getAbilities().contains(ability)) {
|
||||
activeCardHalf = ActiveCardHalf.LEFT;
|
||||
} else if (rightHalfCard.getAbilities().contains(ability)) {
|
||||
activeCardHalf = ActiveCardHalf.RIGHT;
|
||||
} else {
|
||||
activeCardHalf = ActiveCardHalf.NONE;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
activeCardHalf = ActiveCardHalf.NONE;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue