mirror of
https://github.com/magefree/mage.git
synced 2025-12-24 20:41:58 -08:00
change enum comparison
This commit is contained in:
parent
36c004122a
commit
d6450eed94
32 changed files with 41 additions and 40 deletions
|
|
@ -910,7 +910,7 @@ public abstract class AbilityImpl implements Ability {
|
|||
}
|
||||
MageObject object = game.getObject(this.getSourceId());
|
||||
// emblem/planes are always actual
|
||||
if (object != null && (object instanceof Emblem || object instanceof Plane)) {
|
||||
if (object instanceof Emblem || object instanceof Plane) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -44,7 +44,7 @@ public class ExileSourceCost extends CostImpl {
|
|||
public boolean pay(Ability ability, Game game, UUID sourceId, UUID controllerId, boolean noMana, Cost costToPay) {
|
||||
MageObject sourceObject = ability.getSourceObject(game);
|
||||
Player controller = game.getPlayer(controllerId);
|
||||
if (controller != null && sourceObject != null && (sourceObject instanceof Card)) {
|
||||
if (controller != null && sourceObject instanceof Card) {
|
||||
UUID exileZoneId = null;
|
||||
String exileZoneName = "";
|
||||
if (toUniqueExileZone) {
|
||||
|
|
|
|||
|
|
@ -88,7 +88,7 @@ public class AddCardTypeTargetEffect extends ContinuousEffectImpl {
|
|||
sb.append(cardType.toString().toLowerCase(Locale.ENGLISH)).append(" ");
|
||||
}
|
||||
sb.append("in addition to its other types");
|
||||
if (getDuration().equals(Duration.EndOfTurn)) {
|
||||
if (getDuration() == Duration.EndOfTurn) {
|
||||
sb.append(" until end of turn");
|
||||
}
|
||||
return sb.toString();
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public class DiesReplacementEffect extends ReplacementEffectImpl {
|
|||
public DiesReplacementEffect(MageObjectReference objectRef, Duration duration) {
|
||||
super(duration, Outcome.Exile);
|
||||
this.objectRef = objectRef;
|
||||
staticText = "If that creature would die " + (duration.equals(Duration.EndOfTurn) ? "this turn" : "") + ", exile it instead";
|
||||
staticText = "If that creature would die " + (duration == Duration.EndOfTurn ? "this turn" : "") + ", exile it instead";
|
||||
}
|
||||
|
||||
public DiesReplacementEffect(final DiesReplacementEffect effect) {
|
||||
|
|
|
|||
|
|
@ -63,7 +63,7 @@ class SpellCastManaCondition extends ManaCondition implements Condition {
|
|||
public boolean apply(Game game, Ability source) {
|
||||
if (source instanceof SpellAbility) {
|
||||
MageObject object = game.getObject(source.getSourceId());
|
||||
if (object != null && (object instanceof StackObject)) {
|
||||
if ((object instanceof StackObject)) {
|
||||
return filter.match((StackObject) object, source.getSourceId(), source.getControllerId(), game);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -84,8 +84,7 @@ class MonarchDealsCombatDamageToAPlayerTriggeredAbility extends TriggeredAbility
|
|||
public boolean checkTrigger(GameEvent event, Game game) {
|
||||
if (((DamagedPlayerEvent) event).isCombatDamage()) {
|
||||
MageObject damagingObject = game.getObject(event.getSourceId());
|
||||
if (damagingObject != null
|
||||
&& damagingObject instanceof Permanent
|
||||
if (damagingObject instanceof Permanent
|
||||
&& damagingObject.isCreature()
|
||||
&& event.getTargetId().equals(game.getMonarchId())) {
|
||||
setControllerId(event.getPlayerId());
|
||||
|
|
|
|||
|
|
@ -353,4 +353,11 @@ public interface Permanent extends Card, Controllable {
|
|||
|
||||
void setCreateOrder(int createOrder);
|
||||
|
||||
default boolean isAttachedTo(UUID otherId){
|
||||
if(getAttachedTo() == null){
|
||||
return false;
|
||||
}
|
||||
return getAttachedTo().equals(otherId);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue