removed unnecessary overrides of adjustTargets and adjustCosts

This commit is contained in:
Evan Kranzler 2021-03-23 20:43:16 -04:00
parent 897e41bc94
commit 3feb2017d3
4 changed files with 4 additions and 68 deletions

View file

@ -241,11 +241,13 @@ public abstract class MageObjectImpl implements MageObject {
} }
@Override @Override
public void adjustCosts(Ability ability, Game game) { public final void adjustCosts(Ability ability, Game game) {
ability.adjustCosts(game);
} }
@Override @Override
public void adjustTargets(Ability ability, Game game) { public final void adjustTargets(Ability ability, Game game) {
ability.adjustTargets(game);
} }
@Override @Override

View file

@ -367,30 +367,6 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
return spellAbility; return spellAbility;
} }
/**
* Dynamic cost modification for card (process only own abilities). Example:
* if it need stack related info (like real targets) then must check two
* states (game.inCheckPlayableState):
* <p>
* 1. In playable state it must check all possible use cases (e.g. allow to
* reduce on any available target and modes)
* <p>
* 2. In real cast state it must check current use case (e.g. real selected
* targets and modes)
*
* @param ability
* @param game
*/
@Override
public void adjustCosts(Ability ability, Game game) {
ability.adjustCosts(game);
}
@Override
public void adjustTargets(Ability ability, Game game) {
ability.adjustTargets(game);
}
@Override @Override
public void setOwnerId(UUID ownerId) { public void setOwnerId(UUID ownerId) {
this.ownerId = ownerId; this.ownerId = ownerId;

View file

@ -174,30 +174,6 @@ public class PermanentCard extends PermanentImpl {
return false; return false;
} }
@Override
public void adjustTargets(Ability ability, Game game) {
if (this.isTransformed() && card.getSecondCardFace() != null) {
card.getSecondCardFace().adjustTargets(ability, game);
} else {
if (this.isCopy()) {
// if COPIED card have adjuster then it's must be called instead own -- see OathOfLieges tests
// raise null error on wrong copy
this.getCopyFrom().adjustTargets(ability, game);
} else {
card.adjustTargets(ability, game);
}
}
}
@Override
public void adjustCosts(Ability ability, Game game) {
if (this.isTransformed() && card.getSecondCardFace() != null) {
card.getSecondCardFace().adjustCosts(ability, game);
} else {
card.adjustCosts(ability, game);
}
}
@Override @Override
public ManaCosts<ManaCost> getManaCost() { public ManaCosts<ManaCost> getManaCost() {
if (faceDown) { // face down permanent has always {0} mana costs if (faceDown) { // face down permanent has always {0} mana costs

View file

@ -102,24 +102,6 @@ public class PermanentToken extends PermanentImpl {
return new PermanentToken(this); return new PermanentToken(this);
} }
@Override
public void adjustTargets(Ability ability, Game game) {
if (getToken().getCopySourceCard() != null) {
getToken().getCopySourceCard().adjustTargets(ability, game);
} else {
super.adjustTargets(ability, game);
}
}
@Override
public void adjustCosts(Ability ability, Game game) {
if (getToken().getCopySourceCard() != null) {
getToken().getCopySourceCard().adjustCosts(ability, game);
} else {
super.adjustCosts(ability, game);
}
}
@Override @Override
public void updateZoneChangeCounter(Game game, ZoneChangeEvent event) { public void updateZoneChangeCounter(Game game, ZoneChangeEvent event) {
// token must change zcc on enters to battlefield (like cards do with stack), // token must change zcc on enters to battlefield (like cards do with stack),