Merge pull request #3534 from spjspj/master

Implement The Scorpion God (HOU)  + Fix for Unesh
This commit is contained in:
spjspj 2017-06-25 22:31:50 +10:00 committed by GitHub
commit e9a58a7fca
3 changed files with 174 additions and 2 deletions

View file

@ -0,0 +1,168 @@
/*
* Copyright 2010 BetaSteward_at_googlemail.com. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without modification, are
* permitted provided that the following conditions are met:
*
* 1. Redistributions of source code must retain the above copyright notice, this list of
* conditions and the following disclaimer.
*
* 2. Redistributions in binary form must reproduce the above copyright notice, this list
* of conditions and the following disclaimer in the documentation and/or other materials
* provided with the distribution.
*
* THIS SOFTWARE IS PROVIDED BY BetaSteward_at_googlemail.com ``AS IS'' AND ANY EXPRESS OR IMPLIED
* WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL BetaSteward_at_googlemail.com OR
* CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
* CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
* ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
* ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
* The views and conclusions contained in the software and documentation are those of the
* authors and should not be interpreted as representing official policies, either expressed
* or implied, of BetaSteward_at_googlemail.com.
*/
package mage.cards.t;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.DelayedTriggeredAbility;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.DiesTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.delayed.AtTheBeginOfNextEndStepDelayedTriggeredAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.ReturnToHandSourceEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SuperType;
import mage.constants.Zone;
import mage.counters.CounterType;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.predicate.permanent.AnotherPredicate;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.events.ZoneChangeEvent;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author spjspj
*/
public class TheScorpionGod extends CardImpl {
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("another target creature");
static {
filter.add(new AnotherPredicate());
}
public TheScorpionGod(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{B}{R}");
addSuperType(SuperType.LEGENDARY);
this.subtype.add("God");
this.power = new MageInt(6);
this.toughness = new MageInt(5);
// Whenever a creature with a -1/-1 counter on it dies, draw a card.
this.addAbility(new TheScorpionGodTriggeredAbility());
// {1}{B}{R}: Put a -1/-1 counter on another target creature.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new AddCountersTargetEffect(CounterType.M1M1.createInstance()), new ManaCostsImpl("{1}{B}{R}"));
ability.addTarget(new TargetCreaturePermanent(filter));
this.addAbility(ability);
// When The Scorpion God dies, return it to its owner's hand at the beginning of the next end step.
this.addAbility(new DiesTriggeredAbility(new TheScorpionGodEffect()));
}
public TheScorpionGod(final TheScorpionGod card) {
super(card);
}
@Override
public TheScorpionGod copy() {
return new TheScorpionGod(this);
}
}
class TheScorpionGodTriggeredAbility extends TriggeredAbilityImpl {
public TheScorpionGodTriggeredAbility() {
super(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), false);
}
public TheScorpionGodTriggeredAbility(TheScorpionGodTriggeredAbility ability) {
super(ability);
}
@Override
public TheScorpionGodTriggeredAbility copy() {
return new TheScorpionGodTriggeredAbility(this);
}
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.ZONE_CHANGE;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
Permanent permanent = zEvent.getTarget();
if (permanent != null
&& permanent.getCounters(game).containsKey(CounterType.M1M1)) {
return true;
}
}
return false;
}
@Override
public String getRule() {
return "Whenever a creature with a -1/-1 counter on it dies, draw a card.";
}
}
class TheScorpionGodEffect extends OneShotEffect {
private static final String effectText = "return it to its owner's hand";
TheScorpionGodEffect() {
super(Outcome.Benefit);
staticText = effectText;
}
TheScorpionGodEffect(TheScorpionGodEffect effect) {
super(effect);
}
@Override
public boolean apply(Game game, Ability source) {
// Create delayed triggered ability
Effect effect = new ReturnToHandSourceEffect(false, true);
effect.setText(staticText);
DelayedTriggeredAbility delayedAbility = new AtTheBeginOfNextEndStepDelayedTriggeredAbility(effect);
game.addDelayedTriggeredAbility(delayedAbility, source);
return true;
}
@Override
public TheScorpionGodEffect copy() {
return new TheScorpionGodEffect(this);
}
}

View file

@ -66,6 +66,10 @@ import mage.target.TargetCard;
public class UneshCriosphinxSovereign extends CardImpl {
private static final FilterCard filter = new FilterCard("Sphinx spells");
static {
filter.add(new SubtypePredicate(SubType.SPHINX));
}
public UneshCriosphinxSovereign(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{U}{U}");
@ -82,8 +86,7 @@ public class UneshCriosphinxSovereign extends CardImpl {
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostReductionControllerEffect(filter, 2)));
// Whenever Unesh, Criosphinx Sovereign or another Sphinx enters the battlefield under your control, reveal the top four cards of your library. An opponent seperates those cards into two piles. Put one pile into your hand and the other into your graveyard.
Ability ability = new UneshCriosphinxSovereignTriggeredAbility();
this.addAbility(ability);
this.addAbility(new UneshCriosphinxSovereignTriggeredAbility());
}
public UneshCriosphinxSovereign(final UneshCriosphinxSovereign card) {

View file

@ -95,6 +95,7 @@ public class HourOfDevastation extends ExpansionSet {
cards.add(new SetCardInfo("Solemnity", 22, Rarity.RARE, mage.cards.s.Solemnity.class));
cards.add(new SetCardInfo("Steadfast Sentinel", 24, Rarity.COMMON, mage.cards.s.SteadfastSentinel.class));
cards.add(new SetCardInfo("Supreme Will", 49, Rarity.UNCOMMON, mage.cards.s.SupremeWill.class));
cards.add(new SetCardInfo("The Scorpion God", 146, Rarity.MYTHIC, mage.cards.t.TheScorpionGod.class));
cards.add(new SetCardInfo("Torment of Hailfire", 77, Rarity.RARE, mage.cards.t.TormentOfHailfire.class));
cards.add(new SetCardInfo("Torment of Scarabs", 78, Rarity.UNCOMMON, mage.cards.t.TormentOfScarabs.class));
cards.add(new SetCardInfo("Torment of Venom", 79, Rarity.COMMON, mage.cards.t.TormentOfVenom.class));