mirror of
https://github.com/correl/mage.git
synced 2024-11-15 19:19:33 +00:00
[GTC] Aurelias Fury, Riot Gear, Armored Transport, Rust Scarab
This commit is contained in:
parent
d921b15dd0
commit
0b396252f1
4 changed files with 495 additions and 0 deletions
67
Mage.Sets/src/mage/sets/gatecrash/ArmoredTransport.java
Normal file
67
Mage.Sets/src/mage/sets/gatecrash/ArmoredTransport.java
Normal file
|
@ -0,0 +1,67 @@
|
||||||
|
/*
|
||||||
|
* 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.gatecrash;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
import mage.Constants;
|
||||||
|
import mage.Constants.CardType;
|
||||||
|
import mage.Constants.Duration;
|
||||||
|
import mage.Constants.Rarity;
|
||||||
|
import mage.MageInt;
|
||||||
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
import mage.abilities.effects.common.PreventCombatDamageSourceEffect;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author LevelX2
|
||||||
|
*/
|
||||||
|
public class ArmoredTransport extends CardImpl<ArmoredTransport> {
|
||||||
|
|
||||||
|
public ArmoredTransport(UUID ownerId) {
|
||||||
|
super(ownerId, 226, "Armored Transport", Rarity.COMMON, new CardType[]{CardType.ARTIFACT, CardType.CREATURE}, "{3}");
|
||||||
|
this.expansionSetCode = "GTC";
|
||||||
|
this.subtype.add("Construct");
|
||||||
|
|
||||||
|
this.power = new MageInt(2);
|
||||||
|
this.toughness = new MageInt(1);
|
||||||
|
|
||||||
|
// Prevent all combat damage that would be dealt to Armored Transport by creatures blocking it.
|
||||||
|
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new PreventCombatDamageSourceEffect(Duration.WhileOnBattlefield)));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public ArmoredTransport(final ArmoredTransport card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ArmoredTransport copy() {
|
||||||
|
return new ArmoredTransport(this);
|
||||||
|
}
|
||||||
|
}
|
237
Mage.Sets/src/mage/sets/gatecrash/AureliasFury.java
Normal file
237
Mage.Sets/src/mage/sets/gatecrash/AureliasFury.java
Normal file
|
@ -0,0 +1,237 @@
|
||||||
|
/*
|
||||||
|
* 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.gatecrash;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.UUID;
|
||||||
|
import mage.Constants;
|
||||||
|
import mage.Constants.CardType;
|
||||||
|
import mage.Constants.Outcome;
|
||||||
|
import mage.Constants.Rarity;
|
||||||
|
import mage.Constants.WatcherScope;
|
||||||
|
import mage.MageObject;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.dynamicvalue.DynamicValue;
|
||||||
|
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
|
||||||
|
import mage.abilities.effects.ContinuousEffect;
|
||||||
|
import mage.abilities.effects.OneShotEffect;
|
||||||
|
import mage.abilities.effects.ReplacementEffectImpl;
|
||||||
|
import mage.abilities.effects.common.DamageMultiEffect;
|
||||||
|
import mage.cards.Card;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.events.GameEvent;
|
||||||
|
import mage.game.events.GameEvent.EventType;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
import mage.game.stack.Spell;
|
||||||
|
import mage.players.Player;
|
||||||
|
import mage.target.common.TargetCreatureOrPlayerAmount;
|
||||||
|
import mage.target.targetpointer.FixedTarget;
|
||||||
|
import mage.watchers.WatcherImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* GATECRASH FAQ 11.01.2013
|
||||||
|
*
|
||||||
|
* You announce the value of X and how the damage will be divided as part of
|
||||||
|
* casting Aurelia's Fury. Each chosen target must receive at least 1 damage.
|
||||||
|
*
|
||||||
|
* Aurelia's Fury can't deal damage to both a planeswalker and that
|
||||||
|
* planeswalker's controller. If damage dealt by Aurelia's Fury is redirected
|
||||||
|
* from a player to a planeswalker he or she controls, that player will be able
|
||||||
|
* to cast noncreature spells that turn. If you want to stop a player from
|
||||||
|
* casting noncreature spells this turn, you can't choose to redirect the
|
||||||
|
* damage to a planeswalker he or she controls.
|
||||||
|
*
|
||||||
|
* If Aurelia's Fury has multiple targets, and some but not all of them are
|
||||||
|
* illegal targets when Aurelia's Fury resolves, Aurelia's Fury will still
|
||||||
|
* deal damage to the remaining legal targets according to the original damage
|
||||||
|
* division.
|
||||||
|
*
|
||||||
|
* If all of the targets are illegal when Aurelia's Fury tries to resolve,
|
||||||
|
* it will be countered and none of its effects will happen. No creature or
|
||||||
|
* player will be dealt damage.
|
||||||
|
*
|
||||||
|
* @author LevelX2
|
||||||
|
*/
|
||||||
|
public class AureliasFury extends CardImpl<AureliasFury> {
|
||||||
|
|
||||||
|
public AureliasFury(UUID ownerId) {
|
||||||
|
super(ownerId, 144, "Aurelia's Fury", Rarity.MYTHIC, new CardType[]{CardType.INSTANT}, "{X}{R}{W}");
|
||||||
|
this.expansionSetCode = "GTC";
|
||||||
|
|
||||||
|
this.color.setRed(true);
|
||||||
|
this.color.setWhite(true);
|
||||||
|
|
||||||
|
// Aurelia's Fury deals X damage divided as you choose among any number of target creatures and/or players.
|
||||||
|
// Tap each creature dealt damage this way. Players dealt damage this way can't cast noncreature spells this turn.
|
||||||
|
DynamicValue xValue = new ManacostVariableValue();
|
||||||
|
this.getSpellAbility().addEffect(new DamageMultiEffect(xValue));
|
||||||
|
this.getSpellAbility().addEffect(new AureliasFuryEffect());
|
||||||
|
this.getSpellAbility().addTarget(new TargetCreatureOrPlayerAmount(xValue));
|
||||||
|
this.addWatcher(new AureliasFuryDamagedByWatcher());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public AureliasFury(final AureliasFury card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AureliasFury copy() {
|
||||||
|
return new AureliasFury(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AureliasFuryEffect extends OneShotEffect<AureliasFuryEffect> {
|
||||||
|
|
||||||
|
public AureliasFuryEffect() {
|
||||||
|
super(Outcome.Benefit);
|
||||||
|
this.staticText = "Tap each creature dealt damage this way. Players dealt damage this way can't cast noncreature spells this turn";
|
||||||
|
}
|
||||||
|
|
||||||
|
public AureliasFuryEffect(final AureliasFuryEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AureliasFuryEffect copy() {
|
||||||
|
return new AureliasFuryEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
AureliasFuryDamagedByWatcher watcher = (AureliasFuryDamagedByWatcher) game.getState().getWatchers().get("AureliasFuryDamagedByWatcher", source.getSourceId());
|
||||||
|
if (watcher != null) {
|
||||||
|
for(UUID creatureId : watcher.damagedCreatures) {
|
||||||
|
Permanent permanent = game.getPermanent(creatureId);
|
||||||
|
if (permanent != null) {
|
||||||
|
permanent.tap(game);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for(UUID playerId : watcher.damagedPlayers) {
|
||||||
|
ContinuousEffect effect = new AureliasFuryCantCastEffect();
|
||||||
|
effect.setTargetPointer(new FixedTarget(playerId));
|
||||||
|
game.addEffect(effect, source);
|
||||||
|
}
|
||||||
|
watcher.reset();
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AureliasFuryCantCastEffect extends ReplacementEffectImpl<AureliasFuryCantCastEffect> {
|
||||||
|
|
||||||
|
public AureliasFuryCantCastEffect() {
|
||||||
|
super(Constants.Duration.EndOfTurn, Outcome.Benefit);
|
||||||
|
staticText = "Players dealt damage this way can't cast noncreature spells this turn";
|
||||||
|
}
|
||||||
|
|
||||||
|
public AureliasFuryCantCastEffect(final AureliasFuryCantCastEffect effect) {
|
||||||
|
super(effect);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AureliasFuryCantCastEffect copy() {
|
||||||
|
return new AureliasFuryCantCastEffect(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean apply(Game game, Ability source) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean replaceEvent(GameEvent event, Ability source, Game game) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||||
|
if (event.getType() == GameEvent.EventType.CAST_SPELL ) {
|
||||||
|
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||||
|
if (player != null && player.getId().equals(event.getPlayerId())) {
|
||||||
|
Card card = game.getCard(event.getSourceId());
|
||||||
|
if (card != null && !card.getCardType().contains(CardType.CREATURE)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class AureliasFuryDamagedByWatcher extends WatcherImpl<AureliasFuryDamagedByWatcher> {
|
||||||
|
|
||||||
|
public List<UUID> damagedCreatures = new ArrayList<UUID>();
|
||||||
|
public List<UUID> damagedPlayers = new ArrayList<UUID>();
|
||||||
|
|
||||||
|
public AureliasFuryDamagedByWatcher() {
|
||||||
|
super("AureliasFuryDamagedByWatcher", WatcherScope.CARD);
|
||||||
|
}
|
||||||
|
|
||||||
|
public AureliasFuryDamagedByWatcher(final AureliasFuryDamagedByWatcher watcher) {
|
||||||
|
super(watcher);
|
||||||
|
this.damagedCreatures = watcher.damagedCreatures;
|
||||||
|
this.damagedPlayers = watcher.damagedPlayers;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public AureliasFuryDamagedByWatcher copy() {
|
||||||
|
return new AureliasFuryDamagedByWatcher(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void watch(GameEvent event, Game game) {
|
||||||
|
if (event.getType() == EventType.DAMAGED_CREATURE) {
|
||||||
|
MageObject obj = game.getObject(event.getSourceId());
|
||||||
|
if (obj instanceof Spell) {
|
||||||
|
if (sourceId.equals(((Spell) obj).getSourceId()) && !damagedCreatures.contains(event.getTargetId())) {
|
||||||
|
damagedCreatures.add(event.getTargetId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (event.getType() == EventType.DAMAGED_PLAYER) {
|
||||||
|
MageObject obj = game.getObject(event.getSourceId());
|
||||||
|
if (obj instanceof Spell) {
|
||||||
|
if (sourceId.equals(((Spell) obj).getSourceId()) && !damagedPlayers.contains(event.getTargetId())) {
|
||||||
|
damagedPlayers.add(event.getTargetId());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void reset() {
|
||||||
|
super.reset();
|
||||||
|
damagedCreatures.clear();
|
||||||
|
damagedPlayers.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
66
Mage.Sets/src/mage/sets/gatecrash/RiotGear.java
Normal file
66
Mage.Sets/src/mage/sets/gatecrash/RiotGear.java
Normal file
|
@ -0,0 +1,66 @@
|
||||||
|
/*
|
||||||
|
* 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.gatecrash;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
import mage.Constants;
|
||||||
|
import mage.Constants.CardType;
|
||||||
|
import mage.Constants.Rarity;
|
||||||
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
|
import mage.abilities.effects.common.continious.BoostEquippedEffect;
|
||||||
|
import mage.abilities.keyword.EquipAbility;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author LevelX2
|
||||||
|
*/
|
||||||
|
public class RiotGear extends CardImpl<RiotGear> {
|
||||||
|
|
||||||
|
public RiotGear(UUID ownerId) {
|
||||||
|
super(ownerId, 236, "Riot Gear", Rarity.COMMON, new CardType[]{CardType.ARTIFACT}, "{2}");
|
||||||
|
this.expansionSetCode = "GTC";
|
||||||
|
this.subtype.add("Equipment");
|
||||||
|
|
||||||
|
// Equipped creature gets +1/+2.
|
||||||
|
this.addAbility(new SimpleStaticAbility(Constants.Zone.BATTLEFIELD, new BoostEquippedEffect(1, 2)));
|
||||||
|
|
||||||
|
// Equip {2}
|
||||||
|
this.addAbility(new EquipAbility(Constants.Outcome.BoostCreature, new GenericManaCost(2)));
|
||||||
|
}
|
||||||
|
|
||||||
|
public RiotGear(final RiotGear card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RiotGear copy() {
|
||||||
|
return new RiotGear(this);
|
||||||
|
}
|
||||||
|
}
|
125
Mage.Sets/src/mage/sets/gatecrash/RustScarab.java
Normal file
125
Mage.Sets/src/mage/sets/gatecrash/RustScarab.java
Normal file
|
@ -0,0 +1,125 @@
|
||||||
|
/*
|
||||||
|
* 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.gatecrash;
|
||||||
|
|
||||||
|
import java.util.UUID;
|
||||||
|
import mage.Constants;
|
||||||
|
import mage.Constants.CardType;
|
||||||
|
import mage.Constants.Rarity;
|
||||||
|
import mage.MageInt;
|
||||||
|
import mage.abilities.Ability;
|
||||||
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
|
import mage.abilities.effects.Effect;
|
||||||
|
import mage.abilities.effects.common.DestroyTargetEffect;
|
||||||
|
import mage.cards.CardImpl;
|
||||||
|
import mage.filter.FilterPermanent;
|
||||||
|
import mage.filter.predicate.Predicates;
|
||||||
|
import mage.filter.predicate.mageobject.CardTypePredicate;
|
||||||
|
import mage.filter.predicate.permanent.ControllerIdPredicate;
|
||||||
|
import mage.game.Game;
|
||||||
|
import mage.game.combat.CombatGroup;
|
||||||
|
import mage.game.events.GameEvent;
|
||||||
|
import mage.game.permanent.Permanent;
|
||||||
|
import mage.target.Target;
|
||||||
|
import mage.target.TargetPermanent;
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
* @author LevelX2
|
||||||
|
*/
|
||||||
|
public class RustScarab extends CardImpl<RustScarab> {
|
||||||
|
|
||||||
|
public RustScarab(UUID ownerId) {
|
||||||
|
super(ownerId, 130, "Rust Scarab", Rarity.UNCOMMON, new CardType[]{CardType.CREATURE}, "{4}{G}");
|
||||||
|
this.expansionSetCode = "GTC";
|
||||||
|
this.subtype.add("Insect");
|
||||||
|
|
||||||
|
this.color.setGreen(true);
|
||||||
|
this.power = new MageInt(4);
|
||||||
|
this.toughness = new MageInt(5);
|
||||||
|
|
||||||
|
// Whenever Rust Scarab becomes blocked, you may destroy target artifact or enchantment defending player controls.
|
||||||
|
Effect effect = new DestroyTargetEffect();
|
||||||
|
effect.setText("destroy target artifact or enchantment defending player controls");
|
||||||
|
this.addAbility(new BecomesBlockedTriggeredAbility(effect, true));
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void adjustTargets(Ability ability, Game game) {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public RustScarab(final RustScarab card) {
|
||||||
|
super(card);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public RustScarab copy() {
|
||||||
|
return new RustScarab(this);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class BecomesBlockedTriggeredAbility extends TriggeredAbilityImpl<BecomesBlockedTriggeredAbility> {
|
||||||
|
|
||||||
|
public BecomesBlockedTriggeredAbility(Effect effect, boolean optional) {
|
||||||
|
super(Constants.Zone.BATTLEFIELD, effect, optional);
|
||||||
|
}
|
||||||
|
|
||||||
|
public BecomesBlockedTriggeredAbility(final BecomesBlockedTriggeredAbility ability) {
|
||||||
|
super(ability);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
|
if (event.getType() == GameEvent.EventType.CREATURE_BLOCKED && event.getTargetId().equals(this.getSourceId())) {
|
||||||
|
UUID defenderId = game.getState().getCombat().findGroup(this.getSourceId()).getDefenderId();
|
||||||
|
if (defenderId != null) {
|
||||||
|
this.getTargets().clear();
|
||||||
|
FilterPermanent filter = new FilterPermanent("artifact or enchantment defending player controls");
|
||||||
|
filter.add(Predicates.or(new CardTypePredicate(CardType.ARTIFACT), new CardTypePredicate(CardType.ENCHANTMENT)));
|
||||||
|
filter.add(new ControllerIdPredicate(defenderId));
|
||||||
|
Target target = new TargetPermanent(filter);
|
||||||
|
this.addTarget(target);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getRule() {
|
||||||
|
return "Whenever {this} becomes blocked, " + super.getRule();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public BecomesBlockedTriggeredAbility copy() {
|
||||||
|
return new BecomesBlockedTriggeredAbility(this);
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in a new issue