mirror of
https://github.com/correl/mage.git
synced 2024-12-25 11:11:16 +00:00
parent
0bc7008130
commit
a5d10d6a5d
2 changed files with 90 additions and 1 deletions
88
Mage.Sets/src/mage/cards/l/LiegeOfTheHollows.java
Normal file
88
Mage.Sets/src/mage/cards/l/LiegeOfTheHollows.java
Normal file
|
@ -0,0 +1,88 @@
|
|||
package mage.cards.l;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DiesTriggeredAbility;
|
||||
import mage.abilities.effects.Effect;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.CreateTokenTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.token.SquirrelToken;
|
||||
import mage.players.Player;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.util.ManaUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author arcox
|
||||
*/
|
||||
public final class LiegeOfTheHollows extends CardImpl {
|
||||
|
||||
public LiegeOfTheHollows(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{G}");
|
||||
this.subtype.add(SubType.SPIRIT);
|
||||
|
||||
this.power = new MageInt(3);
|
||||
this.toughness = new MageInt(4);
|
||||
|
||||
// When Liege of the Hollows dies, each player may pay any amount of mana.
|
||||
// Then each player creates a number of 1/1 green Squirrel creature tokens equal to the amount of mana they paid this way.
|
||||
this.addAbility(new DiesTriggeredAbility(new LiegeOfTheHollowsEffect()));
|
||||
}
|
||||
|
||||
public LiegeOfTheHollows(final LiegeOfTheHollows card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LiegeOfTheHollows copy() {
|
||||
return new LiegeOfTheHollows(this);
|
||||
}
|
||||
}
|
||||
|
||||
class LiegeOfTheHollowsEffect extends OneShotEffect {
|
||||
|
||||
public LiegeOfTheHollowsEffect() {
|
||||
super(Outcome.Detriment);
|
||||
this.staticText = "each player may pay any amount of mana. Then each player creates a number "
|
||||
+ "of 1/1 green Squirrel creature tokens equal to the amount of mana they paid this way";
|
||||
}
|
||||
|
||||
public LiegeOfTheHollowsEffect(final LiegeOfTheHollowsEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public LiegeOfTheHollowsEffect copy() {
|
||||
return new LiegeOfTheHollowsEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null) {
|
||||
int numSquirrels = ManaUtil.playerPaysXGenericMana(false, "Liege of the Hollows", player, source, game);
|
||||
if (numSquirrels > 0) {
|
||||
Effect effect = new CreateTokenTargetEffect(new SquirrelToken(), numSquirrels);
|
||||
effect.setTargetPointer(new FixedTarget(playerId));
|
||||
effect.apply(game, source);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// prevent undo
|
||||
controller.resetStoredBookmark(game);
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -114,6 +114,7 @@ public final class Weatherlight extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Kithkin Armor", 19, Rarity.COMMON, mage.cards.k.KithkinArmor.class));
|
||||
cards.add(new SetCardInfo("Lava Hounds", 109, Rarity.UNCOMMON, mage.cards.l.LavaHounds.class));
|
||||
cards.add(new SetCardInfo("Lava Storm", 110, Rarity.COMMON, mage.cards.l.LavaStorm.class));
|
||||
cards.add(new SetCardInfo("Liege of the Hollows", 131, Rarity.RARE, mage.cards.l.LiegeOfTheHollows.class));
|
||||
cards.add(new SetCardInfo("Llanowar Behemoth", 132, Rarity.UNCOMMON, mage.cards.l.LlanowarBehemoth.class));
|
||||
cards.add(new SetCardInfo("Llanowar Druid", 133, Rarity.COMMON, mage.cards.l.LlanowarDruid.class));
|
||||
cards.add(new SetCardInfo("Llanowar Sentinel", 134, Rarity.COMMON, mage.cards.l.LlanowarSentinel.class));
|
||||
|
|
Loading…
Reference in a new issue