Beispiel #1
0
  public ParagonOfOpenGraves(UUID ownerId) {
    super(
        ownerId,
        111,
        "Paragon of Open Graves",
        Rarity.UNCOMMON,
        new CardType[] {CardType.CREATURE},
        "{3}{B}");
    this.expansionSetCode = "M15";
    this.subtype.add("Skeleton");
    this.subtype.add("Warrior");

    this.power = new MageInt(2);
    this.toughness = new MageInt(2);

    // Other black creatures you control get +1/+1.
    this.addAbility(
        new SimpleStaticAbility(
            Zone.BATTLEFIELD,
            new BoostControlledEffect(1, 1, Duration.WhileOnBattlefield, filterCreatures, true)));

    // {2}{B}, {T}: Another target black creature you control gains deathtouch until end of turn.
    Ability ability =
        new SimpleActivatedAbility(
            Zone.BATTLEFIELD,
            new GainAbilityTargetEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn),
            new ManaCostsImpl("{2}{B}"));
    ability.addCost(new TapSourceCost());
    ability.addTarget(new TargetControlledCreaturePermanent(filterCreature));
    this.addAbility(ability);
  }
Beispiel #2
0
  /**
   * Damages attacking creatures by a creature that blocked several ones Damages only attackers as
   * blocker was damage in either {@link #singleBlockerDamage} or {@link #multiBlockerDamage}.
   *
   * <p>Handles abilities like "{this} an block any number of creatures.".
   *
   * @param first
   * @param game
   */
  private void multiAttackerDamage(boolean first, Game game) {
    Permanent blocker = game.getPermanent(blockers.get(0));
    if (blocker == null) {
      return;
    }
    Player player = game.getPlayer(blocker.getControllerId());
    int damage = getDamageValueFromPermanent(blocker, game);

    if (canDamage(blocker, first)) {
      Map<UUID, Integer> assigned = new HashMap<>();
      for (UUID attackerId : attackerOrder) {
        Permanent attacker = game.getPermanent(attackerId);
        int lethalDamage;
        if (blocker.getAbilities().containsKey(DeathtouchAbility.getInstance().getId())) {
          lethalDamage = 1;
        } else {
          lethalDamage = attacker.getToughness().getValue() - attacker.getDamage();
        }
        if (lethalDamage >= damage) {
          assigned.put(attackerId, damage);
          break;
        }
        int damageAssigned =
            player.getAmount(
                lethalDamage, damage, "Assign damage to " + attacker.getLogName(), game);
        assigned.put(attackerId, damageAssigned);
        damage -= damageAssigned;
      }

      for (Map.Entry<UUID, Integer> entry : assigned.entrySet()) {
        Permanent attacker = game.getPermanent(entry.getKey());
        attacker.markDamage(entry.getValue(), blocker.getId(), game, true, true);
      }
    }
  }
Beispiel #3
0
 public HornetQueenInsectToken() {
   super("Insect", "1/1 green Insect creature token with flying and deathtouch");
   setOriginalExpansionSetCode("M15");
   cardType.add(CardType.CREATURE);
   color.setGreen(true);
   subtype.add("Insect");
   power = new MageInt(1);
   toughness = new MageInt(1);
   addAbility(FlyingAbility.getInstance());
   addAbility(DeathtouchAbility.getInstance());
 }
Beispiel #4
0
  public SedgeScorpion(UUID ownerId) {
    super(ownerId, 177, "Sedge Scorpion", Rarity.COMMON, new CardType[] {CardType.CREATURE}, "{G}");
    this.expansionSetCode = "THS";
    this.subtype.add("Scorpion");

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

    // Deathtouch
    this.addAbility(DeathtouchAbility.getInstance());
  }
Beispiel #5
0
  public TurntimberBasilisk(UUID ownerId, CardSetInfo setInfo) {
    super(ownerId, setInfo, new CardType[] {CardType.CREATURE}, "{1}{G}{G}");
    this.subtype.add("Basilisk");

    this.power = new MageInt(2);
    this.toughness = new MageInt(1);

    this.addAbility(DeathtouchAbility.getInstance());
    // Landfall - Whenever a land enters the battlefield under your control, you may have target
    // creature block Turntimber Basilisk this turn if able.
    LandfallAbility ability = new LandfallAbility(new MustBeBlockedByTargetSourceEffect(), true);
    ability.addTarget(new TargetCreaturePermanent());
    this.addAbility(ability);
  }
Beispiel #6
0
  public DaggerbackBasilisk(UUID ownerId) {
    super(
        ownerId,
        182,
        "Daggerback Basilisk",
        Rarity.COMMON,
        new CardType[] {CardType.CREATURE},
        "{2}{G}");
    this.expansionSetCode = "ROE";
    this.subtype.add("Basilisk");

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

    this.addAbility(DeathtouchAbility.getInstance());
  }
Beispiel #7
0
  public VengefulPharaoh(UUID ownerId) {
    super(
        ownerId,
        116,
        "Vengeful Pharaoh",
        Rarity.RARE,
        new CardType[] {CardType.CREATURE},
        "{2}{B}{B}{B}");
    this.expansionSetCode = "M12";
    this.subtype.add("Zombie");

    this.color.setBlack(true);
    this.power = new MageInt(5);
    this.toughness = new MageInt(4);

    this.addAbility(DeathtouchAbility.getInstance());
    this.addAbility(new VengefulPharaohTriggeredAbility());
  }
Beispiel #8
0
  public Painsmith(UUID ownerId) {
    super(ownerId, 74, "Painsmith", Rarity.UNCOMMON, new CardType[] {CardType.CREATURE}, "{1}{B}");
    this.expansionSetCode = "SOM";
    this.subtype.add("Human");
    this.subtype.add("Artificer");

    this.power = new MageInt(2);
    this.toughness = new MageInt(1);

    FilterArtifactSpell filter = new FilterArtifactSpell("an artifact spell");
    SpellCastControllerTriggeredAbility ability =
        new SpellCastControllerTriggeredAbility(
            new BoostTargetEffect(2, 0, Duration.EndOfTurn), filter, true);
    ability.addEffect(
        new GainAbilityTargetEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn));
    ability.addTarget(new TargetCreaturePermanent());
    this.addAbility(ability);
  }
Beispiel #9
0
 private void singleBlockerDamage(boolean first, Game game) {
   // TODO:  handle banding
   Permanent blocker = game.getPermanent(blockers.get(0));
   Permanent attacker = game.getPermanent(attackers.get(0));
   if (blocker != null && attacker != null) {
     int blockerDamage =
         getDamageValueFromPermanent(
             blocker,
             game); // must be set before attacker damage marking because of effects like Test of
                    // Faith
     if (blocked && canDamage(attacker, first)) {
       int damage = getDamageValueFromPermanent(attacker, game);
       if (hasTrample(attacker)) {
         int lethalDamage;
         if (attacker.getAbilities().containsKey(DeathtouchAbility.getInstance().getId())) {
           lethalDamage = 1;
         } else {
           lethalDamage = blocker.getToughness().getValue() - blocker.getDamage();
         }
         if (lethalDamage >= damage) {
           blocker.markDamage(damage, attacker.getId(), game, true, true);
         } else {
           Player player = game.getPlayer(attacker.getControllerId());
           int damageAssigned =
               player.getAmount(
                   lethalDamage, damage, "Assign damage to " + blocker.getLogName(), game);
           blocker.markDamage(damageAssigned, attacker.getId(), game, true, true);
           damage -= damageAssigned;
           if (damage > 0) {
             defenderDamage(attacker, damage, game);
           }
         }
       } else {
         blocker.markDamage(damage, attacker.getId(), game, true, true);
       }
     }
     if (canDamage(blocker, first)) {
       if (blocker.getBlocking()
           == 1) { // blocking several creatures handled separately
         attacker.markDamage(blockerDamage, blocker.getId(), game, true, true);
       }
     }
   }
 }
  public ShamblingAttendants(UUID ownerId) {
    super(
        ownerId,
        89,
        "Shambling Attendants",
        Rarity.COMMON,
        new CardType[] {CardType.CREATURE},
        "{7}{B}");
    this.expansionSetCode = "KTK";
    this.subtype.add("Zombie");

    this.power = new MageInt(3);
    this.toughness = new MageInt(5);

    // Delve
    this.addAbility(new DelveAbility());
    // Deathtouch
    this.addAbility(DeathtouchAbility.getInstance());
  }
Beispiel #11
0
  public AcidicSlime(UUID ownerId) {
    super(
        ownerId,
        165,
        "Acidic Slime",
        Rarity.UNCOMMON,
        new CardType[] {CardType.CREATURE},
        "{3}{G}{G}");
    this.expansionSetCode = "M10";
    this.subtype.add("Ooze");
    this.color.setGreen(true);
    this.power = new MageInt(2);
    this.toughness = new MageInt(2);

    this.addAbility(DeathtouchAbility.getInstance());
    Ability ability = new EntersBattlefieldTriggeredAbility(new DestroyTargetEffect(), false);
    Target target = new TargetPermanent(filter);
    ability.addTarget(target);
    this.addAbility(ability);
  }
Beispiel #12
0
  public KederektCreeper(UUID ownerId) {
    super(
        ownerId,
        176,
        "Kederekt Creeper",
        Rarity.COMMON,
        new CardType[] {CardType.CREATURE},
        "{U}{B}{R}");
    this.expansionSetCode = "ALA";
    this.subtype.add("Horror");

    this.color.setRed(true);
    this.color.setBlue(true);
    this.color.setBlack(true);
    this.power = new MageInt(2);
    this.toughness = new MageInt(3);

    this.addAbility(DeathtouchAbility.getInstance());
    // Kederekt Creeper can't be blocked except by two or more creatures.
    this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new CantBeBlockedByOneEffect(2)));
  }
Beispiel #13
0
 @Override
 public boolean apply(Game game, Ability source) {
   Player controller = game.getPlayer(source.getControllerId());
   if (controller != null) {
     CreateTokenEffect effect = new CreateTokenEffect(new ElfToken(), 2);
     effect.apply(game, source);
     if (ClashEffect.getInstance().apply(game, source)) {
       for (UUID tokenId : effect.getLastAddedTokenIds()) {
         Permanent token = game.getPermanent(tokenId);
         if (token != null) {
           ContinuousEffect continuousEffect =
               new GainAbilityTargetEffect(DeathtouchAbility.getInstance(), Duration.EndOfTurn);
           continuousEffect.setTargetPointer(new FixedTarget(tokenId));
           game.addEffect(continuousEffect, source);
         }
       }
     }
     return true;
   }
   return false;
 }
Beispiel #14
0
  public OgreSlumlord(UUID ownerId) {
    super(
        ownerId, 74, "Ogre Slumlord", Rarity.RARE, new CardType[] {CardType.CREATURE}, "{3}{B}{B}");
    this.expansionSetCode = "GTC";
    this.subtype.add("Ogre");
    this.subtype.add("Rogue");

    this.color.setBlack(true);
    this.power = new MageInt(3);
    this.toughness = new MageInt(3);

    this.color.setBlack(true);

    // Whenever another nontoken creature dies, you may put a 1/1 black Rat creature token onto the
    // battlefield.
    this.addAbility(
        new DiesCreatureTriggeredAbility(new CreateTokenEffect(new RatToken()), true, filter));
    // Rats you control have deathtouch.
    this.addAbility(
        new SimpleStaticAbility(
            Zone.BATTLEFIELD,
            new GainAbilityAllEffect(
                DeathtouchAbility.getInstance(), Duration.WhileOnBattlefield, filter2)));
  }
Beispiel #15
0
  public HornetQueen(UUID ownerId) {
    super(
        ownerId,
        159,
        "Hornet Queen",
        Rarity.RARE,
        new CardType[] {CardType.CREATURE},
        "{4}{G}{G}{G}");
    this.expansionSetCode = "CMD";
    this.subtype.add("Insect");

    this.power = new MageInt(2);
    this.toughness = new MageInt(2);

    // Flying
    this.addAbility(FlyingAbility.getInstance());
    // Deathtouch
    this.addAbility(DeathtouchAbility.getInstance());
    // When Hornet Queen enters the battlefield, put four 1/1 green Insect creature tokens with
    // flying and deathtouch onto the battlefield.
    this.addAbility(
        new EntersBattlefieldTriggeredAbility(
            new CreateTokenEffect(new HornetQueenInsectToken(), 4), false));
  }
Beispiel #16
0
  public RuthlessRipper(UUID ownerId) {
    super(
        ownerId, 88, "Ruthless Ripper", Rarity.UNCOMMON, new CardType[] {CardType.CREATURE}, "{B}");
    this.expansionSetCode = "KTK";
    this.subtype.add("Human");
    this.subtype.add("Assassin");

    this.power = new MageInt(1);
    this.toughness = new MageInt(1);

    // Deathtouch
    this.addAbility(DeathtouchAbility.getInstance());

    // Morph - Reveal a black card in your hand.
    this.addAbility(
        new MorphAbility(this, new RevealTargetFromHandCost(new TargetCardInHand(filter))));

    // When Ruthless Ripper is turned face up, target player loses 2 life.
    Effect effect = new LoseLifeTargetEffect(2);
    effect.setText("target player loses 2 life");
    Ability ability = new TurnedFaceUpSourceTriggeredAbility(effect);
    ability.addTarget(new TargetPlayer());
    this.addAbility(ability);
  }
Beispiel #17
0
 private void multiBlockerDamage(boolean first, Game game) {
   // TODO:  handle banding
   Permanent attacker = game.getPermanent(attackers.get(0));
   if (attacker == null) {
     return;
   }
   Player player = game.getPlayer(attacker.getControllerId());
   int damage = getDamageValueFromPermanent(attacker, game);
   if (canDamage(attacker, first)) {
     // must be set before attacker damage marking because of effects like Test of Faith
     Map<UUID, Integer> blockerPower = new HashMap<>();
     for (UUID blockerId : blockerOrder) {
       Permanent blocker = game.getPermanent(blockerId);
       if (canDamage(blocker, first)) {
         if (blocker.getBlocking() == 1) { // blocking several creatures handled separately
           blockerPower.put(blockerId, getDamageValueFromPermanent(blocker, game));
         }
       }
     }
     Map<UUID, Integer> assigned = new HashMap<>();
     if (blocked) {
       for (UUID blockerId : blockerOrder) {
         Permanent blocker = game.getPermanent(blockerId);
         int lethalDamage;
         if (attacker.getAbilities().containsKey(DeathtouchAbility.getInstance().getId())) {
           lethalDamage = 1;
         } else {
           lethalDamage = blocker.getToughness().getValue() - blocker.getDamage();
         }
         if (lethalDamage >= damage) {
           assigned.put(blockerId, damage);
           damage = 0;
           break;
         }
         int damageAssigned =
             player.getAmount(
                 lethalDamage, damage, "Assign damage to " + blocker.getLogName(), game);
         assigned.put(blockerId, damageAssigned);
         damage -= damageAssigned;
       }
       if (damage > 0 && hasTrample(attacker)) {
         defenderDamage(attacker, damage, game);
       }
     }
     for (UUID blockerId : blockerOrder) {
       Integer power = blockerPower.get(blockerId);
       if (power != null) {
         attacker.markDamage(power.intValue(), blockerId, game, true, true);
       }
     }
     for (Map.Entry<UUID, Integer> entry : assigned.entrySet()) {
       Permanent blocker = game.getPermanent(entry.getKey());
       blocker.markDamage(entry.getValue(), attacker.getId(), game, true, true);
     }
   } else {
     for (UUID blockerId : blockerOrder) {
       Permanent blocker = game.getPermanent(blockerId);
       if (canDamage(blocker, first)) {
         attacker.markDamage(
             getDamageValueFromPermanent(blocker, game), blocker.getId(), game, true, true);
       }
     }
   }
 }