mirror of
https://github.com/correl/mage.git
synced 2024-12-25 03:00:15 +00:00
[40K] Implement The Lost and the Damned (#9648)
* [40K] Implement The Lost and the Damned Heavily inspired by Faldorn, but this triggers on "anywhere but hand" instead of "exile". * Add The Lost and the Damned to the 40k set. * Make Spawn tokens red, rather than colorless. * Add slightly-jank handling for lands and spells which you do not own, which cannot have been played from your hand and thus should trigger The Lost and the Damned. * Clean up land ownership check with proper method rather than just comparison.
This commit is contained in:
parent
b8ba92589b
commit
7cd97ffd02
3 changed files with 84 additions and 0 deletions
82
Mage.Sets/src/mage/cards/t/TheLostAndTheDamned.java
Normal file
82
Mage.Sets/src/mage/cards/t/TheLostAndTheDamned.java
Normal file
|
@ -0,0 +1,82 @@
|
|||
package mage.cards.t;
|
||||
|
||||
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.EntersTheBattlefieldEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.token.SpawnToken;
|
||||
import mage.game.stack.Spell;
|
||||
|
||||
import java.util.Optional;
|
||||
import java.util.UUID;
|
||||
|
||||
public final class TheLostAndTheDamned extends CardImpl {
|
||||
|
||||
public TheLostAndTheDamned(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}{R}");
|
||||
|
||||
// Whenever a land enters the battlefield under your control from anywhere other than your hand or you cast a spell from anywhere other than your hand, create 3/3 red Spawn creature token.
|
||||
this.addAbility(new TheLostAndTheDamnedTriggeredAbility());
|
||||
}
|
||||
|
||||
private TheLostAndTheDamned(final TheLostAndTheDamned card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TheLostAndTheDamned copy() {
|
||||
return new TheLostAndTheDamned(this);
|
||||
}
|
||||
}
|
||||
|
||||
class TheLostAndTheDamnedTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
TheLostAndTheDamnedTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new CreateTokenEffect(new SpawnToken()));
|
||||
setTriggerPhrase("Whenever a land enters the battlefield under your control from anywhere other than your hand or you cast a spell from anywhere other than your hand, ");
|
||||
}
|
||||
|
||||
private TheLostAndTheDamnedTriggeredAbility(final TheLostAndTheDamnedTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TheLostAndTheDamnedTriggeredAbility copy() {
|
||||
return new TheLostAndTheDamnedTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ENTERS_THE_BATTLEFIELD
|
||||
|| event.getType() == GameEvent.EventType.SPELL_CAST;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (!this.isControlledBy(event.getPlayerId())) {
|
||||
return false;
|
||||
}
|
||||
switch (event.getType()) {
|
||||
case ENTERS_THE_BATTLEFIELD:
|
||||
EntersTheBattlefieldEvent eEvent = (EntersTheBattlefieldEvent) event;
|
||||
return (!eEvent.getFromZone().match(Zone.HAND) || !(eEvent.getTarget().isOwnedBy(this.controllerId))) // if it's someone else's land, you can't have played it from your hand. This handles playing lands from opponent's hands.
|
||||
&& eEvent.getTarget().isLand(game);
|
||||
case SPELL_CAST:
|
||||
return (!Optional
|
||||
.ofNullable(game.getSpell(event.getTargetId()))
|
||||
.map(Spell::getFromZone)
|
||||
.orElse(Zone.ALL)
|
||||
.equals(Zone.HAND) || !Optional
|
||||
.ofNullable(game.getSpell(event.getTargetId()))
|
||||
.map(Spell::getOwnerId)
|
||||
.orElse(this.controllerId)
|
||||
.equals(this.controllerId)); // if it's someone else's spell, it can't have been in your hand. This handles playing spells from opponent's hands.
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -241,6 +241,7 @@ public final class Warhammer40000 extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Tervigon", 100, Rarity.RARE, mage.cards.t.Tervigon.class));
|
||||
cards.add(new SetCardInfo("The First Tyrannic War", 121, Rarity.RARE, mage.cards.t.TheFirstTyrannicWar.class));
|
||||
cards.add(new SetCardInfo("The Flesh Is Weak", 122, Rarity.RARE, mage.cards.t.TheFleshIsWeak.class));
|
||||
cards.add(new SetCardInfo("The Lost and the Damned", 129, Rarity.UNCOMMON, mage.cards.t.TheLostAndTheDamned.class));
|
||||
cards.add(new SetCardInfo("The Swarmlord", 4, Rarity.MYTHIC, mage.cards.t.TheSwarmlord.class));
|
||||
cards.add(new SetCardInfo("The War in Heaven", 69, Rarity.RARE, mage.cards.t.TheWarInHeaven.class));
|
||||
cards.add(new SetCardInfo("Their Name Is Death", 62, Rarity.RARE, mage.cards.t.TheirNameIsDeath.class));
|
||||
|
|
|
@ -12,6 +12,7 @@ public final class SpawnToken extends TokenImpl {
|
|||
public SpawnToken() {
|
||||
super("Spawn Token", "3/3 red Spawn creature token");
|
||||
cardType.add(CardType.CREATURE);
|
||||
color.setRed(true);
|
||||
this.subtype.add(SubType.SPAWN);
|
||||
power = new MageInt(3);
|
||||
toughness = new MageInt(3);
|
||||
|
|
Loading…
Reference in a new issue