mirror of
https://github.com/magefree/mage.git
synced 2026-01-26 05:09:16 -08:00
[STX] Implemented Strixhaven Stadium
This commit is contained in:
parent
ae22f99b54
commit
a3bbc0b470
5 changed files with 162 additions and 53 deletions
|
|
@ -1,30 +1,31 @@
|
|||
|
||||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.DealsDamageToAPlayerAllTriggeredAbility;
|
||||
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.SetTargetPointer;
|
||||
import mage.constants.TargetController;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.DamagedPlayerEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.GameEvent.EventType;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.filter.StaticFilters;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Xavierv3131
|
||||
*/
|
||||
public final class CoastalPiracy extends CardImpl {
|
||||
|
||||
public CoastalPiracy(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{U}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}{U}");
|
||||
|
||||
// Whenever a creature you control deals combat damage to an opponent, you may draw a card.
|
||||
this.addAbility(new CoastalPiracyTriggeredAbility());
|
||||
this.addAbility(new DealsDamageToAPlayerAllTriggeredAbility(
|
||||
Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1),
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURE, true, SetTargetPointer.PLAYER,
|
||||
true, true, TargetController.OPPONENT
|
||||
));
|
||||
}
|
||||
|
||||
private CoastalPiracy(final CoastalPiracy card) {
|
||||
|
|
@ -36,43 +37,3 @@ public final class CoastalPiracy extends CardImpl {
|
|||
return new CoastalPiracy(this);
|
||||
}
|
||||
}
|
||||
|
||||
class CoastalPiracyTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public CoastalPiracyTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1));
|
||||
this.optional = true;
|
||||
}
|
||||
|
||||
public CoastalPiracyTriggeredAbility(final CoastalPiracyTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public CoastalPiracyTriggeredAbility copy() {
|
||||
return new CoastalPiracyTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (((DamagedPlayerEvent) event).isCombatDamage()
|
||||
&& game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
|
||||
Permanent creature = game.getPermanent(event.getSourceId());
|
||||
if (creature != null && creature.isControlledBy(controllerId)) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever a creature you control deals combat damage to an opponent, you may draw a card.";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
134
Mage.Sets/src/mage/cards/s/StrixhavenStadium.java
Normal file
134
Mage.Sets/src/mage/cards/s/StrixhavenStadium.java
Normal file
|
|
@ -0,0 +1,134 @@
|
|||
package mage.cards.s;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.DealsDamageToAPlayerAllTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.effects.common.counter.RemoveCounterSourceEffect;
|
||||
import mage.abilities.mana.ColorlessManaAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.*;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.StaticFilters;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.DamagedPlayerEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class StrixhavenStadium extends CardImpl {
|
||||
|
||||
public StrixhavenStadium(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{3}");
|
||||
|
||||
// {T}: Add {C}. Put a point counter on Strixhaven Stadium.
|
||||
Ability ability = new ColorlessManaAbility();
|
||||
ability.addEffect(new AddCountersSourceEffect(CounterType.POINT.createInstance()));
|
||||
this.addAbility(ability);
|
||||
|
||||
// Whenever a creature deals combat damage to you, remove a point counter from Strixhaven Stadium.
|
||||
this.addAbility(new StrixhavenStadiumTriggeredAbility());
|
||||
|
||||
// Whenever a creature you control deals combat damage to an opponent, put a point counter on Strixhaven Stadium. Then if it has ten or more point counters on it, remove them all and that player loses the game.
|
||||
ability = new DealsDamageToAPlayerAllTriggeredAbility(
|
||||
Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.POINT.createInstance()),
|
||||
StaticFilters.FILTER_CONTROLLED_CREATURE, false, SetTargetPointer.PLAYER,
|
||||
true, true, TargetController.OPPONENT
|
||||
);
|
||||
ability.addEffect(new StrixhavenStadiumEffect());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
private StrixhavenStadium(final StrixhavenStadium card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StrixhavenStadium copy() {
|
||||
return new StrixhavenStadium(this);
|
||||
}
|
||||
}
|
||||
|
||||
class StrixhavenStadiumTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
StrixhavenStadiumTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new RemoveCounterSourceEffect(CounterType.POINT.createInstance()));
|
||||
}
|
||||
|
||||
private StrixhavenStadiumTriggeredAbility(final StrixhavenStadiumTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StrixhavenStadiumTriggeredAbility copy() {
|
||||
return new StrixhavenStadiumTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
|
||||
Permanent sourcePermanent = game.getPermanent(event.getSourceId());
|
||||
return isControlledBy(damageEvent.getTargetId())
|
||||
&& damageEvent.isCombatDamage()
|
||||
&& sourcePermanent != null
|
||||
&& sourcePermanent.isCreature();
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever a creature deals combat damage to you, remove a point counter from {this}.";
|
||||
}
|
||||
}
|
||||
|
||||
class StrixhavenStadiumEffect extends OneShotEffect {
|
||||
|
||||
StrixhavenStadiumEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "Then if it has ten or more point counters on it, remove them all and that player loses the game";
|
||||
}
|
||||
|
||||
private StrixhavenStadiumEffect(final StrixhavenStadiumEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public StrixhavenStadiumEffect copy() {
|
||||
return new StrixhavenStadiumEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = source.getSourcePermanentIfItStillExists(game);
|
||||
boolean lki = false;
|
||||
if (permanent == null) {
|
||||
lki = true;
|
||||
permanent = source.getSourcePermanentOrLKI(game);
|
||||
}
|
||||
if (permanent == null || permanent.getCounters(game).getCount(CounterType.POINT) < 10) {
|
||||
return false;
|
||||
}
|
||||
if (!lki) {
|
||||
permanent.removeCounters(CounterType.POINT.createInstance(
|
||||
permanent.getCounters(game).getCount(CounterType.POINT)
|
||||
), source, game);
|
||||
}
|
||||
Player player = game.getPlayer(targetPointer.getFirst(game, source));
|
||||
if (player != null) {
|
||||
player.lost(game);
|
||||
return true;
|
||||
}
|
||||
return !lki;
|
||||
}
|
||||
}
|
||||
|
|
@ -263,6 +263,7 @@ public final class StrixhavenSchoolOfMages extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Stonebound Mentor", 239, Rarity.COMMON, mage.cards.s.StoneboundMentor.class));
|
||||
cards.add(new SetCardInfo("Stonerise Spirit", 32, Rarity.COMMON, mage.cards.s.StoneriseSpirit.class));
|
||||
cards.add(new SetCardInfo("Storm-Kiln Artist", 115, Rarity.UNCOMMON, mage.cards.s.StormKilnArtist.class));
|
||||
cards.add(new SetCardInfo("Strixhaven Stadium", 259, Rarity.RARE, mage.cards.s.StrixhavenStadium.class));
|
||||
cards.add(new SetCardInfo("Study Break", 34, Rarity.COMMON, mage.cards.s.StudyBreak.class));
|
||||
cards.add(new SetCardInfo("Sudden Breakthrough", 116, Rarity.COMMON, mage.cards.s.SuddenBreakthrough.class));
|
||||
cards.add(new SetCardInfo("Swamp", 370, Rarity.LAND, mage.cards.basiclands.Swamp.class, NON_FULL_USE_VARIOUS));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue