mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-15 18:28:00 +00:00
- CheckStyle.
This commit is contained in:
@@ -1216,11 +1216,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
if (this.isCreature() && counterName.equals(CounterType.M1M1)) {
|
if (this.isCreature() && counterName.equals(CounterType.M1M1)) {
|
||||||
for (final Card c : this.getController().getCreaturesInPlay()) { // look
|
for (final Card c : this.getController().getCreaturesInPlay()) { // look for Melira, Sylvok Outcast
|
||||||
// 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;
|
||||||
}
|
}
|
||||||
@@ -1236,7 +1232,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
}
|
}
|
||||||
final int multiplier = applyMultiplier ? this.getController().getCounterDoublersMagnitude(counterType) : 1;
|
final int multiplier = applyMultiplier ? this.getController().getCounterDoublersMagnitude(counterType) : 1;
|
||||||
final int addAmount = (multiplier * n);
|
final int addAmount = (multiplier * n);
|
||||||
|
|
||||||
Integer oldValue = this.counters.get(counterType);
|
Integer oldValue = this.counters.get(counterType);
|
||||||
int newValue = addAmount + (oldValue == null ? 0 : oldValue.intValue());
|
int newValue = addAmount + (oldValue == null ? 0 : oldValue.intValue());
|
||||||
this.counters.put(counterType, Integer.valueOf(newValue));
|
this.counters.put(counterType, Integer.valueOf(newValue));
|
||||||
@@ -1269,13 +1265,16 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
Integer oldValue = this.counters.get(counterName);
|
Integer oldValue = this.counters.get(counterName);
|
||||||
int newValue = oldValue == null ? 0 : Math.max(oldValue.intValue() - n, 0);
|
int newValue = oldValue == null ? 0 : Math.max(oldValue.intValue() - n, 0);
|
||||||
|
|
||||||
final int delta = ( oldValue == null ? 0 : oldValue.intValue() ) - newValue;
|
final int delta = (oldValue == null ? 0 : oldValue.intValue()) - newValue;
|
||||||
if ( delta == 0 ) return;
|
if (delta == 0) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
if ( newValue > 0 )
|
if (newValue > 0) {
|
||||||
this.counters.put(counterName, Integer.valueOf(newValue));
|
this.counters.put(counterName, Integer.valueOf(newValue));
|
||||||
else
|
} else {
|
||||||
this.counters.remove(counterName);
|
this.counters.remove(counterName);
|
||||||
|
}
|
||||||
|
|
||||||
// Run triggers
|
// Run triggers
|
||||||
final Map<String, Object> runParams = new TreeMap<String, Object>();
|
final Map<String, Object> runParams = new TreeMap<String, Object>();
|
||||||
@@ -1302,7 +1301,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
|
|
||||||
this.updateObservers();
|
this.updateObservers();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void playFromSuspend() {
|
private void playFromSuspend() {
|
||||||
final Card c = this;
|
final Card c = this;
|
||||||
|
|
||||||
@@ -7379,7 +7378,7 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
* <p>
|
* <p>
|
||||||
* isAttacking.
|
* isAttacking.
|
||||||
* </p>
|
* </p>
|
||||||
*
|
* @param ge the GameEntity to check
|
||||||
* @return a boolean.
|
* @return a boolean.
|
||||||
*/
|
*/
|
||||||
public final boolean isAttacking(GameEntity ge) {
|
public final boolean isAttacking(GameEntity ge) {
|
||||||
|
|||||||
Reference in New Issue
Block a user