changes to the way abilities are added to cards

This commit is contained in:
betasteward 2015-03-23 13:04:09 -04:00
parent 65390e09a6
commit 72ff6f27b3
91 changed files with 2003 additions and 217 deletions

View file

@ -119,7 +119,7 @@ class ChorusOfTheConclaveReplacementEffect extends ReplacementEffectImpl {
if (xCost > 0) {
Ability ability = new EntersBattlefieldAbility(new AddCountersSourceEffect(CounterType.P1P1.createInstance(xCost)));
ability.setRuleVisible(false);
card.addAbility(ability);
game.getState().addOtherAbility(card, ability);
ability.setControllerId(source.getControllerId());
ability.setSourceId(card.getId());
game.getState().addAbility(ability, source.getSourceId(), card);

View file

@ -115,7 +115,7 @@ class VarolzTheScarStripedEffect extends ContinuousEffectImpl {
ScavengeAbility ability = new ScavengeAbility(new ManaCostsImpl(card.getManaCost().getText()));
ability.setSourceId(cardId);
ability.setControllerId(card.getOwnerId());
game.getState().addOtherAbility(cardId, ability);
game.getState().addOtherAbility(card, ability);
}
}
return true;

View file

@ -144,7 +144,7 @@ class GainAbilitySpellsEffect extends ContinuousEffectImpl {
Card card = spell.getCard();
if (card != null) {
if (!card.getAbilities().contains(ability)) {
card.addAbility(ability);
game.getState().addOtherAbility(card, ability);
SoulfireGrandMasterLeavesStackWatcher watcher = (SoulfireGrandMasterLeavesStackWatcher) game.getState().getWatchers().get("SoulfireGrandMasterLeavesStackWatcher");
if (watcher != null) {
watcher.addCardId(card.getId());

View file

@ -103,7 +103,7 @@ class MycosynthGolemEffect extends ReplacementEffectImpl {
if (object != null) {
Card card = (Card) object;
Ability ability = new AffinityForArtifactsAbility();
card.addAbility(ability);
game.getState().addOtherAbility(card, ability);
ability.setControllerId(source.getControllerId());
ability.setSourceId(card.getId());
game.getState().addAbility(ability, source.getSourceId(), card);

View file

@ -150,7 +150,7 @@ class PrimalPlasmaReplacementEffect extends ReplacementEffectImpl {
mageObject.getPower().setValue(2);
mageObject.getToughness().setValue(2);
if (mageObject instanceof Card) {
((Card)mageObject).addAbility(FlyingAbility.getInstance());
game.getState().addOtherAbility((Card)mageObject, FlyingAbility.getInstance());
} else {
((Token)mageObject).addAbility(FlyingAbility.getInstance());
}
@ -159,7 +159,7 @@ class PrimalPlasmaReplacementEffect extends ReplacementEffectImpl {
mageObject.getPower().setValue(1);
mageObject.getToughness().setValue(6);
if (mageObject instanceof Card) {
((Card)mageObject).addAbility(DefenderAbility.getInstance());
game.getState().addOtherAbility((Card)mageObject, DefenderAbility.getInstance());
} else {
((Token)mageObject).addAbility(DefenderAbility.getInstance());
}

View file

@ -112,7 +112,7 @@ class DelayEffect extends OneShotEffect {
// If the exiled card leaves exile by another way, the abilites won't be removed from the card
Abilities oldAbilities = card.getAbilities().copy();
SuspendAbility suspendAbility = new SuspendAbility(3, null, card);
card.addAbility(suspendAbility);
game.getState().addOtherAbility(card, suspendAbility);
for (Ability ability :card.getAbilities()) {
if (!oldAbilities.contains(ability)) {

View file

@ -124,7 +124,7 @@ class PastInFlamesEffect extends ContinuousEffectImpl {
if (ability != null) {
ability.setSourceId(cardId);
ability.setControllerId(card.getOwnerId());
game.getState().addOtherAbility(cardId, ability);
game.getState().addOtherAbility(card, ability);
}
}
}

View file

@ -121,7 +121,7 @@ class SnapcasterMageEffect extends ContinuousEffectImpl {
}
ability.setSourceId(card.getId());
ability.setControllerId(card.getOwnerId());
game.getState().addOtherAbility(card.getId(), ability);
game.getState().addOtherAbility(card, ability);
return true;
}
return false;

View file

@ -101,7 +101,7 @@ class ChiefEngineerEffect extends ReplacementEffectImpl {
if (object != null) {
Card card = (Card) object;
Ability ability = new ConvokeAbility();
card.addAbility(ability);
game.getState().addOtherAbility(card, ability);
ability.setControllerId(source.getControllerId());
ability.setSourceId(card.getId());
game.getState().addAbility(ability, source.getSourceId(), card);

View file

@ -98,7 +98,7 @@ class GruesomeEncoreEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Card card = game.getCard(source.getFirstTarget());
if (card != null) {
card.addAbility(HasteAbility.getInstance());
game.getState().addOtherAbility(card, HasteAbility.getInstance());
card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId());
ExileTargetEffect exileEffect = new ExileTargetEffect();

View file

@ -110,7 +110,7 @@ class PostmortemLungeEffect extends OneShotEffect {
if (player == null) {
return false;
}
card.addAbility(HasteAbility.getInstance());
game.getState().addOtherAbility(card, HasteAbility.getInstance());
card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId());
ExileTargetEffect exileEffect = new ExileTargetEffect();

View file

@ -107,7 +107,7 @@ class RecoupEffect extends ContinuousEffectImpl {
FlashbackAbility ability = new FlashbackAbility(card.getManaCost(), TimingRule.SORCERY);
ability.setSourceId(card.getId());
ability.setControllerId(card.getOwnerId());
game.getState().addOtherAbility(card.getId(), ability);
game.getState().addOtherAbility(card, ability);
return true;
}
}

View file

@ -136,34 +136,20 @@ class PrimalPlasmaReplacementEffect extends ReplacementEffectImpl {
}
}
}
MageObject mageObject;
if (permanent instanceof PermanentCard) {
mageObject = ((PermanentCard) permanent).getCard();
} else {
mageObject = ((PermanentToken) permanent).getToken();
}
switch (choice.getChoice()) {
case choice33:
mageObject.getPower().setValue(3);
mageObject.getToughness().setValue(3);
permanent.getPower().setValue(3);
permanent.getToughness().setValue(3);
break;
case choice22:
mageObject.getPower().setValue(2);
mageObject.getToughness().setValue(2);
if (mageObject instanceof Card) {
((Card)mageObject).addAbility(FlyingAbility.getInstance());
} else {
((Token)mageObject).addAbility(FlyingAbility.getInstance());
}
permanent.getPower().setValue(2);
permanent.getToughness().setValue(2);
permanent.addAbility(FlyingAbility.getInstance(), source.getId(), game);
break;
case choice16:
mageObject.getPower().setValue(1);
mageObject.getToughness().setValue(6);
if (mageObject instanceof Card) {
((Card)mageObject).addAbility(DefenderAbility.getInstance());
} else {
((Token)mageObject).addAbility(DefenderAbility.getInstance());
}
permanent.getPower().setValue(1);
permanent.getToughness().setValue(6);
permanent.addAbility(DefenderAbility.getInstance(), source.getId(), game);
break;
}
}

View file

@ -63,7 +63,7 @@ public class BeastbreakerOfBalaGed extends LevelerCard {
Abilities<Ability> levelAbilities = new AbilitiesImpl<Ability>();
levelAbilities.add(TrampleAbility.getInstance());
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
// LEVEL 1-3
// 4/4
new LevelerCardBuilder.LevelAbility(1, 3, new AbilitiesImpl<Ability>(), 4, 4),
@ -71,7 +71,8 @@ public class BeastbreakerOfBalaGed extends LevelerCard {
// 4/4
// Trample
new LevelerCardBuilder.LevelAbility(4, -1, levelAbilities, 6, 6)
);
));
setMaxLevelCounters(4);
}
public BeastbreakerOfBalaGed(final BeastbreakerOfBalaGed card) {

View file

@ -72,10 +72,11 @@ public class BrimstoneMage extends LevelerCard {
ability.addTarget(new TargetCreatureOrPlayer());
abilities2.add(ability);
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(1, 2, abilities1, 2, 3),
new LevelerCardBuilder.LevelAbility(3, -1, abilities2, 2, 4)
);
));
setMaxLevelCounters(3);
}
public BrimstoneMage (final BrimstoneMage card) {

View file

@ -59,10 +59,10 @@ public class CaravanEscort extends LevelerCard {
this.addAbility(new LevelUpAbility(new ManaCostsImpl("{2}")));
AbilitiesImpl<Ability> levelAbilities = new AbilitiesImpl<Ability>(FirstStrikeAbility.getInstance());
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(1, 4, new AbilitiesImpl<Ability>(), 2, 2),
new LevelerCardBuilder.LevelAbility(5, -1, levelAbilities, 5, 5)
);
));
setMaxLevelCounters(5);
}

View file

@ -68,7 +68,7 @@ public class CastThroughTime extends CardImpl {
// Instant and sorcery spells you control have rebound.
// (Exile the spell as it resolves if you cast it from your hand. At the beginning of your next upkeep, you may cast that card from exile without paying its mana cost.)
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainReboundEffect()), new LeavesBattlefieldWatcher());
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new GainReboundEffect()));
}
public CastThroughTime(final CastThroughTime card) {
@ -131,52 +131,52 @@ class GainReboundEffect extends ContinuousEffectImpl {
}
}
if (!found) {
Ability ability = new AttachedReboundAbility();
card.addAbility(ability);
Ability ability = new ReboundAbility();
// card.addAbility(ability);
ability.setControllerId(source.getControllerId());
ability.setSourceId(card.getId());
game.getState().addAbility(ability, card);
game.getState().addOtherAbility(card, ability);
}
}
}
}
class AttachedReboundAbility extends ReboundAbility {}
//class AttachedReboundAbility extends ReboundAbility {}
class LeavesBattlefieldWatcher extends Watcher {
public LeavesBattlefieldWatcher() {
super("LeavesBattlefieldWatcher", WatcherScope.CARD);
}
public LeavesBattlefieldWatcher(final LeavesBattlefieldWatcher watcher) {
super(watcher);
}
@Override
public void watch(GameEvent event, Game game) {
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId())) {
ZoneChangeEvent zEvent = (ZoneChangeEvent)event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
Player player = game.getPlayer(this.getControllerId());
if (player != null) {
for (Card card : player.getHand().getCards(CastThroughTime.filter, game)) {
Iterator<Ability> it = card.getAbilities().iterator();
while (it.hasNext()) {
if (it.next() instanceof AttachedReboundAbility) {
it.remove();
}
}
}
}
}
}
}
@Override
public LeavesBattlefieldWatcher copy() {
return new LeavesBattlefieldWatcher(this);
}
}
//class LeavesBattlefieldWatcher extends Watcher {
//
// public LeavesBattlefieldWatcher() {
// super("LeavesBattlefieldWatcher", WatcherScope.CARD);
// }
//
// public LeavesBattlefieldWatcher(final LeavesBattlefieldWatcher watcher) {
// super(watcher);
// }
//
// @Override
// public void watch(GameEvent event, Game game) {
// if (event.getType() == GameEvent.EventType.ZONE_CHANGE && event.getTargetId().equals(this.getSourceId())) {
// ZoneChangeEvent zEvent = (ZoneChangeEvent)event;
// if (zEvent.getFromZone() == Zone.BATTLEFIELD) {
// Player player = game.getPlayer(this.getControllerId());
// if (player != null) {
// for (Card card : player.getHand().getCards(CastThroughTime.filter, game)) {
// Iterator<Ability> it = card.getAbilities().iterator();
// while (it.hasNext()) {
// if (it.next() instanceof AttachedReboundAbility) {
// it.remove();
// }
// }
// }
// }
// }
// }
// }
//
// @Override
// public LeavesBattlefieldWatcher copy() {
// return new LeavesBattlefieldWatcher(this);
// }
//
//}

View file

@ -78,10 +78,11 @@ public class CoralhelmCommander extends LevelerCard {
abilities2.add(FlyingAbility.getInstance());
abilities2.add(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filter, true)));
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(2, 3, abilities1, 3, 3),
new LevelerCardBuilder.LevelAbility(4, -1, abilities2, 4, 4)
);
));
setMaxLevelCounters(4);
}
public CoralhelmCommander(final CoralhelmCommander card) {

View file

@ -44,6 +44,7 @@ import mage.abilities.effects.common.CopyTargetSpellEffect;
import mage.abilities.keyword.LevelUpAbility;
import mage.abilities.keyword.LevelerCardBuilder;
import mage.cards.CardImpl;
import mage.cards.LevelerCard;
import mage.filter.FilterSpell;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.CardTypePredicate;
@ -55,7 +56,7 @@ import mage.target.TargetSpell;
*
* @author North
*/
public class EchoMage extends CardImpl {
public class EchoMage extends LevelerCard {
private static final FilterSpell filter = new FilterSpell("instant or sorcery spell");
@ -94,9 +95,10 @@ public class EchoMage extends CardImpl {
ability.addCost(new TapSourceCost());
abilities2.add(ability);
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(2, 3, abilities1, 2, 4),
new LevelerCardBuilder.LevelAbility(4, -1, abilities2, 2, 5));
new LevelerCardBuilder.LevelAbility(4, -1, abilities2, 2, 5)));
setMaxLevelCounters(4);
}
public EchoMage(final EchoMage card) {

View file

@ -69,10 +69,11 @@ public class EnclaveCryptologist extends LevelerCard {
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new TapSourceCost());
Abilities<Ability> abilities2 = new AbilitiesImpl<Ability>(ability);
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(1, 2, abilities1, 0, 1),
new LevelerCardBuilder.LevelAbility(3, -1, abilities2, 0, 1)
);
));
setMaxLevelCounters(3);
}
public EnclaveCryptologist (final EnclaveCryptologist card) {

View file

@ -76,10 +76,11 @@ public class GuulDrazAssassin extends LevelerCard {
ability2.addCost(new TapSourceCost());
abilities2.add(ability2);
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(2, 3, abilities1, 2, 2),
new LevelerCardBuilder.LevelAbility(4, -1, abilities2, 4, 4)
);
));
setMaxLevelCounters(4);
}
public GuulDrazAssassin (final GuulDrazAssassin card) {

View file

@ -74,10 +74,11 @@ public class HadaSpyPatrol extends LevelerCard {
abilities2.add(ShroudAbility.getInstance());
abilities2.add(new CantBeBlockedSourceAbility());
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(1, 2, abilities1, 2, 2),
new LevelerCardBuilder.LevelAbility(3, -1, abilities2, 3, 3)
);
));
setMaxLevelCounters(3);
}
public HadaSpyPatrol(final HadaSpyPatrol card) {

View file

@ -62,10 +62,11 @@ public class HalimarWavewatch extends LevelerCard {
Abilities<Ability> levelAbilities = new AbilitiesImpl<Ability>();
levelAbilities.add(new IslandwalkAbility());
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(1, 4, new AbilitiesImpl<Ability>(), 0, 6),
new LevelerCardBuilder.LevelAbility(5, -1, levelAbilities, 6, 6)
);
));
setMaxLevelCounters(5);
}
public HalimarWavewatch(final HalimarWavewatch card) {

View file

@ -42,6 +42,7 @@ import mage.abilities.effects.PreventionEffectImpl;
import mage.abilities.keyword.LevelUpAbility;
import mage.abilities.keyword.LevelerCardBuilder;
import mage.cards.CardImpl;
import mage.cards.LevelerCard;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
@ -50,7 +51,7 @@ import mage.game.permanent.Permanent;
*
* @author North
*/
public class HedronFieldPurists extends CardImpl {
public class HedronFieldPurists extends LevelerCard {
public HedronFieldPurists(UUID ownerId) {
super(ownerId, 25, "Hedron-Field Purists", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{W}");
@ -75,9 +76,10 @@ public class HedronFieldPurists extends CardImpl {
Abilities<Ability> abilities2 = new AbilitiesImpl<>();
abilities2.add(new SimpleStaticAbility(Zone.BATTLEFIELD, new HedronFieldPuristsEffect(2)));
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(1, 4, abilities1, 1, 4),
new LevelerCardBuilder.LevelAbility(5, -1, abilities2, 2, 5));
new LevelerCardBuilder.LevelAbility(5, -1, abilities2, 2, 5)));
setMaxLevelCounters(5);
}
public HedronFieldPurists(final HedronFieldPurists card) {

View file

@ -65,10 +65,11 @@ public class IkiralOutrider extends LevelerCard {
Abilities<Ability> abilities2 = new AbilitiesImpl<Ability>();
abilities2.add(VigilanceAbility.getInstance());
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(1, 3, abilities1, 2, 6),
new LevelerCardBuilder.LevelAbility(4, -1, abilities2, 3, 10)
);
));
setMaxLevelCounters(4);
}
public IkiralOutrider (final IkiralOutrider card) {

View file

@ -92,10 +92,11 @@ public class JoragaTreespeaker extends LevelerCard {
new TapSourceCost()),
Duration.WhileOnBattlefield, filter)));
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(1, 4, abilities1, 1, 2),
new LevelerCardBuilder.LevelAbility(5, -1, abilities2, 1, 4)
);
));
setMaxLevelCounters(5);
}
public JoragaTreespeaker(final JoragaTreespeaker card) {

View file

@ -69,10 +69,11 @@ public class KabiraVindicator extends LevelerCard {
Abilities<Ability> abilities2 = new AbilitiesImpl<Ability>();
abilities2.add(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostControlledEffect(2, 2, Duration.WhileOnBattlefield, new FilterCreaturePermanent(), true)));
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(2, 4, abilities1, 3, 6),
new LevelerCardBuilder.LevelAbility(5, -1, abilities2, 4, 8)
);
));
setMaxLevelCounters(5);
}
public KabiraVindicator(final KabiraVindicator card) {

View file

@ -72,10 +72,11 @@ public class KarganDragonlord extends LevelerCard {
abilities2.add(TrampleAbility.getInstance());
abilities2.add(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostSourceEffect(1, 0, Duration.EndOfTurn), new ManaCostsImpl("{R}")));
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(4, 7, abilities1, 4, 4),
new LevelerCardBuilder.LevelAbility(8, -1, abilities2, 8, 8)
);
));
setMaxLevelCounters(8);
}
public KarganDragonlord(final KarganDragonlord card) {

View file

@ -72,10 +72,11 @@ public class KazanduTuskcaller extends LevelerCard {
new CreateTokenEffect(new ElephantToken(), 2),
new TapSourceCost()));
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(2, 5, abilities1, 1, 1),
new LevelerCardBuilder.LevelAbility(6, -1, abilities2, 1, 1)
);
));
setMaxLevelCounters(6);
}
public KazanduTuskcaller(final KazanduTuskcaller card) {

View file

@ -67,10 +67,11 @@ public class KnightOfCliffhaven extends LevelerCard {
abilities2.add(FlyingAbility.getInstance());
abilities2.add(VigilanceAbility.getInstance());
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(1, 3, abilities1, 2, 3),
new LevelerCardBuilder.LevelAbility(4, -1, abilities2, 4, 4)
);
));
setMaxLevelCounters(4);
}
public KnightOfCliffhaven(final KnightOfCliffhaven card) {

View file

@ -75,10 +75,11 @@ public class LighthouseChronologist extends LevelerCard {
Abilities<Ability> abilities2 = new AbilitiesImpl<>();
abilities2.add(new LighthouseChronologistAbility());
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(4, 6, abilities1, 2, 4),
new LevelerCardBuilder.LevelAbility(7, -1, abilities2, 3, 5)
);
));
setMaxLevelCounters(7);
}
public LighthouseChronologist (final LighthouseChronologist card) {

View file

@ -42,6 +42,7 @@ import mage.abilities.effects.OneShotEffect;
import mage.abilities.keyword.LevelUpAbility;
import mage.abilities.keyword.LevelerCardBuilder;
import mage.cards.CardImpl;
import mage.cards.LevelerCard;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.ControllerIdPredicate;
import mage.game.Game;
@ -51,7 +52,7 @@ import mage.game.permanent.Permanent;
*
* @author North
*/
public class LordOfShatterskullPass extends CardImpl {
public class LordOfShatterskullPass extends LevelerCard {
public LordOfShatterskullPass(UUID ownerId) {
super(ownerId, 156, "Lord of Shatterskull Pass", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{3}{R}");
@ -74,9 +75,10 @@ public class LordOfShatterskullPass extends CardImpl {
Abilities<Ability> abilities2 = new AbilitiesImpl<Ability>();
abilities2.add(new AttacksTriggeredAbility(new LordOfShatterskullPassEffect(), false));
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(1, 5, abilities1, 6, 6),
new LevelerCardBuilder.LevelAbility(6, -1, abilities2, 6, 6));
new LevelerCardBuilder.LevelAbility(6, -1, abilities2, 6, 6)));
setMaxLevelCounters(6);
}
public LordOfShatterskullPass(final LordOfShatterskullPass card) {

View file

@ -66,10 +66,11 @@ public class NirkanaCutthroat extends LevelerCard {
abilities2.add(FirstStrikeAbility.getInstance());
abilities2.add(DeathtouchAbility.getInstance());
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(1, 2, abilities1, 4, 3),
new LevelerCardBuilder.LevelAbility(3, -1, abilities2, 5, 4)
);
));
setMaxLevelCounters(3);
}
public NirkanaCutthroat (final NirkanaCutthroat card) {

View file

@ -65,10 +65,11 @@ public class NullChampion extends LevelerCard {
Abilities<Ability> abilities2 = new AbilitiesImpl<Ability>();
abilities2.add(new SimpleActivatedAbility(Zone.BATTLEFIELD, new RegenerateSourceEffect(), new ManaCostsImpl("{B}")));
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(1, 3, abilities1, 4, 2),
new LevelerCardBuilder.LevelAbility(4, -1, abilities2, 7, 3)
);
));
setMaxLevelCounters(4);
}
public NullChampion (final NullChampion card) {

View file

@ -65,10 +65,11 @@ public class SkywatcherAdept extends LevelerCard {
Abilities<Ability> abilities2 = new AbilitiesImpl<Ability>();
abilities2.add(FlyingAbility.getInstance());
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(1, 2, abilities1, 2, 2),
new LevelerCardBuilder.LevelAbility(3, -1, abilities2, 4, 2)
);
));
setMaxLevelCounters(3);
}
public SkywatcherAdept(final SkywatcherAdept card) {

View file

@ -65,10 +65,11 @@ public class StudentOfWarfare extends LevelerCard {
Abilities<Ability> abilities2 = new AbilitiesImpl<Ability>();
abilities2.add(DoubleStrikeAbility.getInstance());
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(2, 6, abilities1, 3, 3),
new LevelerCardBuilder.LevelAbility(7, -1, abilities2, 4, 4)
);
));
setMaxLevelCounters(7);
}
public StudentOfWarfare (final StudentOfWarfare card) {

View file

@ -70,10 +70,11 @@ public class TranscendentMaster extends LevelerCard {
LifelinkAbility.getInstance(),
IndestructibleAbility.getInstance());
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(6, 11, abilities1, 6, 6),
new LevelerCardBuilder.LevelAbility(12, -1, abilities2, 9, 9)
);
));
setMaxLevelCounters(12);
}
public TranscendentMaster(final TranscendentMaster card) {

View file

@ -70,10 +70,11 @@ public class ZulaportEnforcer extends LevelerCard {
Abilities<Ability> levelAbilities = new AbilitiesImpl<Ability>();
levelAbilities.add(ZulaportEnforcerAbility.getInstance());
LevelerCardBuilder.construct(this,
this.addAbilities(LevelerCardBuilder.construct(
new LevelerCardBuilder.LevelAbility(1, 2, new AbilitiesImpl<Ability>(), 3, 3),
new LevelerCardBuilder.LevelAbility(3, -1, levelAbilities, 5, 5)
);
));
setMaxLevelCounters(3);
}
public ZulaportEnforcer(final ZulaportEnforcer card) {

View file

@ -93,7 +93,7 @@ class SedrisTheTraitorKingEffect extends ContinuousEffectImpl {
UnearthAbility ability = new UnearthAbility(new ManaCostsImpl("{2}{B}"));
ability.setSourceId(cardId);
ability.setControllerId(card.getOwnerId());
game.getState().addOtherAbility(cardId, ability);
game.getState().addOtherAbility(card, ability);
}
}
return true;

View file

@ -94,7 +94,7 @@ class CrucibleOfWorldsEffect extends ContinuousEffectImpl {
PlayLandFromGraveyardAbility ability = new PlayLandFromGraveyardAbility(card.getName());
ability.setSourceId(cardId);
ability.setControllerId(card.getOwnerId());
game.getState().addOtherAbility(cardId, ability);
game.getState().addOtherAbility(card, ability);
}
}
return true;

View file

@ -116,7 +116,6 @@ class WhipOfErebosEffect extends OneShotEffect {
Card card = game.getCard(this.getTargetPointer().getFirst(game, source));
Player controller = game.getPlayer(source.getControllerId());
if (controller != null && card != null) {
card.addAbility(HasteAbility.getInstance());
if (controller.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId())) {
// gains haste
ContinuousEffect effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.Custom);

View file

@ -162,7 +162,7 @@ class DralnuLichLordFlashbackEffect extends ContinuousEffectImpl {
}
ability.setSourceId(card.getId());
ability.setControllerId(card.getOwnerId());
game.getState().addOtherAbility(card.getId(), ability);
game.getState().addOtherAbility(card, ability);
return true;
}
return false;

View file

@ -110,20 +110,20 @@ class TeferiMageOfZhalfirAddFlashEffect extends ContinuousEffectImpl {
for (UUID cardId: controller.getGraveyard()) {
Card card = game.getCard(cardId);
if (card.getCardType().contains(CardType.CREATURE)) {
game.getState().addOtherAbility(cardId, FlashAbility.getInstance());
game.getState().addOtherAbility(card, FlashAbility.getInstance());
}
}
// on Hand
for (UUID cardId: controller.getHand()) {
Card card = game.getCard(cardId);
if (card.getCardType().contains(CardType.CREATURE)) {
game.getState().addOtherAbility(cardId, FlashAbility.getInstance());
game.getState().addOtherAbility(card, FlashAbility.getInstance());
}
}
// in Exile
for (Card card: game.getState().getExile().getAllCards(game)) {
if (card.getOwnerId().equals(controller.getId()) && card.getCardType().contains(CardType.CREATURE)) {
game.getState().addOtherAbility(card.getId(), FlashAbility.getInstance());
game.getState().addOtherAbility(card, FlashAbility.getInstance());
}
}
// in Library seems not relevant yet

View file

@ -80,7 +80,8 @@ public class Necromancy extends CardImpl {
// You may cast Necromancy as though it had flash. If you cast it any time a sorcery couldn't have been cast, the controller of the permanent it becomes sacrifices it at the beginning of the next cleanup step.
this.addAbility(new SimpleStaticAbility(Zone.ALL, new CastSourceAsThoughItHadFlashEffect(this, Duration.EndOfGame, true)));
this.addAbility(new CastAtInstantTimeTriggeredAbility());
// When Necromancy enters the battlefield, if it's on the battlefield, it becomes an Aura with "enchant creature put onto the battlefield with Necromancy."
// Put target creature card from a graveyard onto the battlefield under your control and attach Necromancy to it.
// When Necromancy leaves the battlefield, that creature's controller sacrifices it.
@ -111,9 +112,6 @@ class CastSourceAsThoughItHadFlashEffect extends AsThoughEffectImpl {
public CastSourceAsThoughItHadFlashEffect(Card card, Duration duration, boolean sacrificeIfCastAsInstant) {
super(AsThoughEffectType.CAST_AS_INSTANT, duration, Outcome.Benefit);
this.sacrificeIfCastAsInstant = sacrificeIfCastAsInstant;
if (sacrificeIfCastAsInstant) {
card.addAbility(new CastAtInstantTimeTriggeredAbility());
}
staticText = "You may cast {this} as though it had flash";
}