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;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.cards.CardImpl;
|
||||
|
|
@ -69,8 +68,6 @@ public class ConsignToDream extends CardImpl {
|
|||
|
||||
class ConsignToDreamEffect extends OneShotEffect {
|
||||
|
||||
boolean applied = false;
|
||||
|
||||
public ConsignToDreamEffect() {
|
||||
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";
|
||||
|
|
@ -87,10 +84,10 @@ class ConsignToDreamEffect extends OneShotEffect {
|
|||
|
||||
@Override
|
||||
public boolean apply(Game game, Ability source) {
|
||||
boolean applied = false;
|
||||
Permanent target = game.getPermanent(source.getFirstTarget());
|
||||
if (target != null) {
|
||||
if (target.getColor(game).contains(ObjectColor.RED)
|
||||
|| target.getColor(game).contains(ObjectColor.GREEN)) {
|
||||
if (target.getColor(game).isRed() || target.getColor(game).isGreen()) {
|
||||
applied = target.moveToZone(Zone.LIBRARY, source.getSourceId(), game, true);
|
||||
} else {
|
||||
applied = target.moveToZone(Zone.HAND, source.getSourceId(), game, false);
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
package mage.cards.c;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
|
|
@ -89,7 +88,7 @@ class CrystalRodAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
return spell != null && spell.getColor(game).contains(ObjectColor.BLUE);
|
||||
return spell != null && spell.getColor(game).isBlue();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ package mage.cards.f;
|
|||
|
||||
import java.util.UUID;
|
||||
import mage.MageInt;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.common.SimpleStaticAbility;
|
||||
import mage.abilities.effects.ContinuousRuleModifyingEffectImpl;
|
||||
|
|
@ -122,8 +121,7 @@ class FiendslayerPaladinEffect extends ContinuousRuleModifyingEffectImpl {
|
|||
Card targetCard = game.getCard(event.getTargetId());
|
||||
StackObject stackObject = (StackObject) game.getStack().getStackObject(event.getSourceId());
|
||||
if (targetCard != null && stackObject != null && targetCard.getId().equals(source.getSourceId())) {
|
||||
if (stackObject.getColor(game).contains(ObjectColor.BLACK)
|
||||
|| stackObject.getColor(game).contains(ObjectColor.RED)) {
|
||||
if (stackObject.getColor(game).isBlack() || stackObject.getColor(game).isRed()) {
|
||||
if (!stackObject.getControllerId().equals(source.getControllerId())
|
||||
&& stackObject.getCardType().contains(CardType.INSTANT)
|
||||
|| stackObject.getCardType().contains(CardType.SORCERY)) {
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
package mage.cards.i;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.Ability;
|
||||
import mage.abilities.effects.OneShotEffect;
|
||||
import mage.abilities.effects.common.PreventAllDamageByAllPermanentsEffect;
|
||||
|
|
@ -95,8 +94,7 @@ class InquisitorsSnareEffect extends OneShotEffect {
|
|||
FilterCreaturePermanent filter = new FilterCreaturePermanent();
|
||||
filter.add(new PermanentIdPredicate(targetCreature.getId()));
|
||||
game.addEffect(new PreventAllDamageByAllPermanentsEffect(filter, Duration.EndOfTurn, false), source);
|
||||
if (targetCreature.getColor(game).contains(ObjectColor.BLACK)
|
||||
|| targetCreature.getColor(game).contains(ObjectColor.RED)) {
|
||||
if (targetCreature.getColor(game).isBlack() || targetCreature.getColor(game).isRed()) {
|
||||
return targetCreature.destroy(source.getSourceId(), game, false);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
package mage.cards.i;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
|
|
@ -45,7 +44,6 @@ import mage.game.stack.Spell;
|
|||
/**
|
||||
*
|
||||
* @author KholdFuzion
|
||||
|
||||
*/
|
||||
public class IronStar extends CardImpl {
|
||||
|
||||
|
|
@ -89,7 +87,7 @@ class IronStarAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
return spell != null && spell.getColor(game).contains(ObjectColor.RED);
|
||||
return spell != null && spell.getColor(game).isRed();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ class IvoryCupAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
return spell != null && spell.getColor(game).contains(ObjectColor.WHITE);
|
||||
return spell != null && spell.getColor(game).isWhite();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
package mage.cards.t;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
|
|
@ -89,7 +88,7 @@ class ThroneOfBoneAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
return spell != null && spell.getColor(game).contains(ObjectColor.BLACK);
|
||||
return spell != null && spell.getColor(game).isBlack();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
|
|
@ -28,7 +28,6 @@
|
|||
package mage.cards.w;
|
||||
|
||||
import java.util.UUID;
|
||||
import mage.ObjectColor;
|
||||
import mage.abilities.TriggeredAbilityImpl;
|
||||
import mage.abilities.costs.mana.GenericManaCost;
|
||||
import mage.abilities.effects.common.DoIfCostPaid;
|
||||
|
|
@ -89,7 +88,7 @@ class WoodenSphereAbility extends TriggeredAbilityImpl {
|
|||
@Override
|
||||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
Spell spell = game.getStack().getSpell(event.getTargetId());
|
||||
return spell != null && spell.getColor(game).contains(ObjectColor.GREEN);
|
||||
return spell != null && spell.getColor(game).isGreen();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue