[BLC] Implement Gourmand's Talent (#12796)

This commit is contained in:
Grath 2024-09-03 23:22:31 -04:00 committed by GitHub
parent 321f93bbc0
commit 8421c993e9
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 152 additions and 0 deletions

View file

@ -2454,6 +2454,9 @@ public class ScryfallImageSupportTokens {
put("BLB/Treasure", "https://api.scryfall.com/cards/tblb/29/en?format=image"); put("BLB/Treasure", "https://api.scryfall.com/cards/tblb/29/en?format=image");
put("BLB/Wall", "https://api.scryfall.com/cards/tblb/4/en?format=image"); put("BLB/Wall", "https://api.scryfall.com/cards/tblb/4/en?format=image");
// BLC
put("BLC/Raccoon", "https://api.scryfall.com/cards/tblc/29/en?format=image");
// generate supported sets // generate supported sets
supportedSets.clear(); supportedSets.clear();
for (String cardName : this.keySet()) { for (String cardName : this.keySet()) {

View file

@ -0,0 +1,116 @@
package mage.cards.g;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.GainLifeFirstTimeTriggeredAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.MyTurnCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.common.CreateTokenEffect;
import mage.abilities.effects.common.continuous.GainClassAbilitySourceEffect;
import mage.abilities.effects.common.counter.AddCountersAllEffect;
import mage.abilities.keyword.ClassLevelAbility;
import mage.abilities.keyword.ClassReminderAbility;
import mage.abilities.token.FoodAbility;
import mage.constants.*;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.counters.CounterType;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.game.permanent.token.RaccoonToken;
/**
*
* @author Grath
*/
public final class GourmandsTalent extends CardImpl {
public GourmandsTalent(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{G}");
this.subtype.add(SubType.CLASS);
// (Gain the next level as a sorcery to add its ability.)
this.addAbility(new ClassReminderAbility());
// During your turn, artifacts you control are Foods in addition to their other types and have "{2}, {T}, Sacrifice this artifact: You gain 3 life."
this.addAbility(new SimpleStaticAbility(new ConditionalContinuousEffect(
new GourmandsTalentEffect(), MyTurnCondition.instance, "During your turn, artifacts you control " +
"are Foods in addition to their other types and have \"{2}, {T}, Sacrifice this artifact: You gain 3 " +
"life.\""
)));
// {2}{G}: Level 2
this.addAbility(new ClassLevelAbility(2, "{2}{G}"));
// Whenever you gain life for the first time each turn, create a 3/3 green Raccoon creature token.
this.addAbility(new SimpleStaticAbility(new GainClassAbilitySourceEffect(
new GainLifeFirstTimeTriggeredAbility(new CreateTokenEffect(new RaccoonToken())), 2)));
// {3}{G}: Level 3
this.addAbility(new ClassLevelAbility(3, "{3}{G}"));
// Whenever you gain life for the first time each turn, put a +1/+1 counter on each creature you control.
this.addAbility(new SimpleStaticAbility(new GainClassAbilitySourceEffect(
new GainLifeFirstTimeTriggeredAbility(new AddCountersAllEffect(CounterType.P1P1.createInstance(), StaticFilters.FILTER_CONTROLLED_CREATURE)), 3)));
}
private GourmandsTalent(final GourmandsTalent card) {
super(card);
}
@Override
public GourmandsTalent copy() {
return new GourmandsTalent(this);
}
}
class GourmandsTalentEffect extends ContinuousEffectImpl {
GourmandsTalentEffect() {
super(Duration.WhileOnBattlefield, Layer.TypeChangingEffects_4, SubLayer.NA, Outcome.AddAbility);
staticText = "Other creatures are Food artifacts in addition to their other types " +
"and have \"{2}, {T}, Sacrifice this permanent: You gain 3 life.\"";
this.dependencyTypes.add(DependencyType.AddingAbility);
}
private GourmandsTalentEffect(final GourmandsTalentEffect effect) {
super(effect);
}
@Override
public GourmandsTalentEffect copy() {
return new GourmandsTalentEffect(this);
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
for (Permanent permanent : game.getBattlefield().getActivePermanents(StaticFilters.FILTER_PERMANENT_ARTIFACT, source.getControllerId(), source, game)) {
if (permanent.getId().equals(source.getSourceId())) {
continue;
}
switch (layer) {
case TypeChangingEffects_4:
permanent.addSubType(game, SubType.FOOD);
break;
case AbilityAddingRemovingEffects_6:
permanent.addAbility(new FoodAbility(true), source.getSourceId(), game);
break;
}
}
return true;
}
@Override
public boolean apply(Game game, Ability source) {
return false;
}
@Override
public boolean hasLayer(Layer layer) {
return layer == Layer.TypeChangingEffects_4 || layer == Layer.AbilityAddingRemovingEffects_6;
}
}

View file

@ -122,6 +122,7 @@ public final class BloomburrowCommander extends ExpansionSet {
cards.add(new SetCardInfo("Golgari Rot Farm", 308, Rarity.UNCOMMON, mage.cards.g.GolgariRotFarm.class)); cards.add(new SetCardInfo("Golgari Rot Farm", 308, Rarity.UNCOMMON, mage.cards.g.GolgariRotFarm.class));
cards.add(new SetCardInfo("Golgari Signet", 272, Rarity.UNCOMMON, mage.cards.g.GolgariSignet.class)); cards.add(new SetCardInfo("Golgari Signet", 272, Rarity.UNCOMMON, mage.cards.g.GolgariSignet.class));
cards.add(new SetCardInfo("Goreclaw, Terror of Qal Sisma", 222, Rarity.RARE, mage.cards.g.GoreclawTerrorOfQalSisma.class)); cards.add(new SetCardInfo("Goreclaw, Terror of Qal Sisma", 222, Rarity.RARE, mage.cards.g.GoreclawTerrorOfQalSisma.class));
cards.add(new SetCardInfo("Gourmand's Talent", 31, Rarity.RARE, mage.cards.g.GourmandsTalent.class));
cards.add(new SetCardInfo("Gratuitous Violence", 197, Rarity.RARE, mage.cards.g.GratuitousViolence.class)); cards.add(new SetCardInfo("Gratuitous Violence", 197, Rarity.RARE, mage.cards.g.GratuitousViolence.class));
cards.add(new SetCardInfo("Greater Good", 223, Rarity.RARE, mage.cards.g.GreaterGood.class)); cards.add(new SetCardInfo("Greater Good", 223, Rarity.RARE, mage.cards.g.GreaterGood.class));
cards.add(new SetCardInfo("Grim Backwoods", 309, Rarity.RARE, mage.cards.g.GrimBackwoods.class)); cards.add(new SetCardInfo("Grim Backwoods", 309, Rarity.RARE, mage.cards.g.GrimBackwoods.class));

View file

@ -0,0 +1,29 @@
package mage.game.permanent.token;
import mage.MageInt;
import mage.constants.CardType;
import mage.constants.SubType;
/**
* @author BetaSteward_at_googlemail.com
*/
public final class RaccoonToken extends TokenImpl {
public RaccoonToken() {
super("Raccoon Token", "3/3 green Raccoon creature token");
cardType.add(CardType.CREATURE);
color.setGreen(true);
subtype.add(SubType.RACCOON);
power = new MageInt(3);
toughness = new MageInt(3);
}
private RaccoonToken(final RaccoonToken token) {
super(token);
}
@Override
public RaccoonToken copy() {
return new RaccoonToken(this);
}
}

View file

@ -2389,3 +2389,6 @@
|Generate|TOK:BLB|Sword|||SwordToken| |Generate|TOK:BLB|Sword|||SwordToken|
|Generate|TOK:BLB|Treasure|||TreasureToken| |Generate|TOK:BLB|Treasure|||TreasureToken|
|Generate|TOK:BLB|Wall|||WallWhiteToken| |Generate|TOK:BLB|Wall|||WallWhiteToken|
# BLC
|Generate|TOK:BLC|Racoon|||RaccoonToken|