mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 21:29:17 -08:00
remove secondSideCardClazz
This commit is contained in:
parent
57a94d7c64
commit
2bcbb30954
3 changed files with 4 additions and 53 deletions
|
|
@ -41,7 +41,6 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
|
||||
protected UUID ownerId;
|
||||
protected Rarity rarity;
|
||||
protected Class<? extends Card> secondSideCardClazz;
|
||||
protected Class<? extends Card> meldsWithClazz;
|
||||
protected Class<? extends MeldCard> meldsToClazz;
|
||||
protected MeldCard meldsToCard;
|
||||
|
|
@ -121,19 +120,8 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
ownerId = card.ownerId;
|
||||
rarity = card.rarity;
|
||||
|
||||
// TODO: wtf, do not copy card sides cause it must be re-created each time (see details in getSecondCardFace)
|
||||
// must be reworked to normal copy and workable transform without such magic
|
||||
|
||||
nightCard = card.nightCard;
|
||||
secondSideCardClazz = card.secondSideCardClazz;
|
||||
secondSideCard = null; // will be set on first getSecondCardFace call if card has one
|
||||
// TODO: temporary until cards tdfc cards are converted
|
||||
// can do normal copy after
|
||||
if (card.secondSideCard instanceof DoubleFacedCardHalf) {
|
||||
secondSideCard = card.secondSideCard.copy();
|
||||
}
|
||||
if (card.secondSideCard instanceof MockableCard) {
|
||||
// workaround to support gui's mock cards
|
||||
if (card.secondSideCard != null) {
|
||||
secondSideCard = card.secondSideCard.copy();
|
||||
}
|
||||
|
||||
|
|
@ -667,27 +655,11 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
// If a spell or ability instructs a player to transform a permanent that
|
||||
// isn’t represented by a transforming token or a transforming double-faced
|
||||
// card, nothing happens.
|
||||
return this.secondSideCardClazz != null || this.nightCard || this.secondSideCard != null;
|
||||
return this.secondSideCard != null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public final Card getSecondCardFace() {
|
||||
// init card side on first call
|
||||
if (secondSideCardClazz == null && secondSideCard == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
if (secondSideCard == null) {
|
||||
secondSideCard = initSecondSideCard(secondSideCardClazz);
|
||||
if (secondSideCard != null && secondSideCard.getSpellAbility() != null) {
|
||||
// TODO: wtf, why it set cast mode here?! Transform tests fails without it
|
||||
// must be reworked without that magic, also see CardImpl'constructor for copy code
|
||||
secondSideCard.getSpellAbility().setSourceId(this.getId());
|
||||
secondSideCard.getSpellAbility().setSpellAbilityType(SpellAbilityType.BASE_ALTERNATE);
|
||||
secondSideCard.getSpellAbility().setSpellAbilityCastMode(SpellAbilityCastMode.TRANSFORMED);
|
||||
}
|
||||
}
|
||||
|
||||
return secondSideCard;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,7 +56,6 @@ import mage.game.mulligan.Mulligan;
|
|||
import mage.game.permanent.Battlefield;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.game.permanent.PermanentCard;
|
||||
import mage.game.permanent.PermanentToken;
|
||||
import mage.game.stack.Spell;
|
||||
import mage.game.stack.SpellStack;
|
||||
import mage.game.stack.StackAbility;
|
||||
|
|
@ -2117,11 +2116,6 @@ public abstract class GameImpl implements Game {
|
|||
BecomesFaceDownCreatureEffect.makeFaceDownObject(this, null, newBluePrint, faceDownType, null);
|
||||
}
|
||||
newBluePrint.assignNewId();
|
||||
// TODO: should be able to remove after tdfc rework
|
||||
if (copyFromPermanent.isTransformed() && (copyFromPermanent instanceof PermanentToken || ((copyFromPermanent instanceof PermanentCard) &&
|
||||
!(((PermanentCard) copyFromPermanent).getCard() instanceof DoubleFacedCardHalf)))) {
|
||||
TransformAbility.transformPermanent(newBluePrint, this, source);
|
||||
}
|
||||
if (copyFromPermanent.isPrototyped()) {
|
||||
Abilities<Ability> abilities = copyFromPermanent.getAbilities();
|
||||
for (Ability ability : abilities) {
|
||||
|
|
|
|||
|
|
@ -7,8 +7,6 @@ import mage.abilities.Ability;
|
|||
import mage.abilities.common.RoomAbility;
|
||||
import mage.abilities.costs.mana.ManaCost;
|
||||
import mage.abilities.costs.mana.ManaCosts;
|
||||
import mage.abilities.keyword.NightboundAbility;
|
||||
import mage.abilities.keyword.TransformAbility;
|
||||
import mage.cards.*;
|
||||
import mage.constants.SpellAbilityType;
|
||||
import mage.game.Game;
|
||||
|
|
@ -103,16 +101,6 @@ public class PermanentCard extends PermanentImpl {
|
|||
if (card instanceof LevelerCard) {
|
||||
maxLevelCounters = ((LevelerCard) card).getMaxLevelCounters();
|
||||
}
|
||||
|
||||
// if transformed on ETB
|
||||
// TODO: remove after tdfc rework
|
||||
if (card.isTransformable() && !(card instanceof DoubleFacedCardHalf)) {
|
||||
if (game.getState().getValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + card.getId()) != null
|
||||
|| NightboundAbility.checkCard(this, game)) {
|
||||
game.getState().setValue(TransformAbility.VALUE_KEY_ENTER_TRANSFORMED + card.getId(), null);
|
||||
TransformAbility.transformPermanent(this, game, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected PermanentCard(final PermanentCard permanent) {
|
||||
|
|
@ -163,7 +151,7 @@ public class PermanentCard extends PermanentImpl {
|
|||
} else if (card.getId() != this.getId()) {
|
||||
// if different id, abilities need to be added to game state for continuous/triggers
|
||||
for (Ability ability : card.getAbilities()) {
|
||||
this.addAbility(ability, card.getId(), game, true);
|
||||
this.addAbility(ability, card.getId(), game, true);
|
||||
}
|
||||
} else {
|
||||
// copy only own abilities; all dynamic added abilities must be added in the parent call
|
||||
|
|
@ -202,9 +190,6 @@ public class PermanentCard extends PermanentImpl {
|
|||
this.setImageFileName(card.getImageFileName());
|
||||
this.setImageNumber(card.getImageNumber());
|
||||
|
||||
if (card.getSecondCardFace() != null && !(card instanceof DoubleFacedCardHalf)) {
|
||||
this.secondSideCardClazz = card.getSecondCardFace().getClass();
|
||||
}
|
||||
if (card.getMeldsToCard() != null) {
|
||||
this.meldsToClazz = card.getMeldsToCard().getClass();
|
||||
}
|
||||
|
|
@ -249,7 +234,7 @@ public class PermanentCard extends PermanentImpl {
|
|||
|
||||
@Override
|
||||
public boolean turnFaceUp(Ability source, Game game, UUID playerId) {
|
||||
if (!this.getBasicMageObject().isPermanent()){
|
||||
if (!this.getBasicMageObject().isPermanent()) {
|
||||
// 701.34g. If a manifested permanent that's represented by an instant or sorcery card would turn face up,
|
||||
// its controller reveals it and leaves it face down. Abilities that trigger whenever a permanent
|
||||
// is turned face up won't trigger.
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue