From b8fb981bfef1f56bcf43290f0ad6c1609c76fcd8 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 24 Jan 2020 15:08:14 -0500 Subject: [PATCH] v0.8.0: fixes/tweaks: - fixed crash/freeze bugs involving spinners, mimics, and DM-300 - fixed ring descriptions to properly consider degraded - fixed typos in some dart descriptions --- .../shatteredpixeldungeon/actors/mobs/Mimic.java | 2 +- .../shatteredpixeldungeon/actors/mobs/NewDM300.java | 11 ++++++++++- .../shatteredpixeldungeon/actors/mobs/Spinner.java | 2 +- .../items/rings/RingOfAccuracy.java | 2 +- .../items/rings/RingOfElements.java | 2 +- .../items/rings/RingOfEnergy.java | 2 +- .../items/rings/RingOfEvasion.java | 2 +- .../items/rings/RingOfForce.java | 3 ++- .../items/rings/RingOfFuror.java | 2 +- .../items/rings/RingOfHaste.java | 2 +- .../items/rings/RingOfMight.java | 2 +- .../items/rings/RingOfSharpshooting.java | 2 +- .../items/rings/RingOfTenacity.java | 2 +- .../items/rings/RingOfWealth.java | 2 +- .../messages/items/items.properties | 6 +++--- 15 files changed, 27 insertions(+), 17 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mimic.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mimic.java index 609615475..6ff3d1023 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mimic.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Mimic.java @@ -178,7 +178,7 @@ public class Mimic extends Mob { public void stopHiding(){ state = HUNTING; - if (Dungeon.level.heroFOV[pos] && Actor.chars().contains(this)) { + if (Actor.chars().contains(this) && Dungeon.level.heroFOV[pos]) { enemy = Dungeon.hero; target = Dungeon.hero.pos; enemySeen = true; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewDM300.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewDM300.java index 72946155b..876d191f1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewDM300.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/NewDM300.java @@ -263,6 +263,15 @@ public class NewDM300 extends Mob { return super.act(); } + @Override + protected Char chooseEnemy() { + Char enemy = super.chooseEnemy(); + if (supercharged && enemy == null){ + enemy = Dungeon.hero; + } + return enemy; + } + @Override public void move(int step) { super.move(step); @@ -485,7 +494,7 @@ public class NewDM300 extends Mob { return true; } - if (!supercharged || state != HUNTING){ + if (!supercharged || state != HUNTING || Dungeon.level.adjacent(pos, target)){ return false; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Spinner.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Spinner.java index 998123a3c..0ea9ddfde 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Spinner.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/mobs/Spinner.java @@ -160,7 +160,7 @@ public class Spinner extends Mob { } //in case target is at the edge of the map and there are no more cells in the path - if (b.path.size() <= collisionIndex){ + if (b.path.size() <= collisionIndex+1){ return -1; } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfAccuracy.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfAccuracy.java index 224309511..780ceea60 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfAccuracy.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfAccuracy.java @@ -30,7 +30,7 @@ public class RingOfAccuracy extends Ring { public String statsInfo() { if (isIdentified()){ - return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.3f, soloBonus()) - 1f))); + return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.3f, soloBuffedBonus()) - 1f))); } else { return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(30f)); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfElements.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfElements.java index abf32b3f1..0e14d254d 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfElements.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfElements.java @@ -62,7 +62,7 @@ public class RingOfElements extends Ring { public String statsInfo() { if (isIdentified()){ - return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (1f - Math.pow(0.80f, soloBonus())))); + return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (1f - Math.pow(0.80f, soloBuffedBonus())))); } else { return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(20f)); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfEnergy.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfEnergy.java index c3e0e8438..c2c04bec7 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfEnergy.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfEnergy.java @@ -30,7 +30,7 @@ public class RingOfEnergy extends Ring { public String statsInfo() { if (isIdentified()){ - return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.30f, soloBonus()) - 1f))); + return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.30f, soloBuffedBonus()) - 1f))); } else { return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(30f)); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfEvasion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfEvasion.java index 229fb97d0..bdd1b4279 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfEvasion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfEvasion.java @@ -30,7 +30,7 @@ public class RingOfEvasion extends Ring { public String statsInfo() { if (isIdentified()){ - return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.15f, soloBonus()) - 1f))); + return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.15f, soloBuffedBonus()) - 1f))); } else { return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(15f)); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfForce.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfForce.java index 4d6bf4723..aba814ff1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfForce.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfForce.java @@ -81,7 +81,8 @@ public class RingOfForce extends Ring { public String statsInfo() { float tier = tier(Dungeon.hero.STR()); if (isIdentified()) { - return Messages.get(this, "stats", min(soloBonus(), tier), max(soloBonus(), tier), soloBonus()); + int level = soloBuffedBonus(); + return Messages.get(this, "stats", min(level, tier), max(level, tier), level); } else { return Messages.get(this, "typical_stats", min(1, tier), max(1, tier), 1); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfFuror.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfFuror.java index 50f8d1429..dc569cb55 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfFuror.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfFuror.java @@ -30,7 +30,7 @@ public class RingOfFuror extends Ring { public String statsInfo() { if (isIdentified()){ - return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.105f, soloBonus()) - 1f))); + return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.105f, soloBuffedBonus()) - 1f))); } else { return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(10.5f)); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfHaste.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfHaste.java index 310f07909..ce5807516 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfHaste.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfHaste.java @@ -30,7 +30,7 @@ public class RingOfHaste extends Ring { public String statsInfo() { if (isIdentified()){ - return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.2f, soloBonus()) - 1f))); + return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.2f, soloBuffedBonus()) - 1f))); } else { return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(20f)); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfMight.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfMight.java index cc0a1416d..2aa2c1914 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfMight.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfMight.java @@ -72,7 +72,7 @@ public class RingOfMight extends Ring { public String statsInfo() { if (isIdentified()){ - return Messages.get(this, "stats", soloBonus(), new DecimalFormat("#.##").format(100f * (Math.pow(1.035, soloBonus()) - 1f))); + return Messages.get(this, "stats", soloBonus(), new DecimalFormat("#.##").format(100f * (Math.pow(1.035, soloBuffedBonus()) - 1f))); } else { return Messages.get(this, "typical_stats", 1, new DecimalFormat("#.##").format(3.5f)); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfSharpshooting.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfSharpshooting.java index 65c559f8d..221bc33b1 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfSharpshooting.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfSharpshooting.java @@ -30,7 +30,7 @@ public class RingOfSharpshooting extends Ring { public String statsInfo() { if (isIdentified()){ - return Messages.get(this, "stats", soloBonus(), new DecimalFormat("#.##").format(100f * (Math.pow(1.2, soloBonus()) - 1f))); + return Messages.get(this, "stats", soloBuffedBonus(), new DecimalFormat("#.##").format(100f * (Math.pow(1.2, soloBonus()) - 1f))); } else { return Messages.get(this, "typical_stats", 1, new DecimalFormat("#.##").format(20f)); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfTenacity.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfTenacity.java index 931b34d1d..f15ad9f4e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfTenacity.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfTenacity.java @@ -30,7 +30,7 @@ public class RingOfTenacity extends Ring { public String statsInfo() { if (isIdentified()){ - return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (1f - Math.pow(0.85f, soloBonus())))); + return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (1f - Math.pow(0.85f, soloBuffedBonus())))); } else { return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(15f)); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfWealth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfWealth.java index 7d49bf02e..b639ef991 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfWealth.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/RingOfWealth.java @@ -51,7 +51,7 @@ public class RingOfWealth extends Ring { public String statsInfo() { if (isIdentified()){ - return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.2f, soloBonus()) - 1f))); + return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.2f, soloBuffedBonus()) - 1f))); } else { return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(20f)); } diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties index f5ba11716..cdb37dec1 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties @@ -1448,7 +1448,7 @@ items.weapon.melee.wornshortsword.desc=A quite short sword, worn down through he ###missile weapons items.weapon.missiles.darts.adrenalinedart.name=adrenaline dart -items.weapon.missiles.darts.adrenalinedart.desc=These darts are tipped with a swiftthistle-based compound which will give their target a boost in speed. This boost affects both speed of movement and of attacking, though movement is improved more. The dart will itself is still harmful to enemies, but will not harm allies. +items.weapon.missiles.darts.adrenalinedart.desc=These darts are tipped with a swiftthistle-based compound which will give their target a boost in speed. This boost affects both speed of movement and of attacking, though movement is improved more. The dart itself is still harmful to enemies, but will not harm allies. items.weapon.missiles.darts.blindingdart.name=blinding dart items.weapon.missiles.darts.blindingdart.desc=These darts are tipped with a blindweed-based compound which will blind their target for a short time. They do not disorient however, so an enemy will still know where they last saw you. @@ -1472,10 +1472,10 @@ items.weapon.missiles.darts.displacingdart.name=displacing dart items.weapon.missiles.darts.displacingdart.desc=These darts are tipped with a fadeleaf-based compound which will teleport their target a short distance away. items.weapon.missiles.darts.healingdart.name=healing dart -items.weapon.missiles.darts.healingdart.desc=These darts are tipped with a sungrass-based compound which grants a burst of healing to their target. The dart will itself is still harmful to enemies, but will not harm allies. +items.weapon.missiles.darts.healingdart.desc=These darts are tipped with a sungrass-based compound which grants a burst of healing to their target. The dart itself is still harmful to enemies, but will not harm allies. items.weapon.missiles.darts.holydart.name=holy dart -items.weapon.missiles.darts.holydart.desc=These darts are tipped with a starflower-based compound which grants a boost in power to their target. The dart will itself is still harmful to enemies, but will not harm allies. +items.weapon.missiles.darts.holydart.desc=These darts are tipped with a starflower-based compound which grants a boost in power to their target. The dart itself is still harmful to enemies, but will not harm allies. items.weapon.missiles.darts.incendiarydart.name=incendiary dart items.weapon.missiles.darts.incendiarydart.desc=These darts are tipped with a firebloom-based compound which will burst into brilliant flames on impact.