mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
[LTR] Implement Great Hall of the Citadel
This commit is contained in:
parent
f7baa2a338
commit
7f3b50f216
2 changed files with 90 additions and 0 deletions
89
Mage.Sets/src/mage/cards/g/GreatHallOfTheCitadel.java
Normal file
89
Mage.Sets/src/mage/cards/g/GreatHallOfTheCitadel.java
Normal file
|
@ -0,0 +1,89 @@
|
|||
package mage.cards.g;
|
||||
|
||||
import mage.ConditionalMana;
|
||||
import mage.MageObject;
|
||||
import mage.Mana;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.costs.Cost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.abilities.mana.ConditionalAnyColorManaAbility;
|
||||
import mage.abilities.mana.builder.ConditionalManaBuilder;
|
||||
import mage.abilities.mana.conditional.ManaCondition;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.game.Game;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class GreatHallOfTheCitadel extends CardImpl {
|
||||
|
||||
public GreatHallOfTheCitadel(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
|
||||
|
||||
// {T}: Add {C}.
|
||||
this.addAbility(new ColorlessManaAbility());
|
||||
|
||||
// {1}, {T}: Add two mana in any combination of colors. Spend this mana only to cast legendary spells.
|
||||
Ability ability = new ConditionalAnyColorManaAbility(
|
||||
new GenericManaCost(1), 2, new GreatHallOfTheCitadelManaBuilder()
|
||||
);
|
||||
ability.addCost(new TapSourceCost());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private GreatHallOfTheCitadel(final GreatHallOfTheCitadel card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GreatHallOfTheCitadel copy() {
|
||||
return new GreatHallOfTheCitadel(this);
|
||||
}
|
||||
}
|
||||
|
||||
class GreatHallOfTheCitadelManaBuilder extends ConditionalManaBuilder {
|
||||
|
||||
@Override
|
||||
public ConditionalMana build(Object... options) {
|
||||
return new GreatHallOfTheCitadelConditionalMana(this.mana);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Spend this mana only to cast legendary spells";
|
||||
}
|
||||
}
|
||||
|
||||
class GreatHallOfTheCitadelConditionalMana extends ConditionalMana {
|
||||
|
||||
public GreatHallOfTheCitadelConditionalMana(Mana mana) {
|
||||
super(mana);
|
||||
staticText = "Spend this mana only to cast legendary spells";
|
||||
addCondition(new GreatHallOfTheCitadelManaCondition());
|
||||
}
|
||||
}
|
||||
|
||||
class GreatHallOfTheCitadelManaCondition extends ManaCondition implements Condition {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
if (source instanceof SpellAbility) {
|
||||
MageObject object = game.getObject(source);
|
||||
return object != null && object.isLegendary(game);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source, UUID originalId, Cost costsToPay) {
|
||||
return apply(game, source);
|
||||
}
|
||||
}
|
|
@ -100,6 +100,7 @@ public final class TheLordOfTheRingsTalesOfMiddleEarth extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Gollum's Bite", 85, Rarity.UNCOMMON, mage.cards.g.GollumsBite.class));
|
||||
cards.add(new SetCardInfo("Gollum, Patient Plotter", 84, Rarity.UNCOMMON, mage.cards.g.GollumPatientPlotter.class));
|
||||
cards.add(new SetCardInfo("Gothmog, Morgul Lieutenant", 87, Rarity.UNCOMMON, mage.cards.g.GothmogMorgulLieutenant.class));
|
||||
cards.add(new SetCardInfo("Great Hall of the Citadel", 254, Rarity.COMMON, mage.cards.g.GreatHallOfTheCitadel.class));
|
||||
cards.add(new SetCardInfo("Grey Havens Navigator", 53, Rarity.COMMON, mage.cards.g.GreyHavensNavigator.class));
|
||||
cards.add(new SetCardInfo("Grishnakh, Brash Instigator", 134, Rarity.UNCOMMON, mage.cards.g.GrishnakhBrashInstigator.class));
|
||||
cards.add(new SetCardInfo("Grond, the Gatebreaker", 89, Rarity.UNCOMMON, mage.cards.g.GrondTheGatebreaker.class));
|
||||
|
|
Loading…
Reference in a new issue