diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/AdrenalineSurge.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/AdrenalineSurge.java index 04be32e08..7f3bce1f6 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/AdrenalineSurge.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/AdrenalineSurge.java @@ -26,6 +26,8 @@ import com.shatteredpixel.shatteredpixeldungeon.ui.BuffIndicator; import com.watabou.utils.Bundle; public class AdrenalineSurge extends Buff { + + public static float DURATION = 800f; { type = buffType.POSITIVE; @@ -59,7 +61,12 @@ public class AdrenalineSurge extends Buff { public int icon() { return BuffIndicator.FURY; } - + + @Override + public float iconFadePercent() { + return Math.max(0, (DURATION - visualcooldown()) / DURATION); + } + @Override public String toString() { return Messages.get(this, "name"); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Berserk.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Berserk.java index 84435a130..d67bc4de1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Berserk.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Berserk.java @@ -96,7 +96,6 @@ public class Berserk extends Buff { } else { state = State.RECOVERING; levelRecovery = LEVEL_RECOVER_START; - BuffIndicator.refreshHero(); if (buff != null) buff.absorbDamage(buff.shielding()); power = 0f; } @@ -106,7 +105,6 @@ public class Berserk extends Buff { if (power <= 0){ detach(); } - BuffIndicator.refreshHero(); } spend(TICK); return true; @@ -123,7 +121,6 @@ public class Berserk extends Buff { WarriorShield shield = target.buff(WarriorShield.class); if (shield != null){ state = State.BERSERK; - BuffIndicator.refreshHero(); shield.supercharge(shield.maxShield() * 10); SpellSprite.show(target, SpellSprite.BERSERK); @@ -139,13 +136,11 @@ public class Berserk extends Buff { public void damage(int damage){ if (state == State.RECOVERING) return; power = Math.min(1.1f, power + (damage/(float)target.HT)/3f ); - BuffIndicator.refreshHero(); } public void recover(float percent){ if (levelRecovery > 0){ levelRecovery -= percent; - BuffIndicator.refreshHero(); if (levelRecovery <= 0) { state = State.NORMAL; levelRecovery = 0; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java index 9f1102bef..4ca4d2188 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Burning.java @@ -147,7 +147,6 @@ public class Burning extends Buff implements Hero.Doom { spend( TICK ); left -= TICK; - BuffIndicator.refreshHero(); if (left <= 0 || (Dungeon.level.water[target.pos] && !target.flying)) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Combo.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Combo.java index 3ea8b2599..5c3bb8a3d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Combo.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Combo.java @@ -77,7 +77,6 @@ public class Combo extends Buff implements ActionIndicator.Action { count++; comboTime = 4f; misses = 0; - BuffIndicator.refreshHero(); if (count >= 2) { @@ -108,7 +107,6 @@ public class Combo extends Buff implements ActionIndicator.Action { public boolean act() { comboTime-=TICK; spend(TICK); - BuffIndicator.refreshHero(); if (comboTime <= 0) { detach(); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/FireImbue.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/FireImbue.java index 2aee17942..697a1568a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/FireImbue.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/FireImbue.java @@ -73,8 +73,6 @@ public class FireImbue extends Buff { left -= TICK; if (left <= 0){ detach(); - } else if (left < 5){ - BuffIndicator.refreshHero(); } return true; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java index 95b46625d..70b42f172 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java @@ -82,28 +82,21 @@ public class Hunger extends Buff implements Hero.Doom { } else { float newLevel = level + STEP; - boolean statusUpdated = false; if (newLevel >= STARVING) { GLog.n( Messages.get(this, "onstarving") ); hero.resting = false; hero.damage( 1, this ); - statusUpdated = true; hero.interrupt(); } else if (newLevel >= HUNGRY && level < HUNGRY) { GLog.w( Messages.get(this, "onhungry") ); - statusUpdated = true; } level = newLevel; - if (statusUpdated) { - BuffIndicator.refreshHero(); - } - } spend( target.buff( Shadows.class ) == null ? STEP : STEP * 1.5f ); @@ -140,7 +133,6 @@ public class Hunger extends Buff implements Hero.Doom { partialDamage += excess * (target.HT/1000f); } - BuffIndicator.refreshHero(); } public boolean isStarving() { 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 ac22ba05a..23f3db83f 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 @@ -40,7 +40,6 @@ public class Momentum extends Buff { turnsSinceMove++; if (turnsSinceMove > 0){ stacks = Math.max(0, stacks - turnsSinceMove); - BuffIndicator.refreshHero(); if (stacks == 0) detach(); } spend(TICK); @@ -50,7 +49,6 @@ public class Momentum extends Buff { public void gainStack(){ stacks = Math.min(stacks+1, 10); turnsSinceMove = -1; - BuffIndicator.refreshHero(); } public int stacks(){ 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 b00d004c6..ee32f53a4 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 @@ -107,7 +107,6 @@ public class Preparation extends Buff implements ActionIndicator.Action { if (AttackLevel.getLvl(turnsInvis).blinkDistance > 0 && target == Dungeon.hero){ ActionIndicator.setAction(this); } - BuffIndicator.refreshHero(); spend(TICK); } else { detach(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ToxicImbue.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ToxicImbue.java index 3a6fd29bb..9241a9680 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ToxicImbue.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/ToxicImbue.java @@ -67,8 +67,6 @@ public class ToxicImbue extends Buff { left -= TICK; if (left <= 0){ detach(); - } else if (left < 5){ - BuffIndicator.refreshHero(); } return true; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 2c8d83768..b106cca5d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -511,9 +511,7 @@ public class Hero extends Char { } checkVisibleMobs(); - if (!buffs(FlavourBuff.class).isEmpty()) { - BuffIndicator.refreshHero(); - } + BuffIndicator.refreshHero(); if (paralysed > 0) { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Metabolism.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Metabolism.java index 556908bda..d86338b79 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Metabolism.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Metabolism.java @@ -50,10 +50,9 @@ public class Metabolism extends Glyph { Hunger hunger = Buff.affect(defender, Hunger.class); - if (hunger != null && !hunger.isStarving()) { + if (!hunger.isStarving()) { hunger.reduceHunger( healing * -10 ); - BuffIndicator.refreshHero(); defender.HP += healing; defender.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java index 7e78bd1ea..c506fb3ae 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CapeOfThorns.java @@ -81,7 +81,6 @@ public class CapeOfThorns extends Artifact { if (cooldown > 0) { cooldown--; if (cooldown == 0) { - BuffIndicator.refreshHero(); GLog.w( Messages.get(this, "inert") ); } updateQuickslot(); @@ -97,7 +96,6 @@ public class CapeOfThorns extends Artifact { charge = 0; cooldown = 10+level(); GLog.p( Messages.get(this, "radiating") ); - BuffIndicator.refreshHero(); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java index f079439fe..cb9f6b66a 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TalismanOfForesight.java @@ -203,7 +203,6 @@ public class TalismanOfForesight extends Artifact { warn --; } } - BuffIndicator.refreshHero(); //fully charges in 2000 turns at lvl=0, scaling to 667 turns at lvl = 10. LockedFloor lock = target.buff(LockedFloor.class); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/elixirs/ElixirOfAquaticRejuvenation.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/elixirs/ElixirOfAquaticRejuvenation.java index 5a60cfe21..55653b032 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/elixirs/ElixirOfAquaticRejuvenation.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/potions/elixirs/ElixirOfAquaticRejuvenation.java @@ -81,7 +81,6 @@ public class ElixirOfAquaticRejuvenation extends Elixir { target.HP += healAmt; left -= healAmt; target.sprite.emitter().burst( Speck.factory( Speck.HEALING ), 1 ); - BuffIndicator.refreshHero(); } if (left <= 0){ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLivingEarth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLivingEarth.java index 706a7625b..8dd0509cf 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLivingEarth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfLivingEarth.java @@ -240,7 +240,6 @@ public class WandOfLivingEarth extends DamageWand { return damage - armor; } else { armor -= block; - BuffIndicator.refreshHero(); return damage - block; } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Kinetic.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Kinetic.java index e6b947d0e..106212dbe 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Kinetic.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/enchantments/Kinetic.java @@ -89,7 +89,6 @@ public class Kinetic extends Weapon.Enchantment { public boolean act() { preservedDamage -= Math.max(preservedDamage*.025f, 0.1f); if (preservedDamage <= 0) detach(); - else if (preservedDamage <= 10) BuffIndicator.refreshHero(); spend(TICK); return true; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Earthroot.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Earthroot.java index bd40a5f58..2208573be 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Earthroot.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Earthroot.java @@ -107,7 +107,6 @@ public class Earthroot extends Plant { return damage - block; } else { level -= block; - BuffIndicator.refreshHero(); return damage - block; } } @@ -115,7 +114,6 @@ public class Earthroot extends Plant { public void level( int value ) { if (level < value) { level = value; - BuffIndicator.refreshHero(); } pos = target.pos; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sungrass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sungrass.java index 1681294fa..47bc1540c 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sungrass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Sungrass.java @@ -107,8 +107,6 @@ public class Sungrass extends Plant { if (level <= 0) { detach(); - } else { - BuffIndicator.refreshHero(); } spend( STEP ); return true; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Swiftthistle.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Swiftthistle.java index 9ce6e7fbf..4886e3658 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Swiftthistle.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Swiftthistle.java @@ -101,8 +101,6 @@ public class Swiftthistle extends Plant { public void processTime(float time){ left -= time; - BuffIndicator.refreshHero(); - if (left <= 0){ detach(); }