mirror of
https://github.com/magefree/mage.git
synced 2025-12-27 22:12:03 -08:00
Implemented Prismatic Boon
This commit is contained in:
parent
64962c63eb
commit
f6af525959
2 changed files with 76 additions and 0 deletions
75
Mage.Sets/src/mage/cards/p/PrismaticBoon.java
Normal file
75
Mage.Sets/src/mage/cards/p/PrismaticBoon.java
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
package mage.cards.p;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
|
||||
import mage.abilities.keyword.ProtectionAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.choices.ChoiceColor;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetadjustment.XTargetsAdjuster;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class PrismaticBoon extends CardImpl {
|
||||
|
||||
public PrismaticBoon(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{X}{W}{U}");
|
||||
|
||||
// Choose a color. X target creatures gain protection from the chosen color until end of turn.
|
||||
this.getSpellAbility().addEffect(new PrismaticBoonEffect());
|
||||
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
|
||||
this.getSpellAbility().setTargetAdjuster(XTargetsAdjuster.instance);
|
||||
}
|
||||
|
||||
private PrismaticBoon(final PrismaticBoon card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrismaticBoon copy() {
|
||||
return new PrismaticBoon(this);
|
||||
}
|
||||
}
|
||||
|
||||
class PrismaticBoonEffect extends OneShotEffect {
|
||||
|
||||
PrismaticBoonEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "Choose a color. X target creatures gain protection from the chosen color until end of turn.";
|
||||
}
|
||||
|
||||
private PrismaticBoonEffect(final PrismaticBoonEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PrismaticBoonEffect copy() {
|
||||
return new PrismaticBoonEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
ChoiceColor choice = new ChoiceColor();
|
||||
if (!player.choose(outcome, choice, game)) {
|
||||
return false;
|
||||
}
|
||||
game.addEffect(new GainAbilityTargetEffect(
|
||||
ProtectionAbility.from(choice.getColor()), Duration.EndOfTurn
|
||||
), source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -224,6 +224,7 @@ public final class Mirage extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Political Trickery", 81, Rarity.RARE, mage.cards.p.PoliticalTrickery.class));
|
||||
cards.add(new SetCardInfo("Polymorph", 82, Rarity.RARE, mage.cards.p.Polymorph.class));
|
||||
cards.add(new SetCardInfo("Power Sink", 83, Rarity.COMMON, mage.cards.p.PowerSink.class));
|
||||
cards.add(new SetCardInfo("Prismatic Boon", 274, Rarity.UNCOMMON, mage.cards.p.PrismaticBoon.class));
|
||||
cards.add(new SetCardInfo("Prismatic Circle", 34, Rarity.COMMON, mage.cards.p.PrismaticCircle.class));
|
||||
cards.add(new SetCardInfo("Prismatic Lace", 84, Rarity.RARE, mage.cards.p.PrismaticLace.class));
|
||||
cards.add(new SetCardInfo("Psychic Transfer", 85, Rarity.RARE, mage.cards.p.PsychicTransfer.class));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue