Tokens and command objects reworked (part 1 of 2):

- fixed that copy effect doesn't restore original image after effect's end;
 - removed outdated availableImageSetCodes (all images auto-selected from tokens database now, related to #10139);
 - refactor command objects to use CommandObjectImpl;
 - refactor planes/emblems/etc objects to use MageObjectImpl, added copyable support;
 - refactor another game objects to remove some duplicated fields;
This commit is contained in:
Oleg Agafonov 2023-05-08 02:15:07 +04:00
parent 46f6593da8
commit 5f55c7c667
45 changed files with 517 additions and 477 deletions

View file

@ -186,7 +186,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
@Override
public String toString() {
StringBuilder sb = threadLocalBuilder.get();
sb.append(this.getName()).append('-').append(this.expansionSetCode);
sb.append(this.getName()).append('-').append(this.getExpansionSetCode());
if (copy) {
sb.append(" [Copy]");
}
@ -1184,7 +1184,7 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
@Override
public boolean entersBattlefield(Ability source, Game game, Zone fromZone, boolean fireEvent) {
controlledFromStartOfControllerTurn = false;
if (this.isFaceDown(game)) { // ?? add morphed/manifested here ??
if (this.isFaceDown(game)) { // ?? add morphed/manifested here ???
// remove some attributes here, because first apply effects comes later otherwise abilities (e.g. color related) will unintended trigger
MorphAbility.setPermanentToFaceDownCreature(this, this, game);
}
@ -1782,16 +1782,6 @@ public abstract class PermanentImpl extends CardImpl implements Permanent {
morphed = value;
}
@Override
public void setCardNumber(String cardNumber) {
this.cardNumber = cardNumber;
}
@Override
public void setExpansionSetCode(String expansionSetCode) {
this.expansionSetCode = expansionSetCode;
}
@Override
public void setRarity(Rarity rarity) {
this.rarity = rarity;