Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions forge-gui-mobile/src/forge/adventure/character/DialogActor.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,15 +16,21 @@ public class DialogActor extends CharacterSprite {
public AdventureQuestData questData;

public DialogActor(MapStage stage, int id, String S, TextureRegion textureRegion) {
this(stage, id, S, textureRegion, null);
}
public DialogActor(MapStage stage, int id, String S, TextureRegion textureRegion, String sourceMapFile) {
super(id,"");
this.stage = stage;
dialog = new MapDialog(S, stage, id);
dialog = new MapDialog(S, stage, id, sourceMapFile);
this.textureRegion = textureRegion;
}
public DialogActor(MapStage stage, int id, String S, String sprite) {
this(stage, id, S, sprite, null);
}
public DialogActor(MapStage stage, int id, String S, String sprite, String sourceMapFile) {
super(id,sprite);
this.stage = stage;
dialog = new MapDialog(S, stage, id);
dialog = new MapDialog(S, stage, id, sourceMapFile);
this.textureRegion = null;
}

Expand Down
8 changes: 5 additions & 3 deletions forge-gui-mobile/src/forge/adventure/scene/DuelScene.java
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
import forge.toolbox.FOptionPane;
import forge.trackable.TrackableCollection;
import forge.util.Aggregates;
import forge.util.Localizer;
import forge.util.StreamUtil;
import org.apache.commons.lang3.tuple.Pair;

Expand Down Expand Up @@ -243,6 +244,7 @@ private void showAnteCardsSequentially(List<PaperCard> cards, int index, boolean
}

private void showAnteCardPopup(String title, PaperCard card, boolean won, Runnable onDone) {
Localizer localizer = Forge.getLocalizer();
CardView cardView = CardView.getCardForUi(card);

FDisplayObject cardDisplay = new FDisplayObject() {
Expand Down Expand Up @@ -275,10 +277,10 @@ public void draw(Graphics g) {
if (won && eventData == null) {
int sellPrice = Current.player().cardSellPrice(card);
buttons = sellPrice > 0
? ImmutableList.of(Forge.getLocalizer().getMessage("lblOK"), "Auto-Sell (" + sellPrice + " gold)")
: ImmutableList.of(Forge.getLocalizer().getMessage("lblOK"));
? ImmutableList.of(localizer.getMessage("lblOK"), "Auto-Sell (" + sellPrice + " gold)")
: ImmutableList.of(localizer.getMessage("lblOK"));
} else {
buttons = ImmutableList.of(Forge.getLocalizer().getMessage("lblOK"));
buttons = ImmutableList.of(localizer.getMessage("lblOK"));
}

FOptionPane popup = new FOptionPane(message, null, title, null, cardDisplay, buttons, 0, result -> {
Expand Down
88 changes: 45 additions & 43 deletions forge-gui-mobile/src/forge/adventure/scene/NewGameScene.java
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
import forge.player.GamePlayerUtil;
import forge.screens.TransitionScreen;
import forge.sound.SoundSystem;
import forge.util.Localizer;
import forge.util.NameGenerator;

import java.util.Random;
Expand Down Expand Up @@ -398,48 +399,48 @@ public void enter() {
}

private void showDifficultyHelp() {
Localizer localizer = Forge.getLocalizer();
DifficultyData selectedDifficulty = Config.instance().getConfigData().difficulties[difficulty.getCurrentIndex()];
boolean enableGeneticAI = Config.instance().getConfigData().enableGeneticAI;
String startingEquipment = selectedDifficulty.startItems == null || selectedDifficulty.startItems.length == 0
? "None"
? localizer.getMessage("lblNone")
: String.join(", ", selectedDifficulty.startItems);

difficultySummary = new DialogData();
difficultySummary.name = "Summary";
difficultySummary.name = localizer.getMessage("lblSummary");
switch (selectedDifficulty.name) {
case "Easy":
difficultySummary.text = String.format("Difficulty: %s\nFor newer players or those who want a relaxed experience.\nStarter decks are monocolored.\nStarting equipment: %s", selectedDifficulty.name, startingEquipment);
difficultySummary.text = localizer.getMessage("advDifficultySummaryEasy", selectedDifficulty.name, startingEquipment);
break;
case "Normal":
difficultySummary.text = String.format("Difficulty: %s\nHow Adventure Mode is intended to be played.\nStarter decks will include a second color.\nStarting equipment: %s", selectedDifficulty.name, startingEquipment);
difficultySummary.text = localizer.getMessage("advDifficultySummaryNormal", selectedDifficulty.name, startingEquipment);
break;
case "Hard":
if (enableGeneticAI) {
difficultySummary.text = String.format("Difficulty: %s\nFor players who want a challenge.\nSome enemies will use genetic AI decks.\nStarter decks will include 2-3 colors.\nStarting equipment: %s", selectedDifficulty.name, startingEquipment);
difficultySummary.text = localizer.getMessage("advDifficultySummaryHardGenetic", selectedDifficulty.name, startingEquipment);
} else {
difficultySummary.text = String.format("Difficulty: %s\nFor players who want a challenge.\nStarter decks will include 2-3 colors.\nStarting equipment: %s", selectedDifficulty.name, startingEquipment);
difficultySummary.text = localizer.getMessage("advDifficultySummaryHard", selectedDifficulty.name, startingEquipment);
}
break;
case "Insane":
difficultySummary.text = String.format("Difficulty: %s\nFor players who don't want to like the game.\nIdentical to Hard difficulty, but with even less forgiving and rewarding results.\nStarter decks will include 2-3 colors.\nStarting equipment: %s", selectedDifficulty.name, startingEquipment);
difficultySummary.text = localizer.getMessage("advDifficultySummaryInsane", selectedDifficulty.name, startingEquipment);
break;
default:
difficultySummary.text = "((Custom difficulty settings))";
difficultySummary.text = localizer.getMessage("advDifficultySummaryCustom");
break;
}


DialogData dismiss = new DialogData();
//todo: add translation
dismiss.name = "OK";
dismiss.name = localizer.getMessage("lblOK");

DialogData matchImpacts = new DialogData();
matchImpacts.text = String.format("Difficulty: %s\nStarting Life: %d\nEnemy Health: %d%%\nGold loss on defeat: %d%%\nLife loss on defeat: %d%%", selectedDifficulty.name, selectedDifficulty.startingLife, (int) (selectedDifficulty.enemyLifeFactor * 100), (int) (selectedDifficulty.goldLoss * 100), (int) (selectedDifficulty.lifeLoss * 100));
matchImpacts.name = "Duels";
matchImpacts.text = localizer.getMessage("advDifficultyMatchImpacts", selectedDifficulty.name, selectedDifficulty.startingLife, (int) (selectedDifficulty.enemyLifeFactor * 100), (int) (selectedDifficulty.goldLoss * 100), (int) (selectedDifficulty.lifeLoss * 100));
matchImpacts.name = localizer.getMessage("lblDuels");

DialogData economyImpacts = new DialogData();
economyImpacts.text = String.format("Difficulty: %s\nStarting Gold: %d\nStarting Mana Shards: %d\nCard Sale Price: %d%%\nMana Shard Sale Price: %d%%\nRandom loot rate: %d%%", selectedDifficulty.name, selectedDifficulty.startingMoney, selectedDifficulty.startingShards, (int) (selectedDifficulty.sellFactor * 100), (int) (selectedDifficulty.shardSellRatio * 100), (int) (selectedDifficulty.rewardMaxFactor * 100));
economyImpacts.name = "Economy";
economyImpacts.text = localizer.getMessage("advDifficultyEconomyImpacts", selectedDifficulty.name, selectedDifficulty.startingMoney, selectedDifficulty.startingShards, (int) (selectedDifficulty.sellFactor * 100), (int) (selectedDifficulty.shardSellRatio * 100), (int) (selectedDifficulty.rewardMaxFactor * 100));
economyImpacts.name = localizer.getMessage("lblEconomy");

difficultySummary.options = new DialogData[3];
difficultySummary.options[0] = matchImpacts;
Expand All @@ -459,103 +460,104 @@ private void showDifficultyHelp() {

private void showModeHelp() {

Localizer localizer = Forge.getLocalizer();
AdventureModes selectedMode = modes.get(mode.getCurrentIndex());
DifficultyData selectedDifficulty = Config.instance().getConfigData().difficulties[difficulty.getCurrentIndex()];
boolean enableGeneticAI = Config.instance().getConfigData().enableGeneticAI;

modeSummary = new DialogData();
modeSummary.name = "Summary";
modeSummary.name = localizer.getMessage("lblSummary");

StringBuilder summaryText = new StringBuilder();
switch (selectedMode) {
case Standard:
summaryText.append("Mode: Standard\n\nYour starting deck is built from 2-3 Jumpstart packs of twenty cards each.\n\n");
summaryText.append(localizer.getMessage("advModeStandardSummary"));
switch (selectedDifficulty.name) {
case "Easy":
summaryText.append("On your currently selected difficulty, Easy, you will receive three jumpstart packs of your chosen color.");
summaryText.append(localizer.getMessage("advDiffEasyStandard"));
break;
case "Normal":
summaryText.append("On your currently selected difficulty, Normal, you will receive two jumpstart packs of your chosen color and one of an allied color.");
summaryText.append(localizer.getMessage("advDiffNormalStandard"));
break;
case "Hard":
summaryText.append("On your currently selected difficulty, Hard, you will receive one jumpstart pack of your chosen color and one of an allied color.");
summaryText.append(localizer.getMessage("advDiffHardStandard"));
break;
case "Insane":
summaryText.append("On your currently selected difficulty, Insane, you will receive one jumpstart pack of your chosen color and one of an allied color.");
summaryText.append(localizer.getMessage("advDiffInsaneStandard"));
break;
default:
difficultySummary.text = "((Cannot determine starter deck based on custom difficulty settings))";
difficultySummary.text = localizer.getMessage("advCannotDetermineStarterDeck");
break;
}
break;
case Constructed:
summaryText.append("Mode: Constructed\n\nYou will receive a specific preconstructed deck based on your chosen color and difficulty.\n\n");
summaryText.append(localizer.getMessage("advModeConstructedSummary"));
switch (selectedDifficulty.name) {
case "Easy":
summaryText.append("On your currently selected difficulty, Easy, your deck will only contain your chosen color.");
summaryText.append(localizer.getMessage("advDiffEasyConstructed"));
break;
case "Normal":
summaryText.append("On your currently selected difficulty, Normal, your deck will contain your chosen color and one allied color.");
summaryText.append(localizer.getMessage("advDiffNormalConstructed"));
break;
case "Hard":
summaryText.append("On your currently selected difficulty, Hard, your deck will contain your chosen color and one opposing color.");
summaryText.append(localizer.getMessage("advDiffHardConstructed"));
break;
case "Insane":
summaryText.append("On your currently selected difficulty, Insane, your deck will contain your chosen color and one opposing color.");
summaryText.append(localizer.getMessage("advDiffInsaneConstructed"));
break;
default:
difficultySummary.text = "((Cannot determine starter deck based on custom difficulty settings))";
difficultySummary.text = localizer.getMessage("advCannotDetermineStarterDeck");
break;
}
break;
case Pile:
summaryText.append("Mode: Pile\n\nYou will receive a random pile of cards based on your chosen color and difficulty.\n\n");
summaryText.append(localizer.getMessage("advModePileSummary"));
switch (selectedDifficulty.name) {
case "Easy":
summaryText.append("On your currently selected difficulty, Easy, your deck will only contain your chosen color and one allied color.");
summaryText.append(localizer.getMessage("advDiffEasyPile"));
break;
case "Normal":
summaryText.append("On your currently selected difficulty, Normal, your deck will contain your chosen color and two allied colors.");
summaryText.append(localizer.getMessage("advDiffNormalPile"));
break;
case "Hard":
summaryText.append("On your currently selected difficulty, Hard, your deck will contain your chosen color and two allied colors.\n\n");
summaryText.append("You will receive less uncommon and rare cards than on Normal difficulty.");
summaryText.append(localizer.getMessage("advDiffHardPile"));
summaryText.append(localizer.getMessage("advPileLessRareReward"));
break;
case "Insane":
summaryText.append("On your currently selected difficulty, Insane, your deck will contain your chosen color and two allied colors.\n\n");
summaryText.append("You will receive less uncommon and rare cards than on Normal difficulty.");
summaryText.append(localizer.getMessage("advDiffInsanePile"));
summaryText.append(localizer.getMessage("advPileLessRareReward"));
break;
default:
difficultySummary.text = "((Cannot determine starter deck based on custom difficulty settings))";
difficultySummary.text = localizer.getMessage("advCannotDetermineStarterDeck");
break;
}
break;
case Chaos:
summaryText.append("Mode: Chaos\n\nYou (and all enemies) will receive a random preconstructed deck.\n\nWarning: This will make encounter difficulty vary wildly from the developers' intent");
summaryText.append(localizer.getMessage("advModeChaosSummary"));
break;
case Custom:
if (enableGeneticAI) {
summaryText.append("Mode: Custom\n\nChoose your own preconstructed deck. Enemies can receive a random genetic AI deck (difficult).\n\nWarning: This will make encounter difficulty vary wildly from the developers' intent");
summaryText.append(localizer.getMessage("advModeCustomGeneticSummary"));
} else {
summaryText.append("Mode: Custom\n\nChoose your own preconstructed deck.");
summaryText.append(localizer.getMessage("advModeCustomSummary"));
}
break;
case Precon:
summaryText.append("Mode: Precon\n\nYou will receive a specific preconstructed deck. You can choose a random or a specific preconstructed deck from an edition of your choice.\n\n");
summaryText.append(localizer.getMessage("advModePreconSummary"));
break;
case Commander:
summaryText.append("Mode: Commander\n\nYou will be given a preconstructed commander deck based on the chosen color theme to start the playthrough.\n\nGood luck on your quest of creating a coherent deck that can win consistently and defeat the bosses.");
summaryText.append(localizer.getMessage("advModeCommanderSummary"));
break;
case CommanderPrecon:
summaryText.append("Mode: Commander Precon\n\nChoose a named commander preconstructed deck to start the playthrough.\n\nThis uses Commander deckbuilding and game rules, but lets you pick from the curated commander precon folder.");
summaryText.append(localizer.getMessage("advModeCommanderPreconSummary"));
break;
default:
summaryText.append("No summary available for this game mode.");
summaryText.append(localizer.getMessage("advNoModeSummaryAvailable"));
break;
}

DialogData dismiss = new DialogData();
dismiss.name = "OK";
dismiss.name = localizer.getMessage("lblOK");
modeSummary.text = summaryText.toString();
modeSummary.options = new DialogData[1];
modeSummary.options[0] = dismiss;
Expand Down
Loading
Loading