mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 03:51:58 -08:00
Merge branch 'master' of ssh://109.200.159.85/var/lib/git/mage.git
This commit is contained in:
commit
e92d3e146f
12 changed files with 561 additions and 35 deletions
1
.gitignore
vendored
1
.gitignore
vendored
|
|
@ -48,6 +48,7 @@ syntax: regexp
|
|||
\.iws
|
||||
\.log
|
||||
nbactions.xml
|
||||
nb-configuration.xml
|
||||
glob:Mage.Client/cheat.dck
|
||||
glob:Mage.Client/test.dck
|
||||
|
||||
|
|
|
|||
|
|
@ -39,12 +39,12 @@ import mage.abilities.effects.common.AttachEffect;
|
|||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.DamagedCreatureEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -97,14 +97,13 @@ class SpitefulShadowsTriggeredAbility extends TriggeredAbilityImpl<SpitefulShado
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
|
||||
Permanent enchantment = game.getPermanent(sourceId);
|
||||
if (enchantment != null && enchantment.getAttachedTo() != null) {
|
||||
if (event.getTargetId().equals(enchantment.getAttachedTo())) {
|
||||
UUID targetId = event.getTargetId();
|
||||
if (enchantment != null && enchantment.getAttachedTo() != null && targetId.equals(enchantment.getAttachedTo())) {
|
||||
this.getEffects().get(0).setValue("damageAmount", event.getAmount());
|
||||
this.getEffects().get(0).setValue("targetId", event.getTargetId());
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(targetId));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
|
@ -133,11 +132,12 @@ class SpitefulShadowsEffect extends OneShotEffect<SpitefulShadowsEffect> {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Integer damageAmount = (Integer) this.getValue("damageAmount");
|
||||
UUID targetId = (UUID) this.getValue("targetId");
|
||||
UUID targetId = this.targetPointer.getFirst(source);
|
||||
if (damageAmount != null && targetId != null) {
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent == null)
|
||||
if (permanent == null) {
|
||||
permanent = (Permanent) game.getLastKnownInformation(targetId, Zone.BATTLEFIELD);
|
||||
}
|
||||
if (permanent != null) {
|
||||
Player player = game.getPlayer(permanent.getControllerId());
|
||||
if (player != null) {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
package mage.sets.tenth;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.Constants;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
|
|
@ -38,6 +37,7 @@ import mage.abilities.effects.common.DrawCardControllerEffect;
|
|||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.players.Player;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
/**
|
||||
*
|
||||
|
|
@ -53,6 +53,7 @@ public class Peek extends CardImpl<Peek> {
|
|||
|
||||
// Look at target player's hand.
|
||||
this.getSpellAbility().addEffect(new PeekEffect());
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
// Draw a card.
|
||||
this.getSpellAbility().addEffect(new DrawCardControllerEffect(1));
|
||||
}
|
||||
|
|
|
|||
98
Mage.Sets/src/mage/sets/zendikar/GuulDrazSpecter.java
Normal file
98
Mage.Sets/src/mage/sets/zendikar/GuulDrazSpecter.java
Normal 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.sets.zendikar;
|
||||
|
||||
import java.util.Set;
|
||||
import java.util.UUID;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Duration;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.DealsCombatDamageToAPlayerTriggeredAbility;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.condition.Condition;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.common.DiscardTargetEffect;
|
||||
import mage.abilities.effects.common.continious.BoostSourceEffect;
|
||||
import mage.abilities.keyword.FlyingAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public class GuulDrazSpecter extends CardImpl<GuulDrazSpecter> {
|
||||
|
||||
private static final String ruleText = "{this} gets +3/+3 as long as an opponent has no cards in hand";
|
||||
|
||||
public GuulDrazSpecter(UUID ownerId) {
|
||||
super(ownerId, 92, "Guul Draz Specter", Rarity.RARE, new CardType[]{CardType.CREATURE}, "{2}{B}{B}");
|
||||
this.expansionSetCode = "ZEN";
|
||||
this.subtype.add("Specter");
|
||||
|
||||
this.color.setBlack(true);
|
||||
this.power = new MageInt(2);
|
||||
this.toughness = new MageInt(2);
|
||||
|
||||
this.addAbility(FlyingAbility.getInstance());
|
||||
// Guul Draz Specter gets +3/+3 as long as an opponent has no cards in hand.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ConditionalContinousEffect(
|
||||
new BoostSourceEffect(3, 3, Duration.WhileOnBattlefield),
|
||||
new GuulDrazSpecterCondition(),
|
||||
ruleText)));
|
||||
// Whenever Guul Draz Specter deals combat damage to a player, that player discards a card.
|
||||
this.addAbility(new DealsCombatDamageToAPlayerTriggeredAbility(new DiscardTargetEffect(1), false, true));
|
||||
}
|
||||
|
||||
public GuulDrazSpecter(final GuulDrazSpecter card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public GuulDrazSpecter copy() {
|
||||
return new GuulDrazSpecter(this);
|
||||
}
|
||||
}
|
||||
|
||||
class GuulDrazSpecterCondition implements Condition {
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
boolean result = false;
|
||||
|
||||
Set<UUID> opponents = game.getOpponents(source.getControllerId());
|
||||
for (UUID opponentId : opponents) {
|
||||
result |= game.getPlayer(opponentId).getHand().size() == 0;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
128
Mage.Sets/src/mage/sets/zendikar/MarshCasualties.java
Normal file
128
Mage.Sets/src/mage/sets/zendikar/MarshCasualties.java
Normal file
|
|
@ -0,0 +1,128 @@
|
|||
/*
|
||||
* 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.zendikar;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.UUID;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Duration;
|
||||
import mage.Constants.Layer;
|
||||
import mage.Constants.Outcome;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.SubLayer;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.condition.common.KickedCondition;
|
||||
import mage.abilities.costs.mana.KickerManaCost;
|
||||
import mage.abilities.decorator.ConditionalContinousEffect;
|
||||
import mage.abilities.effects.ContinuousEffectImpl;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.filter.common.FilterCreaturePermanent;
|
||||
import mage.game.Game;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPlayer;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public class MarshCasualties extends CardImpl<MarshCasualties> {
|
||||
|
||||
private static final String ruleText = "Creatures target player controls get -1/-1 until end of turn. If {this} was kicked, those creatures get -2/-2 until end of turn instead.";
|
||||
|
||||
public MarshCasualties(UUID ownerId) {
|
||||
super(ownerId, 101, "Marsh Casualties", Rarity.UNCOMMON, new CardType[]{CardType.SORCERY}, "{B}{B}");
|
||||
this.expansionSetCode = "ZEN";
|
||||
|
||||
this.color.setBlack(true);
|
||||
|
||||
// Kicker {3}
|
||||
this.getSpellAbility().addOptionalCost(new KickerManaCost("{3}"));
|
||||
// Creatures target player controls get -1/-1 until end of turn. If Marsh Casualties was kicked, those creatures get -2/-2 until end of turn instead.
|
||||
this.getSpellAbility().addEffect(new ConditionalContinousEffect(
|
||||
new MarshCasualtiesEffect(-2, -2),
|
||||
new MarshCasualtiesEffect(-1, -1),
|
||||
KickedCondition.getInstance(),
|
||||
ruleText));
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
}
|
||||
|
||||
public MarshCasualties(final MarshCasualties card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MarshCasualties copy() {
|
||||
return new MarshCasualties(this);
|
||||
}
|
||||
}
|
||||
|
||||
class MarshCasualtiesEffect extends ContinuousEffectImpl<MarshCasualtiesEffect> {
|
||||
|
||||
private int power;
|
||||
private int toughness;
|
||||
|
||||
public MarshCasualtiesEffect(int power, int toughness) {
|
||||
super(Duration.EndOfTurn, Layer.PTChangingEffects_7, SubLayer.ModifyPT_7c, Outcome.BoostCreature);
|
||||
this.power = power;
|
||||
this.toughness = toughness;
|
||||
}
|
||||
|
||||
public MarshCasualtiesEffect(final MarshCasualtiesEffect effect) {
|
||||
super(effect);
|
||||
this.power = effect.power;
|
||||
this.toughness = effect.toughness;
|
||||
}
|
||||
|
||||
@Override
|
||||
public MarshCasualtiesEffect copy() {
|
||||
return new MarshCasualtiesEffect(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void init(Ability source, Game game) {
|
||||
super.init(source, game);
|
||||
if (this.affectedObjectsSet) {
|
||||
List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getFirstTarget());
|
||||
for (Permanent creature : creatures) {
|
||||
objects.add(creature.getId());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), source.getFirstTarget());
|
||||
for (Permanent creature : creatures) {
|
||||
if (!this.affectedObjectsSet || objects.contains(creature.getId())) {
|
||||
creature.addPower(power);
|
||||
creature.addToughness(toughness);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
113
Mage.Sets/src/mage/sets/zendikar/MireBlight.java
Normal file
113
Mage.Sets/src/mage/sets/zendikar/MireBlight.java
Normal file
|
|
@ -0,0 +1,113 @@
|
|||
/*
|
||||
* 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.zendikar;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Outcome;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.Zone;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.effects.common.AttachEffect;
|
||||
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||
import mage.abilities.keyword.EnchantAbility;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.game.permanent.Permanent;
|
||||
import mage.target.TargetPermanent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
import mage.target.targetpointer.FixedTarget;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public class MireBlight extends CardImpl<MireBlight> {
|
||||
|
||||
public MireBlight(UUID ownerId) {
|
||||
super(ownerId, 104, "Mire Blight", Rarity.COMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}");
|
||||
this.expansionSetCode = "ZEN";
|
||||
this.subtype.add("Aura");
|
||||
|
||||
this.color.setBlack(true);
|
||||
|
||||
// Enchant creature
|
||||
TargetPermanent auraTarget = new TargetCreaturePermanent();
|
||||
this.getSpellAbility().addTarget(auraTarget);
|
||||
this.getSpellAbility().addEffect(new AttachEffect(Outcome.Detriment));
|
||||
Ability ability = new EnchantAbility(auraTarget.getTargetName());
|
||||
this.addAbility(ability);
|
||||
// When enchanted creature is dealt damage, destroy it.
|
||||
this.addAbility(new MireBlightTriggeredAbility());
|
||||
}
|
||||
|
||||
public MireBlight(final MireBlight card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MireBlight copy() {
|
||||
return new MireBlight(this);
|
||||
}
|
||||
}
|
||||
|
||||
class MireBlightTriggeredAbility extends TriggeredAbilityImpl<MireBlightTriggeredAbility> {
|
||||
|
||||
public MireBlightTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new DestroyTargetEffect());
|
||||
}
|
||||
|
||||
public MireBlightTriggeredAbility(final MireBlightTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public MireBlightTriggeredAbility copy() {
|
||||
return new MireBlightTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE) {
|
||||
Permanent enchantment = game.getPermanent(sourceId);
|
||||
UUID targetId = event.getTargetId();
|
||||
if (enchantment != null && enchantment.getAttachedTo() != null && targetId.equals(enchantment.getAttachedTo())) {
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(targetId));
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "When enchanted creature is dealt damage, destroy it.";
|
||||
}
|
||||
}
|
||||
109
Mage.Sets/src/mage/sets/zendikar/QuestForTheGemblades.java
Normal file
109
Mage.Sets/src/mage/sets/zendikar/QuestForTheGemblades.java
Normal file
|
|
@ -0,0 +1,109 @@
|
|||
/*
|
||||
* 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.zendikar;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.Zone;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.Game;
|
||||
import mage.game.events.DamagedCreatureEvent;
|
||||
import mage.game.events.GameEvent;
|
||||
import mage.target.common.TargetCreaturePermanent;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public class QuestForTheGemblades extends CardImpl<QuestForTheGemblades> {
|
||||
|
||||
public QuestForTheGemblades(UUID ownerId) {
|
||||
super(ownerId, 177, "Quest for the Gemblades", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{1}{G}");
|
||||
this.expansionSetCode = "ZEN";
|
||||
|
||||
this.color.setGreen(true);
|
||||
|
||||
// Whenever a creature you control deals combat damage to a creature, you may put a quest counter on Quest for the Gemblades.
|
||||
this.addAbility(new QuestForTheGembladesTriggeredAbility());
|
||||
// Remove a quest counter from Quest for the Gemblades and sacrifice it: Put four +1/+1 counters on target creature.
|
||||
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
new AddCountersTargetEffect(CounterType.P1P1.createInstance(4)),
|
||||
new RemoveCountersSourceCost(CounterType.QUEST.createInstance()));
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
ability.addTarget(new TargetCreaturePermanent());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public QuestForTheGemblades(final QuestForTheGemblades card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QuestForTheGemblades copy() {
|
||||
return new QuestForTheGemblades(this);
|
||||
}
|
||||
}
|
||||
|
||||
class QuestForTheGembladesTriggeredAbility extends TriggeredAbilityImpl<QuestForTheGembladesTriggeredAbility> {
|
||||
|
||||
public QuestForTheGembladesTriggeredAbility() {
|
||||
super(Zone.BATTLEFIELD, new AddCountersSourceEffect(CounterType.QUEST.createInstance()), true);
|
||||
}
|
||||
|
||||
public QuestForTheGembladesTriggeredAbility(final QuestForTheGembladesTriggeredAbility ability) {
|
||||
super(ability);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QuestForTheGembladesTriggeredAbility copy() {
|
||||
return new QuestForTheGembladesTriggeredAbility(this);
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.DAMAGED_CREATURE && event.getPlayerId().equals(controllerId)) {
|
||||
if (((DamagedCreatureEvent) event).isCombatDamage()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String getRule() {
|
||||
return "Whenever a creature you control deals combat damage to a creature, " + super.getRule();
|
||||
}
|
||||
}
|
||||
90
Mage.Sets/src/mage/sets/zendikar/QuestForTheGravelord.java
Normal file
90
Mage.Sets/src/mage/sets/zendikar/QuestForTheGravelord.java
Normal 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.zendikar;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.Constants.CardType;
|
||||
import mage.Constants.Rarity;
|
||||
import mage.Constants.Zone;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.common.CreatureDiesTriggeredAbility;
|
||||
import mage.abilities.common.SimpleActivatedAbility;
|
||||
import mage.abilities.costs.common.RemoveCountersSourceCost;
|
||||
import mage.abilities.costs.common.SacrificeSourceCost;
|
||||
import mage.abilities.effects.common.CreateTokenEffect;
|
||||
import mage.abilities.effects.common.counter.AddCountersSourceEffect;
|
||||
import mage.cards.CardImpl;
|
||||
import mage.counters.CounterType;
|
||||
import mage.game.permanent.token.Token;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author North
|
||||
*/
|
||||
public class QuestForTheGravelord extends CardImpl<QuestForTheGravelord> {
|
||||
|
||||
public QuestForTheGravelord(UUID ownerId) {
|
||||
super(ownerId, 108, "Quest for the Gravelord", Rarity.UNCOMMON, new CardType[]{CardType.ENCHANTMENT}, "{B}");
|
||||
this.expansionSetCode = "ZEN";
|
||||
|
||||
this.color.setBlack(true);
|
||||
|
||||
// Whenever a creature dies, you may put a quest counter on Quest for the Gravelord.
|
||||
this.addAbility(new CreatureDiesTriggeredAbility(new AddCountersSourceEffect(CounterType.QUEST.createInstance()), true));
|
||||
// Remove three quest counters from Quest for the Gravelord and sacrifice it: Put a 5/5 black Zombie Giant creature token onto the battlefield.
|
||||
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD,
|
||||
new CreateTokenEffect(new ZombieToken()),
|
||||
new RemoveCountersSourceCost(CounterType.QUEST.createInstance(3)));
|
||||
ability.addCost(new SacrificeSourceCost());
|
||||
this.addAbility(ability);
|
||||
}
|
||||
|
||||
public QuestForTheGravelord(final QuestForTheGravelord card) {
|
||||
super(card);
|
||||
}
|
||||
|
||||
@Override
|
||||
public QuestForTheGravelord copy() {
|
||||
return new QuestForTheGravelord(this);
|
||||
}
|
||||
}
|
||||
|
||||
class ZombieToken extends Token {
|
||||
|
||||
public ZombieToken() {
|
||||
super("Zombie Giant", "5/5 black Zombie Giant creature token");
|
||||
cardType.add(CardType.CREATURE);
|
||||
subtype.add("Zombie");
|
||||
subtype.add("Giant");
|
||||
|
||||
color = ObjectColor.BLACK;
|
||||
power = new MageInt(5);
|
||||
toughness = new MageInt(5);
|
||||
}
|
||||
}
|
||||
|
|
@ -53,6 +53,8 @@ import mage.target.common.TargetCardInLibrary;
|
|||
*/
|
||||
public class SadisticSacrament extends CardImpl<SadisticSacrament> {
|
||||
|
||||
private static final String ruleText = "Search target player's library for up to three cards, exile them, then that player shuffles his or her library. If {this} was kicked, instead search that player's library for up to fifteen cards, exile them, then that player shuffles his or her library";
|
||||
|
||||
public SadisticSacrament(UUID ownerId) {
|
||||
super(ownerId, 110, "Sadistic Sacrament", Rarity.RARE, new CardType[]{CardType.SORCERY}, "{B}{B}{B}");
|
||||
this.expansionSetCode = "ZEN";
|
||||
|
|
@ -67,7 +69,7 @@ public class SadisticSacrament extends CardImpl<SadisticSacrament> {
|
|||
new SadisticSacramentEffect(15),
|
||||
new SadisticSacramentEffect(3),
|
||||
KickedCondition.getInstance(),
|
||||
"Search target player's library for up to three cards, exile them, then that player shuffles his or her library. If Sadistic Sacrament was kicked, instead search that player's library for up to fifteen cards, exile them, then that player shuffles his or her library"));
|
||||
ruleText));
|
||||
this.getSpellAbility().addTarget(new TargetPlayer());
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -98,8 +98,12 @@ public class DiscardTargetEffect extends OneShotEffect<DiscardTargetEffect> {
|
|||
|
||||
@Override
|
||||
public String getText(Mode mode) {
|
||||
StringBuilder sb = new StringBuilder("Target ");
|
||||
sb.append(mode.getTargets().get(0).getTargetName());
|
||||
StringBuilder sb = new StringBuilder();
|
||||
if(mode.getTargets().isEmpty()){
|
||||
sb.append("that player");
|
||||
} else {
|
||||
sb.append("Target ").append(mode.getTargets().get(0).getTargetName());
|
||||
}
|
||||
sb.append(" discards ");
|
||||
sb.append(amount).append(" card");
|
||||
try {
|
||||
|
|
|
|||
|
|
@ -131,8 +131,6 @@ public class ReboundAbility extends TriggeredAbilityImpl<ReboundAbility> {
|
|||
*/
|
||||
class ReboundEffect extends OneShotEffect<ReboundEffect> {
|
||||
|
||||
private UUID originalId;
|
||||
|
||||
public ReboundEffect() {
|
||||
super(Outcome.Benefit);
|
||||
}
|
||||
|
|
@ -144,7 +142,7 @@ class ReboundEffect extends OneShotEffect<ReboundEffect> {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
Spell sourceSpell = (Spell)game.getObject(source.getId());
|
||||
if ( sourceSpell.isCopiedSpell() ) {
|
||||
if ( sourceSpell != null && sourceSpell.isCopiedSpell() ) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
|
|
@ -201,7 +199,7 @@ class ReboundCastFromHandReplacementEffect extends ReplacementEffectImpl<Rebound
|
|||
@Override
|
||||
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||
Spell sourceSpell = (Spell)game.getObject(source.getId());
|
||||
if ( sourceSpell.isCopiedSpell() ) {
|
||||
if ( sourceSpell != null && sourceSpell.isCopiedSpell() ) {
|
||||
return false;
|
||||
}
|
||||
else {
|
||||
|
|
|
|||
|
|
@ -1,18 +0,0 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project-shared-configuration>
|
||||
<!--
|
||||
This file contains additional configuration written by modules in the NetBeans IDE.
|
||||
The configuration is intended to be shared among all the users of project and
|
||||
therefore it is assumed to be part of version control checkout.
|
||||
Without this configuration present, some functionality in the IDE may be limited or fail altogether.
|
||||
-->
|
||||
<properties xmlns="http://www.netbeans.org/ns/maven-properties-data/1">
|
||||
<!--
|
||||
Properties that influence various parts of the IDE, especially code formatting and the like.
|
||||
You can copy and paste the single properties, into the pom.xml file and the IDE will pick them up.
|
||||
That way multiple projects can share the same settings (useful for formatting rules for example).
|
||||
Any value defined here will override the pom.xml file value but is only applicable to the current project.
|
||||
-->
|
||||
<netbeans.compile.on.save>app</netbeans.compile.on.save>
|
||||
</properties>
|
||||
</project-shared-configuration>
|
||||
Loading…
Add table
Add a link
Reference in a new issue