Examples of Spell


Examples of mage.game.stack.Spell

        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            int affectedTargets = 0;
            if (targetPointer.getTargets(game, source).size() > 0) {
                for (UUID spellId : targetPointer.getTargets(game, source)) {
                    Spell spell = game.getStack().getSpell(spellId);
                    if (spell != null) {
                        controller.moveCardToExileWithInfo(spell, null, "", source.getSourceId(), game, Zone.STACK);
                        affectedTargets++;
                    }
                }
View Full Code Here

Examples of mage.game.stack.Spell

    @Override
    public boolean applies(Ability abilityToModify, Ability source, Game game) {
        if (abilityToModify instanceof SpellAbility) {
            if (abilityToModify.getControllerId().equals(source.getControllerId())) {
                Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId());
                if (spell != null) {
                    return this.filter.match(spell, game);
                } else {
                    // used at least for flashback ability because Flashback ability doesn't use stack
                    Card sourceCard = game.getCard(abilityToModify.getSourceId());
View Full Code Here

Examples of mage.game.stack.Spell

    @Override
    public boolean apply(Game game, Ability source) {
        Player controller = game.getPlayer(source.getControllerId());
        if (controller != null) {
            StackObject stackObject = game.getStack().getStackObject(source.getId());
            Spell spell = (Spell) stackObject;
            spell = spell.copySpell();
            spell.setCopiedSpell(true);
            spell.setControllerId(source.getControllerId());
            // Remove Epic effect from the spell
            Effect epicEffect = null;
            for (Effect effect : spell.getSpellAbility().getEffects()) {
                if (effect instanceof EpicEffect) {
                    epicEffect = effect;
                    break;
                }
            }
            spell.getSpellAbility().getEffects().remove(epicEffect);
            DelayedTriggeredAbility ability = new AtTheBeginOfYourNextUpkeepDelayedTriggeredAbility(new EpicPushEffect(spell, rule), Duration.EndOfGame, false);
            ability.setSourceId(source.getSourceId());
            ability.setControllerId(source.getControllerId());
            game.addDelayedTriggeredAbility(ability);
            game.addEffect(new EpicReplacementEffect(), source);
View Full Code Here

Examples of mage.game.stack.Spell

    }

    @Override
    public boolean applies(Ability abilityToModify, Ability source, Game game) {
        if (abilityToModify instanceof SpellAbility) {
            Spell spell = (Spell) game.getStack().getStackObject(abilityToModify.getId());
            if (spell != null) {
                return this.filter.match(spell, game);
            } else {
                // used at least for flashback ability because Flashback ability doesn't use stack
                Card sourceCard = game.getCard(abilityToModify.getSourceId());
View Full Code Here

Examples of mage.game.stack.Spell

    @Override
    public boolean apply(Game game, Ability source) {
        if (spell != null) {
            // don't change the targets of the in the origin copied spell
            Spell copySpell = spell.copy();
            game.getStack().push(copySpell);
            copySpell.chooseNewTargets(game, source.getControllerId());
            return true;
        }

        return false;
    }
View Full Code Here

Examples of org.graphstream.util.cumulative.CumulativeSpells.Spell

        CumulativeSpells spells = graphSpells.getNodeSpells(nodeId);

        if (!spells.isEternal()) {
          startElement(stream, "spells");
          for (int i = 0; i < spells.getSpellCount(); i++) {
            Spell s = spells.getSpell(i);

            startElement(stream, "spell");
            putSpellAttributes(s);
            endElement(stream, true);
          }
          endElement(stream, false);
        }

        if (attr.getAttributesCount() > 0) {
          startElement(stream, "attvalues");
          nodeAttributes.push(stream, nodeId, graphSpells);
          endElement(stream, false);
        }

        endElement(stream,
            spells.isEternal() && attr.getAttributesCount() == 0);
      }
      endElement(stream, false);

      startElement(stream, "edges");
      for (String edgeId : graphSpells.getEdges()) {
        startElement(stream, "edge");

        GraphSpells.EdgeData data = graphSpells.getEdgeData(edgeId);

        stream.writeAttribute("id", edgeId);
        stream.writeAttribute("source", data.getSource());
        stream.writeAttribute("target", data.getTarget());

        CumulativeAttributes attr = graphSpells
            .getEdgeAttributes(edgeId);

        CumulativeSpells spells = graphSpells.getEdgeSpells(edgeId);

        if (!spells.isEternal()) {
          startElement(stream, "spells");
          for (int i = 0; i < spells.getSpellCount(); i++) {
            Spell s = spells.getSpell(i);

            startElement(stream, "spell");
            putSpellAttributes(s);
            endElement(stream, true);
          }
View Full Code Here

Examples of pathfinder.bean.spell.Spell

      System.out.println(name + " - " + school + " - " + composant
          + " - " + range + " - " + castingTime + " - " + description
          + " - " + parseLevels);

      try {
        Spell spell = new Spell(name, school, range, castingTime,
            description, composant, source, ref, parseLevels);

        String filename = DocumentIO.validateFilename(spell.getId()
            .toString());
        DocumentIO.saveDocument(spell, "./tmp/", filename);
      } catch (Exception e) {
        // TODO Auto-generated catch block
        e.printStackTrace();
View Full Code Here

Examples of pathfinder.bean.spell.Spell

      System.out.println(name + " - " + school + " - " + composant
          + " - " + range + " - " + castingTime + " - " + description
          + " - " + parseLevels);

      try {
        Spell spell = new Spell(name, school, range, castingTime,
            description, composant, source, ref, parseLevels);

        DocumentIO.saveDocument(spell, "./tmp/");
      } catch (Exception e) {
        // TODO Auto-generated catch block
View Full Code Here

Examples of pathfinder.bean.spell.Spell

  public void setDocument(BeanDocument document) {
    DocumentSpellBook spellBook = document.getBean();

    ArrayList<Spell> spells = new ArrayList<Spell>();
    for (UniqueID id : spellBook.getSpells()) {
      Spell spell = CampaignClient.getInstance().getBean(id);

      if (spell != null) {
        spells.add(spell);
      } else {
        Logger.getLogger(getClass()).warn(
View Full Code Here

Examples of pathfinder.bean.spell.Spell

   * separated by a newline.
   */
  @Override
  protected Transferable createTransferable(JComponent c) {
    JList<Spell> list = (JList<Spell>) c;
    Spell spell = list.getSelectedValue();

    return new SpellTransferable(spell);
  }
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.