mirror of
https://github.com/correl/mage.git
synced 2025-03-12 17:00:08 -09:00
[ROE] Aura Gnarlid, Grotag Siege-Runner, Kor Spiritdancer, Merfolk Observer
This commit is contained in:
parent
ef8a5eb281
commit
84894fbaad
5 changed files with 511 additions and 0 deletions
115
Mage.Sets/src/mage/sets/riseoftheeldrazi/AuraGnarlid.java
Normal file
115
Mage.Sets/src/mage/sets/riseoftheeldrazi/AuraGnarlid.java
Normal file
|
@ -0,0 +1,115 @@
|
|||
/*
|
||||
* 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.sets.riseoftheeldrazi;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Duration;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.dynamicvalue.common.PermanentsOnBattlefieldCount;
|
||||
import mage.abilities.effects.RestrictionEffect;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public class AuraGnarlid extends CardImpl<AuraGnarlid> {
|
||||
|
||||
private static final FilterPermanent filter = new FilterPermanent("Aura on the battlefield");
|
||||
|
||||
static {
|
||||
filter.getSubtype().add("Aura");
|
||||
}
|
||||
|
||||
public AuraGnarlid(UUID ownerId) {
|
||||
super(ownerId, 175, "Aura Gnarlid", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{2}{G}");
|
||||
this.expansionSetCode = "ROE";
|
||||
this.subtype.add("Beast");
|
||||
|
||||
this.color.setGreen(true);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Creatures with power less than Aura Gnarlid's power can't block it.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new AuraGnarlidRestrictionEffect()));
|
||||
// Aura Gnarlid gets +1/+1 for each Aura on the battlefield.
|
||||
PermanentsOnBattlefieldCount count = new PermanentsOnBattlefieldCount(filter);
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(count, count, Duration.WhileOnBattlefield)));
|
||||
}
|
||||
|
||||
public AuraGnarlid(final AuraGnarlid card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public AuraGnarlid copy() {
|
||||
return new AuraGnarlid(this);
|
||||
}
|
||||
}
|
||||
|
||||
class AuraGnarlidRestrictionEffect extends RestrictionEffect<AuraGnarlidRestrictionEffect> {
|
||||
|
||||
public AuraGnarlidRestrictionEffect() {
|
||||
super(Duration.WhileOnBattlefield);
|
||||
staticText = "Creatures with power less than {this}'s power can't block it";
|
||||
}
|
||||
|
||||
public AuraGnarlidRestrictionEffect(final AuraGnarlidRestrictionEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
if (permanent.getId().equals(source.getSourceId())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean canBeBlocked(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
if (blocker.getPower().getValue() < attacker.getPower().getValue()) {
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public AuraGnarlidRestrictionEffect copy() {
|
||||
return new AuraGnarlidRestrictionEffect(this);
|
||||
}
|
||||
}
|
116
Mage.Sets/src/mage/sets/riseoftheeldrazi/GrotagSiegeRunner.java
Normal file
116
Mage.Sets/src/mage/sets/riseoftheeldrazi/GrotagSiegeRunner.java
Normal file
|
@ -0,0 +1,116 @@
|
|||
/*
|
||||
* 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.sets.riseoftheeldrazi;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Outcome;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.mana.ManaCostsImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.abilities.keyword.DefenderAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public class GrotagSiegeRunner extends CardImpl<GrotagSiegeRunner> {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("creature with defender");
|
||||
|
||||
static {
|
||||
filter.getAbilities().add(DefenderAbility.getInstance());
|
||||
}
|
||||
|
||||
public GrotagSiegeRunner(UUID ownerId) {
|
||||
super(ownerId, 149, "Grotag Siege-Runner", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{R}");
|
||||
this.expansionSetCode = "ROE";
|
||||
this.subtype.add("Goblin");
|
||||
this.subtype.add("Rogue");
|
||||
|
||||
this.color.setRed(true);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// {R}, Sacrifice Grotag Siege-Runner: Destroy target creature with defender. Grotag Siege-Runner deals 2 damage to that creature's controller.
|
||||
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DestroyTargetEffect(), new ManaCostsImpl("{R}"));
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||
ability.addEffect(new GrotageSiegeRunnerEffect());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public GrotagSiegeRunner(final GrotagSiegeRunner card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GrotagSiegeRunner copy() {
|
||||
return new GrotagSiegeRunner(this);
|
||||
}
|
||||
}
|
||||
|
||||
class GrotageSiegeRunnerEffect extends OneShotEffect<GrotageSiegeRunnerEffect> {
|
||||
|
||||
public GrotageSiegeRunnerEffect() {
|
||||
super(Outcome.Damage);
|
||||
this.staticText = "{this} deals 2 damage to that creature's controller";
|
||||
}
|
||||
|
||||
public GrotageSiegeRunnerEffect(final GrotageSiegeRunnerEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GrotageSiegeRunnerEffect copy() {
|
||||
return new GrotageSiegeRunnerEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = (Permanent) game.getLastKnownInformation(source.getFirstTarget(), Zone.BATTLEFIELD);
|
||||
if (permanent != null) {
|
||||
Player controller = game.getPlayer(permanent.getControllerId());
|
||||
controller.damage(2, source.getSourceId(), game, false, true);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
/*
|
||||
* 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.sets.riseoftheeldrazi;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Duration;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.common.SpellCastTriggeredAbility;
|
||||
import mage.abilities.dynamicvalue.common.AuraAttachedCount;
|
||||
import mage.abilities.effects.common.DrawCardControllerEffect;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.FilterCard;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public class KorSpiritdancer extends CardImpl<KorSpiritdancer> {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("an Aura spell");
|
||||
|
||||
static {
|
||||
filter.getSubtype().add("Aura");
|
||||
}
|
||||
|
||||
public KorSpiritdancer(UUID ownerId) {
|
||||
super(ownerId, 31, "Kor Spiritdancer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{1}{W}");
|
||||
this.expansionSetCode = "ROE";
|
||||
this.subtype.add("Kor");
|
||||
this.subtype.add("Wizard");
|
||||
|
||||
this.color.setWhite(true);
|
||||
this.power = new MageInt(0);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
// Kor Spiritdancer gets +2/+2 for each Aura attached to it.
|
||||
AuraAttachedCount count = new AuraAttachedCount(2);
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostSourceEffect(count, count, Duration.WhileOnBattlefield)));
|
||||
// Whenever you cast an Aura spell, you may draw a card.
|
||||
this.addAbility(new SpellCastTriggeredAbility(new DrawCardControllerEffect(1), filter, true));
|
||||
}
|
||||
|
||||
public KorSpiritdancer(final KorSpiritdancer card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public KorSpiritdancer copy() {
|
||||
return new KorSpiritdancer(this);
|
||||
}
|
||||
}
|
108
Mage.Sets/src/mage/sets/riseoftheeldrazi/MerfolkObserver.java
Normal file
108
Mage.Sets/src/mage/sets/riseoftheeldrazi/MerfolkObserver.java
Normal file
|
@ -0,0 +1,108 @@
|
|||
/*
|
||||
* 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.sets.riseoftheeldrazi;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Outcome;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardsImpl;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public class MerfolkObserver extends CardImpl<MerfolkObserver> {
|
||||
|
||||
public MerfolkObserver(UUID ownerId) {
|
||||
super(ownerId, 76, "Merfolk Observer", Rarity.COMMON, new CardType[]{CardType.CREATURE}, "{1}{U}");
|
||||
this.expansionSetCode = "ROE";
|
||||
this.subtype.add("Merfolk");
|
||||
this.subtype.add("Rogue");
|
||||
|
||||
this.color.setBlue(true);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(1);
|
||||
|
||||
// When Merfolk Observer enters the battlefield, look at the top card of target player's library.
|
||||
EntersBattlefieldTriggeredAbility ability = new EntersBattlefieldTriggeredAbility(new MerfolkObserverEffect());
|
||||
ability.addTarget(new TargetPlayer());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public MerfolkObserver(final MerfolkObserver card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MerfolkObserver copy() {
|
||||
return new MerfolkObserver(this);
|
||||
}
|
||||
}
|
||||
|
||||
class MerfolkObserverEffect extends OneShotEffect<MerfolkObserverEffect> {
|
||||
|
||||
public MerfolkObserverEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "look at the top card of target player's library";
|
||||
}
|
||||
|
||||
public MerfolkObserverEffect(final MerfolkObserverEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MerfolkObserverEffect copy() {
|
||||
return new MerfolkObserverEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
Player targetPlayer = game.getPlayer(source.getFirstTarget());
|
||||
if (player != null && targetPlayer != null) {
|
||||
Card card = targetPlayer.getLibrary().getFromTop(game);
|
||||
if (card != null) {
|
||||
CardsImpl cards = new CardsImpl();
|
||||
cards.add(card);
|
||||
player.lookAtCards("Merfolk Observer", cards, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
/*
|
||||
* 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.abilities.dynamicvalue.common;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.dynamicvalue.DynamicValue;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public class AuraAttachedCount implements DynamicValue {
|
||||
|
||||
private Integer amount;
|
||||
|
||||
public AuraAttachedCount() {
|
||||
this(1);
|
||||
}
|
||||
|
||||
public AuraAttachedCount(Integer amount) {
|
||||
this.amount = amount;
|
||||
}
|
||||
|
||||
public AuraAttachedCount(final AuraAttachedCount dynamicValue) {
|
||||
this.amount = dynamicValue.amount;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int calculate(Game game, Ability source) {
|
||||
int count = 0;
|
||||
Permanent p = game.getPermanent(source.getSourceId());
|
||||
if (p != null) {
|
||||
List<UUID> attachments = p.getAttachments();
|
||||
for (UUID attachmentId : attachments) {
|
||||
Permanent attached = game.getPermanent(attachmentId);
|
||||
if (attached != null && attached.getSubtype().contains("Aura")) {
|
||||
count++;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
return amount * count;
|
||||
}
|
||||
|
||||
@Override
|
||||
public DynamicValue clone() {
|
||||
return new AuraAttachedCount(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
if (amount != null) {
|
||||
return amount.toString();
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getMessage() {
|
||||
return "Aura attached to it";
|
||||
}
|
||||
}
|
Loading…
Add table
Reference in a new issue