forked from External/mage
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:
parent
46f6593da8
commit
5f55c7c667
45 changed files with 517 additions and 477 deletions
|
|
@ -202,6 +202,36 @@ public class Spell extends StackObjectImpl implements Card {
|
|||
return GameLog.replaceNameByColoredName(card, getSpellAbility().toString());
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getExpansionSetCode() {
|
||||
return card.getExpansionSetCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExpansionSetCode(String expansionSetCode) {
|
||||
throw new IllegalStateException("Wrong code usage: you can't change set code for the spell");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCardNumber() {
|
||||
return card.getCardNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCardNumber(String cardNumber) {
|
||||
throw new IllegalStateException("Wrong code usage: you can't change card number for the spell");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getImageNumber() {
|
||||
return card.getImageNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setImageNumber(Integer imageNumber) {
|
||||
throw new IllegalStateException("Wrong code usage: you can't change image number for the spell");
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean resolve(Game game) {
|
||||
boolean result;
|
||||
|
|
@ -481,11 +511,6 @@ public class Spell extends StackObjectImpl implements Card {
|
|||
return GameLog.getColoredObjectIdName(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getImageName() {
|
||||
return card.getImageName();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setName(String name) {
|
||||
}
|
||||
|
|
@ -704,11 +729,6 @@ public class Spell extends StackObjectImpl implements Card {
|
|||
return card.getRules(game);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getExpansionSetCode() {
|
||||
return card.getExpansionSetCode();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setFaceDown(boolean value, Game game) {
|
||||
faceDown = value;
|
||||
|
|
@ -875,11 +895,6 @@ public class Spell extends StackObjectImpl implements Card {
|
|||
throw new UnsupportedOperationException("Not supported yet.");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCardNumber() {
|
||||
return card.getCardNumber();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean getUsesVariousArt() {
|
||||
return card.getUsesVariousArt();
|
||||
|
|
|
|||
|
|
@ -52,23 +52,23 @@ public class StackAbility extends StackObjectImpl implements Ability {
|
|||
private boolean copy;
|
||||
private MageObject copyFrom; // copied card INFO (used to call original adjusters)
|
||||
private String name;
|
||||
private String expansionSetCode;
|
||||
private TargetAdjuster targetAdjuster = null;
|
||||
private CostAdjuster costAdjuster = null;
|
||||
|
||||
public StackAbility(Ability ability, UUID controllerId) {
|
||||
super();
|
||||
this.ability = ability;
|
||||
this.controllerId = controllerId;
|
||||
this.name = "stack ability (" + ability.getRule() + ')';
|
||||
}
|
||||
|
||||
public StackAbility(final StackAbility stackAbility) {
|
||||
super();
|
||||
this.ability = stackAbility.ability.copy();
|
||||
this.controllerId = stackAbility.controllerId;
|
||||
this.copy = stackAbility.copy;
|
||||
this.copyFrom = (stackAbility.copyFrom != null ? stackAbility.copyFrom.copy() : null);
|
||||
this.name = stackAbility.name;
|
||||
this.expansionSetCode = stackAbility.expansionSetCode;
|
||||
this.targetAdjuster = stackAbility.targetAdjuster;
|
||||
this.targetChanged = stackAbility.targetChanged;
|
||||
this.costAdjuster = stackAbility.costAdjuster;
|
||||
|
|
@ -128,6 +128,36 @@ public class StackAbility extends StackObjectImpl implements Ability {
|
|||
return this.copyFrom;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getExpansionSetCode() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setExpansionSetCode(String expansionSetCode) {
|
||||
throw new IllegalStateException("Wrong code usage: you can't change set code for the stack ability");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getCardNumber() {
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setCardNumber(String cardNumber) {
|
||||
throw new IllegalStateException("Wrong code usage: you can't change card number for the stack ability");
|
||||
}
|
||||
|
||||
@Override
|
||||
public Integer getImageNumber() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setImageNumber(Integer imageNumber) {
|
||||
throw new IllegalStateException("Wrong code usage: you can't change image number for the stack ability");
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getName() {
|
||||
return name;
|
||||
|
|
@ -144,12 +174,8 @@ public class StackAbility extends StackObjectImpl implements Ability {
|
|||
}
|
||||
|
||||
@Override
|
||||
public String getImageName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public String getExpansionSetCode() {
|
||||
return expansionSetCode;
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
@ -384,15 +410,6 @@ public class StackAbility extends StackObjectImpl implements Ability {
|
|||
return new StackAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public void setExpansionSetCode(String expansionSetCode) {
|
||||
this.expansionSetCode = expansionSetCode;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkIfClause(Game game) {
|
||||
return true;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue