mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
removed an unreferenced method and renamed another method
This commit is contained in:
@@ -1078,18 +1078,6 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
this.clones.add(c);
|
this.clones.add(c);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* <p>
|
|
||||||
* addClones.
|
|
||||||
* </p>
|
|
||||||
*
|
|
||||||
* @param c
|
|
||||||
* a {@link java.util.ArrayList} object.
|
|
||||||
*/
|
|
||||||
public final void addClones(final ArrayList<Card> c) {
|
|
||||||
this.clones.addAll(c);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
* clearClones.
|
* clearClones.
|
||||||
@@ -1169,15 +1157,15 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
/**
|
/**
|
||||||
* Can have counters placed on it.
|
* Can have counters placed on it.
|
||||||
*
|
*
|
||||||
* @param counterName
|
* @param type
|
||||||
* the counter name
|
* the counter name
|
||||||
* @return true, if successful
|
* @return true, if successful
|
||||||
*/
|
*/
|
||||||
public final boolean canHaveCountersPlacedOnIt(final CounterType counterName) {
|
public final boolean canReceiveCounters(final CounterType type) {
|
||||||
if (this.hasKeyword("CARDNAME can't have counters placed on it.")) {
|
if (this.hasKeyword("CARDNAME can't have counters placed on it.")) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.isCreature() && counterName == CounterType.M1M1) {
|
if (this.isCreature() && type == CounterType.M1M1) {
|
||||||
for (final Card c : this.getController().getCreaturesInPlay()) { // look for Melira, Sylvok Outcast
|
for (final Card c : this.getController().getCreaturesInPlay()) { // look for Melira, Sylvok Outcast
|
||||||
if (c.hasKeyword("Creatures you control can't have -1/-1 counters placed on them.")) {
|
if (c.hasKeyword("Creatures you control can't have -1/-1 counters placed on them.")) {
|
||||||
return false;
|
return false;
|
||||||
@@ -1188,7 +1176,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final int getTotalCountersToAdd(final CounterType counterType, final int baseAmount, final boolean applyMultiplier) {
|
public final int getTotalCountersToAdd(final CounterType counterType, final int baseAmount, final boolean applyMultiplier) {
|
||||||
if (!this.canHaveCountersPlacedOnIt(counterType)) {
|
if (!this.canReceiveCounters(counterType)) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
final int multiplier = applyMultiplier ? this.getController().getCounterDoublersMagnitude(counterType) : 1;
|
final int multiplier = applyMultiplier ? this.getController().getCounterDoublersMagnitude(counterType) : 1;
|
||||||
@@ -1197,7 +1185,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final void addCounter(final CounterType counterType, final int n, final boolean applyMultiplier) {
|
public final void addCounter(final CounterType counterType, final int n, final boolean applyMultiplier) {
|
||||||
if (!this.canHaveCountersPlacedOnIt(counterType)) {
|
if (!this.canReceiveCounters(counterType)) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
final int multiplier = applyMultiplier ? this.getController().getCounterDoublersMagnitude(counterType) : 1;
|
final int multiplier = applyMultiplier ? this.getController().getCounterDoublersMagnitude(counterType) : 1;
|
||||||
|
|||||||
@@ -49,7 +49,7 @@ public class CountersPutAi extends SpellAbilityAi {
|
|||||||
list = CardLists.filter(player.getCardsIn(ZoneType.Battlefield), new Predicate<Card>() {
|
list = CardLists.filter(player.getCardsIn(ZoneType.Battlefield), new Predicate<Card>() {
|
||||||
@Override
|
@Override
|
||||||
public boolean apply(final Card c) {
|
public boolean apply(final Card c) {
|
||||||
return c.canBeTargetedBy(sa) && c.canHaveCountersPlacedOnIt(CounterType.valueOf(type));
|
return c.canBeTargetedBy(sa) && c.canReceiveCounters(CounterType.valueOf(type));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ public class CountersMoveEffect extends SpellAbilityEffect {
|
|||||||
for (final Card dest : tgtCards) {
|
for (final Card dest : tgtCards) {
|
||||||
if ((null != source) && (null != dest)) {
|
if ((null != source) && (null != dest)) {
|
||||||
if (!"Any".matches(counterName)) {
|
if (!"Any".matches(counterName)) {
|
||||||
if (dest.canHaveCountersPlacedOnIt(cType)
|
if (dest.canReceiveCounters(cType)
|
||||||
&& source.getCounters(cType) >= amount) {
|
&& source.getCounters(cType) >= amount) {
|
||||||
dest.addCounter(cType, amount, true);
|
dest.addCounter(cType, amount, true);
|
||||||
source.subtractCounter(cType, amount);
|
source.subtractCounter(cType, amount);
|
||||||
|
|||||||
@@ -193,7 +193,7 @@ public class CostPutCounter extends CostPartWithList {
|
|||||||
final Player activator = ability.getActivatingPlayer();
|
final Player activator = ability.getActivatingPlayer();
|
||||||
final Card source = ability.getSourceCard();
|
final Card source = ability.getSourceCard();
|
||||||
if (this.payCostFromSource()) {
|
if (this.payCostFromSource()) {
|
||||||
if (!source.canHaveCountersPlacedOnIt(this.counter)) {
|
if (!source.canReceiveCounters(this.counter)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
@@ -457,7 +457,7 @@ public final class GameActionUtil {
|
|||||||
CounterType counterType = ((CostPutCounter) part).getCounter();
|
CounterType counterType = ((CostPutCounter) part).getCounter();
|
||||||
int amount = getAmountFromPartX(part, source, sourceAbility);
|
int amount = getAmountFromPartX(part, source, sourceAbility);
|
||||||
|
|
||||||
if (false == source.canHaveCountersPlacedOnIt(counterType)) {
|
if (false == source.canReceiveCounters(counterType)) {
|
||||||
String message = String.format("Won't be able to pay upkeep for %s but it can't have %s counters put on it.", source, counterType.getName());
|
String message = String.format("Won't be able to pay upkeep for %s but it can't have %s counters put on it.", source, counterType.getName());
|
||||||
p.getGame().getGameLog().add("ResolveStack", message, 2);
|
p.getGame().getGameLog().add("ResolveStack", message, 2);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -1384,9 +1384,9 @@ public class ComputerUtilCombat {
|
|||||||
|
|
||||||
if (((attacker.hasKeyword("Indestructible") || (ComputerUtil.canRegenerate(ai, attacker) && !withoutAbilities)) && !(defender
|
if (((attacker.hasKeyword("Indestructible") || (ComputerUtil.canRegenerate(ai, attacker) && !withoutAbilities)) && !(defender
|
||||||
.hasKeyword("Wither") || defender.hasKeyword("Infect")))
|
.hasKeyword("Wither") || defender.hasKeyword("Infect")))
|
||||||
|| (attacker.hasKeyword("Persist") && !attacker.canHaveCountersPlacedOnIt(CounterType.M1M1) && (attacker
|
|| (attacker.hasKeyword("Persist") && !attacker.canReceiveCounters(CounterType.M1M1) && (attacker
|
||||||
.getCounters(CounterType.M1M1) == 0))
|
.getCounters(CounterType.M1M1) == 0))
|
||||||
|| (attacker.hasKeyword("Undying") && !attacker.canHaveCountersPlacedOnIt(CounterType.P1P1) && (attacker
|
|| (attacker.hasKeyword("Undying") && !attacker.canReceiveCounters(CounterType.P1P1) && (attacker
|
||||||
.getCounters(CounterType.P1P1) == 0))) {
|
.getCounters(CounterType.P1P1) == 0))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -1533,9 +1533,9 @@ public class ComputerUtilCombat {
|
|||||||
|
|
||||||
if (((defender.hasKeyword("Indestructible") || (ComputerUtil.canRegenerate(ai, defender) && !withoutAbilities)) && !(attacker
|
if (((defender.hasKeyword("Indestructible") || (ComputerUtil.canRegenerate(ai, defender) && !withoutAbilities)) && !(attacker
|
||||||
.hasKeyword("Wither") || attacker.hasKeyword("Infect")))
|
.hasKeyword("Wither") || attacker.hasKeyword("Infect")))
|
||||||
|| (defender.hasKeyword("Persist") && !defender.canHaveCountersPlacedOnIt(CounterType.M1M1) && (defender
|
|| (defender.hasKeyword("Persist") && !defender.canReceiveCounters(CounterType.M1M1) && (defender
|
||||||
.getCounters(CounterType.M1M1) == 0))
|
.getCounters(CounterType.M1M1) == 0))
|
||||||
|| (defender.hasKeyword("Undying") && !defender.canHaveCountersPlacedOnIt(CounterType.P1P1) && (defender
|
|| (defender.hasKeyword("Undying") && !defender.canReceiveCounters(CounterType.P1P1) && (defender
|
||||||
.getCounters(CounterType.P1P1) == 0))) {
|
.getCounters(CounterType.P1P1) == 0))) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user