Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: DragonMeteor acting as amplified card #241

Merged
merged 1 commit into from
Jun 21, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 14 additions & 15 deletions src/main/kotlin/marisa/cards/DragonMeteor.kt
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package marisa.cards

import basemod.abstracts.CustomCard
import com.megacrit.cardcrawl.actions.AbstractGameAction.AttackEffect
import com.megacrit.cardcrawl.actions.animations.VFXAction
import com.megacrit.cardcrawl.actions.common.DamageAction
Expand All @@ -8,13 +9,12 @@ import com.megacrit.cardcrawl.cards.AbstractCard
import com.megacrit.cardcrawl.cards.DamageInfo
import com.megacrit.cardcrawl.characters.AbstractPlayer
import com.megacrit.cardcrawl.core.CardCrawlGame
import com.megacrit.cardcrawl.dungeons.AbstractDungeon
import com.megacrit.cardcrawl.monsters.AbstractMonster
import com.megacrit.cardcrawl.vfx.combat.WeightyImpactEffect
import marisa.abstracts.AmplifiedAttack
import marisa.p
import marisa.patches.AbstractCardEnum

class DragonMeteor : AmplifiedAttack(
class DragonMeteor : CustomCard(
ID,
NAME,
IMG_PATH,
Expand All @@ -32,24 +32,24 @@ class DragonMeteor : AmplifiedAttack(
block = baseBlock
baseMagicNumber = DMG_GAIN
magicNumber = baseMagicNumber
isException = true
}

private fun calculatedDamage(): Int = baseDamage + p.exhaustPile.size() * magicNumber

override fun applyPowers() {
block = baseDamage + AbstractDungeon.player.exhaustPile.size() * magicNumber
val realBaseDamage = baseDamage
baseDamage = calculatedDamage()
super.applyPowers()
if (block == baseDamage) {
isBlockModified = false
}
}

override fun calculateDamageDisplay(mo: AbstractMonster?) {
calculateCardDamage(mo)
baseDamage = realBaseDamage
isDamageModified = damage != realBaseDamage
}

override fun calculateCardDamage(mo: AbstractMonster?) {
block = baseDamage + AbstractDungeon.player.exhaustPile.size() * magicNumber
val realBaseDamage = baseDamage
baseDamage = calculatedDamage()
super.calculateCardDamage(mo)
baseDamage = realBaseDamage
isDamageModified = damage != realBaseDamage
}

override fun use(p: AbstractPlayer, m: AbstractMonster?) {
Expand All @@ -64,8 +64,7 @@ class DragonMeteor : AmplifiedAttack(
DamageAction(
m,
DamageInfo(
p,
block,
p, damage,
damageTypeForTurn
),
AttackEffect.FIRE
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/marisa/localization/ENG/cards.json
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@
},
"DragonMeteor": {
"NAME": "Dragon Meteor",
"DESCRIPTION": "Deal !B! damage. NL Deals an additional !M! damage for each card in your exhaust pile."
"DESCRIPTION": "Deal !D! damage. NL Deals an additional !M! damage for each card in your exhaust pile."
},
"EventHorizon": {
"NAME": "Event Horizon",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/marisa/localization/FRA/cards.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
},
"DragonMeteor": {
"NAME": "Météor draconique",
"DESCRIPTION": "Infligez !B! dégâts. NL Infligez !M! dégâts additionnels pour chaque carte épuisée ce combat."
"DESCRIPTION": "Infligez !D! dégâts. NL Infligez !M! dégâts additionnels pour chaque carte épuisée ce combat."
},
"EventHorizon": {
"NAME": "Horizon des événements",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/marisa/localization/JPN/cards.json
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@
},
"DragonMeteor": {
"NAME": "ドラゴンメテオ",
"DESCRIPTION": "!B! ダメージを与える。 NL この戦闘中に廃棄したカードの数1枚につき、 !M! の追加ダメージを与える。"
"DESCRIPTION": "!D! ダメージを与える。 NL この戦闘中に廃棄したカードの数1枚につき、 !M! の追加ダメージを与える。"
},
"EventHorizon": {
"NAME": "イベントホライズン",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/marisa/localization/KOR/cards.json
Original file line number Diff line number Diff line change
Expand Up @@ -207,7 +207,7 @@
},
"DragonMeteor": {
"NAME": "드래곤 미티어",
"DESCRIPTION": "피해를 !B! 줍니다. NL 소멸된 카드마다 !M! 만큼 추가 피해를 줍니다."
"DESCRIPTION": "피해를 !D! 줍니다. NL 소멸된 카드마다 !M! 만큼 추가 피해를 줍니다."
},
"EventHorizon": {
"NAME": "사건의 지평선",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/marisa/localization/ZHS/cards.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
},
"DragonMeteor": {
"NAME": "龙陨星",
"DESCRIPTION": "造成 !B! 点伤害。 NL 你的消耗区每有一张卡,此卡伤害增加 !M! 。"
"DESCRIPTION": "造成 !D! 点伤害。 NL 你的消耗区每有一张卡,此卡伤害增加 !M! 。"
},
"PulseMagic": {
"NAME": "脉冲魔术",
Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/marisa/localization/ZHT/cards.json
Original file line number Diff line number Diff line change
Expand Up @@ -233,7 +233,7 @@
},
"DragonMeteor": {
"NAME": "龍隕星",
"DESCRIPTION": "造成 !B! 點傷害。 NL 本場戰鬥中每 消耗 1張牌,此牌傷害增加 !M! "
"DESCRIPTION": "造成 !D! 點傷害。 NL 本場戰鬥中每 消耗 1張牌,此牌傷害增加 !M! "
},
"PulseMagic": {
"NAME": "脈衝魔術",
Expand Down
Loading