diff options
author | Jesse Luehrs <doy@tozt.net> | 2014-08-02 03:55:25 -0400 |
---|---|---|
committer | Jesse Luehrs <doy@tozt.net> | 2014-08-02 03:55:25 -0400 |
commit | 73be12ef33867c53ad9a947d256935b639ff4dcc (patch) | |
tree | 6717681b141abe06cc7fd6a41c5961792b3c7ec9 /crawl-ref/source/dat | |
parent | 087d792f95f0adb472be59fb60f1c5a190466677 (diff) | |
download | crawl-ref-73be12ef33867c53ad9a947d256935b639ff4dcc.tar.gz crawl-ref-73be12ef33867c53ad9a947d256935b639ff4dcc.zip |
webs shouldn't be considered safe during autofight
it seems to be intentional that they are considered safe during travel
and explore, but they certainly shouldn't be considered safe when you're
actively fighting monsters.
Diffstat (limited to 'crawl-ref/source/dat')
-rw-r--r-- | crawl-ref/source/dat/clua/autofight.lua | 9 | ||||
-rw-r--r-- | crawl-ref/source/dat/clua/automagic.lua | 9 |
2 files changed, 16 insertions, 2 deletions
diff --git a/crawl-ref/source/dat/clua/autofight.lua b/crawl-ref/source/dat/clua/autofight.lua index 966de6b7ae..edc28600e7 100644 --- a/crawl-ref/source/dat/clua/autofight.lua +++ b/crawl-ref/source/dat/clua/autofight.lua @@ -67,10 +67,17 @@ local function have_throwing(no_move) return (AUTOFIGHT_THROW or no_move and AUTOFIGHT_THROW_NOMOVE) and items.fired_item() ~= nil end +local function is_safe_square(dx, dy) + if view.feature_at(dx, dy) == "trap_web" then + return false + end + return view.is_safe_square(dx, dy) +end + local function try_move(dx, dy) m = monster.get_monster_at(dx, dy) -- attitude > ATT_NEUTRAL should mean you can push past the monster - if view.is_safe_square(dx, dy) and (not m or m:attitude() > ATT_NEUTRAL) then + if is_safe_square(dx, dy) and (not m or m:attitude() > ATT_NEUTRAL) then return delta_to_vi(dx, dy) else return nil diff --git a/crawl-ref/source/dat/clua/automagic.lua b/crawl-ref/source/dat/clua/automagic.lua index 962ef503e9..ca1210b322 100644 --- a/crawl-ref/source/dat/clua/automagic.lua +++ b/crawl-ref/source/dat/clua/automagic.lua @@ -53,10 +53,17 @@ local function vector_move(dx, dy) return str end +local function is_safe_square(dx, dy) + if view.feature_at(dx, dy) == "trap_web" then + return false + end + return view.is_safe_square(dx, dy) +end + local function try_move(dx, dy) m = monster.get_monster_at(dx, dy) -- attitude > ATT_NEUTRAL should mean you can push past the monster - if view.is_safe_square(dx, dy) and (not m or m:attitude() > ATT_NEUTRAL) then + if is_safe_square(dx, dy) and (not m or m:attitude() > ATT_NEUTRAL) then return delta_to_vi(dx, dy) else return nil |