From e837d28cf23f1265ca90a56be4c0d2c9464015c8 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Tue, 12 May 2020 20:14:19 -0400 Subject: [PATCH] v0.8.1: improved a few more buff icons, mainly subclass abilities --- core/src/main/assets/interfaces/buffs.png | Bin 1236 -> 1240 bytes .../main/assets/interfaces/large_buffs.png | Bin 2516 -> 2535 bytes .../actors/buffs/Berserk.java | 20 ++++++++++++++---- .../actors/buffs/Combo.java | 20 ++++++++++++------ .../actors/buffs/FlavourBuff.java | 8 ------- .../actors/buffs/Haste.java | 5 +++++ .../actors/buffs/Momentum.java | 13 ++++++------ .../actors/buffs/Preparation.java | 15 ++++++++++++- .../actors/buffs/Stamina.java | 5 +++++ .../ui/BuffIndicator.java | 9 ++++++-- 10 files changed, 68 insertions(+), 27 deletions(-) diff --git a/core/src/main/assets/interfaces/buffs.png b/core/src/main/assets/interfaces/buffs.png index e984af86c536a506718299b599575ab92cbf297a..df34f6eb31edc3574e7a73e3739fb872cc4a4a3f 100644 GIT binary patch delta 957 zcmV;u148`N3D^mcBmwY|CDQ}CS{#x19t6xt>t~Z10U>{dNkljEvY744d>`#9vP+zHQ3mOeZ!22KL8b_!k0SQe1 z5m-|K(GLj}xzr#0@b++D20%Q4M4(<@VG7?R5YNCm14t5xK!u-Y0D=jWQ3i=v6j)_R zU|0eh?7u;QQS#jkd^!c$Y&HxbYw%Ox1`-IBoPyf#rvT2Tv*m0%JI<~%;_Ny54uAu$ zL+5|UId)E*yki8X1}70HmqeM(&m?dzwze-Ww=XX!&~CRW&}p|j6gUsHHzXv`4FbJ` z9tEy=ey;ig*Fpj}61cs)ySvSwLhbE7Kml5~K$xPB0+(WYr+sht?Va8BuC9?S6$L`E zf0qX6ot~cdaF{uy!QsQBcsM54$Face-P3>5)7>r1Ac0N?xWA7Dk_67gCjm2~!0s~> zNCZ5AuGl{~IAtCD5qLa0(&haraC1Wg_6H5@6wDwI7>93x?w>18Kn9ut_3tO3`jroX$F5D zv;+MaxDoLT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=tQd&)g6vrIUHqE*STJC}9O4^}yo9g9!+A8TU{uK+22U<^P>J1(n<;EjINbGLsMQ&uEyW8yh~M5~j+zgs zN4Ue4qRFX7|M67(v&_c@e}u6K_K>BgTn?Y;THCw^q?^+?3KJX)Ep;ZnDQzlm7N~Sz zd@YHfH1bi<4KGd${H(jgH-v4ZHBk$-?W{R*%o-()b`WRw#~}L8)VtV{K^==jq6G)P zop?SJ4tET=$%mrWs3BF-Gu4nn!_bkqk_W2e8?Lx*jsC~bjx9g#N9F;L*VKa7R5j56n)t z= 3f){ - icon.resetColor(); - } else { - icon.tint(0xb3b3b3, 0.5f + 0.5f*(3f + 1 - comboTime)/3f); - } + if (count >= 10) icon.hardlight(1f, 0f, 0f); + else if (count >= 8)icon.hardlight(1f, 0.8f, 0f); + else if (count >= 6)icon.hardlight(1f, 1f, 0f); + else if (count >= 4)icon.hardlight(0.8f, 1f, 0f); + else if (count >= 2)icon.hardlight(0f, 1f, 0f); + else icon.resetColor(); } - + + @Override + public float iconFadePercent() { + return (4 - comboTime)/4f; + } + @Override public String toString() { return Messages.get(this, "name"); @@ -87,6 +93,8 @@ public class Combo extends Buff implements ActionIndicator.Action { } + BuffIndicator.refreshHero(); //refresh the buff visually on-hit + } public void miss( Char enemy ){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/FlavourBuff.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/FlavourBuff.java index f38ff16a4..f3d4eb07e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/FlavourBuff.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/FlavourBuff.java @@ -31,14 +31,6 @@ public class FlavourBuff extends Buff { detach(); return true; } - - public static void greyIcon(Image icon, float startGrey, float remaining){ - if (remaining >= startGrey){ - icon.resetColor(); - } else { - icon.tint(0xb3b3b3, 0.6f + 0.3f*(startGrey - remaining)/startGrey); - } - } //flavour buffs can all just rely on cooldown() protected String dispTurns() { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Haste.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Haste.java index 0dacf2626..be83e6546 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Haste.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Haste.java @@ -38,6 +38,11 @@ public class Haste extends FlavourBuff { return BuffIndicator.MOMENTUM; } + @Override + public void tintIcon(Image icon) { + icon.hardlight(1f, 0.8f, 0f); + } + @Override public float iconFadePercent() { return Math.max(0, (DURATION - visualcooldown()) / DURATION); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Momentum.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Momentum.java index 23f3db83f..7aca1124e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Momentum.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Momentum.java @@ -72,13 +72,14 @@ public class Momentum extends Buff { @Override public void tintIcon(Image icon) { - if (stacks <= 5) { - icon.hardlight(0.2f * (stacks - 1), 1f, 0f); - } else { - icon.hardlight(1f, 1f - 0.2f*(stacks - 6), 0f); - } + icon.invert(); } - + + @Override + public float iconFadePercent() { + return (10-stacks)/10f; + } + @Override public String toString() { return Messages.get(this, "name"); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Preparation.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Preparation.java index 8cb758768..c18bce206 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Preparation.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Preparation.java @@ -157,7 +157,20 @@ public class Preparation extends Buff implements ActionIndicator.Action { break; } } - + + @Override + public float iconFadePercent() { + if (AttackLevel.getLvl(turnsInvis) == AttackLevel.LVL_5){ + return 0; + } else { + float turnsForCur = AttackLevel.getLvl(turnsInvis).turnsReq; + float turnsForNext = AttackLevel.values()[AttackLevel.getLvl(turnsInvis).ordinal()+1].turnsReq; + turnsForNext -= turnsForCur; + float turnsToNext = turnsInvis - turnsForCur; + return Math.min(1, (turnsForNext - turnsToNext)/(turnsForNext)); + } + } + @Override public String toString() { return Messages.get(this, "name"); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Stamina.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Stamina.java index eb525f832..88899e1f0 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Stamina.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Stamina.java @@ -38,6 +38,11 @@ public class Stamina extends FlavourBuff { return BuffIndicator.MOMENTUM; } + @Override + public void tintIcon(Image icon) { + icon.hardlight(0.5f, 1f, 0.5f); + } + @Override public float iconFadePercent() { return Math.max(0, (DURATION - visualcooldown()) / DURATION); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java index dcea68367..2b99366fb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/ui/BuffIndicator.java @@ -215,9 +215,14 @@ public class BuffIndicator extends Component { public void updateIcon(){ icon.frame( film.get( buff.icon() ) ); buff.tintIcon(icon); - //logic here rounds down to the nearest pixel + //round up to the nearest pixel if <50% faded, otherwise round down + float fadeHeight = buff.iconFadePercent() * icon.height(); float zoom = (camera() != null) ? camera().zoom : 1; - grey.scale.set( icon.width(), (float)Math.floor(zoom*icon.height()*buff.iconFadePercent())/zoom); + if (fadeHeight < icon.height()/2f){ + grey.scale.set( icon.width(), (float)Math.ceil(zoom*fadeHeight)/zoom); + } else { + grey.scale.set( icon.width(), (float)Math.floor(zoom*fadeHeight)/zoom); + } } @Override