forked from External/mage
Implement DFC tokens for Incubate (#10231)
* remove incubate skip * initial implementation of DFC tokens * separate incubator back face to separate class * small refactor to token copy function * token copies now have back faces as well * effects which modify token copies now correctly apply to both faces * add skip for exception * tokens now enter transformed correctly * [MOC] remove skip for incubate * fix verify failure
This commit is contained in:
parent
f8d23ff56b
commit
726e289646
30 changed files with 540 additions and 156 deletions
|
|
@ -5,6 +5,7 @@ import mage.MageObject;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.costs.mana.ManaCost;
|
||||
import mage.abilities.keyword.ChangelingAbility;
|
||||
import mage.abilities.keyword.TransformAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.EmptyNames;
|
||||
import mage.game.Game;
|
||||
|
|
@ -28,6 +29,9 @@ public class PermanentToken extends PermanentImpl {
|
|||
this.power = new MageInt(token.getPower().getModifiedBaseValue());
|
||||
this.toughness = new MageInt(token.getToughness().getModifiedBaseValue());
|
||||
this.copyFromToken(this.token, game, false); // needed to have at this time (e.g. for subtypes for entersTheBattlefield replacement effects)
|
||||
if (this.token.isEntersTransformed()) {
|
||||
TransformAbility.transformPermanent(this, this.token.getBackFace(), game, null);
|
||||
}
|
||||
|
||||
// token's ZCC must be synced with original token to keep abilities settings
|
||||
// Example: kicker ability and kicked status
|
||||
|
|
@ -50,6 +54,14 @@ public class PermanentToken extends PermanentImpl {
|
|||
this.toughness.resetToBaseValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int getManaValue() {
|
||||
if (this.isTransformed()) {
|
||||
return token.getManaValue();
|
||||
}
|
||||
return super.getManaValue();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
if (name.isEmpty()) {
|
||||
|
|
@ -121,6 +133,16 @@ public class PermanentToken extends PermanentImpl {
|
|||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTransformable() {
|
||||
return token.getBackFace() != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected MageObject getOtherFace() {
|
||||
return this.transformed ? token : this.token.getBackFace();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCardNumber() {
|
||||
return token.getOriginalCardNumber();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue