v2.5.0: fixed unknown rings revealing their stats in upgrade window

This commit is contained in:
Evan Debenham
2024-08-22 12:53:39 -04:00
parent cc45774138
commit 1e344ec17f
2 changed files with 25 additions and 18 deletions
@@ -352,6 +352,7 @@ windows.wndtradeitem.sell_all=Sell all for %dg
windows.wndupgrade.title=Upgrade an Item windows.wndupgrade.title=Upgrade an Item
windows.wndupgrade.desc=Upgrading an item permanently improves it: windows.wndupgrade.desc=Upgrading an item permanently improves it:
windows.wndupgrade.unided=You don't know the properties of this item, its un-upgraded state is shown here. windows.wndupgrade.unided=You don't know the properties of this item, its un-upgraded state is shown here.
windows.wndupgrade.unknown_ring=You don't know what this ring's effect is, and so have no idea what upgrading it will do.
windows.wndupgrade.cursed=Upgrading this item also has a 33% chance to cleanse its curse. windows.wndupgrade.cursed=Upgrading this item also has a 33% chance to cleanse its curse.
windows.wndupgrade.cursed_weaken=Upgrading this item will also weaken its curse, and has a 33% chance to cleanse it entirely. windows.wndupgrade.cursed_weaken=Upgrading this item will also weaken its curse, and has a 33% chance to cleanse it entirely.
windows.wndupgrade.curse_infusion=If the curse is cleansed, the item will no longer benefit from curse infusion! windows.wndupgrade.curse_infusion=If the curse is cleansed, the item will no longer benefit from curse infusion!
@@ -280,6 +280,7 @@ public class WndUpgrade extends Window {
//Various ring stats (varies by ring) //Various ring stats (varies by ring)
if (toUpgrade instanceof Ring){ if (toUpgrade instanceof Ring){
if (((Ring) toUpgrade).isKnown()) {
if (((Ring) toUpgrade).upgradeStat1(levelFrom) != null) { if (((Ring) toUpgrade).upgradeStat1(levelFrom) != null) {
bottom = fillFields(Messages.get(toUpgrade, "upgrade_stat_name_1"), bottom = fillFields(Messages.get(toUpgrade, "upgrade_stat_name_1"),
((Ring) toUpgrade).upgradeStat1(levelFrom), ((Ring) toUpgrade).upgradeStat1(levelFrom),
@@ -299,6 +300,7 @@ public class WndUpgrade extends Window {
bottom); bottom);
} }
} }
}
//visual separators for each column //visual separators for each column
ColorBlock sep = new ColorBlock(1, 1, 0xFF222222); ColorBlock sep = new ColorBlock(1, 1, 0xFF222222);
@@ -317,8 +319,12 @@ public class WndUpgrade extends Window {
//warning relating to identification //warning relating to identification
if (!toUpgrade.isIdentified()){ if (!toUpgrade.isIdentified()){
if (toUpgrade instanceof Ring && !((Ring) toUpgrade).isKnown()){
bottom = addMessage(Messages.get(this, "unknown_ring"), CharSprite.WARNING, bottom);
} else {
bottom = addMessage(Messages.get(this, "unided"), CharSprite.WARNING, bottom); bottom = addMessage(Messages.get(this, "unided"), CharSprite.WARNING, bottom);
} }
}
// various messages relating to enchantments and curses // various messages relating to enchantments and curses
if (!(upgrader instanceof MagicalInfusion)) { if (!(upgrader instanceof MagicalInfusion)) {