Package mage.game.permanent

Examples of mage.game.permanent.Permanent


    super(effect);
  }

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent != null) {
      if (permanent.moveToExile(source.getSourceId(), "Mystifying Maze Exile", source.getId(), game)) {
        //create delayed triggered ability
        MystifyingMazeDelayedTriggeredAbility delayedAbility = new MystifyingMazeDelayedTriggeredAbility(source.getSourceId());
        delayedAbility.setSourceId(source.getSourceId());
        delayedAbility.setControllerId(source.getControllerId());
        game.addDelayedTriggeredAbility(delayedAbility);
View Full Code Here


  }

  @Override
  public boolean applies(GameEvent event, Ability source, Game game) {
    if (event.getType() == EventType.DECLARE_ATTACKER || event.getType() == EventType.DECLARE_BLOCKER || event.getType() == EventType.ACTIVATE_ABILITY) {
      Permanent enchantment = game.getPermanent(source.getSourceId());
      if (enchantment != null && enchantment.getAttachedTo() != null) {
        if (event.getSourceId().equals(enchantment.getAttachedTo())) {
          return true;
        }
      }
    }
    return false;
View Full Code Here

  }

  @Override
  public boolean checkTrigger(GameEvent event, Game game) {
    if (event.getType() == EventType.TARGETED) {
      Permanent enchantment = game.getPermanent(sourceId);
      if (enchantment != null && enchantment.getAttachedTo() != null) {
        if (event.getTargetId().equals(enchantment.getAttachedTo())) {
          return true;
        }
      }
    }
    return false;
View Full Code Here

        super(effect);
    }

    @Override
    public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
        Permanent enchantment = game.getPermanent(source.getSourceId());
  if (enchantment != null && enchantment.getAttachedTo() != null) {
    Permanent creature = game.getPermanent(enchantment.getAttachedTo());
    if (creature != null) {
      switch (layer) {
        case PTChangingEffects_7:
          if (sublayer == SubLayer.ModifyPT_7c) {
            creature.addPower(-2);
            creature.addToughness(-1);
          }
          break;
      }
      return true;
    }
View Full Code Here

        return false;
    }

    @Override
    public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
  Permanent enchantment = game.getPermanent(source.getSourceId());
      if (enchantment != null && enchantment.getAttachedTo() != null) {
    Permanent creature = game.getPermanent(enchantment.getAttachedTo());
    if (creature != null) {
      switch (layer) {
        case PTChangingEffects_7:
          if (sublayer == SubLayer.ModifyPT_7c) {
            creature.addPower(3);
            creature.addToughness(3);
          }
          break;
      }
      return true;
    }
View Full Code Here

    return new AlluringSirenEffect(this);
  }

  @Override
  public boolean apply(Game game, Ability source) {
    Permanent creature = game.getPermanent(source.getFirstTarget());
    if (creature != null) {
      if (creature.canAttack(game)) {
        game.getCombat().declareAttacker(creature.getId(), source.getControllerId(), game);
      }
    }
    return false;
  }
View Full Code Here

  private CreatureSimulator attacker;

  public CombatGroupSimulator(UUID defenderId, List<UUID> attackers, List<UUID> blockers, Game game) {
    this.defenderId = defenderId;
    for (UUID attackerId: attackers) {
      Permanent permanent = game.getPermanent(attackerId);
      this.attackers.add(new CreatureSimulator(permanent));
    }
    for (UUID blockerId: blockers) {
      Permanent permanent = game.getPermanent(blockerId);
      this.blockers.add(new CreatureSimulator(permanent));
    }
    //NOTE:  assumes no banding
    attacker = this.attackers.get(0);
  }
View Full Code Here

            super(effect);
        }

        @Override
        public boolean apply(Game game, Ability source) {
            Permanent target = game.getPermanent(source.getFirstTarget());
            Player player = game.getPlayer(source.getControllerId());
    if (player != null && target != null) {
      player.drawCards(target.getPower().getValue(), game);
      return true;
    }
    return false;
        }
View Full Code Here

      Player player = game.getPlayer(defenderId);
      if (player != null) {
        simCombat.playersLife.put(defenderId, player.getLife());
      }
      else {
        Permanent permanent = game.getPermanent(defenderId);
        simCombat.planeswalkerLoyalty.put(defenderId, permanent.getLoyalty().getValue());
      }
    }
    return simCombat;
  }
View Full Code Here

      FilterCreaturePermanent filter = new FilterCreaturePermanent("creature defending player owns");
      filter.getControllerId().add(defender.getId());
      TargetCreaturePermanent target = new TargetCreaturePermanent(filter);
      Player player = game.getPlayer(source.getControllerId());
      player.choose(Outcome.Damage, target, game);
      Permanent permanent = game.getPermanent(target.getFirstTarget());
      Permanent cyclops = game.getPermanent(source.getSourceId());
      if (permanent != null && cyclops != null) {
        permanent.damage(cyclops.getPower().getValue(), cyclops.getId(), game, true, false);
        cyclops.damage(permanent.getPower().getValue(), permanent.getId(), game, true, false);
        return true;
      }
    }
    return false;
  }
View Full Code Here

TOP

Related Classes of mage.game.permanent.Permanent

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.