1
0
Fork 0
mirror of https://github.com/correl/mage.git synced 2025-03-30 09:08:36 -09:00

[OGW] Added Endbringer and UntapSourceDuringEachOtherPlayersUntapStepEffect.

This commit is contained in:
fireshoes 2015-12-19 22:45:59 -06:00
parent 29c78cf27e
commit aaa4857e43
3 changed files with 189 additions and 0 deletions
Mage.Sets/src/mage/sets/oathofthegatewatch
Mage/src/main/java/mage/abilities/effects/common/continuous
Utils

View file

@ -0,0 +1,90 @@
/*
* 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.sets.oathofthegatewatch;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.DamageTargetEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.combat.CantAttackBlockTargetEffect;
import mage.abilities.effects.common.continuous.UntapSourceDuringEachOtherPlayersUntapStepEffect;
import mage.cards.CardImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Rarity;
import mage.constants.Zone;
import mage.target.common.TargetCreatureOrPlayer;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author fireshoes
*/
public class Endbringer extends CardImpl {
public Endbringer(UUID ownerId) {
super(ownerId, 3, "Endbringer", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{5}{C}");
this.expansionSetCode = "OGW";
this.subtype.add("Eldrazi");
this.power = new MageInt(5);
this.toughness = new MageInt(5);
// Untap Endbringer during each other player's untap step.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new UntapSourceDuringEachOtherPlayersUntapStepEffect()));
// {T}: Endbringer deals 1 damage to target creature or player.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DamageTargetEffect(1), new TapSourceCost());
ability.addTarget(new TargetCreatureOrPlayer());
this.addAbility(ability);
// {C}, {T}: Target creature can't attack or block this turn.
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new CantAttackBlockTargetEffect(Duration.EndOfTurn), new ManaCostsImpl("{C}"));
ability.addCost(new TapSourceCost());
ability.addTarget(new TargetCreaturePermanent());
this.addAbility(ability);
// {C}{C}, {T}: Draw a card.
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new DrawCardSourceControllerEffect(1), new ManaCostsImpl("{C}{C}"));
ability.addCost(new TapSourceCost());
this.addAbility(ability);
}
public Endbringer(final Endbringer card) {
super(card);
}
@Override
public Endbringer copy() {
return new Endbringer(this);
}
}

View file

@ -0,0 +1,98 @@
/*
* 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.abilities.effects.common.continuous;
import mage.abilities.Ability;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.RestrictionEffect;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.PhaseStep;
import mage.constants.SubLayer;
import mage.game.Game;
import mage.game.permanent.Permanent;
/**
*
* @author fireshoes
*/
public class UntapSourceDuringEachOtherPlayersUntapStepEffect extends ContinuousEffectImpl {
public UntapSourceDuringEachOtherPlayersUntapStepEffect() {
super(Duration.WhileOnBattlefield, Outcome.Untap);
staticText = "Untap {this} during each other player's untap step";
}
public UntapSourceDuringEachOtherPlayersUntapStepEffect(final UntapSourceDuringEachOtherPlayersUntapStepEffect effect) {
super(effect);
}
@Override
public UntapSourceDuringEachOtherPlayersUntapStepEffect copy() {
return new UntapSourceDuringEachOtherPlayersUntapStepEffect(this);
}
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
Boolean applied = (Boolean) game.getState().getValue(source.getSourceId() + "applied");
if (applied == null) {
applied = Boolean.FALSE;
}
if (!applied && layer.equals(Layer.RulesEffects)) {
if (!source.getControllerId().equals(game.getActivePlayerId()) && game.getStep().getType() == PhaseStep.UNTAP) {
game.getState().setValue(source.getSourceId() + "applied", true);
Permanent permanent = (Permanent) game.getPermanent(source.getSourceId());
if (permanent != null) {
boolean untap = true;
for (RestrictionEffect effect : game.getContinuousEffects().getApplicableRestrictionEffects(permanent, game).keySet()) {
untap &= effect.canBeUntapped(permanent, source, game);
}
if (untap) {
permanent.untap(game);
}
}
}
} else if (applied && layer.equals(Layer.RulesEffects)) {
if (game.getStep().getType() == PhaseStep.END_TURN) {
game.getState().setValue(source.getSourceId() + "applied", false);
}
}
return true;
}
@Override
public boolean apply(Game game, Ability source) {
return false;
}
@Override
public boolean hasLayer(Layer layer) {
return layer == Layer.RulesEffects;
}
}

View file

@ -28241,6 +28241,7 @@ Mana Confluence|Zendikar Expeditions|42|M||Land|||{tap}, Pay 1 life: Add one man
Strip Mine|Zendikar Expeditions|43|M||Land|||{T}: Add {C} to your mana pool.${T}, Sacrifice Strip Mine: Destroy target land.|
Tectonic Edge|Zendikar Expeditions|44|M||Land|||{tap}: Add {C} to your mana pool.${1}, {tap}, Sacrifice Tectonic Edge: Destroy target nonbasic land. Activate this ability only if an opponent controls four or more lands.|
Wasteland|Zendikar Expeditions|45|M||Land|||{tap}: Add {C} to your mana pool.${tap}, Sacrifice Wasteland: Destroy target nonbasic land.|
Endbringer|Oath of the Gatewatch|3|R|{5}{C}|Creature - Eldrazi|5|5|Untap Endbringer during each other player's untap step.${T}: Endbringer deals 1 damage to target creature or player.${C}, {T}: Target creature can't attack or block this turn.${C}{C}, {T}: Draw a card.|
Kozilek, the Great Distortion|Oath of the Gatewatch|4|M|{8}{C}{C}|Legendary Creature - Eldrazi|12|12|When you cast Kozilek, the Great Distortion, if you have fewer than seven cards in hand, draw cards equal to the difference.$Menace$Discard a card with converted mana cost X: Counter target spell with converted mana cost X.|
Crush of Tentacles|Oath of the Gatewatch|53|M|{4}{U}{U}|Sorcery|||Surge {3}{U}{U} <i>(You may cast this spell for its surge cost if you or a teammate has cast another spell this turn.)</i>$Return all nonland permanents to their owners' hands. If Crush of Tentacles surge cost was paid, put an 8/8 blue Octopus creature token onto the battlefield.|
Sphinx of the Final Word|Oath of the Gatewatch|63|M|{5}{U}{U}|Creature - Sphinx|5|5|Sphinx of the Final Word can't be countered.$Flying, hexproof$Instant and sorcery spells you control can't be countered by spells or abilities.|