mirror of
https://github.com/correl/mage.git
synced 2024-11-15 11:09:30 +00:00
removed a few TODOs
This commit is contained in:
parent
56b5d54ca1
commit
c233ca57d8
3 changed files with 16 additions and 45 deletions
|
@ -35,7 +35,7 @@ public final class CrownOfDoom extends CardImpl {
|
|||
private static final FilterPlayer filter = new FilterPlayer("player other than {this}'s owner");
|
||||
|
||||
static {
|
||||
filter.add(new CrownOfDoomPredicate());
|
||||
filter.add(CrownOfDoomPredicate.instance);
|
||||
}
|
||||
|
||||
public CrownOfDoom(UUID ownerId, CardSetInfo setInfo) {
|
||||
|
@ -51,13 +51,11 @@ public final class CrownOfDoom extends CardImpl {
|
|||
SetTargetPointer.PERMANENT,
|
||||
true));
|
||||
|
||||
//TODO: Make ability properly copiable
|
||||
|
||||
// {2}: Target player other than Crown of Doom's owner gains control of it. Activate this ability only during your turn.
|
||||
Ability ability = new ActivateIfConditionActivatedAbility(
|
||||
Zone.BATTLEFIELD,
|
||||
new CrownOfDoomEffect(),
|
||||
new ManaCostsImpl("{2}"),
|
||||
new ManaCostsImpl<>("{2}"),
|
||||
MyTurnCondition.instance);
|
||||
ability.addTarget(new TargetPlayer(1, 1, false, filter));
|
||||
ability.addHint(MyTurnHint.instance);
|
||||
|
@ -74,10 +72,8 @@ public final class CrownOfDoom extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class CrownOfDoomPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Player>> {
|
||||
|
||||
public CrownOfDoomPredicate() {
|
||||
}
|
||||
enum CrownOfDoomPredicate implements ObjectSourcePlayerPredicate<ObjectSourcePlayer<Player>> {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(ObjectSourcePlayer<Player> input, Game game) {
|
||||
|
|
|
@ -40,7 +40,6 @@ public final class MartyrOfBones extends CardImpl {
|
|||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// TODO: Make ability properly copiable
|
||||
// {1}, Reveal X black cards from your hand, Sacrifice Martyr of Bones: Exile up to X target cards from a single graveyard.
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new GenericManaCost(1));
|
||||
ability.addCost(new RevealVariableBlackCardsFromHandCost());
|
||||
|
|
|
@ -3,17 +3,18 @@ package mage.cards.s;
|
|||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.costs.CostAdjuster;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.dynamicvalue.common.PartyCount;
|
||||
import mage.abilities.effects.common.InfoEffect;
|
||||
import mage.abilities.effects.common.combat.CantBeBlockedSourceEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostSourceEffect;
|
||||
import mage.abilities.effects.common.cost.CostModificationEffectImpl;
|
||||
import mage.abilities.hint.common.PartyCountHint;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
@ -34,7 +35,6 @@ public final class SeafloorStalker extends CardImpl {
|
|||
this.toughness = new MageInt(3);
|
||||
|
||||
// {4}{U}: Seafloor Stalker gets +1/+0 until end of turn and can't be blocked this turn. This ability costs {1} less to activate for each creature in your party.
|
||||
// TODO: Make ability properly copiable
|
||||
Ability ability = new SimpleActivatedAbility(
|
||||
new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl<>("{4}{U}")
|
||||
);
|
||||
|
@ -42,10 +42,8 @@ public final class SeafloorStalker extends CardImpl {
|
|||
ability.addEffect(new InfoEffect(
|
||||
"This ability costs {1} less to activate for each creature in your party. " + PartyCount.getReminder()
|
||||
));
|
||||
this.addAbility(ability);
|
||||
this.addAbility(new SimpleStaticAbility(
|
||||
Zone.ALL, new SeafloorStalkerCostIncreasingEffect(ability.getOriginalId())
|
||||
).addHint(PartyCountHint.instance));
|
||||
ability.setCostAdjuster(SeafloorStalkerAdjuster.instance);
|
||||
this.addAbility(ability.addHint(PartyCountHint.instance));
|
||||
}
|
||||
|
||||
private SeafloorStalker(final SeafloorStalker card) {
|
||||
|
@ -58,37 +56,15 @@ public final class SeafloorStalker extends CardImpl {
|
|||
}
|
||||
}
|
||||
|
||||
class SeafloorStalkerCostIncreasingEffect extends CostModificationEffectImpl {
|
||||
|
||||
private final UUID originalId;
|
||||
|
||||
SeafloorStalkerCostIncreasingEffect(UUID originalId) {
|
||||
super(Duration.EndOfGame, Outcome.Benefit, CostModificationType.REDUCE_COST);
|
||||
this.originalId = originalId;
|
||||
}
|
||||
|
||||
private SeafloorStalkerCostIncreasingEffect(final SeafloorStalkerCostIncreasingEffect effect) {
|
||||
super(effect);
|
||||
this.originalId = effect.originalId;
|
||||
}
|
||||
enum SeafloorStalkerAdjuster implements CostAdjuster {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
public void adjustCosts(Ability ability, Game game) {
|
||||
Player controller = game.getPlayer(ability.getControllerId());
|
||||
if (controller != null) {
|
||||
int count = PartyCount.instance.calculate(game, source, this);
|
||||
CardUtil.reduceCost(abilityToModify, count);
|
||||
int count = PartyCount.instance.calculate(game, ability, null);
|
||||
CardUtil.reduceCost(ability, count);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
return abilityToModify.getOriginalId().equals(originalId);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SeafloorStalkerCostIncreasingEffect copy() {
|
||||
return new SeafloorStalkerCostIncreasingEffect(this);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue