mirror of
https://github.com/correl/mage.git
synced 2025-01-12 19:25:44 +00:00
Some minor changes/formatting to cards submitted by Quercitron.
This commit is contained in:
parent
c58ecf366b
commit
7f80bb0134
7 changed files with 38 additions and 102 deletions
|
@ -111,17 +111,17 @@ class BrowseEffect extends OneShotEffect<BrowseEffect> {
|
|||
if (player.choose(Outcome.Benefit, cards, target, game)) {
|
||||
Card card = cards.get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
card.moveToZone(Zone.HAND, source.getId(), game, false);
|
||||
card.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
cards.remove(card);
|
||||
}
|
||||
}
|
||||
|
||||
for (Card card : cards.getCards(game)) {
|
||||
card.moveToExile(null, null, source.getId(), game);
|
||||
card.moveToExile(null, null, source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,4 +112,4 @@ class DiminishingReturnsEffect extends OneShotEffect<DiminishingReturnsEffect> {
|
|||
public DiminishingReturnsEffect copy() {
|
||||
return new DiminishingReturnsEffect(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -52,7 +52,7 @@ public class PsychicTransfer extends CardImpl<PsychicTransfer> {
|
|||
|
||||
// If the difference between your life total and target player's life total is 5 or less, exchange life totals with that player.
|
||||
this.getSpellAbility().addEffect(new PsychicTransferEffect());
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
this.getSpellAbility().addTarget(new TargetPlayer(true));
|
||||
}
|
||||
|
||||
public PsychicTransfer(final PsychicTransfer card) {
|
||||
|
@ -70,7 +70,7 @@ class PsychicTransferEffect extends OneShotEffect<PsychicTransferEffect>
|
|||
|
||||
public PsychicTransferEffect() {
|
||||
super(Outcome.Neutral);
|
||||
this.staticText = "If the difference between your life total and target player's life total is 5 or less, exchange life totals with that player.";
|
||||
this.staticText = "If the difference between your life total and target player's life total is 5 or less, exchange life totals with that player";
|
||||
}
|
||||
|
||||
public PsychicTransferEffect(final PsychicTransferEffect effect) {
|
||||
|
@ -98,16 +98,12 @@ class PsychicTransferEffect extends OneShotEffect<PsychicTransferEffect>
|
|||
return false;
|
||||
}
|
||||
|
||||
if (!sourcePlayer.isLifeTotalCanChange() || !targetPlayer.isLifeTotalCanChange()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// 20110930 - 118.7, 118.8
|
||||
if (lifePlayer1 < lifePlayer2 && (!targetPlayer.isCanGainLife() || !targetPlayer.isCanLoseLife())) {
|
||||
if (lifePlayer1 < lifePlayer2 && (!sourcePlayer.isCanGainLife() || !targetPlayer.isCanLoseLife())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (lifePlayer1 > lifePlayer2 && (!targetPlayer.isCanLoseLife() || !targetPlayer.isCanGainLife())) {
|
||||
if (lifePlayer1 > lifePlayer2 && (!sourcePlayer.isCanLoseLife() || !targetPlayer.isCanGainLife())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
@ -117,4 +113,4 @@ class PsychicTransferEffect extends OneShotEffect<PsychicTransferEffect>
|
|||
}
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,9 +31,8 @@ import java.util.UUID;
|
|||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.PayLifeCost;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.costs.common.TapSourceCost;
|
||||
import mage.abilities.effects.common.CounterTargetEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
|
@ -54,9 +53,10 @@ public class UnyaroGriffin extends CardImpl<UnyaroGriffin> {
|
|||
private static final FilterSpell filter = new FilterSpell("red instant or sorcery spell");
|
||||
|
||||
static {
|
||||
filter.add(Predicates.and(new ColorPredicate(ObjectColor.RED),
|
||||
Predicates.or(new CardTypePredicate(CardType.INSTANT),
|
||||
new CardTypePredicate(CardType.SORCERY))));
|
||||
filter.add(new ColorPredicate(ObjectColor.RED));
|
||||
filter.add(Predicates.or(
|
||||
new CardTypePredicate(CardType.INSTANT),
|
||||
new CardTypePredicate(CardType.SORCERY)));
|
||||
}
|
||||
|
||||
public UnyaroGriffin(UUID ownerId) {
|
||||
|
@ -70,11 +70,10 @@ public class UnyaroGriffin extends CardImpl<UnyaroGriffin> {
|
|||
|
||||
// Flying
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
//
|
||||
|
||||
// Sacrifice Unyaro Griffin: Counter target red instant or sorcery spell.
|
||||
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
new mage.abilities.effects.common.CounterTargetEffect(),
|
||||
new SacrificeSourceCost());
|
||||
new CounterTargetEffect(), new SacrificeSourceCost());
|
||||
ability.addTarget(new TargetSpell(filter));
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
|
|
@ -96,14 +96,11 @@ class SunwebEffect extends RestrictionEffect<SunwebEffect> {
|
|||
|
||||
@Override
|
||||
public boolean canBlock(Permanent attacker, Permanent blocker, Ability source, Game game) {
|
||||
if (attacker != null) {
|
||||
return attacker.getPower().getValue() > 2;
|
||||
}
|
||||
return true;
|
||||
return attacker != null && attacker.getPower().getValue() > 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public SunwebEffect copy() {
|
||||
return new SunwebEffect(this);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,10 +28,12 @@
|
|||
package mage.sets.tempest;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.SpellAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.CostModificationEffectImpl;
|
||||
import mage.abilities.effects.common.cost.SpellsCostIncreasementAllEffect;
|
||||
import mage.abilities.keyword.FlashbackAbility;
|
||||
import mage.abilities.keyword.RetraceAbility;
|
||||
import mage.cards.Card;
|
||||
|
@ -42,6 +44,8 @@ import mage.constants.Duration;
|
|||
import mage.constants.Outcome;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.filter.FilterCard;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
import mage.game.Game;
|
||||
import mage.util.CardUtil;
|
||||
|
||||
|
@ -51,6 +55,11 @@ import mage.util.CardUtil;
|
|||
*/
|
||||
public class Chill extends CardImpl<Chill> {
|
||||
|
||||
private static final FilterCard filter = new FilterCard("Red spells");
|
||||
static {
|
||||
filter.add(new ColorPredicate(ObjectColor.RED));
|
||||
}
|
||||
|
||||
public Chill(UUID ownerId) {
|
||||
super(ownerId, 60, "Chill", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}");
|
||||
this.expansionSetCode = "TMP";
|
||||
|
@ -58,7 +67,7 @@ public class Chill extends CardImpl<Chill> {
|
|||
this.color.setBlue(true);
|
||||
|
||||
// Red spells cost {2} more to cast.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ChillCostIncreaseEffect()));
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new SpellsCostIncreasementAllEffect(filter, 2)));
|
||||
}
|
||||
|
||||
public Chill(final Chill card) {
|
||||
|
@ -70,37 +79,3 @@ public class Chill extends CardImpl<Chill> {
|
|||
return new Chill(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ChillCostIncreaseEffect extends CostModificationEffectImpl<ChillCostIncreaseEffect> {
|
||||
|
||||
ChillCostIncreaseEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.INCREASE_COST);
|
||||
staticText = "Red spells cost {2} more to cast.";
|
||||
}
|
||||
|
||||
ChillCostIncreaseEffect(ChillCostIncreaseEffect effect) {
|
||||
super(effect);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source, Ability abilityToModify) {
|
||||
CardUtil.increaseCost(abilityToModify, 2);
|
||||
return true;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
if (abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility || abilityToModify instanceof RetraceAbility) {
|
||||
Card card = game.getCard(abilityToModify.getSourceId());
|
||||
if (card != null && card.getColor().isRed()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ChillCostIncreaseEffect copy() {
|
||||
return new ChillCostIncreaseEffect(this);
|
||||
}
|
||||
}
|
|
@ -28,16 +28,14 @@
|
|||
package mage.sets.tempest;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.common.SpellCastOpponentTriggeredAbility;
|
||||
import mage.abilities.effects.common.GainLifeEffect;
|
||||
import mage.cards.Card;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.constants.CardType;
|
||||
import mage.constants.Rarity;
|
||||
import mage.constants.Zone;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
import mage.filter.FilterSpell;
|
||||
import mage.filter.predicate.mageobject.ColorPredicate;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -45,6 +43,11 @@ import mage.target.targetpointer.FixedTarget;
|
|||
*/
|
||||
public class Warmth extends CardImpl<Warmth> {
|
||||
|
||||
private static final FilterSpell filter = new FilterSpell("red spell");
|
||||
static {
|
||||
filter.add(new ColorPredicate(ObjectColor.RED));
|
||||
}
|
||||
|
||||
public Warmth(UUID ownerId) {
|
||||
super(ownerId, 263, "Warmth", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{W}");
|
||||
this.expansionSetCode = "TMP";
|
||||
|
@ -52,7 +55,7 @@ public class Warmth extends CardImpl<Warmth> {
|
|||
this.color.setWhite(true);
|
||||
|
||||
// Whenever an opponent casts a red spell, you gain 2 life.
|
||||
this.addAbility(new WarmthTriggeredAbility());
|
||||
this.addAbility(new SpellCastOpponentTriggeredAbility(new GainLifeEffect(2), filter, false));
|
||||
}
|
||||
|
||||
public Warmth(final Warmth card) {
|
||||
|
@ -64,37 +67,3 @@ public class Warmth extends CardImpl<Warmth> {
|
|||
return new Warmth(this);
|
||||
}
|
||||
}
|
||||
|
||||
class WarmthTriggeredAbility extends TriggeredAbilityImpl<WarmthTriggeredAbility> {
|
||||
|
||||
public WarmthTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new GainLifeEffect(2), false);
|
||||
}
|
||||
|
||||
public WarmthTriggeredAbility(final WarmthTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public WarmthTriggeredAbility copy() {
|
||||
return new WarmthTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.SPELL_CAST
|
||||
&& game.getOpponents(controllerId).contains(event.getPlayerId())) {
|
||||
Card card = game.getCard(event.getSourceId());
|
||||
if (card != null && card.getColor().isRed()) {
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever an opponent casts a red spell, you gain 2 life.";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue