diff --git a/Mage.Sets/src/mage/cards/l/LootDispute.java b/Mage.Sets/src/mage/cards/l/LootDispute.java new file mode 100644 index 00000000000..026f40e0078 --- /dev/null +++ b/Mage.Sets/src/mage/cards/l/LootDispute.java @@ -0,0 +1,81 @@ +package mage.cards.l; + +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.CompletedDungeonTriggeredAbility; +import mage.abilities.common.EntersBattlefieldTriggeredAbility; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.TakeTheInitiativeEffect; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.GameEvent; +import mage.game.permanent.token.DragonToken2; +import mage.game.permanent.token.TreasureToken; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class LootDispute extends CardImpl { + + public LootDispute(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{R}"); + + // When Loot Dispute enters the battlefield, you take the initiative and create a Treasure token. + Ability ability = new EntersBattlefieldTriggeredAbility(new TakeTheInitiativeEffect()); + ability.addEffect(new CreateTokenEffect(new TreasureToken()).setText("and create a Treasure token")); + this.addAbility(ability); + + // Whenever you attack a player who has the initiative, create a Treasure token. + this.addAbility(new LootDisputeTriggeredAbility()); + + // Loud Ruckus — Whenever you complete a dungeon, create a 5/5 red Dragon creature token with flying. + this.addAbility(new CompletedDungeonTriggeredAbility( + new CreateTokenEffect(new DragonToken2()) + ).withFlavorWord("Loud Ruckus")); + } + + private LootDispute(final LootDispute card) { + super(card); + } + + @Override + public LootDispute copy() { + return new LootDispute(this); + } +} + +class LootDisputeTriggeredAbility extends TriggeredAbilityImpl { + + LootDisputeTriggeredAbility() { + super(Zone.BATTLEFIELD, new CreateTokenEffect(new TreasureToken())); + } + + private LootDisputeTriggeredAbility(final LootDisputeTriggeredAbility ability) { + super(ability); + } + + @Override + public LootDisputeTriggeredAbility copy() { + return new LootDisputeTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DEFENDER_ATTACKED; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + return isControlledBy(event.getPlayerId()) && event.getTargetId().equals(game.getInitiativeId()); + } + + @Override + public String getTriggerPhrase() { + return "Whenever you attack a player who has the initiative, "; + } +} diff --git a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java index 45c9c086584..fce5e05cfe2 100644 --- a/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java +++ b/Mage.Sets/src/mage/sets/CommanderLegendsBattleForBaldursGate.java @@ -321,6 +321,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet { cards.add(new SetCardInfo("Lightning Bolt", 187, Rarity.COMMON, mage.cards.l.LightningBolt.class)); cards.add(new SetCardInfo("Lightning Greaves", 864, Rarity.UNCOMMON, mage.cards.l.LightningGreaves.class)); cards.add(new SetCardInfo("Livaan, Cultist of Tiamat", 188, Rarity.UNCOMMON, mage.cards.l.LivaanCultistOfTiamat.class)); + cards.add(new SetCardInfo("Loot Dispute", 677, Rarity.RARE, mage.cards.l.LootDispute.class)); cards.add(new SetCardInfo("Lovestruck Beast", 827, Rarity.RARE, mage.cards.l.LovestruckBeast.class)); cards.add(new SetCardInfo("Lozhan, Dragons' Legacy", 281, Rarity.UNCOMMON, mage.cards.l.LozhanDragonsLegacy.class)); cards.add(new SetCardInfo("Lulu, Loyal Hollyphant", 32, Rarity.UNCOMMON, mage.cards.l.LuluLoyalHollyphant.class));