mirror of
https://github.com/correl/mage.git
synced 2025-03-17 09:16:26 -09:00
Merge origin/master
This commit is contained in:
commit
16dc022018
3 changed files with 141 additions and 3 deletions
137
Mage.Sets/src/mage/cards/a/AzraBladeseeker.java
Normal file
137
Mage.Sets/src/mage/cards/a/AzraBladeseeker.java
Normal file
|
@ -0,0 +1,137 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
|
||||||
|
*
|
||||||
|
* Redistribution and use in source and binary forms, with or without modification, are
|
||||||
|
* permitted provided that the following conditions are met:
|
||||||
|
*
|
||||||
|
* 1. Redistributions of source code must retain the above copyright notice, this list of
|
||||||
|
* conditions and the following disclaimer.
|
||||||
|
*
|
||||||
|
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
|
||||||
|
* of conditions and the following disclaimer in the documentation and/or other materials
|
||||||
|
* provided with the distribution.
|
||||||
|
*
|
||||||
|
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
|
||||||
|
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
|
||||||
|
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
|
||||||
|
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
|
||||||
|
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
||||||
|
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||||
|
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
|
||||||
|
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
|
||||||
|
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
*
|
||||||
|
* The views and conclusions contained in the software and documentation are those of the
|
||||||
|
* authors and should not be interpreted as representing official policies, either expressed
|
||||||
|
* or implied, of BetaSteward_at_googlemail.com.
|
||||||
|
*/
|
||||||
|
package mage.cards.a;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
import mage.MageInt;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.cards.Card;
|
||||||
|
import mage.constants.SubType;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.cards.CardSetInfo;
|
||||||
|
import mage.constants.CardType;
|
||||||
|
import mage.constants.Outcome;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.players.Player;
|
||||||
|
import mage.target.Target;
|
||||||
|
import mage.target.common.TargetDiscard;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author TheElk801
|
||||||
|
*/
|
||||||
|
public class AzraBladeseeker extends CardImpl {
|
||||||
|
|
||||||
|
public AzraBladeseeker(UUID ownerId, CardSetInfo setInfo) {
|
||||||
|
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{R}");
|
||||||
|
|
||||||
|
this.subtype.add(SubType.AZRA);
|
||||||
|
this.subtype.add(SubType.WARRIOR);
|
||||||
|
this.power = new MageInt(3);
|
||||||
|
this.toughness = new MageInt(2);
|
||||||
|
|
||||||
|
// When Azra Bladeseeker enters the battlefield, each player on your team may discard a card, then each player who discarded a card this way draws a card.
|
||||||
|
this.addAbility(new EntersBattlefieldTriggeredAbility(new AzraBladeseekerEffect(), false));
|
||||||
|
}
|
||||||
|
|
||||||
|
public AzraBladeseeker(final AzraBladeseeker card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AzraBladeseeker copy() {
|
||||||
|
return new AzraBladeseeker(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AzraBladeseekerEffect extends OneShotEffect {
|
||||||
|
|
||||||
|
AzraBladeseekerEffect() {
|
||||||
|
super(Outcome.Benefit);
|
||||||
|
this.staticText = "each player on your team may discard a card, then each player who discarded a card this way draws a card";
|
||||||
|
}
|
||||||
|
|
||||||
|
AzraBladeseekerEffect(final AzraBladeseekerEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AzraBladeseekerEffect copy() {
|
||||||
|
return new AzraBladeseekerEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
List<PlayerCard> playerCardList = new ArrayList<>();
|
||||||
|
for (UUID playerId : game.getState().getPlayersInRange(source.getControllerId(), game)) {
|
||||||
|
Player player = game.getPlayer(playerId);
|
||||||
|
if (player == null
|
||||||
|
|| player.hasOpponent(source.getControllerId(), game)
|
||||||
|
|| player.getHand().isEmpty()
|
||||||
|
|| !player.chooseUse(Outcome.DrawCard, "Discard a card?", source, game)) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
Target target = new TargetDiscard(playerId);
|
||||||
|
if (target.choose(Outcome.DrawCard, playerId, source.getSourceId(), game)) {
|
||||||
|
Card card = game.getCard(target.getFirstTarget());
|
||||||
|
if (card != null) {
|
||||||
|
playerCardList.add(new PlayerCard(player, card));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (PlayerCard playerCard : playerCardList) {
|
||||||
|
if (playerCard.getPlayer().discard(playerCard.getCard(), source, game)) {
|
||||||
|
playerCard.getPlayer().drawCards(1, game);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
class PlayerCard {
|
||||||
|
|
||||||
|
private final Player player;
|
||||||
|
private final Card card;
|
||||||
|
|
||||||
|
private PlayerCard(Player player, Card card) {
|
||||||
|
this.player = player;
|
||||||
|
this.card = card;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Player getPlayer() {
|
||||||
|
return player;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Card getCard() {
|
||||||
|
return card;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -65,6 +65,7 @@ public class Battlebond extends ExpansionSet {
|
||||||
cards.add(new SetCardInfo("Assassinate", 139, Rarity.COMMON, mage.cards.a.Assassinate.class));
|
cards.add(new SetCardInfo("Assassinate", 139, Rarity.COMMON, mage.cards.a.Assassinate.class));
|
||||||
cards.add(new SetCardInfo("Auger Spree", 218, Rarity.COMMON, mage.cards.a.AugerSpree.class));
|
cards.add(new SetCardInfo("Auger Spree", 218, Rarity.COMMON, mage.cards.a.AugerSpree.class));
|
||||||
cards.add(new SetCardInfo("Aurora Champion", 24, Rarity.COMMON, mage.cards.a.AuroraChampion.class));
|
cards.add(new SetCardInfo("Aurora Champion", 24, Rarity.COMMON, mage.cards.a.AuroraChampion.class));
|
||||||
|
cards.add(new SetCardInfo("Azra Bladeseeker", 55, Rarity.COMMON, mage.cards.a.AzraBladeseeker.class));
|
||||||
cards.add(new SetCardInfo("Azra Oddsmaker", 75, Rarity.UNCOMMON, mage.cards.a.AzraOddsmaker.class));
|
cards.add(new SetCardInfo("Azra Oddsmaker", 75, Rarity.UNCOMMON, mage.cards.a.AzraOddsmaker.class));
|
||||||
cards.add(new SetCardInfo("Bathe in Dragonfire", 164, Rarity.COMMON, mage.cards.b.BatheInDragonfire.class));
|
cards.add(new SetCardInfo("Bathe in Dragonfire", 164, Rarity.COMMON, mage.cards.b.BatheInDragonfire.class));
|
||||||
cards.add(new SetCardInfo("Battle Mastery", 89, Rarity.UNCOMMON, mage.cards.b.BattleMastery.class));
|
cards.add(new SetCardInfo("Battle Mastery", 89, Rarity.UNCOMMON, mage.cards.b.BattleMastery.class));
|
||||||
|
|
|
@ -24,8 +24,7 @@
|
||||||
* The views and conclusions contained in the software and documentation are those of the
|
* The views and conclusions contained in the software and documentation are those of the
|
||||||
* authors and should not be interpreted as representing official policies, either expressed
|
* authors and should not be interpreted as representing official policies, either expressed
|
||||||
* or implied, of BetaSteward_at_googlemail.com.
|
* or implied, of BetaSteward_at_googlemail.com.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package mage.target.common;
|
package mage.target.common;
|
||||||
|
|
||||||
import mage.constants.Zone;
|
import mage.constants.Zone;
|
||||||
|
@ -36,6 +35,7 @@ import mage.game.Game;
|
||||||
import mage.target.TargetCard;
|
import mage.target.TargetCard;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
|
import mage.filter.StaticFilters;
|
||||||
import mage.filter.predicate.other.OwnerIdPredicate;
|
import mage.filter.predicate.other.OwnerIdPredicate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -47,7 +47,7 @@ public class TargetDiscard extends TargetCard {
|
||||||
private final UUID playerId;
|
private final UUID playerId;
|
||||||
|
|
||||||
public TargetDiscard(UUID playerId) {
|
public TargetDiscard(UUID playerId) {
|
||||||
this(1, 1, new FilterCard(), playerId);
|
this(1, 1, StaticFilters.FILTER_CARD, playerId);
|
||||||
}
|
}
|
||||||
|
|
||||||
public TargetDiscard(FilterCard filter, UUID playerId) {
|
public TargetDiscard(FilterCard filter, UUID playerId) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue