mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 20:28:00 +00:00
Clean up
This commit is contained in:
@@ -396,7 +396,6 @@ public abstract class DeckGeneratorBase {
|
|||||||
* @return dual land names
|
* @return dual land names
|
||||||
*/
|
*/
|
||||||
protected List<String> getDualLandList() {
|
protected List<String> getDualLandList() {
|
||||||
|
|
||||||
if (colors.countColors() > 3) {
|
if (colors.countColors() > 3) {
|
||||||
addCardNameToList("Rupture Spire", dLands);
|
addCardNameToList("Rupture Spire", dLands);
|
||||||
addCardNameToList("Undiscovered Paradise", dLands);
|
addCardNameToList("Undiscovered Paradise", dLands);
|
||||||
|
|||||||
@@ -71,7 +71,6 @@ public class ArchetypeDeckGenerator extends DeckProxy implements Comparable<Arch
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Deck getDeck() {
|
public Deck getDeck() {
|
||||||
|
|
||||||
return DeckgenUtil.buildLDACArchetypeDeck(archetype,format,isForAi);
|
return DeckgenUtil.buildLDACArchetypeDeck(archetype,format,isForAi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,6 @@ public class CardThemedDeckGenerator extends DeckProxy implements Comparable<Car
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Deck getDeck() {
|
public Deck getDeck() {
|
||||||
|
|
||||||
return DeckgenUtil.buildCardGenDeck(name,format,isForAi);
|
return DeckgenUtil.buildCardGenDeck(name,format,isForAi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -497,8 +497,6 @@ public class CardThemedDeckBuilder extends DeckGeneratorBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
protected void addLowCMCCard(){
|
protected void addLowCMCCard(){
|
||||||
final Iterable<PaperCard> nonLands = Iterables.filter(rankedColorList,
|
final Iterable<PaperCard> nonLands = Iterables.filter(rankedColorList,
|
||||||
Predicates.compose(CardRulesPredicates.Presets.IS_NON_LAND, PaperCard.FN_GET_RULES));
|
Predicates.compose(CardRulesPredicates.Presets.IS_NON_LAND, PaperCard.FN_GET_RULES));
|
||||||
@@ -692,7 +690,6 @@ public class CardThemedDeckBuilder extends DeckGeneratorBase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// do not update landsNeeded until after the loop, because the
|
// do not update landsNeeded until after the loop, because the
|
||||||
// calculation involves landsNeeded
|
// calculation involves landsNeeded
|
||||||
for (int i = 0; i < 5; i++) {
|
for (int i = 0; i < 5; i++) {
|
||||||
@@ -845,7 +842,6 @@ public class CardThemedDeckBuilder extends DeckGeneratorBase {
|
|||||||
rankedColorList.removeAll(landsToAdd);
|
rankedColorList.removeAll(landsToAdd);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Add random cards to the deck.
|
* Add random cards to the deck.
|
||||||
*
|
*
|
||||||
@@ -930,8 +926,6 @@ public class CardThemedDeckBuilder extends DeckGeneratorBase {
|
|||||||
rankedColorList.removeAll(keyCardList);
|
rankedColorList.removeAll(keyCardList);
|
||||||
}*/
|
}*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
final Map<Integer, Integer> creatureCosts = new HashMap<>();
|
final Map<Integer, Integer> creatureCosts = new HashMap<>();
|
||||||
for (int i = 1; i < 7; i++) {
|
for (int i = 1; i < 7; i++) {
|
||||||
creatureCosts.put(i, 0);
|
creatureCosts.put(i, 0);
|
||||||
|
|||||||
@@ -66,7 +66,6 @@ public class GauntletMini {
|
|||||||
currentRound = 1;
|
currentRound = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Advances the tournament to the next round.
|
* Advances the tournament to the next round.
|
||||||
*/
|
*/
|
||||||
@@ -206,4 +205,3 @@ public class GauntletMini {
|
|||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -33,8 +33,7 @@ public abstract class LimitedWinLoseController {
|
|||||||
|
|
||||||
if (lastGame.isWinner(GamePlayerUtil.getGuiPlayer())) {
|
if (lastGame.isWinner(GamePlayerUtil.getGuiPlayer())) {
|
||||||
gauntlet.addWin();
|
gauntlet.addWin();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
gauntlet.addLoss();
|
gauntlet.addLoss();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -515,8 +515,7 @@ public class SealedCardPoolGenerator {
|
|||||||
return null; //return null if user canceled
|
return null; //return null if user canceled
|
||||||
}
|
}
|
||||||
pool.addAllFlat(cards);
|
pool.addAllFlat(cards);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
pool.addAllFlat(prod.get());
|
pool.addAllFlat(prod.get());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -83,8 +83,7 @@ public class InputBlock extends InputSyncronizedBase {
|
|||||||
|
|
||||||
if (currentAttacker == null) {
|
if (currentAttacker == null) {
|
||||||
showMessage(localizer.getMessage("lblSelectBlockTarget"));
|
showMessage(localizer.getMessage("lblSelectBlockTarget"));
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
String attackerName = currentAttacker.isFaceDown() ? localizer.getMessage("lblMorph") : currentAttacker.getName() + " (" + currentAttacker.getId() + ")";
|
String attackerName = currentAttacker.isFaceDown() ? localizer.getMessage("lblMorph") : currentAttacker.getName() + " (" + currentAttacker.getId() + ")";
|
||||||
String message = localizer.getMessage("lblSelectBlocker") + attackerName + " " + localizer.getMessage("lblOrSelectBlockTarget");
|
String message = localizer.getMessage("lblSelectBlocker") + attackerName + " " + localizer.getMessage("lblOrSelectBlockTarget");
|
||||||
showMessage(message);
|
showMessage(message);
|
||||||
@@ -104,8 +103,7 @@ public class InputBlock extends InputSyncronizedBase {
|
|||||||
// Done blocking
|
// Done blocking
|
||||||
setCurrentAttacker(null);
|
setCurrentAttacker(null);
|
||||||
stop();
|
stop();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
//must run in game thread to prevent problems for mobile game
|
//must run in game thread to prevent problems for mobile game
|
||||||
ThreadUtil.invokeInGameThread(new Runnable() {
|
ThreadUtil.invokeInGameThread(new Runnable() {
|
||||||
@Override
|
@Override
|
||||||
@@ -124,14 +122,12 @@ public class InputBlock extends InputSyncronizedBase {
|
|||||||
combat.removeFromCombat(card);
|
combat.removeFromCombat(card);
|
||||||
card.getGame().getMatch().fireEvent(new UiEventBlockerAssigned(CardView.get(card), null));
|
card.getGame().getMatch().fireEvent(new UiEventBlockerAssigned(CardView.get(card), null));
|
||||||
isCorrectAction = true;
|
isCorrectAction = true;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// is attacking?
|
// is attacking?
|
||||||
if (combat.isAttacking(card)) {
|
if (combat.isAttacking(card)) {
|
||||||
setCurrentAttacker(card);
|
setCurrentAttacker(card);
|
||||||
isCorrectAction = true;
|
isCorrectAction = true;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// Make sure this card is valid to even be a blocker
|
// Make sure this card is valid to even be a blocker
|
||||||
if (currentAttacker != null && card.isCreature() && defender.getZone(ZoneType.Battlefield).contains(card)) {
|
if (currentAttacker != null && card.isCreature() && defender.getZone(ZoneType.Battlefield).contains(card)) {
|
||||||
if (combat.isBlocking(card, currentAttacker)) {
|
if (combat.isBlocking(card, currentAttacker)) {
|
||||||
@@ -139,8 +135,7 @@ public class InputBlock extends InputSyncronizedBase {
|
|||||||
combat.removeBlockAssignment(currentAttacker, card);
|
combat.removeBlockAssignment(currentAttacker, card);
|
||||||
card.getGame().getMatch().fireEvent(new UiEventBlockerAssigned(CardView.get(card), null));
|
card.getGame().getMatch().fireEvent(new UiEventBlockerAssigned(CardView.get(card), null));
|
||||||
isCorrectAction = true;
|
isCorrectAction = true;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
isCorrectAction = CombatUtil.canBlock(currentAttacker, card, combat);
|
isCorrectAction = CombatUtil.canBlock(currentAttacker, card, combat);
|
||||||
if (isCorrectAction) {
|
if (isCorrectAction) {
|
||||||
combat.addBlocker(currentAttacker, card);
|
combat.addBlocker(currentAttacker, card);
|
||||||
|
|||||||
@@ -62,8 +62,7 @@ public class InputPlaybackControl extends InputSyncronizedBase {
|
|||||||
if (isPaused) {
|
if (isPaused) {
|
||||||
control.resume();
|
control.resume();
|
||||||
setPause(false);
|
setPause(false);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
control.pause();
|
control.pause();
|
||||||
setPause(true);
|
setPause(true);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -100,8 +100,7 @@ public class InputSelectEntitiesFromList<T extends GameEntity> extends InputSele
|
|||||||
final boolean entityWasSelected = selected.contains(c);
|
final boolean entityWasSelected = selected.contains(c);
|
||||||
if (entityWasSelected) {
|
if (entityWasSelected) {
|
||||||
selected.remove(c);
|
selected.remove(c);
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
selected.add((T)c);
|
selected.add((T)c);
|
||||||
}
|
}
|
||||||
onSelectStateChanged(c, !entityWasSelected);
|
onSelectStateChanged(c, !entityWasSelected);
|
||||||
@@ -124,8 +123,8 @@ public class InputSelectEntitiesFromList<T extends GameEntity> extends InputSele
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected void onStop() {
|
protected void onStop() {
|
||||||
getController().getGui().hideZones(getController().getPlayer().getView(),zonesShown);
|
getController().getGui().hideZones(getController().getPlayer().getView(),zonesShown);
|
||||||
getController().getGui().clearSelectables();
|
getController().getGui().clearSelectables();
|
||||||
super.onStop();
|
super.onStop();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -50,8 +50,7 @@ public abstract class InputSelectManyBase<T extends GameEntity> extends InputSyn
|
|||||||
protected void refresh() {
|
protected void refresh() {
|
||||||
if (hasAllTargets()) {
|
if (hasAllTargets()) {
|
||||||
selectButtonOK();
|
selectButtonOK();
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
this.showMessage();
|
this.showMessage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -73,7 +72,7 @@ public abstract class InputSelectManyBase<T extends GameEntity> extends InputSyn
|
|||||||
sb.append("\n\n").append(getMessage());
|
sb.append("\n\n").append(getMessage());
|
||||||
showMessage(sb.toString(), card);
|
showMessage(sb.toString(), card);
|
||||||
} else {
|
} else {
|
||||||
if (card!=null) {
|
if (card != null) {
|
||||||
showMessage(getMessage(), card);
|
showMessage(getMessage(), card);
|
||||||
} else {
|
} else {
|
||||||
showMessage(getMessage());
|
showMessage(getMessage());
|
||||||
@@ -122,6 +121,6 @@ public abstract class InputSelectManyBase<T extends GameEntity> extends InputSyn
|
|||||||
}
|
}
|
||||||
|
|
||||||
public final void setCancelAllowed(boolean allow) {
|
public final void setCancelAllowed(boolean allow) {
|
||||||
this.allowCancel = allow ;
|
this.allowCancel = allow;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -119,7 +119,7 @@ public final class InputSelectTargets extends InputSyncronizedBase {
|
|||||||
|
|
||||||
final int maxTargets = sa.getMaxTargets();
|
final int maxTargets = sa.getMaxTargets();
|
||||||
final int targeted = sa.getTargets().size();
|
final int targeted = sa.getTargets().size();
|
||||||
if(maxTargets > 1) {
|
if (maxTargets > 1) {
|
||||||
sb.append(TextUtil.concatNoSpace("\n(", String.valueOf(maxTargets - targeted), " more can be targeted)"));
|
sb.append(TextUtil.concatNoSpace("\n(", String.valueOf(maxTargets - targeted), " more can be targeted)"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -131,7 +131,7 @@ public final class InputSelectTargets extends InputSyncronizedBase {
|
|||||||
if (divisionValues != null && !divisionValues.isEmpty() && sa.getMinTargets() == 0 && sa.getTargets().size() == 0) {
|
if (divisionValues != null && !divisionValues.isEmpty() && sa.getMinTargets() == 0 && sa.getTargets().size() == 0) {
|
||||||
// extra logic for Divided with min targets = 0, should only work if num targets are 0 too
|
// extra logic for Divided with min targets = 0, should only work if num targets are 0 too
|
||||||
getController().getGui().updateButtons(getOwner(), true, true, false);
|
getController().getGui().updateButtons(getOwner(), true, true, false);
|
||||||
} else if (!sa.isMinTargetChosen() || (divisionValues != null && !divisionValues.isEmpty())){
|
} else if (!sa.isMinTargetChosen() || (divisionValues != null && !divisionValues.isEmpty())) {
|
||||||
// If reached Minimum targets, enable OK button
|
// If reached Minimum targets, enable OK button
|
||||||
if (mandatory && tgt.hasCandidates(sa)) {
|
if (mandatory && tgt.hasCandidates(sa)) {
|
||||||
// Player has to click on a target
|
// Player has to click on a target
|
||||||
|
|||||||
@@ -269,7 +269,6 @@ public class QuestAchievements {
|
|||||||
}
|
}
|
||||||
|
|
||||||
FModel.getQuest().save();
|
FModel.getQuest().save();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void addDraftToken() {
|
public void addDraftToken() {
|
||||||
|
|||||||
@@ -244,8 +244,6 @@ public class QuestAssets {
|
|||||||
this.credits = credits0;
|
this.credits = credits0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// Credits
|
// Credits
|
||||||
/**
|
/**
|
||||||
* Adds the credits.
|
* Adds the credits.
|
||||||
|
|||||||
@@ -180,7 +180,6 @@ public class QuestData {
|
|||||||
* the new name to set
|
* the new name to set
|
||||||
*/
|
*/
|
||||||
public void rename(final String newName) {
|
public void rename(final String newName) {
|
||||||
|
|
||||||
File newpath = new File(ForgeConstants.QUEST_SAVE_DIR, newName + ".dat");
|
File newpath = new File(ForgeConstants.QUEST_SAVE_DIR, newName + ".dat");
|
||||||
File oldpath = new File(ForgeConstants.QUEST_SAVE_DIR, this.name + ".dat");
|
File oldpath = new File(ForgeConstants.QUEST_SAVE_DIR, this.name + ".dat");
|
||||||
oldpath.renameTo(newpath);
|
oldpath.renameTo(newpath);
|
||||||
@@ -191,7 +190,6 @@ public class QuestData {
|
|||||||
|
|
||||||
this.name = newName;
|
this.name = newName;
|
||||||
QuestDataIO.saveData(this);
|
QuestDataIO.saveData(this);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public QuestAssets getAssets() {
|
public QuestAssets getAssets() {
|
||||||
|
|||||||
@@ -70,7 +70,6 @@ public class ReadPriceList {
|
|||||||
* @return a {@link java.util.HashMap} object.
|
* @return a {@link java.util.HashMap} object.
|
||||||
*/
|
*/
|
||||||
private Map<String, Integer> readFile(final String file) {
|
private Map<String, Integer> readFile(final String file) {
|
||||||
|
|
||||||
final Map<String, Integer> map = new HashMap<>();
|
final Map<String, Integer> map = new HashMap<>();
|
||||||
|
|
||||||
final List<String> lines = FileUtil.readFile(file);
|
final List<String> lines = FileUtil.readFile(file);
|
||||||
@@ -96,8 +95,7 @@ public class ReadPriceList {
|
|||||||
float ff;
|
float ff;
|
||||||
if (MyRandom.getRandom().nextInt(100) < 90) {
|
if (MyRandom.getRandom().nextInt(100) < 90) {
|
||||||
ff = MyRandom.getRandom().nextInt(10) * (float) .01;
|
ff = MyRandom.getRandom().nextInt(10) * (float) .01;
|
||||||
}
|
} else {
|
||||||
else {
|
|
||||||
// +/- 50%
|
// +/- 50%
|
||||||
ff = MyRandom.getRandom().nextInt(50) * (float) .01;
|
ff = MyRandom.getRandom().nextInt(50) * (float) .01;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -70,8 +70,4 @@ public abstract class AbstractGeneticAlgorithm<T> {
|
|||||||
|
|
||||||
protected abstract boolean shouldContinue();
|
protected abstract boolean shouldContinue();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user