diff --git a/game/modules/tome/class/interface/Combat.lua b/game/modules/tome/class/interface/Combat.lua index daf8824059f575469ae390bb1448a9f0c5055f4c..308866b9d6ef4dd7bff93c0058d155bf4e20f050 100644 --- a/game/modules/tome/class/interface/Combat.lua +++ b/game/modules/tome/class/interface/Combat.lua @@ -114,6 +114,7 @@ function _M:attackTarget(target, damtype, mult, noenergy) if self:isTalentActive(self.T_GESTURE_OF_PAIN) then print("[ATTACK] attacking with Gesture of Pain") local t = self:getTalentFromId(self.T_GESTURE_OF_PAIN) + if not t.preAttack(self, t, target) then return false end speed, hit = t.attack(self, t, target) break_stealth = true end @@ -1286,6 +1287,7 @@ function _M:getFreeHands() local weapon = self:getInven("MAINHAND")[1] local offweapon = self:getInven("OFFHAND")[1] if weapon and offweapon then return 0 end + if weapon and weapon.twohanded then return 0 end if weapon or offweapon then return 1 end return 2 end diff --git a/game/modules/tome/class/interface/PlayerExplore.lua b/game/modules/tome/class/interface/PlayerExplore.lua index 910dd93ce80d6d3ba7b82424ff216763f98cad1b..b48e918793bb7f09d5e9bcc38f06d5c78558cdb2 100644 --- a/game/modules/tome/class/interface/PlayerExplore.lua +++ b/game/modules/tome/class/interface/PlayerExplore.lua @@ -135,12 +135,12 @@ local adjacentTiles = { --Dir 5 (all adjacent, slow) function(node, cardinal_tiles, diagonal_tiles) local x, y, c, val = node[1], node[2], node[3], node[4]+1 - + local left_okay = x > 0 local right_okay = x < game.level.map.w - 1 local lower_okay = y > 0 local upper_okay = y < game.level.map.h - 1 - + if upper_okay then cardinal_tiles[#cardinal_tiles+1] = {x, y + 1, c + game.level.map.w, val, 2 } end if left_okay then cardinal_tiles[#cardinal_tiles+1] = {x - 1, y, c - 1, val, 4 } end if right_okay then cardinal_tiles[#cardinal_tiles+1] = {x + 1, y, c + 1, val, 6 } end @@ -511,16 +511,17 @@ function _M:autoExplore() min_diagonal = values[node[3]] end end + local plus_one = 0 if min_cardinal > min_diagonal then for _, node in ipairs(listAdjacentTiles(c, false, true)) do if values[node[3]] then add_values[node[3]] = values[node[3]] + 1 - door_values[c] = door_val + 1 + plus_one = 1 end end end - local dist = core.fov.distance(self.x, self.y, x, y, true) + 10*door_values[c] + local dist = core.fov.distance(self.x, self.y, x, y, true) + 10*(door_values[c] + plus_one) distances[c] = dist if dist < mindist then mindist = dist @@ -738,7 +739,7 @@ function _M:autoExplore() } self.running.dialog.__showup = nil self.running.dialog.__hidden = true - + self:runStep() end return true @@ -788,7 +789,7 @@ function _M:checkAutoExplore() if terrain.notice then self:runStop("interesting terrain") return false - elseif self.running.explore == "unseen" then + elseif self.running.explore == "unseen" then return self:autoExplore() else self:runStop("the path is blocked") diff --git a/game/modules/tome/data/talents/cursed/gestures.lua b/game/modules/tome/data/talents/cursed/gestures.lua index 8350e6879c1f1d484293f6bc50761ee0c8586477..e9d000d65b5a670420874e52fd5fc8538e5eea95 100644 --- a/game/modules/tome/data/talents/cursed/gestures.lua +++ b/game/modules/tome/data/talents/cursed/gestures.lua @@ -24,7 +24,6 @@ newTalent{ require = cursed_cun_req1, points = 5, random_ego = "attack", - proj_speed = 4, tactical = { ATTACK = 2 }, getBaseDamage = function(self, t) return self:combatTalentMindDamage(t, 0, 125) @@ -32,12 +31,20 @@ newTalent{ getSecondAttackChance = function(self, t) return 20 end, - attack = function(self, t, target) - if self.hate < 0.1 then return true end - - local freeHands = self:getFreeHands() - if freeHands == 0 then return true end + preAttack = function(self, t, target) + if self.hate < 0.1 then + game.logPlayer(self, "You do not have enough hate to use Gesture of Pain.") + return false + end + if self:getFreeHands() == 0 then + game.logPlayer(self, "You do not have a free hand to use Gesture of Pain.") + return false + end + return true + end, + attack = function(self, t, target) + local freeHands = self:getFreeHands() local hit = false local mindpower = self:combatMindpower()