From f831a848162756d26ce0da3ce8bb901632e370ab Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 7 Dec 2019 18:00:22 -0500 Subject: [PATCH] v0.8.0: Fixes: - Added a missing translation for the prompt for dart tipping - fixed a rare crash bug with disarming traps --- .../shatteredpixeldungeon/items/weapon/missiles/darts/Dart.java | 2 +- .../shatteredpixeldungeon/levels/traps/DisarmingTrap.java | 2 ++ .../shatteredpixeldungeon/messages/items/items.properties | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/Dart.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/Dart.java index 17f97bce5..545b4bab3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/Dart.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/missiles/darts/Dart.java @@ -60,7 +60,7 @@ public class Dart extends MissileWeapon { @Override public void execute(Hero hero, String action) { if (action.equals(AC_TIP)){ - GameScene.selectItem(itemSelector, WndBag.Mode.SEED, "select a seed"); + GameScene.selectItem(itemSelector, WndBag.Mode.SEED, Messages.get(this, "prompt")); } super.execute(hero, action); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/DisarmingTrap.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/DisarmingTrap.java index 159b8c7eb..dd8166b45 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/DisarmingTrap.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/traps/DisarmingTrap.java @@ -68,8 +68,10 @@ public class DisarmingTrap extends Trap{ if (weapon != null && !weapon.cursed) { int cell; + int tries = 20; do { cell = Dungeon.level.randomRespawnCell(); + if (tries-- < 0 && cell != -1) break; PathFinder.buildDistanceMap(pos, Dungeon.level.passable); } while (cell == -1 || PathFinder.distance[cell] < 10 || PathFinder.distance[cell] > 20); 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 b68f42e28..4128cd774 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 @@ -1458,6 +1458,7 @@ items.weapon.missiles.darts.chillingdart.desc=These darts are tipped with an ice items.weapon.missiles.darts.dart.name=dart items.weapon.missiles.darts.dart.ac_tip=TIP +items.weapon.missiles.darts.dart.prompt=Select a seed items.weapon.missiles.darts.dart.tip_title=Tip Darts items.weapon.missiles.darts.dart.tip_desc=A seed can be combined with one or two darts to tip them. Each type of seed produces its own type of tipped dart, with a unique single-use effect.\n\nTipping a dart with these seeds will produce a _%s._ items.weapon.missiles.darts.dart.tip_all=tip %1$d darts with %2$d seeds