v0.9.1: implemented the wide search talent

This commit is contained in:
Evan Debenham 2020-11-30 12:52:43 -05:00
parent 1182a13cef
commit 68bdd4931c

View File

@ -103,6 +103,7 @@ import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm; import com.shatteredpixel.shatteredpixeldungeon.levels.features.Chasm;
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap; import com.shatteredpixel.shatteredpixeldungeon.levels.traps.Trap;
import com.shatteredpixel.shatteredpixeldungeon.mechanics.ShadowCaster;
import com.shatteredpixel.shatteredpixeldungeon.messages.Languages; import com.shatteredpixel.shatteredpixeldungeon.messages.Languages;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.plants.Earthroot; import com.shatteredpixel.shatteredpixeldungeon.plants.Earthroot;
@ -1784,7 +1785,9 @@ public class Hero extends Char {
boolean smthFound = false; boolean smthFound = false;
boolean circular = pointsInTalent(Talent.WIDE_SEARCH) == 1;
int distance = heroClass == HeroClass.ROGUE ? 2 : 1; int distance = heroClass == HeroClass.ROGUE ? 2 : 1;
if (hasTalent(Talent.WIDE_SEARCH)) distance++;
boolean foresight = buff(Foresight.class) != null; boolean foresight = buff(Foresight.class) != null;
@ -1814,7 +1817,11 @@ public class Hero extends Char {
for (int y = ay; y <= by; y++) { for (int y = ay; y <= by; y++) {
for (int x = ax, p = ax + y * Dungeon.level.width(); x <= bx; x++, p++) { 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 (fieldOfView[p] && p != pos) {
if (intentional) { if (intentional) {