v0.8.1: BuffIndicator.refreshHero() is now always called when hero acts
This commit is contained in:
parent
13ecf57edf
commit
05b70dce87
|
@ -27,6 +27,8 @@ import com.watabou.utils.Bundle;
|
|||
|
||||
public class AdrenalineSurge extends Buff {
|
||||
|
||||
public static float DURATION = 800f;
|
||||
|
||||
{
|
||||
type = buffType.POSITIVE;
|
||||
}
|
||||
|
@ -60,6 +62,11 @@ public class AdrenalineSurge extends Buff {
|
|||
return BuffIndicator.FURY;
|
||||
}
|
||||
|
||||
@Override
|
||||
public float iconFadePercent() {
|
||||
return Math.max(0, (DURATION - visualcooldown()) / DURATION);
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return Messages.get(this, "name");
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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)) {
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
|
|
|
@ -73,8 +73,6 @@ public class FireImbue extends Buff {
|
|||
left -= TICK;
|
||||
if (left <= 0){
|
||||
detach();
|
||||
} else if (left < 5){
|
||||
BuffIndicator.refreshHero();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -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() {
|
||||
|
|
|
@ -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(){
|
||||
|
|
|
@ -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();
|
||||
|
|
|
@ -67,8 +67,6 @@ public class ToxicImbue extends Buff {
|
|||
left -= TICK;
|
||||
if (left <= 0){
|
||||
detach();
|
||||
} else if (left < 5){
|
||||
BuffIndicator.refreshHero();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -511,9 +511,7 @@ public class Hero extends Char {
|
|||
}
|
||||
|
||||
checkVisibleMobs();
|
||||
if (!buffs(FlavourBuff.class).isEmpty()) {
|
||||
BuffIndicator.refreshHero();
|
||||
}
|
||||
BuffIndicator.refreshHero();
|
||||
|
||||
if (paralysed > 0) {
|
||||
|
||||
|
|
|
@ -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 );
|
||||
|
|
|
@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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){
|
||||
|
|
|
@ -240,7 +240,6 @@ public class WandOfLivingEarth extends DamageWand {
|
|||
return damage - armor;
|
||||
} else {
|
||||
armor -= block;
|
||||
BuffIndicator.refreshHero();
|
||||
return damage - block;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
|
@ -107,8 +107,6 @@ public class Sungrass extends Plant {
|
|||
|
||||
if (level <= 0) {
|
||||
detach();
|
||||
} else {
|
||||
BuffIndicator.refreshHero();
|
||||
}
|
||||
spend( STEP );
|
||||
return true;
|
||||
|
|
|
@ -101,8 +101,6 @@ public class Swiftthistle extends Plant {
|
|||
public void processTime(float time){
|
||||
left -= time;
|
||||
|
||||
BuffIndicator.refreshHero();
|
||||
|
||||
if (left <= 0){
|
||||
detach();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user