From 4b0e89af2e4ef3c986b9cb5791f6318581a31b0b Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 27 Aug 2021 14:41:36 -0400 Subject: [PATCH] v1.0.2: negative str bonuses now also show in hero stats screen --- .../shatteredpixeldungeon/windows/WndGameInProgress.java | 6 ++++-- .../shatteredpixeldungeon/windows/WndHero.java | 5 +++-- .../shatteredpixeldungeon/windows/WndRanking.java | 5 +++-- 3 files changed, 10 insertions(+), 6 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndGameInProgress.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndGameInProgress.java index f5b0eec78..36b4cad1f 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndGameInProgress.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndGameInProgress.java @@ -108,8 +108,10 @@ public class WndGameInProgress extends Window { pos += GAP; - if (info.strBonus > 0) statSlot( Messages.get(this, "str"), info.str + "+" + info.strBonus ); - else statSlot( Messages.get(this, "str"), info.str ); + int strBonus = info.strBonus; + if (strBonus > 0) statSlot( Messages.get(this, "str"), info.str + " + " + strBonus ); + else if (strBonus < 0) statSlot( Messages.get(this, "str"), info.str + " - " + -strBonus ); + else statSlot( Messages.get(this, "str"), info.str ); if (info.shld > 0) statSlot( Messages.get(this, "health"), info.hp + "+" + info.shld + "/" + info.ht ); else statSlot( Messages.get(this, "health"), (info.hp) + "/" + info.ht ); statSlot( Messages.get(this, "exp"), info.exp + "/" + Hero.maxExp(info.level) ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndHero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndHero.java index 5369f4e24..2b336e2c8 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndHero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndHero.java @@ -144,8 +144,9 @@ public class WndHero extends WndTabbed { pos = title.bottom() + 2*GAP; int strBonus = hero.STR() - hero.STR; - if (strBonus > 0) statSlot( Messages.get(this, "str"), hero.STR + "+" + strBonus ); - else statSlot( Messages.get(this, "str"), hero.STR() ); + if (strBonus > 0) statSlot( Messages.get(this, "str"), hero.STR + " + " + strBonus ); + else if (strBonus < 0) statSlot( Messages.get(this, "str"), hero.STR + " - " + -strBonus ); + else statSlot( Messages.get(this, "str"), hero.STR() ); if (hero.shielding() > 0) statSlot( Messages.get(this, "health"), hero.HP + "+" + hero.shielding() + "/" + hero.HT ); else statSlot( Messages.get(this, "health"), (hero.HP) + "/" + hero.HT ); statSlot( Messages.get(this, "exp"), hero.exp + "/" + hero.maxExp() ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndRanking.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndRanking.java index 484b5e2c2..6c8d40381 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndRanking.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/windows/WndRanking.java @@ -224,8 +224,9 @@ public class WndRanking extends WndTabbed { pos += GAP; int strBonus = Dungeon.hero.STR() - Dungeon.hero.STR; - if (strBonus > 0) pos = statSlot(this, Messages.get(this, "str"), Dungeon.hero.STR + "+" + strBonus, pos); - else pos = statSlot(this, Messages.get(this, "str"), Integer.toString(Dungeon.hero.STR), pos); + if (strBonus > 0) pos = statSlot(this, Messages.get(this, "str"), Dungeon.hero.STR + " + " + strBonus, pos); + else if (strBonus < 0) pos = statSlot(this, Messages.get(this, "str"), Dungeon.hero.STR + " - " + -strBonus, pos ); + else pos = statSlot(this, Messages.get(this, "str"), Integer.toString(Dungeon.hero.STR), pos); pos = statSlot( this, Messages.get(this, "health"), Integer.toString( Dungeon.hero.HT ), pos ); pos += GAP;