mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
replaced x targets adjustment
This commit is contained in:
parent
7305fbac3a
commit
0d3c068f50
9 changed files with 37 additions and 28 deletions
|
|
@ -361,12 +361,6 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
switch (ability.getTargetAdjustment()) {
|
||||
case NONE:
|
||||
break;
|
||||
case X_TARGETS:
|
||||
xValue = ability.getManaCostsToPay().getX();
|
||||
permanentFilter = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
|
||||
ability.getTargets().clear();
|
||||
ability.addTarget(new TargetPermanent(xValue, permanentFilter));
|
||||
break;
|
||||
case X_POWER_LEQ:// Minamo Sightbender only
|
||||
xValue = ability.getManaCostsToPay().getX();
|
||||
oldTargetPermanent = (TargetPermanent) ability.getTargets().get(0);
|
||||
|
|
|
|||
|
|
@ -0,0 +1,22 @@
|
|||
package mage.target.targetadjustment;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801
|
||||
*/
|
||||
public enum XTargetsAdjuster implements TargetAdjuster {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
int xValue = ability.getManaCostsToPay().getX();
|
||||
FilterPermanent permanentFilter = ((TargetPermanent) ability.getTargets().get(0)).getFilter();
|
||||
ability.getTargets().clear();
|
||||
ability.addTarget(new TargetPermanent(xValue, permanentFilter));
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue