mirror of
https://github.com/magefree/mage.git
synced 2026-01-09 20:32:06 -08:00
rolled back Permanent optimizations - were causing RMI exceptions
This commit is contained in:
parent
86d2086b70
commit
66a5027e94
2 changed files with 21 additions and 35 deletions
|
|
@ -83,32 +83,20 @@ public class PermanentCard extends PermanentImpl<PermanentCard> {
|
|||
public void reset(Game game) {
|
||||
// when the permanent is reset copy all original values from the card
|
||||
// must copy card each reset so that the original values don't get modified
|
||||
// Card copy = game.getCard(objectId).copy();
|
||||
copyFromCard(game.getCard(objectId));
|
||||
Card copy = game.getCard(objectId).copy();
|
||||
copyFromCard(copy);
|
||||
super.reset(game);
|
||||
}
|
||||
|
||||
protected void copyFromCard(Card card) {
|
||||
this.name = card.getName();
|
||||
this.manaCost = card.getManaCost().copy();
|
||||
this.color = card.getColor().copy();
|
||||
this.power = card.getPower().copy();
|
||||
this.toughness = card.getToughness().copy();
|
||||
this.loyalty = card.getLoyalty().copy();
|
||||
this.abilities = card.getAbilities().copy();
|
||||
this.abilities.setControllerId(controllerId);
|
||||
this.cardType.clear();
|
||||
for (CardType cType: card.getCardType()) {
|
||||
this.cardType.add(cType);
|
||||
}
|
||||
this.subtype.clear();
|
||||
for (String subType: card.getSubtype()) {
|
||||
this.subtype.add(subType);
|
||||
}
|
||||
this.supertype.clear();
|
||||
for (String superType: card.getSupertype()) {
|
||||
this.supertype.add(superType);
|
||||
}
|
||||
this.abilities = card.getAbilities();
|
||||
this.abilities.setControllerId(this.controllerId);
|
||||
this.cardType = card.getCardType();
|
||||
this.color = card.getColor();
|
||||
this.manaCost = card.getManaCost();
|
||||
this.power = card.getPower();
|
||||
this.toughness = card.getToughness();
|
||||
if (card instanceof LevelerCard) {
|
||||
LevelAbility level = ((LevelerCard)card).getLevel(this.getCounters().getCount("Level"));
|
||||
if (level != null) {
|
||||
|
|
@ -119,6 +107,8 @@ public class PermanentCard extends PermanentImpl<PermanentCard> {
|
|||
}
|
||||
}
|
||||
}
|
||||
this.subtype = card.getSubtype();
|
||||
this.supertype = card.getSupertype();
|
||||
this.art = card.getArt();
|
||||
this.expansionSetCode = card.getExpansionSetCode();
|
||||
this.rarity = card.getRarity();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue