From 68bdd4931c41d3885f5153797303afacc3248d8a Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Mon, 30 Nov 2020 12:52:43 -0500 Subject: [PATCH] v0.9.1: implemented the wide search talent --- .../shatteredpixeldungeon/actors/hero/Hero.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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 b746c1afa..b024b3ac9 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 @@ -103,6 +103,7 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap; +import com.shatteredpixel.shatteredpixeldungeon.mechanics.ShadowCaster; import com.shatteredpixel.shatteredpixeldungeon.messages.Languages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.plants.Earthroot; @@ -1784,7 +1785,9 @@ public class Hero extends Char { boolean smthFound = false; + boolean circular = pointsInTalent(Talent.WIDE_SEARCH) == 1; int distance = heroClass == HeroClass.ROGUE ? 2 : 1; + if (hasTalent(Talent.WIDE_SEARCH)) distance++; boolean foresight = buff(Foresight.class) != null; @@ -1814,7 +1817,11 @@ public class Hero extends Char { for (int y = ay; y <= by; y++) { for (int x = ax, p = ax + y * Dungeon.level.width(); x <= bx; x++, p++) { - + + if (circular && Math.abs(x - cx)-1 > ShadowCaster.rounding[distance][distance - Math.abs(y - cy)]){ + continue; + } + if (fieldOfView[p] && p != pos) { if (intentional) {