Skip to content
Snippets Groups Projects
Commit 80bfa153 authored by dg's avatar dg
Browse files

rogue: unseen actions

git-svn-id: http://svn.net-core.org/repos/t-engine4@288 51575b47-30f0-44d4-a5cc-537603b46e54
parent 205a544b
No related branches found
No related tags found
No related merge requests found
......@@ -353,15 +353,28 @@ function _M:postUseTalent(ab, ret)
end
-- Cancel stealth!
if ab.id ~= self.T_STEALTH and self:isTalentActive(self.T_STEALTH) then
if ab.id ~= self.T_STEALTH then self:breakStealth() end
return true
end
--- Breaks stealth if active
function _M:breakStealth()
if self:isTalentActive(self.T_STEALTH) then
local chance = 0
if self:knowTalent(self.T_UNSEEN_ACTIONS) then
chance = 10 + self:getTalentLevel(self.T_UNSEEN_ACTIONS) * 9
end
-- Do not break stealth
if rng.percent(chance) then return end
local old = self.energy.value
self.energy.value = 100000
self:useTalent(self.T_STEALTH)
self.energy.value = old
self.changed = true
end
return true
end
--- Return the full description of a talent
......
......@@ -260,6 +260,7 @@ function _M:playerUseItem(object, item)
self:useEnergy()
end
end
self:breakStealth()
end
if object and item then return use_fct(object, item) end
......
......@@ -89,13 +89,7 @@ function _M:attackTarget(target, damtype, mult, noenergy)
end
-- Cancel stealth!
if self:isTalentActive(self.T_STEALTH) then
local old = self.energy.value
self.energy.value = 100000
self:useTalent(self.T_STEALTH)
self.energy.value = old
self.changed = true
end
self:breakStealth()
return hit
end
......
......@@ -42,7 +42,7 @@ newTalent{
newTalent{
name = "Shadowstrike",
type = {"cunning/stealth", 1},
type = {"cunning/stealth", 2},
mode = "passive",
points = 5,
require = { stat = { cun=18 }, },
......@@ -51,3 +51,15 @@ newTalent{
Shadowstrikes do %.02f%% damage than a normal hit.]]):format((2 + self:getTalentLevel(t) / 5) * 100)
end,
}
newTalent{
name = "Unseen Actions",
type = {"cunning/stealth", 3},
mode = "passive",
points = 5,
require = { stat = { cun=18 }, },
info = function(self, t)
return ([[When you perform an action from stealth (attacking, using objects, ...) you have %d%% chances to not break stealth.]]):
format(10 + self:getTalentLevel(t) * 9)
end,
}
......@@ -72,12 +72,12 @@ newTalent{
local tg = {type="bolt", range=self:getTalentRange(t)}
local x, y = self:getTarget(tg)
if not x or not y then return nil end
self:project(tg, x, y, DamageType.SLIME, 20 + (self:getMag() * self:getTalentLevel(t)) * 0.3, {type="slime"})
self:project(tg, x, y, DamageType.SLIME, 20 + (self:getDex() * self:getTalentLevel(t)) * 0.3, {type="slime"})
return true
end,
info = function(self, t)
return ([[Spit slime at your target doing %0.2f nature damage and slowing it down for 3 turns.
The damage will increase with the Dexterity stat]]):format(20 + (self:getMag() * self:getTalentLevel(t)) * 0.3)
The damage will increase with the Dexterity stat]]):format(20 + (self:getDex() * self:getTalentLevel(t)) * 0.3)
end,
}
......@@ -107,7 +107,6 @@ newTalent{
end,
info = function(self, t)
return ([[You extend slimy roots into the ground, follow them and re-appear somewhere else in a range of %d.
The process is quite a strain on your body and you will be stunned for %d turns.
The damage will increase with the Dexterity stat]]):format(20 + (self:getMag() * self:getTalentLevel(t)) * 0.3, util.bound(5 - self:getTalentLevel(t) / 2, 2, 7))
The process is quite a strain on your body and you will be stunned for %d turns.]]):format(20 + (self:getMag() * self:getTalentLevel(t)) * 0.3, util.bound(5 - self:getTalentLevel(t) / 2, 2, 7))
end,
}
No preview for this file type
No preview for this file type
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