mirror of
https://github.com/magefree/mage.git
synced 2026-01-10 21:02:08 -08:00
Implemented God-Eternal Bontu
This commit is contained in:
parent
a1875f824f
commit
09bf817f1a
3 changed files with 193 additions and 0 deletions
101
Mage.Sets/src/mage/cards/g/GodEternalBontu.java
Normal file
101
Mage.Sets/src/mage/cards/g/GodEternalBontu.java
Normal file
|
|
@ -0,0 +1,101 @@
|
|||
package mage.cards.g;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.EntersBattlefieldTriggeredAbility;
|
||||
import mage.abilities.common.GodEternalTriggeredAbility;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.MenaceAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.SubType;
|
||||
import mage.constants.SuperType;
|
||||
import mage.filter.FilterPermanent;
|
||||
import mage.filter.common.FilterControlledPermanent;
|
||||
import mage.filter.predicate.permanent.AnotherPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.Target;
|
||||
import mage.target.TargetPermanent;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public final class GodEternalBontu extends CardImpl {
|
||||
|
||||
public GodEternalBontu(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{B}");
|
||||
|
||||
this.addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.ZOMBIE);
|
||||
this.subtype.add(SubType.GOD);
|
||||
this.power = new MageInt(5);
|
||||
this.toughness = new MageInt(6);
|
||||
|
||||
// Menace
|
||||
this.addAbility(new MenaceAbility());
|
||||
|
||||
// When God-Eternal Bontu enters the battlefield, sacrifice any number of other permanents, then draw that many cards.
|
||||
this.addAbility(new EntersBattlefieldTriggeredAbility(new GodEternalBontuEffect()));
|
||||
|
||||
// When God-Eternal Bontu dies or is put into exile from the battlefield, you may put it into its owner's library third from the top.
|
||||
this.addAbility(new GodEternalTriggeredAbility());
|
||||
}
|
||||
|
||||
private GodEternalBontu(final GodEternalBontu card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GodEternalBontu copy() {
|
||||
return new GodEternalBontu(this);
|
||||
}
|
||||
}
|
||||
|
||||
class GodEternalBontuEffect extends OneShotEffect {
|
||||
|
||||
private static final FilterPermanent filter = new FilterControlledPermanent("other permanents you control");
|
||||
|
||||
static {
|
||||
filter.add(AnotherPredicate.instance);
|
||||
}
|
||||
|
||||
GodEternalBontuEffect() {
|
||||
super(Outcome.Benefit);
|
||||
staticText = "sacrifice any number of other permanents, then draw that many cards.";
|
||||
}
|
||||
|
||||
private GodEternalBontuEffect(final GodEternalBontuEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GodEternalBontuEffect copy() {
|
||||
return new GodEternalBontuEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
Target target = new TargetPermanent(0, Integer.MAX_VALUE, filter, true);
|
||||
if (!player.choose(outcome, target, source.getSourceId(), game)) {
|
||||
return false;
|
||||
}
|
||||
int counter = 0;
|
||||
for (UUID permanentId : target.getTargets()) {
|
||||
Permanent permanent = game.getPermanent(permanentId);
|
||||
if (permanent != null && permanent.sacrifice(source.getSourceId(), game)) {
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
return player.drawCards(counter, game) > 0;
|
||||
}
|
||||
}
|
||||
|
|
@ -85,6 +85,7 @@ public final class WarOfTheSpark extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Gleaming Overseer", 198, Rarity.UNCOMMON, mage.cards.g.GleamingOverseer.class));
|
||||
cards.add(new SetCardInfo("Goblin Assailant", 128, Rarity.COMMON, mage.cards.g.GoblinAssailant.class));
|
||||
cards.add(new SetCardInfo("Goblin Assault Team", 129, Rarity.COMMON, mage.cards.g.GoblinAssaultTeam.class));
|
||||
cards.add(new SetCardInfo("God-Eternal Bontu", 92, Rarity.MYTHIC, mage.cards.g.GodEternalBontu.class));
|
||||
cards.add(new SetCardInfo("God-Pharaoh's Statue", 238, Rarity.UNCOMMON, mage.cards.g.GodPharaohsStatue.class));
|
||||
cards.add(new SetCardInfo("Grateful Apparition", 17, Rarity.UNCOMMON, mage.cards.g.GratefulApparition.class));
|
||||
cards.add(new SetCardInfo("Grim Initiate", 130, Rarity.COMMON, mage.cards.g.GrimInitiate.class));
|
||||
|
|
|
|||
|
|
@ -0,0 +1,91 @@
|
|||
|
||||
package mage.abilities.common;
|
||||
|
||||
import mage.MageObjectReference;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.players.Player;
|
||||
|
||||
/**
|
||||
* @author TheElk801
|
||||
*/
|
||||
public class GodEternalTriggeredAbility extends TriggeredAbilityImpl {
|
||||
|
||||
public GodEternalTriggeredAbility() {
|
||||
super(Zone.ALL, null, true);
|
||||
}
|
||||
|
||||
private GodEternalTriggeredAbility(GodEternalTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
return zEvent.getFromZone() == Zone.BATTLEFIELD
|
||||
&& (zEvent.getToZone() == Zone.GRAVEYARD
|
||||
|| zEvent.getToZone() == Zone.EXILED);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
if (zEvent.getTargetId().equals(this.getSourceId())) {
|
||||
this.getEffects().clear();
|
||||
this.addEffect(new GodEternalEffect(new MageObjectReference(zEvent.getTarget(), game)));
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GodEternalTriggeredAbility copy() {
|
||||
return new GodEternalTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "When {this} dies or is put into exile from the battlefield, " +
|
||||
"you may put it into its owner's library third from the top.";
|
||||
}
|
||||
}
|
||||
|
||||
class GodEternalEffect extends OneShotEffect {
|
||||
|
||||
private final MageObjectReference mor;
|
||||
|
||||
GodEternalEffect(MageObjectReference mor) {
|
||||
super(Outcome.Benefit);
|
||||
this.mor = mor;
|
||||
}
|
||||
|
||||
private GodEternalEffect(final GodEternalEffect effect) {
|
||||
super(effect);
|
||||
this.mor = effect.mor;
|
||||
}
|
||||
|
||||
@Override
|
||||
public GodEternalEffect copy() {
|
||||
return new GodEternalEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player == null) {
|
||||
return false;
|
||||
}
|
||||
Card card = game.getCard(mor.getSourceId());
|
||||
if (card.getZoneChangeCounter(game) - 1 != mor.getZoneChangeCounter()) {
|
||||
return false;
|
||||
}
|
||||
return player.putCardOnTopXOfLibrary(card, game, source, 3);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue