Examples of changeControllerId()


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

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

  @Override
View Full Code Here

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

    Permanent permanent = game.getPermanent(source.getFirstTarget());
    if (permanent != null) {
      switch (layer) {
        case ControlChangingEffects_2:
          if (sublayer == SubLayer.NA) {
            permanent.changeControllerId(source.getControllerId(), game);
          }
          break;
        case TypeChangingEffects_4:
          if (sublayer == SubLayer.NA) {
            permanent.getSubtype().add("Vampire");
View Full Code Here

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

            for (UUID permanentId: this.getTargetPointer().getTargets(game, source)) {
                Permanent permanent = game.getPermanent(permanentId);
                if (permanent != null) {
                    targetStillExists = true;
                    if (controllingPlayerId != null) {
                        permanent.changeControllerId(controllingPlayerId, game);                       
                    } else {
                        permanent.changeControllerId(source.getControllerId(), game);
                    }
                }               
            }
View Full Code Here

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

                if (permanent != null) {
                    targetStillExists = true;
                    if (controllingPlayerId != null) {
                        permanent.changeControllerId(controllingPlayerId, game);                       
                    } else {
                        permanent.changeControllerId(source.getControllerId(), game);
                    }
                }               
            }
            if (!targetStillExists) {
                // no valid target exists, effect can be discarded
View Full Code Here

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

            if (permanent == null || permanent.getZoneChangeCounter() != entry.getValue()) {
                // controll effect cease if the same permanent is no longer on the battlefield
                toDelete.add(entry.getKey());
                continue;
            }
            permanent.changeControllerId(lockedControllers.get(permanent.getId()), game);
        }
        if (!toDelete.isEmpty()) {
            for(UUID uuid: toDelete) {
                zoneChangeCounter.remove(uuid);           
            }
View Full Code Here

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

            Permanent permanent = game.getPermanent(enchantment.getAttachedTo());
            if (permanent != null) {
                switch (layer) {
                    case ControlChangingEffects_2:
                        if (sublayer == SubLayer.NA) {
                            permanent.changeControllerId(source.getControllerId(), game);
                        }
                        break;
                }
                return true;
            }
View Full Code Here

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

                Card card = game.getCard(targetId);
                if (card != null) {
                    if (player.putOntoBattlefieldWithInfo(card, game, Zone.GRAVEYARD, source.getSourceId(), tapped)) {
                        Permanent permanent = game.getPermanent(source.getSourceId());
                        if (permanent != null) {
                            permanent.changeControllerId(source.getControllerId(), game);
                        }
                    }
                }
            }
            return true;
View Full Code Here

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

      Permanent creature = game.getPermanent(enchantment.getAttachedTo());
      if (creature != null) {
        switch (layer) {
          case ControlChangingEffects_2:
            if (sublayer == SubLayer.NA) {
              creature.changeControllerId(source.getControllerId(), game);
            }
            break;
        }
        return true;
      }
View Full Code Here

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

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

  @Override
View Full Code Here

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

                this.zoneChangeCounter.put(permanent1.getId(), permanent1.getZoneChangeCounter());
                this.lockedControllers.put(permanent2.getId(), permanent1.getControllerId());
                this.zoneChangeCounter.put(permanent2.getId(), permanent2.getZoneChangeCounter());
               
                permanent1.changeControllerId(targetPlayer.getId(), game);
                permanent2.changeControllerId(you.getId(), game);
                game.informPlayers(new StringBuilder(sourceObject != null ? sourceObject.getName() : "").append(": ").append(you.getName())
                        .append(" and ").append(targetPlayer.getName()).append(" exchange control of ").append(permanent1.getName())
                        .append(" and ").append(permanent2.getName()).toString());
            } else {
                // discard if there are less than 2 permanents
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.