mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-16 10:48:00 +00:00
Added rewards for maintaining large win streaks in quest mode.
This commit is contained in:
@@ -45,6 +45,7 @@
|
|||||||
<proguard>
|
<proguard>
|
||||||
<config>${project.basedir}/proguard.cfg</config>
|
<config>${project.basedir}/proguard.cfg</config>
|
||||||
</proguard>
|
</proguard>
|
||||||
|
<release>true</release>
|
||||||
</configuration>
|
</configuration>
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
@@ -107,11 +108,11 @@
|
|||||||
<artifactId>gdx</artifactId>
|
<artifactId>gdx</artifactId>
|
||||||
<version>0.9.9</version>
|
<version>0.9.9</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- <dependency>
|
<dependency>
|
||||||
<groupId>com.badlogicgames.gdx</groupId>
|
<groupId>com.badlogicgames.gdx</groupId>
|
||||||
<artifactId>gdx-freetype</artifactId>
|
<artifactId>gdx-freetype</artifactId>
|
||||||
<version>0.9.9</version>
|
<version>0.9.9</version>
|
||||||
</dependency> -->
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.badlogicgames.gdx</groupId>
|
<groupId>com.badlogicgames.gdx</groupId>
|
||||||
<artifactId>gdx-freetype-platform</artifactId>
|
<artifactId>gdx-freetype-platform</artifactId>
|
||||||
@@ -123,11 +124,11 @@
|
|||||||
<version>1.1.3.1</version>
|
<version>1.1.3.1</version>
|
||||||
<scope>provided</scope>
|
<scope>provided</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- <dependency>
|
<dependency>
|
||||||
<groupId>com.badlogicgames.gdx</groupId>
|
<groupId>com.badlogicgames.gdx</groupId>
|
||||||
<artifactId>gdx-backend-android</artifactId>
|
<artifactId>gdx-backend-android</artifactId>
|
||||||
<version>0.9.9</version>
|
<version>0.9.9</version>
|
||||||
</dependency> -->
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
@@ -137,6 +137,7 @@ public class QuestWinLose extends ControlWinLose {
|
|||||||
qc.getCards().loseCards(anteResult.lostCards);
|
qc.getCards().loseCards(anteResult.lostCards);
|
||||||
this.anteReport(anteResult.wonCards, anteResult.lostCards, questPlayer.equals(outcome.getWinningPlayer()));
|
this.anteReport(anteResult.wonCards, anteResult.lostCards, questPlayer.equals(outcome.getWinningPlayer()));
|
||||||
}
|
}
|
||||||
|
System.err.println(outcome.getWinningPlayer() + ", " + outcome.getLastTurnNumber());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!lastGame.getMatch().isMatchOver()) {
|
if (!lastGame.getMatch().isMatchOver()) {
|
||||||
@@ -173,6 +174,8 @@ public class QuestWinLose extends ControlWinLose {
|
|||||||
this.awardRandomRare("You've won a random rare for winning against a very hard deck.");
|
this.awardRandomRare("You've won a random rare for winning against a very hard deck.");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
this.awardWinStreakBonus();
|
||||||
|
|
||||||
// Random rare given at 50% chance (65% with luck upgrade)
|
// Random rare given at 50% chance (65% with luck upgrade)
|
||||||
if (this.getLuckyCoinResult()) {
|
if (this.getLuckyCoinResult()) {
|
||||||
@@ -486,6 +489,61 @@ public class QuestWinLose extends ControlWinLose {
|
|||||||
this.view.getPnlCustom().add(cv, QuestWinLose.CONSTRAINTS_CARDS);
|
this.view.getPnlCustom().add(cv, QuestWinLose.CONSTRAINTS_CARDS);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* <p>
|
||||||
|
* awardWinStreakBonus.
|
||||||
|
* </p>
|
||||||
|
* Generates and displays a reward for maintaining a win streak.
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private void awardWinStreakBonus() {
|
||||||
|
|
||||||
|
int currentStreak = qData.getAchievements().getWinStreakCurrent() + 1;
|
||||||
|
|
||||||
|
final List<PaperCard> cardsWon = new ArrayList<>();
|
||||||
|
String typeWon = "";
|
||||||
|
|
||||||
|
switch (currentStreak) {
|
||||||
|
case 3:
|
||||||
|
cardsWon.addAll(qData.getCards().addRandomCommon(1));
|
||||||
|
typeWon = "common";
|
||||||
|
break;
|
||||||
|
case 5:
|
||||||
|
cardsWon.addAll(qData.getCards().addRandomUncommon(1));
|
||||||
|
typeWon = "uncommon";
|
||||||
|
break;
|
||||||
|
case 7:
|
||||||
|
cardsWon.addAll(qData.getCards().addRandomRareNotMythic(1));
|
||||||
|
typeWon = "rare";
|
||||||
|
break;
|
||||||
|
case 10:
|
||||||
|
cardsWon.addAll(qData.getCards().addRandomMythicRare(1));
|
||||||
|
typeWon = "mythic rare";
|
||||||
|
break;
|
||||||
|
case 25:
|
||||||
|
cardsWon.addAll(qData.getCards().addRandomMythicRare(5));
|
||||||
|
typeWon = "mythic rare";
|
||||||
|
break;
|
||||||
|
case 50:
|
||||||
|
cardsWon.addAll(qData.getCards().addRandomMythicRare(10));
|
||||||
|
typeWon = "mythic rare";
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
this.lblTemp1 = new TitleLabel("You have achieved a " + currentStreak + " win streak and won " + cardsWon.size() + " " + typeWon + " card" + ((cardsWon.size() != 1) ? "s" : "") + "!");
|
||||||
|
final QuestWinLoseCardViewer cv = new QuestWinLoseCardViewer(cardsWon);
|
||||||
|
|
||||||
|
this.view.getPnlCustom().add(this.lblTemp1, QuestWinLose.CONSTRAINTS_TITLE);
|
||||||
|
if (FModel.getPreferences().getPrefBoolean(FPref.UI_LARGE_CARD_VIEWERS)) {
|
||||||
|
this.view.getPnlCustom().add(cv, QuestWinLose.CONSTRAINTS_CARDS_LARGE);
|
||||||
|
} else {
|
||||||
|
this.view.getPnlCustom().add(cv, QuestWinLose.CONSTRAINTS_CARDS);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
|
|||||||
@@ -181,7 +181,11 @@ public final class QuestUtilCards {
|
|||||||
this.qa.getNewCardList().add(card, qty);
|
this.qa.getNewCardList().add(card, qty);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static final Predicate<PaperCard> COMMON_PREDICATE = IPaperCard.Predicates.Presets.IS_COMMON;
|
||||||
|
private static final Predicate<PaperCard> UNCOMMON_PREDICATE = IPaperCard.Predicates.Presets.IS_UNCOMMON;
|
||||||
private static final Predicate<PaperCard> RARE_PREDICATE = IPaperCard.Predicates.Presets.IS_RARE_OR_MYTHIC;
|
private static final Predicate<PaperCard> RARE_PREDICATE = IPaperCard.Predicates.Presets.IS_RARE_OR_MYTHIC;
|
||||||
|
private static final Predicate<PaperCard> ONLY_RARE_PREDICATE = IPaperCard.Predicates.Presets.IS_RARE;
|
||||||
|
private static final Predicate<PaperCard> MYTHIC_PREDICATE = IPaperCard.Predicates.Presets.IS_MYTHIC_RARE;
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -208,6 +212,32 @@ public final class QuestUtilCards {
|
|||||||
return card;
|
return card;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a random common.
|
||||||
|
*
|
||||||
|
* @param n the number of cards to add
|
||||||
|
* @return the list of cards added
|
||||||
|
*/
|
||||||
|
public List<PaperCard> addRandomCommon(final int n) {
|
||||||
|
final Predicate<PaperCard> myFilter = applyFormatFilter(QuestUtilCards.COMMON_PREDICATE);
|
||||||
|
final List<PaperCard> newCards = Aggregates.random(Iterables.filter(FModel.getMagicDb().getCommonCards().getAllCards(), myFilter), n);
|
||||||
|
this.addAllCards(newCards);
|
||||||
|
return newCards;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds a random uncommon.
|
||||||
|
*
|
||||||
|
* @param n the number of cards to add
|
||||||
|
* @return the list of cards added
|
||||||
|
*/
|
||||||
|
public List<PaperCard> addRandomUncommon(final int n) {
|
||||||
|
final Predicate<PaperCard> myFilter = applyFormatFilter(QuestUtilCards.UNCOMMON_PREDICATE);
|
||||||
|
final List<PaperCard> newCards = Aggregates.random(Iterables.filter(FModel.getMagicDb().getCommonCards().getAllCards(), myFilter), n);
|
||||||
|
this.addAllCards(newCards);
|
||||||
|
return newCards;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Adds the random rare.
|
* Adds the random rare.
|
||||||
*
|
*
|
||||||
@@ -223,6 +253,36 @@ public final class QuestUtilCards {
|
|||||||
return newCards;
|
return newCards;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the random rare.
|
||||||
|
*
|
||||||
|
* @param n
|
||||||
|
* the n
|
||||||
|
* @return the list
|
||||||
|
*/
|
||||||
|
public List<PaperCard> addRandomRareNotMythic(final int n) {
|
||||||
|
final Predicate<PaperCard> myFilter = applyFormatFilter(QuestUtilCards.ONLY_RARE_PREDICATE);
|
||||||
|
|
||||||
|
final List<PaperCard> newCards = Aggregates.random(Iterables.filter(FModel.getMagicDb().getCommonCards().getAllCards(), myFilter), n);
|
||||||
|
this.addAllCards(newCards);
|
||||||
|
return newCards;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Adds the random rare.
|
||||||
|
*
|
||||||
|
* @param n
|
||||||
|
* the n
|
||||||
|
* @return the list
|
||||||
|
*/
|
||||||
|
public List<PaperCard> addRandomMythicRare(final int n) {
|
||||||
|
final Predicate<PaperCard> myFilter = applyFormatFilter(QuestUtilCards.MYTHIC_PREDICATE);
|
||||||
|
|
||||||
|
final List<PaperCard> newCards = Aggregates.random(Iterables.filter(FModel.getMagicDb().getCommonCards().getAllCards(), myFilter), n);
|
||||||
|
this.addAllCards(newCards);
|
||||||
|
return newCards;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Setup new game card pool.
|
* Setup new game card pool.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user