Package mage.game.permanent

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


                    if (you.choose(Outcome.Benefit, you.getHand(), targetAura, game)) {
                        Card aura = game.getCard(targetAura.getFirstTarget());
                        if (aura != null) {
                            game.getState().setValue("attachTo:" + aura.getId(), evershrikePermanent);
                            aura.putOntoBattlefield(game, Zone.HAND, source.getSourceId(), you.getId());
                            evershrikePermanent.addAttachment(aura.getId(), game);
                            exiled = false;
                            count = you.getHand().count(filterAuraCard, game);
                        }
                    }
View Full Code Here


                Card sourceEnchantmentCard = game.getCard(source.getSourceId());
                Permanent creature = game.getPermanent(this.getTargetPointer().getFirst(game, source));
                if (sourceEnchantmentCard != null && creature != null) {
                    game.getState().setValue("attachTo:" + sourceEnchantmentCard.getId(), creature);
                    creatureController.putOntoBattlefieldWithInfo(sourceEnchantmentCard, game, Zone.GRAVEYARD, source.getSourceId());
                    return creature.addAttachment(sourceEnchantmentCard.getId(), game);
                }
            }
        }
        return false;
    }
View Full Code Here

                        if (card != null && game.getState().getZone(card.getId()).equals(Zone.GRAVEYARD)) {
                            Player owner = game.getPlayer(card.getOwnerId());
                            if (card.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), source.getControllerId())) {
                                Permanent permanent = game.getPermanent(card.getId());
                                if (permanent != null) {
                                    permanent.addAttachment(equipment.getId(), game);
                                    return true;
                                }
                            }
                        }
                    }
View Full Code Here

                if (you.searchLibrary(target, game)) {
                    if (target.getFirstTarget() != null) {
                        Card aura = game.getCard(target.getFirstTarget());
                        game.getState().setValue("attachTo:" + aura.getId(), attackingCreature);
                        aura.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), you.getId());
                        return attackingCreature.addAttachment(aura.getId(), game);
                    }
                }
            }
            you.shuffleLibrary(game);
        }
View Full Code Here

                        if (controller.choose(auraOutcome, target, source.getSourceId(), game)) {
                            UUID targetId = target.getFirstTarget();
                            Permanent targetPermanent = game.getPermanent(targetId);
                            Player targetPlayer = game.getPlayer(targetId);
                            if (targetPermanent != null) {
                                targetPermanent.addAttachment(sourcePermanent.getId(), game);
                            } else if (targetPlayer != null) {
                                targetPlayer.addAttachment(sourcePermanent.getId(), game);
                            } else {
                                return false;
                            }
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

    @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

        Player controller = game.getPlayer(source.getControllerId());
        if (equipment != null && controller != null && game.getState().getZone(source.getSourceId()).equals(Zone.GRAVEYARD)) {
            controller.putOntoBattlefieldWithInfo(equipment, game, Zone.GRAVEYARD, source.getSourceId());
            Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
            if (permanent != null) {
                return permanent.addAttachment(equipment.getId(), game);
            }
        }
        return false;
    }
}
View Full Code Here

        Permanent permanent = game.getPermanent(source.getSourceId());
        if (permanent != null && permanent.canTransform()) {
            if (permanent.transform(game)) {
                Permanent attachTo = game.getPermanent(targetPointer.getFirst(game, source));
                if (attachTo != null) {
                    return attachTo.addAttachment(source.getSourceId(), game);
                }
            }
        }
        return false;
    }
View Full Code Here

            //enchantAbility.setTargetName(target.getTargetName());
            if (enchantedCreature != null) {
                target.addTarget(enchantedCreature.getId(), source, game);
                enchantment.getSpellAbility().getTargets().clear();
                enchantment.getSpellAbility().getTargets().add(target);
                enchantedCreature.addAttachment(enchantment.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.