mirror of
https://github.com/magefree/mage.git
synced 2026-01-25 04:39:18 -08:00
* Fixed that cards without cost (e.g. Ancestral Vision) could be cast from graveyard (e.g. by using Yawgmoth Will). Fixed that cards could be suspended from graveyard (e.g. with Yawgmoth Will).
This commit is contained in:
parent
8bab182f8a
commit
9f22eb0688
6 changed files with 134 additions and 17 deletions
|
|
@ -101,7 +101,7 @@ public class SwordOfLightAndShadow extends CardImpl {
|
|||
if (ability instanceof SwordOfLightAndShadowAbility) {
|
||||
Player controller = game.getPlayer(ability.getControllerId());
|
||||
if (controller != null) {
|
||||
// Target may only be added if possible target exists. Else the gain life effect won't trigger, becuase there is no valid target for the
|
||||
// Target may only be added if possible target exists. Else the gain life effect won't trigger, because there is no valid target for the
|
||||
// return to hand ability
|
||||
if (controller.getGraveyard().count(new FilterCreatureCard(), ability.getSourceId(), ability.getControllerId(), game) > 0) {
|
||||
ability.addTarget(new TargetCardInYourGraveyard(0, 1, new FilterCreatureCard("creature card from your graveyard")));
|
||||
|
|
@ -115,8 +115,8 @@ public class SwordOfLightAndShadow extends CardImpl {
|
|||
class SwordOfLightAndShadowAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public SwordOfLightAndShadowAbility() {
|
||||
super(Zone.BATTLEFIELD, new SwordOfLightAndShadowReturnToHandTargetEffect(), false);
|
||||
this.addEffect(new GainLifeEffect(3));
|
||||
super(Zone.BATTLEFIELD, new GainLifeEffect(3), false);
|
||||
this.addEffect(new SwordOfLightAndShadowReturnToHandTargetEffect());
|
||||
|
||||
}
|
||||
|
||||
|
|
@ -177,7 +177,7 @@ class SwordOfLightAndShadowReturnToHandTargetEffect extends OneShotEffect {
|
|||
case GRAVEYARD:
|
||||
Card card = game.getCard(targetId);
|
||||
if (card != null) {
|
||||
controller.moveCards(card, null, Zone.HAND, source, game);
|
||||
controller.moveCards(card, Zone.HAND, source, game);
|
||||
} else {
|
||||
result = false;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -99,13 +99,7 @@ class CanPlayCardsFromGraveyardEffect extends ContinuousEffectImpl {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
for (UUID playerId: controller.getInRange()) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null)
|
||||
{
|
||||
player.setPlayCardsFromGraveyard(true);
|
||||
}
|
||||
}
|
||||
controller.setPlayCardsFromGraveyard(true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
@ -148,12 +142,12 @@ class YawgmothsWillReplacementEffect extends ReplacementEffectImpl {
|
|||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == EventType.ZONE_CHANGE;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue