mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
Merge origin/master
This commit is contained in:
commit
881661deb6
5 changed files with 207 additions and 16 deletions
|
@ -50,7 +50,7 @@ import mage.game.events.GameEvent;
|
|||
public class KruphixGodOfHorizons extends CardImpl {
|
||||
|
||||
public KruphixGodOfHorizons(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT,CardType.CREATURE},"{3}{G}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT, CardType.CREATURE}, "{3}{G}{U}");
|
||||
addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.GOD);
|
||||
|
||||
|
@ -86,7 +86,7 @@ class KruphixGodOfHorizonsEffect extends ReplacementEffectImpl {
|
|||
|
||||
public KruphixGodOfHorizonsEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Benefit);
|
||||
staticText = "If unused mana would empty from your mana pool, that mana becomes colorless instead";
|
||||
staticText = "If you would lose unspent mana, that mana becomes colorless instead.";
|
||||
}
|
||||
|
||||
public KruphixGodOfHorizonsEffect(final KruphixGodOfHorizonsEffect effect) {
|
||||
|
@ -108,13 +108,13 @@ class KruphixGodOfHorizonsEffect extends ReplacementEffectImpl {
|
|||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
@Override
|
||||
public boolean checksEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.EMPTY_MANA_POOL;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
return event.getPlayerId().equals(source.getControllerId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,7 +48,7 @@ import mage.players.Player;
|
|||
public class OmnathLocusOfMana extends CardImpl {
|
||||
|
||||
public OmnathLocusOfMana(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}");
|
||||
addSuperType(SuperType.LEGENDARY);
|
||||
this.subtype.add(SubType.ELEMENTAL);
|
||||
|
||||
|
@ -78,7 +78,7 @@ class OmnathRuleEffect extends ContinuousEffectImpl {
|
|||
|
||||
public OmnathRuleEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Detriment);
|
||||
staticText = "Green mana doesn't empty from your mana pool as steps and phases end";
|
||||
staticText = "You don’t lose unspent green mana as steps and phases end";
|
||||
}
|
||||
|
||||
public OmnathRuleEffect(final OmnathRuleEffect effect) {
|
||||
|
@ -93,10 +93,11 @@ class OmnathRuleEffect extends ContinuousEffectImpl {
|
|||
@Override
|
||||
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
||||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null){
|
||||
if (player != null) {
|
||||
player.getManaPool().addDoNotEmptyManaType(ManaType.GREEN);
|
||||
}
|
||||
return false; }
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
|
|
190
Mage.Sets/src/mage/cards/t/TogetherForever.java
Normal file
190
Mage.Sets/src/mage/cards/t/TogetherForever.java
Normal file
|
@ -0,0 +1,190 @@
|
|||
/*
|
||||
* 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.abilities.Ability;
|
||||
import mage.abilities.DelayedTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.keyword.SupportAbility;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.cards.CardSetInfo;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Duration;
|
||||
import mage.constants.Outcome;
|
||||
import mage.constants.Zone;
|
||||
import mage.counters.CounterType;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.filter.predicate.permanent.CounterPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.events.ZoneChangeEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author TheElk801, jeffwadsworth
|
||||
*/
|
||||
public class TogetherForever extends CardImpl {
|
||||
|
||||
private static final FilterCreaturePermanent filter = new FilterCreaturePermanent("");
|
||||
|
||||
static {
|
||||
filter.add(new CounterPredicate(CounterType.P1P1));
|
||||
}
|
||||
|
||||
public TogetherForever(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{W}{W}");
|
||||
|
||||
// When Together Forever enters the battlefield, support 2. (Put a +1/+1 counter on each of up to two other target creatures.)
|
||||
this.addAbility(new SupportAbility(this, 2));
|
||||
|
||||
// {1}: Choose target creature with a counter on it. When that creature dies this turn, return that card to its owner's hand.
|
||||
Ability ability = new SimpleActivatedAbility(new TogetherForeverEffect(), new GenericManaCost(1));
|
||||
ability.addTarget(new TargetCreaturePermanent(filter));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public TogetherForever(final TogetherForever card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TogetherForever copy() {
|
||||
return new TogetherForever(this);
|
||||
}
|
||||
}
|
||||
|
||||
class TogetherForeverEffect extends OneShotEffect {
|
||||
|
||||
public TogetherForeverEffect() {
|
||||
super(Outcome.Benefit);
|
||||
this.staticText = "Choose target creature with a counter on it. When that creature dies this turn, return that card to its owner's hand.";
|
||||
}
|
||||
|
||||
public TogetherForeverEffect(final TogetherForeverEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public TogetherForeverEffect copy() {
|
||||
return new TogetherForeverEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
DelayedTriggeredAbility delayedAbility = new TogetherForeverDelayedTriggeredAbility(targetPointer.getFirst(game, source));
|
||||
game.addDelayedTriggeredAbility(delayedAbility, source);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
class TogetherForeverDelayedTriggeredAbility extends DelayedTriggeredAbility {
|
||||
|
||||
private UUID target;
|
||||
|
||||
public TogetherForeverDelayedTriggeredAbility(UUID target) {
|
||||
super(new TogetherForeverDelayedEffect(target), Duration.EndOfTurn);
|
||||
this.target = target;
|
||||
}
|
||||
|
||||
public TogetherForeverDelayedTriggeredAbility(TogetherForeverDelayedTriggeredAbility ability) {
|
||||
super(ability);
|
||||
this.target = ability.target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkEventType(GameEvent event, Game game) {
|
||||
return event.getType() == GameEvent.EventType.ZONE_CHANGE;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getTargetId().equals(target)) {
|
||||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TogetherForeverDelayedTriggeredAbility copy() {
|
||||
return new TogetherForeverDelayedTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "When that creature dies this turn, return that card to its owner's hand";
|
||||
}
|
||||
}
|
||||
|
||||
class TogetherForeverDelayedEffect extends OneShotEffect {
|
||||
|
||||
private final UUID target;
|
||||
|
||||
public TogetherForeverDelayedEffect(UUID target) {
|
||||
super(Outcome.PutCreatureInPlay);
|
||||
this.target = target;
|
||||
this.staticText = "return that card to its owner's hand";
|
||||
}
|
||||
|
||||
public TogetherForeverDelayedEffect(final TogetherForeverDelayedEffect effect) {
|
||||
super(effect);
|
||||
this.target = effect.target;
|
||||
}
|
||||
|
||||
@Override
|
||||
public TogetherForeverDelayedEffect copy() {
|
||||
return new TogetherForeverDelayedEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
Permanent permanent = (Permanent) game.getLastKnownInformation(target, Zone.BATTLEFIELD);
|
||||
if (controller != null
|
||||
&& permanent != null) {
|
||||
Player player = game.getPlayer(permanent.getOwnerId());
|
||||
if (player != null) {
|
||||
Card card = game.getCard(target);
|
||||
if (card != null && game.getState().getZone(card.getId()) == Zone.GRAVEYARD) {
|
||||
return player.moveCards(card, Zone.HAND, source, game);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
|
@ -51,8 +51,7 @@ import mage.players.Player;
|
|||
public class Upwelling extends CardImpl {
|
||||
|
||||
public Upwelling(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{3}{G}");
|
||||
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{G}");
|
||||
|
||||
// Mana pools don't empty as steps and phases end.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new UpwellingRuleEffect()));
|
||||
|
@ -73,7 +72,7 @@ class UpwellingRuleEffect extends ContinuousEffectImpl {
|
|||
|
||||
public UpwellingRuleEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Detriment);
|
||||
staticText = "Mana pools don't empty as steps and phases end";
|
||||
staticText = "Players don’t lose unspent mana as steps and phases end";
|
||||
}
|
||||
|
||||
public UpwellingRuleEffect(final UpwellingRuleEffect effect) {
|
||||
|
@ -89,9 +88,9 @@ class UpwellingRuleEffect extends ContinuousEffectImpl {
|
|||
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
|
||||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
for (UUID playerId: game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
for (UUID playerId : game.getState().getPlayersInRange(controller.getId(), game)) {
|
||||
Player player = game.getPlayer(playerId);
|
||||
if (player != null){
|
||||
if (player != null) {
|
||||
ManaPool pool = player.getManaPool();
|
||||
pool.addDoNotEmptyManaType(ManaType.WHITE);
|
||||
pool.addDoNotEmptyManaType(ManaType.GREEN);
|
||||
|
@ -99,11 +98,11 @@ class UpwellingRuleEffect extends ContinuousEffectImpl {
|
|||
pool.addDoNotEmptyManaType(ManaType.RED);
|
||||
pool.addDoNotEmptyManaType(ManaType.BLACK);
|
||||
pool.addDoNotEmptyManaType(ManaType.COLORLESS);
|
||||
}
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -272,6 +272,7 @@ public class Battlebond extends ExpansionSet {
|
|||
cards.add(new SetCardInfo("Thrasher Brute", 52, Rarity.UNCOMMON, mage.cards.t.ThrasherBrute.class));
|
||||
cards.add(new SetCardInfo("Thunder Strike", 185, Rarity.COMMON, mage.cards.t.ThunderStrike.class));
|
||||
cards.add(new SetCardInfo("Tidespout Tyrant", 134, Rarity.RARE, mage.cards.t.TidespoutTyrant.class));
|
||||
cards.add(new SetCardInfo("Together Forever", 32, Rarity.RARE, mage.cards.t.TogetherForever.class));
|
||||
cards.add(new SetCardInfo("Toothy, Imaginary Friend", 12, Rarity.RARE, mage.cards.t.ToothyImaginaryFriend.class));
|
||||
cards.add(new SetCardInfo("Totally Lost", 135, Rarity.COMMON, mage.cards.t.TotallyLost.class));
|
||||
cards.add(new SetCardInfo("True-Name Nemesis", 136, Rarity.MYTHIC, mage.cards.t.TrueNameNemesis.class));
|
||||
|
|
Loading…
Reference in a new issue