mirror of
https://github.com/correl/mage.git
synced 2024-12-24 11:50:45 +00:00
remove all contains(cardtype.XX) references, instead use the default interface method
This commit is contained in:
parent
733de2d27f
commit
b5e8c88153
466 changed files with 581 additions and 570 deletions
|
@ -101,7 +101,7 @@ class AAT1TriggeredAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Card card = game.getCard(event.getTargetId());
|
||||
if (event.getPlayerId().equals(game.getControllerId(sourceId))
|
||||
&& card.getCardType().contains(CardType.CREATURE)
|
||||
&& card.isCreature()
|
||||
&& game.getState().getZone(card.getId()) == Zone.GRAVEYARD
|
||||
&& event.getData().equals("repair")) {
|
||||
return true;
|
||||
|
|
|
@ -97,7 +97,7 @@ class AberrantResearcherEffect extends OneShotEffect {
|
|||
if (controller != null && controller.getLibrary().size() > 0) {
|
||||
Card card = controller.getLibrary().getFromTop(game);
|
||||
controller.moveCards(card, Zone.GRAVEYARD, source, game);
|
||||
if (card.getCardType().contains(CardType.INSTANT) || card.getCardType().contains(CardType.SORCERY)) {
|
||||
if (card.isInstant() || card.isSorcery()) {
|
||||
new TransformSourceEffect(true).apply(game, source);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -104,7 +104,7 @@ class AbeyanceEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
if (event.getPlayerId().equals(source.getFirstTarget())) {
|
||||
MageObject object = game.getObject(event.getSourceId());
|
||||
if (event.getType() == GameEvent.EventType.CAST_SPELL) {
|
||||
if (object.getCardType().contains(CardType.INSTANT) || object.getCardType().contains(CardType.SORCERY)) {
|
||||
if (object.isInstant() || object.isSorcery()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ class AetherChargeTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent.getCardType().contains(CardType.CREATURE) && permanent.getSubtype(game).contains("Beast")
|
||||
if (permanent.isCreature() && permanent.getSubtype(game).contains("Beast")
|
||||
&& permanent.getControllerId().equals(this.controllerId)) {
|
||||
Effect effect = this.getEffects().get(0);
|
||||
effect.setValue("damageSource", event.getTargetId());
|
||||
|
|
|
@ -91,7 +91,7 @@ class AetherRiftEffect extends OneShotEffect {
|
|||
Player controller = game.getPlayer(source.getControllerId());
|
||||
if (controller != null) {
|
||||
Card card = controller.discardOne(true, source, game);
|
||||
if (card != null && card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card != null && card.isCreature()) {
|
||||
Effect returnEffect = new ReturnFromGraveyardToBattlefieldTargetEffect();
|
||||
returnEffect.setTargetPointer(new FixedTarget(card.getId()));
|
||||
Effect doEffect = new DoUnlessAnyPlayerPaysEffect(returnEffect, new PayLifeCost(5),
|
||||
|
|
|
@ -88,7 +88,7 @@ class AetherStingTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (game.getOpponents(controllerId).contains(event.getPlayerId())) {
|
||||
Card card = game.getCard(event.getSourceId());
|
||||
if (card != null && card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card != null && card.isCreature()) {
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(event.getPlayerId()));
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -104,7 +104,7 @@ class AkoumFirebirdLandfallAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
return permanent != null && permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(this.controllerId);
|
||||
return permanent != null && permanent.isLand() && permanent.getControllerId().equals(this.controllerId);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -105,7 +105,7 @@ class AkoumHellkiteTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent != null
|
||||
&& permanent.getCardType().contains(CardType.LAND)
|
||||
&& permanent.isLand()
|
||||
&& permanent.getControllerId().equals(getControllerId())) {
|
||||
Permanent sourcePermanent = game.getPermanent(getSourceId());
|
||||
if (sourcePermanent != null)
|
||||
|
|
|
@ -168,7 +168,7 @@ class AlurenRuleEffect extends ContinuousEffectImpl {
|
|||
// Card sourceCard = game.getCard(abilityToModify.getSourceId());
|
||||
// StackObject stackObject = game.getStack().getStackObject(abilityToModify.getSourceId());
|
||||
// if (stackObject != null && stackObject instanceof Spell) {
|
||||
// if (sourceCard != null && sourceCard.getCardType().contains(CardType.CREATURE) && sourceCard.getConvertedManaCost() <= 3) {
|
||||
// if (sourceCard != null && sourceCard.isCreature() && sourceCard.getConvertedManaCost() <= 3) {
|
||||
// Player player = game.getPlayer(stackObject.getControllerId());
|
||||
// String message = "Cast " + sourceCard.getName() + " without paying its mana costs?";
|
||||
// if (player != null &&
|
||||
|
|
|
@ -101,7 +101,7 @@ class AmbuscadeShamanTriggeredAbility extends TriggeredAbilityImpl {
|
|||
UUID targetId = event.getTargetId();
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent.getControllerId().equals(this.controllerId)
|
||||
&& permanent.getCardType().contains(CardType.CREATURE)) {
|
||||
&& permanent.isCreature()) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ class AmnesiaEffect extends OneShotEffect {
|
|||
player.revealCards("Amnesia", hand, game);
|
||||
Set<Card> cards = hand.getCards(game);
|
||||
for (Card card : cards) {
|
||||
if (card != null && !card.getCardType().contains(CardType.LAND)) {
|
||||
if (card != null && !card.isLand()) {
|
||||
player.discard(card, source, game);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -145,10 +145,10 @@ class AnafenzaTheForemostEffect extends ReplacementEffectImpl {
|
|||
Card card = game.getCard(event.getTargetId());
|
||||
if (card != null && game.getOpponents(source.getControllerId()).contains(card.getOwnerId())) { // Anafenza only cares about cards
|
||||
if (zEvent.getTarget() != null) { // if it comes from permanent, check if it was a creature on the battlefield
|
||||
if (zEvent.getTarget().getCardType().contains(CardType.CREATURE)) {
|
||||
if (zEvent.getTarget().isCreature()) {
|
||||
return true;
|
||||
}
|
||||
} else if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
} else if (card.isCreature()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -83,7 +83,7 @@ class AngelicChorusTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent.getCardType().contains(CardType.CREATURE)
|
||||
if (permanent.isCreature()
|
||||
&& permanent.getControllerId().equals(this.controllerId)) {
|
||||
this.getEffects().get(0).setValue("lifeSource", event.getTargetId());
|
||||
return true;
|
||||
|
|
|
@ -116,7 +116,7 @@ class AnimarCostReductionEffect extends CostModificationEffectImpl {
|
|||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
if (abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility) {
|
||||
Card sourceCard = game.getCard(abilityToModify.getSourceId());
|
||||
if (sourceCard != null && abilityToModify.getControllerId().equals(source.getControllerId()) && (sourceCard.getCardType().contains(CardType.CREATURE))) {
|
||||
if (sourceCard != null && abilityToModify.getControllerId().equals(source.getControllerId()) && (sourceCard.isCreature())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ class AnimateArtifactContinuousEffect extends ContinuousEffectImpl {
|
|||
Permanent enchantment = game.getPermanent(source.getSourceId());
|
||||
if (enchantment != null) {
|
||||
Permanent permanent = game.getPermanent(enchantment.getAttachedTo());
|
||||
if (permanent != null && !permanent.getCardType().contains(CardType.CREATURE)) {
|
||||
if (permanent != null && !permanent.isCreature()) {
|
||||
if (sublayer == SubLayer.NA) {
|
||||
permanent.getCardType().add(CardType.CREATURE);
|
||||
permanent.getPower().setValue(permanent.getConvertedManaCost());
|
||||
|
|
|
@ -90,7 +90,7 @@ class AnkhOfMishraAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent != null && permanent.getCardType().contains(CardType.LAND)) {
|
||||
if (permanent != null && permanent.isLand()) {
|
||||
Player player = game.getPlayer(permanent.getControllerId());
|
||||
if (player != null) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
|
|
|
@ -42,13 +42,12 @@ import mage.util.CardUtil;
|
|||
import java.util.UUID;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author noxx
|
||||
*/
|
||||
public class ArcaneMelee extends CardImpl {
|
||||
|
||||
public ArcaneMelee(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.ENCHANTMENT},"{4}{U}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.ENCHANTMENT}, "{4}{U}");
|
||||
|
||||
// Instant and sorcery spells cost {2} less to cast.
|
||||
this.addAbility(new SimpleStaticAbility(Zone.BATTLEFIELD, new ArcaneMeleeCostReductionEffect()));
|
||||
|
@ -66,7 +65,7 @@ public class ArcaneMelee extends CardImpl {
|
|||
|
||||
class ArcaneMeleeCostReductionEffect extends CostModificationEffectImpl {
|
||||
|
||||
ArcaneMeleeCostReductionEffect ( ) {
|
||||
ArcaneMeleeCostReductionEffect() {
|
||||
super(Duration.WhileOnBattlefield, Outcome.Benefit, CostModificationType.REDUCE_COST);
|
||||
staticText = "Instant and sorcery spells cost {2} less to cast";
|
||||
}
|
||||
|
@ -84,9 +83,9 @@ class ArcaneMeleeCostReductionEffect extends CostModificationEffectImpl {
|
|||
|
||||
@Override
|
||||
public boolean applies(Ability abilityToModify, Ability source, Game game) {
|
||||
if ( abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility) {
|
||||
Card sourceCard = game.getCard(((SpellAbility)abilityToModify).getSourceId());
|
||||
if ( sourceCard != null && (sourceCard.getCardType().contains(CardType.INSTANT) || sourceCard.getCardType().contains(CardType.SORCERY))) {
|
||||
if (abilityToModify instanceof SpellAbility || abilityToModify instanceof FlashbackAbility) {
|
||||
Card sourceCard = game.getCard((abilityToModify).getSourceId());
|
||||
if (sourceCard != null && (sourceCard.isInstant() || sourceCard.isSorcery())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ class ArchonOfRedemptionTriggeredAbility extends TriggeredAbilityImpl {
|
|||
UUID targetId = event.getTargetId();
|
||||
Permanent permanent = game.getPermanent(targetId);
|
||||
if (permanent.getControllerId().equals(this.controllerId)
|
||||
&& permanent.getCardType().contains(CardType.CREATURE)
|
||||
&& permanent.isCreature()
|
||||
&& (targetId.equals(this.getSourceId())
|
||||
|| (permanent.getAbilities().contains(FlyingAbility.getInstance()) && !targetId.equals(this.getSourceId())))) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
|
|
|
@ -107,7 +107,7 @@ class ArtificersHexEffect extends OneShotEffect {
|
|||
Permanent equipment = game.getPermanent(enchantment.getAttachedTo());
|
||||
if (equipment != null && equipment.getAttachedTo() != null) {
|
||||
Permanent creature = game.getPermanent(equipment.getAttachedTo());
|
||||
if (creature != null && creature.getCardType().contains(CardType.CREATURE)) {
|
||||
if (creature != null && creature.isCreature()) {
|
||||
return creature.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ class AshesOfTheFallenEffect extends ContinuousEffectImpl {
|
|||
String subtype = (String) game.getState().getValue(permanent.getId() + "_type");
|
||||
for (UUID cardId : controller.getGraveyard()) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card != null && card.getCardType().contains(CardType.CREATURE) && !card.getSubtype(game).contains(subtype)) {
|
||||
if (card != null && card.isCreature() && !card.getSubtype(game).contains(subtype)) {
|
||||
game.getState().getCreateCardAttribute(card).getSubtype().add(subtype);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
package mage.cards.a;
|
||||
|
||||
import java.util.UUID;
|
||||
|
||||
import mage.MageInt;
|
||||
import mage.MageObject;
|
||||
import mage.abilities.Ability;
|
||||
|
@ -50,13 +51,12 @@ import mage.game.events.ZoneChangeEvent;
|
|||
import mage.watchers.Watcher;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author Plopman
|
||||
*/
|
||||
public class AsmiraHolyAvenger extends CardImpl {
|
||||
|
||||
public AsmiraHolyAvenger(UUID ownerId, CardSetInfo setInfo) {
|
||||
super(ownerId,setInfo,new CardType[]{CardType.CREATURE},"{2}{G}{W}");
|
||||
super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{2}{G}{W}");
|
||||
this.supertype.add("Legendary");
|
||||
this.subtype.add("Human");
|
||||
this.subtype.add("Cleric");
|
||||
|
@ -108,7 +108,7 @@ class AsmiraHolyAvengerWatcher extends Watcher {
|
|||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) {
|
||||
MageObject card = game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
|
||||
if (card != null && ((Card)card).getOwnerId().equals(this.controllerId) && card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card != null && ((Card) card).getOwnerId().equals(this.controllerId) && card.isCreature()) {
|
||||
creaturesCount++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -95,7 +95,7 @@ public class AuraBarbs extends CardImpl {
|
|||
for (Permanent auraEnchantment : game.getBattlefield().getActivePermanents(filterEnchantments, source.getControllerId(), source.getSourceId(), game)) {
|
||||
if (auraEnchantment.getAttachedTo() != null) {
|
||||
Permanent attachedToCreature = game.getPermanent(auraEnchantment.getAttachedTo());
|
||||
if (attachedToCreature != null && attachedToCreature.getCardType().contains(CardType.CREATURE)) {
|
||||
if (attachedToCreature != null && attachedToCreature.isCreature()) {
|
||||
attachedToCreature.damage(2, auraEnchantment.getId(), game, false, true);
|
||||
game.informPlayers("2 damage assigned to " + attachedToCreature.getName() + " from " + auraEnchantment.getName());
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@ class AuraOfSilenceCostModificationEffect extends CostModificationEffectImpl {
|
|||
if (abilityToModify instanceof SpellAbility) {
|
||||
if (game.getOpponents(source.getControllerId()).contains(abilityToModify.getControllerId())) {
|
||||
Card card = game.getCard(abilityToModify.getSourceId());
|
||||
if (card != null && (card.getCardType().contains(CardType.ARTIFACT) || card.getCardType().contains(CardType.ENCHANTMENT))) {
|
||||
if (card != null && (card.isArtifact() || card.isEnchantment())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -184,7 +184,7 @@ class AureliasFuryCantCastEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
Player player = game.getPlayer(getTargetPointer().getFirst(game, source));
|
||||
if (player != null && player.getId().equals(event.getPlayerId())) {
|
||||
Card card = game.getCard(event.getSourceId());
|
||||
if (card != null && !card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card != null && !card.isCreature()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -122,7 +122,7 @@ public class Aurification extends CardImpl {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getPlayerId().equals(this.getControllerId())) {
|
||||
Permanent permanent = game.getPermanent(event.getSourceId());
|
||||
if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) {
|
||||
if (permanent != null && permanent.isCreature()) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getSourceId()));
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ class AuthorityOfTheConsulsTapEffect extends ReplacementEffectImpl {
|
|||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
|
||||
Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget();
|
||||
if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) {
|
||||
if (permanent != null && permanent.isCreature()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -85,7 +85,7 @@ class BalothCageTrapCondition implements Condition {
|
|||
List<Permanent> permanents = watcher.getThisTurnEnteringPermanents(opponentId);
|
||||
if (permanents != null) {
|
||||
for (Permanent permanent : permanents) {
|
||||
if (permanent.getCardType().contains(CardType.ARTIFACT)) {
|
||||
if (permanent.isArtifact()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ class BalustradeSpyEffect extends OneShotEffect {
|
|||
Card card = controller.getLibrary().removeFromTop(game);
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
if (card.getCardType().contains(CardType.LAND)) {
|
||||
if (card.isLand()) {
|
||||
landFound = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -107,7 +107,7 @@ class BattlefieldThaumaturgeSpellsCostReductionEffect extends CostModificationEf
|
|||
for (Target target: abilityToModify.getTargets()) {
|
||||
for (UUID uuid: target.getTargets()) {
|
||||
Permanent permanent = game.getPermanent(uuid);
|
||||
if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) {
|
||||
if (permanent != null && permanent.isCreature()) {
|
||||
creaturesTargeted.add(permanent.getId());
|
||||
}
|
||||
}
|
||||
|
|
|
@ -78,7 +78,7 @@ class BedlamEffect extends RestrictionEffect {
|
|||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
if (permanent.getCardType().contains(CardType.CREATURE)) {
|
||||
if (permanent.isCreature()) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -89,7 +89,7 @@ class BereavementTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (((ZoneChangeEvent)event).isDiesEvent()) {
|
||||
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
|
||||
if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) && permanent.getColor(game).isGreen()) {
|
||||
if (permanent != null && permanent.isCreature() && permanent.getColor(game).isGreen()) {
|
||||
this.getEffects().get(0).setTargetPointer(new FixedTarget(permanent.getControllerId()));
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -80,7 +80,7 @@ class BlackSunsZenithEffect extends OneShotEffect {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
int amount = source.getManaCostsToPay().getX();
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents()) {
|
||||
if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) {
|
||||
if (permanent != null && permanent.isCreature()) {
|
||||
permanent.addCounters(CounterType.M1M1.createInstance(amount), source, game);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ class BladeOfTheBloodChiefTriggeredAbility extends TriggeredAbilityImpl {
|
|||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
if (zEvent.getFromZone() == Zone.BATTLEFIELD && zEvent.getToZone() == Zone.GRAVEYARD) {
|
||||
Permanent p = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
|
||||
if (p != null && p.getCardType().contains(CardType.CREATURE)) {
|
||||
if (p != null && p.isCreature()) {
|
||||
Permanent enchantment = game.getPermanent(getSourceId());
|
||||
if (enchantment != null && enchantment.getAttachedTo() != null) {
|
||||
return true;
|
||||
|
|
|
@ -117,7 +117,7 @@ class BlazeCommandoTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (getControllerId().equals(game.getControllerId(event.getSourceId()))) {
|
||||
MageObject damageSource = game.getObject(event.getSourceId());
|
||||
if (damageSource != null) {
|
||||
if (damageSource.getCardType().contains(CardType.INSTANT) || damageSource.getCardType().contains(CardType.SORCERY)) {
|
||||
if (damageSource.isInstant()|| damageSource.isSorcery()) {
|
||||
if (!handledStackObjects.contains(damageSource.getId())) {
|
||||
handledStackObjects.add(damageSource.getId());
|
||||
return true;
|
||||
|
|
|
@ -118,12 +118,12 @@ class BlessedReincarnationEffect extends OneShotEffect {
|
|||
Cards cards = new CardsImpl();
|
||||
Card card = library.removeFromTop(game);
|
||||
cards.add(card);
|
||||
while (!card.getCardType().contains(CardType.CREATURE) && library.size() > 0) {
|
||||
while (!card.isCreature() && library.size() > 0) {
|
||||
card = library.removeFromTop(game);
|
||||
cards.add(card);
|
||||
}
|
||||
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card.isCreature()) {
|
||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), player.getId());
|
||||
}
|
||||
|
||||
|
|
|
@ -99,7 +99,7 @@ class BlindObedienceTapEffect extends ReplacementEffectImpl {
|
|||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
if (game.getOpponents(source.getControllerId()).contains(event.getPlayerId())) {
|
||||
Permanent permanent = ((EntersTheBattlefieldEvent) event).getTarget();
|
||||
if (permanent != null && (permanent.getCardType().contains(CardType.CREATURE) || permanent.getCardType().contains(CardType.ARTIFACT))) {
|
||||
if (permanent != null && (permanent.isCreature() || permanent.isArtifact())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ class BloodSeekerTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (game.getOpponents(this.controllerId).contains(event.getPlayerId())) {
|
||||
EntersTheBattlefieldEvent zEvent = (EntersTheBattlefieldEvent) event;
|
||||
Card card = zEvent.getTarget();
|
||||
if (card != null && card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card != null && card.isCreature()) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getPlayerId()));
|
||||
}
|
||||
|
|
|
@ -91,12 +91,12 @@ class BloodfireEnforcersCondition implements Condition {
|
|||
Player player = game.getPlayer(source.getControllerId());
|
||||
if (player != null) {
|
||||
for(Card card : player.getGraveyard().getCards(game)) {
|
||||
if (card.getCardType().contains(CardType.INSTANT)) {
|
||||
if (card.isInstant()) {
|
||||
if (sorceryFound) {
|
||||
return true;
|
||||
}
|
||||
instantFound = true;
|
||||
} else if (card.getCardType().contains(CardType.SORCERY)) {
|
||||
} else if (card.isSorcery()) {
|
||||
if (instantFound) {
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ class BloodsporeThrinaxEntersBattlefieldEffect extends ReplacementEffectImpl {
|
|||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();
|
||||
return creature != null && creature.getControllerId().equals(source.getControllerId())
|
||||
&& creature.getCardType().contains(CardType.CREATURE)
|
||||
&& creature.isCreature()
|
||||
&& !event.getTargetId().equals(source.getSourceId());
|
||||
}
|
||||
|
||||
|
|
|
@ -94,7 +94,7 @@ class BoneDancerEffect extends OneShotEffect {
|
|||
if (controller != null && defendingPlayer != null) {
|
||||
Card lastCreatureCard = null;
|
||||
for (Card card : defendingPlayer.getGraveyard().getCards(game)) {
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card.isCreature()) {
|
||||
lastCreatureCard = card;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -105,7 +105,7 @@ class BosskTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent != null && permanent.getCardType().contains(CardType.LAND) && permanent.getControllerId().equals(this.getControllerId())) {
|
||||
if (permanent != null && permanent.isLand() && permanent.getControllerId().equals(this.getControllerId())) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -110,7 +110,7 @@ class BramblewoodParagonReplacementEffect extends ReplacementEffectImpl {
|
|||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
Permanent creature = ((EntersTheBattlefieldEvent) event).getTarget();
|
||||
return creature != null && creature.getControllerId().equals(source.getControllerId())
|
||||
&& creature.getCardType().contains(CardType.CREATURE)
|
||||
&& creature.isCreature()
|
||||
&& creature.hasSubtype("Warrior", game)
|
||||
&& !event.getTargetId().equals(source.getSourceId());
|
||||
}
|
||||
|
|
|
@ -106,7 +106,7 @@ class BrutalDeceiverAbility extends LimitedTimesPerTurnActivatedAbility {
|
|||
Card card = player.getLibrary().getFromTop(game);
|
||||
cards.add(card);
|
||||
player.revealCards("Brutal Deceiver", cards, game);
|
||||
if (card != null && card.getCardType().contains(CardType.LAND)) {
|
||||
if (card != null && card.isLand()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -140,7 +140,7 @@ class CagedSunTriggeredAbility extends TriggeredManaAbility {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getPlayerId().equals(controllerId)) {
|
||||
Permanent permanent = game.getPermanentOrLKIBattlefield(event.getSourceId());
|
||||
if (permanent != null && permanent.getCardType().contains(CardType.LAND)) {
|
||||
if (permanent != null && permanent.isLand()) {
|
||||
ObjectColor color = (ObjectColor) game.getState().getValue(this.sourceId + "_color");
|
||||
if (color != null && event.getData().contains(color.toString())) {
|
||||
return true;
|
||||
|
|
|
@ -96,7 +96,7 @@ public class CairnWanderer extends CardImpl {
|
|||
|
||||
if (player != null) {
|
||||
for (Card card : player.getGraveyard().getCards(game)) {
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card.isCreature()) {
|
||||
for (Ability ability : card.getAbilities(game)) {
|
||||
if (ability instanceof MageSingleton) {
|
||||
if (ability instanceof FlyingAbility
|
||||
|
|
|
@ -96,7 +96,7 @@ class CallOfTheWildEffect extends OneShotEffect {
|
|||
if (card != null) {
|
||||
Cards cards = new CardsImpl(card);
|
||||
controller.revealCards(sourceObject.getIdName(), cards, game);
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card.isCreature()) {
|
||||
controller.moveCards(card, Zone.BATTLEFIELD, source, game);
|
||||
} else {
|
||||
controller.moveCards(card, Zone.GRAVEYARD, source, game);
|
||||
|
|
|
@ -107,7 +107,7 @@ class CallerOfTheClawWatcher extends Watcher {
|
|||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.ZONE_CHANGE && ((ZoneChangeEvent) event).isDiesEvent()) {
|
||||
Permanent card = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
|
||||
if (card != null && card.getOwnerId().equals(this.controllerId) && card.getCardType().contains(CardType.CREATURE) && !(card instanceof PermanentToken)) {
|
||||
if (card != null && card.getOwnerId().equals(this.controllerId) && card.isCreature() && !(card instanceof PermanentToken)) {
|
||||
creaturesCount++;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ class CallousDeceiverEffect extends OneShotEffect {
|
|||
if (card != null) {
|
||||
cards.add(card);
|
||||
controller.revealCards(sourceObject.getIdName(), cards, game);
|
||||
if (card.getCardType().contains(CardType.LAND)) {
|
||||
if (card.isLand()) {
|
||||
game.addEffect(new BoostSourceEffect(1, 0, Duration.EndOfTurn), source);
|
||||
game.addEffect(new GainAbilitySourceEffect(FlyingAbility.getInstance(), Duration.EndOfTurn), source);
|
||||
}
|
||||
|
|
|
@ -92,7 +92,7 @@ class CarnifexDemonEffect extends OneShotEffect {
|
|||
Permanent p = game.getPermanent(source.getSourceId());
|
||||
if (p != null) {
|
||||
for (Permanent t : game.getBattlefield().getAllActivePermanents()) {
|
||||
if (t.getCardType().contains(CardType.CREATURE) && !t.getId().equals(source.getSourceId()))
|
||||
if (t.isCreature() && !t.getId().equals(source.getSourceId()))
|
||||
t.addCounters(CounterType.M1M1.createInstance(), source, game);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -173,7 +173,7 @@ class CataclysmicGearhulkEffect extends OneShotEffect {
|
|||
}
|
||||
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents()) {
|
||||
if (!chosen.contains(permanent) && !permanent.getCardType().contains(CardType.LAND)) {
|
||||
if (!chosen.contains(permanent) && !permanent.isLand()) {
|
||||
permanent.sacrifice(source.getSourceId(), game);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -86,7 +86,7 @@ class CatastropheEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
if (controller.chooseUse(outcome, "Destroy all lands? (otherwise all creatures are destroyed)", source, game)) {
|
||||
for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterLandPermanent(), controller.getId(), source.getSourceId(), game)) {
|
||||
permanent.destroy(source.getSourceId(), game, permanent.getCardType().contains(CardType.CREATURE));
|
||||
permanent.destroy(source.getSourceId(), game, permanent.isCreature());
|
||||
}
|
||||
} else {
|
||||
for (Permanent permanent: game.getBattlefield().getActivePermanents(new FilterCreaturePermanent(), controller.getId(), source.getSourceId(), game)) {
|
||||
|
|
|
@ -93,7 +93,7 @@ class CellarDoorEffect extends OneShotEffect {
|
|||
Card card = player.getLibrary().removeFromBottom(game);
|
||||
if (card != null) {
|
||||
player.moveCards(card, Zone.GRAVEYARD, source, game);
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card.isCreature()) {
|
||||
ZombieToken token = new ZombieToken();
|
||||
token.putOntoBattlefield(1, game, source.getSourceId(), source.getControllerId());
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ class CerebralEruptionEffect extends OneShotEffect {
|
|||
for (Permanent perm : game.getBattlefield().getAllActivePermanents(filter, player.getId(), game)) {
|
||||
perm.damage(damage, source.getSourceId(), game, false, true);
|
||||
}
|
||||
if (card.getCardType().contains(CardType.LAND)) {
|
||||
if (card.isLand()) {
|
||||
Card spellCard = game.getStack().getSpell(source.getSourceId()).getCard();
|
||||
if (spellCard != null) {
|
||||
player.moveCards(spellCard, Zone.HAND, source, game);
|
||||
|
|
|
@ -109,7 +109,7 @@ class ChandraTheFirebrandAbility extends DelayedTriggeredAbility {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getPlayerId().equals(this.getControllerId())) {
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
if (spell != null && (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY))) {
|
||||
if (spell != null && (spell.isInstant() || spell.isSorcery())) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
}
|
||||
|
|
|
@ -121,7 +121,7 @@ class ChandraTorchOfDefianceEffect extends OneShotEffect {
|
|||
boolean exiledCardWasCast = false;
|
||||
controller.moveCardToExileWithInfo(card, source.getSourceId(), sourceObject.getIdName(), source.getSourceId(), game, Zone.LIBRARY, true);
|
||||
if (!card.getManaCost().isEmpty())
|
||||
if (controller.chooseUse(Outcome.Benefit, "Cast the card? (You still pay the costs)", source, game) && !card.getCardType().contains(CardType.LAND)) {
|
||||
if (controller.chooseUse(Outcome.Benefit, "Cast the card? (You still pay the costs)", source, game) && !card.isLand()) {
|
||||
// LinkedHashMap<UUID, ActivatedAbility> useableAbilities = controller.getUseableActivatedAbilities(card, Zone.EXILED, game);
|
||||
// for (ActivatedAbility ability : useableAbilities.values()) {
|
||||
//
|
||||
|
|
|
@ -108,9 +108,9 @@ class ChandrasPhoenixTriggeredAbility extends TriggeredAbilityImpl {
|
|||
}
|
||||
if (sourceObjectDamage != null) {
|
||||
if (sourceObjectDamage.getColor(game).isRed()
|
||||
&& (sourceObjectDamage.getCardType().contains(CardType.PLANESWALKER)
|
||||
|| sourceObjectDamage.getCardType().contains(CardType.INSTANT)
|
||||
|| sourceObjectDamage.getCardType().contains(CardType.SORCERY))) {
|
||||
&& (sourceObjectDamage.isPlaneswalker()
|
||||
|| sourceObjectDamage.isInstant()
|
||||
|| sourceObjectDamage.isSorcery())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ class ChorusOfTheConclaveReplacementEffect extends ReplacementEffectImpl {
|
|||
if (event.getPlayerId().equals(source.getControllerId())) {
|
||||
MageObject spellObject = game.getObject(event.getSourceId());
|
||||
if (spellObject != null) {
|
||||
return spellObject.getCardType().contains(CardType.CREATURE);
|
||||
return spellObject.isCreature();
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
|
|
@ -151,7 +151,7 @@ class ChronatogTotemCondition implements Condition {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
return permanent.getCardType().contains(CardType.CREATURE);
|
||||
return permanent.isCreature();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -102,7 +102,7 @@ class CircleOfFlameTriggeredAbility extends TriggeredAbilityImpl {
|
|||
} else{ // check attacks your planeswalker
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
youOrYourPlaneswalker = permanent != null
|
||||
&& permanent.getCardType().contains(CardType.PLANESWALKER)
|
||||
&& permanent.isPlaneswalker()
|
||||
&& permanent.getControllerId().equals(this.getControllerId());
|
||||
}
|
||||
if (youOrYourPlaneswalker) {
|
||||
|
|
|
@ -87,7 +87,7 @@ class CityOfTraitorsTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent land = game.getPermanent(event.getTargetId());
|
||||
return land.getCardType().contains(CardType.LAND)
|
||||
return land.isLand()
|
||||
&& land.getControllerId().equals(this.controllerId)
|
||||
&& !Objects.equals(event.getTargetId(), this.getSourceId());
|
||||
}
|
||||
|
|
|
@ -127,7 +127,7 @@ class CivilizedScholarEffect extends OneShotEffect {
|
|||
if (player != null) {
|
||||
player.drawCards(1, game);
|
||||
Card card = player.discardOne(false, source, game);
|
||||
if (card != null && card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card != null && card.isCreature()) {
|
||||
Permanent permanent = game.getPermanent(source.getSourceId());
|
||||
if (permanent != null) {
|
||||
permanent.untap(game);
|
||||
|
|
|
@ -166,7 +166,7 @@ class CloneShellDiesEffect extends OneShotEffect {
|
|||
if (!imprinted.isEmpty()) {
|
||||
Card imprintedCard = game.getCard(imprinted.get(0));
|
||||
imprintedCard.setFaceDown(false, game);
|
||||
if (imprintedCard.getCardType().contains(CardType.CREATURE)) {
|
||||
if (imprintedCard.isCreature()) {
|
||||
controller.moveCards(imprintedCard, Zone.BATTLEFIELD, source, game);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -116,7 +116,7 @@ class CobraTrapWatcher extends Watcher {
|
|||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == EventType.DESTROYED_PERMANENT) {
|
||||
Permanent perm = (Permanent) game.getPermanentOrLKIBattlefield(event.getTargetId()); // can regenerate or be indestructible
|
||||
if (perm != null && !perm.getCardType().contains(CardType.CREATURE)) {
|
||||
if (perm != null && !perm.isCreature()) {
|
||||
if (!game.getStack().isEmpty()) {
|
||||
StackObject spell = game.getStack().getStackObject(event.getSourceId());
|
||||
if (spell != null && game.getOpponents(perm.getControllerId()).contains(spell.getControllerId())) {
|
||||
|
|
|
@ -92,7 +92,7 @@ class CoercedConfessionMillEffect extends OneShotEffect {
|
|||
Cards cards = new CardsImpl();
|
||||
for(Card card: player.getLibrary().getTopCards(game, 4)) {
|
||||
cards.add(card);
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card.isCreature()) {
|
||||
++foundCreatures;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ class ComeuppanceEffect extends PreventionEffectImpl {
|
|||
MageObject damageDealingObject = game.getObject(event.getSourceId());
|
||||
UUID objectControllerId = null;
|
||||
if (damageDealingObject instanceof Permanent) {
|
||||
if (((Permanent) damageDealingObject).getCardType().contains(CardType.CREATURE)) {
|
||||
if (((Permanent) damageDealingObject).isCreature()) {
|
||||
((Permanent) damageDealingObject).damage(preventionData.getPreventedDamage(), source.getSourceId(), game, false, true);
|
||||
} else {
|
||||
objectControllerId = ((Permanent) damageDealingObject).getControllerId();
|
||||
|
@ -129,7 +129,7 @@ class ComeuppanceEffect extends PreventionEffectImpl {
|
|||
Permanent targetPermanent = game.getPermanent(event.getTargetId());
|
||||
if (targetPermanent != null &&
|
||||
targetPermanent.getControllerId().equals(source.getControllerId()) &&
|
||||
targetPermanent.getCardType().contains(CardType.PLANESWALKER)) {
|
||||
targetPermanent.isPlaneswalker()) {
|
||||
catched = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,7 +91,7 @@ class CompulsiveResearchDiscardEffect extends OneShotEffect {
|
|||
Card card = targetPlayer.getHand().get(target.getFirstTarget(), game);
|
||||
if (card != null) {
|
||||
targetPlayer.discard(card, source, game);
|
||||
if (!card.getCardType().contains(CardType.LAND) && !targetPlayer.getHand().isEmpty()) {
|
||||
if (!card.isLand() && !targetPlayer.getHand().isEmpty()) {
|
||||
targetPlayer.discard(1, false, source, game);
|
||||
}
|
||||
return true;
|
||||
|
|
|
@ -115,7 +115,7 @@ class ConduitOfRuinWatcher extends Watcher {
|
|||
public void watch(GameEvent event, Game game) {
|
||||
if (event.getType() == GameEvent.EventType.SPELL_CAST) {
|
||||
Spell spell = (Spell) game.getObject(event.getTargetId());
|
||||
if (spell != null && spell.getCardType().contains(CardType.CREATURE)) {
|
||||
if (spell != null && spell.isCreature()) {
|
||||
if (playerCreatureSpells.containsKey(event.getPlayerId())) {
|
||||
playerCreatureSpells.put(event.getPlayerId(), playerCreatureSpells.get(event.getPlayerId()) + 1);
|
||||
} else {
|
||||
|
@ -149,7 +149,7 @@ class FirstCastCreatureSpellPredicate implements ObjectPlayerPredicate<ObjectPla
|
|||
@Override
|
||||
public boolean apply(ObjectPlayer<Controllable> input, Game game) {
|
||||
if (input.getObject() instanceof Spell
|
||||
&& ((Spell) input.getObject()).getCardType().contains(CardType.CREATURE)) {
|
||||
&& ((Spell) input.getObject()).isCreature()) {
|
||||
ConduitOfRuinWatcher watcher = (ConduitOfRuinWatcher) game.getState().getWatchers().get("FirstCreatureSpellCastThisTurn");
|
||||
return watcher != null && watcher.creatureSpellsCastThisTurn(input.getPlayerId()) == 0;
|
||||
}
|
||||
|
|
|
@ -103,26 +103,26 @@ class ConspiracyEffect extends ContinuousEffectImpl {
|
|||
// in graveyard
|
||||
for (UUID cardId : controller.getGraveyard()) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card.isCreature()) {
|
||||
setCreatureSubtype(card, choice, game);
|
||||
}
|
||||
}
|
||||
// on Hand
|
||||
for (UUID cardId : controller.getHand()) {
|
||||
Card card = game.getCard(cardId);
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card.isCreature()) {
|
||||
setCreatureSubtype(card, choice, game);
|
||||
}
|
||||
}
|
||||
// in Exile
|
||||
for (Card card : game.getState().getExile().getAllCards(game)) {
|
||||
if (card.getOwnerId().equals(controller.getId()) && card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card.getOwnerId().equals(controller.getId()) && card.isCreature()) {
|
||||
setCreatureSubtype(card, choice, game);
|
||||
}
|
||||
}
|
||||
// in Library (e.g. for Mystical Teachings)
|
||||
for (Card card : controller.getLibrary().getCards(game)) {
|
||||
if (card.getOwnerId().equals(controller.getId()) && card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card.getOwnerId().equals(controller.getId()) && card.isCreature()) {
|
||||
setCreatureSubtype(card, choice, game);
|
||||
}
|
||||
}
|
||||
|
@ -130,7 +130,7 @@ class ConspiracyEffect extends ContinuousEffectImpl {
|
|||
for (UUID commanderId : controller.getCommandersIds()) {
|
||||
if (game.getState().getZone(commanderId) == Zone.COMMAND) {
|
||||
Card card = game.getCard(commanderId);
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card.isCreature()) {
|
||||
setCreatureSubtype(card, choice, game);
|
||||
}
|
||||
}
|
||||
|
@ -140,7 +140,7 @@ class ConspiracyEffect extends ContinuousEffectImpl {
|
|||
StackObject stackObject = iterator.next();
|
||||
if (stackObject instanceof Spell &&
|
||||
stackObject.getControllerId().equals(source.getControllerId()) &&
|
||||
stackObject.getCardType().contains(CardType.CREATURE)) {
|
||||
stackObject.isCreature()) {
|
||||
Card card = ((Spell) stackObject).getCard();
|
||||
setCreatureSubtype(card, choice, game);
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ class ConsumingAberrationEffect extends OneShotEffect {
|
|||
Card card = player.getLibrary().removeFromTop(game);
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
if(card.getCardType().contains(CardType.LAND)){
|
||||
if(card.isLand()){
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -126,7 +126,7 @@ class ContainmentPriestReplacementEffect extends ReplacementEffectImpl {
|
|||
if (entersTransformed instanceof Boolean && (Boolean) entersTransformed && card.getSecondCardFace() != null) {
|
||||
card = card.getSecondCardFace();
|
||||
}
|
||||
if (card.getCardType().contains(CardType.CREATURE)) { // TODO: Bestow Card cast as Enchantment probably not handled correctly
|
||||
if (card.isCreature()) { // TODO: Bestow Card cast as Enchantment probably not handled correctly
|
||||
CreatureWasCastWatcher watcher = (CreatureWasCastWatcher) game.getState().getWatchers().get("CreatureWasCast");
|
||||
if (watcher != null && !watcher.wasCreatureCastThisTurn(event.getTargetId())) {
|
||||
return true;
|
||||
|
|
|
@ -114,6 +114,6 @@ class ContaminationReplacementEffect extends ReplacementEffectImpl {
|
|||
@Override
|
||||
public boolean applies(GameEvent event, Ability source, Game game) {
|
||||
MageObject mageObject = game.getObject(event.getSourceId());
|
||||
return mageObject != null && mageObject.getCardType().contains(CardType.LAND);
|
||||
return mageObject != null && mageObject.isLand();
|
||||
}
|
||||
}
|
||||
|
|
|
@ -111,7 +111,7 @@ class ContestedWarZoneAbility extends TriggeredAbilityImpl {
|
|||
DamagedPlayerEvent damageEvent = (DamagedPlayerEvent)event;
|
||||
if (damageEvent.isCombatDamage()) {
|
||||
Permanent permanent = game.getPermanent(event.getSourceId());
|
||||
if (damageEvent.getPlayerId().equals(getControllerId()) && permanent != null && permanent.getCardType().contains(CardType.CREATURE)) {
|
||||
if (damageEvent.getPlayerId().equals(getControllerId()) && permanent != null && permanent.isCreature()) {
|
||||
game.getState().setValue(getSourceId().toString(), permanent.getControllerId());
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -97,7 +97,7 @@ class CorpseDanceEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
Card lastCreatureCard = null;
|
||||
for (Card card : controller.getGraveyard().getCards(game)) {
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card.isCreature()) {
|
||||
lastCreatureCard = card;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -109,7 +109,7 @@ class CorpsejackMenaceReplacementEffect extends ReplacementEffectImpl {
|
|||
permanent = game.getPermanentEntering(event.getTargetId());
|
||||
}
|
||||
if (permanent != null && permanent.getControllerId().equals(source.getControllerId())
|
||||
&& permanent.getCardType().contains(CardType.CREATURE)) {
|
||||
&& permanent.isCreature()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -108,7 +108,7 @@ class CountrysideCrusherEffect extends OneShotEffect {
|
|||
while (controller.getLibrary().size() > 0) {
|
||||
Card card = controller.getLibrary().getFromTop(game);
|
||||
cards.add(card);
|
||||
if (card.getCardType().contains(CardType.LAND)) {
|
||||
if (card.isLand()) {
|
||||
controller.moveCards(card, Zone.GRAVEYARD, source, game);
|
||||
} else {
|
||||
break;
|
||||
|
|
|
@ -83,7 +83,7 @@ class CowardiceTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Permanent permanent = game.getPermanent(event.getTargetId());
|
||||
if (permanent != null && permanent.getCardType().contains(CardType.CREATURE) &&
|
||||
if (permanent != null && permanent.isCreature() &&
|
||||
StackObject.class.isInstance(game.getObject(event.getSourceId()))) {
|
||||
getEffects().get(0).setTargetPointer(new FixedTarget(event.getTargetId()));
|
||||
return true;
|
||||
|
|
|
@ -93,7 +93,7 @@ class CrackdownConstructTriggeredAbility extends TriggeredAbilityImpl {
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (event.getPlayerId().equals(getControllerId())) {
|
||||
Card source = game.getPermanentOrLKIBattlefield(event.getSourceId());
|
||||
if (source != null && (source.getCardType().contains(CardType.ARTIFACT) || source.getCardType().contains(CardType.CREATURE))) {
|
||||
if (source != null && (source.isArtifact() || source.isCreature())) {
|
||||
StackAbility stackAbility = (StackAbility) game.getStack().getStackObject(event.getSourceId());
|
||||
if (!(stackAbility.getStackAbility() instanceof ActivatedManaAbilityImpl)) {
|
||||
return true;
|
||||
|
|
|
@ -95,7 +95,7 @@ class CragganwickCrematorEffect extends OneShotEffect {
|
|||
if (controller != null) {
|
||||
Card discardedCard = controller.discardOne(true, source, game);
|
||||
if (discardedCard != null
|
||||
&& discardedCard.getCardType().contains(CardType.CREATURE)) {
|
||||
&& discardedCard.isCreature()) {
|
||||
Player targetedPlayer = game.getPlayer(source.getFirstTarget());
|
||||
if (targetedPlayer != null) {
|
||||
int damage = discardedCard.getPower().getValue();
|
||||
|
|
|
@ -101,7 +101,7 @@ class CrawlingSensationTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (cardOwnerId != null
|
||||
&& card.getOwnerId().equals(getControllerId())
|
||||
&& cardType != null
|
||||
&& card.getCardType().contains(CardType.LAND)) {
|
||||
&& card.isLand()) {
|
||||
game.getState().setValue("usedOnTurn" + getControllerId() + getOriginalId(), game.getTurnNum());
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -98,9 +98,9 @@ class PunishmentEffect extends OneShotEffect {
|
|||
for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
|
||||
if (permanent != null
|
||||
&& permanent.getConvertedManaCost() == source.getManaCostsToPay().getX()
|
||||
&& (permanent.getCardType().contains(CardType.ARTIFACT)
|
||||
|| permanent.getCardType().contains(CardType.CREATURE)
|
||||
|| permanent.getCardType().contains(CardType.ENCHANTMENT))) {
|
||||
&& (permanent.isArtifact()
|
||||
|| permanent.isCreature()
|
||||
|| permanent.isEnchantment())) {
|
||||
permanent.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -89,7 +89,7 @@ class CrucibleOfWorldsEffect extends ContinuousEffectImpl {
|
|||
if (player != null) {
|
||||
for (UUID cardId: player.getGraveyard()) {
|
||||
Card card = game.getCard(cardId);
|
||||
if(card != null && card.getCardType().contains(CardType.LAND)){
|
||||
if(card != null && card.isLand()){
|
||||
PlayLandFromGraveyardAbility ability = new PlayLandFromGraveyardAbility(card.getName());
|
||||
ability.setSourceId(cardId);
|
||||
ability.setControllerId(card.getOwnerId());
|
||||
|
|
|
@ -105,7 +105,7 @@ class CruelDeceiverEffect extends OneShotEffect {
|
|||
Card card = player.getLibrary().getFromTop(game);
|
||||
cards.add(card);
|
||||
player.revealCards("Cruel Deceiver", cards, game);
|
||||
if (card != null && card.getCardType().contains(CardType.LAND)) {
|
||||
if (card != null && card.isLand()) {
|
||||
game.addEffect(new BoostSourceEffect(2,2,Duration.EndOfTurn), source);
|
||||
game.addEffect(new GainAbilitySourceEffect(TrampleAbility.getInstance(),Duration.EndOfTurn), source);
|
||||
}
|
||||
|
|
|
@ -117,7 +117,7 @@ class InstantOrSorceryCastManaCondition extends ManaCondition implements Conditi
|
|||
public boolean apply(Game game, Ability source) {
|
||||
if (source instanceof SpellAbility) {
|
||||
MageObject object = game.getObject(source.getSourceId());
|
||||
if (object != null && (object.getCardType().contains(CardType.INSTANT) || object.getCardType().contains(CardType.SORCERY))) {
|
||||
if (object != null && (object.isInstant() || object.isSorcery())) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -112,7 +112,7 @@ class CurseOfEchoesCopyTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
if (spell != null && (spell.getCardType().contains(CardType.INSTANT) || spell.getCardType().contains(CardType.SORCERY))) {
|
||||
if (spell != null && (spell.isInstant() || spell.isSorcery())) {
|
||||
Permanent enchantment = game.getPermanent(sourceId);
|
||||
if (enchantment != null && enchantment.getAttachedTo() != null) {
|
||||
Player player = game.getPlayer(enchantment.getAttachedTo());
|
||||
|
|
|
@ -75,7 +75,7 @@ class CursedTotemCantActivateEffect extends RestrictionEffect {
|
|||
|
||||
@Override
|
||||
public boolean applies(Permanent permanent, Ability source, Game game) {
|
||||
return permanent.getCardType().contains(CardType.CREATURE);
|
||||
return permanent.isCreature();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -205,7 +205,7 @@ class DarettiScrapSavantTriggeredAbility extends TriggeredAbilityImpl {
|
|||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
if (zEvent.getToZone() == Zone.GRAVEYARD
|
||||
&& zEvent.getFromZone() == Zone.BATTLEFIELD
|
||||
&& zEvent.getTarget().getCardType().contains(CardType.ARTIFACT)
|
||||
&& zEvent.getTarget().isArtifact()
|
||||
&& zEvent.getTarget().getOwnerId().equals(this.controllerId)) {
|
||||
for (Effect effect : this.getEffects()) {
|
||||
effect.setTargetPointer(new FixedTarget(zEvent.getTargetId()));
|
||||
|
|
|
@ -97,7 +97,7 @@ class DeadbridgeChantEffect extends OneShotEffect {
|
|||
if (card != null) {
|
||||
Zone targetZone = Zone.HAND;
|
||||
String text = " put into hand of ";
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card.isCreature()) {
|
||||
targetZone = Zone.BATTLEFIELD;
|
||||
text = " put onto battlefield for ";
|
||||
}
|
||||
|
|
|
@ -96,7 +96,7 @@ class DeathSparkCondition implements Condition {
|
|||
boolean nextCard = false;
|
||||
for (Card card : controller.getGraveyard().getCards(game)) {
|
||||
if (nextCard) {
|
||||
return card.getCardType().contains(CardType.CREATURE);
|
||||
return card.isCreature();
|
||||
}
|
||||
if (card.getId().equals(source.getSourceId())) {
|
||||
nextCard = true;
|
||||
|
|
|
@ -92,7 +92,7 @@ class DeathsPresenceTriggeredAbility extends TriggeredAbilityImpl {
|
|||
if (((ZoneChangeEvent) event).getToZone() == Zone.GRAVEYARD
|
||||
&& ((ZoneChangeEvent) event).getFromZone() == Zone.BATTLEFIELD) {
|
||||
Permanent permanent = (Permanent) game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD);
|
||||
if (permanent != null && permanent.getControllerId().equals(this.getControllerId()) && permanent.getCardType().contains(CardType.CREATURE)) {
|
||||
if (permanent != null && permanent.getControllerId().equals(this.getControllerId()) && permanent.isCreature()) {
|
||||
this.getTargets().clear();
|
||||
this.addTarget(new TargetControlledCreaturePermanent());
|
||||
this.getEffects().clear();
|
||||
|
|
|
@ -106,7 +106,7 @@ class DeceiverOfFormEffect extends OneShotEffect {
|
|||
if (card != null) {
|
||||
Cards cards = new CardsImpl(card);
|
||||
controller.revealCards(sourceObject.getIdName(), cards, game);
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card.isCreature()) {
|
||||
if (controller.chooseUse(outcome, "Let creatures you control other than "
|
||||
+ sourceObject.getLogName() + " becomes copies of " + card.getLogName() + " until end of turn?", source, game)) {
|
||||
for (Permanent permanent : game.getBattlefield().getAllActivePermanents(new FilterCreaturePermanent(), controller.getId(), game)) {
|
||||
|
|
|
@ -98,7 +98,7 @@ class DescendantsPathEffect extends OneShotEffect {
|
|||
return false;
|
||||
}
|
||||
controller.revealCards(sourceObject.getIdName(), new CardsImpl(card), game);
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card.isCreature()) {
|
||||
FilterControlledCreaturePermanent filter = new FilterControlledCreaturePermanent();
|
||||
boolean found = false;
|
||||
for (Permanent permanent: game.getBattlefield().getAllActivePermanents(filter, controller.getId(), game)) {
|
||||
|
|
|
@ -99,7 +99,7 @@ class DesecratorHagEffect extends OneShotEffect {
|
|||
Player you = game.getPlayer(source.getControllerId());
|
||||
if (you != null) {
|
||||
for (Card card : you.getGraveyard().getCards(game)) {
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card.isCreature()) {
|
||||
if (card.getPower().getValue() > creatureGreatestPower) {
|
||||
creatureGreatestPower = card.getPower().getValue();
|
||||
cards.clear();
|
||||
|
|
|
@ -107,7 +107,7 @@ class DestroyTheEvidenceEffect extends OneShotEffect {
|
|||
Card card = player.getLibrary().removeFromTop(game);
|
||||
if (card != null) {
|
||||
cards.add(card);
|
||||
if (card.getCardType().contains(CardType.LAND)) {
|
||||
if (card.isLand()) {
|
||||
landFound = true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -88,7 +88,7 @@ class DevoutHarpistPredicate implements ObjectPlayerPredicate<ObjectPlayer<Perma
|
|||
Permanent attachment = input.getObject();
|
||||
if (attachment != null) {
|
||||
Permanent permanent = game.getPermanent(attachment.getAttachedTo());
|
||||
if (permanent != null && permanent.getCardType().contains(CardType.CREATURE)) {
|
||||
if (permanent != null && permanent.isCreature()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -114,7 +114,7 @@ class DimensionalInfiltratorEffect extends OneShotEffect {
|
|||
Card card = opponent.getLibrary().getFromTop(game);
|
||||
if (card != null) {
|
||||
card.moveToExile(null, "Dimensional Infiltrator", source.getSourceId(), game);
|
||||
if (card.getCardType().contains(CardType.LAND)) {
|
||||
if (card.isLand()) {
|
||||
if (controller.chooseUse(Outcome.Neutral, "Return " + sourceObject.getIdName() + " to its owner's hand?", source, game)) {
|
||||
new ReturnToHandSourceEffect(true).apply(game, source);
|
||||
}
|
||||
|
|
|
@ -84,7 +84,7 @@ class DingusEggTriggeredAbility extends TriggeredAbilityImpl {
|
|||
ZoneChangeEvent zEvent = (ZoneChangeEvent) event;
|
||||
if (zEvent.getFromZone() == Zone.BATTLEFIELD
|
||||
&& zEvent.getToZone() == Zone.GRAVEYARD
|
||||
&& zEvent.getTarget().getCardType().contains(CardType.LAND)) {
|
||||
&& zEvent.getTarget().isLand()) {
|
||||
if (getTargets().isEmpty()) {
|
||||
UUID targetId = zEvent.getTarget().getControllerId();
|
||||
for (Effect effect : this.getEffects()) {
|
||||
|
|
|
@ -81,7 +81,7 @@ class DisplacementWaveEffect extends OneShotEffect {
|
|||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
for (Permanent permanent : game.getBattlefield().getActivePermanents(source.getControllerId(), game)) {
|
||||
if (!permanent.getCardType().contains(CardType.LAND) && permanent.getConvertedManaCost() <= source.getManaCostsToPay().getX()) {
|
||||
if (!permanent.isLand() && permanent.getConvertedManaCost() <= source.getManaCostsToPay().getX()) {
|
||||
permanent.moveToZone(Zone.HAND, source.getSourceId(), game, true);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -116,12 +116,12 @@ class DivergentTransformationsEffect extends OneShotEffect {
|
|||
Cards cards = new CardsImpl();
|
||||
Card card = player.getLibrary().removeFromTop(game);
|
||||
cards.add(card);
|
||||
while (!card.getCardType().contains(CardType.CREATURE) && player.getLibrary().size() > 0) {
|
||||
while (!card.isCreature() && player.getLibrary().size() > 0) {
|
||||
card = player.getLibrary().removeFromTop(game);
|
||||
cards.add(card);
|
||||
}
|
||||
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card.isCreature()) {
|
||||
card.putOntoBattlefield(game, Zone.LIBRARY, source.getSourceId(), player.getId());
|
||||
}
|
||||
|
||||
|
|
|
@ -128,7 +128,7 @@ class DomriRadeEffect1 extends OneShotEffect {
|
|||
CardsImpl cards = new CardsImpl();
|
||||
cards.add(card);
|
||||
controller.lookAtCards(sourceObject.getName(), cards, game);
|
||||
if (card.getCardType().contains(CardType.CREATURE)) {
|
||||
if (card.isCreature()) {
|
||||
if (controller.chooseUse(outcome, "Reveal " + card.getName() + " and put it into your hand?", source, game)) {
|
||||
controller.moveCards(card, Zone.HAND, source, game);
|
||||
controller.revealCards(sourceObject.getIdName(), cards, game);
|
||||
|
|
|
@ -91,7 +91,7 @@ class DragonAppeasementTriggeredAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
return event.getPlayerId().equals(this.getControllerId())
|
||||
&& game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).getCardType().contains(CardType.CREATURE);
|
||||
&& game.getLastKnownInformation(event.getTargetId(), Zone.BATTLEFIELD).isCreature();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue