mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-20 12:48:00 +00:00
Merge branch 'noAbilities' into 'master'
Fix NoAbilities failing for basic land types See merge request core-developers/forge!4424
This commit is contained in:
@@ -2730,6 +2730,27 @@ public class Card extends GameEntity implements Comparable<Card>, IHasSVars {
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean hasNoAbilities() {
|
||||
if (!getUnhiddenKeywords().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
if (!getStaticAbilities().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
if (!getReplacementEffects().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
if (!getTriggers().isEmpty()) {
|
||||
return false;
|
||||
}
|
||||
for (SpellAbility sa : getSpellAbilities()) {
|
||||
if (!(sa instanceof SpellPermanent)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
public void updateSpellAbilities(List<SpellAbility> list, CardState state, Boolean mana) {
|
||||
if (hasRemoveIntrinsic()) {
|
||||
list.clear();
|
||||
|
||||
@@ -1749,7 +1749,7 @@ public class CardProperty {
|
||||
return false;
|
||||
}
|
||||
} else if (property.equals("NoAbilities")) {
|
||||
if (!((card.getAbilityText().trim().equals("") || card.isFaceDown()) && (card.getUnhiddenKeywords().isEmpty()))) {
|
||||
if (!card.hasNoAbilities()) {
|
||||
return false;
|
||||
}
|
||||
} else if (property.equals("HasCounters")) {
|
||||
|
||||
@@ -198,7 +198,6 @@ public class CardState extends GameObject implements IHasSVars {
|
||||
public final String getBasePowerString() {
|
||||
return (null == basePowerString) ? "" + getBasePower() : basePowerString;
|
||||
}
|
||||
|
||||
public final String getBaseToughnessString() {
|
||||
return (null == baseToughnessString) ? "" + getBaseToughness() : baseToughnessString;
|
||||
}
|
||||
@@ -207,7 +206,6 @@ public class CardState extends GameObject implements IHasSVars {
|
||||
public final void setBasePowerString(final String s) {
|
||||
basePowerString = s;
|
||||
}
|
||||
|
||||
public final void setBaseToughnessString(final String s) {
|
||||
baseToughnessString = s;
|
||||
}
|
||||
@@ -313,7 +311,9 @@ public class CardState extends GameObject implements IHasSVars {
|
||||
return Iterables.filter(getSpellAbilities(), SpellAbilityPredicates.isIntrinsic());
|
||||
}
|
||||
|
||||
|
||||
public final SpellAbility getFirstAbility() {
|
||||
return Iterables.getFirst(getIntrinsicSpellAbilities(), null);
|
||||
}
|
||||
public final SpellAbility getFirstSpellAbility() {
|
||||
return Iterables.getFirst(getNonManaAbilities(), null);
|
||||
}
|
||||
@@ -321,7 +321,6 @@ public class CardState extends GameObject implements IHasSVars {
|
||||
public final boolean hasSpellAbility(final SpellAbility sa) {
|
||||
return getSpellAbilities().contains(sa);
|
||||
}
|
||||
|
||||
public final boolean hasSpellAbility(final int id) {
|
||||
for (SpellAbility sa : getSpellAbilities()) {
|
||||
if (id == sa.getId()) {
|
||||
@@ -379,10 +378,6 @@ public class CardState extends GameObject implements IHasSVars {
|
||||
}
|
||||
}
|
||||
|
||||
public final SpellAbility getFirstAbility() {
|
||||
return Iterables.getFirst(getIntrinsicSpellAbilities(), null);
|
||||
}
|
||||
|
||||
public final FCollectionView<Trigger> getTriggers() {
|
||||
FCollection<Trigger> result = new FCollection<>(triggers);
|
||||
card.updateTriggers(result, this);
|
||||
@@ -467,7 +462,6 @@ public class CardState extends GameObject implements IHasSVars {
|
||||
public final boolean hasReplacementEffect(final ReplacementEffect re) {
|
||||
return getReplacementEffects().contains(re);
|
||||
}
|
||||
|
||||
public final boolean hasReplacementEffect(final int id) {
|
||||
for (final ReplacementEffect r : getReplacementEffects()) {
|
||||
if (id == r.getId()) {
|
||||
@@ -492,9 +486,8 @@ public class CardState extends GameObject implements IHasSVars {
|
||||
public final String getSVar(final String var) {
|
||||
if (sVars.containsKey(var)) {
|
||||
return sVars.get(var);
|
||||
} else {
|
||||
return "";
|
||||
}
|
||||
return "";
|
||||
}
|
||||
public final boolean hasSVar(final String var) {
|
||||
if (var == null) {
|
||||
|
||||
Reference in New Issue
Block a user