Package mage.game.permanent

Examples of mage.game.permanent.Permanent.addAttachment()


  @Override
  public boolean apply(Game game, Ability source) {
    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent != null) {
      return permanent.addAttachment(source.getSourceId(), game);
    }
    return false;
  }

}
View Full Code Here


                Permanent equipment = game.getPermanent(card.getId());

                Target targetCreature = new TargetControlledCreaturePermanent();
                if (equipment != null && player.choose(Outcome.BoostCreature, targetCreature, source.getSourceId(), game)) {
                    Permanent permanent = game.getPermanent(targetCreature.getFirstTarget());
                    permanent.addAttachment(equipment.getId(), game);
                }
            }
        }
        player.shuffleLibrary(game);
        return true;
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
        if (permanent != null) {
            return permanent.addAttachment(source.getSourceId(), game);
        }
        else {
            Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
            if (player != null) {
                return player.addAttachment(source.getSourceId(), game);
View Full Code Here

    @Override
    public boolean apply(Game game, Ability source) {
        Permanent equipment = game.getPermanent(source.getFirstTarget());
        Permanent creature = game.getPermanent(source.getTargets().get(1).getFirstTarget());
        if (creature != null && equipment != null) {
            return creature.addAttachment(equipment.getId(), game);
        }
        return false;
    }
}
View Full Code Here

        if (controller != null) {
            GermToken token = new GermToken();
            token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
            Permanent p = game.getPermanent(token.getLastAddedToken());
            if (p != null) {
                 p.addAttachment(source.getSourceId(), game);
                 return true;
            }           
        }
        return false;
    }
View Full Code Here

                TargetCardInHand target = new TargetCardInHand(0, 1, filter);
                if (player.choose(Outcome.PutCardInPlay, target, source.getSourceId(), game)) {
                    Card auraInHand = game.getCard(target.getFirstTarget());
                    if (auraInHand != null) {
                        player.putOntoBattlefieldWithInfo(auraInHand, game, Zone.HAND, source.getSourceId());
                        enchantedPermanent.addAttachment(auraInHand.getId(), game);
                        player.moveCardToHandWithInfo(auraPermanent, source.getSourceId(), game, Zone.BATTLEFIELD);
                        return true;
                    }
                }
            }
View Full Code Here

            permanent.entersBattlefield(event.getSourceId(), game, fromZone, true);
            game.applyEffects();
            game.fireEvent(new ZoneChangeEvent(permanent, controllerId, fromZone, Zone.BATTLEFIELD));

            if (targetPermanent != null) {
                targetPermanent.addAttachment(permanent.getId(), game);
            }
            if (targetPlayer != null) {
                targetPlayer.addAttachment(permanent.getId(), game);
            }
        }
View Full Code Here

        Card card = game.getCard(cardId);
        if (card != null) {
          card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getId(), source.getControllerId());
          Permanent permanent = game.getPermanent(target.getFirstTarget());
          if (permanent != null) {
            return permanent.addAttachment(cardId, game);
          }
        }
      }
    }
    return false;
View Full Code Here

        if (card != null) {
            Permanent permanent = game.getPermanent(source.getFirstTarget());
            if (permanent != null) {
                game.getState().setValue("attachTo:" + card.getId(), permanent.getId());
                card.putOntoBattlefield(game, zone, source.getSourceId(), source.getControllerId());
                return permanent.addAttachment(card.getId(), game);
            }
        }
        return false;
    }
}
View Full Code Here

        Permanent p = game.getPermanent(targetPointer.getFirst(game, source));
        Permanent sourcePermanent = game.getPermanent(source.getSourceId());
        Player player = game.getPlayer(source.getControllerId());
        if (p != null && player != null && sourcePermanent != null) {
            if (player.chooseUse(Outcome.Benefit, "Attach " + p.getName() + " to " + sourcePermanent.getName() + "?", game)) {
                sourcePermanent.addAttachment(p.getId(), game);
            }
            return true;
        }
        return false;
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.