Some minor fixes to Idle Thoughts, Kithkin Zealot, Hallowed Burial, Endless Horizon.

This commit is contained in:
LevelX2 2013-10-10 08:13:30 +02:00
parent f34ecae48a
commit 6388c939ee
5 changed files with 41 additions and 64 deletions

View file

@ -103,17 +103,21 @@ class EndlessHorizonsEffect extends SearchEffect<EndlessHorizonsEffect> {
@Override
public boolean apply(Game game, Ability source) {
Player you = game.getPlayer(source.getControllerId());
if (you != null && you.searchLibrary(target, game)) {
if (target.getTargets().size() > 0) {
for (UUID cardId : target.getTargets()) {
Card card = you.getLibrary().remove(cardId, game);
if (card != null) {
card.moveToExile(CardUtil.getCardExileZoneId(game, source), "Endless Horizons", source.getSourceId(), game);
if (you != null) {
if (you.searchLibrary(target, game)) {
UUID exileZone = CardUtil.getCardExileZoneId(game, source);
if (target.getTargets().size() > 0) {
for (UUID cardId : target.getTargets()) {
Card card = you.getLibrary().getCard(cardId, game);
if (card != null) {
card.moveToExile(exileZone, "Endless Horizons", source.getSourceId(), game);
}
}
}
you.shuffleLibrary(game);
return true;
}
you.shuffleLibrary(game);
return true;
}
return false;
}
@ -140,15 +144,13 @@ class EndlessHorizonsEffect extends SearchEffect<EndlessHorizonsEffect> {
ExileZone exZone = game.getExile().getExileZone(CardUtil.getCardExileZoneId(game, source));
if (exZone != null) {
for (Card card : exZone.getCards(game)) {
if (card != null
&& card.getOwnerId() == source.getControllerId()) {
if (card.moveToZone(Zone.HAND, source.getId(), game, false)) {
return true;
}
if (card.getOwnerId() == source.getControllerId()) {
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
break; // only one
}
}
}
return false;
return true;
}
}
}

View file

@ -35,6 +35,7 @@ import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -83,10 +84,8 @@ class HallowedBurialEffect extends OneShotEffect<HallowedBurialEffect> {
@Override
public boolean apply(Game game, Ability source) {
for (Permanent creature : game.getBattlefield().getAllActivePermanents(CardType.CREATURE)) {
if (creature != null) {
creature.moveToZone(Zone.LIBRARY, source.getId(), game, false);
}
for (Permanent creature : game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), source.getSourceId(), game)) {
creature.moveToZone(Zone.LIBRARY, source.getSourceId(), game, false);
}
return false;
}

View file

@ -33,7 +33,9 @@ import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.condition.Condition;
import mage.abilities.condition.common.CardsInHandCondition;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.decorator.ConditionalOneShotEffect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardControllerEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Outcome;
@ -55,7 +57,9 @@ public class IdleThoughts extends CardImpl<IdleThoughts> {
this.color.setBlue(true);
// {2}: Draw a card if you have no cards in hand.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new IdleThoughtsEffect(), new ManaCostsImpl("{2}")));
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new ConditionalOneShotEffect(
new DrawCardControllerEffect(2), new CardsInHandCondition(),
"Draw a card if you have no cards in hand"), new ManaCostsImpl("{{2}}")));
}
public IdleThoughts(final IdleThoughts card) {
@ -67,32 +71,3 @@ public class IdleThoughts extends CardImpl<IdleThoughts> {
return new IdleThoughts(this);
}
}
class IdleThoughtsEffect extends OneShotEffect<IdleThoughtsEffect> {
public IdleThoughtsEffect() {
super(Outcome.Benefit);
this.staticText = "Draw a card if you have no cards in hand";
}
public IdleThoughtsEffect(final IdleThoughtsEffect effect) {
super(effect);
}
@Override
public IdleThoughtsEffect copy() {
return new IdleThoughtsEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Condition condition = new CardsInHandCondition();
Player you = game.getPlayer(source.getControllerId());
if (condition.apply(game, source)
&& you != null) {
you.drawCards(1, game);
return true;
}
return false;
}
}

View file

@ -62,9 +62,8 @@ public class KithkinZealot extends CardImpl<KithkinZealot> {
// When Kithkin Zealot enters the battlefield, you gain 1 life for each black and/or red permanent target opponent controls.
Ability ability = new EntersBattlefieldTriggeredAbility(new KithkinZealotEffect(), false);
ability.addTarget(new TargetOpponent());
ability.addTarget(new TargetOpponent(true));
this.addAbility(ability);
}
public KithkinZealot(final KithkinZealot card) {
@ -79,6 +78,13 @@ public class KithkinZealot extends CardImpl<KithkinZealot> {
class KithkinZealotEffect extends OneShotEffect<KithkinZealotEffect> {
private static final FilterPermanent filter = new FilterPermanent();
static {
filter.add(Predicates.or(
new ColorPredicate(ObjectColor.BLACK),
new ColorPredicate(ObjectColor.RED)));
}
public KithkinZealotEffect() {
super(Outcome.Neutral);
this.staticText = "you gain 1 life for each black and/or red permanent target opponent controls";
@ -96,19 +102,13 @@ class KithkinZealotEffect extends OneShotEffect<KithkinZealotEffect> {
@Override
public boolean apply(Game game, Ability source) {
Player you = game.getPlayer(source.getControllerId());
Player opponent = game.getPlayer(source.getFirstTarget());
FilterPermanent filter = new FilterPermanent();
filter.add(Predicates.or(
new ColorPredicate(ObjectColor.BLACK),
new ColorPredicate(ObjectColor.RED)));
if (opponent != null) {
Player opponent = game.getPlayer(targetPointer.getFirst(game, source));
if (you!= null && opponent != null) {
int amount = game.getBattlefield().countAll(filter, opponent.getId(), game);
if (you != null) {
you.gainLife(amount, game);
return true;
}
you.gainLife(amount, game);
return true;
}
return false;
}
}
}