mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
* Viridian Revel - Fixed that it wrongly also triggerd for cards going to your own graveyard.
This commit is contained in:
parent
b9de0e7f93
commit
ec2c93d0db
1 changed files with 6 additions and 1 deletions
|
@ -40,6 +40,7 @@ import mage.constants.Zone;
|
|||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -51,6 +52,8 @@ public class ViridianRevel extends CardImpl {
|
|||
super(ownerId, 132, "Viridian Revel", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}{G}");
|
||||
this.expansionSetCode = "SOM";
|
||||
this.color.setGreen(true);
|
||||
|
||||
// Whenever an artifact is put into an opponent's graveyard from the battlefield, you may draw a card.
|
||||
this.addAbility(new ViridianRevelTriggeredAbility());
|
||||
}
|
||||
|
||||
|
@ -82,7 +85,9 @@ class ViridianRevelTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent)event).isDiesEvent()) {
|
||||
Card card = game.getCard(event.getTargetId());
|
||||
if (card != null && card.getCardType().contains(CardType.ARTIFACT)) {
|
||||
Player controller = game.getPlayer(getControllerId());
|
||||
if (controller != null && card != null && card.getCardType().contains(CardType.ARTIFACT)
|
||||
&& controller.hasOpponent(card.getOwnerId(), game)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue