mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
* Fixed a problem with token P/T reset (fixes the problem with Tree of Perdition and Soul Separator).
This commit is contained in:
parent
0af7871804
commit
21baa14404
4 changed files with 10 additions and 9 deletions
|
@ -57,8 +57,8 @@ public class SoulSeparator extends CardImpl {
|
|||
super(ownerId, 199, "Soul Separator", Rarity.RARE, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||
this.expansionSetCode = "EMN";
|
||||
|
||||
// {5}, {T}, Sacrifice Soul Separator: Exile target creature card from your graveyard.
|
||||
// Put a token onto the battlefield that's a copy of that card except it's 1/1, it's a Spirit in addition to its other types, and it has flying.
|
||||
// {5}, {T}, Sacrifice Soul Separator: Exile target creature card from your graveyard.
|
||||
// Put a token onto the battlefield that's a copy of that card except it's 1/1, it's a Spirit in addition to its other types, and it has flying.
|
||||
// Put a black Zombie creature token onto the battlefield with power equal to that card's power and toughness equal that card's toughness.
|
||||
PutTokenOntoBattlefieldCopyTargetEffect copyEffect = new PutTokenOntoBattlefieldCopyTargetEffect(null, null, false, 1, false, false, null, 1, 1, true);
|
||||
copyEffect.setAdditionalSubType("Spirit");
|
||||
|
@ -85,7 +85,7 @@ class SoulSeparatorEffect extends OneShotEffect {
|
|||
|
||||
public SoulSeparatorEffect() {
|
||||
super(Outcome.PutCreatureInPlay);
|
||||
this.staticText = "Put a black Zombie creature token onto the battlefield with power equal to that card's power and toughness equal that card's toughness.";
|
||||
this.staticText = "Put a black Zombie creature token onto the battlefield with power equal to that card's power and toughness equal that card's toughness";
|
||||
}
|
||||
|
||||
public SoulSeparatorEffect(final SoulSeparatorEffect effect) {
|
||||
|
|
|
@ -193,10 +193,10 @@ public class PutTokenOntoBattlefieldCopyTargetEffect extends OneShotEffect {
|
|||
token.addAbility(FlyingAbility.getInstance());
|
||||
}
|
||||
if (tokenPower != Integer.MIN_VALUE) {
|
||||
token.setPower(tokenPower);
|
||||
token.getPower().modifyBaseValue(tokenPower);
|
||||
}
|
||||
if (tokenToughness != Integer.MIN_VALUE) {
|
||||
token.setToughness(tokenToughness);
|
||||
token.getToughness().modifyBaseValue(tokenToughness);
|
||||
}
|
||||
if (additionalSubType != null && !token.getSubtype(game).contains(additionalSubType)) {
|
||||
token.getSubtype(game).add(additionalSubType);
|
||||
|
|
|
@ -49,6 +49,8 @@ public class PermanentToken extends PermanentImpl {
|
|||
this.token = token.copy();
|
||||
this.token.getAbilities().newId(); // neccessary if token has ability like DevourAbility()
|
||||
this.token.getAbilities().setSourceId(objectId);
|
||||
this.power.modifyBaseValue(token.getPower().getBaseValueModified());
|
||||
this.toughness.modifyBaseValue(token.getToughness().getBaseValueModified());
|
||||
this.copyFromToken(this.token, game, false); // needed to have at this time (e.g. for subtypes for entersTheBattlefield replacement effects)
|
||||
}
|
||||
|
||||
|
@ -62,6 +64,9 @@ public class PermanentToken extends PermanentImpl {
|
|||
public void reset(Game game) {
|
||||
copyFromToken(token, game, true);
|
||||
super.reset(game);
|
||||
// Because the P/T objects have there own base value for reset we have to take it from there instead of from the basic token object
|
||||
this.power.resetToBaseValue();
|
||||
this.toughness.resetToBaseValue();
|
||||
}
|
||||
|
||||
private void copyFromToken(Token token, Game game, boolean reset) {
|
||||
|
@ -84,8 +89,6 @@ public class PermanentToken extends PermanentImpl {
|
|||
this.color = token.getColor(game).copy();
|
||||
this.frameColor = token.getFrameColor(game);
|
||||
this.frameStyle = token.getFrameStyle();
|
||||
this.power.modifyBaseValue(token.getPower().getBaseValueModified());
|
||||
this.toughness.modifyBaseValue(token.getToughness().getBaseValueModified());
|
||||
this.supertype = token.getSupertype();
|
||||
this.subtype = token.getSubtype(game);
|
||||
this.tokenDescriptor = token.getTokenDescriptor();
|
||||
|
|
|
@ -38,7 +38,6 @@ import java.util.HashSet;
|
|||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Random;
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.cards.Card;
|
||||
|
@ -53,7 +52,6 @@ import mage.util.RandomUtil;
|
|||
*/
|
||||
public class Library implements Serializable {
|
||||
|
||||
|
||||
private boolean emptyDraw;
|
||||
private final Deque<UUID> library = new ArrayDeque<>();
|
||||
private final UUID playerId;
|
||||
|
|
Loading…
Reference in a new issue