mirror of
https://github.com/magefree/mage.git
synced 2025-12-23 12:02:01 -08:00
prefer ObjectColor.isRed() to ObjectColor.contains(ObjectColor.RED)
This commit is contained in:
parent
8109532adf
commit
b5bb6dd0db
8 changed files with 9 additions and 21 deletions
|
|
@ -28,7 +28,6 @@
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.ObjectColor;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.cards.CardImpl;
|
import mage.cards.CardImpl;
|
||||||
|
|
@ -69,8 +68,6 @@ public class ConsignToDream extends CardImpl {
|
||||||
|
|
||||||
class ConsignToDreamEffect extends OneShotEffect {
|
class ConsignToDreamEffect extends OneShotEffect {
|
||||||
|
|
||||||
boolean applied = false;
|
|
||||||
|
|
||||||
public ConsignToDreamEffect() {
|
public ConsignToDreamEffect() {
|
||||||
super(Outcome.ReturnToHand);
|
super(Outcome.ReturnToHand);
|
||||||
this.staticText = "Return target permanent to its owner's hand. If that permanent is red or green, put it on top of its owner's library instead";
|
this.staticText = "Return target permanent to its owner's hand. If that permanent is red or green, put it on top of its owner's library instead";
|
||||||
|
|
@ -87,10 +84,10 @@ class ConsignToDreamEffect extends OneShotEffect {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(Game game, Ability source) {
|
public boolean apply(Game game, Ability source) {
|
||||||
|
boolean applied = false;
|
||||||
Permanent target = game.getPermanent(source.getFirstTarget());
|
Permanent target = game.getPermanent(source.getFirstTarget());
|
||||||
if (target != null) {
|
if (target != null) {
|
||||||
if (target.getColor(game).contains(ObjectColor.RED)
|
if (target.getColor(game).isRed() || target.getColor(game).isGreen()) {
|
||||||
|| target.getColor(game).contains(ObjectColor.GREEN)) {
|
|
||||||
applied = target.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
applied = target.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||||
} else {
|
} else {
|
||||||
applied = target.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
applied = target.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@
|
||||||
package mage.cards.c;
|
package mage.cards.c;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.ObjectColor;
|
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
import mage.abilities.costs.mana.GenericManaCost;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.effects.common.DoIfCostPaid;
|
import mage.abilities.effects.common.DoIfCostPaid;
|
||||||
|
|
@ -89,7 +88,7 @@ class CrystalRodAbility extends TriggeredAbilityImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||||
return spell != null && spell.getColor(game).contains(ObjectColor.BLUE);
|
return spell != null && spell.getColor(game).isBlue();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,6 @@ package mage.cards.f;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.MageInt;
|
import mage.MageInt;
|
||||||
import mage.ObjectColor;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.common.SimpleStaticAbility;
|
import mage.abilities.common.SimpleStaticAbility;
|
||||||
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||||
|
|
@ -122,8 +121,7 @@ class FiendslayerPaladinEffect extends ContinuousRuleModifyingEffectImpl {
|
||||||
Card targetCard = game.getCard(event.getTargetId());
|
Card targetCard = game.getCard(event.getTargetId());
|
||||||
StackObject stackObject = (StackObject) game.getStack().getStackObject(event.getSourceId());
|
StackObject stackObject = (StackObject) game.getStack().getStackObject(event.getSourceId());
|
||||||
if (targetCard != null && stackObject != null && targetCard.getId().equals(source.getSourceId())) {
|
if (targetCard != null && stackObject != null && targetCard.getId().equals(source.getSourceId())) {
|
||||||
if (stackObject.getColor(game).contains(ObjectColor.BLACK)
|
if (stackObject.getColor(game).isBlack() || stackObject.getColor(game).isRed()) {
|
||||||
|| stackObject.getColor(game).contains(ObjectColor.RED)) {
|
|
||||||
if (!stackObject.getControllerId().equals(source.getControllerId())
|
if (!stackObject.getControllerId().equals(source.getControllerId())
|
||||||
&& stackObject.getCardType().contains(CardType.INSTANT)
|
&& stackObject.getCardType().contains(CardType.INSTANT)
|
||||||
|| stackObject.getCardType().contains(CardType.SORCERY)) {
|
|| stackObject.getCardType().contains(CardType.SORCERY)) {
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@
|
||||||
package mage.cards.i;
|
package mage.cards.i;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.ObjectColor;
|
|
||||||
import mage.abilities.Ability;
|
import mage.abilities.Ability;
|
||||||
import mage.abilities.effects.OneShotEffect;
|
import mage.abilities.effects.OneShotEffect;
|
||||||
import mage.abilities.effects.common.PreventAllDamageByAllPermanentsEffect;
|
import mage.abilities.effects.common.PreventAllDamageByAllPermanentsEffect;
|
||||||
|
|
@ -95,8 +94,7 @@ class InquisitorsSnareEffect extends OneShotEffect {
|
||||||
FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||||
filter.add(new PermanentIdPredicate(targetCreature.getId()));
|
filter.add(new PermanentIdPredicate(targetCreature.getId()));
|
||||||
game.addEffect(new PreventAllDamageByAllPermanentsEffect(filter, Duration.EndOfTurn, false), source);
|
game.addEffect(new PreventAllDamageByAllPermanentsEffect(filter, Duration.EndOfTurn, false), source);
|
||||||
if (targetCreature.getColor(game).contains(ObjectColor.BLACK)
|
if (targetCreature.getColor(game).isBlack() || targetCreature.getColor(game).isRed()) {
|
||||||
|| targetCreature.getColor(game).contains(ObjectColor.RED)) {
|
|
||||||
return targetCreature.destroy(source.getSourceId(), game, false);
|
return targetCreature.destroy(source.getSourceId(), game, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@
|
||||||
package mage.cards.i;
|
package mage.cards.i;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.ObjectColor;
|
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
import mage.abilities.costs.mana.GenericManaCost;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.effects.common.DoIfCostPaid;
|
import mage.abilities.effects.common.DoIfCostPaid;
|
||||||
|
|
@ -45,7 +44,6 @@ import mage.game.stack.Spell;
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @author KholdFuzion
|
* @author KholdFuzion
|
||||||
|
|
||||||
*/
|
*/
|
||||||
public class IronStar extends CardImpl {
|
public class IronStar extends CardImpl {
|
||||||
|
|
||||||
|
|
@ -89,7 +87,7 @@ class IronStarAbility extends TriggeredAbilityImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||||
return spell != null && spell.getColor(game).contains(ObjectColor.RED);
|
return spell != null && spell.getColor(game).isRed();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -88,7 +88,7 @@ class IvoryCupAbility extends TriggeredAbilityImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||||
return spell != null && spell.getColor(game).contains(ObjectColor.WHITE);
|
return spell != null && spell.getColor(game).isWhite();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@
|
||||||
package mage.cards.t;
|
package mage.cards.t;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.ObjectColor;
|
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
import mage.abilities.costs.mana.GenericManaCost;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.effects.common.DoIfCostPaid;
|
import mage.abilities.effects.common.DoIfCostPaid;
|
||||||
|
|
@ -89,7 +88,7 @@ class ThroneOfBoneAbility extends TriggeredAbilityImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||||
return spell != null && spell.getColor(game).contains(ObjectColor.BLACK);
|
return spell != null && spell.getColor(game).isBlack();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
|
|
@ -28,7 +28,6 @@
|
||||||
package mage.cards.w;
|
package mage.cards.w;
|
||||||
|
|
||||||
import java.util.UUID;
|
import java.util.UUID;
|
||||||
import mage.ObjectColor;
|
|
||||||
import mage.abilities.TriggeredAbilityImpl;
|
import mage.abilities.TriggeredAbilityImpl;
|
||||||
import mage.abilities.costs.mana.GenericManaCost;
|
import mage.abilities.costs.mana.GenericManaCost;
|
||||||
import mage.abilities.effects.common.DoIfCostPaid;
|
import mage.abilities.effects.common.DoIfCostPaid;
|
||||||
|
|
@ -89,7 +88,7 @@ class WoodenSphereAbility extends TriggeredAbilityImpl {
|
||||||
@Override
|
@Override
|
||||||
public boolean checkTrigger(GameEvent event, Game game) {
|
public boolean checkTrigger(GameEvent event, Game game) {
|
||||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||||
return spell != null && spell.getColor(game).contains(ObjectColor.GREEN);
|
return spell != null && spell.getColor(game).isGreen();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue