mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 02:38:02 +00:00
- CheckStyle.
This commit is contained in:
@@ -656,6 +656,9 @@ public class Card extends GameEntity implements Comparable<Card> {
|
|||||||
this.imprintedCards.addAll(list);
|
this.imprintedCards.addAll(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* TODO: Write javadoc for this method.
|
||||||
|
*/
|
||||||
public final void removeImprinted(final Object o) {
|
public final void removeImprinted(final Object o) {
|
||||||
this.imprintedCards.remove(o);
|
this.imprintedCards.remove(o);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -419,7 +419,7 @@ public class ChangeZoneEffect extends SpellEffect {
|
|||||||
tgtC.clearUnEnchantCommand();
|
tgtC.clearUnEnchantCommand();
|
||||||
}
|
}
|
||||||
tgtC.enchantEntity(attachedTo);
|
tgtC.enchantEntity(attachedTo);
|
||||||
} else {//Equipment
|
} else { //Equipment
|
||||||
if (tgtC.isEquipping()) {
|
if (tgtC.isEquipping()) {
|
||||||
final Card oldEquiped = tgtC.getEquippingCard();
|
final Card oldEquiped = tgtC.getEquippingCard();
|
||||||
tgtC.removeEquipping(oldEquiped);
|
tgtC.removeEquipping(oldEquiped);
|
||||||
@@ -689,7 +689,7 @@ public class ChangeZoneEffect extends SpellEffect {
|
|||||||
c.clearUnEnchantCommand();
|
c.clearUnEnchantCommand();
|
||||||
}
|
}
|
||||||
c.enchantEntity(attachedTo);
|
c.enchantEntity(attachedTo);
|
||||||
} else {//Equipment
|
} else { //Equipment
|
||||||
if (c.isEquipping()) {
|
if (c.isEquipping()) {
|
||||||
final Card oldEquiped = c.getEquippingCard();
|
final Card oldEquiped = c.getEquippingCard();
|
||||||
c.removeEquipping(oldEquiped);
|
c.removeEquipping(oldEquiped);
|
||||||
|
|||||||
@@ -52,8 +52,8 @@ public class DiscardEffect extends RevealEffectBase {
|
|||||||
sb.append("All");
|
sb.append("All");
|
||||||
} else if (sa.hasParam("AnyNumber")) {
|
} else if (sa.hasParam("AnyNumber")) {
|
||||||
sb.append("any number");
|
sb.append("any number");
|
||||||
} else if (sa.hasParam("NumCards") && sa.getParam("NumCards").equals("X") &&
|
} else if (sa.hasParam("NumCards") && sa.getParam("NumCards").equals("X")
|
||||||
sa.getSVar("X").equals("Remembered$Amount")) {
|
&& sa.getSVar("X").equals("Remembered$Amount")) {
|
||||||
sb.append("that many");
|
sb.append("that many");
|
||||||
} else {
|
} else {
|
||||||
sb.append(numCards);
|
sb.append(numCards);
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ public class CostExile extends CostPartWithList {
|
|||||||
if (this.sameZone && amount != null) {
|
if (this.sameZone && amount != null) {
|
||||||
boolean foundPayable = false;
|
boolean foundPayable = false;
|
||||||
List<Player> players = game.getPlayers();
|
List<Player> players = game.getPlayers();
|
||||||
for(Player p : players) {
|
for (Player p : players) {
|
||||||
if (CardLists.filter(typeList, CardPredicates.isController(p)).size() >= amount) {
|
if (CardLists.filter(typeList, CardPredicates.isController(p)).size() >= amount) {
|
||||||
foundPayable = true;
|
foundPayable = true;
|
||||||
break;
|
break;
|
||||||
@@ -283,7 +283,7 @@ public class CostExile extends CostPartWithList {
|
|||||||
} else if (this.sameZone) {
|
} else if (this.sameZone) {
|
||||||
List<Player> players = game.getPlayers();
|
List<Player> players = game.getPlayers();
|
||||||
List<Player> payableZone = new ArrayList<Player>();
|
List<Player> payableZone = new ArrayList<Player>();
|
||||||
for(Player p : players) {
|
for (Player p : players) {
|
||||||
List<Card> enoughType = CardLists.filter(list, CardPredicates.isOwner(p));
|
List<Card> enoughType = CardLists.filter(list, CardPredicates.isOwner(p));
|
||||||
if (enoughType.size() < c) {
|
if (enoughType.size() < c) {
|
||||||
list.removeAll(enoughType);
|
list.removeAll(enoughType);
|
||||||
|
|||||||
@@ -190,7 +190,7 @@ public class ManaPool {
|
|||||||
return numRemoved;
|
return numRemoved;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isEndOfPhase && this.owner.hasKeyword("Green mana doesn't empty from your mana pool as steps and phases end.")){
|
if (isEndOfPhase && this.owner.hasKeyword("Green mana doesn't empty from your mana pool as steps and phases end.")) {
|
||||||
// Omnath in play, clear all non-green mana
|
// Omnath in play, clear all non-green mana
|
||||||
int i = 0;
|
int i = 0;
|
||||||
while (i < this.floatingMana.size()) {
|
while (i < this.floatingMana.size()) {
|
||||||
|
|||||||
@@ -483,7 +483,7 @@ public class SpellPermanent extends Spell {
|
|||||||
final SpellAbility exSA = af.getAbility(card.getSVar(execute), card);
|
final SpellAbility exSA = af.getAbility(card.getSVar(execute), card);
|
||||||
|
|
||||||
if (api != null) {
|
if (api != null) {
|
||||||
if(exSA.getApi() != api) {
|
if (exSA.getApi() != api) {
|
||||||
continue;
|
continue;
|
||||||
} else {
|
} else {
|
||||||
rightapi = true;
|
rightapi = true;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ package forge.card.trigger;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* TriggerWaiting is just a small object to keep track of things that occurred that need to be run
|
* TriggerWaiting is just a small object to keep track of things that occurred that need to be run.
|
||||||
*/
|
*/
|
||||||
public class TriggerWaiting {
|
public class TriggerWaiting {
|
||||||
private TriggerType mode;
|
private TriggerType mode;
|
||||||
|
|||||||
@@ -165,9 +165,10 @@ public class Deck extends DeckBase {
|
|||||||
|
|
||||||
//This if clause is really only necessary when cloning decks that were
|
//This if clause is really only necessary when cloning decks that were
|
||||||
//around before schemes.
|
//around before schemes.
|
||||||
if(this.schemes != null)
|
if (this.schemes != null) {
|
||||||
result.schemes.addAll(this.schemes);
|
result.schemes.addAll(this.schemes);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* (non-Javadoc)
|
* (non-Javadoc)
|
||||||
|
|||||||
@@ -249,10 +249,12 @@ public class DeckgenUtil {
|
|||||||
|
|
||||||
deckList.append(dName == null ? "" : dName + nl + nl);
|
deckList.append(dName == null ? "" : dName + nl + nl);
|
||||||
|
|
||||||
if(deck.getAvatar() != null)
|
if (deck.getAvatar() != null) {
|
||||||
deckList.append("Avatar: " + deck.getAvatar().getName() + nl + nl);
|
deckList.append("Avatar: " + deck.getAvatar().getName() + nl + nl);
|
||||||
if(deck.getCommander() != null)
|
}
|
||||||
|
if (deck.getCommander() != null) {
|
||||||
deckList.append("Commander: " + deck.getCommander().getName() + nl + nl);
|
deckList.append("Commander: " + deck.getCommander().getName() + nl + nl);
|
||||||
|
}
|
||||||
|
|
||||||
for (final Entry<String, Integer> ev : deckMap.entrySet()) {
|
for (final Entry<String, Integer> ev : deckMap.entrySet()) {
|
||||||
deckList.append(ev.getValue() + " x " + ev.getKey() + nl);
|
deckList.append(ev.getValue() + " x " + ev.getKey() + nl);
|
||||||
@@ -311,24 +313,23 @@ public class DeckgenUtil {
|
|||||||
public static Deck generateSchemeDeck() {
|
public static Deck generateSchemeDeck() {
|
||||||
Deck res = new Deck();
|
Deck res = new Deck();
|
||||||
|
|
||||||
Iterable<CardPrinted> allSchemes = Iterables.filter(CardDb.instance().getAllNonTraditionalCards(),CardPrinted.Predicates.type("Scheme"));
|
Iterable<CardPrinted> allSchemes = Iterables.filter(CardDb.instance().getAllNonTraditionalCards(), CardPrinted.Predicates.type("Scheme"));
|
||||||
|
|
||||||
for(int i=0;i<20;i++) {
|
for (int i = 0; i < 20; i++) {
|
||||||
CardPrinted cp = Iterables.get(allSchemes, MyRandom.getRandom().nextInt(Iterables.size(allSchemes)));
|
CardPrinted cp = Iterables.get(allSchemes, MyRandom.getRandom().nextInt(Iterables.size(allSchemes)));
|
||||||
int appearances = 0;
|
int appearances = 0;
|
||||||
for(CardPrinted added : res.getSchemes().toFlatList()) {
|
for (CardPrinted added : res.getSchemes().toFlatList()) {
|
||||||
if(added.getName().equals(cp.getName()))
|
if (added.getName().equals(cp.getName())) {
|
||||||
{
|
|
||||||
appearances++;
|
appearances++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if(appearances < 2)
|
if (appearances < 2) {
|
||||||
{
|
|
||||||
res.getSchemes().add(cp);
|
res.getSchemes().add(cp);
|
||||||
}
|
} else {
|
||||||
else
|
|
||||||
{
|
|
||||||
i--;
|
i--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -125,8 +125,8 @@ public class GameNew {
|
|||||||
|
|
||||||
// mark card as difficult for AI to play
|
// mark card as difficult for AI to play
|
||||||
if (player.isComputer() && card.getSVar("RemAIDeck").equals("True") && !rAICards.contains(card.getName())) {
|
if (player.isComputer() && card.getSVar("RemAIDeck").equals("True") && !rAICards.contains(card.getName())) {
|
||||||
if (Singletons.getModel().getMatch().getGameType() != GameType.Draft &&
|
if (Singletons.getModel().getMatch().getGameType() != GameType.Draft
|
||||||
Singletons.getModel().getMatch().getGameType() != GameType.Sealed) {
|
&& Singletons.getModel().getMatch().getGameType() != GameType.Sealed) {
|
||||||
rAICards.add(card.getName());
|
rAICards.add(card.getName());
|
||||||
// get card picture so that it is in the image cache
|
// get card picture so that it is in the image cache
|
||||||
// ImageCache.getImage(card);
|
// ImageCache.getImage(card);
|
||||||
@@ -250,7 +250,7 @@ public class GameNew {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Iterable<Card> schemes = p.getValue().getSchemes();
|
Iterable<Card> schemes = p.getValue().getSchemes();
|
||||||
if(schemes != null) {
|
if (schemes != null) {
|
||||||
player.setSchemeDeck(schemes);
|
player.setSchemeDeck(schemes);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -58,8 +58,8 @@ public class MatchStartHelper {
|
|||||||
@Override
|
@Override
|
||||||
public Iterable<Card> get() {
|
public Iterable<Card> get() {
|
||||||
List<Card> res = new ArrayList<Card>();
|
List<Card> res = new ArrayList<Card>();
|
||||||
for(CardPrinted cp : schemes)
|
for (CardPrinted cp : schemes) {
|
||||||
{
|
|
||||||
res.add(cp.toForgeCard());
|
res.add(cp.toForgeCard());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -272,8 +272,9 @@ public class PhaseHandler extends MyObservable implements java.io.Serializable {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case MAIN1:
|
case MAIN1:
|
||||||
if(this.getPlayerTurn().isArchenemy())
|
if (this.getPlayerTurn().isArchenemy()) {
|
||||||
this.getPlayerTurn().setSchemeInMotion();
|
this.getPlayerTurn().setSchemeInMotion();
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case COMBAT_BEGIN:
|
case COMBAT_BEGIN:
|
||||||
@@ -724,20 +725,20 @@ public class PhaseHandler extends MyObservable implements java.io.Serializable {
|
|||||||
//is turned face down and put on the bottom of its owner's scheme
|
//is turned face down and put on the bottom of its owner's scheme
|
||||||
//deck the next time a player would receive priority.
|
//deck the next time a player would receive priority.
|
||||||
//(This is a state-based action. See rule 704.)
|
//(This is a state-based action. See rule 704.)
|
||||||
for (int i=0; i<game.getCardsIn(ZoneType.Command).size();i++) {
|
for (int i = 0; i < game.getCardsIn(ZoneType.Command).size(); i++) {
|
||||||
Card c = game.getCardsIn(ZoneType.Command).get(i);
|
Card c = game.getCardsIn(ZoneType.Command).get(i);
|
||||||
if(c.isScheme() && !c.isType("Ongoing"))
|
if (c.isScheme() && !c.isType("Ongoing")) {
|
||||||
{
|
|
||||||
boolean foundonstack = false;
|
boolean foundonstack = false;
|
||||||
for(SpellAbilityStackInstance si : game.getStack().getStack()) {
|
for (SpellAbilityStackInstance si : game.getStack().getStack()) {
|
||||||
if(si.getSourceCard().equals(c))
|
if (si.getSourceCard().equals(c)) {
|
||||||
{
|
|
||||||
foundonstack = true;
|
foundonstack = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(!foundonstack)
|
if (!foundonstack) {
|
||||||
{
|
|
||||||
game.getTriggerHandler().suppressMode(TriggerType.ChangesZone);
|
game.getTriggerHandler().suppressMode(TriggerType.ChangesZone);
|
||||||
c.getController().getZone(ZoneType.Command).remove(c);
|
c.getController().getZone(ZoneType.Command).remove(c);
|
||||||
i--;
|
i--;
|
||||||
|
|||||||
Reference in New Issue
Block a user