From 00928bdb9dd94ef16210818d0500f50fa6c6eb7a Mon Sep 17 00:00:00 2001 From: Evan Kranzler Date: Sat, 6 Nov 2021 21:50:24 -0400 Subject: [PATCH] [VOW] Implemented Olivia's Attendants --- .../src/mage/cards/o/OliviasAttendants.java | 99 +++++++++++++++++++ .../src/mage/sets/InnistradCrimsonVow.java | 1 + 2 files changed, 100 insertions(+) create mode 100644 Mage.Sets/src/mage/cards/o/OliviasAttendants.java diff --git a/Mage.Sets/src/mage/cards/o/OliviasAttendants.java b/Mage.Sets/src/mage/cards/o/OliviasAttendants.java new file mode 100644 index 0000000000..fe3c3731ea --- /dev/null +++ b/Mage.Sets/src/mage/cards/o/OliviasAttendants.java @@ -0,0 +1,99 @@ +package mage.cards.o; + +import mage.MageInt; +import mage.abilities.Ability; +import mage.abilities.TriggeredAbilityImpl; +import mage.abilities.common.SimpleActivatedAbility; +import mage.abilities.costs.mana.ManaCostsImpl; +import mage.abilities.effects.common.CreateTokenEffect; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.keyword.MenaceAbility; +import mage.cards.CardImpl; +import mage.cards.CardSetInfo; +import mage.constants.CardType; +import mage.constants.SubType; +import mage.constants.Zone; +import mage.game.Game; +import mage.game.events.DamagedBatchEvent; +import mage.game.events.GameEvent; +import mage.game.permanent.token.BloodToken; +import mage.target.common.TargetAnyTarget; + +import java.util.UUID; + +/** + * @author TheElk801 + */ +public final class OliviasAttendants extends CardImpl { + + public OliviasAttendants(UUID ownerId, CardSetInfo setInfo) { + super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{R}{R}"); + + this.subtype.add(SubType.VAMPIRE); + this.power = new MageInt(6); + this.toughness = new MageInt(6); + + // Menace + this.addAbility(new MenaceAbility()); + + // Whenever Olivia's Attendants deals damage, create that many Blood tokens. + this.addAbility(new OliviasAttendantsTriggeredAbility()); + + // {2}{R}: Olivia's Attendants deals 1 damage to any target. + Ability ability = new SimpleActivatedAbility(new DamageTargetEffect(1), new ManaCostsImpl<>("{2}{R}")); + ability.addTarget(new TargetAnyTarget()); + this.addAbility(ability); + } + + private OliviasAttendants(final OliviasAttendants card) { + super(card); + } + + @Override + public OliviasAttendants copy() { + return new OliviasAttendants(this); + } +} + +class OliviasAttendantsTriggeredAbility extends TriggeredAbilityImpl { + + OliviasAttendantsTriggeredAbility() { + super(Zone.BATTLEFIELD, null); + } + + private OliviasAttendantsTriggeredAbility(final OliviasAttendantsTriggeredAbility ability) { + super(ability); + } + + @Override + public OliviasAttendantsTriggeredAbility copy() { + return new OliviasAttendantsTriggeredAbility(this); + } + + @Override + public boolean checkEventType(GameEvent event, Game game) { + return event.getType() == GameEvent.EventType.DAMAGED_PLAYER_BATCH + || event.getType() == GameEvent.EventType.DAMAGED_PERMANENT_BATCH; + } + + @Override + public boolean checkTrigger(GameEvent event, Game game) { + int amount = ((DamagedBatchEvent) event) + .getEvents() + .stream() + .filter(e -> e.getSourceId().equals(getSourceId())) + .mapToInt(GameEvent::getAmount) + .sum(); + if (amount < 1) { + return false; + } + this.getEffects().clear(); + this.addEffect(new CreateTokenEffect(new BloodToken(), amount)); + return true; + } + + @Override + public String getRule() { + return "Whenever {this} deals damage, create that many Blood tokens."; + } +} diff --git a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java index ef19fa7508..fec91cb7b1 100644 --- a/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java +++ b/Mage.Sets/src/mage/sets/InnistradCrimsonVow.java @@ -195,6 +195,7 @@ public final class InnistradCrimsonVow extends ExpansionSet { cards.add(new SetCardInfo("Oakshade Stalker", 212, Rarity.UNCOMMON, mage.cards.o.OakshadeStalker.class)); cards.add(new SetCardInfo("Odric, Blood-Cursed", 243, Rarity.RARE, mage.cards.o.OdricBloodCursed.class)); cards.add(new SetCardInfo("Old Rutstein", 244, Rarity.RARE, mage.cards.o.OldRutstein.class)); + cards.add(new SetCardInfo("Olivia's Attendants", 172, Rarity.RARE, mage.cards.o.OliviasAttendants.class)); cards.add(new SetCardInfo("Olivia, Crimson Bride", 245, Rarity.MYTHIC, mage.cards.o.OliviaCrimsonBride.class)); cards.add(new SetCardInfo("Ollenbock Escort", 27, Rarity.UNCOMMON, mage.cards.o.OllenbockEscort.class)); cards.add(new SetCardInfo("Overcharged Amalgam", 71, Rarity.RARE, mage.cards.o.OverchargedAmalgam.class));