mirror of
https://github.com/correl/mage.git
synced 2024-12-26 03:00:11 +00:00
[C21] Implemented Monologue Tax
This commit is contained in:
parent
020ab525f3
commit
5702043eb7
2 changed files with 74 additions and 0 deletions
73
Mage.Sets/src/mage/cards/m/MonologueTax.java
Normal file
73
Mage.Sets/src/mage/cards/m/MonologueTax.java
Normal file
|
@ -0,0 +1,73 @@
|
|||
package mage.cards.m;
|
||||
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.token.TreasureToken;
|
||||
import mage.players.Player;
|
||||
import mage.watchers.common.CastSpellLastTurnWatcher;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class MonologueTax extends CardImpl {
|
||||
|
||||
public MonologueTax(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{W}");
|
||||
|
||||
// Whenever an opponent casts their second spell each turn, you create a Treasure token.
|
||||
this.addAbility(new MonologueTaxTriggeredAbility());
|
||||
}
|
||||
|
||||
private MonologueTax(final MonologueTax card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MonologueTax copy() {
|
||||
return new MonologueTax(this);
|
||||
}
|
||||
}
|
||||
|
||||
class MonologueTaxTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
MonologueTaxTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new CreateTokenEffect(new TreasureToken()));
|
||||
}
|
||||
|
||||
private MonologueTaxTriggeredAbility(final MonologueTaxTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.SPELL_CAST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Player player = game.getPlayer(getControllerId());
|
||||
CastSpellLastTurnWatcher watcher = game.getState().getWatcher(CastSpellLastTurnWatcher.class);
|
||||
return player != null
|
||||
&& watcher != null
|
||||
&& player.hasOpponent(event.getPlayerId(), game)
|
||||
&& watcher.getAmountOfSpellsPlayerCastOnCurrentTurn(event.getPlayerId()) == 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MonologueTaxTriggeredAbility copy() {
|
||||
return new MonologueTaxTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever an opponent casts their second spell each turn, you create a Treasure token.";
|
||||
}
|
||||
}
|
|
@ -22,5 +22,6 @@ public final class Commander2021Edition extends ExpansionSet {
|
|||
|
||||
cards.add(new SetCardInfo("Angel of the Ruins", 11, Rarity.RARE, mage.cards.a.AngelOfTheRuins.class));
|
||||
cards.add(new SetCardInfo("Excavation Technique", 16, Rarity.RARE, mage.cards.e.ExcavationTechnique.class));
|
||||
cards.add(new SetCardInfo("Monologue Tax", 19, Rarity.RARE, mage.cards.m.MonologueTax.class));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue