- Added a way to display a custom win message for a challenge.

- Made "Against All Odds" a persistent challenge with a custom win message that congratulates the player for beating the ultimate challenge in the quest.
This commit is contained in:
Agetian
2016-08-27 14:43:28 +00:00
parent 34c11c6b46
commit 00ada401d2
4 changed files with 30 additions and 0 deletions

View File

@@ -72,6 +72,9 @@ public class QuestEventChallenge extends QuestEvent {
/** If persistent, the challenge does not disappear if the player fails it. */
private boolean persistent = false;
/** a text message that appears when the player wins the challenge match. */
private String winMessage = "";
private Deck humanDeck = null;
/**
@@ -321,6 +324,25 @@ public class QuestEventChallenge extends QuestEvent {
this.forceAnte = forceAnte;
}
/**
* Gets the win message.
*
* @return the winMessage
*/
public String getWinMessage() {
return this.winMessage;
}
/**
* Sets the win message
*
* @param winMessage0
* the winMessage to set
*/
public void setWinMessage(final String winMessage0) {
this.winMessage = winMessage0;
}
/**
* @return the humanDeck
*/

View File

@@ -605,6 +605,11 @@ public class QuestWinLoseController {
sb.append("Challenge completed.\n\n");
sb.append("Challenge bounty: ").append(questRewardCredits).append(" credits.");
String winMessage = ((QuestEventChallenge)qEvent).getWinMessage();
if (!winMessage.isEmpty()) {
view.showMessage(winMessage.replace("\\n", "\n"), "Congratulations", FSkinProp.ICO_QUEST_NOTES);
}
qData.getAssets().addCredits(questRewardCredits);
view.showMessage(sb.toString(), "Challenge Rewards for \"" + qEvent.getTitle() + "\"", FSkinProp.ICO_QUEST_BOX);

View File

@@ -39,6 +39,7 @@ public class QuestChallengeReader extends StorageReaderFolder<QuestEventChalleng
qc.setCardReward(sectionQuest.get("Card Reward"));
qc.setHumanExtraCards(Arrays.asList(TextUtil.split(sectionQuest.get("HumanExtras", ""), '|')));
qc.setAiExtraCards(Arrays.asList(TextUtil.split(sectionQuest.get("AIExtras", ""), '|')));
qc.setWinMessage(sectionQuest.get("WinMessage", ""));
// Less common properties
int humanLife = sectionQuest.getInt("HumanLife", 0);
if (humanLife != 0) {