forked from External/mage
address other comments
This commit is contained in:
parent
32bf3eb9bf
commit
ab99cfe1fd
4 changed files with 8 additions and 75 deletions
|
|
@ -11,21 +11,15 @@ import mage.abilities.costs.CostsImpl;
|
|||
import mage.abilities.costs.common.PayEnergyCost;
|
||||
import mage.abilities.costs.common.ReturnToHandFromBattlefieldSourceCost;
|
||||
import mage.abilities.costs.common.SacrificeTargetCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.SourceControllerCountersCount;
|
||||
import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffect;
|
||||
import mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.filter.predicate.mageobject.ManaValuePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetCardInYourGraveyard;
|
||||
import mage.target.targetadjustment.TargetAdjuster;
|
||||
import mage.target.targetadjustment.XManaValueTargetAdjuster;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -49,7 +43,7 @@ public final class ChthonianNightmare extends CardImpl {
|
|||
ability.addCost(new SacrificeTargetCost(StaticFilters.FILTER_PERMANENT_CREATURE));
|
||||
ability.addTarget(new TargetCardInYourGraveyard(StaticFilters.FILTER_CARD_CREATURE));
|
||||
ability.addCost(new ReturnToHandFromBattlefieldSourceCost());
|
||||
ability.setTargetAdjuster(new ChthonianNightmareTargetAdjuster(SourceControllerCountersCount.ENERGY, ComparisonType.OR_LESS));
|
||||
ability.setTargetAdjuster(new XManaValueTargetAdjuster());
|
||||
ability.setCostAdjuster(ChthonianNightmareCostAdjuster.instance);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
@ -64,33 +58,6 @@ public final class ChthonianNightmare extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: replace with ManaValueTargetAdjuster in #12017
|
||||
class ChthonianNightmareTargetAdjuster implements TargetAdjuster {
|
||||
private Target blueprintTarget = null;
|
||||
private final DynamicValue dynamicValue;
|
||||
private final ComparisonType comparison;
|
||||
|
||||
ChthonianNightmareTargetAdjuster(DynamicValue value, ComparisonType compare) {
|
||||
this.dynamicValue = value;
|
||||
this.comparison = compare;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
if (blueprintTarget == null) {
|
||||
blueprintTarget = ability.getTargets().get(0).copy();
|
||||
blueprintTarget.clearChosen();
|
||||
}
|
||||
Target newTarget = blueprintTarget.copy();
|
||||
int amount = dynamicValue.calculate(game, ability, ability.getEffects().get(0));
|
||||
Filter<MageObject> filter = newTarget.getFilter();
|
||||
filter.add(new ManaValuePredicate(comparison, amount));
|
||||
newTarget.setTargetName(filter.getMessage() + " (Mana Value " + comparison + " " + amount + ")");
|
||||
ability.getTargets().clear();
|
||||
ability.addTarget(newTarget);
|
||||
}
|
||||
}
|
||||
|
||||
enum ChthonianNightmareCostAdjuster implements CostAdjuster {
|
||||
instance;
|
||||
|
||||
|
|
@ -114,4 +81,4 @@ enum ChthonianNightmareCostAdjuster implements CostAdjuster {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,21 +12,15 @@ import mage.abilities.costs.common.PayEnergyCost;
|
|||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.abilities.dynamicvalue.common.SourceControllerCountersCount;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.abilities.effects.common.counter.GetEnergyCountersControllerEffect;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.ComparisonType;
|
||||
import mage.filter.Filter;
|
||||
import mage.filter.predicate.mageobject.ManaValuePredicate;
|
||||
import mage.game.Game;
|
||||
import mage.target.Target;
|
||||
import mage.target.common.TargetNonlandPermanent;
|
||||
import mage.target.targetadjustment.TargetAdjuster;
|
||||
import mage.target.targetadjustment.XManaValueTargetAdjuster;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
|
|
@ -58,7 +52,7 @@ public final class HELIOSOne extends CardImpl {
|
|||
ability.addCost(new PayEnergyCost(0).setText("Pay X {E}")); // Cost adjusted.
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
ability.addTarget(new TargetNonlandPermanent());
|
||||
ability.setTargetAdjuster(new HELIOSOneTargetAdjuster(SourceControllerCountersCount.ENERGY, ComparisonType.OR_LESS));
|
||||
ability.setTargetAdjuster(new XManaValueTargetAdjuster());
|
||||
ability.setCostAdjuster(HELIOSOneCostAdjuster.instance);
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
@ -73,33 +67,6 @@ public final class HELIOSOne extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: replace with ManaValueTargetAdjuster in #12017
|
||||
class HELIOSOneTargetAdjuster implements TargetAdjuster {
|
||||
private Target blueprintTarget = null;
|
||||
private final DynamicValue dynamicValue;
|
||||
private final ComparisonType comparison;
|
||||
|
||||
HELIOSOneTargetAdjuster(DynamicValue value, ComparisonType compare) {
|
||||
this.dynamicValue = value;
|
||||
this.comparison = compare;
|
||||
}
|
||||
|
||||
@Override
|
||||
public void adjustTargets(Ability ability, Game game) {
|
||||
if (blueprintTarget == null) {
|
||||
blueprintTarget = ability.getTargets().get(0).copy();
|
||||
blueprintTarget.clearChosen();
|
||||
}
|
||||
Target newTarget = blueprintTarget.copy();
|
||||
int amount = dynamicValue.calculate(game, ability, ability.getEffects().get(0));
|
||||
Filter<MageObject> filter = newTarget.getFilter();
|
||||
filter.add(new ManaValuePredicate(comparison, amount));
|
||||
newTarget.setTargetName(filter.getMessage() + " (Mana Value " + comparison + " " + amount + ")");
|
||||
ability.getTargets().clear();
|
||||
ability.addTarget(newTarget);
|
||||
}
|
||||
}
|
||||
|
||||
enum HELIOSOneCostAdjuster implements CostAdjuster {
|
||||
instance;
|
||||
|
||||
|
|
@ -123,4 +90,4 @@ enum HELIOSOneCostAdjuster implements CostAdjuster {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -57,11 +57,11 @@ public final class PlasmaCaster extends CardImpl {
|
|||
new DamageTargetEffect(1)
|
||||
).setText("Choose target creature that's blocking equipped creature. "
|
||||
+ "Flip a coin. If you win the flip, exile the chosen creature. "
|
||||
+ "Otherwise, Plasma Caster deals 1 damage to it"),
|
||||
+ "Otherwise, {this} deals 1 damage to it"),
|
||||
new PayEnergyCost(2)
|
||||
);
|
||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||
this.addAbility(ability, new BlockingOrBlockedWatcher());
|
||||
this.addAbility(ability);
|
||||
|
||||
// Equip {2}
|
||||
this.addAbility(new EquipAbility(Outcome.BoostCreature, new GenericManaCost(2), false));
|
||||
|
|
|
|||
|
|
@ -7,7 +7,6 @@ public class DamagedBatchForOnePlayerEvent extends BatchEvent<DamagedPlayerEvent
|
|||
|
||||
public DamagedBatchForOnePlayerEvent(DamagedPlayerEvent firstEvent) {
|
||||
super(EventType.DAMAGED_BATCH_FOR_ONE_PLAYER, true, false, false, firstEvent);
|
||||
// TODO: rework to support singlePlayerId = true
|
||||
}
|
||||
|
||||
public boolean isCombatDamage() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue