Examples of Spell


Examples of mage.game.stack.Spell

  }

  @Override
  public boolean checkTrigger(GameEvent event, Game game) {
    if (event.getType() == EventType.SPELL_CAST) {
      Spell spell = game.getStack().getSpell(event.getTargetId());
      if (spell != null && spell.getColor().isRed()) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

Examples of mage.game.stack.Spell

    }

    @Override
    public boolean checkTrigger(GameEvent event, Game game) {
        if (event.getType() == EventType.SPELL_CAST) {
      Spell spell = game.getStack().getSpell(event.getTargetId());
      if (spell != null && spell.getCardType().contains(CardType.ENCHANTMENT) && event.getPlayerId().equals(getControllerId())) {
        return true;
            }
    }
    return false;
    }
View Full Code Here

Examples of mage.game.stack.Spell

  }

  @Override
  public boolean checkTrigger(GameEvent event, Game game) {
    if (event.getType() == EventType.SPELL_CAST) {
      Spell spell = game.getStack().getSpell(event.getTargetId());
      if (spell != null && spell.getColor().isGreen()) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

Examples of mage.game.stack.Spell

  }

  @Override
  public void watch(GameEvent event, Game game) {
    if (event.getType() == EventType.SPELL_CAST && event.getPlayerId().equals(controllerId)) {
      Spell spell = game.getStack().getSpell(event.getTargetId());
      if (spell != null && spell.getCardType().contains(CardType.CREATURE)) {
        creatureSpellCount++;
        if (creatureSpellCount == 2)
          condition = true;
      }
    }
View Full Code Here

Examples of mage.game.stack.Spell

  }

  @Override
  public boolean checkTrigger(GameEvent event, Game game) {
    if (event.getType() == EventType.SPELL_CAST) {
      Spell spell = game.getStack().getSpell(event.getTargetId());
      if (spell != null && spell.getColor().isWhite()) {
        return true;
      }
    }
    return false;
  }
View Full Code Here

Examples of mage.game.stack.Spell

    public ManaSpentToCastCount(){
    }

    @Override
    public int calculate(Game game, Ability source, Effect effect) {
        Spell spell = game.getStack().getSpell(source.getSourceId());
        if (spell == null) {
            MageObject mageObject = game.getLastKnownInformation(source.getSourceId(), Zone.STACK);
            if (mageObject instanceof Spell) {
                spell = (Spell) mageObject;
            }
        }
        if (spell != null) {
            // NOT the cmc of the spell on the stack
            return spell.getSpellAbility().getManaCostsToPay().convertedManaCost() + spell.getSpellAbility().getManaCostsToPay().getX();
        }
        return 0;
    }
View Full Code Here

Examples of mage.game.stack.Spell

    @Override
    public boolean apply(Game game, Ability source, Ability abilityToModify) {
        Player controller = game.getPlayer(source.getControllerId());
        Card spliceCard = game.getCard(source.getSourceId());
        if (spliceCard != null && controller != null) {
            Spell spell = game.getStack().getSpell(abilityToModify.getId());
            if (spell != null) {
                SpellAbility splicedAbility = spliceCard.getSpellAbility().copy();
                splicedAbility.setSpellAbilityType(SpellAbilityType.SPLICE);
                splicedAbility.setSourceId(abilityToModify.getSourceId());
                spell.addSpellAbility(splicedAbility);
                for (Iterator it = ((SpliceOntoArcaneAbility) source).getSpliceCosts().iterator(); it.hasNext();) {
                    Cost cost = (Cost) it.next();
                    if (cost instanceof ManaCostsImpl) {
                        spell.getSpellAbility().getManaCostsToPay().add((ManaCostsImpl) cost.copy());
                    } else {
                        spell.getSpellAbility().getCosts().add(cost.copy());
                    }
                }
            }
            return true;
        }
View Full Code Here

Examples of mage.game.stack.Spell

    public boolean canTarget(UUID id, Game game) {
        Permanent permanent = game.getPermanent(id);
        if (permanent != null) {
            return filter.match(permanent, game);
        }
        Spell spell = game.getStack().getSpell(id);
        if (spell != null) {
            return filter.match(spell, game);
        }
        return false;
    }
View Full Code Here

Examples of mage.game.stack.Spell

                return permanent.canBeTargetedBy(targetSource, source.getControllerId(), game) && filter.match(permanent, source.getSourceId(), source.getControllerId(), game);
            } else {
                return filter.match(permanent, game);
            }
        }
        Spell spell = game.getStack().getSpell(id);
        if (spell != null) {
            return filter.match(spell, game);
        }
        return false;
    }
View Full Code Here

Examples of mage.game.stack.Spell

    @Override
    public boolean canChoose(UUID sourceId, UUID sourceControllerId, Game game) {
        int count = 0;
        MageObject targetSource = game.getObject(sourceId);
        for (StackObject stackObject: game.getStack()) {
            Spell spell = game.getStack().getSpell(stackObject.getId());
            if (spell != null && filter.match(spell, sourceId, sourceControllerId, game)) {
                count++;
                if (count >= this.minNumberOfTargets) {
                    return true;
                }
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.