mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
[EOE] Implement Requiem Monolith
This commit is contained in:
parent
57780c9211
commit
7b7d31f29c
2 changed files with 87 additions and 0 deletions
86
Mage.Sets/src/mage/cards/r/RequiemMonolith.java
Normal file
86
Mage.Sets/src/mage/cards/r/RequiemMonolith.java
Normal file
|
|
@ -0,0 +1,86 @@
|
||||||
|
package mage.cards.r;
|
||||||
|
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.common.ActivateAsSorceryActivatedAbility;
|
||||||
|
import mage.abilities.common.DealtDamageToSourceTriggeredAbility;
|
||||||
|
import mage.abilities.costs.common.TapSourceCost;
|
||||||
|
import mage.abilities.dynamicvalue.common.SavedDamageValue;
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||||
|
import mage.abilities.effects.common.LoseLifeSourceControllerEffect;
|
||||||
|
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.game.Controllable;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
import mage.target.common.TargetCreaturePermanent;
|
||||||
|
|
||||||
|
import java.util.Optional;
|
||||||
|
import java.util.UUID;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author TheElk801
|
||||||
|
*/
|
||||||
|
public final class RequiemMonolith extends CardImpl {
|
||||||
|
|
||||||
|
public RequiemMonolith(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}{B}");
|
||||||
|
|
||||||
|
// {T}: Until end of turn, target creature gains "Whenever this creature is dealt damage, you draw that many cards and lose that much life." That creature's controller may have this artifact deal 1 damage to it. Activate only as a sorcery.
|
||||||
|
Ability ability = new DealtDamageToSourceTriggeredAbility(
|
||||||
|
new DrawCardSourceControllerEffect(SavedDamageValue.MANY, true), false
|
||||||
|
);
|
||||||
|
ability.addEffect(new LoseLifeSourceControllerEffect(SavedDamageValue.MUCH).setText("and lose that much life"));
|
||||||
|
ability = new ActivateAsSorceryActivatedAbility(new GainAbilityTargetEffect(ability)
|
||||||
|
.setText("Until end of turn, target creature gains \"Whenever this creature " +
|
||||||
|
"is dealt damage, you draw that many cards and lose that much life.\""), new TapSourceCost());
|
||||||
|
ability.addEffect(new RequiemMonolithEffect());
|
||||||
|
ability.addTarget(new TargetCreaturePermanent());
|
||||||
|
this.addAbility(ability);
|
||||||
|
}
|
||||||
|
|
||||||
|
private RequiemMonolith(final RequiemMonolith card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RequiemMonolith copy() {
|
||||||
|
return new RequiemMonolith(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class RequiemMonolithEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
RequiemMonolithEffect() {
|
||||||
|
super(Outcome.Benefit);
|
||||||
|
staticText = "That creature's controller may have {this} deal 1 damage to it";
|
||||||
|
}
|
||||||
|
|
||||||
|
private RequiemMonolithEffect(final RequiemMonolithEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RequiemMonolithEffect copy() {
|
||||||
|
return new RequiemMonolithEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
Permanent permanent = game.getPermanent(getTargetPointer().getFirst(game, source));
|
||||||
|
return permanent != null
|
||||||
|
&& Optional
|
||||||
|
.ofNullable(permanent)
|
||||||
|
.map(Controllable::getControllerId)
|
||||||
|
.map(game::getPlayer)
|
||||||
|
.filter(player -> player.chooseUse(
|
||||||
|
Outcome.Neutral, "Have this artifact deal 1 damage to " +
|
||||||
|
permanent.getLogName() + '?', source, game
|
||||||
|
))
|
||||||
|
.filter(x -> permanent.damage(1, source, game) > 0)
|
||||||
|
.isPresent();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -196,6 +196,7 @@ public final class EdgeOfEternities extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Rayblade Trooper", 30, Rarity.UNCOMMON, mage.cards.r.RaybladeTrooper.class));
|
cards.add(new SetCardInfo("Rayblade Trooper", 30, Rarity.UNCOMMON, mage.cards.r.RaybladeTrooper.class));
|
||||||
cards.add(new SetCardInfo("Red Tiger Mechan", 154, Rarity.COMMON, mage.cards.r.RedTigerMechan.class));
|
cards.add(new SetCardInfo("Red Tiger Mechan", 154, Rarity.COMMON, mage.cards.r.RedTigerMechan.class));
|
||||||
cards.add(new SetCardInfo("Remnant Elemental", 155, Rarity.UNCOMMON, mage.cards.r.RemnantElemental.class));
|
cards.add(new SetCardInfo("Remnant Elemental", 155, Rarity.UNCOMMON, mage.cards.r.RemnantElemental.class));
|
||||||
|
cards.add(new SetCardInfo("Requiem Monolith", 113, Rarity.RARE, mage.cards.r.RequiemMonolith.class));
|
||||||
cards.add(new SetCardInfo("Reroute Systems", 31, Rarity.UNCOMMON, mage.cards.r.RerouteSystems.class));
|
cards.add(new SetCardInfo("Reroute Systems", 31, Rarity.UNCOMMON, mage.cards.r.RerouteSystems.class));
|
||||||
cards.add(new SetCardInfo("Rescue Skiff", 32, Rarity.UNCOMMON, mage.cards.r.RescueSkiff.class));
|
cards.add(new SetCardInfo("Rescue Skiff", 32, Rarity.UNCOMMON, mage.cards.r.RescueSkiff.class));
|
||||||
cards.add(new SetCardInfo("Roving Actuator", 157, Rarity.UNCOMMON, mage.cards.r.RovingActuator.class));
|
cards.add(new SetCardInfo("Roving Actuator", 157, Rarity.UNCOMMON, mage.cards.r.RovingActuator.class));
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue