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
|
|
@ -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