예제 #1
0
  public AustereCommand(UUID ownerId) {
    super(
        ownerId, 8, "Austere Command", Rarity.RARE, new CardType[] {CardType.SORCERY}, "{4}{W}{W}");
    this.expansionSetCode = "CMD";

    this.color.setWhite(true);

    // Choose two -
    this.getSpellAbility().getModes().setMinModes(2);
    this.getSpellAbility().getModes().setMaxModes(2);
    // Destroy all artifacts;
    this.getSpellAbility()
        .addEffect(new DestroyAllEffect(new FilterArtifactPermanent("artifacts")));
    // or destroy all enchantments;
    Mode mode = new Mode();
    mode.getEffects().add(new DestroyAllEffect(new FilterEnchantmentPermanent("enchantments")));
    this.getSpellAbility().getModes().addMode(mode);
    // or destroy all creatures with converted mana cost 3 or less;
    mode = new Mode();
    mode.getEffects().add(new DestroyAllEffect(filter3orLess));
    this.getSpellAbility().getModes().addMode(mode);
    // or destroy all creatures with converted mana cost 4 or greater.
    mode = new Mode();
    mode.getEffects().add(new DestroyAllEffect(filter4orMore));
    this.getSpellAbility().getModes().addMode(mode);
  }
예제 #2
0
  public CrosissCharm(UUID ownerId) {
    super(
        ownerId,
        181,
        "Crosis's Charm",
        Rarity.UNCOMMON,
        new CardType[] {CardType.INSTANT},
        "{U}{B}{R}");
    this.expansionSetCode = "C13";

    // Choose one - Return target permanent to its owner's hand;
    this.getSpellAbility().addEffect(new ReturnToHandTargetEffect());
    this.getSpellAbility().addTarget(new TargetPermanent());
    // or destroy target nonblack creature, and it can't be regenerated;
    Mode mode = new Mode();
    mode.getEffects().add(new DestroyTargetEffect(true));
    mode.getTargets().add(new TargetCreaturePermanent(filter));
    this.getSpellAbility().addMode(mode);
    // or destroy target artifact.
    mode = new Mode();
    mode.getEffects().add(new DestroyTargetEffect(true));
    Target target = new TargetArtifactPermanent();
    mode.getTargets().add(target);
    this.getSpellAbility().addMode(mode);
  }
예제 #3
0
  public TrevasCharm(UUID ownerId) {
    super(
        ownerId,
        129,
        "Treva's Charm",
        Rarity.UNCOMMON,
        new CardType[] {CardType.INSTANT},
        "{G}{W}{U}");
    this.expansionSetCode = "PLS";

    // Choose one - Destroy target enchantment;
    this.getSpellAbility().addEffect(new DestroyTargetEffect());
    this.getSpellAbility().addTarget(new TargetEnchantmentPermanent());

    // or exile target attacking creature;
    Mode mode = new Mode();
    mode.getEffects().add(new ExileTargetEffect());
    mode.getTargets().add(new TargetAttackingCreature());
    this.getSpellAbility().addMode(mode);

    // or draw a card, then discard a card.
    mode = new Mode();
    mode.getEffects().add(new DrawDiscardControllerEffect());
    this.getSpellAbility().addMode(mode);
  }
예제 #4
0
  public DawnCharm(UUID ownerId, CardSetInfo setInfo) {
    super(ownerId, setInfo, new CardType[] {CardType.INSTANT}, "{1}{W}");

    // Choose one - Prevent all combat damage that would be dealt this turn
    this.getSpellAbility()
        .addEffect(new PreventAllDamageByAllPermanentsEffect(Duration.EndOfTurn, true));
    // or regenerate target creature;
    Mode mode = new Mode();
    mode.getEffects().add(new RegenerateTargetEffect());
    mode.getTargets().add(new TargetCreaturePermanent());
    this.getSpellAbility().addMode(mode);
    // or counter target spell that targets you.
    mode = new Mode();
    mode.getEffects().add(new CounterTargetEffect());
    mode.getTargets().add(new TargetSpell(filter));
    this.getSpellAbility().addMode(mode);
  }
예제 #5
0
  private void updateTargets(Game game, StackAbility ability) {
    List<String> names = new ArrayList<>();
    for (Mode mode : ability.getModes().getSelectedModes()) {
      if (mode.getTargets().size() > 0) {
        setTargets(mode.getTargets());
      } else {
        List<UUID> targetList = new ArrayList<>();
        for (Effect effect : mode.getEffects()) {
          TargetPointer targetPointer = effect.getTargetPointer();
          if (targetPointer instanceof FixedTarget) {
            targetList.add(((FixedTarget) targetPointer).getTarget());
          }
        }
        if (targetList.size() > 0) {
          overrideTargets(targetList);

          for (UUID uuid : targetList) {
            MageObject mageObject = game.getObject(uuid);
            if (mageObject != null) {
              if ((mageObject instanceof Card) && ((Card) mageObject).isFaceDown(game)) {
                continue;
              }
              names.add(GameLog.getColoredObjectIdNameForTooltip(mageObject));
            }
          }
        }
      }
    }
    if (!names.isEmpty()) {
      getRules().add("<i>Related objects: " + names.toString() + "</i>");
    }
    // show for modal ability, which mode was choosen
    if (ability.isModal()) {
      Modes modes = ability.getModes();
      for (Mode mode : modes.getSelectedModes()) {
        this.rules.add(
            "<span color='green'><i>Chosen mode: "
                + mode.getEffects().getText(mode)
                + "</i></span>");
      }
    }
  }
예제 #6
0
  public SteelSabotage(UUID ownerId, CardSetInfo setInfo) {
    super(ownerId, setInfo, new CardType[] {CardType.INSTANT}, "{U}");

    // Choose one - Counter target artifact spell; or return target artifact to its owner's hand.
    this.getSpellAbility().addEffect(new CounterTargetEffect());
    this.getSpellAbility().addTarget(new TargetSpell(new FilterArtifactSpell()));
    Mode mode = new Mode();
    mode.getEffects().add(new ReturnToHandTargetEffect());
    mode.getTargets().add(new TargetArtifactPermanent());
    this.getSpellAbility().addMode(mode);
  }
예제 #7
0
  public FeastOrFamine(UUID ownerId, CardSetInfo setInfo) {
    super(ownerId, setInfo, new CardType[] {CardType.INSTANT}, "{3}{B}");

    // Choose one - Create a 2/2 black Zombie creature token;
    this.getSpellAbility().addEffect(new CreateTokenEffect(new ZombieToken()));

    // or destroy target nonartifact, nonblack creature and it can't be regenerated.
    Mode mode = new Mode();
    mode.getEffects().add(new DestroyTargetEffect(true));
    mode.getTargets().add(new TargetCreaturePermanent(filter));
    this.getSpellAbility().addMode(mode);
  }
예제 #8
0
 public void addAbility(Ability ability, UUID sourceId, MageObject attachedTo) {
   if (ability instanceof StaticAbility) {
     for (Mode mode : ability.getModes().values()) {
       for (Effect effect : mode.getEffects()) {
         if (effect instanceof ContinuousEffect) {
           addEffect((ContinuousEffect) effect, sourceId, ability);
         }
       }
     }
   } else if (ability instanceof TriggeredAbility) {
     // TODO: add sources for triggers - the same way as in addEffect: sources
     this.triggers.add((TriggeredAbility) ability, sourceId, attachedTo);
   }
 }
예제 #9
0
 @Deprecated
 public void addAbility(Ability ability, MageObject attachedTo) {
   if (ability instanceof StaticAbility) {
     for (Mode mode : ability.getModes().values()) {
       for (Effect effect : mode.getEffects()) {
         if (effect instanceof ContinuousEffect) {
           addEffect((ContinuousEffect) effect, ability);
         }
       }
     }
   } else if (ability instanceof TriggeredAbility) {
     this.triggers.add((TriggeredAbility) ability, attachedTo);
   }
 }
예제 #10
0
  public Vandalize(UUID ownerId, CardSetInfo setInfo) {
    super(ownerId, setInfo, new CardType[] {CardType.SORCERY}, "{4}{R}");

    // Choose one or both - Destroy target artifact; or Destroy target land.
    this.getSpellAbility().getModes().setMinModes(1);
    this.getSpellAbility().getModes().setMaxModes(2);

    this.getSpellAbility().addTarget(new TargetArtifactPermanent());
    this.getSpellAbility().addEffect(new DestroyTargetEffect());

    Mode mode1 = new Mode();
    mode1.getTargets().add(new TargetLandPermanent());
    mode1.getEffects().add(new DestroyTargetEffect());
    this.getSpellAbility().addMode(mode1);
  }
예제 #11
0
  public RainOfRust(UUID ownerId) {
    super(
        ownerId, 76, "Rain of Rust", Rarity.COMMON, new CardType[] {CardType.INSTANT}, "{3}{R}{R}");
    this.expansionSetCode = "5DN";

    this.color.setRed(true);

    // Choose one -
    this.getSpellAbility().getModes().setMinModes(1);
    this.getSpellAbility().getModes().setMaxModes(1);
    // Destroy target artifact;
    this.getSpellAbility().addEffect(new DestroyTargetEffect());
    this.getSpellAbility().addTarget(new TargetArtifactPermanent());
    // or destroy target land.
    Mode mode = new Mode();
    mode.getEffects().add(new DestroyTargetEffect());
    mode.getTargets().add(new TargetLandPermanent());
    this.getSpellAbility().getModes().addMode(mode);
    // Entwine {3}{R}
    this.addAbility(new EntwineAbility("{3}{R}"));
  }
예제 #12
0
  public UlashtTheHateSeed(UUID ownerId) {
    super(
        ownerId,
        136,
        "Ulasht, the Hate Seed",
        Rarity.RARE,
        new CardType[] {CardType.CREATURE},
        "{2}{R}{G}");
    this.expansionSetCode = "GPT";
    this.supertype.add("Legendary");
    this.subtype.add("Hellion");
    this.subtype.add("Hydra");

    this.color.setGreen(true);
    this.color.setRed(true);
    this.power = new MageInt(0);
    this.toughness = new MageInt(0);

    // Ulasht, the Hate Seed enters the battlefield with a +1/+1 counter on it for each other red
    // creature you control and a +1/+1 counter on it for each other green creature you control.
    this.addAbility(
        new EntersBattlefieldAbility(
            new UlashtTheHateSeedEffect(),
            "with a +1/+1 counter on it for each other red creature you control and a +1/+1 counter on it for each other green creature you control."));

    // {1}, Remove a +1/+1 counter from Ulasht: Choose one - Ulasht deals 1 damage to target
    // creature;
    Ability ability =
        new SimpleActivatedAbility(
            Zone.BATTLEFIELD, new DamageTargetEffect(1), new GenericManaCost(1));
    ability.addCost(new RemoveCountersSourceCost(CounterType.P1P1.createInstance()));
    ability.addTarget(new TargetCreaturePermanent());
    // or put a 1/1 green Saproling creature token onto the battlefield.
    Mode mode = new Mode();
    Effect effect = new CreateTokenEffect(new SaprolingToken());
    effect.setText("Put a 1/1 green Saproling creature token onto the battlefield.");
    mode.getEffects().add(effect);
    ability.addMode(mode);
    this.addAbility(ability);
  }