Skip to content

Commit

Permalink
- Fixed #5777.
Browse files Browse the repository at this point in the history
  • Loading branch information
jeffwadsworth committed May 2, 2019
1 parent 735d2a1 commit ef48d23
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions Mage.Sets/src/mage/cards/b/BridgeFromBelow.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

package mage.cards.b;

import java.util.UUID;
Expand All @@ -13,7 +12,7 @@
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.permanent.ControllerPredicate;
import mage.filter.predicate.other.OwnerPredicate;
import mage.filter.predicate.permanent.TokenPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
Expand All @@ -28,23 +27,24 @@
*/
public final class BridgeFromBelow extends CardImpl {


private static final FilterCreaturePermanent filter1 = new FilterCreaturePermanent("Whenever a nontoken creature is put into your graveyard from the battlefield");
private static final FilterCreaturePermanent filter2 = new FilterCreaturePermanent("When a creature is put into an opponent's graveyard from the battlefield");
static{
filter1.add(new ControllerPredicate(TargetController.YOU));

static {
filter1.add(new OwnerPredicate(TargetController.YOU));
filter1.add(Predicates.not(TokenPredicate.instance));
filter2.add(new ControllerPredicate(TargetController.OPPONENT));
filter2.add(new OwnerPredicate(TargetController.OPPONENT));
}

public BridgeFromBelow(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{B}{B}{B}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{B}{B}{B}");

// Whenever a nontoken creature is put into your graveyard from the battlefield, if Bridge from Below is in your graveyard, create a 2/2 black Zombie creature token.
this.addAbility(new BridgeFromBelowAbility(new CreateTokenEffect(new ZombieToken()), filter1));

// When a creature is put into an opponent's graveyard from the battlefield, if Bridge from Below is in your graveyard, exile Bridge from Below.
this.addAbility(new BridgeFromBelowAbility(new ExileSourceEffect(), filter2));

}

public BridgeFromBelow(final BridgeFromBelow card) {
Expand Down Expand Up @@ -86,7 +86,8 @@ public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.isDiesEvent()) {
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
if (permanent != null && filter.match(permanent, sourceId, controllerId, game)) {
if (permanent != null
&& filter.match(permanent, sourceId, controllerId, game)) {
return true;
}
}
Expand All @@ -96,11 +97,12 @@ public boolean checkTrigger(GameEvent event, Game game) {
@Override
public boolean checkInterveningIfClause(Game game) {
Player controller = game.getPlayer(this.getControllerId());
return controller != null && controller.getGraveyard().contains(this.getSourceId());
return controller != null
&& controller.getGraveyard().contains(this.getSourceId());
}

@Override
public String getRule() {
return filter.getMessage() +", if {this} is in your graveyard, " + super.getRule();
return filter.getMessage() + ", if {this} is in your graveyard, " + super.getRule();
}
}

0 comments on commit ef48d23

Please sign in to comment.