mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
- CheckStyle.
This commit is contained in:
@@ -130,7 +130,7 @@ public class CostDiscard extends CostPartWithList {
|
|||||||
return handList.contains(c);
|
return handList.contains(c);
|
||||||
} else {
|
} else {
|
||||||
if (ability.isSpell()) {
|
if (ability.isSpell()) {
|
||||||
handList.remove(source);// can't pay for itself
|
handList.remove(source); // can't pay for itself
|
||||||
}
|
}
|
||||||
boolean sameName = false;
|
boolean sameName = false;
|
||||||
if (type.contains("+WithSameName")) {
|
if (type.contains("+WithSameName")) {
|
||||||
|
|||||||
@@ -362,10 +362,14 @@ public class ManaCostShard {
|
|||||||
*/
|
*/
|
||||||
public boolean canBePaidWithManaOfColor(CardColor color) {
|
public boolean canBePaidWithManaOfColor(CardColor color) {
|
||||||
// can pay with life?
|
// can pay with life?
|
||||||
if ( (this.shard & Atom.OR_2_LIFE) != 0 ) return true;
|
if ((this.shard & Atom.OR_2_LIFE) != 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
// can pay with any color?
|
// can pay with any color?
|
||||||
if ( (this.shard & Atom.OR_2_COLORLESS) != 0 || 0 != ( this.shard & Atom.COLORLESS ) ) return true;
|
if ((this.shard & Atom.OR_2_COLORLESS) != 0 || 0 != (this.shard & Atom.COLORLESS)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
// either colored part is empty, or there are same colors in shard and mana source
|
// either colored part is empty, or there are same colors in shard and mana source
|
||||||
return ( 0xFF & this.shard ) == 0 || ( color.getColor() & this.shard ) > 0;
|
return (0xFF & this.shard) == 0 || (color.getColor() & this.shard) > 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -179,8 +179,8 @@ public class ManaPool {
|
|||||||
public final int clearPool(boolean isEndOfPhase) {
|
public final int clearPool(boolean isEndOfPhase) {
|
||||||
int numRemoved = 0;
|
int numRemoved = 0;
|
||||||
|
|
||||||
if (isEndOfPhase &&
|
if (isEndOfPhase
|
||||||
Singletons.getModel().getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.manapoolsDontEmpty)) {
|
&& Singletons.getModel().getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.manapoolsDontEmpty)) {
|
||||||
return numRemoved;
|
return numRemoved;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ public abstract class ReplacementEffect extends TriggerReplacementBase {
|
|||||||
if (Expressions.compare(left, comparator, compareTo)) {
|
if (Expressions.compare(left, comparator, compareTo)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
} else if (sa != null && sa.doTrigger(false)){
|
} else if (sa != null && sa.doTrigger(false)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -89,7 +89,7 @@ public class ReplacementHandler {
|
|||||||
* the run params,same as for triggers.
|
* the run params,same as for triggers.
|
||||||
* @return true if the event was replaced.
|
* @return true if the event was replaced.
|
||||||
*/
|
*/
|
||||||
public ReplacementResult run(final HashMap<String, Object> runParams, final ReplacementLayer layer,final Player decider) {
|
public ReplacementResult run(final HashMap<String, Object> runParams, final ReplacementLayer layer, final Player decider) {
|
||||||
|
|
||||||
final List<ReplacementEffect> possibleReplacers = new ArrayList<ReplacementEffect>();
|
final List<ReplacementEffect> possibleReplacers = new ArrayList<ReplacementEffect>();
|
||||||
// Round up Non-static replacement effects ("Until EOT," or
|
// Round up Non-static replacement effects ("Until EOT," or
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ public class AbilityManaPart implements java.io.Serializable {
|
|||||||
private String origProduced;
|
private String origProduced;
|
||||||
private String lastExpressChoice = "";
|
private String lastExpressChoice = "";
|
||||||
private String manaRestrictions = "";
|
private String manaRestrictions = "";
|
||||||
transient private ArrayList<Mana> lastProduced = new ArrayList<Mana>();
|
private transient ArrayList<Mana> lastProduced = new ArrayList<Mana>();
|
||||||
private int amount = 1;
|
private int amount = 1;
|
||||||
|
|
||||||
/** The reflected. */
|
/** The reflected. */
|
||||||
@@ -54,9 +54,9 @@ public class AbilityManaPart implements java.io.Serializable {
|
|||||||
/** The canceled. */
|
/** The canceled. */
|
||||||
private boolean canceled = false;
|
private boolean canceled = false;
|
||||||
|
|
||||||
transient private final Card sourceCard;
|
private final transient Card sourceCard;
|
||||||
|
|
||||||
transient private Cost cost;
|
private transient Cost cost;
|
||||||
|
|
||||||
// Spells paid with this mana spell can't be countered.
|
// Spells paid with this mana spell can't be countered.
|
||||||
private boolean cannotCounterSpell;
|
private boolean cannotCounterSpell;
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
package forge.card.spellability;
|
package forge.card.spellability;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will collect here essential methods needed to hold ability on stack and resolve
|
* Will collect here essential methods needed to hold ability on stack and resolve.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public interface ISpellAbility {
|
public interface ISpellAbility {
|
||||||
|
|||||||
@@ -512,7 +512,7 @@ public abstract class SpellAbility implements ISpellAbility {
|
|||||||
return params == null ? null : params.get(key);
|
return params == null ? null : params.get(key);
|
||||||
}
|
}
|
||||||
public boolean hasParam(String key) {
|
public boolean hasParam(String key) {
|
||||||
return params == null ? false: params.containsKey(key);
|
return params == null ? false : params.containsKey(key);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -520,8 +520,9 @@ public abstract class SpellAbility implements ISpellAbility {
|
|||||||
* @param mapParams
|
* @param mapParams
|
||||||
*/
|
*/
|
||||||
public void copyParamsToMap(Map<String, String> mapParams) {
|
public void copyParamsToMap(Map<String, String> mapParams) {
|
||||||
if ( null != params )
|
if (null != params) {
|
||||||
mapParams.putAll(params);
|
mapParams.putAll(params);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// If this is not null, then ability was made in a factory
|
// If this is not null, then ability was made in a factory
|
||||||
@@ -1702,10 +1703,12 @@ public abstract class SpellAbility implements ISpellAbility {
|
|||||||
public SpellAbility getParentTargetingCard() {
|
public SpellAbility getParentTargetingCard() {
|
||||||
SpellAbility parent = this;
|
SpellAbility parent = this;
|
||||||
|
|
||||||
while( parent.getParent() != null)
|
while (parent.getParent() != null) {
|
||||||
{
|
|
||||||
Target tgt = parent.getTarget();
|
Target tgt = parent.getTarget();
|
||||||
if ( tgt != null && tgt.getTargetCards() != null && !tgt.getTargetCards().isEmpty() ) break;
|
if (tgt != null && tgt.getTargetCards() != null && !tgt.getTargetCards().isEmpty()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
parent = parent.getParent();
|
parent = parent.getParent();
|
||||||
}
|
}
|
||||||
return parent;
|
return parent;
|
||||||
@@ -1720,10 +1723,12 @@ public abstract class SpellAbility implements ISpellAbility {
|
|||||||
*/
|
*/
|
||||||
public SpellAbility getParentTargetingSA() {
|
public SpellAbility getParentTargetingSA() {
|
||||||
SpellAbility parent = this;
|
SpellAbility parent = this;
|
||||||
while( parent.getParent() != null)
|
while (parent.getParent() != null) {
|
||||||
{
|
|
||||||
Target tgt = parent.getTarget();
|
Target tgt = parent.getTarget();
|
||||||
if ( tgt != null && tgt.getTargetSAs() != null && !tgt.getTargetSAs().isEmpty() ) break;
|
if (tgt != null && tgt.getTargetSAs() != null && !tgt.getTargetSAs().isEmpty()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
parent = parent.getParent();
|
parent = parent.getParent();
|
||||||
}
|
}
|
||||||
return parent;
|
return parent;
|
||||||
@@ -1738,10 +1743,12 @@ public abstract class SpellAbility implements ISpellAbility {
|
|||||||
*/
|
*/
|
||||||
public SpellAbility getParentTargetingPlayer() {
|
public SpellAbility getParentTargetingPlayer() {
|
||||||
SpellAbility parent = this;
|
SpellAbility parent = this;
|
||||||
while( parent.getParent() != null)
|
while (parent.getParent() != null) {
|
||||||
{
|
|
||||||
Target tgt = parent.getTarget();
|
Target tgt = parent.getTarget();
|
||||||
if ( tgt != null && tgt.getTargetPlayers() != null && !tgt.getTargetPlayers().isEmpty() ) break;
|
if (tgt != null && tgt.getTargetPlayers() != null && !tgt.getTargetPlayers().isEmpty()) {
|
||||||
|
break;
|
||||||
|
}
|
||||||
parent = parent.getParent();
|
parent = parent.getParent();
|
||||||
}
|
}
|
||||||
return parent;
|
return parent;
|
||||||
@@ -1759,8 +1766,9 @@ public abstract class SpellAbility implements ISpellAbility {
|
|||||||
* TODO: Write javadoc for this method.
|
* TODO: Write javadoc for this method.
|
||||||
*/
|
*/
|
||||||
public void undo() {
|
public void undo() {
|
||||||
if ( isUndoable() )
|
if (isUndoable()) {
|
||||||
this.payCosts.refundPaidCost(sourceCard);
|
this.payCosts.refundPaidCost(sourceCard);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -249,9 +249,9 @@ public class SpellPermanent extends Spell {
|
|||||||
sourceCard.addLeavesPlayCommand(this.championCommandLeavesPlay);
|
sourceCard.addLeavesPlayCommand(this.championCommandLeavesPlay);
|
||||||
}
|
}
|
||||||
|
|
||||||
if(this.getManaCost().contains("X"))
|
if (this.getManaCost().contains("X")) {
|
||||||
{
|
|
||||||
if(!this.getSourceCard().getSVar("X").equals("")) {
|
if (!this.getSourceCard().getSVar("X").equals("")) {
|
||||||
this.setSVar("X", this.getSourceCard().getSVar("X"));
|
this.setSVar("X", this.getSourceCard().getSVar("X"));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -349,8 +349,8 @@ public class SpellPermanent extends Spell {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check on legendary
|
// check on legendary
|
||||||
if (card.isType("Legendary") &&
|
if (card.isType("Legendary")
|
||||||
!Singletons.getModel().getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noLegendRule)) {
|
&& !Singletons.getModel().getGame().getStaticEffects().getGlobalRuleChange(GlobalRuleChange.noLegendRule)) {
|
||||||
final List<Card> list = ai.getCardsIn(ZoneType.Battlefield);
|
final List<Card> list = ai.getCardsIn(ZoneType.Battlefield);
|
||||||
if (Iterables.any(list, CardPredicates.nameEquals(card.getName()))) {
|
if (Iterables.any(list, CardPredicates.nameEquals(card.getName()))) {
|
||||||
return false;
|
return false;
|
||||||
@@ -391,7 +391,7 @@ public class SpellPermanent extends Spell {
|
|||||||
}
|
}
|
||||||
|
|
||||||
final List<Card> cl = this.championGetCreature.get();
|
final List<Card> cl = this.championGetCreature.get();
|
||||||
if ( !(cl.size() > 0) || !this.getSourceCard().isInZone(ZoneType.Hand)) {
|
if (!(cl.size() > 0) || !this.getSourceCard().isInZone(ZoneType.Hand)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -718,7 +718,9 @@ public class Target {
|
|||||||
boolean canTarget = (!isTargeted || c.canBeTargetedBy(sa));
|
boolean canTarget = (!isTargeted || c.canBeTargetedBy(sa));
|
||||||
boolean isAlreadyTargeted = this.getTargetCards().contains(c);
|
boolean isAlreadyTargeted = this.getTargetCards().contains(c);
|
||||||
//System.out.print(c);
|
//System.out.print(c);
|
||||||
if ( isValidTarget && canTarget && !isAlreadyTargeted ) return true;
|
if (isValidTarget && canTarget && !isAlreadyTargeted) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user