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;
|
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) {
|
public void updateSpellAbilities(List<SpellAbility> list, CardState state, Boolean mana) {
|
||||||
if (hasRemoveIntrinsic()) {
|
if (hasRemoveIntrinsic()) {
|
||||||
list.clear();
|
list.clear();
|
||||||
|
|||||||
@@ -1749,7 +1749,7 @@ public class CardProperty {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (property.equals("NoAbilities")) {
|
} else if (property.equals("NoAbilities")) {
|
||||||
if (!((card.getAbilityText().trim().equals("") || card.isFaceDown()) && (card.getUnhiddenKeywords().isEmpty()))) {
|
if (!card.hasNoAbilities()) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else if (property.equals("HasCounters")) {
|
} else if (property.equals("HasCounters")) {
|
||||||
|
|||||||
@@ -198,7 +198,6 @@ public class CardState extends GameObject implements IHasSVars {
|
|||||||
public final String getBasePowerString() {
|
public final String getBasePowerString() {
|
||||||
return (null == basePowerString) ? "" + getBasePower() : basePowerString;
|
return (null == basePowerString) ? "" + getBasePower() : basePowerString;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final String getBaseToughnessString() {
|
public final String getBaseToughnessString() {
|
||||||
return (null == baseToughnessString) ? "" + getBaseToughness() : baseToughnessString;
|
return (null == baseToughnessString) ? "" + getBaseToughness() : baseToughnessString;
|
||||||
}
|
}
|
||||||
@@ -207,7 +206,6 @@ public class CardState extends GameObject implements IHasSVars {
|
|||||||
public final void setBasePowerString(final String s) {
|
public final void setBasePowerString(final String s) {
|
||||||
basePowerString = s;
|
basePowerString = s;
|
||||||
}
|
}
|
||||||
|
|
||||||
public final void setBaseToughnessString(final String s) {
|
public final void setBaseToughnessString(final String s) {
|
||||||
baseToughnessString = s;
|
baseToughnessString = s;
|
||||||
}
|
}
|
||||||
@@ -313,7 +311,9 @@ public class CardState extends GameObject implements IHasSVars {
|
|||||||
return Iterables.filter(getSpellAbilities(), SpellAbilityPredicates.isIntrinsic());
|
return Iterables.filter(getSpellAbilities(), SpellAbilityPredicates.isIntrinsic());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public final SpellAbility getFirstAbility() {
|
||||||
|
return Iterables.getFirst(getIntrinsicSpellAbilities(), null);
|
||||||
|
}
|
||||||
public final SpellAbility getFirstSpellAbility() {
|
public final SpellAbility getFirstSpellAbility() {
|
||||||
return Iterables.getFirst(getNonManaAbilities(), null);
|
return Iterables.getFirst(getNonManaAbilities(), null);
|
||||||
}
|
}
|
||||||
@@ -321,7 +321,6 @@ public class CardState extends GameObject implements IHasSVars {
|
|||||||
public final boolean hasSpellAbility(final SpellAbility sa) {
|
public final boolean hasSpellAbility(final SpellAbility sa) {
|
||||||
return getSpellAbilities().contains(sa);
|
return getSpellAbilities().contains(sa);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean hasSpellAbility(final int id) {
|
public final boolean hasSpellAbility(final int id) {
|
||||||
for (SpellAbility sa : getSpellAbilities()) {
|
for (SpellAbility sa : getSpellAbilities()) {
|
||||||
if (id == sa.getId()) {
|
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() {
|
public final FCollectionView<Trigger> getTriggers() {
|
||||||
FCollection<Trigger> result = new FCollection<>(triggers);
|
FCollection<Trigger> result = new FCollection<>(triggers);
|
||||||
card.updateTriggers(result, this);
|
card.updateTriggers(result, this);
|
||||||
@@ -467,7 +462,6 @@ public class CardState extends GameObject implements IHasSVars {
|
|||||||
public final boolean hasReplacementEffect(final ReplacementEffect re) {
|
public final boolean hasReplacementEffect(final ReplacementEffect re) {
|
||||||
return getReplacementEffects().contains(re);
|
return getReplacementEffects().contains(re);
|
||||||
}
|
}
|
||||||
|
|
||||||
public final boolean hasReplacementEffect(final int id) {
|
public final boolean hasReplacementEffect(final int id) {
|
||||||
for (final ReplacementEffect r : getReplacementEffects()) {
|
for (final ReplacementEffect r : getReplacementEffects()) {
|
||||||
if (id == r.getId()) {
|
if (id == r.getId()) {
|
||||||
@@ -492,9 +486,8 @@ public class CardState extends GameObject implements IHasSVars {
|
|||||||
public final String getSVar(final String var) {
|
public final String getSVar(final String var) {
|
||||||
if (sVars.containsKey(var)) {
|
if (sVars.containsKey(var)) {
|
||||||
return sVars.get(var);
|
return sVars.get(var);
|
||||||
} else {
|
|
||||||
return "";
|
|
||||||
}
|
}
|
||||||
|
return "";
|
||||||
}
|
}
|
||||||
public final boolean hasSVar(final String var) {
|
public final boolean hasSVar(final String var) {
|
||||||
if (var == null) {
|
if (var == null) {
|
||||||
|
|||||||
Reference in New Issue
Block a user