mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
[CLB] Implemented Beckoning Will-O'-Wisp
This commit is contained in:
parent
a4db8dafc4
commit
706602bb82
2 changed files with 109 additions and 0 deletions
108
Mage.Sets/src/mage/cards/b/BeckoningWillOWisp.java
Normal file
108
Mage.Sets/src/mage/cards/b/BeckoningWillOWisp.java
Normal file
|
@ -0,0 +1,108 @@
|
|||
package mage.cards.b;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.BeginningOfCombatTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.continuous.BoostAllEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.ObjectSourcePlayer;
|
||||
import mage.filter.predicate.ObjectSourcePlayerPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetOpponent;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class BeckoningWillOWisp extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter
|
||||
= new FilterCreaturePermanent("creatures attacking the last chosen player");
|
||||
|
||||
static {
|
||||
filter.add(BeckoningWillOWispPredicate.instance);
|
||||
}
|
||||
|
||||
public BeckoningWillOWisp(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{W}");
|
||||
|
||||
this.subtype.add(SubType.SPIRIT);
|
||||
this.power = new MageInt(1);
|
||||
this.toughness = new MageInt(3);
|
||||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
|
||||
// Lure the Unwary — At the beginning of combat on your turn, choose an opponent.
|
||||
this.addAbility(new BeginningOfCombatTriggeredAbility(new BeckoningWillOWispEffect(), TargetController.YOU, false));
|
||||
|
||||
// Creatures attacking the last chosen player get +1/+0.
|
||||
this.addAbility(new SimpleStaticAbility(new BoostAllEffect(1, 0, Duration.WhileOnBattlefield, filter, false)));
|
||||
}
|
||||
|
||||
private BeckoningWillOWisp(final BeckoningWillOWisp card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BeckoningWillOWisp copy() {
|
||||
return new BeckoningWillOWisp(this);
|
||||
}
|
||||
}
|
||||
|
||||
enum BeckoningWillOWispPredicate implements ObjectSourcePlayerPredicate<Permanent> {
|
||||
instance;
|
||||
|
||||
@Override
|
||||
public boolean apply(ObjectSourcePlayer<Permanent> input, Game game) {
|
||||
UUID playerId = (UUID) game.getState().getValue(input.getSourceId() + "_" + game.getState().getZoneChangeCounter(input.getSourceId()) + "_chosenOpponent");
|
||||
return playerId != null && playerId.equals(game.getCombat().getDefendingPlayerId(input.getObject().getId(), game));
|
||||
}
|
||||
}
|
||||
|
||||
class BeckoningWillOWispEffect extends OneShotEffect {
|
||||
|
||||
BeckoningWillOWispEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "choose an opponent";
|
||||
}
|
||||
|
||||
private BeckoningWillOWispEffect(final BeckoningWillOWispEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public BeckoningWillOWispEffect copy() {
|
||||
return new BeckoningWillOWispEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = source.getSourcePermanentOrLKI(game);
|
||||
if (player == null || permanent == null) {
|
||||
return false;
|
||||
}
|
||||
TargetOpponent target = new TargetOpponent();
|
||||
target.setNotTarget(true);
|
||||
player.choose(outcome, target, source, game);
|
||||
Player chosenPlayer = game.getPlayer(target.getFirstTarget());
|
||||
if (chosenPlayer == null) {
|
||||
return false;
|
||||
}
|
||||
game.informPlayers(permanent.getName() + ": " + player.getLogName() + " has chosen " + chosenPlayer.getLogName());
|
||||
game.getState().setValue(permanent.getId() + "_" + permanent.getZoneChangeCounter(game) + "_chosenOpponent", chosenPlayer.getId());
|
||||
permanent.addInfo("chosen opponent", CardUtil.addToolTipMarkTags("Chosen player: " + chosenPlayer.getLogName()), game);
|
||||
return true;
|
||||
}
|
||||
}
|
|
@ -57,6 +57,7 @@ public final class CommanderLegendsBattleForBaldursGate extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Basilisk Collar", 300, Rarity.RARE, mage.cards.b.BasiliskCollar.class));
|
||||
cards.add(new SetCardInfo("Basilisk Gate", 346, Rarity.COMMON, mage.cards.b.BasiliskGate.class));
|
||||
cards.add(new SetCardInfo("Battle Angels of Tyr", 9, Rarity.MYTHIC, mage.cards.b.BattleAngelsOfTyr.class));
|
||||
cards.add(new SetCardInfo("Beckoning Will-o'-Wisp", 10, Rarity.UNCOMMON, mage.cards.b.BeckoningWillOWisp.class));
|
||||
cards.add(new SetCardInfo("Bhaal's Invoker", 163, Rarity.COMMON, mage.cards.b.BhaalsInvoker.class));
|
||||
cards.add(new SetCardInfo("Bhaal, Lord of Murder", 268, Rarity.RARE, mage.cards.b.BhaalLordOfMurder.class));
|
||||
cards.add(new SetCardInfo("Black Dragon Gate", 347, Rarity.COMMON, mage.cards.b.BlackDragonGate.class));
|
||||
|
|
Loading…
Reference in a new issue