Merge pull request #6 from magefree/master

Merge https://github.com/magefree/mage
This commit is contained in:
Zzooouhh 2017-09-26 14:11:35 +02:00 committed by GitHub
commit 9312f52614
119 changed files with 840 additions and 339 deletions

View file

@ -100,7 +100,7 @@ class AdaptiveAutomatonAddSubtypeEffect extends ContinuousEffectImpl {
Permanent permanent = game.getPermanent(source.getSourceId());
if (permanent != null) {
SubType subtype = (SubType) game.getState().getValue(permanent.getId() + "_type");
if (subtype != null && !permanent.getSubtype(game).contains(subtype)) {
if (subtype != null && !permanent.hasSubtype(subtype, game)) {
permanent.getSubtype(game).add(subtype);
}
}

View file

@ -27,11 +27,6 @@
*/
package mage.cards.a;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Map;
import java.util.Set;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
@ -40,13 +35,7 @@ import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.abilities.effects.common.continuous.GainControlTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.TargetController;
import mage.constants.WatcherScope;
import mage.constants.Zone;
import mage.constants.*;
import mage.filter.common.FilterCreaturePermanent;
import mage.filter.common.FilterNonlandPermanent;
import mage.filter.predicate.Predicate;
@ -59,6 +48,8 @@ import mage.game.permanent.Permanent;
import mage.target.common.TargetNonlandPermanent;
import mage.watchers.Watcher;
import java.util.*;
/**
*
* @author TheElk801
@ -129,11 +120,11 @@ class DamagedByPiratesWatcher extends Watcher {
if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
if (((DamagedPlayerEvent) event).isCombatDamage()) {
Permanent creature = game.getPermanentOrLKIBattlefield(event.getSourceId());
if (creature != null && creature.getSubtype(game).contains(SubType.PIRATE)) {
if (creature != null && creature.hasSubtype(SubType.PIRATE, game)) {
if (damageSourceIds.keySet().contains(event.getTargetId())) {
damageSourceIds.get(event.getTargetId()).add(creature.getId());
} else {
Set<UUID> creatureSet = new HashSet();
Set<UUID> creatureSet = new HashSet<>();
creatureSet.add(creature.getId());
damageSourceIds.put(event.getTargetId(), creatureSet);
}

View file

@ -27,7 +27,6 @@
*/
package mage.cards.a;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.EntersBattlefieldAllTriggeredAbility;
@ -42,6 +41,8 @@ import mage.game.permanent.token.CatToken;
import mage.game.permanent.token.Token;
import mage.players.Player;
import java.util.UUID;
/**
*
* @author Plopman
@ -95,7 +96,7 @@ class AjanisChosenEffect extends OneShotEffect {
Token token = new CatToken();
if (token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId())) {
Permanent enchantment = game.getPermanent(this.getTargetPointer().getFirst(game, source));
if (enchantment != null && enchantment.getSubtype(game).contains(SubType.AURA)) {
if (enchantment != null && enchantment.hasSubtype(SubType.AURA, game)) {
for (UUID tokenId : token.getLastAddedTokenIds()) {
Permanent tokenPermanent = game.getPermanent(tokenId);
if (tokenPermanent != null) {

View file

@ -47,23 +47,24 @@ import mage.filter.predicate.mageobject.CardTypePredicate;
/**
*
* @author noxx
*
*/
public class AlchemistsRefuge extends CardImpl {
private static final FilterCard filter = new FilterCard("nonland cards");
private static final FilterCard filter = new FilterCard("spells");
static {
filter.add(Predicates.not(new CardTypePredicate(CardType.LAND)));
}
public AlchemistsRefuge(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.LAND},"");
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
// {tap}: Add {C} to your mana pool.
this.addAbility(new ColorlessManaAbility());
// {G}{U}, {tap}: You may cast nonland cards this turn as though they had flash.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
// {G}{U}, {tap}: You may cast spells this turn as though they had flash.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD,
new AddContinuousEffectToGame(new CastAsThoughItHadFlashAllEffect(Duration.EndOfTurn, filter)),
new CompositeCost(new ManaCostsImpl("{G}{U}"), new TapSourceCost(), "{G}{U}, {T}")));
}

View file

@ -27,7 +27,6 @@
*/
package mage.cards.a;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.Mode;
import mage.abilities.common.AsEntersBattlefieldAbility;
@ -36,17 +35,14 @@ import mage.abilities.effects.common.ChooseCreatureTypeEffect;
import mage.abilities.effects.common.DontUntapInControllersUntapStepAllEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.constants.*;
import mage.filter.common.FilterCreaturePermanent;
import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author TheElk801
@ -95,7 +91,7 @@ class AnZerrinRuinsDontUntapEffect extends DontUntapInControllersUntapStepAllEff
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent != null && sourcePerm != null) {
SubType subtype = (SubType) game.getState().getValue(sourcePerm.getId() + "_type");
if (permanent.getSubtype(game).contains(subtype)) {
if (permanent.hasSubtype(subtype, game)) {
return true;
}
}

View file

@ -27,9 +27,6 @@
*/
package mage.cards.a;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.AsEntersBattlefieldAbility;
import mage.abilities.common.SimpleStaticAbility;
@ -38,13 +35,7 @@ import mage.abilities.effects.common.ChooseCreatureTypeEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.constants.*;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.game.Game;
import mage.game.permanent.Permanent;
@ -52,6 +43,10 @@ import mage.game.stack.Spell;
import mage.game.stack.StackObject;
import mage.players.Player;
import java.util.Iterator;
import java.util.List;
import java.util.UUID;
/**
*
* @author TheElk801
@ -102,7 +97,7 @@ class ConspyEffect extends ContinuousEffectImpl {
// in graveyard
for (UUID cardId : controller.getGraveyard()) {
Card card = game.getCard(cardId);
if (card.isCreature() && !card.getSubtype(game).contains(choice)) {
if (card.isCreature() && !card.hasSubtype(choice, game)) {
for (SubType s : card.getSubtype(game)) {
game.getState().getCreateCardAttribute(card).getSubtype().add(s);
}
@ -112,7 +107,7 @@ class ConspyEffect extends ContinuousEffectImpl {
// on Hand
for (UUID cardId : controller.getHand()) {
Card card = game.getCard(cardId);
if (card.isCreature() && !card.getSubtype(game).contains(choice)) {
if (card.isCreature() && !card.hasSubtype(choice, game)) {
for (SubType s : card.getSubtype(game)) {
game.getState().getCreateCardAttribute(card).getSubtype().add(s);
}
@ -121,7 +116,7 @@ class ConspyEffect extends ContinuousEffectImpl {
}
// in Exile
for (Card card : game.getState().getExile().getAllCards(game)) {
if (card.isCreature() && !card.getSubtype(game).contains(choice)) {
if (card.isCreature() && !card.hasSubtype(choice, game)) {
for (SubType s : card.getSubtype(game)) {
game.getState().getCreateCardAttribute(card).getSubtype().add(s);
}
@ -130,7 +125,7 @@ class ConspyEffect extends ContinuousEffectImpl {
}
// in Library (e.g. for Mystical Teachings)
for (Card card : controller.getLibrary().getCards(game)) {
if (card.getOwnerId().equals(controller.getId()) && card.isCreature() && !card.getSubtype(game).contains(choice)) {
if (card.getOwnerId().equals(controller.getId()) && card.isCreature() && !card.hasSubtype(choice, game)) {
for (SubType s : card.getSubtype(game)) {
game.getState().getCreateCardAttribute(card).getSubtype().add(s);
}
@ -141,7 +136,7 @@ class ConspyEffect extends ContinuousEffectImpl {
for (UUID commanderId : controller.getCommandersIds()) {
if (game.getState().getZone(commanderId) == Zone.COMMAND) {
Card card = game.getCard(commanderId);
if (card.isCreature() && !card.getSubtype(game).contains(choice)) {
if (card.isCreature() && !card.hasSubtype(choice, game)) {
for (SubType s : card.getSubtype(game)) {
game.getState().getCreateCardAttribute(card).getSubtype().add(s);
}
@ -155,7 +150,7 @@ class ConspyEffect extends ContinuousEffectImpl {
if (stackObject instanceof Spell
&& stackObject.getControllerId().equals(source.getControllerId())
&& stackObject.isCreature()
&& !stackObject.getSubtype(game).contains(choice)) {
&& !stackObject.hasSubtype(choice, game)) {
Card card = ((Spell) stackObject).getCard();
for (SubType s : card.getSubtype(game)) {
game.getState().getCreateCardAttribute(card).getSubtype().add(s);
@ -167,7 +162,7 @@ class ConspyEffect extends ContinuousEffectImpl {
List<Permanent> creatures = game.getBattlefield().getAllActivePermanents(
new FilterControlledCreaturePermanent(), source.getControllerId(), game);
for (Permanent creature : creatures) {
if (creature != null && !creature.getSubtype(game).contains(choice)) {
if (creature != null && !creature.hasSubtype(choice, game)) {
creature.getSubtype(game).add(choice);
}
}

View file

@ -27,8 +27,6 @@
*/
package mage.cards.a;
import java.util.List;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -41,6 +39,9 @@ import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.List;
import java.util.UUID;
/**
*
* @author North
@ -116,7 +117,7 @@ class ArmamentMasterEffect extends ContinuousEffectImpl {
List<UUID> attachments = p.getAttachments();
for (UUID attachmentId : attachments) {
Permanent attached = game.getPermanent(attachmentId);
if (attached != null && attached.getSubtype(game).contains(SubType.EQUIPMENT)) {
if (attached != null && attached.hasSubtype(SubType.EQUIPMENT, game)) {
count++;
}
}

View file

@ -87,7 +87,7 @@ class AshesOfTheFallenEffect extends ContinuousEffectImpl {
SubType subtype = (SubType) game.getState().getValue(permanent.getId() + "_type");
for (UUID cardId : controller.getGraveyard()) {
Card card = game.getCard(cardId);
if (card != null && card.isCreature() && !card.getSubtype(game).contains(subtype)) {
if (card != null && card.isCreature() && !card.hasSubtype(subtype, game)) {
game.getState().getCreateCardAttribute(card).getSubtype().add(subtype);
}
}

View file

@ -27,8 +27,6 @@
*/
package mage.cards.a;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.dynamicvalue.DynamicValue;
@ -46,6 +44,9 @@ import mage.game.permanent.Permanent;
import mage.target.TargetPermanent;
import mage.target.common.TargetCreaturePermanent;
import java.util.List;
import java.util.UUID;
/**
*
* @author spjspj
@ -101,7 +102,7 @@ class EnchantedCreatureAurasCount implements DynamicValue {
List<UUID> attachments = permanent.getAttachments();
for (UUID attachmentId : attachments) {
Permanent attached = game.getPermanent(attachmentId);
if (attached != null && attached.getSubtype(game).contains(SubType.AURA)) {
if (attached != null && attached.hasSubtype(SubType.AURA, game)) {
count++;
}

View file

@ -109,7 +109,7 @@ class BartelRuneaxeEffect extends ContinuousRuleModifyingEffectImpl {
public boolean applies(GameEvent event, Ability source, Game game) {
StackObject stackObject = (StackObject) game.getStack().getStackObject(event.getSourceId());
if (stackObject != null && event.getTargetId().equals(source.getSourceId())) {
if (stackObject.getSubtype(game).contains(SubType.AURA)) {
if (stackObject.hasSubtype(SubType.AURA, game)) {
return true;
}
}

View file

@ -95,7 +95,7 @@ class DestroyAllAttachedEquipmentEffect extends OneShotEffect {
List<UUID> attachments = new ArrayList<>(target.getAttachments());
for (UUID attachmentId : attachments) {
Permanent attachment = game.getPermanent(attachmentId);
if (attachment != null && attachment.getSubtype(game).contains(SubType.EQUIPMENT)) {
if (attachment != null && attachment.hasSubtype(SubType.EQUIPMENT, game)) {
attachment.destroy(source.getSourceId(), game, false);
}
}

View file

@ -43,6 +43,7 @@ import mage.constants.CardType;
import mage.constants.Outcome;
import mage.game.Game;
import mage.players.Player;
import mage.target.common.TargetOpponent;
/**
*
@ -55,6 +56,7 @@ public class BloodOath extends CardImpl {
// Choose a card type. Target opponent reveals his or her hand. Blood Oath deals 3 damage to that player for each card of the chosen type revealed this way.
this.getSpellAbility().addEffect(new BloodOathEffect());
this.getSpellAbility().addTarget(new TargetOpponent());
}
public BloodOath(final BloodOath card) {
@ -130,13 +132,14 @@ class BloodOathEffect extends OneShotEffect {
Cards hand = opponent.getHand();
opponent.revealCards(sourceObject.getIdName(), hand, game);
Set<Card> cards = hand.getCards(game);
int count = 0;
int damageToDeal = 0;
for (Card card : cards) {
if (card != null && card.getCardType().contains(type)) {
count += 1;
damageToDeal += 3;
}
}
opponent.damage(count * 3, source.getSourceId(), game, false, true);
game.informPlayers(sourceObject.getLogName() + " deals " + (damageToDeal == 0 ? "no" : "" + damageToDeal) + " damage to " + opponent.getLogName());
opponent.damage(damageToDeal, source.getSourceId(), game, false, true);
return true;
}
}

View file

@ -27,8 +27,6 @@
*/
package mage.cards.b;
import java.util.List;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfEndStepTriggeredAbility;
@ -47,6 +45,9 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.watchers.common.PermanentsSacrificedWatcher;
import java.util.List;
import java.util.UUID;
/**
* @author LevelX2
*/
@ -88,7 +89,7 @@ enum BriarbridgePatrolCondition implements Condition {
if (sacrificedPermanents != null && !sacrificedPermanents.isEmpty()) {
int amountOfClues = 0;
for (Permanent permanent : sacrificedPermanents) {
if (permanent.getSubtype(game).contains(SubType.CLUE)) {
if (permanent.hasSubtype(SubType.CLUE, game)) {
amountOfClues++;
}
}

View file

@ -88,7 +88,7 @@ class CopyEnchantmentEffect extends CopyPermanentEffect {
if (super.apply(game, source)) {
Permanent permanentToCopy = getBluePrintPermanent();
if (permanentToCopy != null) {
if (permanentToCopy.getSubtype(game).contains(SubType.AURA)) {
if (permanentToCopy.hasSubtype(SubType.AURA, game)) {
Target target = getBluePrintPermanent().getSpellAbility().getTargets().get(0);
Outcome auraOutcome = Outcome.BoostCreature;
Ability:

View file

@ -203,14 +203,14 @@ class CrypticGatewayEffect extends OneShotEffect {
List<SubtypePredicate> subtypes = new ArrayList<>();
for (SubType subtype : creature.getSubtype(game)) {
if (creature2.getSubtype(game).contains(subtype) || changeling2) {
if (creature2.hasSubtype(subtype, game) || changeling2) {
subtypes.add(new SubtypePredicate(subtype));
commonSubType = true;
}
}
for (SubType subtype : creature2.getSubtype(game)) {
if (creature.getSubtype(game).contains(subtype) || changeling) {
if (creature.hasSubtype(subtype, game) || changeling) {
subtypes.add(new SubtypePredicate(subtype));
commonSubType = true;
}

View file

@ -27,7 +27,6 @@
*/
package mage.cards.c;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.OnEventTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
@ -52,6 +51,8 @@ import mage.target.TargetPlayer;
import mage.target.common.TargetCardInLibrary;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
*
* @author BetaSteward
@ -107,7 +108,7 @@ class CurseOfMisfortunesEffect extends OneShotEffect {
// get the names of attached Curses
for (UUID attachmentId: targetPlayer.getAttachments()) {
Permanent attachment = game.getPermanent(attachmentId);
if (attachment != null && attachment.getSubtype(game).contains(SubType.CURSE)) {
if (attachment != null && attachment.hasSubtype(SubType.CURSE, game)) {
filter.add(Predicates.not(new NamePredicate(attachment.getName())));
}
}

View file

@ -136,7 +136,7 @@ class CursesAttachedCount implements DynamicValue {
if (player != null) {
for (UUID attachmentId: player.getAttachments()) {
Permanent attachment = game.getPermanent(attachmentId);
if (attachment != null && attachment.getSubtype(game).contains(SubType.CURSE))
if (attachment != null && attachment.hasSubtype(SubType.CURSE, game))
count++;
}
}

View file

@ -27,7 +27,6 @@
*/
package mage.cards.d;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.effects.common.TransformSourceEffect;
@ -42,6 +41,8 @@ import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import java.util.UUID;
/**
*
* @author fireshoes
@ -96,7 +97,7 @@ class DaringSleuthTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return event.getPlayerId().equals(this.getControllerId())
&& game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getSubtype(game).contains(SubType.CLUE);
&& game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).hasSubtype(SubType.CLUE, game);
}
@Override

View file

@ -27,7 +27,6 @@
*/
package mage.cards.d;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
@ -42,6 +41,8 @@ import mage.game.Game;
import mage.game.events.GameEvent;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author TheElk801
@ -90,7 +91,7 @@ class DauntingDefenderEffect extends PreventionEffectImpl {
public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getType() == GameEvent.EventType.DAMAGE_CREATURE) {
Permanent permanent = game.getPermanent(event.getTargetId());
if (permanent != null && permanent.getControllerId().equals(source.getControllerId()) && permanent.getSubtype(game).contains(SubType.CLERIC)) {
if (permanent != null && permanent.getControllerId().equals(source.getControllerId()) && permanent.hasSubtype(SubType.CLERIC, game)) {
return super.applies(event, source, game);
}
}

View file

@ -110,7 +110,7 @@ class AuraAttachedPredicate implements Predicate<Permanent> {
if (!uuid.equals(ownId)) {
Permanent attachment = game.getPermanent(uuid);
if (attachment != null
&& attachment.getSubtype(game).contains(SubType.AURA)) {
&& attachment.hasSubtype(SubType.AURA, game)) {
return true;
}
}

View file

@ -27,7 +27,6 @@
*/
package mage.cards.e;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.LandfallAbility;
@ -37,8 +36,8 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.filter.common.FilterPermanentCard;
import mage.filter.predicate.Predicates;
@ -48,6 +47,8 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCardInYourGraveyard;
import java.util.UUID;
/**
*
* @author LevelX2
@ -109,7 +110,7 @@ class EmeriaShepherdReturnToHandTargetEffect extends OneShotEffect {
return false;
}
Zone toZone = Zone.HAND;
if (triggeringLand.getSubtype(game).contains(SubType.PLAINS)
if (triggeringLand.hasSubtype(SubType.PLAINS, game)
&& controller.chooseUse(Outcome.PutCardInPlay, "Put the card to battlefield instead?", source, game)) {
toZone = Zone.BATTLEFIELD;
}

View file

@ -27,7 +27,6 @@
*/
package mage.cards.e;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -39,14 +38,12 @@ import mage.abilities.effects.common.continuous.BoostSourceEffect;
import mage.abilities.keyword.BestowAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.constants.*;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author Quercitron
@ -98,7 +95,7 @@ class EverflameEidolonEffect extends OneShotEffect {
public boolean apply(Game game, Ability source) {
Permanent sourceObject = game.getPermanentOrLKIBattlefield(source.getSourceId());
if (sourceObject != null) {
if (sourceObject.getSubtype(game).contains(SubType.AURA)) {
if (sourceObject.hasSubtype(SubType.AURA, game)) {
game.addEffect(new BoostEnchantedEffect(1, 0, Duration.EndOfTurn), source);
} else {
game.addEffect(new BoostSourceEffect(1, 0, Duration.EndOfTurn), source);

View file

@ -103,7 +103,7 @@ class FleetingMemoriesTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return event.getPlayerId().equals(this.getControllerId())
&& game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getSubtype(game).contains(SubType.CLUE);
&& game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).hasSubtype(SubType.CLUE, game);
}
@Override

View file

@ -0,0 +1,68 @@
/*
* 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.f;
import java.util.UUID;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostTargetEffect;
import mage.abilities.effects.common.continuous.GainAbilityTargetEffect;
import mage.abilities.keyword.HasteAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author TheElk801
*/
public class FlowstoneStrike extends CardImpl {
public FlowstoneStrike(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{1}{R}");
// Target creature gets +1/-1 and gains haste until end of turn.
Effect effect = new BoostTargetEffect(1, -1, Duration.EndOfTurn);
effect.setText("Target creature gets +1/-1");
this.getSpellAbility().addEffect(effect);
effect = new GainAbilityTargetEffect(HasteAbility.getInstance(), Duration.EndOfTurn);
effect.setText("and gains haste until end of turn");
this.getSpellAbility().addEffect(effect);
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}
public FlowstoneStrike(final FlowstoneStrike card) {
super(card);
}
@Override
public FlowstoneStrike copy() {
return new FlowstoneStrike(this);
}
}

View file

@ -0,0 +1,72 @@
/*
* 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.f;
import java.util.UUID;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.common.continuous.BoostAllEffect;
import mage.abilities.keyword.CumulativeUpkeepAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Zone;
import mage.filter.common.FilterCreaturePermanent;
/**
*
* @author TheElk801
*/
public class FyndhornPollen extends CardImpl {
private static FilterCreaturePermanent filter = new FilterCreaturePermanent("All creatures");
public FyndhornPollen(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{G}");
// Cumulative upkeep {1}
this.addAbility(new CumulativeUpkeepAbility(new ManaCostsImpl("{1}")));
// All creatures get -1/-0.
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new BoostAllEffect(-1, 0, Duration.WhileOnBattlefield, filter, false)));
// {1}{G}: All creatures get -1/-0 until end of turn.
this.addAbility(new SimpleActivatedAbility(Zone.BATTLEFIELD, new BoostAllEffect(-1, 0, Duration.EndOfTurn, filter, false), new ManaCostsImpl("{1}{G}")));
}
public FyndhornPollen(final FyndhornPollen card) {
super(card);
}
@Override
public FyndhornPollen copy() {
return new FyndhornPollen(this);
}
}

View file

@ -99,7 +99,7 @@ class CantBeEquippedSourceEffect extends ContinuousRuleModifyingEffectImpl {
public boolean applies(GameEvent event, Ability source, Game game) {
if (event.getTargetId().equals(source.getSourceId())) {
Permanent permanent = game.getPermanent(event.getSourceId());
if (permanent != null && permanent.getSubtype(game).contains(SubType.EQUIPMENT)) {
if (permanent != null && permanent.hasSubtype(SubType.EQUIPMENT, game)) {
return true;
}
}

View file

@ -27,7 +27,6 @@
*/
package mage.cards.g;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -36,14 +35,16 @@ import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.OneShotEffect;
import mage.cards.*;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.Zone;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetCreatureOrPlayer;
import java.util.UUID;
/**
*
* @author Plopman
@ -102,7 +103,7 @@ class GoblinCharbelcherEffect extends OneShotEffect {
cards.add(card);
if (card.isLand()){
landFound = true;
if(card.getSubtype(game).contains(SubType.MOUNTAIN)){
if(card.hasSubtype(SubType.MOUNTAIN, game)){
isMountain = true;
}
break;
@ -117,7 +118,7 @@ class GoblinCharbelcherEffect extends OneShotEffect {
if (landFound) {
damage--;
}
if(isMountain == true){
if(isMountain){
damage *= 2;
}

View file

@ -91,7 +91,7 @@ class GolemSkinGauntletsAttachedCount implements DynamicValue {
List<UUID> attachments = permanent.getAttachments();
for (UUID attachmentId : attachments) {
Permanent attached = game.getPermanent(attachmentId);
if (attached != null && attached.getSubtype(game).contains(SubType.EQUIPMENT)) {
if (attached != null && attached.hasSubtype(SubType.EQUIPMENT, game)) {
count++;
}
}

View file

@ -91,7 +91,7 @@ class GrafMoleTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return event.getPlayerId().equals(this.getControllerId())
&& game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getSubtype(game).contains(SubType.CLUE);
&& game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).hasSubtype(SubType.CLUE, game);
}
@Override

View file

@ -142,7 +142,7 @@ class GuardianBeastConditionalEffect extends ContinuousRuleModifyingEffectImpl {
}
StackObject spell = game.getStack().getStackObject(event.getSourceId());
if (event.getType() == EventType.LOSE_CONTROL || event.getType() == EventType.ATTACH || event.getType() == EventType.TARGET && spell != null && spell.isEnchantment() && spell.getSubtype(game).contains(SubType.AURA)) {
if (event.getType() == EventType.LOSE_CONTROL || event.getType() == EventType.ATTACH || event.getType() == EventType.TARGET && spell != null && spell.isEnchantment() && spell.hasSubtype(SubType.AURA, game)) {
for (Permanent perm : game.getBattlefield().getAllActivePermanents(filter, source.getControllerId(), game)) {
if (perm != null && Objects.equals(perm.getId(), targetPermanent.getId()) && !perm.isCreature()) {
return true;

View file

@ -27,7 +27,6 @@
*/
package mage.cards.g;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.LandfallAbility;
@ -41,6 +40,8 @@ import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.UUID;
/**
*
* @author LevelX2
@ -91,7 +92,7 @@ class GuulDrazOverseerEffect extends OneShotEffect {
Permanent land = game.getPermanentOrLKIBattlefield(getTargetPointer().getFirst(game, source));
if (controller != null && land != null) {
int boost = 1;
if (land.getSubtype(game).contains(SubType.SWAMP)) {
if (land.hasSubtype(SubType.SWAMP, game)) {
boost = 2;
}
game.addEffect(new BoostControlledEffect(boost, 0, Duration.EndOfTurn, true), source);

View file

@ -27,7 +27,6 @@
*/
package mage.cards.h;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -41,13 +40,7 @@ import mage.abilities.keyword.FlyingAbility;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.PhaseStep;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.TargetController;
import mage.constants.Zone;
import mage.constants.*;
import mage.filter.FilterCard;
import mage.filter.FilterPermanent;
import mage.filter.predicate.mageobject.CardIdPredicate;
@ -62,6 +55,8 @@ import mage.players.Player;
import mage.target.Target;
import mage.target.common.TargetCardInYourGraveyard;
import java.util.UUID;
/**
*
* @author jeffwadsworth, TheElk801
@ -77,7 +72,7 @@ public class HakimLoreweaver extends CardImpl {
}
public HakimLoreweaver(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}");
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{3}{U}{U}");
addSuperType(SuperType.LEGENDARY);
this.subtype.add(SubType.HUMAN);

View file

@ -27,7 +27,6 @@
*/
package mage.cards.h;
import java.util.UUID;
import mage.ConditionalMana;
import mage.MageObject;
import mage.Mana;
@ -54,6 +53,8 @@ import mage.filter.predicate.Predicates;
import mage.game.Game;
import mage.target.common.TargetCardInYourGraveyard;
import java.util.UUID;
/**
*
* @author jeffwadsworth
@ -158,7 +159,7 @@ class UginPlaneswalkerCardPredicate implements Predicate<Card> {
@Override
public boolean apply(Card input, Game game) {
return input.isPlaneswalker()
&& input.getSubtype(game).contains(SubType.UGIN);
&& input.hasSubtype(SubType.UGIN, game);
}
@Override

View file

@ -27,7 +27,6 @@
*/
package mage.cards.j;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.EntersBattlefieldTappedAbility;
@ -51,6 +50,8 @@ import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.common.TargetControlledPermanent;
import java.util.UUID;
/**
*
* @author fireshoes
@ -110,7 +111,7 @@ class JokulmorderTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
Permanent land = game.getPermanent(event.getTargetId());
return land.getSubtype(game).contains(SubType.ISLAND)
return land.hasSubtype(SubType.ISLAND, game)
&& land.getControllerId().equals(this.controllerId);
}

View file

@ -123,7 +123,7 @@ class KarnLiberatedEffect extends OneShotEffect {
for (ExileZone zone : game.getExile().getExileZones()) {
if (zone.getId().equals(exileId)) {
for (Card card : zone.getCards(game)) {
if (!card.getSubtype(game).contains(SubType.AURA) && card.isPermanent()) {
if (!card.hasSubtype(SubType.AURA, game) && card.isPermanent()) {
cards.add(card);
}
}
@ -155,7 +155,7 @@ class KarnLiberatedEffect extends OneShotEffect {
}
for (Card card : cards) {
game.getState().setZone(card.getId(), Zone.EXILED);
if (card.isPermanent() && !card.getSubtype(game).contains(SubType.AURA)) {
if (card.isPermanent() && !card.hasSubtype(SubType.AURA, game)) {
game.getExile().add(exileId, sourceObject.getIdName(), card);
}
}

View file

@ -84,7 +84,7 @@ class SourceIsEquiped implements Condition {
for (UUID attachmentUUID : attachments) {
Permanent attachment = game.getPermanent(attachmentUUID);
if (attachment != null) {
if (attachment.getSubtype(game).contains(SubType.EQUIPMENT)) {
if (attachment.hasSubtype(SubType.EQUIPMENT, game)) {
return true;
}
}

View file

@ -27,7 +27,6 @@
*/
package mage.cards.l;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.common.ManacostVariableValue;
@ -37,11 +36,7 @@ import mage.abilities.effects.common.continuous.BecomesCreatureTargetEffect;
import mage.abilities.effects.common.counter.AddCountersTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.TargetController;
import mage.constants.*;
import mage.counters.CounterType;
import mage.filter.common.FilterArtifactPermanent;
import mage.filter.predicate.permanent.ControllerPredicate;
@ -51,6 +46,8 @@ import mage.game.permanent.token.Token;
import mage.target.common.TargetArtifactPermanent;
import mage.target.targetpointer.FixedTarget;
import java.util.UUID;
/**
*
* @author fireshoes
@ -101,8 +98,8 @@ class LifecraftAwakeningEffect extends OneShotEffect {
@Override
public boolean apply(Game game, Ability source) {
Permanent permanent = (Permanent) game.getPermanent(source.getTargets().getFirstTarget());
if (!permanent.isCreature() && !permanent.getSubtype(game).contains(SubType.VEHICLE)) {
Permanent permanent = game.getPermanent(source.getTargets().getFirstTarget());
if (!permanent.isCreature() && !permanent.hasSubtype(SubType.VEHICLE, game)) {
ContinuousEffect continuousEffect = new BecomesCreatureTargetEffect(new LifecraftAwakeningToken(), false, true, Duration.Custom);
continuousEffect.setTargetPointer(new FixedTarget(permanent, game));
game.addEffect(continuousEffect, source);

View file

@ -27,7 +27,6 @@
*/
package mage.cards.l;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.costs.mana.GenericManaCost;
@ -38,15 +37,13 @@ import mage.abilities.keyword.EquipAbility;
import mage.abilities.keyword.FirstStrikeAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AttachmentType;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.constants.*;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.util.CardUtil;
import java.util.UUID;
/**
*
* @author Styxo
@ -73,7 +70,7 @@ public class Lightsaber extends CardImpl {
public void adjustCosts(Ability ability, Game game) {
if (ability instanceof EquipAbility) {
Permanent targetCreature = game.getPermanent(ability.getTargets().getFirstTarget());
if (targetCreature != null && (targetCreature.getSubtype(game).contains(SubType.SITH) || targetCreature.getSubtype(game).contains(SubType.JEDI))) {
if (targetCreature != null && (targetCreature.hasSubtype(SubType.SITH, game) || targetCreature.hasSubtype(SubType.JEDI, game))) {
CardUtil.increaseCost(ability, 1 - ability.getManaCostsToPay().convertedManaCost());
}
}

View file

@ -27,7 +27,6 @@
*/
package mage.cards.l;
import java.util.UUID;
import mage.ObjectColor;
import mage.abilities.Ability;
import mage.abilities.effects.OneShotEffect;
@ -44,6 +43,8 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
*
* @author LevelX2
@ -93,7 +94,7 @@ class LilianasDefeatEffect extends OneShotEffect {
if (player != null && permanent != null) {
permanent.destroy(source.getSourceId(), game, true);
game.applyEffects();
if (permanent.isPlaneswalker() && permanent.getSubtype(game).contains(SubType.LILIANA)) {
if (permanent.isPlaneswalker() && permanent.hasSubtype(SubType.LILIANA, game)) {
Player permanentController = game.getPlayer(permanent.getControllerId());
if (permanentController != null) {
permanentController.loseLife(3, game, false);

View file

@ -27,26 +27,19 @@
*/
package mage.cards.l;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.common.AttacksAllTriggeredAbility;
import mage.abilities.effects.OneShotEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.cards.Cards;
import mage.cards.CardsImpl;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Outcome;
import mage.constants.SetTargetPointer;
import mage.constants.Zone;
import mage.cards.*;
import mage.constants.*;
import mage.filter.StaticFilters;
import mage.game.Game;
import mage.game.permanent.Permanent;
import mage.players.Player;
import java.util.UUID;
/**
*
* @author BetaSteward
@ -95,7 +88,7 @@ class LostInTheWoodsEffect extends OneShotEffect {
controller.revealCards(sourceObject.getName(), cards, game);
if (card != null) {
if (card.getSubtype(game).contains(SubType.FOREST)) {
if (card.hasSubtype(SubType.FOREST, game)) {
Permanent permanent = game.getPermanent(targetPointer.getFirst(game, source));
if (permanent != null) {
permanent.removeFromCombat(game);

View file

@ -108,7 +108,7 @@ class MarkOfEvictionEffect extends OneShotEffect {
toHand.add(enchanted);
for (UUID attachmentId : enchanted.getAttachments()) {
Permanent attachment = game.getPermanent(attachmentId);
if (attachment != null && attachment.getSubtype(game).contains(SubType.AURA)) {
if (attachment != null && attachment.hasSubtype(SubType.AURA, game)) {
toHand.add(attachment);
}
}

View file

@ -0,0 +1,81 @@
/*
* 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.m;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.effects.common.DestroyTargetEffect;
import mage.constants.SubType;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.filter.FilterPermanent;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.filter.predicate.permanent.AttachedToPredicate;
import mage.target.TargetPermanent;
/**
*
* @author TheElk801
*/
public class MiracleWorker extends CardImpl {
private static final FilterPermanent filter = new FilterPermanent("Aura attached to a creature you control");
static {
filter.add(new AttachedToPredicate(new FilterControlledCreaturePermanent()));
filter.add(new SubtypePredicate(SubType.AURA));
}
public MiracleWorker(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{W}");
this.subtype.add(SubType.HUMAN);
this.subtype.add(SubType.CLERIC);
this.power = new MageInt(1);
this.toughness = new MageInt(1);
// {tap}: Destroy target Aura attached to a creature you control.
Ability ability = new SimpleActivatedAbility(new DestroyTargetEffect(), new TapSourceCost());
ability.addTarget(new TargetPermanent(filter));
this.addAbility(ability);
}
public MiracleWorker(final MiracleWorker card) {
super(card);
}
@Override
public MiracleWorker copy() {
return new MiracleWorker(this);
}
}

View file

@ -98,7 +98,7 @@ class MurderousSpoilsEffect extends OneShotEffect {
List<Permanent> attachments = new ArrayList<>();
for (UUID uuid : target.getAttachments()) {
Permanent attached = game.getBattlefield().getPermanent(uuid);
if (attached.getSubtype(game).contains(SubType.EQUIPMENT)) {
if (attached.hasSubtype(SubType.EQUIPMENT, game)) {
attachments.add(attached);
}
}

View file

@ -110,7 +110,7 @@ class TargetCardInLibrarySharingLandType extends TargetCardInLibrary {
if (landTypes.isEmpty()) {
landTypes.addAll(landCard.getSubtype(game));
} else {
landTypes.removeIf(next -> !landCard.getSubtype(game).contains(next));
landTypes.removeIf(next -> !landCard.hasSubtype(next, game));
}
}
}
@ -118,7 +118,7 @@ class TargetCardInLibrarySharingLandType extends TargetCardInLibrary {
if (card != null && !landTypes.isEmpty()) {
for (Iterator<SubType> iterator = landTypes.iterator(); iterator.hasNext();) {
SubType next = iterator.next();
if (card.getSubtype(game).contains(next)) {
if (card.hasSubtype(next, game)) {
return true;
}
}

View file

@ -142,7 +142,7 @@ class NecromancersMagemarkEffect extends ReplacementEffectImpl {
if (permanent != null && permanent.getControllerId().equals(source.getControllerId())) {
for (UUID attachmentId : permanent.getAttachments()) {
Permanent attachment = game.getPermanentOrLKIBattlefield(attachmentId);
if (attachment != null && attachment.getSubtype(game).contains(SubType.AURA)) {
if (attachment != null && attachment.hasSubtype(SubType.AURA, game)) {
return true;
}
}

View file

@ -204,7 +204,7 @@ class NecromancyChangeAbilityEffect extends ContinuousEffectImpl implements Sour
switch (layer) {
case TypeChangingEffects_4:
if (sublayer == SubLayer.NA) {
if (!permanent.getSubtype(game).contains(SubType.AURA)) {
if (!permanent.hasSubtype(SubType.AURA, game)) {
permanent.getSubtype(game).add(SubType.AURA);
}
}

View file

@ -27,9 +27,6 @@
*/
package mage.cards.n;
import java.util.LinkedHashSet;
import java.util.UUID;
import java.util.stream.Collectors;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.Mode;
@ -43,12 +40,7 @@ import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.choices.Choice;
import mage.choices.ChoiceImpl;
import mage.constants.CardType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.SubType;
import mage.constants.*;
import mage.filter.common.FilterControlledCreaturePermanent;
import mage.filter.predicate.Predicates;
import mage.filter.predicate.mageobject.TextPartSubtypePredicate;
@ -60,6 +52,10 @@ import mage.target.common.TargetControlledCreaturePermanent;
import mage.target.common.TargetCreaturePermanent;
import mage.target.targetpointer.FixedTarget;
import java.util.LinkedHashSet;
import java.util.UUID;
import java.util.stream.Collectors;
/**
*
* @author LevelX2
@ -187,9 +183,9 @@ class ChangeCreatureTypeTargetEffect extends ContinuousEffectImpl {
break;
case TypeChangingEffects_4:
if (sublayer == SubLayer.NA) {
if (targetObject.getSubtype(game).contains(fromSubType)) {
if (targetObject.hasSubtype(fromSubType, game)) {
targetObject.getSubtype(game).remove(fromSubType);
if (!targetObject.getSubtype(game).contains(toSubType)) {
if (!targetObject.hasSubtype(toSubType, game)) {
targetObject.getSubtype(game).add(toSubType);
}
}

View file

@ -141,7 +141,7 @@ class NyleasPresenceLandTypeEffect extends ContinuousEffectImpl {
break;
case TypeChangingEffects_4:
for (SubType subtype : landTypes) {
if (!land.getSubtype(game).contains(subtype)) {
if (!land.hasSubtype(subtype, game)) {
land.getSubtype(game).add(subtype);
}
}

View file

@ -27,15 +27,14 @@
*/
package mage.cards.o;
import java.util.HashSet;
import java.util.Set;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.ExileFromGraveCost;
import mage.abilities.costs.mana.ManaCostsImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.GainLifeEffect;
import mage.abilities.effects.keyword.InvestigateEffect;
import mage.cards.CardImpl;
@ -46,7 +45,6 @@ import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
import mage.game.events.DamagedPlayerEvent;
import mage.game.events.GameEvent;
import mage.game.events.GameEvent.EventType;
import mage.game.permanent.Permanent;
import mage.target.common.TargetCardInYourGraveyard;
@ -57,11 +55,11 @@ import mage.target.common.TargetCardInYourGraveyard;
public class OngoingInvestigation extends CardImpl {
public OngoingInvestigation(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{1}{U}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{1}{U}");
// Whenever one or more creatures you control deal combat damage to a player, investigate.
this.addAbility(new OngoingInvestigationTriggeredAbility());
// {1}{G}, Exile a creature card from your graveyard: Investigate. You gain 2 life.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new InvestigateEffect(), new ManaCostsImpl("{1}{G}"));
ability.addCost(new ExileFromGraveCost(new TargetCardInYourGraveyard(new FilterCreatureCard("a creature card from your graveyard"))));
@ -81,8 +79,7 @@ public class OngoingInvestigation extends CardImpl {
class OngoingInvestigationTriggeredAbility extends TriggeredAbilityImpl {
private boolean madeDamage = false;
private Set<UUID> damagedPlayers = new HashSet<>();
List<UUID> damagedPlayerIds = new ArrayList<>();
public OngoingInvestigationTriggeredAbility() {
super(Zone.BATTLEFIELD, new InvestigateEffect(), false);
@ -90,9 +87,6 @@ class OngoingInvestigationTriggeredAbility extends TriggeredAbilityImpl {
public OngoingInvestigationTriggeredAbility(final OngoingInvestigationTriggeredAbility ability) {
super(ability);
this.madeDamage = ability.madeDamage;
this.damagedPlayers = new HashSet<>();
this.damagedPlayers.addAll(ability.damagedPlayers);
}
@Override
@ -102,36 +96,30 @@ class OngoingInvestigationTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkEventType(GameEvent event, Game game) {
return event.getType() == EventType.DAMAGED_PLAYER || event.getType() == EventType.COMBAT_DAMAGE_STEP_POST;
return event.getType() == GameEvent.EventType.DAMAGED_PLAYER
|| event.getType() == GameEvent.EventType.END_COMBAT_STEP_POST;
}
@Override
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getType() == EventType.DAMAGED_PLAYER) {
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent) event;
Permanent p = game.getPermanent(event.getSourceId());
if (damageEvent.isCombatDamage() && p != null && p.getControllerId().equals(this.getControllerId())) {
madeDamage = true;
damagedPlayers.add(event.getPlayerId());
if (event.getType() == GameEvent.EventType.DAMAGED_PLAYER) {
if (((DamagedPlayerEvent) event).isCombatDamage()) {
Permanent creature = game.getPermanent(event.getSourceId());
if (creature != null && creature.getControllerId().equals(controllerId)
&& !damagedPlayerIds.contains(event.getTargetId())) {
damagedPlayerIds.add(event.getTargetId());
return true;
}
}
}
if (event.getType() == EventType.COMBAT_DAMAGE_STEP_POST) {
if (madeDamage) {
Set<UUID> damagedPlayersCopy = new HashSet<>();
damagedPlayersCopy.addAll(damagedPlayers);
for(Effect effect: this.getEffects()) {
effect.setValue("damagedPlayers", damagedPlayersCopy);
}
damagedPlayers.clear();
madeDamage = false;
return true;
}
if (event.getType() == GameEvent.EventType.END_COMBAT_STEP_POST) {
damagedPlayerIds.clear();
}
return false;
}
@Override
public String getRule() {
return "Whenever one or more creatures you control deal combat damage to a player, " + super.getRule();
return "Whenever one or more creatures you control deal combat damage to a player, investigate";
}
}

View file

@ -119,7 +119,7 @@ class OrzhovCharmReturnToHandEffect extends OneShotEffect {
for (UUID attachmentId : attachments) {
Permanent attachment = game.getPermanent(attachmentId);
if (attachment != null && attachment.getControllerId().equals(source.getControllerId())
&& attachment.getSubtype(game).contains(SubType.AURA)) {
&& attachment.hasSubtype(SubType.AURA, game)) {
attachment.moveToZone(Zone.HAND, source.getSourceId(), game, false);
}
}

View file

@ -27,8 +27,6 @@
*/
package mage.cards.p;
import java.util.Iterator;
import java.util.UUID;
import mage.MageObject;
import mage.abilities.Ability;
import mage.abilities.TriggeredAbilityImpl;
@ -47,6 +45,9 @@ import mage.game.events.GameEvent;
import mage.game.stack.Spell;
import mage.players.Player;
import java.util.Iterator;
import java.util.UUID;
/**
*
* @author TheElk801
@ -115,7 +116,7 @@ class PathOfAncestryTriggeredAbility extends TriggeredAbilityImpl {
if (sType.getSubTypeSet() == SubTypeSet.CreatureType) {
for (UUID cmdr : controller.getCommandersIds()) {
MageObject commander = game.getObject(cmdr);
if (commander != null && commander.getSubtype(game).contains(sType)) {
if (commander != null && commander.hasSubtype(sType, game)) {
return true;
}
}

View file

@ -0,0 +1,86 @@
/*
* 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.p;
import java.util.UUID;
import mage.ObjectColor;
import mage.constants.SubType;
import mage.target.common.TargetCreaturePermanent;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.common.EnchantedCreatureColorCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.continuous.BoostEnchantedEffect;
import mage.constants.Outcome;
import mage.target.TargetPermanent;
import mage.abilities.keyword.EnchantAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
/**
*
* @author TheElk801
*/
public class PhyrexianBoon extends CardImpl {
public PhyrexianBoon(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{B}");
this.subtype.add(SubType.AURA);
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature gets +2/+1 as long as it's black. Otherwise, it gets -1/-2.
this.addAbility(new SimpleStaticAbility(
Zone.BATTLEFIELD,
new ConditionalContinuousEffect(
new BoostEnchantedEffect(2, 1),
new BoostEnchantedEffect(-1, -2),
new EnchantedCreatureColorCondition(ObjectColor.BLACK),
"Enchanted creature gets +2/+1 as long as it's black. Otherwise, it gets -1/-2."
)
));
}
public PhyrexianBoon(final PhyrexianBoon card) {
super(card);
}
@Override
public PhyrexianBoon copy() {
return new PhyrexianBoon(this);
}
}

View file

@ -27,17 +27,12 @@
*/
package mage.cards.p;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.effects.ReplacementEffectImpl;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Outcome;
import mage.constants.Zone;
import mage.constants.*;
import mage.game.Game;
import mage.game.events.EntersTheBattlefieldEvent;
import mage.game.events.GameEvent;
@ -45,6 +40,8 @@ import mage.game.events.GameEvent.EventType;
import mage.game.events.NumberOfTriggersEvent;
import mage.game.events.ZoneChangeEvent;
import java.util.UUID;
/**
*
* @author Styxo
@ -101,7 +98,7 @@ class PrecipiceOfMortisEffect extends ReplacementEffectImpl {
if (sourceEvent.getType() == EventType.ENTERS_THE_BATTLEFIELD && sourceEvent instanceof EntersTheBattlefieldEvent) {
EntersTheBattlefieldEvent entersTheBattlefieldEvent = (EntersTheBattlefieldEvent) sourceEvent;
// Only for entering Jedis
if (entersTheBattlefieldEvent.getTarget().getSubtype(game).contains(SubType.JEDI)) {
if (entersTheBattlefieldEvent.getTarget().hasSubtype(SubType.JEDI, game)) {
// Only for triggers of permanents
if (game.getPermanent(numberOfTriggersEvent.getSourceId()) != null) {
return true;
@ -113,7 +110,7 @@ class PrecipiceOfMortisEffect extends ReplacementEffectImpl {
ZoneChangeEvent leavesTheBattlefieldEvent = (ZoneChangeEvent) sourceEvent;
if (leavesTheBattlefieldEvent.getFromZone() == Zone.BATTLEFIELD) {
// Only for leaving Jedis
if (leavesTheBattlefieldEvent.getTarget().getSubtype(game).contains(SubType.JEDI)) {
if (leavesTheBattlefieldEvent.getTarget().hasSubtype(SubType.JEDI, game)) {
// Only for triggers of permanents
if (game.getPermanent(numberOfTriggersEvent.getSourceId()) != null) {
return true;

View file

@ -123,7 +123,7 @@ class BecomesBasicLandTypeAllEffect extends ContinuousEffectImpl {
break;
case TypeChangingEffects_4:
for (SubType subtype : landTypes) {
if (!land.getSubtype(game).contains(subtype)) {
if (!land.hasSubtype(subtype, game)) {
land.getSubtype(game).add(subtype);
}
}

View file

@ -111,7 +111,7 @@ class RealmwrightEffect2 extends ContinuousEffectImpl {
if (land != null) {
switch (layer) {
case TypeChangingEffects_4:
if (sublayer == SubLayer.NA && !land.getSubtype(game).contains(choice)) {
if (sublayer == SubLayer.NA && !land.hasSubtype(choice, game)) {
land.getSubtype(game).add(choice);
}
break;

View file

@ -27,7 +27,6 @@
*/
package mage.cards.r;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.BeginningOfUpkeepTriggeredAbility;
import mage.abilities.common.SimpleActivatedAbility;
@ -46,6 +45,8 @@ import mage.counters.CounterType;
import mage.filter.FilterPermanent;
import mage.target.TargetPermanent;
import java.util.UUID;
/**
*
* @author TheElk801
@ -53,7 +54,7 @@ import mage.target.TargetPermanent;
public class Recantation extends CardImpl {
public Recantation(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{3}{U}{U}");
// At the beginning of your upkeep, you may put a verse counter on Recantation.
this.addAbility(new BeginningOfUpkeepTriggeredAbility(Zone.BATTLEFIELD,

View file

@ -105,7 +105,7 @@ class RiptideShapeshifterEffect extends OneShotEffect {
Cards revealedCards = new CardsImpl();
while (controller.getLibrary().hasCards()) {
Card card = controller.getLibrary().removeFromTop(game);
if (card.isCreature() && card.getSubtype(game).contains(SubType.byDescription(choice.getChoice()))) {
if (card.isCreature() && card.hasSubtype(SubType.byDescription(choice.getChoice()), game)) {
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
break;
}

View file

@ -35,6 +35,7 @@ import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.OneShotEffect;
import mage.abilities.effects.common.DrawCardSourceControllerEffect;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.cards.Card;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
@ -55,18 +56,18 @@ import mage.target.common.TargetCardInGraveyard;
public class ScrabblingClaws extends CardImpl {
public ScrabblingClaws(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ARTIFACT},"{1}");
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{1}");
// {tap}: Target player exiles a card from his or her graveyard.
Ability firstAbility = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ScrabblingClawsEffect(), new TapSourceCost());
firstAbility.addTarget(new TargetPlayer());
this.addAbility(firstAbility);
// {1}, Sacrifice Scrabbling Claws: Exile target card from a graveyard. Draw a card.
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new mage.abilities.effects.common.ExileTargetEffect(), new SacrificeSourceCost());
SimpleActivatedAbility ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new SacrificeSourceCost());
ability.addCost(new GenericManaCost(1));
ability.addTarget(new TargetCardInGraveyard());
this.addAbility(ability);
ability.addEffect(new DrawCardSourceControllerEffect(1));
this.addAbility(ability);
}
public ScrabblingClaws(final ScrabblingClaws card) {
@ -112,4 +113,4 @@ class ScrabblingClawsEffect extends OneShotEffect {
}
return false;
}
}
}

View file

@ -27,7 +27,6 @@
*/
package mage.cards.s;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.BecomesMonstrousSourceTriggeredAbility;
@ -45,6 +44,8 @@ import mage.game.permanent.Permanent;
import mage.target.Target;
import mage.target.common.TargetLandPermanent;
import java.util.UUID;
/**
*
* @author LevelX2
@ -116,7 +117,7 @@ class SealockMonsterBecomesIslandTargetEffect extends ContinuousEffectImpl {
}
break;
case TypeChangingEffects_4:
if (!land.getSubtype(game).contains(SubType.ISLAND)) {
if (!land.hasSubtype(SubType.ISLAND, game)) {
land.getSubtype(game).add(SubType.ISLAND);
}
break;

View file

@ -101,7 +101,7 @@ class SilenceTheBelieversExileEffect extends OneShotEffect {
List<UUID> attachments = new ArrayList<>(creature.getAttachments());
for (UUID attachmentId: attachments) {
Permanent attachment = game.getPermanent(attachmentId);
if (attachment != null && attachment.getSubtype(game).contains(SubType.AURA)) {
if (attachment != null && attachment.hasSubtype(SubType.AURA, game)) {
controller.moveCardToExileWithInfo(attachment, null, null, source.getSourceId(), game, Zone.BATTLEFIELD, true);
}
}

View file

@ -27,7 +27,6 @@
*/
package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.common.ExileTargetForSourceEffect;
import mage.abilities.effects.common.ReturnToBattlefieldUnderYourControlTargetEffect;
@ -40,6 +39,8 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.target.common.TargetControlledCreaturePermanent;
import java.util.UUID;
/**
*
* @author TheElk801
@ -85,7 +86,7 @@ class SirensRuseEffect extends ExileTargetForSourceEffect {
boolean isPirate = false;
Player player = game.getPlayer(source.getControllerId());
Permanent permanent = game.getPermanent(source.getFirstTarget());
if (permanent != null && permanent.getSubtype(game).contains(SubType.PIRATE)) {
if (permanent != null && permanent.hasSubtype(SubType.PIRATE, game)) {
isPirate = true;
}
if (super.apply(game, source)) {

View file

@ -27,7 +27,6 @@
*/
package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.costs.Cost;
import mage.abilities.costs.common.ExileTargetCost;
@ -36,8 +35,8 @@ import mage.abilities.effects.common.ReturnFromGraveyardToBattlefieldTargetEffec
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.counters.CounterType;
import mage.filter.common.FilterCreatureCard;
import mage.game.Game;
@ -45,22 +44,23 @@ import mage.game.permanent.Permanent;
import mage.target.common.TargetCardInYourGraveyard;
import mage.target.common.TargetControlledCreaturePermanent;
import java.util.UUID;
/**
*
* @author MarcoMarin
*/
public class SoulExchange extends CardImpl {
public SoulExchange(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.SORCERY},"{B}{B}");
super(ownerId, setInfo, new CardType[]{CardType.SORCERY}, "{B}{B}");
// As an additional cost to cast Soul Exchange, exile a creature you control.
Cost cost = new ExileTargetCost(new TargetControlledCreaturePermanent());
this.getSpellAbility().addCost(cost);
// Return target creature card from your graveyard to the battlefield. Put a +2/+2 counter on that creature if the exiled creature was a Thrull.
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard")));
this.getSpellAbility().addEffect(new SoulExchangeEffect());
this.getSpellAbility().addTarget(new TargetCardInYourGraveyard(new FilterCreatureCard("creature card from your graveyard")));
this.getSpellAbility().addEffect(new SoulExchangeEffect());
}
public SoulExchange(final SoulExchange card) {
@ -73,17 +73,17 @@ public class SoulExchange extends CardImpl {
}
}
class SoulExchangeEffect extends OneShotEffect{
class SoulExchangeEffect extends OneShotEffect {
public SoulExchangeEffect() {
super(Outcome.Benefit);
this.setText("Return target creature card from your graveyard to the battlefield. Put a +2/+2 counter on that creature if the exiled creature was a Thrull.");
}
public SoulExchangeEffect(final SoulExchangeEffect effect) {
super(effect);
}
@Override
public SoulExchangeEffect copy() {
return new SoulExchangeEffect(this);
@ -93,22 +93,22 @@ class SoulExchangeEffect extends OneShotEffect{
public boolean apply(Game game, Ability source) {
ReturnFromGraveyardToBattlefieldTargetEffect effect = new ReturnFromGraveyardToBattlefieldTargetEffect();
if (!effect.apply(game, source)) return false;
for (Cost c : source.getCosts()){
for (Cost c : source.getCosts()) {
/* if (!c.getTargets().isEmpty()){
UUID t = c.getTargets().getFirstTarget();
Permanent exiled = game.getPermanentOrLKIBattlefield(t);*/
if (c.isPaid() && c instanceof ExileTargetCost) {
for (Permanent exiled : ((ExileTargetCost) c).getPermanents()) {
if (exiled != null){
if(exiled.getSubtype(game).contains(SubType.THRULL)){
game.getPermanent(source.getFirstTarget()).addCounters(CounterType.P2P2.createInstance(), source, game);
return true;
if (exiled != null) {
if (exiled.hasSubtype(SubType.THRULL, game)) {
game.getPermanent(source.getFirstTarget()).addCounters(CounterType.P2P2.createInstance(), source, game);
return true;
}
} else return false;
}
} else return false;
}
}
}
return true;
}
return true;
}
}

View file

@ -0,0 +1,87 @@
/*
* 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.s;
import java.util.UUID;
import mage.constants.SubType;
import mage.target.common.TargetCreaturePermanent;
import mage.abilities.Ability;
import mage.abilities.common.SimpleStaticAbility;
import mage.abilities.condition.InvertCondition;
import mage.abilities.condition.common.AttachedToTappedCondition;
import mage.abilities.decorator.ConditionalContinuousEffect;
import mage.abilities.effects.common.AttachEffect;
import mage.abilities.effects.common.continuous.GainAbilityAttachedEffect;
import mage.constants.Outcome;
import mage.target.TargetPermanent;
import mage.abilities.keyword.EnchantAbility;
import mage.abilities.keyword.ShroudAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AttachmentType;
import mage.constants.CardType;
import mage.constants.Zone;
/**
*
* @author TheElk801
*/
public class SpectralCloak extends CardImpl {
public SpectralCloak(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{U}{U}");
this.subtype.add(SubType.AURA);
// Enchant creature
TargetPermanent auraTarget = new TargetCreaturePermanent();
this.getSpellAbility().addTarget(auraTarget);
this.getSpellAbility().addEffect(new AttachEffect(Outcome.BoostCreature));
Ability ability = new EnchantAbility(auraTarget.getTargetName());
this.addAbility(ability);
// Enchanted creature has shroud as long as it's untapped.
this.addAbility(new SimpleStaticAbility(
Zone.BATTLEFIELD,
new ConditionalContinuousEffect(
new GainAbilityAttachedEffect(ShroudAbility.getInstance(), AttachmentType.AURA),
new InvertCondition(AttachedToTappedCondition.instance),
"Enchanted creature has shroud as long as it's untapped."
)
));
}
public SpectralCloak(final SpectralCloak card) {
super(card);
}
@Override
public SpectralCloak copy() {
return new SpectralCloak(this);
}
}

View file

@ -27,22 +27,18 @@
*/
package mage.cards.s;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.effects.ContinuousEffectImpl;
import mage.abilities.effects.Effect;
import mage.abilities.effects.common.continuous.BoostControlledEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.constants.Duration;
import mage.constants.Layer;
import mage.constants.Outcome;
import mage.constants.SubLayer;
import mage.constants.*;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
*
* @author LevelX2
@ -90,7 +86,7 @@ class StartYourEnginesEffect extends ContinuousEffectImpl {
@Override
public boolean apply(Layer layer, SubLayer sublayer, Ability source, Game game) {
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(source.getControllerId())) {
if (permanent != null && permanent.getSubtype(game).contains(SubType.VEHICLE)) {
if (permanent != null && permanent.hasSubtype(SubType.VEHICLE, game)) {
if (sublayer == SubLayer.NA) {
permanent.addCardType(CardType.ARTIFACT);
permanent.addCardType(CardType.CREATURE);// TODO: Chcek if giving CREATURE Type is correct

View file

@ -0,0 +1,73 @@
/*
* 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.s;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
import mage.abilities.costs.common.SacrificeSourceCost;
import mage.abilities.costs.common.TapSourceCost;
import mage.abilities.costs.mana.GenericManaCost;
import mage.abilities.effects.common.ExileTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.constants.Zone;
import mage.target.common.TargetCardInGraveyard;
/**
*
* @author TheElk801
*/
public class Steamclaw extends CardImpl {
public Steamclaw(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.ARTIFACT}, "{2}");
// {3}, {tap}: Exile target card from a graveyard.
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new TapSourceCost());
ability.addCost(new GenericManaCost(3));
ability.addTarget(new TargetCardInGraveyard());
this.addAbility(ability);
// {1}, Sacrifice Steamclaw: Exile target card from a graveyard.
ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, new ExileTargetEffect(), new GenericManaCost(1));
ability.addCost(new SacrificeSourceCost());
ability.addTarget(new TargetCardInGraveyard());
this.addAbility(ability);
}
public Steamclaw(final Steamclaw card) {
super(card);
}
@Override
public Steamclaw copy() {
return new Steamclaw(this);
}
}

View file

@ -114,7 +114,7 @@ class StormtideLeviathanEffect extends ContinuousEffectImpl {
for (Permanent land : game.getBattlefield().getActivePermanents(new FilterLandPermanent(), source.getControllerId(), game)) {
switch (layer) {
case TypeChangingEffects_4:
if (!land.getSubtype(game).contains(SubType.ISLAND)) {
if (!land.hasSubtype(SubType.ISLAND, game)) {
land.getSubtype(game).add(SubType.ISLAND);
}
break;

View file

@ -108,7 +108,7 @@ class StreetSweeperDestroyEffect extends OneShotEffect {
for(UUID uuid : attachments)
{
Permanent aura = game.getPermanent(uuid);
if(aura != null && aura.getSubtype(game).contains(SubType.AURA))
if(aura != null && aura.hasSubtype(SubType.AURA, game))
{
aura.destroy(source.getSourceId(), game, false);
}

View file

@ -27,7 +27,6 @@
*/
package mage.cards.t;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -49,6 +48,8 @@ import mage.game.permanent.Permanent;
import mage.game.stack.StackObject;
import mage.target.common.TargetCreaturePermanent;
import java.util.UUID;
/**
*
* @author JRHerlehy
@ -127,9 +128,9 @@ class TetsuoUmezawaEffect extends ContinuousRuleModifyingEffectImpl {
@Override
public boolean applies(GameEvent event, Ability source, Game game) {
StackObject stackObject = (StackObject) game.getStack().getStackObject(event.getSourceId());
StackObject stackObject = game.getStack().getStackObject(event.getSourceId());
if (stackObject != null && event.getTargetId().equals(source.getSourceId())) {
if (stackObject.getSubtype(game).contains(SubType.AURA)) {
if (stackObject.hasSubtype(SubType.AURA, game)) {
return true;
}
}

View file

@ -27,9 +27,6 @@
*/
package mage.cards.t;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
import mage.MageInt;
import mage.MageObjectReference;
import mage.abilities.Ability;
@ -42,13 +39,7 @@ import mage.abilities.effects.common.cost.SpellsCostReductionControllerEffect;
import mage.abilities.keyword.FlyingAbility;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.AbilityWord;
import mage.constants.CardType;
import mage.constants.Outcome;
import mage.constants.SubType;
import mage.constants.SuperType;
import mage.constants.WatcherScope;
import mage.constants.Zone;
import mage.constants.*;
import mage.filter.FilterCard;
import mage.filter.predicate.mageobject.SubtypePredicate;
import mage.game.Game;
@ -57,8 +48,11 @@ import mage.game.permanent.Permanent;
import mage.players.Player;
import mage.watchers.Watcher;
import java.util.HashSet;
import java.util.Set;
import java.util.UUID;
/**
*
* @author TheElk801
*/
public class TheUrDragon extends CardImpl {
@ -125,7 +119,7 @@ class DragonsAttackedWatcher extends Watcher {
this.attackedThisTurnCreatures.clear();
}
if (event.getType() == GameEvent.EventType.ATTACKER_DECLARED) {
if (game.getPermanent(event.getSourceId()).getSubtype(game).contains(SubType.DRAGON)) {
if (game.getPermanent(event.getSourceId()).hasSubtype(SubType.DRAGON, game)) {
this.attackedThisTurnCreatures.add(new MageObjectReference(event.getSourceId(), game));
}
}
@ -166,7 +160,10 @@ class TheUrDragonTriggeredAbility extends TriggeredAbilityImpl {
public boolean checkTrigger(GameEvent event, Game game) {
for (UUID attacker : game.getCombat().getAttackers()) {
Permanent creature = game.getPermanent(attacker);
if (creature != null && creature.getControllerId() == this.getControllerId() && creature.getSubtype(game).contains(SubType.DRAGON)) {
if (creature != null
&& creature.getControllerId() != null
&& creature.getControllerId().equals(this.getControllerId())
&& creature.hasSubtype(SubType.DRAGON, game)) {
return true;
}
}

View file

@ -51,7 +51,7 @@ import mage.game.permanent.token.ThopterColorlessToken;
public class ThopterSpyNetwork extends CardImpl {
public ThopterSpyNetwork(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{2}{U}{U}");
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{2}{U}{U}");
// At the beginning of your upkeep, if you control an artifact, create a 1/1 colorless Thopter artifact creature token with flying.
this.addAbility(new ThopterSpyNetworkUpkeepTriggeredAbility());
@ -149,6 +149,6 @@ class ThopterSpyNetworkDamageTriggeredAbility extends TriggeredAbilityImpl {
@Override
public String getRule() {
return "Whenever one or more artifact creatures you control deals combat damage to a player, draw a card";
return "Whenever one or more artifact creatures you control deal combat damage to a player, draw a card";
}
}

View file

@ -106,7 +106,7 @@ class TirelessTrackerTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return event.getPlayerId().equals(this.getControllerId())
&& game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getSubtype(game).contains(SubType.CLUE);
&& game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).hasSubtype(SubType.CLUE, game);
}
@Override

View file

@ -0,0 +1,59 @@
/*
* 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.effects.common.combat.CantBeBlockedTargetEffect;
import mage.cards.CardImpl;
import mage.cards.CardSetInfo;
import mage.constants.CardType;
import mage.target.common.TargetCreaturePermanent;
/**
*
* @author TheElk801
*/
public class Trailblazer extends CardImpl {
public Trailblazer(UUID ownerId, CardSetInfo setInfo) {
super(ownerId, setInfo, new CardType[]{CardType.INSTANT}, "{2}{G}{G}");
// Target creature is unblockable this turn.
this.getSpellAbility().addEffect(new CantBeBlockedTargetEffect());
this.getSpellAbility().addTarget(new TargetCreaturePermanent());
}
public Trailblazer(final Trailblazer card) {
super(card);
}
@Override
public Trailblazer copy() {
return new Trailblazer(this);
}
}

View file

@ -86,7 +86,7 @@ class TrainingDroneEffect extends RestrictionEffect {
List<UUID> attachments = permanent.getAttachments();
for (UUID uuid : attachments) {
Permanent attached = game.getBattlefield().getPermanent(uuid);
if (attached.getSubtype(game).contains(SubType.EQUIPMENT)) {
if (attached.hasSubtype(SubType.EQUIPMENT, game)) {
return false;
}
}

View file

@ -92,7 +92,7 @@ class TreefolkMysticEffect extends OneShotEffect {
attachments.addAll(permanent.getAttachments());
for (UUID uuid : attachments) {
Permanent aura = game.getPermanent(uuid);
if (aura != null && aura.getSubtype(game).contains(SubType.AURA)) {
if (aura != null && aura.hasSubtype(SubType.AURA, game)) {
aura.destroy(source.getSourceId(), game, false);
}
}

View file

@ -83,7 +83,7 @@ class TurnToSlagEffect extends OneShotEffect {
List<Permanent> attachments = new ArrayList<>();
for (UUID uuid : target.getAttachments()) {
Permanent attached = game.getBattlefield().getPermanent(uuid);
if (attached.getSubtype(game).contains(SubType.EQUIPMENT)) {
if (attached.hasSubtype(SubType.EQUIPMENT, game)) {
attachments.add(attached);
}
}

View file

@ -108,7 +108,7 @@ class UlvenwaldMysteriesTriggeredAbility extends TriggeredAbilityImpl {
@Override
public boolean checkTrigger(GameEvent event, Game game) {
return event.getPlayerId().equals(this.getControllerId())
&& game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getSubtype(game).contains(SubType.CLUE);
&& game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).hasSubtype(SubType.CLUE, game);
}
@Override

View file

@ -27,7 +27,6 @@
*/
package mage.cards.v;
import java.util.UUID;
import mage.MageInt;
import mage.abilities.Ability;
import mage.abilities.common.SimpleActivatedAbility;
@ -42,6 +41,8 @@ import mage.constants.*;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
* @author ImperatorPrime
*/
@ -108,7 +109,7 @@ class VolrathsShapeshifterEffect extends ContinuousEffectImpl {
permanent.getSubtype(game).clear();
for (SubType type : card.getSubtype(game)) {
if (!permanent.getSubtype(game).contains(type)) {
if (!permanent.hasSubtype(type, game)) {
permanent.getSubtype(game).add(type);
}
}

View file

@ -50,14 +50,14 @@ import mage.filter.common.FilterCreatureCard;
public class WindingCanyons extends CardImpl {
public WindingCanyons(UUID ownerId, CardSetInfo setInfo) {
super(ownerId,setInfo,new CardType[]{CardType.LAND},"");
super(ownerId, setInfo, new CardType[]{CardType.LAND}, "");
// {tap}: Add {C} to your mana pool.
this.addAbility(new ColorlessManaAbility());
// {2}, {tap}: Until end of turn, you may play creature cards as though they had flash.
// {2}, {tap}: Until end of turn, you may cast creature spells as though they had flash.
Effect effect = new AddContinuousEffectToGame(new CastAsThoughItHadFlashAllEffect(Duration.EndOfTurn, new FilterCreatureCard()));
effect.setText("Until end of turn, you may play creature cards as though they had flash");
effect.setText("Until end of turn, you may cast creature spells as though they had flash.");
Ability ability = new SimpleActivatedAbility(Zone.BATTLEFIELD, effect, new GenericManaCost(2));
ability.addCost(new TapSourceCost());
this.addAbility(ability);

View file

@ -92,7 +92,7 @@ class WitchbaneOrbEffect extends OneShotEffect {
List<Permanent> toDestroy = new ArrayList<>();
for (UUID attachmentId : controller.getAttachments()) {
Permanent attachment = game.getPermanent(attachmentId);
if (attachment != null && attachment.getSubtype(game).contains(SubType.CURSE)) {
if (attachment != null && attachment.hasSubtype(SubType.CURSE, game)) {
toDestroy.add(attachment);
}
}

View file

@ -84,7 +84,7 @@ class XenograftAddSubtypeEffect extends ContinuousEffectImpl {
if (subtype != null) {
List<Permanent> permanents = game.getBattlefield().getAllActivePermanents(StaticFilters.FILTER_PERMANENT_CREATURE, source.getControllerId(), game);
for (Permanent permanent : permanents) {
if (permanent != null && !permanent.getSubtype(game).contains(subtype)) {
if (permanent != null && !permanent.hasSubtype(subtype, game)) {
permanent.getSubtype(game).add(subtype);
}
}

View file

@ -110,6 +110,7 @@ public class Alliances extends ExpansionSet {
cards.add(new SetCardInfo("Noble Steeds", 140, Rarity.COMMON, mage.cards.n.NobleSteeds.class));
cards.add(new SetCardInfo("Phantasmal Fiend", 20, Rarity.COMMON, mage.cards.p.PhantasmalFiend.class));
cards.add(new SetCardInfo("Phelddagrif", 196, Rarity.RARE, mage.cards.p.Phelddagrif.class));
cards.add(new SetCardInfo("Phyrexian Boon", 22, Rarity.COMMON, mage.cards.p.PhyrexianBoon.class));
cards.add(new SetCardInfo("Phyrexian Devourer", 167, Rarity.RARE, mage.cards.p.PhyrexianDevourer.class));
cards.add(new SetCardInfo("Phyrexian War Beast", 169, Rarity.COMMON, PhyrexianWarBeast.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Phyrexian War Beast", 170, Rarity.COMMON, PhyrexianWarBeast.class, NON_FULL_USE_VARIOUS));

View file

@ -135,6 +135,7 @@ public class IceAge extends ExpansionSet {
cards.add(new SetCardInfo("Fyndhorn Brownie", 130, Rarity.COMMON, mage.cards.f.FyndhornBrownie.class));
cards.add(new SetCardInfo("Fyndhorn Elder", 131, Rarity.UNCOMMON, mage.cards.f.FyndhornElder.class));
cards.add(new SetCardInfo("Fyndhorn Elves", 132, Rarity.COMMON, mage.cards.f.FyndhornElves.class));
cards.add(new SetCardInfo("Fyndhorn Pollen", 133, Rarity.RARE, mage.cards.f.FyndhornPollen.class));
cards.add(new SetCardInfo("Game of Chaos", 186, Rarity.RARE, mage.cards.g.GameOfChaos.class));
cards.add(new SetCardInfo("Gangrenous Zombies", 15, Rarity.COMMON, mage.cards.g.GangrenousZombies.class));
cards.add(new SetCardInfo("Giant Growth", 134, Rarity.COMMON, mage.cards.g.GiantGrowth.class));
@ -298,6 +299,7 @@ public class IceAge extends ExpansionSet {
cards.add(new SetCardInfo("Tinder Wall", 158, Rarity.COMMON, mage.cards.t.TinderWall.class));
cards.add(new SetCardInfo("Tor Giant", 220, Rarity.COMMON, mage.cards.t.TorGiant.class));
cards.add(new SetCardInfo("Touch of Death", 55, Rarity.COMMON, mage.cards.t.TouchOfDeath.class));
cards.add(new SetCardInfo("Trailblazer", 160, Rarity.RARE, mage.cards.t.Trailblazer.class));
cards.add(new SetCardInfo("Underground River", 357, Rarity.RARE, mage.cards.u.UndergroundRiver.class));
cards.add(new SetCardInfo("Updraft", 105, Rarity.UNCOMMON, mage.cards.u.Updraft.class));
cards.add(new SetCardInfo("Urza's Bauble", 318, Rarity.UNCOMMON, mage.cards.u.UrzasBauble.class));

View file

@ -220,6 +220,7 @@ public class Legends extends ExpansionSet {
cards.add(new SetCardInfo("Sir Shandlar of Eberyn", 297, Rarity.UNCOMMON, mage.cards.s.SirShandlarOfEberyn.class));
cards.add(new SetCardInfo("Sivitri Scarzam", 298, Rarity.UNCOMMON, mage.cards.s.SivitriScarzam.class));
cards.add(new SetCardInfo("Sol'kanar the Swamp King", 299, Rarity.RARE, mage.cards.s.SolkanarTheSwampKing.class));
cards.add(new SetCardInfo("Spectral Cloak", 78, Rarity.UNCOMMON, mage.cards.s.SpectralCloak.class));
cards.add(new SetCardInfo("Spinal Villain", 161, Rarity.RARE, mage.cards.s.SpinalVillain.class));
cards.add(new SetCardInfo("Spirit Link", 206, Rarity.UNCOMMON, mage.cards.s.SpiritLink.class));
cards.add(new SetCardInfo("Spirit Shackle", 31, Rarity.COMMON, mage.cards.s.SpiritShackle.class));

View file

@ -184,6 +184,7 @@ public class MastersEdition extends ExpansionSet {
cards.add(new SetCardInfo("Paralyze", 80, Rarity.COMMON, mage.cards.p.Paralyze.class));
cards.add(new SetCardInfo("Phantom Monster", 43, Rarity.COMMON, mage.cards.p.PhantomMonster.class));
cards.add(new SetCardInfo("Phelddagrif", 150, Rarity.RARE, mage.cards.p.Phelddagrif.class));
cards.add(new SetCardInfo("Phyrexian Boon", 81, Rarity.COMMON, mage.cards.p.PhyrexianBoon.class));
cards.add(new SetCardInfo("Phyrexian War Beast", 162, Rarity.UNCOMMON, PhyrexianWarBeast.class));
cards.add(new SetCardInfo("Plains", 181, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS));
cards.add(new SetCardInfo("Plains", 182, Rarity.LAND, mage.cards.basiclands.Plains.class, NON_FULL_USE_VARIOUS));

View file

@ -131,6 +131,7 @@ public class MastersEditionII extends ExpansionSet {
cards.add(new SetCardInfo("Foul Familiar", 90, Rarity.COMMON, mage.cards.f.FoulFamiliar.class));
cards.add(new SetCardInfo("Fumarole", 194, Rarity.UNCOMMON, mage.cards.f.Fumarole.class));
cards.add(new SetCardInfo("Fungal Bloom", 165, Rarity.RARE, mage.cards.f.FungalBloom.class));
cards.add(new SetCardInfo("Fyndhorn Pollen", 166, Rarity.RARE, mage.cards.f.FyndhornPollen.class));
cards.add(new SetCardInfo("Gangrenous Zombies", 92, Rarity.COMMON, mage.cards.g.GangrenousZombies.class));
cards.add(new SetCardInfo("Giant Growth", 167, Rarity.COMMON, mage.cards.g.GiantGrowth.class));
cards.add(new SetCardInfo("Giant Trap Door Spider", 195, Rarity.UNCOMMON, mage.cards.g.GiantTrapDoorSpider.class));

View file

@ -91,6 +91,7 @@ public class Nemesis extends ExpansionSet {
cards.add(new SetCardInfo("Flowstone Crusher", 81, Rarity.COMMON, mage.cards.f.FlowstoneCrusher.class));
cards.add(new SetCardInfo("Flowstone Overseer", 82, Rarity.RARE, mage.cards.f.FlowstoneOverseer.class));
cards.add(new SetCardInfo("Flowstone Slide", 83, Rarity.RARE, mage.cards.f.FlowstoneSlide.class));
cards.add(new SetCardInfo("Flowstone Strike", 84, Rarity.COMMON, mage.cards.f.FlowstoneStrike.class));
cards.add(new SetCardInfo("Flowstone Surge", 85, Rarity.UNCOMMON, mage.cards.f.FlowstoneSurge.class));
cards.add(new SetCardInfo("Flowstone Thopter", 132, Rarity.UNCOMMON, mage.cards.f.FlowstoneThopter.class));
cards.add(new SetCardInfo("Flowstone Wall", 86, Rarity.COMMON, mage.cards.f.FlowstoneWall.class));

View file

@ -324,6 +324,7 @@ public class Odyssey extends ExpansionSet {
cards.add(new SetCardInfo("Squirrel Nest", 274, Rarity.UNCOMMON, mage.cards.s.SquirrelNest.class));
cards.add(new SetCardInfo("Stalking Bloodsucker", 163, Rarity.RARE, mage.cards.s.StalkingBloodsucker.class));
cards.add(new SetCardInfo("Standstill", 102, Rarity.UNCOMMON, mage.cards.s.Standstill.class));
cards.add(new SetCardInfo("Steamclaw", 310, Rarity.UNCOMMON, mage.cards.s.Steamclaw.class));
cards.add(new SetCardInfo("Still Life", 275, Rarity.UNCOMMON, mage.cards.s.StillLife.class));
cards.add(new SetCardInfo("Stone-Tongue Basilisk", 276, Rarity.RARE, mage.cards.s.StoneTongueBasilisk.class));
cards.add(new SetCardInfo("Sungrass Egg", 311, Rarity.UNCOMMON, mage.cards.s.SungrassEgg.class));

View file

@ -106,6 +106,7 @@ public class TheDark extends ExpansionSet {
cards.add(new SetCardInfo("Maze of Ith", 114, Rarity.UNCOMMON, mage.cards.m.MazeOfIth.class));
cards.add(new SetCardInfo("Merfolk Assassin", 31, Rarity.UNCOMMON, mage.cards.m.MerfolkAssassin.class));
cards.add(new SetCardInfo("Mind Bomb", 32, Rarity.RARE, mage.cards.m.MindBomb.class));
cards.add(new SetCardInfo("Miracle Worker", 86, Rarity.COMMON, mage.cards.m.MiracleWorker.class));
cards.add(new SetCardInfo("Morale", 87, Rarity.COMMON, mage.cards.m.Morale.class));
cards.add(new SetCardInfo("Murk Dwellers", 11, Rarity.COMMON, mage.cards.m.MurkDwellers.class));
cards.add(new SetCardInfo("Niall Silvain", 45, Rarity.RARE, mage.cards.n.NiallSilvain.class));

View file

@ -1,9 +1,5 @@
package mage;
import java.io.Serializable;
import java.util.EnumSet;
import java.util.List;
import java.util.UUID;
import mage.abilities.Abilities;
import mage.abilities.Ability;
import mage.abilities.costs.mana.ManaCost;
@ -19,6 +15,11 @@ import mage.game.Game;
import mage.game.events.ZoneChangeEvent;
import mage.util.SubTypeList;
import java.io.Serializable;
import java.util.EnumSet;
import java.util.List;
import java.util.UUID;
public interface MageObject extends MageItem, Serializable {
String getName();
@ -177,7 +178,7 @@ public interface MageObject extends MageItem, Serializable {
}
}
for (SubType subtype : this.getSubtype(game)) {
if (otherCard.getSubtype(game).contains(subtype)) {
if (otherCard.hasSubtype(subtype, game)) {
return true;
}
}

View file

@ -58,7 +58,7 @@ public class AuraAttachedTriggeredAbility extends TriggeredAbilityImpl {
public boolean checkTrigger(GameEvent event, Game game) {
if (event.getTargetId().equals(this.getSourceId())) {
Permanent attachment = game.getPermanent(event.getSourceId());
if (attachment != null && attachment.getSubtype(game).contains(SubType.AURA)) {
if (attachment != null && attachment.hasSubtype(SubType.AURA, game)) {
return true;
}
}

View file

@ -29,11 +29,11 @@ package mage.abilities.condition.common;
import mage.abilities.Ability;
import mage.abilities.condition.Condition;
import mage.constants.SubType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
import mage.constants.SubType;
/**
* Describes condition when creature is equipped with more than one Equipment.
@ -51,7 +51,7 @@ public enum EquippedMultipleSourceCondition implements Condition {
if (permanent != null) {
for (UUID uuid : permanent.getAttachments()) {
Permanent attached = game.getBattlefield().getPermanent(uuid);
if (attached != null && attached.getSubtype(game).contains(SubType.EQUIPMENT)) {
if (attached != null && attached.hasSubtype(SubType.EQUIPMENT, game)) {
countEquipped++;
if (countEquipped >= 2) {
return true;

View file

@ -50,7 +50,7 @@ public enum EquippedSourceCondition implements Condition {
if (permanent != null) {
for (UUID uuid : permanent.getAttachments()) {
Permanent attached = game.getBattlefield().getPermanent(uuid);
if (attached != null && attached.getSubtype(game).contains(SubType.EQUIPMENT)) {
if (attached != null && attached.hasSubtype(SubType.EQUIPMENT, game)) {
return true;
}
}

View file

@ -64,7 +64,7 @@ public class AuraAttachedCount implements DynamicValue {
List<UUID> attachments = p.getAttachments();
for (UUID attachmentId : attachments) {
Permanent attached = game.getPermanent(attachmentId);
if (attached != null && attached.getSubtype(game).contains(SubType.AURA)) {
if (attached != null && attached.hasSubtype(SubType.AURA, game)) {
count++;
}
}

View file

@ -1,14 +1,14 @@
package mage.abilities.dynamicvalue.common;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
import mage.constants.CardType;
import mage.constants.SubType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.UUID;
/**
* @author Loki
*/
@ -63,19 +63,19 @@ public class DomainValue implements DynamicValue {
}
for (Permanent p : game.getBattlefield().getAllActivePermanents(targetPlayer)) {
if (p.isLand()) {
if (havePlains == 0 && p.getSubtype(game).contains(SubType.PLAINS)) {
if (havePlains == 0 && p.hasSubtype(SubType.PLAINS, game)) {
havePlains = 1;
}
if (haveIslands == 0 && p.getSubtype(game).contains(SubType.ISLAND)) {
if (haveIslands == 0 && p.hasSubtype(SubType.ISLAND, game)) {
haveIslands = 1;
}
if (haveMountains == 0 && p.getSubtype(game).contains(SubType.MOUNTAIN)) {
if (haveMountains == 0 && p.hasSubtype(SubType.MOUNTAIN, game)) {
haveMountains = 1;
}
if (haveSwamps == 0 && p.getSubtype(game).contains(SubType.SWAMP)) {
if (haveSwamps == 0 && p.hasSubtype(SubType.SWAMP, game)) {
haveSwamps = 1;
}
if (haveForests == 0 && p.getSubtype(game).contains(SubType.FOREST)) {
if (haveForests == 0 && p.hasSubtype(SubType.FOREST, game)) {
haveForests = 1;
}
}

View file

@ -27,8 +27,6 @@
*/
package mage.abilities.dynamicvalue.common;
import java.util.List;
import java.util.UUID;
import mage.abilities.Ability;
import mage.abilities.dynamicvalue.DynamicValue;
import mage.abilities.effects.Effect;
@ -36,6 +34,9 @@ import mage.constants.SubType;
import mage.game.Game;
import mage.game.permanent.Permanent;
import java.util.List;
import java.util.UUID;
/**
*
* @author North, noxx
@ -64,7 +65,7 @@ public class EquipmentAttachedCount implements DynamicValue {
List<UUID> attachments = permanent.getAttachments();
for (UUID attachmentId : attachments) {
Permanent attached = game.getPermanent(attachmentId);
if (attached != null && attached.getSubtype(game).contains(SubType.EQUIPMENT)) {
if (attached != null && attached.hasSubtype(SubType.EQUIPMENT, game)) {
count++;
}
}

View file

@ -27,9 +27,6 @@
*/
package mage.abilities.effects.common;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
import mage.MageObject;
import mage.ObjectColor;
import mage.abilities.Ability;
@ -51,6 +48,10 @@ import mage.util.CardUtil;
import mage.util.functions.ApplyToPermanent;
import mage.util.functions.EmptyApplyToPermanent;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
/**
*
* @author LevelX2
@ -237,10 +238,10 @@ public class CreateTokenCopyTargetEffect extends OneShotEffect {
if (tokenToughness != Integer.MIN_VALUE) {
token.getToughness().modifyBaseValue(tokenToughness);
}
if (additionalSubType != null && !token.getSubtype(game).contains(additionalSubType)) {
if (additionalSubType != null && !token.hasSubtype(additionalSubType, game)) {
token.getSubtype(game).add(additionalSubType);
}
if (onlySubType != null && !token.getSubtype(game).contains(onlySubType)) {
if (onlySubType != null && !token.hasSubtype(onlySubType, game)) {
token.getSubtype(game).clear();
token.getSubtype(game).add(onlySubType);
}

View file

@ -59,7 +59,7 @@ public class AddCardSubtypeAllEffect extends ContinuousEffectImpl {
@Override
public boolean apply(Game game, Ability source) {
for (Permanent perm : game.getBattlefield().getActivePermanents(filter, source.getControllerId(), source.getSourceId(), game)) {
if (perm != null && !perm.getSubtype(game).contains(addedSubtype)) {
if (perm != null && !perm.hasSubtype(addedSubtype, game)) {
perm.getSubtype(game).add(addedSubtype);
}
}

View file

@ -59,7 +59,7 @@ public class AddCardSubtypeAttachedEffect extends ContinuousEffectImpl {
Permanent equipment = game.getPermanent(source.getSourceId());
if (equipment != null && equipment.getAttachedTo() != null) {
Permanent target = game.getPermanent(equipment.getAttachedTo());
if (target != null && !target.getSubtype(game).contains(addedSubtype))
if (target != null && !target.hasSubtype(addedSubtype, game))
target.getSubtype(game).add(addedSubtype);
}
return true;

View file

@ -84,7 +84,7 @@ public class BecomesAuraSourceEffect extends ContinuousEffectImpl implements Sou
switch (layer) {
case TypeChangingEffects_4:
if (sublayer == SubLayer.NA) {
if (!permanent.getSubtype(game).contains(SubType.AURA)) {
if (!permanent.hasSubtype(SubType.AURA, game)) {
permanent.getSubtype(game).add(SubType.AURA);
}
}

View file

@ -75,27 +75,27 @@ public class BecomesBasicLandEnchantedEffect extends ContinuousEffectImpl {
for (SubType landType : landTypes) {
switch (landType) {
case SWAMP:
if (permanent.getSubtype(game).contains(SubType.SWAMP)) { // type can be removed by other effect with newer timestamp, so no ability adding
if (permanent.hasSubtype(SubType.SWAMP, game)) { // type can be removed by other effect with newer timestamp, so no ability adding
permanent.addAbility(new BlackManaAbility(), source.getSourceId(), game);
}
break;
case MOUNTAIN:
if (permanent.getSubtype(game).contains(SubType.MOUNTAIN)) {
if (permanent.hasSubtype(SubType.MOUNTAIN, game)) {
permanent.addAbility(new RedManaAbility(), source.getSourceId(), game);
}
break;
case FOREST:
if (permanent.getSubtype(game).contains(SubType.FOREST)) {
if (permanent.hasSubtype(SubType.FOREST, game)) {
permanent.addAbility(new GreenManaAbility(), source.getSourceId(), game);
}
break;
case ISLAND:
if (permanent.getSubtype(game).contains(SubType.ISLAND)) {
if (permanent.hasSubtype(SubType.ISLAND, game)) {
permanent.addAbility(new BlueManaAbility(), source.getSourceId(), game);
}
break;
case PLAINS:
if (permanent.getSubtype(game).contains(SubType.PLAINS)) {
if (permanent.hasSubtype(SubType.PLAINS, game)) {
permanent.addAbility(new WhiteManaAbility(), source.getSourceId(), game);
}
break;

Some files were not shown because too many files have changed in this diff Show more