Search in sources :

Example 6 with Watcher

use of mage.watchers.Watcher in project mage by magefree.

the class EbondeathDracolichWatcher method applies.

@Override
public boolean applies(UUID sourceId, Ability source, UUID affectedControllerId, Game game) {
    if (sourceId.equals(source.getSourceId()) && source.isControlledBy(affectedControllerId)) {
        Card card = game.getCard(source.getSourceId());
        Watcher watcher = game.getState().getWatcher(EbondeathDracolichWatcher.class);
        if (card != null && watcher != null && game.getState().getZone(source.getSourceId()) == Zone.GRAVEYARD) {
            return watcher.conditionMet();
        }
    }
    return false;
}
Also used : Watcher(mage.watchers.Watcher) Card(mage.cards.Card)

Aggregations

Watcher (mage.watchers.Watcher)6 MageObjectReference (mage.MageObjectReference)2 Permanent (mage.game.permanent.Permanent)2 IOException (java.io.IOException)1 Constructor (java.lang.reflect.Constructor)1 InvocationTargetException (java.lang.reflect.InvocationTargetException)1 Method (java.lang.reflect.Method)1 java.util (java.util)1 ArrayList (java.util.ArrayList)1 MageInt (mage.MageInt)1 Ability (mage.abilities.Ability)1 AttacksTriggeredAbility (mage.abilities.common.AttacksTriggeredAbility)1 ContinuousEffect (mage.abilities.effects.ContinuousEffect)1 Effect (mage.abilities.effects.Effect)1 OneShotEffect (mage.abilities.effects.OneShotEffect)1 HasteAbility (mage.abilities.keyword.HasteAbility)1 PartnerWithAbility (mage.abilities.keyword.PartnerWithAbility)1 mage.cards (mage.cards)1 Card (mage.cards.Card)1 mage.constants (mage.constants)1