mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-18 03:38:01 +00:00
- 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:
@@ -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
|
||||
*/
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user