Skip to content

Commit

Permalink
fix: properly multiply damge and exhaust burns and cards
Browse files Browse the repository at this point in the history
  • Loading branch information
scarf005 committed Oct 9, 2024
1 parent 135143b commit 36851e5
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions src/main/kotlin/marisa/action/MeteoricShowerAction.kt
Original file line number Diff line number Diff line change
@@ -1,15 +1,17 @@
package marisa.action

import com.megacrit.cardcrawl.actions.AbstractGameAction
import com.megacrit.cardcrawl.cards.status.Burn
import com.megacrit.cardcrawl.core.CardCrawlGame
import com.megacrit.cardcrawl.core.Settings
import com.megacrit.cardcrawl.dungeons.AbstractDungeon
import com.megacrit.cardcrawl.relics.ChemicalX
import com.megacrit.cardcrawl.ui.panels.EnergyPanel
import marisa.countRelic
import marisa.exhaust
import marisa.fx.MeteoricShowerEffect
import marisa.p
import marisa.withCardsBurned
import marisa.partitionByType

class MeteoricShowerAction(val energyOnUse: Int, val dmg: Int, val freeToPlay: Boolean) :
AbstractGameAction() {
Expand All @@ -31,11 +33,14 @@ class MeteoricShowerAction(val energyOnUse: Int, val dmg: Int, val freeToPlay: B
return
}
if (!AbstractDungeon.handCardSelectScreen.wereCardsRetrieved) {
val (regular, burns) = AbstractDungeon.handCardSelectScreen.selectedCards.group.withCardsBurned()
val cnt = regular.size * 3 + burns.size * 2
val cards = AbstractDungeon.handCardSelectScreen.selectedCards.group
val (burns, regular) = cards.partitionByType<Burn>()
val cnt = regular.size * 2 + burns.size * 3

AbstractDungeon.handCardSelectScreen.wereCardsRetrieved = true
AbstractDungeon.handCardSelectScreen.selectedCards.group.clear()
cards.forEach { it.exhaust() }
cards.clear()

addToBot(MeteoricShowerEffect.toVfx(cnt))
addToBot(RandomDamageAction(cnt) { dmg })
AbstractDungeon.gridSelectScreen.selectedCards.clear()
Expand All @@ -48,8 +53,7 @@ class MeteoricShowerAction(val energyOnUse: Int, val dmg: Int, val freeToPlay: B
}

companion object {
private val uiStrings = CardCrawlGame.languagePack
.getUIString("ExhaustAction")
private val uiStrings = CardCrawlGame.languagePack.getUIString("ExhaustAction")
val TEXT = uiStrings.TEXT
}
}

0 comments on commit 36851e5

Please sign in to comment.