Some cleanup (#6211)

Co-authored-by: tool4EvEr <tool4EvEr@192.168.0.59>
This commit is contained in:
tool4ever
2024-09-28 18:04:41 +02:00
committed by GitHub
parent 6169285cdb
commit 86dc3a4d5e
9 changed files with 9 additions and 30 deletions

View File

@@ -1,7 +1,5 @@
package forge.game;
import com.google.common.collect.Iterables;
import forge.card.CardTypeView;
import forge.card.ColorSet;
import forge.card.MagicColor;
@@ -17,7 +15,6 @@ import forge.game.mana.Mana;
import forge.game.mana.ManaCostBeingPaid;
import forge.game.player.Player;
import forge.game.spellability.SpellAbility;
import forge.game.spellability.SpellAbilityPredicates;
import forge.game.spellability.TargetChoices;
import forge.game.staticability.StaticAbility;
import forge.game.staticability.StaticAbilityCastWithFlash;
@@ -147,7 +144,7 @@ public class ForgeScript {
}
return false;
} else if (property.equals("hasManaAbility")) {
if (Iterables.any(cardState.getSpellAbilities(), SpellAbilityPredicates.isManaAbility())) {
if (!cardState.getManaAbilities().isEmpty()) {
return true;
}
for (final Trigger trig : cardState.getTriggers()) {

View File

@@ -84,12 +84,6 @@ public class CardProperty {
}
}
return found;
} else if (property.startsWith("DifferentNameThan")) {
for (Card c : AbilityUtils.getDefinedCards(source, property.substring(17), spellAbility)) {
if (card.sharesNameWith(c)) {
return false;
}
}
} else if (property.equals("NamedByRememberedPlayer")) {
if (!source.hasRemembered()) {
final Card newCard = game.getCardState(source);
@@ -482,10 +476,6 @@ public class CardProperty {
if (enchantedPlayer == null || enchantedPlayer.isEnchantedBy(card.getName())) {
return false;
}
} else if (property.equals("NotAttachedTo")) {
if (source.hasCardAttachment(card)) {
return false;
}
} else if (property.startsWith("EnchantedBy")) {
if (property.equals("EnchantedBy")) {
if (!card.isEnchantedBy(source) && !card.equals(source.getEntityAttachedTo())) {
@@ -1276,10 +1266,6 @@ public class CardProperty {
if (card.getBlockedThisTurn().isEmpty()) {
return false;
}
} else if (property.startsWith("notBlockedThisTurn")) {
if (!card.getBlockedThisTurn().isEmpty()) {
return false;
}
} else if (property.startsWith("notExertedThisTurn")) {
if (card.getExertedThisTurn() > 0) {
return false;

View File

@@ -78,7 +78,7 @@ public class PlayerProperty {
return false;
}
} else if (property.equals("descended")) {
if (!(player.getDescended() > 0)) {
if (player.getDescended() < 1) {
return false;
}
} else if (property.equals("committedCrimeThisTurn")) {
@@ -243,10 +243,6 @@ public class PlayerProperty {
if (!player.isEnchantedBy(source)) {
return false;
}
} else if (property.equals("NotEnchantedBy")) {
if (player.isEnchantedBy(source)) {
return false;
}
} else if (property.equals("EnchantedController")) {
Card enchanting = source.getEnchantingCard();
if (enchanting == null || !player.equals(enchanting.getController())) {