From deb626e279617c0c2e075f8cad3e34691e22a7a7 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Wed, 11 Oct 2017 21:52:33 -0400 Subject: [PATCH] v0.6.2: several simple bugfixes: - fixed fire not spreading in some cases - fixed wand of corruption awarding exp at all levels - fixed assassin bonus damage scaling incorrectly - fixed sprites not retaining invisibility visuals in some cases --- .../shatteredpixeldungeon/actors/blobs/Fire.java | 2 +- .../actors/buffs/Preparation.java | 6 +++--- .../shatteredpixeldungeon/actors/mobs/Mob.java | 2 +- .../items/wands/WandOfCorruption.java | 2 +- .../shatteredpixeldungeon/sprites/CharSprite.java | 14 ++++++++++++-- 5 files changed, 18 insertions(+), 8 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Fire.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Fire.java index 8705be816..06a4dd04e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Fire.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/blobs/Fire.java @@ -69,7 +69,7 @@ public class Fire extends Blob { } - } else if (freeze == null || freeze.volume <= 0 || freeze.cur[cell] < 0) { + } else if (freeze == null || freeze.volume <= 0 || freeze.cur[cell] <= 0) { if (flamable[cell] && (cur[cell-1] > 0 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 169c6b93f..306ecff71 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 @@ -55,8 +55,8 @@ public class Preparation extends Buff implements ActionIndicator.Action { LVL_1( 1, 0.1f, 0.0f, 1, 0), LVL_2( 3, 0.2f, 0.0f, 1, 1), LVL_3( 6, 0.3f, 0.0f, 2, 3), - LVL_4( 11, 0.4f, 0.4f, 2, 5), - LVL_5( 16, 0.6f, 0.6f, 3, 7); + LVL_4( 11, 0.4f, 0.6f, 2, 5), + LVL_5( 16, 0.5f, 1.0f, 3, 7); final int turnsReq; final float baseDmgBonus, missingHPBonus; @@ -80,7 +80,7 @@ public class Preparation extends Buff implements ActionIndicator.Action { int newDmg = attacker.damageRoll(); if (newDmg > dmg) dmg = newDmg; } - float defenderHPPercent = defender.HP / (float)defender.HT; + float defenderHPPercent = 1f - (defender.HP / (float)defender.HT); return Math.round(dmg * (1f + baseDmgBonus + (missingHPBonus * defenderHPPercent))); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java index cfd4d5223..370c41d04 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mob.java @@ -86,7 +86,7 @@ public abstract class Mob extends Char { protected int defenseSkill = 0; public int EXP = 1; - protected int maxLvl = Hero.MAX_LEVEL; + public int maxLvl = Hero.MAX_LEVEL; protected Char enemy; protected boolean enemySeen; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java index 8a4a4af8d..21eb8bf06 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfCorruption.java @@ -208,7 +208,7 @@ public class WandOfCorruption extends Wand { buff.detach(); } Buff.affect(enemy, Corruption.class); - if (enemy.EXP > 0) { + if (enemy.EXP > 0 && curUser.lvl <= enemy.maxLvl) { curUser.sprite.showStatus(CharSprite.POSITIVE, Messages.get(enemy, "exp", enemy.EXP)); curUser.earnExp(enemy.EXP); enemy.EXP = 0; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java index 731eb4526..159ccf030 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/CharSprite.java @@ -314,9 +314,11 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip levitation.pour( Speck.factory( Speck.JET ), 0.02f ); break; case INVISIBLE: + if (invisible != null) { + invisible.killAndErase(); + } + invisible = new AlphaTweener( this, 0.4f, 0.4f ); if (parent != null){ - if (invisible != null) invisible.killAndErase(); - invisible = new AlphaTweener( this, 0.4f, 0.4f ); parent.add(invisible); } else alpha( 0.4f ); @@ -450,6 +452,14 @@ public class CharSprite extends MovieClip implements Tweener.Listener, MovieClip } } + @Override + public void resetColor() { + super.resetColor(); + if (invisible != null){ + alpha(0.4f); + } + } + public synchronized void showSleep() { if (emo instanceof EmoIcon.Sleep) {