mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
removed unnecessary overrides of adjustTargets and adjustCosts
This commit is contained in:
parent
897e41bc94
commit
3feb2017d3
4 changed files with 4 additions and 68 deletions
|
@ -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
|
||||||
|
|
|
@ -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;
|
||||||
|
|
|
@ -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
|
||||||
|
|
|
@ -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),
|
||||||
|
|
Loading…
Reference in a new issue