Skip to content

Commit

Permalink
Merge pull request #5 from zyzzyvivification/SeedSearch-bugfixes
Browse files Browse the repository at this point in the history
Seed search bugfixes
  • Loading branch information
ForgottenArbiter authored Feb 8, 2021
2 parents 480d18e + 54da777 commit 345134a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 3 deletions.
8 changes: 7 additions & 1 deletion src/main/java/seedsearch/SeedResult.java
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.megacrit.cardcrawl.dungeons.AbstractDungeon;
import com.megacrit.cardcrawl.helpers.SeedHelper;
import com.megacrit.cardcrawl.neow.NeowReward;
import com.megacrit.cardcrawl.potions.AbstractPotion;
import com.megacrit.cardcrawl.relics.AbstractRelic;

import java.text.MessageFormat;
Expand Down Expand Up @@ -221,7 +222,12 @@ public void printSeedStats() {
System.out.println("Potions:");
for (Reward reward : miscRewards) {
if (reward.potions.size() > 0) {
System.out.println(String.format("Floor %d: %s", reward.floor, reward.potions));
ArrayList<String> potionNames = new ArrayList<>();
for (AbstractPotion potion : reward.potions)
{
potionNames.add(potion.ID);
}
System.out.println(String.format("Floor %d: %s", reward.floor, potionNames));
}
}
System.out.println("Other cards:");
Expand Down
10 changes: 8 additions & 2 deletions src/main/java/seedsearch/SeedRunner.java
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,9 @@ private void claimNeowReward(NeowReward neowOption) {
player.masterDeck.removeCard(removedCard);
addInvoluntaryCardReward(AbstractDungeon.getTransformedCard(), reward);
}
if (neowOption.drawback == NeowReward.NeowRewardDrawback.CURSE) {
addInvoluntaryCardReward(AbstractDungeon.getCardWithoutRng(AbstractCard.CardRarity.CURSE), reward);
}
seedResult.addMiscReward(reward);
}

Expand Down Expand Up @@ -558,6 +561,9 @@ private void runPath(ArrayList<MapRoomNode> path) {
String monster = AbstractDungeon.monsterList.remove(0);
seedResult.registerCombat(monster);
seedResult.addCardReward(AbstractDungeon.floorNum, AbstractDungeon.getRewardCards());
if (player.hasRelic(PrayerWheel.ID)) {
seedResult.addCardReward(AbstractDungeon.floorNum, AbstractDungeon.getRewardCards());
}
int gold = AbstractDungeon.treasureRng.random(10, 20);
addGoldReward(gold);
AbstractPotion monsterPotion = getPotionReward();
Expand All @@ -571,6 +577,7 @@ private void runPath(ArrayList<MapRoomNode> path) {
seedResult.addToTrueMapPath("E");
String elite = AbstractDungeon.eliteMonsterList.remove(0);
seedResult.registerEliteCombat(elite);
seedResult.addCardReward(AbstractDungeon.floorNum, AbstractDungeon.getRewardCards());
AbstractRelic.RelicTier tier = AbstractDungeon.returnRandomRelicTier();
String relic = AbstractDungeon.returnRandomRelicKey(tier);
Reward relicReward = new Reward(AbstractDungeon.floorNum);
Expand All @@ -580,7 +587,6 @@ private void runPath(ArrayList<MapRoomNode> path) {
awardRelic(starRelic, relicReward);
}
seedResult.addMiscReward(relicReward);
seedResult.addCardReward(AbstractDungeon.floorNum, AbstractDungeon.getRewardCards());
gold = AbstractDungeon.treasureRng.random(25, 35);
addGoldReward(gold);
AbstractPotion elitePotion = getPotionReward();
Expand Down Expand Up @@ -1083,7 +1089,7 @@ public SeedResult getSeedResult() {

private void addInvoluntaryCardReward(AbstractCard card, Reward reward) {
reward.cards.add(card);
AbstractDungeon.player.masterDeck.addToBottom(card);
AbstractDungeon.player.masterDeck.addToTop(card);
}

private void loseRelic(String relicID) {
Expand Down

0 comments on commit 345134a

Please sign in to comment.