mirror of
https://github.com/magefree/mage.git
synced 2025-12-20 02:30:08 -08:00
[TLA] Implement Planetarium of Wan Shi Tong
This commit is contained in:
parent
b7416356aa
commit
d4b8c75619
4 changed files with 132 additions and 0 deletions
122
Mage.Sets/src/mage/cards/p/PlanetariumOfWanShiTong.java
Normal file
122
Mage.Sets/src/mage/cards/p/PlanetariumOfWanShiTong.java
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
package mage.cards.p;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbility;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.keyword.ScryEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SuperType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.players.Player;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class PlanetariumOfWanShiTong extends CardImpl {
|
||||
|
||||
public PlanetariumOfWanShiTong(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{6}");
|
||||
|
||||
this.supertype.add(SuperType.LEGENDARY);
|
||||
|
||||
// {1}, {T}: Scry 2.
|
||||
Ability ability = new SimpleActivatedAbility(new ScryEffect(2), new GenericManaCost(1));
|
||||
ability.addCost(new TapSourceCost());
|
||||
this.addAbility(ability);
|
||||
|
||||
// Whenever you scry or surveil, look at the top card of your library. You may cast that card without paying its mana cost. Do this only once each turn.
|
||||
this.addAbility(new PlanetariumOfWanShiTongTriggeredAbility());
|
||||
}
|
||||
|
||||
private PlanetariumOfWanShiTong(final PlanetariumOfWanShiTong card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlanetariumOfWanShiTong copy() {
|
||||
return new PlanetariumOfWanShiTong(this);
|
||||
}
|
||||
}
|
||||
|
||||
class PlanetariumOfWanShiTongTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
PlanetariumOfWanShiTongTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new PlanetariumOfWanShiTongEffect());
|
||||
this.setTriggerPhrase("Whenever you scry or surveil, ");
|
||||
this.setDoOnlyOnceEachTurn(true);
|
||||
this.setOptional(false);
|
||||
}
|
||||
|
||||
private PlanetariumOfWanShiTongTriggeredAbility(final PlanetariumOfWanShiTongTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlanetariumOfWanShiTongTriggeredAbility copy() {
|
||||
return new PlanetariumOfWanShiTongTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
switch (event.getType()) {
|
||||
case SCRIED:
|
||||
case SURVEILED:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
return isControlledBy(event.getPlayerId());
|
||||
}
|
||||
}
|
||||
|
||||
class PlanetariumOfWanShiTongEffect extends OneShotEffect {
|
||||
|
||||
PlanetariumOfWanShiTongEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "look at the top card of your library. You may cast that card without paying its mana cost";
|
||||
}
|
||||
|
||||
private PlanetariumOfWanShiTongEffect(final PlanetariumOfWanShiTongEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public PlanetariumOfWanShiTongEffect copy() {
|
||||
return new PlanetariumOfWanShiTongEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
Card card = player.getLibrary().getFromTop(game);
|
||||
if (card == null) {
|
||||
return false;
|
||||
}
|
||||
player.lookAtCards("Top of library", card, game);
|
||||
if (!CardUtil.castSpellWithAttributesForFree(player, source, game, card)) {
|
||||
return false;
|
||||
}
|
||||
TriggeredAbility.setDidThisTurn(source, game);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
@ -147,6 +147,8 @@ public final class AvatarTheLastAirbender extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Plains", 282, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Plains", 287, Rarity.LAND, mage.cards.basiclands.Plains.class, FULL_ART_BFZ_VARIOUS));
|
||||
cards.add(new SetCardInfo("Plains", 292, Rarity.LAND, mage.cards.basiclands.Plains.class, FULL_ART_BFZ_VARIOUS));
|
||||
cards.add(new SetCardInfo("Planetarium of Wan Shi Tong", 259, Rarity.MYTHIC, mage.cards.p.PlanetariumOfWanShiTong.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Planetarium of Wan Shi Tong", 385, Rarity.MYTHIC, mage.cards.p.PlanetariumOfWanShiTong.class, NON_FULL_USE_VARIOUS));
|
||||
cards.add(new SetCardInfo("Pretending Poxbearers", 237, Rarity.COMMON, mage.cards.p.PretendingPoxbearers.class));
|
||||
cards.add(new SetCardInfo("Rabaroo Troop", 32, Rarity.COMMON, mage.cards.r.RabarooTroop.class));
|
||||
cards.add(new SetCardInfo("Ran and Shaw", 150, Rarity.RARE, mage.cards.r.RanAndShaw.class, NON_FULL_USE_VARIOUS));
|
||||
|
|
|
|||
|
|
@ -61,6 +61,8 @@ public interface TriggeredAbility extends Ability {
|
|||
*/
|
||||
int getRemainingTriggersLimitEachGame(Game game);
|
||||
|
||||
TriggeredAbility setOptional(boolean optional);
|
||||
|
||||
TriggeredAbility setDoOnlyOnceEachTurn(boolean doOnlyOnce);
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -209,6 +209,12 @@ public abstract class TriggeredAbilityImpl extends AbilityImpl implements Trigge
|
|||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TriggeredAbility setOptional(boolean optional) {
|
||||
this.optional = optional;
|
||||
return this;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TriggeredAbility withRuleTextReplacement(boolean replaceRuleText) {
|
||||
this.replaceRuleText = replaceRuleText;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue