Package mage.game.permanent

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


            if (player.choose(Outcome.PutCardInPlay, target, source.getSourceId(), game)) {
                Card auraInHand = game.getCard(target.getFirstTarget());
                if (auraInHand != null) {
                    game.getState().setValue("attachTo:" + auraInHand.getId(), permanent);
                    if (player.putOntoBattlefieldWithInfo(auraInHand, game, Zone.HAND, source.getSourceId())) {
                        permanent.addAttachment(auraInHand.getId(), game);
                    }
                }
            }
            return true;
        }
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

            if (permanent != null) {
                game.getState().setValue("attachTo:" + card.getId(), permanent);
            }
            player.putOntoBattlefieldWithInfo(card, game, zone, source.getSourceId());
            if (permanent != null) {
                return permanent.addAttachment(card.getId(), game);
            }
        }
        return true;
    }
}
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

            game.addDelayedTriggeredAbility(delayedAbility);
            Permanent equipment = game.getPermanent(equipmentId);
            if (equipment != null) {
                Permanent ogre = game.getPermanent(source.getSourceId());
                if (ogre != null) {
                    ogre.addAttachment(equipmentId, game);
                }
            }
            return true;
        }
        return false;
View Full Code Here

            Player you = game.getPlayer(source.getControllerId());
            Permanent creature = game.getPermanent(getTargetPointer().getFirst(game, source));
            if (you != null && creature != null) {
                game.getState().setValue("attachTo:" + aura.getId(), creature);
                aura.putOntoBattlefield(game, Zone.GRAVEYARD, source.getSourceId(), you.getId());
                return creature.addAttachment(aura.getId(), game);
            }
        }

        return false;
    }
View Full Code Here

            // put card into play
            controller.putOntoBattlefieldWithInfo(cardInGraveyard, game, Zone.GRAVEYARD, source.getSourceId());
            Permanent enchantedCreature = game.getPermanent(cardInGraveyard.getId());

            if (enchantedCreature != null) {
                enchantedCreature.addAttachment(enchantment.getId(), game);
                FilterCreaturePermanent filter = new FilterCreaturePermanent("enchant creature put onto the battlefield with Necromancy");
                filter.add(new PermanentIdPredicate(cardInGraveyard.getId()));
                Target target = new TargetCreaturePermanent(filter);
                target.addTarget(enchantedCreature.getId(), source, game);
                game.addEffect(new NecromancyChangeAbilityEffect(target), source);
View Full Code Here

            UUID kaldraId = effect.getLastAddedTokenId();
            Permanent kaldra = game.getPermanent(kaldraId);
            if (kaldra != null) {
                // Attach helm to the token
                for (Permanent kaldrasHelm :game.getBattlefield().getAllActivePermanents(HelmOfKaldra.filterHelm, source.getControllerId(), game)) {
                    kaldra.addAttachment(kaldrasHelm.getId(), game);
                    break;
                }
                // Attach shield to the token
                for (Permanent kaldrasShield :game.getBattlefield().getAllActivePermanents(HelmOfKaldra.filterShield, source.getControllerId(), game)) {
                    kaldra.addAttachment(kaldrasShield.getId(), game);
View Full Code Here

                    kaldra.addAttachment(kaldrasHelm.getId(), game);
                    break;
                }
                // Attach shield to the token
                for (Permanent kaldrasShield :game.getBattlefield().getAllActivePermanents(HelmOfKaldra.filterShield, source.getControllerId(), game)) {
                    kaldra.addAttachment(kaldrasShield.getId(), game);
                    break;
                }
                // Attach sword to the token
                for (Permanent kaldrasSword :game.getBattlefield().getAllActivePermanents(HelmOfKaldra.filterSword, source.getControllerId(), game)) {
                    kaldra.addAttachment(kaldrasSword.getId(), game);
View Full Code Here

                    kaldra.addAttachment(kaldrasShield.getId(), game);
                    break;
                }
                // Attach sword to the token
                for (Permanent kaldrasSword :game.getBattlefield().getAllActivePermanents(HelmOfKaldra.filterSword, source.getControllerId(), game)) {
                    kaldra.addAttachment(kaldrasSword.getId(), game);
                    break;
                }

            }
        }
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.