Skip to content
Snippets Groups Projects
Commit 2fa6317e authored by dg's avatar dg
Browse files

fix

git-svn-id: http://svn.net-core.org/repos/t-engine4@4645 51575b47-30f0-44d4-a5cc-537603b46e54
parent 91a38be5
No related branches found
No related tags found
No related merge requests found
......@@ -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
......
......@@ -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")
......
......@@ -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()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment