mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
[THS] Some fixes for Bow of Nylea and Ashio, Nightmare Weaver.
This commit is contained in:
parent
13cc227ebb
commit
a21f7f315d
3 changed files with 28 additions and 8 deletions
|
@ -38,6 +38,8 @@ import mage.abilities.effects.OneShotEffect;
|
|||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.Cards;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Layer;
|
||||
|
@ -163,6 +165,7 @@ class AshiokNightmareWeaverPutIntoPlayEffect extends OneShotEffect<AshiokNightma
|
|||
FilterCard filter = new FilterCreatureCard(new StringBuilder("creature card with converted mana cost {").append(cmc).append("} exiled with Ashiok, Nightmare Weaver").toString());
|
||||
filter.add(new ConvertedManaCostPredicate(Filter.ComparisonType.Equal, cmc));
|
||||
Target target = new TargetCardInExile(filter, CardUtil.getCardExileZoneId(game, source));
|
||||
target.setRequired(true);
|
||||
|
||||
if (target.canChoose(source.getSourceId(), player.getId(), game)) {
|
||||
if (player.chooseTarget(Outcome.PutCreatureInPlay, target, source, game)) {
|
||||
|
@ -247,13 +250,17 @@ class AshiokNightmareWeaverExileAllEffect extends OneShotEffect<AshiokNightmareW
|
|||
for (UUID opponentId: game.getOpponents(source.getControllerId())) {
|
||||
Player opponent = game.getPlayer(opponentId);
|
||||
if (opponent != null) {
|
||||
for (UUID cardId :opponent.getHand()) {
|
||||
Cards cards = new CardsImpl();
|
||||
cards.addAll(opponent.getHand());
|
||||
for (UUID cardId : cards) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card != null) {
|
||||
card.moveToExile(exileId, "Ashiok, Nightmare Weaver", source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
for (UUID cardId :opponent.getGraveyard()) {
|
||||
cards.clear();
|
||||
cards.addAll(opponent.getGraveyard());
|
||||
for (UUID cardId :cards) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card != null) {
|
||||
card.moveToExile(exileId, "Ashiok, Nightmare Weaver", source.getSourceId(), game);
|
||||
|
|
|
@ -81,13 +81,14 @@ public class BowOfNylea extends CardImpl<BowOfNylea> {
|
|||
this.color.setGreen(true);
|
||||
|
||||
// Attacking creatures you control have deathtouch.
|
||||
GainAbilityControlledEffect gainEffect = new GainAbilityControlledEffect(DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield, new FilterAttackingCreature(), false);
|
||||
GainAbilityControlledEffect gainEffect = new GainAbilityControlledEffect(DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield, new FilterAttackingCreature("Attacking creatures"), false);
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, gainEffect));
|
||||
|
||||
// {1}{G}, {T}: Choose one - Put a +1/+1 counter on target creature;
|
||||
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
new AddCountersTargetEffect(CounterType.P1P1.createInstance()),
|
||||
new ManaCostsImpl("{1}{G}"));
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
ability.addCost(new TapSourceCost());
|
||||
// or Bow of Nylea deals 2 damage to target creature with flying;
|
||||
Mode mode = new Mode();
|
||||
|
|
|
@ -71,18 +71,25 @@ public class TargetCardInExile extends TargetCard<TargetCardInExile> {
|
|||
|
||||
@Override
|
||||
public Set<UUID> possibleTargets(UUID sourceId, UUID sourceControllerId, Game game) {
|
||||
if (allExileZones) {
|
||||
Set<UUID> possibleTargets = new HashSet<UUID>();
|
||||
if (allExileZones) {
|
||||
for (Card card : game.getExile().getAllCards(game)) {
|
||||
if (filter.match(card, sourceControllerId, game)) {
|
||||
possibleTargets.add(card.getId());
|
||||
}
|
||||
}
|
||||
return possibleTargets;
|
||||
} else {
|
||||
return super.possibleTargets(sourceId, sourceControllerId, game);
|
||||
ExileZone exileZone = game.getExile().getExileZone(zoneId);
|
||||
if (exileZone != null) {
|
||||
for(Card card : exileZone.getCards(game)) {
|
||||
if (filter.match(card, sourceControllerId, game)) {
|
||||
possibleTargets.add(card.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return possibleTargets;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) {
|
||||
|
@ -94,11 +101,16 @@ public class TargetCardInExile extends TargetCard<TargetCardInExile> {
|
|||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
} else {
|
||||
return super.canChoose(sourceControllerId, game);
|
||||
ExileZone exileZone = game.getExile().getExileZone(zoneId);
|
||||
if (exileZone != null) {
|
||||
if (exileZone.count(filter, sourceId, sourceControllerId, game) >= this.minNumberOfTargets) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canTarget(UUID id, Ability source, Game game) {
|
||||
|
|
Loading…
Reference in a new issue