From 8968beb8fa7300c6cb719413d75b53eccfb60b69 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 4 Nov 2019 15:22:28 -0500 Subject: [PATCH] v0.8.0: various bugfixes and improvements: - foresight buff now lets the hero detect Tengu's traps - fixed rare vfx/animation freezing errors with time freeze effects - direct damage/healing numbers are now included in the description of transfusion. - fixed wand of prismatic light rarely revealing areas it shouldn't --- .../actors/hero/Hero.java | 21 ++++++++++--------- .../items/artifacts/TimekeepersHourglass.java | 14 ++++++++----- .../items/wands/WandOfPrismaticLight.java | 5 ++++- .../items/wands/WandOfTransfusion.java | 9 ++++++++ .../plants/Swiftthistle.java | 14 ++++++++----- .../messages/items/items.properties | 2 +- 6 files changed, 43 insertions(+), 22 deletions(-) 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 73ea47bdc..129cde958 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 @@ -1676,23 +1676,24 @@ public class Hero extends Char { if (Dungeon.level.secret[p]){ Trap trap = Dungeon.level.traps.get( p ); - if (trap != null && !trap.canBeSearched){ - continue; - } - float chance; - //intentional searches always succeed - if (intentional){ + + //searches aided by foresight always succeed, even if trap isn't searchable + if (foresight){ + chance = 1f; + + //otherwise if the trap isn't searchable, searching always fails + } else if (trap != null && !trap.canBeSearched){ + chance = 0f; + + //intentional searches always succeed against regular traps and doors + } else if (intentional){ chance = 1f; //unintentional searches always fail with a cursed talisman } else if (cursed) { chance = 0f; - //..and always succeed when affected by foresight buff - } else if (foresight){ - chance = 1f; - //unintentional trap detection scales from 40% at floor 0 to 30% at floor 25 } else if (Dungeon.level.map[p] == Terrain.SECRET_TRAP) { chance = 0.4f - (Dungeon.depth / 250f); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java index af1a84f86..8e5517644 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/TimekeepersHourglass.java @@ -326,11 +326,15 @@ public class TimekeepersHourglass extends Artifact { @Override public boolean attachTo(Char target) { - if (Dungeon.level != null) - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) - mob.sprite.add(CharSprite.State.PARALYSED); - GameScene.freezeEmitters = true; - return super.attachTo(target); + if (super.attachTo(target)){ + if (Dungeon.level != null) + for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) + mob.sprite.add(CharSprite.State.PARALYSED); + GameScene.freezeEmitters = true; + return true; + } else { + return false; + } } @Override diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfPrismaticLight.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfPrismaticLight.java index e81d7957c..da5289e93 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfPrismaticLight.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfPrismaticLight.java @@ -107,7 +107,10 @@ public class WandOfPrismaticLight extends DamageWand { private void affectMap(Ballistica beam){ boolean noticed = false; - for (int c: beam.subPath(0, beam.dist)){ + for (int c : beam.subPath(0, beam.dist)){ + if (!Dungeon.level.insideMap(c)){ + continue; + } for (int n : PathFinder.NEIGHBOURS9){ int cell = c+n; diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java index eec0175cd..f62c13e2e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/wands/WandOfTransfusion.java @@ -169,6 +169,15 @@ public class WandOfTransfusion extends Wand { particle.radiateXY(0.5f); } + @Override + public String statsDesc() { + int selfDMG = Math.round(Dungeon.hero.HT*0.10f); + if (levelKnown) + return Messages.get(this, "stats_desc", selfDMG, selfDMG + 3*level(), 5+2*level(), 3+level()/2, 6+level()); + else + return Messages.get(this, "stats_desc", selfDMG, selfDMG, 5, 3, 6); + } + private static final String FREECHARGE = "freecharge"; @Override 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 75f6e409b..ff6dbb989 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Swiftthistle.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Swiftthistle.java @@ -123,11 +123,15 @@ public class Swiftthistle extends Plant { @Override public boolean attachTo(Char target) { - if (Dungeon.level != null) - for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) - mob.sprite.add(CharSprite.State.PARALYSED); - GameScene.freezeEmitters = true; - return super.attachTo(target); + if (super.attachTo(target)){ + if (Dungeon.level != null) + for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) + mob.sprite.add(CharSprite.State.PARALYSED); + GameScene.freezeEmitters = true; + return true; + } else { + return false; + } } @Override 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 2ac1020a4..b68f42e28 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 @@ -1215,7 +1215,7 @@ items.wands.wandoftransfusion.staff_name=staff of transfusion items.wands.wandoftransfusion.ondeath=You killed yourself with your own Wand of Transfusion... items.wands.wandoftransfusion.charged=Your staff is charged with the life energy of your enemy! items.wands.wandoftransfusion.desc=A fairly plainly shaped wand, it stands out due to its magenta hue and pitch black gem at the tip. -items.wands.wandoftransfusion.stats_desc=When used on allies, this wand saps some of your own health to heal or shield them. When used on enemies, the wand briefly charms them while pulling a bit of energy back to you. Hostile undead will be damaged instead of charmed. +items.wands.wandoftransfusion.stats_desc=When used on allies, this wand will sap _%1$d of the user's health_ to heal or shield the ally for _%2$d health._ When used on enemies, the wand briefly charms them while applying _%3$d shielding_ to the user. Hostile undead will take _%4$d-%5$d damage_ instead of being charmed. items.wands.wandofwarding.name=wand of warding items.wands.wandofwarding.staff_name=staff of warding