mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
[DOM] Update Aryel, Knight of Windgrace.
This commit is contained in:
parent
83ab8528d2
commit
265bcf5004
3 changed files with 15 additions and 26 deletions
|
@ -32,7 +32,6 @@ import mage.MageInt;
|
|||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.VariableCost;
|
||||
import mage.abilities.costs.VariableCostImpl;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.common.TapTargetCost;
|
||||
|
@ -43,20 +42,17 @@ import mage.abilities.keyword.VigilanceAbility;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.constants.TargetAdjustment;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.common.FilterControlledCreaturePermanent;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.Predicates;
|
||||
import mage.filter.predicate.mageobject.PowerPredicate;
|
||||
import mage.filter.predicate.mageobject.SubtypePredicate;
|
||||
import mage.filter.predicate.permanent.TappedPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.KnightToken;
|
||||
import mage.target.common.TargetControlledPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -64,8 +60,6 @@ import mage.target.common.TargetCreaturePermanent;
|
|||
*/
|
||||
public class AryelKnightOfWindgrace extends CardImpl {
|
||||
|
||||
private UUID adjustTargetAbilityId;
|
||||
|
||||
public AryelKnightOfWindgrace(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}{B}");
|
||||
|
||||
|
@ -89,30 +83,13 @@ public class AryelKnightOfWindgrace extends CardImpl {
|
|||
.setText("Destroy target creature with power X or less"), new ManaCostsImpl("{B}"));
|
||||
ability.addCost(new TapSourceCost());
|
||||
ability.addCost(new AryelTapXTargetCost());
|
||||
ability.setTargetAdjustment(TargetAdjustment.CREATURE_POWER_X_OR_LESS);
|
||||
this.addAbility(ability);
|
||||
this.adjustTargetAbilityId = ability.getOriginalId();
|
||||
ability.getOriginalId();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
if (adjustTargetAbilityId.equals(ability.getOriginalId())) {
|
||||
for (VariableCost cost : ability.getCosts().getVariableCosts()) {
|
||||
if (cost instanceof AryelTapXTargetCost) {
|
||||
int value = ((AryelTapXTargetCost) cost).getAmount();
|
||||
FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with power " + value + " or less");
|
||||
filter.add(new PowerPredicate(ComparisonType.FEWER_THAN, value + 1));
|
||||
ability.getTargets().clear();
|
||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public AryelKnightOfWindgrace(final AryelKnightOfWindgrace card) {
|
||||
super(card);
|
||||
this.adjustTargetAbilityId = card.adjustTargetAbilityId;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -36,6 +36,7 @@ import mage.Mana;
|
|||
import mage.ObjectColor;
|
||||
import mage.abilities.*;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.VariableCost;
|
||||
import mage.abilities.costs.common.RemoveVariableCountersTargetCost;
|
||||
import mage.abilities.effects.common.NameACardEffect;
|
||||
import mage.abilities.mana.ActivatedManaAbilityImpl;
|
||||
|
@ -457,6 +458,16 @@ public abstract class CardImpl extends MageObjectImpl implements Card {
|
|||
newFilter.add(new PowerPredicate(ComparisonType.FEWER_THAN, xValue + 1));
|
||||
ability.addTarget(new TargetCreaturePermanent(newFilter));
|
||||
break;
|
||||
case CREATURE_POWER_X_OR_LESS: // Aryel, Knight of Windgrace
|
||||
int value = 0;
|
||||
for (VariableCost cost : ability.getCosts().getVariableCosts()) {
|
||||
value = cost.getAmount();
|
||||
}
|
||||
FilterCreaturePermanent filterCreaturePermanent = new FilterCreaturePermanent("creature with power " + value + " or less");
|
||||
filterCreaturePermanent.add(new PowerPredicate(ComparisonType.FEWER_THAN, value + 1));
|
||||
ability.getTargets().clear();
|
||||
ability.addTarget(new TargetCreaturePermanent(filterCreaturePermanent));
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,5 +13,6 @@ public enum TargetAdjustment {
|
|||
CHOSEN_COLOR,
|
||||
VERSE_COUNTER_TARGETS,
|
||||
TREASURE_COUNTER_POWER,
|
||||
SIMIC_MANIPULATOR
|
||||
SIMIC_MANIPULATOR,
|
||||
CREATURE_POWER_X_OR_LESS
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue