mirror of
https://github.com/correl/mage.git
synced 2024-11-24 19:19:56 +00:00
[CLB] Implement Master Chef (#9527)
--------- Co-authored-by: xenohedron <xenohedron@users.noreply.github.com>
This commit is contained in:
parent
2db08c6b7d
commit
90d35e0543
2 changed files with 97 additions and 0 deletions
96
Mage.Sets/src/mage/cards/m/MasterChef.java
Normal file
96
Mage.Sets/src/mage/cards/m/MasterChef.java
Normal file
|
@ -0,0 +1,96 @@
|
||||||
|
package mage.cards.m;
|
||||||
|
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.common.EntersBattlefieldAbility;
|
||||||
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
import mage.abilities.effects.ReplacementEffectImpl;
|
||||||
|
import mage.abilities.effects.common.continuous.GainAbilityAllEffect;
|
||||||
|
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.*;
|
||||||
|
import mage.counters.CounterType;
|
||||||
|
import mage.filter.StaticFilters;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.events.EntersTheBattlefieldEvent;
|
||||||
|
import mage.game.events.GameEvent;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
public class MasterChef extends CardImpl {
|
||||||
|
|
||||||
|
public MasterChef(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}");
|
||||||
|
this.supertype.add(SuperType.LEGENDARY);
|
||||||
|
this.subtype.add(SubType.BACKGROUND);
|
||||||
|
|
||||||
|
// Commander creatures you own have "This creature enters the battlefield with an additional +1/+1 counter on it"
|
||||||
|
// and "Other creatures you control enter the battlefield with an additional +1/+1 counter on them."
|
||||||
|
Ability ability = new SimpleStaticAbility(new GainAbilityAllEffect(
|
||||||
|
new EntersBattlefieldAbility(
|
||||||
|
new AddCountersSourceEffect(CounterType.P1P1.createInstance()).setText("with an additional +1/+1 counter on it")
|
||||||
|
), Duration.WhileOnBattlefield, StaticFilters.FILTER_CREATURES_OWNED_COMMANDER)
|
||||||
|
.setText("commander creatures you own have \"This creature enters the battlefield with an additional +1/+1 counter on it\"")
|
||||||
|
);
|
||||||
|
ability.addEffect(new GainAbilityAllEffect(
|
||||||
|
new SimpleStaticAbility(
|
||||||
|
new MasterChefReplacementEffect()
|
||||||
|
), Duration.WhileOnBattlefield, StaticFilters.FILTER_CREATURES_OWNED_COMMANDER)
|
||||||
|
.setText("and \"Other creatures you control enter the battlefield with an additional +1/+1 counter on them.\"")
|
||||||
|
);
|
||||||
|
this.addAbility(ability);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
private MasterChef(final MasterChef card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MasterChef copy() {
|
||||||
|
return new MasterChef(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
class MasterChefReplacementEffect extends ReplacementEffectImpl {
|
||||||
|
|
||||||
|
MasterChefReplacementEffect() {
|
||||||
|
super(Duration.WhileOnBattlefield, Outcome.BoostCreature);
|
||||||
|
staticText = "other creatures you control enter the battlefield with an additional +1/+1 counter on them";
|
||||||
|
}
|
||||||
|
|
||||||
|
private MasterChefReplacementEffect(final MasterChefReplacementEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||||
|
Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();
|
||||||
|
if (creature != null) {
|
||||||
|
creature.addCounters(CounterType.P1P1.createInstance(), source.getControllerId(), source, game, event.getAppliedEffects());
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checksEventType(GameEvent event, Game game) {
|
||||||
|
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
|
Permanent creature = ((EntersTheBattlefieldEvent)event).getTarget();
|
||||||
|
return creature != null
|
||||||
|
&& creature.isCreature(game)
|
||||||
|
&& creature.isControlledBy(source.getControllerId())
|
||||||
|
&& !source.getSourceId().equals(creature.getId());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public MasterChefReplacementEffect copy() {
|
||||||
|
return new MasterChefReplacementEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -375,6 +375,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Martial Impetus", 33, Rarity.COMMON, mage.cards.m.MartialImpetus.class));
|
cards.add(new SetCardInfo("Martial Impetus", 33, Rarity.COMMON, mage.cards.m.MartialImpetus.class));
|
||||||
cards.add(new SetCardInfo("Marut", 322, Rarity.COMMON, mage.cards.m.Marut.class));
|
cards.add(new SetCardInfo("Marut", 322, Rarity.COMMON, mage.cards.m.Marut.class));
|
||||||
cards.add(new SetCardInfo("Maskwood Nexus", 865, Rarity.RARE, mage.cards.m.MaskwoodNexus.class));
|
cards.add(new SetCardInfo("Maskwood Nexus", 865, Rarity.RARE, mage.cards.m.MaskwoodNexus.class));
|
||||||
|
cards.add(new SetCardInfo("Master Chef", 241, Rarity.COMMON, mage.cards.m.MasterChef.class));
|
||||||
cards.add(new SetCardInfo("Mazzy, Truesword Paladin", 283, Rarity.RARE, mage.cards.m.MazzyTrueswordPaladin.class, NON_FULL_USE_VARIOUS));
|
cards.add(new SetCardInfo("Mazzy, Truesword Paladin", 283, Rarity.RARE, mage.cards.m.MazzyTrueswordPaladin.class, NON_FULL_USE_VARIOUS));
|
||||||
cards.add(new SetCardInfo("Mazzy, Truesword Paladin", 430, Rarity.RARE, mage.cards.m.MazzyTrueswordPaladin.class, NON_FULL_USE_VARIOUS));
|
cards.add(new SetCardInfo("Mazzy, Truesword Paladin", 430, Rarity.RARE, mage.cards.m.MazzyTrueswordPaladin.class, NON_FULL_USE_VARIOUS));
|
||||||
cards.add(new SetCardInfo("Mazzy, Truesword Paladin", 541, Rarity.RARE, mage.cards.m.MazzyTrueswordPaladin.class, NON_FULL_USE_VARIOUS));
|
cards.add(new SetCardInfo("Mazzy, Truesword Paladin", 541, Rarity.RARE, mage.cards.m.MazzyTrueswordPaladin.class, NON_FULL_USE_VARIOUS));
|
||||||
|
|
Loading…
Reference in a new issue