mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
@@ -1260,8 +1260,11 @@ public class Forge implements ApplicationListener {
|
||||
|
||||
@Override
|
||||
public boolean touchDown(int x, int y, int pointer, int button) {
|
||||
if (transitionScreen != null)
|
||||
if (transitionScreen != null) {
|
||||
boolean isFDialog = FOverlay.getTopOverlay() != null && FOverlay.getTopOverlay() instanceof FDialog;
|
||||
if (!isFDialog)
|
||||
return false;
|
||||
}
|
||||
if (pointer == 0) { //don't change listeners when second finger goes down for zoom
|
||||
updatePotentialListeners(x, y);
|
||||
if (keyInputAdapter != null) {
|
||||
|
||||
@@ -109,7 +109,7 @@ public class DuelScene extends ForgeScene {
|
||||
e.printStackTrace();
|
||||
}
|
||||
String enemyName = enemy.getName();
|
||||
boolean showMessages = enemy.getData().copyPlayerDeck && Current.player().isUsingCustomDeck();
|
||||
boolean showMessages = enemy.getData().boss || (enemy.getData().copyPlayerDeck && Current.player().isUsingCustomDeck());
|
||||
Current.player().clearBlessing();
|
||||
if ((chaosBattle || showMessages) && !winner) {
|
||||
final FBufferedImage fb = new FBufferedImage(120, 120) {
|
||||
@@ -131,19 +131,18 @@ public class DuelScene extends ForgeScene {
|
||||
"Thought you could beat me? Whew, talk about conceited.", "*Yawn* ... Huh? It's over already? But I just woke up!",
|
||||
"Next time bring an army. It might give you a chance.", "The reason you lost is quite simple...",
|
||||
"Is that all you can do?", "You need to learn more to stand a chance.", "You weren't that bad.", "You made an effort at least.",
|
||||
"From today, you can call me teacher.", "Hmph, predictable!", "I haven't used a fraction of my REAL power!");
|
||||
"From today, you can call me teacher.", "Hmph, predictable!", "I haven't used a fraction of my REAL power!",
|
||||
"Wanting something does not give you the right to have it.", "It takes skill to be this bad.",
|
||||
"You're impressing me with your ability to fail so effortlessly.", "No one's good at everything . . . but you're bad at everything",
|
||||
"I'd say you're really good if failing was the goal.", "It ain't getting easier, and you're not getting any better",
|
||||
"Uh... you okay there?", "Are you even trying?", "Lose again? Why am I not surprised!", "That's the spirit, Go out there and lose again. I'll be waiting.");
|
||||
String message = Aggregates.random(insult);
|
||||
boolean finalWinner = winner;
|
||||
FThreads.invokeInEdtNowOrLater(() -> FOptionPane.showMessageDialog(message, enemyName, fb, new Callback<Integer>() {
|
||||
@Override
|
||||
public void run(Integer result) {
|
||||
if (result == 0) {
|
||||
afterGameEnd(enemyName, finalWinner);
|
||||
if (Config.instance().getSettingData().disableWinLose) {
|
||||
MatchController.writeMatchPreferences();
|
||||
exitDuelScene();
|
||||
}
|
||||
}
|
||||
fb.dispose();
|
||||
}
|
||||
}));
|
||||
@@ -375,7 +374,7 @@ public class DuelScene extends ForgeScene {
|
||||
//hostedMatch.setEndGameHook(() -> DuelScene.this.GameEnd());
|
||||
hostedMatch.startMatch(rules, appliedVariants, players, guiMap, bossBattle ? MusicPlaylist.BOSS : MusicPlaylist.MATCH);
|
||||
MatchController.instance.setGameView(hostedMatch.getGameView());
|
||||
boolean showMessages = enemy.getData().copyPlayerDeck && Current.player().isUsingCustomDeck();
|
||||
boolean showMessages = enemy.getData().boss || (enemy.getData().copyPlayerDeck && Current.player().isUsingCustomDeck());
|
||||
if (chaosBattle || showMessages) {
|
||||
final FBufferedImage fb = new FBufferedImage(120, 120) {
|
||||
@Override
|
||||
|
||||
@@ -272,7 +272,6 @@ public class ConsoleCommandInterpreter {
|
||||
for (EnemyData E : new Array.ArrayIterator<>(WorldData.getAllEnemies())) {
|
||||
Deck D = E.generateDeck(Current.player().isFantasyMode(), Current.player().isUsingCustomDeck() || Current.player().getDifficulty().name.equalsIgnoreCase("Hard"));
|
||||
DeckProxy DP = new DeckProxy(D, "Constructed", GameType.Constructed, null);
|
||||
ColorSet colorSet = DP.getColor();
|
||||
System.out.printf("Deck: %s\n%s\n\n", D.getName(), DP.getDeck().getMain().toCardList("\n")
|
||||
);
|
||||
}
|
||||
@@ -282,9 +281,8 @@ public class ConsoleCommandInterpreter {
|
||||
for (EnemyData E : new Array.ArrayIterator<>(WorldData.getAllEnemies())) {
|
||||
Deck D = E.generateDeck(Current.player().isFantasyMode(), Current.player().isUsingCustomDeck() || Current.player().getDifficulty().name.equalsIgnoreCase("Hard"));
|
||||
DeckProxy DP = new DeckProxy(D, "Constructed", GameType.Constructed, null);
|
||||
ColorSet colorSet = DP.getColor();
|
||||
System.out.printf("%s Colors: %s | Deck Colors: %s (%s)\n", E.name, E.colors, DP.getColorIdentity().toEnumSet().toString(), DP.getName()
|
||||
);
|
||||
System.out.printf("%s Colors: %s | Deck Colors: %s (%s)%s\n", E.name, E.colors, DP.getColorIdentity().toEnumSet().toString(), DP.getName()
|
||||
, E.boss ? " - BOSS" : "");
|
||||
}
|
||||
return "Enemy color Identity dumped to stdout.";
|
||||
});
|
||||
|
||||
@@ -713,8 +713,18 @@ public class CardUtil {
|
||||
|
||||
public static Deck getDeck(String path, boolean forAI, boolean isFantasyMode, String colors, boolean isTheme, boolean useGeneticAI, CardEdition starterEdition, boolean discourageDuplicates)
|
||||
{
|
||||
if(path.endsWith(".dck"))
|
||||
return DeckSerializer.fromFile(Config.instance().getFile(path).file());
|
||||
if(path.endsWith(".dck")) {
|
||||
FileHandle fileHandle = Config.instance().getFile(path);
|
||||
Deck deck = null;
|
||||
if (fileHandle != null) {
|
||||
deck = DeckSerializer.fromFile(fileHandle.file());
|
||||
}
|
||||
if (deck == null) {
|
||||
deck = DeckgenUtil.getRandomOrPreconOrThemeDeck(colors, true, false, true);
|
||||
System.err.println("Error loading Deck: " + path + "\nGenerating random deck: " + deck.getName());
|
||||
}
|
||||
return deck;
|
||||
}
|
||||
|
||||
if(forAI && (isFantasyMode||useGeneticAI)) {
|
||||
Deck deck = DeckgenUtil.getRandomOrPreconOrThemeDeck(colors, forAI, isTheme, useGeneticAI);
|
||||
|
||||
Reference in New Issue
Block a user