[MAT] Implement Rocco, Street Chef

This commit is contained in:
theelk801 2023-05-08 17:59:17 -04:00
parent 5f3715a8dc
commit b7cd8f8c6e
2 changed files with 124 additions and 0 deletions

View file

@ -0,0 +1,123 @@
package mage.cards.r;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.*;
import mage.counters.CounterType;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.token.TreasureToken;
import mage.players.Player;
import mage.target.common.TargetCreaturePermanent;
import mage.util.CardUtil;
import java.util.UUID;
/**
* @author TheElk801
*/
public final class RoccoStreetChef extends CardImpl {
public RoccoStreetChef(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{R}{G}{W}");
this.addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.ELF);
this.subtype.add(SubType.DRUID);
this.power = new MageInt(2);
this.toughness = new MageInt(4);
// At the beginning of your end step, each player exiles the top card of their library. Until your next end step, each player may play the card they exiled this way.
this.addAbility(new BeginningOfEndStepTriggeredAbility(
new RoccoStreetChefEffect(), TargetController.YOU, false
));
// Whenever a player plays a land from exile or casts a spell from exile, you put a +1/+1 counter on target creature and create a Food token.
this.addAbility(new RoccoStreetChefTriggeredAbility());
}
private RoccoStreetChef(final RoccoStreetChef card) {
super(card);
}
@Override
public RoccoStreetChef copy() {
return new RoccoStreetChef(this);
}
}
class RoccoStreetChefEffect extends OneShotEffect {
RoccoStreetChefEffect() {
super(Outcome.Benefit);
staticText = "each player exiles the top card of their library. " +
"Until your next end step, each player may play the card they exiled this way";
}
private RoccoStreetChefEffect(final RoccoStreetChefEffect effect) {
super(effect);
}
@Override
public RoccoStreetChefEffect copy() {
return new RoccoStreetChefEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
Player player = game.getPlayer(playerId);
if (player == null) {
continue;
}
Card card = player.getLibrary().getFromTop(game);
if (card == null) {
continue;
}
player.moveCards(card, Zone.EXILED, source, game);
CardUtil.makeCardPlayable(
game, source, card, Duration.UntilYourNextEndStep,
false, playerId, null
);
}
return true;
}
}
class RoccoStreetChefTriggeredAbility extends TriggeredAbilityImpl {
RoccoStreetChefTriggeredAbility() {
super(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.P1P1.createInstance()), true);
this.addEffect(new CreateTokenEffect(new TreasureToken()).concatBy("and"));
this.addTarget(new TargetCreaturePermanent());
this.setTriggerPhrase("Whenever a player plays a land from exile or casts a spell from exile, ");
}
private RoccoStreetChefTriggeredAbility(final RoccoStreetChefTriggeredAbility ability) {
super(ability);
}
@Override
public RoccoStreetChefTriggeredAbility copy() {
return new RoccoStreetChefTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == GameEvent.EventType.LAND_PLAYED
|| event.getType() == GameEvent.EventType.SPELL_CAST;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return event.getZone() == Zone.EXILED;
}
}

View file

@ -53,6 +53,7 @@ public final class MarchOfTheMachineTheAftermath extends ExpansionSet {
cards.add(new SetCardInfo("Plargg and Nassari", 18, Rarity.RARE, mage.cards.p.PlarggAndNassari.class));
cards.add(new SetCardInfo("Rebuild the City", 43, Rarity.RARE, mage.cards.r.RebuildTheCity.class));
cards.add(new SetCardInfo("Reckless Handling", 19, Rarity.UNCOMMON, mage.cards.r.RecklessHandling.class));
cards.add(new SetCardInfo("Rocco, Street Chef", 44, Rarity.RARE, mage.cards.r.RoccoStreetChef.class));
cards.add(new SetCardInfo("Samut, Vizier of Naktamun", 45, Rarity.MYTHIC, mage.cards.s.SamutVizierOfNaktamun.class));
cards.add(new SetCardInfo("Sarkhan, Soul Aflame", 46, Rarity.MYTHIC, mage.cards.s.SarkhanSoulAflame.class));
cards.add(new SetCardInfo("Sigarda, Font of Blessings", 47, Rarity.RARE, mage.cards.s.SigardaFontOfBlessings.class));