mirror of
https://github.com/magefree/mage.git
synced 2025-12-29 06:52:02 -08:00
[MOM] Implement Wrenn and Realmbreaker
This commit is contained in:
parent
372b088f2b
commit
4706b695e7
3 changed files with 135 additions and 0 deletions
|
|
@ -0,0 +1,61 @@
|
|||
package mage.game.command.emblems;
|
||||
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.AsThoughEffectImpl;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.AsThoughEffectType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.command.Emblem;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class WrennAndRealmbreakerEmblem extends Emblem {
|
||||
|
||||
// -7: You get an emblem with "You may play lands and cast permanent spells from your graveyard."
|
||||
public WrennAndRealmbreakerEmblem() {
|
||||
this.setName("Emblem Wrenn");
|
||||
this.setExpansionSetCodeForImage("MOM");
|
||||
this.getAbilities().add(new SimpleStaticAbility(Zone.COMMAND, new WrennAndRealmbreakerEmblemEffect()));
|
||||
}
|
||||
}
|
||||
|
||||
class WrennAndRealmbreakerEmblemEffect extends AsThoughEffectImpl {
|
||||
|
||||
public WrennAndRealmbreakerEmblemEffect() {
|
||||
super(AsThoughEffectType.PLAY_FROM_NOT_OWN_HAND_ZONE, Duration.WhileOnBattlefield, Outcome.Benefit);
|
||||
staticText = "you may play lands and cast permanent spells from your graveyard";
|
||||
}
|
||||
|
||||
public WrennAndRealmbreakerEmblemEffect(final WrennAndRealmbreakerEmblemEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public WrennAndRealmbreakerEmblemEffect copy() {
|
||||
return new WrennAndRealmbreakerEmblemEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(UUID objectId, Ability source, UUID affectedControllerId, Game game) {
|
||||
if (!source.isControlledBy(affectedControllerId)) {
|
||||
return false;
|
||||
}
|
||||
Card card = game.getCard(objectId);
|
||||
return card != null
|
||||
&& card.isPermanent(game)
|
||||
&& card.isOwnedBy(source.getControllerId())
|
||||
&& game.getState().getZone(objectId) == Zone.GRAVEYARD;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue