v3.2.2: fixed upgrade window not account for metamorphed runic trans

This commit is contained in:
Evan Debenham
2025-08-24 15:55:37 -04:00
parent d16dd4ed23
commit b95e05a4f7

View File

@@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.windows;
import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
@@ -361,6 +362,11 @@ public class WndUpgrade extends Window {
lossChance = Math.min(100, 10 * (int) Math.pow(2, levelFrom - 6));
} else {
lossChance = Math.min(100, 10 * (int) Math.pow(2, levelFrom - 4));
if (Dungeon.hero != null && Dungeon.hero.heroClass != HeroClass.WARRIOR && Dungeon.hero.hasTalent(Talent.RUNIC_TRANSFERENCE)){
if (levelFrom < 5+Dungeon.hero.pointsInTalent(Talent.RUNIC_TRANSFERENCE)){
lossChance = 0;
}
}
}
if (lossChance >= 10) {