[BFZ] Added Devoid and Ingest keywords.

This commit is contained in:
LevelX2 2015-08-28 16:51:37 +02:00
parent 423e1fd368
commit b6c3355329
5 changed files with 362 additions and 246 deletions

View file

@ -0,0 +1,41 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities.keyword;
import mage.ObjectColor;
import mage.abilities.common.SimpleStaticAbility;
import mage.constants.Zone;
/**
*
* @author LevelX2
*/
public class DevoidAbility extends SimpleStaticAbility {
public DevoidAbility(ObjectColor color) {
super(Zone.ALL, null);
color.setBlack(false);
color.setWhite(false);
color.setGreen(false);
color.setBlue(false);
color.setRed(false);
}
public DevoidAbility(final DevoidAbility ability) {
super(ability);
}
@Override
public DevoidAbility copy() {
return new DevoidAbility(this);
}
@Override
public String getRule() {
return "Devoid <i>(This card has no color.)<i/>";
}
}

View file

@ -0,0 +1,71 @@
/*
* To change this license header, choose License Headers in Project Properties.
* To change this template file, choose Tools | Templates
* and open the template in the editor.
*/
package mage.abilities.keyword;
import mage.abilities.Ability;
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.game.Game;
import mage.players.Player;
/**
*
* @author LevelX2
*/
public class IngestAbility extends DealsCombatDamageToAPlayerTriggeredAbility {
public IngestAbility() {
super(new IngestEffect(), false, true);
}
public IngestAbility(IngestAbility ability) {
super(ability);
}
@Override
public String getRule() {
return "Ingest (Whenever this creature deals combat damage to a player, that player exiles the top card of his or her library.)";
}
@Override
public IngestAbility copy() {
return new IngestAbility(this);
}
}
class IngestEffect extends OneShotEffect {
public IngestEffect() {
super(Outcome.Exile);
this.staticText = "that player exiles the top card of his or her library";
}
public IngestEffect(final IngestEffect effect) {
super(effect);
}
@Override
public IngestEffect copy() {
return new IngestEffect(this);
}
@Override
public boolean apply(Game game, Ability source) {
Player targetPlayer = game.getPlayer(getTargetPointer().getFirst(game, source));
if (targetPlayer != null) {
Card card = targetPlayer.getLibrary().getFromTop(game);
if (card != null) {
targetPlayer.moveCards(card, Zone.LIBRARY, Zone.EXILED, source, game);
}
return true;
}
return false;
}
}