Skip to content

Commit

Permalink
Implement [CLU] Tribune Of Rot (magefree#11839)
Browse files Browse the repository at this point in the history
  • Loading branch information
BenGiese22 authored Feb 24, 2024
1 parent 011ccec commit 5ae2244
Show file tree
Hide file tree
Showing 2 changed files with 83 additions and 0 deletions.
82 changes: 82 additions & 0 deletions Mage.Sets/src/mage/cards/t/TribuneOfRot.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@

package mage.cards.t;

import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.AttacksTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.token.Token;
import mage.game.permanent.token.SaprolingToken;
import mage.players.Player;

import java.util.Objects;
import java.util.UUID;

/**
* @author BenGiese22
*/
public final class TribuneOfRot extends CardImpl {

public TribuneOfRot(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{B/G}{B/G}");

this.subtype.add(SubType.ELF);
this.subtype.add(SubType.SHAMAN);
this.power = new MageInt(3);
this.toughness = new MageInt(3);

// Whenever Tribune of Rot attacks, mill two cards. For each creature card milled this way, create a 1/1 green Saproling creature token.
this.addAbility(new AttacksTriggeredAbility(new TribuneOfRotEffect()));
}

private TribuneOfRot(final TribuneOfRot card) {
super(card);
}

@Override
public TribuneOfRot copy() {
return new TribuneOfRot(this);
}
}

class TribuneOfRotEffect extends OneShotEffect {

private static final Token token = new SaprolingToken();

TribuneOfRotEffect() {
super(Outcome.PutCreatureInPlay);
this.staticText = "For each creature card milled this way, create a 1/1 green Saproling creature token.";
}

private TribuneOfRotEffect(final TribuneOfRotEffect effect) {
super(effect);
}

@Override
public TribuneOfRotEffect copy() {
return new TribuneOfRotEffect(this);
}

@Override
public boolean apply(Game game, Ability source) {
Player player = game.getPlayer(source.getControllerId());
if (player != null) {
int numOfCreatureCardsMilled = player
.millCards(2, source, game)
.count(StaticFilters.FILTER_CARD_CREATURE, game);
if (numOfCreatureCardsMilled > 0) {
game.getState().processAction(game);
token.putOntoBattlefield(numOfCreatureCardsMilled, game, source, source.getControllerId(), false, false);
}
return true;
}
return false;
}
}
1 change: 1 addition & 0 deletions Mage.Sets/src/mage/sets/RavnicaClueEdition.java
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ private RavnicaClueEdition() {
cards.add(new SetCardInfo("Tithebearer Giant", 124, Rarity.COMMON, mage.cards.t.TithebearerGiant.class));
cards.add(new SetCardInfo("Towering Thunderfist", 151, Rarity.COMMON, mage.cards.t.ToweringThunderfist.class));
cards.add(new SetCardInfo("Transluminant", 177, Rarity.COMMON, mage.cards.t.Transluminant.class));
cards.add(new SetCardInfo("Tribune of Rot", 48, Rarity.UNCOMMON, mage.cards.t.TribuneOfRot.class));
cards.add(new SetCardInfo("Trostani Discordant", 213, Rarity.MYTHIC, mage.cards.t.TrostaniDiscordant.class));
cards.add(new SetCardInfo("Trusted Pegasus", 77, Rarity.COMMON, mage.cards.t.TrustedPegasus.class));
cards.add(new SetCardInfo("Turn to Frog", 103, Rarity.UNCOMMON, mage.cards.t.TurnToFrog.class));
Expand Down

0 comments on commit 5ae2244

Please sign in to comment.