diff --git a/Mage.Sets/src/mage/sets/Guru.java b/Mage.Sets/src/mage/sets/Guru.java index 2c02285e87..43fb8a1532 100644 --- a/Mage.Sets/src/mage/sets/Guru.java +++ b/Mage.Sets/src/mage/sets/Guru.java @@ -14,6 +14,6 @@ public class Guru extends ExpansionSet { private Guru() { //TODO find correct release date, wiki don't known anything about this expansion - super("Guru", "GUR", "", "mage.sets.guru", new GregorianCalendar(2000, 1, 1).getTime(), Constants.SetType.REPRINT); + super("Guru", "GUR", "", "mage.sets.guru", new GregorianCalendar(1990, 1, 2).getTime(), Constants.SetType.REPRINT); } } diff --git a/Mage.Sets/src/mage/sets/ravnika/SearingMeditation.java b/Mage.Sets/src/mage/sets/ravnika/SearingMeditation.java new file mode 100644 index 0000000000..a727a7392b --- /dev/null +++ b/Mage.Sets/src/mage/sets/ravnika/SearingMeditation.java @@ -0,0 +1,71 @@ +/* + * 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.ravnika; + +import java.util.UUID; + +import mage.Constants; +import mage.Constants.CardType; +import mage.Constants.Rarity; +import mage.abilities.Ability; +import mage.abilities.common.SimpleTriggeredAbility; +import mage.abilities.costs.mana.GenericManaCost; +import mage.abilities.effects.common.DamageTargetEffect; +import mage.abilities.effects.common.DoIfCostPaid; +import mage.cards.CardImpl; +import mage.game.events.GameEvent; +import mage.target.common.TargetCreatureOrPlayer; + +/** + * + * @author Loki + */ +public class SearingMeditation extends CardImpl { + + public SearingMeditation(UUID ownerId) { + super(ownerId, 226, "Searing Meditation", Rarity.RARE, new CardType[]{CardType.ENCHANTMENT}, "{1}{R}{W}"); + this.expansionSetCode = "RAV"; + + this.color.setRed(true); + this.color.setWhite(true); + + // Whenever you gain life, you may pay {2}. If you do, Searing Meditation deals 2 damage to target creature or player. + Ability ability = new SimpleTriggeredAbility(Constants.Zone.BATTLEFIELD, GameEvent.EventType.GAINED_LIFE, new DoIfCostPaid(new DamageTargetEffect(2), new GenericManaCost(2)), "Whenever you gain life, ", true); + ability.addTarget(new TargetCreatureOrPlayer()); + this.addAbility(ability); + } + + public SearingMeditation(final SearingMeditation card) { + super(card); + } + + @Override + public SearingMeditation copy() { + return new SearingMeditation(this); + } +} diff --git a/Mage/src/mage/abilities/common/SimpleTriggeredAbility.java b/Mage/src/mage/abilities/common/SimpleTriggeredAbility.java index 1b14f34656..26dc8d5155 100644 --- a/Mage/src/mage/abilities/common/SimpleTriggeredAbility.java +++ b/Mage/src/mage/abilities/common/SimpleTriggeredAbility.java @@ -41,22 +41,34 @@ import mage.game.events.GameEvent.EventType; */ public class SimpleTriggeredAbility extends TriggeredAbilityImpl { - EventType eventType; + private EventType eventType; + private boolean onlyController; + private String prefix; - public SimpleTriggeredAbility(Zone zone, EventType eventType, Effect effect) { - super(zone, effect); - this.eventType = eventType; + public SimpleTriggeredAbility(Zone zone, EventType eventType, Effect effect, String prefix) { + this(zone, eventType, effect, prefix, false); } + public SimpleTriggeredAbility(Zone zone, EventType eventType, Effect effect, String prefix, boolean onlyController) { + super(zone, effect); + this.eventType = eventType; + this.onlyController = onlyController; + this.prefix = prefix; + } + public SimpleTriggeredAbility(SimpleTriggeredAbility ability) { super(ability); this.eventType = ability.eventType; + this.onlyController = ability.onlyController; + this.prefix = ability.prefix; } @Override public boolean checkTrigger(GameEvent event, Game game) { if (event.getType() == eventType) { - return true; + if (!onlyController || event.getPlayerId().equals(this.controllerId)) { + return true; + } } return false; } @@ -65,4 +77,9 @@ public class SimpleTriggeredAbility extends TriggeredAbilityImpl