Skip to content

Commit

Permalink
fix: make upgraded mysterious beam create upgraded card (#218)
Browse files Browse the repository at this point in the history
  • Loading branch information
scarf005 committed Aug 5, 2023
1 parent 4e3caba commit e533731
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions src/main/kotlin/marisa/cards/MysteriousBeam.kt
Expand Up @@ -27,26 +27,12 @@ class MysteriousBeam : CustomCard(
baseDamage = 0
}

override fun calculateCardDamage(mo: AbstractMonster) {
var tmp = baseDamage.toFloat()
for (p in mo.powers) {
tmp = p.atDamageReceive(tmp, damageTypeForTurn)
}
for (p in mo.powers) {
tmp = p.atDamageFinalReceive(tmp, damageTypeForTurn)
if (baseDamage != tmp.toInt()) {
isDamageModified = true
}
}
damage = tmp.toInt()
}

override fun use(p: AbstractPlayer, m: AbstractMonster?) {
val c = generateSequence {
AbstractDungeon.returnTrulyRandomCardInCombat(CardType.ATTACK).makeCopy()
}
.first { it !is MysteriousBeam }
.apply { if (upgraded) upgrade() }
.apply { if (this@MysteriousBeam.upgraded) upgrade() }
.apply { applyPowers() }

addToBot(MakeTempCardInHandAction(c, true))
Expand Down

0 comments on commit e533731

Please sign in to comment.